gaugeit.js 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CONTRIBUTING.md +36 -0
- package/LICENSE +21 -0
- package/NOTICE.md +5 -0
- package/README.md +894 -0
- package/SECURITY.md +24 -0
- package/adapters/react/Gaugeit.d.ts +11 -0
- package/adapters/react/Gaugeit.js +66 -0
- package/adapters/react/Gaugeit.jsx +1 -0
- package/dist/gaugeit.cjs +4686 -0
- package/dist/gaugeit.cjs.map +7 -0
- package/dist/gaugeit.css +300 -0
- package/dist/gaugeit.d.ts +442 -0
- package/dist/gaugeit.esm.js +4683 -0
- package/dist/gaugeit.esm.js.map +7 -0
- package/dist/gaugeit.esm.min.js +2 -0
- package/dist/gaugeit.esm.min.js.map +7 -0
- package/dist/gaugeit.min.cjs +2 -0
- package/dist/gaugeit.min.cjs.map +7 -0
- package/dist/gaugeit.min.css +1 -0
- package/dist/gaugeit.standalone.js +4720 -0
- package/dist/gaugeit.standalone.js.map +7 -0
- package/dist/gaugeit.standalone.min.js +302 -0
- package/dist/gaugeit.standalone.min.js.map +7 -0
- package/dist/gaugeit.umd.js +4713 -0
- package/dist/gaugeit.umd.js.map +7 -0
- package/dist/gaugeit.umd.min.js +4 -0
- package/dist/gaugeit.umd.min.js.map +7 -0
- package/dist/manifest.json +24 -0
- package/docs/api.md +456 -0
- package/docs/architecture.md +224 -0
- package/docs/assets/arc_zones.png +0 -0
- package/docs/assets/center_zero.png +0 -0
- package/docs/assets/classic_instrument.png +0 -0
- package/docs/assets/classic_linear_center_zero.png +0 -0
- package/docs/assets/classic_linear_instrument.png +0 -0
- package/docs/assets/heritage_rolling_tape.png +0 -0
- package/docs/assets/heritage_round.png +0 -0
- package/docs/assets/line_scale.png +0 -0
- package/docs/assets/rose_balance.png +0 -0
- package/docs/creating-gauge-types.md +286 -0
- package/docs/development.md +56 -0
- package/docs/framework-integration.md +84 -0
- package/package.json +114 -0
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
/*! Gaugeit.js v0.1.0 | MIT License | https://github.com/kasperikoski/gaugeit.js#readme */
|
|
2
|
+
var Gaugeit=(()=>{var Be=Object.defineProperty;var ci=Object.getOwnPropertyDescriptor;var ui=Object.getOwnPropertyNames;var hi=Object.prototype.hasOwnProperty;var fi=(e,t)=>{for(var i in t)Be(e,i,{get:t[i],enumerable:!0})},di=(e,t,i,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of ui(t))!hi.call(e,n)&&n!==i&&Be(e,n,{get:()=>t[n],enumerable:!(r=ci(t,n))||r.enumerable});return e};var gi=e=>di(Be({},"__esModule",{value:!0}),e);var Zr={};fi(Zr,{Gauge:()=>re,GaugeTypeRegistry:()=>ge,VERSION:()=>ni,autoMount:()=>Qt,createGauge:()=>yt,deepMerge:()=>D,default:()=>Hr,defineGaugeitElement:()=>ei,easingNames:()=>Ke,gaugeTypeRegistry:()=>ne,geometry:()=>ii,getMountedGauge:()=>mt,layers:()=>ti,registerGaugeType:()=>Kt,types:()=>ri,unmountGauge:()=>pt});var vt=`/* Gaugeit.js baseline styles. Visual geometry is rendered by SVG; CSS only handles layout and integration. */
|
|
3
|
+
.gaugeit-host {
|
|
4
|
+
display: block;
|
|
5
|
+
min-width: 0;
|
|
6
|
+
width: var(--gaugeit-width, auto);
|
|
7
|
+
height: var(--gaugeit-height, auto);
|
|
8
|
+
aspect-ratio: var(--gaugeit-aspect-ratio, auto);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.gaugeit {
|
|
12
|
+
display: block;
|
|
13
|
+
width: 100%;
|
|
14
|
+
min-width: 0;
|
|
15
|
+
color: var(--gaugeit-text-color, inherit);
|
|
16
|
+
font-family: var(--gaugeit-font-family, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);
|
|
17
|
+
contain: layout style;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.gaugeit__svg {
|
|
21
|
+
display: block;
|
|
22
|
+
width: 100%;
|
|
23
|
+
max-width: 100%;
|
|
24
|
+
height: auto;
|
|
25
|
+
overflow: hidden;
|
|
26
|
+
user-select: none;
|
|
27
|
+
-webkit-user-select: none;
|
|
28
|
+
touch-action: pan-y;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.gaugeit__pointer-rotating,
|
|
32
|
+
.gaugeit__linear-indicator-moving,
|
|
33
|
+
.gaugeit__tape-slot {
|
|
34
|
+
will-change: transform;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.gaugeit__pointer,
|
|
38
|
+
.gaugeit__pointer-cap,
|
|
39
|
+
.gaugeit__linear-indicator,
|
|
40
|
+
.gaugeit__linear-indicator-cap,
|
|
41
|
+
.gaugeit__tape-window,
|
|
42
|
+
.gaugeit__tape-window-inner,
|
|
43
|
+
.gaugeit__tape-indicator,
|
|
44
|
+
.gaugeit__zero-marker,
|
|
45
|
+
.gaugeit__ticks,
|
|
46
|
+
.gaugeit__zone,
|
|
47
|
+
.gaugeit__track {
|
|
48
|
+
shape-rendering: geometricPrecision;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.gaugeit__label,
|
|
52
|
+
.gaugeit__readout,
|
|
53
|
+
.gaugeit__tape-label {
|
|
54
|
+
paint-order: stroke fill;
|
|
55
|
+
font-variant-numeric: tabular-nums;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
gauge-it {
|
|
59
|
+
display: block;
|
|
60
|
+
min-width: 0;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.gaugeit-element__mount {
|
|
64
|
+
display: block;
|
|
65
|
+
width: 100%;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
@media (prefers-reduced-motion: reduce) {
|
|
69
|
+
.gaugeit__pointer-rotating,
|
|
70
|
+
.gaugeit__linear-indicator-moving,
|
|
71
|
+
.gaugeit__tape-slot {
|
|
72
|
+
will-change: auto;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
@media (forced-colors: active) {
|
|
77
|
+
.gaugeit__pointer,
|
|
78
|
+
.gaugeit__pointer-cap,
|
|
79
|
+
.gaugeit__linear-indicator,
|
|
80
|
+
.gaugeit__linear-indicator-cap,
|
|
81
|
+
.gaugeit__tape-window,
|
|
82
|
+
.gaugeit__tape-window-inner,
|
|
83
|
+
.gaugeit__tape-indicator,
|
|
84
|
+
.gaugeit__zero-marker,
|
|
85
|
+
.gaugeit__ticks,
|
|
86
|
+
.gaugeit__label,
|
|
87
|
+
.gaugeit__readout,
|
|
88
|
+
.gaugeit__light {
|
|
89
|
+
forced-color-adjust: auto;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/* Intrinsic mode grows with the computed SVG viewBox; contain mode fits a fixed host box. */
|
|
94
|
+
.gaugeit--layout-intrinsic {
|
|
95
|
+
height: auto;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.gaugeit--layout-contain {
|
|
99
|
+
width: 100%;
|
|
100
|
+
height: 100%;
|
|
101
|
+
min-height: 0;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.gaugeit--layout-contain .gaugeit__svg {
|
|
105
|
+
width: 100%;
|
|
106
|
+
height: 100%;
|
|
107
|
+
max-height: 100%;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/* Shared SVG annunciator lamp. Colors are themeable through CSS variables or light.customColor. */
|
|
111
|
+
.gaugeit__light {
|
|
112
|
+
--gaugeit-light-core: #f59e0b;
|
|
113
|
+
--gaugeit-light-highlight: #fde68a;
|
|
114
|
+
--gaugeit-light-glow: #fbbf24;
|
|
115
|
+
--gaugeit-light-rim: #92400e;
|
|
116
|
+
--gaugeit-light-off: #3f2d12;
|
|
117
|
+
--gaugeit-light-opacity: 1;
|
|
118
|
+
pointer-events: none;
|
|
119
|
+
opacity: var(--gaugeit-light-opacity);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.gaugeit__light--red {
|
|
123
|
+
--gaugeit-light-core: #ef4444;
|
|
124
|
+
--gaugeit-light-highlight: #fecaca;
|
|
125
|
+
--gaugeit-light-glow: #f87171;
|
|
126
|
+
--gaugeit-light-rim: #7f1d1d;
|
|
127
|
+
--gaugeit-light-off: #3f1c1c;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.gaugeit__light--green {
|
|
131
|
+
--gaugeit-light-core: #22c55e;
|
|
132
|
+
--gaugeit-light-highlight: #bbf7d0;
|
|
133
|
+
--gaugeit-light-glow: #4ade80;
|
|
134
|
+
--gaugeit-light-rim: #14532d;
|
|
135
|
+
--gaugeit-light-off: #182c1e;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.gaugeit__light--blue {
|
|
139
|
+
--gaugeit-light-core: #3b82f6;
|
|
140
|
+
--gaugeit-light-highlight: #bfdbfe;
|
|
141
|
+
--gaugeit-light-glow: #60a5fa;
|
|
142
|
+
--gaugeit-light-rim: #1e3a8a;
|
|
143
|
+
--gaugeit-light-off: #1b2438;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.gaugeit__light--amber {
|
|
147
|
+
--gaugeit-light-core: #f59e0b;
|
|
148
|
+
--gaugeit-light-highlight: #fde68a;
|
|
149
|
+
--gaugeit-light-glow: #fbbf24;
|
|
150
|
+
--gaugeit-light-rim: #92400e;
|
|
151
|
+
--gaugeit-light-off: #3f2d12;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.gaugeit__light--yellow {
|
|
155
|
+
--gaugeit-light-core: #fde047;
|
|
156
|
+
--gaugeit-light-highlight: #fef9c3;
|
|
157
|
+
--gaugeit-light-glow: #facc15;
|
|
158
|
+
--gaugeit-light-rim: #a16207;
|
|
159
|
+
--gaugeit-light-off: #443a16;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.gaugeit__light--orange {
|
|
163
|
+
--gaugeit-light-core: #f97316;
|
|
164
|
+
--gaugeit-light-highlight: #fed7aa;
|
|
165
|
+
--gaugeit-light-glow: #fb923c;
|
|
166
|
+
--gaugeit-light-rim: #9a3412;
|
|
167
|
+
--gaugeit-light-off: #462515;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.gaugeit__light--white {
|
|
171
|
+
--gaugeit-light-core: #f8fafc;
|
|
172
|
+
--gaugeit-light-highlight: #ffffff;
|
|
173
|
+
--gaugeit-light-glow: #e2e8f0;
|
|
174
|
+
--gaugeit-light-rim: #64748b;
|
|
175
|
+
--gaugeit-light-off: #3f4955;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
.gaugeit__light--halogen {
|
|
179
|
+
--gaugeit-light-core: #fff2bf;
|
|
180
|
+
--gaugeit-light-highlight: #fffdf0;
|
|
181
|
+
--gaugeit-light-glow: #ffe79a;
|
|
182
|
+
--gaugeit-light-rim: #9a7b24;
|
|
183
|
+
--gaugeit-light-off: #4d4326;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.gaugeit__light--cyan {
|
|
187
|
+
--gaugeit-light-core: #22d3ee;
|
|
188
|
+
--gaugeit-light-highlight: #cffafe;
|
|
189
|
+
--gaugeit-light-glow: #67e8f9;
|
|
190
|
+
--gaugeit-light-rim: #155e75;
|
|
191
|
+
--gaugeit-light-off: #18343a;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
.gaugeit__light--brown {
|
|
195
|
+
--gaugeit-light-core: #a16207;
|
|
196
|
+
--gaugeit-light-highlight: #f5d0a1;
|
|
197
|
+
--gaugeit-light-glow: #d6a56b;
|
|
198
|
+
--gaugeit-light-rim: #5b3b10;
|
|
199
|
+
--gaugeit-light-off: #332617;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.gaugeit__light-emission {
|
|
203
|
+
pointer-events: none;
|
|
204
|
+
transition: opacity 150ms ease;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
.gaugeit__light-emission--off {
|
|
208
|
+
opacity: var(--gaugeit-light-opacity, 1);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
.gaugeit__light-emission--on {
|
|
212
|
+
opacity: 0;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
.gaugeit__light-glow {
|
|
216
|
+
opacity: 0.76;
|
|
217
|
+
transform-box: fill-box;
|
|
218
|
+
transform-origin: center;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
.gaugeit__light:not(.has-glow) .gaugeit__light-glow {
|
|
222
|
+
display: none;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
.gaugeit__light-bezel,
|
|
226
|
+
.gaugeit__light-bezel-highlight,
|
|
227
|
+
.gaugeit__light-bulb,
|
|
228
|
+
.gaugeit__light-lens-shade,
|
|
229
|
+
.gaugeit__light-sparkle {
|
|
230
|
+
shape-rendering: geometricPrecision;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
.gaugeit__light-bulb {
|
|
234
|
+
transform-box: fill-box;
|
|
235
|
+
transform-origin: center;
|
|
236
|
+
transition: filter 150ms ease;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
.gaugeit__light.is-on:not(.is-blinking) .gaugeit__light-emission--off {
|
|
240
|
+
opacity: 0;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
.gaugeit__light.is-on:not(.is-blinking) .gaugeit__light-emission--on {
|
|
244
|
+
opacity: var(--gaugeit-light-opacity, 1);
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
.gaugeit__light.is-on .gaugeit__light-bulb--on {
|
|
248
|
+
filter: saturate(1.08) brightness(1.05);
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
.gaugeit__light.is-pulsing .gaugeit__light-glow {
|
|
252
|
+
animation: gaugeit-light-pulse-glow var(--gaugeit-light-pulse-duration, 2600ms) ease-in-out infinite;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
.gaugeit__light.is-pulsing .gaugeit__light-bulb--on {
|
|
256
|
+
animation: gaugeit-light-pulse-lens var(--gaugeit-light-pulse-duration, 2600ms) ease-in-out infinite;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
.gaugeit__light.is-on.is-blinking .gaugeit__light-emission--on {
|
|
260
|
+
animation: gaugeit-light-blink-on var(--gaugeit-light-blink-duration, 1000ms) step-end infinite;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
.gaugeit__light.is-on.is-blinking .gaugeit__light-emission--off {
|
|
264
|
+
animation: gaugeit-light-blink-off var(--gaugeit-light-blink-duration, 1000ms) step-end infinite;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
@keyframes gaugeit-light-pulse-glow {
|
|
268
|
+
0%, 100% { opacity: 0.72; transform: scale(0.99); }
|
|
269
|
+
50% { opacity: 0.8; transform: scale(1.015); }
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
@keyframes gaugeit-light-pulse-lens {
|
|
273
|
+
0%, 100% { filter: saturate(1.06) brightness(1.04); }
|
|
274
|
+
50% { filter: saturate(1.1) brightness(1.07); }
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
@keyframes gaugeit-light-blink-on {
|
|
278
|
+
0%, 48% { opacity: var(--gaugeit-light-opacity, 1); }
|
|
279
|
+
49%, 100% { opacity: 0; }
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
@keyframes gaugeit-light-blink-off {
|
|
283
|
+
0%, 48% { opacity: 0; }
|
|
284
|
+
49%, 100% { opacity: var(--gaugeit-light-opacity, 1); }
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
@media (prefers-reduced-motion: reduce) {
|
|
288
|
+
.gaugeit__light.is-blinking .gaugeit__light-emission,
|
|
289
|
+
.gaugeit__light.is-pulsing .gaugeit__light-glow,
|
|
290
|
+
.gaugeit__light.is-pulsing .gaugeit__light-bulb--on {
|
|
291
|
+
animation: none;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
.gaugeit__light.is-on.is-blinking .gaugeit__light-emission--off {
|
|
295
|
+
opacity: 0;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
.gaugeit__light.is-on.is-blinking .gaugeit__light-emission--on {
|
|
299
|
+
opacity: var(--gaugeit-light-opacity, 1);
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
`;function v(e){if(e===null||typeof e!="object"||Object.prototype.toString.call(e)!=="[object Object]")return!1;let t=Object.getPrototypeOf(e);if(t===null||t===Object.prototype)return!0;let i=Object.prototype.hasOwnProperty.call(t,"constructor")?t.constructor:null;return typeof i=="function"&&i.name==="Object"}function D(e,t){if(!v(e))return U(t);let i={...e};if(!v(t))return i;for(let[r,n]of Object.entries(t))kt(r)||(v(n)&&v(i[r])?i[r]=D(i[r],n):i[r]=U(n));return i}function U(e){if(Array.isArray(e))return e.map(U);if(v(e)){let t={};for(let[i,r]of Object.entries(e))kt(i)||(t[i]=U(r));return t}return e}function kt(e){return e==="__proto__"||e==="prototype"||e==="constructor"}function T(e,t,i){return Math.min(i,Math.max(t,e))}function l(e,t){let i=Number(e);return Number.isFinite(i)?i:t}var wt=0;function Mt(e="gaugeit"){return wt+=1,`${e}-${wt}`}function St(e){if(typeof e=="string"){let t=document.querySelector(e);if(!t)throw new Error(`Gaugeit target not found: ${e}`);return t}if(e&&typeof e=="object"&&e.nodeType===1)return e;throw new TypeError("Gaugeit target must be an Element or a valid CSS selector.")}function I(e){if(e==null)return!0;let t=String(e).trim().toLowerCase();return t===""||t==="transparent"||t==="none"}function Lt(e){return typeof requestAnimationFrame=="function"?requestAnimationFrame(e):setTimeout(()=>e(Date.now()),16)}function Le(e){if(e!=null){if(typeof cancelAnimationFrame=="function"){cancelAnimationFrame(e);return}clearTimeout(e)}}function X(e,t,i){!e||typeof e.dispatchEvent!="function"||typeof CustomEvent!="function"||e.dispatchEvent(new CustomEvent(`gaugeit:${t}`,{detail:i}))}function Oe(e,t={}){if(typeof e!="string"||e.trim()==="")return t;try{let i=JSON.parse(e);return v(i)?i:t}catch(i){return t}}function pi(e){return e*Math.PI/180}function b(e,t,i,r){let n=pi(r);return{x:e+i*Math.cos(n),y:t+i*Math.sin(n)}}function ae(e){return e.geometry.endAngle-e.geometry.startAngle}function Ot(e,t=0){let i=Math.min(360,Math.max(.001,Math.abs(l(e,180)))),r=270+l(t,0),n=i/2;return{startAngle:r-n,endAngle:r+n}}function L(e,t,i=!0){let r=t.min,n=t.max,a=((i?T(e,r,n):e)-r)/(n-r),s=t.invert?1-a:a;return t.geometry.startAngle+ae(t)*s}function At(e,t,i=!0){let r=ae(t),n=(e-t.geometry.startAngle)/r,o=t.invert?1-n:n,a=t.min+o*(t.max-t.min);return i?T(a,t.min,t.max):a}function Ae(e,t,i,r,n){let o=b(e,t,i,r),a=b(e,t,i,n),s=n-r,c=s>=0?1:0;if(Math.abs(s)>=360-.001){let f=b(e,t,i,r+s/2);return[`M ${x(o.x)} ${x(o.y)}`,`A ${x(i)} ${x(i)} 0 1 ${c} ${x(f.x)} ${x(f.y)}`,`A ${x(i)} ${x(i)} 0 1 ${c} ${x(a.x)} ${x(a.y)}`].join(" ")}let u=Math.abs(s)>180?1:0;return[`M ${x(o.x)} ${x(o.y)}`,`A ${x(i)} ${x(i)} 0 ${u} ${c} ${x(a.x)} ${x(a.y)}`].join(" ")}function Ce(e,t,i,r,n,o,a,s=48){let c=n-r,u=Math.max(2,Math.min(256,Math.ceil(l(s,48)))),f=Math.max(0,l(i,0)),g=Math.max(0,l(o,0)),m=Math.max(0,l(a,g)),d=[],p=[];for(let y=0;y<=u;y+=1){let w=y/u,F=r+c*w,O=g+(m-g)*w;d.push(b(e,t,f+O/2,F)),p.push(b(e,t,Math.max(0,f-O/2),F))}let _=[`M ${x(d[0].x)} ${x(d[0].y)}`];for(let y=1;y<d.length;y+=1)_.push(`L ${x(d[y].x)} ${x(d[y].y)}`);for(let y=p.length-1;y>=0;y-=1)_.push(`L ${x(p[y].x)} ${x(p[y].y)}`);return _.push("Z"),_.join(" ")}function oe(e,t=5){let r=(Math.abs(l(e,1))||1)/Math.max(1,t),n=Math.floor(Math.log10(r)),o=r/Math.pow(10,n),a;return o<=1?a=1:o<=2?a=2:o<=2.5?a=2.5:o<=5?a=5:a=10,a*Math.pow(10,n)}function $(e,t,i){let r=Math.abs(l(i,0));if(r<=0||t<=e)return[e,t];let n=Math.min(12,Math.max(0,xi(r)+2)),o=r/1e6,a=[],s=e,c=0;for(;s<=t+o&&c<1e4;)a.push(yi(s,n)),s+=r,c+=1;return a.length===0||Math.abs(a[a.length-1]-t)>o?a.push(t):a[a.length-1]=t,a}function se(e,t){let i=Math.max(0,Math.floor(l(t,0)));if(i===0||e.length<2)return[];let r=[];for(let n=0;n<e.length-1;n+=1){let o=e[n],s=(e[n+1]-o)/(i+1);for(let c=1;c<=i;c+=1)r.push(o+s*c)}return r}function le(e,t,i){let r=Array.isArray(i)?i.filter(s=>s&&typeof s=="object").map((s,c)=>({...s,min:T(l(s.min,e),e,t),max:T(l(s.max,t),e,t),_index:c})).filter(s=>s.max>s.min):[],n=new Set([e,t]);for(let s of r)n.add(s.min),n.add(s.max);let o=[...n].sort((s,c)=>s-c),a=[];for(let s=0;s<o.length-1;s+=1){let c=o[s],u=o[s+1],f=(c+u)/2,g=r.filter(d=>f>=d.min&&f<=d.max),m=g.length?g[g.length-1]:null;a.push({min:c,max:u,zone:m})}return a}function q(e,t){if(!Array.isArray(t))return null;let i=null;for(let r of t)!r||typeof r!="object"||e>=Number(r.min)&&e<=Number(r.max)&&(i=r);return i}function x(e){return Math.round(e*1e3)/1e3}function yi(e,t){let i=Math.pow(10,t);return Math.round(e*i)/i}function xi(e){let t=String(e).toLowerCase();if(t.includes("e-"))return Number(t.split("e-")[1]);let i=t.split(".")[1];return i?i.length:0}function J(e,t){let i=t.linear||{};return l(i.originY,140)-l(e,0)}function k(e){let t=e.linear||{},i=l(t.startX,36),r=J(t.startY,e),n=l(t.endX,284),o=J(t.endY,e),a=n-i,s=o-r,c=Math.hypot(a,s);c<.001&&(n=i+1,o=r,a=1,s=0,c=1);let u=a/c,f=s/c;return{startX:i,startY:r,endX:n,endY:o,dx:a,dy:s,length:c,tangentX:u,tangentY:f,normalX:-f,normalY:u,angle:Math.atan2(s,a)*180/Math.PI}}function He(e,t,i=!0){let n=((i?T(e,t.min,t.max):e)-t.min)/(t.max-t.min);return t.invert?1-n:n}function M(e,t,i=!0){let r=k(t),n=He(e,t,i);return{x:r.startX+r.dx*n,y:r.startY+r.dy*n}}function Ct(e,t,i,r=!0){let n=k(i),o=l(e,n.startX)-n.startX,a=l(t,n.startY)-n.startY,s=(o*n.tangentX+a*n.tangentY)/n.length,c=r?T(s,0,1):s,u=i.invert?1-c:c,f=i.min+u*(i.max-i.min);return r?T(f,i.min,i.max):f}function S(e,t,i){let r=l(i,0);return{x:e.x+t.normalX*r,y:e.y+t.normalY*r}}function V(e){return-l(e,0)}function ce(e){return V(e==null?void 0:e.centerOffset)}function j(e,t="cross",i=0){let r=Math.max(0,l(e,0)),n=l(i,0);return t==="negative"?{start:n-r,end:n}:t==="positive"?{start:n,end:n+r}:{start:n-r/2,end:n+r/2}}function ue(e){let t=e.tape||{};return{x:l(t.x,64),y:l(t.y,58),width:Math.max(20,l(t.width,192)),height:Math.max(20,l(t.height,210))}}function ye(e){var i,r,n;let t=l((i=e.tape)==null?void 0:i.interval,0);return t>0?t:oe(e.max-e.min,Math.max(2,((n=(r=e.scale)==null?void 0:r.major)==null?void 0:n.divisions)||5))}function xe(e){var i;let t=Math.max(0,Math.floor(l((i=e.tape)==null?void 0:i.minorSubdivisions,4)));return ye(e)/(t+1)}function _e(e){var i,r;let t=Math.max(0,Math.floor(l((i=e.tape)==null?void 0:i.minorSubdivisions,4)));return Math.max(2,l((r=e.tape)==null?void 0:r.majorSpacing,54))/(t+1)}function ze(e,t,i){let r=xe(i),n=_e(i),o=i.invert?-1:1;return(Number(e)-Number(t))/r*n*o}function he(e,t){return{x:l(e==null?void 0:e.x,t.geometry.width/2),y:t.geometry.mode==="linear"?J(e==null?void 0:e.y,t):l(e==null?void 0:e.y,t.geometry.height/2)}}function Ve(e,t){if(!(e!=null&&e.visible))return!1;let i=e.trigger||{},r=l(t,0);switch(i.mode){case"below":return r<=l(i.value,0);case"above":return r>=l(i.value,0);case"between":{let n=l(i.min,0),o=l(i.max,n);return r>=Math.min(n,o)&&r<=Math.max(n,o)}default:return e.on===!0}}var fe=.001;function $t(e=1/0,t=1/0,i=-1/0,r=-1/0){return Number.isFinite(e)&&Number.isFinite(t)&&Number.isFinite(i)&&Number.isFinite(r)?{x:e,y:t,width:i,height:r}:{minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function te(e,t,i){return!Number.isFinite(t)||!Number.isFinite(i)||(e.minX=Math.min(e.minX,t),e.minY=Math.min(e.minY,i),e.maxX=Math.max(e.maxX,t),e.maxY=Math.max(e.maxY,i)),e}function E(e,t,i,r,n){return te(e,t,i),te(e,t+Math.max(0,r),i+Math.max(0,n)),e}function Ze(e,t={x:0,y:0,width:1,height:1}){return!e||!Number.isFinite(e.minX)||!Number.isFinite(e.minY)||!Number.isFinite(e.maxX)||!Number.isFinite(e.maxY)?{...t}:{x:e.minX,y:e.minY,width:Math.max(1,e.maxX-e.minX),height:Math.max(1,e.maxY-e.minY)}}function be(e,t=0){let i=Math.max(0,l(t,0));return{x:e.x-i,y:e.y-i,width:Math.max(1,e.width+i*2),height:Math.max(1,e.height+i*2)}}function Ie(...e){let t=$t();for(let i of e)i&&E(t,i.x,i.y,i.width,i.height);return Ze(t)}function Ue(e){return Math.abs(ae(e))>=360-fe}function ie(e,t){var r;let i=((r=t.scale)==null?void 0:r.endpointMode)||"auto";return e.length<2||i==="both"?e:i==="dedupe"||i==="auto"&&Ue(t)?e.slice(0,-1):e}function ve(e,t){let i=Vi(t),r=Math.max(1,l(e.fontSize,12)),n=Math.max(0,l(e.margin,12)),o=e.position||"top",a=e.x==="auto",s=e.y==="auto",c=a?i.x+i.width/2:l(e.x,i.x+i.width/2),u;return s?o==="bottom"?u=i.y+i.height-n-r/2:o==="center"?u=i.y+i.height/2:u=i.y+n+r/2:t.geometry.mode==="linear"?u=J(e.y,t):u=l(e.y,i.y+n+r/2),{x:c+(a?l(e.offsetX,0):0),y:u+(s?l(e.offsetY,0):0)}}function we(e,t=null){var d,p;let i=e.face,r=e.geometry;if(i.fit!=="content"||!t)return{x:i.x,y:i.y,width:i.width,height:i.height};let n=Math.max(0,l(i.contentPadding,8)),o={x:i.x,y:i.y,width:i.width,height:i.height},a=(d=i.minWidth)!=null?d:o.width,s=(p=i.minHeight)!=null?p:o.height;if(i.shape==="circle"){let _=r.centerX,y=r.centerY,w=Math.min(a,s)/2,F=Math.max(_-t.x,t.x+t.width-_,y-t.y,t.y+t.height-y)+n,O=Math.max(1,w,F);return{x:_-O,y:y-O,width:O*2,height:O*2}}let c={x:t.x-n,y:t.y-n,width:t.width+n*2,height:t.height+n*2},u=Math.max(r.centerX-c.x,c.x+c.width-r.centerX),f=Math.max(1,a,u*2),g=Math.max(1,s,c.height),m=c.y+c.height/2;return{x:r.centerX-f/2,y:m-g/2,width:f,height:g}}function ke(e,t={}){var s;let i=t.includeFace!==!1,r=t.includeBase===void 0?((s=e.layout)==null?void 0:s.includeGeometry)!==!1:t.includeBase===!0,n=t.contentBounds||null,o=e.geometry,a=$t();if(r&&E(a,0,0,o.width,o.height),i&&e.face.visible){let c=we(e,n),u=e.face.shadow?10:Math.max(0,e.face.strokeWidth/2);if(E(a,c.x-u,c.y-u,c.width+u*2,c.height+u*2),e.face.clipContent)return Ze(a,{x:0,y:0,width:o.width,height:o.height})}return o.mode==="linear"?(Mi(a,e),Si(a,e),Li(a,e),Oi(a,e),zt(a,e)):o.mode==="tape"?Ai(a,e):(_i(a,e),vi(a,e),wi(a,e),zt(a,e),ki(a,e)),zi(a,e),Ci(a,e),Ze(a,{x:0,y:0,width:o.width,height:o.height})}function _i(e,t){var n,o;let{geometry:i,track:r}=t;r.visible&&Tt(e,i.centerX,i.centerY,r.radius,r.width,i.startAngle,i.endAngle);for(let a of t.zones||[])I(a.color)||Tt(e,i.centerX,i.centerY,(o=(n=a.radius)!=null?n:r.radius)!=null?o:i.radius,bi(a,r.width),L(a.min,t),L(a.max,t))}function bi(e,t){var i,r,n;return e!=null&&e.taper?Math.max(0,l(e.taper.startWidth,(r=e.width)!=null?r:t),l(e.taper.endWidth,(n=e.width)!=null?n:t)):(i=e==null?void 0:e.width)!=null?i:t}function vi(e,t){let{geometry:i,scale:r}=t,n=[];if(r.major.visible&&n.push(r.major.length),r.minor.visible&&n.push(r.minor.length),!n.length)return;let o=Math.max(...n,0),a=r.radius,s=r.radius;r.position==="outside"?s+=o:r.position==="cross"?(a-=o/2,s+=o/2):a-=o,Te(e,i.centerX,i.centerY,Math.max(0,a),s,i.startAngle,i.endAngle)}function wi(e,t){let i=t.labels;if(!i.visible)return;let r=Number(i.interval)>0?Number(i.interval):Math.abs(t.max-t.min)/Math.max(1,t.scale.major.divisions||5),n=ie($(t.min,t.max,r),t);for(let o of n){let a=b(t.geometry.centerX,t.geometry.centerY,i.radius,L(o,t)),s=Number(o).toFixed(i.fractionDigits);if(typeof i.formatter=="function")try{s=String(i.formatter(o,{min:t.min,max:t.max,options:t}))}catch(f){}let c=Math.max(i.fontSize*.55,s.length*i.fontSize*.34),u=i.fontSize*.68;E(e,a.x-c,a.y-u,c*2,u*2)}}function ki(e,t){let{geometry:i,pointer:r}=t;if(!r.visible)return;let n=Math.max(r.width/2,r.strokeWidth/2,1);if(Te(e,i.centerX,i.centerY,0,r.length+n,i.startAngle,i.endAngle),r.tailLength>0&&Te(e,i.centerX,i.centerY,0,r.tailLength+n,i.startAngle+180,i.endAngle+180),r.cap.visible){let o=r.cap.radius+r.cap.strokeWidth/2;E(e,i.centerX-o,i.centerY-o,o*2,o*2)}}function Mi(e,t){var r,n;let i=k(t);t.track.visible&&Vt(e,i,M(t.min,t),M(t.max,t),V(t.linear.zoneOffset),t.track.width);for(let o of t.zones||[])I(o.color)||Vt(e,i,M(o.min,t),M(o.max,t),V((r=o.offset)!=null?r:t.linear.zoneOffset),(n=o.width)!=null?n:t.track.width)}function Si(e,t){let i=k(t),r=[];if(t.scale.major.visible&&r.push(t.scale.major.length),t.scale.minor.visible&&r.push(t.scale.minor.length),!r.length)return;let n=j(Math.max(...r,0),t.linear.tickSide);Wt(e,i,n.start,n.end)}function Li(e,t){let i=t.labels;if(!i.visible)return;let r=Number(i.interval)>0?Number(i.interval):Math.abs(t.max-t.min)/Math.max(1,t.scale.major.divisions||5),n=$(t.min,t.max,r),o=k(t);for(let a of n){let s=S(M(a,t),o,V(t.linear.labelOffset)),c=Number(a).toFixed(i.fractionDigits);if(typeof i.formatter=="function")try{c=String(i.formatter(a,{min:t.min,max:t.max,options:t}))}catch(g){}let u=Math.max(i.fontSize*.55,c.length*i.fontSize*.34),f=i.fontSize*.68;E(e,s.x-u,s.y-f,u*2,f*2)}}function Oi(e,t){let i=t.indicator;if(!i.visible)return;let r=k(t),n=j(i.length,i.position,ce(i)),o=Math.max(i.width/2,i.strokeWidth/2,1),a=Math.min(n.start,n.end)-o,s=Math.max(n.start,n.end)+o,c=o;i.type==="marker"&&(c=Math.max(c,i.markerSize)),i.type==="carriage"&&(c=Math.max(c,i.carriageWidth/2)),i.cap.visible&&(c=Math.max(c,i.cap.radius+i.cap.strokeWidth/2)),Wt(e,r,a,s,c)}function zt(e,t){var c,u;let i=(c=t.centerZero)==null?void 0:c.marker;if(!(i!=null&&i.visible))return;let r=Math.max(i.width/2,.5);if(t.geometry.mode==="linear"){let f=k(t),g=M(t.centerZero.zeroValue,t),m=j(i.length,i.position,V(i.centerOffset)),d=S(g,f,m.start),p=S(g,f,m.end);E(e,Math.min(d.x,p.x)-r,Math.min(d.y,p.y)-r,Math.abs(p.x-d.x)+r*2,Math.abs(p.y-d.y)+r*2);return}let n=L(t.centerZero.zeroValue,t),o=(u=i.radius)!=null?u:t.scale.radius,a=b(t.geometry.centerX,t.geometry.centerY,Math.max(0,o-i.length),n),s=b(t.geometry.centerX,t.geometry.centerY,o,n);E(e,Math.min(a.x,s.x)-r,Math.min(a.y,s.y)-r,Math.abs(s.x-a.x)+r*2,Math.abs(s.y-a.y)+r*2)}function Vt(e,t,i,r,n,o){let a=Math.max(0,l(o,0))/2,s=S(i,t,n),c=S(r,t,n),u=Math.min(s.x,c.x)-a,f=Math.min(s.y,c.y)-a;E(e,u,f,Math.abs(c.x-s.x)+a*2,Math.abs(c.y-s.y)+a*2)}function Wt(e,t,i,r,n=0){for(let o of[{x:t.startX,y:t.startY},{x:t.endX,y:t.endY}])for(let a of[i,r]){let s=S(o,t,a);te(e,s.x-t.tangentX*n,s.y-t.tangentY*n),te(e,s.x+t.tangentX*n,s.y+t.tangentY*n)}}function Ai(e,t){let i=ue(t),r=Math.max(t.tape.windowStrokeWidth/2,t.tape.windowInnerStrokeWidth/2);E(e,i.x-r,i.y-r,i.width+r*2,i.height+r*2)}function Ci(e,t){let i=t.light;if(!(i!=null&&i.visible))return;let r=he(i,t),n=Math.max(1,l(i.radius,8)),o=i.glow?n*2.96:n,a=n+Math.max(1.5,n*.18),s=Math.max(o,a);E(e,r.x-s,r.y-s,s*2,s*2)}function zi(e,t){if(t.readout.visible)for(let[i,r]of Object.entries(t.readout)){if(i==="visible"||!(r!=null&&r.visible))continue;let n=i==="value"?`${r.prefix||""}${t.max}${r.suffix||""}`:String(r.text||"");if(!n&&i!=="value")continue;let o=ve(r,t),a=Math.max(r.fontSize*.55,n.length*r.fontSize*.34),s=r.fontSize*.68;E(e,o.x-a,o.y-s,a*2,s*2)}}function Vi(e){let t=e.face;return t.visible&&t.fit!=="content"?{x:t.x,y:t.y,width:t.width,height:t.height}:{x:0,y:0,width:e.geometry.width,height:e.geometry.height}}function Tt(e,t,i,r,n,o,a){let s=Math.max(0,l(n,0))/2;Te(e,t,i,Math.max(0,r-s),r+s,o,a)}function Te(e,t,i,r,n,o,a){let s=[o,a];for(let c of[0,90,180,270])Ti(c,o,a)&&s.push(c);r<=fe&&te(e,t,i);for(let c of s){let u=b(t,i,Math.max(0,n),c);if(te(e,u.x,u.y),r>fe){let f=b(t,i,r,c);te(e,f.x,f.y)}}}function Ti(e,t,i){let r=i-t;return Math.abs(r)>=360-fe?!0:r>=0?It(e-t,360)<=r+fe:It(t-e,360)<=-r+fe}function It(e,t){return(e%t+t)%t}var Ii="http://www.w3.org/2000/svg";function h(e,t={},i=null){let r=document.createElementNS(Ii,e);return G(r,t),i!=null&&(r.textContent=String(i)),r}function G(e,t){for(let[i,r]of Object.entries(t||{}))r==null||r===!1||(i==="className"?e.setAttribute("class",String(r)):e.setAttribute(i,String(r)));return e}var We=class{constructor(t,i){this.host=t,this.options=i,this.id=Mt("gaugeit"),this.controllers=[],this.references=new Map,this.root=null,this.svg=null,this.content=null,this.contentBounds=null,this.layoutBounds=null,this.contentClipPathId=null}begin(){this.destroyControllers(),this.references.clear(),this.contentClipPathId=null;let t=document.createElement("div");t.className=["gaugeit",`gaugeit--${this.options.type}`,`gaugeit--layout-${this.options.layout.mode}`,this.options.className].filter(Boolean).join(" "),t.dataset.gaugeitRoot="true",t.dataset.gaugeitLayout=this.options.layout.mode,this.contentBounds=ke(this.options,{includeFace:!1,includeBase:!1}),this.layoutBounds=ke(this.options,{contentBounds:this.contentBounds});let i=be(this.layoutBounds,this.options.layout.padding),r=this.options.geometry,n=h("svg",{class:"gaugeit__svg",viewBox:qe(i),preserveAspectRatio:r.preserveAspectRatio,focusable:"false"}),o=h("title",{id:`${this.id}-title`},this.options.accessibility.label);if(n.append(o),this.options.accessibility.description){let s=h("desc",{id:`${this.id}-description`},this.options.accessibility.description);n.append(s),n.setAttribute("aria-describedby",s.id)}n.setAttribute("aria-labelledby",o.id);let a=h("g",{class:"gaugeit__viewport","data-gaugeit-viewport":"true"});return n.append(a),t.append(n),this.host.replaceChildren(t),this.host.classList.add("gaugeit-host"),this.root=t,this.svg=n,this.content=a,this.applySizing(i),n}finish(){if(!this.svg||!this.content)return null;let t=$i(this.content),i=this.options.face.visible&&this.options.face.clipContent,r=t&&!i?Ie(this.layoutBounds,t):this.layoutBounds,n=be(r,this.options.layout.padding);return this.layoutBounds=r,this.svg.setAttribute("viewBox",qe(n)),this.applySizing(n),this.root.dataset.gaugeitViewBox=qe(n),n}group(t,i={}){let r=t!=="face"&&this.contentClipPathId?`url(#${this.contentClipPathId})`:void 0,n=h("g",{class:`gaugeit__layer gaugeit__layer--${t}`,"data-gaugeit-layer":t,"clip-path":r,...i});return this.content.append(n),n}setContentClipPath(t){this.contentClipPathId=t?String(t):null}getContentBounds(){return this.contentBounds}setReference(t,i){return this.references.set(t,i),i}getReference(t){return this.references.get(t)}addController(t){t&&typeof t.update=="function"&&this.controllers.push(t)}update(t,i){for(let r of this.controllers)r.update(t,i)}destroyControllers(){for(let t of this.controllers)typeof t.destroy=="function"&&t.destroy();this.controllers=[]}destroy(){this.destroyControllers(),this.references.clear(),this.root&&this.root.parentNode===this.host&&this.root.remove(),this.host.classList.remove("gaugeit-host"),this.root=null,this.svg=null,this.content=null,this.contentBounds=null,this.layoutBounds=null,this.contentClipPathId=null}applySizing(t){let i=this.options.responsive,r=this.options.layout.mode==="contain";this.root.style.width=i?"100%":`${t.width}px`,this.root.style.maxWidth="100%",this.root.style.height=r?"100%":"auto",this.svg.style.display="block",this.svg.style.width=i?"100%":`${t.width}px`,this.svg.style.height=r?"100%":"auto",this.svg.style.maxWidth="100%",this.svg.style.maxHeight=r?"100%":"none",this.svg.style.overflow="hidden"}};function qe(e){return`${$e(e.x)} ${$e(e.y)} ${$e(e.width)} ${$e(e.height)}`}function $e(e){return Math.round(e*1e3)/1e3}function $i(e){if(typeof e.getBBox!="function")return null;try{let t=e.getBBox();return![t.x,t.y,t.width,t.height].every(Number.isFinite)||t.width<=0&&t.height<=0?null:{x:t.x,y:t.y,width:Math.max(1,t.width),height:Math.max(1,t.height)}}catch(t){return null}}var Je={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>e*(2-e),easeInOutQuad:e=>e<.5?2*e*e:-1+(4-2*e)*e,easeOutCubic:e=>1-Math.pow(1-e,3),easeInOutCubic:e=>e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2,easeOutBack:e=>1+2.70158*Math.pow(e-1,3)+1.70158*Math.pow(e-1,2)};function jt(e){return typeof e=="function"?e:Je[e]||Je.easeOutCubic}var Ke=Object.freeze(Object.keys(Je));var Qe=Object.freeze({type:"arc",min:0,max:100,value:0,invert:!1,overflow:"clamp",precision:3,className:"",layout:{mode:"intrinsic",padding:8,includeGeometry:!0},geometry:{mode:"radial",width:320,height:220,centerX:160,centerY:174,radius:120,startAngle:180,endAngle:360,preserveAspectRatio:"xMidYMid meet",aspectRatio:null},linear:{originY:140,startX:36,startY:0,endX:284,endY:0,tickSide:"negative",labelOffset:34,zoneOffset:-12},face:{visible:!1,shape:"panel",fit:"geometry",contentPadding:8,minWidth:null,minHeight:null,clipContent:!1,x:6,y:6,width:308,height:208,cornerRadius:18,color:"#ffffff",strokeColor:"#d1d5db",strokeWidth:2,innerStrokeColor:"#f3f4f6",innerStrokeWidth:1,shadow:!1,glass:!1},track:{visible:!0,color:"#e5e7eb",width:28,radius:112,opacity:1,lineCap:"butt",showUnderZones:!1},zones:[],scale:{endpointMode:"auto",radius:112,position:"inside",major:{visible:!0,interval:null,divisions:5,length:13,width:2,color:"#111827",opacity:1},minor:{visible:!0,subdivisions:4,length:7,width:1,color:"#6b7280",opacity:.9}},labels:{visible:!0,interval:null,radius:84,color:"#111827",fontFamily:'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',fontSize:11,fontWeight:500,fractionDigits:0,rotation:"horizontal",formatter:null},pointer:{visible:!0,type:"needle",length:94,shaftLength:null,tailLength:13,width:8,color:"#111827",strokeColor:"none",strokeWidth:0,opacity:1,colorByZone:!1,cap:{visible:!0,stackOrder:"above",radius:8,color:"#111827",strokeColor:"#ffffff",strokeWidth:2}},indicator:{visible:!1,type:"hairline",position:"cross",length:76,centerOffset:null,offset:0,width:2,color:"#b91c1c",strokeColor:"none",strokeWidth:0,opacity:1,lineCap:"round",colorByZone:!1,markerSize:8,carriageWidth:14,carriageRadius:4,cap:{visible:!1,stackOrder:"above",radius:4,color:"#b91c1c",strokeColor:"#ffffff",strokeWidth:1}},centerZero:{zeroValue:0,symmetric:!1,marker:{visible:!1,radius:null,position:"cross",centerOffset:0,length:20,width:3,color:"#111827",opacity:1,lineCap:"round"}},tape:{orientation:"vertical",x:64,y:58,width:192,height:210,cornerRadius:12,windowColor:"#e5e7eb",windowStrokeColor:"#475569",windowStrokeWidth:2,windowInnerStrokeColor:"#d1d5db",windowInnerStrokeWidth:1,stripColor:"#ffffff",textColor:"#111827",tickColor:"#334155",minorTickColor:"#64748b",minorTickOpacity:.85,majorTickWidth:2,minorTickWidth:1,majorTickLength:24,minorTickLength:12,tickInset:64,labelOffset:10,interval:null,minorSubdivisions:4,majorSpacing:52,indicatorColor:"#b91c1c",indicatorWidth:2.5,fadeSize:32,fadeColor:"#ffffff",colorByZone:!1},light:{visible:!1,x:160,y:110,radius:8,color:"amber",customColor:"",offColor:"#f3ead6",offEdgeColor:"#817768",bezelColor:"#4b5563",bezelHighlightColor:"#f8fafc",opacity:1,on:!1,glow:!0,pulse:!0,pulseInterval:2600,blink:!1,blinkInterval:1e3,trigger:{mode:"manual",source:"target",value:0,min:0,max:0}},readout:{visible:!0,title:{visible:!1,text:"",x:"auto",y:"auto",position:"top",margin:12,offsetX:0,offsetY:0,color:"#374151",fontFamily:'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',fontSize:14,fontWeight:700,letterSpacing:.8},value:{visible:!1,x:"auto",y:54,position:"center",margin:12,offsetX:0,offsetY:0,color:"#111827",fontFamily:'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',fontSize:38,fontWeight:750,fractionDigits:0,prefix:"",suffix:"",locale:void 0,formatter:null},unit:{visible:!1,text:"",x:"auto",y:76,position:"bottom",margin:12,offsetX:0,offsetY:0,color:"#6b7280",fontFamily:'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',fontSize:12,fontWeight:600}},animation:{enabled:!0,duration:850,easing:"easeOutCubic",animateOnInit:!0,startFrom:"min",respectReducedMotion:!0},effects:{jitter:{enabled:!1,amplitude:.45,amplitudeUnit:"value",frequency:4,smoothing:.86,whenIdleOnly:!0}},accessibility:{label:"Gauge",description:"",valueText:null},performance:{pauseWhenHidden:!0,pauseWhenOffscreen:!0},responsive:!0});var Wi=new Set(["clamp","expand","allow"]),ji=new Set(["needle","line","arrow","spear"]),Ei=new Set(["inside","outside","cross"]),Ni=new Set(["horizontal","radial","tangent"]),Yi=new Set(["intrinsic","contain"]),Ri=new Set(["geometry","content"]),Pi=new Set(["panel","circle"]),Fi=new Set(["auto","both","dedupe"]),Xi=new Set(["top","center","bottom"]),Gi=new Set(["radial","linear","tape"]),Di=new Set(["negative","positive","cross"]),Bi=new Set(["hairline","marker","carriage"]),Et=new Set(["negative","positive","cross"]),Nt=new Set(["above","below"]),Hi=new Set(["vertical","horizontal"]),Zi=new Set(["red","green","blue","amber","yellow","orange","white","halogen","cyan","brown"]),Ui=new Set(["manual","below","above","between"]),qi=new Set(["target","displayed","pointer"]);function Ee(e,t){let i=v(e)?e:{},r=String(i.type||Qe.type),n=t.get(r),o=D(Qe,n.defaults),a=D(o,i);if(a.type=r,a=tt(a,o),typeof n.configure=="function"){let s=n.configure(a,{requested:i,typeDefaults:n.defaults});v(s)&&(a=s)}return a=tt(a,o),a.min=l(a.min,0),a.max=l(a.max,100),a.max<=a.min&&(a.max=a.min+1),a.value=l(a.value,a.min),a.invert=a.invert===!0,a.precision=Math.max(0,Math.min(12,Math.floor(l(a.precision,3)))),a.overflow=Wi.has(a.overflow)?a.overflow:"clamp",Ji(a.layout),Ki(a.geometry),Qi(a.linear),er(a.face),tr(a),ir(a.pointer),rr(a.indicator,i.indicator),nr(a.centerZero,a),ar(a.tape),or(a.light),sr(a.labels),lr(a.readout),cr(a.animation),ur(a.effects.jitter),a.zones=hr(a.zones,a.min,a.max,a.track.width),a}function K(e){let t=l(e.scale.major.interval,0);if(t>0)return t;let i=Math.max(1,Math.floor(l(e.scale.major.divisions,5)));return oe(e.max-e.min,i)}function Ne(e,t){return D(e||{},t||{})}function Ji(e){e.mode=Yi.has(e.mode)?e.mode:"intrinsic",e.padding=Math.max(0,l(e.padding,8)),e.includeGeometry=e.includeGeometry!==!1}function Ki(e){e.mode=Gi.has(e.mode)?e.mode:"radial",e.width=Math.max(40,l(e.width,320)),e.height=Math.max(40,l(e.height,220)),e.centerX=l(e.centerX,e.width/2),e.centerY=l(e.centerY,e.height*.78),e.radius=Math.max(1,l(e.radius,Math.min(e.width,e.height)*.4)),e.startAngle=l(e.startAngle,180),e.endAngle=l(e.endAngle,360),Math.abs(e.endAngle-e.startAngle)<.001&&(e.endAngle=e.startAngle+180),Math.abs(e.endAngle-e.startAngle)>360&&(e.endAngle=e.startAngle+Math.sign(e.endAngle-e.startAngle)*360),e.preserveAspectRatio=String(e.preserveAspectRatio||"xMidYMid meet"),e.aspectRatio=e.aspectRatio===null||e.aspectRatio===void 0?null:Math.max(1e-6,l(e.aspectRatio,e.width/e.height))}function Qi(e){e.originY=l(e.originY,140),e.startX=l(e.startX,36),e.startY=l(e.startY,0),e.endX=l(e.endX,284),e.endY=l(e.endY,e.startY),Math.hypot(e.endX-e.startX,e.endY-e.startY)<.001&&(e.endX=e.startX+1,e.endY=e.startY),e.tickSide=Di.has(e.tickSide)?e.tickSide:"negative",e.labelOffset=l(e.labelOffset,34),e.zoneOffset=l(e.zoneOffset,-12)}function er(e){e.shape=Pi.has(e.shape)?e.shape:"panel",e.fit=Ri.has(e.fit)?e.fit:"geometry",e.contentPadding=Math.max(0,l(e.contentPadding,8)),e.minWidth=e.minWidth===null||e.minWidth===void 0?null:Math.max(1,l(e.minWidth,1)),e.minHeight=e.minHeight===null||e.minHeight===void 0?null:Math.max(1,l(e.minHeight,1)),e.clipContent=e.clipContent===!0,e.x=l(e.x,6),e.y=l(e.y,6),e.width=Math.max(1,l(e.width,308)),e.height=Math.max(1,l(e.height,208)),e.cornerRadius=Math.max(0,l(e.cornerRadius,18)),e.strokeWidth=Math.max(0,l(e.strokeWidth,2)),e.innerStrokeWidth=Math.max(0,l(e.innerStrokeWidth,1))}function tr(e){e.scale.endpointMode=Fi.has(e.scale.endpointMode)?e.scale.endpointMode:"auto",e.scale.radius=Math.max(1,l(e.scale.radius,e.geometry.radius)),e.scale.position=Ei.has(e.scale.position)?e.scale.position:"inside",e.scale.major.divisions=Math.max(1,Math.floor(l(e.scale.major.divisions,5))),e.scale.major.length=Math.max(0,l(e.scale.major.length,13)),e.scale.major.width=Math.max(0,l(e.scale.major.width,2)),e.scale.minor.subdivisions=Math.max(0,Math.floor(l(e.scale.minor.subdivisions,4))),e.scale.minor.length=Math.max(0,l(e.scale.minor.length,7)),e.scale.minor.width=Math.max(0,l(e.scale.minor.width,1))}function ir(e){e.type=ji.has(e.type)?e.type:"needle",e.length=Math.max(0,l(e.length,94)),e.shaftLength=e.shaftLength===null||e.shaftLength===void 0?null:Math.min(e.length,Math.max(0,l(e.shaftLength,e.length))),e.tailLength=Math.max(0,l(e.tailLength,13)),e.width=Math.max(.5,l(e.width,8)),e.strokeWidth=Math.max(0,l(e.strokeWidth,0)),e.cap.radius=Math.max(0,l(e.cap.radius,8)),e.cap.strokeWidth=Math.max(0,l(e.cap.strokeWidth,2)),e.cap.stackOrder=Nt.has(e.cap.stackOrder)?e.cap.stackOrder:"above"}function rr(e,t={}){e.visible=e.visible===!0,e.type=Bi.has(e.type)?e.type:"hairline",e.position=Et.has(e.position)?e.position:"cross",e.length=Math.max(0,l(e.length,76));let i=v(t)&&Object.prototype.hasOwnProperty.call(t,"centerOffset"),r=v(t)&&Object.prototype.hasOwnProperty.call(t,"offset");i?e.centerOffset=l(t.centerOffset,0):r?e.centerOffset=-l(t.offset,0):e.centerOffset===null||e.centerOffset===void 0?e.centerOffset=-l(e.offset,0):e.centerOffset=l(e.centerOffset,0),e.offset=-e.centerOffset,e.width=Math.max(.5,l(e.width,2)),e.strokeWidth=Math.max(0,l(e.strokeWidth,0)),e.opacity=Math.min(1,Math.max(0,l(e.opacity,1))),e.markerSize=Math.max(1,l(e.markerSize,8)),e.carriageWidth=Math.max(1,l(e.carriageWidth,14)),e.carriageRadius=Math.max(0,l(e.carriageRadius,4)),e.cap.radius=Math.max(0,l(e.cap.radius,4)),e.cap.strokeWidth=Math.max(0,l(e.cap.strokeWidth,1)),e.cap.stackOrder=Nt.has(e.cap.stackOrder)?e.cap.stackOrder:"above"}function nr(e,t){if(e.zeroValue=l(e.zeroValue,0),e.symmetric=e.symmetric===!0,e.symmetric){let i=Math.max(Math.abs(t.min-e.zeroValue),Math.abs(t.max-e.zeroValue),1);t.min=e.zeroValue-i,t.max=e.zeroValue+i}e.marker.visible=e.marker.visible===!0,e.marker.radius=e.marker.radius===null||e.marker.radius===void 0?null:Math.max(0,l(e.marker.radius,t.scale.radius)),e.marker.position=Et.has(e.marker.position)?e.marker.position:"cross",e.marker.centerOffset=l(e.marker.centerOffset,0),e.marker.length=Math.max(0,l(e.marker.length,20)),e.marker.width=Math.max(.5,l(e.marker.width,3)),e.marker.opacity=Math.min(1,Math.max(0,l(e.marker.opacity,1))),e.marker.lineCap=String(e.marker.lineCap||"round")}function ar(e){e.orientation=Hi.has(e.orientation)?e.orientation:"vertical",e.x=l(e.x,64),e.y=l(e.y,58),e.width=Math.max(20,l(e.width,192)),e.height=Math.max(20,l(e.height,210)),e.cornerRadius=Math.max(0,l(e.cornerRadius,12)),e.windowStrokeWidth=Math.max(0,l(e.windowStrokeWidth,2)),e.windowInnerStrokeWidth=Math.max(0,l(e.windowInnerStrokeWidth,1)),e.minorTickOpacity=Math.min(1,Math.max(0,l(e.minorTickOpacity,.85))),e.majorTickWidth=Math.max(.5,l(e.majorTickWidth,2)),e.minorTickWidth=Math.max(.5,l(e.minorTickWidth,1)),e.majorTickLength=Math.max(0,l(e.majorTickLength,24)),e.minorTickLength=Math.max(0,l(e.minorTickLength,12)),e.tickInset=l(e.tickInset,64),e.labelOffset=l(e.labelOffset,10),e.interval=e.interval===null||e.interval===void 0?null:Math.max(1e-6,l(e.interval,1)),e.minorSubdivisions=Math.max(0,Math.floor(l(e.minorSubdivisions,4))),e.majorSpacing=Math.max(2,l(e.majorSpacing,52)),e.indicatorWidth=Math.max(.5,l(e.indicatorWidth,2.5));let t=e.orientation==="horizontal"?e.width:e.height;e.fadeSize=Math.min(t/2,Math.max(0,l(e.fadeSize,32))),e.colorByZone=e.colorByZone===!0}function or(e){e.visible=e.visible===!0,e.x=l(e.x,160),e.y=l(e.y,110),e.radius=Math.max(1,l(e.radius,8)),e.color=Zi.has(e.color)?e.color:"amber",e.customColor=e.customColor===null||e.customColor===void 0?"":String(e.customColor).trim(),e.offColor=je(e.offColor,"#f3ead6"),e.offEdgeColor=je(e.offEdgeColor,"#817768"),e.bezelColor=je(e.bezelColor,"#4b5563"),e.bezelHighlightColor=je(e.bezelHighlightColor,"#f8fafc"),e.opacity=Math.min(1,Math.max(0,l(e.opacity,1))),e.on=e.on===!0,e.glow=e.glow!==!1,e.pulse=e.pulse!==!1,e.pulseInterval=Math.max(400,l(e.pulseInterval,2600)),e.blink=e.blink===!0,e.blinkInterval=Math.max(100,l(e.blinkInterval,1e3)),e.trigger=v(e.trigger)?e.trigger:{},e.trigger.mode=Ui.has(e.trigger.mode)?e.trigger.mode:"manual",e.trigger.source=qi.has(e.trigger.source)?e.trigger.source:"target",e.trigger.value=l(e.trigger.value,0),e.trigger.min=l(e.trigger.min,e.trigger.value),e.trigger.max=l(e.trigger.max,e.trigger.value),e.trigger.max<e.trigger.min&&([e.trigger.min,e.trigger.max]=[e.trigger.max,e.trigger.min])}function je(e,t){return e==null?t:String(e).trim()||t}function sr(e){e.radius=Math.max(0,l(e.radius,84)),e.fontSize=Math.max(1,l(e.fontSize,11)),e.fractionDigits=Math.max(0,Math.min(12,Math.floor(l(e.fractionDigits,0)))),e.rotation=Ni.has(e.rotation)?e.rotation:"horizontal"}function lr(e){e.visible=e.visible!==!1,et(e.title,14),et(e.value,38),et(e.unit,12),e.value.fractionDigits=Math.max(0,Math.min(12,Math.floor(l(e.value.fractionDigits,0))))}function et(e,t){e.visible=e.visible===!0,e.x=e.x==="auto"?"auto":l(e.x,160),e.y=e.y==="auto"?"auto":l(e.y,0),e.position=Xi.has(e.position)?e.position:"top",e.margin=Math.max(0,l(e.margin,12)),e.offsetX=l(e.offsetX,0),e.offsetY=l(e.offsetY,0),e.fontSize=Math.max(1,l(e.fontSize,t)),e.letterSpacing=l(e.letterSpacing,0)}function cr(e){e.duration=Math.max(0,l(e.duration,850)),typeof e.startFrom!="number"&&!["min","max","value"].includes(e.startFrom)&&(e.startFrom="min")}function ur(e){e.amplitude=Math.max(0,l(e.amplitude,.45)),e.amplitudeUnit=e.amplitudeUnit==="percent"?"percent":"value",e.frequency=Math.max(.1,l(e.frequency,4)),e.smoothing=Math.min(.999,Math.max(0,l(e.smoothing,.86)))}function hr(e,t,i,r){return Array.isArray(e)?e.filter(v).map(n=>{var s,c;let o=n.width===void 0?void 0:Math.max(0,l(n.width,0)),a=fr(n.taper,o!=null?o:r);return{...n,min:Math.max(t,l(n.min,t)),max:Math.min(i,l(n.max,i)),color:(c=(s=n.color)!=null?s:n.strokeStyle)!=null?c:"transparent",width:o,taper:a,radius:n.radius===void 0?void 0:Math.max(0,l(n.radius,0)),offset:n.offset===void 0?void 0:l(n.offset,0),opacity:n.opacity===void 0?1:Math.min(1,Math.max(0,l(n.opacity,1)))}}).filter(n=>n.max>n.min):[]}function tt(e,t){if(!v(e))return U(t);for(let[i,r]of Object.entries(t))v(r)&&(e[i]=tt(e[i],r));return e}function fr(e,t){var n;if(!v(e))return;let i=e.startWidth===void 0?t:Math.max(0,l(e.startWidth,t!=null?t:0)),r=e.endWidth===void 0?t:Math.max(0,l(e.endWidth,(n=t!=null?t:i)!=null?n:0));return{startWidth:i,endWidth:r,segments:Math.max(2,Math.min(256,Math.floor(l(e.segments,48))))}}var re=class{constructor(t,i,r,n={}){this.host=St(t),this.registry=r,this._onDestroy=typeof n.onDestroy=="function"?n.onDestroy:null,this.userOptions=Ne({},i||{}),this.options=Ee(this.userOptions,r),this.renderer=new We(this.host,this.options),this._destroyed=!1,this._paused=!1,this._pausedAt=0,this._lifecycleSuspendedAt=0,this._onscreen=!0,this._frameHandle=null,this._animation=null,this._targetValue=this._normalizeIncomingValue(this.options.value),this._baseValue=this._targetValue,this._displayValue=this._targetValue,this._pointerValue=this._targetValue,this._jitterOffset=0,this._jitterTarget=0,this._lastJitterTargetAt=0,this._lastFrameAt=0,this._visibilityHandler=null,this._intersectionObserver=null,this._syncLifecycleObservers(),this.render(),this._initializeValue()}render(){this._assertAlive(),this.renderer.options=this.options,this.renderer.begin();let t=this.registry.get(this.options.type),i={gauge:this,options:this.options,renderer:this.renderer,registry:this.registry};for(let r of t.layers){let n=r.render(i);this.renderer.addController(n)}return this._updateDynamic(this._displayValue,!0,this._pointerValue),this.renderer.finish(),X(this.host,"render",{gauge:this,type:this.options.type,value:this._targetValue}),this}setValue(t,i={}){this._assertAlive();let r=this._normalizeIncomingValue(t),n=Math.max(0,l(i.duration,this.options.animation.duration)),o=i.animate!==!1&&this.options.animation.enabled&&n>0&&!this._prefersReducedMotion();if(this._targetValue=r,this.options.value=r,!o)return this._animation=null,this._baseValue=r,this._displayValue=r,this._pointerValue=r,this._jitterOffset=0,this._updateDynamic(r,!0,r),this._ensureLoop(),this._emitChange(),this;let a=jt(i.easing||this.options.animation.easing),s=de();return this._animation={from:this._baseValue,to:r,startedAt:s,duration:n,easing:a},X(this.host,"animationstart",{gauge:this,from:this._animation.from,to:r,duration:n}),this._ensureLoop(),this._emitChange(),this}set(t,i={}){return this.setValue(t,i)}updateOptions(t,i={}){this._assertAlive();let r=t||{};return this._applyUserOptions(Ne(this.userOptions,r),Object.prototype.hasOwnProperty.call(r,"value"),i)}replaceOptions(t={},i={}){this._assertAlive();let r=t||{};return this._applyUserOptions(Ne({},r),Object.prototype.hasOwnProperty.call(r,"value"),i)}setOptions(t,i={}){return this.updateOptions(t,i)}_applyUserOptions(t,i,r){let n=this.options.type;this.userOptions=t,this.options=Ee(this.userOptions,this.registry),this.renderer.options=this.options,this._syncLifecycleObservers();let o=i?this.options.value:this._targetValue;return this._targetValue=this._normalizeIncomingValue(o),i&&!r.animateToValue?(this._animation=null,this._baseValue=this._targetValue,this._displayValue=this._targetValue,this._pointerValue=this._targetValue,this._jitterOffset=0):(this._baseValue=this._normalizeIncomingValue(this._baseValue),this._displayValue=this._normalizeIncomingValue(this._displayValue),this._pointerValue=this._displayClamp(this._baseValue+this._jitterOffset)),this.options.value=this._targetValue,this.render(),r.animateToValue?this.setValue(this._targetValue,{animate:!0}):this._updateDynamic(this._displayValue,!0,this._pointerValue),n!==this.options.type&&X(this.host,"typechange",{gauge:this,previousType:n,type:this.options.type}),this._ensureLoop(),this}getValue(){return this._targetValue}getDisplayedValue(){return this._displayValue}pause(){return this._destroyed||this._paused?this:(this._paused=!0,this._pausedAt=de(),Le(this._frameHandle),this._frameHandle=null,X(this.host,"pause",{gauge:this}),this)}resume(){if(this._destroyed||!this._paused)return this;let t=de(),i=this._lifecycleSuspendedAt>0?Math.min(this._pausedAt,this._lifecycleSuspendedAt):this._pausedAt;return this._paused=!1,this._animation&&i>0&&(this._animation.startedAt+=Math.max(0,t-i)),this._pausedAt=0,this._lifecycleSuspendedAt=this._isLifecycleBlocked()?t:0,this._lastFrameAt=0,this._ensureLoop(),X(this.host,"resume",{gauge:this}),this}refresh(){return this.render()}destroy(){if(this._destroyed)return;this._destroyed=!0,Le(this._frameHandle),this._frameHandle=null,this._animation=null,this._removeLifecycleObservers(),this.renderer.destroy();let t=this._onDestroy;this._onDestroy=null,t&&t(this),X(this.host,"destroy",{gauge:this})}_initializeValue(){let t=this.options.animation;if(!t.enabled||!t.animateOnInit||t.duration<=0||this._prefersReducedMotion()){this._baseValue=this._targetValue,this._displayValue=this._targetValue,this._pointerValue=this._targetValue,this._updateDynamic(this._targetValue,!0,this._targetValue),this._ensureLoop();return}let i=this._resolveInitialValue(t.startFrom);if(Object.is(i,this._targetValue)){this._updateDynamic(this._targetValue,!0),this._ensureLoop();return}let r=this._targetValue;this._baseValue=i,this._displayValue=i,this._pointerValue=i,this._updateDynamic(i,!0,i),this.setValue(r,{animate:!0})}_resolveInitialValue(t){return typeof t=="number"?this._normalizeIncomingValue(t):t==="max"?this.options.max:t==="value"?this._targetValue:this.options.min}_normalizeIncomingValue(t){let i=l(t,this.options.min);if(this.options.overflow==="allow")return i;if(this.options.overflow==="expand"){let r=!1;return i<this.options.min&&(this.userOptions.min=i,r=!0),i>this.options.max&&(this.userOptions.max=i,r=!0),r&&(this.options=Ee(this.userOptions,this.registry),this.renderer&&(this.renderer.options=this.options,this.renderer.svg&&this.render())),i}return T(i,this.options.min,this.options.max)}_ensureLoop(){this._destroyed||this._paused||this._frameHandle!==null||this._shouldRun()&&(this._frameHandle=Lt(t=>this._frame(t)))}_frame(t){if(this._frameHandle=null,this._destroyed||this._paused||!this._shouldRun())return;let i=Number.isFinite(t)?t:de(),r=this._lastFrameAt>0?Math.min(100,Math.max(0,i-this._lastFrameAt)):16.667;this._lastFrameAt=i;let n=!1;if(this._animation){let u=i-this._animation.startedAt,f=this._animation.duration<=0?1:T(u/this._animation.duration,0,1),g=this._animation.easing(f);if(this._baseValue=this._animation.from+(this._animation.to-this._animation.from)*g,f>=1){let m=this._animation;this._baseValue=m.to,this._animation=null,n=!0,X(this.host,"animationend",{gauge:this,value:m.to})}}let o=this.options.effects.jitter;if(o.enabled&&(!o.whenIdleOnly||!this._animation)){let u=1e3/o.frequency;(this._lastJitterTargetAt===0||i-this._lastJitterTargetAt>=u)&&(this._jitterTarget=(Math.random()*2-1)*this._jitterAmplitude(),this._lastJitterTargetAt=i);let f=1-Math.pow(o.smoothing,r/16.667);this._jitterOffset+=(this._jitterTarget-this._jitterOffset)*f}else{this._jitterTarget=0;let u=1-Math.pow(o.smoothing,r/16.667);this._jitterOffset+=(0-this._jitterOffset)*u,Math.abs(this._jitterOffset)<1e-6&&(this._jitterOffset=0)}let s=this._displayClamp(this._baseValue),c=this._displayClamp(this._baseValue+this._jitterOffset);this._updateDynamic(s,!1,c),n&&this._emitSettled(),this._needsAnotherFrame()&&this._ensureLoop()}_needsAnotherFrame(){return this._animation||this.options.effects.jitter.enabled?!0:Math.abs(this._jitterOffset)>1e-6}_jitterAmplitude(){let t=this.options.effects.jitter;return t.amplitudeUnit==="percent"?(this.options.max-this.options.min)*t.amplitude/100:t.amplitude}_displayClamp(t){return this.options.overflow==="allow"?t:T(t,this.options.min,this.options.max)}_updateDynamic(t,i,r=t){let n=dr(t,this.options.precision),o=!Object.is(n,this._displayValue),a=!Object.is(r,this._pointerValue);!i&&!o&&!a||(this._displayValue=n,this._pointerValue=r,this.renderer.update(n,{gauge:this,targetValue:this._targetValue,baseValue:this._baseValue,pointerValue:r,animated:!!this._animation,jitterOffset:this._jitterOffset}),(i||o)&&(this._updateAccessibility(n),X(this.host,"displaychange",{gauge:this,value:this._targetValue,displayedValue:n})))}_updateAccessibility(t){let i=this.renderer.root;if(!i)return;i.setAttribute("role","meter"),i.setAttribute("aria-label",this.options.accessibility.label),i.setAttribute("aria-valuemin",String(this.options.min)),i.setAttribute("aria-valuemax",String(this.options.max)),i.setAttribute("aria-valuenow",String(t));let r=this.options.accessibility.valueText;typeof r=="function"?i.setAttribute("aria-valuetext",String(r(t,this.options))):typeof r=="string"&&r?i.setAttribute("aria-valuetext",r):i.removeAttribute("aria-valuetext")}_emitChange(){X(this.host,"change",{gauge:this,value:this._targetValue,displayedValue:this._displayValue})}_emitSettled(){X(this.host,"settled",{gauge:this,value:this._targetValue,displayedValue:this._displayValue})}_syncLifecycleObservers(){this._removeLifecycleObservers(),this._onscreen=!0,this._lifecycleSuspendedAt=0,this._installLifecycleObservers()}_removeLifecycleObservers(){this._visibilityHandler&&typeof document!="undefined"&&document.removeEventListener("visibilitychange",this._visibilityHandler),this._visibilityHandler=null,this._intersectionObserver&&this._intersectionObserver.disconnect(),this._intersectionObserver=null}_installLifecycleObservers(){typeof document!="undefined"&&this.options.performance.pauseWhenHidden&&(this._visibilityHandler=()=>{if(document.hidden){this._suspendForLifecycle();return}this._resumeFromLifecycle()},document.addEventListener("visibilitychange",this._visibilityHandler,{passive:!0}),document.hidden&&this._suspendForLifecycle()),typeof IntersectionObserver=="function"&&this.options.performance.pauseWhenOffscreen&&(this._intersectionObserver=new IntersectionObserver(t=>{let i=t[0];this._onscreen=!!(i&&i.isIntersecting),this._onscreen?this._resumeFromLifecycle():this._suspendForLifecycle()},{rootMargin:"100px"}),this._intersectionObserver.observe(this.host))}_shouldRun(){return this._isLifecycleBlocked()?!1:this._needsAnotherFrame()}_isLifecycleBlocked(){return typeof document!="undefined"&&this.options.performance.pauseWhenHidden&&document.hidden?!0:this.options.performance.pauseWhenOffscreen&&!this._onscreen}_suspendForLifecycle(){this._lifecycleSuspendedAt===0&&(this._lifecycleSuspendedAt=de()),Le(this._frameHandle),this._frameHandle=null}_resumeFromLifecycle(){typeof document!="undefined"&&this.options.performance.pauseWhenHidden&&document.hidden||this.options.performance.pauseWhenOffscreen&&!this._onscreen||this._paused||(this._lifecycleSuspendedAt>0&&this._animation&&(this._animation.startedAt+=Math.max(0,de()-this._lifecycleSuspendedAt)),this._lifecycleSuspendedAt=0,this._lastFrameAt=0,this._ensureLoop())}_prefersReducedMotion(){return!this.options.animation.respectReducedMotion||typeof matchMedia!="function"?!1:matchMedia("(prefers-reduced-motion: reduce)").matches}_assertAlive(){if(this._destroyed)throw new Error("This Gaugeit instance has been destroyed.")}};function de(){return typeof performance!="undefined"&&typeof performance.now=="function"?performance.now():Date.now()}function dr(e,t){let i=Math.pow(10,t);return Math.round(e*i)/i}var ge=class{constructor(){this._types=new Map}register(t,i){let r=String(t||"").trim();if(!r)throw new TypeError("Gauge type name must be a non-empty string.");if(!v(i))throw new TypeError(`Gauge type "${r}" must be an object.`);if(!Array.isArray(i.layers)||i.layers.length===0)throw new TypeError(`Gauge type "${r}" must define at least one layer.`);let n=i.layers.map((o,a)=>{if(!o||typeof o.render!="function")throw new TypeError(`Layer ${a} in gauge type "${r}" must expose render(context).`);return o});return this._types.set(r,{name:r,defaults:U(i.defaults||{}),layers:n,description:String(i.description||""),configure:typeof i.configure=="function"?i.configure:null}),this}get(t){let i=this._types.get(String(t));if(!i)throw new Error(`Unknown Gaugeit gauge type: ${t}`);return i}has(t){return this._types.has(String(t))}names(){return[...this._types.keys()]}describe(){return[...this._types.values()].map(t=>({name:t.name,description:t.description}))}},ne=new ge;var A={id:"face",render(e){let{options:t,renderer:i}=e,r=t.face;if(!r.visible)return null;let n=i.group("face",{"aria-hidden":"true"}),o=we(t,i.getContentBounds()),a=`${i.id}-face-shadow`,s=`${i.id}-glass`,c=`${i.id}-face-content-clip`,u=Math.max(3,r.strokeWidth+2),f=gr(o,u),g=h("defs");if(r.shadow){let d=h("filter",{id:a,x:"-20%",y:"-20%",width:"140%",height:"140%"});d.append(h("feDropShadow",{dx:0,dy:3,stdDeviation:4,"flood-color":"#000000","flood-opacity":.18})),g.append(d)}if(r.glass){let d=h("linearGradient",{id:s,x1:"0%",y1:"0%",x2:"0%",y2:"100%"});d.append(h("stop",{offset:"0%","stop-color":"#ffffff","stop-opacity":.38}),h("stop",{offset:"48%","stop-color":"#ffffff","stop-opacity":.06}),h("stop",{offset:"100%","stop-color":"#ffffff","stop-opacity":0})),g.append(d)}if(r.clipContent){let d=h("clipPath",{id:c,clipPathUnits:"userSpaceOnUse"});d.append(it(r,f,{fill:"#ffffff",stroke:"none"},Math.max(0,r.cornerRadius-u))),g.append(d),i.setContentClipPath(c)}g.children.length>0&&n.append(g);let m=it(r,o,{fill:r.color,stroke:r.strokeColor,"stroke-width":r.strokeWidth,filter:r.shadow?`url(#${a})`:void 0});if(m.classList.add("gaugeit__face"),n.append(m),n.append(it(r,f,{class:"gaugeit__face-inner",fill:"none",stroke:r.innerStrokeColor,"stroke-width":r.innerStrokeWidth},Math.max(0,r.cornerRadius-u))),r.glass)if(r.shape==="circle"){let d=Math.min(o.width,o.height)/2;n.append(h("ellipse",{class:"gaugeit__glass",cx:o.x+o.width/2,cy:o.y+o.height/2-d*.27,rx:d*.68,ry:d*.32,fill:`url(#${s})`,"pointer-events":"none"}))}else n.append(h("path",{class:"gaugeit__glass",d:`M ${o.x+14} ${o.y+14} H ${o.x+o.width-14} V ${o.y+o.height*.52} Q ${o.x+o.width/2} ${o.y+o.height*.38} ${o.x+14} ${o.y+o.height*.52} Z`,fill:`url(#${s})`,"pointer-events":"none"}));return null}};function gr(e,t){return{x:e.x+t,y:e.y+t,width:Math.max(1,e.width-t*2),height:Math.max(1,e.height-t*2)}}function it(e,t,i={},r=e.cornerRadius){if(e.shape==="circle")return h("circle",{cx:t.x+t.width/2,cy:t.y+t.height/2,r:Math.max(1,Math.min(t.width,t.height)/2),...i});let n=Math.max(0,Math.min(r,t.width/2,t.height/2));return h("rect",{x:t.x,y:t.y,width:t.width,height:t.height,rx:n,ry:n,...i})}var N={id:"zones",render(e){let{options:t,renderer:i}=e,r=i.group("zones",{"aria-hidden":"true"}),n=le(t.min,t.max,t.zones);t.track.showUnderZones&&t.track.visible&&o(r,t.min,t.max,t.track,"gaugeit__track");for(let a of n){let s=a.zone||t.track;(a.zone?!I(a.zone.color):t.track.visible&&!t.track.showUnderZones)&&o(r,a.min,a.max,s,a.zone?"gaugeit__zone":"gaugeit__track")}return null;function o(a,s,c,u,f){let g=mr(s,c,u,f,t);for(let m of g)u.className&&m.classList.add(String(u.className)),a.append(m)}}};function mr(e,t,i,r,n){var y,w,F,O,B;let o=n.geometry,a=(w=(y=i.radius)!=null?y:n.track.radius)!=null?w:o.radius,s=(F=i.width)!=null?F:n.track.width,c=(O=i.color)!=null?O:n.track.color,u=(B=i.opacity)!=null?B:1,f=i.lineCap||n.track.lineCap||"butt",g=L(e,n),m=L(t,n);if(!i.taper)return[h("path",{class:r,d:Ae(o.centerX,o.centerY,a,g,m),fill:"none",stroke:c,"stroke-width":s,"stroke-linecap":f,opacity:u})];let d=Yt(i,e,s),p=Yt(i,t,s),_=[h("path",{class:`${r} ${r}--tapered`,d:Ce(o.centerX,o.centerY,a,g,m,d,p,i.taper.segments),fill:c,stroke:"none",opacity:u})];if(f==="round"){let W=b(o.centerX,o.centerY,a,g),ee=b(o.centerX,o.centerY,a,m),pe=Math.abs(e-i.min)<1e-9,H=Math.abs(t-i.max)<1e-9;pe&&d>0&&_.push(Rt(r,W,d,c,u,"start")),H&&p>0&&_.push(Rt(r,ee,p,c,u,"end"))}return _}function Yt(e,t,i){let r=e.taper||{},n=Math.max(0,l(r.startWidth,i)),o=Math.max(0,l(r.endWidth,i)),a=Math.max(1e-12,e.max-e.min),s=Math.min(1,Math.max(0,(t-e.min)/a));return n+(o-n)*s}function Rt(e,t,i,r,n,o){return h("circle",{class:`${e} ${e}--taper-cap`,"data-gaugeit-zone-cap":o,cx:t.x,cy:t.y,r:i/2,fill:r,opacity:n})}var Y={id:"ticks",render(e){let{options:t,renderer:i}=e,r=t.scale;if(!r.major.visible&&!r.minor.visible)return null;let n=i.group("ticks",{"aria-hidden":"true"}),o=K(t),a=$(t.min,t.max,o),s=ie(a,t),c=se(a,r.minor.subdivisions);return r.minor.visible&&r.minor.length>0&&r.minor.width>0&&c.length&&n.append(h("path",{class:"gaugeit__ticks gaugeit__ticks--minor",d:u(c,r.minor.length),fill:"none",stroke:r.minor.color,"stroke-width":r.minor.width,"stroke-linecap":"butt",opacity:r.minor.opacity})),r.major.visible&&r.major.length>0&&r.major.width>0&&n.append(h("path",{class:"gaugeit__ticks gaugeit__ticks--major",d:u(s,r.major.length),fill:"none",stroke:r.major.color,"stroke-width":r.major.width,"stroke-linecap":"butt",opacity:r.major.opacity})),i.setReference("majorValues",s),null;function u(f,g){let m=[];for(let d of f){let p=L(d,t),_=pr(r.radius,g,r.position),y=b(t.geometry.centerX,t.geometry.centerY,_.start,p),w=b(t.geometry.centerX,t.geometry.centerY,_.end,p);m.push(`M ${x(y.x)} ${x(y.y)} L ${x(w.x)} ${x(w.y)}`)}return m.join(" ")}}};function pr(e,t,i){return i==="outside"?{start:e,end:e+t}:i==="cross"?{start:e-t/2,end:e+t/2}:{start:e,end:e-t}}var R={id:"labels",render(e){let{options:t,renderer:i}=e,r=t.labels;if(!r.visible)return null;let n=i.group("labels",{"aria-hidden":"true"}),o=Number(r.interval)>0?Number(r.interval):K(t),a=ie($(t.min,t.max,o),t);for(let s of a){let c=L(s,t),u=b(t.geometry.centerX,t.geometry.centerY,r.radius,c),f=h("text",{class:"gaugeit__label",x:u.x,y:u.y,fill:r.color,"font-family":r.fontFamily,"font-size":r.fontSize,"font-weight":r.fontWeight,"text-anchor":"middle","dominant-baseline":"middle",transform:yr(r.rotation,c,u)},xr(s,r,t));n.append(f)}return null}};function yr(e,t,i){if(e==="radial")return`rotate(${t} ${i.x} ${i.y})`;if(e==="tangent")return`rotate(${t+90} ${i.x} ${i.y})`}function xr(e,t,i){return typeof t.formatter=="function"?t.formatter(e,{min:i.min,max:i.max,options:i}):Number(e).toFixed(t.fractionDigits)}var P={id:"pointer",render(e){let{options:t,renderer:i}=e,r=t.pointer;if(!r.visible)return null;let n=t.geometry,o=i.group("pointer",{"aria-hidden":"true"}),a=h("g",{class:"gaugeit__pointer-rotating"}),s=br(r,n);a.append(s);let c=null;return r.cap.visible&&(c=h("circle",{class:"gaugeit__pointer-cap",cx:n.centerX,cy:n.centerY,r:r.cap.radius,fill:r.cap.color,stroke:r.cap.strokeColor,"stroke-width":r.cap.strokeWidth})),_r(o,a,c,r.cap.stackOrder),{update(u,f={}){let g=Number.isFinite(f.pointerValue)?f.pointerValue:u,m=L(g,t,t.overflow!=="allow");if(a.setAttribute("transform",`rotate(${m} ${n.centerX} ${n.centerY})`),r.colorByZone){let d=q(g,t.zones),p=d&&!I(d.color)?d.color:r.color;s.tagName.toLowerCase()==="line"?s.setAttribute("stroke",p):s.setAttribute("fill",p)}}}}};function _r(e,t,i,r){i&&r==="below"?e.append(i,t):i?e.append(t,i):e.append(t)}function br(e,t){let i=t.centerX,r=t.centerY,n=e.length,o=e.tailLength,a=e.width/2,s=vr(e),c;if(e.type==="line")c=h("line",{class:"gaugeit__pointer gaugeit__pointer--line",x1:i-o,y1:r,x2:i+n,y2:r,stroke:e.color,"stroke-width":e.width,"stroke-linecap":"round"});else{let u;if(e.type==="arrow")u=[[i-o,r-a*.55],[i+s,r-a*.55],[i+s,r-a*1.5],[i+n,r],[i+s,r+a*1.5],[i+s,r+a*.55],[i-o,r+a*.55]];else if(e.type==="spear"){let g=s+(n-s)*.56;u=[[i-o,r-a*.45],[i+s,r-a*.38],[i+g,r-a*.85],[i+n,r],[i+g,r+a*.85],[i+s,r+a*.38],[i-o,r+a*.45]]}else u=[[i-o,r-a*.65],[i+s,r-a*.22],[i+n,r],[i+s,r+a*.22],[i-o,r+a*.65]];let f=u.map((g,m)=>`${m===0?"M":"L"} ${g[0]} ${g[1]}`).join(" ");c=h("path",{class:`gaugeit__pointer gaugeit__pointer--${e.type}`,d:`${f} Z`,fill:e.color})}return G(c,{opacity:e.opacity,stroke:e.type==="line"?e.color:e.strokeColor,"stroke-width":e.type==="line"?e.width:e.strokeWidth}),c}function vr(e){return Number.isFinite(e.shaftLength)?Math.min(e.length,Math.max(0,e.shaftLength)):e.type==="arrow"?e.length*.7:e.type==="spear"?e.length*.68:e.length*.86}var C={id:"readout",render(e){let{options:t,renderer:i}=e,r=t.readout;if(!r.visible)return null;let n=i.group("readout");r.title.visible&&r.title.text&&n.append(rt("title",r.title,r.title.text,t));let o=null,a=wr(r.value,t);return r.value.visible&&(o=rt("value",r.value,"",t),o.setAttribute("aria-hidden","true"),n.append(o)),r.unit.visible&&r.unit.text&&n.append(rt("unit",r.unit,r.unit.text,t)),{update(s){o&&(o.textContent=a(s))}}}};function rt(e,t,i,r){let n=ve(t,r);return h("text",{class:`gaugeit__readout gaugeit__readout--${e}`,x:n.x,y:n.y,fill:t.color,"font-family":t.fontFamily,"font-size":t.fontSize,"font-weight":t.fontWeight,"letter-spacing":t.letterSpacing,"text-anchor":"middle","dominant-baseline":"middle"},i)}function wr(e,t){if(typeof e.formatter=="function")return r=>String(e.formatter(r,{min:t.min,max:t.max,options:t}));let i=new Intl.NumberFormat(e.locale,{minimumFractionDigits:e.fractionDigits,maximumFractionDigits:e.fractionDigits});return r=>`${e.prefix||""}${i.format(r)}${e.suffix||""}`}var nt=Object.freeze({red:{core:"#ef4444",highlight:"#fecaca",glow:"#f87171",rim:"#7f1d1d"},green:{core:"#22c55e",highlight:"#bbf7d0",glow:"#4ade80",rim:"#14532d"},blue:{core:"#3b82f6",highlight:"#bfdbfe",glow:"#60a5fa",rim:"#1e3a8a"},amber:{core:"#f59e0b",highlight:"#fde68a",glow:"#fb923c",rim:"#92400e"},yellow:{core:"#fde047",highlight:"#fef9c3",glow:"#facc15",rim:"#a16207"},orange:{core:"#f97316",highlight:"#fed7aa",glow:"#fb923c",rim:"#9a3412"},white:{core:"#f8fafc",highlight:"#ffffff",glow:"#e2e8f0",rim:"#64748b"},halogen:{core:"#fff2bf",highlight:"#fffdf0",glow:"#ffe79a",rim:"#9a7b24"},cyan:{core:"#22d3ee",highlight:"#cffafe",glow:"#67e8f9",rim:"#155e75"},brown:{core:"#a16207",highlight:"#f5d0a1",glow:"#d6a56b",rim:"#5b3b10"}}),z={id:"light",render({options:e,renderer:t}){let i=e.light;if(!(i!=null&&i.visible))return null;let{x:r,y:n}=he(i,e),o=kr(i),a=Object.prototype.hasOwnProperty.call(nt,i.color)?i.color:"amber",s=`${t.id}-light-glow`,c=`${t.id}-light-on`,u=`${t.id}-light-off`,f=`${t.id}-light-bezel`,g=h("defs");g.append(Mr(s,i.radius),Ft(c,{center:"#ffffff",highlight:o.highlight,middle:o.core,edge:o.rim}),Ft(u,{center:"#fffdf7",highlight:i.offColor,middle:i.offColor,edge:i.offEdgeColor}),Sr(f,i));let m=t.group("light",{"aria-hidden":"true"});m.append(g);let d=h("g",{class:`gaugeit__light gaugeit__light--${a}`,transform:`translate(${r} ${n})`,"data-gaugeit-light-color":a,"data-gaugeit-light-state":"off"});d.style.setProperty("--gaugeit-light-blink-duration",`${i.blinkInterval}ms`),d.style.setProperty("--gaugeit-light-pulse-duration",`${i.pulseInterval}ms`),d.style.setProperty("--gaugeit-light-opacity",String(i.opacity));let p=h("circle",{class:"gaugeit__light-bezel",cx:0,cy:0,r:i.radius+Math.max(1.8,i.radius*.2),fill:`url(#${f})`}),_=h("circle",{class:"gaugeit__light-bezel-highlight",cx:0,cy:0,r:i.radius+Math.max(.75,i.radius*.08),fill:"none",stroke:i.bezelHighlightColor,"stroke-width":Math.max(.55,i.radius*.075),"stroke-opacity":.65}),y=Pt({state:"off",radius:i.radius,gradientId:u,edgeColor:i.offEdgeColor,glowColor:null,glowFilterId:null,sparkleOpacity:.58,shadeOpacity:.14}),w=Pt({state:"on",radius:i.radius,gradientId:c,edgeColor:o.rim,glowColor:o.glow,glowFilterId:s,sparkleOpacity:.72,shadeOpacity:.1});return d.append(p,_,y,w),m.append(d),{update(F,O={}){var H;let B=Or((H=i.trigger)==null?void 0:H.source,F,O),W=Ve(i,B),ee=W&&i.blink,pe=W&&i.pulse&&!ee;d.classList.toggle("is-on",W),d.classList.toggle("is-blinking",ee),d.classList.toggle("is-pulsing",pe),d.classList.toggle("has-glow",i.glow),d.setAttribute("data-gaugeit-light-state",W?"on":"off")}}}};function Pt({state:e,radius:t,gradientId:i,edgeColor:r,glowColor:n,glowFilterId:o,sparkleOpacity:a,shadeOpacity:s}){let c=h("g",{class:`gaugeit__light-emission gaugeit__light-emission--${e}`,"data-gaugeit-light-visual":e});return n&&o&&c.append(h("circle",{class:"gaugeit__light-glow",cx:0,cy:0,r:t*1.82,fill:n,filter:`url(#${o})`})),c.append(h("circle",{class:`gaugeit__light-bulb gaugeit__light-bulb--${e}`,cx:0,cy:0,r:t,fill:`url(#${i})`,stroke:r,"stroke-width":Math.max(.8,t*.13)}),h("path",{class:`gaugeit__light-lens-shade gaugeit__light-lens-shade--${e}`,d:Lr(t),fill:r,opacity:s}),h("ellipse",{class:`gaugeit__light-sparkle gaugeit__light-sparkle--${e}`,cx:-t*.29,cy:-t*.35,rx:Math.max(.8,t*.36),ry:Math.max(.6,t*.2),fill:"#ffffff",opacity:a})),c}function kr(e){let t=nt[e.color]||nt.amber,i=String(e.customColor||"").trim();return i?{core:i,highlight:"#ffffff",glow:i,rim:i}:t}function Mr(e,t){let i=h("filter",{id:e,x:"-120%",y:"-120%",width:"340%",height:"340%"});return i.append(h("feGaussianBlur",{stdDeviation:Math.max(1.4,t*.38)})),i}function Ft(e,t){let i=h("radialGradient",{id:e,cx:"31%",cy:"27%",r:"74%"});return i.append(h("stop",{offset:"0%","stop-color":t.center,"stop-opacity":.98}),h("stop",{offset:"23%","stop-color":t.highlight,"stop-opacity":.96}),h("stop",{offset:"62%","stop-color":t.middle,"stop-opacity":1}),h("stop",{offset:"100%","stop-color":t.edge,"stop-opacity":1})),i}function Sr(e,t){let i=h("linearGradient",{id:e,x1:"0%",y1:"0%",x2:"100%",y2:"100%"});return i.append(h("stop",{offset:"0%","stop-color":t.bezelHighlightColor,"stop-opacity":.92}),h("stop",{offset:"34%","stop-color":t.bezelColor,"stop-opacity":.9}),h("stop",{offset:"72%","stop-color":t.bezelColor,"stop-opacity":1}),h("stop",{offset:"100%","stop-color":"#1f2937","stop-opacity":.92})),i}function Lr(e){let t=Math.max(1,e);return[`M ${-t*.86} ${t*.42}`,`A ${t} ${t} 0 0 0 ${t*.86} ${t*.42}`,`A ${t} ${t} 0 0 1 ${-t*.86} ${t*.42}`,"Z"].join(" ")}function Or(e,t,i){return e==="pointer"&&Number.isFinite(i.pointerValue)?i.pointerValue:e==="displayed"?t:Number.isFinite(i.targetValue)?i.targetValue:t}var at={description:"A lightweight semicircular arc with zones, labels, and an animated pointer.",defaults:{geometry:{width:320,height:220,centerX:160,centerY:176,radius:120,startAngle:180,endAngle:360},face:{visible:!1},track:{visible:!0,color:"#e5e7eb",width:28,radius:112,lineCap:"butt"},scale:{radius:112,position:"inside",major:{visible:!1},minor:{visible:!1}},labels:{visible:!0,radius:82,fontSize:11,fontWeight:600},pointer:{type:"needle",length:91,tailLength:12,width:8,cap:{radius:7,stackOrder:"above"}},light:{visible:!1,x:160,y:142,radius:7,color:"amber"},readout:{title:{visible:!1,x:"auto",y:35},value:{visible:!1,x:160,y:130,fontSize:30},unit:{visible:!1,x:160,y:150}}},layers:[A,N,Y,R,z,C,P]};var ot={description:"A framed white analog instrument inspired by vintage electrical and pressure meters.",defaults:{layout:{includeGeometry:!1},geometry:{width:320,height:260,centerX:160,centerY:183,radius:124,startAngle:195,endAngle:345},face:{visible:!0,shape:"panel",fit:"content",clipContent:!0,x:7,y:7,width:306,height:246,cornerRadius:20,color:"#fffef8",strokeColor:"#4b5563",strokeWidth:3,innerStrokeColor:"#d1d5db",innerStrokeWidth:1.2,shadow:!0,glass:!0},track:{visible:!1,width:8,radius:119},scale:{radius:119,position:"inside",major:{visible:!0,divisions:5,length:17,width:2.4,color:"#111827"},minor:{visible:!0,subdivisions:4,length:9,width:1,color:"#4b5563"}},labels:{visible:!0,radius:89,fontSize:12,fontWeight:650},pointer:{type:"spear",length:99,tailLength:15,width:9,color:"#111827",cap:{visible:!0,stackOrder:"above",radius:10,color:"#20242a",strokeColor:"#d1d5db",strokeWidth:2}},light:{visible:!1,x:112,y:112,radius:8,color:"amber"},readout:{title:{visible:!0,text:"ANALOG",x:"auto",y:"auto",position:"top",margin:12,offsetY:18,fontSize:13,letterSpacing:1.6},value:{visible:!1,x:160,y:224,fontSize:24,fontWeight:750},unit:{visible:!1,x:160,y:242,fontSize:10}}},layers:[A,N,Y,R,z,C,P]};var st={description:"A dense line-scale gauge with independently configurable major and minor ticks.",defaults:{geometry:{width:320,height:225,centerX:160,centerY:184,radius:127,startAngle:180,endAngle:360},face:{visible:!1},track:{visible:!0,color:"#cbd5e1",width:2,radius:126,lineCap:"round"},scale:{radius:124,position:"inside",major:{visible:!0,divisions:8,length:23,width:2.4,color:"#0f172a"},minor:{visible:!0,subdivisions:4,length:11,width:1,color:"#475569"}},labels:{visible:!0,radius:88,fontSize:10,fontWeight:650},pointer:{type:"line",length:101,tailLength:10,width:4,color:"#b91c1c",cap:{visible:!0,stackOrder:"above",radius:7,color:"#b91c1c",strokeColor:"#ffffff",strokeWidth:2}},light:{visible:!1,x:160,y:151,radius:7,color:"amber"},readout:{title:{visible:!1,x:"auto",y:140},value:{visible:!1,x:160,y:220,fontSize:33},unit:{visible:!1,x:160,y:240}}},layers:[A,N,Y,R,z,C,P]};var lt={description:"A circular, glass-fronted vintage instrument with a 270-degree scale.",defaults:{geometry:{width:320,height:320,centerX:160,centerY:160,radius:132,startAngle:225,endAngle:495},face:{visible:!0,shape:"circle",fit:"geometry",clipContent:!0,x:8,y:8,width:304,height:304,cornerRadius:0,color:"#fffdf5",strokeColor:"#374151",strokeWidth:4,innerStrokeColor:"#c7bfae",innerStrokeWidth:1.4,shadow:!0,glass:!0},track:{visible:!1,width:7,radius:124},scale:{endpointMode:"auto",radius:124,position:"inside",major:{visible:!0,divisions:9,length:18,width:2.6,color:"#171717"},minor:{visible:!0,subdivisions:4,length:9,width:1,color:"#57534e"}},labels:{visible:!0,radius:92,fontSize:11,fontWeight:700},pointer:{type:"spear",length:104,tailLength:18,width:9,color:"#7f1d1d",cap:{visible:!0,stackOrder:"above",radius:11,color:"#292524",strokeColor:"#d6d3d1",strokeWidth:2}},light:{visible:!1,x:108,y:110,radius:10,color:"amber",blink:!1,blinkInterval:1e3,trigger:{mode:"below",source:"target",value:15,min:0,max:15}},readout:{title:{visible:!0,text:"HERITAGE",x:"auto",y:"auto",position:"top",margin:14,offsetY:85,fontSize:13,letterSpacing:1.8},value:{visible:!1,x:"auto",y:224,fontSize:25,fontWeight:750},unit:{visible:!1,x:"auto",y:244,fontSize:10}}},layers:[A,N,Y,R,z,C,P]};var Ye={id:"linear-zones",render(e){let{options:t,renderer:i}=e,r=i.group("linear-zones",{"aria-hidden":"true"}),n=le(t.min,t.max,t.zones);t.track.showUnderZones&&t.track.visible&&r.append(o(t.min,t.max,t.track,"gaugeit__track"));for(let a of n){let s=a.zone||t.track;if(!(a.zone?!I(a.zone.color):t.track.visible&&!t.track.showUnderZones))continue;let u=a.zone?"gaugeit__zone":"gaugeit__track",f=o(a.min,a.max,s,u);a.zone&&a.zone.className&&f.classList.add(String(a.zone.className)),r.append(f)}return null;function o(a,s,c,u){var p,_,y,w;let f=k(t),g=V((p=c.offset)!=null?p:t.linear.zoneOffset),m=S(M(a,t),f,g),d=S(M(s,t),f,g);return h("line",{class:u,x1:m.x,y1:m.y,x2:d.x,y2:d.y,stroke:(_=c.color)!=null?_:t.track.color,"stroke-width":(y=c.width)!=null?y:t.track.width,"stroke-linecap":c.lineCap||t.track.lineCap||"butt",opacity:(w=c.opacity)!=null?w:1})}}};var Re={id:"linear-ticks",render(e){let{options:t,renderer:i}=e,r=t.scale;if(!r.major.visible&&!r.minor.visible)return null;let n=i.group("linear-ticks",{"aria-hidden":"true"}),o=K(t),a=$(t.min,t.max,o),s=se(a,r.minor.subdivisions);return r.minor.visible&&r.minor.length>0&&r.minor.width>0&&s.length&&n.append(h("path",{class:"gaugeit__ticks gaugeit__ticks--minor gaugeit__linear-ticks",d:c(s,r.minor.length),fill:"none",stroke:r.minor.color,"stroke-width":r.minor.width,"stroke-linecap":"butt",opacity:r.minor.opacity})),r.major.visible&&r.major.length>0&&r.major.width>0&&n.append(h("path",{class:"gaugeit__ticks gaugeit__ticks--major gaugeit__linear-ticks",d:c(a,r.major.length),fill:"none",stroke:r.major.color,"stroke-width":r.major.width,"stroke-linecap":"butt",opacity:r.major.opacity})),i.setReference("majorValues",a),null;function c(u,f){let g=k(t),m=j(f,t.linear.tickSide),d=[];for(let p of u){let _=M(p,t),y=S(_,g,m.start),w=S(_,g,m.end);d.push(`M ${x(y.x)} ${x(y.y)} L ${x(w.x)} ${x(w.y)}`)}return d.join(" ")}}};var Pe={id:"linear-labels",render(e){let{options:t,renderer:i}=e,r=t.labels;if(!r.visible)return null;let n=i.group("linear-labels",{"aria-hidden":"true"}),o=Number(r.interval)>0?Number(r.interval):K(t),a=$(t.min,t.max,o),s=k(t);for(let c of a){let u=S(M(c,t),s,V(t.linear.labelOffset)),f=h("text",{class:"gaugeit__label gaugeit__linear-label",x:u.x,y:u.y,fill:r.color,"font-family":r.fontFamily,"font-size":r.fontSize,"font-weight":r.fontWeight,"text-anchor":"middle","dominant-baseline":"middle",transform:Ar(r.rotation,s.angle,u)},Cr(c,r,t));n.append(f)}return null}};function Ar(e,t,i){if(e==="radial")return`rotate(${t+90} ${i.x} ${i.y})`;if(e==="tangent")return`rotate(${t} ${i.x} ${i.y})`}function Cr(e,t,i){return typeof t.formatter=="function"?t.formatter(e,{min:i.min,max:i.max,options:i}):Number(e).toFixed(t.fractionDigits)}var Fe={id:"linear-indicator",render(e){let{options:t,renderer:i}=e,r=t.indicator;if(!r.visible)return null;let n=k(t),o=ce(r),a=i.group("linear-indicator",{"aria-hidden":"true"}),s=h("g",{class:"gaugeit__linear-indicator-moving"}),c=zr(r,o);s.append(c);let u=null;return r.cap.visible&&(u=h("circle",{class:"gaugeit__linear-indicator-cap",cx:0,cy:o,r:r.cap.radius,fill:r.cap.color,stroke:r.cap.strokeColor,"stroke-width":r.cap.strokeWidth}),r.cap.stackOrder==="below"?s.prepend(u):s.append(u)),a.append(s),{update(f,g={}){let m=Number.isFinite(g.pointerValue)?g.pointerValue:f,d=M(m,t,t.overflow!=="allow");if(s.setAttribute("transform",`translate(${d.x} ${d.y}) rotate(${n.angle})`),r.colorByZone){let p=q(m,t.zones),_=p&&!I(p.color)?p.color:r.color;Tr(c,r,_)}}}}};function zr(e,t){let i=j(e.length,e.position,t),r;if(e.type==="marker"){let n=Vr(e.position);if(n===0){let o=e.markerSize,a=t;r=h("path",{class:"gaugeit__linear-indicator gaugeit__linear-indicator--marker",d:`M 0 ${a-o} L ${o*.72} ${a} L 0 ${a+o} L ${-o*.72} ${a} Z`,fill:e.color})}else{let o=t,a=o+n*e.markerSize,s=e.markerSize*.72;r=h("path",{class:"gaugeit__linear-indicator gaugeit__linear-indicator--marker",d:`M 0 ${o} L ${s} ${a} L ${-s} ${a} Z`,fill:e.color})}}else if(e.type==="carriage"){let n=Math.min(i.start,i.end);r=h("rect",{class:"gaugeit__linear-indicator gaugeit__linear-indicator--carriage",x:-e.carriageWidth/2,y:n,width:e.carriageWidth,height:Math.max(1,Math.abs(i.end-i.start)),rx:e.carriageRadius,ry:e.carriageRadius,fill:e.color})}else r=h("line",{class:"gaugeit__linear-indicator gaugeit__linear-indicator--hairline",x1:0,y1:i.start,x2:0,y2:i.end,stroke:e.color,"stroke-width":e.width,"stroke-linecap":e.lineCap});return G(r,{opacity:e.opacity,stroke:e.type==="hairline"?e.color:e.strokeColor,"stroke-width":e.type==="hairline"?e.width:e.strokeWidth}),r}function Vr(e){return e==="negative"?-1:e==="positive"?1:0}function Tr(e,t,i){t.type==="hairline"?e.setAttribute("stroke",i):e.setAttribute("fill",i)}function Xt(e,t){var c,u;let i=v((c=t.requested)==null?void 0:c.geometry)?t.requested.geometry:{},r=((u=t.typeDefaults)==null?void 0:u.geometry)||{},n=ct(i,"width"),o=ct(i,"height"),a=ct(i,"aspectRatio"),s=l(i.aspectRatio,0);if(a&&s>0){if(n&&!o)e.geometry.height=e.geometry.width/s;else if(o&&!n)e.geometry.width=e.geometry.height*s;else if(!n&&!o){let f=l(r.width,e.geometry.width);e.geometry.width=f,e.geometry.height=f/s}}return e.geometry.aspectRatio=a&&s>0?s:null,{requestedGeometry:i,widthExplicit:n||a&&s>0&&!o,heightExplicit:o||a&&s>0,baseWidth:Math.max(1,l(r.width,e.geometry.width)),baseHeight:Math.max(1,l(r.height,e.geometry.height))}}function Xe(e,t){let i=Xt(e,t);if(!i.widthExplicit&&!i.heightExplicit)return e;let r=e.geometry.width/i.baseWidth,n=e.geometry.height/i.baseHeight,o=Math.min(r,n);return Q(e,t,r,["geometry.centerX","face.x","face.width","face.minWidth","linear.startX","linear.endX","readout.title.x","readout.value.x","readout.unit.x"]),Q(e,t,n,["geometry.centerY","face.y","face.height","face.minHeight","linear.originY","linear.startY","linear.endY","linear.labelOffset","linear.zoneOffset","scale.major.length","scale.minor.length","indicator.length","indicator.centerOffset","indicator.markerSize","indicator.carriageWidth","indicator.carriageRadius","indicator.cap.radius","centerZero.marker.length","centerZero.marker.centerOffset","readout.title.y","readout.value.y","readout.unit.y"]),Q(e,t,o,["face.contentPadding","face.cornerRadius"]),e}function Gt(e,t){let i=Xt(e,t);if(!i.widthExplicit&&!i.heightExplicit)return e;let r=e.geometry.width/i.baseWidth,n=e.geometry.height/i.baseHeight,o=Math.min(r,n),a=e.tape.orientation!=="horizontal";return Q(e,t,r,["geometry.centerX","face.x","face.width","face.minWidth","tape.x","tape.width","readout.title.x","readout.value.x","readout.unit.x"]),Q(e,t,n,["geometry.centerY","face.y","face.height","face.minHeight","tape.y","tape.height","readout.title.y","readout.value.y","readout.unit.y"]),Q(e,t,a?r:n,["tape.tickInset","tape.labelOffset","tape.majorTickLength","tape.minorTickLength"]),Q(e,t,a?n:r,["tape.majorSpacing","tape.fadeSize"]),Q(e,t,o,["face.cornerRadius","tape.cornerRadius"]),e}function Q(e,t,i,r){if(!(!Number.isFinite(i)||i<=0||Math.abs(i-1)<1e-9))for(let n of r){if(Ir(t.requested,n))continue;let o=$r(t.typeDefaults,n);Number.isFinite(o)&&Wr(e,n,o*i)}}function ct(e,t){return v(e)&&Object.prototype.hasOwnProperty.call(e,t)}function Ir(e,t){let i=t.split("."),r=e;for(let n of i){if(!v(r)||!Object.prototype.hasOwnProperty.call(r,n))return!1;r=r[n]}return!0}function $r(e,t){let i=e;for(let r of t.split(".")){if(i==null)return;i=i[r]}return i}function Wr(e,t,i){let r=t.split("."),n=e;for(let o=0;o<r.length-1;o+=1){let a=r[o];v(n[a])||(n[a]={}),n=n[a]}n[r[r.length-1]]=i}var ut={layout:{includeGeometry:!1},geometry:{mode:"linear",width:320,height:220,centerX:160,centerY:110},face:{visible:!0,shape:"panel",fit:"content",contentPadding:14,minWidth:1,minHeight:1,clipContent:!0,x:7,y:7,width:306,height:206,cornerRadius:20,color:"#fffef8",strokeColor:"#4b5563",strokeWidth:3,innerStrokeColor:"#d1d5db",innerStrokeWidth:1.2,shadow:!0,glass:!0},linear:{originY:142,startX:38,startY:0,endX:282,endY:0,tickSide:"negative",labelOffset:38,zoneOffset:-16},track:{visible:!0,color:"#a8a29e",width:5,opacity:.85,lineCap:"round",showUnderZones:!1},scale:{major:{visible:!0,divisions:5,length:20,width:2.4,color:"#111827"},minor:{visible:!0,subdivisions:4,length:10,width:1,color:"#57534e"}},labels:{visible:!0,fontSize:11,fontWeight:700,rotation:"horizontal"},pointer:{visible:!1},indicator:{visible:!0,type:"hairline",position:"cross",length:84,centerOffset:0,width:2.4,color:"#991b1b",strokeColor:"#fffef8",strokeWidth:.8,cap:{visible:!1,stackOrder:"above",radius:4.5,color:"#991b1b",strokeColor:"#fffef8",strokeWidth:1.2}},light:{visible:!1,x:72,y:60,radius:8,color:"amber"},readout:{title:{visible:!0,text:"LINEAR",x:"auto",y:60,fontSize:13,letterSpacing:1.6},value:{visible:!1,x:"auto",y:-42,fontSize:24,fontWeight:750},unit:{visible:!1,x:"auto",y:-60,fontSize:10}}},Ge=[A,Ye,Re,Pe,z,C,Fe],ht={description:"A framed vintage linear instrument with zones, ticks, labels, and a moving hairline.",defaults:ut,configure:Xe,layers:Ge};var me={id:"zero-marker",render(e){var a;let{options:t,renderer:i}=e,r=(a=t.centerZero)==null?void 0:a.marker;if(!(r!=null&&r.visible))return null;let n=i.group("zero-marker",{"aria-hidden":"true"}),o=t.geometry.mode==="linear"?Er(t,r):jr(t,r);return n.append(h("line",{class:"gaugeit__zero-marker",...o,stroke:r.color,"stroke-width":r.width,"stroke-linecap":r.lineCap,opacity:r.opacity})),null}};function jr(e,t){var a;let i=L(e.centerZero.zeroValue,e),r=(a=t.radius)!=null?a:e.scale.radius,n=b(e.geometry.centerX,e.geometry.centerY,Math.max(0,r-t.length),i),o=b(e.geometry.centerX,e.geometry.centerY,r,i);return{x1:n.x,y1:n.y,x2:o.x,y2:o.y}}function Er(e,t){let i=k(e),r=M(e.centerZero.zeroValue,e),n=j(t.length,t.position,V(t.centerOffset)),o=S(r,i,n.start),a=S(r,i,n.end);return{x1:o.x,y1:o.y,x2:a.x,y2:a.y}}var Nr=D(ut,{min:-100,max:100,value:0,centerZero:{zeroValue:0,symmetric:!0,marker:{visible:!0,position:"cross",centerOffset:0,length:34,width:3.2,color:"#111827",opacity:1,lineCap:"butt"}},zones:[{min:-100,max:-35,color:"#b91c1c",width:7},{min:-35,max:35,color:"transparent"},{min:35,max:100,color:"#15803d",width:7}],readout:{title:{visible:!0,text:"DEVIATION"}}}),ft={description:"A classic linear instrument with a fixed center-zero reference and signed travel.",defaults:Nr,configure:Xe,layers:[...Ge.slice(0,3),me,...Ge.slice(3)]};var dt={description:"A heritage-styled bidirectional center-zero dial for deviation, balance, and signed values.",defaults:{min:-100,max:100,value:0,geometry:{width:320,height:320,centerX:160,centerY:160,radius:132,startAngle:150,endAngle:390},centerZero:{zeroValue:0,symmetric:!0,marker:{visible:!0,radius:124,length:25,width:3.2,color:"#292524",opacity:1,lineCap:"round"}},face:{visible:!0,shape:"circle",fit:"geometry",clipContent:!0,x:8,y:8,width:304,height:304,color:"#fffdf5",strokeColor:"#374151",strokeWidth:4,innerStrokeColor:"#c7bfae",innerStrokeWidth:1.4,shadow:!0,glass:!0},track:{visible:!0,color:"#d6d0c2",width:10,radius:123,opacity:1,lineCap:"round",showUnderZones:!0},zones:[{min:-100,max:-35,color:"#b91c1c",width:8,radius:123,opacity:.92,lineCap:"round"},{min:-35,max:35,color:"transparent"},{min:35,max:100,color:"#b45309",width:8,radius:123,opacity:.92,lineCap:"round"}],scale:{radius:119,position:"inside",major:{visible:!0,interval:25,divisions:8,length:18,width:2.4,color:"#292524"},minor:{visible:!0,subdivisions:4,length:9,width:1,color:"#78716c"}},labels:{visible:!0,interval:25,radius:88,color:"#292524",fontSize:11,fontWeight:700},pointer:{type:"spear",length:101,shaftLength:78,tailLength:18,width:8,color:"#7f1d1d",strokeColor:"#fffdf5",strokeWidth:.8,cap:{visible:!0,stackOrder:"above",radius:10,color:"#292524",strokeColor:"#d6d3d1",strokeWidth:2}},light:{visible:!1,x:112,y:205,radius:8,color:"amber"},readout:{title:{visible:!0,text:"BALANCE",x:"auto",y:205,color:"#44403c",fontSize:13,letterSpacing:1.8},value:{visible:!0,x:"auto",y:238,color:"#292524",fontSize:28,fontWeight:760,prefix:""},unit:{visible:!1,text:"",x:"auto",y:258,color:"#78716c",fontSize:10}}},layers:[A,N,Y,R,me,z,C,P]};var De={id:"rolling-tape",render(e){let{options:t,renderer:i}=e,r=t.tape,n=ue(t),o=r.orientation!=="horizontal",a=i.group("rolling-tape",{"aria-hidden":"true"}),s=`${i.id}-rolling-tape-clip`,c=`${i.id}-rolling-tape-fade-start`,u=`${i.id}-rolling-tape-fade-end`,f=h("defs"),g=h("clipPath",{id:s,clipPathUnits:"userSpaceOnUse"});g.append(h("rect",{x:n.x,y:n.y,width:n.width,height:n.height,rx:r.cornerRadius,ry:r.cornerRadius})),f.append(g),f.append(Dt(c,o,!0,r.fadeColor)),f.append(Dt(u,o,!1,r.fadeColor)),a.append(f),a.append(h("rect",{class:"gaugeit__tape-window-background",x:n.x,y:n.y,width:n.width,height:n.height,rx:r.cornerRadius,ry:r.cornerRadius,fill:r.windowColor,stroke:"none"}));let m=h("g",{class:"gaugeit__tape-strip","clip-path":`url(#${s})`});m.append(h("rect",{x:n.x,y:n.y,width:n.width,height:n.height,fill:r.stripColor})),a.append(m);let d=xe(t),p=_e(t),_=Math.max(1,Math.floor(ye(t)/d+.5)),y=o?n.height:n.width,w=Math.max(9,Math.ceil(y/p)+8),F=Math.ceil(w/2),O=[];for(let B=0;B<w;B+=1){let W=Yr(o,t);m.append(W.group),O.push(W)}return Xr(a,n,r,c,u,o),Pr(a,n,r,o),Fr(a,n,r),{update(B,W={}){let ee=Number.isFinite(W.pointerValue)?W.pointerValue:B,pe=Math.floor((ee-t.min)/d);for(let H=0;H<O.length;H+=1){let xt=pe+H-F,Me=t.min+xt*d,Se=O[H];if(Me<t.min-d*.25||Me>t.max+d*.25){Se.group.setAttribute("display","none");continue}let _t=ze(Me,ee,t),bt=o?{x:n.x+n.width/2,y:n.y+n.height/2-_t}:{x:n.x+n.width/2+_t,y:n.y+n.height/2};Se.group.removeAttribute("display"),Se.group.setAttribute("transform",`translate(${bt.x} ${bt.y})`);let li=Dr(xt,_)===0;Rr(Se,Me,li,t)}}}}};function Yr(e,t){let i=h("g",{class:"gaugeit__tape-slot"}),r=h("line",{class:"gaugeit__tape-tick"}),n=h("text",{class:"gaugeit__label gaugeit__tape-label",fill:t.tape.textColor,"font-family":t.labels.fontFamily,"font-size":t.labels.fontSize,"font-weight":t.labels.fontWeight,"text-anchor":"middle","dominant-baseline":"middle"});return i.append(r,n),i.dataset.vertical=e?"true":"false",{group:i,tick:r,text:n,vertical:e}}function Rr(e,t,i,r){let n=r.tape,o=i?n.majorTickLength:n.minorTickLength,a=n.colorByZone?q(t,r.zones):null,s=a&&!I(a.color)?a.color:null,c=s||(i?n.tickColor:n.minorTickColor),u=s||n.textColor,f=i?n.majorTickWidth:n.minorTickWidth;e.vertical?(G(e.tick,{x1:-n.tickInset,y1:0,x2:-n.tickInset-o,y2:0}),G(e.text,{x:n.labelOffset,y:0})):(G(e.tick,{x1:0,y1:n.tickInset,x2:0,y2:n.tickInset+o}),G(e.text,{x:0,y:-n.labelOffset})),G(e.tick,{stroke:c,"stroke-width":f,"stroke-linecap":"butt",opacity:i?1:n.minorTickOpacity}),e.text.setAttribute("fill",u),e.text.style.display=i&&r.labels.visible?"":"none",e.text.textContent=Gr(t,r)}function Pr(e,t,i,r){let n=t.x+t.width/2,o=t.y+t.height/2,a=Math.max(0,i.windowStrokeWidth/2);r?e.append(h("line",{class:"gaugeit__tape-indicator",x1:t.x+a,y1:o,x2:t.x+t.width-a,y2:o,stroke:i.indicatorColor,"stroke-width":i.indicatorWidth,"stroke-linecap":"butt"})):e.append(h("line",{class:"gaugeit__tape-indicator",x1:n,y1:t.y+a,x2:n,y2:t.y+t.height-a,stroke:i.indicatorColor,"stroke-width":i.indicatorWidth,"stroke-linecap":"butt"}))}function Fr(e,t,i){let r=Math.max(0,Math.min(i.cornerRadius,t.width/2,t.height/2)),n=Math.max(i.windowStrokeWidth,i.windowInnerStrokeWidth,0);e.append(h("rect",{class:"gaugeit__tape-window",x:t.x,y:t.y,width:t.width,height:t.height,rx:r,ry:r,fill:"none",stroke:i.windowStrokeColor,"stroke-width":i.windowStrokeWidth})),i.windowInnerStrokeWidth>0&&t.width>n*2&&t.height>n*2&&e.append(h("rect",{class:"gaugeit__tape-window-inner",x:t.x+n,y:t.y+n,width:t.width-n*2,height:t.height-n*2,rx:Math.max(0,r-n),ry:Math.max(0,r-n),fill:"none",stroke:i.windowInnerStrokeColor,"stroke-width":i.windowInnerStrokeWidth,"pointer-events":"none"}))}function Xr(e,t,i,r,n,o){i.fadeSize<=0||(o?e.append(h("rect",{x:t.x,y:t.y,width:t.width,height:i.fadeSize,fill:`url(#${r})`,"pointer-events":"none"}),h("rect",{x:t.x,y:t.y+t.height-i.fadeSize,width:t.width,height:i.fadeSize,fill:`url(#${n})`,"pointer-events":"none"})):e.append(h("rect",{x:t.x,y:t.y,width:i.fadeSize,height:t.height,fill:`url(#${r})`,"pointer-events":"none"}),h("rect",{x:t.x+t.width-i.fadeSize,y:t.y,width:i.fadeSize,height:t.height,fill:`url(#${n})`,"pointer-events":"none"})))}function Dt(e,t,i,r){let n=h("linearGradient",{id:e,x1:"0%",y1:"0%",x2:t?"0%":"100%",y2:t?"100%":"0%"}),o=i?.96:0,a=i?0:.96;return n.append(h("stop",{offset:"0%","stop-color":r,"stop-opacity":o}),h("stop",{offset:"100%","stop-color":r,"stop-opacity":a})),n}function Gr(e,t){return typeof t.labels.formatter=="function"?String(t.labels.formatter(e,{min:t.min,max:t.max,options:t})):Number(e).toFixed(t.labels.fractionDigits)}function Dr(e,t){return(e%t+t)%t}var gt={description:"A cream-faced rolling numeric tape with a fixed edge-to-edge aircraft reference line.",defaults:{geometry:{mode:"tape",width:320,height:340,centerX:160,centerY:170},face:{visible:!0,shape:"panel",fit:"geometry",clipContent:!0,x:8,y:8,width:304,height:324,cornerRadius:23,color:"#fffdf4",strokeColor:"#4b5563",strokeWidth:4,innerStrokeColor:"#c8bfaa",innerStrokeWidth:1.4,shadow:!0,glass:!0},pointer:{visible:!1},indicator:{visible:!1},track:{visible:!1},tape:{orientation:"vertical",x:62,y:69,width:196,height:212,cornerRadius:12,windowColor:"#fff9ea",windowStrokeColor:"#544f45",windowStrokeWidth:2,windowInnerStrokeColor:"#d8cfbd",windowInnerStrokeWidth:1,stripColor:"#fff9ea",textColor:"#211f1a",tickColor:"#3f3a32",minorTickColor:"#817867",minorTickOpacity:.86,majorTickWidth:2.2,minorTickWidth:1,majorTickLength:26,minorTickLength:13,tickInset:66,labelOffset:10,interval:20,minorSubdivisions:4,majorSpacing:54,indicatorColor:"#991b1b",indicatorWidth:2.8,fadeSize:38,fadeColor:"#fffdf4",colorByZone:!0},scale:{major:{visible:!0,interval:20,divisions:5},minor:{visible:!0,subdivisions:4}},labels:{visible:!0,color:"#211f1a",fontSize:15,fontWeight:760,fractionDigits:0},zones:[{min:0,max:20,color:"#b91c1c"},{min:20,max:80,color:"transparent"},{min:80,max:100,color:"#15803d"}],light:{visible:!1,x:72,y:46,radius:8,color:"amber"},readout:{title:{visible:!0,text:"ALTITUDE",x:"auto",y:42,color:"#3f3a32",fontSize:13,letterSpacing:1.8},value:{visible:!1,x:"auto",y:303,color:"#211f1a",fontSize:24,fontWeight:760},unit:{visible:!0,text:"FT",x:"auto",y:307,color:"#6b6253",fontSize:10,letterSpacing:1.2}}},configure:Gt,layers:[A,De,z,C]};function Bt(e){return e.register("arc",at).register("classic",ot).register("classic-linear",ht).register("classic-linear-zero",ft).register("center-zero",dt).register("heritage-round",lt).register("rolling-tape",gt).register("line-scale",st),e}var Ht=Object.freeze({arc:at,classic:ot,"classic-linear":ht,"classic-linear-zero":ft,"center-zero":dt,"heritage-round":lt,"rolling-tape":gt,"line-scale":st});var Z=new WeakMap;function Zt(e,t,i,r){let n=Z.get(e);n&&n.destroy();let o=new i(e,t,r,qt(e));return Z.set(e,o),o}function Ut(e,t,i,r=document){return[...r.querySelectorAll(e||"[data-gaugeit]")].map(o=>{let a=Z.get(o);if(a)return a;let s=Br(o),c=new t(o,s,i,qt(o));return Z.set(o,c),c})}function mt(e){return Z.get(e)||null}function pt(e){let t=Z.get(e);return t?(t.destroy(),Z.delete(e),!0):!1}function Br(e){let t=Oe(e.dataset.gaugeitOptions,{});return e.dataset.gaugeitType&&(t.type=e.dataset.gaugeitType),e.dataset.gaugeitValue!==void 0&&(t.value=Number(e.dataset.gaugeitValue)),e.dataset.gaugeitMin!==void 0&&(t.min=Number(e.dataset.gaugeitMin)),e.dataset.gaugeitMax!==void 0&&(t.max=Number(e.dataset.gaugeitMax)),t}function qt(e){return{onDestroy(t){Z.get(e)===t&&Z.delete(e)}}}function Jt(e,t="gauge-it"){if(typeof customElements=="undefined"||typeof HTMLElement=="undefined")return null;if(customElements.get(t))return customElements.get(t);class i extends HTMLElement{static get observedAttributes(){return["value","min","max","type","options"]}constructor(){super(),this._gauge=null,this._mount=document.createElement("div"),this._mount.className="gaugeit-element__mount"}connectedCallback(){this._mount.isConnected||this.append(this._mount),this._gauge||(this._gauge=e(this._mount,this._readOptions()))}disconnectedCallback(){this._gauge&&(this._gauge.destroy(),this._gauge=null)}attributeChangedCallback(){this._gauge&&this._gauge.replaceOptions(this._readOptions())}get value(){return this._gauge?this._gauge.getValue():Number(this.getAttribute("value")||0)}set value(n){this.setAttribute("value",String(n))}get gauge(){return this._gauge}_readOptions(){let n=Oe(this.getAttribute("options"),{});return this.hasAttribute("type")&&(n.type=this.getAttribute("type")),this.hasAttribute("value")&&(n.value=Number(this.getAttribute("value"))),this.hasAttribute("min")&&(n.min=Number(this.getAttribute("min"))),this.hasAttribute("max")&&(n.max=Number(this.getAttribute("max"))),n}}return customElements.define(t,i),i}Bt(ne);function yt(e,t={}){let i=typeof e=="string"?document.querySelector(e):e;if(!i)throw new Error(`Gaugeit target not found: ${e}`);return Zt(i,t,re,ne)}function Kt(e,t){return ne.register(e,t),ai}function Qt(e="[data-gaugeit]",t=document){return Ut(e,re,ne,t)}function ei(e="gauge-it"){return Jt(yt,e)}var ti=Object.freeze({face:A,zones:N,ticks:Y,labels:R,pointer:P,readout:C,linearZones:Ye,linearTicks:Re,linearLabels:Pe,linearIndicator:Fe,zeroMarker:me,rollingTape:De,light:z}),ii=Object.freeze({angleToValue:At,arcPath:Ae,calculateGaugeBounds:ke,buildMinorValues:se,buildScaleValues:$,centeredArcAngles:Ot,findZoneForValue:q,gaugeSweep:ae,isClosedGauge:Ue,linearAxis:k,linearIndicatorNormalOffset:ce,linearNormalOffset:V,linearNormalSpan:j,linearYToSvg:J,linearPointToValue:Ct,niceInterval:oe,offsetLinearPoint:S,padBounds:be,polarPoint:b,resolveFaceBox:we,resolveReadoutPosition:ve,resolveScaleEndpointValues:ie,resolveZoneSegments:le,taperedArcPath:Ce,unionBounds:Ie,valueToAngle:L,valueToLinearPoint:M,valueToLinearRatio:He,resolveTapeInterval:ye,tapeMinorSpacing:_e,tapeMinorStep:xe,tapeValueOffset:ze,tapeWindowBox:ue,lightIsActive:Ve,resolveLightPosition:he}),ri=Ht,ni="0.1.0",ai=Object.freeze({VERSION:ni,Gauge:re,GaugeTypeRegistry:ge,createGauge:yt,registerGaugeType:Kt,autoMount:Qt,defineGaugeitElement:ei,getMountedGauge:mt,unmountGauge:pt,registry:ne,types:ri,layers:ti,geometry:ii,deepMerge:D,easingNames:Ke}),oi=ai;var si="gaugeit-styles";if(typeof document!="undefined"&&!document.getElementById(si)){let e=document.createElement("style");e.id=si,e.dataset.gaugeitStyles="standalone",e.textContent=vt,(document.head||document.documentElement).append(e)}var Hr=oi;return gi(Zr);})();
|