From ee9028f34e429f2c7c1632ca3e11ee5085ae229e Mon Sep 17 00:00:00 2001 From: dxstiny Date: Mon, 8 Jan 2024 11:45:35 +0100 Subject: [PATCH] fully match design --- dist/assets/index-_hjdk0vx.css | 1 - dist/assets/{index-OL0q35Pf.js => index-dSC3sH6u.js} | 4 ++-- dist/assets/index-ssf_1ATp.css | 1 + dist/index.html | 4 ++-- src/components/player/WaveAudio.vue | 10 ++++++++-- src/views/Insights.vue | 2 +- 6 files changed, 14 insertions(+), 8 deletions(-) delete mode 100644 dist/assets/index-_hjdk0vx.css rename dist/assets/{index-OL0q35Pf.js => index-dSC3sH6u.js} (99%) create mode 100644 dist/assets/index-ssf_1ATp.css diff --git a/dist/assets/index-_hjdk0vx.css b/dist/assets/index-_hjdk0vx.css deleted file mode 100644 index fe460d0..0000000 --- a/dist/assets/index-_hjdk0vx.css +++ /dev/null @@ -1 +0,0 @@ -:root{--fg-secondary: #18a74b;--fg-secondary-dk: #80dda0;--bg-contrast: #181c2f;--fg-contrast: white;--fg-base: #181c2f;--fg-base-dk: #8b8c91;--fg-base-dkr: #8b8c91;--bg-hover-ltr: #242424;--bg-hover-lt: #b3b3b31f;--bg-hover: #7c828f5e;--bg-hover-dk: #E3E7EB;--bg-gradient: linear-gradient(to left bottom, #18a74b, #80dda0);--bg-gradient-placeholder: linear-gradient(to left bottom, #00a53c, #00297f);--bg-base: white;--bg-base-lt: #f3f7fb;--bg-base-dk: #f3f7fb;--bg-input: var(--background);--bg-fixedPlaylistHeader: var(--bg-base-lt);--border-fixedPlaylistHeader: #D0D0D0;--border-base: #E3E7EB;--border-container: 1px solid var(--border-base);--ff-base: Poppins, sans-serif;--h-playlistEntry: 64px;--h-player: 88px;--h-player-mobile: 64px;--h-header: 64px;--supportsAmbient: true;--w-sidebar: 44px;--neutral: #374148;--success: #00c48b;--fail: #e85454;--warning: #c7aa19;--info: #189de4;--ff: Poppins, sans-serif}@media (prefers-color-scheme: dark){:root{--fg-secondary: #1ed760;--fg-secondary-dk: #217e41;--bg-contrast: white;--fg-contrast: #121212;--fg-base: white;--fg-base-dk: #a7a7a7;--fg-base-dkr: #999;--bg-hover-ltr: #242424;--bg-hover-lt: hsla(0, 0%, 100%, .04);--bg-hover: hsla(0, 0%, 100%, .3);--bg-hover-dk: hsla(0, 0%, 100%, .1);--bg-gradient: linear-gradient(to left bottom, #1ed760, #217e41);--bg-gradient-placeholder: linear-gradient(to left bottom, #00a53c, #00297f);--bg-base: #121212;--bg-base-lt: #181818;--bg-base-dk: black;--bg-input: var(--background-light);--bg-fixedPlaylistHeader: var(--bg-base-lt);--border-fixedPlaylistHeader: #303030;--border-base: hsla(0, 0%, 100%, .1);--border-container: 1px solid var(--border-base);--ff-base: Poppins, sans-serif;--h-playlistEntry: 64px;--h-player: 88px;--h-player-mobile: 64px;--h-header: 64px;--supportsAmbient: true;--w-sidebar: 44px}}:root{--w-scrollbar: 8px}::-webkit-scrollbar{width:var(--w-scrollbar);height:var(--w-scrollbar);padding:0;margin:0;z-index:101}::-webkit-scrollbar-track{border-radius:var(--w-scrollbar)}::-webkit-scrollbar-thumb{background:var(--bg-hover);border-radius:var(--w-scrollbar)}::-webkit-scrollbar-thumb:hover{background:var(--bg-hover-dk)}html,body{font-family:var(--ff);margin:0;color:var(--fg-base)}#app{display:grid;grid-template-rows:var(--h-header) 1fr var(--h-player);width:100vw;height:100vh;background:var(--bg-base);overflow:hidden}main{overflow:hidden auto}h1{margin-top:.5rem;margin-bottom:.5rem;font-size:1.875rem;line-height:2.25rem;font-weight:900}.relative{position:relative}.cursor-pointer{cursor:pointer}.text-xs{font-size:.75rem;line-height:1rem}.text-muted{color:var(--fg-base-dk)}.ms-fill{font-variation-settings:"FILL" 1}.text-4xl{font-size:2.25rem;line-height:2.5rem}.card[data-v-5d111e8c]{background:var(--bg-base-lt);border-radius:1em;border:var(--border-container);position:relative}.card[data-v-5d111e8c][data-v-5d111e8c]:before{content:"";border-radius:1em;box-shadow:0 0 10px #0000001a;position:absolute;top:0;right:0;bottom:0;left:0;z-index:-1}.card[data-v-5d111e8c].withHover[data-v-5d111e8c]:hover{background:var(--bg-hover-dk)}.card[data-v-5d111e8c].disabled[data-v-5d111e8c]{opacity:.5;cursor:not-allowed!important}.meters[data-v-0825ef4c]{display:flex;flex-direction:column;justify-content:center;gap:1em;padding:.5em;grid-column:1 / -1}.meters[data-v-0825ef4c] .stereo-field[data-v-0825ef4c]{max-width:400px;align-self:center;aspect-ratio:1}.meters[data-v-0825ef4c] .stereo-field[data-v-0825ef4c] canvas[data-v-0825ef4c]{width:100%;height:100%}.meters[data-v-0825ef4c] h4[data-v-0825ef4c]{margin-bottom:0}.meters[data-v-0825ef4c] .meter[data-v-0825ef4c]{display:grid;grid-template-columns:1ch 1fr;align-items:center;gap:1em}.meters[data-v-0825ef4c] .meter[data-v-0825ef4c] .label[data-v-0825ef4c]{font-size:.8em;color:var(--fg-base-dk)}.meters[data-v-0825ef4c] .meter[data-v-0825ef4c] meter[data-v-0825ef4c]{width:100%}.insights[data-v-0825ef4c]{display:grid;grid-template-columns:2fr 1fr;gap:1em;padding:1em}.insights[data-v-0825ef4c]>h1[data-v-0825ef4c]{grid-column:1 / -1}.insights[data-v-0825ef4c]>h1[data-v-0825ef4c] span[data-v-0825ef4c]{margin-right:.5em}.left[data-v-0825ef4c]{display:grid;grid-template-rows:1fr max-content;gap:1em}.left[data-v-0825ef4c] .loudness-chart[data-v-0825ef4c]{height:calc(2 * (100vh - var(--h-header) - 4px - var(--h-player) - 2.25rem - 5em) / 3)}.left[data-v-0825ef4c] .tonal-balance-chart[data-v-0825ef4c]{height:calc(1 * (100vh - var(--h-header) - 4px - var(--h-player) - 2.25rem - 5em) / 3)}.right[data-v-0825ef4c]{display:grid;grid-template-columns:repeat(3,1fr);gap:1em;align-content:start}.right[data-v-0825ef4c] .mode[data-v-0825ef4c]{padding:.5em;display:flex;flex-direction:column;align-items:center;width:100%}.right[data-v-0825ef4c] .mode[data-v-0825ef4c] .label[data-v-0825ef4c]{font-size:.8em;color:var(--fg-base-dk)}meter[data-v-0825ef4c]{--background: var(--bg-base);--optimum: var(--success);--sub-optimum: var(--warning);--sub-sub-optimum: var(--fail);display:block;width:100%}meter[data-v-0825ef4c]::-webkit-meter-bar{background:var(--background);border:2px solid var(--border-base)}meter[data-v-0825ef4c]:-moz-meter-optimum::-moz-meter-bar{background:var(--optimum)}meter[data-v-0825ef4c]::-webkit-meter-optimum-value{background:var(--optimum)}meter[data-v-0825ef4c]:-moz-meter-sub-optimum::-moz-meter-bar{background:var(--sub-optimum)}meter[data-v-0825ef4c]::-webkit-meter-suboptimum-value{background:var(--sub-optimum)}meter[data-v-0825ef4c]:-moz-meter-sub-sub-optimum::-moz-meter-bar{background:var(--sub-sub-optimum)}meter[data-v-0825ef4c]::-webkit-meter-even-less-good-value{background:var(--sub-sub-optimum)}header[data-v-46429bb4]{background:var(--bg-base-dk);height:calc(var(--h-header) - 20px);display:flex;flex-direction:row;justify-content:space-between;align-items:center;box-shadow:0 0 10px 0 var(--shadow);border-bottom:var(--border-container);padding:10px}header svg#logo[data-v-46429bb4]{fill:var(--fg-base);translate:5px 5px;height:100%}header a[data-v-46429bb4]:first-child{width:100%;height:100%}header svg#github[data-v-46429bb4]{width:20px;cursor:pointer}header svg path[data-v-46429bb4]{fill:var(--fg-base)}.progressBar__track[data-v-1a625635]{position:relative;width:100%;height:5px;margin:10px 0;border-radius:1000vmax;background-color:var(--fg-base-dkr)}.progressBar__progress[data-v-1a625635]{position:relative;height:5px;border-radius:1000vmax;background-color:var(--fg-base)}.progressBar__progress[data-v-1a625635].hover[data-v-1a625635]{background-color:var(--fg-secondary)}.progressBar__progress[data-v-1a625635].hover[data-v-1a625635][data-v-1a625635]:after{content:""}.progressBar__progress[data-v-1a625635][data-v-1a625635]:after{position:absolute;top:-5px;right:-5px;width:15px;height:15px;border-radius:50%;background-color:var(--fg-base)}#waveform{width:100%}#waveform wave,#waveform canvas{width:100%;height:calc(var(--h-player) / 2 - 1em)!important}.player .on-this-device>.material-symbols-rounded{color:var(--fg-secondary)}.player[data-v-921fb191]{background:var(--bg-base-lt);border-top:1px solid var(--border-base);z-index:2}.icon[data-v-921fb191]{color:var(--fg-base-dk)}.icon[data-v-921fb191][data-v-921fb191]:hover{color:var(--fg-base)}.desktop[data-v-921fb191]{display:grid;height:calc(var(--h-player) - 1px);grid-template-columns:1fr max-content;grid-template-areas:"controls aux";gap:10px;padding:0 1em}.desktop[data-v-921fb191] .song-info[data-v-921fb191]{grid-area:song-info;display:grid;align-items:center;grid-template-columns:calc(var(--h-player) - 40px) fit-content(100%) 20px 20px;gap:10px;overflow:hidden}.desktop[data-v-921fb191] .song-info[data-v-921fb191] .title-artist[data-v-921fb191]{overflow:hidden}.desktop[data-v-921fb191] .song-info[data-v-921fb191] div[data-v-921fb191]{margin:auto 0}.desktop[data-v-921fb191] .controls[data-v-921fb191]{grid-area:controls;display:grid;grid-template-columns:1fr;grid-template-rows:1fr auto}.desktop[data-v-921fb191] .controls[data-v-921fb191] .top[data-v-921fb191]{display:grid;grid-template-columns:40px;gap:1.5em;justify-content:center}.desktop[data-v-921fb191] .controls[data-v-921fb191] .top[data-v-921fb191] span[data-v-921fb191]{margin:auto 0;font-size:2.5rem}.desktop[data-v-921fb191] .controls[data-v-921fb191] .bottom .display[data-v-921fb191]{display:grid;grid-template-columns:4ch 10fr 4ch;margin-bottom:.5em;align-items:center}.desktop[data-v-921fb191] .aux[data-v-921fb191]{grid-area:aux;justify-content:end;display:grid;grid-template-columns:20px 20px minmax(auto,8vw);gap:1em;align-items:center}.desktop[data-v-921fb191] .aux[data-v-921fb191] a.icon[data-v-921fb191]{display:flex;text-decoration:none}.desktop[data-v-921fb191] .aux[data-v-921fb191] a.icon[data-v-921fb191].router-link-active[data-v-921fb191]{color:var(--fg-secondary)} diff --git a/dist/assets/index-OL0q35Pf.js b/dist/assets/index-dSC3sH6u.js similarity index 99% rename from dist/assets/index-OL0q35Pf.js rename to dist/assets/index-dSC3sH6u.js index 750b155..b5de7f0 100644 --- a/dist/assets/index-OL0q35Pf.js +++ b/dist/assets/index-dSC3sH6u.js @@ -19,10 +19,10 @@ var Qc=Object.defineProperty;var Jc=(e,t,i)=>t in e?Qc(e,t,{enumerable:!0,config * Released under the MIT License */class Kp{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,i,n,s){const r=i.listeners[s],o=i.duration;r.forEach(a=>a({chart:t,initial:i.initial,numSteps:o,currentStep:Math.min(n-i.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=gc.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let i=0;this._charts.forEach((n,s)=>{if(!n.running||!n.items.length)return;const r=n.items;let o=r.length-1,a=!1,l;for(;o>=0;--o)l=r[o],l._active?(l._total>n.duration&&(n.duration=l._total),l.tick(t),a=!0):(r[o]=r[r.length-1],r.pop());a&&(s.draw(),this._notify(s,n,t,"progress")),r.length||(n.running=!1,this._notify(s,n,t,"complete"),n.initial=!1),i+=r.length}),this._lastDate=t,i===0&&(this._running=!1)}_getAnims(t){const i=this._charts;let n=i.get(t);return n||(n={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},i.set(t,n)),n}listen(t,i,n){this._getAnims(t).listeners[i].push(n)}add(t,i){!i||!i.length||this._getAnims(t).items.push(...i)}has(t){return this._getAnims(t).items.length>0}start(t){const i=this._charts.get(t);i&&(i.running=!0,i.start=Date.now(),i.duration=i.items.reduce((n,s)=>Math.max(n,s._duration),0),this._refresh())}running(t){if(!this._running)return!1;const i=this._charts.get(t);return!(!i||!i.running||!i.items.length)}stop(t){const i=this._charts.get(t);if(!i||!i.items.length)return;const n=i.items;let s=n.length-1;for(;s>=0;--s)n[s].cancel();i.items=[],this._notify(t,i,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var ge=new Kp;const aa="transparent",Yp={boolean(e,t,i){return i>.5?t:e},color(e,t,i){const n=Zo(e||aa),s=n.valid&&Zo(t||aa);return s&&s.valid?s.mix(n,i).hexString():t},number(e,t,i){return e+(t-e)*i}};class Xp{constructor(t,i,n,s){const r=i[n];s=Mn([t.to,s,r,t.from]);const o=Mn([t.from,r,s]);this._active=!0,this._fn=t.fn||Yp[t.type||typeof o],this._easing=Qi[t.easing]||Qi.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=i,this._prop=n,this._from=o,this._to=s,this._promises=void 0}active(){return this._active}update(t,i,n){if(this._active){this._notify(!1);const s=this._target[this._prop],r=n-this._start,o=this._duration-r;this._start=n,this._duration=Math.floor(Math.max(o,t.duration)),this._total+=r,this._loop=!!t.loop,this._to=Mn([t.to,i,s,t.from]),this._from=Mn([t.from,s,i])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const i=t-this._start,n=this._duration,s=this._prop,r=this._from,o=this._loop,a=this._to;let l;if(this._active=r!==a&&(o||i1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[s]=this._fn(r,a,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((i,n)=>{t.push({res:i,rej:n})})}_notify(t){const i=t?"res":"rej",n=this._promises||[];for(let s=0;s{const r=t[s];if(!dt(r))return;const o={};for(const a of i)o[a]=r[a];(wt(r.properties)&&r.properties||[s]).forEach(a=>{(a===s||!n.has(a))&&n.set(a,o)})})}_animateOptions(t,i){const n=i.options,s=Zp(t,n);if(!s)return[];const r=this._createAnimations(s,n);return n.$shared&&Gp(t.options.$animations,n).then(()=>{t.options=n},()=>{}),r}_createAnimations(t,i){const n=this._properties,s=[],r=t.$animations||(t.$animations={}),o=Object.keys(i),a=Date.now();let l;for(l=o.length-1;l>=0;--l){const c=o[l];if(c.charAt(0)==="$")continue;if(c==="options"){s.push(...this._animateOptions(t,i));continue}const u=i[c];let h=r[c];const f=n.get(c);if(h)if(f&&h.active()){h.update(f,u,a);continue}else h.cancel();if(!f||!f.duration){t[c]=u;continue}r[c]=h=new Xp(f,t,c,u),s.push(h)}return s}update(t,i){if(this._properties.size===0){Object.assign(t,i);return}const n=this._createAnimations(t,i);if(n.length)return ge.add(this._chart,n),!0}}function Gp(e,t){const i=[],n=Object.keys(t);for(let s=0;s0||!i&&r<0)return s.index}return null}function fa(e,t){const{chart:i,_cachedMeta:n}=e,s=i._stacks||(i._stacks={}),{iScale:r,vScale:o,index:a}=n,l=r.axis,c=o.axis,u=eg(r,o,n),h=t.length;let f;for(let d=0;di[n].axis===t).shift()}function sg(e,t){return Ve(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function rg(e,t,i){return Ve(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:i,index:t,mode:"default",type:"data"})}function Li(e,t){const i=e.controller.index,n=e.vScale&&e.vScale.axis;if(n){t=t||e._parsed;for(const s of t){const r=s._stacks;if(!r||r[n]===void 0||r[n][i]===void 0)return;delete r[n][i],r[n]._visualValues!==void 0&&r[n]._visualValues[i]!==void 0&&delete r[n]._visualValues[i]}}}const zs=e=>e==="reset"||e==="none",da=(e,t)=>t?e:Object.assign({},e),og=(e,t,i)=>e&&!t.hidden&&t._stacked&&{keys:Tc(i,!0),values:null};class oi{constructor(t,i){this.chart=t,this._ctx=t.ctx,this.index=i,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=ua(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&Li(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,i=this._cachedMeta,n=this.getDataset(),s=(h,f,d,_)=>h==="x"?f:h==="r"?_:d,r=i.xAxisID=ut(n.xAxisID,js(t,"x")),o=i.yAxisID=ut(n.yAxisID,js(t,"y")),a=i.rAxisID=ut(n.rAxisID,js(t,"r")),l=i.indexAxis,c=i.iAxisID=s(l,r,o,a),u=i.vAxisID=s(l,o,r,a);i.xScale=this.getScaleForId(r),i.yScale=this.getScaleForId(o),i.rScale=this.getScaleForId(a),i.iScale=this.getScaleForId(c),i.vScale=this.getScaleForId(u)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const i=this._cachedMeta;return t===i.iScale?i.vScale:i.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&Yo(this._data,this),t._stacked&&Li(t)}_dataCheck(){const t=this.getDataset(),i=t.data||(t.data=[]),n=this._data;if(dt(i))this._data=tg(i);else if(n!==i){if(n){Yo(n,this);const s=this._cachedMeta;Li(s),s._parsed=[]}i&&Object.isExtensible(i)&&Hd(i,this),this._syncList=[],this._data=i}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const i=this._cachedMeta,n=this.getDataset();let s=!1;this._dataCheck();const r=i._stacked;i._stacked=ua(i.vScale,i),i.stack!==n.stack&&(s=!0,Li(i),i.stack=n.stack),this._resyncElements(t),(s||r!==i._stacked)&&fa(this,i._parsed)}configure(){const t=this.chart.config,i=t.datasetScopeKeys(this._type),n=t.getOptionScopes(this.getDataset(),i,!0);this.options=t.createResolver(n,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,i){const{_cachedMeta:n,_data:s}=this,{iScale:r,_stacked:o}=n,a=r.axis;let l=t===0&&i===s.length?!0:n._sorted,c=t>0&&n._parsed[t-1],u,h,f;if(this._parsing===!1)n._parsed=s,n._sorted=!0,f=s;else{wt(s[t])?f=this.parseArrayData(n,s,t,i):dt(s[t])?f=this.parseObjectData(n,s,t,i):f=this.parsePrimitiveData(n,s,t,i);const d=()=>h[a]===null||c&&h[a]y||h=0;--f)if(!_()){this.updateRangeFromParsed(c,t,d,l);break}}return c}getAllParsedValues(t){const i=this._cachedMeta._parsed,n=[];let s,r,o;for(s=0,r=i.length;s=0&&tthis.getContext(n,s,i),y=c.resolveNamedOptions(f,d,_,h);return y.$shared&&(y.$shared=l,r[o]=Object.freeze(da(y,l))),y}_resolveAnimations(t,i,n){const s=this.chart,r=this._cachedDataOpts,o=`animation-${i}`,a=r[o];if(a)return a;let l;if(s.options.animation!==!1){const u=this.chart.config,h=u.datasetAnimationScopeKeys(this._type,i),f=u.getOptionScopes(this.getDataset(),h);l=u.createResolver(f,this.getContext(t,n,i))}const c=new Rc(s,l&&l.animations);return l&&l._cacheable&&(r[o]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,i){return!i||zs(t)||this.chart._animationsDisabled}_getSharedOptions(t,i){const n=this.resolveDataElementOptions(t,i),s=this._sharedOptions,r=this.getSharedOptions(n),o=this.includeOptions(i,r)||r!==s;return this.updateSharedOptions(r,i,n),{sharedOptions:r,includeOptions:o}}updateElement(t,i,n,s){zs(s)?Object.assign(t,n):this._resolveAnimations(i,s).update(t,n)}updateSharedOptions(t,i,n){t&&!zs(i)&&this._resolveAnimations(void 0,i).update(t,n)}_setStyle(t,i,n,s){t.active=s;const r=this.getStyle(i,s);this._resolveAnimations(i,n,s).update(t,{options:!s&&this.getSharedOptions(r)||r})}removeHoverStyle(t,i,n){this._setStyle(t,n,"active",!1)}setHoverStyle(t,i,n){this._setStyle(t,n,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const i=this._data,n=this._cachedMeta.data;for(const[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];const s=n.length,r=i.length,o=Math.min(r,s);o&&this.parse(0,o),r>s?this._insertElements(s,r-s,t):r{for(c.length+=i,a=c.length-1;a>=o;a--)c[a]=c[a-i]};for(l(r),a=t;as-r))}return e._cache.$bar}function lg(e){const t=e.iScale,i=ag(t,e.type);let n=t._length,s,r,o,a;const l=()=>{o===32767||o===-32768||(ln(a)&&(n=Math.min(n,Math.abs(o-a)||n)),a=o)};for(s=0,r=i.length;s0?s[e-1]:null,a=eMath.abs(a)&&(l=a,c=o),t[i.axis]=c,t._custom={barStart:l,barEnd:c,start:s,end:r,min:o,max:a}}function Dc(e,t,i,n){return wt(e)?hg(e,t,i,n):t[i.axis]=i.parse(e,n),t}function pa(e,t,i,n){const s=e.iScale,r=e.vScale,o=s.getLabels(),a=s===r,l=[];let c,u,h,f;for(c=i,u=i+n;c=i?1:-1)}function dg(e){let t,i,n,s,r;return e.horizontal?(t=e.base>e.x,i="left",n="right"):(t=e.basel.controller.options.grouped),r=n.options.stacked,o=[],a=l=>{const c=l.controller.getParsed(i),u=c&&c[l.vScale.axis];if(pt(u)||isNaN(u))return!0};for(const l of s)if(!(i!==void 0&&a(l))&&((r===!1||o.indexOf(l.stack)===-1||r===void 0&&l.stack===void 0)&&o.push(l.stack),l.index===t))break;return o.length||o.push(void 0),o}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,i,n){const s=this._getStacks(t,n),r=i!==void 0?s.indexOf(i):-1;return r===-1?s.length-1:r}_getRuler(){const t=this.options,i=this._cachedMeta,n=i.iScale,s=[];let r,o;for(r=0,o=i.data.length;r0&&this.getParsed(i-1);for(let P=0;P=F){D.skip=!0;continue}const R=this.getParsed(P),B=pt(R[d]),W=D[f]=o.getPixelForValue(R[f],P),L=D[d]=r||B?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,R,l):R[d],P);D.skip=isNaN(W)||isNaN(L)||B,D.stop=P>0&&Math.abs(R[f]-C[f])>v,y&&(D.parsed=R,D.raw=c.data[P]),h&&(D.options=u||this.resolveDataElementOptions(P,M.active?"active":s)),A||this.updateElement(M,P,D,s),C=R}}getMaxOverflow(){const t=this._cachedMeta,i=t.dataset,n=i.options&&i.options.borderWidth||0,s=t.data||[];if(!s.length)return n;const r=s[0].size(this.resolveDataElementOptions(0)),o=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(n,r,o)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}tt(Hn,"id","line"),tt(Hn,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),tt(Hn,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class $n extends oi{getLabelAndValue(t){const i=this._cachedMeta,n=this.chart.data.labels||[],{xScale:s,yScale:r}=i,o=this.getParsed(t),a=s.getLabelForValue(o.x),l=r.getLabelForValue(o.y);return{label:n[t]||"",value:"("+a+", "+l+")"}}update(t){const i=this._cachedMeta,{data:n=[]}=i,s=this.chart._animationsDisabled;let{start:r,count:o}=yc(i,n,s);if(this._drawStart=r,this._drawCount=o,bc(i)&&(r=0,o=n.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:a,_dataset:l}=i;a._chart=this.chart,a._datasetIndex=this.index,a._decimated=!!l._decimated,a.points=n;const c=this.resolveDatasetElementOptions(t);c.segment=this.options.segment,this.updateElement(a,void 0,{animated:!s,options:c},t)}else this.datasetElementType&&(delete i.dataset,this.datasetElementType=!1);this.updateElements(n,r,o,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,i,n,s){const r=s==="reset",{iScale:o,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,u=this.resolveDataElementOptions(i,s),h=this.getSharedOptions(u),f=this.includeOptions(s,h),d=o.axis,_=a.axis,{spanGaps:y,segment:v}=this.options,A=Ci(y)?y:Number.POSITIVE_INFINITY,F=this.chart._animationsDisabled||r||s==="none";let S=i>0&&this.getParsed(i-1);for(let C=i;C0&&Math.abs(M[d]-S[d])>A,v&&(D.parsed=M,D.raw=c.data[C]),f&&(D.options=h||this.resolveDataElementOptions(C,P.active?"active":s)),F||this.updateElement(P,C,D,s),S=M}this.updateSharedOptions(h,s,u)}getMaxOverflow(){const t=this._cachedMeta,i=t.data||[];if(!this.options.showLine){let a=0;for(let l=i.length-1;l>=0;--l)a=Math.max(a,i[l].size(this.resolveDataElementOptions(l))/2);return a>0&&a}const n=t.dataset,s=n.options&&n.options.borderWidth||0;if(!i.length)return s;const r=i[0].size(this.resolveDataElementOptions(0)),o=i[i.length-1].size(this.resolveDataElementOptions(i.length-1));return Math.max(s,r,o)/2}}tt($n,"id","scatter"),tt($n,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),tt($n,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});function Ue(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class eo{constructor(t){tt(this,"options");this.options=t||{}}static override(t){Object.assign(eo.prototype,t)}init(){}formats(){return Ue()}parse(){return Ue()}format(){return Ue()}add(){return Ue()}diff(){return Ue()}startOf(){return Ue()}endOf(){return Ue()}}var yg={_date:eo};function bg(e,t,i,n){const{controller:s,data:r,_sorted:o}=e,a=s._cachedMeta.iScale;if(a&&t===a.axis&&t!=="r"&&o&&r.length){const l=a._reversePixels?zd:ti;if(n){if(s._sharedOptions){const c=r[0],u=typeof c.getRange=="function"&&c.getRange(t);if(u){const h=l(r,t,i-u),f=l(r,t,i+u);return{lo:h.lo,hi:f.hi}}}}else return l(r,t,i)}return{lo:0,hi:r.length-1}}function mn(e,t,i,n,s){const r=e.getSortedVisibleDatasetMetas(),o=i[t];for(let a=0,l=r.length;a{l[o](t[i],s)&&(r.push({element:l,datasetIndex:c,index:u}),a=a||l.inRange(t.x,t.y,s))}),n&&!a?[]:r}var wg={evaluateInteractionItems:mn,modes:{index(e,t,i,n){const s=Ye(t,e),r=i.axis||"x",o=i.includeInvisible||!1,a=i.intersect?Hs(e,s,r,n,o):$s(e,s,r,!1,n,o),l=[];return a.length?(e.getSortedVisibleDatasetMetas().forEach(c=>{const u=a[0].index,h=c.data[u];h&&!h.skip&&l.push({element:h,datasetIndex:c.index,index:u})}),l):[]},dataset(e,t,i,n){const s=Ye(t,e),r=i.axis||"xy",o=i.includeInvisible||!1;let a=i.intersect?Hs(e,s,r,n,o):$s(e,s,r,!1,n,o);if(a.length>0){const l=a[0].datasetIndex,c=e.getDatasetMeta(l).data;a=[];for(let u=0;ui.pos===t)}function ba(e,t){return e.filter(i=>Lc.indexOf(i.pos)===-1&&i.box.axis===t)}function Fi(e,t){return e.sort((i,n)=>{const s=t?n:i,r=t?i:n;return s.weight===r.weight?s.index-r.index:s.weight-r.weight})}function kg(e){const t=[];let i,n,s,r,o,a;for(i=0,n=(e||[]).length;ic.box.fullSize),!0),n=Fi(Ii(t,"left"),!0),s=Fi(Ii(t,"right")),r=Fi(Ii(t,"top"),!0),o=Fi(Ii(t,"bottom")),a=ba(t,"x"),l=ba(t,"y");return{fullSize:i,leftAndTop:n.concat(r),rightAndBottom:s.concat(l).concat(o).concat(a),chartArea:Ii(t,"chartArea"),vertical:n.concat(s).concat(l),horizontal:r.concat(o).concat(a)}}function va(e,t,i,n){return Math.max(e[i],t[i])+Math.max(e[n],t[n])}function Ic(e,t){e.top=Math.max(e.top,t.top),e.left=Math.max(e.left,t.left),e.bottom=Math.max(e.bottom,t.bottom),e.right=Math.max(e.right,t.right)}function Mg(e,t,i,n){const{pos:s,box:r}=i,o=e.maxPadding;if(!dt(s)){i.size&&(e[s]-=i.size);const h=n[i.stack]||{size:0,count:1};h.size=Math.max(h.size,i.horizontal?r.height:r.width),i.size=h.size/h.count,e[s]+=i.size}r.getPadding&&Ic(o,r.getPadding());const a=Math.max(0,t.outerWidth-va(o,e,"left","right")),l=Math.max(0,t.outerHeight-va(o,e,"top","bottom")),c=a!==e.w,u=l!==e.h;return e.w=a,e.h=l,i.horizontal?{same:c,other:u}:{same:u,other:c}}function Sg(e){const t=e.maxPadding;function i(n){const s=Math.max(t[n]-e[n],0);return e[n]+=s,s}e.y+=i("top"),e.x+=i("left"),i("right"),i("bottom")}function Og(e,t){const i=t.maxPadding;function n(s){const r={left:0,top:0,right:0,bottom:0};return s.forEach(o=>{r[o]=Math.max(t[o],i[o])}),r}return n(e?["left","right"]:["top","bottom"])}function zi(e,t,i,n){const s=[];let r,o,a,l,c,u;for(r=0,o=e.length,c=0;r{typeof y.beforeLayout=="function"&&y.beforeLayout()});const u=l.reduce((y,v)=>v.box.options&&v.box.options.display===!1?y:y+1,0)||1,h=Object.freeze({outerWidth:t,outerHeight:i,padding:s,availableWidth:r,availableHeight:o,vBoxMaxWidth:r/2/u,hBoxMaxHeight:o/2}),f=Object.assign({},s);Ic(f,Wt(n));const d=Object.assign({maxPadding:f,w:r,h:o,x:s.left,y:s.top},s),_=Ag(l.concat(c),h);zi(a.fullSize,d,h,_),zi(l,d,h,_),zi(c,d,h,_)&&zi(l,d,h,_),Sg(d),_a(a.leftAndTop,d,h,_),d.x+=d.w,d.y+=d.h,_a(a.rightAndBottom,d,h,_),e.chartArea={left:d.left,top:d.top,right:d.left+d.w,bottom:d.top+d.h,height:d.h,width:d.w},mt(a.chartArea,y=>{const v=y.box;Object.assign(v,e.chartArea),v.update(d.w,d.h,{left:0,top:0,right:0,bottom:0})})}};class Fc{acquireContext(t,i){}releaseContext(t){return!1}addEventListener(t,i,n){}removeEventListener(t,i,n){}getDevicePixelRatio(){return 1}getMaximumSize(t,i,n,s){return i=Math.max(0,i||t.width),n=n||t.height,{width:i,height:Math.max(0,s?Math.floor(i/s):n)}}isAttached(t){return!0}updateConfig(t){}}class Eg extends Fc{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Un="$chartjs",Rg={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},xa=e=>e===null||e==="";function Tg(e,t){const i=e.style,n=e.getAttribute("height"),s=e.getAttribute("width");if(e[Un]={initial:{height:n,width:s,style:{display:i.display,height:i.height,width:i.width}}},i.display=i.display||"block",i.boxSizing=i.boxSizing||"border-box",xa(s)){const r=na(e,"width");r!==void 0&&(e.width=r)}if(xa(n))if(e.style.height==="")e.height=e.width/(t||2);else{const r=na(e,"height");r!==void 0&&(e.height=r)}return e}const Bc=Lp?{passive:!0}:!1;function Dg(e,t,i){e.addEventListener(t,i,Bc)}function Lg(e,t,i){e.canvas.removeEventListener(t,i,Bc)}function Ig(e,t){const i=Rg[e.type]||e.type,{x:n,y:s}=Ye(e,t);return{type:i,chart:t,native:e,x:n!==void 0?n:null,y:s!==void 0?s:null}}function rs(e,t){for(const i of e)if(i===t||i.contains(t))return!0}function Fg(e,t,i){const n=e.canvas,s=new MutationObserver(r=>{let o=!1;for(const a of r)o=o||rs(a.addedNodes,n),o=o&&!rs(a.removedNodes,n);o&&i()});return s.observe(document,{childList:!0,subtree:!0}),s}function Bg(e,t,i){const n=e.canvas,s=new MutationObserver(r=>{let o=!1;for(const a of r)o=o||rs(a.removedNodes,n),o=o&&!rs(a.addedNodes,n);o&&i()});return s.observe(document,{childList:!0,subtree:!0}),s}const un=new Map;let wa=0;function Wc(){const e=window.devicePixelRatio;e!==wa&&(wa=e,un.forEach((t,i)=>{i.currentDevicePixelRatio!==e&&t()}))}function Wg(e,t){un.size||window.addEventListener("resize",Wc),un.set(e,t)}function Vg(e){un.delete(e),un.size||window.removeEventListener("resize",Wc)}function jg(e,t,i){const n=e.canvas,s=n&&to(n);if(!s)return;const r=mc((a,l)=>{const c=s.clientWidth;i(a,l),c{const l=a[0],c=l.contentRect.width,u=l.contentRect.height;c===0&&u===0||r(c,u)});return o.observe(s),Wg(e,r),o}function Us(e,t,i){i&&i.disconnect(),t==="resize"&&Vg(e)}function zg(e,t,i){const n=e.canvas,s=mc(r=>{e.ctx!==null&&i(Ig(r,e))},e);return Dg(n,t,s),s}class Ng extends Fc{acquireContext(t,i){const n=t&&t.getContext&&t.getContext("2d");return n&&n.canvas===t?(Tg(t,i),n):null}releaseContext(t){const i=t.canvas;if(!i[Un])return!1;const n=i[Un].initial;["height","width"].forEach(r=>{const o=n[r];pt(o)?i.removeAttribute(r):i.setAttribute(r,o)});const s=n.style||{};return Object.keys(s).forEach(r=>{i.style[r]=s[r]}),i.width=i.width,delete i[Un],!0}addEventListener(t,i,n){this.removeEventListener(t,i);const s=t.$proxies||(t.$proxies={}),o={attach:Fg,detach:Bg,resize:jg}[i]||zg;s[i]=o(t,i,n)}removeEventListener(t,i){const n=t.$proxies||(t.$proxies={}),s=n[i];if(!s)return;({attach:Us,detach:Us,resize:Us}[i]||Lg)(t,i,s),n[i]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,i,n,s){return Dp(t,i,n,s)}isAttached(t){const i=to(t);return!!(i&&i.isConnected)}}function Hg(e){return!Jr()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?Eg:Ng}var Wn;let je=(Wn=class{constructor(){tt(this,"x");tt(this,"y");tt(this,"active",!1);tt(this,"options");tt(this,"$animations")}tooltipPosition(t){const{x:i,y:n}=this.getProps(["x","y"],t);return{x:i,y:n}}hasValue(){return Ci(this.x)&&Ci(this.y)}getProps(t,i){const n=this.$animations;if(!i||!n)return this;const s={};return t.forEach(r=>{s[r]=n[r]&&n[r].active()?n[r]._to:this[r]}),s}},tt(Wn,"defaults",{}),tt(Wn,"defaultRoutes"),Wn);function $g(e,t){const i=e.options.ticks,n=Ug(e),s=Math.min(i.maxTicksLimit||n,n),r=i.major.enabled?Kg(t):[],o=r.length,a=r[0],l=r[o-1],c=[];if(o>s)return Yg(t,c,r,o/s),c;const u=qg(r,t,s);if(o>0){let h,f;const d=o>1?Math.round((l-a)/(o-1)):null;for(Rn(t,c,u,pt(d)?0:a-d,a),h=0,f=o-1;hs)return l}return Math.max(s,1)}function Kg(e){const t=[];let i,n;for(i=0,n=e.length;ie==="left"?"right":e==="right"?"left":e,ka=(e,t,i)=>t==="top"||t==="left"?e[t]+i:e[t]-i,Pa=(e,t)=>Math.min(t||e,e);function Aa(e,t){const i=[],n=e.length/t,s=e.length;let r=0;for(;ro+a)))return l}function Qg(e,t){mt(e,i=>{const n=i.gc,s=n.length/2;let r;if(s>t){for(r=0;rn?n:i,n=s&&i>n?i:n,{min:qt(i,qt(n,i)),max:qt(n,qt(i,n))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){vt(this.options.beforeUpdate,[this])}update(t,i,n){const{beginAtZero:s,grace:r,ticks:o}=this.options,a=o.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=i,this._margins=n=Object.assign({left:0,right:0,top:0,bottom:0},n),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+n.left+n.right:this.height+n.top+n.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=hp(this,r,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a=r||n<=1||!this.isHorizontal()){this.labelRotation=s;return}const u=this._getLabelSizes(),h=u.widest.width,f=u.highest.height,d=Gt(this.chart.width-h,0,this.maxWidth);a=t.offset?this.maxWidth/n:d/(n-1),h+6>a&&(a=d/(n-(t.offset?.5:1)),l=this.maxHeight-Bi(t.grid)-i.padding-Ca(t.title,this.chart.options.font),c=Math.sqrt(h*h+f*f),o=Hr(Math.min(Math.asin(Gt((u.highest.height+6)/a,-1,1)),Math.asin(Gt(l/c,-1,1))-Math.asin(Gt(f/c,-1,1)))),o=Math.max(s,Math.min(r,o))),this.labelRotation=o}afterCalculateLabelRotation(){vt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){vt(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:i,options:{ticks:n,title:s,grid:r}}=this,o=this._isVisible(),a=this.isHorizontal();if(o){const l=Ca(s,i.options.font);if(a?(t.width=this.maxWidth,t.height=Bi(r)+l):(t.height=this.maxHeight,t.width=Bi(r)+l),n.display&&this.ticks.length){const{first:c,last:u,widest:h,highest:f}=this._getLabelSizes(),d=n.padding*2,_=Ee(this.labelRotation),y=Math.cos(_),v=Math.sin(_);if(a){const A=n.mirror?0:v*h.width+y*f.height;t.height=Math.min(this.maxHeight,t.height+A+d)}else{const A=n.mirror?0:y*h.width+v*f.height;t.width=Math.min(this.maxWidth,t.width+A+d)}this._calculatePadding(c,u,v,y)}}this._handleMargins(),a?(this.width=this._length=i.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=i.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,i,n,s){const{ticks:{align:r,padding:o},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,h=this.right-this.getPixelForTick(this.ticks.length-1);let f=0,d=0;l?c?(f=s*t.width,d=n*i.height):(f=n*t.height,d=s*i.width):r==="start"?d=i.width:r==="end"?f=t.width:r!=="inner"&&(f=t.width/2,d=i.width/2),this.paddingLeft=Math.max((f-u+o)*this.width/(this.width-u),0),this.paddingRight=Math.max((d-h+o)*this.width/(this.width-h),0)}else{let u=i.height/2,h=t.height/2;r==="start"?(u=0,h=t.height):r==="end"&&(u=i.height,h=0),this.paddingTop=u+o,this.paddingBottom=h+o}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){vt(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:i}=this.options;return i==="top"||i==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let i,n;for(i=0,n=t.length;i({width:o[B]||0,height:a[B]||0});return{first:R(0),last:R(i-1),widest:R(M),highest:R(D),widths:o,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,i){return NaN}getValueForPixel(t){}getPixelForTick(t){const i=this.ticks;return t<0||t>i.length-1?null:this.getPixelForValue(i[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const i=this._startPixel+t*this._length;return jd(this._alignToPixels?$e(this.chart,i,0):i)}getDecimalForPixel(t){const i=(t-this._startPixel)/this._length;return this._reversePixels?1-i:i}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:i}=this;return t<0&&i<0?i:t>0&&i>0?t:0}getContext(t){const i=this.ticks||[];if(t>=0&&ta*s?a/n:l/s:l*s0}_computeGridLineItems(t){const i=this.axis,n=this.chart,s=this.options,{grid:r,position:o,border:a}=s,l=r.offset,c=this.isHorizontal(),h=this.ticks.length+(l?1:0),f=Bi(r),d=[],_=a.setContext(this.getContext()),y=_.display?_.width:0,v=y/2,A=function(O){return $e(n,O,y)};let F,S,C,P,M,D,R,B,W,L,j,I;if(o==="top")F=A(this.bottom),D=this.bottom-f,B=F-v,L=A(t.top)+v,I=t.bottom;else if(o==="bottom")F=A(this.top),L=t.top,I=A(t.bottom)-v,D=F+v,B=this.top+f;else if(o==="left")F=A(this.right),M=this.right-f,R=F-v,W=A(t.left)+v,j=t.right;else if(o==="right")F=A(this.left),W=t.left,j=A(t.right)-v,M=F+v,R=this.left+f;else if(i==="x"){if(o==="center")F=A((t.top+t.bottom)/2+.5);else if(dt(o)){const O=Object.keys(o)[0],m=o[O];F=A(this.chart.scales[O].getPixelForValue(m))}L=t.top,I=t.bottom,D=F+v,B=D+f}else if(i==="y"){if(o==="center")F=A((t.left+t.right)/2);else if(dt(o)){const O=Object.keys(o)[0],m=o[O];F=A(this.chart.scales[O].getPixelForValue(m))}M=F-v,R=M-f,W=t.left,j=t.right}const b=ut(s.ticks.maxTicksLimit,h),x=Math.max(1,Math.ceil(h/b));for(S=0;S0&&(J-=Z/2);break}p={left:J,top:G,width:Z+V.width,height:H+V.height,color:x.backdropColor}}v.push({label:C,font:B,textOffset:j,options:{rotation:y,color:m,strokeColor:g,strokeWidth:T,textAlign:k,textBaseline:I,translation:[P,M],backdrop:p}})}return v}_getXAxisLabelAlignment(){const{position:t,ticks:i}=this.options;if(-Ee(this.labelRotation))return t==="top"?"left":"right";let s="center";return i.align==="start"?s="left":i.align==="end"?s="right":i.align==="inner"&&(s="inner"),s}_getYAxisLabelAlignment(t){const{position:i,ticks:{crossAlign:n,mirror:s,padding:r}}=this.options,o=this._getLabelSizes(),a=t+r,l=o.widest.width;let c,u;return i==="left"?s?(u=this.right+r,n==="near"?c="left":n==="center"?(c="center",u+=l/2):(c="right",u+=l)):(u=this.right-a,n==="near"?c="right":n==="center"?(c="center",u-=l/2):(c="left",u=this.left)):i==="right"?s?(u=this.left+r,n==="near"?c="right":n==="center"?(c="center",u-=l/2):(c="left",u-=l)):(u=this.left+a,n==="near"?c="left":n==="center"?(c="center",u+=l/2):(c="right",u=this.right)):c="right",{textAlign:c,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,i=this.options.position;if(i==="left"||i==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(i==="top"||i==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:i},left:n,top:s,width:r,height:o}=this;i&&(t.save(),t.fillStyle=i,t.fillRect(n,s,r,o),t.restore())}getLineWidthForValue(t){const i=this.options.grid;if(!this._isVisible()||!i.display)return 0;const s=this.ticks.findIndex(r=>r.value===t);return s>=0?i.setContext(this.getContext(s)).lineWidth:0}drawGrid(t){const i=this.options.grid,n=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let r,o;const a=(l,c,u)=>{!u.width||!u.color||(n.save(),n.lineWidth=u.width,n.strokeStyle=u.color,n.setLineDash(u.borderDash||[]),n.lineDashOffset=u.borderDashOffset,n.beginPath(),n.moveTo(l.x,l.y),n.lineTo(c.x,c.y),n.stroke(),n.restore())};if(i.display)for(r=0,o=s.length;r{this.draw(r)}}]:[{z:n,draw:r=>{this.drawBackground(),this.drawGrid(r),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:i,draw:r=>{this.drawLabels(r)}}]}getMatchingVisibleMetas(t){const i=this.chart.getSortedVisibleDatasetMetas(),n=this.axis+"AxisID",s=[];let r,o;for(r=0,o=i.length;r{const n=i.split("."),s=n.pop(),r=[e].concat(n).join("."),o=t[i].split("."),a=o.pop(),l=o.join(".");kt.route(r,s,l,a)})}function rm(e){return"id"in e&&"defaults"in e}class om{constructor(){this.controllers=new Tn(oi,"datasets",!0),this.elements=new Tn(je,"elements"),this.plugins=new Tn(Object,"plugins"),this.scales=new Tn(hi,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,i,n){[...i].forEach(s=>{const r=n||this._getRegistryForType(s);n||r.isForType(s)||r===this.plugins&&s.id?this._exec(t,r,s):mt(s,o=>{const a=n||this._getRegistryForType(o);this._exec(t,a,o)})})}_exec(t,i,n){const s=Nr(t);vt(n["before"+s],[],n),i[t](n),vt(n["after"+s],[],n)}_getRegistryForType(t){for(let i=0;ir.filter(a=>!o.some(l=>a.plugin.id===l.plugin.id));this._notify(s(i,n),t,"stop"),this._notify(s(n,i),t,"start")}}function lm(e){const t={},i=[],n=Object.keys(ue.plugins.items);for(let r=0;r1&&Ma(e[0].toLowerCase());if(n)return n}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function Sa(e,t,i){if(i[t+"AxisID"]===e)return{axis:t}}function gm(e,t){if(t.data&&t.data.datasets){const i=t.data.datasets.filter(n=>n.xAxisID===e||n.yAxisID===e);if(i.length)return Sa(e,"x",i[0])||Sa(e,"y",i[0])}return{}}function mm(e,t){const i=ai[e.type]||{scales:{}},n=t.scales||{},s=fr(e.type,t),r=Object.create(null);return Object.keys(n).forEach(o=>{const a=n[o];if(!dt(a))return console.error(`Invalid scale configuration for scale: ${o}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${o}`);const l=dr(o,a,gm(o,e),kt.scales[a.type]),c=dm(l,s),u=i.scales||{};r[o]=Gi(Object.create(null),[{axis:l},a,u[l],u[c]])}),e.data.datasets.forEach(o=>{const a=o.type||e.type,l=o.indexAxis||fr(a,t),u=(ai[a]||{}).scales||{};Object.keys(u).forEach(h=>{const f=fm(h,l),d=o[f+"AxisID"]||f;r[d]=r[d]||Object.create(null),Gi(r[d],[{axis:f},n[d],u[h]])})}),Object.keys(r).forEach(o=>{const a=r[o];Gi(a,[kt.scales[a.type],kt.scale])}),r}function Vc(e){const t=e.options||(e.options={});t.plugins=ut(t.plugins,{}),t.scales=mm(e,t)}function jc(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function ym(e){return e=e||{},e.data=jc(e.data),Vc(e),e}const Oa=new Map,zc=new Set;function Dn(e,t){let i=Oa.get(e);return i||(i=t(),Oa.set(e,i),zc.add(i)),i}const Wi=(e,t,i)=>{const n=Ai(t,i);n!==void 0&&e.add(n)};class bm{constructor(t){this._config=ym(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=jc(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),Vc(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Dn(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,i){return Dn(`${t}.transition.${i}`,()=>[[`datasets.${t}.transitions.${i}`,`transitions.${i}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,i){return Dn(`${t}-${i}`,()=>[[`datasets.${t}.elements.${i}`,`datasets.${t}`,`elements.${i}`,""]])}pluginScopeKeys(t){const i=t.id,n=this.type;return Dn(`${n}-plugin-${i}`,()=>[[`plugins.${i}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,i){const n=this._scopeCache;let s=n.get(t);return(!s||i)&&(s=new Map,n.set(t,s)),s}getOptionScopes(t,i,n){const{options:s,type:r}=this,o=this._cachedScopes(t,n),a=o.get(i);if(a)return a;const l=new Set;i.forEach(u=>{t&&(l.add(t),u.forEach(h=>Wi(l,t,h))),u.forEach(h=>Wi(l,s,h)),u.forEach(h=>Wi(l,ai[r]||{},h)),u.forEach(h=>Wi(l,kt,h)),u.forEach(h=>Wi(l,ur,h))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),zc.has(i)&&o.set(i,c),c}chartOptionScopes(){const{options:t,type:i}=this;return[t,ai[i]||{},kt.datasets[i]||{},{type:i},kt,ur]}resolveNamedOptions(t,i,n,s=[""]){const r={$shared:!0},{resolver:o,subPrefixes:a}=Ea(this._resolverCache,t,s);let l=o;if(_m(o,i)){r.$shared=!1,n=We(n)?n():n;const c=this.createResolver(t,n,a);l=Mi(o,n,c)}for(const c of i)r[c]=l[c];return r}createResolver(t,i,n=[""],s){const{resolver:r}=Ea(this._resolverCache,t,n);return dt(i)?Mi(r,i,void 0,s):r}}function Ea(e,t,i){let n=e.get(t);n||(n=new Map,e.set(t,n));const s=i.join();let r=n.get(s);return r||(r={resolver:Gr(t,i),subPrefixes:i.filter(a=>!a.toLowerCase().includes("hover"))},n.set(s,r)),r}const vm=e=>dt(e)&&Object.getOwnPropertyNames(e).some(t=>We(e[t]));function _m(e,t){const{isScriptable:i,isIndexable:n}=kc(e);for(const s of t){const r=i(s),o=n(s),a=(o||r)&&e[s];if(r&&(We(a)||vm(a))||o&&wt(a))return!0}return!1}var xm="4.4.1";const wm=["top","bottom","left","right","chartArea"];function Ra(e,t){return e==="top"||e==="bottom"||wm.indexOf(e)===-1&&t==="x"}function Ta(e,t){return function(i,n){return i[e]===n[e]?i[t]-n[t]:i[e]-n[e]}}function Da(e){const t=e.chart,i=t.options.animation;t.notifyPlugins("afterRender"),vt(i&&i.onComplete,[e],t)}function km(e){const t=e.chart,i=t.options.animation;vt(i&&i.onProgress,[e],t)}function Nc(e){return Jr()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const qn={},La=e=>{const t=Nc(e);return Object.values(qn).filter(i=>i.canvas===t).pop()};function Pm(e,t,i){const n=Object.keys(e);for(const s of n){const r=+s;if(r>=t){const o=e[s];delete e[s],(i>0||r>t)&&(e[r+i]=o)}}}function Am(e,t,i,n){return!i||e.type==="mouseout"?null:n?t:e}function Ln(e,t,i){return e.options.clip?e[i]:t[i]}function Cm(e,t){const{xScale:i,yScale:n}=e;return i&&n?{left:Ln(i,t,"left"),right:Ln(i,t,"right"),top:Ln(n,t,"top"),bottom:Ln(n,t,"bottom")}:t}class se{static register(...t){ue.add(...t),Ia()}static unregister(...t){ue.remove(...t),Ia()}constructor(t,i){const n=this.config=new bm(i),s=Nc(t),r=La(s);if(r)throw new Error("Canvas is already in use. Chart with ID '"+r.id+"' must be destroyed before the canvas with ID '"+r.canvas.id+"' can be reused.");const o=n.createResolver(n.chartOptionScopes(),this.getContext());this.platform=new(n.platform||Hg(s)),this.platform.updateConfig(n);const a=this.platform.acquireContext(s,o.aspectRatio),l=a&&a.canvas,c=l&&l.height,u=l&&l.width;if(this.id=Md(),this.ctx=a,this.canvas=l,this.width=u,this.height=c,this._options=o,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new am,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=$d(h=>this.update(h),o.resizeDelay||0),this._dataChanges=[],qn[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}ge.listen(this,"complete",Da),ge.listen(this,"progress",km),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:i},width:n,height:s,_aspectRatio:r}=this;return pt(t)?i&&r?r:s?n/s:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return ue}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():ia(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Jo(this.canvas,this.ctx),this}stop(){return ge.stop(this),this}resize(t,i){ge.running(this)?this._resizeBeforeDraw={width:t,height:i}:this._resize(t,i)}_resize(t,i){const n=this.options,s=this.canvas,r=n.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(s,t,i,r),a=n.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,ia(this,a,!0)&&(this.notifyPlugins("resize",{size:o}),vt(n.onResize,[this,o],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const i=this.options.scales||{};mt(i,(n,s)=>{n.id=s})}buildOrUpdateScales(){const t=this.options,i=t.scales,n=this.scales,s=Object.keys(n).reduce((o,a)=>(o[a]=!1,o),{});let r=[];i&&(r=r.concat(Object.keys(i).map(o=>{const a=i[o],l=dr(o,a),c=l==="r",u=l==="x";return{options:a,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),mt(r,o=>{const a=o.options,l=a.id,c=dr(l,a),u=ut(a.type,o.dtype);(a.position===void 0||Ra(a.position,c)!==Ra(o.dposition))&&(a.position=o.dposition),s[l]=!0;let h=null;if(l in n&&n[l].type===u)h=n[l];else{const f=ue.getScale(u);h=new f({id:l,type:u,ctx:this.ctx,chart:this}),n[h.id]=h}h.init(a,t)}),mt(s,(o,a)=>{o||delete n[a]}),mt(n,o=>{te.configure(this,o,o.options),te.addBox(this,o)})}_updateMetasets(){const t=this._metasets,i=this.data.datasets.length,n=t.length;if(t.sort((s,r)=>s.index-r.index),n>i){for(let s=i;si.length&&delete this._stacks,t.forEach((n,s)=>{i.filter(r=>r===n._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){const t=[],i=this.data.datasets;let n,s;for(this._removeUnreferencedMetasets(),n=0,s=i.length;n{this.getDatasetMeta(i).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const i=this.config;i.update();const n=this._options=i.createResolver(i.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!n.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const r=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let c=0,u=this.data.datasets.length;c{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Ta("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){mt(this.scales,t=>{te.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,i=new Set(Object.keys(this._listeners)),n=new Set(t.events);(!$o(i,n)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,i=this._getUniformDataChanges()||[];for(const{method:n,start:s,count:r}of i){const o=n==="_removeElements"?-r:r;Pm(t,s,o)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const i=this.data.datasets.length,n=r=>new Set(t.filter(o=>o[0]===r).map((o,a)=>a+","+o.splice(1).join(","))),s=n(0);for(let r=1;rr.split(",")).map(r=>({method:r[1],start:+r[2],count:+r[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;te.update(this,this.width,this.height,t);const i=this.chartArea,n=i.width<=0||i.height<=0;this._layers=[],mt(this.boxes,s=>{n&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,r)=>{s._idx=r}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let i=0,n=this.data.datasets.length;i=0;--i)this._drawDataset(t[i]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const i=this.ctx,n=t._clip,s=!n.disabled,r=Cm(t,this.chartArea),o={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",o)!==!1&&(s&&Yr(i,{left:n.left===!1?0:r.left-n.left,right:n.right===!1?this.width:r.right+n.right,top:n.top===!1?0:r.top-n.top,bottom:n.bottom===!1?this.height:r.bottom+n.bottom}),t.controller.draw(),s&&Xr(i),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(t){return ve(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,i,n,s){const r=wg.modes[i];return typeof r=="function"?r(this,t,n,s):[]}getDatasetMeta(t){const i=this.data.datasets[t],n=this._metasets;let s=n.filter(r=>r&&r._dataset===i).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:i&&i.order||0,index:t,_dataset:i,_parsed:[],_sorted:!1},n.push(s)),s}getContext(){return this.$context||(this.$context=Ve(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const i=this.data.datasets[t];if(!i)return!1;const n=this.getDatasetMeta(t);return typeof n.hidden=="boolean"?!n.hidden:!i.hidden}setDatasetVisibility(t,i){const n=this.getDatasetMeta(t);n.hidden=!i}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,i,n){const s=n?"show":"hide",r=this.getDatasetMeta(t),o=r.controller._resolveAnimations(void 0,s);ln(i)?(r.data[i].hidden=!n,this.update()):(this.setDatasetVisibility(t,n),o.update(r,{visible:n}),this.update(a=>a.datasetIndex===t?s:void 0))}hide(t,i){this._updateVisibility(t,i,!1)}show(t,i){this._updateVisibility(t,i,!0)}_destroyDatasetMeta(t){const i=this._metasets[t];i&&i.controller&&i.controller._destroy(),delete this._metasets[t]}_stop(){let t,i;for(this.stop(),ge.remove(this),t=0,i=this.data.datasets.length;t{i.addEventListener(this,r,o),t[r]=o},s=(r,o,a)=>{r.offsetX=o,r.offsetY=a,this._eventHandler(r)};mt(this.options.events,r=>n(r,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,i=this.platform,n=(l,c)=>{i.addEventListener(this,l,c),t[l]=c},s=(l,c)=>{t[l]&&(i.removeEventListener(this,l,c),delete t[l])},r=(l,c)=>{this.canvas&&this.resize(l,c)};let o;const a=()=>{s("attach",a),this.attached=!0,this.resize(),n("resize",r),n("detach",o)};o=()=>{this.attached=!1,s("resize",r),this._stop(),this._resize(0,0),n("attach",a)},i.isAttached(this.canvas)?a():o()}unbindEvents(){mt(this._listeners,(t,i)=>{this.platform.removeEventListener(this,i,t)}),this._listeners={},mt(this._responsiveListeners,(t,i)=>{this.platform.removeEventListener(this,i,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,i,n){const s=n?"set":"remove";let r,o,a,l;for(i==="dataset"&&(r=this.getDatasetMeta(t[0].datasetIndex),r.controller["_"+s+"DatasetHoverStyle"]()),a=0,l=t.length;a{const a=this.getDatasetMeta(r);if(!a)throw new Error("No dataset found at index "+r);return{datasetIndex:r,element:a.data[o],index:o}});!ts(n,i)&&(this._active=n,this._lastEvent=null,this._updateHoverStyles(n,i))}notifyPlugins(t,i,n){return this._plugins.notify(this,t,i,n)}isPluginEnabled(t){return this._plugins._cache.filter(i=>i.plugin.id===t).length===1}_updateHoverStyles(t,i,n){const s=this.options.hover,r=(l,c)=>l.filter(u=>!c.some(h=>u.datasetIndex===h.datasetIndex&&u.index===h.index)),o=r(i,t),a=n?t:r(t,i);o.length&&this.updateHoverStyle(o,s.mode,!1),a.length&&s.mode&&this.updateHoverStyle(a,s.mode,!0)}_eventHandler(t,i){const n={event:t,replay:i,cancelable:!0,inChartArea:this.isPointInArea(t)},s=o=>(o.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",n,s)===!1)return;const r=this._handleEvent(t,i,n.inChartArea);return n.cancelable=!1,this.notifyPlugins("afterEvent",n,s),(r||n.changed)&&this.render(),this}_handleEvent(t,i,n){const{_active:s=[],options:r}=this,o=i,a=this._getActiveElements(t,s,n,o),l=Dd(t),c=Am(t,this._lastEvent,n,l);n&&(this._lastEvent=null,vt(r.onHover,[t,a,this],this),l&&vt(r.onClick,[t,a,this],this));const u=!ts(a,s);return(u||i)&&(this._active=a,this._updateHoverStyles(a,s,i)),this._lastEvent=c,u}_getActiveElements(t,i,n,s){if(t.type==="mouseout")return[];if(!n)return i;const r=this.options.hover;return this.getElementsAtEventForMode(t,r.mode,r,s)}}tt(se,"defaults",kt),tt(se,"instances",qn),tt(se,"overrides",ai),tt(se,"registry",ue),tt(se,"version",xm),tt(se,"getChart",La);function Ia(){return mt(se.instances,e=>e._plugins.invalidate())}function Hc(e,t,i=t){e.lineCap=ut(i.borderCapStyle,t.borderCapStyle),e.setLineDash(ut(i.borderDash,t.borderDash)),e.lineDashOffset=ut(i.borderDashOffset,t.borderDashOffset),e.lineJoin=ut(i.borderJoinStyle,t.borderJoinStyle),e.lineWidth=ut(i.borderWidth,t.borderWidth),e.strokeStyle=ut(i.borderColor,t.borderColor)}function Mm(e,t,i){e.lineTo(i.x,i.y)}function Sm(e){return e.stepped?ip:e.tension||e.cubicInterpolationMode==="monotone"?np:Mm}function $c(e,t,i={}){const n=e.length,{start:s=0,end:r=n-1}=i,{start:o,end:a}=t,l=Math.max(s,o),c=Math.min(r,a),u=sa&&r>a;return{count:n,start:l,loop:t.loop,ilen:c(o+(c?a-C:C))%r,S=()=>{y!==v&&(e.lineTo(u,v),e.lineTo(u,y),e.lineTo(u,A))};for(l&&(d=s[F(0)],e.moveTo(d.x,d.y)),f=0;f<=a;++f){if(d=s[F(f)],d.skip)continue;const C=d.x,P=d.y,M=C|0;M===_?(Pv&&(v=P),u=(h*u+C)/++h):(S(),e.lineTo(C,P),_=M,h=0,y=v=P),A=P}S()}function pr(e){const t=e.options,i=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!i?Em:Om}function Rm(e){return e.stepped?Ip:e.tension||e.cubicInterpolationMode==="monotone"?Fp:Xe}function Tm(e,t,i,n){let s=t._path;s||(s=t._path=new Path2D,t.path(s,i,n)&&s.closePath()),Hc(e,t.options),e.stroke(s)}function Dm(e,t,i,n){const{segments:s,options:r}=t,o=pr(t);for(const a of s)Hc(e,r,a.style),e.beginPath(),o(e,t,a,{start:i,end:i+n-1})&&e.closePath(),e.stroke()}const Lm=typeof Path2D=="function";function Im(e,t,i,n){Lm&&!t.options.segment?Tm(e,t,i,n):Dm(e,t,i,n)}class Ni extends je{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,i){const n=this.options;if((n.tension||n.cubicInterpolationMode==="monotone")&&!n.stepped&&!this._pointsUpdated){const s=n.spanGaps?this._loop:this._fullLoop;Mp(this._points,n,t,s,i),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=$p(this,this.options.segment))}first(){const t=this.segments,i=this.points;return t.length&&i[t[0].start]}last(){const t=this.segments,i=this.points,n=t.length;return n&&i[t[n-1].end]}interpolate(t,i){const n=this.options,s=t[i],r=this.points,o=zp(this,{property:i,start:s,end:s});if(!o.length)return;const a=[],l=Rm(n);let c,u;for(c=0,u=o.length;ct!=="borderDash"&&t!=="fill"});function Fa(e,t,i,n){const s=e.options,{[i]:r}=e.getProps([i],n);return Math.abs(t-r){let{boxHeight:i=t,boxWidth:n=t}=e;return e.usePointStyle&&(i=Math.min(i,t),n=e.pointStyleWidth||Math.min(n,t)),{boxWidth:n,boxHeight:i,itemHeight:Math.max(t,i)}},zm=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class Wa extends je{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,i,n){this.maxWidth=t,this.maxHeight=i,this._margins=n,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let i=vt(t.generateLabels,[this.chart],this)||[];t.filter&&(i=i.filter(n=>t.filter(n,this.chart.data))),t.sort&&(i=i.sort((n,s)=>t.sort(n,s,this.chart.data))),this.options.reverse&&i.reverse(),this.legendItems=i}fit(){const{options:t,ctx:i}=this;if(!t.display){this.width=this.height=0;return}const n=t.labels,s=Mt(n.font),r=s.size,o=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=Ba(n,r);let c,u;i.font=s.string,this.isHorizontal()?(c=this.maxWidth,u=this._fitRows(o,r,a,l)+10):(u=this.maxHeight,c=this._fitCols(o,s,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(u,t.maxHeight||this.maxHeight)}_fitRows(t,i,n,s){const{ctx:r,maxWidth:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],u=s+a;let h=t;r.textAlign="left",r.textBaseline="middle";let f=-1,d=-u;return this.legendItems.forEach((_,y)=>{const v=n+i/2+r.measureText(_.text).width;(y===0||c[c.length-1]+v+2*a>o)&&(h+=u,c[c.length-(y>0?0:1)]=0,d+=u,f++),l[y]={left:0,top:d,row:f,width:v,height:s},c[c.length-1]+=v+a}),h}_fitCols(t,i,n,s){const{ctx:r,maxHeight:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],u=o-t;let h=a,f=0,d=0,_=0,y=0;return this.legendItems.forEach((v,A)=>{const{itemWidth:F,itemHeight:S}=Nm(n,i,r,v,s);A>0&&d+S+2*a>u&&(h+=f+a,c.push({width:f,height:d}),_+=f+a,y++,f=d=0),l[A]={left:_,top:d,col:y,width:F,height:S},f=Math.max(f,F),d+=S+a}),h+=f,c.push({width:f,height:d}),h}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:i,options:{align:n,labels:{padding:s},rtl:r}}=this,o=vi(r,this.left,this.width);if(this.isHorizontal()){let a=0,l=Lt(n,this.left+s,this.right-this.lineWidths[a]);for(const c of i)a!==c.row&&(a=c.row,l=Lt(n,this.left+s,this.right-this.lineWidths[a])),c.top+=this.top+t+s,c.left=o.leftForLtr(o.x(l),c.width),l+=c.width+s}else{let a=0,l=Lt(n,this.top+t+s,this.bottom-this.columnSizes[a].height);for(const c of i)c.col!==a&&(a=c.col,l=Lt(n,this.top+t+s,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+s,c.left=o.leftForLtr(o.x(c.left),c.width),l+=c.height+s}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;Yr(t,this),this._draw(),Xr(t)}}_draw(){const{options:t,columnSizes:i,lineWidths:n,ctx:s}=this,{align:r,labels:o}=t,a=kt.color,l=vi(t.rtl,this.left,this.width),c=Mt(o.font),{padding:u}=o,h=c.size,f=h/2;let d;this.drawTitle(),s.textAlign=l.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=c.string;const{boxWidth:_,boxHeight:y,itemHeight:v}=Ba(o,h),A=function(M,D,R){if(isNaN(_)||_<=0||isNaN(y)||y<0)return;s.save();const B=ut(R.lineWidth,1);if(s.fillStyle=ut(R.fillStyle,a),s.lineCap=ut(R.lineCap,"butt"),s.lineDashOffset=ut(R.lineDashOffset,0),s.lineJoin=ut(R.lineJoin,"miter"),s.lineWidth=B,s.strokeStyle=ut(R.strokeStyle,a),s.setLineDash(ut(R.lineDash,[])),o.usePointStyle){const W={radius:y*Math.SQRT2/2,pointStyle:R.pointStyle,rotation:R.rotation,borderWidth:B},L=l.xPlus(M,_/2),j=D+f;_c(s,W,L,j,o.pointStyleWidth&&_)}else{const W=D+Math.max((h-y)/2,0),L=l.leftForLtr(M,_),j=si(R.borderRadius);s.beginPath(),Object.values(j).some(I=>I!==0)?cn(s,{x:L,y:W,w:_,h:y,radius:j}):s.rect(L,W,_,y),s.fill(),B!==0&&s.stroke()}s.restore()},F=function(M,D,R){li(s,R.text,M,D+v/2,c,{strikethrough:R.hidden,textAlign:l.textAlign(R.textAlign)})},S=this.isHorizontal(),C=this._computeTitleHeight();S?d={x:Lt(r,this.left+u,this.right-n[0]),y:this.top+u+C,line:0}:d={x:this.left+u,y:Lt(r,this.top+C+u,this.bottom-i[0].height),line:0},Sc(this.ctx,t.textDirection);const P=v+u;this.legendItems.forEach((M,D)=>{s.strokeStyle=M.fontColor,s.fillStyle=M.fontColor;const R=s.measureText(M.text).width,B=l.textAlign(M.textAlign||(M.textAlign=o.textAlign)),W=_+f+R;let L=d.x,j=d.y;l.setWidth(this.width),S?D>0&&L+W+u>this.right&&(j=d.y+=P,d.line++,L=d.x=Lt(r,this.left+u,this.right-n[d.line])):D>0&&j+P>this.bottom&&(L=d.x=L+i[d.line].width+u,d.line++,j=d.y=Lt(r,this.top+C+u,this.bottom-i[d.line].height));const I=l.x(L);if(A(I,j,M),L=Ud(B,L+_+f,S?L+W:this.right,t.rtl),F(l.x(L),j,M),S)d.x+=W+u;else if(typeof M.text!="string"){const b=c.lineHeight;d.y+=qc(M,b)+u}else d.y+=P}),Oc(this.ctx,t.textDirection)}drawTitle(){const t=this.options,i=t.title,n=Mt(i.font),s=Wt(i.padding);if(!i.display)return;const r=vi(t.rtl,this.left,this.width),o=this.ctx,a=i.position,l=n.size/2,c=s.top+l;let u,h=this.left,f=this.width;if(this.isHorizontal())f=Math.max(...this.lineWidths),u=this.top+c,h=Lt(t.align,h,this.right-f);else{const _=this.columnSizes.reduce((y,v)=>Math.max(y,v.height),0);u=c+Lt(t.align,this.top,this.bottom-_-t.labels.padding-this._computeTitleHeight())}const d=Lt(a,h,h+f);o.textAlign=r.textAlign(Ur(a)),o.textBaseline="middle",o.strokeStyle=i.color,o.fillStyle=i.color,o.font=n.string,li(o,i.text,d,u,n)}_computeTitleHeight(){const t=this.options.title,i=Mt(t.font),n=Wt(t.padding);return t.display?i.lineHeight+n.height:0}_getLegendItemAt(t,i){let n,s,r;if(Je(t,this.left,this.right)&&Je(i,this.top,this.bottom)){for(r=this.legendHitBoxes,n=0;nr.length>o.length?r:o)),t+i.size/2+n.measureText(s).width}function $m(e,t,i){let n=e;return typeof t.text!="string"&&(n=qc(t,i)),n}function qc(e,t){const i=e.text?e.text.length:0;return t*i}function Um(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var qm={id:"legend",_element:Wa,start(e,t,i){const n=e.legend=new Wa({ctx:e.ctx,options:i,chart:e});te.configure(e,n,i),te.addBox(e,n)},stop(e){te.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,i){const n=e.legend;te.configure(e,n,i),n.options=i},afterUpdate(e){const t=e.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(e,t){t.replay||e.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(e,t,i){const n=t.datasetIndex,s=i.chart;s.isDatasetVisible(n)?(s.hide(n),t.hidden=!0):(s.show(n),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){const t=e.data.datasets,{labels:{usePointStyle:i,pointStyle:n,textAlign:s,color:r,useBorderRadius:o,borderRadius:a}}=e.legend.options;return e._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(i?0:void 0),u=Wt(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:r,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(u.width+u.height)/4,strokeStyle:c.borderColor,pointStyle:n||c.pointStyle,rotation:c.rotation,textAlign:s||c.textAlign,borderRadius:o&&(a||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:e=>e.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:e=>!e.startsWith("on"),labels:{_scriptable:e=>!["generateLabels","filter","sort"].includes(e)}}};class Kc extends je{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,i){const n=this.options;if(this.left=0,this.top=0,!n.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=i;const s=wt(n.text)?n.text.length:1;this._padding=Wt(n.padding);const r=s*Mt(n.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=r:this.width=r}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:i,left:n,bottom:s,right:r,options:o}=this,a=o.align;let l=0,c,u,h;return this.isHorizontal()?(u=Lt(a,n,r),h=i+t,c=r-n):(o.position==="left"?(u=n+t,h=Lt(a,s,i),l=Ct*-.5):(u=r-t,h=Lt(a,i,s),l=Ct*.5),c=s-i),{titleX:u,titleY:h,maxWidth:c,rotation:l}}draw(){const t=this.ctx,i=this.options;if(!i.display)return;const n=Mt(i.font),r=n.lineHeight/2+this._padding.top,{titleX:o,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(r);li(t,i.text,0,0,n,{color:i.color,maxWidth:l,rotation:c,textAlign:Ur(i.align),textBaseline:"middle",translation:[o,a]})}}function Km(e,t){const i=new Kc({ctx:e.ctx,options:t,chart:e});te.configure(e,i,t),te.addBox(e,i),e.titleBlock=i}var Ym={id:"title",_element:Kc,start(e,t,i){Km(e,i)},stop(e){const t=e.titleBlock;te.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,i){const n=e.titleBlock;te.configure(e,n,i),n.options=i},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Hi={average(e){if(!e.length)return!1;let t,i,n=0,s=0,r=0;for(t=0,i=e.length;t-1?e.split(` -`):e}function Xm(e,t){const{element:i,datasetIndex:n,index:s}=t,r=e.getDatasetMeta(n).controller,{label:o,value:a}=r.getLabelAndValue(s);return{chart:e,label:o,parsed:r.getParsed(s),raw:e.data.datasets[n].data[s],formattedValue:a,dataset:r.getDataset(),dataIndex:s,datasetIndex:n,element:i}}function Va(e,t){const i=e.chart.ctx,{body:n,footer:s,title:r}=e,{boxWidth:o,boxHeight:a}=t,l=Mt(t.bodyFont),c=Mt(t.titleFont),u=Mt(t.footerFont),h=r.length,f=s.length,d=n.length,_=Wt(t.padding);let y=_.height,v=0,A=n.reduce((C,P)=>C+P.before.length+P.lines.length+P.after.length,0);if(A+=e.beforeBody.length+e.afterBody.length,h&&(y+=h*c.lineHeight+(h-1)*t.titleSpacing+t.titleMarginBottom),A){const C=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;y+=d*C+(A-d)*l.lineHeight+(A-1)*t.bodySpacing}f&&(y+=t.footerMarginTop+f*u.lineHeight+(f-1)*t.footerSpacing);let F=0;const S=function(C){v=Math.max(v,i.measureText(C).width+F)};return i.save(),i.font=c.string,mt(e.title,S),i.font=l.string,mt(e.beforeBody.concat(e.afterBody),S),F=t.displayColors?o+2+t.boxPadding:0,mt(n,C=>{mt(C.before,S),mt(C.lines,S),mt(C.after,S)}),F=0,i.font=u.string,mt(e.footer,S),i.restore(),v+=_.width,{width:v,height:y}}function Gm(e,t){const{y:i,height:n}=t;return ie.height-n/2?"bottom":"center"}function Zm(e,t,i,n){const{x:s,width:r}=n,o=i.caretSize+i.caretPadding;if(e==="left"&&s+r+o>t.width||e==="right"&&s-r-o<0)return!0}function Qm(e,t,i,n){const{x:s,width:r}=i,{width:o,chartArea:{left:a,right:l}}=e;let c="center";return n==="center"?c=s<=(a+l)/2?"left":"right":s<=r/2?c="left":s>=o-r/2&&(c="right"),Zm(c,e,t,i)&&(c="center"),c}function ja(e,t,i){const n=i.yAlign||t.yAlign||Gm(e,i);return{xAlign:i.xAlign||t.xAlign||Qm(e,t,i,n),yAlign:n}}function Jm(e,t){let{x:i,width:n}=e;return t==="right"?i-=n:t==="center"&&(i-=n/2),i}function ty(e,t,i){let{y:n,height:s}=e;return t==="top"?n+=i:t==="bottom"?n-=s+i:n-=s/2,n}function za(e,t,i,n){const{caretSize:s,caretPadding:r,cornerRadius:o}=e,{xAlign:a,yAlign:l}=i,c=s+r,{topLeft:u,topRight:h,bottomLeft:f,bottomRight:d}=si(o);let _=Jm(t,a);const y=ty(t,l,c);return l==="center"?a==="left"?_+=c:a==="right"&&(_-=c):a==="left"?_-=Math.max(u,f)+s:a==="right"&&(_+=Math.max(h,d)+s),{x:Gt(_,0,n.width-t.width),y:Gt(y,0,n.height-t.height)}}function In(e,t,i){const n=Wt(i.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-n.right:e.x+n.left}function Na(e){return ce([],me(e))}function ey(e,t,i){return Ve(e,{tooltip:t,tooltipItems:i,type:"tooltip"})}function Ha(e,t){const i=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return i?e.override(i):e}const Yc={beforeTitle:pe,title(e){if(e.length>0){const t=e[0],i=t.chart.data.labels,n=i?i.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(n>0&&t.dataIndex"u"?Yc[t].call(i,n):s}class gr extends je{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const i=this.chart,n=this.options.setContext(this.getContext()),s=n.enabled&&i.options.animation&&n.animations,r=new Rc(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(r)),r}getContext(){return this.$context||(this.$context=ey(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,i){const{callbacks:n}=i,s=jt(n,"beforeTitle",this,t),r=jt(n,"title",this,t),o=jt(n,"afterTitle",this,t);let a=[];return a=ce(a,me(s)),a=ce(a,me(r)),a=ce(a,me(o)),a}getBeforeBody(t,i){return Na(jt(i.callbacks,"beforeBody",this,t))}getBody(t,i){const{callbacks:n}=i,s=[];return mt(t,r=>{const o={before:[],lines:[],after:[]},a=Ha(n,r);ce(o.before,me(jt(a,"beforeLabel",this,r))),ce(o.lines,jt(a,"label",this,r)),ce(o.after,me(jt(a,"afterLabel",this,r))),s.push(o)}),s}getAfterBody(t,i){return Na(jt(i.callbacks,"afterBody",this,t))}getFooter(t,i){const{callbacks:n}=i,s=jt(n,"beforeFooter",this,t),r=jt(n,"footer",this,t),o=jt(n,"afterFooter",this,t);let a=[];return a=ce(a,me(s)),a=ce(a,me(r)),a=ce(a,me(o)),a}_createItems(t){const i=this._active,n=this.chart.data,s=[],r=[],o=[];let a=[],l,c;for(l=0,c=i.length;lt.filter(u,h,f,n))),t.itemSort&&(a=a.sort((u,h)=>t.itemSort(u,h,n))),mt(a,u=>{const h=Ha(t.callbacks,u);s.push(jt(h,"labelColor",this,u)),r.push(jt(h,"labelPointStyle",this,u)),o.push(jt(h,"labelTextColor",this,u))}),this.labelColors=s,this.labelPointStyles=r,this.labelTextColors=o,this.dataPoints=a,a}update(t,i){const n=this.options.setContext(this.getContext()),s=this._active;let r,o=[];if(!s.length)this.opacity!==0&&(r={opacity:0});else{const a=Hi[n.position].call(this,s,this._eventPosition);o=this._createItems(n),this.title=this.getTitle(o,n),this.beforeBody=this.getBeforeBody(o,n),this.body=this.getBody(o,n),this.afterBody=this.getAfterBody(o,n),this.footer=this.getFooter(o,n);const l=this._size=Va(this,n),c=Object.assign({},a,l),u=ja(this.chart,n,c),h=za(n,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,r={opacity:1,x:h.x,y:h.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=o,this.$context=void 0,r&&this._resolveAnimations().update(this,r),t&&n.external&&n.external.call(this,{chart:this.chart,tooltip:this,replay:i})}drawCaret(t,i,n,s){const r=this.getCaretPosition(t,n,s);i.lineTo(r.x1,r.y1),i.lineTo(r.x2,r.y2),i.lineTo(r.x3,r.y3)}getCaretPosition(t,i,n){const{xAlign:s,yAlign:r}=this,{caretSize:o,cornerRadius:a}=n,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:h}=si(a),{x:f,y:d}=t,{width:_,height:y}=i;let v,A,F,S,C,P;return r==="center"?(C=d+y/2,s==="left"?(v=f,A=v-o,S=C+o,P=C-o):(v=f+_,A=v+o,S=C-o,P=C+o),F=v):(s==="left"?A=f+Math.max(l,u)+o:s==="right"?A=f+_-Math.max(c,h)-o:A=this.caretX,r==="top"?(S=d,C=S-o,v=A-o,F=A+o):(S=d+y,C=S+o,v=A+o,F=A-o),P=S),{x1:v,x2:A,x3:F,y1:S,y2:C,y3:P}}drawTitle(t,i,n){const s=this.title,r=s.length;let o,a,l;if(r){const c=vi(n.rtl,this.x,this.width);for(t.x=In(this,n.titleAlign,n),i.textAlign=c.textAlign(n.titleAlign),i.textBaseline="middle",o=Mt(n.titleFont),a=n.titleSpacing,i.fillStyle=n.titleColor,i.font=o.string,l=0;lF!==0)?(t.beginPath(),t.fillStyle=r.multiKeyBackground,cn(t,{x:y,y:_,w:c,h:l,radius:A}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),cn(t,{x:v,y:_+1,w:c-2,h:l-2,radius:A}),t.fill()):(t.fillStyle=r.multiKeyBackground,t.fillRect(y,_,c,l),t.strokeRect(y,_,c,l),t.fillStyle=o.backgroundColor,t.fillRect(v,_+1,c-2,l-2))}t.fillStyle=this.labelTextColors[n]}drawBody(t,i,n){const{body:s}=this,{bodySpacing:r,bodyAlign:o,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:u}=n,h=Mt(n.bodyFont);let f=h.lineHeight,d=0;const _=vi(n.rtl,this.x,this.width),y=function(R){i.fillText(R,_.x(t.x+d),t.y+f/2),t.y+=f+r},v=_.textAlign(o);let A,F,S,C,P,M,D;for(i.textAlign=o,i.textBaseline="middle",i.font=h.string,t.x=In(this,v,n),i.fillStyle=n.bodyColor,mt(this.beforeBody,y),d=a&&v!=="right"?o==="center"?c/2+u:c+2+u:0,C=0,M=s.length;C0&&i.stroke()}_updateAnimationTarget(t){const i=this.chart,n=this.$animations,s=n&&n.x,r=n&&n.y;if(s||r){const o=Hi[t.position].call(this,this._active,this._eventPosition);if(!o)return;const a=this._size=Va(this,t),l=Object.assign({},o,this._size),c=ja(i,t,l),u=za(t,l,c,i);(s._to!==u.x||r._to!==u.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=o.x,this.caretY=o.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(t){const i=this.options.setContext(this.getContext());let n=this.opacity;if(!n)return;this._updateAnimationTarget(i);const s={width:this.width,height:this.height},r={x:this.x,y:this.y};n=Math.abs(n)<.001?0:n;const o=Wt(i.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;i.enabled&&a&&(t.save(),t.globalAlpha=n,this.drawBackground(r,t,s,i),Sc(t,i.textDirection),r.y+=o.top,this.drawTitle(r,t,i),this.drawBody(r,t,i),this.drawFooter(r,t,i),Oc(t,i.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,i){const n=this._active,s=t.map(({datasetIndex:a,index:l})=>{const c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),r=!ts(n,s),o=this._positionChanged(s,i);(r||o)&&(this._active=s,this._eventPosition=i,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,i,n=!0){if(i&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,r=this._active||[],o=this._getActiveElements(t,r,i,n),a=this._positionChanged(o,t),l=i||!ts(o,r)||a;return l&&(this._active=o,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,i))),l}_getActiveElements(t,i,n,s){const r=this.options;if(t.type==="mouseout")return[];if(!s)return i.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);const o=this.chart.getElementsAtEventForMode(t,r.mode,r,n);return r.reverse&&o.reverse(),o}_positionChanged(t,i){const{caretX:n,caretY:s,options:r}=this,o=Hi[r.position].call(this,t,i);return o!==!1&&(n!==o.x||s!==o.y)}}tt(gr,"positioners",Hi);var iy={id:"tooltip",_element:gr,positioners:Hi,afterInit(e,t,i){i&&(e.tooltip=new gr({chart:e,options:i}))},beforeUpdate(e,t,i){e.tooltip&&e.tooltip.initialize(i)},reset(e,t,i){e.tooltip&&e.tooltip.initialize(i)},afterDraw(e){const t=e.tooltip;if(t&&t._willRender()){const i={tooltip:t};if(e.notifyPlugins("beforeTooltipDraw",{...i,cancelable:!0})===!1)return;t.draw(e.ctx),e.notifyPlugins("afterTooltipDraw",i)}},afterEvent(e,t){if(e.tooltip){const i=t.replay;e.tooltip.handleEvent(t.event,i,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(e,t)=>t.bodyFont.size,boxWidth:(e,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:Yc},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:e=>e!=="filter"&&e!=="itemSort"&&e!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const ny=(e,t,i,n)=>(typeof t=="string"?(i=e.push(t)-1,n.unshift({index:i,label:t})):isNaN(t)&&(i=null),i);function sy(e,t,i,n){const s=e.indexOf(t);if(s===-1)return ny(e,t,i,n);const r=e.lastIndexOf(t);return s!==r?i:s}const ry=(e,t)=>e===null?null:Gt(Math.round(e),0,t);function $a(e){const t=this.getLabels();return e>=0&&ei.length-1?null:this.getPixelForValue(i[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}tt(mr,"id","category"),tt(mr,"defaults",{ticks:{callback:$a}});function oy(e,t){const i=[],{bounds:s,step:r,min:o,max:a,precision:l,count:c,maxTicks:u,maxDigits:h,includeBounds:f}=e,d=r||1,_=u-1,{min:y,max:v}=t,A=!pt(o),F=!pt(a),S=!pt(c),C=(v-y)/(h+1);let P=qo((v-y)/_/d)*d,M,D,R,B;if(P<1e-14&&!A&&!F)return[{value:y},{value:v}];B=Math.ceil(v/P)-Math.floor(y/P),B>_&&(P=qo(B*P/_/d)*d),pt(l)||(M=Math.pow(10,l),P=Math.ceil(P*M)/M),s==="ticks"?(D=Math.floor(y/P)*P,R=Math.ceil(v/P)*P):(D=y,R=v),A&&F&&r&&Bd((a-o)/r,P/1e3)?(B=Math.round(Math.min((a-o)/P,u)),P=(a-o)/B,D=o,R=a):S?(D=A?o:D,R=F?a:R,B=c-1,P=(R-D)/B):(B=(R-D)/P,Zi(B,Math.round(B),P/1e3)?B=Math.round(B):B=Math.ceil(B));const W=Math.max(Ko(P),Ko(D));M=Math.pow(10,pt(l)?W:l),D=Math.round(D*M)/M,R=Math.round(R*M)/M;let L=0;for(A&&(f&&D!==o?(i.push({value:o}),Da)break;i.push({value:j})}return F&&f&&R!==a?i.length&&Zi(i[i.length-1].value,a,Ua(a,C,e))?i[i.length-1].value=a:i.push({value:a}):(!F||R===a)&&i.push({value:R}),i}function Ua(e,t,{horizontal:i,minRotation:n}){const s=Ee(n),r=(i?Math.sin(s):Math.cos(s))||.001,o=.75*t*(""+e).length;return Math.min(t/r,o)}class os extends hi{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,i){return pt(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:i,maxDefined:n}=this.getUserBounds();let{min:s,max:r}=this;const o=l=>s=i?s:l,a=l=>r=n?r:l;if(t){const l=de(s),c=de(r);l<0&&c<0?a(0):l>0&&c>0&&o(0)}if(s===r){let l=r===0?1:Math.abs(r*.05);a(r+l),t||o(s-l)}this.min=s,this.max=r}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:i,stepSize:n}=t,s;return n?(s=Math.ceil(this.max/n)-Math.floor(this.min/n)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${n} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),i=i||11),i&&(s=Math.min(i,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,i=t.ticks;let n=this.getTickLimit();n=Math.max(2,n);const s={maxTicks:n,bounds:t.bounds,min:t.min,max:t.max,precision:i.precision,step:i.stepSize,count:i.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:i.minRotation||0,includeBounds:i.includeBounds!==!1},r=this._range||this,o=oy(s,r);return t.bounds==="ticks"&&hc(o,this,"value"),t.reverse?(o.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),o}configure(){const t=this.ticks;let i=this.min,n=this.max;if(super.configure(),this.options.offset&&t.length){const s=(n-i)/Math.max(t.length-1,1)/2;i-=s,n+=s}this._startValue=i,this._endValue=n,this._valueRange=n-i}getLabelForValue(t){return Kr(t,this.chart.options.locale,this.options.ticks.format)}}class yr extends os{determineDataLimits(){const{min:t,max:i}=this.getMinMax(!0);this.min=Et(t)?t:0,this.max=Et(i)?i:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),i=t?this.width:this.height,n=Ee(this.options.ticks.minRotation),s=(t?Math.sin(n):Math.cos(n))||.001,r=this._resolveTickFontOptions(0);return Math.ceil(i/Math.min(40,r.lineHeight/s))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}tt(yr,"id","linear"),tt(yr,"defaults",{ticks:{callback:As.formatters.numeric}});const hn=e=>Math.floor(Oe(e)),qe=(e,t)=>Math.pow(10,hn(e)+t);function qa(e){return e/Math.pow(10,hn(e))===1}function Ka(e,t,i){const n=Math.pow(10,i),s=Math.floor(e/n);return Math.ceil(t/n)-s}function ay(e,t){const i=t-e;let n=hn(i);for(;Ka(e,t,n)>10;)n++;for(;Ka(e,t,n)<10;)n--;return Math.min(n,hn(e))}function ly(e,{min:t,max:i}){t=qt(e.min,t);const n=[],s=hn(t);let r=ay(t,i),o=r<0?Math.pow(10,Math.abs(r)):1;const a=Math.pow(10,r),l=s>r?Math.pow(10,s):0,c=Math.round((t-l)*o)/o,u=Math.floor((t-l)/a/10)*a*10;let h=Math.floor((c-u)/Math.pow(10,r)),f=qt(e.min,Math.round((l+u+h*Math.pow(10,r))*o)/o);for(;f=10?h=h<15?15:20:h++,h>=20&&(r++,h=2,o=r>=0?1:o),f=Math.round((l+u+h*Math.pow(10,r))*o)/o;const d=qt(e.max,f);return n.push({value:d,major:qa(d),significand:h}),n}class br extends hi{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,i){const n=os.prototype.parse.apply(this,[t,i]);if(n===0){this._zero=!0;return}return Et(n)&&n>0?n:null}determineDataLimits(){const{min:t,max:i}=this.getMinMax(!0);this.min=Et(t)?Math.max(0,t):null,this.max=Et(i)?Math.max(0,i):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!Et(this._userMin)&&(this.min=t===qe(this.min,0)?qe(this.min,-1):qe(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:i}=this.getUserBounds();let n=this.min,s=this.max;const r=a=>n=t?n:a,o=a=>s=i?s:a;n===s&&(n<=0?(r(1),o(10)):(r(qe(n,-1)),o(qe(s,1)))),n<=0&&r(qe(s,-1)),s<=0&&o(qe(n,1)),this.min=n,this.max=s}buildTicks(){const t=this.options,i={min:this._userMin,max:this._userMax},n=ly(i,this);return t.bounds==="ticks"&&hc(n,this,"value"),t.reverse?(n.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),n}getLabelForValue(t){return t===void 0?"0":Kr(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Oe(t),this._valueRange=Oe(this.max)-Oe(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Oe(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const i=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+i*this._valueRange)}}tt(br,"id","logarithmic"),tt(br,"defaults",{ticks:{callback:As.formatters.logarithmic,major:{enabled:!0}}});function vr(e){const t=e.ticks;if(t.display&&e.display){const i=Wt(t.backdropPadding);return ut(t.font&&t.font.size,kt.font.size)+i.height}return 0}function cy(e,t,i){return i=wt(i)?i:[i],{w:ep(e,t.string,i),h:i.length*t.lineHeight}}function Ya(e,t,i,n,s){return e===n||e===s?{start:t-i/2,end:t+i/2}:es?{start:t-i,end:t}:{start:t,end:t+i}}function uy(e){const t={l:e.left+e._padding.left,r:e.right-e._padding.right,t:e.top+e._padding.top,b:e.bottom-e._padding.bottom},i=Object.assign({},t),n=[],s=[],r=e._pointLabels.length,o=e.options.pointLabels,a=o.centerPointLabels?Ct/r:0;for(let l=0;lt.r&&(a=(n.end-t.r)/r,e.r=Math.max(e.r,t.r+a)),s.startt.b&&(l=(s.end-t.b)/o,e.b=Math.max(e.b,t.b+l))}function fy(e,t,i){const n=e.drawingArea,{extra:s,additionalAngle:r,padding:o,size:a}=i,l=e.getPointPosition(t,n+s+o,r),c=Math.round(Hr(ne(l.angle+Xt))),u=yy(l.y,a.h,c),h=gy(c),f=my(l.x,a.w,h);return{visible:!0,x:l.x,y:u,textAlign:h,left:f,top:u,right:f+a.w,bottom:u+a.h}}function dy(e,t){if(!t)return!0;const{left:i,top:n,right:s,bottom:r}=e;return!(ve({x:i,y:n},t)||ve({x:i,y:r},t)||ve({x:s,y:n},t)||ve({x:s,y:r},t))}function py(e,t,i){const n=[],s=e._pointLabels.length,r=e.options,{centerPointLabels:o,display:a}=r.pointLabels,l={extra:vr(r)/2,additionalAngle:o?Ct/s:0};let c;for(let u=0;u270||i<90)&&(e-=t),e}function by(e,t,i){const{left:n,top:s,right:r,bottom:o}=i,{backdropColor:a}=t;if(!pt(a)){const l=si(t.borderRadius),c=Wt(t.backdropPadding);e.fillStyle=a;const u=n-c.left,h=s-c.top,f=r-n+c.width,d=o-s+c.height;Object.values(l).some(_=>_!==0)?(e.beginPath(),cn(e,{x:u,y:h,w:f,h:d,radius:l}),e.fill()):e.fillRect(u,h,f,d)}}function vy(e,t){const{ctx:i,options:{pointLabels:n}}=e;for(let s=t-1;s>=0;s--){const r=e._pointLabelItems[s];if(!r.visible)continue;const o=n.setContext(e.getPointLabelContext(s));by(i,o,r);const a=Mt(o.font),{x:l,y:c,textAlign:u}=r;li(i,e._pointLabels[s],l,c+a.lineHeight/2,a,{color:o.color,textAlign:u,textBaseline:"middle"})}}function Xc(e,t,i,n){const{ctx:s}=e;if(i)s.arc(e.xCenter,e.yCenter,t,0,ee);else{let r=e.getPointPosition(0,t);s.moveTo(r.x,r.y);for(let o=1;o{const s=vt(this.options.pointLabels.callback,[i,n],this);return s||s===0?s:""}).filter((i,n)=>this.chart.getDataVisibility(n))}fit(){const t=this.options;t.display&&t.pointLabels.display?uy(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,i,n,s){this.xCenter+=Math.floor((t-i)/2),this.yCenter+=Math.floor((n-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,i,n,s))}getIndexAngle(t){const i=ee/(this._pointLabels.length||1),n=this.options.startAngle||0;return ne(t*i+Ee(n))}getDistanceFromCenterForValue(t){if(pt(t))return NaN;const i=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*i:(t-this.min)*i}getValueForDistanceFromCenter(t){if(pt(t))return NaN;const i=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-i:this.min+i}getPointLabelContext(t){const i=this._pointLabels||[];if(t>=0&&t{if(h!==0){l=this.getDistanceFromCenterForValue(u.value);const f=this.getContext(h),d=s.setContext(f),_=r.setContext(f);_y(this,d,l,o,_)}}),n.display){for(t.save(),a=o-1;a>=0;a--){const u=n.setContext(this.getPointLabelContext(a)),{color:h,lineWidth:f}=u;!f||!h||(t.lineWidth=f,t.strokeStyle=h,t.setLineDash(u.borderDash),t.lineDashOffset=u.borderDashOffset,l=this.getDistanceFromCenterForValue(i.ticks.reverse?this.min:this.max),c=this.getPointPosition(a,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(c.x,c.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,i=this.options,n=i.ticks;if(!n.display)return;const s=this.getIndexAngle(0);let r,o;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&!i.reverse)return;const c=n.setContext(this.getContext(l)),u=Mt(c.font);if(r=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=u.string,o=t.measureText(a.label).width,t.fillStyle=c.backdropColor;const h=Wt(c.backdropPadding);t.fillRect(-o/2-h.left,-r-u.size/2-h.top,o+h.width,u.size+h.height)}li(t,a.label,0,-r,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}tt(Fn,"id","radialLinear"),tt(Fn,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:As.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),tt(Fn,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),tt(Fn,"descriptors",{angleLines:{_fallback:"grid"}});const Ms={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},Ht=Object.keys(Ms);function Xa(e,t){return e-t}function Ga(e,t){if(pt(t))return null;const i=e._adapter,{parser:n,round:s,isoWeekday:r}=e._parseOpts;let o=t;return typeof n=="function"&&(o=n(o)),Et(o)||(o=typeof n=="string"?i.parse(o,n):i.parse(o)),o===null?null:(s&&(o=s==="week"&&(Ci(r)||r===!0)?i.startOf(o,"isoWeek",r):i.startOf(o,s)),+o)}function Za(e,t,i,n){const s=Ht.length;for(let r=Ht.indexOf(e);r=Ht.indexOf(i);r--){const o=Ht[r];if(Ms[o].common&&e._adapter.diff(s,n,o)>=t-1)return o}return Ht[i?Ht.indexOf(i):0]}function ky(e){for(let t=Ht.indexOf(e)+1,i=Ht.length;t=t?i[n]:i[s];e[r]=!0}}function Py(e,t,i,n){const s=e._adapter,r=+s.startOf(t[0].value,n),o=t[t.length-1].value;let a,l;for(a=r;a<=o;a=+s.add(a,1,n))l=i[a],l>=0&&(t[l].major=!0);return t}function Ja(e,t,i){const n=[],s={},r=t.length;let o,a;for(o=0;o+t.value))}initOffsets(t=[]){let i=0,n=0,s,r;this.options.offset&&t.length&&(s=this.getDecimalForValue(t[0]),t.length===1?i=1-s:i=(this.getDecimalForValue(t[1])-s)/2,r=this.getDecimalForValue(t[t.length-1]),t.length===1?n=r:n=(r-this.getDecimalForValue(t[t.length-2]))/2);const o=t.length<3?.5:.25;i=Gt(i,0,o),n=Gt(n,0,o),this._offsets={start:i,end:n,factor:1/(i+1+n)}}_generate(){const t=this._adapter,i=this.min,n=this.max,s=this.options,r=s.time,o=r.unit||Za(r.minUnit,i,n,this._getLabelCapacity(i)),a=ut(s.ticks.stepSize,1),l=o==="week"?r.isoWeekday:!1,c=Ci(l)||l===!0,u={};let h=i,f,d;if(c&&(h=+t.startOf(h,"isoWeek",l)),h=+t.startOf(h,c?"day":o),t.diff(n,i,o)>1e5*a)throw new Error(i+" and "+n+" are too far apart with stepSize of "+a+" "+o);const _=s.ticks.source==="data"&&this.getDataTimestamps();for(f=h,d=0;f+y)}getLabelForValue(t){const i=this._adapter,n=this.options.time;return n.tooltipFormat?i.format(t,n.tooltipFormat):i.format(t,n.displayFormats.datetime)}format(t,i){const s=this.options.time.displayFormats,r=this._unit,o=i||s[r];return this._adapter.format(t,o)}_tickFormatFunction(t,i,n,s){const r=this.options,o=r.ticks.callback;if(o)return vt(o,[t,i,n],this);const a=r.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&a[l],h=c&&a[c],f=n[i],d=c&&h&&f&&f.major;return this._adapter.format(t,s||(d?h:u))}generateTickLabels(t){let i,n,s;for(i=0,n=t.length;i0?a:1}getDataTimestamps(){let t=this._cache.data||[],i,n;if(t.length)return t;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(i=0,n=s.length;i=e[n].pos&&t<=e[s].pos&&({lo:n,hi:s}=ti(e,"pos",t)),{pos:r,time:a}=e[n],{pos:o,time:l}=e[s]):(t>=e[n].time&&t<=e[s].time&&({lo:n,hi:s}=ti(e,"time",t)),{time:r,pos:a}=e[n],{time:o,pos:l}=e[s]);const c=o-r;return c?a+(l-a)*(t-r)/c:a}class tl extends as{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),i=this._table=this.buildLookupTable(t);this._minPos=Bn(i,this.min),this._tableRange=Bn(i,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:i,max:n}=this,s=[],r=[];let o,a,l,c,u;for(o=0,a=t.length;o=i&&c<=n&&s.push(c);if(s.length<2)return[{time:i,pos:0},{time:n,pos:1}];for(o=0,a=s.length;os-r)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const i=this.getDataTimestamps(),n=this.getLabelTimestamps();return i.length&&n.length?t=this.normalize(i.concat(n)):t=i.length?i:n,t=this._cache.all=t,t}getDecimalForValue(t){return(Bn(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const i=this._offsets,n=this.getDecimalForPixel(t)/i.factor-i.end;return Bn(this._table,n*this._tableRange+this._minPos,!0)}}tt(tl,"id","timeseries"),tt(tl,"defaults",as.defaults);const ke=e=>(Ll("data-v-0825ef4c"),e=e(),Il(),e),Ay={class:"insights"},Cy=ke(()=>st("h1",null,[st("span",{class:"material-symbols-rounded"},"insights"),st("span",null,"Insights")],-1)),My={class:"left"},Sy={class:"right"},Oy=ke(()=>st("span",{class:"label uppercase"}," short term ",-1)),Ey=ke(()=>st("span",{class:"label uppercase"}," integrated ",-1)),Ry=ke(()=>st("span",{class:"label uppercase"}," max momentary ",-1)),Ty={class:"meter"},Dy=ke(()=>st("span",{class:"label uppercase"}," L ",-1)),Ly=["value"],Iy={class:"meter"},Fy=ke(()=>st("span",{class:"label uppercase"}," R ",-1)),By=["value"],Wy=ke(()=>st("h4",null,"Correlation",-1)),Vy={class:"meter"},jy=ke(()=>st("span",{class:"label uppercase"}," L/R ",-1)),zy=["value"],Ny=ke(()=>st("h4",null,"Stereo Field",-1)),Hy={class:"container stereo-field"},$y=dn({__name:"Insights",setup(e){se.register(Hn,Nn,Kn,Ni,Ym,iy,qm,Yn,mr,yr,br,$n);const t=Nt(),i=Nt(),n=Nt(),s=Ps(),r=Nt([]),o=Nt([]),a=Array.from({length:60},()=>-1/0),l=h=>{var f,d;h.width=(f=h.parentElement)==null?void 0:f.clientWidth,h.height=(d=h.parentElement)==null?void 0:d.clientHeight,window.addEventListener("resize",()=>{var _,y;h.width=(_=h.parentElement)==null?void 0:_.clientWidth,h.height=(y=h.parentElement)==null?void 0:y.clientHeight})};Dr(()=>{if(!t.value||!i.value||!n.value)return;l(i.value),l(t.value),l(n.value),r.value=a,o.value=a;const h=new se(t.value,{data:{labels:Array.from({length:60},(y,v)=>v),datasets:c()},options:{responsive:!0,maintainAspectRatio:!1,scales:{y:{min:-30,max:0,ticks:{font:{family:"Poppins",size:10}},title:{display:!0,text:"Loudness (LUFS)",font:{family:"Poppins"}}},x:{ticks:{display:!1},title:{display:!0,text:"Time (s)",font:{family:"Poppins"}}}},animation:{duration:0}}}),f=new se(i.value,{type:"scatter",data:{datasets:[{data:[],backgroundColor:"#00c48b",borderColor:"#00c48b",pointRadius:.5},{data:[],backgroundColor:"#00c48b99",borderColor:"#00c48bcc",pointRadius:.3},{data:[],backgroundColor:"#00c48b33",borderColor:"#00c48b99",pointRadius:.1}]},options:{responsive:!0,maintainAspectRatio:!1,animation:!1,scales:{y:{min:-1.5,max:1.5,ticks:{callback:y=>y,font:{family:"Poppins"}},title:{display:!0,text:"Left",font:{family:"Poppins"}}},x:{min:-1.5,max:1.5,ticks:{callback:y=>y,font:{family:"Poppins"}},title:{display:!0,text:"Right",font:{family:"Poppins"}}}},plugins:{legend:{display:!1}}}}),d=new se(n.value,{data:{datasets:[{type:"line",tension:1,cubicInterpolationMode:"monotone",data:[{x:0,y:0},{x:255,y:50}],borderColor:"#00c48b"}]},options:{responsive:!0,maintainAspectRatio:!1,scales:{y:{min:0,max:255,ticks:{display:!1},title:{display:!0,text:"Gain",font:{family:"Poppins"}}},x:{min:0,max:18e3,type:"logarithmic",ticks:{callback:y=>y>=1e3?y/1e3+"k":y,font:{family:"Poppins"}},title:{display:!0,text:"Frequency (Hz)",font:{family:"Poppins"}}}},plugins:{legend:{display:!1}}}});let _=0;setInterval(()=>{if(!s.player.playing||(f.data.datasets[2].data=f.data.datasets[1].data,f.data.datasets[1].data=f.data.datasets[0].data,f.data.datasets[0].data=s.stereo.field,f.update(),_++%10!==0))return;const y=s.tonalBalance.data.reduce((v,A,F)=>(v.push({x:F*188,y:A}),v),[]);d.data.datasets[0].data=y,d.update(),h.data.datasets[0].data.shift(),h.data.datasets[0].data.push(s.loudness.shortterm),h.data.datasets[1].data.shift(),h.data.datasets[1].data.push(s.loudness.integrated),h.data.datasets[2].data.shift(),h.data.datasets[2].data.push([-60,s.loudness.momentary]),h.update()},100)});const c=()=>[{label:"short term",type:"line",data:a.map(h=>h),borderColor:"#c7aa19"},{label:"integrated",type:"line",data:a.map(h=>h),borderColor:"#189de4"},{label:"momentary",type:"bar",data:a.map(h=>[h,-1/0]),backgroundColor:"#e8545426"}],u=h=>Math.round(h*100)/100+" LUFS";return(h,f)=>(xe(),Be("div",Ay,[Cy,st("div",My,[At(pi,{class:"relative loudness-chart p-2"},{default:Ke(()=>[st("canvas",{ref_key:"chart",ref:t},null,512)]),_:1}),At(pi,{class:"relative tonal-balance-chart p-2"},{default:Ke(()=>[st("canvas",{ref_key:"tonalBalanceChart",ref:n},null,512)]),_:1})]),st("div",Sy,[At(pi,{class:"mode"},{default:Ke(()=>[Oy,st("span",null,Ze(u(Qt(s).loudness.shortterm)),1)]),_:1}),At(pi,{class:"mode"},{default:Ke(()=>[Ey,st("span",null,Ze(u(Qt(s).loudness.integrated)),1)]),_:1}),At(pi,{class:"mode"},{default:Ke(()=>[Ry,st("span",null,Ze(u(Qt(s).loudness.maxMomentary)),1)]),_:1}),At(pi,{class:"meters"},{default:Ke(()=>[st("div",Ty,[Dy,st("meter",{optimum:"0.25",low:"0.5",high:"0.75",min:"0",max:"1",value:Qt(s).stereo.left},null,8,Ly)]),st("div",Iy,[Fy,st("meter",{optimum:"0.25",low:"0.5",high:"0.75",min:"0",max:"1",value:Qt(s).stereo.right},null,8,By)]),Wy,st("div",Vy,[jy,st("meter",{optimum:"1",low:"-0.5",high:"0",min:"-1",max:"1",value:Qt(s).stereo.correlation},null,8,zy)]),Ny,st("div",Hy,[st("canvas",{ref_key:"stereoFieldChart",ref:i},null,512)])]),_:1})])]))}}),Uy=pn($y,[["__scopeId","data-v-0825ef4c"]]),qy={},Ky=e=>(Ll("data-v-46429bb4"),e=e(),Il(),e),Yy=zh('',1),Xy={href:"https://github.com/reAudioPlayer/one",target:"_blank"},Gy={"aria-label":"Github",id:"github","xmlns:xlink":"http://www.w3.org/1999/xlink",width:"48.438",xmlns:"http://www.w3.org/2000/svg",height:"50",viewBox:"0 0 48.438 50",style:{"-webkit-print-color-adjust":"exact"},fill:"none",version:"1.1"},Zy=Ky(()=>st("g",{id:"shape-79d840b8-f6ae-8053-8002-334fc9dfbbc1",rx:"0",ry:"0",style:{fill:"rgb(0, 0, 0)"}},[st("g",{id:"shape-79d840b8-f6ae-8053-8002-334fc9e114db"},[st("g",{class:"fills",id:"fills-79d840b8-f6ae-8053-8002-334fc9e114db"},[st("path",{rx:"0",ry:"0",d:"M16.201,38.809C16.201,39.004,15.977,39.160,15.693,39.160C15.371,39.189,15.146,39.033,15.146,38.809C15.146,38.613,15.371,38.457,15.654,38.457C15.947,38.428,16.201,38.584,16.201,38.809ZZM13.164,38.369C13.096,38.564,13.291,38.789,13.584,38.848C13.838,38.945,14.131,38.848,14.189,38.652C14.248,38.457,14.063,38.232,13.770,38.145C13.516,38.076,13.232,38.174,13.164,38.369ZZM17.480,38.203C17.197,38.271,17.002,38.457,17.031,38.682C17.061,38.877,17.314,39.004,17.607,38.936C17.891,38.867,18.086,38.682,18.057,38.486C18.027,38.301,17.764,38.174,17.480,38.203ZZM23.906,0.781C10.361,0.781,0.000,11.064,0.000,24.609C0.000,35.439,6.816,44.707,16.553,47.969C17.803,48.193,18.242,47.422,18.242,46.787C18.242,46.182,18.213,42.842,18.213,40.791C18.213,40.791,11.377,42.256,9.941,37.881C9.941,37.881,8.828,35.039,7.227,34.307C7.227,34.307,4.990,32.773,7.383,32.803C7.383,32.803,9.814,32.998,11.152,35.322C13.291,39.092,16.875,38.008,18.271,37.363C18.496,35.801,19.131,34.717,19.834,34.072C14.375,33.467,8.867,32.676,8.867,23.281C8.867,20.596,9.609,19.248,11.172,17.529C10.918,16.895,10.088,14.277,11.426,10.898C13.467,10.264,18.164,13.535,18.164,13.535C20.117,12.988,22.217,12.705,24.297,12.705C26.377,12.705,28.477,12.988,30.430,13.535C30.430,13.535,35.127,10.254,37.168,10.898C38.506,14.287,37.676,16.895,37.422,17.529C38.984,19.258,39.941,20.605,39.941,23.281C39.941,32.705,34.189,33.457,28.730,34.072C29.629,34.844,30.391,36.309,30.391,38.604C30.391,41.895,30.361,45.967,30.361,46.768C30.361,47.402,30.811,48.174,32.051,47.949C41.816,44.707,48.438,35.439,48.438,24.609C48.438,11.064,37.451,0.781,23.906,0.781ZZM9.492,34.463C9.365,34.561,9.395,34.785,9.561,34.971C9.717,35.127,9.941,35.195,10.068,35.068C10.195,34.971,10.166,34.746,10.000,34.561C9.844,34.404,9.619,34.336,9.492,34.463ZZM8.438,33.672C8.369,33.799,8.467,33.955,8.662,34.053C8.818,34.150,9.014,34.121,9.082,33.984C9.150,33.857,9.053,33.701,8.857,33.604C8.662,33.545,8.506,33.574,8.438,33.672ZZM11.602,37.148C11.445,37.275,11.504,37.568,11.729,37.754C11.953,37.979,12.236,38.008,12.363,37.852C12.490,37.725,12.432,37.432,12.236,37.246C12.021,37.021,11.729,36.992,11.602,37.148ZZM10.488,35.713C10.332,35.811,10.332,36.064,10.488,36.289C10.645,36.514,10.908,36.611,11.035,36.514C11.191,36.387,11.191,36.133,11.035,35.908C10.898,35.684,10.645,35.586,10.488,35.713ZZ"})])])],-1)),Qy=[Zy];function Jy(e,t){return xe(),Be("header",null,[Yy,st("a",Xy,[(xe(),Be("svg",Gy,Qy))])])}const tb=pn(qy,[["render",Jy],["__scopeId","data-v-46429bb4"]]),eb={props:{modelValue:{type:Number,required:!0},max:{type:Number,default:100}},watch:{modelValue(){this.value=this.modelValue}},computed:{percentage(){return Math.min(1,this.value/this.max)*100}},methods:{seek(e,t=!1){console.log("seek",e);const i=this.$el.getBoundingClientRect(),n=e.clientX-i.left,s=this.$el.offsetWidth;if(this.value=n/s*this.max,!t){this.seeking=!1,this.$emit("change",this.value);try{this.$emit("update:modelValue",this.value)}catch{}}}},data(){return{hover:!1,value:this.modelValue||0,seeking:!1}},mounted(){window.addEventListener("mouseup",e=>{this.seeking&&(this.seeking=!1,this.seek(e))}),window.addEventListener("mousemove",e=>{this.seeking&&this.seek(e,!0)})}},ib={class:"progressBar__track"};function nb(e,t,i,n,s,r){return xe(),Be("div",{ref:"el",class:"progressBar",onMousedown:t[0]||(t[0]=o=>s.seeking=!0),onDragover:t[1]||(t[1]=xf(()=>{},["stop"])),onClick:t[2]||(t[2]=(...o)=>r.seek&&r.seek(...o)),onMouseenter:t[3]||(t[3]=o=>s.hover=!0),onMouseleave:t[4]||(t[4]=o=>s.hover=!1)},[st("div",ib,[st("div",{class:fn([{hover:s.hover},"progressBar__progress"]),style:hs({width:`${r.percentage}%`})},null,6)])],544)}const sb=pn(eb,[["render",nb],["__scopeId","data-v-1a625635"]]);function rb(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Gc={exports:{}};/*! +`):e}function Xm(e,t){const{element:i,datasetIndex:n,index:s}=t,r=e.getDatasetMeta(n).controller,{label:o,value:a}=r.getLabelAndValue(s);return{chart:e,label:o,parsed:r.getParsed(s),raw:e.data.datasets[n].data[s],formattedValue:a,dataset:r.getDataset(),dataIndex:s,datasetIndex:n,element:i}}function Va(e,t){const i=e.chart.ctx,{body:n,footer:s,title:r}=e,{boxWidth:o,boxHeight:a}=t,l=Mt(t.bodyFont),c=Mt(t.titleFont),u=Mt(t.footerFont),h=r.length,f=s.length,d=n.length,_=Wt(t.padding);let y=_.height,v=0,A=n.reduce((C,P)=>C+P.before.length+P.lines.length+P.after.length,0);if(A+=e.beforeBody.length+e.afterBody.length,h&&(y+=h*c.lineHeight+(h-1)*t.titleSpacing+t.titleMarginBottom),A){const C=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;y+=d*C+(A-d)*l.lineHeight+(A-1)*t.bodySpacing}f&&(y+=t.footerMarginTop+f*u.lineHeight+(f-1)*t.footerSpacing);let F=0;const S=function(C){v=Math.max(v,i.measureText(C).width+F)};return i.save(),i.font=c.string,mt(e.title,S),i.font=l.string,mt(e.beforeBody.concat(e.afterBody),S),F=t.displayColors?o+2+t.boxPadding:0,mt(n,C=>{mt(C.before,S),mt(C.lines,S),mt(C.after,S)}),F=0,i.font=u.string,mt(e.footer,S),i.restore(),v+=_.width,{width:v,height:y}}function Gm(e,t){const{y:i,height:n}=t;return ie.height-n/2?"bottom":"center"}function Zm(e,t,i,n){const{x:s,width:r}=n,o=i.caretSize+i.caretPadding;if(e==="left"&&s+r+o>t.width||e==="right"&&s-r-o<0)return!0}function Qm(e,t,i,n){const{x:s,width:r}=i,{width:o,chartArea:{left:a,right:l}}=e;let c="center";return n==="center"?c=s<=(a+l)/2?"left":"right":s<=r/2?c="left":s>=o-r/2&&(c="right"),Zm(c,e,t,i)&&(c="center"),c}function ja(e,t,i){const n=i.yAlign||t.yAlign||Gm(e,i);return{xAlign:i.xAlign||t.xAlign||Qm(e,t,i,n),yAlign:n}}function Jm(e,t){let{x:i,width:n}=e;return t==="right"?i-=n:t==="center"&&(i-=n/2),i}function ty(e,t,i){let{y:n,height:s}=e;return t==="top"?n+=i:t==="bottom"?n-=s+i:n-=s/2,n}function za(e,t,i,n){const{caretSize:s,caretPadding:r,cornerRadius:o}=e,{xAlign:a,yAlign:l}=i,c=s+r,{topLeft:u,topRight:h,bottomLeft:f,bottomRight:d}=si(o);let _=Jm(t,a);const y=ty(t,l,c);return l==="center"?a==="left"?_+=c:a==="right"&&(_-=c):a==="left"?_-=Math.max(u,f)+s:a==="right"&&(_+=Math.max(h,d)+s),{x:Gt(_,0,n.width-t.width),y:Gt(y,0,n.height-t.height)}}function In(e,t,i){const n=Wt(i.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-n.right:e.x+n.left}function Na(e){return ce([],me(e))}function ey(e,t,i){return Ve(e,{tooltip:t,tooltipItems:i,type:"tooltip"})}function Ha(e,t){const i=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return i?e.override(i):e}const Yc={beforeTitle:pe,title(e){if(e.length>0){const t=e[0],i=t.chart.data.labels,n=i?i.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(n>0&&t.dataIndex"u"?Yc[t].call(i,n):s}class gr extends je{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const i=this.chart,n=this.options.setContext(this.getContext()),s=n.enabled&&i.options.animation&&n.animations,r=new Rc(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(r)),r}getContext(){return this.$context||(this.$context=ey(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,i){const{callbacks:n}=i,s=jt(n,"beforeTitle",this,t),r=jt(n,"title",this,t),o=jt(n,"afterTitle",this,t);let a=[];return a=ce(a,me(s)),a=ce(a,me(r)),a=ce(a,me(o)),a}getBeforeBody(t,i){return Na(jt(i.callbacks,"beforeBody",this,t))}getBody(t,i){const{callbacks:n}=i,s=[];return mt(t,r=>{const o={before:[],lines:[],after:[]},a=Ha(n,r);ce(o.before,me(jt(a,"beforeLabel",this,r))),ce(o.lines,jt(a,"label",this,r)),ce(o.after,me(jt(a,"afterLabel",this,r))),s.push(o)}),s}getAfterBody(t,i){return Na(jt(i.callbacks,"afterBody",this,t))}getFooter(t,i){const{callbacks:n}=i,s=jt(n,"beforeFooter",this,t),r=jt(n,"footer",this,t),o=jt(n,"afterFooter",this,t);let a=[];return a=ce(a,me(s)),a=ce(a,me(r)),a=ce(a,me(o)),a}_createItems(t){const i=this._active,n=this.chart.data,s=[],r=[],o=[];let a=[],l,c;for(l=0,c=i.length;lt.filter(u,h,f,n))),t.itemSort&&(a=a.sort((u,h)=>t.itemSort(u,h,n))),mt(a,u=>{const h=Ha(t.callbacks,u);s.push(jt(h,"labelColor",this,u)),r.push(jt(h,"labelPointStyle",this,u)),o.push(jt(h,"labelTextColor",this,u))}),this.labelColors=s,this.labelPointStyles=r,this.labelTextColors=o,this.dataPoints=a,a}update(t,i){const n=this.options.setContext(this.getContext()),s=this._active;let r,o=[];if(!s.length)this.opacity!==0&&(r={opacity:0});else{const a=Hi[n.position].call(this,s,this._eventPosition);o=this._createItems(n),this.title=this.getTitle(o,n),this.beforeBody=this.getBeforeBody(o,n),this.body=this.getBody(o,n),this.afterBody=this.getAfterBody(o,n),this.footer=this.getFooter(o,n);const l=this._size=Va(this,n),c=Object.assign({},a,l),u=ja(this.chart,n,c),h=za(n,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,r={opacity:1,x:h.x,y:h.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=o,this.$context=void 0,r&&this._resolveAnimations().update(this,r),t&&n.external&&n.external.call(this,{chart:this.chart,tooltip:this,replay:i})}drawCaret(t,i,n,s){const r=this.getCaretPosition(t,n,s);i.lineTo(r.x1,r.y1),i.lineTo(r.x2,r.y2),i.lineTo(r.x3,r.y3)}getCaretPosition(t,i,n){const{xAlign:s,yAlign:r}=this,{caretSize:o,cornerRadius:a}=n,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:h}=si(a),{x:f,y:d}=t,{width:_,height:y}=i;let v,A,F,S,C,P;return r==="center"?(C=d+y/2,s==="left"?(v=f,A=v-o,S=C+o,P=C-o):(v=f+_,A=v+o,S=C-o,P=C+o),F=v):(s==="left"?A=f+Math.max(l,u)+o:s==="right"?A=f+_-Math.max(c,h)-o:A=this.caretX,r==="top"?(S=d,C=S-o,v=A-o,F=A+o):(S=d+y,C=S+o,v=A+o,F=A-o),P=S),{x1:v,x2:A,x3:F,y1:S,y2:C,y3:P}}drawTitle(t,i,n){const s=this.title,r=s.length;let o,a,l;if(r){const c=vi(n.rtl,this.x,this.width);for(t.x=In(this,n.titleAlign,n),i.textAlign=c.textAlign(n.titleAlign),i.textBaseline="middle",o=Mt(n.titleFont),a=n.titleSpacing,i.fillStyle=n.titleColor,i.font=o.string,l=0;lF!==0)?(t.beginPath(),t.fillStyle=r.multiKeyBackground,cn(t,{x:y,y:_,w:c,h:l,radius:A}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),cn(t,{x:v,y:_+1,w:c-2,h:l-2,radius:A}),t.fill()):(t.fillStyle=r.multiKeyBackground,t.fillRect(y,_,c,l),t.strokeRect(y,_,c,l),t.fillStyle=o.backgroundColor,t.fillRect(v,_+1,c-2,l-2))}t.fillStyle=this.labelTextColors[n]}drawBody(t,i,n){const{body:s}=this,{bodySpacing:r,bodyAlign:o,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:u}=n,h=Mt(n.bodyFont);let f=h.lineHeight,d=0;const _=vi(n.rtl,this.x,this.width),y=function(R){i.fillText(R,_.x(t.x+d),t.y+f/2),t.y+=f+r},v=_.textAlign(o);let A,F,S,C,P,M,D;for(i.textAlign=o,i.textBaseline="middle",i.font=h.string,t.x=In(this,v,n),i.fillStyle=n.bodyColor,mt(this.beforeBody,y),d=a&&v!=="right"?o==="center"?c/2+u:c+2+u:0,C=0,M=s.length;C0&&i.stroke()}_updateAnimationTarget(t){const i=this.chart,n=this.$animations,s=n&&n.x,r=n&&n.y;if(s||r){const o=Hi[t.position].call(this,this._active,this._eventPosition);if(!o)return;const a=this._size=Va(this,t),l=Object.assign({},o,this._size),c=ja(i,t,l),u=za(t,l,c,i);(s._to!==u.x||r._to!==u.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=o.x,this.caretY=o.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(t){const i=this.options.setContext(this.getContext());let n=this.opacity;if(!n)return;this._updateAnimationTarget(i);const s={width:this.width,height:this.height},r={x:this.x,y:this.y};n=Math.abs(n)<.001?0:n;const o=Wt(i.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;i.enabled&&a&&(t.save(),t.globalAlpha=n,this.drawBackground(r,t,s,i),Sc(t,i.textDirection),r.y+=o.top,this.drawTitle(r,t,i),this.drawBody(r,t,i),this.drawFooter(r,t,i),Oc(t,i.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,i){const n=this._active,s=t.map(({datasetIndex:a,index:l})=>{const c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),r=!ts(n,s),o=this._positionChanged(s,i);(r||o)&&(this._active=s,this._eventPosition=i,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,i,n=!0){if(i&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,r=this._active||[],o=this._getActiveElements(t,r,i,n),a=this._positionChanged(o,t),l=i||!ts(o,r)||a;return l&&(this._active=o,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,i))),l}_getActiveElements(t,i,n,s){const r=this.options;if(t.type==="mouseout")return[];if(!s)return i.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);const o=this.chart.getElementsAtEventForMode(t,r.mode,r,n);return r.reverse&&o.reverse(),o}_positionChanged(t,i){const{caretX:n,caretY:s,options:r}=this,o=Hi[r.position].call(this,t,i);return o!==!1&&(n!==o.x||s!==o.y)}}tt(gr,"positioners",Hi);var iy={id:"tooltip",_element:gr,positioners:Hi,afterInit(e,t,i){i&&(e.tooltip=new gr({chart:e,options:i}))},beforeUpdate(e,t,i){e.tooltip&&e.tooltip.initialize(i)},reset(e,t,i){e.tooltip&&e.tooltip.initialize(i)},afterDraw(e){const t=e.tooltip;if(t&&t._willRender()){const i={tooltip:t};if(e.notifyPlugins("beforeTooltipDraw",{...i,cancelable:!0})===!1)return;t.draw(e.ctx),e.notifyPlugins("afterTooltipDraw",i)}},afterEvent(e,t){if(e.tooltip){const i=t.replay;e.tooltip.handleEvent(t.event,i,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(e,t)=>t.bodyFont.size,boxWidth:(e,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:Yc},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:e=>e!=="filter"&&e!=="itemSort"&&e!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const ny=(e,t,i,n)=>(typeof t=="string"?(i=e.push(t)-1,n.unshift({index:i,label:t})):isNaN(t)&&(i=null),i);function sy(e,t,i,n){const s=e.indexOf(t);if(s===-1)return ny(e,t,i,n);const r=e.lastIndexOf(t);return s!==r?i:s}const ry=(e,t)=>e===null?null:Gt(Math.round(e),0,t);function $a(e){const t=this.getLabels();return e>=0&&ei.length-1?null:this.getPixelForValue(i[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}tt(mr,"id","category"),tt(mr,"defaults",{ticks:{callback:$a}});function oy(e,t){const i=[],{bounds:s,step:r,min:o,max:a,precision:l,count:c,maxTicks:u,maxDigits:h,includeBounds:f}=e,d=r||1,_=u-1,{min:y,max:v}=t,A=!pt(o),F=!pt(a),S=!pt(c),C=(v-y)/(h+1);let P=qo((v-y)/_/d)*d,M,D,R,B;if(P<1e-14&&!A&&!F)return[{value:y},{value:v}];B=Math.ceil(v/P)-Math.floor(y/P),B>_&&(P=qo(B*P/_/d)*d),pt(l)||(M=Math.pow(10,l),P=Math.ceil(P*M)/M),s==="ticks"?(D=Math.floor(y/P)*P,R=Math.ceil(v/P)*P):(D=y,R=v),A&&F&&r&&Bd((a-o)/r,P/1e3)?(B=Math.round(Math.min((a-o)/P,u)),P=(a-o)/B,D=o,R=a):S?(D=A?o:D,R=F?a:R,B=c-1,P=(R-D)/B):(B=(R-D)/P,Zi(B,Math.round(B),P/1e3)?B=Math.round(B):B=Math.ceil(B));const W=Math.max(Ko(P),Ko(D));M=Math.pow(10,pt(l)?W:l),D=Math.round(D*M)/M,R=Math.round(R*M)/M;let L=0;for(A&&(f&&D!==o?(i.push({value:o}),Da)break;i.push({value:j})}return F&&f&&R!==a?i.length&&Zi(i[i.length-1].value,a,Ua(a,C,e))?i[i.length-1].value=a:i.push({value:a}):(!F||R===a)&&i.push({value:R}),i}function Ua(e,t,{horizontal:i,minRotation:n}){const s=Ee(n),r=(i?Math.sin(s):Math.cos(s))||.001,o=.75*t*(""+e).length;return Math.min(t/r,o)}class os extends hi{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,i){return pt(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:i,maxDefined:n}=this.getUserBounds();let{min:s,max:r}=this;const o=l=>s=i?s:l,a=l=>r=n?r:l;if(t){const l=de(s),c=de(r);l<0&&c<0?a(0):l>0&&c>0&&o(0)}if(s===r){let l=r===0?1:Math.abs(r*.05);a(r+l),t||o(s-l)}this.min=s,this.max=r}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:i,stepSize:n}=t,s;return n?(s=Math.ceil(this.max/n)-Math.floor(this.min/n)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${n} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),i=i||11),i&&(s=Math.min(i,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,i=t.ticks;let n=this.getTickLimit();n=Math.max(2,n);const s={maxTicks:n,bounds:t.bounds,min:t.min,max:t.max,precision:i.precision,step:i.stepSize,count:i.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:i.minRotation||0,includeBounds:i.includeBounds!==!1},r=this._range||this,o=oy(s,r);return t.bounds==="ticks"&&hc(o,this,"value"),t.reverse?(o.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),o}configure(){const t=this.ticks;let i=this.min,n=this.max;if(super.configure(),this.options.offset&&t.length){const s=(n-i)/Math.max(t.length-1,1)/2;i-=s,n+=s}this._startValue=i,this._endValue=n,this._valueRange=n-i}getLabelForValue(t){return Kr(t,this.chart.options.locale,this.options.ticks.format)}}class yr extends os{determineDataLimits(){const{min:t,max:i}=this.getMinMax(!0);this.min=Et(t)?t:0,this.max=Et(i)?i:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),i=t?this.width:this.height,n=Ee(this.options.ticks.minRotation),s=(t?Math.sin(n):Math.cos(n))||.001,r=this._resolveTickFontOptions(0);return Math.ceil(i/Math.min(40,r.lineHeight/s))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}tt(yr,"id","linear"),tt(yr,"defaults",{ticks:{callback:As.formatters.numeric}});const hn=e=>Math.floor(Oe(e)),qe=(e,t)=>Math.pow(10,hn(e)+t);function qa(e){return e/Math.pow(10,hn(e))===1}function Ka(e,t,i){const n=Math.pow(10,i),s=Math.floor(e/n);return Math.ceil(t/n)-s}function ay(e,t){const i=t-e;let n=hn(i);for(;Ka(e,t,n)>10;)n++;for(;Ka(e,t,n)<10;)n--;return Math.min(n,hn(e))}function ly(e,{min:t,max:i}){t=qt(e.min,t);const n=[],s=hn(t);let r=ay(t,i),o=r<0?Math.pow(10,Math.abs(r)):1;const a=Math.pow(10,r),l=s>r?Math.pow(10,s):0,c=Math.round((t-l)*o)/o,u=Math.floor((t-l)/a/10)*a*10;let h=Math.floor((c-u)/Math.pow(10,r)),f=qt(e.min,Math.round((l+u+h*Math.pow(10,r))*o)/o);for(;f=10?h=h<15?15:20:h++,h>=20&&(r++,h=2,o=r>=0?1:o),f=Math.round((l+u+h*Math.pow(10,r))*o)/o;const d=qt(e.max,f);return n.push({value:d,major:qa(d),significand:h}),n}class br extends hi{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,i){const n=os.prototype.parse.apply(this,[t,i]);if(n===0){this._zero=!0;return}return Et(n)&&n>0?n:null}determineDataLimits(){const{min:t,max:i}=this.getMinMax(!0);this.min=Et(t)?Math.max(0,t):null,this.max=Et(i)?Math.max(0,i):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!Et(this._userMin)&&(this.min=t===qe(this.min,0)?qe(this.min,-1):qe(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:i}=this.getUserBounds();let n=this.min,s=this.max;const r=a=>n=t?n:a,o=a=>s=i?s:a;n===s&&(n<=0?(r(1),o(10)):(r(qe(n,-1)),o(qe(s,1)))),n<=0&&r(qe(s,-1)),s<=0&&o(qe(n,1)),this.min=n,this.max=s}buildTicks(){const t=this.options,i={min:this._userMin,max:this._userMax},n=ly(i,this);return t.bounds==="ticks"&&hc(n,this,"value"),t.reverse?(n.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),n}getLabelForValue(t){return t===void 0?"0":Kr(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Oe(t),this._valueRange=Oe(this.max)-Oe(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Oe(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const i=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+i*this._valueRange)}}tt(br,"id","logarithmic"),tt(br,"defaults",{ticks:{callback:As.formatters.logarithmic,major:{enabled:!0}}});function vr(e){const t=e.ticks;if(t.display&&e.display){const i=Wt(t.backdropPadding);return ut(t.font&&t.font.size,kt.font.size)+i.height}return 0}function cy(e,t,i){return i=wt(i)?i:[i],{w:ep(e,t.string,i),h:i.length*t.lineHeight}}function Ya(e,t,i,n,s){return e===n||e===s?{start:t-i/2,end:t+i/2}:es?{start:t-i,end:t}:{start:t,end:t+i}}function uy(e){const t={l:e.left+e._padding.left,r:e.right-e._padding.right,t:e.top+e._padding.top,b:e.bottom-e._padding.bottom},i=Object.assign({},t),n=[],s=[],r=e._pointLabels.length,o=e.options.pointLabels,a=o.centerPointLabels?Ct/r:0;for(let l=0;lt.r&&(a=(n.end-t.r)/r,e.r=Math.max(e.r,t.r+a)),s.startt.b&&(l=(s.end-t.b)/o,e.b=Math.max(e.b,t.b+l))}function fy(e,t,i){const n=e.drawingArea,{extra:s,additionalAngle:r,padding:o,size:a}=i,l=e.getPointPosition(t,n+s+o,r),c=Math.round(Hr(ne(l.angle+Xt))),u=yy(l.y,a.h,c),h=gy(c),f=my(l.x,a.w,h);return{visible:!0,x:l.x,y:u,textAlign:h,left:f,top:u,right:f+a.w,bottom:u+a.h}}function dy(e,t){if(!t)return!0;const{left:i,top:n,right:s,bottom:r}=e;return!(ve({x:i,y:n},t)||ve({x:i,y:r},t)||ve({x:s,y:n},t)||ve({x:s,y:r},t))}function py(e,t,i){const n=[],s=e._pointLabels.length,r=e.options,{centerPointLabels:o,display:a}=r.pointLabels,l={extra:vr(r)/2,additionalAngle:o?Ct/s:0};let c;for(let u=0;u270||i<90)&&(e-=t),e}function by(e,t,i){const{left:n,top:s,right:r,bottom:o}=i,{backdropColor:a}=t;if(!pt(a)){const l=si(t.borderRadius),c=Wt(t.backdropPadding);e.fillStyle=a;const u=n-c.left,h=s-c.top,f=r-n+c.width,d=o-s+c.height;Object.values(l).some(_=>_!==0)?(e.beginPath(),cn(e,{x:u,y:h,w:f,h:d,radius:l}),e.fill()):e.fillRect(u,h,f,d)}}function vy(e,t){const{ctx:i,options:{pointLabels:n}}=e;for(let s=t-1;s>=0;s--){const r=e._pointLabelItems[s];if(!r.visible)continue;const o=n.setContext(e.getPointLabelContext(s));by(i,o,r);const a=Mt(o.font),{x:l,y:c,textAlign:u}=r;li(i,e._pointLabels[s],l,c+a.lineHeight/2,a,{color:o.color,textAlign:u,textBaseline:"middle"})}}function Xc(e,t,i,n){const{ctx:s}=e;if(i)s.arc(e.xCenter,e.yCenter,t,0,ee);else{let r=e.getPointPosition(0,t);s.moveTo(r.x,r.y);for(let o=1;o{const s=vt(this.options.pointLabels.callback,[i,n],this);return s||s===0?s:""}).filter((i,n)=>this.chart.getDataVisibility(n))}fit(){const t=this.options;t.display&&t.pointLabels.display?uy(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,i,n,s){this.xCenter+=Math.floor((t-i)/2),this.yCenter+=Math.floor((n-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,i,n,s))}getIndexAngle(t){const i=ee/(this._pointLabels.length||1),n=this.options.startAngle||0;return ne(t*i+Ee(n))}getDistanceFromCenterForValue(t){if(pt(t))return NaN;const i=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*i:(t-this.min)*i}getValueForDistanceFromCenter(t){if(pt(t))return NaN;const i=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-i:this.min+i}getPointLabelContext(t){const i=this._pointLabels||[];if(t>=0&&t{if(h!==0){l=this.getDistanceFromCenterForValue(u.value);const f=this.getContext(h),d=s.setContext(f),_=r.setContext(f);_y(this,d,l,o,_)}}),n.display){for(t.save(),a=o-1;a>=0;a--){const u=n.setContext(this.getPointLabelContext(a)),{color:h,lineWidth:f}=u;!f||!h||(t.lineWidth=f,t.strokeStyle=h,t.setLineDash(u.borderDash),t.lineDashOffset=u.borderDashOffset,l=this.getDistanceFromCenterForValue(i.ticks.reverse?this.min:this.max),c=this.getPointPosition(a,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(c.x,c.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,i=this.options,n=i.ticks;if(!n.display)return;const s=this.getIndexAngle(0);let r,o;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&!i.reverse)return;const c=n.setContext(this.getContext(l)),u=Mt(c.font);if(r=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=u.string,o=t.measureText(a.label).width,t.fillStyle=c.backdropColor;const h=Wt(c.backdropPadding);t.fillRect(-o/2-h.left,-r-u.size/2-h.top,o+h.width,u.size+h.height)}li(t,a.label,0,-r,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}tt(Fn,"id","radialLinear"),tt(Fn,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:As.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),tt(Fn,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),tt(Fn,"descriptors",{angleLines:{_fallback:"grid"}});const Ms={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},Ht=Object.keys(Ms);function Xa(e,t){return e-t}function Ga(e,t){if(pt(t))return null;const i=e._adapter,{parser:n,round:s,isoWeekday:r}=e._parseOpts;let o=t;return typeof n=="function"&&(o=n(o)),Et(o)||(o=typeof n=="string"?i.parse(o,n):i.parse(o)),o===null?null:(s&&(o=s==="week"&&(Ci(r)||r===!0)?i.startOf(o,"isoWeek",r):i.startOf(o,s)),+o)}function Za(e,t,i,n){const s=Ht.length;for(let r=Ht.indexOf(e);r=Ht.indexOf(i);r--){const o=Ht[r];if(Ms[o].common&&e._adapter.diff(s,n,o)>=t-1)return o}return Ht[i?Ht.indexOf(i):0]}function ky(e){for(let t=Ht.indexOf(e)+1,i=Ht.length;t=t?i[n]:i[s];e[r]=!0}}function Py(e,t,i,n){const s=e._adapter,r=+s.startOf(t[0].value,n),o=t[t.length-1].value;let a,l;for(a=r;a<=o;a=+s.add(a,1,n))l=i[a],l>=0&&(t[l].major=!0);return t}function Ja(e,t,i){const n=[],s={},r=t.length;let o,a;for(o=0;o+t.value))}initOffsets(t=[]){let i=0,n=0,s,r;this.options.offset&&t.length&&(s=this.getDecimalForValue(t[0]),t.length===1?i=1-s:i=(this.getDecimalForValue(t[1])-s)/2,r=this.getDecimalForValue(t[t.length-1]),t.length===1?n=r:n=(r-this.getDecimalForValue(t[t.length-2]))/2);const o=t.length<3?.5:.25;i=Gt(i,0,o),n=Gt(n,0,o),this._offsets={start:i,end:n,factor:1/(i+1+n)}}_generate(){const t=this._adapter,i=this.min,n=this.max,s=this.options,r=s.time,o=r.unit||Za(r.minUnit,i,n,this._getLabelCapacity(i)),a=ut(s.ticks.stepSize,1),l=o==="week"?r.isoWeekday:!1,c=Ci(l)||l===!0,u={};let h=i,f,d;if(c&&(h=+t.startOf(h,"isoWeek",l)),h=+t.startOf(h,c?"day":o),t.diff(n,i,o)>1e5*a)throw new Error(i+" and "+n+" are too far apart with stepSize of "+a+" "+o);const _=s.ticks.source==="data"&&this.getDataTimestamps();for(f=h,d=0;f+y)}getLabelForValue(t){const i=this._adapter,n=this.options.time;return n.tooltipFormat?i.format(t,n.tooltipFormat):i.format(t,n.displayFormats.datetime)}format(t,i){const s=this.options.time.displayFormats,r=this._unit,o=i||s[r];return this._adapter.format(t,o)}_tickFormatFunction(t,i,n,s){const r=this.options,o=r.ticks.callback;if(o)return vt(o,[t,i,n],this);const a=r.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&a[l],h=c&&a[c],f=n[i],d=c&&h&&f&&f.major;return this._adapter.format(t,s||(d?h:u))}generateTickLabels(t){let i,n,s;for(i=0,n=t.length;i0?a:1}getDataTimestamps(){let t=this._cache.data||[],i,n;if(t.length)return t;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(i=0,n=s.length;i=e[n].pos&&t<=e[s].pos&&({lo:n,hi:s}=ti(e,"pos",t)),{pos:r,time:a}=e[n],{pos:o,time:l}=e[s]):(t>=e[n].time&&t<=e[s].time&&({lo:n,hi:s}=ti(e,"time",t)),{time:r,pos:a}=e[n],{time:o,pos:l}=e[s]);const c=o-r;return c?a+(l-a)*(t-r)/c:a}class tl extends as{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),i=this._table=this.buildLookupTable(t);this._minPos=Bn(i,this.min),this._tableRange=Bn(i,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:i,max:n}=this,s=[],r=[];let o,a,l,c,u;for(o=0,a=t.length;o=i&&c<=n&&s.push(c);if(s.length<2)return[{time:i,pos:0},{time:n,pos:1}];for(o=0,a=s.length;os-r)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const i=this.getDataTimestamps(),n=this.getLabelTimestamps();return i.length&&n.length?t=this.normalize(i.concat(n)):t=i.length?i:n,t=this._cache.all=t,t}getDecimalForValue(t){return(Bn(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const i=this._offsets,n=this.getDecimalForPixel(t)/i.factor-i.end;return Bn(this._table,n*this._tableRange+this._minPos,!0)}}tt(tl,"id","timeseries"),tt(tl,"defaults",as.defaults);const ke=e=>(Ll("data-v-2564d235"),e=e(),Il(),e),Ay={class:"insights"},Cy=ke(()=>st("h1",null,[st("span",{class:"material-symbols-rounded"},"insights"),st("span",null,"Insights")],-1)),My={class:"left"},Sy={class:"right"},Oy=ke(()=>st("span",{class:"label uppercase"}," short term ",-1)),Ey=ke(()=>st("span",{class:"label uppercase"}," integrated ",-1)),Ry=ke(()=>st("span",{class:"label uppercase"}," max momentary ",-1)),Ty={class:"meter"},Dy=ke(()=>st("span",{class:"label uppercase"}," L ",-1)),Ly=["value"],Iy={class:"meter"},Fy=ke(()=>st("span",{class:"label uppercase"}," R ",-1)),By=["value"],Wy=ke(()=>st("h4",null,"Correlation",-1)),Vy={class:"meter"},jy=ke(()=>st("span",{class:"label uppercase"}," L/R ",-1)),zy=["value"],Ny=ke(()=>st("h4",null,"Stereo Field",-1)),Hy={class:"container stereo-field"},$y=dn({__name:"Insights",setup(e){se.register(Hn,Nn,Kn,Ni,Ym,iy,qm,Yn,mr,yr,br,$n);const t=Nt(),i=Nt(),n=Nt(),s=Ps(),r=Nt([]),o=Nt([]),a=Array.from({length:60},()=>-1/0),l=h=>{var f,d;h.width=(f=h.parentElement)==null?void 0:f.clientWidth,h.height=(d=h.parentElement)==null?void 0:d.clientHeight,window.addEventListener("resize",()=>{var _,y;h.width=(_=h.parentElement)==null?void 0:_.clientWidth,h.height=(y=h.parentElement)==null?void 0:y.clientHeight})};Dr(()=>{if(!t.value||!i.value||!n.value)return;l(i.value),l(t.value),l(n.value),r.value=a,o.value=a;const h=new se(t.value,{data:{labels:Array.from({length:60},(y,v)=>v),datasets:c()},options:{responsive:!0,maintainAspectRatio:!1,scales:{y:{min:-30,max:0,ticks:{font:{family:"Poppins",size:10}},title:{display:!0,text:"Loudness (LUFS)",font:{family:"Poppins"}}},x:{ticks:{display:!1},title:{display:!0,text:"Time (s)",font:{family:"Poppins"}}}},animation:{duration:0}}}),f=new se(i.value,{type:"scatter",data:{datasets:[{data:[],backgroundColor:"#00c48b",borderColor:"#00c48b",pointRadius:.5},{data:[],backgroundColor:"#00c48b99",borderColor:"#00c48bcc",pointRadius:.3},{data:[],backgroundColor:"#00c48b33",borderColor:"#00c48b99",pointRadius:.1}]},options:{responsive:!0,maintainAspectRatio:!1,animation:!1,scales:{y:{min:-1.5,max:1.5,ticks:{callback:y=>y,font:{family:"Poppins"}},title:{display:!0,text:"Left",font:{family:"Poppins"}}},x:{min:-1.5,max:1.5,ticks:{callback:y=>y,font:{family:"Poppins"}},title:{display:!0,text:"Right",font:{family:"Poppins"}}}},plugins:{legend:{display:!1}}}}),d=new se(n.value,{data:{datasets:[{type:"line",tension:1,cubicInterpolationMode:"monotone",data:[{x:0,y:0},{x:255,y:50}],borderColor:"#00c48b"}]},options:{responsive:!0,maintainAspectRatio:!1,scales:{y:{min:0,max:255,ticks:{display:!1},title:{display:!0,text:"Gain",font:{family:"Poppins"}}},x:{min:0,max:18e3,type:"logarithmic",ticks:{callback:y=>y>=1e3?y/1e3+"k":y,font:{family:"Poppins"}},title:{display:!0,text:"Frequency (Hz)",font:{family:"Poppins"}}}},plugins:{legend:{display:!1}}}});let _=0;setInterval(()=>{if(!s.player.playing||(f.data.datasets[2].data=f.data.datasets[1].data,f.data.datasets[1].data=f.data.datasets[0].data,f.data.datasets[0].data=s.stereo.field,f.update(),_++%10!==0))return;const y=s.tonalBalance.data.reduce((v,A,F)=>(v.push({x:F*188,y:A}),v),[]);d.data.datasets[0].data=y,d.update(),h.data.datasets[0].data.shift(),h.data.datasets[0].data.push(s.loudness.shortterm),h.data.datasets[1].data.shift(),h.data.datasets[1].data.push(s.loudness.integrated),h.data.datasets[2].data.shift(),h.data.datasets[2].data.push([-60,s.loudness.momentary]),h.update()},100)});const c=()=>[{label:"short term",type:"line",data:a.map(h=>h),borderColor:"#c7aa19"},{label:"integrated",type:"line",data:a.map(h=>h),borderColor:"#189de4"},{label:"momentary",type:"bar",data:a.map(h=>[h,-1/0]),backgroundColor:"#e8545426"}],u=h=>Math.round(h*100)/100+" LUFS";return(h,f)=>(xe(),Be("div",Ay,[Cy,st("div",My,[At(pi,{class:"relative loudness-chart p-2"},{default:Ke(()=>[st("canvas",{ref_key:"chart",ref:t},null,512)]),_:1}),At(pi,{class:"relative tonal-balance-chart p-2"},{default:Ke(()=>[st("canvas",{ref_key:"tonalBalanceChart",ref:n},null,512)]),_:1})]),st("div",Sy,[At(pi,{class:"mode"},{default:Ke(()=>[Oy,st("span",null,Ze(u(Qt(s).loudness.shortterm)),1)]),_:1}),At(pi,{class:"mode"},{default:Ke(()=>[Ey,st("span",null,Ze(u(Qt(s).loudness.integrated)),1)]),_:1}),At(pi,{class:"mode"},{default:Ke(()=>[Ry,st("span",null,Ze(u(Qt(s).loudness.maxMomentary)),1)]),_:1}),At(pi,{class:"meters"},{default:Ke(()=>[st("div",Ty,[Dy,st("meter",{optimum:"0.25",low:"0.5",high:"0.75",min:"0",max:"1",value:Qt(s).stereo.left},null,8,Ly)]),st("div",Iy,[Fy,st("meter",{optimum:"0.25",low:"0.5",high:"0.75",min:"0",max:"1",value:Qt(s).stereo.right},null,8,By)]),Wy,st("div",Vy,[jy,st("meter",{optimum:"1",low:"-0.5",high:"0",min:"-1",max:"1",value:Qt(s).stereo.correlation},null,8,zy)]),Ny,st("div",Hy,[st("canvas",{ref_key:"stereoFieldChart",ref:i},null,512)])]),_:1})])]))}}),Uy=pn($y,[["__scopeId","data-v-2564d235"]]),qy={},Ky=e=>(Ll("data-v-46429bb4"),e=e(),Il(),e),Yy=zh('',1),Xy={href:"https://github.com/reAudioPlayer/one",target:"_blank"},Gy={"aria-label":"Github",id:"github","xmlns:xlink":"http://www.w3.org/1999/xlink",width:"48.438",xmlns:"http://www.w3.org/2000/svg",height:"50",viewBox:"0 0 48.438 50",style:{"-webkit-print-color-adjust":"exact"},fill:"none",version:"1.1"},Zy=Ky(()=>st("g",{id:"shape-79d840b8-f6ae-8053-8002-334fc9dfbbc1",rx:"0",ry:"0",style:{fill:"rgb(0, 0, 0)"}},[st("g",{id:"shape-79d840b8-f6ae-8053-8002-334fc9e114db"},[st("g",{class:"fills",id:"fills-79d840b8-f6ae-8053-8002-334fc9e114db"},[st("path",{rx:"0",ry:"0",d:"M16.201,38.809C16.201,39.004,15.977,39.160,15.693,39.160C15.371,39.189,15.146,39.033,15.146,38.809C15.146,38.613,15.371,38.457,15.654,38.457C15.947,38.428,16.201,38.584,16.201,38.809ZZM13.164,38.369C13.096,38.564,13.291,38.789,13.584,38.848C13.838,38.945,14.131,38.848,14.189,38.652C14.248,38.457,14.063,38.232,13.770,38.145C13.516,38.076,13.232,38.174,13.164,38.369ZZM17.480,38.203C17.197,38.271,17.002,38.457,17.031,38.682C17.061,38.877,17.314,39.004,17.607,38.936C17.891,38.867,18.086,38.682,18.057,38.486C18.027,38.301,17.764,38.174,17.480,38.203ZZM23.906,0.781C10.361,0.781,0.000,11.064,0.000,24.609C0.000,35.439,6.816,44.707,16.553,47.969C17.803,48.193,18.242,47.422,18.242,46.787C18.242,46.182,18.213,42.842,18.213,40.791C18.213,40.791,11.377,42.256,9.941,37.881C9.941,37.881,8.828,35.039,7.227,34.307C7.227,34.307,4.990,32.773,7.383,32.803C7.383,32.803,9.814,32.998,11.152,35.322C13.291,39.092,16.875,38.008,18.271,37.363C18.496,35.801,19.131,34.717,19.834,34.072C14.375,33.467,8.867,32.676,8.867,23.281C8.867,20.596,9.609,19.248,11.172,17.529C10.918,16.895,10.088,14.277,11.426,10.898C13.467,10.264,18.164,13.535,18.164,13.535C20.117,12.988,22.217,12.705,24.297,12.705C26.377,12.705,28.477,12.988,30.430,13.535C30.430,13.535,35.127,10.254,37.168,10.898C38.506,14.287,37.676,16.895,37.422,17.529C38.984,19.258,39.941,20.605,39.941,23.281C39.941,32.705,34.189,33.457,28.730,34.072C29.629,34.844,30.391,36.309,30.391,38.604C30.391,41.895,30.361,45.967,30.361,46.768C30.361,47.402,30.811,48.174,32.051,47.949C41.816,44.707,48.438,35.439,48.438,24.609C48.438,11.064,37.451,0.781,23.906,0.781ZZM9.492,34.463C9.365,34.561,9.395,34.785,9.561,34.971C9.717,35.127,9.941,35.195,10.068,35.068C10.195,34.971,10.166,34.746,10.000,34.561C9.844,34.404,9.619,34.336,9.492,34.463ZZM8.438,33.672C8.369,33.799,8.467,33.955,8.662,34.053C8.818,34.150,9.014,34.121,9.082,33.984C9.150,33.857,9.053,33.701,8.857,33.604C8.662,33.545,8.506,33.574,8.438,33.672ZZM11.602,37.148C11.445,37.275,11.504,37.568,11.729,37.754C11.953,37.979,12.236,38.008,12.363,37.852C12.490,37.725,12.432,37.432,12.236,37.246C12.021,37.021,11.729,36.992,11.602,37.148ZZM10.488,35.713C10.332,35.811,10.332,36.064,10.488,36.289C10.645,36.514,10.908,36.611,11.035,36.514C11.191,36.387,11.191,36.133,11.035,35.908C10.898,35.684,10.645,35.586,10.488,35.713ZZ"})])])],-1)),Qy=[Zy];function Jy(e,t){return xe(),Be("header",null,[Yy,st("a",Xy,[(xe(),Be("svg",Gy,Qy))])])}const tb=pn(qy,[["render",Jy],["__scopeId","data-v-46429bb4"]]),eb={props:{modelValue:{type:Number,required:!0},max:{type:Number,default:100}},watch:{modelValue(){this.value=this.modelValue}},computed:{percentage(){return Math.min(1,this.value/this.max)*100}},methods:{seek(e,t=!1){console.log("seek",e);const i=this.$el.getBoundingClientRect(),n=e.clientX-i.left,s=this.$el.offsetWidth;if(this.value=n/s*this.max,!t){this.seeking=!1,this.$emit("change",this.value);try{this.$emit("update:modelValue",this.value)}catch{}}}},data(){return{hover:!1,value:this.modelValue||0,seeking:!1}},mounted(){window.addEventListener("mouseup",e=>{this.seeking&&(this.seeking=!1,this.seek(e))}),window.addEventListener("mousemove",e=>{this.seeking&&this.seek(e,!0)})}},ib={class:"progressBar__track"};function nb(e,t,i,n,s,r){return xe(),Be("div",{ref:"el",class:"progressBar",onMousedown:t[0]||(t[0]=o=>s.seeking=!0),onDragover:t[1]||(t[1]=xf(()=>{},["stop"])),onClick:t[2]||(t[2]=(...o)=>r.seek&&r.seek(...o)),onMouseenter:t[3]||(t[3]=o=>s.hover=!0),onMouseleave:t[4]||(t[4]=o=>s.hover=!1)},[st("div",ib,[st("div",{class:fn([{hover:s.hover},"progressBar__progress"]),style:hs({width:`${r.percentage}%`})},null,6)])],544)}const sb=pn(eb,[["render",nb],["__scopeId","data-v-1a625635"]]);function rb(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Gc={exports:{}};/*! * wavesurfer.js 6.6.4 (2023-06-10) * https://wavesurfer-js.org * @license BSD-3-Clause */(function(e,t){(function(n,s){e.exports=s()})(self,()=>(()=>{var i={"./src/drawer.canvasentry.js":(o,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;var c=h(l("./src/util/style.js")),u=h(l("./src/util/get-id.js"));function h(S){return S&&S.__esModule?S:{default:S}}function f(S){"@babel/helpers - typeof";return f=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(C){return typeof C}:function(C){return C&&typeof Symbol=="function"&&C.constructor===Symbol&&C!==Symbol.prototype?"symbol":typeof C},f(S)}function d(S,C){if(!(S instanceof C))throw new TypeError("Cannot call a class as a function")}function _(S,C){for(var P=0;P=x;H--)p=M[2*H+1]||0,V=Math.round(p/T),P.lineTo((H-I)*m+this.halfPixel,g-V);P.lineTo((x-I)*m,g-Math.round((M[2*x+1]||0)/T)),P.closePath(),P.fill()}}},{key:"destroy",value:function(){this.waveCtx=null,this.wave=null,this.progressCtx=null,this.progress=null}},{key:"getImage",value:function(P,M,D){var R=this;if(D==="blob")return new Promise(function(B){R.wave.toBlob(B,P,M)});if(D==="dataURL")return this.wave.toDataURL(P,M)}}]),S}();a.default=F,o.exports=a.default},"./src/drawer.js":(o,a,l)=>{function c(W){"@babel/helpers - typeof";return c=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(L){return typeof L}:function(L){return L&&typeof Symbol=="function"&&L.constructor===Symbol&&L!==Symbol.prototype?"symbol":typeof L},c(W)}Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;var u=f(l("./src/util/index.js"));function h(W){if(typeof WeakMap!="function")return null;var L=new WeakMap,j=new WeakMap;return(h=function(b){return b?j:L})(W)}function f(W,L){if(!L&&W&&W.__esModule)return W;if(W===null||c(W)!=="object"&&typeof W!="function")return{default:W};var j=h(L);if(j&&j.has(W))return j.get(W);var I={},b=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var x in W)if(x!=="default"&&Object.prototype.hasOwnProperty.call(W,x)){var O=b?Object.getOwnPropertyDescriptor(W,x):null;O&&(O.get||O.set)?Object.defineProperty(I,x,O):I[x]=W[x]}return I.default=W,j&&j.set(W,I),I}function d(W,L){if(!(W instanceof L))throw new TypeError("Cannot call a class as a function")}function _(W,L){for(var j=0;j"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function R(W){return R=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(j){return j.__proto__||Object.getPrototypeOf(j)},R(W)}var B=function(W){F(j,W);var L=C(j);function j(I,b){var x;return d(this,j),x=L.call(this),x.container=u.withOrientation(I,b.vertical),x.params=b,x.width=0,x.height=b.height*x.params.pixelRatio,x.lastPos=0,x.wrapper=null,x}return y(j,[{key:"style",value:function(b,x){return u.style(b,x)}},{key:"createWrapper",value:function(){this.wrapper=u.withOrientation(this.container.appendChild(document.createElement("wave")),this.params.vertical),this.style(this.wrapper,{display:"block",position:"relative",userSelect:"none",webkitUserSelect:"none",height:this.params.height+"px"}),(this.params.fillParent||this.params.scrollParent)&&this.style(this.wrapper,{width:"100%",cursor:this.params.hideCursor?"none":"auto",overflowX:this.params.hideScrollbar?"hidden":"auto",overflowY:"hidden"}),this.setupWrapperEvents()}},{key:"handleEvent",value:function(b,x){!x&&b.preventDefault();var O=u.withOrientation(b.targetTouches?b.targetTouches[0]:b,this.params.vertical).clientX,m=this.wrapper.getBoundingClientRect(),g=this.width,T=this.getWidth(),k=this.getProgressPixels(m,O),p;return!this.params.fillParent&&g=g.bottom-m)return}b.params.interact&&b.fireEvent("click",x,b.handleEvent(x))}),this.wrapper.addEventListener("dblclick",function(x){b.params.interact&&b.fireEvent("dblclick",x,b.handleEvent(x))}),this.wrapper.addEventListener("scroll",function(x){return b.fireEvent("scroll",x)})}},{key:"drawPeaks",value:function(b,x,O,m){this.setWidth(x)||this.clearWave(),this.params.barWidth?this.drawBars(b,0,O,m):this.drawWave(b,0,O,m)}},{key:"resetScroll",value:function(){this.wrapper!==null&&(this.wrapper.scrollLeft=0)}},{key:"recenter",value:function(b){var x=this.wrapper.scrollWidth*b;this.recenterOnPosition(x,!0)}},{key:"recenterOnPosition",value:function(b,x){var O=this.wrapper.scrollLeft,m=~~(this.wrapper.clientWidth/2),g=this.wrapper.scrollWidth-this.wrapper.clientWidth,T=b-m,k=T-O;if(g!=0){if(!x&&-m<=k&&k=x){if(this.lastPos=O,this.params.scrollParent&&this.params.autoCenter){var m=~~(this.wrapper.scrollWidth*b);this.recenterOnPosition(m,this.params.autoCenterImmediately)}this.updateProgress(O)}}},{key:"destroy",value:function(){this.unAll(),this.wrapper&&(this.wrapper.parentNode==this.container.domElement&&this.container.removeChild(this.wrapper.domElement),this.wrapper=null)}},{key:"updateCursor",value:function(){}},{key:"updateSize",value:function(){}},{key:"drawBars",value:function(b,x,O,m){}},{key:"drawWave",value:function(b,x,O,m){}},{key:"clearWave",value:function(){}},{key:"updateProgress",value:function(b){}}]),j}(u.Observer);a.default=B,o.exports=a.default},"./src/drawer.multicanvas.js":(o,a,l)=>{function c(I){"@babel/helpers - typeof";return c=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(b){return typeof b}:function(b){return b&&typeof Symbol=="function"&&b.constructor===Symbol&&b!==Symbol.prototype?"symbol":typeof b},c(I)}Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;var u=y(l("./src/drawer.js")),h=_(l("./src/util/index.js")),f=y(l("./src/drawer.canvasentry.js"));function d(I){if(typeof WeakMap!="function")return null;var b=new WeakMap,x=new WeakMap;return(d=function(m){return m?x:b})(I)}function _(I,b){if(!b&&I&&I.__esModule)return I;if(I===null||c(I)!=="object"&&typeof I!="function")return{default:I};var x=d(b);if(x&&x.has(I))return x.get(I);var O={},m=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var g in I)if(g!=="default"&&Object.prototype.hasOwnProperty.call(I,g)){var T=m?Object.getOwnPropertyDescriptor(I,g):null;T&&(T.get||T.set)?Object.defineProperty(O,g,T):O[g]=I[g]}return O.default=I,x&&x.set(I,O),O}function y(I){return I&&I.__esModule?I:{default:I}}function v(I,b){if(!(I instanceof b))throw new TypeError("Cannot call a class as a function")}function A(I,b){for(var x=0;x"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function L(I){return L=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(x){return x.__proto__||Object.getPrototypeOf(x)},L(I)}var j=function(I){P(x,I);var b=D(x);function x(O,m){var g;return v(this,x),g=b.call(this,O,m),g.maxCanvasWidth=m.maxCanvasWidth,g.maxCanvasElementWidth=Math.round(m.maxCanvasWidth/m.pixelRatio),g.hasProgressCanvas=m.waveColor!=m.progressColor,g.halfPixel=.5/m.pixelRatio,g.canvases=[],g.progressWave=null,g.EntryClass=f.default,g.canvasContextAttributes=m.drawingContextAttributes,g.overlap=2*Math.ceil(m.pixelRatio/2),g.barRadius=m.barRadius||0,g.vertical=m.vertical,g}return F(x,[{key:"init",value:function(){this.createWrapper(),this.createElements()}},{key:"createElements",value:function(){this.progressWave=h.withOrientation(this.wrapper.appendChild(document.createElement("wave")),this.params.vertical),this.style(this.progressWave,{position:"absolute",zIndex:3,left:0,top:0,bottom:0,overflow:"hidden",width:"0",display:"none",boxSizing:"border-box",borderRightStyle:"solid",pointerEvents:"none"}),this.addCanvas(),this.updateCursor()}},{key:"updateCursor",value:function(){this.style(this.progressWave,{borderRightWidth:this.params.cursorWidth+"px",borderRightColor:this.params.cursorColor})}},{key:"updateSize",value:function(){for(var m=this,g=Math.round(this.width/this.params.pixelRatio),T=Math.ceil(g/(this.maxCanvasElementWidth+this.overlap));this.canvases.lengthT;)this.removeCanvas();var k=this.maxCanvasWidth+this.overlap,p=this.canvases.length-1;this.canvases.forEach(function(V,H){H==p&&(k=m.width-m.maxCanvasWidth*p),m.updateDimensions(V,k,m.height),V.clearWave()})}},{key:"addCanvas",value:function(){var m=new this.EntryClass;m.canvasContextAttributes=this.canvasContextAttributes,m.hasProgressCanvas=this.hasProgressCanvas,m.halfPixel=this.halfPixel;var g=this.maxCanvasElementWidth*this.canvases.length,T=h.withOrientation(this.wrapper.appendChild(document.createElement("canvas")),this.params.vertical);if(this.style(T,{position:"absolute",zIndex:2,left:g+"px",top:0,bottom:0,height:"100%",pointerEvents:"none"}),m.initWave(T),this.hasProgressCanvas){var k=h.withOrientation(this.progressWave.appendChild(document.createElement("canvas")),this.params.vertical);this.style(k,{position:"absolute",left:g+"px",top:0,bottom:0,height:"100%"}),m.initProgress(k)}this.canvases.push(m)}},{key:"removeCanvas",value:function(){var m=this.canvases[this.canvases.length-1];m.wave.parentElement.removeChild(m.wave.domElement),this.hasProgressCanvas&&m.progress.parentElement.removeChild(m.progress.domElement),m&&(m.destroy(),m=null),this.canvases.pop()}},{key:"updateDimensions",value:function(m,g,T){var k=Math.round(g/this.params.pixelRatio),p=Math.round(this.width/this.params.pixelRatio);m.updateDimensions(k,p,g,T),this.style(this.progressWave,{display:"block"})}},{key:"clearWave",value:function(){var m=this;h.frame(function(){m.canvases.forEach(function(g){return g.clearWave()})})()}},{key:"drawBars",value:function(m,g,T,k){var p=this;return this.prepareDraw(m,g,T,k,function(V){var H=V.absmax,Z=V.hasMinVals;V.height;var G=V.offsetY,J=V.halfH,lt=V.peaks,it=V.channelIndex;if(T!==void 0){var yt=Z?2:1,Tt=lt.length/yt,gt=p.params.barWidth*p.params.pixelRatio,w=p.params.barGap===null?Math.max(p.params.pixelRatio,~~(gt/2)):Math.max(p.params.pixelRatio,p.params.barGap*p.params.pixelRatio),E=gt+w,z=Tt/p.width,N=T,$=k,q=N;for(q;q<$;q+=E){var X=0,K=Math.floor(q*z)*yt,Y=Math.floor((q+E)*z)*yt;do{var U=Math.abs(lt[K]);U>X&&(X=U),K+=yt}while(K1&&arguments[1]!==void 0?arguments[1]:this.params.waveColor,T=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.params.progressColor;m.setFillStyles(g,T)}},{key:"applyCanvasTransforms",value:function(m){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;m.applyCanvasTransforms(g)}},{key:"getImage",value:function(m,g,T){if(T==="blob")return Promise.all(this.canvases.map(function(p){return p.getImage(m,g,T)}));if(T==="dataURL"){var k=this.canvases.map(function(p){return p.getImage(m,g,T)});return k.length>1?k:k[0]}}},{key:"updateProgress",value:function(m){this.style(this.progressWave,{width:m+"px"})}}]),x}(u.default);a.default=j,o.exports=a.default},"./src/mediaelement-webaudio.js":(o,a,l)=>{function c(L){"@babel/helpers - typeof";return c=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(j){return typeof j}:function(j){return j&&typeof Symbol=="function"&&j.constructor===Symbol&&j!==Symbol.prototype?"symbol":typeof j},c(L)}Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;var u=h(l("./src/mediaelement.js"));function h(L){return L&&L.__esModule?L:{default:L}}function f(L,j){if(!(L instanceof j))throw new TypeError("Cannot call a class as a function")}function d(L,j){for(var I=0;I"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function B(L){return B=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(I){return I.__proto__||Object.getPrototypeOf(I)},B(L)}var W=function(L){S(I,L);var j=P(I);function I(b){var x;return f(this,I),x=j.call(this,b),x.params=b,x.sourceMediaElement=null,x}return _(I,[{key:"init",value:function(){this.setPlaybackRate(this.params.audioRate),this.createTimer(),this.createVolumeNode(),this.createScriptNode(),this.createAnalyserNode()}},{key:"_load",value:function(x,O,m){A(B(I.prototype),"_load",this).call(this,x,O,m),this.createMediaElementSource(x)}},{key:"createMediaElementSource",value:function(x){this.sourceMediaElement=this.ac.createMediaElementSource(x),this.sourceMediaElement.connect(this.analyser)}},{key:"play",value:function(x,O){return this.resumeAudioContext(),A(B(I.prototype),"play",this).call(this,x,O)}},{key:"destroy",value:function(){A(B(I.prototype),"destroy",this).call(this),this.destroyWebAudio()}}]),I}(u.default);a.default=W,o.exports=a.default},"./src/mediaelement.js":(o,a,l)=>{function c(b){"@babel/helpers - typeof";return c=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(x){return typeof x}:function(x){return x&&typeof Symbol=="function"&&x.constructor===Symbol&&x!==Symbol.prototype?"symbol":typeof x},c(b)}Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;var u=_(l("./src/webaudio.js")),h=d(l("./src/util/index.js"));function f(b){if(typeof WeakMap!="function")return null;var x=new WeakMap,O=new WeakMap;return(f=function(g){return g?O:x})(b)}function d(b,x){if(!x&&b&&b.__esModule)return b;if(b===null||c(b)!=="object"&&typeof b!="function")return{default:b};var O=f(x);if(O&&O.has(b))return O.get(b);var m={},g=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var T in b)if(T!=="default"&&Object.prototype.hasOwnProperty.call(b,T)){var k=g?Object.getOwnPropertyDescriptor(b,T):null;k&&(k.get||k.set)?Object.defineProperty(m,T,k):m[T]=b[T]}return m.default=b,O&&O.set(b,m),m}function _(b){return b&&b.__esModule?b:{default:b}}function y(b,x){if(!(b instanceof x))throw new TypeError("Cannot call a class as a function")}function v(b,x){for(var O=0;O"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function j(b){return j=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(O){return O.__proto__||Object.getPrototypeOf(O)},j(b)}var I=function(b){M(O,b);var x=R(O);function O(m){var g;return y(this,O),g=x.call(this,m),g.params=m,g.media={currentTime:0,duration:0,paused:!0,playbackRate:1,play:function(){},pause:function(){},volume:0},g.mediaType=m.mediaType.toLowerCase(),g.elementPosition=m.elementPosition,g.peaks=null,g.playbackRate=1,g.volume=1,g.isMuted=!1,g.buffer=null,g.onPlayEnd=null,g.mediaListeners={},g}return A(O,[{key:"init",value:function(){this.setPlaybackRate(this.params.audioRate),this.createTimer()}},{key:"_setupMediaListeners",value:function(){var g=this;this.mediaListeners.error=function(){g.fireEvent("error","Error loading media element")},this.mediaListeners.waiting=function(){g.fireEvent("waiting")},this.mediaListeners.canplay=function(){g.fireEvent("canplay")},this.mediaListeners.ended=function(){g.fireEvent("finish")},this.mediaListeners.play=function(){g.fireEvent("play")},this.mediaListeners.pause=function(){g.fireEvent("pause")},this.mediaListeners.seeked=function(T){g.fireEvent("seek")},this.mediaListeners.volumechange=function(T){g.isMuted=g.media.muted,g.isMuted?g.volume=0:g.volume=g.media.volume,g.fireEvent("volume")},Object.keys(this.mediaListeners).forEach(function(T){g.media.removeEventListener(T,g.mediaListeners[T]),g.media.addEventListener(T,g.mediaListeners[T])})}},{key:"createTimer",value:function(){var g=this,T=function k(){g.isPaused()||(g.fireEvent("audioprocess",g.getCurrentTime()),h.frame(k)())};this.on("play",T),this.on("pause",function(){g.fireEvent("audioprocess",g.getCurrentTime())})}},{key:"load",value:function(g,T,k,p){var V=document.createElement(this.mediaType);V.controls=this.params.mediaControls,V.autoplay=this.params.autoplay||!1,V.preload=p??"auto",V.src=g,V.style.width="100%";var H=T.querySelector(this.mediaType);H&&T.removeChild(H),T.appendChild(V),this._load(V,k,p)}},{key:"loadElt",value:function(g,T){g.controls=this.params.mediaControls,g.autoplay=this.params.autoplay||!1,this._load(g,T,g.preload)}},{key:"_load",value:function(g,T,k){if(!(g instanceof HTMLMediaElement)||typeof g.addEventListener>"u")throw new Error("media parameter is not a valid media element");typeof g.load=="function"&&!(T&&k=="none")&&g.load(),this.media=g,this._setupMediaListeners(),this.peaks=T,this.onPlayEnd=null,this.buffer=null,this.isMuted=g.muted,this.setPlaybackRate(this.playbackRate),this.setVolume(this.volume)}},{key:"isPaused",value:function(){return!this.media||this.media.paused}},{key:"getDuration",value:function(){if(this.explicitDuration)return this.explicitDuration;var g=(this.buffer||this.media).duration;return g>=1/0&&(g=this.media.seekable.end(0)),g}},{key:"getCurrentTime",value:function(){return this.media&&this.media.currentTime}},{key:"getPlayedPercents",value:function(){return this.getCurrentTime()/this.getDuration()||0}},{key:"getPlaybackRate",value:function(){return this.playbackRate||this.media.playbackRate}},{key:"setPlaybackRate",value:function(g){this.playbackRate=g||1,this.media.playbackRate=this.playbackRate}},{key:"seekTo",value:function(g){g!=null&&!isNaN(g)&&(this.media.currentTime=g),this.clearPlayEnd()}},{key:"play",value:function(g,T){this.seekTo(g);var k=this.media.play();return T&&this.setPlayEnd(T),k}},{key:"pause",value:function(){var g;return this.media&&(g=this.media.pause()),this.clearPlayEnd(),g}},{key:"setPlayEnd",value:function(g){var T=this;this.clearPlayEnd(),this._onPlayEnd=function(k){k>=g&&(T.pause(),T.seekTo(g))},this.on("audioprocess",this._onPlayEnd)}},{key:"clearPlayEnd",value:function(){this._onPlayEnd&&(this.un("audioprocess",this._onPlayEnd),this._onPlayEnd=null)}},{key:"getPeaks",value:function(g,T,k){return this.buffer?C(j(O.prototype),"getPeaks",this).call(this,g,T,k):this.peaks||[]}},{key:"setSinkId",value:function(g){return g?this.media.setSinkId?this.media.setSinkId(g):Promise.reject(new Error("setSinkId is not supported in your browser")):Promise.reject(new Error("Invalid deviceId: "+g))}},{key:"getVolume",value:function(){return this.volume}},{key:"setVolume",value:function(g){this.volume=g,this.media.volume!==this.volume&&(this.media.volume=this.volume)}},{key:"setMute",value:function(g){this.isMuted=this.media.muted=g}},{key:"destroy",value:function(){var g=this;this.pause(),this.unAll(),this.destroyed=!0,Object.keys(this.mediaListeners).forEach(function(T){g.media&&g.media.removeEventListener(T,g.mediaListeners[T])}),this.params.removeMediaElementOnDestroy&&this.media&&this.media.parentNode&&this.media.parentNode.removeChild(this.media),this.media=null}}]),O}(u.default);a.default=I,o.exports=a.default},"./src/peakcache.js":(o,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;function l(y){"@babel/helpers - typeof";return l=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(v){return typeof v}:function(v){return v&&typeof Symbol=="function"&&v.constructor===Symbol&&v!==Symbol.prototype?"symbol":typeof v},l(y)}function c(y,v){if(!(y instanceof v))throw new TypeError("Cannot call a class as a function")}function u(y,v){for(var A=0;A{Object.defineProperty(a,"__esModule",{value:!0}),a.default=f;var c=h(l("./src/util/max.js")),u=h(l("./src/util/min.js"));function h(d){return d&&d.__esModule?d:{default:d}}function f(d){var _=(0,c.default)(d),y=(0,u.default)(d);return-y>_?-y:_}o.exports=a.default},"./src/util/clamp.js":(o,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.default=l;function l(c,u,h){return Math.min(Math.max(u,c),h)}o.exports=a.default},"./src/util/fetch.js":(o,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.default=F;var c=u(l("./src/util/observer.js"));function u(S){return S&&S.__esModule?S:{default:S}}function h(S){"@babel/helpers - typeof";return h=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(C){return typeof C}:function(C){return C&&typeof Symbol=="function"&&C.constructor===Symbol&&C!==Symbol.prototype?"symbol":typeof C},h(S)}function f(S,C){if(!(S instanceof C))throw new TypeError("Cannot call a class as a function")}function d(S,C){for(var P=0;P{Object.defineProperty(a,"__esModule",{value:!0}),a.default=h;var c=u(l("./src/util/request-animation-frame.js"));function u(f){return f&&f.__esModule?f:{default:f}}function h(f){return function(){for(var d=arguments.length,_=new Array(d),y=0;y{Object.defineProperty(a,"__esModule",{value:!0}),a.default=l;function l(c){return c===void 0&&(c="wavesurfer_"),c+Math.random().toString(32).substring(2)}o.exports=a.default},"./src/util/index.js":(o,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"Observer",{enumerable:!0,get:function(){return d.default}}),Object.defineProperty(a,"absMax",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(a,"clamp",{enumerable:!0,get:function(){return C.default}}),Object.defineProperty(a,"debounce",{enumerable:!0,get:function(){return A.default}}),Object.defineProperty(a,"fetchFile",{enumerable:!0,get:function(){return S.default}}),Object.defineProperty(a,"frame",{enumerable:!0,get:function(){return v.default}}),Object.defineProperty(a,"getId",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(a,"ignoreSilenceMode",{enumerable:!0,get:function(){return M.default}}),Object.defineProperty(a,"max",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(a,"min",{enumerable:!0,get:function(){return h.default}}),Object.defineProperty(a,"preventClick",{enumerable:!0,get:function(){return F.default}}),Object.defineProperty(a,"requestAnimationFrame",{enumerable:!0,get:function(){return y.default}}),Object.defineProperty(a,"style",{enumerable:!0,get:function(){return _.default}}),Object.defineProperty(a,"withOrientation",{enumerable:!0,get:function(){return P.default}});var c=D(l("./src/util/get-id.js")),u=D(l("./src/util/max.js")),h=D(l("./src/util/min.js")),f=D(l("./src/util/absMax.js")),d=D(l("./src/util/observer.js")),_=D(l("./src/util/style.js")),y=D(l("./src/util/request-animation-frame.js")),v=D(l("./src/util/frame.js")),A=D(l("./node_modules/debounce/index.js")),F=D(l("./src/util/prevent-click.js")),S=D(l("./src/util/fetch.js")),C=D(l("./src/util/clamp.js")),P=D(l("./src/util/orientation.js")),M=D(l("./src/util/silence-mode.js"));function D(R){return R&&R.__esModule?R:{default:R}}},"./src/util/max.js":(o,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.default=l;function l(c){var u=-1/0;return Object.keys(c).forEach(function(h){c[h]>u&&(u=c[h])}),u}o.exports=a.default},"./src/util/min.js":(o,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.default=l;function l(c){var u=1/0;return Object.keys(c).forEach(function(h){c[h]{Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;function l(y){"@babel/helpers - typeof";return l=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(v){return typeof v}:function(v){return v&&typeof Symbol=="function"&&v.constructor===Symbol&&v!==Symbol.prototype?"symbol":typeof v},l(y)}function c(y,v){if(!(y instanceof v))throw new TypeError("Cannot call a class as a function")}function u(y,v){for(var A=0;A=0;C--)S[C]==F&&S.splice(C,1);else S.length=0}}},{key:"unAll",value:function(){this.handlers=null}},{key:"once",value:function(A,F){var S=this,C=function P(){for(var M=arguments.length,D=new Array(M),R=0;R1?F-1:0),C=1;C{Object.defineProperty(a,"__esModule",{value:!0}),a.default=h;var l={width:"height",height:"width",overflowX:"overflowY",overflowY:"overflowX",clientWidth:"clientHeight",clientHeight:"clientWidth",clientX:"clientY",clientY:"clientX",scrollWidth:"scrollHeight",scrollLeft:"scrollTop",offsetLeft:"offsetTop",offsetTop:"offsetLeft",offsetHeight:"offsetWidth",offsetWidth:"offsetHeight",left:"top",right:"bottom",top:"left",bottom:"right",borderRightStyle:"borderBottomStyle",borderRightWidth:"borderBottomWidth",borderRightColor:"borderBottomColor"};function c(f,d){return Object.prototype.hasOwnProperty.call(l,f)&&d?l[f]:f}var u=Symbol("isProxy");function h(f,d){return f[u]?f:new Proxy(f,{get:function(y,v,A){if(v===u)return!0;if(v==="domElement")return y;if(v==="style")return h(y.style,d);if(v==="canvas")return h(y.canvas,d);if(v==="getBoundingClientRect")return function(){return h(y.getBoundingClientRect.apply(y,arguments),d)};if(v==="getContext")return function(){return h(y.getContext.apply(y,arguments),d)};var F=y[c(v,d)];return typeof F=="function"?F.bind(y):F},set:function(y,v,A){return y[c(v,d)]=A,!0}})}o.exports=a.default},"./src/util/prevent-click.js":(o,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.default=c;function l(u){u.stopPropagation(),document.body.removeEventListener("click",l,!0)}function c(u){document.body.addEventListener("click",l,!0)}o.exports=a.default},"./src/util/request-animation-frame.js":(o,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;var l=(window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(c,u){return setTimeout(c,1e3/60)}).bind(window);a.default=l,o.exports=a.default},"./src/util/silence-mode.js":(o,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.default=l;function l(){var c=new AudioContext,u=c.createBufferSource();u.buffer=c.createBuffer(1,1,44100),u.connect(c.destination),u.start();var h="data:audio/mpeg;base64,//uQxAAAAAAAAAAAAAAAAAAAAAAAWGluZwAAAA8AAAACAAACcQCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA//////////////////////////////////////////////////////////////////8AAABhTEFNRTMuMTAwA8MAAAAAAAAAABQgJAUHQQAB9AAAAnGMHkkIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//sQxAADgnABGiAAQBCqgCRMAAgEAH///////////////7+n/9FTuQsQH//////2NG0jWUGlio5gLQTOtIoeR2WX////X4s9Atb/JRVCbBUpeRUq//////////////////9RUi0f2jn/+xDECgPCjAEQAABN4AAANIAAAAQVTEFNRTMuMTAwVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVQ==",f=document.createElement("div");f.innerHTML='';var d=f.children.item(0);d.src=h,d.preload="auto",d.type="audio/mpeg",d.disableRemotePlayback=!0,d.play(),d.remove(),f.remove()}o.exports=a.default},"./src/util/style.js":(o,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.default=l;function l(c,u){return Object.keys(u).forEach(function(h){c.style[h]!==u[h]&&(c.style[h]=u[h])}),c}o.exports=a.default},"./src/wavesurfer.js":(o,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;var c=A(l("./src/util/index.js")),u=y(l("./src/drawer.multicanvas.js")),h=y(l("./src/webaudio.js")),f=y(l("./src/mediaelement.js")),d=y(l("./src/peakcache.js")),_=y(l("./src/mediaelement-webaudio.js"));function y(m){return m&&m.__esModule?m:{default:m}}function v(m){if(typeof WeakMap!="function")return null;var g=new WeakMap,T=new WeakMap;return(v=function(p){return p?T:g})(m)}function A(m,g){if(!g&&m&&m.__esModule)return m;if(m===null||W(m)!=="object"&&typeof m!="function")return{default:m};var T=v(g);if(T&&T.has(m))return T.get(m);var k={},p=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var V in m)if(V!=="default"&&Object.prototype.hasOwnProperty.call(m,V)){var H=p?Object.getOwnPropertyDescriptor(m,V):null;H&&(H.get||H.set)?Object.defineProperty(k,V,H):k[V]=m[V]}return k.default=m,T&&T.set(m,k),k}function F(m,g){if(typeof g!="function"&&g!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(g&&g.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),Object.defineProperty(m,"prototype",{writable:!1}),g&&S(m,g)}function S(m,g){return S=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(k,p){return k.__proto__=p,k},S(m,g)}function C(m){var g=D();return function(){var k=R(m),p;if(g){var V=R(this).constructor;p=Reflect.construct(k,arguments,V)}else p=k.apply(this,arguments);return P(this,p)}}function P(m,g){if(g&&(W(g)==="object"||typeof g=="function"))return g;if(g!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return M(m)}function M(m){if(m===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m}function D(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function R(m){return R=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(T){return T.__proto__||Object.getPrototypeOf(T)},R(m)}function B(m,g,T){return g=b(g),g in m?Object.defineProperty(m,g,{value:T,enumerable:!0,configurable:!0,writable:!0}):m[g]=T,m}function W(m){"@babel/helpers - typeof";return W=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(g){return typeof g}:function(g){return g&&typeof Symbol=="function"&&g.constructor===Symbol&&g!==Symbol.prototype?"symbol":typeof g},W(m)}function L(m,g){if(!(m instanceof g))throw new TypeError("Cannot call a class as a function")}function j(m,g){for(var T=0;T=this.getDuration()?this.seekTo(1):this.seekTo(p/this.getDuration())}},{key:"play",value:function(p,V){var H=this;return this.params.ignoreSilenceMode&&c.ignoreSilenceMode(),this.fireEvent("interaction",function(){return H.play(p,V)}),this.backend.play(p,V)}},{key:"setPlayEnd",value:function(p){this.backend.setPlayEnd(p)}},{key:"pause",value:function(){if(!this.backend.isPaused())return this.backend.pause()}},{key:"playPause",value:function(){return this.backend.isPaused()?this.play():this.pause()}},{key:"isPlaying",value:function(){return!this.backend.isPaused()}},{key:"skipBackward",value:function(p){this.skip(-p||-this.params.skipLength)}},{key:"skipForward",value:function(p){this.skip(p||this.params.skipLength)}},{key:"skip",value:function(p){var V=this.getDuration()||1,H=this.getCurrentTime()||0;H=Math.max(0,Math.min(V,H+(p||0))),this.seekAndCenter(H/V)}},{key:"seekAndCenter",value:function(p){this.seekTo(p),this.drawer.recenter(p)}},{key:"seekTo",value:function(p){var V=this;if(typeof p!="number"||!isFinite(p)||p<0||p>1)throw new Error("Error calling wavesurfer.seekTo, parameter must be a number between 0 and 1!");this.fireEvent("interaction",function(){return V.seekTo(p)});var H=this.params.backend==="WebAudio",Z=this.backend.isPaused();H&&!Z&&this.backend.pause();var G=this.params.scrollParent;this.params.scrollParent=!1,this.backend.seekTo(p*this.getDuration()),this.drawer.progress(p),H&&!Z&&this.backend.play(),this.params.scrollParent=G,this.fireEvent("seek",p)}},{key:"stop",value:function(){this.pause(),this.seekTo(0),this.drawer.progress(0)}},{key:"setSinkId",value:function(p){return this.backend.setSinkId(p)}},{key:"setVolume",value:function(p){if(this.isMuted===!0){this.savedVolume=p;return}this.backend.setVolume(p),this.fireEvent("volume",p)}},{key:"getVolume",value:function(){return this.backend.getVolume()}},{key:"setPlaybackRate",value:function(p){this.backend.setPlaybackRate(p)}},{key:"getPlaybackRate",value:function(){return this.backend.getPlaybackRate()}},{key:"toggleMute",value:function(){this.setMute(!this.isMuted)}},{key:"setMute",value:function(p){if(p===this.isMuted){this.fireEvent("mute",this.isMuted);return}this.backend.setMute?(this.backend.setMute(p),this.isMuted=p):p?(this.savedVolume=this.backend.getVolume(),this.backend.setVolume(0),this.isMuted=!0,this.fireEvent("volume",0)):(this.backend.setVolume(this.savedVolume),this.isMuted=!1,this.fireEvent("volume",this.savedVolume)),this.fireEvent("mute",this.isMuted)}},{key:"getMute",value:function(){return this.isMuted}},{key:"getFilters",value:function(){return this.backend.filters||[]}},{key:"toggleScroll",value:function(){this.params.scrollParent=!this.params.scrollParent,this.drawBuffer()}},{key:"toggleInteraction",value:function(){this.params.interact=!this.params.interact}},{key:"getWaveColor",value:function(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return this.params.splitChannelsOptions.channelColors[p]?this.params.splitChannelsOptions.channelColors[p].waveColor:this.params.waveColor}},{key:"setWaveColor",value:function(p){var V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;this.params.splitChannelsOptions.channelColors[V]?this.params.splitChannelsOptions.channelColors[V].waveColor=p:this.params.waveColor=p,this.drawBuffer()}},{key:"getProgressColor",value:function(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return this.params.splitChannelsOptions.channelColors[p]?this.params.splitChannelsOptions.channelColors[p].progressColor:this.params.progressColor}},{key:"setProgressColor",value:function(p,V){this.params.splitChannelsOptions.channelColors[V]?this.params.splitChannelsOptions.channelColors[V].progressColor=p:this.params.progressColor=p,this.drawBuffer()}},{key:"getBackgroundColor",value:function(){return this.params.backgroundColor}},{key:"setBackgroundColor",value:function(p){this.params.backgroundColor=p,c.style(this.container,{background:this.params.backgroundColor})}},{key:"getCursorColor",value:function(){return this.params.cursorColor}},{key:"setCursorColor",value:function(p){this.params.cursorColor=p,this.drawer.updateCursor()}},{key:"getHeight",value:function(){return this.params.height}},{key:"setHeight",value:function(p){this.params.height=p,this.drawer.setHeight(p*this.params.pixelRatio),this.drawBuffer()}},{key:"setFilteredChannels",value:function(p){this.params.splitChannelsOptions.filterChannels=p,this.drawBuffer()}},{key:"drawBuffer",value:function(){var p=Math.round(this.getDuration()*this.params.minPxPerSec*this.params.pixelRatio),V=this.drawer.getWidth(),H=p,Z=0,G=Math.max(Z+V,H);this.params.fillParent&&(!this.params.scrollParent||p{Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;var c=h(l("./src/util/index.js"));function u(b){if(typeof WeakMap!="function")return null;var x=new WeakMap,O=new WeakMap;return(u=function(g){return g?O:x})(b)}function h(b,x){if(!x&&b&&b.__esModule)return b;if(b===null||f(b)!=="object"&&typeof b!="function")return{default:b};var O=u(x);if(O&&O.has(b))return O.get(b);var m={},g=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var T in b)if(T!=="default"&&Object.prototype.hasOwnProperty.call(b,T)){var k=g?Object.getOwnPropertyDescriptor(b,T):null;k&&(k.get||k.set)?Object.defineProperty(m,T,k):m[T]=b[T]}return m.default=b,O&&O.set(b,m),m}function f(b){"@babel/helpers - typeof";return f=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(x){return typeof x}:function(x){return x&&typeof Symbol=="function"&&x.constructor===Symbol&&x!==Symbol.prototype?"symbol":typeof x},f(b)}function d(b,x){if(!(b instanceof x))throw new TypeError("Cannot call a class as a function")}function _(b,x){for(var O=0;O"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function M(b){return M=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(O){return O.__proto__||Object.getPrototypeOf(O)},M(b)}function D(b,x,O){return x=R(x),x in b?Object.defineProperty(b,x,{value:O,enumerable:!0,configurable:!0,writable:!0}):b[x]=O,b}function R(b){var x=B(b,"string");return f(x)==="symbol"?x:String(x)}function B(b,x){if(f(b)!=="object"||b===null)return b;var O=b[Symbol.toPrimitive];if(O!==void 0){var m=O.call(b,x||"default");if(f(m)!=="object")return m;throw new TypeError("@@toPrimitive must return a primitive value.")}return(x==="string"?String:Number)(b)}var W="playing",L="paused",j="finished",I=function(b){v(O,b);var x=F(O);function O(m){var g,T,k;return d(this,O),k=x.call(this),D(C(k),"audioContext",null),D(C(k),"stateBehaviors",(g={},D(g,W,{init:function(){this.addOnAudioProcess()},getPlayedPercents:function(){var V=this.getDuration();return this.getCurrentTime()/V||0},getCurrentTime:function(){return this.startPosition+this.getPlayedTime()}}),D(g,L,{init:function(){},getPlayedPercents:function(){var V=this.getDuration();return this.getCurrentTime()/V||0},getCurrentTime:function(){return this.startPosition}}),D(g,j,{init:function(){this.fireEvent("finish")},getPlayedPercents:function(){return 1},getCurrentTime:function(){return this.getDuration()}}),g)),k.params=m,k.ac=m.audioContext||(k.supportsWebAudio()?k.getAudioContext():{}),k.lastPlay=k.ac.currentTime,k.startPosition=0,k.scheduledPause=null,k.states=(T={},D(T,W,Object.create(k.stateBehaviors[W])),D(T,L,Object.create(k.stateBehaviors[L])),D(T,j,Object.create(k.stateBehaviors[j])),T),k.buffer=null,k.filters=[],k.gainNode=null,k.mergedPeaks=null,k.offlineAc=null,k.peaks=null,k.playbackRate=1,k.analyser=null,k.scriptNode=null,k.source=null,k.splitPeaks=[],k.state=null,k.explicitDuration=m.duration,k.sinkStreamDestination=null,k.sinkAudioElement=null,k.destroyed=!1,k}return y(O,[{key:"supportsWebAudio",value:function(){return!!(window.AudioContext||window.webkitAudioContext)}},{key:"getAudioContext",value:function(){return window.WaveSurferAudioContext||(window.WaveSurferAudioContext=new(window.AudioContext||window.webkitAudioContext)),window.WaveSurferAudioContext}},{key:"getOfflineAudioContext",value:function(g){return window.WaveSurferOfflineAudioContext||(window.WaveSurferOfflineAudioContext=new(window.OfflineAudioContext||window.webkitOfflineAudioContext)(1,2,g)),window.WaveSurferOfflineAudioContext}},{key:"init",value:function(){this.createVolumeNode(),this.createScriptNode(),this.createAnalyserNode(),this.setState(L),this.setPlaybackRate(this.params.audioRate),this.setLength(0)}},{key:"disconnectFilters",value:function(){this.filters&&(this.filters.forEach(function(g){g&&g.disconnect()}),this.filters=null,this.analyser.connect(this.gainNode))}},{key:"setState",value:function(g){this.state!==this.states[g]&&(this.state=this.states[g],this.state.init.call(this))}},{key:"setFilter",value:function(){for(var g=arguments.length,T=new Array(g),k=0;k=g.getDuration()&&g.state!==g.states[j]?(g.setState(j),g.fireEvent("pause")):p>=g.scheduledPause&&g.state!==g.states[L]?g.pause():g.state===g.states[W]&&(g.fireEvent("audioprocess",p),c.frame(k)())};T()}},{key:"createAnalyserNode",value:function(){this.analyser=this.ac.createAnalyser(),this.analyser.connect(this.gainNode)}},{key:"createVolumeNode",value:function(){this.ac.createGain?this.gainNode=this.ac.createGain():this.gainNode=this.ac.createGainNode(),this.gainNode.connect(this.ac.destination)}},{key:"setSinkId",value:function(g){return g?(this.sinkAudioElement||(this.sinkAudioElement=new window.Audio,this.sinkAudioElement.autoplay=!0),this.sinkAudioElement.setSinkId?(this.sinkStreamDestination||(this.sinkStreamDestination=this.ac.createMediaStreamDestination()),this.gainNode.disconnect(),this.gainNode.connect(this.sinkStreamDestination),this.sinkAudioElement.srcObject=this.sinkStreamDestination.stream,this.sinkAudioElement.setSinkId(g)):Promise.reject(new Error("setSinkId is not supported in your browser"))):Promise.reject(new Error("Invalid deviceId: "+g))}},{key:"setVolume",value:function(g){this.gainNode.gain.setValueAtTime(g,this.ac.currentTime)}},{key:"getVolume",value:function(){return this.gainNode.gain.value}},{key:"decodeArrayBuffer",value:function(g,T,k){this.offlineAc||(this.offlineAc=this.getOfflineAudioContext(this.ac&&this.ac.sampleRate?this.ac.sampleRate:44100)),"webkitAudioContext"in window?this.offlineAc.decodeAudioData(g,function(p){return T(p)},k):this.offlineAc.decodeAudioData(g).then(function(p){return T(p)}).catch(function(p){return k(p)})}},{key:"setPeaks",value:function(g,T){T!=null&&(this.explicitDuration=T),this.peaks=g}},{key:"setLength",value:function(g){if(!(this.mergedPeaks&&g==2*this.mergedPeaks.length-1+2)){this.splitPeaks=[],this.mergedPeaks=[];var T=this.buffer?this.buffer.numberOfChannels:1,k;for(k=0;kw&&(w=z),zthis.mergedPeaks[2*it])&&(this.mergedPeaks[2*it]=w),(G==0||gt=this.getDuration()&&(g=0)),T==null&&(T=this.getDuration()),this.startPosition=g,this.lastPlay=this.ac.currentTime,this.state===this.states[j]&&this.setState(L),{start:g,end:T}}},{key:"getPlayedTime",value:function(){return(this.ac.currentTime-this.lastPlay)*this.playbackRate}},{key:"play",value:function(g,T){if(this.buffer){this.createSource();var k=this.seekTo(g,T);g=k.start,T=k.end,this.scheduledPause=T,this.source.start(0,g),this.resumeAudioContext(),this.setState(W),this.fireEvent("play")}}},{key:"pause",value:function(){this.scheduledPause=null,this.startPosition+=this.getPlayedTime();try{this.source&&this.source.stop(0)}catch{}this.setState(L),this.fireEvent("pause")}},{key:"getCurrentTime",value:function(){return this.state.getCurrentTime.call(this)}},{key:"getPlaybackRate",value:function(){return this.playbackRate}},{key:"setPlaybackRate",value:function(g){this.playbackRate=g||1,this.source&&this.source.playbackRate.setValueAtTime(this.playbackRate,this.ac.currentTime)}},{key:"setPlayEnd",value:function(g){this.scheduledPause=g}}]),O}(c.Observer);a.default=I,o.exports=a.default},"./node_modules/debounce/index.js":o=>{function a(l,c,u){var h,f,d,_,y;c==null&&(c=100);function v(){var F=Date.now()-_;F=0?h=setTimeout(v,c-F):(h=null,u||(y=l.apply(d,f),d=f=null))}var A=function(){d=this,f=arguments,_=Date.now();var F=u&&!h;return h||(h=setTimeout(v,c)),F&&(y=l.apply(d,f),d=f=null),y};return A.clear=function(){h&&(clearTimeout(h),h=null)},A.flush=function(){h&&(y=l.apply(d,f),d=f=null,clearTimeout(h),h=null)},A}a.debounce=a,o.exports=a}},n={};function s(o){var a=n[o];if(a!==void 0)return a.exports;var l=n[o]={exports:{}};return i[o](l,l.exports,s),l.exports}var r=s("./src/wavesurfer.js");return r})())})(Gc);var ob=Gc.exports;const ab=rb(ob),lb={id:"waveform"},cb=dn({__name:"WaveAudio",setup(e,{expose:t}){const i=Nt(null),n=Nt();Dr(()=>{const d="white",_="green";i.value=ab.create({container:"#waveform",waveColor:d,progressColor:_,cursorWidth:0,barWidth:1,barGap:3,responsive:!0,backend:"MediaElement"}),i.value.on("play",()=>{s.player.playing=!0}),i.value.on("pause",()=>{s.player.playing=!1}),i.value.on("audioprocess",()=>{s.player.progress=i.value.getCurrentTime()}),i.value.on("waveform-ready",()=>{i.value&&(s.player.duration=i.value.getDuration())})});const s=Ps(),r=d=>{n.value=d;const _=new AudioContext;var y=_.createMediaElementSource(n.value);y.connect(_.destination),s.setSource(y,_)};return t({play:()=>{n.value.play()},pause:()=>{n.value.pause()},seek:d=>{i.value.seekTo(d/s.player.duration)},setVolume:d=>{let _=d/100;_=Math.min(Math.max(_,0),1),i.value.setVolume(_)},setMute:d=>{i.value.setMute(d)},onSongChange:d=>{r(d),i.value.load(d)},setElement:r}),(d,_)=>(xe(),Be("div",lb))}}),ub={class:"player relative"},hb={class:"desktop mx-4"},fb={class:"controls"},db={class:"top relative"},pb={class:"bottom"},gb={class:"display"},mb={class:"text-xs text-muted text-right cursor-pointer"},yb={class:"text-xs text-muted text-left"},bb={class:"aux relative"},vb=dn({__name:"Player",setup(e){const t=Ps(),i=Nt(),n=Nt(),s=Nt(),r=h=>{const f=h.target.files[0];if(!f)return;const d=new FileReader;d.onload=_=>{s.value.src=_.target.result,s.value.load(),i.value.onSongChange(s.value),t.onSongChange(),a.value=!0},d.readAsDataURL(f)},o=()=>{n.value.click()},a=Nt(!1),l=Nt(!1),c=()=>{l.value=!l.value,i.value.setMute(l.value)},u=()=>{if(!a.value){o();return}t.player.playing?i.value.pause():i.value.play()};return(h,f)=>(xe(),Be(Yt,null,[mo(st("input",{type:"file",id:"file",ref_key:"upload",ref:n,accept:"audio/*",onChange:r},null,544),[[Oo,!1]]),st("div",ub,[st("div",hb,[st("div",fb,[mo(st("audio",{ref_key:"audio",ref:s,controls:""},null,512),[[Oo,!1]]),st("div",db,[st("span",{class:"cursor-pointer material-symbols-rounded ms-fill text-4xl",onClick:u},Ze(a.value?Qt(t).player.playing?"pause_circle":"play_circle":"file_upload"),1)]),st("div",pb,[st("div",gb,[st("span",mb,Ze(Qt(t).displayProgress),1),At(cb,{ref_key:"playable",ref:i},null,512),st("span",yb,Ze(Qt(t).displayDuration),1)])])]),st("div",bb,[st("span",{class:"icon cursor-pointer material-symbols-rounded ms-fill select-none",onClick:o}," file_upload "),st("span",{class:"icon cursor-pointer material-symbols-rounded ms-fill select-none",onClick:c},Ze(l.value?"volume_off":"volume_up"),1),At(sb,{modelValue:Qt(t).player.volume,"onUpdate:modelValue":f[0]||(f[0]=d=>Qt(t).player.volume=d),max:100,onChange:f[1]||(f[1]=d=>i.value.setVolume(d))},null,8,["modelValue"])])])])],64))}}),_b=pn(vb,[["__scopeId","data-v-921fb191"]]),xb=dn({__name:"App",setup(e){return Ps().initialise(),(i,n)=>(xe(),Be(Yt,null,[At(tb),st("main",null,[At(Uy)]),st("footer",null,[At(_b)])],64))}}),Zc=Pf(xb);Zc.use(Sf());Zc.mount("#app"); + - `)),H=null)}switch(this.params.backend==="WebAudio"&&p instanceof HTMLMediaElement&&(p=p.src),this.params.backend){case"WebAudio":return this.loadBuffer(p,V,Z);case"MediaElement":case"MediaElementWebAudio":return this.loadMediaElement(p,V,H,Z)}}},{key:"loadBuffer",value:function(p,V,H){var Z=this,G=function(lt){return lt&&Z.tmpEvents.push(Z.once("ready",lt)),Z.getArrayBuffer(p,function(it){return Z.loadArrayBuffer(it)})};if(V)this.backend.setPeaks(V,H),this.drawBuffer(),this.fireEvent("waveform-ready"),this.tmpEvents.push(this.once("interaction",G));else return G()}},{key:"loadMediaElement",value:function(p,V,H,Z){var G=this,J=p;if(typeof p=="string")this.backend.load(J,this.mediaContainer,V,H);else{var lt=p;this.backend.loadElt(lt,V),J=lt.src}this.tmpEvents.push(this.backend.once("canplay",function(){G.backend.destroyed||(G.drawBuffer(),G.isReady=!0,G.fireEvent("ready"))}),this.backend.once("error",function(it){return G.fireEvent("error",it)})),V&&(this.backend.setPeaks(V,Z),this.drawBuffer(),this.fireEvent("waveform-ready")),(!V||this.params.forceDecode)&&this.backend.supportsWebAudio()&&this.getArrayBuffer(J,function(it){G.decodeArrayBuffer(it,function(yt){G.backend.buffer=yt,G.backend.setPeaks(null),G.drawBuffer(),G.fireEvent("waveform-ready")})})}},{key:"decodeArrayBuffer",value:function(p,V){var H=this;this.isDestroyed||(this.arraybuffer=p,this.backend.decodeArrayBuffer(p,function(Z){!H.isDestroyed&&H.arraybuffer==p&&(V(Z),H.arraybuffer=null)},function(){return H.fireEvent("error","Error decoding audiobuffer")}))}},{key:"getArrayBuffer",value:function(p,V){var H=this,Z=Object.assign({url:p,responseType:"arraybuffer"},this.params.xhr),G=c.fetchFile(Z);return this.currentRequest=G,this.tmpEvents.push(G.on("progress",function(J){H.onProgress(J)}),G.on("success",function(J){V(J),H.currentRequest=null}),G.on("error",function(J){H.fireEvent("error",J),H.currentRequest=null})),G}},{key:"onProgress",value:function(p){var V;p.lengthComputable?V=p.loaded/p.total:V=p.loaded/(p.loaded+1e6),this.fireEvent("loading",Math.round(V*100),p.target)}},{key:"exportPCM",value:function(p,V,H,Z,G){p=p||1024,Z=Z||0,V=V||1e4,H=H||!1;var J=this.backend.getPeaks(p,Z,G),lt=[].map.call(J,function(it){return Math.round(it*V)/V});return new Promise(function(it,yt){if(!H){var Tt=new Blob([JSON.stringify(lt)],{type:"application/json;charset=utf-8"}),gt=URL.createObjectURL(Tt);window.open(gt),URL.revokeObjectURL(gt)}it(lt)})}},{key:"exportImage",value:function(p,V,H){return p||(p="image/png"),V||(V=1),H||(H="dataURL"),this.drawer.getImage(p,V,H)}},{key:"cancelAjax",value:function(){this.currentRequest&&this.currentRequest.controller&&(this.currentRequest._reader&&this.currentRequest._reader.cancel().catch(function(p){}),this.currentRequest.controller.abort(),this.currentRequest=null)}},{key:"clearTmpEvents",value:function(){this.tmpEvents.forEach(function(p){return p.un()})}},{key:"empty",value:function(){this.backend.isPaused()||(this.stop(),this.backend.disconnectSource()),this.isReady=!1,this.cancelAjax(),this.clearTmpEvents(),this.drawer.progress(0),this.drawer.setWidth(0),this.drawer.drawPeaks({length:this.drawer.getWidth()},0)}},{key:"destroy",value:function(){this.destroyAllPlugins(),this.fireEvent("destroy"),this.cancelAjax(),this.clearTmpEvents(),this.unAll(),this.params.responsive!==!1&&(window.removeEventListener("resize",this._onResize,!0),window.removeEventListener("orientationchange",this._onResize,!0)),this.backend&&(this.backend.destroy(),this.backend=null),this.drawer&&this.drawer.destroy(),this.isDestroyed=!0,this.isReady=!1,this.arraybuffer=null}}],[{key:"create",value:function(p){var V=new T(p);return V.init()}}]),T}(c.Observer);a.default=O,B(O,"VERSION","6.6.4"),B(O,"util",c),o.exports=a.default},"./src/webaudio.js":(o,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;var c=h(l("./src/util/index.js"));function u(b){if(typeof WeakMap!="function")return null;var x=new WeakMap,O=new WeakMap;return(u=function(g){return g?O:x})(b)}function h(b,x){if(!x&&b&&b.__esModule)return b;if(b===null||f(b)!=="object"&&typeof b!="function")return{default:b};var O=u(x);if(O&&O.has(b))return O.get(b);var m={},g=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var T in b)if(T!=="default"&&Object.prototype.hasOwnProperty.call(b,T)){var k=g?Object.getOwnPropertyDescriptor(b,T):null;k&&(k.get||k.set)?Object.defineProperty(m,T,k):m[T]=b[T]}return m.default=b,O&&O.set(b,m),m}function f(b){"@babel/helpers - typeof";return f=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(x){return typeof x}:function(x){return x&&typeof Symbol=="function"&&x.constructor===Symbol&&x!==Symbol.prototype?"symbol":typeof x},f(b)}function d(b,x){if(!(b instanceof x))throw new TypeError("Cannot call a class as a function")}function _(b,x){for(var O=0;O"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function M(b){return M=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(O){return O.__proto__||Object.getPrototypeOf(O)},M(b)}function D(b,x,O){return x=R(x),x in b?Object.defineProperty(b,x,{value:O,enumerable:!0,configurable:!0,writable:!0}):b[x]=O,b}function R(b){var x=B(b,"string");return f(x)==="symbol"?x:String(x)}function B(b,x){if(f(b)!=="object"||b===null)return b;var O=b[Symbol.toPrimitive];if(O!==void 0){var m=O.call(b,x||"default");if(f(m)!=="object")return m;throw new TypeError("@@toPrimitive must return a primitive value.")}return(x==="string"?String:Number)(b)}var W="playing",L="paused",j="finished",I=function(b){v(O,b);var x=F(O);function O(m){var g,T,k;return d(this,O),k=x.call(this),D(C(k),"audioContext",null),D(C(k),"stateBehaviors",(g={},D(g,W,{init:function(){this.addOnAudioProcess()},getPlayedPercents:function(){var V=this.getDuration();return this.getCurrentTime()/V||0},getCurrentTime:function(){return this.startPosition+this.getPlayedTime()}}),D(g,L,{init:function(){},getPlayedPercents:function(){var V=this.getDuration();return this.getCurrentTime()/V||0},getCurrentTime:function(){return this.startPosition}}),D(g,j,{init:function(){this.fireEvent("finish")},getPlayedPercents:function(){return 1},getCurrentTime:function(){return this.getDuration()}}),g)),k.params=m,k.ac=m.audioContext||(k.supportsWebAudio()?k.getAudioContext():{}),k.lastPlay=k.ac.currentTime,k.startPosition=0,k.scheduledPause=null,k.states=(T={},D(T,W,Object.create(k.stateBehaviors[W])),D(T,L,Object.create(k.stateBehaviors[L])),D(T,j,Object.create(k.stateBehaviors[j])),T),k.buffer=null,k.filters=[],k.gainNode=null,k.mergedPeaks=null,k.offlineAc=null,k.peaks=null,k.playbackRate=1,k.analyser=null,k.scriptNode=null,k.source=null,k.splitPeaks=[],k.state=null,k.explicitDuration=m.duration,k.sinkStreamDestination=null,k.sinkAudioElement=null,k.destroyed=!1,k}return y(O,[{key:"supportsWebAudio",value:function(){return!!(window.AudioContext||window.webkitAudioContext)}},{key:"getAudioContext",value:function(){return window.WaveSurferAudioContext||(window.WaveSurferAudioContext=new(window.AudioContext||window.webkitAudioContext)),window.WaveSurferAudioContext}},{key:"getOfflineAudioContext",value:function(g){return window.WaveSurferOfflineAudioContext||(window.WaveSurferOfflineAudioContext=new(window.OfflineAudioContext||window.webkitOfflineAudioContext)(1,2,g)),window.WaveSurferOfflineAudioContext}},{key:"init",value:function(){this.createVolumeNode(),this.createScriptNode(),this.createAnalyserNode(),this.setState(L),this.setPlaybackRate(this.params.audioRate),this.setLength(0)}},{key:"disconnectFilters",value:function(){this.filters&&(this.filters.forEach(function(g){g&&g.disconnect()}),this.filters=null,this.analyser.connect(this.gainNode))}},{key:"setState",value:function(g){this.state!==this.states[g]&&(this.state=this.states[g],this.state.init.call(this))}},{key:"setFilter",value:function(){for(var g=arguments.length,T=new Array(g),k=0;k=g.getDuration()&&g.state!==g.states[j]?(g.setState(j),g.fireEvent("pause")):p>=g.scheduledPause&&g.state!==g.states[L]?g.pause():g.state===g.states[W]&&(g.fireEvent("audioprocess",p),c.frame(k)())};T()}},{key:"createAnalyserNode",value:function(){this.analyser=this.ac.createAnalyser(),this.analyser.connect(this.gainNode)}},{key:"createVolumeNode",value:function(){this.ac.createGain?this.gainNode=this.ac.createGain():this.gainNode=this.ac.createGainNode(),this.gainNode.connect(this.ac.destination)}},{key:"setSinkId",value:function(g){return g?(this.sinkAudioElement||(this.sinkAudioElement=new window.Audio,this.sinkAudioElement.autoplay=!0),this.sinkAudioElement.setSinkId?(this.sinkStreamDestination||(this.sinkStreamDestination=this.ac.createMediaStreamDestination()),this.gainNode.disconnect(),this.gainNode.connect(this.sinkStreamDestination),this.sinkAudioElement.srcObject=this.sinkStreamDestination.stream,this.sinkAudioElement.setSinkId(g)):Promise.reject(new Error("setSinkId is not supported in your browser"))):Promise.reject(new Error("Invalid deviceId: "+g))}},{key:"setVolume",value:function(g){this.gainNode.gain.setValueAtTime(g,this.ac.currentTime)}},{key:"getVolume",value:function(){return this.gainNode.gain.value}},{key:"decodeArrayBuffer",value:function(g,T,k){this.offlineAc||(this.offlineAc=this.getOfflineAudioContext(this.ac&&this.ac.sampleRate?this.ac.sampleRate:44100)),"webkitAudioContext"in window?this.offlineAc.decodeAudioData(g,function(p){return T(p)},k):this.offlineAc.decodeAudioData(g).then(function(p){return T(p)}).catch(function(p){return k(p)})}},{key:"setPeaks",value:function(g,T){T!=null&&(this.explicitDuration=T),this.peaks=g}},{key:"setLength",value:function(g){if(!(this.mergedPeaks&&g==2*this.mergedPeaks.length-1+2)){this.splitPeaks=[],this.mergedPeaks=[];var T=this.buffer?this.buffer.numberOfChannels:1,k;for(k=0;kw&&(w=z),zthis.mergedPeaks[2*it])&&(this.mergedPeaks[2*it]=w),(G==0||gt=this.getDuration()&&(g=0)),T==null&&(T=this.getDuration()),this.startPosition=g,this.lastPlay=this.ac.currentTime,this.state===this.states[j]&&this.setState(L),{start:g,end:T}}},{key:"getPlayedTime",value:function(){return(this.ac.currentTime-this.lastPlay)*this.playbackRate}},{key:"play",value:function(g,T){if(this.buffer){this.createSource();var k=this.seekTo(g,T);g=k.start,T=k.end,this.scheduledPause=T,this.source.start(0,g),this.resumeAudioContext(),this.setState(W),this.fireEvent("play")}}},{key:"pause",value:function(){this.scheduledPause=null,this.startPosition+=this.getPlayedTime();try{this.source&&this.source.stop(0)}catch{}this.setState(L),this.fireEvent("pause")}},{key:"getCurrentTime",value:function(){return this.state.getCurrentTime.call(this)}},{key:"getPlaybackRate",value:function(){return this.playbackRate}},{key:"setPlaybackRate",value:function(g){this.playbackRate=g||1,this.source&&this.source.playbackRate.setValueAtTime(this.playbackRate,this.ac.currentTime)}},{key:"setPlayEnd",value:function(g){this.scheduledPause=g}}]),O}(c.Observer);a.default=I,o.exports=a.default},"./node_modules/debounce/index.js":o=>{function a(l,c,u){var h,f,d,_,y;c==null&&(c=100);function v(){var F=Date.now()-_;F=0?h=setTimeout(v,c-F):(h=null,u||(y=l.apply(d,f),d=f=null))}var A=function(){d=this,f=arguments,_=Date.now();var F=u&&!h;return h||(h=setTimeout(v,c)),F&&(y=l.apply(d,f),d=f=null),y};return A.clear=function(){h&&(clearTimeout(h),h=null)},A.flush=function(){h&&(y=l.apply(d,f),d=f=null,clearTimeout(h),h=null)},A}a.debounce=a,o.exports=a}},n={};function s(o){var a=n[o];if(a!==void 0)return a.exports;var l=n[o]={exports:{}};return i[o](l,l.exports,s),l.exports}var r=s("./src/wavesurfer.js");return r})())})(Gc);var ob=Gc.exports;const ab=rb(ob),lb={id:"waveform"},cb=dn({__name:"WaveAudio",setup(e,{expose:t}){const i=Nt(null),n=Nt();Dr(()=>{const _=getComputedStyle(document.documentElement).getPropertyValue("--fg-base"),v=getComputedStyle(document.documentElement).getPropertyValue("--fg-secondary");i.value=ab.create({container:"#waveform",waveColor:_,progressColor:v,cursorWidth:0,barWidth:1,barGap:3,responsive:!0,backend:"MediaElement"}),i.value.on("play",()=>{s.player.playing=!0}),i.value.on("pause",()=>{s.player.playing=!1}),i.value.on("audioprocess",()=>{s.player.progress=i.value.getCurrentTime()}),i.value.on("waveform-ready",()=>{i.value&&(s.player.duration=i.value.getDuration())})});const s=Ps(),r=d=>{n.value=d;const _=new AudioContext;var y=_.createMediaElementSource(n.value);y.connect(_.destination),s.setSource(y,_)};return t({play:()=>{n.value.play()},pause:()=>{n.value.pause()},seek:d=>{i.value.seekTo(d/s.player.duration)},setVolume:d=>{let _=d/100;_=Math.min(Math.max(_,0),1),i.value.setVolume(_)},setMute:d=>{i.value.setMute(d)},onSongChange:d=>{r(d),i.value.load(d)},setElement:r}),(d,_)=>(xe(),Be("div",lb))}}),ub={class:"player relative"},hb={class:"desktop mx-4"},fb={class:"controls"},db={class:"top relative"},pb={class:"bottom"},gb={class:"display"},mb={class:"text-xs text-muted text-right cursor-pointer"},yb={class:"text-xs text-muted text-left"},bb={class:"aux relative"},vb=dn({__name:"Player",setup(e){const t=Ps(),i=Nt(),n=Nt(),s=Nt(),r=h=>{const f=h.target.files[0];if(!f)return;const d=new FileReader;d.onload=_=>{s.value.src=_.target.result,s.value.load(),i.value.onSongChange(s.value),t.onSongChange(),a.value=!0},d.readAsDataURL(f)},o=()=>{n.value.click()},a=Nt(!1),l=Nt(!1),c=()=>{l.value=!l.value,i.value.setMute(l.value)},u=()=>{if(!a.value){o();return}t.player.playing?i.value.pause():i.value.play()};return(h,f)=>(xe(),Be(Yt,null,[mo(st("input",{type:"file",id:"file",ref_key:"upload",ref:n,accept:"audio/*",onChange:r},null,544),[[Oo,!1]]),st("div",ub,[st("div",hb,[st("div",fb,[mo(st("audio",{ref_key:"audio",ref:s,controls:""},null,512),[[Oo,!1]]),st("div",db,[st("span",{class:"cursor-pointer material-symbols-rounded ms-fill text-4xl",onClick:u},Ze(a.value?Qt(t).player.playing?"pause_circle":"play_circle":"file_upload"),1)]),st("div",pb,[st("div",gb,[st("span",mb,Ze(Qt(t).displayProgress),1),At(cb,{ref_key:"playable",ref:i},null,512),st("span",yb,Ze(Qt(t).displayDuration),1)])])]),st("div",bb,[st("span",{class:"icon cursor-pointer material-symbols-rounded ms-fill select-none",onClick:o}," file_upload "),st("span",{class:"icon cursor-pointer material-symbols-rounded ms-fill select-none",onClick:c},Ze(l.value?"volume_off":"volume_up"),1),At(sb,{modelValue:Qt(t).player.volume,"onUpdate:modelValue":f[0]||(f[0]=d=>Qt(t).player.volume=d),max:100,onChange:f[1]||(f[1]=d=>i.value.setVolume(d))},null,8,["modelValue"])])])])],64))}}),_b=pn(vb,[["__scopeId","data-v-921fb191"]]),xb=dn({__name:"App",setup(e){return Ps().initialise(),(i,n)=>(xe(),Be(Yt,null,[At(tb),st("main",null,[At(Uy)]),st("footer",null,[At(_b)])],64))}}),Zc=Pf(xb);Zc.use(Sf());Zc.mount("#app"); diff --git a/dist/assets/index-ssf_1ATp.css b/dist/assets/index-ssf_1ATp.css new file mode 100644 index 0000000..e3c7136 --- /dev/null +++ b/dist/assets/index-ssf_1ATp.css @@ -0,0 +1 @@ +:root{--fg-secondary: #18a74b;--fg-secondary-dk: #80dda0;--bg-contrast: #181c2f;--fg-contrast: white;--fg-base: #181c2f;--fg-base-dk: #8b8c91;--fg-base-dkr: #8b8c91;--bg-hover-ltr: #242424;--bg-hover-lt: #b3b3b31f;--bg-hover: #7c828f5e;--bg-hover-dk: #E3E7EB;--bg-gradient: linear-gradient(to left bottom, #18a74b, #80dda0);--bg-gradient-placeholder: linear-gradient(to left bottom, #00a53c, #00297f);--bg-base: white;--bg-base-lt: #f3f7fb;--bg-base-dk: #f3f7fb;--bg-input: var(--background);--bg-fixedPlaylistHeader: var(--bg-base-lt);--border-fixedPlaylistHeader: #D0D0D0;--border-base: #E3E7EB;--border-container: 1px solid var(--border-base);--ff-base: Poppins, sans-serif;--h-playlistEntry: 64px;--h-player: 88px;--h-player-mobile: 64px;--h-header: 64px;--supportsAmbient: true;--w-sidebar: 44px;--neutral: #374148;--success: #00c48b;--fail: #e85454;--warning: #c7aa19;--info: #189de4;--ff: Poppins, sans-serif}@media (prefers-color-scheme: dark){:root{--fg-secondary: #1ed760;--fg-secondary-dk: #217e41;--bg-contrast: white;--fg-contrast: #121212;--fg-base: white;--fg-base-dk: #a7a7a7;--fg-base-dkr: #999;--bg-hover-ltr: #242424;--bg-hover-lt: hsla(0, 0%, 100%, .04);--bg-hover: hsla(0, 0%, 100%, .3);--bg-hover-dk: hsla(0, 0%, 100%, .1);--bg-gradient: linear-gradient(to left bottom, #1ed760, #217e41);--bg-gradient-placeholder: linear-gradient(to left bottom, #00a53c, #00297f);--bg-base: #121212;--bg-base-lt: #181818;--bg-base-dk: black;--bg-input: var(--background-light);--bg-fixedPlaylistHeader: var(--bg-base-lt);--border-fixedPlaylistHeader: #303030;--border-base: hsla(0, 0%, 100%, .1);--border-container: 1px solid var(--border-base);--ff-base: Poppins, sans-serif;--h-playlistEntry: 64px;--h-player: 88px;--h-player-mobile: 64px;--h-header: 64px;--supportsAmbient: true;--w-sidebar: 44px}}:root{--w-scrollbar: 8px}::-webkit-scrollbar{width:var(--w-scrollbar);height:var(--w-scrollbar);padding:0;margin:0;z-index:101}::-webkit-scrollbar-track{border-radius:var(--w-scrollbar)}::-webkit-scrollbar-thumb{background:var(--bg-hover);border-radius:var(--w-scrollbar)}::-webkit-scrollbar-thumb:hover{background:var(--bg-hover-dk)}html,body{font-family:var(--ff);margin:0;color:var(--fg-base)}#app{display:grid;grid-template-rows:var(--h-header) 1fr var(--h-player);width:100vw;height:100vh;background:var(--bg-base);overflow:hidden}main{overflow:hidden auto}h1{margin-top:.5rem;margin-bottom:.5rem;font-size:1.875rem;line-height:2.25rem;font-weight:900}.relative{position:relative}.cursor-pointer{cursor:pointer}.text-xs{font-size:.75rem;line-height:1rem}.text-muted{color:var(--fg-base-dk)}.ms-fill{font-variation-settings:"FILL" 1}.text-4xl{font-size:2.25rem;line-height:2.5rem}.card[data-v-5d111e8c]{background:var(--bg-base-lt);border-radius:1em;border:var(--border-container);position:relative}.card[data-v-5d111e8c][data-v-5d111e8c]:before{content:"";border-radius:1em;box-shadow:0 0 10px #0000001a;position:absolute;top:0;right:0;bottom:0;left:0;z-index:-1}.card[data-v-5d111e8c].withHover[data-v-5d111e8c]:hover{background:var(--bg-hover-dk)}.card[data-v-5d111e8c].disabled[data-v-5d111e8c]{opacity:.5;cursor:not-allowed!important}.meters[data-v-2564d235]{display:flex;flex-direction:column;justify-content:center;gap:1em;padding:.5em;grid-column:1 / -1}.meters[data-v-2564d235] .stereo-field[data-v-2564d235]{max-width:400px;align-self:center;aspect-ratio:1}.meters[data-v-2564d235] .stereo-field[data-v-2564d235] canvas[data-v-2564d235]{width:100%;height:100%}.meters[data-v-2564d235] h4[data-v-2564d235]{margin-bottom:0}.meters[data-v-2564d235] .meter[data-v-2564d235]{display:grid;grid-template-columns:1ch 1fr;align-items:center;gap:1em}.meters[data-v-2564d235] .meter[data-v-2564d235] .label[data-v-2564d235]{font-size:.8em;color:var(--fg-base-dk)}.meters[data-v-2564d235] .meter[data-v-2564d235] meter[data-v-2564d235]{width:100%}.insights[data-v-2564d235]{display:grid;grid-template-columns:2fr 1fr;gap:1em;padding:1em}.insights[data-v-2564d235]>h1[data-v-2564d235]{grid-column:1 / -1}.insights[data-v-2564d235]>h1[data-v-2564d235] span[data-v-2564d235]{margin-right:.5em}.left[data-v-2564d235]{display:grid;grid-template-rows:1fr max-content;gap:1em}.left[data-v-2564d235] .loudness-chart[data-v-2564d235]{height:calc(2 * (100vh - var(--h-header) - 4px - var(--h-player) - 2.25rem - 5em) / 3)}.left[data-v-2564d235] .tonal-balance-chart[data-v-2564d235]{height:calc(1 * (100vh - var(--h-header) - 4px - var(--h-player) - 2.25rem - 5em) / 3)}.right[data-v-2564d235]{display:grid;grid-template-columns:repeat(3,1fr);gap:1em;align-content:start}.right[data-v-2564d235] .mode[data-v-2564d235]{padding:.5em;display:flex;flex-direction:column;align-items:center}.right[data-v-2564d235] .mode[data-v-2564d235] .label[data-v-2564d235]{font-size:.8em;color:var(--fg-base-dk);text-transform:uppercase}meter[data-v-2564d235]{--background: var(--bg-base);--optimum: var(--success);--sub-optimum: var(--warning);--sub-sub-optimum: var(--fail);display:block;width:100%}meter[data-v-2564d235]::-webkit-meter-bar{background:var(--background);border:2px solid var(--border-base)}meter[data-v-2564d235]:-moz-meter-optimum::-moz-meter-bar{background:var(--optimum)}meter[data-v-2564d235]::-webkit-meter-optimum-value{background:var(--optimum)}meter[data-v-2564d235]:-moz-meter-sub-optimum::-moz-meter-bar{background:var(--sub-optimum)}meter[data-v-2564d235]::-webkit-meter-suboptimum-value{background:var(--sub-optimum)}meter[data-v-2564d235]:-moz-meter-sub-sub-optimum::-moz-meter-bar{background:var(--sub-sub-optimum)}meter[data-v-2564d235]::-webkit-meter-even-less-good-value{background:var(--sub-sub-optimum)}header[data-v-46429bb4]{background:var(--bg-base-dk);height:calc(var(--h-header) - 20px);display:flex;flex-direction:row;justify-content:space-between;align-items:center;box-shadow:0 0 10px 0 var(--shadow);border-bottom:var(--border-container);padding:10px}header svg#logo[data-v-46429bb4]{fill:var(--fg-base);translate:5px 5px;height:100%}header a[data-v-46429bb4]:first-child{width:100%;height:100%}header svg#github[data-v-46429bb4]{width:20px;cursor:pointer}header svg path[data-v-46429bb4]{fill:var(--fg-base)}.progressBar__track[data-v-1a625635]{position:relative;width:100%;height:5px;margin:10px 0;border-radius:1000vmax;background-color:var(--fg-base-dkr)}.progressBar__progress[data-v-1a625635]{position:relative;height:5px;border-radius:1000vmax;background-color:var(--fg-base)}.progressBar__progress[data-v-1a625635].hover[data-v-1a625635]{background-color:var(--fg-secondary)}.progressBar__progress[data-v-1a625635].hover[data-v-1a625635][data-v-1a625635]:after{content:""}.progressBar__progress[data-v-1a625635][data-v-1a625635]:after{position:absolute;top:-5px;right:-5px;width:15px;height:15px;border-radius:50%;background-color:var(--fg-base)}#waveform{width:100%}#waveform wave,#waveform canvas{width:100%;height:calc(var(--h-player) / 2 - 1em)!important}.player .on-this-device>.material-symbols-rounded{color:var(--fg-secondary)}.player[data-v-921fb191]{background:var(--bg-base-lt);border-top:1px solid var(--border-base);z-index:2}.icon[data-v-921fb191]{color:var(--fg-base-dk)}.icon[data-v-921fb191][data-v-921fb191]:hover{color:var(--fg-base)}.desktop[data-v-921fb191]{display:grid;height:calc(var(--h-player) - 1px);grid-template-columns:1fr max-content;grid-template-areas:"controls aux";gap:10px;padding:0 1em}.desktop[data-v-921fb191] .song-info[data-v-921fb191]{grid-area:song-info;display:grid;align-items:center;grid-template-columns:calc(var(--h-player) - 40px) fit-content(100%) 20px 20px;gap:10px;overflow:hidden}.desktop[data-v-921fb191] .song-info[data-v-921fb191] .title-artist[data-v-921fb191]{overflow:hidden}.desktop[data-v-921fb191] .song-info[data-v-921fb191] div[data-v-921fb191]{margin:auto 0}.desktop[data-v-921fb191] .controls[data-v-921fb191]{grid-area:controls;display:grid;grid-template-columns:1fr;grid-template-rows:1fr auto}.desktop[data-v-921fb191] .controls[data-v-921fb191] .top[data-v-921fb191]{display:grid;grid-template-columns:40px;gap:1.5em;justify-content:center}.desktop[data-v-921fb191] .controls[data-v-921fb191] .top[data-v-921fb191] span[data-v-921fb191]{margin:auto 0;font-size:2.5rem}.desktop[data-v-921fb191] .controls[data-v-921fb191] .bottom .display[data-v-921fb191]{display:grid;grid-template-columns:4ch 10fr 4ch;margin-bottom:.5em;align-items:center}.desktop[data-v-921fb191] .aux[data-v-921fb191]{grid-area:aux;justify-content:end;display:grid;grid-template-columns:20px 20px minmax(auto,8vw);gap:1em;align-items:center}.desktop[data-v-921fb191] .aux[data-v-921fb191] a.icon[data-v-921fb191]{display:flex;text-decoration:none}.desktop[data-v-921fb191] .aux[data-v-921fb191] a.icon[data-v-921fb191].router-link-active[data-v-921fb191]{color:var(--fg-secondary)} diff --git a/dist/index.html b/dist/index.html index 0e0e708..87a6fa3 100644 --- a/dist/index.html +++ b/dist/index.html @@ -26,8 +26,8 @@ /> reAudioPlayer Insights - - + +
diff --git a/src/components/player/WaveAudio.vue b/src/components/player/WaveAudio.vue index 0389476..8629e3b 100644 --- a/src/components/player/WaveAudio.vue +++ b/src/components/player/WaveAudio.vue @@ -15,8 +15,14 @@ const audio = ref(null); const audioElement = ref(); onMounted(() => { - const waveColor = "white"; - const progressColor = "green"; + const fgBase = getComputedStyle(document.documentElement).getPropertyValue( + "--fg-base" + ); + const waveColor = fgBase; + const fgSecondary = getComputedStyle( + document.documentElement + ).getPropertyValue("--fg-secondary"); + const progressColor = fgSecondary; // @ts-ignore audio.value = WaveSurfer.create({ diff --git a/src/views/Insights.vue b/src/views/Insights.vue index fce1a0f..c2dc11c 100644 --- a/src/views/Insights.vue +++ b/src/views/Insights.vue @@ -472,11 +472,11 @@ const formatLoudness = (loudness: number) => { display: flex; flex-direction: column; align-items: center; - width: 100%; .label { font-size: 0.8em; color: var(--fg-base-dk); + text-transform: uppercase; } } }