granclaw 0.0.1-beta.6 → 0.0.1-beta.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -117,7 +117,7 @@ This cannot be undone.`)&&(await BS(I),j())}return n?d.jsx("div",{className:"fon
117
117
  * Released under the MIT License
118
118
  */class OD{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,n,r,i){const s=n.listeners[i],o=n.duration;s.forEach(a=>a({chart:t,initial:n.initial,numSteps:o,currentStep:Math.min(r-n.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=nb.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let n=0;this._charts.forEach((r,i)=>{if(!r.running||!r.items.length)return;const s=r.items;let o=s.length-1,a=!1,l;for(;o>=0;--o)l=s[o],l._active?(l._total>r.duration&&(r.duration=l._total),l.tick(t),a=!0):(s[o]=s[s.length-1],s.pop());a&&(i.draw(),this._notify(i,r,t,"progress")),s.length||(r.running=!1,this._notify(i,r,t,"complete"),r.initial=!1),n+=s.length}),this._lastDate=t,n===0&&(this._running=!1)}_getAnims(t){const n=this._charts;let r=n.get(t);return r||(r={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(t,r)),r}listen(t,n,r){this._getAnims(t).listeners[n].push(r)}add(t,n){!n||!n.length||this._getAnims(t).items.push(...n)}has(t){return this._getAnims(t).items.length>0}start(t){const n=this._charts.get(t);n&&(n.running=!0,n.start=Date.now(),n.duration=n.items.reduce((r,i)=>Math.max(r,i._duration),0),this._refresh())}running(t){if(!this._running)return!1;const n=this._charts.get(t);return!(!n||!n.running||!n.items.length)}stop(t){const n=this._charts.get(t);if(!n||!n.items.length)return;const r=n.items;let i=r.length-1;for(;i>=0;--i)r[i].cancel();n.items=[],this._notify(t,n,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var dn=new OD;const og="transparent",ID={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const r=Qm(e||og),i=r.valid&&Qm(t||og);return i&&i.valid?i.mix(r,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class zD{constructor(t,n,r,i){const s=n[r];i=ss([t.to,i,s,t.from]);const o=ss([t.from,s,i]);this._active=!0,this._fn=t.fn||ID[t.type||typeof o],this._easing=Cs[t.easing]||Cs.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=n,this._prop=r,this._from=o,this._to=i,this._promises=void 0}active(){return this._active}update(t,n,r){if(this._active){this._notify(!1);const i=this._target[this._prop],s=r-this._start,o=this._duration-s;this._start=r,this._duration=Math.floor(Math.max(o,t.duration)),this._total+=s,this._loop=!!t.loop,this._to=ss([t.to,n,i,t.from]),this._from=ss([t.from,i,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const n=t-this._start,r=this._duration,i=this._prop,s=this._from,o=this._loop,a=this._to;let l;if(this._active=s!==a&&(o||n<r),!this._active){this._target[i]=a,this._notify(!0);return}if(n<0){this._target[i]=s;return}l=n/r%2,l=o&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[i]=this._fn(s,a,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((n,r)=>{t.push({res:n,rej:r})})}_notify(t){const n=t?"res":"rej",r=this._promises||[];for(let i=0;i<r.length;i++)r[i][n]()}}class wb{constructor(t,n){this._chart=t,this._properties=new Map,this.configure(n)}configure(t){if(!se(t))return;const n=Object.keys(Ce.animation),r=this._properties;Object.getOwnPropertyNames(t).forEach(i=>{const s=t[i];if(!se(s))return;const o={};for(const a of n)o[a]=s[a];(_e(s.properties)&&s.properties||[i]).forEach(a=>{(a===i||!r.has(a))&&r.set(a,o)})})}_animateOptions(t,n){const r=n.options,i=BD(t,r);if(!i)return[];const s=this._createAnimations(i,r);return r.$shared&&FD(t.options.$animations,r).then(()=>{t.options=r},()=>{}),s}_createAnimations(t,n){const r=this._properties,i=[],s=t.$animations||(t.$animations={}),o=Object.keys(n),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"){i.push(...this._animateOptions(t,n));continue}const u=n[c];let f=s[c];const h=r.get(c);if(f)if(h&&f.active()){f.update(h,u,a);continue}else f.cancel();if(!h||!h.duration){t[c]=u;continue}s[c]=f=new zD(h,t,c,u),i.push(f)}return i}update(t,n){if(this._properties.size===0){Object.assign(t,n);return}const r=this._createAnimations(t,n);if(r.length)return dn.add(this._chart,r),!0}}function FD(e,t){const n=[],r=Object.keys(t);for(let i=0;i<r.length;i++){const s=e[r[i]];s&&s.active()&&n.push(s.wait())}return Promise.all(n)}function BD(e,t){if(!t)return;let n=e.options;if(!n){e.options=t;return}return n.$shared&&(e.options=n=Object.assign({},n,{$shared:!1,$animations:{}})),n}function ag(e,t){const n=e&&e.options||{},r=n.reverse,i=n.min===void 0?t:0,s=n.max===void 0?t:0;return{start:r?s:i,end:r?i:s}}function $D(e,t,n){if(n===!1)return!1;const r=ag(e,n),i=ag(t,n);return{top:i.end,right:r.end,bottom:i.start,left:r.start}}function VD(e){let t,n,r,i;return se(e)?(t=e.top,n=e.right,r=e.bottom,i=e.left):t=n=r=i=e,{top:t,right:n,bottom:r,left:i,disabled:e===!1}}function kb(e,t){const n=[],r=e._getSortedDatasetMetas(t);let i,s;for(i=0,s=r.length;i<s;++i)n.push(r[i].index);return n}function lg(e,t,n,r={}){const i=e.keys,s=r.mode==="single";let o,a,l,c;if(t===null)return;let u=!1;for(o=0,a=i.length;o<a;++o){if(l=+i[o],l===n){if(u=!0,r.all)continue;break}c=e.values[l],Me(c)&&(s||t===0||on(t)===on(c))&&(t+=c)}return!u&&!r.all?0:t}function WD(e,t){const{iScale:n,vScale:r}=t,i=n.axis==="x"?"x":"y",s=r.axis==="x"?"x":"y",o=Object.keys(e),a=new Array(o.length);let l,c,u;for(l=0,c=o.length;l<c;++l)u=o[l],a[l]={[i]:u,[s]:e[u]};return a}function Tc(e,t){const n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function UD(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}function HD(e){const{min:t,max:n,minDefined:r,maxDefined:i}=e.getUserBounds();return{min:r?t:Number.NEGATIVE_INFINITY,max:i?n:Number.POSITIVE_INFINITY}}function YD(e,t,n){const r=e[t]||(e[t]={});return r[n]||(r[n]={})}function cg(e,t,n,r){for(const i of t.getMatchingVisibleMetas(r).reverse()){const s=e[i.index];if(n&&s>0||!n&&s<0)return i.index}return null}function ug(e,t){const{chart:n,_cachedMeta:r}=e,i=n._stacks||(n._stacks={}),{iScale:s,vScale:o,index:a}=r,l=s.axis,c=o.axis,u=UD(s,o,r),f=t.length;let h;for(let p=0;p<f;++p){const m=t[p],{[l]:g,[c]:v}=m,x=m._stacks||(m._stacks={});h=x[c]=YD(i,u,g),h[a]=v,h._top=cg(h,o,!0,r.type),h._bottom=cg(h,o,!1,r.type);const y=h._visualValues||(h._visualValues={});y[a]=v}}function Dc(e,t){const n=e.scales;return Object.keys(n).filter(r=>n[r].axis===t).shift()}function KD(e,t){return cr(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function XD(e,t,n){return cr(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function Gi(e,t){const n=e.controller.index,r=e.vScale&&e.vScale.axis;if(r){t=t||e._parsed;for(const i of t){const s=i._stacks;if(!s||s[r]===void 0||s[r][n]===void 0)return;delete s[r][n],s[r]._visualValues!==void 0&&s[r]._visualValues[n]!==void 0&&delete s[r]._visualValues[n]}}}const Ac=e=>e==="reset"||e==="none",fg=(e,t)=>t?e:Object.assign({},e),GD=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:kb(n,!0),values:null};class Ht{constructor(t,n){this.chart=t,this._ctx=t.ctx,this.index=n,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=Tc(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&&Gi(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,r=this.getDataset(),i=(f,h,p,m)=>f==="x"?h:f==="r"?m:p,s=n.xAxisID=Z(r.xAxisID,Dc(t,"x")),o=n.yAxisID=Z(r.yAxisID,Dc(t,"y")),a=n.rAxisID=Z(r.rAxisID,Dc(t,"r")),l=n.indexAxis,c=n.iAxisID=i(l,s,o,a),u=n.vAxisID=i(l,o,s,a);n.xScale=this.getScaleForId(s),n.yScale=this.getScaleForId(o),n.rScale=this.getScaleForId(a),n.iScale=this.getScaleForId(c),n.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 n=this._cachedMeta;return t===n.iScale?n.vScale:n.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&Km(this._data,this),t._stacked&&Gi(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),r=this._data;if(se(n)){const i=this._cachedMeta;this._data=WD(n,i)}else if(r!==n){if(r){Km(r,this);const i=this._cachedMeta;Gi(i),i._parsed=[]}n&&Object.isExtensible(n)&&AT(n,this),this._syncList=[],this._data=n}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const n=this._cachedMeta,r=this.getDataset();let i=!1;this._dataCheck();const s=n._stacked;n._stacked=Tc(n.vScale,n),n.stack!==r.stack&&(i=!0,Gi(n),n.stack=r.stack),this._resyncElements(t),(i||s!==n._stacked)&&(ug(this,n._parsed),n._stacked=Tc(n.vScale,n))}configure(){const t=this.chart.config,n=t.datasetScopeKeys(this._type),r=t.getOptionScopes(this.getDataset(),n,!0);this.options=t.createResolver(r,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,n){const{_cachedMeta:r,_data:i}=this,{iScale:s,_stacked:o}=r,a=s.axis;let l=t===0&&n===i.length?!0:r._sorted,c=t>0&&r._parsed[t-1],u,f,h;if(this._parsing===!1)r._parsed=i,r._sorted=!0,h=i;else{_e(i[t])?h=this.parseArrayData(r,i,t,n):se(i[t])?h=this.parseObjectData(r,i,t,n):h=this.parsePrimitiveData(r,i,t,n);const p=()=>f[a]===null||c&&f[a]<c[a];for(u=0;u<n;++u)r._parsed[u+t]=f=h[u],l&&(p()&&(l=!1),c=f);r._sorted=l}o&&ug(this,h)}parsePrimitiveData(t,n,r,i){const{iScale:s,vScale:o}=t,a=s.axis,l=o.axis,c=s.getLabels(),u=s===o,f=new Array(i);let h,p,m;for(h=0,p=i;h<p;++h)m=h+r,f[h]={[a]:u||s.parse(c[m],m),[l]:o.parse(n[m],m)};return f}parseArrayData(t,n,r,i){const{xScale:s,yScale:o}=t,a=new Array(i);let l,c,u,f;for(l=0,c=i;l<c;++l)u=l+r,f=n[u],a[l]={x:s.parse(f[0],u),y:o.parse(f[1],u)};return a}parseObjectData(t,n,r,i){const{xScale:s,yScale:o}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=new Array(i);let u,f,h,p;for(u=0,f=i;u<f;++u)h=u+r,p=n[h],c[u]={x:s.parse(nr(p,a),h),y:o.parse(nr(p,l),h)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,n,r){const i=this.chart,s=this._cachedMeta,o=n[t.axis],a={keys:kb(i,!0),values:n._stacks[t.axis]._visualValues};return lg(a,o,s.index,{mode:r})}updateRangeFromParsed(t,n,r,i){const s=r[n.axis];let o=s===null?NaN:s;const a=i&&r._stacks[n.axis];i&&a&&(i.values=a,o=lg(i,s,this._cachedMeta.index)),t.min=Math.min(t.min,o),t.max=Math.max(t.max,o)}getMinMax(t,n){const r=this._cachedMeta,i=r._parsed,s=r._sorted&&t===r.iScale,o=i.length,a=this._getOtherScale(t),l=GD(n,r,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:f}=HD(a);let h,p;function m(){p=i[h];const g=p[a.axis];return!Me(p[t.axis])||u>g||f<g}for(h=0;h<o&&!(!m()&&(this.updateRangeFromParsed(c,t,p,l),s));++h);if(s){for(h=o-1;h>=0;--h)if(!m()){this.updateRangeFromParsed(c,t,p,l);break}}return c}getAllParsedValues(t){const n=this._cachedMeta._parsed,r=[];let i,s,o;for(i=0,s=n.length;i<s;++i)o=n[i][t.axis],Me(o)&&r.push(o);return r}getMaxOverflow(){return!1}getLabelAndValue(t){const n=this._cachedMeta,r=n.iScale,i=n.vScale,s=this.getParsed(t);return{label:r?""+r.getLabelForValue(s[r.axis]):"",value:i?""+i.getLabelForValue(s[i.axis]):""}}_update(t){const n=this._cachedMeta;this.update(t||"default"),n._clip=VD(Z(this.options.clip,$D(n.xScale,n.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,n=this.chart,r=this._cachedMeta,i=r.data||[],s=n.chartArea,o=[],a=this._drawStart||0,l=this._drawCount||i.length-a,c=this.options.drawActiveElementsOnTop;let u;for(r.dataset&&r.dataset.draw(t,s,a,l),u=a;u<a+l;++u){const f=i[u];f.hidden||(f.active&&c?o.push(f):f.draw(t,s))}for(u=0;u<o.length;++u)o[u].draw(t,s)}getStyle(t,n){const r=n?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(r):this.resolveDataElementOptions(t||0,r)}getContext(t,n,r){const i=this.getDataset();let s;if(t>=0&&t<this._cachedMeta.data.length){const o=this._cachedMeta.data[t];s=o.$context||(o.$context=XD(this.getContext(),t,o)),s.parsed=this.getParsed(t),s.raw=i.data[t],s.index=s.dataIndex=t}else s=this.$context||(this.$context=KD(this.chart.getContext(),this.index)),s.dataset=i,s.index=s.datasetIndex=this.index;return s.active=!!n,s.mode=r,s}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,n){return this._resolveElementOptions(this.dataElementType.id,n,t)}_resolveElementOptions(t,n="default",r){const i=n==="active",s=this._cachedDataOpts,o=t+"-"+n,a=s[o],l=this.enableOptionSharing&&Zs(r);if(a)return fg(a,l);const c=this.chart.config,u=c.datasetElementScopeKeys(this._type,t),f=i?[`${t}Hover`,"hover",t,""]:[t,""],h=c.getOptionScopes(this.getDataset(),u),p=Object.keys(Ce.elements[t]),m=()=>this.getContext(r,i,n),g=c.resolveNamedOptions(h,p,m,f);return g.$shared&&(g.$shared=l,s[o]=Object.freeze(fg(g,l))),g}_resolveAnimations(t,n,r){const i=this.chart,s=this._cachedDataOpts,o=`animation-${n}`,a=s[o];if(a)return a;let l;if(i.options.animation!==!1){const u=this.chart.config,f=u.datasetAnimationScopeKeys(this._type,n),h=u.getOptionScopes(this.getDataset(),f);l=u.createResolver(h,this.getContext(t,r,n))}const c=new wb(i,l&&l.animations);return l&&l._cacheable&&(s[o]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,n){return!n||Ac(t)||this.chart._animationsDisabled}_getSharedOptions(t,n){const r=this.resolveDataElementOptions(t,n),i=this._sharedOptions,s=this.getSharedOptions(r),o=this.includeOptions(n,s)||s!==i;return this.updateSharedOptions(s,n,r),{sharedOptions:s,includeOptions:o}}updateElement(t,n,r,i){Ac(i)?Object.assign(t,r):this._resolveAnimations(n,i).update(t,r)}updateSharedOptions(t,n,r){t&&!Ac(n)&&this._resolveAnimations(void 0,n).update(t,r)}_setStyle(t,n,r,i){t.active=i;const s=this.getStyle(n,i);this._resolveAnimations(n,r,i).update(t,{options:!i&&this.getSharedOptions(s)||s})}removeHoverStyle(t,n,r){this._setStyle(t,r,"active",!1)}setHoverStyle(t,n,r){this._setStyle(t,r,"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 n=this._data,r=this._cachedMeta.data;for(const[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];const i=r.length,s=n.length,o=Math.min(s,i);o&&this.parse(0,o),s>i?this._insertElements(i,s-i,t):s<i&&this._removeElements(s,i-s)}_insertElements(t,n,r=!0){const i=this._cachedMeta,s=i.data,o=t+n;let a;const l=c=>{for(c.length+=n,a=c.length-1;a>=o;a--)c[a]=c[a-n]};for(l(s),a=t;a<o;++a)s[a]=new this.dataElementType;this._parsing&&l(i._parsed),this.parse(t,n),r&&this.updateElements(s,t,n,"reset")}updateElements(t,n,r,i){}_removeElements(t,n){const r=this._cachedMeta;if(this._parsing){const i=r._parsed.splice(t,n);r._stacked&&Gi(r,i)}r.data.splice(t,n)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[n,r,i]=t;this[n](r,i)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,n){n&&this._sync(["_removeElements",t,n]);const r=arguments.length-2;r&&this._sync(["_insertElements",t,r])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}B(Ht,"defaults",{}),B(Ht,"datasetElementType",null),B(Ht,"dataElementType",null);function QD(e,t){if(!e._cache.$bar){const n=e.getMatchingVisibleMetas(t);let r=[];for(let i=0,s=n.length;i<s;i++)r=r.concat(n[i].controller.getAllParsedValues(e));e._cache.$bar=tb(r.sort((i,s)=>i-s))}return e._cache.$bar}function qD(e){const t=e.iScale,n=QD(t,e.type);let r=t._length,i,s,o,a;const l=()=>{o===32767||o===-32768||(Zs(a)&&(r=Math.min(r,Math.abs(o-a)||r)),a=o)};for(i=0,s=n.length;i<s;++i)o=t.getPixelForValue(n[i]),l();for(a=void 0,i=0,s=t.ticks.length;i<s;++i)o=t.getPixelForTick(i),l();return r}function JD(e,t,n,r){const i=n.barThickness;let s,o;return re(i)?(s=t.min*n.categoryPercentage,o=n.barPercentage):(s=i*r,o=1),{chunk:s/r,ratio:o,start:t.pixels[e]-s/2}}function ZD(e,t,n,r){const i=t.pixels,s=i[e];let o=e>0?i[e-1]:null,a=e<i.length-1?i[e+1]:null;const l=n.categoryPercentage;o===null&&(o=s-(a===null?t.end-t.start:a-s)),a===null&&(a=s+s-o);const c=s-(s-Math.min(o,a))/2*l;return{chunk:Math.abs(a-o)/2*l/r,ratio:n.barPercentage,start:c}}function eA(e,t,n,r){const i=n.parse(e[0],r),s=n.parse(e[1],r),o=Math.min(i,s),a=Math.max(i,s);let l=o,c=a;Math.abs(o)>Math.abs(a)&&(l=a,c=o),t[n.axis]=c,t._custom={barStart:l,barEnd:c,start:i,end:s,min:o,max:a}}function Sb(e,t,n,r){return _e(e)?eA(e,t,n,r):t[n.axis]=n.parse(e,r),t}function dg(e,t,n,r){const i=e.iScale,s=e.vScale,o=i.getLabels(),a=i===s,l=[];let c,u,f,h;for(c=n,u=n+r;c<u;++c)h=t[c],f={},f[i.axis]=a||i.parse(o[c],c),l.push(Sb(h,f,s,c));return l}function Lc(e){return e&&e.barStart!==void 0&&e.barEnd!==void 0}function tA(e,t,n){return e!==0?on(e):(t.isHorizontal()?1:-1)*(t.min>=n?1:-1)}function nA(e){let t,n,r,i,s;return e.horizontal?(t=e.base>e.x,n="left",r="right"):(t=e.base<e.y,n="bottom",r="top"),t?(i="end",s="start"):(i="start",s="end"),{start:n,end:r,reverse:t,top:i,bottom:s}}function rA(e,t,n,r){let i=t.borderSkipped;const s={};if(!i){e.borderSkipped=s;return}if(i===!0){e.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:o,end:a,reverse:l,top:c,bottom:u}=nA(e);i==="middle"&&n&&(e.enableBorderRadius=!0,(n._top||0)===r?i=c:(n._bottom||0)===r?i=u:(s[hg(u,o,a,l)]=!0,i=c)),s[hg(i,o,a,l)]=!0,e.borderSkipped=s}function hg(e,t,n,r){return r?(e=iA(e,t,n),e=pg(e,n,t)):e=pg(e,t,n),e}function iA(e,t,n){return e===t?n:e===n?t:e}function pg(e,t,n){return e==="start"?t:e==="end"?n:e}function sA(e,{inflateAmount:t},n){e.inflateAmount=t==="auto"?n===1?.33:0:t}class fa extends Ht{parsePrimitiveData(t,n,r,i){return dg(t,n,r,i)}parseArrayData(t,n,r,i){return dg(t,n,r,i)}parseObjectData(t,n,r,i){const{iScale:s,vScale:o}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=s.axis==="x"?a:l,u=o.axis==="x"?a:l,f=[];let h,p,m,g;for(h=r,p=r+i;h<p;++h)g=n[h],m={},m[s.axis]=s.parse(nr(g,c),h),f.push(Sb(nr(g,u),m,o,h));return f}updateRangeFromParsed(t,n,r,i){super.updateRangeFromParsed(t,n,r,i);const s=r._custom;s&&n===this._cachedMeta.vScale&&(t.min=Math.min(t.min,s.min),t.max=Math.max(t.max,s.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const n=this._cachedMeta,{iScale:r,vScale:i}=n,s=this.getParsed(t),o=s._custom,a=Lc(o)?"["+o.start+", "+o.end+"]":""+i.getLabelForValue(s[i.axis]);return{label:""+r.getLabelForValue(s[r.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const n=this._cachedMeta;this.updateElements(n.data,0,n.data.length,t)}updateElements(t,n,r,i){const s=i==="reset",{index:o,_cachedMeta:{vScale:a}}=this,l=a.getBasePixel(),c=a.isHorizontal(),u=this._getRuler(),{sharedOptions:f,includeOptions:h}=this._getSharedOptions(n,i);for(let p=n;p<n+r;p++){const m=this.getParsed(p),g=s||re(m[a.axis])?{base:l,head:l}:this._calculateBarValuePixels(p),v=this._calculateBarIndexPixels(p,u),x=(m._stacks||{})[a.axis],y={horizontal:c,base:g.base,enableBorderRadius:!x||Lc(m._custom)||o===x._top||o===x._bottom,x:c?g.head:v.center,y:c?v.center:g.head,height:c?v.size:Math.abs(g.size),width:c?Math.abs(g.size):v.size};h&&(y.options=f||this.resolveDataElementOptions(p,t[p].active?"active":i));const b=y.options||t[p].options;rA(y,b,x,o),sA(y,b,u.ratio),this.updateElement(t[p],p,y,i)}}_getStacks(t,n){const{iScale:r}=this._cachedMeta,i=r.getMatchingVisibleMetas(this._type).filter(u=>u.controller.options.grouped),s=r.options.stacked,o=[],a=this._cachedMeta.controller.getParsed(n),l=a&&a[r.axis],c=u=>{const f=u._parsed.find(p=>p[r.axis]===l),h=f&&f[u.vScale.axis];if(re(h)||isNaN(h))return!0};for(const u of i)if(!(n!==void 0&&c(u))&&((s===!1||o.indexOf(u.stack)===-1||s===void 0&&u.stack===void 0)&&o.push(u.stack),u.index===t))break;return o.length||o.push(void 0),o}_getStackCount(t){return this._getStacks(void 0,t).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const t=this.chart.scales,n=this.chart.options.indexAxis;return Object.keys(t).filter(r=>t[r].axis===n).shift()}_getAxis(){const t={},n=this.getFirstScaleIdForIndexAxis();for(const r of this.chart.data.datasets)t[Z(this.chart.options.indexAxis==="x"?r.xAxisID:r.yAxisID,n)]=!0;return Object.keys(t)}_getStackIndex(t,n,r){const i=this._getStacks(t,r),s=n!==void 0?i.indexOf(n):-1;return s===-1?i.length-1:s}_getRuler(){const t=this.options,n=this._cachedMeta,r=n.iScale,i=[];let s,o;for(s=0,o=n.data.length;s<o;++s)i.push(r.getPixelForValue(this.getParsed(s)[r.axis],s));const a=t.barThickness;return{min:a||qD(n),pixels:i,start:r._startPixel,end:r._endPixel,stackCount:this._getStackCount(),scale:r,grouped:t.grouped,ratio:a?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:n,_stacked:r,index:i},options:{base:s,minBarLength:o}}=this,a=s||0,l=this.getParsed(t),c=l._custom,u=Lc(c);let f=l[n.axis],h=0,p=r?this.applyStack(n,l,r):f,m,g;p!==f&&(h=p-f,p=f),u&&(f=c.barStart,p=c.barEnd-c.barStart,f!==0&&on(f)!==on(c.barEnd)&&(h=0),h+=f);const v=!re(s)&&!u?s:h;let x=n.getPixelForValue(v);if(this.chart.getDataVisibility(t)?m=n.getPixelForValue(h+p):m=x,g=m-x,Math.abs(g)<o){g=tA(g,n,a)*o,f===a&&(x-=g/2);const y=n.getPixelForDecimal(0),b=n.getPixelForDecimal(1),k=Math.min(y,b),S=Math.max(y,b);x=Math.max(Math.min(x,S),k),m=x+g,r&&!u&&(l._stacks[n.axis]._visualValues[i]=n.getValueForPixel(m)-n.getValueForPixel(x))}if(x===n.getPixelForValue(a)){const y=on(g)*n.getLineWidthForValue(a)/2;x+=y,g-=y}return{size:g,base:x,head:m,center:m+g/2}}_calculateBarIndexPixels(t,n){const r=n.scale,i=this.options,s=i.skipNull,o=Z(i.maxBarThickness,1/0);let a,l;const c=this._getAxisCount();if(n.grouped){const u=s?this._getStackCount(t):n.stackCount,f=i.barThickness==="flex"?ZD(t,n,i,u*c):JD(t,n,i,u*c),h=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,p=this._getAxis().indexOf(Z(h,this.getFirstScaleIdForIndexAxis())),m=this._getStackIndex(this.index,this._cachedMeta.stack,s?t:void 0)+p;a=f.start+f.chunk*m+f.chunk/2,l=Math.min(o,f.chunk*f.ratio)}else a=r.getPixelForValue(this.getParsed(t)[r.axis],t),l=Math.min(o,n.min*n.ratio);return{base:a-l/2,head:a+l/2,center:a,size:l}}draw(){const t=this._cachedMeta,n=t.vScale,r=t.data,i=r.length;let s=0;for(;s<i;++s)this.getParsed(s)[n.axis]!==null&&!r[s].hidden&&r[s].draw(this._ctx)}}B(fa,"id","bar"),B(fa,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),B(fa,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class da extends Ht{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,n,r,i){const s=super.parsePrimitiveData(t,n,r,i);for(let o=0;o<s.length;o++)s[o]._custom=this.resolveDataElementOptions(o+r).radius;return s}parseArrayData(t,n,r,i){const s=super.parseArrayData(t,n,r,i);for(let o=0;o<s.length;o++){const a=n[r+o];s[o]._custom=Z(a[2],this.resolveDataElementOptions(o+r).radius)}return s}parseObjectData(t,n,r,i){const s=super.parseObjectData(t,n,r,i);for(let o=0;o<s.length;o++){const a=n[r+o];s[o]._custom=Z(a&&a.r&&+a.r,this.resolveDataElementOptions(o+r).radius)}return s}getMaxOverflow(){const t=this._cachedMeta.data;let n=0;for(let r=t.length-1;r>=0;--r)n=Math.max(n,t[r].size(this.resolveDataElementOptions(r))/2);return n>0&&n}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart.data.labels||[],{xScale:i,yScale:s}=n,o=this.getParsed(t),a=i.getLabelForValue(o.x),l=s.getLabelForValue(o.y),c=o._custom;return{label:r[t]||"",value:"("+a+", "+l+(c?", "+c:"")+")"}}update(t){const n=this._cachedMeta.data;this.updateElements(n,0,n.length,t)}updateElements(t,n,r,i){const s=i==="reset",{iScale:o,vScale:a}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(n,i),u=o.axis,f=a.axis;for(let h=n;h<n+r;h++){const p=t[h],m=!s&&this.getParsed(h),g={},v=g[u]=s?o.getPixelForDecimal(.5):o.getPixelForValue(m[u]),x=g[f]=s?a.getBasePixel():a.getPixelForValue(m[f]);g.skip=isNaN(v)||isNaN(x),c&&(g.options=l||this.resolveDataElementOptions(h,p.active?"active":i),s&&(g.options.radius=0)),this.updateElement(p,h,g,i)}}resolveDataElementOptions(t,n){const r=this.getParsed(t);let i=super.resolveDataElementOptions(t,n);i.$shared&&(i=Object.assign({},i,{$shared:!1}));const s=i.radius;return n!=="active"&&(i.radius=0),i.radius+=Z(r&&r._custom,s),i}}B(da,"id","bubble"),B(da,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),B(da,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function oA(e,t,n){let r=1,i=1,s=0,o=0;if(t<ke){const a=e,l=a+t,c=Math.cos(a),u=Math.sin(a),f=Math.cos(l),h=Math.sin(l),p=(b,k,S)=>eo(b,a,l,!0)?1:Math.max(k,k*n,S,S*n),m=(b,k,S)=>eo(b,a,l,!0)?-1:Math.min(k,k*n,S,S*n),g=p(0,c,f),v=p(De,u,h),x=m(ue,c,f),y=m(ue+De,u,h);r=(g-x)/2,i=(v-y)/2,s=-(g+x)/2,o=-(v+y)/2}return{ratioX:r,ratioY:i,offsetX:s,offsetY:o}}class Cr extends Ht{constructor(t,n){super(t,n),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,n){const r=this.getDataset().data,i=this._cachedMeta;if(this._parsing===!1)i._parsed=r;else{let s=l=>+r[l];if(se(r[t])){const{key:l="value"}=this._parsing;s=c=>+nr(r[c],l)}let o,a;for(o=t,a=t+n;o<a;++o)i._parsed[o]=s(o)}}_getRotation(){return $t(this.options.rotation-90)}_getCircumference(){return $t(this.options.circumference)}_getRotationExtents(){let t=ke,n=-ke;for(let r=0;r<this.chart.data.datasets.length;++r)if(this.chart.isDatasetVisible(r)&&this.chart.getDatasetMeta(r).type===this._type){const i=this.chart.getDatasetMeta(r).controller,s=i._getRotation(),o=i._getCircumference();t=Math.min(t,s),n=Math.max(n,s+o)}return{rotation:t,circumference:n-t}}update(t){const n=this.chart,{chartArea:r}=n,i=this._cachedMeta,s=i.data,o=this.getMaxBorderWidth()+this.getMaxOffset(s)+this.options.spacing,a=Math.max((Math.min(r.width,r.height)-o)/2,0),l=Math.min(yT(this.options.cutout,a),1),c=this._getRingWeight(this.index),{circumference:u,rotation:f}=this._getRotationExtents(),{ratioX:h,ratioY:p,offsetX:m,offsetY:g}=oA(f,u,l),v=(r.width-o)/h,x=(r.height-o)/p,y=Math.max(Math.min(v,x)/2,0),b=Qv(this.options.radius,y),k=Math.max(b*l,0),S=(b-k)/this._getVisibleDatasetWeightTotal();this.offsetX=m*b,this.offsetY=g*b,i.total=this.calculateTotal(),this.outerRadius=b-S*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-S*c,0),this.updateElements(s,0,s.length,t)}_circumference(t,n){const r=this.options,i=this._cachedMeta,s=this._getCircumference();return n&&r.animation.animateRotate||!this.chart.getDataVisibility(t)||i._parsed[t]===null||i.data[t].hidden?0:this.calculateCircumference(i._parsed[t]*s/ke)}updateElements(t,n,r,i){const s=i==="reset",o=this.chart,a=o.chartArea,c=o.options.animation,u=(a.left+a.right)/2,f=(a.top+a.bottom)/2,h=s&&c.animateScale,p=h?0:this.innerRadius,m=h?0:this.outerRadius,{sharedOptions:g,includeOptions:v}=this._getSharedOptions(n,i);let x=this._getRotation(),y;for(y=0;y<n;++y)x+=this._circumference(y,s);for(y=n;y<n+r;++y){const b=this._circumference(y,s),k=t[y],S={x:u+this.offsetX,y:f+this.offsetY,startAngle:x,endAngle:x+b,circumference:b,outerRadius:m,innerRadius:p};v&&(S.options=g||this.resolveDataElementOptions(y,k.active?"active":i)),x+=b,this.updateElement(k,y,S,i)}}calculateTotal(){const t=this._cachedMeta,n=t.data;let r=0,i;for(i=0;i<n.length;i++){const s=t._parsed[i];s!==null&&!isNaN(s)&&this.chart.getDataVisibility(i)&&!n[i].hidden&&(r+=Math.abs(s))}return r}calculateCircumference(t){const n=this._cachedMeta.total;return n>0&&!isNaN(t)?ke*(Math.abs(t)/n):0}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart,i=r.data.labels||[],s=mo(n._parsed[t],r.options.locale);return{label:i[t]||"",value:s}}getMaxBorderWidth(t){let n=0;const r=this.chart;let i,s,o,a,l;if(!t){for(i=0,s=r.data.datasets.length;i<s;++i)if(r.isDatasetVisible(i)){o=r.getDatasetMeta(i),t=o.data,a=o.controller;break}}if(!t)return 0;for(i=0,s=t.length;i<s;++i)l=a.resolveDataElementOptions(i),l.borderAlign!=="inner"&&(n=Math.max(n,l.borderWidth||0,l.hoverBorderWidth||0));return n}getMaxOffset(t){let n=0;for(let r=0,i=t.length;r<i;++r){const s=this.resolveDataElementOptions(r);n=Math.max(n,s.offset||0,s.hoverOffset||0)}return n}_getRingWeightOffset(t){let n=0;for(let r=0;r<t;++r)this.chart.isDatasetVisible(r)&&(n+=this._getRingWeight(r));return n}_getRingWeight(t){return Math.max(Z(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}B(Cr,"id","doughnut"),B(Cr,"defaults",{datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"}),B(Cr,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),B(Cr,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data,{labels:{pointStyle:r,textAlign:i,color:s,useBorderRadius:o,borderRadius:a}}=t.legend.options;return n.labels.length&&n.datasets.length?n.labels.map((l,c)=>{const f=t.getDatasetMeta(0).controller.getStyle(c);return{text:l,fillStyle:f.backgroundColor,fontColor:s,hidden:!t.getDataVisibility(c),lineDash:f.borderDash,lineDashOffset:f.borderDashOffset,lineJoin:f.borderJoinStyle,lineWidth:f.borderWidth,strokeStyle:f.borderColor,textAlign:i,pointStyle:r,borderRadius:o&&(a||f.borderRadius),index:c}}):[]}},onClick(t,n,r){r.chart.toggleDataVisibility(n.index),r.chart.update()}}}});class ha extends Ht{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const n=this._cachedMeta,{dataset:r,data:i=[],_dataset:s}=n,o=this.chart._animationsDisabled;let{start:a,count:l}=ib(n,i,o);this._drawStart=a,this._drawCount=l,sb(n)&&(a=0,l=i.length),r._chart=this.chart,r._datasetIndex=this.index,r._decimated=!!s._decimated,r.points=i;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(r,void 0,{animated:!o,options:c},t),this.updateElements(i,a,l,t)}updateElements(t,n,r,i){const s=i==="reset",{iScale:o,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:u,includeOptions:f}=this._getSharedOptions(n,i),h=o.axis,p=a.axis,{spanGaps:m,segment:g}=this.options,v=Ci(m)?m:Number.POSITIVE_INFINITY,x=this.chart._animationsDisabled||s||i==="none",y=n+r,b=t.length;let k=n>0&&this.getParsed(n-1);for(let S=0;S<b;++S){const w=t[S],E=x?w:{};if(S<n||S>=y){E.skip=!0;continue}const P=this.getParsed(S),M=re(P[p]),j=E[h]=o.getPixelForValue(P[h],S),D=E[p]=s||M?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,P,l):P[p],S);E.skip=isNaN(j)||isNaN(D)||M,E.stop=S>0&&Math.abs(P[h]-k[h])>v,g&&(E.parsed=P,E.raw=c.data[S]),f&&(E.options=u||this.resolveDataElementOptions(S,w.active?"active":i)),x||this.updateElement(w,S,E,i),k=P}}getMaxOverflow(){const t=this._cachedMeta,n=t.dataset,r=n.options&&n.options.borderWidth||0,i=t.data||[];if(!i.length)return r;const s=i[0].size(this.resolveDataElementOptions(0)),o=i[i.length-1].size(this.resolveDataElementOptions(i.length-1));return Math.max(r,s,o)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}B(ha,"id","line"),B(ha,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),B(ha,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class js extends Ht{constructor(t,n){super(t,n),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart,i=r.data.labels||[],s=mo(n._parsed[t].r,r.options.locale);return{label:i[t]||"",value:s}}parseObjectData(t,n,r,i){return hb.bind(this)(t,n,r,i)}update(t){const n=this._cachedMeta.data;this._updateRadius(),this.updateElements(n,0,n.length,t)}getMinMax(){const t=this._cachedMeta,n={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((r,i)=>{const s=this.getParsed(i).r;!isNaN(s)&&this.chart.getDataVisibility(i)&&(s<n.min&&(n.min=s),s>n.max&&(n.max=s))}),n}_updateRadius(){const t=this.chart,n=t.chartArea,r=t.options,i=Math.min(n.right-n.left,n.bottom-n.top),s=Math.max(i/2,0),o=Math.max(r.cutoutPercentage?s/100*r.cutoutPercentage:1,0),a=(s-o)/t.getVisibleDatasetCount();this.outerRadius=s-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(t,n,r,i){const s=i==="reset",o=this.chart,l=o.options.animation,c=this._cachedMeta.rScale,u=c.xCenter,f=c.yCenter,h=c.getIndexAngle(0)-.5*ue;let p=h,m;const g=360/this.countVisibleElements();for(m=0;m<n;++m)p+=this._computeAngle(m,i,g);for(m=n;m<n+r;m++){const v=t[m];let x=p,y=p+this._computeAngle(m,i,g),b=o.getDataVisibility(m)?c.getDistanceFromCenterForValue(this.getParsed(m).r):0;p=y,s&&(l.animateScale&&(b=0),l.animateRotate&&(x=y=h));const k={x:u,y:f,innerRadius:0,outerRadius:b,startAngle:x,endAngle:y,options:this.resolveDataElementOptions(m,v.active?"active":i)};this.updateElement(v,m,k,i)}}countVisibleElements(){const t=this._cachedMeta;let n=0;return t.data.forEach((r,i)=>{!isNaN(this.getParsed(i).r)&&this.chart.getDataVisibility(i)&&n++}),n}_computeAngle(t,n,r){return this.chart.getDataVisibility(t)?$t(this.resolveDataElementOptions(t,n).angle||r):0}}B(js,"id","polarArea"),B(js,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),B(js,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:r,color:i}}=t.legend.options;return n.labels.map((s,o)=>{const l=t.getDatasetMeta(0).controller.getStyle(o);return{text:s,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:i,lineWidth:l.borderWidth,pointStyle:r,hidden:!t.getDataVisibility(o),index:o}})}return[]}},onClick(t,n,r){r.chart.toggleDataVisibility(n.index),r.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class af extends Cr{}B(af,"id","pie"),B(af,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class pa extends Ht{getLabelAndValue(t){const n=this._cachedMeta.vScale,r=this.getParsed(t);return{label:n.getLabels()[t],value:""+n.getLabelForValue(r[n.axis])}}parseObjectData(t,n,r,i){return hb.bind(this)(t,n,r,i)}update(t){const n=this._cachedMeta,r=n.dataset,i=n.data||[],s=n.iScale.getLabels();if(r.points=i,t!=="resize"){const o=this.resolveDatasetElementOptions(t);this.options.showLine||(o.borderWidth=0);const a={_loop:!0,_fullLoop:s.length===i.length,options:o};this.updateElement(r,void 0,a,t)}this.updateElements(i,0,i.length,t)}updateElements(t,n,r,i){const s=this._cachedMeta.rScale,o=i==="reset";for(let a=n;a<n+r;a++){const l=t[a],c=this.resolveDataElementOptions(a,l.active?"active":i),u=s.getPointPositionForValue(a,this.getParsed(a).r),f=o?s.xCenter:u.x,h=o?s.yCenter:u.y,p={x:f,y:h,angle:u.angle,skip:isNaN(f)||isNaN(h),options:c};this.updateElement(l,a,p,i)}}}B(pa,"id","radar"),B(pa,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),B(pa,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class ma extends Ht{getLabelAndValue(t){const n=this._cachedMeta,r=this.chart.data.labels||[],{xScale:i,yScale:s}=n,o=this.getParsed(t),a=i.getLabelForValue(o.x),l=s.getLabelForValue(o.y);return{label:r[t]||"",value:"("+a+", "+l+")"}}update(t){const n=this._cachedMeta,{data:r=[]}=n,i=this.chart._animationsDisabled;let{start:s,count:o}=ib(n,r,i);if(this._drawStart=s,this._drawCount=o,sb(n)&&(s=0,o=r.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:a,_dataset:l}=n;a._chart=this.chart,a._datasetIndex=this.index,a._decimated=!!l._decimated,a.points=r;const c=this.resolveDatasetElementOptions(t);c.segment=this.options.segment,this.updateElement(a,void 0,{animated:!i,options:c},t)}else this.datasetElementType&&(delete n.dataset,this.datasetElementType=!1);this.updateElements(r,s,o,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,n,r,i){const s=i==="reset",{iScale:o,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,u=this.resolveDataElementOptions(n,i),f=this.getSharedOptions(u),h=this.includeOptions(i,f),p=o.axis,m=a.axis,{spanGaps:g,segment:v}=this.options,x=Ci(g)?g:Number.POSITIVE_INFINITY,y=this.chart._animationsDisabled||s||i==="none";let b=n>0&&this.getParsed(n-1);for(let k=n;k<n+r;++k){const S=t[k],w=this.getParsed(k),E=y?S:{},P=re(w[m]),M=E[p]=o.getPixelForValue(w[p],k),j=E[m]=s||P?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,w,l):w[m],k);E.skip=isNaN(M)||isNaN(j)||P,E.stop=k>0&&Math.abs(w[p]-b[p])>x,v&&(E.parsed=w,E.raw=c.data[k]),h&&(E.options=f||this.resolveDataElementOptions(k,S.active?"active":i)),y||this.updateElement(S,k,E,i),b=w}this.updateSharedOptions(f,i,u)}getMaxOverflow(){const t=this._cachedMeta,n=t.data||[];if(!this.options.showLine){let a=0;for(let l=n.length-1;l>=0;--l)a=Math.max(a,n[l].size(this.resolveDataElementOptions(l))/2);return a>0&&a}const r=t.dataset,i=r.options&&r.options.borderWidth||0;if(!n.length)return i;const s=n[0].size(this.resolveDataElementOptions(0)),o=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(i,s,o)/2}}B(ma,"id","scatter"),B(ma,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),B(ma,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var aA=Object.freeze({__proto__:null,BarController:fa,BubbleController:da,DoughnutController:Cr,LineController:ha,PieController:af,PolarAreaController:js,RadarController:pa,ScatterController:ma});function pr(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Zd{constructor(t){B(this,"options");this.options=t||{}}static override(t){Object.assign(Zd.prototype,t)}init(){}formats(){return pr()}parse(){return pr()}format(){return pr()}add(){return pr()}diff(){return pr()}startOf(){return pr()}endOf(){return pr()}}var lA={_date:Zd};function cA(e,t,n,r){const{controller:i,data:s,_sorted:o}=e,a=i._cachedMeta.iScale,l=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null;if(a&&t===a.axis&&t!=="r"&&o&&s.length){const c=a._reversePixels?TT:bn;if(r){if(i._sharedOptions){const u=s[0],f=typeof u.getRange=="function"&&u.getRange(t);if(f){const h=c(s,t,n-f),p=c(s,t,n+f);return{lo:h.lo,hi:p.hi}}}}else{const u=c(s,t,n);if(l){const{vScale:f}=i._cachedMeta,{_parsed:h}=e,p=h.slice(0,u.lo+1).reverse().findIndex(g=>!re(g[f.axis]));u.lo-=Math.max(0,p);const m=h.slice(u.hi).findIndex(g=>!re(g[f.axis]));u.hi+=Math.max(0,m)}return u}}return{lo:0,hi:s.length-1}}function Al(e,t,n,r,i){const s=e.getSortedVisibleDatasetMetas(),o=n[t];for(let a=0,l=s.length;a<l;++a){const{index:c,data:u}=s[a],{lo:f,hi:h}=cA(s[a],t,o,i);for(let p=f;p<=h;++p){const m=u[p];m.skip||r(m,c,p)}}}function uA(e){const t=e.indexOf("x")!==-1,n=e.indexOf("y")!==-1;return function(r,i){const s=t?Math.abs(r.x-i.x):0,o=n?Math.abs(r.y-i.y):0;return Math.sqrt(Math.pow(s,2)+Math.pow(o,2))}}function Rc(e,t,n,r,i){const s=[];return!i&&!e.isPointInArea(t)||Al(e,n,t,function(a,l,c){!i&&!wn(a,e.chartArea,0)||a.inRange(t.x,t.y,r)&&s.push({element:a,datasetIndex:l,index:c})},!0),s}function fA(e,t,n,r){let i=[];function s(o,a,l){const{startAngle:c,endAngle:u}=o.getProps(["startAngle","endAngle"],r),{angle:f}=Zv(o,{x:t.x,y:t.y});eo(f,c,u)&&i.push({element:o,datasetIndex:a,index:l})}return Al(e,n,t,s),i}function dA(e,t,n,r,i,s){let o=[];const a=uA(n);let l=Number.POSITIVE_INFINITY;function c(u,f,h){const p=u.inRange(t.x,t.y,i);if(r&&!p)return;const m=u.getCenterPoint(i);if(!(!!s||e.isPointInArea(m))&&!p)return;const v=a(t,m);v<l?(o=[{element:u,datasetIndex:f,index:h}],l=v):v===l&&o.push({element:u,datasetIndex:f,index:h})}return Al(e,n,t,c),o}function Oc(e,t,n,r,i,s){return!s&&!e.isPointInArea(t)?[]:n==="r"&&!r?fA(e,t,n,i):dA(e,t,n,r,i,s)}function mg(e,t,n,r,i){const s=[],o=n==="x"?"inXRange":"inYRange";let a=!1;return Al(e,n,t,(l,c,u)=>{l[o]&&l[o](t[n],i)&&(s.push({element:l,datasetIndex:c,index:u}),a=a||l.inRange(t.x,t.y,i))}),r&&!a?[]:s}var hA={modes:{index(e,t,n,r){const i=yr(t,e),s=n.axis||"x",o=n.includeInvisible||!1,a=n.intersect?Rc(e,i,s,r,o):Oc(e,i,s,!1,r,o),l=[];return a.length?(e.getSortedVisibleDatasetMetas().forEach(c=>{const u=a[0].index,f=c.data[u];f&&!f.skip&&l.push({element:f,datasetIndex:c.index,index:u})}),l):[]},dataset(e,t,n,r){const i=yr(t,e),s=n.axis||"xy",o=n.includeInvisible||!1;let a=n.intersect?Rc(e,i,s,r,o):Oc(e,i,s,!1,r,o);if(a.length>0){const l=a[0].datasetIndex,c=e.getDatasetMeta(l).data;a=[];for(let u=0;u<c.length;++u)a.push({element:c[u],datasetIndex:l,index:u})}return a},point(e,t,n,r){const i=yr(t,e),s=n.axis||"xy",o=n.includeInvisible||!1;return Rc(e,i,s,r,o)},nearest(e,t,n,r){const i=yr(t,e),s=n.axis||"xy",o=n.includeInvisible||!1;return Oc(e,i,s,n.intersect,r,o)},x(e,t,n,r){const i=yr(t,e);return mg(e,i,"x",n.intersect,r)},y(e,t,n,r){const i=yr(t,e);return mg(e,i,"y",n.intersect,r)}}};const _b=["left","top","right","bottom"];function Qi(e,t){return e.filter(n=>n.pos===t)}function gg(e,t){return e.filter(n=>_b.indexOf(n.pos)===-1&&n.box.axis===t)}function qi(e,t){return e.sort((n,r)=>{const i=t?r:n,s=t?n:r;return i.weight===s.weight?i.index-s.index:i.weight-s.weight})}function pA(e){const t=[];let n,r,i,s,o,a;for(n=0,r=(e||[]).length;n<r;++n)i=e[n],{position:s,options:{stack:o,stackWeight:a=1}}=i,t.push({index:n,box:i,pos:s,horizontal:i.isHorizontal(),weight:i.weight,stack:o&&s+o,stackWeight:a});return t}function mA(e){const t={};for(const n of e){const{stack:r,pos:i,stackWeight:s}=n;if(!r||!_b.includes(i))continue;const o=t[r]||(t[r]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=s}return t}function gA(e,t){const n=mA(e),{vBoxMaxWidth:r,hBoxMaxHeight:i}=t;let s,o,a;for(s=0,o=e.length;s<o;++s){a=e[s];const{fullSize:l}=a.box,c=n[a.stack],u=c&&a.stackWeight/c.weight;a.horizontal?(a.width=u?u*r:l&&t.availableWidth,a.height=i):(a.width=r,a.height=u?u*i:l&&t.availableHeight)}return n}function xA(e){const t=pA(e),n=qi(t.filter(c=>c.box.fullSize),!0),r=qi(Qi(t,"left"),!0),i=qi(Qi(t,"right")),s=qi(Qi(t,"top"),!0),o=qi(Qi(t,"bottom")),a=gg(t,"x"),l=gg(t,"y");return{fullSize:n,leftAndTop:r.concat(s),rightAndBottom:i.concat(l).concat(o).concat(a),chartArea:Qi(t,"chartArea"),vertical:r.concat(i).concat(l),horizontal:s.concat(o).concat(a)}}function xg(e,t,n,r){return Math.max(e[n],t[n])+Math.max(e[r],t[r])}function Cb(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 yA(e,t,n,r){const{pos:i,box:s}=n,o=e.maxPadding;if(!se(i)){n.size&&(e[i]-=n.size);const f=r[n.stack]||{size:0,count:1};f.size=Math.max(f.size,n.horizontal?s.height:s.width),n.size=f.size/f.count,e[i]+=n.size}s.getPadding&&Cb(o,s.getPadding());const a=Math.max(0,t.outerWidth-xg(o,e,"left","right")),l=Math.max(0,t.outerHeight-xg(o,e,"top","bottom")),c=a!==e.w,u=l!==e.h;return e.w=a,e.h=l,n.horizontal?{same:c,other:u}:{same:u,other:c}}function vA(e){const t=e.maxPadding;function n(r){const i=Math.max(t[r]-e[r],0);return e[r]+=i,i}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}function bA(e,t){const n=t.maxPadding;function r(i){const s={left:0,top:0,right:0,bottom:0};return i.forEach(o=>{s[o]=Math.max(t[o],n[o])}),s}return r(e?["left","right"]:["top","bottom"])}function os(e,t,n,r){const i=[];let s,o,a,l,c,u;for(s=0,o=e.length,c=0;s<o;++s){a=e[s],l=a.box,l.update(a.width||t.w,a.height||t.h,bA(a.horizontal,t));const{same:f,other:h}=yA(t,n,a,r);c|=f&&i.length,u=u||h,l.fullSize||i.push(a)}return c&&os(i,t,n,r)||u}function Wo(e,t,n,r,i){e.top=n,e.left=t,e.right=t+r,e.bottom=n+i,e.width=r,e.height=i}function yg(e,t,n,r){const i=n.padding;let{x:s,y:o}=t;for(const a of e){const l=a.box,c=r[a.stack]||{placed:0,weight:1},u=a.stackWeight/c.weight||1;if(a.horizontal){const f=t.w*u,h=c.size||l.height;Zs(c.start)&&(o=c.start),l.fullSize?Wo(l,i.left,o,n.outerWidth-i.right-i.left,h):Wo(l,t.left+c.placed,o,f,h),c.start=o,c.placed+=f,o=l.bottom}else{const f=t.h*u,h=c.size||l.width;Zs(c.start)&&(s=c.start),l.fullSize?Wo(l,s,i.top,h,n.outerHeight-i.bottom-i.top):Wo(l,s,t.top+c.placed,h,f),c.start=s,c.placed+=f,s=l.right}}t.x=s,t.y=o}var Je={addBox(e,t){e.boxes||(e.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(n){t.draw(n)}}]},e.boxes.push(t)},removeBox(e,t){const n=e.boxes?e.boxes.indexOf(t):-1;n!==-1&&e.boxes.splice(n,1)},configure(e,t,n){t.fullSize=n.fullSize,t.position=n.position,t.weight=n.weight},update(e,t,n,r){if(!e)return;const i=et(e.options.layout.padding),s=Math.max(t-i.width,0),o=Math.max(n-i.height,0),a=xA(e.boxes),l=a.vertical,c=a.horizontal;fe(e.boxes,g=>{typeof g.beforeLayout=="function"&&g.beforeLayout()});const u=l.reduce((g,v)=>v.box.options&&v.box.options.display===!1?g:g+1,0)||1,f=Object.freeze({outerWidth:t,outerHeight:n,padding:i,availableWidth:s,availableHeight:o,vBoxMaxWidth:s/2/u,hBoxMaxHeight:o/2}),h=Object.assign({},i);Cb(h,et(r));const p=Object.assign({maxPadding:h,w:s,h:o,x:i.left,y:i.top},i),m=gA(l.concat(c),f);os(a.fullSize,p,f,m),os(l,p,f,m),os(c,p,f,m)&&os(l,p,f,m),vA(p),yg(a.leftAndTop,p,f,m),p.x+=p.w,p.y+=p.h,yg(a.rightAndBottom,p,f,m),e.chartArea={left:p.left,top:p.top,right:p.left+p.w,bottom:p.top+p.h,height:p.h,width:p.w},fe(a.chartArea,g=>{const v=g.box;Object.assign(v,e.chartArea),v.update(p.w,p.h,{left:0,top:0,right:0,bottom:0})})}};class Nb{acquireContext(t,n){}releaseContext(t){return!1}addEventListener(t,n,r){}removeEventListener(t,n,r){}getDevicePixelRatio(){return 1}getMaximumSize(t,n,r,i){return n=Math.max(0,n||t.width),r=r||t.height,{width:n,height:Math.max(0,i?Math.floor(n/i):r)}}isAttached(t){return!0}updateConfig(t){}}class wA extends Nb{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const ga="$chartjs",kA={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},vg=e=>e===null||e==="";function SA(e,t){const n=e.style,r=e.getAttribute("height"),i=e.getAttribute("width");if(e[ga]={initial:{height:r,width:i,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",vg(i)){const s=ng(e,"width");s!==void 0&&(e.width=s)}if(vg(r))if(e.style.height==="")e.height=e.width/(t||2);else{const s=ng(e,"height");s!==void 0&&(e.height=s)}return e}const jb=_D?{passive:!0}:!1;function _A(e,t,n){e&&e.addEventListener(t,n,jb)}function CA(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,jb)}function NA(e,t){const n=kA[e.type]||e.type,{x:r,y:i}=yr(e,t);return{type:n,chart:t,native:e,x:r!==void 0?r:null,y:i!==void 0?i:null}}function nl(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function jA(e,t,n){const r=e.canvas,i=new MutationObserver(s=>{let o=!1;for(const a of s)o=o||nl(a.addedNodes,r),o=o&&!nl(a.removedNodes,r);o&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}function EA(e,t,n){const r=e.canvas,i=new MutationObserver(s=>{let o=!1;for(const a of s)o=o||nl(a.removedNodes,r),o=o&&!nl(a.addedNodes,r);o&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}const no=new Map;let bg=0;function Eb(){const e=window.devicePixelRatio;e!==bg&&(bg=e,no.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function PA(e,t){no.size||window.addEventListener("resize",Eb),no.set(e,t)}function MA(e){no.delete(e),no.size||window.removeEventListener("resize",Eb)}function TA(e,t,n){const r=e.canvas,i=r&&Jd(r);if(!i)return;const s=rb((a,l)=>{const c=i.clientWidth;n(a,l),c<i.clientWidth&&n()},window),o=new ResizeObserver(a=>{const l=a[0],c=l.contentRect.width,u=l.contentRect.height;c===0&&u===0||s(c,u)});return o.observe(i),PA(e,s),o}function Ic(e,t,n){n&&n.disconnect(),t==="resize"&&MA(e)}function DA(e,t,n){const r=e.canvas,i=rb(s=>{e.ctx!==null&&n(NA(s,e))},e);return _A(r,t,i),i}class AA extends Nb{acquireContext(t,n){const r=t&&t.getContext&&t.getContext("2d");return r&&r.canvas===t?(SA(t,n),r):null}releaseContext(t){const n=t.canvas;if(!n[ga])return!1;const r=n[ga].initial;["height","width"].forEach(s=>{const o=r[s];re(o)?n.removeAttribute(s):n.setAttribute(s,o)});const i=r.style||{};return Object.keys(i).forEach(s=>{n.style[s]=i[s]}),n.width=n.width,delete n[ga],!0}addEventListener(t,n,r){this.removeEventListener(t,n);const i=t.$proxies||(t.$proxies={}),o={attach:jA,detach:EA,resize:TA}[n]||DA;i[n]=o(t,n,r)}removeEventListener(t,n){const r=t.$proxies||(t.$proxies={}),i=r[n];if(!i)return;({attach:Ic,detach:Ic,resize:Ic}[n]||CA)(t,n,i),r[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,r,i){return SD(t,n,r,i)}isAttached(t){const n=t&&Jd(t);return!!(n&&n.isConnected)}}function LA(e){return!qd()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?wA:AA}class Kt{constructor(){B(this,"x");B(this,"y");B(this,"active",!1);B(this,"options");B(this,"$animations")}tooltipPosition(t){const{x:n,y:r}=this.getProps(["x","y"],t);return{x:n,y:r}}hasValue(){return Ci(this.x)&&Ci(this.y)}getProps(t,n){const r=this.$animations;if(!n||!r)return this;const i={};return t.forEach(s=>{i[s]=r[s]&&r[s].active()?r[s]._to:this[s]}),i}}B(Kt,"defaults",{}),B(Kt,"defaultRoutes");function RA(e,t){const n=e.options.ticks,r=OA(e),i=Math.min(n.maxTicksLimit||r,r),s=n.major.enabled?zA(t):[],o=s.length,a=s[0],l=s[o-1],c=[];if(o>i)return FA(t,c,s,o/i),c;const u=IA(s,t,i);if(o>0){let f,h;const p=o>1?Math.round((l-a)/(o-1)):null;for(Uo(t,c,u,re(p)?0:a-p,a),f=0,h=o-1;f<h;f++)Uo(t,c,u,s[f],s[f+1]);return Uo(t,c,u,l,re(p)?t.length:l+p),c}return Uo(t,c,u),c}function OA(e){const t=e.options.offset,n=e._tickSize(),r=e._length/n+(t?0:1),i=e._maxLength/n;return Math.floor(Math.min(r,i))}function IA(e,t,n){const r=BA(e),i=t.length/n;if(!r)return Math.max(i,1);const s=NT(r);for(let o=0,a=s.length-1;o<a;o++){const l=s[o];if(l>i)return l}return Math.max(i,1)}function zA(e){const t=[];let n,r;for(n=0,r=e.length;n<r;n++)e[n].major&&t.push(n);return t}function FA(e,t,n,r){let i=0,s=n[0],o;for(r=Math.ceil(r),o=0;o<e.length;o++)o===s&&(t.push(e[o]),i++,s=n[i*r])}function Uo(e,t,n,r,i){const s=Z(r,0),o=Math.min(Z(i,e.length),e.length);let a=0,l,c,u;for(n=Math.ceil(n),i&&(l=i-r,n=l/Math.floor(l/n)),u=s;u<0;)a++,u=Math.round(s+a*n);for(c=Math.max(s,0);c<o;c++)c===u&&(t.push(e[c]),a++,u=Math.round(s+a*n))}function BA(e){const t=e.length;let n,r;if(t<2)return!1;for(r=e[0],n=1;n<t;++n)if(e[n]-e[n-1]!==r)return!1;return r}const $A=e=>e==="left"?"right":e==="right"?"left":e,wg=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,kg=(e,t)=>Math.min(t||e,e);function Sg(e,t){const n=[],r=e.length/t,i=e.length;let s=0;for(;s<i;s+=r)n.push(e[Math.floor(s)]);return n}function VA(e,t,n){const r=e.ticks.length,i=Math.min(t,r-1),s=e._startPixel,o=e._endPixel,a=1e-6;let l=e.getPixelForTick(i),c;if(!(n&&(r===1?c=Math.max(l-s,o-l):t===0?c=(e.getPixelForTick(1)-l)/2:c=(l-e.getPixelForTick(i-1))/2,l+=i<t?c:-c,l<s-a||l>o+a)))return l}function WA(e,t){fe(e,n=>{const r=n.gc,i=r.length/2;let s;if(i>t){for(s=0;s<i;++s)delete n.data[r[s]];r.splice(0,i)}})}function Ji(e){return e.drawTicks?e.tickLength:0}function _g(e,t){if(!e.display)return 0;const n=Fe(e.font,t),r=et(e.padding);return(_e(e.text)?e.text.length:1)*n.lineHeight+r.height}function UA(e,t){return cr(e,{scale:t,type:"scale"})}function HA(e,t,n){return cr(e,{tick:n,index:t,type:"tick"})}function YA(e,t,n){let r=Hd(e);return(n&&t!=="right"||!n&&t==="right")&&(r=$A(r)),r}function KA(e,t,n,r){const{top:i,left:s,bottom:o,right:a,chart:l}=e,{chartArea:c,scales:u}=l;let f=0,h,p,m;const g=o-i,v=a-s;if(e.isHorizontal()){if(p=Xe(r,s,a),se(n)){const x=Object.keys(n)[0],y=n[x];m=u[x].getPixelForValue(y)+g-t}else n==="center"?m=(c.bottom+c.top)/2+g-t:m=wg(e,n,t);h=a-s}else{if(se(n)){const x=Object.keys(n)[0],y=n[x];p=u[x].getPixelForValue(y)-v+t}else n==="center"?p=(c.left+c.right)/2-v+t:p=wg(e,n,t);m=Xe(r,o,i),f=n==="left"?-De:De}return{titleX:p,titleY:m,maxWidth:h,rotation:f}}class Vr extends Kt{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,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._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,n){return t}getUserBounds(){let{_userMin:t,_userMax:n,_suggestedMin:r,_suggestedMax:i}=this;return t=bt(t,Number.POSITIVE_INFINITY),n=bt(n,Number.NEGATIVE_INFINITY),r=bt(r,Number.POSITIVE_INFINITY),i=bt(i,Number.NEGATIVE_INFINITY),{min:bt(t,r),max:bt(n,i),minDefined:Me(t),maxDefined:Me(n)}}getMinMax(t){let{min:n,max:r,minDefined:i,maxDefined:s}=this.getUserBounds(),o;if(i&&s)return{min:n,max:r};const a=this.getMatchingVisibleMetas();for(let l=0,c=a.length;l<c;++l)o=a[l].controller.getMinMax(this,t),i||(n=Math.min(n,o.min)),s||(r=Math.max(r,o.max));return n=s&&n>r?r:n,r=i&&n>r?n:r,{min:bt(n,bt(r,n)),max:bt(r,bt(n,r))}}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(){xe(this.options.beforeUpdate,[this])}update(t,n,r){const{beginAtZero:i,grace:s,ticks:o}=this.options,a=o.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=n,this._margins=r=Object.assign({left:0,right:0,top:0,bottom:0},r),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+r.left+r.right:this.height+r.top+r.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=tD(this,s,i),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?Sg(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),o.display&&(o.autoSkip||o.source==="auto")&&(this.ticks=RA(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,n,r;this.isHorizontal()?(n=this.left,r=this.right):(n=this.top,r=this.bottom,t=!t),this._startPixel=n,this._endPixel=r,this._reversePixels=t,this._length=r-n,this._alignToPixels=this.options.alignToPixels}afterUpdate(){xe(this.options.afterUpdate,[this])}beforeSetDimensions(){xe(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){xe(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),xe(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){xe(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const n=this.options.ticks;let r,i,s;for(r=0,i=t.length;r<i;r++)s=t[r],s.label=xe(n.callback,[s.value,r,t],this)}afterTickToLabelConversion(){xe(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){xe(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,n=t.ticks,r=kg(this.ticks.length,t.ticks.maxTicksLimit),i=n.minRotation||0,s=n.maxRotation;let o=i,a,l,c;if(!this._isVisible()||!n.display||i>=s||r<=1||!this.isHorizontal()){this.labelRotation=i;return}const u=this._getLabelSizes(),f=u.widest.width,h=u.highest.height,p=$e(this.chart.width-f,0,this.maxWidth);a=t.offset?this.maxWidth/r:p/(r-1),f+6>a&&(a=p/(r-(t.offset?.5:1)),l=this.maxHeight-Ji(t.grid)-n.padding-_g(t.title,this.chart.options.font),c=Math.sqrt(f*f+h*h),o=Wd(Math.min(Math.asin($e((u.highest.height+6)/a,-1,1)),Math.asin($e(l/c,-1,1))-Math.asin($e(h/c,-1,1)))),o=Math.max(i,Math.min(s,o))),this.labelRotation=o}afterCalculateLabelRotation(){xe(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){xe(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:n,options:{ticks:r,title:i,grid:s}}=this,o=this._isVisible(),a=this.isHorizontal();if(o){const l=_g(i,n.options.font);if(a?(t.width=this.maxWidth,t.height=Ji(s)+l):(t.height=this.maxHeight,t.width=Ji(s)+l),r.display&&this.ticks.length){const{first:c,last:u,widest:f,highest:h}=this._getLabelSizes(),p=r.padding*2,m=$t(this.labelRotation),g=Math.cos(m),v=Math.sin(m);if(a){const x=r.mirror?0:v*f.width+g*h.height;t.height=Math.min(this.maxHeight,t.height+x+p)}else{const x=r.mirror?0:g*f.width+v*h.height;t.width=Math.min(this.maxWidth,t.width+x+p)}this._calculatePadding(c,u,v,g)}}this._handleMargins(),a?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,n,r,i){const{ticks:{align:s,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,f=this.right-this.getPixelForTick(this.ticks.length-1);let h=0,p=0;l?c?(h=i*t.width,p=r*n.height):(h=r*t.height,p=i*n.width):s==="start"?p=n.width:s==="end"?h=t.width:s!=="inner"&&(h=t.width/2,p=n.width/2),this.paddingLeft=Math.max((h-u+o)*this.width/(this.width-u),0),this.paddingRight=Math.max((p-f+o)*this.width/(this.width-f),0)}else{let u=n.height/2,f=t.height/2;s==="start"?(u=0,f=t.height):s==="end"&&(u=n.height,f=0),this.paddingTop=u+o,this.paddingBottom=f+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(){xe(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:n}=this.options;return n==="top"||n==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let n,r;for(n=0,r=t.length;n<r;n++)re(t[n].label)&&(t.splice(n,1),r--,n--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const n=this.options.ticks.sampleSize;let r=this.ticks;n<r.length&&(r=Sg(r,n)),this._labelSizes=t=this._computeLabelSizes(r,r.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,n,r){const{ctx:i,_longestTextCache:s}=this,o=[],a=[],l=Math.floor(n/kg(n,r));let c=0,u=0,f,h,p,m,g,v,x,y,b,k,S;for(f=0;f<n;f+=l){if(m=t[f].label,g=this._resolveTickFontOptions(f),i.font=v=g.string,x=s[v]=s[v]||{data:{},gc:[]},y=g.lineHeight,b=k=0,!re(m)&&!_e(m))b=el(i,x.data,x.gc,b,m),k=y;else if(_e(m))for(h=0,p=m.length;h<p;++h)S=m[h],!re(S)&&!_e(S)&&(b=el(i,x.data,x.gc,b,S),k+=y);o.push(b),a.push(k),c=Math.max(b,c),u=Math.max(k,u)}WA(s,n);const w=o.indexOf(c),E=a.indexOf(u),P=M=>({width:o[M]||0,height:a[M]||0});return{first:P(0),last:P(n-1),widest:P(w),highest:P(E),widths:o,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,n){return NaN}getValueForPixel(t){}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const n=this._startPixel+t*this._length;return MT(this._alignToPixels?hr(this.chart,n,0):n)}getDecimalForPixel(t){const n=(t-this._startPixel)/this._length;return this._reversePixels?1-n:n}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:n}=this;return t<0&&n<0?n:t>0&&n>0?t:0}getContext(t){const n=this.ticks||[];if(t>=0&&t<n.length){const r=n[t];return r.$context||(r.$context=HA(this.getContext(),t,r))}return this.$context||(this.$context=UA(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,n=$t(this.labelRotation),r=Math.abs(Math.cos(n)),i=Math.abs(Math.sin(n)),s=this._getLabelSizes(),o=t.autoSkipPadding||0,a=s?s.widest.width+o:0,l=s?s.highest.height+o:0;return this.isHorizontal()?l*r>a*i?a/r:l/i:l*i<a*r?l/r:a/i}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const n=this.axis,r=this.chart,i=this.options,{grid:s,position:o,border:a}=i,l=s.offset,c=this.isHorizontal(),f=this.ticks.length+(l?1:0),h=Ji(s),p=[],m=a.setContext(this.getContext()),g=m.display?m.width:0,v=g/2,x=function(G){return hr(r,G,g)};let y,b,k,S,w,E,P,M,j,D,R,$;if(o==="top")y=x(this.bottom),E=this.bottom-h,M=y-v,D=x(t.top)+v,$=t.bottom;else if(o==="bottom")y=x(this.top),D=t.top,$=x(t.bottom)-v,E=y+v,M=this.top+h;else if(o==="left")y=x(this.right),w=this.right-h,P=y-v,j=x(t.left)+v,R=t.right;else if(o==="right")y=x(this.left),j=t.left,R=x(t.right)-v,w=y+v,P=this.left+h;else if(n==="x"){if(o==="center")y=x((t.top+t.bottom)/2+.5);else if(se(o)){const G=Object.keys(o)[0],I=o[G];y=x(this.chart.scales[G].getPixelForValue(I))}D=t.top,$=t.bottom,E=y+v,M=E+h}else if(n==="y"){if(o==="center")y=x((t.left+t.right)/2);else if(se(o)){const G=Object.keys(o)[0],I=o[G];y=x(this.chart.scales[G].getPixelForValue(I))}w=y-v,P=w-h,j=t.left,R=t.right}const X=Z(i.ticks.maxTicksLimit,f),W=Math.max(1,Math.ceil(f/X));for(b=0;b<f;b+=W){const G=this.getContext(b),I=s.setContext(G),O=a.setContext(G),T=I.lineWidth,N=I.color,A=O.dash||[],H=O.dashOffset,_=I.tickWidth,Y=I.tickColor,q=I.tickBorderDash||[],K=I.tickBorderDashOffset;k=VA(this,b,l),k!==void 0&&(S=hr(r,k,T),c?w=P=j=R=S:E=M=D=$=S,p.push({tx1:w,ty1:E,tx2:P,ty2:M,x1:j,y1:D,x2:R,y2:$,width:T,color:N,borderDash:A,borderDashOffset:H,tickWidth:_,tickColor:Y,tickBorderDash:q,tickBorderDashOffset:K}))}return this._ticksLength=f,this._borderValue=y,p}_computeLabelItems(t){const n=this.axis,r=this.options,{position:i,ticks:s}=r,o=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:c,padding:u,mirror:f}=s,h=Ji(r.grid),p=h+u,m=f?-u:p,g=-$t(this.labelRotation),v=[];let x,y,b,k,S,w,E,P,M,j,D,R,$="middle";if(i==="top")w=this.bottom-m,E=this._getXAxisLabelAlignment();else if(i==="bottom")w=this.top+m,E=this._getXAxisLabelAlignment();else if(i==="left"){const W=this._getYAxisLabelAlignment(h);E=W.textAlign,S=W.x}else if(i==="right"){const W=this._getYAxisLabelAlignment(h);E=W.textAlign,S=W.x}else if(n==="x"){if(i==="center")w=(t.top+t.bottom)/2+p;else if(se(i)){const W=Object.keys(i)[0],G=i[W];w=this.chart.scales[W].getPixelForValue(G)+p}E=this._getXAxisLabelAlignment()}else if(n==="y"){if(i==="center")S=(t.left+t.right)/2-p;else if(se(i)){const W=Object.keys(i)[0],G=i[W];S=this.chart.scales[W].getPixelForValue(G)}E=this._getYAxisLabelAlignment(h).textAlign}n==="y"&&(l==="start"?$="top":l==="end"&&($="bottom"));const X=this._getLabelSizes();for(x=0,y=a.length;x<y;++x){b=a[x],k=b.label;const W=s.setContext(this.getContext(x));P=this.getPixelForTick(x)+s.labelOffset,M=this._resolveTickFontOptions(x),j=M.lineHeight,D=_e(k)?k.length:1;const G=D/2,I=W.color,O=W.textStrokeColor,T=W.textStrokeWidth;let N=E;o?(S=P,E==="inner"&&(x===y-1?N=this.options.reverse?"left":"right":x===0?N=this.options.reverse?"right":"left":N="center"),i==="top"?c==="near"||g!==0?R=-D*j+j/2:c==="center"?R=-X.highest.height/2-G*j+j:R=-X.highest.height+j/2:c==="near"||g!==0?R=j/2:c==="center"?R=X.highest.height/2-G*j:R=X.highest.height-D*j,f&&(R*=-1),g!==0&&!W.showLabelBackdrop&&(S+=j/2*Math.sin(g))):(w=P,R=(1-D)*j/2);let A;if(W.showLabelBackdrop){const H=et(W.backdropPadding),_=X.heights[x],Y=X.widths[x];let q=R-H.top,K=0-H.left;switch($){case"middle":q-=_/2;break;case"bottom":q-=_;break}switch(E){case"center":K-=Y/2;break;case"right":K-=Y;break;case"inner":x===y-1?K-=Y:x>0&&(K-=Y/2);break}A={left:K,top:q,width:Y+H.width,height:_+H.height,color:W.backdropColor}}v.push({label:k,font:M,textOffset:R,options:{rotation:g,color:I,strokeColor:O,strokeWidth:T,textAlign:N,textBaseline:$,translation:[S,w],backdrop:A}})}return v}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-$t(this.labelRotation))return t==="top"?"left":"right";let i="center";return n.align==="start"?i="left":n.align==="end"?i="right":n.align==="inner"&&(i="inner"),i}_getYAxisLabelAlignment(t){const{position:n,ticks:{crossAlign:r,mirror:i,padding:s}}=this.options,o=this._getLabelSizes(),a=t+s,l=o.widest.width;let c,u;return n==="left"?i?(u=this.right+s,r==="near"?c="left":r==="center"?(c="center",u+=l/2):(c="right",u+=l)):(u=this.right-a,r==="near"?c="right":r==="center"?(c="center",u-=l/2):(c="left",u=this.left)):n==="right"?i?(u=this.left+s,r==="near"?c="right":r==="center"?(c="center",u-=l/2):(c="left",u-=l)):(u=this.left+a,r==="near"?c="left":r==="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,n=this.options.position;if(n==="left"||n==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(n==="top"||n==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:n},left:r,top:i,width:s,height:o}=this;n&&(t.save(),t.fillStyle=n,t.fillRect(r,i,s,o),t.restore())}getLineWidthForValue(t){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const i=this.ticks.findIndex(s=>s.value===t);return i>=0?n.setContext(this.getContext(i)).lineWidth:0}drawGrid(t){const n=this.options.grid,r=this.ctx,i=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let s,o;const a=(l,c,u)=>{!u.width||!u.color||(r.save(),r.lineWidth=u.width,r.strokeStyle=u.color,r.setLineDash(u.borderDash||[]),r.lineDashOffset=u.borderDashOffset,r.beginPath(),r.moveTo(l.x,l.y),r.lineTo(c.x,c.y),r.stroke(),r.restore())};if(n.display)for(s=0,o=i.length;s<o;++s){const l=i[s];n.drawOnChartArea&&a({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),n.drawTicks&&a({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:n,options:{border:r,grid:i}}=this,s=r.setContext(this.getContext()),o=r.display?s.width:0;if(!o)return;const a=i.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,u,f,h;this.isHorizontal()?(c=hr(t,this.left,o)-o/2,u=hr(t,this.right,a)+a/2,f=h=l):(f=hr(t,this.top,o)-o/2,h=hr(t,this.bottom,a)+a/2,c=u=l),n.save(),n.lineWidth=s.width,n.strokeStyle=s.color,n.beginPath(),n.moveTo(c,f),n.lineTo(u,h),n.stroke(),n.restore()}drawLabels(t){if(!this.options.ticks.display)return;const r=this.ctx,i=this._computeLabelArea();i&&Ml(r,i);const s=this.getLabelItems(t);for(const o of s){const a=o.options,l=o.font,c=o.label,u=o.textOffset;Ir(r,c,0,u,l,a)}i&&Tl(r)}drawTitle(){const{ctx:t,options:{position:n,title:r,reverse:i}}=this;if(!r.display)return;const s=Fe(r.font),o=et(r.padding),a=r.align;let l=s.lineHeight/2;n==="bottom"||n==="center"||se(n)?(l+=o.bottom,_e(r.text)&&(l+=s.lineHeight*(r.text.length-1))):l+=o.top;const{titleX:c,titleY:u,maxWidth:f,rotation:h}=KA(this,l,n,a);Ir(t,r.text,0,0,s,{color:r.color,maxWidth:f,rotation:h,textAlign:YA(a,n,i),textBaseline:"middle",translation:[c,u]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,n=t.ticks&&t.ticks.z||0,r=Z(t.grid&&t.grid.z,-1),i=Z(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==Vr.prototype.draw?[{z:n,draw:s=>{this.draw(s)}}]:[{z:r,draw:s=>{this.drawBackground(),this.drawGrid(s),this.drawTitle()}},{z:i,draw:()=>{this.drawBorder()}},{z:n,draw:s=>{this.drawLabels(s)}}]}getMatchingVisibleMetas(t){const n=this.chart.getSortedVisibleDatasetMetas(),r=this.axis+"AxisID",i=[];let s,o;for(s=0,o=n.length;s<o;++s){const a=n[s];a[r]===this.id&&(!t||a.type===t)&&i.push(a)}return i}_resolveTickFontOptions(t){const n=this.options.ticks.setContext(this.getContext(t));return Fe(n.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class Ho{constructor(t,n,r){this.type=t,this.scope=n,this.override=r,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const n=Object.getPrototypeOf(t);let r;QA(n)&&(r=this.register(n));const i=this.items,s=t.id,o=this.scope+"."+s;if(!s)throw new Error("class does not have id: "+t);return s in i||(i[s]=t,XA(t,o,r),this.override&&Ce.override(t.id,t.overrides)),o}get(t){return this.items[t]}unregister(t){const n=this.items,r=t.id,i=this.scope;r in n&&delete n[r],i&&r in Ce[i]&&(delete Ce[i][r],this.override&&delete Or[r])}}function XA(e,t,n){const r=Js(Object.create(null),[n?Ce.get(n):{},Ce.get(t),e.defaults]);Ce.set(t,r),e.defaultRoutes&&GA(t,e.defaultRoutes),e.descriptors&&Ce.describe(t,e.descriptors)}function GA(e,t){Object.keys(t).forEach(n=>{const r=n.split("."),i=r.pop(),s=[e].concat(r).join("."),o=t[n].split("."),a=o.pop(),l=o.join(".");Ce.route(s,i,l,a)})}function QA(e){return"id"in e&&"defaults"in e}class qA{constructor(){this.controllers=new Ho(Ht,"datasets",!0),this.elements=new Ho(Kt,"elements"),this.plugins=new Ho(Object,"plugins"),this.scales=new Ho(Vr,"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,n,r){[...n].forEach(i=>{const s=r||this._getRegistryForType(i);r||s.isForType(i)||s===this.plugins&&i.id?this._exec(t,s,i):fe(i,o=>{const a=r||this._getRegistryForType(o);this._exec(t,a,o)})})}_exec(t,n,r){const i=Vd(t);xe(r["before"+i],[],r),n[t](r),xe(r["after"+i],[],r)}_getRegistryForType(t){for(let n=0;n<this._typedRegistries.length;n++){const r=this._typedRegistries[n];if(r.isForType(t))return r}return this.plugins}_get(t,n,r){const i=n.get(t);if(i===void 0)throw new Error('"'+t+'" is not a registered '+r+".");return i}}var en=new qA;class JA{constructor(){this._init=void 0}notify(t,n,r,i){if(n==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install")),this._init===void 0)return;const s=i?this._descriptors(t).filter(i):this._descriptors(t),o=this._notify(s,t,n,r);return n==="afterDestroy"&&(this._notify(s,t,"stop"),this._notify(this._init,t,"uninstall"),this._init=void 0),o}_notify(t,n,r,i){i=i||{};for(const s of t){const o=s.plugin,a=o[r],l=[n,i,s.options];if(xe(a,l,o)===!1&&i.cancelable)return!1}return!0}invalidate(){re(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const n=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),n}_createDescriptors(t,n){const r=t&&t.config,i=Z(r.options&&r.options.plugins,{}),s=ZA(r);return i===!1&&!n?[]:tL(t,s,i,n)}_notifyStateChanges(t){const n=this._oldCache||[],r=this._cache,i=(s,o)=>s.filter(a=>!o.some(l=>a.plugin.id===l.plugin.id));this._notify(i(n,r),t,"stop"),this._notify(i(r,n),t,"start")}}function ZA(e){const t={},n=[],r=Object.keys(en.plugins.items);for(let s=0;s<r.length;s++)n.push(en.getPlugin(r[s]));const i=e.plugins||[];for(let s=0;s<i.length;s++){const o=i[s];n.indexOf(o)===-1&&(n.push(o),t[o.id]=!0)}return{plugins:n,localIds:t}}function eL(e,t){return!t&&e===!1?null:e===!0?{}:e}function tL(e,{plugins:t,localIds:n},r,i){const s=[],o=e.getContext();for(const a of t){const l=a.id,c=eL(r[l],i);c!==null&&s.push({plugin:a,options:nL(e.config,{plugin:a,local:n[l]},c,o)})}return s}function nL(e,{plugin:t,local:n},r,i){const s=e.pluginScopeKeys(t),o=e.getOptionScopes(r,s);return n&&t.defaults&&o.push(t.defaults),e.createResolver(o,i,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function lf(e,t){const n=Ce.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function rL(e,t){let n=e;return e==="_index_"?n=t:e==="_value_"&&(n=t==="x"?"y":"x"),n}function iL(e,t){return e===t?"_index_":"_value_"}function Cg(e){if(e==="x"||e==="y"||e==="r")return e}function sL(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function cf(e,...t){if(Cg(e))return e;for(const n of t){const r=n.axis||sL(n.position)||e.length>1&&Cg(e[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function Ng(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function oL(e,t){if(t.data&&t.data.datasets){const n=t.data.datasets.filter(r=>r.xAxisID===e||r.yAxisID===e);if(n.length)return Ng(e,"x",n[0])||Ng(e,"y",n[0])}return{}}function aL(e,t){const n=Or[e.type]||{scales:{}},r=t.scales||{},i=lf(e.type,t),s=Object.create(null);return Object.keys(r).forEach(o=>{const a=r[o];if(!se(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=cf(o,a,oL(o,e),Ce.scales[a.type]),c=iL(l,i),u=n.scales||{};s[o]=Ss(Object.create(null),[{axis:l},a,u[l],u[c]])}),e.data.datasets.forEach(o=>{const a=o.type||e.type,l=o.indexAxis||lf(a,t),u=(Or[a]||{}).scales||{};Object.keys(u).forEach(f=>{const h=rL(f,l),p=o[h+"AxisID"]||h;s[p]=s[p]||Object.create(null),Ss(s[p],[{axis:h},r[p],u[f]])})}),Object.keys(s).forEach(o=>{const a=s[o];Ss(a,[Ce.scales[a.type],Ce.scale])}),s}function Pb(e){const t=e.options||(e.options={});t.plugins=Z(t.plugins,{}),t.scales=aL(e,t)}function Mb(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function lL(e){return e=e||{},e.data=Mb(e.data),Pb(e),e}const jg=new Map,Tb=new Set;function Yo(e,t){let n=jg.get(e);return n||(n=t(),jg.set(e,n),Tb.add(n)),n}const Zi=(e,t,n)=>{const r=nr(t,n);r!==void 0&&e.add(r)};class cL{constructor(t){this._config=lL(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=Mb(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(),Pb(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Yo(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return Yo(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return Yo(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,r=this.type;return Yo(`${r}-plugin-${n}`,()=>[[`plugins.${n}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,n){const r=this._scopeCache;let i=r.get(t);return(!i||n)&&(i=new Map,r.set(t,i)),i}getOptionScopes(t,n,r){const{options:i,type:s}=this,o=this._cachedScopes(t,r),a=o.get(n);if(a)return a;const l=new Set;n.forEach(u=>{t&&(l.add(t),u.forEach(f=>Zi(l,t,f))),u.forEach(f=>Zi(l,i,f)),u.forEach(f=>Zi(l,Or[s]||{},f)),u.forEach(f=>Zi(l,Ce,f)),u.forEach(f=>Zi(l,sf,f))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),Tb.has(n)&&o.set(n,c),c}chartOptionScopes(){const{options:t,type:n}=this;return[t,Or[n]||{},Ce.datasets[n]||{},{type:n},Ce,sf]}resolveNamedOptions(t,n,r,i=[""]){const s={$shared:!0},{resolver:o,subPrefixes:a}=Eg(this._resolverCache,t,i);let l=o;if(fL(o,n)){s.$shared=!1,r=rr(r)?r():r;const c=this.createResolver(t,r,a);l=Ni(o,r,c)}for(const c of n)s[c]=l[c];return s}createResolver(t,n,r=[""],i){const{resolver:s}=Eg(this._resolverCache,t,r);return se(n)?Ni(s,n,void 0,i):s}}function Eg(e,t,n){let r=e.get(t);r||(r=new Map,e.set(t,r));const i=n.join();let s=r.get(i);return s||(s={resolver:Xd(t,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},r.set(i,s)),s}const uL=e=>se(e)&&Object.getOwnPropertyNames(e).some(t=>rr(e[t]));function fL(e,t){const{isScriptable:n,isIndexable:r}=cb(e);for(const i of t){const s=n(i),o=r(i),a=(o||s)&&e[i];if(s&&(rr(a)||uL(a))||o&&_e(a))return!0}return!1}var dL="4.5.1";const hL=["top","bottom","left","right","chartArea"];function Pg(e,t){return e==="top"||e==="bottom"||hL.indexOf(e)===-1&&t==="x"}function Mg(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}function Tg(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),xe(n&&n.onComplete,[e],t)}function pL(e){const t=e.chart,n=t.options.animation;xe(n&&n.onProgress,[e],t)}function Db(e){return qd()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const xa={},Dg=e=>{const t=Db(e);return Object.values(xa).filter(n=>n.canvas===t).pop()};function mL(e,t,n){const r=Object.keys(e);for(const i of r){const s=+i;if(s>=t){const o=e[i];delete e[i],(n>0||s>t)&&(e[s+n]=o)}}}function gL(e,t,n,r){return!n||e.type==="mouseout"?null:r?t:e}class tn{static register(...t){en.add(...t),Ag()}static unregister(...t){en.remove(...t),Ag()}constructor(t,n){const r=this.config=new cL(n),i=Db(t),s=Dg(i);if(s)throw new Error("Canvas is already in use. Chart with ID '"+s.id+"' must be destroyed before the canvas with ID '"+s.canvas.id+"' can be reused.");const o=r.createResolver(r.chartOptionScopes(),this.getContext());this.platform=new(r.platform||LA(i)),this.platform.updateConfig(r);const a=this.platform.acquireContext(i,o.aspectRatio),l=a&&a.canvas,c=l&&l.height,u=l&&l.width;if(this.id=xT(),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 JA,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=LT(f=>this.update(f),o.resizeDelay||0),this._dataChanges=[],xa[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}dn.listen(this,"complete",Tg),dn.listen(this,"progress",pL),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:r,height:i,_aspectRatio:s}=this;return re(t)?n&&s?s:i?r/i: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 en}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():tg(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Jm(this.canvas,this.ctx),this}stop(){return dn.stop(this),this}resize(t,n){dn.running(this)?this._resizeBeforeDraw={width:t,height:n}:this._resize(t,n)}_resize(t,n){const r=this.options,i=this.canvas,s=r.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(i,t,n,s),a=r.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,tg(this,a,!0)&&(this.notifyPlugins("resize",{size:o}),xe(r.onResize,[this,o],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};fe(n,(r,i)=>{r.id=i})}buildOrUpdateScales(){const t=this.options,n=t.scales,r=this.scales,i=Object.keys(r).reduce((o,a)=>(o[a]=!1,o),{});let s=[];n&&(s=s.concat(Object.keys(n).map(o=>{const a=n[o],l=cf(o,a),c=l==="r",u=l==="x";return{options:a,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),fe(s,o=>{const a=o.options,l=a.id,c=cf(l,a),u=Z(a.type,o.dtype);(a.position===void 0||Pg(a.position,c)!==Pg(o.dposition))&&(a.position=o.dposition),i[l]=!0;let f=null;if(l in r&&r[l].type===u)f=r[l];else{const h=en.getScale(u);f=new h({id:l,type:u,ctx:this.ctx,chart:this}),r[f.id]=f}f.init(a,t)}),fe(i,(o,a)=>{o||delete r[a]}),fe(r,o=>{Je.configure(this,o,o.options),Je.addBox(this,o)})}_updateMetasets(){const t=this._metasets,n=this.data.datasets.length,r=t.length;if(t.sort((i,s)=>i.index-s.index),r>n){for(let i=n;i<r;++i)this._destroyDatasetMeta(i);t.splice(n,r-n)}this._sortedMetasets=t.slice(0).sort(Mg("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:n}}=this;t.length>n.length&&delete this._stacks,t.forEach((r,i)=>{n.filter(s=>s===r._dataset).length===0&&this._destroyDatasetMeta(i)})}buildOrUpdateControllers(){const t=[],n=this.data.datasets;let r,i;for(this._removeUnreferencedMetasets(),r=0,i=n.length;r<i;r++){const s=n[r];let o=this.getDatasetMeta(r);const a=s.type||this.config.type;if(o.type&&o.type!==a&&(this._destroyDatasetMeta(r),o=this.getDatasetMeta(r)),o.type=a,o.indexAxis=s.indexAxis||lf(a,this.options),o.order=s.order||0,o.index=r,o.label=""+s.label,o.visible=this.isDatasetVisible(r),o.controller)o.controller.updateIndex(r),o.controller.linkScales();else{const l=en.getController(a),{datasetElementType:c,dataElementType:u}=Ce.datasets[a];Object.assign(l,{dataElementType:en.getElement(u),datasetElementType:c&&en.getElement(c)}),o.controller=new l(this,r),t.push(o.controller)}}return this._updateMetasets(),t}_resetElements(){fe(this.data.datasets,(t,n)=>{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const n=this.config;n.update();const r=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),i=this._animationsDisabled=!r.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const s=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let c=0,u=this.data.datasets.length;c<u;c++){const{controller:f}=this.getDatasetMeta(c),h=!i&&s.indexOf(f)===-1;f.buildOrUpdateElements(h),o=Math.max(+f.getMaxOverflow(),o)}o=this._minPadding=r.layout.autoPadding?o:0,this._updateLayout(o),i||fe(s,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Mg("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){fe(this.scales,t=>{Je.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),r=new Set(t.events);(!Wm(n,r)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,n=this._getUniformDataChanges()||[];for(const{method:r,start:i,count:s}of n){const o=r==="_removeElements"?-s:s;mL(t,i,o)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const n=this.data.datasets.length,r=s=>new Set(t.filter(o=>o[0]===s).map((o,a)=>a+","+o.splice(1).join(","))),i=r(0);for(let s=1;s<n;s++)if(!Wm(i,r(s)))return;return Array.from(i).map(s=>s.split(",")).map(s=>({method:s[1],start:+s[2],count:+s[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;Je.update(this,this.width,this.height,t);const n=this.chartArea,r=n.width<=0||n.height<=0;this._layers=[],fe(this.boxes,i=>{r&&i.position==="chartArea"||(i.configure&&i.configure(),this._layers.push(...i._layers()))},this),this._layers.forEach((i,s)=>{i._idx=s}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let n=0,r=this.data.datasets.length;n<r;++n)this.getDatasetMeta(n).controller.configure();for(let n=0,r=this.data.datasets.length;n<r;++n)this._updateDataset(n,rr(t)?t({datasetIndex:n}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,n){const r=this.getDatasetMeta(t),i={meta:r,index:t,mode:n,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",i)!==!1&&(r.controller._update(n),i.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",i))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(dn.has(this)?this.attached&&!dn.running(this)&&dn.start(this):(this.draw(),Tg({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:r,height:i}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(r,i)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const n=this._layers;for(t=0;t<n.length&&n[t].z<=0;++t)n[t].draw(this.chartArea);for(this._drawDatasets();t<n.length;++t)n[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const n=this._sortedMetasets,r=[];let i,s;for(i=0,s=n.length;i<s;++i){const o=n[i];(!t||o.visible)&&r.push(o)}return r}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let n=t.length-1;n>=0;--n)this._drawDataset(t[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const n=this.ctx,r={meta:t,index:t.index,cancelable:!0},i=bb(this,t);this.notifyPlugins("beforeDatasetDraw",r)!==!1&&(i&&Ml(n,i),t.controller.draw(),i&&Tl(n),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(t){return wn(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,r,i){const s=hA.modes[n];return typeof s=="function"?s(this,t,r,i):[]}getDatasetMeta(t){const n=this.data.datasets[t],r=this._metasets;let i=r.filter(s=>s&&s._dataset===n).pop();return i||(i={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n&&n.order||0,index:t,_dataset:n,_parsed:[],_sorted:!1},r.push(i)),i}getContext(){return this.$context||(this.$context=cr(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const n=this.data.datasets[t];if(!n)return!1;const r=this.getDatasetMeta(t);return typeof r.hidden=="boolean"?!r.hidden:!n.hidden}setDatasetVisibility(t,n){const r=this.getDatasetMeta(t);r.hidden=!n}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,n,r){const i=r?"show":"hide",s=this.getDatasetMeta(t),o=s.controller._resolveAnimations(void 0,i);Zs(n)?(s.data[n].hidden=!r,this.update()):(this.setDatasetVisibility(t,r),o.update(s,{visible:r}),this.update(a=>a.datasetIndex===t?i:void 0))}hide(t,n){this._updateVisibility(t,n,!1)}show(t,n){this._updateVisibility(t,n,!0)}_destroyDatasetMeta(t){const n=this._metasets[t];n&&n.controller&&n.controller._destroy(),delete this._metasets[t]}_stop(){let t,n;for(this.stop(),dn.remove(this),t=0,n=this.data.datasets.length;t<n;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:n}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),Jm(t,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete xa[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,n=this.platform,r=(s,o)=>{n.addEventListener(this,s,o),t[s]=o},i=(s,o,a)=>{s.offsetX=o,s.offsetY=a,this._eventHandler(s)};fe(this.options.events,s=>r(s,i))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,n=this.platform,r=(l,c)=>{n.addEventListener(this,l,c),t[l]=c},i=(l,c)=>{t[l]&&(n.removeEventListener(this,l,c),delete t[l])},s=(l,c)=>{this.canvas&&this.resize(l,c)};let o;const a=()=>{i("attach",a),this.attached=!0,this.resize(),r("resize",s),r("detach",o)};o=()=>{this.attached=!1,i("resize",s),this._stop(),this._resize(0,0),r("attach",a)},n.isAttached(this.canvas)?a():o()}unbindEvents(){fe(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},fe(this._responsiveListeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,n,r){const i=r?"set":"remove";let s,o,a,l;for(n==="dataset"&&(s=this.getDatasetMeta(t[0].datasetIndex),s.controller["_"+i+"DatasetHoverStyle"]()),a=0,l=t.length;a<l;++a){o=t[a];const c=o&&this.getDatasetMeta(o.datasetIndex).controller;c&&c[i+"HoverStyle"](o.element,o.datasetIndex,o.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const n=this._active||[],r=t.map(({datasetIndex:s,index:o})=>{const a=this.getDatasetMeta(s);if(!a)throw new Error("No dataset found at index "+s);return{datasetIndex:s,element:a.data[o],index:o}});!qa(r,n)&&(this._active=r,this._lastEvent=null,this._updateHoverStyles(r,n))}notifyPlugins(t,n,r){return this._plugins.notify(this,t,n,r)}isPluginEnabled(t){return this._plugins._cache.filter(n=>n.plugin.id===t).length===1}_updateHoverStyles(t,n,r){const i=this.options.hover,s=(l,c)=>l.filter(u=>!c.some(f=>u.datasetIndex===f.datasetIndex&&u.index===f.index)),o=s(n,t),a=r?t:s(t,n);o.length&&this.updateHoverStyle(o,i.mode,!1),a.length&&i.mode&&this.updateHoverStyle(a,i.mode,!0)}_eventHandler(t,n){const r={event:t,replay:n,cancelable:!0,inChartArea:this.isPointInArea(t)},i=o=>(o.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",r,i)===!1)return;const s=this._handleEvent(t,n,r.inChartArea);return r.cancelable=!1,this.notifyPlugins("afterEvent",r,i),(s||r.changed)&&this.render(),this}_handleEvent(t,n,r){const{_active:i=[],options:s}=this,o=n,a=this._getActiveElements(t,i,r,o),l=ST(t),c=gL(t,this._lastEvent,r,l);r&&(this._lastEvent=null,xe(s.onHover,[t,a,this],this),l&&xe(s.onClick,[t,a,this],this));const u=!qa(a,i);return(u||n)&&(this._active=a,this._updateHoverStyles(a,i,n)),this._lastEvent=c,u}_getActiveElements(t,n,r,i){if(t.type==="mouseout")return[];if(!r)return n;const s=this.options.hover;return this.getElementsAtEventForMode(t,s.mode,s,i)}}B(tn,"defaults",Ce),B(tn,"instances",xa),B(tn,"overrides",Or),B(tn,"registry",en),B(tn,"version",dL),B(tn,"getChart",Dg);function Ag(){return fe(tn.instances,e=>e._plugins.invalidate())}function xL(e,t,n){const{startAngle:r,x:i,y:s,outerRadius:o,innerRadius:a,options:l}=t,{borderWidth:c,borderJoinStyle:u}=l,f=Math.min(c/o,Ge(r-n));if(e.beginPath(),e.arc(i,s,o-c/2,r+f/2,n-f/2),a>0){const h=Math.min(c/a,Ge(r-n));e.arc(i,s,a+c/2,n-h/2,r+h/2,!0)}else{const h=Math.min(c/2,o*Ge(r-n));if(u==="round")e.arc(i,s,h,n-ue/2,r+ue/2,!0);else if(u==="bevel"){const p=2*h*h,m=-p*Math.cos(n+ue/2)+i,g=-p*Math.sin(n+ue/2)+s,v=p*Math.cos(r+ue/2)+i,x=p*Math.sin(r+ue/2)+s;e.lineTo(m,g),e.lineTo(v,x)}}e.closePath(),e.moveTo(0,0),e.rect(0,0,e.canvas.width,e.canvas.height),e.clip("evenodd")}function yL(e,t,n){const{startAngle:r,pixelMargin:i,x:s,y:o,outerRadius:a,innerRadius:l}=t;let c=i/a;e.beginPath(),e.arc(s,o,a,r-c,n+c),l>i?(c=i/l,e.arc(s,o,l,n+c,r-c,!0)):e.arc(s,o,i,n+De,r-De),e.closePath(),e.clip()}function vL(e){return Kd(e,["outerStart","outerEnd","innerStart","innerEnd"])}function bL(e,t,n,r){const i=vL(e.options.borderRadius),s=(n-t)/2,o=Math.min(s,r*t/2),a=l=>{const c=(n-Math.min(s,l))*r/2;return $e(l,0,Math.min(s,c))};return{outerStart:a(i.outerStart),outerEnd:a(i.outerEnd),innerStart:$e(i.innerStart,0,o),innerEnd:$e(i.innerEnd,0,o)}}function Kr(e,t,n,r){return{x:n+e*Math.cos(t),y:r+e*Math.sin(t)}}function rl(e,t,n,r,i,s){const{x:o,y:a,startAngle:l,pixelMargin:c,innerRadius:u}=t,f=Math.max(t.outerRadius+r+n-c,0),h=u>0?u+r+n+c:0;let p=0;const m=i-l;if(r){const W=u>0?u-r:0,G=f>0?f-r:0,I=(W+G)/2,O=I!==0?m*I/(I+r):m;p=(m-O)/2}const g=Math.max(.001,m*f-n/ue)/f,v=(m-g)/2,x=l+v+p,y=i-v-p,{outerStart:b,outerEnd:k,innerStart:S,innerEnd:w}=bL(t,h,f,y-x),E=f-b,P=f-k,M=x+b/E,j=y-k/P,D=h+S,R=h+w,$=x+S/D,X=y-w/R;if(e.beginPath(),s){const W=(M+j)/2;if(e.arc(o,a,f,M,W),e.arc(o,a,f,W,j),k>0){const T=Kr(P,j,o,a);e.arc(T.x,T.y,k,j,y+De)}const G=Kr(R,y,o,a);if(e.lineTo(G.x,G.y),w>0){const T=Kr(R,X,o,a);e.arc(T.x,T.y,w,y+De,X+Math.PI)}const I=(y-w/h+(x+S/h))/2;if(e.arc(o,a,h,y-w/h,I,!0),e.arc(o,a,h,I,x+S/h,!0),S>0){const T=Kr(D,$,o,a);e.arc(T.x,T.y,S,$+Math.PI,x-De)}const O=Kr(E,x,o,a);if(e.lineTo(O.x,O.y),b>0){const T=Kr(E,M,o,a);e.arc(T.x,T.y,b,x-De,M)}}else{e.moveTo(o,a);const W=Math.cos(M)*f+o,G=Math.sin(M)*f+a;e.lineTo(W,G);const I=Math.cos(j)*f+o,O=Math.sin(j)*f+a;e.lineTo(I,O)}e.closePath()}function wL(e,t,n,r,i){const{fullCircles:s,startAngle:o,circumference:a}=t;let l=t.endAngle;if(s){rl(e,t,n,r,l,i);for(let c=0;c<s;++c)e.fill();isNaN(a)||(l=o+(a%ke||ke))}return rl(e,t,n,r,l,i),e.fill(),l}function kL(e,t,n,r,i){const{fullCircles:s,startAngle:o,circumference:a,options:l}=t,{borderWidth:c,borderJoinStyle:u,borderDash:f,borderDashOffset:h,borderRadius:p}=l,m=l.borderAlign==="inner";if(!c)return;e.setLineDash(f||[]),e.lineDashOffset=h,m?(e.lineWidth=c*2,e.lineJoin=u||"round"):(e.lineWidth=c,e.lineJoin=u||"bevel");let g=t.endAngle;if(s){rl(e,t,n,r,g,i);for(let v=0;v<s;++v)e.stroke();isNaN(a)||(g=o+(a%ke||ke))}m&&yL(e,t,g),l.selfJoin&&g-o>=ue&&p===0&&u!=="miter"&&xL(e,t,g),s||(rl(e,t,n,r,g,i),e.stroke())}class as extends Kt{constructor(n){super();B(this,"circumference");B(this,"endAngle");B(this,"fullCircles");B(this,"innerRadius");B(this,"outerRadius");B(this,"pixelMargin");B(this,"startAngle");this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,n&&Object.assign(this,n)}inRange(n,r,i){const s=this.getProps(["x","y"],i),{angle:o,distance:a}=Zv(s,{x:n,y:r}),{startAngle:l,endAngle:c,innerRadius:u,outerRadius:f,circumference:h}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),p=(this.options.spacing+this.options.borderWidth)/2,m=Z(h,c-l),g=eo(o,l,c)&&l!==c,v=m>=ke||g,x=vn(a,u+p,f+p);return v&&x}getCenterPoint(n){const{x:r,y:i,startAngle:s,endAngle:o,innerRadius:a,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],n),{offset:c,spacing:u}=this.options,f=(s+o)/2,h=(a+l+u+c)/2;return{x:r+Math.cos(f)*h,y:i+Math.sin(f)*h}}tooltipPosition(n){return this.getCenterPoint(n)}draw(n){const{options:r,circumference:i}=this,s=(r.offset||0)/4,o=(r.spacing||0)/2,a=r.circular;if(this.pixelMargin=r.borderAlign==="inner"?.33:0,this.fullCircles=i>ke?Math.floor(i/ke):0,i===0||this.innerRadius<0||this.outerRadius<0)return;n.save();const l=(this.startAngle+this.endAngle)/2;n.translate(Math.cos(l)*s,Math.sin(l)*s);const c=1-Math.sin(Math.min(ue,i||0)),u=s*c;n.fillStyle=r.backgroundColor,n.strokeStyle=r.borderColor,wL(n,this,u,o,a),kL(n,this,u,o,a),n.restore()}}B(as,"id","arc"),B(as,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0,selfJoin:!1}),B(as,"defaultRoutes",{backgroundColor:"backgroundColor"}),B(as,"descriptors",{_scriptable:!0,_indexable:n=>n!=="borderDash"});function Ab(e,t,n=t){e.lineCap=Z(n.borderCapStyle,t.borderCapStyle),e.setLineDash(Z(n.borderDash,t.borderDash)),e.lineDashOffset=Z(n.borderDashOffset,t.borderDashOffset),e.lineJoin=Z(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=Z(n.borderWidth,t.borderWidth),e.strokeStyle=Z(n.borderColor,t.borderColor)}function SL(e,t,n){e.lineTo(n.x,n.y)}function _L(e){return e.stepped?YT:e.tension||e.cubicInterpolationMode==="monotone"?KT:SL}function Lb(e,t,n={}){const r=e.length,{start:i=0,end:s=r-1}=n,{start:o,end:a}=t,l=Math.max(i,o),c=Math.min(s,a),u=i<o&&s<o||i>a&&s>a;return{count:r,start:l,loop:t.loop,ilen:c<l&&!u?r+c-l:c-l}}function CL(e,t,n,r){const{points:i,options:s}=t,{count:o,start:a,loop:l,ilen:c}=Lb(i,n,r),u=_L(s);let{move:f=!0,reverse:h}=r||{},p,m,g;for(p=0;p<=c;++p)m=i[(a+(h?c-p:p))%o],!m.skip&&(f?(e.moveTo(m.x,m.y),f=!1):u(e,g,m,h,s.stepped),g=m);return l&&(m=i[(a+(h?c:0))%o],u(e,g,m,h,s.stepped)),!!l}function NL(e,t,n,r){const i=t.points,{count:s,start:o,ilen:a}=Lb(i,n,r),{move:l=!0,reverse:c}=r||{};let u=0,f=0,h,p,m,g,v,x;const y=k=>(o+(c?a-k:k))%s,b=()=>{g!==v&&(e.lineTo(u,v),e.lineTo(u,g),e.lineTo(u,x))};for(l&&(p=i[y(0)],e.moveTo(p.x,p.y)),h=0;h<=a;++h){if(p=i[y(h)],p.skip)continue;const k=p.x,S=p.y,w=k|0;w===m?(S<g?g=S:S>v&&(v=S),u=(f*u+k)/++f):(b(),e.lineTo(k,S),m=w,f=0,g=v=S),x=S}b()}function uf(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?NL:CL}function jL(e){return e.stepped?CD:e.tension||e.cubicInterpolationMode==="monotone"?ND:vr}function EL(e,t,n,r){let i=t._path;i||(i=t._path=new Path2D,t.path(i,n,r)&&i.closePath()),Ab(e,t.options),e.stroke(i)}function PL(e,t,n,r){const{segments:i,options:s}=t,o=uf(t);for(const a of i)Ab(e,s,a.style),e.beginPath(),o(e,t,a,{start:n,end:n+r-1})&&e.closePath(),e.stroke()}const ML=typeof Path2D=="function";function TL(e,t,n,r){ML&&!t.options.segment?EL(e,t,n,r):PL(e,t,n,r)}class Vn extends Kt{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,n){const r=this.options;if((r.tension||r.cubicInterpolationMode==="monotone")&&!r.stepped&&!this._pointsUpdated){const i=r.spanGaps?this._loop:this._fullLoop;xD(this._points,r,t,i,n),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=DD(this,this.options.segment))}first(){const t=this.segments,n=this.points;return t.length&&n[t[0].start]}last(){const t=this.segments,n=this.points,r=t.length;return r&&n[t[r-1].end]}interpolate(t,n){const r=this.options,i=t[n],s=this.points,o=vb(this,{property:n,start:i,end:i});if(!o.length)return;const a=[],l=jL(r);let c,u;for(c=0,u=o.length;c<u;++c){const{start:f,end:h}=o[c],p=s[f],m=s[h];if(p===m){a.push(p);continue}const g=Math.abs((i-p[n])/(m[n]-p[n])),v=l(p,m,g,r.stepped);v[n]=t[n],a.push(v)}return a.length===1?a[0]:a}pathSegment(t,n,r){return uf(this)(t,this,n,r)}path(t,n,r){const i=this.segments,s=uf(this);let o=this._loop;n=n||0,r=r||this.points.length-n;for(const a of i)o&=s(t,this,a,{start:n,end:n+r-1});return!!o}draw(t,n,r,i){const s=this.options||{};(this.points||[]).length&&s.borderWidth&&(t.save(),TL(t,this,r,i),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}B(Vn,"id","line"),B(Vn,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),B(Vn,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),B(Vn,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function Lg(e,t,n,r){const i=e.options,{[n]:s}=e.getProps([n],r);return Math.abs(t-s)<i.radius+i.hitRadius}class ya extends Kt{constructor(n){super();B(this,"parsed");B(this,"skip");B(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,n&&Object.assign(this,n)}inRange(n,r,i){const s=this.options,{x:o,y:a}=this.getProps(["x","y"],i);return Math.pow(n-o,2)+Math.pow(r-a,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(n,r){return Lg(this,n,"x",r)}inYRange(n,r){return Lg(this,n,"y",r)}getCenterPoint(n){const{x:r,y:i}=this.getProps(["x","y"],n);return{x:r,y:i}}size(n){n=n||this.options||{};let r=n.radius||0;r=Math.max(r,r&&n.hoverRadius||0);const i=r&&n.borderWidth||0;return(r+i)*2}draw(n,r){const i=this.options;this.skip||i.radius<.1||!wn(this,r,this.size(i)/2)||(n.strokeStyle=i.borderColor,n.lineWidth=i.borderWidth,n.fillStyle=i.backgroundColor,of(n,i,this.x,this.y))}getRange(){const n=this.options||{};return n.radius+n.hitRadius}}B(ya,"id","point"),B(ya,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),B(ya,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function Rb(e,t){const{x:n,y:r,base:i,width:s,height:o}=e.getProps(["x","y","base","width","height"],t);let a,l,c,u,f;return e.horizontal?(f=o/2,a=Math.min(n,i),l=Math.max(n,i),c=r-f,u=r+f):(f=s/2,a=n-f,l=n+f,c=Math.min(r,i),u=Math.max(r,i)),{left:a,top:c,right:l,bottom:u}}function Wn(e,t,n,r){return e?0:$e(t,n,r)}function DL(e,t,n){const r=e.options.borderWidth,i=e.borderSkipped,s=lb(r);return{t:Wn(i.top,s.top,0,n),r:Wn(i.right,s.right,0,t),b:Wn(i.bottom,s.bottom,0,n),l:Wn(i.left,s.left,0,t)}}function AL(e,t,n){const{enableBorderRadius:r}=e.getProps(["enableBorderRadius"]),i=e.options.borderRadius,s=Er(i),o=Math.min(t,n),a=e.borderSkipped,l=r||se(i);return{topLeft:Wn(!l||a.top||a.left,s.topLeft,0,o),topRight:Wn(!l||a.top||a.right,s.topRight,0,o),bottomLeft:Wn(!l||a.bottom||a.left,s.bottomLeft,0,o),bottomRight:Wn(!l||a.bottom||a.right,s.bottomRight,0,o)}}function LL(e){const t=Rb(e),n=t.right-t.left,r=t.bottom-t.top,i=DL(e,n/2,r/2),s=AL(e,n/2,r/2);return{outer:{x:t.left,y:t.top,w:n,h:r,radius:s},inner:{x:t.left+i.l,y:t.top+i.t,w:n-i.l-i.r,h:r-i.t-i.b,radius:{topLeft:Math.max(0,s.topLeft-Math.max(i.t,i.l)),topRight:Math.max(0,s.topRight-Math.max(i.t,i.r)),bottomLeft:Math.max(0,s.bottomLeft-Math.max(i.b,i.l)),bottomRight:Math.max(0,s.bottomRight-Math.max(i.b,i.r))}}}}function zc(e,t,n,r){const i=t===null,s=n===null,a=e&&!(i&&s)&&Rb(e,r);return a&&(i||vn(t,a.left,a.right))&&(s||vn(n,a.top,a.bottom))}function RL(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}function OL(e,t){e.rect(t.x,t.y,t.w,t.h)}function Fc(e,t,n={}){const r=e.x!==n.x?-t:0,i=e.y!==n.y?-t:0,s=(e.x+e.w!==n.x+n.w?t:0)-r,o=(e.y+e.h!==n.y+n.h?t:0)-i;return{x:e.x+r,y:e.y+i,w:e.w+s,h:e.h+o,radius:e.radius}}class va extends Kt{constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:n,options:{borderColor:r,backgroundColor:i}}=this,{inner:s,outer:o}=LL(this),a=RL(o.radius)?to:OL;t.save(),(o.w!==s.w||o.h!==s.h)&&(t.beginPath(),a(t,Fc(o,n,s)),t.clip(),a(t,Fc(s,-n,o)),t.fillStyle=r,t.fill("evenodd")),t.beginPath(),a(t,Fc(s,n)),t.fillStyle=i,t.fill(),t.restore()}inRange(t,n,r){return zc(this,t,n,r)}inXRange(t,n){return zc(this,t,null,n)}inYRange(t,n){return zc(this,null,t,n)}getCenterPoint(t){const{x:n,y:r,base:i,horizontal:s}=this.getProps(["x","y","base","horizontal"],t);return{x:s?(n+i)/2:n,y:s?r:(r+i)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}B(va,"id","bar"),B(va,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),B(va,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var IL=Object.freeze({__proto__:null,ArcElement:as,BarElement:va,LineElement:Vn,PointElement:ya});const ff=["rgb(54, 162, 235)","rgb(255, 99, 132)","rgb(255, 159, 64)","rgb(255, 205, 86)","rgb(75, 192, 192)","rgb(153, 102, 255)","rgb(201, 203, 207)"],Rg=ff.map(e=>e.replace("rgb(","rgba(").replace(")",", 0.5)"));function Ob(e){return ff[e%ff.length]}function Ib(e){return Rg[e%Rg.length]}function zL(e,t){return e.borderColor=Ob(t),e.backgroundColor=Ib(t),++t}function FL(e,t){return e.backgroundColor=e.data.map(()=>Ob(t++)),t}function BL(e,t){return e.backgroundColor=e.data.map(()=>Ib(t++)),t}function $L(e){let t=0;return(n,r)=>{const i=e.getDatasetMeta(r).controller;i instanceof Cr?t=FL(n,t):i instanceof js?t=BL(n,t):i&&(t=zL(n,t))}}function Og(e){let t;for(t in e)if(e[t].borderColor||e[t].backgroundColor)return!0;return!1}function VL(e){return e&&(e.borderColor||e.backgroundColor)}function WL(){return Ce.borderColor!=="rgba(0,0,0,0.1)"||Ce.backgroundColor!=="rgba(0,0,0,0.1)"}var UL={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(e,t,n){if(!n.enabled)return;const{data:{datasets:r},options:i}=e.config,{elements:s}=i,o=Og(r)||VL(i)||s&&Og(s)||WL();if(!n.forceOverride&&o)return;const a=$L(e);r.forEach(a)}};function HL(e,t,n,r,i){const s=i.samples||r;if(s>=n)return e.slice(t,t+n);const o=[],a=(n-2)/(s-2);let l=0;const c=t+n-1;let u=t,f,h,p,m,g;for(o[l++]=e[u],f=0;f<s-2;f++){let v=0,x=0,y;const b=Math.floor((f+1)*a)+1+t,k=Math.min(Math.floor((f+2)*a)+1,n)+t,S=k-b;for(y=b;y<k;y++)v+=e[y].x,x+=e[y].y;v/=S,x/=S;const w=Math.floor(f*a)+1+t,E=Math.min(Math.floor((f+1)*a)+1,n)+t,{x:P,y:M}=e[u];for(p=m=-1,y=w;y<E;y++)m=.5*Math.abs((P-v)*(e[y].y-M)-(P-e[y].x)*(x-M)),m>p&&(p=m,h=e[y],g=y);o[l++]=h,u=g}return o[l++]=e[c],o}function YL(e,t,n,r){let i=0,s=0,o,a,l,c,u,f,h,p,m,g;const v=[],x=t+n-1,y=e[t].x,k=e[x].x-y;for(o=t;o<t+n;++o){a=e[o],l=(a.x-y)/k*r,c=a.y;const S=l|0;if(S===u)c<m?(m=c,f=o):c>g&&(g=c,h=o),i=(s*i+a.x)/++s;else{const w=o-1;if(!re(f)&&!re(h)){const E=Math.min(f,h),P=Math.max(f,h);E!==p&&E!==w&&v.push({...e[E],x:i}),P!==p&&P!==w&&v.push({...e[P],x:i})}o>0&&w!==p&&v.push(e[w]),v.push(a),u=S,s=0,m=g=c,f=h=p=o}}return v}function zb(e){if(e._decimated){const t=e._data;delete e._decimated,delete e._data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function Ig(e){e.data.datasets.forEach(t=>{zb(t)})}function KL(e,t){const n=t.length;let r=0,i;const{iScale:s}=e,{min:o,max:a,minDefined:l,maxDefined:c}=s.getUserBounds();return l&&(r=$e(bn(t,s.axis,o).lo,0,n-1)),c?i=$e(bn(t,s.axis,a).hi+1,r,n)-r:i=n-r,{start:r,count:i}}var XL={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(e,t,n)=>{if(!n.enabled){Ig(e);return}const r=e.width;e.data.datasets.forEach((i,s)=>{const{_data:o,indexAxis:a}=i,l=e.getDatasetMeta(s),c=o||i.data;if(ss([a,e.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;const u=e.scales[l.xAxisID];if(u.type!=="linear"&&u.type!=="time"||e.options.parsing)return;let{start:f,count:h}=KL(l,c);const p=n.threshold||4*r;if(h<=p){zb(i);return}re(o)&&(i._data=c,delete i.data,Object.defineProperty(i,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(g){this._data=g}}));let m;switch(n.algorithm){case"lttb":m=HL(c,f,h,r,n);break;case"min-max":m=YL(c,f,h,r);break;default:throw new Error(`Unsupported decimation algorithm '${n.algorithm}'`)}i._decimated=m})},destroy(e){Ig(e)}};function GL(e,t,n){const r=e.segments,i=e.points,s=t.points,o=[];for(const a of r){let{start:l,end:c}=a;c=Ll(l,c,i);const u=df(n,i[l],i[c],a.loop);if(!t.segments){o.push({source:a,target:u,start:i[l],end:i[c]});continue}const f=vb(t,u);for(const h of f){const p=df(n,s[h.start],s[h.end],h.loop),m=yb(a,i,p);for(const g of m)o.push({source:g,target:h,start:{[n]:zg(u,p,"start",Math.max)},end:{[n]:zg(u,p,"end",Math.min)}})}}return o}function df(e,t,n,r){if(r)return;let i=t[e],s=n[e];return e==="angle"&&(i=Ge(i),s=Ge(s)),{property:e,start:i,end:s}}function QL(e,t){const{x:n=null,y:r=null}=e||{},i=t.points,s=[];return t.segments.forEach(({start:o,end:a})=>{a=Ll(o,a,i);const l=i[o],c=i[a];r!==null?(s.push({x:l.x,y:r}),s.push({x:c.x,y:r})):n!==null&&(s.push({x:n,y:l.y}),s.push({x:n,y:c.y}))}),s}function Ll(e,t,n){for(;t>e;t--){const r=n[t];if(!isNaN(r.x)&&!isNaN(r.y))break}return t}function zg(e,t,n,r){return e&&t?r(e[n],t[n]):e?e[n]:t?t[n]:0}function Fb(e,t){let n=[],r=!1;return _e(e)?(r=!0,n=e):n=QL(e,t),n.length?new Vn({points:n,options:{tension:0},_loop:r,_fullLoop:r}):null}function Fg(e){return e&&e.fill!==!1}function qL(e,t,n){let i=e[t].fill;const s=[t];let o;if(!n)return i;for(;i!==!1&&s.indexOf(i)===-1;){if(!Me(i))return i;if(o=e[i],!o)return!1;if(o.visible)return i;s.push(i),i=o.fill}return!1}function JL(e,t,n){const r=nR(e);if(se(r))return isNaN(r.value)?!1:r;let i=parseFloat(r);return Me(i)&&Math.floor(i)===i?ZL(r[0],t,i,n):["origin","start","end","stack","shape"].indexOf(r)>=0&&r}function ZL(e,t,n,r){return(e==="-"||e==="+")&&(n=t+n),n===t||n<0||n>=r?!1:n}function eR(e,t){let n=null;return e==="start"?n=t.bottom:e==="end"?n=t.top:se(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}function tR(e,t,n){let r;return e==="start"?r=n:e==="end"?r=t.options.reverse?t.min:t.max:se(e)?r=e.value:r=t.getBaseValue(),r}function nR(e){const t=e.options,n=t.fill;let r=Z(n&&n.target,n);return r===void 0&&(r=!!t.backgroundColor),r===!1||r===null?!1:r===!0?"origin":r}function rR(e){const{scale:t,index:n,line:r}=e,i=[],s=r.segments,o=r.points,a=iR(t,n);a.push(Fb({x:null,y:t.bottom},r));for(let l=0;l<s.length;l++){const c=s[l];for(let u=c.start;u<=c.end;u++)sR(i,o[u],a)}return new Vn({points:i,options:{}})}function iR(e,t){const n=[],r=e.getMatchingVisibleMetas("line");for(let i=0;i<r.length;i++){const s=r[i];if(s.index===t)break;s.hidden||n.unshift(s.dataset)}return n}function sR(e,t,n){const r=[];for(let i=0;i<n.length;i++){const s=n[i],{first:o,last:a,point:l}=oR(s,t,"x");if(!(!l||o&&a)){if(o)r.unshift(l);else if(e.push(l),!a)break}}e.push(...r)}function oR(e,t,n){const r=e.interpolate(t,n);if(!r)return{};const i=r[n],s=e.segments,o=e.points;let a=!1,l=!1;for(let c=0;c<s.length;c++){const u=s[c],f=o[u.start][n],h=o[u.end][n];if(vn(i,f,h)){a=i===f,l=i===h;break}}return{first:a,last:l,point:r}}class Bb{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,n,r){const{x:i,y:s,radius:o}=this;return n=n||{start:0,end:ke},t.arc(i,s,o,n.end,n.start,!0),!r.bounds}interpolate(t){const{x:n,y:r,radius:i}=this,s=t.angle;return{x:n+Math.cos(s)*i,y:r+Math.sin(s)*i,angle:s}}}function aR(e){const{chart:t,fill:n,line:r}=e;if(Me(n))return lR(t,n);if(n==="stack")return rR(e);if(n==="shape")return!0;const i=cR(e);return i instanceof Bb?i:Fb(i,r)}function lR(e,t){const n=e.getDatasetMeta(t);return n&&e.isDatasetVisible(t)?n.dataset:null}function cR(e){return(e.scale||{}).getPointPositionForValue?fR(e):uR(e)}function uR(e){const{scale:t={},fill:n}=e,r=eR(n,t);if(Me(r)){const i=t.isHorizontal();return{x:i?r:null,y:i?null:r}}return null}function fR(e){const{scale:t,fill:n}=e,r=t.options,i=t.getLabels().length,s=r.reverse?t.max:t.min,o=tR(n,t,s),a=[];if(r.grid.circular){const l=t.getPointPositionForValue(0,s);return new Bb({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(o)})}for(let l=0;l<i;++l)a.push(t.getPointPositionForValue(l,o));return a}function Bc(e,t,n){const r=aR(t),{chart:i,index:s,line:o,scale:a,axis:l}=t,c=o.options,u=c.fill,f=c.backgroundColor,{above:h=f,below:p=f}=u||{},m=i.getDatasetMeta(s),g=bb(i,m);r&&o.points.length&&(Ml(e,n),dR(e,{line:o,target:r,above:h,below:p,area:n,scale:a,axis:l,clip:g}),Tl(e))}function dR(e,t){const{line:n,target:r,above:i,below:s,area:o,scale:a,clip:l}=t,c=n._loop?"angle":t.axis;e.save();let u=s;s!==i&&(c==="x"?(Bg(e,r,o.top),$c(e,{line:n,target:r,color:i,scale:a,property:c,clip:l}),e.restore(),e.save(),Bg(e,r,o.bottom)):c==="y"&&($g(e,r,o.left),$c(e,{line:n,target:r,color:s,scale:a,property:c,clip:l}),e.restore(),e.save(),$g(e,r,o.right),u=i)),$c(e,{line:n,target:r,color:u,scale:a,property:c,clip:l}),e.restore()}function Bg(e,t,n){const{segments:r,points:i}=t;let s=!0,o=!1;e.beginPath();for(const a of r){const{start:l,end:c}=a,u=i[l],f=i[Ll(l,c,i)];s?(e.moveTo(u.x,u.y),s=!1):(e.lineTo(u.x,n),e.lineTo(u.x,u.y)),o=!!t.pathSegment(e,a,{move:o}),o?e.closePath():e.lineTo(f.x,n)}e.lineTo(t.first().x,n),e.closePath(),e.clip()}function $g(e,t,n){const{segments:r,points:i}=t;let s=!0,o=!1;e.beginPath();for(const a of r){const{start:l,end:c}=a,u=i[l],f=i[Ll(l,c,i)];s?(e.moveTo(u.x,u.y),s=!1):(e.lineTo(n,u.y),e.lineTo(u.x,u.y)),o=!!t.pathSegment(e,a,{move:o}),o?e.closePath():e.lineTo(n,f.y)}e.lineTo(n,t.first().y),e.closePath(),e.clip()}function $c(e,t){const{line:n,target:r,property:i,color:s,scale:o,clip:a}=t,l=GL(n,r,i);for(const{source:c,target:u,start:f,end:h}of l){const{style:{backgroundColor:p=s}={}}=c,m=r!==!0;e.save(),e.fillStyle=p,hR(e,o,a,m&&df(i,f,h)),e.beginPath();const g=!!n.pathSegment(e,c);let v;if(m){g?e.closePath():Vg(e,r,h,i);const x=!!r.pathSegment(e,u,{move:g,reverse:!0});v=g&&x,v||Vg(e,r,f,i)}e.closePath(),e.fill(v?"evenodd":"nonzero"),e.restore()}}function hR(e,t,n,r){const i=t.chart.chartArea,{property:s,start:o,end:a}=r||{};if(s==="x"||s==="y"){let l,c,u,f;s==="x"?(l=o,c=i.top,u=a,f=i.bottom):(l=i.left,c=o,u=i.right,f=a),e.beginPath(),n&&(l=Math.max(l,n.left),u=Math.min(u,n.right),c=Math.max(c,n.top),f=Math.min(f,n.bottom)),e.rect(l,c,u-l,f-c),e.clip()}}function Vg(e,t,n,r){const i=t.interpolate(n,r);i&&e.lineTo(i.x,i.y)}var pR={id:"filler",afterDatasetsUpdate(e,t,n){const r=(e.data.datasets||[]).length,i=[];let s,o,a,l;for(o=0;o<r;++o)s=e.getDatasetMeta(o),a=s.dataset,l=null,a&&a.options&&a instanceof Vn&&(l={visible:e.isDatasetVisible(o),index:o,fill:JL(a,o,r),chart:e,axis:s.controller.options.indexAxis,scale:s.vScale,line:a}),s.$filler=l,i.push(l);for(o=0;o<r;++o)l=i[o],!(!l||l.fill===!1)&&(l.fill=qL(i,o,n.propagate))},beforeDraw(e,t,n){const r=n.drawTime==="beforeDraw",i=e.getSortedVisibleDatasetMetas(),s=e.chartArea;for(let o=i.length-1;o>=0;--o){const a=i[o].$filler;a&&(a.line.updateControlPoints(s,a.axis),r&&a.fill&&Bc(e.ctx,a,s))}},beforeDatasetsDraw(e,t,n){if(n.drawTime!=="beforeDatasetsDraw")return;const r=e.getSortedVisibleDatasetMetas();for(let i=r.length-1;i>=0;--i){const s=r[i].$filler;Fg(s)&&Bc(e.ctx,s,e.chartArea)}},beforeDatasetDraw(e,t,n){const r=t.meta.$filler;!Fg(r)||n.drawTime!=="beforeDatasetDraw"||Bc(e.ctx,r,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Wg=(e,t)=>{let{boxHeight:n=t,boxWidth:r=t}=e;return e.usePointStyle&&(n=Math.min(n,t),r=e.pointStyleWidth||Math.min(r,t)),{boxWidth:r,boxHeight:n,itemHeight:Math.max(t,n)}},mR=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class Ug extends Kt{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,n,r){this.maxWidth=t,this.maxHeight=n,this._margins=r,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 n=xe(t.generateLabels,[this.chart],this)||[];t.filter&&(n=n.filter(r=>t.filter(r,this.chart.data))),t.sort&&(n=n.sort((r,i)=>t.sort(r,i,this.chart.data))),this.options.reverse&&n.reverse(),this.legendItems=n}fit(){const{options:t,ctx:n}=this;if(!t.display){this.width=this.height=0;return}const r=t.labels,i=Fe(r.font),s=i.size,o=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=Wg(r,s);let c,u;n.font=i.string,this.isHorizontal()?(c=this.maxWidth,u=this._fitRows(o,s,a,l)+10):(u=this.maxHeight,c=this._fitCols(o,i,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(u,t.maxHeight||this.maxHeight)}_fitRows(t,n,r,i){const{ctx:s,maxWidth:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],u=i+a;let f=t;s.textAlign="left",s.textBaseline="middle";let h=-1,p=-u;return this.legendItems.forEach((m,g)=>{const v=r+n/2+s.measureText(m.text).width;(g===0||c[c.length-1]+v+2*a>o)&&(f+=u,c[c.length-(g>0?0:1)]=0,p+=u,h++),l[g]={left:0,top:p,row:h,width:v,height:i},c[c.length-1]+=v+a}),f}_fitCols(t,n,r,i){const{ctx:s,maxHeight:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],u=o-t;let f=a,h=0,p=0,m=0,g=0;return this.legendItems.forEach((v,x)=>{const{itemWidth:y,itemHeight:b}=gR(r,n,s,v,i);x>0&&p+b+2*a>u&&(f+=h+a,c.push({width:h,height:p}),m+=h+a,g++,h=p=0),l[x]={left:m,top:p,col:g,width:y,height:b},h=Math.max(h,y),p+=b+a}),f+=h,c.push({width:h,height:p}),f}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:r,labels:{padding:i},rtl:s}}=this,o=gi(s,this.left,this.width);if(this.isHorizontal()){let a=0,l=Xe(r,this.left+i,this.right-this.lineWidths[a]);for(const c of n)a!==c.row&&(a=c.row,l=Xe(r,this.left+i,this.right-this.lineWidths[a])),c.top+=this.top+t+i,c.left=o.leftForLtr(o.x(l),c.width),l+=c.width+i}else{let a=0,l=Xe(r,this.top+t+i,this.bottom-this.columnSizes[a].height);for(const c of n)c.col!==a&&(a=c.col,l=Xe(r,this.top+t+i,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+i,c.left=o.leftForLtr(o.x(c.left),c.width),l+=c.height+i}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;Ml(t,this),this._draw(),Tl(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:r,ctx:i}=this,{align:s,labels:o}=t,a=Ce.color,l=gi(t.rtl,this.left,this.width),c=Fe(o.font),{padding:u}=o,f=c.size,h=f/2;let p;this.drawTitle(),i.textAlign=l.textAlign("left"),i.textBaseline="middle",i.lineWidth=.5,i.font=c.string;const{boxWidth:m,boxHeight:g,itemHeight:v}=Wg(o,f),x=function(w,E,P){if(isNaN(m)||m<=0||isNaN(g)||g<0)return;i.save();const M=Z(P.lineWidth,1);if(i.fillStyle=Z(P.fillStyle,a),i.lineCap=Z(P.lineCap,"butt"),i.lineDashOffset=Z(P.lineDashOffset,0),i.lineJoin=Z(P.lineJoin,"miter"),i.lineWidth=M,i.strokeStyle=Z(P.strokeStyle,a),i.setLineDash(Z(P.lineDash,[])),o.usePointStyle){const j={radius:g*Math.SQRT2/2,pointStyle:P.pointStyle,rotation:P.rotation,borderWidth:M},D=l.xPlus(w,m/2),R=E+h;ab(i,j,D,R,o.pointStyleWidth&&m)}else{const j=E+Math.max((f-g)/2,0),D=l.leftForLtr(w,m),R=Er(P.borderRadius);i.beginPath(),Object.values(R).some($=>$!==0)?to(i,{x:D,y:j,w:m,h:g,radius:R}):i.rect(D,j,m,g),i.fill(),M!==0&&i.stroke()}i.restore()},y=function(w,E,P){Ir(i,P.text,w,E+v/2,c,{strikethrough:P.hidden,textAlign:l.textAlign(P.textAlign)})},b=this.isHorizontal(),k=this._computeTitleHeight();b?p={x:Xe(s,this.left+u,this.right-r[0]),y:this.top+u+k,line:0}:p={x:this.left+u,y:Xe(s,this.top+k+u,this.bottom-n[0].height),line:0},mb(this.ctx,t.textDirection);const S=v+u;this.legendItems.forEach((w,E)=>{i.strokeStyle=w.fontColor,i.fillStyle=w.fontColor;const P=i.measureText(w.text).width,M=l.textAlign(w.textAlign||(w.textAlign=o.textAlign)),j=m+h+P;let D=p.x,R=p.y;l.setWidth(this.width),b?E>0&&D+j+u>this.right&&(R=p.y+=S,p.line++,D=p.x=Xe(s,this.left+u,this.right-r[p.line])):E>0&&R+S>this.bottom&&(D=p.x=D+n[p.line].width+u,p.line++,R=p.y=Xe(s,this.top+k+u,this.bottom-n[p.line].height));const $=l.x(D);if(x($,R,w),D=RT(M,D+m+h,b?D+j:this.right,t.rtl),y(l.x(D),R,w),b)p.x+=j+u;else if(typeof w.text!="string"){const X=c.lineHeight;p.y+=$b(w,X)+u}else p.y+=S}),gb(this.ctx,t.textDirection)}drawTitle(){const t=this.options,n=t.title,r=Fe(n.font),i=et(n.padding);if(!n.display)return;const s=gi(t.rtl,this.left,this.width),o=this.ctx,a=n.position,l=r.size/2,c=i.top+l;let u,f=this.left,h=this.width;if(this.isHorizontal())h=Math.max(...this.lineWidths),u=this.top+c,f=Xe(t.align,f,this.right-h);else{const m=this.columnSizes.reduce((g,v)=>Math.max(g,v.height),0);u=c+Xe(t.align,this.top,this.bottom-m-t.labels.padding-this._computeTitleHeight())}const p=Xe(a,f,f+h);o.textAlign=s.textAlign(Hd(a)),o.textBaseline="middle",o.strokeStyle=n.color,o.fillStyle=n.color,o.font=r.string,Ir(o,n.text,p,u,r)}_computeTitleHeight(){const t=this.options.title,n=Fe(t.font),r=et(t.padding);return t.display?n.lineHeight+r.height:0}_getLegendItemAt(t,n){let r,i,s;if(vn(t,this.left,this.right)&&vn(n,this.top,this.bottom)){for(s=this.legendHitBoxes,r=0;r<s.length;++r)if(i=s[r],vn(t,i.left,i.left+i.width)&&vn(n,i.top,i.top+i.height))return this.legendItems[r]}return null}handleEvent(t){const n=this.options;if(!vR(t.type,n))return;const r=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const i=this._hoveredItem,s=mR(i,r);i&&!s&&xe(n.onLeave,[t,i,this],this),this._hoveredItem=r,r&&!s&&xe(n.onHover,[t,r,this],this)}else r&&xe(n.onClick,[t,r,this],this)}}function gR(e,t,n,r,i){const s=xR(r,e,t,n),o=yR(i,r,t.lineHeight);return{itemWidth:s,itemHeight:o}}function xR(e,t,n,r){let i=e.text;return i&&typeof i!="string"&&(i=i.reduce((s,o)=>s.length>o.length?s:o)),t+n.size/2+r.measureText(i).width}function yR(e,t,n){let r=e;return typeof t.text!="string"&&(r=$b(t,n)),r}function $b(e,t){const n=e.text?e.text.length:0;return t*n}function vR(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var bR={id:"legend",_element:Ug,start(e,t,n){const r=e.legend=new Ug({ctx:e.ctx,options:n,chart:e});Je.configure(e,r,n),Je.addBox(e,r)},stop(e){Je.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const r=e.legend;Je.configure(e,r,n),r.options=n},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,n){const r=t.datasetIndex,i=n.chart;i.isDatasetVisible(r)?(i.hide(r),t.hidden=!0):(i.show(r),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:n,pointStyle:r,textAlign:i,color:s,useBorderRadius:o,borderRadius:a}}=e.legend.options;return e._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(n?0:void 0),u=et(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:s,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:r||c.pointStyle,rotation:c.rotation,textAlign:i||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 eh extends Kt{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,n){const r=this.options;if(this.left=0,this.top=0,!r.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=n;const i=_e(r.text)?r.text.length:1;this._padding=et(r.padding);const s=i*Fe(r.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=s:this.width=s}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:n,left:r,bottom:i,right:s,options:o}=this,a=o.align;let l=0,c,u,f;return this.isHorizontal()?(u=Xe(a,r,s),f=n+t,c=s-r):(o.position==="left"?(u=r+t,f=Xe(a,i,n),l=ue*-.5):(u=s-t,f=Xe(a,n,i),l=ue*.5),c=i-n),{titleX:u,titleY:f,maxWidth:c,rotation:l}}draw(){const t=this.ctx,n=this.options;if(!n.display)return;const r=Fe(n.font),s=r.lineHeight/2+this._padding.top,{titleX:o,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(s);Ir(t,n.text,0,0,r,{color:n.color,maxWidth:l,rotation:c,textAlign:Hd(n.align),textBaseline:"middle",translation:[o,a]})}}function wR(e,t){const n=new eh({ctx:e.ctx,options:t,chart:e});Je.configure(e,n,t),Je.addBox(e,n),e.titleBlock=n}var kR={id:"title",_element:eh,start(e,t,n){wR(e,n)},stop(e){const t=e.titleBlock;Je.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){const r=e.titleBlock;Je.configure(e,r,n),r.options=n},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 Ko=new WeakMap;var SR={id:"subtitle",start(e,t,n){const r=new eh({ctx:e.ctx,options:n,chart:e});Je.configure(e,r,n),Je.addBox(e,r),Ko.set(e,r)},stop(e){Je.removeBox(e,Ko.get(e)),Ko.delete(e)},beforeUpdate(e,t,n){const r=Ko.get(e);Je.configure(e,r,n),r.options=n},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const ls={average(e){if(!e.length)return!1;let t,n,r=new Set,i=0,s=0;for(t=0,n=e.length;t<n;++t){const a=e[t].element;if(a&&a.hasValue()){const l=a.tooltipPosition();r.add(l.x),i+=l.y,++s}}return s===0||r.size===0?!1:{x:[...r].reduce((a,l)=>a+l)/r.size,y:i/s}},nearest(e,t){if(!e.length)return!1;let n=t.x,r=t.y,i=Number.POSITIVE_INFINITY,s,o,a;for(s=0,o=e.length;s<o;++s){const l=e[s].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),u=rf(t,c);u<i&&(i=u,a=l)}}if(a){const l=a.tooltipPosition();n=l.x,r=l.y}return{x:n,y:r}}};function qt(e,t){return t&&(_e(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function hn(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(`
119
119
  `)>-1?e.split(`
120
- `):e}function _R(e,t){const{element:n,datasetIndex:r,index:i}=t,s=e.getDatasetMeta(r).controller,{label:o,value:a}=s.getLabelAndValue(i);return{chart:e,label:o,parsed:s.getParsed(i),raw:e.data.datasets[r].data[i],formattedValue:a,dataset:s.getDataset(),dataIndex:i,datasetIndex:r,element:n}}function Hg(e,t){const n=e.chart.ctx,{body:r,footer:i,title:s}=e,{boxWidth:o,boxHeight:a}=t,l=Fe(t.bodyFont),c=Fe(t.titleFont),u=Fe(t.footerFont),f=s.length,h=i.length,p=r.length,m=et(t.padding);let g=m.height,v=0,x=r.reduce((k,S)=>k+S.before.length+S.lines.length+S.after.length,0);if(x+=e.beforeBody.length+e.afterBody.length,f&&(g+=f*c.lineHeight+(f-1)*t.titleSpacing+t.titleMarginBottom),x){const k=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;g+=p*k+(x-p)*l.lineHeight+(x-1)*t.bodySpacing}h&&(g+=t.footerMarginTop+h*u.lineHeight+(h-1)*t.footerSpacing);let y=0;const b=function(k){v=Math.max(v,n.measureText(k).width+y)};return n.save(),n.font=c.string,fe(e.title,b),n.font=l.string,fe(e.beforeBody.concat(e.afterBody),b),y=t.displayColors?o+2+t.boxPadding:0,fe(r,k=>{fe(k.before,b),fe(k.lines,b),fe(k.after,b)}),y=0,n.font=u.string,fe(e.footer,b),n.restore(),v+=m.width,{width:v,height:g}}function CR(e,t){const{y:n,height:r}=t;return n<r/2?"top":n>e.height-r/2?"bottom":"center"}function NR(e,t,n,r){const{x:i,width:s}=r,o=n.caretSize+n.caretPadding;if(e==="left"&&i+s+o>t.width||e==="right"&&i-s-o<0)return!0}function jR(e,t,n,r){const{x:i,width:s}=n,{width:o,chartArea:{left:a,right:l}}=e;let c="center";return r==="center"?c=i<=(a+l)/2?"left":"right":i<=s/2?c="left":i>=o-s/2&&(c="right"),NR(c,e,t,n)&&(c="center"),c}function Yg(e,t,n){const r=n.yAlign||t.yAlign||CR(e,n);return{xAlign:n.xAlign||t.xAlign||jR(e,t,n,r),yAlign:r}}function ER(e,t){let{x:n,width:r}=e;return t==="right"?n-=r:t==="center"&&(n-=r/2),n}function PR(e,t,n){let{y:r,height:i}=e;return t==="top"?r+=n:t==="bottom"?r-=i+n:r-=i/2,r}function Kg(e,t,n,r){const{caretSize:i,caretPadding:s,cornerRadius:o}=e,{xAlign:a,yAlign:l}=n,c=i+s,{topLeft:u,topRight:f,bottomLeft:h,bottomRight:p}=Er(o);let m=ER(t,a);const g=PR(t,l,c);return l==="center"?a==="left"?m+=c:a==="right"&&(m-=c):a==="left"?m-=Math.max(u,h)+i:a==="right"&&(m+=Math.max(f,p)+i),{x:$e(m,0,r.width-t.width),y:$e(g,0,r.height-t.height)}}function Xo(e,t,n){const r=et(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-r.right:e.x+r.left}function Xg(e){return qt([],hn(e))}function MR(e,t,n){return cr(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function Gg(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const Vb={beforeTitle:fn,title(e){if(e.length>0){const t=e[0],n=t.chart.data.labels,r=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(r>0&&t.dataIndex<r)return n[t.dataIndex]}return""},afterTitle:fn,beforeBody:fn,beforeLabel:fn,label(e){if(this&&this.options&&this.options.mode==="dataset")return e.label+": "+e.formattedValue||e.formattedValue;let t=e.dataset.label||"";t&&(t+=": ");const n=e.formattedValue;return re(n)||(t+=n),t},labelColor(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{borderColor:n.borderColor,backgroundColor:n.backgroundColor,borderWidth:n.borderWidth,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:n.pointStyle,rotation:n.rotation}},afterLabel:fn,afterBody:fn,beforeFooter:fn,footer:fn,afterFooter:fn};function lt(e,t,n,r){const i=e[t].call(n,r);return typeof i>"u"?Vb[t].call(n,r):i}class hf extends Kt{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 n=this.chart,r=this.options.setContext(this.getContext()),i=r.enabled&&n.options.animation&&r.animations,s=new wb(this.chart,i);return i._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=MR(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:r}=n,i=lt(r,"beforeTitle",this,t),s=lt(r,"title",this,t),o=lt(r,"afterTitle",this,t);let a=[];return a=qt(a,hn(i)),a=qt(a,hn(s)),a=qt(a,hn(o)),a}getBeforeBody(t,n){return Xg(lt(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:r}=n,i=[];return fe(t,s=>{const o={before:[],lines:[],after:[]},a=Gg(r,s);qt(o.before,hn(lt(a,"beforeLabel",this,s))),qt(o.lines,lt(a,"label",this,s)),qt(o.after,hn(lt(a,"afterLabel",this,s))),i.push(o)}),i}getAfterBody(t,n){return Xg(lt(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:r}=n,i=lt(r,"beforeFooter",this,t),s=lt(r,"footer",this,t),o=lt(r,"afterFooter",this,t);let a=[];return a=qt(a,hn(i)),a=qt(a,hn(s)),a=qt(a,hn(o)),a}_createItems(t){const n=this._active,r=this.chart.data,i=[],s=[],o=[];let a=[],l,c;for(l=0,c=n.length;l<c;++l)a.push(_R(this.chart,n[l]));return t.filter&&(a=a.filter((u,f,h)=>t.filter(u,f,h,r))),t.itemSort&&(a=a.sort((u,f)=>t.itemSort(u,f,r))),fe(a,u=>{const f=Gg(t.callbacks,u);i.push(lt(f,"labelColor",this,u)),s.push(lt(f,"labelPointStyle",this,u)),o.push(lt(f,"labelTextColor",this,u))}),this.labelColors=i,this.labelPointStyles=s,this.labelTextColors=o,this.dataPoints=a,a}update(t,n){const r=this.options.setContext(this.getContext()),i=this._active;let s,o=[];if(!i.length)this.opacity!==0&&(s={opacity:0});else{const a=ls[r.position].call(this,i,this._eventPosition);o=this._createItems(r),this.title=this.getTitle(o,r),this.beforeBody=this.getBeforeBody(o,r),this.body=this.getBody(o,r),this.afterBody=this.getAfterBody(o,r),this.footer=this.getFooter(o,r);const l=this._size=Hg(this,r),c=Object.assign({},a,l),u=Yg(this.chart,r,c),f=Kg(r,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,s={opacity:1,x:f.x,y:f.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=o,this.$context=void 0,s&&this._resolveAnimations().update(this,s),t&&r.external&&r.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(t,n,r,i){const s=this.getCaretPosition(t,r,i);n.lineTo(s.x1,s.y1),n.lineTo(s.x2,s.y2),n.lineTo(s.x3,s.y3)}getCaretPosition(t,n,r){const{xAlign:i,yAlign:s}=this,{caretSize:o,cornerRadius:a}=r,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:f}=Er(a),{x:h,y:p}=t,{width:m,height:g}=n;let v,x,y,b,k,S;return s==="center"?(k=p+g/2,i==="left"?(v=h,x=v-o,b=k+o,S=k-o):(v=h+m,x=v+o,b=k-o,S=k+o),y=v):(i==="left"?x=h+Math.max(l,u)+o:i==="right"?x=h+m-Math.max(c,f)-o:x=this.caretX,s==="top"?(b=p,k=b-o,v=x-o,y=x+o):(b=p+g,k=b+o,v=x+o,y=x-o),S=b),{x1:v,x2:x,x3:y,y1:b,y2:k,y3:S}}drawTitle(t,n,r){const i=this.title,s=i.length;let o,a,l;if(s){const c=gi(r.rtl,this.x,this.width);for(t.x=Xo(this,r.titleAlign,r),n.textAlign=c.textAlign(r.titleAlign),n.textBaseline="middle",o=Fe(r.titleFont),a=r.titleSpacing,n.fillStyle=r.titleColor,n.font=o.string,l=0;l<s;++l)n.fillText(i[l],c.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+a,l+1===s&&(t.y+=r.titleMarginBottom-a)}}_drawColorBox(t,n,r,i,s){const o=this.labelColors[r],a=this.labelPointStyles[r],{boxHeight:l,boxWidth:c}=s,u=Fe(s.bodyFont),f=Xo(this,"left",s),h=i.x(f),p=l<u.lineHeight?(u.lineHeight-l)/2:0,m=n.y+p;if(s.usePointStyle){const g={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},v=i.leftForLtr(h,c)+c/2,x=m+l/2;t.strokeStyle=s.multiKeyBackground,t.fillStyle=s.multiKeyBackground,of(t,g,v,x),t.strokeStyle=o.borderColor,t.fillStyle=o.backgroundColor,of(t,g,v,x)}else{t.lineWidth=se(o.borderWidth)?Math.max(...Object.values(o.borderWidth)):o.borderWidth||1,t.strokeStyle=o.borderColor,t.setLineDash(o.borderDash||[]),t.lineDashOffset=o.borderDashOffset||0;const g=i.leftForLtr(h,c),v=i.leftForLtr(i.xPlus(h,1),c-2),x=Er(o.borderRadius);Object.values(x).some(y=>y!==0)?(t.beginPath(),t.fillStyle=s.multiKeyBackground,to(t,{x:g,y:m,w:c,h:l,radius:x}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),to(t,{x:v,y:m+1,w:c-2,h:l-2,radius:x}),t.fill()):(t.fillStyle=s.multiKeyBackground,t.fillRect(g,m,c,l),t.strokeRect(g,m,c,l),t.fillStyle=o.backgroundColor,t.fillRect(v,m+1,c-2,l-2))}t.fillStyle=this.labelTextColors[r]}drawBody(t,n,r){const{body:i}=this,{bodySpacing:s,bodyAlign:o,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:u}=r,f=Fe(r.bodyFont);let h=f.lineHeight,p=0;const m=gi(r.rtl,this.x,this.width),g=function(P){n.fillText(P,m.x(t.x+p),t.y+h/2),t.y+=h+s},v=m.textAlign(o);let x,y,b,k,S,w,E;for(n.textAlign=o,n.textBaseline="middle",n.font=f.string,t.x=Xo(this,v,r),n.fillStyle=r.bodyColor,fe(this.beforeBody,g),p=a&&v!=="right"?o==="center"?c/2+u:c+2+u:0,k=0,w=i.length;k<w;++k){for(x=i[k],y=this.labelTextColors[k],n.fillStyle=y,fe(x.before,g),b=x.lines,a&&b.length&&(this._drawColorBox(n,t,k,m,r),h=Math.max(f.lineHeight,l)),S=0,E=b.length;S<E;++S)g(b[S]),h=f.lineHeight;fe(x.after,g)}p=0,h=f.lineHeight,fe(this.afterBody,g),t.y-=s}drawFooter(t,n,r){const i=this.footer,s=i.length;let o,a;if(s){const l=gi(r.rtl,this.x,this.width);for(t.x=Xo(this,r.footerAlign,r),t.y+=r.footerMarginTop,n.textAlign=l.textAlign(r.footerAlign),n.textBaseline="middle",o=Fe(r.footerFont),n.fillStyle=r.footerColor,n.font=o.string,a=0;a<s;++a)n.fillText(i[a],l.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+r.footerSpacing}}drawBackground(t,n,r,i){const{xAlign:s,yAlign:o}=this,{x:a,y:l}=t,{width:c,height:u}=r,{topLeft:f,topRight:h,bottomLeft:p,bottomRight:m}=Er(i.cornerRadius);n.fillStyle=i.backgroundColor,n.strokeStyle=i.borderColor,n.lineWidth=i.borderWidth,n.beginPath(),n.moveTo(a+f,l),o==="top"&&this.drawCaret(t,n,r,i),n.lineTo(a+c-h,l),n.quadraticCurveTo(a+c,l,a+c,l+h),o==="center"&&s==="right"&&this.drawCaret(t,n,r,i),n.lineTo(a+c,l+u-m),n.quadraticCurveTo(a+c,l+u,a+c-m,l+u),o==="bottom"&&this.drawCaret(t,n,r,i),n.lineTo(a+p,l+u),n.quadraticCurveTo(a,l+u,a,l+u-p),o==="center"&&s==="left"&&this.drawCaret(t,n,r,i),n.lineTo(a,l+f),n.quadraticCurveTo(a,l,a+f,l),n.closePath(),n.fill(),i.borderWidth>0&&n.stroke()}_updateAnimationTarget(t){const n=this.chart,r=this.$animations,i=r&&r.x,s=r&&r.y;if(i||s){const o=ls[t.position].call(this,this._active,this._eventPosition);if(!o)return;const a=this._size=Hg(this,t),l=Object.assign({},o,this._size),c=Yg(n,t,l),u=Kg(t,l,c,n);(i._to!==u.x||s._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 n=this.options.setContext(this.getContext());let r=this.opacity;if(!r)return;this._updateAnimationTarget(n);const i={width:this.width,height:this.height},s={x:this.x,y:this.y};r=Math.abs(r)<.001?0:r;const o=et(n.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&a&&(t.save(),t.globalAlpha=r,this.drawBackground(s,t,i,n),mb(t,n.textDirection),s.y+=o.top,this.drawTitle(s,t,n),this.drawBody(s,t,n),this.drawFooter(s,t,n),gb(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){const r=this._active,i=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}}),s=!qa(r,i),o=this._positionChanged(i,n);(s||o)&&(this._active=i,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,n,r=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const i=this.options,s=this._active||[],o=this._getActiveElements(t,s,n,r),a=this._positionChanged(o,t),l=n||!qa(o,s)||a;return l&&(this._active=o,(i.enabled||i.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,n))),l}_getActiveElements(t,n,r,i){const s=this.options;if(t.type==="mouseout")return[];if(!i)return n.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,s.mode,s,r);return s.reverse&&o.reverse(),o}_positionChanged(t,n){const{caretX:r,caretY:i,options:s}=this,o=ls[s.position].call(this,t,n);return o!==!1&&(r!==o.x||i!==o.y)}}B(hf,"positioners",ls);var TR={id:"tooltip",_element:hf,positioners:ls,afterInit(e,t,n){n&&(e.tooltip=new hf({chart:e,options:n}))},beforeUpdate(e,t,n){e.tooltip&&e.tooltip.initialize(n)},reset(e,t,n){e.tooltip&&e.tooltip.initialize(n)},afterDraw(e){const t=e.tooltip;if(t&&t._willRender()){const n={tooltip:t};if(e.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0})===!1)return;t.draw(e.ctx),e.notifyPlugins("afterTooltipDraw",n)}},afterEvent(e,t){if(e.tooltip){const n=t.replay;e.tooltip.handleEvent(t.event,n,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:Vb},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"]},DR=Object.freeze({__proto__:null,Colors:UL,Decimation:XL,Filler:pR,Legend:bR,SubTitle:SR,Title:kR,Tooltip:TR});const AR=(e,t,n,r)=>(typeof t=="string"?(n=e.push(t)-1,r.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function LR(e,t,n,r){const i=e.indexOf(t);if(i===-1)return AR(e,t,n,r);const s=e.lastIndexOf(t);return i!==s?n:i}const RR=(e,t)=>e===null?null:$e(Math.round(e),0,t);function Qg(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class pf extends Vr{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const n=this._addedLabels;if(n.length){const r=this.getLabels();for(const{index:i,label:s}of n)r[i]===s&&r.splice(i,1);this._addedLabels=[]}super.init(t)}parse(t,n){if(re(t))return null;const r=this.getLabels();return n=isFinite(n)&&r[n]===t?n:LR(r,t,Z(n,t),this._addedLabels),RR(n,r.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let{min:r,max:i}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(r=0),n||(i=this.getLabels().length-1)),this.min=r,this.max=i}buildTicks(){const t=this.min,n=this.max,r=this.options.offset,i=[];let s=this.getLabels();s=t===0&&n===s.length-1?s:s.slice(t,n+1),this._valueRange=Math.max(s.length-(r?0:1),1),this._startValue=this.min-(r?.5:0);for(let o=t;o<=n;o++)i.push({value:o});return i}getLabelForValue(t){return Qg.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}B(pf,"id","category"),B(pf,"defaults",{ticks:{callback:Qg}});function OR(e,t){const n=[],{bounds:i,step:s,min:o,max:a,precision:l,count:c,maxTicks:u,maxDigits:f,includeBounds:h}=e,p=s||1,m=u-1,{min:g,max:v}=t,x=!re(o),y=!re(a),b=!re(c),k=(v-g)/(f+1);let S=Hm((v-g)/m/p)*p,w,E,P,M;if(S<1e-14&&!x&&!y)return[{value:g},{value:v}];M=Math.ceil(v/S)-Math.floor(g/S),M>m&&(S=Hm(M*S/m/p)*p),re(l)||(w=Math.pow(10,l),S=Math.ceil(S*w)/w),i==="ticks"?(E=Math.floor(g/S)*S,P=Math.ceil(v/S)*S):(E=g,P=v),x&&y&&s&&ET((a-o)/s,S/1e3)?(M=Math.round(Math.min((a-o)/S,u)),S=(a-o)/M,E=o,P=a):b?(E=x?o:E,P=y?a:P,M=c-1,S=(P-E)/M):(M=(P-E)/S,_s(M,Math.round(M),S/1e3)?M=Math.round(M):M=Math.ceil(M));const j=Math.max(Ym(S),Ym(E));w=Math.pow(10,re(l)?j:l),E=Math.round(E*w)/w,P=Math.round(P*w)/w;let D=0;for(x&&(h&&E!==o?(n.push({value:o}),E<o&&D++,_s(Math.round((E+D*S)*w)/w,o,qg(o,k,e))&&D++):E<o&&D++);D<M;++D){const R=Math.round((E+D*S)*w)/w;if(y&&R>a)break;n.push({value:R})}return y&&h&&P!==a?n.length&&_s(n[n.length-1].value,a,qg(a,k,e))?n[n.length-1].value=a:n.push({value:a}):(!y||P===a)&&n.push({value:P}),n}function qg(e,t,{horizontal:n,minRotation:r}){const i=$t(r),s=(n?Math.sin(i):Math.cos(i))||.001,o=.75*t*(""+e).length;return Math.min(t/s,o)}class il extends Vr{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,n){return re(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:n,maxDefined:r}=this.getUserBounds();let{min:i,max:s}=this;const o=l=>i=n?i:l,a=l=>s=r?s:l;if(t){const l=on(i),c=on(s);l<0&&c<0?a(0):l>0&&c>0&&o(0)}if(i===s){let l=s===0?1:Math.abs(s*.05);a(s+l),t||o(i-l)}this.min=i,this.max=s}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:n,stepSize:r}=t,i;return r?(i=Math.ceil(this.max/r)-Math.floor(this.min/r)+1,i>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${r} would result generating up to ${i} ticks. Limiting to 1000.`),i=1e3)):(i=this.computeTickLimit(),n=n||11),n&&(i=Math.min(n,i)),i}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,n=t.ticks;let r=this.getTickLimit();r=Math.max(2,r);const i={maxTicks:r,bounds:t.bounds,min:t.min,max:t.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},s=this._range||this,o=OR(i,s);return t.bounds==="ticks"&&Jv(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 n=this.min,r=this.max;if(super.configure(),this.options.offset&&t.length){const i=(r-n)/Math.max(t.length-1,1)/2;n-=i,r+=i}this._startValue=n,this._endValue=r,this._valueRange=r-n}getLabelForValue(t){return mo(t,this.chart.options.locale,this.options.ticks.format)}}class mf extends il{determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=Me(t)?t:0,this.max=Me(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,r=$t(this.options.ticks.minRotation),i=(t?Math.sin(r):Math.cos(r))||.001,s=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,s.lineHeight/i))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}B(mf,"id","linear"),B(mf,"defaults",{ticks:{callback:Pl.formatters.numeric}});const ro=e=>Math.floor(Bn(e)),mr=(e,t)=>Math.pow(10,ro(e)+t);function Jg(e){return e/Math.pow(10,ro(e))===1}function Zg(e,t,n){const r=Math.pow(10,n),i=Math.floor(e/r);return Math.ceil(t/r)-i}function IR(e,t){const n=t-e;let r=ro(n);for(;Zg(e,t,r)>10;)r++;for(;Zg(e,t,r)<10;)r--;return Math.min(r,ro(e))}function zR(e,{min:t,max:n}){t=bt(e.min,t);const r=[],i=ro(t);let s=IR(t,n),o=s<0?Math.pow(10,Math.abs(s)):1;const a=Math.pow(10,s),l=i>s?Math.pow(10,i):0,c=Math.round((t-l)*o)/o,u=Math.floor((t-l)/a/10)*a*10;let f=Math.floor((c-u)/Math.pow(10,s)),h=bt(e.min,Math.round((l+u+f*Math.pow(10,s))*o)/o);for(;h<n;)r.push({value:h,major:Jg(h),significand:f}),f>=10?f=f<15?15:20:f++,f>=20&&(s++,f=2,o=s>=0?1:o),h=Math.round((l+u+f*Math.pow(10,s))*o)/o;const p=bt(e.max,h);return r.push({value:p,major:Jg(p),significand:f}),r}class gf extends Vr{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,n){const r=il.prototype.parse.apply(this,[t,n]);if(r===0){this._zero=!0;return}return Me(r)&&r>0?r:null}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=Me(t)?Math.max(0,t):null,this.max=Me(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!Me(this._userMin)&&(this.min=t===mr(this.min,0)?mr(this.min,-1):mr(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let r=this.min,i=this.max;const s=a=>r=t?r:a,o=a=>i=n?i:a;r===i&&(r<=0?(s(1),o(10)):(s(mr(r,-1)),o(mr(i,1)))),r<=0&&s(mr(i,-1)),i<=0&&o(mr(r,1)),this.min=r,this.max=i}buildTicks(){const t=this.options,n={min:this._userMin,max:this._userMax},r=zR(n,this);return t.bounds==="ticks"&&Jv(r,this,"value"),t.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}getLabelForValue(t){return t===void 0?"0":mo(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Bn(t),this._valueRange=Bn(this.max)-Bn(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Bn(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const n=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+n*this._valueRange)}}B(gf,"id","logarithmic"),B(gf,"defaults",{ticks:{callback:Pl.formatters.logarithmic,major:{enabled:!0}}});function xf(e){const t=e.ticks;if(t.display&&e.display){const n=et(t.backdropPadding);return Z(t.font&&t.font.size,Ce.font.size)+n.height}return 0}function FR(e,t,n){return n=_e(n)?n:[n],{w:HT(e,t.string,n),h:n.length*t.lineHeight}}function ex(e,t,n,r,i){return e===r||e===i?{start:t-n/2,end:t+n/2}:e<r||e>i?{start:t-n,end:t}:{start:t,end:t+n}}function BR(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},n=Object.assign({},t),r=[],i=[],s=e._pointLabels.length,o=e.options.pointLabels,a=o.centerPointLabels?ue/s:0;for(let l=0;l<s;l++){const c=o.setContext(e.getPointLabelContext(l));i[l]=c.padding;const u=e.getPointPosition(l,e.drawingArea+i[l],a),f=Fe(c.font),h=FR(e.ctx,f,e._pointLabels[l]);r[l]=h;const p=Ge(e.getIndexAngle(l)+a),m=Math.round(Wd(p)),g=ex(m,u.x,h.w,0,180),v=ex(m,u.y,h.h,90,270);$R(n,t,p,g,v)}e.setCenterPoint(t.l-n.l,n.r-t.r,t.t-n.t,n.b-t.b),e._pointLabelItems=UR(e,r,i)}function $R(e,t,n,r,i){const s=Math.abs(Math.sin(n)),o=Math.abs(Math.cos(n));let a=0,l=0;r.start<t.l?(a=(t.l-r.start)/s,e.l=Math.min(e.l,t.l-a)):r.end>t.r&&(a=(r.end-t.r)/s,e.r=Math.max(e.r,t.r+a)),i.start<t.t?(l=(t.t-i.start)/o,e.t=Math.min(e.t,t.t-l)):i.end>t.b&&(l=(i.end-t.b)/o,e.b=Math.max(e.b,t.b+l))}function VR(e,t,n){const r=e.drawingArea,{extra:i,additionalAngle:s,padding:o,size:a}=n,l=e.getPointPosition(t,r+i+o,s),c=Math.round(Wd(Ge(l.angle+De))),u=KR(l.y,a.h,c),f=HR(c),h=YR(l.x,a.w,f);return{visible:!0,x:l.x,y:u,textAlign:f,left:h,top:u,right:h+a.w,bottom:u+a.h}}function WR(e,t){if(!t)return!0;const{left:n,top:r,right:i,bottom:s}=e;return!(wn({x:n,y:r},t)||wn({x:n,y:s},t)||wn({x:i,y:r},t)||wn({x:i,y:s},t))}function UR(e,t,n){const r=[],i=e._pointLabels.length,s=e.options,{centerPointLabels:o,display:a}=s.pointLabels,l={extra:xf(s)/2,additionalAngle:o?ue/i:0};let c;for(let u=0;u<i;u++){l.padding=n[u],l.size=t[u];const f=VR(e,u,l);r.push(f),a==="auto"&&(f.visible=WR(f,c),f.visible&&(c=f))}return r}function HR(e){return e===0||e===180?"center":e<180?"left":"right"}function YR(e,t,n){return n==="right"?e-=t:n==="center"&&(e-=t/2),e}function KR(e,t,n){return n===90||n===270?e-=t/2:(n>270||n<90)&&(e-=t),e}function XR(e,t,n){const{left:r,top:i,right:s,bottom:o}=n,{backdropColor:a}=t;if(!re(a)){const l=Er(t.borderRadius),c=et(t.backdropPadding);e.fillStyle=a;const u=r-c.left,f=i-c.top,h=s-r+c.width,p=o-i+c.height;Object.values(l).some(m=>m!==0)?(e.beginPath(),to(e,{x:u,y:f,w:h,h:p,radius:l}),e.fill()):e.fillRect(u,f,h,p)}}function GR(e,t){const{ctx:n,options:{pointLabels:r}}=e;for(let i=t-1;i>=0;i--){const s=e._pointLabelItems[i];if(!s.visible)continue;const o=r.setContext(e.getPointLabelContext(i));XR(n,o,s);const a=Fe(o.font),{x:l,y:c,textAlign:u}=s;Ir(n,e._pointLabels[i],l,c+a.lineHeight/2,a,{color:o.color,textAlign:u,textBaseline:"middle"})}}function Wb(e,t,n,r){const{ctx:i}=e;if(n)i.arc(e.xCenter,e.yCenter,t,0,ke);else{let s=e.getPointPosition(0,t);i.moveTo(s.x,s.y);for(let o=1;o<r;o++)s=e.getPointPosition(o,t),i.lineTo(s.x,s.y)}}function QR(e,t,n,r,i){const s=e.ctx,o=t.circular,{color:a,lineWidth:l}=t;!o&&!r||!a||!l||n<0||(s.save(),s.strokeStyle=a,s.lineWidth=l,s.setLineDash(i.dash||[]),s.lineDashOffset=i.dashOffset,s.beginPath(),Wb(e,n,o,r),s.closePath(),s.stroke(),s.restore())}function qR(e,t,n){return cr(e,{label:n,index:t,type:"pointLabel"})}class cs extends il{constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this._padding=et(xf(this.options)/2),n=this.width=this.maxWidth-t.width,r=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+n/2+t.left),this.yCenter=Math.floor(this.top+r/2+t.top),this.drawingArea=Math.floor(Math.min(n,r)/2)}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!1);this.min=Me(t)&&!isNaN(t)?t:0,this.max=Me(n)&&!isNaN(n)?n:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/xf(this.options))}generateTickLabels(t){il.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((n,r)=>{const i=xe(this.options.pointLabels.callback,[n,r],this);return i||i===0?i:""}).filter((n,r)=>this.chart.getDataVisibility(r))}fit(){const t=this.options;t.display&&t.pointLabels.display?BR(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,n,r,i){this.xCenter+=Math.floor((t-n)/2),this.yCenter+=Math.floor((r-i)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,n,r,i))}getIndexAngle(t){const n=ke/(this._pointLabels.length||1),r=this.options.startAngle||0;return Ge(t*n+$t(r))}getDistanceFromCenterForValue(t){if(re(t))return NaN;const n=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*n:(t-this.min)*n}getValueForDistanceFromCenter(t){if(re(t))return NaN;const n=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-n:this.min+n}getPointLabelContext(t){const n=this._pointLabels||[];if(t>=0&&t<n.length){const r=n[t];return qR(this.getContext(),t,r)}}getPointPosition(t,n,r=0){const i=this.getIndexAngle(t)-De+r;return{x:Math.cos(i)*n+this.xCenter,y:Math.sin(i)*n+this.yCenter,angle:i}}getPointPositionForValue(t,n){return this.getPointPosition(t,this.getDistanceFromCenterForValue(n))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:n,top:r,right:i,bottom:s}=this._pointLabelItems[t];return{left:n,top:r,right:i,bottom:s}}drawBackground(){const{backgroundColor:t,grid:{circular:n}}=this.options;if(t){const r=this.ctx;r.save(),r.beginPath(),Wb(this,this.getDistanceFromCenterForValue(this._endValue),n,this._pointLabels.length),r.closePath(),r.fillStyle=t,r.fill(),r.restore()}}drawGrid(){const t=this.ctx,n=this.options,{angleLines:r,grid:i,border:s}=n,o=this._pointLabels.length;let a,l,c;if(n.pointLabels.display&&GR(this,o),i.display&&this.ticks.forEach((u,f)=>{if(f!==0||f===0&&this.min<0){l=this.getDistanceFromCenterForValue(u.value);const h=this.getContext(f),p=i.setContext(h),m=s.setContext(h);QR(this,p,l,o,m)}}),r.display){for(t.save(),a=o-1;a>=0;a--){const u=r.setContext(this.getPointLabelContext(a)),{color:f,lineWidth:h}=u;!h||!f||(t.lineWidth=h,t.strokeStyle=f,t.setLineDash(u.borderDash),t.lineDashOffset=u.borderDashOffset,l=this.getDistanceFromCenterForValue(n.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,n=this.options,r=n.ticks;if(!r.display)return;const i=this.getIndexAngle(0);let s,o;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(i),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&this.min>=0&&!n.reverse)return;const c=r.setContext(this.getContext(l)),u=Fe(c.font);if(s=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=u.string,o=t.measureText(a.label).width,t.fillStyle=c.backdropColor;const f=et(c.backdropPadding);t.fillRect(-o/2-f.left,-s-u.size/2-f.top,o+f.width,u.size+f.height)}Ir(t,a.label,0,-s,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}B(cs,"id","radialLinear"),B(cs,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Pl.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),B(cs,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),B(cs,"descriptors",{angleLines:{_fallback:"grid"}});const Rl={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}},ft=Object.keys(Rl);function tx(e,t){return e-t}function nx(e,t){if(re(t))return null;const n=e._adapter,{parser:r,round:i,isoWeekday:s}=e._parseOpts;let o=t;return typeof r=="function"&&(o=r(o)),Me(o)||(o=typeof r=="string"?n.parse(o,r):n.parse(o)),o===null?null:(i&&(o=i==="week"&&(Ci(s)||s===!0)?n.startOf(o,"isoWeek",s):n.startOf(o,i)),+o)}function rx(e,t,n,r){const i=ft.length;for(let s=ft.indexOf(e);s<i-1;++s){const o=Rl[ft[s]],a=o.steps?o.steps:Number.MAX_SAFE_INTEGER;if(o.common&&Math.ceil((n-t)/(a*o.size))<=r)return ft[s]}return ft[i-1]}function JR(e,t,n,r,i){for(let s=ft.length-1;s>=ft.indexOf(n);s--){const o=ft[s];if(Rl[o].common&&e._adapter.diff(i,r,o)>=t-1)return o}return ft[n?ft.indexOf(n):0]}function ZR(e){for(let t=ft.indexOf(e)+1,n=ft.length;t<n;++t)if(Rl[ft[t]].common)return ft[t]}function ix(e,t,n){if(!n)e[t]=!0;else if(n.length){const{lo:r,hi:i}=Ud(n,t),s=n[r]>=t?n[r]:n[i];e[s]=!0}}function eO(e,t,n,r){const i=e._adapter,s=+i.startOf(t[0].value,r),o=t[t.length-1].value;let a,l;for(a=s;a<=o;a=+i.add(a,1,r))l=n[a],l>=0&&(t[l].major=!0);return t}function sx(e,t,n){const r=[],i={},s=t.length;let o,a;for(o=0;o<s;++o)a=t[o],i[a]=o,r.push({value:a,major:!1});return s===0||!n?r:eO(e,r,i,n)}class io extends Vr{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,n={}){const r=t.time||(t.time={}),i=this._adapter=new lA._date(t.adapters.date);i.init(n),Ss(r.displayFormats,i.formats()),this._parseOpts={parser:r.parser,round:r.round,isoWeekday:r.isoWeekday},super.init(t),this._normalized=n.normalized}parse(t,n){return t===void 0?null:nx(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,n=this._adapter,r=t.time.unit||"day";let{min:i,max:s,minDefined:o,maxDefined:a}=this.getUserBounds();function l(c){!o&&!isNaN(c.min)&&(i=Math.min(i,c.min)),!a&&!isNaN(c.max)&&(s=Math.max(s,c.max))}(!o||!a)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),i=Me(i)&&!isNaN(i)?i:+n.startOf(Date.now(),r),s=Me(s)&&!isNaN(s)?s:+n.endOf(Date.now(),r)+1,this.min=Math.min(i,s-1),this.max=Math.max(i+1,s)}_getLabelBounds(){const t=this.getLabelTimestamps();let n=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY;return t.length&&(n=t[0],r=t[t.length-1]),{min:n,max:r}}buildTicks(){const t=this.options,n=t.time,r=t.ticks,i=r.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&i.length&&(this.min=this._userMin||i[0],this.max=this._userMax||i[i.length-1]);const s=this.min,o=this.max,a=DT(i,s,o);return this._unit=n.unit||(r.autoSkip?rx(n.minUnit,this.min,this.max,this._getLabelCapacity(s)):JR(this,a.length,n.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:ZR(this._unit),this.initOffsets(i),t.reverse&&a.reverse(),sx(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let n=0,r=0,i,s;this.options.offset&&t.length&&(i=this.getDecimalForValue(t[0]),t.length===1?n=1-i:n=(this.getDecimalForValue(t[1])-i)/2,s=this.getDecimalForValue(t[t.length-1]),t.length===1?r=s:r=(s-this.getDecimalForValue(t[t.length-2]))/2);const o=t.length<3?.5:.25;n=$e(n,0,o),r=$e(r,0,o),this._offsets={start:n,end:r,factor:1/(n+1+r)}}_generate(){const t=this._adapter,n=this.min,r=this.max,i=this.options,s=i.time,o=s.unit||rx(s.minUnit,n,r,this._getLabelCapacity(n)),a=Z(i.ticks.stepSize,1),l=o==="week"?s.isoWeekday:!1,c=Ci(l)||l===!0,u={};let f=n,h,p;if(c&&(f=+t.startOf(f,"isoWeek",l)),f=+t.startOf(f,c?"day":o),t.diff(r,n,o)>1e5*a)throw new Error(n+" and "+r+" are too far apart with stepSize of "+a+" "+o);const m=i.ticks.source==="data"&&this.getDataTimestamps();for(h=f,p=0;h<r;h=+t.add(h,a,o),p++)ix(u,h,m);return(h===r||i.bounds==="ticks"||p===1)&&ix(u,h,m),Object.keys(u).sort(tx).map(g=>+g)}getLabelForValue(t){const n=this._adapter,r=this.options.time;return r.tooltipFormat?n.format(t,r.tooltipFormat):n.format(t,r.displayFormats.datetime)}format(t,n){const i=this.options.time.displayFormats,s=this._unit,o=n||i[s];return this._adapter.format(t,o)}_tickFormatFunction(t,n,r,i){const s=this.options,o=s.ticks.callback;if(o)return xe(o,[t,n,r],this);const a=s.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&a[l],f=c&&a[c],h=r[n],p=c&&f&&h&&h.major;return this._adapter.format(t,i||(p?f:u))}generateTickLabels(t){let n,r,i;for(n=0,r=t.length;n<r;++n)i=t[n],i.label=this._tickFormatFunction(i.value,n,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const n=this._offsets,r=this.getDecimalForValue(t);return this.getPixelForDecimal((n.start+r)*n.factor)}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return this.min+r*(this.max-this.min)}_getLabelSize(t){const n=this.options.ticks,r=this.ctx.measureText(t).width,i=$t(this.isHorizontal()?n.maxRotation:n.minRotation),s=Math.cos(i),o=Math.sin(i),a=this._resolveTickFontOptions(0).size;return{w:r*s+a*o,h:r*o+a*s}}_getLabelCapacity(t){const n=this.options.time,r=n.displayFormats,i=r[n.unit]||r.millisecond,s=this._tickFormatFunction(t,0,sx(this,[t],this._majorUnit),i),o=this._getLabelSize(s),a=Math.floor(this.isHorizontal()?this.width/o.w:this.height/o.h)-1;return a>0?a:1}getDataTimestamps(){let t=this._cache.data||[],n,r;if(t.length)return t;const i=this.getMatchingVisibleMetas();if(this._normalized&&i.length)return this._cache.data=i[0].controller.getAllParsedValues(this);for(n=0,r=i.length;n<r;++n)t=t.concat(i[n].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let n,r;if(t.length)return t;const i=this.getLabels();for(n=0,r=i.length;n<r;++n)t.push(nx(this,i[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return tb(t.sort(tx))}}B(io,"id","time"),B(io,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});function Go(e,t,n){let r=0,i=e.length-1,s,o,a,l;n?(t>=e[r].pos&&t<=e[i].pos&&({lo:r,hi:i}=bn(e,"pos",t)),{pos:s,time:a}=e[r],{pos:o,time:l}=e[i]):(t>=e[r].time&&t<=e[i].time&&({lo:r,hi:i}=bn(e,"time",t)),{time:s,pos:a}=e[r],{time:o,pos:l}=e[i]);const c=o-s;return c?a+(l-a)*(t-s)/c:a}class yf extends io{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(t);this._minPos=Go(n,this.min),this._tableRange=Go(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:n,max:r}=this,i=[],s=[];let o,a,l,c,u;for(o=0,a=t.length;o<a;++o)c=t[o],c>=n&&c<=r&&i.push(c);if(i.length<2)return[{time:n,pos:0},{time:r,pos:1}];for(o=0,a=i.length;o<a;++o)u=i[o+1],l=i[o-1],c=i[o],Math.round((u+l)/2)!==c&&s.push({time:c,pos:o/(a-1)});return s}_generate(){const t=this.min,n=this.max;let r=super.getDataTimestamps();return(!r.includes(t)||!r.length)&&r.splice(0,0,t),(!r.includes(n)||r.length===1)&&r.push(n),r.sort((i,s)=>i-s)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const n=this.getDataTimestamps(),r=this.getLabelTimestamps();return n.length&&r.length?t=this.normalize(n.concat(r)):t=n.length?n:r,t=this._cache.all=t,t}getDecimalForValue(t){return(Go(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return Go(this._table,r*this._tableRange+this._minPos,!0)}}B(yf,"id","timeseries"),B(yf,"defaults",io.defaults);var tO=Object.freeze({__proto__:null,CategoryScale:pf,LinearScale:mf,LogarithmicScale:gf,RadialLinearScale:cs,TimeScale:io,TimeSeriesScale:yf});const nO=[aA,IL,DR,tO];tn.register(...nO);function vt(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)}function rt(e,t=1){if(typeof document>"u")return`rgba(0,0,0,${t})`;const n=getComputedStyle(document.documentElement).getPropertyValue(`--${e}`).trim();return n?`rgba(${n.split(/\s+/).join(", ")}, ${t})`:`rgba(0,0,0,${t})`}function rO({data:e}){const t=C.useRef(null),n=C.useRef(null);return C.useEffect(()=>{if(!(!t.current||e.daily.length===0))return n.current&&n.current.destroy(),n.current=new tn(t.current,{type:"bar",data:{labels:e.daily.map(r=>r.date.slice(5)),datasets:[{label:"Input",data:e.daily.map(r=>r.inputTokens),backgroundColor:rt("primary",.75),borderRadius:2},{label:"Output",data:e.daily.map(r=>r.outputTokens),backgroundColor:rt("info",.7),borderRadius:2},{label:"Cache Read",data:e.daily.map(r=>r.cacheReadTokens),backgroundColor:rt("success",.45),borderRadius:2},{label:"Cache Write",data:e.daily.map(r=>r.cacheCreateTokens),backgroundColor:rt("tertiary-fixed",.75),borderRadius:2}]},options:{responsive:!0,maintainAspectRatio:!1,plugins:{legend:{position:"bottom",labels:{color:rt("on-surface-variant"),font:{size:10,family:"monospace"},boxWidth:12}},tooltip:{callbacks:{label:r=>`${r.dataset.label}: ${vt(r.raw)} tokens`}}},scales:{x:{stacked:!0,grid:{color:rt("outline-variant",.3)},ticks:{color:rt("on-surface-variant"),font:{size:9,family:"monospace"}}},y:{stacked:!0,grid:{color:rt("outline-variant",.3)},ticks:{color:rt("on-surface-variant"),font:{size:9,family:"monospace"},callback:r=>vt(r)}}}}}),()=>{var r;(r=n.current)==null||r.destroy()}},[e]),d.jsx("canvas",{ref:t})}function iO({data:e}){const t=C.useRef(null),n=C.useRef(null);return C.useEffect(()=>{if(!(!t.current||e.daily.length===0))return n.current&&n.current.destroy(),n.current=new tn(t.current,{type:"bar",data:{labels:e.daily.map(r=>r.date.slice(5)),datasets:[{label:"Est. Cost (USD)",data:e.daily.map(r=>Number(r.estimatedCostUsd.toFixed(2))),backgroundColor:rt("secondary",.75),borderRadius:2}]},options:{responsive:!0,maintainAspectRatio:!1,plugins:{legend:{labels:{color:rt("on-surface-variant"),font:{size:10,family:"monospace"},boxWidth:12}},tooltip:{callbacks:{label:r=>`$${r.raw.toFixed(2)}`}}},scales:{x:{grid:{color:rt("outline-variant",.3)},ticks:{color:rt("on-surface-variant"),font:{size:9,family:"monospace"}}},y:{grid:{color:rt("outline-variant",.3)},ticks:{color:rt("on-surface-variant"),font:{size:9,family:"monospace"},callback:r=>`$${r}`}}}}}),()=>{var r;(r=n.current)==null||r.destroy()}},[e]),d.jsx("canvas",{ref:t})}function sO({agentId:e}){const[t,n]=C.useState(null),[r,i]=C.useState(30),[s,o]=C.useState(!0);if(C.useEffect(()=>{o(!0),s_(e,r).then(n).catch(console.error).finally(()=>o(!1))},[e,r]),s||!t)return d.jsx("div",{className:"text-on-surface-variant/70 text-xs p-6",children:"Scanning sessions..."});const a=Object.entries(t.byModel).sort((l,c)=>c[1].estimatedCostUsd-l[1].estimatedCostUsd);return d.jsxs("div",{className:"flex flex-col h-full w-full min-w-0 bg-background",children:[d.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-outline-variant/30",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"text-[13px] opacity-60",children:"📊"}),d.jsx("span",{className:"text-[11px] uppercase tracking-[0.14em] font-medium text-on-surface-variant",children:"Usage"})]}),d.jsx("div",{className:"flex items-center gap-1",children:[7,14,30].map(l=>d.jsxs("button",{onClick:()=>i(l),className:`px-2 py-0.5 rounded text-[9px] font-mono transition-colors ${r===l?"bg-primary/20 text-primary":"text-on-surface-variant/70 hover:text-on-surface-variant/70"}`,children:[l,"d"]},l))})]}),d.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-4 scrollbar-thin",children:[d.jsxs("div",{className:"grid grid-cols-4 gap-3",children:[d.jsxs("div",{className:"rounded-lg bg-surface-container-lowest border border-outline-variant/40 p-4",children:[d.jsx("p",{className:"text-[9px] uppercase text-on-surface-variant/60 mb-1.5",children:"Total Tokens"}),d.jsx("p",{className:"font-mono text-[20px] text-on-surface/80",children:vt(t.totalInputTokens+t.totalOutputTokens)}),d.jsxs("p",{className:"font-mono text-[9px] text-on-surface-variant/60 mt-1",children:[vt(t.totalCacheReadTokens+t.totalCacheCreateTokens)," cached"]})]}),d.jsxs("div",{className:"rounded-lg bg-surface-container-lowest border border-outline-variant/40 p-4",children:[d.jsx("p",{className:"text-[9px] uppercase text-on-surface-variant/60 mb-1.5",children:"Sessions"}),d.jsx("p",{className:"font-mono text-[20px] text-on-surface/80",children:t.totalSessions}),d.jsxs("p",{className:"font-mono text-[9px] text-on-surface-variant/60 mt-1",children:[Object.keys(t.byModel).length," models"]})]}),d.jsxs("div",{className:"rounded-lg bg-surface-container-lowest border border-outline-variant/40 p-4",children:[d.jsx("p",{className:"text-[9px] uppercase text-on-surface-variant/60 mb-1.5",children:"Est. Cost"}),d.jsxs("p",{className:"font-mono text-[20px] text-error/80",children:["$",t.totalEstimatedCostUsd.toFixed(2)]}),d.jsxs("p",{className:"font-mono text-[9px] text-on-surface-variant/60 mt-1",children:[r," day period"]})]}),d.jsxs("div",{className:"rounded-lg bg-surface-container-lowest border border-outline-variant/40 p-4",children:[d.jsx("p",{className:"text-[9px] uppercase text-on-surface-variant/60 mb-1.5",children:"Avg/Day"}),d.jsxs("p",{className:"font-mono text-[20px] text-warning/80",children:["$",t.daily.length>0?(t.totalEstimatedCostUsd/t.daily.length).toFixed(2):"0.00"]}),d.jsxs("p",{className:"font-mono text-[9px] text-on-surface-variant/60 mt-1",children:[t.daily.length>0?Math.round(t.totalSessions/t.daily.length):0," sessions/day"]})]})]}),d.jsxs("div",{children:[d.jsx("p",{className:"text-[8px] uppercase tracking-[0.18em] text-on-surface-variant/35 font-semibold mb-2",children:"Daily Token Usage"}),d.jsx("div",{className:"rounded-lg bg-surface-container-lowest border border-outline-variant/40 p-4",style:{height:"300px"},children:t.daily.length>0?d.jsx(rO,{data:t}):d.jsx("p",{className:"text-on-surface-variant/25 text-xs text-center pt-20",children:"No usage data"})})]}),d.jsxs("div",{children:[d.jsx("p",{className:"text-[8px] uppercase tracking-[0.18em] text-on-surface-variant/35 font-semibold mb-2",children:"Daily Estimated Cost"}),d.jsx("div",{className:"rounded-lg bg-surface-container-lowest border border-outline-variant/40 p-4",style:{height:"250px"},children:t.daily.length>0?d.jsx(iO,{data:t}):d.jsx("p",{className:"text-on-surface-variant/25 text-xs text-center pt-16",children:"No cost data"})})]}),a.length>0&&d.jsxs("div",{children:[d.jsx("p",{className:"text-[8px] uppercase tracking-[0.18em] text-on-surface-variant/35 font-semibold mb-2",children:"By Model"}),d.jsx("div",{className:"space-y-1",children:a.map(([l,c])=>d.jsxs("div",{className:"rounded bg-surface-container-lowest border border-outline-variant/40 p-2.5 flex items-center gap-3",children:[d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("span",{className:"font-mono text-[10px] text-on-surface/70 truncate block",children:l}),d.jsxs("span",{className:"font-mono text-[9px] text-on-surface-variant/60",children:[c.sessions," sessions · ",vt(c.inputTokens)," in · ",vt(c.outputTokens)," out"]})]}),d.jsxs("span",{className:"font-mono text-[10px] text-error/60 flex-shrink-0",children:["$",c.estimatedCostUsd.toFixed(2)]})]},l))})]}),d.jsxs("div",{children:[d.jsx("p",{className:"text-[8px] uppercase tracking-[0.18em] text-on-surface-variant/35 font-semibold mb-2",children:"Token Breakdown"}),d.jsxs("div",{className:"rounded bg-surface-container-lowest border border-outline-variant/40 p-3 space-y-1.5",children:[d.jsxs("div",{className:"flex justify-between",children:[d.jsx("span",{className:"font-mono text-[10px] text-on-surface-variant",children:"Input tokens"}),d.jsx("span",{className:"font-mono text-[10px] text-primary",children:vt(t.totalInputTokens)})]}),d.jsxs("div",{className:"flex justify-between",children:[d.jsx("span",{className:"font-mono text-[10px] text-on-surface-variant",children:"Output tokens"}),d.jsx("span",{className:"font-mono text-[10px] text-info",children:vt(t.totalOutputTokens)})]}),d.jsxs("div",{className:"flex justify-between",children:[d.jsx("span",{className:"font-mono text-[10px] text-on-surface-variant",children:"Cache read"}),d.jsx("span",{className:"font-mono text-[10px] text-success",children:vt(t.totalCacheReadTokens)})]}),d.jsxs("div",{className:"flex justify-between",children:[d.jsx("span",{className:"font-mono text-[10px] text-on-surface-variant",children:"Cache write"}),d.jsx("span",{className:"font-mono text-[10px] text-warning",children:vt(t.totalCacheCreateTokens)})]})]})]}),Object.keys(t.byTool).length>0&&d.jsxs("div",{children:[d.jsx("p",{className:"text-[8px] uppercase tracking-[0.18em] text-on-surface-variant/35 font-semibold mb-2",children:"Tool Invocations"}),d.jsx("div",{className:"rounded-lg bg-surface-container-lowest border border-outline-variant/40 p-3 space-y-1",children:Object.entries(t.byTool).sort((l,c)=>c[1]-l[1]).map(([l,c])=>{const u=Math.max(...Object.values(t.byTool));return d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"font-mono text-[10px] text-on-surface-variant w-40 truncate flex-shrink-0",title:l,children:l}),d.jsx("div",{className:"flex-1 h-3 rounded-sm bg-background overflow-hidden",children:d.jsx("div",{className:"h-full rounded-sm bg-primary/40",style:{width:`${c/u*100}%`}})}),d.jsx("span",{className:"font-mono text-[9px] text-on-surface-variant/70 w-8 text-right flex-shrink-0",children:c})]},l)})})]}),d.jsxs("div",{children:[d.jsx("p",{className:"text-[8px] uppercase tracking-[0.18em] text-on-surface-variant/35 font-semibold mb-2",children:"Daily Breakdown"}),d.jsx("div",{className:"rounded-lg bg-surface-container-lowest border border-outline-variant/40 overflow-hidden",children:d.jsxs("table",{className:"w-full",children:[d.jsx("thead",{children:d.jsxs("tr",{className:"border-b border-outline-variant/30",children:[d.jsx("th",{className:"px-3 py-2 text-left text-[9px] font-mono text-on-surface-variant/70 font-medium",children:"Date"}),d.jsx("th",{className:"px-3 py-2 text-right text-[9px] font-mono text-on-surface-variant/70 font-medium",children:"Sessions"}),d.jsx("th",{className:"px-3 py-2 text-right text-[9px] font-mono text-on-surface-variant/70 font-medium",children:"Input"}),d.jsx("th",{className:"px-3 py-2 text-right text-[9px] font-mono text-on-surface-variant/70 font-medium",children:"Output"}),d.jsx("th",{className:"px-3 py-2 text-right text-[9px] font-mono text-on-surface-variant/70 font-medium",children:"Cache"}),d.jsx("th",{className:"px-3 py-2 text-right text-[9px] font-mono text-on-surface-variant/70 font-medium",children:"Cost"})]})}),d.jsx("tbody",{children:[...t.daily].reverse().map(l=>d.jsxs("tr",{className:"border-b border-white/[0.03] hover:bg-white/[0.02]",children:[d.jsx("td",{className:"px-3 py-1.5 font-mono text-[10px] text-on-surface/70",children:l.date}),d.jsx("td",{className:"px-3 py-1.5 font-mono text-[10px] text-on-surface-variant text-right",children:l.sessions}),d.jsx("td",{className:"px-3 py-1.5 font-mono text-[10px] text-primary text-right",children:vt(l.inputTokens)}),d.jsx("td",{className:"px-3 py-1.5 font-mono text-[10px] text-info text-right",children:vt(l.outputTokens)}),d.jsx("td",{className:"px-3 py-1.5 font-mono text-[10px] text-success text-right",children:vt(l.cacheReadTokens+l.cacheCreateTokens)}),d.jsxs("td",{className:"px-3 py-1.5 font-mono text-[10px] text-error/60 text-right",children:["$",l.estimatedCostUsd.toFixed(2)]})]},l.date))})]})})]})]})]})}function oO(e){const t=e.createdAt??e.created_at;return{_id:e._id??e.id,agentId:e.agentId??e.agent_id??"",type:e.type,input:e.input,output:e.output,durationMs:e.durationMs??e.duration_ms,createdAt:typeof t=="number"?new Date(t).toISOString():t??""}}const aO=[{label:"All",value:"default",color:""},{label:"MSG",value:"message",color:"bg-emerald-500"},{label:"TOOL",value:"tool_call",color:"bg-blue-500"},{label:"ERR",value:"error",color:"bg-red-500"},{label:"SYS",value:"system",color:"bg-gray-500"}];function lO(e){return{message:"text-success",tool_call:"text-info",tool_result:"text-info/60",error:"text-error",system:"text-gray-500"}[e]??"text-gray-500"}function cO(e){return{message:"bg-emerald-500/10",tool_call:"bg-blue-500/10",tool_result:"bg-blue-500/5",error:"bg-red-500/10",system:""}[e]??""}function uO(e){return{message:"bg-emerald-400",tool_call:"bg-blue-400",tool_result:"bg-blue-400/60",error:"bg-red-400",system:"bg-gray-600"}[e]??"bg-gray-600"}function fO(e){const t=new Date(e),n=new Date,r=t.toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"});return t.toDateString()!==n.toDateString()?`${t.toLocaleDateString("en-US",{month:"short",day:"numeric"})} ${r}`:r}function Es(e){if(typeof e=="string")try{return JSON.parse(e)}catch{return e}return e}function dO(e){const t=Es(e.input),n=Es(e.output);if(e.type==="message"){const r=(t==null?void 0:t.text)??"";return String(r)||"(no text)"}if(e.type==="tool_call"){const r=(t==null?void 0:t.tool)??(t==null?void 0:t.tool_name)??(t==null?void 0:t.name)??"",i=(t==null?void 0:t.description)??"";if(r){({...t});const s=Es(t==null?void 0:t.input),o=s?Object.values(s).map(l=>String(l).slice(0,60)).join(", ").slice(0,80):"",a=o?`${r}(${o})`:String(r);return i?`${a} — ${i}`:a}return JSON.stringify(t??{}).slice(0,200)}if(e.type==="tool_result")return JSON.stringify(n??{}).slice(0,200);if(e.type==="error")return String((n==null?void 0:n.message)??n??"unknown error");if(e.type==="system"){const r=n==null?void 0:n.exitCode;return r!==void 0?`process exited (${r})`:"—"}return JSON.stringify(n??{}).slice(0,200)}function hO(e,t){if(!t)return e;const n=e.toLowerCase().indexOf(t.toLowerCase());return n===-1?e:d.jsxs(d.Fragment,{children:[e.slice(0,n),d.jsx("mark",{className:"bg-yellow-400/30 text-yellow-200 rounded-sm px-0.5",children:e.slice(n,n+t.length)}),e.slice(n+t.length)]})}function pO({agentId:e}){const[t,n]=C.useState("default"),[r,i]=C.useState(""),[s,o]=C.useState(""),[a,l]=C.useState([]),[c,u]=C.useState(0),[f,h]=C.useState(!0),[p,m]=C.useState(new Set),[g,v]=C.useState(100),[x,y]=C.useState(!0),b=C.useRef(null),k=C.useRef(null),S=()=>o(r),w=C.useCallback(()=>{g_({agentId:e,type:t==="default"||t==="all"?void 0:t,search:s||void 0,limit:g}).then(M=>{let j=M.items.map(oO);t==="default"&&(j=j.filter(D=>D.type!=="system")),l(j),u(M.total)}).catch(console.error).finally(()=>h(!1))},[e,t,s,g]);C.useEffect(()=>{h(!0),w()},[w]),C.useEffect(()=>{if(!x)return;const M=setInterval(w,3e3);return()=>clearInterval(M)},[x,w]);const E=M=>{m(j=>{const D=new Set(j);return D.has(M)?D.delete(M):D.add(M),D})},P=a;return d.jsxs("div",{className:"flex flex-col h-full w-full min-w-0 rounded-lg overflow-hidden bg-surface-container-lowest",children:[d.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 border-b border-outline-variant/30 bg-background",children:[d.jsxs("div",{className:"flex-1 flex items-center gap-1.5",children:[d.jsxs("div",{className:"flex-1 relative",children:[d.jsx("svg",{className:"absolute left-2.5 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-on-surface-variant/60",viewBox:"0 0 20 20",fill:"currentColor",children:d.jsx("path",{fillRule:"evenodd",d:"M9 3.5a5.5 5.5 0 100 11 5.5 5.5 0 000-11zM2 9a7 7 0 1112.452 4.391l3.328 3.329a.75.75 0 11-1.06 1.06l-3.329-3.328A7 7 0 012 9z",clipRule:"evenodd"})}),d.jsx("input",{className:"w-full bg-surface-container-lowest rounded pl-8 pr-7 py-1.5 text-[11px] text-on-surface font-mono placeholder:text-on-surface-variant/25 outline-none focus:ring-1 focus:ring-primary/30 transition-shadow",placeholder:"Search logs...",value:r,onChange:M=>i(M.target.value),onKeyDown:M=>M.key==="Enter"&&S()}),r&&d.jsx("button",{onClick:()=>{i(""),o("")},className:"absolute right-2 top-1/2 -translate-y-1/2 text-on-surface-variant hover:text-on-surface text-xs",children:"x"})]}),d.jsx("button",{onClick:S,disabled:r===s,className:"px-2.5 py-1.5 rounded bg-primary/20 text-[10px] font-mono text-primary transition-colors hover:bg-primary/30 disabled:opacity-30 disabled:cursor-default flex-shrink-0",children:"Apply"})]}),d.jsx("div",{className:"flex items-center gap-0.5",children:aO.map(({label:M,value:j,color:D})=>d.jsxs("button",{onClick:()=>n(j),className:`flex items-center gap-1 px-2 py-1 rounded text-[9px] font-mono transition-colors ${t===j?"bg-surface-container-high text-on-surface":"text-on-surface-variant hover:text-on-surface hover:bg-surface-container/50"}`,children:[D&&d.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${D}`}),M]},j))}),d.jsxs("button",{onClick:()=>y(M=>!M),className:`flex items-center gap-1.5 px-2 py-1 rounded text-[9px] font-mono transition-colors ${x?"bg-success/15 text-success":"text-on-surface-variant hover:text-on-surface"}`,children:[d.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${x?"bg-success animate-pulse":"bg-outline/60"}`}),"Live"]}),d.jsxs("span",{className:"font-mono text-[9px] text-on-surface-variant tabular-nums",children:[a.length,"/",c]})]}),d.jsx("div",{ref:k,className:"flex-1 overflow-y-auto scrollbar-thin font-mono text-[11px]",children:f&&a.length===0?d.jsx("div",{className:"flex items-center justify-center h-full",children:d.jsx("span",{className:"text-on-surface-variant text-[10px]",children:"loading..."})}):P.length===0?d.jsx("div",{className:"flex items-center justify-center h-full",children:d.jsx("span",{className:"text-on-surface-variant text-[10px]",children:r?`no results for "${r}"`:"no log entries"})}):d.jsxs("div",{className:"py-1",children:[P.map(M=>{const j=p.has(M._id),D=dO(M);return d.jsxs("div",{onClick:()=>E(M._id),className:`group px-3 py-[5px] cursor-pointer transition-colors hover:bg-surface-container/40 ${cO(M.type)} ${j?"bg-surface-container/30":""}`,children:[d.jsxs("div",{className:"flex items-start gap-2 leading-relaxed",children:[d.jsx("span",{className:`mt-[6px] w-[5px] h-[5px] rounded-full flex-shrink-0 ${uO(M.type)}`}),d.jsx("span",{className:"text-on-surface-variant flex-shrink-0 w-[70px] tabular-nums",children:fO(M.createdAt)}),d.jsx("span",{className:`flex-shrink-0 w-[52px] uppercase text-[9px] ${lO(M.type)}`,children:M.type==="tool_call"?"tool":M.type==="tool_result"?"result":M.type}),d.jsx("span",{className:`flex-1 min-w-0 ${j?"":"truncate"} ${M.type==="error"?"text-error":"text-on-surface"}`,children:hO(D,s)}),M.durationMs!=null&&d.jsx("span",{className:"flex-shrink-0 text-[9px] text-on-surface-variant tabular-nums",children:M.durationMs>1e3?`${(M.durationMs/1e3).toFixed(1)}s`:`${M.durationMs}ms`}),d.jsx("span",{className:"flex-shrink-0 text-[8px] text-on-surface-variant opacity-0 group-hover:opacity-100 transition-opacity",children:j?"−":"+"})]}),j&&d.jsxs("div",{className:"ml-[79px] mt-1.5 mb-1 space-y-1.5",children:[!!M.input&&M.input!=="null"&&d.jsxs("div",{children:[d.jsx("span",{className:"font-label text-[8px] uppercase tracking-wider text-on-surface-variant",children:"input"}),d.jsx("pre",{className:"text-[10px] text-on-surface mt-0.5 bg-surface-container-high rounded px-2.5 py-1.5 overflow-auto max-h-48 whitespace-pre-wrap break-words",children:JSON.stringify(Es(M.input),null,2)})]}),!!M.output&&M.output!=="null"&&d.jsxs("div",{children:[d.jsx("span",{className:"font-label text-[8px] uppercase tracking-wider text-on-surface-variant",children:"output"}),d.jsx("pre",{className:"text-[10px] text-on-surface mt-0.5 bg-surface-container-high rounded px-2.5 py-1.5 overflow-auto max-h-48 whitespace-pre-wrap break-words",children:JSON.stringify(Es(M.output),null,2)})]})]})]},M._id)}),a.length<c&&d.jsx("div",{className:"px-3 py-2 text-center",children:d.jsxs("button",{onClick:()=>v(M=>M+100),className:"text-[9px] text-primary/40 hover:text-primary/70 transition-colors",children:["Load ",Math.min(100,c-a.length)," older entries..."]})}),d.jsx("div",{ref:b})]})})]})}const mO=[{id:"telegram",name:"Telegram",description:"Receive and reply to messages via a Telegram bot.",icon:"✈️",secretKey:"TELEGRAM_BOT_TOKEN",tokenLabel:"Bot Token",tokenPlaceholder:"110201543:AAHdqTcvCH1vGWJxfSeofSAs0K5PALDsaw",helpText:"Create a bot via @BotFather on Telegram, then paste the token here."}],ox="w-full rounded bg-surface-container px-3 py-2 text-[11px] text-on-surface placeholder:text-on-surface-variant/40 outline-none focus:ring-1 focus:ring-primary/25 font-mono transition-shadow";function gO({def:e,agentId:t,enabled:n,onEnable:r,onDisable:i}){const[s,o]=C.useState(!1),[a,l]=C.useState(""),[c,u]=C.useState(!1),[f,h]=C.useState(null);async function p(){if(!a.trim()){h("Token is required");return}u(!0),h(null);try{await Bu(t,e.secretKey,a.trim()),r(e.secretKey),o(!1),l("")}catch{h("Failed to save — check the console")}finally{u(!1)}}async function m(){confirm(`Disconnect ${e.name}? The agent will stop using it immediately.`)&&(await R0(t,e.secretKey),i(e.secretKey))}return d.jsxs("div",{className:"rounded-lg bg-surface-container-lowest border border-outline-variant/40 p-4 space-y-3",children:[d.jsxs("div",{className:"flex items-start justify-between gap-3",children:[d.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[d.jsx("span",{className:"text-[20px] flex-shrink-0",children:e.icon}),d.jsxs("div",{className:"min-w-0",children:[d.jsx("p",{className:"text-[13px] font-semibold text-on-surface",children:e.name}),d.jsx("p",{className:"font-mono text-[10px] text-on-surface-variant/70 mt-0.5 leading-relaxed",children:e.description})]})]}),d.jsx("div",{className:"flex-shrink-0 flex items-center gap-2",children:n?d.jsxs(d.Fragment,{children:[d.jsxs("span",{className:"font-mono text-[9px] text-secondary/80 flex items-center gap-1",children:[d.jsx("span",{className:"inline-block w-1.5 h-1.5 rounded-full bg-secondary/70"}),"Connected"]}),d.jsx("button",{onClick:m,className:"rounded px-2 py-1 text-[10px] font-mono text-error/50 hover:text-error hover:bg-error/10 transition-colors",children:"Disconnect"})]}):d.jsx("button",{onClick:()=>{o(!0),h(null)},className:"rounded bg-primary/10 border border-primary/20 px-3 py-1 text-[11px] font-medium text-primary hover:bg-primary/20 transition-colors",children:"Connect"})})]}),!n&&s&&d.jsxs("div",{className:"pt-2 border-t border-outline-variant/30 space-y-3",children:[d.jsxs("div",{children:[d.jsx("label",{className:"block text-[10px] uppercase tracking-[0.14em] text-on-surface-variant font-medium mb-1.5",children:e.tokenLabel}),d.jsx("input",{type:"password",className:ox,placeholder:e.tokenPlaceholder,value:a,onChange:g=>{l(g.target.value),h(null)},autoComplete:"off",autoFocus:!0}),d.jsx("p",{className:"font-mono text-[9px] text-on-surface-variant/50 mt-1.5 leading-relaxed",children:e.helpText})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("button",{onClick:p,disabled:c||!a.trim(),className:"rounded bg-primary px-3 py-1.5 text-[12px] font-medium text-on-primary transition-opacity disabled:opacity-40 hover:opacity-90",children:c?"Saving…":"Save & Connect"}),d.jsx("button",{onClick:()=>{o(!1),l(""),h(null)},className:"rounded px-3 py-1.5 text-[12px] font-mono text-on-surface-variant hover:text-on-surface transition-colors",children:"Cancel"}),f&&d.jsx("span",{className:"font-mono text-[10px] text-error",children:f})]})]}),n&&s&&d.jsxs("div",{className:"pt-2 border-t border-outline-variant/30 space-y-3",children:[d.jsxs("div",{children:[d.jsxs("label",{className:"block text-[10px] uppercase tracking-[0.14em] text-on-surface-variant font-medium mb-1.5",children:["New ",e.tokenLabel]}),d.jsx("input",{type:"password",className:ox,placeholder:"Paste new token",value:a,onChange:g=>{l(g.target.value),h(null)},autoComplete:"off",autoFocus:!0})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("button",{onClick:p,disabled:c||!a.trim(),className:"rounded bg-primary px-3 py-1.5 text-[12px] font-medium text-on-primary transition-opacity disabled:opacity-40 hover:opacity-90",children:c?"Saving…":"Update Token"}),d.jsx("button",{onClick:()=>{o(!1),l(""),h(null)},className:"rounded px-3 py-1.5 text-[12px] font-mono text-on-surface-variant hover:text-on-surface transition-colors",children:"Cancel"}),f&&d.jsx("span",{className:"font-mono text-[10px] text-error",children:f})]})]}),n&&!s&&d.jsx("button",{onClick:()=>{o(!0),h(null)},className:"font-mono text-[10px] text-on-surface-variant/50 hover:text-on-surface-variant transition-colors",children:"Rotate token"})]})}function xO({agentId:e,secretNames:t,setSecretNames:n}){return d.jsxs("div",{className:"flex flex-col gap-4 max-w-xl",children:[d.jsxs("div",{children:[d.jsx("h2",{className:"font-headline text-[22px] font-bold text-on-surface",children:"Integrations"}),d.jsx("p",{className:"font-mono text-[11px] text-on-surface-variant/70 mt-1",children:"Connect external services. Each integration stores a token as a secret and activates automatically."})]}),d.jsx("div",{className:"space-y-3",children:mO.map(r=>d.jsx(gO,{def:r,agentId:e,enabled:t.includes(r.secretKey),onEnable:i=>n(s=>s.includes(i)?s:[...s,i]),onDisable:i=>n(s=>s.filter(o=>o!==i))},r.id))}),d.jsx("p",{className:"font-mono text-[10px] text-on-surface-variant/40 mt-2",children:"More integrations coming soon. For other API keys and credentials, use the Secrets section in the sidebar."})]})}const yO=["chat","files","tasks","browser","workflows","schedules","monitor","usage","logs","integrations"];function Vc({className:e=""}){return d.jsx("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",children:d.jsx("path",{d:"M12 2L3 7v5c0 5.25 3.75 10.15 9 11.25C17.25 22.15 21 17.25 21 12V7L12 2z"})})}function vO({toolCalls:e,isStreaming:t}){const[n,r]=C.useState(!1),i=e.length,s=a=>{const l=a.match(/^([^(]+)/);return l?l[1]:a},o=s(e[i-1]??"");return d.jsxs("div",{className:"w-full max-w-xl",children:[d.jsxs("button",{onClick:()=>r(a=>!a),className:"flex items-center gap-2 px-2 py-1 rounded hover:bg-surface-dim/50 transition-colors w-full text-left",children:[t?d.jsx("span",{className:"h-3 w-3 rounded-full border-2 border-primary/40 border-t-primary animate-spin flex-shrink-0"}):d.jsx("span",{className:"text-[10px] text-primary/60 flex-shrink-0",children:"⚙"}),d.jsx("span",{className:"font-mono text-[10px] text-on-surface-variant flex-1 truncate",children:t?`Running ${o}…`:`${i} tool call${i!==1?"s":""}`}),d.jsx("svg",{className:"w-2.5 h-2.5 text-on-surface-variant/60 transition-transform duration-150 flex-shrink-0",style:{transform:n?"rotate(90deg)":"none"},viewBox:"0 0 16 16",fill:"currentColor",children:d.jsx("path",{d:"M6 3l5 5-5 5V3z"})})]}),n&&d.jsx("div",{className:"mt-1 rounded bg-surface-dim/50 overflow-y-auto scrollbar-thin",style:{maxHeight:"10rem"},children:e.map((a,l)=>d.jsxs("div",{className:"font-mono text-[9px] text-on-surface-variant/70 px-2.5 py-1 border-b border-white/[0.03] last:border-0 truncate hover:text-on-surface-variant/60 transition-colors",title:a,children:[d.jsx("span",{className:"text-primary/50",children:s(a)}),d.jsx("span",{className:"text-on-surface-variant/20 ml-1",children:a.slice(s(a).length)})]},l))})]})}function bO(){var H;const{id:e="","*":t=""}=E0(),n=Br(),r=(()=>{if(!t||t==="chat")return"chat";const _=t.match(/^view\/([\w-]+)$/);return _&&yO.includes(_[1])?_[1]:"chat"})(),i=_=>{_==="chat"?n(`/agents/${e}/chat`,{replace:!0}):n(`/agents/${e}/view/${_}`,{replace:!0})},[s,o]=C.useState(null),[a,l]=C.useState(null),[c,u]=C.useState([]),[f,h]=C.useState(""),[p,m]=C.useState(!1),[g,v]=C.useState(!1),[x,y]=C.useState(null),[b,k]=C.useState([]),S=C.useRef(null),[w]=C.useState(!0),[E,P]=C.useState([]),[,M]=C.useState(null),[,j]=C.useState(!1),D=C.useRef(null),{sendMessage:R,stopMessage:$,connected:X}=Dm(s==null?void 0:s.id);function W(){$(),u(_=>_.map(Y=>Y.isStreaming?{...Y,isStreaming:!1,text:Y.text+`
120
+ `):e}function _R(e,t){const{element:n,datasetIndex:r,index:i}=t,s=e.getDatasetMeta(r).controller,{label:o,value:a}=s.getLabelAndValue(i);return{chart:e,label:o,parsed:s.getParsed(i),raw:e.data.datasets[r].data[i],formattedValue:a,dataset:s.getDataset(),dataIndex:i,datasetIndex:r,element:n}}function Hg(e,t){const n=e.chart.ctx,{body:r,footer:i,title:s}=e,{boxWidth:o,boxHeight:a}=t,l=Fe(t.bodyFont),c=Fe(t.titleFont),u=Fe(t.footerFont),f=s.length,h=i.length,p=r.length,m=et(t.padding);let g=m.height,v=0,x=r.reduce((k,S)=>k+S.before.length+S.lines.length+S.after.length,0);if(x+=e.beforeBody.length+e.afterBody.length,f&&(g+=f*c.lineHeight+(f-1)*t.titleSpacing+t.titleMarginBottom),x){const k=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;g+=p*k+(x-p)*l.lineHeight+(x-1)*t.bodySpacing}h&&(g+=t.footerMarginTop+h*u.lineHeight+(h-1)*t.footerSpacing);let y=0;const b=function(k){v=Math.max(v,n.measureText(k).width+y)};return n.save(),n.font=c.string,fe(e.title,b),n.font=l.string,fe(e.beforeBody.concat(e.afterBody),b),y=t.displayColors?o+2+t.boxPadding:0,fe(r,k=>{fe(k.before,b),fe(k.lines,b),fe(k.after,b)}),y=0,n.font=u.string,fe(e.footer,b),n.restore(),v+=m.width,{width:v,height:g}}function CR(e,t){const{y:n,height:r}=t;return n<r/2?"top":n>e.height-r/2?"bottom":"center"}function NR(e,t,n,r){const{x:i,width:s}=r,o=n.caretSize+n.caretPadding;if(e==="left"&&i+s+o>t.width||e==="right"&&i-s-o<0)return!0}function jR(e,t,n,r){const{x:i,width:s}=n,{width:o,chartArea:{left:a,right:l}}=e;let c="center";return r==="center"?c=i<=(a+l)/2?"left":"right":i<=s/2?c="left":i>=o-s/2&&(c="right"),NR(c,e,t,n)&&(c="center"),c}function Yg(e,t,n){const r=n.yAlign||t.yAlign||CR(e,n);return{xAlign:n.xAlign||t.xAlign||jR(e,t,n,r),yAlign:r}}function ER(e,t){let{x:n,width:r}=e;return t==="right"?n-=r:t==="center"&&(n-=r/2),n}function PR(e,t,n){let{y:r,height:i}=e;return t==="top"?r+=n:t==="bottom"?r-=i+n:r-=i/2,r}function Kg(e,t,n,r){const{caretSize:i,caretPadding:s,cornerRadius:o}=e,{xAlign:a,yAlign:l}=n,c=i+s,{topLeft:u,topRight:f,bottomLeft:h,bottomRight:p}=Er(o);let m=ER(t,a);const g=PR(t,l,c);return l==="center"?a==="left"?m+=c:a==="right"&&(m-=c):a==="left"?m-=Math.max(u,h)+i:a==="right"&&(m+=Math.max(f,p)+i),{x:$e(m,0,r.width-t.width),y:$e(g,0,r.height-t.height)}}function Xo(e,t,n){const r=et(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-r.right:e.x+r.left}function Xg(e){return qt([],hn(e))}function MR(e,t,n){return cr(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function Gg(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const Vb={beforeTitle:fn,title(e){if(e.length>0){const t=e[0],n=t.chart.data.labels,r=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(r>0&&t.dataIndex<r)return n[t.dataIndex]}return""},afterTitle:fn,beforeBody:fn,beforeLabel:fn,label(e){if(this&&this.options&&this.options.mode==="dataset")return e.label+": "+e.formattedValue||e.formattedValue;let t=e.dataset.label||"";t&&(t+=": ");const n=e.formattedValue;return re(n)||(t+=n),t},labelColor(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{borderColor:n.borderColor,backgroundColor:n.backgroundColor,borderWidth:n.borderWidth,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:n.pointStyle,rotation:n.rotation}},afterLabel:fn,afterBody:fn,beforeFooter:fn,footer:fn,afterFooter:fn};function lt(e,t,n,r){const i=e[t].call(n,r);return typeof i>"u"?Vb[t].call(n,r):i}class hf extends Kt{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 n=this.chart,r=this.options.setContext(this.getContext()),i=r.enabled&&n.options.animation&&r.animations,s=new wb(this.chart,i);return i._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=MR(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:r}=n,i=lt(r,"beforeTitle",this,t),s=lt(r,"title",this,t),o=lt(r,"afterTitle",this,t);let a=[];return a=qt(a,hn(i)),a=qt(a,hn(s)),a=qt(a,hn(o)),a}getBeforeBody(t,n){return Xg(lt(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:r}=n,i=[];return fe(t,s=>{const o={before:[],lines:[],after:[]},a=Gg(r,s);qt(o.before,hn(lt(a,"beforeLabel",this,s))),qt(o.lines,lt(a,"label",this,s)),qt(o.after,hn(lt(a,"afterLabel",this,s))),i.push(o)}),i}getAfterBody(t,n){return Xg(lt(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:r}=n,i=lt(r,"beforeFooter",this,t),s=lt(r,"footer",this,t),o=lt(r,"afterFooter",this,t);let a=[];return a=qt(a,hn(i)),a=qt(a,hn(s)),a=qt(a,hn(o)),a}_createItems(t){const n=this._active,r=this.chart.data,i=[],s=[],o=[];let a=[],l,c;for(l=0,c=n.length;l<c;++l)a.push(_R(this.chart,n[l]));return t.filter&&(a=a.filter((u,f,h)=>t.filter(u,f,h,r))),t.itemSort&&(a=a.sort((u,f)=>t.itemSort(u,f,r))),fe(a,u=>{const f=Gg(t.callbacks,u);i.push(lt(f,"labelColor",this,u)),s.push(lt(f,"labelPointStyle",this,u)),o.push(lt(f,"labelTextColor",this,u))}),this.labelColors=i,this.labelPointStyles=s,this.labelTextColors=o,this.dataPoints=a,a}update(t,n){const r=this.options.setContext(this.getContext()),i=this._active;let s,o=[];if(!i.length)this.opacity!==0&&(s={opacity:0});else{const a=ls[r.position].call(this,i,this._eventPosition);o=this._createItems(r),this.title=this.getTitle(o,r),this.beforeBody=this.getBeforeBody(o,r),this.body=this.getBody(o,r),this.afterBody=this.getAfterBody(o,r),this.footer=this.getFooter(o,r);const l=this._size=Hg(this,r),c=Object.assign({},a,l),u=Yg(this.chart,r,c),f=Kg(r,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,s={opacity:1,x:f.x,y:f.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=o,this.$context=void 0,s&&this._resolveAnimations().update(this,s),t&&r.external&&r.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(t,n,r,i){const s=this.getCaretPosition(t,r,i);n.lineTo(s.x1,s.y1),n.lineTo(s.x2,s.y2),n.lineTo(s.x3,s.y3)}getCaretPosition(t,n,r){const{xAlign:i,yAlign:s}=this,{caretSize:o,cornerRadius:a}=r,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:f}=Er(a),{x:h,y:p}=t,{width:m,height:g}=n;let v,x,y,b,k,S;return s==="center"?(k=p+g/2,i==="left"?(v=h,x=v-o,b=k+o,S=k-o):(v=h+m,x=v+o,b=k-o,S=k+o),y=v):(i==="left"?x=h+Math.max(l,u)+o:i==="right"?x=h+m-Math.max(c,f)-o:x=this.caretX,s==="top"?(b=p,k=b-o,v=x-o,y=x+o):(b=p+g,k=b+o,v=x+o,y=x-o),S=b),{x1:v,x2:x,x3:y,y1:b,y2:k,y3:S}}drawTitle(t,n,r){const i=this.title,s=i.length;let o,a,l;if(s){const c=gi(r.rtl,this.x,this.width);for(t.x=Xo(this,r.titleAlign,r),n.textAlign=c.textAlign(r.titleAlign),n.textBaseline="middle",o=Fe(r.titleFont),a=r.titleSpacing,n.fillStyle=r.titleColor,n.font=o.string,l=0;l<s;++l)n.fillText(i[l],c.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+a,l+1===s&&(t.y+=r.titleMarginBottom-a)}}_drawColorBox(t,n,r,i,s){const o=this.labelColors[r],a=this.labelPointStyles[r],{boxHeight:l,boxWidth:c}=s,u=Fe(s.bodyFont),f=Xo(this,"left",s),h=i.x(f),p=l<u.lineHeight?(u.lineHeight-l)/2:0,m=n.y+p;if(s.usePointStyle){const g={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},v=i.leftForLtr(h,c)+c/2,x=m+l/2;t.strokeStyle=s.multiKeyBackground,t.fillStyle=s.multiKeyBackground,of(t,g,v,x),t.strokeStyle=o.borderColor,t.fillStyle=o.backgroundColor,of(t,g,v,x)}else{t.lineWidth=se(o.borderWidth)?Math.max(...Object.values(o.borderWidth)):o.borderWidth||1,t.strokeStyle=o.borderColor,t.setLineDash(o.borderDash||[]),t.lineDashOffset=o.borderDashOffset||0;const g=i.leftForLtr(h,c),v=i.leftForLtr(i.xPlus(h,1),c-2),x=Er(o.borderRadius);Object.values(x).some(y=>y!==0)?(t.beginPath(),t.fillStyle=s.multiKeyBackground,to(t,{x:g,y:m,w:c,h:l,radius:x}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),to(t,{x:v,y:m+1,w:c-2,h:l-2,radius:x}),t.fill()):(t.fillStyle=s.multiKeyBackground,t.fillRect(g,m,c,l),t.strokeRect(g,m,c,l),t.fillStyle=o.backgroundColor,t.fillRect(v,m+1,c-2,l-2))}t.fillStyle=this.labelTextColors[r]}drawBody(t,n,r){const{body:i}=this,{bodySpacing:s,bodyAlign:o,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:u}=r,f=Fe(r.bodyFont);let h=f.lineHeight,p=0;const m=gi(r.rtl,this.x,this.width),g=function(P){n.fillText(P,m.x(t.x+p),t.y+h/2),t.y+=h+s},v=m.textAlign(o);let x,y,b,k,S,w,E;for(n.textAlign=o,n.textBaseline="middle",n.font=f.string,t.x=Xo(this,v,r),n.fillStyle=r.bodyColor,fe(this.beforeBody,g),p=a&&v!=="right"?o==="center"?c/2+u:c+2+u:0,k=0,w=i.length;k<w;++k){for(x=i[k],y=this.labelTextColors[k],n.fillStyle=y,fe(x.before,g),b=x.lines,a&&b.length&&(this._drawColorBox(n,t,k,m,r),h=Math.max(f.lineHeight,l)),S=0,E=b.length;S<E;++S)g(b[S]),h=f.lineHeight;fe(x.after,g)}p=0,h=f.lineHeight,fe(this.afterBody,g),t.y-=s}drawFooter(t,n,r){const i=this.footer,s=i.length;let o,a;if(s){const l=gi(r.rtl,this.x,this.width);for(t.x=Xo(this,r.footerAlign,r),t.y+=r.footerMarginTop,n.textAlign=l.textAlign(r.footerAlign),n.textBaseline="middle",o=Fe(r.footerFont),n.fillStyle=r.footerColor,n.font=o.string,a=0;a<s;++a)n.fillText(i[a],l.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+r.footerSpacing}}drawBackground(t,n,r,i){const{xAlign:s,yAlign:o}=this,{x:a,y:l}=t,{width:c,height:u}=r,{topLeft:f,topRight:h,bottomLeft:p,bottomRight:m}=Er(i.cornerRadius);n.fillStyle=i.backgroundColor,n.strokeStyle=i.borderColor,n.lineWidth=i.borderWidth,n.beginPath(),n.moveTo(a+f,l),o==="top"&&this.drawCaret(t,n,r,i),n.lineTo(a+c-h,l),n.quadraticCurveTo(a+c,l,a+c,l+h),o==="center"&&s==="right"&&this.drawCaret(t,n,r,i),n.lineTo(a+c,l+u-m),n.quadraticCurveTo(a+c,l+u,a+c-m,l+u),o==="bottom"&&this.drawCaret(t,n,r,i),n.lineTo(a+p,l+u),n.quadraticCurveTo(a,l+u,a,l+u-p),o==="center"&&s==="left"&&this.drawCaret(t,n,r,i),n.lineTo(a,l+f),n.quadraticCurveTo(a,l,a+f,l),n.closePath(),n.fill(),i.borderWidth>0&&n.stroke()}_updateAnimationTarget(t){const n=this.chart,r=this.$animations,i=r&&r.x,s=r&&r.y;if(i||s){const o=ls[t.position].call(this,this._active,this._eventPosition);if(!o)return;const a=this._size=Hg(this,t),l=Object.assign({},o,this._size),c=Yg(n,t,l),u=Kg(t,l,c,n);(i._to!==u.x||s._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 n=this.options.setContext(this.getContext());let r=this.opacity;if(!r)return;this._updateAnimationTarget(n);const i={width:this.width,height:this.height},s={x:this.x,y:this.y};r=Math.abs(r)<.001?0:r;const o=et(n.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&a&&(t.save(),t.globalAlpha=r,this.drawBackground(s,t,i,n),mb(t,n.textDirection),s.y+=o.top,this.drawTitle(s,t,n),this.drawBody(s,t,n),this.drawFooter(s,t,n),gb(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){const r=this._active,i=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}}),s=!qa(r,i),o=this._positionChanged(i,n);(s||o)&&(this._active=i,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,n,r=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const i=this.options,s=this._active||[],o=this._getActiveElements(t,s,n,r),a=this._positionChanged(o,t),l=n||!qa(o,s)||a;return l&&(this._active=o,(i.enabled||i.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,n))),l}_getActiveElements(t,n,r,i){const s=this.options;if(t.type==="mouseout")return[];if(!i)return n.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,s.mode,s,r);return s.reverse&&o.reverse(),o}_positionChanged(t,n){const{caretX:r,caretY:i,options:s}=this,o=ls[s.position].call(this,t,n);return o!==!1&&(r!==o.x||i!==o.y)}}B(hf,"positioners",ls);var TR={id:"tooltip",_element:hf,positioners:ls,afterInit(e,t,n){n&&(e.tooltip=new hf({chart:e,options:n}))},beforeUpdate(e,t,n){e.tooltip&&e.tooltip.initialize(n)},reset(e,t,n){e.tooltip&&e.tooltip.initialize(n)},afterDraw(e){const t=e.tooltip;if(t&&t._willRender()){const n={tooltip:t};if(e.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0})===!1)return;t.draw(e.ctx),e.notifyPlugins("afterTooltipDraw",n)}},afterEvent(e,t){if(e.tooltip){const n=t.replay;e.tooltip.handleEvent(t.event,n,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:Vb},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"]},DR=Object.freeze({__proto__:null,Colors:UL,Decimation:XL,Filler:pR,Legend:bR,SubTitle:SR,Title:kR,Tooltip:TR});const AR=(e,t,n,r)=>(typeof t=="string"?(n=e.push(t)-1,r.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function LR(e,t,n,r){const i=e.indexOf(t);if(i===-1)return AR(e,t,n,r);const s=e.lastIndexOf(t);return i!==s?n:i}const RR=(e,t)=>e===null?null:$e(Math.round(e),0,t);function Qg(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class pf extends Vr{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const n=this._addedLabels;if(n.length){const r=this.getLabels();for(const{index:i,label:s}of n)r[i]===s&&r.splice(i,1);this._addedLabels=[]}super.init(t)}parse(t,n){if(re(t))return null;const r=this.getLabels();return n=isFinite(n)&&r[n]===t?n:LR(r,t,Z(n,t),this._addedLabels),RR(n,r.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let{min:r,max:i}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(r=0),n||(i=this.getLabels().length-1)),this.min=r,this.max=i}buildTicks(){const t=this.min,n=this.max,r=this.options.offset,i=[];let s=this.getLabels();s=t===0&&n===s.length-1?s:s.slice(t,n+1),this._valueRange=Math.max(s.length-(r?0:1),1),this._startValue=this.min-(r?.5:0);for(let o=t;o<=n;o++)i.push({value:o});return i}getLabelForValue(t){return Qg.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}B(pf,"id","category"),B(pf,"defaults",{ticks:{callback:Qg}});function OR(e,t){const n=[],{bounds:i,step:s,min:o,max:a,precision:l,count:c,maxTicks:u,maxDigits:f,includeBounds:h}=e,p=s||1,m=u-1,{min:g,max:v}=t,x=!re(o),y=!re(a),b=!re(c),k=(v-g)/(f+1);let S=Hm((v-g)/m/p)*p,w,E,P,M;if(S<1e-14&&!x&&!y)return[{value:g},{value:v}];M=Math.ceil(v/S)-Math.floor(g/S),M>m&&(S=Hm(M*S/m/p)*p),re(l)||(w=Math.pow(10,l),S=Math.ceil(S*w)/w),i==="ticks"?(E=Math.floor(g/S)*S,P=Math.ceil(v/S)*S):(E=g,P=v),x&&y&&s&&ET((a-o)/s,S/1e3)?(M=Math.round(Math.min((a-o)/S,u)),S=(a-o)/M,E=o,P=a):b?(E=x?o:E,P=y?a:P,M=c-1,S=(P-E)/M):(M=(P-E)/S,_s(M,Math.round(M),S/1e3)?M=Math.round(M):M=Math.ceil(M));const j=Math.max(Ym(S),Ym(E));w=Math.pow(10,re(l)?j:l),E=Math.round(E*w)/w,P=Math.round(P*w)/w;let D=0;for(x&&(h&&E!==o?(n.push({value:o}),E<o&&D++,_s(Math.round((E+D*S)*w)/w,o,qg(o,k,e))&&D++):E<o&&D++);D<M;++D){const R=Math.round((E+D*S)*w)/w;if(y&&R>a)break;n.push({value:R})}return y&&h&&P!==a?n.length&&_s(n[n.length-1].value,a,qg(a,k,e))?n[n.length-1].value=a:n.push({value:a}):(!y||P===a)&&n.push({value:P}),n}function qg(e,t,{horizontal:n,minRotation:r}){const i=$t(r),s=(n?Math.sin(i):Math.cos(i))||.001,o=.75*t*(""+e).length;return Math.min(t/s,o)}class il extends Vr{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,n){return re(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:n,maxDefined:r}=this.getUserBounds();let{min:i,max:s}=this;const o=l=>i=n?i:l,a=l=>s=r?s:l;if(t){const l=on(i),c=on(s);l<0&&c<0?a(0):l>0&&c>0&&o(0)}if(i===s){let l=s===0?1:Math.abs(s*.05);a(s+l),t||o(i-l)}this.min=i,this.max=s}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:n,stepSize:r}=t,i;return r?(i=Math.ceil(this.max/r)-Math.floor(this.min/r)+1,i>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${r} would result generating up to ${i} ticks. Limiting to 1000.`),i=1e3)):(i=this.computeTickLimit(),n=n||11),n&&(i=Math.min(n,i)),i}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,n=t.ticks;let r=this.getTickLimit();r=Math.max(2,r);const i={maxTicks:r,bounds:t.bounds,min:t.min,max:t.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},s=this._range||this,o=OR(i,s);return t.bounds==="ticks"&&Jv(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 n=this.min,r=this.max;if(super.configure(),this.options.offset&&t.length){const i=(r-n)/Math.max(t.length-1,1)/2;n-=i,r+=i}this._startValue=n,this._endValue=r,this._valueRange=r-n}getLabelForValue(t){return mo(t,this.chart.options.locale,this.options.ticks.format)}}class mf extends il{determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=Me(t)?t:0,this.max=Me(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,r=$t(this.options.ticks.minRotation),i=(t?Math.sin(r):Math.cos(r))||.001,s=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,s.lineHeight/i))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}B(mf,"id","linear"),B(mf,"defaults",{ticks:{callback:Pl.formatters.numeric}});const ro=e=>Math.floor(Bn(e)),mr=(e,t)=>Math.pow(10,ro(e)+t);function Jg(e){return e/Math.pow(10,ro(e))===1}function Zg(e,t,n){const r=Math.pow(10,n),i=Math.floor(e/r);return Math.ceil(t/r)-i}function IR(e,t){const n=t-e;let r=ro(n);for(;Zg(e,t,r)>10;)r++;for(;Zg(e,t,r)<10;)r--;return Math.min(r,ro(e))}function zR(e,{min:t,max:n}){t=bt(e.min,t);const r=[],i=ro(t);let s=IR(t,n),o=s<0?Math.pow(10,Math.abs(s)):1;const a=Math.pow(10,s),l=i>s?Math.pow(10,i):0,c=Math.round((t-l)*o)/o,u=Math.floor((t-l)/a/10)*a*10;let f=Math.floor((c-u)/Math.pow(10,s)),h=bt(e.min,Math.round((l+u+f*Math.pow(10,s))*o)/o);for(;h<n;)r.push({value:h,major:Jg(h),significand:f}),f>=10?f=f<15?15:20:f++,f>=20&&(s++,f=2,o=s>=0?1:o),h=Math.round((l+u+f*Math.pow(10,s))*o)/o;const p=bt(e.max,h);return r.push({value:p,major:Jg(p),significand:f}),r}class gf extends Vr{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,n){const r=il.prototype.parse.apply(this,[t,n]);if(r===0){this._zero=!0;return}return Me(r)&&r>0?r:null}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=Me(t)?Math.max(0,t):null,this.max=Me(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!Me(this._userMin)&&(this.min=t===mr(this.min,0)?mr(this.min,-1):mr(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let r=this.min,i=this.max;const s=a=>r=t?r:a,o=a=>i=n?i:a;r===i&&(r<=0?(s(1),o(10)):(s(mr(r,-1)),o(mr(i,1)))),r<=0&&s(mr(i,-1)),i<=0&&o(mr(r,1)),this.min=r,this.max=i}buildTicks(){const t=this.options,n={min:this._userMin,max:this._userMax},r=zR(n,this);return t.bounds==="ticks"&&Jv(r,this,"value"),t.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}getLabelForValue(t){return t===void 0?"0":mo(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Bn(t),this._valueRange=Bn(this.max)-Bn(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Bn(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const n=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+n*this._valueRange)}}B(gf,"id","logarithmic"),B(gf,"defaults",{ticks:{callback:Pl.formatters.logarithmic,major:{enabled:!0}}});function xf(e){const t=e.ticks;if(t.display&&e.display){const n=et(t.backdropPadding);return Z(t.font&&t.font.size,Ce.font.size)+n.height}return 0}function FR(e,t,n){return n=_e(n)?n:[n],{w:HT(e,t.string,n),h:n.length*t.lineHeight}}function ex(e,t,n,r,i){return e===r||e===i?{start:t-n/2,end:t+n/2}:e<r||e>i?{start:t-n,end:t}:{start:t,end:t+n}}function BR(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},n=Object.assign({},t),r=[],i=[],s=e._pointLabels.length,o=e.options.pointLabels,a=o.centerPointLabels?ue/s:0;for(let l=0;l<s;l++){const c=o.setContext(e.getPointLabelContext(l));i[l]=c.padding;const u=e.getPointPosition(l,e.drawingArea+i[l],a),f=Fe(c.font),h=FR(e.ctx,f,e._pointLabels[l]);r[l]=h;const p=Ge(e.getIndexAngle(l)+a),m=Math.round(Wd(p)),g=ex(m,u.x,h.w,0,180),v=ex(m,u.y,h.h,90,270);$R(n,t,p,g,v)}e.setCenterPoint(t.l-n.l,n.r-t.r,t.t-n.t,n.b-t.b),e._pointLabelItems=UR(e,r,i)}function $R(e,t,n,r,i){const s=Math.abs(Math.sin(n)),o=Math.abs(Math.cos(n));let a=0,l=0;r.start<t.l?(a=(t.l-r.start)/s,e.l=Math.min(e.l,t.l-a)):r.end>t.r&&(a=(r.end-t.r)/s,e.r=Math.max(e.r,t.r+a)),i.start<t.t?(l=(t.t-i.start)/o,e.t=Math.min(e.t,t.t-l)):i.end>t.b&&(l=(i.end-t.b)/o,e.b=Math.max(e.b,t.b+l))}function VR(e,t,n){const r=e.drawingArea,{extra:i,additionalAngle:s,padding:o,size:a}=n,l=e.getPointPosition(t,r+i+o,s),c=Math.round(Wd(Ge(l.angle+De))),u=KR(l.y,a.h,c),f=HR(c),h=YR(l.x,a.w,f);return{visible:!0,x:l.x,y:u,textAlign:f,left:h,top:u,right:h+a.w,bottom:u+a.h}}function WR(e,t){if(!t)return!0;const{left:n,top:r,right:i,bottom:s}=e;return!(wn({x:n,y:r},t)||wn({x:n,y:s},t)||wn({x:i,y:r},t)||wn({x:i,y:s},t))}function UR(e,t,n){const r=[],i=e._pointLabels.length,s=e.options,{centerPointLabels:o,display:a}=s.pointLabels,l={extra:xf(s)/2,additionalAngle:o?ue/i:0};let c;for(let u=0;u<i;u++){l.padding=n[u],l.size=t[u];const f=VR(e,u,l);r.push(f),a==="auto"&&(f.visible=WR(f,c),f.visible&&(c=f))}return r}function HR(e){return e===0||e===180?"center":e<180?"left":"right"}function YR(e,t,n){return n==="right"?e-=t:n==="center"&&(e-=t/2),e}function KR(e,t,n){return n===90||n===270?e-=t/2:(n>270||n<90)&&(e-=t),e}function XR(e,t,n){const{left:r,top:i,right:s,bottom:o}=n,{backdropColor:a}=t;if(!re(a)){const l=Er(t.borderRadius),c=et(t.backdropPadding);e.fillStyle=a;const u=r-c.left,f=i-c.top,h=s-r+c.width,p=o-i+c.height;Object.values(l).some(m=>m!==0)?(e.beginPath(),to(e,{x:u,y:f,w:h,h:p,radius:l}),e.fill()):e.fillRect(u,f,h,p)}}function GR(e,t){const{ctx:n,options:{pointLabels:r}}=e;for(let i=t-1;i>=0;i--){const s=e._pointLabelItems[i];if(!s.visible)continue;const o=r.setContext(e.getPointLabelContext(i));XR(n,o,s);const a=Fe(o.font),{x:l,y:c,textAlign:u}=s;Ir(n,e._pointLabels[i],l,c+a.lineHeight/2,a,{color:o.color,textAlign:u,textBaseline:"middle"})}}function Wb(e,t,n,r){const{ctx:i}=e;if(n)i.arc(e.xCenter,e.yCenter,t,0,ke);else{let s=e.getPointPosition(0,t);i.moveTo(s.x,s.y);for(let o=1;o<r;o++)s=e.getPointPosition(o,t),i.lineTo(s.x,s.y)}}function QR(e,t,n,r,i){const s=e.ctx,o=t.circular,{color:a,lineWidth:l}=t;!o&&!r||!a||!l||n<0||(s.save(),s.strokeStyle=a,s.lineWidth=l,s.setLineDash(i.dash||[]),s.lineDashOffset=i.dashOffset,s.beginPath(),Wb(e,n,o,r),s.closePath(),s.stroke(),s.restore())}function qR(e,t,n){return cr(e,{label:n,index:t,type:"pointLabel"})}class cs extends il{constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this._padding=et(xf(this.options)/2),n=this.width=this.maxWidth-t.width,r=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+n/2+t.left),this.yCenter=Math.floor(this.top+r/2+t.top),this.drawingArea=Math.floor(Math.min(n,r)/2)}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!1);this.min=Me(t)&&!isNaN(t)?t:0,this.max=Me(n)&&!isNaN(n)?n:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/xf(this.options))}generateTickLabels(t){il.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((n,r)=>{const i=xe(this.options.pointLabels.callback,[n,r],this);return i||i===0?i:""}).filter((n,r)=>this.chart.getDataVisibility(r))}fit(){const t=this.options;t.display&&t.pointLabels.display?BR(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,n,r,i){this.xCenter+=Math.floor((t-n)/2),this.yCenter+=Math.floor((r-i)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,n,r,i))}getIndexAngle(t){const n=ke/(this._pointLabels.length||1),r=this.options.startAngle||0;return Ge(t*n+$t(r))}getDistanceFromCenterForValue(t){if(re(t))return NaN;const n=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*n:(t-this.min)*n}getValueForDistanceFromCenter(t){if(re(t))return NaN;const n=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-n:this.min+n}getPointLabelContext(t){const n=this._pointLabels||[];if(t>=0&&t<n.length){const r=n[t];return qR(this.getContext(),t,r)}}getPointPosition(t,n,r=0){const i=this.getIndexAngle(t)-De+r;return{x:Math.cos(i)*n+this.xCenter,y:Math.sin(i)*n+this.yCenter,angle:i}}getPointPositionForValue(t,n){return this.getPointPosition(t,this.getDistanceFromCenterForValue(n))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:n,top:r,right:i,bottom:s}=this._pointLabelItems[t];return{left:n,top:r,right:i,bottom:s}}drawBackground(){const{backgroundColor:t,grid:{circular:n}}=this.options;if(t){const r=this.ctx;r.save(),r.beginPath(),Wb(this,this.getDistanceFromCenterForValue(this._endValue),n,this._pointLabels.length),r.closePath(),r.fillStyle=t,r.fill(),r.restore()}}drawGrid(){const t=this.ctx,n=this.options,{angleLines:r,grid:i,border:s}=n,o=this._pointLabels.length;let a,l,c;if(n.pointLabels.display&&GR(this,o),i.display&&this.ticks.forEach((u,f)=>{if(f!==0||f===0&&this.min<0){l=this.getDistanceFromCenterForValue(u.value);const h=this.getContext(f),p=i.setContext(h),m=s.setContext(h);QR(this,p,l,o,m)}}),r.display){for(t.save(),a=o-1;a>=0;a--){const u=r.setContext(this.getPointLabelContext(a)),{color:f,lineWidth:h}=u;!h||!f||(t.lineWidth=h,t.strokeStyle=f,t.setLineDash(u.borderDash),t.lineDashOffset=u.borderDashOffset,l=this.getDistanceFromCenterForValue(n.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,n=this.options,r=n.ticks;if(!r.display)return;const i=this.getIndexAngle(0);let s,o;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(i),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&this.min>=0&&!n.reverse)return;const c=r.setContext(this.getContext(l)),u=Fe(c.font);if(s=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=u.string,o=t.measureText(a.label).width,t.fillStyle=c.backdropColor;const f=et(c.backdropPadding);t.fillRect(-o/2-f.left,-s-u.size/2-f.top,o+f.width,u.size+f.height)}Ir(t,a.label,0,-s,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}B(cs,"id","radialLinear"),B(cs,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Pl.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),B(cs,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),B(cs,"descriptors",{angleLines:{_fallback:"grid"}});const Rl={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}},ft=Object.keys(Rl);function tx(e,t){return e-t}function nx(e,t){if(re(t))return null;const n=e._adapter,{parser:r,round:i,isoWeekday:s}=e._parseOpts;let o=t;return typeof r=="function"&&(o=r(o)),Me(o)||(o=typeof r=="string"?n.parse(o,r):n.parse(o)),o===null?null:(i&&(o=i==="week"&&(Ci(s)||s===!0)?n.startOf(o,"isoWeek",s):n.startOf(o,i)),+o)}function rx(e,t,n,r){const i=ft.length;for(let s=ft.indexOf(e);s<i-1;++s){const o=Rl[ft[s]],a=o.steps?o.steps:Number.MAX_SAFE_INTEGER;if(o.common&&Math.ceil((n-t)/(a*o.size))<=r)return ft[s]}return ft[i-1]}function JR(e,t,n,r,i){for(let s=ft.length-1;s>=ft.indexOf(n);s--){const o=ft[s];if(Rl[o].common&&e._adapter.diff(i,r,o)>=t-1)return o}return ft[n?ft.indexOf(n):0]}function ZR(e){for(let t=ft.indexOf(e)+1,n=ft.length;t<n;++t)if(Rl[ft[t]].common)return ft[t]}function ix(e,t,n){if(!n)e[t]=!0;else if(n.length){const{lo:r,hi:i}=Ud(n,t),s=n[r]>=t?n[r]:n[i];e[s]=!0}}function eO(e,t,n,r){const i=e._adapter,s=+i.startOf(t[0].value,r),o=t[t.length-1].value;let a,l;for(a=s;a<=o;a=+i.add(a,1,r))l=n[a],l>=0&&(t[l].major=!0);return t}function sx(e,t,n){const r=[],i={},s=t.length;let o,a;for(o=0;o<s;++o)a=t[o],i[a]=o,r.push({value:a,major:!1});return s===0||!n?r:eO(e,r,i,n)}class io extends Vr{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,n={}){const r=t.time||(t.time={}),i=this._adapter=new lA._date(t.adapters.date);i.init(n),Ss(r.displayFormats,i.formats()),this._parseOpts={parser:r.parser,round:r.round,isoWeekday:r.isoWeekday},super.init(t),this._normalized=n.normalized}parse(t,n){return t===void 0?null:nx(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,n=this._adapter,r=t.time.unit||"day";let{min:i,max:s,minDefined:o,maxDefined:a}=this.getUserBounds();function l(c){!o&&!isNaN(c.min)&&(i=Math.min(i,c.min)),!a&&!isNaN(c.max)&&(s=Math.max(s,c.max))}(!o||!a)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),i=Me(i)&&!isNaN(i)?i:+n.startOf(Date.now(),r),s=Me(s)&&!isNaN(s)?s:+n.endOf(Date.now(),r)+1,this.min=Math.min(i,s-1),this.max=Math.max(i+1,s)}_getLabelBounds(){const t=this.getLabelTimestamps();let n=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY;return t.length&&(n=t[0],r=t[t.length-1]),{min:n,max:r}}buildTicks(){const t=this.options,n=t.time,r=t.ticks,i=r.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&i.length&&(this.min=this._userMin||i[0],this.max=this._userMax||i[i.length-1]);const s=this.min,o=this.max,a=DT(i,s,o);return this._unit=n.unit||(r.autoSkip?rx(n.minUnit,this.min,this.max,this._getLabelCapacity(s)):JR(this,a.length,n.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:ZR(this._unit),this.initOffsets(i),t.reverse&&a.reverse(),sx(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let n=0,r=0,i,s;this.options.offset&&t.length&&(i=this.getDecimalForValue(t[0]),t.length===1?n=1-i:n=(this.getDecimalForValue(t[1])-i)/2,s=this.getDecimalForValue(t[t.length-1]),t.length===1?r=s:r=(s-this.getDecimalForValue(t[t.length-2]))/2);const o=t.length<3?.5:.25;n=$e(n,0,o),r=$e(r,0,o),this._offsets={start:n,end:r,factor:1/(n+1+r)}}_generate(){const t=this._adapter,n=this.min,r=this.max,i=this.options,s=i.time,o=s.unit||rx(s.minUnit,n,r,this._getLabelCapacity(n)),a=Z(i.ticks.stepSize,1),l=o==="week"?s.isoWeekday:!1,c=Ci(l)||l===!0,u={};let f=n,h,p;if(c&&(f=+t.startOf(f,"isoWeek",l)),f=+t.startOf(f,c?"day":o),t.diff(r,n,o)>1e5*a)throw new Error(n+" and "+r+" are too far apart with stepSize of "+a+" "+o);const m=i.ticks.source==="data"&&this.getDataTimestamps();for(h=f,p=0;h<r;h=+t.add(h,a,o),p++)ix(u,h,m);return(h===r||i.bounds==="ticks"||p===1)&&ix(u,h,m),Object.keys(u).sort(tx).map(g=>+g)}getLabelForValue(t){const n=this._adapter,r=this.options.time;return r.tooltipFormat?n.format(t,r.tooltipFormat):n.format(t,r.displayFormats.datetime)}format(t,n){const i=this.options.time.displayFormats,s=this._unit,o=n||i[s];return this._adapter.format(t,o)}_tickFormatFunction(t,n,r,i){const s=this.options,o=s.ticks.callback;if(o)return xe(o,[t,n,r],this);const a=s.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&a[l],f=c&&a[c],h=r[n],p=c&&f&&h&&h.major;return this._adapter.format(t,i||(p?f:u))}generateTickLabels(t){let n,r,i;for(n=0,r=t.length;n<r;++n)i=t[n],i.label=this._tickFormatFunction(i.value,n,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const n=this._offsets,r=this.getDecimalForValue(t);return this.getPixelForDecimal((n.start+r)*n.factor)}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return this.min+r*(this.max-this.min)}_getLabelSize(t){const n=this.options.ticks,r=this.ctx.measureText(t).width,i=$t(this.isHorizontal()?n.maxRotation:n.minRotation),s=Math.cos(i),o=Math.sin(i),a=this._resolveTickFontOptions(0).size;return{w:r*s+a*o,h:r*o+a*s}}_getLabelCapacity(t){const n=this.options.time,r=n.displayFormats,i=r[n.unit]||r.millisecond,s=this._tickFormatFunction(t,0,sx(this,[t],this._majorUnit),i),o=this._getLabelSize(s),a=Math.floor(this.isHorizontal()?this.width/o.w:this.height/o.h)-1;return a>0?a:1}getDataTimestamps(){let t=this._cache.data||[],n,r;if(t.length)return t;const i=this.getMatchingVisibleMetas();if(this._normalized&&i.length)return this._cache.data=i[0].controller.getAllParsedValues(this);for(n=0,r=i.length;n<r;++n)t=t.concat(i[n].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let n,r;if(t.length)return t;const i=this.getLabels();for(n=0,r=i.length;n<r;++n)t.push(nx(this,i[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return tb(t.sort(tx))}}B(io,"id","time"),B(io,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});function Go(e,t,n){let r=0,i=e.length-1,s,o,a,l;n?(t>=e[r].pos&&t<=e[i].pos&&({lo:r,hi:i}=bn(e,"pos",t)),{pos:s,time:a}=e[r],{pos:o,time:l}=e[i]):(t>=e[r].time&&t<=e[i].time&&({lo:r,hi:i}=bn(e,"time",t)),{time:s,pos:a}=e[r],{time:o,pos:l}=e[i]);const c=o-s;return c?a+(l-a)*(t-s)/c:a}class yf extends io{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(t);this._minPos=Go(n,this.min),this._tableRange=Go(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:n,max:r}=this,i=[],s=[];let o,a,l,c,u;for(o=0,a=t.length;o<a;++o)c=t[o],c>=n&&c<=r&&i.push(c);if(i.length<2)return[{time:n,pos:0},{time:r,pos:1}];for(o=0,a=i.length;o<a;++o)u=i[o+1],l=i[o-1],c=i[o],Math.round((u+l)/2)!==c&&s.push({time:c,pos:o/(a-1)});return s}_generate(){const t=this.min,n=this.max;let r=super.getDataTimestamps();return(!r.includes(t)||!r.length)&&r.splice(0,0,t),(!r.includes(n)||r.length===1)&&r.push(n),r.sort((i,s)=>i-s)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const n=this.getDataTimestamps(),r=this.getLabelTimestamps();return n.length&&r.length?t=this.normalize(n.concat(r)):t=n.length?n:r,t=this._cache.all=t,t}getDecimalForValue(t){return(Go(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return Go(this._table,r*this._tableRange+this._minPos,!0)}}B(yf,"id","timeseries"),B(yf,"defaults",io.defaults);var tO=Object.freeze({__proto__:null,CategoryScale:pf,LinearScale:mf,LogarithmicScale:gf,RadialLinearScale:cs,TimeScale:io,TimeSeriesScale:yf});const nO=[aA,IL,DR,tO];tn.register(...nO);function vt(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)}function rt(e,t=1){if(typeof document>"u")return`rgba(0,0,0,${t})`;const n=getComputedStyle(document.documentElement).getPropertyValue(`--${e}`).trim();return n?`rgba(${n.split(/\s+/).join(", ")}, ${t})`:`rgba(0,0,0,${t})`}function rO({data:e}){const t=C.useRef(null),n=C.useRef(null);return C.useEffect(()=>{if(!(!t.current||e.daily.length===0))return n.current&&n.current.destroy(),n.current=new tn(t.current,{type:"bar",data:{labels:e.daily.map(r=>r.date.slice(5)),datasets:[{label:"Input",data:e.daily.map(r=>r.inputTokens),backgroundColor:rt("primary",.75),borderRadius:2},{label:"Output",data:e.daily.map(r=>r.outputTokens),backgroundColor:rt("info",.7),borderRadius:2},{label:"Cache Read",data:e.daily.map(r=>r.cacheReadTokens),backgroundColor:rt("success",.45),borderRadius:2},{label:"Cache Write",data:e.daily.map(r=>r.cacheCreateTokens),backgroundColor:rt("tertiary-fixed",.75),borderRadius:2}]},options:{responsive:!0,maintainAspectRatio:!1,plugins:{legend:{position:"bottom",labels:{color:rt("on-surface-variant"),font:{size:10,family:"monospace"},boxWidth:12}},tooltip:{callbacks:{label:r=>`${r.dataset.label}: ${vt(r.raw)} tokens`}}},scales:{x:{stacked:!0,grid:{color:rt("outline-variant",.3)},ticks:{color:rt("on-surface-variant"),font:{size:9,family:"monospace"}}},y:{stacked:!0,grid:{color:rt("outline-variant",.3)},ticks:{color:rt("on-surface-variant"),font:{size:9,family:"monospace"},callback:r=>vt(r)}}}}}),()=>{var r;(r=n.current)==null||r.destroy()}},[e]),d.jsx("canvas",{ref:t})}function iO({data:e}){const t=C.useRef(null),n=C.useRef(null);return C.useEffect(()=>{if(!(!t.current||e.daily.length===0))return n.current&&n.current.destroy(),n.current=new tn(t.current,{type:"bar",data:{labels:e.daily.map(r=>r.date.slice(5)),datasets:[{label:"Est. Cost (USD)",data:e.daily.map(r=>Number(r.estimatedCostUsd.toFixed(2))),backgroundColor:rt("secondary",.75),borderRadius:2}]},options:{responsive:!0,maintainAspectRatio:!1,plugins:{legend:{labels:{color:rt("on-surface-variant"),font:{size:10,family:"monospace"},boxWidth:12}},tooltip:{callbacks:{label:r=>`$${r.raw.toFixed(2)}`}}},scales:{x:{grid:{color:rt("outline-variant",.3)},ticks:{color:rt("on-surface-variant"),font:{size:9,family:"monospace"}}},y:{grid:{color:rt("outline-variant",.3)},ticks:{color:rt("on-surface-variant"),font:{size:9,family:"monospace"},callback:r=>`$${r}`}}}}}),()=>{var r;(r=n.current)==null||r.destroy()}},[e]),d.jsx("canvas",{ref:t})}function sO({agentId:e}){const[t,n]=C.useState(null),[r,i]=C.useState(30),[s,o]=C.useState(!0);if(C.useEffect(()=>{o(!0),s_(e,r).then(n).catch(console.error).finally(()=>o(!1))},[e,r]),s||!t)return d.jsx("div",{className:"text-on-surface-variant/70 text-xs p-6",children:"Scanning sessions..."});const a=Object.entries(t.byModel).sort((l,c)=>c[1].estimatedCostUsd-l[1].estimatedCostUsd);return d.jsxs("div",{className:"flex flex-col h-full w-full min-w-0 bg-background",children:[d.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-outline-variant/30",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"text-[13px] opacity-60",children:"📊"}),d.jsx("span",{className:"text-[11px] uppercase tracking-[0.14em] font-medium text-on-surface-variant",children:"Usage"})]}),d.jsx("div",{className:"flex items-center gap-1",children:[7,14,30].map(l=>d.jsxs("button",{onClick:()=>i(l),className:`px-2 py-0.5 rounded text-[9px] font-mono transition-colors ${r===l?"bg-primary/20 text-primary":"text-on-surface-variant/70 hover:text-on-surface-variant/70"}`,children:[l,"d"]},l))})]}),d.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-4 scrollbar-thin",children:[d.jsxs("div",{className:"grid grid-cols-4 gap-3",children:[d.jsxs("div",{className:"rounded-lg bg-surface-container-lowest border border-outline-variant/40 p-4",children:[d.jsx("p",{className:"text-[9px] uppercase text-on-surface-variant/60 mb-1.5",children:"Total Tokens"}),d.jsx("p",{className:"font-mono text-[20px] text-on-surface/80",children:vt(t.totalInputTokens+t.totalOutputTokens)}),d.jsxs("p",{className:"font-mono text-[9px] text-on-surface-variant/60 mt-1",children:[vt(t.totalCacheReadTokens+t.totalCacheCreateTokens)," cached"]})]}),d.jsxs("div",{className:"rounded-lg bg-surface-container-lowest border border-outline-variant/40 p-4",children:[d.jsx("p",{className:"text-[9px] uppercase text-on-surface-variant/60 mb-1.5",children:"Sessions"}),d.jsx("p",{className:"font-mono text-[20px] text-on-surface/80",children:t.totalSessions}),d.jsxs("p",{className:"font-mono text-[9px] text-on-surface-variant/60 mt-1",children:[Object.keys(t.byModel).length," models"]})]}),d.jsxs("div",{className:"rounded-lg bg-surface-container-lowest border border-outline-variant/40 p-4",children:[d.jsx("p",{className:"text-[9px] uppercase text-on-surface-variant/60 mb-1.5",children:"Est. Cost"}),d.jsxs("p",{className:"font-mono text-[20px] text-error/80",children:["$",t.totalEstimatedCostUsd.toFixed(2)]}),d.jsxs("p",{className:"font-mono text-[9px] text-on-surface-variant/60 mt-1",children:[r," day period"]})]}),d.jsxs("div",{className:"rounded-lg bg-surface-container-lowest border border-outline-variant/40 p-4",children:[d.jsx("p",{className:"text-[9px] uppercase text-on-surface-variant/60 mb-1.5",children:"Avg/Day"}),d.jsxs("p",{className:"font-mono text-[20px] text-warning/80",children:["$",t.daily.length>0?(t.totalEstimatedCostUsd/t.daily.length).toFixed(2):"0.00"]}),d.jsxs("p",{className:"font-mono text-[9px] text-on-surface-variant/60 mt-1",children:[t.daily.length>0?Math.round(t.totalSessions/t.daily.length):0," sessions/day"]})]})]}),d.jsxs("div",{children:[d.jsx("p",{className:"text-[8px] uppercase tracking-[0.18em] text-on-surface-variant/35 font-semibold mb-2",children:"Daily Token Usage"}),d.jsx("div",{className:"rounded-lg bg-surface-container-lowest border border-outline-variant/40 p-4",style:{height:"300px"},children:t.daily.length>0?d.jsx(rO,{data:t}):d.jsx("p",{className:"text-on-surface-variant/25 text-xs text-center pt-20",children:"No usage data"})})]}),d.jsxs("div",{children:[d.jsx("p",{className:"text-[8px] uppercase tracking-[0.18em] text-on-surface-variant/35 font-semibold mb-2",children:"Daily Estimated Cost"}),d.jsx("div",{className:"rounded-lg bg-surface-container-lowest border border-outline-variant/40 p-4",style:{height:"250px"},children:t.daily.length>0?d.jsx(iO,{data:t}):d.jsx("p",{className:"text-on-surface-variant/25 text-xs text-center pt-16",children:"No cost data"})})]}),a.length>0&&d.jsxs("div",{children:[d.jsx("p",{className:"text-[8px] uppercase tracking-[0.18em] text-on-surface-variant/35 font-semibold mb-2",children:"By Model"}),d.jsx("div",{className:"space-y-1",children:a.map(([l,c])=>d.jsxs("div",{className:"rounded bg-surface-container-lowest border border-outline-variant/40 p-2.5 flex items-center gap-3",children:[d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("span",{className:"font-mono text-[10px] text-on-surface/70 truncate block",children:l}),d.jsxs("span",{className:"font-mono text-[9px] text-on-surface-variant/60",children:[c.sessions," sessions · ",vt(c.inputTokens)," in · ",vt(c.outputTokens)," out"]})]}),d.jsxs("span",{className:"font-mono text-[10px] text-error/60 flex-shrink-0",children:["$",c.estimatedCostUsd.toFixed(2)]})]},l))})]}),d.jsxs("div",{children:[d.jsx("p",{className:"text-[8px] uppercase tracking-[0.18em] text-on-surface-variant/35 font-semibold mb-2",children:"Token Breakdown"}),d.jsxs("div",{className:"rounded bg-surface-container-lowest border border-outline-variant/40 p-3 space-y-1.5",children:[d.jsxs("div",{className:"flex justify-between",children:[d.jsx("span",{className:"font-mono text-[10px] text-on-surface-variant",children:"Input tokens"}),d.jsx("span",{className:"font-mono text-[10px] text-primary",children:vt(t.totalInputTokens)})]}),d.jsxs("div",{className:"flex justify-between",children:[d.jsx("span",{className:"font-mono text-[10px] text-on-surface-variant",children:"Output tokens"}),d.jsx("span",{className:"font-mono text-[10px] text-info",children:vt(t.totalOutputTokens)})]}),d.jsxs("div",{className:"flex justify-between",children:[d.jsx("span",{className:"font-mono text-[10px] text-on-surface-variant",children:"Cache read"}),d.jsx("span",{className:"font-mono text-[10px] text-success",children:vt(t.totalCacheReadTokens)})]}),d.jsxs("div",{className:"flex justify-between",children:[d.jsx("span",{className:"font-mono text-[10px] text-on-surface-variant",children:"Cache write"}),d.jsx("span",{className:"font-mono text-[10px] text-warning",children:vt(t.totalCacheCreateTokens)})]})]})]}),Object.keys(t.byTool).length>0&&d.jsxs("div",{children:[d.jsx("p",{className:"text-[8px] uppercase tracking-[0.18em] text-on-surface-variant/35 font-semibold mb-2",children:"Tool Invocations"}),d.jsx("div",{className:"rounded-lg bg-surface-container-lowest border border-outline-variant/40 p-3 space-y-1",children:Object.entries(t.byTool).sort((l,c)=>c[1]-l[1]).map(([l,c])=>{const u=Math.max(...Object.values(t.byTool));return d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"font-mono text-[10px] text-on-surface-variant w-40 truncate flex-shrink-0",title:l,children:l}),d.jsx("div",{className:"flex-1 h-3 rounded-sm bg-background overflow-hidden",children:d.jsx("div",{className:"h-full rounded-sm bg-primary/40",style:{width:`${c/u*100}%`}})}),d.jsx("span",{className:"font-mono text-[9px] text-on-surface-variant/70 w-8 text-right flex-shrink-0",children:c})]},l)})})]}),d.jsxs("div",{children:[d.jsx("p",{className:"text-[8px] uppercase tracking-[0.18em] text-on-surface-variant/35 font-semibold mb-2",children:"Daily Breakdown"}),d.jsx("div",{className:"rounded-lg bg-surface-container-lowest border border-outline-variant/40 overflow-hidden",children:d.jsxs("table",{className:"w-full",children:[d.jsx("thead",{children:d.jsxs("tr",{className:"border-b border-outline-variant/30",children:[d.jsx("th",{className:"px-3 py-2 text-left text-[9px] font-mono text-on-surface-variant/70 font-medium",children:"Date"}),d.jsx("th",{className:"px-3 py-2 text-right text-[9px] font-mono text-on-surface-variant/70 font-medium",children:"Sessions"}),d.jsx("th",{className:"px-3 py-2 text-right text-[9px] font-mono text-on-surface-variant/70 font-medium",children:"Input"}),d.jsx("th",{className:"px-3 py-2 text-right text-[9px] font-mono text-on-surface-variant/70 font-medium",children:"Output"}),d.jsx("th",{className:"px-3 py-2 text-right text-[9px] font-mono text-on-surface-variant/70 font-medium",children:"Cache"}),d.jsx("th",{className:"px-3 py-2 text-right text-[9px] font-mono text-on-surface-variant/70 font-medium",children:"Cost"})]})}),d.jsx("tbody",{children:[...t.daily].reverse().map(l=>d.jsxs("tr",{className:"border-b border-white/[0.03] hover:bg-white/[0.02]",children:[d.jsx("td",{className:"px-3 py-1.5 font-mono text-[10px] text-on-surface/70",children:l.date}),d.jsx("td",{className:"px-3 py-1.5 font-mono text-[10px] text-on-surface-variant text-right",children:l.sessions}),d.jsx("td",{className:"px-3 py-1.5 font-mono text-[10px] text-primary text-right",children:vt(l.inputTokens)}),d.jsx("td",{className:"px-3 py-1.5 font-mono text-[10px] text-info text-right",children:vt(l.outputTokens)}),d.jsx("td",{className:"px-3 py-1.5 font-mono text-[10px] text-success text-right",children:vt(l.cacheReadTokens+l.cacheCreateTokens)}),d.jsxs("td",{className:"px-3 py-1.5 font-mono text-[10px] text-error/60 text-right",children:["$",l.estimatedCostUsd.toFixed(2)]})]},l.date))})]})})]})]})]})}function oO(e){const t=e.createdAt??e.created_at;return{_id:e._id??e.id,agentId:e.agentId??e.agent_id??"",type:e.type,input:e.input,output:e.output,durationMs:e.durationMs??e.duration_ms,createdAt:typeof t=="number"?new Date(t).toISOString():t??""}}const aO=[{label:"All",value:"default",color:""},{label:"MSG",value:"message",color:"bg-emerald-500"},{label:"TOOL",value:"tool_call",color:"bg-blue-500"},{label:"ERR",value:"error",color:"bg-red-500"},{label:"SYS",value:"system",color:"bg-gray-500"}];function lO(e){return{message:"text-success",tool_call:"text-info",tool_result:"text-info/60",error:"text-error",system:"text-gray-500"}[e]??"text-gray-500"}function cO(e){return{message:"bg-emerald-500/10",tool_call:"bg-blue-500/10",tool_result:"bg-blue-500/5",error:"bg-red-500/10",system:""}[e]??""}function uO(e){return{message:"bg-emerald-400",tool_call:"bg-blue-400",tool_result:"bg-blue-400/60",error:"bg-red-400",system:"bg-gray-600"}[e]??"bg-gray-600"}function fO(e){const t=new Date(e),n=new Date,r=t.toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"});return t.toDateString()!==n.toDateString()?`${t.toLocaleDateString("en-US",{month:"short",day:"numeric"})} ${r}`:r}function Es(e){if(typeof e=="string")try{return JSON.parse(e)}catch{return e}return e}function dO(e){const t=Es(e.input),n=Es(e.output);if(e.type==="message"){const r=(t==null?void 0:t.text)??"";return String(r)||"(no text)"}if(e.type==="tool_call"){const r=(t==null?void 0:t.tool)??(t==null?void 0:t.tool_name)??(t==null?void 0:t.name)??"",i=(t==null?void 0:t.description)??"";if(r){({...t});const s=Es(t==null?void 0:t.input),o=s?Object.values(s).map(l=>String(l).slice(0,60)).join(", ").slice(0,80):"",a=o?`${r}(${o})`:String(r);return i?`${a} — ${i}`:a}return JSON.stringify(t??{}).slice(0,200)}if(e.type==="tool_result")return JSON.stringify(n??{}).slice(0,200);if(e.type==="error")return String((n==null?void 0:n.message)??n??"unknown error");if(e.type==="system"){const r=n==null?void 0:n.exitCode;return r!==void 0?`process exited (${r})`:"—"}return JSON.stringify(n??{}).slice(0,200)}function hO(e,t){if(!t)return e;const n=e.toLowerCase().indexOf(t.toLowerCase());return n===-1?e:d.jsxs(d.Fragment,{children:[e.slice(0,n),d.jsx("mark",{className:"bg-yellow-400/30 text-yellow-200 rounded-sm px-0.5",children:e.slice(n,n+t.length)}),e.slice(n+t.length)]})}function pO({agentId:e}){const[t,n]=C.useState("default"),[r,i]=C.useState(""),[s,o]=C.useState(""),[a,l]=C.useState([]),[c,u]=C.useState(0),[f,h]=C.useState(!0),[p,m]=C.useState(new Set),[g,v]=C.useState(100),[x,y]=C.useState(!0),b=C.useRef(null),k=C.useRef(null),S=()=>o(r),w=C.useCallback(()=>{g_({agentId:e,type:t==="default"||t==="all"?void 0:t,search:s||void 0,limit:g}).then(M=>{let j=M.items.map(oO);t==="default"&&(j=j.filter(D=>D.type!=="system")),l(j),u(M.total)}).catch(console.error).finally(()=>h(!1))},[e,t,s,g]);C.useEffect(()=>{h(!0),w()},[w]),C.useEffect(()=>{if(!x)return;const M=setInterval(w,3e3);return()=>clearInterval(M)},[x,w]);const E=M=>{m(j=>{const D=new Set(j);return D.has(M)?D.delete(M):D.add(M),D})},P=a;return d.jsxs("div",{className:"flex flex-col h-full w-full min-w-0 rounded-lg overflow-hidden bg-surface-container-lowest",children:[d.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 border-b border-outline-variant/30 bg-background",children:[d.jsxs("div",{className:"flex-1 flex items-center gap-1.5",children:[d.jsxs("div",{className:"flex-1 relative",children:[d.jsx("svg",{className:"absolute left-2.5 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-on-surface-variant/60",viewBox:"0 0 20 20",fill:"currentColor",children:d.jsx("path",{fillRule:"evenodd",d:"M9 3.5a5.5 5.5 0 100 11 5.5 5.5 0 000-11zM2 9a7 7 0 1112.452 4.391l3.328 3.329a.75.75 0 11-1.06 1.06l-3.329-3.328A7 7 0 012 9z",clipRule:"evenodd"})}),d.jsx("input",{className:"w-full bg-surface-container-lowest rounded pl-8 pr-7 py-1.5 text-[11px] text-on-surface font-mono placeholder:text-on-surface-variant/25 outline-none focus:ring-1 focus:ring-primary/30 transition-shadow",placeholder:"Search logs...",value:r,onChange:M=>i(M.target.value),onKeyDown:M=>M.key==="Enter"&&S()}),r&&d.jsx("button",{onClick:()=>{i(""),o("")},className:"absolute right-2 top-1/2 -translate-y-1/2 text-on-surface-variant hover:text-on-surface text-xs",children:"x"})]}),d.jsx("button",{onClick:S,disabled:r===s,className:"px-2.5 py-1.5 rounded bg-primary/20 text-[10px] font-mono text-primary transition-colors hover:bg-primary/30 disabled:opacity-30 disabled:cursor-default flex-shrink-0",children:"Apply"})]}),d.jsx("div",{className:"flex items-center gap-0.5",children:aO.map(({label:M,value:j,color:D})=>d.jsxs("button",{onClick:()=>n(j),className:`flex items-center gap-1 px-2 py-1 rounded text-[9px] font-mono transition-colors ${t===j?"bg-surface-container-high text-on-surface":"text-on-surface-variant hover:text-on-surface hover:bg-surface-container/50"}`,children:[D&&d.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${D}`}),M]},j))}),d.jsxs("button",{onClick:()=>y(M=>!M),className:`flex items-center gap-1.5 px-2 py-1 rounded text-[9px] font-mono transition-colors ${x?"bg-success/15 text-success":"text-on-surface-variant hover:text-on-surface"}`,children:[d.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${x?"bg-success animate-pulse":"bg-outline/60"}`}),"Live"]}),d.jsxs("span",{className:"font-mono text-[9px] text-on-surface-variant tabular-nums",children:[a.length,"/",c]})]}),d.jsx("div",{ref:k,className:"flex-1 overflow-y-auto scrollbar-thin font-mono text-[11px]",children:f&&a.length===0?d.jsx("div",{className:"flex items-center justify-center h-full",children:d.jsx("span",{className:"text-on-surface-variant text-[10px]",children:"loading..."})}):P.length===0?d.jsx("div",{className:"flex items-center justify-center h-full",children:d.jsx("span",{className:"text-on-surface-variant text-[10px]",children:r?`no results for "${r}"`:"no log entries"})}):d.jsxs("div",{className:"py-1",children:[P.map(M=>{const j=p.has(M._id),D=dO(M);return d.jsxs("div",{onClick:()=>E(M._id),className:`group px-3 py-[5px] cursor-pointer transition-colors hover:bg-surface-container/40 ${cO(M.type)} ${j?"bg-surface-container/30":""}`,children:[d.jsxs("div",{className:"flex items-start gap-2 leading-relaxed",children:[d.jsx("span",{className:`mt-[6px] w-[5px] h-[5px] rounded-full flex-shrink-0 ${uO(M.type)}`}),d.jsx("span",{className:"text-on-surface-variant flex-shrink-0 w-[70px] tabular-nums",children:fO(M.createdAt)}),d.jsx("span",{className:`flex-shrink-0 w-[52px] uppercase text-[9px] ${lO(M.type)}`,children:M.type==="tool_call"?"tool":M.type==="tool_result"?"result":M.type}),d.jsx("span",{className:`flex-1 min-w-0 ${j?"":"truncate"} ${M.type==="error"?"text-error":"text-on-surface"}`,children:hO(D,s)}),M.durationMs!=null&&d.jsx("span",{className:"flex-shrink-0 text-[9px] text-on-surface-variant tabular-nums",children:M.durationMs>1e3?`${(M.durationMs/1e3).toFixed(1)}s`:`${M.durationMs}ms`}),d.jsx("span",{className:"flex-shrink-0 text-[8px] text-on-surface-variant opacity-0 group-hover:opacity-100 transition-opacity",children:j?"−":"+"})]}),j&&d.jsxs("div",{className:"ml-[79px] mt-1.5 mb-1 space-y-1.5",children:[!!M.input&&M.input!=="null"&&d.jsxs("div",{children:[d.jsx("span",{className:"font-label text-[8px] uppercase tracking-wider text-on-surface-variant",children:"input"}),d.jsx("pre",{className:"text-[10px] text-on-surface mt-0.5 bg-surface-container-high rounded px-2.5 py-1.5 overflow-auto max-h-48 whitespace-pre-wrap break-words",children:JSON.stringify(Es(M.input),null,2)})]}),!!M.output&&M.output!=="null"&&d.jsxs("div",{children:[d.jsx("span",{className:"font-label text-[8px] uppercase tracking-wider text-on-surface-variant",children:"output"}),d.jsx("pre",{className:"text-[10px] text-on-surface mt-0.5 bg-surface-container-high rounded px-2.5 py-1.5 overflow-auto max-h-48 whitespace-pre-wrap break-words",children:JSON.stringify(Es(M.output),null,2)})]})]})]},M._id)}),a.length<c&&d.jsx("div",{className:"px-3 py-2 text-center",children:d.jsxs("button",{onClick:()=>v(M=>M+100),className:"text-[9px] text-primary/40 hover:text-primary/70 transition-colors",children:["Load ",Math.min(100,c-a.length)," older entries..."]})}),d.jsx("div",{ref:b})]})})]})}const mO=[{id:"telegram",name:"Telegram",description:"Receive and reply to messages via a Telegram bot.",icon:"✈️",secretKey:"TELEGRAM_BOT_TOKEN",tokenLabel:"Bot Token",tokenPlaceholder:"110201543:AAHdqTcvCH1vGWJxfSeofSAs0K5PALDsaw",helpText:"Create a bot via @BotFather on Telegram, then paste the token here."}],ox="w-full rounded bg-surface-container px-3 py-2 text-[11px] text-on-surface placeholder:text-on-surface-variant/40 outline-none focus:ring-1 focus:ring-primary/25 font-mono transition-shadow";function gO({def:e,agentId:t,enabled:n,onEnable:r,onDisable:i}){const[s,o]=C.useState(!1),[a,l]=C.useState(""),[c,u]=C.useState(!1),[f,h]=C.useState(null);async function p(){if(!a.trim()){h("Token is required");return}u(!0),h(null);try{await Bu(t,e.secretKey,a.trim()),r(e.secretKey),o(!1),l("")}catch{h("Failed to save — check the console")}finally{u(!1)}}async function m(){confirm(`Disconnect ${e.name}? The agent will stop using it immediately.`)&&(await R0(t,e.secretKey),i(e.secretKey))}return d.jsxs("div",{className:"rounded-lg bg-surface-container-lowest border border-outline-variant/40 p-4 space-y-3",children:[d.jsxs("div",{className:"flex items-start justify-between gap-3",children:[d.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[d.jsx("span",{className:"text-[20px] flex-shrink-0",children:e.icon}),d.jsxs("div",{className:"min-w-0",children:[d.jsx("p",{className:"text-[13px] font-semibold text-on-surface",children:e.name}),d.jsx("p",{className:"font-mono text-[10px] text-on-surface-variant/70 mt-0.5 leading-relaxed",children:e.description})]})]}),d.jsx("div",{className:"flex-shrink-0 flex items-center gap-2",children:n?d.jsxs(d.Fragment,{children:[d.jsxs("span",{className:"font-mono text-[9px] text-secondary/80 flex items-center gap-1",children:[d.jsx("span",{className:"inline-block w-1.5 h-1.5 rounded-full bg-secondary/70"}),"Connected"]}),d.jsx("button",{onClick:m,className:"rounded px-2 py-1 text-[10px] font-mono text-error/50 hover:text-error hover:bg-error/10 transition-colors",children:"Disconnect"})]}):d.jsx("button",{onClick:()=>{o(!0),h(null)},className:"rounded bg-primary/10 border border-primary/20 px-3 py-1 text-[11px] font-medium text-primary hover:bg-primary/20 transition-colors",children:"Connect"})})]}),!n&&s&&d.jsxs("div",{className:"pt-2 border-t border-outline-variant/30 space-y-3",children:[d.jsxs("div",{children:[d.jsx("label",{className:"block text-[10px] uppercase tracking-[0.14em] text-on-surface-variant font-medium mb-1.5",children:e.tokenLabel}),d.jsx("input",{type:"password",className:ox,placeholder:e.tokenPlaceholder,value:a,onChange:g=>{l(g.target.value),h(null)},autoComplete:"off",autoFocus:!0}),d.jsx("p",{className:"font-mono text-[9px] text-on-surface-variant/50 mt-1.5 leading-relaxed",children:e.helpText})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("button",{onClick:p,disabled:c||!a.trim(),className:"rounded bg-primary px-3 py-1.5 text-[12px] font-medium text-on-primary transition-opacity disabled:opacity-40 hover:opacity-90",children:c?"Saving…":"Save & Connect"}),d.jsx("button",{onClick:()=>{o(!1),l(""),h(null)},className:"rounded px-3 py-1.5 text-[12px] font-mono text-on-surface-variant hover:text-on-surface transition-colors",children:"Cancel"}),f&&d.jsx("span",{className:"font-mono text-[10px] text-error",children:f})]})]}),n&&s&&d.jsxs("div",{className:"pt-2 border-t border-outline-variant/30 space-y-3",children:[d.jsxs("div",{children:[d.jsxs("label",{className:"block text-[10px] uppercase tracking-[0.14em] text-on-surface-variant font-medium mb-1.5",children:["New ",e.tokenLabel]}),d.jsx("input",{type:"password",className:ox,placeholder:"Paste new token",value:a,onChange:g=>{l(g.target.value),h(null)},autoComplete:"off",autoFocus:!0})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("button",{onClick:p,disabled:c||!a.trim(),className:"rounded bg-primary px-3 py-1.5 text-[12px] font-medium text-on-primary transition-opacity disabled:opacity-40 hover:opacity-90",children:c?"Saving…":"Update Token"}),d.jsx("button",{onClick:()=>{o(!1),l(""),h(null)},className:"rounded px-3 py-1.5 text-[12px] font-mono text-on-surface-variant hover:text-on-surface transition-colors",children:"Cancel"}),f&&d.jsx("span",{className:"font-mono text-[10px] text-error",children:f})]})]}),n&&!s&&d.jsx("button",{onClick:()=>{o(!0),h(null)},className:"font-mono text-[10px] text-on-surface-variant/50 hover:text-on-surface-variant transition-colors",children:"Rotate token"})]})}function xO({agentId:e,secretNames:t,setSecretNames:n}){return d.jsxs("div",{className:"flex flex-col gap-4 max-w-xl",children:[d.jsxs("div",{children:[d.jsx("h2",{className:"font-headline text-[22px] font-bold text-on-surface",children:"Integrations"}),d.jsx("p",{className:"font-mono text-[11px] text-on-surface-variant/70 mt-1",children:"Connect external services. Each integration stores a token as a secret and activates automatically."})]}),d.jsx("div",{className:"space-y-3",children:mO.map(r=>d.jsx(gO,{def:r,agentId:e,enabled:t.includes(r.secretKey),onEnable:i=>n(s=>s.includes(i)?s:[...s,i]),onDisable:i=>n(s=>s.filter(o=>o!==i))},r.id))}),d.jsx("p",{className:"font-mono text-[10px] text-on-surface-variant/40 mt-2",children:"More integrations coming soon. For other API keys and credentials, use the Secrets section in the sidebar."})]})}const yO=["chat","files","tasks","browser","workflows","schedules","monitor","usage","logs","integrations"];function vO(){return d.jsx("span",{className:"inline-flex items-end gap-[3px] h-4",children:[0,1,2].map(e=>d.jsx("span",{className:"block w-1.5 h-1.5 rounded-full bg-current",style:{animation:`heartbeat-dot 1.2s ease-in-out ${e*.2}s infinite`}},e))})}function Vc({className:e=""}){return d.jsx("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",children:d.jsx("path",{d:"M12 2L3 7v5c0 5.25 3.75 10.15 9 11.25C17.25 22.15 21 17.25 21 12V7L12 2z"})})}function bO({toolCalls:e,isStreaming:t}){const[n,r]=C.useState(!1),i=e.length,s=a=>{const l=a.match(/^([^(]+)/);return l?l[1]:a},o=s(e[i-1]??"");return d.jsxs("div",{className:"w-full max-w-xl",children:[d.jsxs("button",{onClick:()=>r(a=>!a),className:"flex items-center gap-2 px-2 py-1 rounded hover:bg-surface-dim/50 transition-colors w-full text-left",children:[t?d.jsx("span",{className:"h-3 w-3 rounded-full border-2 border-primary/40 border-t-primary animate-spin flex-shrink-0"}):d.jsx("span",{className:"text-[10px] text-primary/60 flex-shrink-0",children:"⚙"}),d.jsx("span",{className:"font-mono text-[10px] text-on-surface-variant flex-1 truncate",children:t?`Running ${o}…`:`${i} tool call${i!==1?"s":""}`}),d.jsx("svg",{className:"w-2.5 h-2.5 text-on-surface-variant/60 transition-transform duration-150 flex-shrink-0",style:{transform:n?"rotate(90deg)":"none"},viewBox:"0 0 16 16",fill:"currentColor",children:d.jsx("path",{d:"M6 3l5 5-5 5V3z"})})]}),n&&d.jsx("div",{className:"mt-1 rounded bg-surface-dim/50 overflow-y-auto scrollbar-thin",style:{maxHeight:"10rem"},children:e.map((a,l)=>d.jsxs("div",{className:"font-mono text-[9px] text-on-surface-variant/70 px-2.5 py-1 border-b border-white/[0.03] last:border-0 truncate hover:text-on-surface-variant/60 transition-colors",title:a,children:[d.jsx("span",{className:"text-primary/50",children:s(a)}),d.jsx("span",{className:"text-on-surface-variant/20 ml-1",children:a.slice(s(a).length)})]},l))})]})}function wO(){var H;const{id:e="","*":t=""}=E0(),n=Br(),r=(()=>{if(!t||t==="chat")return"chat";const _=t.match(/^view\/([\w-]+)$/);return _&&yO.includes(_[1])?_[1]:"chat"})(),i=_=>{_==="chat"?n(`/agents/${e}/chat`,{replace:!0}):n(`/agents/${e}/view/${_}`,{replace:!0})},[s,o]=C.useState(null),[a,l]=C.useState(null),[c,u]=C.useState([]),[f,h]=C.useState(""),[p,m]=C.useState(!1),[g,v]=C.useState(!1),[x,y]=C.useState(null),[b,k]=C.useState([]),S=C.useRef(null),[w]=C.useState(!0),[E,P]=C.useState([]),[,M]=C.useState(null),[,j]=C.useState(!1),D=C.useRef(null),{sendMessage:R,stopMessage:$,connected:X}=Dm(s==null?void 0:s.id);function W(){$(),u(_=>_.map(Y=>Y.isStreaming?{...Y,isStreaming:!1,text:Y.text+`
121
121
 
122
122
  *(stopped)*`}:Y)),m(!1)}const G=C.useRef(!1),I=C.useRef(null),O=C.useCallback(_=>{if(!G.current){if(_.type==="text")if(I.current){const Y=I.current;P(q=>q.map(K=>K.id===Y?{...K,text:K.text+_.text}:K))}else{const Y=crypto.randomUUID();I.current=Y,P(q=>[...q,{id:Y,role:"agent",text:_.text,isStreaming:!0}])}else if(_.type==="done"&&I.current){const Y=I.current;P(q=>q.map(K=>K.id===Y?{...K,isStreaming:!1}:K)),I.current=null}}},[]);Dm(void 0,O),C.useEffect(()=>{if(!e)return;const _=setInterval(()=>{cc(e).then(o).catch(console.error)},3e4);return()=>clearInterval(_)},[e]),C.useEffect(()=>{e&&(cc(e).then(o).catch(console.error),HS(e).then(_=>k(_.names)).catch(console.error),Mp(e,"ui").then(_=>{const Y=[];let q=[];for(const K of _)if(K.role==="tool_call")q.push(K.content);else if(K.role==="assistant"){if(!K.content&&q.length===0)continue;Y.push({id:K.id,role:"agent",text:K.content,toolCalls:q.length>0?q:void 0}),q=[]}else q.length>0&&(Y.push({id:crypto.randomUUID(),role:"agent",text:"",toolCalls:q}),q=[]),Y.push({id:K.id,role:"user",text:K.content});q.length>0&&Y.push({id:crypto.randomUUID(),role:"agent",text:"",toolCalls:q}),u(Y),cc(e).then(K=>{K.busy&&(m(!0),u(Le=>{let oe=-1;for(let ve=Le.length-1;ve>=0;ve--)if(Le[ve].role==="agent"){oe=ve;break}return oe===-1?Le:Le.map((ve,me)=>me===oe?{...ve,isStreaming:!0}:ve)}))}).catch(()=>{})}).catch(console.error),Mp(e,"bb").then(_=>P(_.map(Y=>({id:Y.id,role:Y.role==="user"?"user":"agent",text:Y.content})))).catch(console.error))},[e]),C.useEffect(()=>{var _;(_=S.current)==null||_.scrollIntoView({behavior:"smooth"})},[c,r]),C.useEffect(()=>{var _;(_=D.current)==null||_.scrollIntoView({behavior:"smooth"})},[E]);function T(){const _=f.trim();if(!_||p)return;const Y={id:crypto.randomUUID(),role:"user",text:_},q=crypto.randomUUID(),K={id:q,role:"agent",text:"",isStreaming:!0,toolCalls:[]};u(oe=>[...oe,Y,K]),h(""),m(!0);let Le="";R(_,oe=>{if(oe.type==="text")Le+=oe.text,u(ve=>ve.map(me=>me.id===q?{...me,text:me.text+oe.text}:me));else if(oe.type==="tool_call")u(ve=>ve.map(me=>me.id===q?{...me,toolCalls:[...me.toolCalls??[],`${oe.tool}(${JSON.stringify(oe.input)})`]}:me));else if(oe.type==="pending_approval")y({reason:oe.reason}),u(ve=>ve.map(me=>me.id===q?{...me,text:`⏳ Awaiting approval: ${oe.reason}`}:me));else if(oe.type==="blocked"){const ve=`🛡 Blocked: ${oe.reason}`;y(null),u(me=>me.map(Xt=>Xt.id===q?{...Xt,isStreaming:!1,text:ve}:Xt)),m(!1)}else if(oe.type==="agent_ready")l(oe.name);else if(oe.type==="done"||oe.type==="error"){const ve=oe.type==="error"?`⚠ ${oe.message}`:"",me=Le+(ve?`
123
123
 
@@ -128,7 +128,7 @@ This will permanently delete:
128
128
  • Claude session memory
129
129
  • Workspace files
130
130
 
131
- This cannot be undone.`)){v(!0);try{await $S(e),u([]),P([]),l(null),M(null),j(!1)}catch(_){console.error("wipe failed",_)}finally{v(!1)}}}const A=((H=s==null?void 0:s.bigBrother)==null?void 0:H.enabled)&&s.bbPort!==null;return d.jsxs("div",{className:"flex h-full gap-5",children:[s?d.jsx(gM,{agentId:e,agent:s,agentDisplayName:a,connected:X,secretNames:b,setSecretNames:k,isWiping:g,isSending:p,onWipe:N,mainView:r,onViewChange:i}):d.jsx("aside",{className:"w-80 flex-shrink-0 rounded-md bg-surface-container-lowest border border-outline-variant/40 p-4",children:d.jsx("p",{className:"font-mono text-xs text-on-surface-variant",children:"loading…"})}),r==="files"?d.jsx(xM,{agentId:e}):r==="browser"?d.jsx(OM,{agentId:e}):r==="tasks"?d.jsx(CM,{agentId:e}):r==="workflows"?d.jsx(WM,{agentId:e}):r==="schedules"?d.jsx(KM,{agentId:e}):r==="monitor"?d.jsx(XM,{agentId:e}):r==="usage"?d.jsx(sO,{agentId:e}):r==="logs"?d.jsx(pO,{agentId:e}):r==="integrations"?d.jsx("div",{className:"flex-1 overflow-y-auto p-6",children:d.jsx(xO,{agentId:e,secretNames:b,setSecretNames:k})}):d.jsxs("div",{className:"flex flex-1 flex-col rounded-lg bg-surface-container-lowest overflow-hidden min-w-0",children:[d.jsxs("div",{className:"flex-1 overflow-y-auto p-4 flex flex-col gap-3",children:[c.length===0&&d.jsx("p",{className:"font-mono text-xs text-on-surface-variant m-auto",children:"Send a message to start the conversation…"}),c.map(_=>{var Y;return d.jsxs("div",{className:`flex flex-col gap-1 ${_.role==="user"?"items-end":"items-start"}`,children:[d.jsx("span",{className:"text-[10px] uppercase tracking-widest text-on-surface-variant font-medium",children:_.role==="user"?"you":(s==null?void 0:s.name)??"agent"}),(((Y=_.toolCalls)==null?void 0:Y.length)??0)>0&&d.jsx(vO,{toolCalls:_.toolCalls,isStreaming:_.isStreaming}),(_.text||_.isStreaming)&&d.jsx("div",{className:`max-w-xl rounded-lg px-3 py-2 text-sm leading-relaxed
131
+ This cannot be undone.`)){v(!0);try{await $S(e),u([]),P([]),l(null),M(null),j(!1)}catch(_){console.error("wipe failed",_)}finally{v(!1)}}}const A=((H=s==null?void 0:s.bigBrother)==null?void 0:H.enabled)&&s.bbPort!==null;return d.jsxs("div",{className:"flex h-full gap-5",children:[s?d.jsx(gM,{agentId:e,agent:s,agentDisplayName:a,connected:X,secretNames:b,setSecretNames:k,isWiping:g,isSending:p,onWipe:N,mainView:r,onViewChange:i}):d.jsx("aside",{className:"w-80 flex-shrink-0 rounded-md bg-surface-container-lowest border border-outline-variant/40 p-4",children:d.jsx("p",{className:"font-mono text-xs text-on-surface-variant",children:"loading…"})}),r==="files"?d.jsx(xM,{agentId:e}):r==="browser"?d.jsx(OM,{agentId:e}):r==="tasks"?d.jsx(CM,{agentId:e}):r==="workflows"?d.jsx(WM,{agentId:e}):r==="schedules"?d.jsx(KM,{agentId:e}):r==="monitor"?d.jsx(XM,{agentId:e}):r==="usage"?d.jsx(sO,{agentId:e}):r==="logs"?d.jsx(pO,{agentId:e}):r==="integrations"?d.jsx("div",{className:"flex-1 overflow-y-auto p-6",children:d.jsx(xO,{agentId:e,secretNames:b,setSecretNames:k})}):d.jsxs("div",{className:"flex flex-1 flex-col rounded-lg bg-surface-container-lowest overflow-hidden min-w-0",children:[d.jsxs("div",{className:"flex-1 overflow-y-auto p-4 flex flex-col gap-3",children:[c.length===0&&d.jsx("p",{className:"font-mono text-xs text-on-surface-variant m-auto",children:"Send a message to start the conversation…"}),c.map(_=>{var Y;return d.jsxs("div",{className:`flex flex-col gap-1 ${_.role==="user"?"items-end":"items-start"}`,children:[d.jsx("span",{className:"text-[10px] uppercase tracking-widest text-on-surface-variant font-medium",children:_.role==="user"?"you":(s==null?void 0:s.name)??"agent"}),(((Y=_.toolCalls)==null?void 0:Y.length)??0)>0&&d.jsx(bO,{toolCalls:_.toolCalls,isStreaming:_.isStreaming}),(_.text||_.isStreaming)&&d.jsx("div",{className:`max-w-xl rounded-lg px-3 py-2 text-sm leading-relaxed
132
132
  ${_.text.startsWith("🛡 Blocked:")?"bg-red-950/40 border border-red-800/50 text-error font-mono text-xs":_.role==="user"?"bg-primary/20 text-on-surface font-mono whitespace-pre-wrap break-words":"bg-surface-container text-on-surface"}
133
133
  ${_.isStreaming?"animate-pulse":""}
134
134
  `,children:_.text.startsWith("🛡 Blocked:")?_.text:_.role==="user"?_.text||"…":_.text?d.jsx("div",{className:`prose prose-sm dark:prose-invert max-w-none text-on-surface
@@ -139,5 +139,5 @@ This cannot be undone.`)){v(!0);try{await $S(e),u([]),P([]),l(null),M(null),j(!1
139
139
  prose-a:text-secondary prose-strong:text-on-surface
140
140
  prose-table:border-collapse prose-table:text-xs prose-table:w-full
141
141
  prose-th:border prose-th:border-outline-variant/40 prose-th:px-2 prose-th:py-1 prose-th:bg-surface-dim prose-th:text-left prose-th:font-medium
142
- prose-td:border prose-td:border-outline-variant/40 prose-td:px-2 prose-td:py-1`,children:d.jsx(Rd,{remarkPlugins:[dM,mM],children:_.text})}):"…"})]},_.id)}),d.jsx("div",{ref:S})]}),x&&d.jsxs("div",{"data-testid":"pending-approval",className:"flex items-center gap-3 border-t border-amber-800/50 bg-amber-950/40 px-4 py-3",children:[d.jsx(Vc,{className:"h-5 w-5 text-warning flex-shrink-0 animate-pulse"}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("p",{className:"font-mono text-xs text-warning font-semibold",children:"Awaiting approval"}),d.jsx("p",{className:"font-mono text-[11px] text-warning/80 mt-0.5",children:x.reason}),d.jsx("p",{className:"font-mono text-[10px] text-amber-500/60 mt-1",children:"Respond in the guardian panel →"})]})]}),d.jsxs("div",{className:"flex gap-2 border-t border-outline-variant/20 p-3",children:[d.jsx("textarea",{className:"flex-1 rounded bg-surface-container-high px-3 py-2 text-sm text-on-surface placeholder-on-surface-variant outline-none focus:ring-1 focus:ring-primary/40 font-mono resize-none",placeholder:`Message ${a??(s==null?void 0:s.name)??"agent"}… (Shift+Enter for new line)`,value:f,onChange:_=>h(_.target.value),onKeyDown:_=>{_.key==="Enter"&&!_.shiftKey&&(_.preventDefault(),T())},disabled:p,rows:Math.min(f.split(`
143
- `).length,8),style:{minHeight:"2.5rem",maxHeight:"12rem",overflow:"auto"}}),p?d.jsx("button",{onClick:W,className:"rounded bg-red-500/20 px-4 py-2 text-sm font-medium text-error transition-opacity hover:bg-red-500/30",children:"Stop"}):d.jsx("button",{onClick:T,disabled:!f.trim()||!X,className:"rounded bg-primary px-4 py-2 text-sm font-medium text-on-primary transition-opacity disabled:opacity-40 hover:opacity-90",children:"Send"})]})]}),A&&r==="chat"&&d.jsxs("div",{"data-testid":"bb-panel",className:`relative flex-shrink-0 flex flex-col rounded-lg bg-surface-container-lowest overflow-hidden transition-all duration-200 ${w?"w-96":"w-10"}`,children:[d.jsxs("div",{"data-testid":"guardian-coming-soon-overlay",className:"absolute inset-0 z-20 flex flex-col items-center justify-center bg-surface-container-lowest/90 backdrop-blur-sm rounded-lg",children:[d.jsx(Vc,{className:"h-12 w-12 text-warning/30 mb-4"}),w&&d.jsxs(d.Fragment,{children:[d.jsx("p",{className:"font-headline text-lg font-semibold text-on-surface tracking-tight mb-2",children:"Guardian"}),d.jsx("span",{className:"rounded-full bg-warning/10 border border-warning/30 px-3 py-1 font-label text-[10px] font-semibold text-warning uppercase tracking-widest mb-4",children:"Coming Soon"}),d.jsx("p",{className:"max-w-[260px] text-center font-mono text-[10px] text-on-surface-variant leading-relaxed px-4",children:"Set up a Guardian agent to control what your main agent can do. Define guardrails, block actions, and require approval before sensitive operations."})]})]}),d.jsxs("div",{className:"flex items-center gap-2 px-3 py-3 border-b border-outline-variant/20",children:[d.jsx(Vc,{className:"h-4 w-4 flex-shrink-0 text-on-surface-variant"}),w&&d.jsx(d.Fragment,{children:d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("p",{className:"font-headline text-xs font-semibold text-on-surface truncate",children:"Guardian"}),d.jsx("p",{className:"font-mono text-[9px] text-on-surface-variant",children:"○ offline"})]})})]}),w&&d.jsx("div",{className:"flex-1 overflow-hidden p-3 flex flex-col gap-2",children:d.jsxs("p",{className:"font-mono text-[10px] text-on-surface-variant/20 m-auto text-center leading-relaxed",children:["Guardian chat.",d.jsx("br",{}),"Configure guardrails here."]})})]})]})}const wr="rounded bg-surface-container px-3 py-2 text-[12px] text-on-surface placeholder:text-on-surface-variant/60 outline-none focus:ring-1 focus:ring-primary/25 font-mono transition-shadow w-full",Ub=Object.fromEntries(F0.map(e=>[e.value,e.label]));function wO({entry:e,onRemove:t,onReplaceKey:n}){const[r,i]=C.useState(!1),[s,o]=C.useState(e.model),[a,l]=C.useState(""),[c,u]=C.useState(!1),[f,h]=C.useState(null),[p,m]=C.useState(!1);async function g(){if(!a.trim()){h("API key is required");return}u(!0),h(null),m(!1);try{await n(e.provider,s,a.trim()),m(!0),l(""),i(!1)}catch(v){h(v instanceof Error?v.message:"Failed to save")}finally{u(!1)}}return d.jsxs("div",{className:"rounded-lg bg-surface-container-lowest border border-outline-variant/40 p-4 space-y-3",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("div",{children:[d.jsx("span",{className:"font-mono text-[13px] text-on-surface font-semibold",children:Ub[e.provider]??e.provider}),d.jsx("span",{className:"font-mono text-[10px] text-on-surface-variant/70 ml-2",children:e.model}),d.jsx("span",{className:"ml-2 text-success text-[10px] font-mono",children:"✓"})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[!r&&d.jsx("button",{onClick:()=>{i(!0),m(!1)},className:"rounded px-2 py-1 text-[11px] font-mono text-on-surface-variant hover:text-on-surface bg-surface-container transition-colors",children:"Replace key"}),d.jsx("button",{onClick:t,className:"rounded px-2 py-1 text-[11px] font-mono text-error/60 hover:text-error hover:bg-error/10 transition-colors",children:"Remove"})]})]}),r&&d.jsxs("div",{className:"space-y-2 pt-1 border-t border-outline-variant/40",children:[d.jsxs("div",{children:[d.jsx("label",{className:"block text-[10px] uppercase tracking-[0.14em] text-on-surface-variant font-medium mb-1",children:"Model"}),d.jsx("select",{className:`${wr} appearance-none`,value:s,onChange:v=>o(v.target.value),children:kl(e.provider).map(v=>d.jsx("option",{value:v.value,children:v.label},v.value))})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-[10px] uppercase tracking-[0.14em] text-on-surface-variant font-medium mb-1",children:"New API Key"}),d.jsx("input",{type:"password",className:wr,placeholder:"Paste new API key",value:a,onChange:v=>{l(v.target.value),h(null)},autoComplete:"off",autoFocus:!0})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("button",{onClick:g,disabled:c,className:"rounded bg-primary px-3 py-1.5 text-[12px] font-medium text-on-primary transition-opacity disabled:opacity-40 hover:opacity-90",children:c?"Saving…":"Save"}),d.jsx("button",{onClick:()=>{i(!1),l(""),h(null)},className:"rounded px-3 py-1.5 text-[12px] font-mono text-on-surface-variant hover:text-on-surface transition-colors",children:"Cancel"}),p&&d.jsx("span",{className:"font-mono text-[11px] text-success",children:"Saved"}),f&&d.jsx("span",{className:"font-mono text-[10px] text-error",children:f})]})]})]})}function kO(){const e=Br(),[t,n]=C.useState(!0),[r,i]=C.useState([]),[s,o]=C.useState(""),[a,l]=C.useState(""),[c,u]=C.useState(""),[f,h]=C.useState(!1),[p,m]=C.useState(null),[g,v]=C.useState(!1),[x,y]=C.useState(""),[b,k]=C.useState(!1),[S,w]=C.useState(null),[E,P]=C.useState(!1),[M,j]=C.useState(!1),[D,R]=C.useState(!1);C.useEffect(()=>{Promise.all([z0(),y_()]).then(([A,H])=>{i(A.providers??[]),j(H.configured)}).catch(console.error).finally(()=>n(!1))},[]);const $=new Set(r.map(A=>A.provider)),X=F0.filter(A=>!$.has(A.value));C.useEffect(()=>{if(X.length>0&&!X.find(A=>A.value===s)){const A=X[0].value;o(A),l($u(A))}},[r.length]);function W(A){o(A),l($u(A))}async function G(){if(!s||!a||!c.trim()){m("All fields required");return}h(!0),m(null),v(!1);try{await Lp(s,a,c.trim()),i(A=>[...A.filter(_=>_.provider!==s),{provider:s,model:a}]),v(!0),u("")}catch(A){m(A instanceof Error?A.message:"Failed to save")}finally{h(!1)}}async function I(A,H,_){await Lp(A,H,_),i(Y=>Y.map(q=>q.provider===A?{provider:A,model:H}:q))}async function O(A){confirm(`Remove ${Ub[A]??A}? Agents using this provider will stop responding.`)&&(await x_(A),i(H=>H.filter(_=>_.provider!==A)))}async function T(){if(!x.trim()){w("API key is required");return}k(!0),w(null),P(!1);try{await v_("brave",x.trim()),P(!0),j(!0),y(""),R(!1)}catch(A){w(A instanceof Error?A.message:"Failed to save")}finally{k(!1)}}async function N(){k(!0),w(null);try{await b_(),j(!1),y(""),P(!1),R(!1)}catch(A){w(A instanceof Error?A.message:"Failed to reset")}finally{k(!1)}}return t?d.jsx("div",{className:"text-on-surface-variant/70 font-mono text-xs p-8",children:"loading…"}):d.jsxs("div",{className:"max-w-2xl mx-auto py-8 px-4",children:[d.jsxs("button",{type:"button",onClick:()=>e(-1),className:"flex items-center gap-1.5 mb-6 font-mono text-[12px] text-on-surface-variant hover:text-on-surface transition-colors",children:[d.jsx("span",{className:"material-symbols-outlined text-[16px]",children:"arrow_back"}),"Go back to agent"]}),d.jsxs("div",{className:"mb-8",children:[d.jsxs("h1",{className:"font-headline text-4xl font-bold text-on-surface",children:[d.jsx("span",{className:"highlight-marker",children:"Provider"})," Settings"]}),d.jsx("p",{className:"font-mono text-[11px] text-on-surface-variant mt-2",children:"Configure AI providers. Each agent can use a different provider."})]}),r.length===0?d.jsx("p",{className:"font-mono text-[11px] text-warning/80 mb-4",children:"No providers configured — agents will not respond until you add one."}):d.jsx("div",{className:"space-y-2 mb-6",children:r.map(A=>d.jsx(wO,{entry:A,onRemove:()=>O(A.provider),onReplaceKey:I},A.provider))}),X.length>0&&d.jsxs("div",{className:"rounded-lg bg-surface-container-lowest border border-outline-variant/40 p-5 space-y-4",children:[d.jsx("p",{className:"text-[10px] uppercase tracking-[0.14em] text-on-surface-variant font-medium",children:"Add provider"}),d.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[d.jsxs("div",{children:[d.jsx("label",{className:"block text-[10px] uppercase tracking-[0.14em] text-on-surface-variant font-medium mb-1.5",children:"Provider"}),d.jsx("select",{className:`${wr} appearance-none`,value:s,onChange:A=>W(A.target.value),children:X.map(A=>d.jsx("option",{value:A.value,children:A.label},A.value))})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-[10px] uppercase tracking-[0.14em] text-on-surface-variant font-medium mb-1.5",children:"Model"}),d.jsx("select",{className:`${wr} appearance-none`,value:a,onChange:A=>l(A.target.value),children:kl(s).map(A=>d.jsx("option",{value:A.value,children:A.label},A.value))})]})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-[10px] uppercase tracking-[0.14em] text-on-surface-variant font-medium mb-1.5",children:"API Key"}),d.jsx("input",{type:"password",className:wr,placeholder:"Paste your API key",value:c,onChange:A=>{u(A.target.value),m(null),v(!1)},autoComplete:"off"})]}),d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("button",{onClick:G,disabled:f||!c.trim(),className:"rounded bg-primary px-4 py-2 text-sm font-medium text-on-primary transition-opacity disabled:opacity-40 hover:opacity-90",children:f?"Adding…":"Add"}),g&&d.jsx("span",{className:"font-mono text-[11px] text-success",children:"Added ✓"}),p&&d.jsx("span",{className:"font-mono text-[10px] text-error",children:p})]})]}),d.jsxs("div",{className:"mt-8 pt-8 border-t border-outline-variant/40",children:[d.jsx("h2",{className:"font-headline text-2xl font-bold text-on-surface mb-1",children:"Web Search"}),d.jsxs("p",{className:"font-mono text-[11px] text-on-surface-variant/70 mb-6",children:["Brave Search gives agents real web search capability."," ",M?d.jsx("span",{className:"text-success",children:"Configured ✓"}):d.jsx("span",{className:"text-warning",children:"Not configured — agents cannot search the web."})]}),d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{children:[d.jsx("label",{className:"block font-mono text-[11px] text-on-surface-variant mb-1",children:"Brave Search API key"}),M&&!D?d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("input",{type:"password",className:wr,value:"••••••••••••••••••••",readOnly:!0}),d.jsx("button",{type:"button",onClick:()=>{R(!0),P(!1)},className:"shrink-0 rounded px-3 py-2 text-[11px] font-mono text-on-surface-variant hover:text-on-surface bg-surface-container transition-colors",children:"Replace"})]}):d.jsx("input",{type:"password",className:wr,placeholder:"Enter Brave Search API key",value:x,onChange:A=>{y(A.target.value),P(!1)},autoComplete:"off",autoFocus:D})]}),d.jsxs("div",{className:"flex items-center gap-3",children:[(!M||D)&&d.jsx("button",{onClick:T,disabled:b||!x.trim(),className:"rounded-lg bg-primary px-4 py-2 text-sm font-medium text-on-primary transition-opacity hover:opacity-90 disabled:opacity-40 disabled:cursor-not-allowed",children:b?"Saving…":"Save"}),D&&d.jsx("button",{onClick:()=>{R(!1),y(""),w(null)},className:"rounded px-3 py-1.5 text-[12px] font-mono text-on-surface-variant hover:text-on-surface transition-colors",children:"Cancel"}),M&&d.jsx("button",{onClick:N,disabled:b,className:"rounded px-3 py-2 text-[12px] font-mono text-on-surface-variant hover:text-error hover:bg-error/10 transition-colors disabled:opacity-40",children:"Remove"}),E&&d.jsx("span",{className:"font-mono text-[11px] text-success",children:"Saved"}),S&&d.jsx("span",{className:"font-mono text-[10px] text-error",children:S})]})]})]})]})}const SO=1280,_O=800,ax=500,lx=5,cx={Backspace:8,Tab:9,Enter:13,Shift:16,Control:17,Alt:18,Pause:19,CapsLock:20,Escape:27,PageUp:33,PageDown:34,End:35,Home:36,ArrowLeft:37,ArrowUp:38,ArrowRight:39,ArrowDown:40,Insert:45,Delete:46,Meta:91,ContextMenu:93,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123};function CO(){const{token:e}=E0(),[t,n]=C.useState(null),[r,i]=C.useState(!1),[s,o]=C.useState(null),[a,l]=C.useState(!1),[c,u]=C.useState(!1),[f,h]=C.useState(""),[p,m]=C.useState(""),[g,v]=C.useState(""),x=C.useRef(null),y=C.useRef(null),b=C.useRef(null),k=C.useRef(null),S=C.useRef({time:0,x:0,y:0});C.useEffect(()=>{e&&fetch(`/api/takeover/${e}`).then(T=>T.status===404?(i(!0),null):T.json()).then(T=>{T&&(n(T),T.url&&m(T.url))}).catch(()=>i(!0))},[e]),C.useEffect(()=>{if(!t)return;const T=new WebSocket(I0(t.agentId,t.sessionId));return y.current=T,T.onmessage=N=>{try{const A=JSON.parse(N.data);A.type==="frame"&&A.data?o(`data:image/jpeg;base64,${A.data}`):(A.type==="attached"||A.type==="tab_changed")&&(A.url&&m(A.url),A.title&&v(A.title))}catch{}},()=>{T.onmessage=null,T.close()}},[t]),C.useEffect(()=>{var T;(T=b.current)==null||T.focus()},[t]);const w=C.useCallback(T=>{var N;((N=y.current)==null?void 0:N.readyState)===WebSocket.OPEN&&y.current.send(JSON.stringify(T))},[]),E=C.useCallback((T,N)=>{const A=x.current;if(!A)return{x:0,y:0};const H=A.getBoundingClientRect();if(H.width===0||H.height===0)return{x:0,y:0};const _=A.naturalWidth||SO,Y=A.naturalHeight||_O,q=Math.max(0,Math.min(H.width,T-H.left)),K=Math.max(0,Math.min(H.height,N-H.top));return{x:Math.round(q/H.width*_),y:Math.round(K/H.height*Y)}},[]),P=C.useCallback(T=>(T.shiftKey?8:0)|(T.ctrlKey?2:0)|(T.altKey?1:0)|(T.metaKey?4:0),[]),M=T=>T===2?"right":T===1?"middle":"left",j=T=>{const{x:N,y:A}=E(T.clientX,T.clientY);w({type:"mouse",eventType:"mouseMoved",x:N,y:A,button:k.current??"none",clickCount:0,modifiers:P(T.nativeEvent)})},D=T=>{var oe;(oe=b.current)==null||oe.focus();const{x:N,y:A}=E(T.clientX,T.clientY),H=M(T.button),_=Date.now(),Y=_-S.current.time,q=Math.abs(N-S.current.x),K=Math.abs(A-S.current.y),Le=Y<ax&&q<lx&&K<lx?2:1;S.current={time:_,x:N,y:A},k.current=H,w({type:"mouse",eventType:"mousePressed",x:N,y:A,button:H,clickCount:Le,modifiers:P(T.nativeEvent)})},R=T=>{const{x:N,y:A}=E(T.clientX,T.clientY),H=M(T.button),_=S.current.time===0?1:Date.now()-S.current.time<ax?2:1;k.current=null,w({type:"mouse",eventType:"mouseReleased",x:N,y:A,button:H,clickCount:_,modifiers:P(T.nativeEvent)})},$=()=>{k.current&&(k.current=null)},X=T=>{w({type:"scroll",...E(T.clientX,T.clientY),deltaY:T.deltaY})},W=T=>{var A;if(((A=T.target)==null?void 0:A.tagName)==="INPUT")return;T.preventDefault();const N=cx[T.key];T.key.length===1?(w({type:"key",eventType:"rawKeyDown",key:T.key,code:T.code,modifiers:P(T.nativeEvent),windowsVirtualKeyCode:T.key.toUpperCase().charCodeAt(0)}),w({type:"insertText",text:T.key})):w({type:"key",eventType:"rawKeyDown",key:T.key,code:T.code,modifiers:P(T.nativeEvent),windowsVirtualKeyCode:N??0})},G=T=>{var A;if(((A=T.target)==null?void 0:A.tagName)==="INPUT")return;const N=T.key.length===1?T.key.toUpperCase().charCodeAt(0):cx[T.key]??0;w({type:"key",eventType:"keyUp",key:T.key,code:T.code,modifiers:P(T.nativeEvent),windowsVirtualKeyCode:N})},I=T=>{var A;if(((A=T.target)==null?void 0:A.tagName)==="INPUT")return;T.preventDefault();const N=T.clipboardData.getData("text/plain");N&&w({type:"insertText",text:N})},O=async()=>{var T;if(!(!e||c)){u(!0);try{await fetch(`/api/takeover/${e}/resolve`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({note:f.trim()||void 0})}),(T=y.current)==null||T.close(),l(!0)}catch{u(!1)}}};return r?d.jsx("div",{className:"flex h-screen items-center justify-center bg-background font-body text-on-surface px-6",children:d.jsxs("div",{className:"text-center max-w-md",children:[d.jsx("p",{className:"text-[11px] font-label uppercase tracking-[0.15em] text-secondary/70 mb-2",children:"takeover"}),d.jsx("h1",{className:"font-headline text-[32px] leading-tight text-on-surface mb-3",children:"Session expired"}),d.jsx("p",{className:"text-[15px] leading-relaxed text-on-surface-variant italic",children:"This takeover link has already been used or timed out."})]})}):a?d.jsx("div",{className:"flex h-screen items-center justify-center bg-background font-body text-on-surface px-6",children:d.jsxs("div",{className:"text-center max-w-md",children:[d.jsx("p",{className:"text-[11px] font-label uppercase tracking-[0.15em] text-primary/70 mb-2",children:"complete"}),d.jsx("h1",{className:"font-headline text-[32px] leading-tight text-on-surface mb-3",children:"Returned control to the agent"}),d.jsx("p",{className:"text-[15px] leading-relaxed text-on-surface-variant italic",children:"You can close this tab."})]})}):t?d.jsxs("div",{className:"flex flex-col h-screen bg-background font-body text-on-surface overflow-hidden",children:[d.jsxs("div",{className:"flex items-start gap-4 px-8 py-5 bg-surface-container-low flex-shrink-0",children:[d.jsx("div",{className:"flex-shrink-0 mt-1 w-7 h-7 rounded-full bg-primary-fixed flex items-center justify-center",children:d.jsx("span",{className:"font-headline italic text-[15px] text-primary",children:"!"})}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("p",{className:"text-[10px] font-label uppercase tracking-[0.15em] text-primary/70 mb-1",children:"The agent needs your help"}),d.jsx("p",{className:"font-headline text-[17px] leading-snug text-on-surface",children:t.reason})]})]}),d.jsxs("div",{className:"flex items-center gap-3 px-6 py-3 bg-surface-container flex-shrink-0",children:[d.jsxs("div",{className:"flex gap-1.5 flex-shrink-0",children:[d.jsx("span",{className:"w-3 h-3 rounded-full bg-secondary/60"}),d.jsx("span",{className:"w-3 h-3 rounded-full bg-tertiary-fixed"}),d.jsx("span",{className:"w-3 h-3 rounded-full bg-primary/40"})]}),d.jsxs("div",{className:"flex-1 flex items-center gap-2 bg-surface-container-lowest rounded-md px-3 py-1.5 min-w-0",children:[d.jsx("span",{className:"text-[11px] text-primary flex-shrink-0","aria-hidden":!0,children:"∎"}),d.jsx("span",{className:"text-[12px] font-mono text-on-surface truncate",children:p||t.url||"about:blank"}),g&&d.jsxs("span",{className:"text-[11px] font-body italic text-on-surface-variant/70 flex-shrink-0 hidden md:inline",children:["— ",g]})]}),d.jsxs("div",{className:"flex items-center gap-1.5 flex-shrink-0",children:[d.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-secondary animate-pulse"}),d.jsx("span",{className:"text-[10px] font-label uppercase tracking-[0.15em] text-secondary",children:"live"})]})]}),d.jsx("div",{ref:b,tabIndex:0,className:"flex-1 flex items-center justify-center overflow-hidden outline-none cursor-default bg-surface-container-highest",onMouseMove:j,onMouseDown:D,onMouseUp:R,onMouseLeave:$,onWheel:X,onKeyDown:W,onKeyUp:G,onPaste:I,onContextMenu:T=>T.preventDefault(),children:s?d.jsx("img",{ref:x,src:s,alt:"live browser",className:"max-w-full max-h-full object-contain select-none",draggable:!1,style:{pointerEvents:"none"}}):d.jsx("p",{className:"font-mono text-[10px] text-on-surface-variant/50 animate-pulse",children:"waiting for browser stream…"})}),d.jsxs("div",{className:"flex items-end gap-4 px-8 py-5 bg-surface-container-low flex-shrink-0",children:[d.jsxs("div",{className:"flex-1 flex flex-col",children:[d.jsxs("label",{className:"text-[10px] font-label uppercase tracking-[0.15em] text-on-surface-variant/70 mb-1",children:["What did you do? ",d.jsx("span",{className:"italic text-on-surface-variant/50",children:"(optional)"})]}),d.jsx("input",{type:"text",value:f,onChange:T=>h(T.target.value),onKeyDown:T=>{T.key==="Enter"&&!T.shiftKey&&(T.preventDefault(),O())},placeholder:"Describe your action for the agent…",disabled:c,className:"bg-transparent border-0 border-b border-outline-variant/30 focus:border-primary focus:outline-none font-body text-[15px] text-on-surface placeholder:text-on-surface-variant/40 placeholder:italic px-0 py-2 disabled:opacity-50"})]}),d.jsx("button",{onClick:O,disabled:c,className:"flex-shrink-0 rounded-sm bg-primary text-on-primary font-label text-[11px] uppercase tracking-[0.15em] px-5 py-3 hover:bg-primary/90 transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:c?"Returning…":"Completed"})]})]}):d.jsx("div",{className:"flex h-screen items-center justify-center bg-background font-body",children:d.jsx("p",{className:"font-mono text-[11px] text-on-surface-variant/60 animate-pulse",children:"connecting…"})})}function NO(){return d.jsxs(SS,{children:[d.jsx(Tn,{path:"takeover/:token",element:d.jsx(CO,{})}),d.jsxs(Tn,{element:d.jsx(zS,{}),children:[d.jsx(Tn,{index:!0,element:d.jsx(wp,{to:"/dashboard",replace:!0})}),d.jsx(Tn,{path:"dashboard",element:d.jsx(S_,{})}),d.jsx(Tn,{path:"agents/:id/*",element:d.jsx(bO,{})}),d.jsx(Tn,{path:"settings",element:d.jsx(kO,{})}),d.jsx(Tn,{path:"*",element:d.jsx(wp,{to:"/dashboard",replace:!0})})]})]})}Wc.createRoot(document.getElementById("root")).render(d.jsx(bx.StrictMode,{children:d.jsx(MS,{children:d.jsx(NO,{})})}));
142
+ prose-td:border prose-td:border-outline-variant/40 prose-td:px-2 prose-td:py-1`,children:d.jsx(Rd,{remarkPlugins:[dM,mM],children:_.text})}):d.jsx(vO,{})})]},_.id)}),d.jsx("div",{ref:S})]}),x&&d.jsxs("div",{"data-testid":"pending-approval",className:"flex items-center gap-3 border-t border-amber-800/50 bg-amber-950/40 px-4 py-3",children:[d.jsx(Vc,{className:"h-5 w-5 text-warning flex-shrink-0 animate-pulse"}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("p",{className:"font-mono text-xs text-warning font-semibold",children:"Awaiting approval"}),d.jsx("p",{className:"font-mono text-[11px] text-warning/80 mt-0.5",children:x.reason}),d.jsx("p",{className:"font-mono text-[10px] text-amber-500/60 mt-1",children:"Respond in the guardian panel →"})]})]}),d.jsxs("div",{className:"flex gap-2 border-t border-outline-variant/20 p-3",children:[d.jsx("textarea",{className:"flex-1 rounded bg-surface-container-high px-3 py-2 text-sm text-on-surface placeholder-on-surface-variant outline-none focus:ring-1 focus:ring-primary/40 font-mono resize-none",placeholder:`Message ${a??(s==null?void 0:s.name)??"agent"}… (Shift+Enter for new line)`,value:f,onChange:_=>h(_.target.value),onKeyDown:_=>{_.key==="Enter"&&!_.shiftKey&&(_.preventDefault(),T())},disabled:p,rows:Math.min(f.split(`
143
+ `).length,8),style:{minHeight:"2.5rem",maxHeight:"12rem",overflow:"auto"}}),p?d.jsx("button",{onClick:W,className:"rounded bg-red-500/20 px-4 py-2 text-sm font-medium text-error transition-opacity hover:bg-red-500/30",children:"Stop"}):d.jsx("button",{onClick:T,disabled:!f.trim()||!X,className:"rounded bg-primary px-4 py-2 text-sm font-medium text-on-primary transition-opacity disabled:opacity-40 hover:opacity-90",children:"Send"})]})]}),A&&r==="chat"&&d.jsxs("div",{"data-testid":"bb-panel",className:`relative flex-shrink-0 flex flex-col rounded-lg bg-surface-container-lowest overflow-hidden transition-all duration-200 ${w?"w-96":"w-10"}`,children:[d.jsxs("div",{"data-testid":"guardian-coming-soon-overlay",className:"absolute inset-0 z-20 flex flex-col items-center justify-center bg-surface-container-lowest/90 backdrop-blur-sm rounded-lg",children:[d.jsx(Vc,{className:"h-12 w-12 text-warning/30 mb-4"}),w&&d.jsxs(d.Fragment,{children:[d.jsx("p",{className:"font-headline text-lg font-semibold text-on-surface tracking-tight mb-2",children:"Guardian"}),d.jsx("span",{className:"rounded-full bg-warning/10 border border-warning/30 px-3 py-1 font-label text-[10px] font-semibold text-warning uppercase tracking-widest mb-4",children:"Coming Soon"}),d.jsx("p",{className:"max-w-[260px] text-center font-mono text-[10px] text-on-surface-variant leading-relaxed px-4",children:"Set up a Guardian agent to control what your main agent can do. Define guardrails, block actions, and require approval before sensitive operations."})]})]}),d.jsxs("div",{className:"flex items-center gap-2 px-3 py-3 border-b border-outline-variant/20",children:[d.jsx(Vc,{className:"h-4 w-4 flex-shrink-0 text-on-surface-variant"}),w&&d.jsx(d.Fragment,{children:d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("p",{className:"font-headline text-xs font-semibold text-on-surface truncate",children:"Guardian"}),d.jsx("p",{className:"font-mono text-[9px] text-on-surface-variant",children:"○ offline"})]})})]}),w&&d.jsx("div",{className:"flex-1 overflow-hidden p-3 flex flex-col gap-2",children:d.jsxs("p",{className:"font-mono text-[10px] text-on-surface-variant/20 m-auto text-center leading-relaxed",children:["Guardian chat.",d.jsx("br",{}),"Configure guardrails here."]})})]})]})}const wr="rounded bg-surface-container px-3 py-2 text-[12px] text-on-surface placeholder:text-on-surface-variant/60 outline-none focus:ring-1 focus:ring-primary/25 font-mono transition-shadow w-full",Ub=Object.fromEntries(F0.map(e=>[e.value,e.label]));function kO({entry:e,onRemove:t,onReplaceKey:n}){const[r,i]=C.useState(!1),[s,o]=C.useState(e.model),[a,l]=C.useState(""),[c,u]=C.useState(!1),[f,h]=C.useState(null),[p,m]=C.useState(!1);async function g(){if(!a.trim()){h("API key is required");return}u(!0),h(null),m(!1);try{await n(e.provider,s,a.trim()),m(!0),l(""),i(!1)}catch(v){h(v instanceof Error?v.message:"Failed to save")}finally{u(!1)}}return d.jsxs("div",{className:"rounded-lg bg-surface-container-lowest border border-outline-variant/40 p-4 space-y-3",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("div",{children:[d.jsx("span",{className:"font-mono text-[13px] text-on-surface font-semibold",children:Ub[e.provider]??e.provider}),d.jsx("span",{className:"font-mono text-[10px] text-on-surface-variant/70 ml-2",children:e.model}),d.jsx("span",{className:"ml-2 text-success text-[10px] font-mono",children:"✓"})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[!r&&d.jsx("button",{onClick:()=>{i(!0),m(!1)},className:"rounded px-2 py-1 text-[11px] font-mono text-on-surface-variant hover:text-on-surface bg-surface-container transition-colors",children:"Replace key"}),d.jsx("button",{onClick:t,className:"rounded px-2 py-1 text-[11px] font-mono text-error/60 hover:text-error hover:bg-error/10 transition-colors",children:"Remove"})]})]}),r&&d.jsxs("div",{className:"space-y-2 pt-1 border-t border-outline-variant/40",children:[d.jsxs("div",{children:[d.jsx("label",{className:"block text-[10px] uppercase tracking-[0.14em] text-on-surface-variant font-medium mb-1",children:"Model"}),d.jsx("select",{className:`${wr} appearance-none`,value:s,onChange:v=>o(v.target.value),children:kl(e.provider).map(v=>d.jsx("option",{value:v.value,children:v.label},v.value))})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-[10px] uppercase tracking-[0.14em] text-on-surface-variant font-medium mb-1",children:"New API Key"}),d.jsx("input",{type:"password",className:wr,placeholder:"Paste new API key",value:a,onChange:v=>{l(v.target.value),h(null)},autoComplete:"off",autoFocus:!0})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("button",{onClick:g,disabled:c,className:"rounded bg-primary px-3 py-1.5 text-[12px] font-medium text-on-primary transition-opacity disabled:opacity-40 hover:opacity-90",children:c?"Saving…":"Save"}),d.jsx("button",{onClick:()=>{i(!1),l(""),h(null)},className:"rounded px-3 py-1.5 text-[12px] font-mono text-on-surface-variant hover:text-on-surface transition-colors",children:"Cancel"}),p&&d.jsx("span",{className:"font-mono text-[11px] text-success",children:"Saved"}),f&&d.jsx("span",{className:"font-mono text-[10px] text-error",children:f})]})]})]})}function SO(){const e=Br(),[t,n]=C.useState(!0),[r,i]=C.useState([]),[s,o]=C.useState(""),[a,l]=C.useState(""),[c,u]=C.useState(""),[f,h]=C.useState(!1),[p,m]=C.useState(null),[g,v]=C.useState(!1),[x,y]=C.useState(""),[b,k]=C.useState(!1),[S,w]=C.useState(null),[E,P]=C.useState(!1),[M,j]=C.useState(!1),[D,R]=C.useState(!1);C.useEffect(()=>{Promise.all([z0(),y_()]).then(([A,H])=>{i(A.providers??[]),j(H.configured)}).catch(console.error).finally(()=>n(!1))},[]);const $=new Set(r.map(A=>A.provider)),X=F0.filter(A=>!$.has(A.value));C.useEffect(()=>{if(X.length>0&&!X.find(A=>A.value===s)){const A=X[0].value;o(A),l($u(A))}},[r.length]);function W(A){o(A),l($u(A))}async function G(){if(!s||!a||!c.trim()){m("All fields required");return}h(!0),m(null),v(!1);try{await Lp(s,a,c.trim()),i(A=>[...A.filter(_=>_.provider!==s),{provider:s,model:a}]),v(!0),u("")}catch(A){m(A instanceof Error?A.message:"Failed to save")}finally{h(!1)}}async function I(A,H,_){await Lp(A,H,_),i(Y=>Y.map(q=>q.provider===A?{provider:A,model:H}:q))}async function O(A){confirm(`Remove ${Ub[A]??A}? Agents using this provider will stop responding.`)&&(await x_(A),i(H=>H.filter(_=>_.provider!==A)))}async function T(){if(!x.trim()){w("API key is required");return}k(!0),w(null),P(!1);try{await v_("brave",x.trim()),P(!0),j(!0),y(""),R(!1)}catch(A){w(A instanceof Error?A.message:"Failed to save")}finally{k(!1)}}async function N(){k(!0),w(null);try{await b_(),j(!1),y(""),P(!1),R(!1)}catch(A){w(A instanceof Error?A.message:"Failed to reset")}finally{k(!1)}}return t?d.jsx("div",{className:"text-on-surface-variant/70 font-mono text-xs p-8",children:"loading…"}):d.jsxs("div",{className:"max-w-2xl mx-auto py-8 px-4",children:[d.jsxs("button",{type:"button",onClick:()=>e(-1),className:"flex items-center gap-1.5 mb-6 font-mono text-[12px] text-on-surface-variant hover:text-on-surface transition-colors",children:[d.jsx("span",{className:"material-symbols-outlined text-[16px]",children:"arrow_back"}),"Go back to agent"]}),d.jsxs("div",{className:"mb-8",children:[d.jsxs("h1",{className:"font-headline text-4xl font-bold text-on-surface",children:[d.jsx("span",{className:"highlight-marker",children:"Provider"})," Settings"]}),d.jsx("p",{className:"font-mono text-[11px] text-on-surface-variant mt-2",children:"Configure AI providers. Each agent can use a different provider."})]}),r.length===0?d.jsx("p",{className:"font-mono text-[11px] text-warning/80 mb-4",children:"No providers configured — agents will not respond until you add one."}):d.jsx("div",{className:"space-y-2 mb-6",children:r.map(A=>d.jsx(kO,{entry:A,onRemove:()=>O(A.provider),onReplaceKey:I},A.provider))}),X.length>0&&d.jsxs("div",{className:"rounded-lg bg-surface-container-lowest border border-outline-variant/40 p-5 space-y-4",children:[d.jsx("p",{className:"text-[10px] uppercase tracking-[0.14em] text-on-surface-variant font-medium",children:"Add provider"}),d.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[d.jsxs("div",{children:[d.jsx("label",{className:"block text-[10px] uppercase tracking-[0.14em] text-on-surface-variant font-medium mb-1.5",children:"Provider"}),d.jsx("select",{className:`${wr} appearance-none`,value:s,onChange:A=>W(A.target.value),children:X.map(A=>d.jsx("option",{value:A.value,children:A.label},A.value))})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-[10px] uppercase tracking-[0.14em] text-on-surface-variant font-medium mb-1.5",children:"Model"}),d.jsx("select",{className:`${wr} appearance-none`,value:a,onChange:A=>l(A.target.value),children:kl(s).map(A=>d.jsx("option",{value:A.value,children:A.label},A.value))})]})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-[10px] uppercase tracking-[0.14em] text-on-surface-variant font-medium mb-1.5",children:"API Key"}),d.jsx("input",{type:"password",className:wr,placeholder:"Paste your API key",value:c,onChange:A=>{u(A.target.value),m(null),v(!1)},autoComplete:"off"})]}),d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("button",{onClick:G,disabled:f||!c.trim(),className:"rounded bg-primary px-4 py-2 text-sm font-medium text-on-primary transition-opacity disabled:opacity-40 hover:opacity-90",children:f?"Adding…":"Add"}),g&&d.jsx("span",{className:"font-mono text-[11px] text-success",children:"Added ✓"}),p&&d.jsx("span",{className:"font-mono text-[10px] text-error",children:p})]})]}),d.jsxs("div",{className:"mt-8 pt-8 border-t border-outline-variant/40",children:[d.jsx("h2",{className:"font-headline text-2xl font-bold text-on-surface mb-1",children:"Web Search"}),d.jsxs("p",{className:"font-mono text-[11px] text-on-surface-variant/70 mb-6",children:["Brave Search gives agents real web search capability."," ",M?d.jsx("span",{className:"text-success",children:"Configured ✓"}):d.jsx("span",{className:"text-warning",children:"Not configured — agents cannot search the web."})]}),d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{children:[d.jsx("label",{className:"block font-mono text-[11px] text-on-surface-variant mb-1",children:"Brave Search API key"}),M&&!D?d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("input",{type:"password",className:wr,value:"••••••••••••••••••••",readOnly:!0}),d.jsx("button",{type:"button",onClick:()=>{R(!0),P(!1)},className:"shrink-0 rounded px-3 py-2 text-[11px] font-mono text-on-surface-variant hover:text-on-surface bg-surface-container transition-colors",children:"Replace"})]}):d.jsx("input",{type:"password",className:wr,placeholder:"Enter Brave Search API key",value:x,onChange:A=>{y(A.target.value),P(!1)},autoComplete:"off",autoFocus:D})]}),d.jsxs("div",{className:"flex items-center gap-3",children:[(!M||D)&&d.jsx("button",{onClick:T,disabled:b||!x.trim(),className:"rounded-lg bg-primary px-4 py-2 text-sm font-medium text-on-primary transition-opacity hover:opacity-90 disabled:opacity-40 disabled:cursor-not-allowed",children:b?"Saving…":"Save"}),D&&d.jsx("button",{onClick:()=>{R(!1),y(""),w(null)},className:"rounded px-3 py-1.5 text-[12px] font-mono text-on-surface-variant hover:text-on-surface transition-colors",children:"Cancel"}),M&&d.jsx("button",{onClick:N,disabled:b,className:"rounded px-3 py-2 text-[12px] font-mono text-on-surface-variant hover:text-error hover:bg-error/10 transition-colors disabled:opacity-40",children:"Remove"}),E&&d.jsx("span",{className:"font-mono text-[11px] text-success",children:"Saved"}),S&&d.jsx("span",{className:"font-mono text-[10px] text-error",children:S})]})]})]})]})}const _O=1280,CO=800,ax=500,lx=5,cx={Backspace:8,Tab:9,Enter:13,Shift:16,Control:17,Alt:18,Pause:19,CapsLock:20,Escape:27,PageUp:33,PageDown:34,End:35,Home:36,ArrowLeft:37,ArrowUp:38,ArrowRight:39,ArrowDown:40,Insert:45,Delete:46,Meta:91,ContextMenu:93,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123};function NO(){const{token:e}=E0(),[t,n]=C.useState(null),[r,i]=C.useState(!1),[s,o]=C.useState(null),[a,l]=C.useState(!1),[c,u]=C.useState(!1),[f,h]=C.useState(""),[p,m]=C.useState(""),[g,v]=C.useState(""),x=C.useRef(null),y=C.useRef(null),b=C.useRef(null),k=C.useRef(null),S=C.useRef({time:0,x:0,y:0});C.useEffect(()=>{e&&fetch(`/api/takeover/${e}`).then(T=>T.status===404?(i(!0),null):T.json()).then(T=>{T&&(n(T),T.url&&m(T.url))}).catch(()=>i(!0))},[e]),C.useEffect(()=>{if(!t)return;const T=new WebSocket(I0(t.agentId,t.sessionId));return y.current=T,T.onmessage=N=>{try{const A=JSON.parse(N.data);A.type==="frame"&&A.data?o(`data:image/jpeg;base64,${A.data}`):(A.type==="attached"||A.type==="tab_changed")&&(A.url&&m(A.url),A.title&&v(A.title))}catch{}},()=>{T.onmessage=null,T.close()}},[t]),C.useEffect(()=>{var T;(T=b.current)==null||T.focus()},[t]);const w=C.useCallback(T=>{var N;((N=y.current)==null?void 0:N.readyState)===WebSocket.OPEN&&y.current.send(JSON.stringify(T))},[]),E=C.useCallback((T,N)=>{const A=x.current;if(!A)return{x:0,y:0};const H=A.getBoundingClientRect();if(H.width===0||H.height===0)return{x:0,y:0};const _=A.naturalWidth||_O,Y=A.naturalHeight||CO,q=Math.max(0,Math.min(H.width,T-H.left)),K=Math.max(0,Math.min(H.height,N-H.top));return{x:Math.round(q/H.width*_),y:Math.round(K/H.height*Y)}},[]),P=C.useCallback(T=>(T.shiftKey?8:0)|(T.ctrlKey?2:0)|(T.altKey?1:0)|(T.metaKey?4:0),[]),M=T=>T===2?"right":T===1?"middle":"left",j=T=>{const{x:N,y:A}=E(T.clientX,T.clientY);w({type:"mouse",eventType:"mouseMoved",x:N,y:A,button:k.current??"none",clickCount:0,modifiers:P(T.nativeEvent)})},D=T=>{var oe;(oe=b.current)==null||oe.focus();const{x:N,y:A}=E(T.clientX,T.clientY),H=M(T.button),_=Date.now(),Y=_-S.current.time,q=Math.abs(N-S.current.x),K=Math.abs(A-S.current.y),Le=Y<ax&&q<lx&&K<lx?2:1;S.current={time:_,x:N,y:A},k.current=H,w({type:"mouse",eventType:"mousePressed",x:N,y:A,button:H,clickCount:Le,modifiers:P(T.nativeEvent)})},R=T=>{const{x:N,y:A}=E(T.clientX,T.clientY),H=M(T.button),_=S.current.time===0?1:Date.now()-S.current.time<ax?2:1;k.current=null,w({type:"mouse",eventType:"mouseReleased",x:N,y:A,button:H,clickCount:_,modifiers:P(T.nativeEvent)})},$=()=>{k.current&&(k.current=null)},X=T=>{w({type:"scroll",...E(T.clientX,T.clientY),deltaY:T.deltaY})},W=T=>{var A;if(((A=T.target)==null?void 0:A.tagName)==="INPUT")return;T.preventDefault();const N=cx[T.key];T.key.length===1?(w({type:"key",eventType:"rawKeyDown",key:T.key,code:T.code,modifiers:P(T.nativeEvent),windowsVirtualKeyCode:T.key.toUpperCase().charCodeAt(0)}),w({type:"insertText",text:T.key})):w({type:"key",eventType:"rawKeyDown",key:T.key,code:T.code,modifiers:P(T.nativeEvent),windowsVirtualKeyCode:N??0})},G=T=>{var A;if(((A=T.target)==null?void 0:A.tagName)==="INPUT")return;const N=T.key.length===1?T.key.toUpperCase().charCodeAt(0):cx[T.key]??0;w({type:"key",eventType:"keyUp",key:T.key,code:T.code,modifiers:P(T.nativeEvent),windowsVirtualKeyCode:N})},I=T=>{var A;if(((A=T.target)==null?void 0:A.tagName)==="INPUT")return;T.preventDefault();const N=T.clipboardData.getData("text/plain");N&&w({type:"insertText",text:N})},O=async()=>{var T;if(!(!e||c)){u(!0);try{await fetch(`/api/takeover/${e}/resolve`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({note:f.trim()||void 0})}),(T=y.current)==null||T.close(),l(!0)}catch{u(!1)}}};return r?d.jsx("div",{className:"flex h-screen items-center justify-center bg-background font-body text-on-surface px-6",children:d.jsxs("div",{className:"text-center max-w-md",children:[d.jsx("p",{className:"text-[11px] font-label uppercase tracking-[0.15em] text-secondary/70 mb-2",children:"takeover"}),d.jsx("h1",{className:"font-headline text-[32px] leading-tight text-on-surface mb-3",children:"Session expired"}),d.jsx("p",{className:"text-[15px] leading-relaxed text-on-surface-variant italic",children:"This takeover link has already been used or timed out."})]})}):a?d.jsx("div",{className:"flex h-screen items-center justify-center bg-background font-body text-on-surface px-6",children:d.jsxs("div",{className:"text-center max-w-md",children:[d.jsx("p",{className:"text-[11px] font-label uppercase tracking-[0.15em] text-primary/70 mb-2",children:"complete"}),d.jsx("h1",{className:"font-headline text-[32px] leading-tight text-on-surface mb-3",children:"Returned control to the agent"}),d.jsx("p",{className:"text-[15px] leading-relaxed text-on-surface-variant italic",children:"You can close this tab."})]})}):t?d.jsxs("div",{className:"flex flex-col h-screen bg-background font-body text-on-surface overflow-hidden",children:[d.jsxs("div",{className:"flex items-start gap-4 px-8 py-5 bg-surface-container-low flex-shrink-0",children:[d.jsx("div",{className:"flex-shrink-0 mt-1 w-7 h-7 rounded-full bg-primary-fixed flex items-center justify-center",children:d.jsx("span",{className:"font-headline italic text-[15px] text-primary",children:"!"})}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("p",{className:"text-[10px] font-label uppercase tracking-[0.15em] text-primary/70 mb-1",children:"The agent needs your help"}),d.jsx("p",{className:"font-headline text-[17px] leading-snug text-on-surface",children:t.reason})]})]}),d.jsxs("div",{className:"flex items-center gap-3 px-6 py-3 bg-surface-container flex-shrink-0",children:[d.jsxs("div",{className:"flex gap-1.5 flex-shrink-0",children:[d.jsx("span",{className:"w-3 h-3 rounded-full bg-secondary/60"}),d.jsx("span",{className:"w-3 h-3 rounded-full bg-tertiary-fixed"}),d.jsx("span",{className:"w-3 h-3 rounded-full bg-primary/40"})]}),d.jsxs("div",{className:"flex-1 flex items-center gap-2 bg-surface-container-lowest rounded-md px-3 py-1.5 min-w-0",children:[d.jsx("span",{className:"text-[11px] text-primary flex-shrink-0","aria-hidden":!0,children:"∎"}),d.jsx("span",{className:"text-[12px] font-mono text-on-surface truncate",children:p||t.url||"about:blank"}),g&&d.jsxs("span",{className:"text-[11px] font-body italic text-on-surface-variant/70 flex-shrink-0 hidden md:inline",children:["— ",g]})]}),d.jsxs("div",{className:"flex items-center gap-1.5 flex-shrink-0",children:[d.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-secondary animate-pulse"}),d.jsx("span",{className:"text-[10px] font-label uppercase tracking-[0.15em] text-secondary",children:"live"})]})]}),d.jsx("div",{ref:b,tabIndex:0,className:"flex-1 flex items-center justify-center overflow-hidden outline-none cursor-default bg-surface-container-highest",onMouseMove:j,onMouseDown:D,onMouseUp:R,onMouseLeave:$,onWheel:X,onKeyDown:W,onKeyUp:G,onPaste:I,onContextMenu:T=>T.preventDefault(),children:s?d.jsx("img",{ref:x,src:s,alt:"live browser",className:"max-w-full max-h-full object-contain select-none",draggable:!1,style:{pointerEvents:"none"}}):d.jsx("p",{className:"font-mono text-[10px] text-on-surface-variant/50 animate-pulse",children:"waiting for browser stream…"})}),d.jsxs("div",{className:"flex items-end gap-4 px-8 py-5 bg-surface-container-low flex-shrink-0",children:[d.jsxs("div",{className:"flex-1 flex flex-col",children:[d.jsxs("label",{className:"text-[10px] font-label uppercase tracking-[0.15em] text-on-surface-variant/70 mb-1",children:["What did you do? ",d.jsx("span",{className:"italic text-on-surface-variant/50",children:"(optional)"})]}),d.jsx("input",{type:"text",value:f,onChange:T=>h(T.target.value),onKeyDown:T=>{T.key==="Enter"&&!T.shiftKey&&(T.preventDefault(),O())},placeholder:"Describe your action for the agent…",disabled:c,className:"bg-transparent border-0 border-b border-outline-variant/30 focus:border-primary focus:outline-none font-body text-[15px] text-on-surface placeholder:text-on-surface-variant/40 placeholder:italic px-0 py-2 disabled:opacity-50"})]}),d.jsx("button",{onClick:O,disabled:c,className:"flex-shrink-0 rounded-sm bg-primary text-on-primary font-label text-[11px] uppercase tracking-[0.15em] px-5 py-3 hover:bg-primary/90 transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:c?"Returning…":"Completed"})]})]}):d.jsx("div",{className:"flex h-screen items-center justify-center bg-background font-body",children:d.jsx("p",{className:"font-mono text-[11px] text-on-surface-variant/60 animate-pulse",children:"connecting…"})})}function jO(){return d.jsxs(SS,{children:[d.jsx(Tn,{path:"takeover/:token",element:d.jsx(NO,{})}),d.jsxs(Tn,{element:d.jsx(zS,{}),children:[d.jsx(Tn,{index:!0,element:d.jsx(wp,{to:"/dashboard",replace:!0})}),d.jsx(Tn,{path:"dashboard",element:d.jsx(S_,{})}),d.jsx(Tn,{path:"agents/:id/*",element:d.jsx(wO,{})}),d.jsx(Tn,{path:"settings",element:d.jsx(SO,{})}),d.jsx(Tn,{path:"*",element:d.jsx(wp,{to:"/dashboard",replace:!0})})]})]})}Wc.createRoot(document.getElementById("root")).render(d.jsx(bx.StrictMode,{children:d.jsx(MS,{children:d.jsx(jO,{})})}));
@@ -1 +1 @@
1
- *,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:Inter,system-ui,sans-serif;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:JetBrains Mono,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}:root{--background: 254 249 239;--on-background: 29 28 22;--on-surface: 29 28 22;--on-surface-variant: 58 55 47;--surface-bright: 254 249 239;--surface-dim: 222 218 208;--surface-container-lowest: 251 246 235;--surface-container-low: 248 243 233;--surface-container: 242 237 227;--surface-container-high: 237 227 207;--surface-container-highest: 231 226 216;--primary: 93 57 224;--on-primary: 255 255 255;--primary-fixed: 230 222 255;--primary-fixed-dim: 202 190 255;--surface-tint: 96 60 227;--secondary: 177 46 9;--secondary-container: 253 100 61;--tertiary-fixed: 243 228 143;--outline: 121 117 135;--outline-variant: 201 196 216;--error: 186 26 26;--success: 16 122 75;--warning: 202 138 4;--info: 37 99 235}.dark{--background: 29 28 22;--on-background: 245 240 224;--on-surface: 245 240 224;--on-surface-variant: 185 179 195;--surface-bright: 58 54 39;--surface-dim: 20 19 16;--surface-container-lowest: 20 19 16;--surface-container-low: 36 34 26;--surface-container: 46 45 34;--surface-container-high: 58 55 43;--surface-container-highest: 70 67 52;--primary: 202 190 255;--on-primary: 34 16 112;--primary-fixed: 230 222 255;--primary-fixed-dim: 93 57 224;--surface-tint: 202 190 255;--secondary: 255 180 167;--secondary-container: 142 26 0;--tertiary-fixed: 92 81 42;--outline: 141 134 148;--outline-variant: 71 70 79;--error: 255 180 171;--success: 94 218 160;--warning: 250 204 21;--info: 96 165 250}*{box-sizing:border-box}html{scroll-behavior:smooth;scroll-padding-top:72px}body{--tw-bg-opacity: 1;background-color:rgb(var(--background) / var(--tw-bg-opacity, 1));font-family:Inter,system-ui,sans-serif;--tw-text-opacity: 1;color:rgb(var(--on-surface) / var(--tw-text-opacity, 1));background-image:linear-gradient(rgb(var(--on-surface) / .03) 1px,transparent 1px),radial-gradient(circle,rgb(var(--on-surface) / .02) 1px,transparent 1px);background-size:100% 28px,16px 16px;background-attachment:fixed;min-height:100vh}h1,h2,h3{font-family:"Noto Serif",Georgia,serif;--tw-text-opacity: 1;color:rgb(var(--on-surface) / var(--tw-text-opacity, 1))}::-webkit-scrollbar{width:6px;height:6px}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{background:rgb(var(--outline-variant));border-radius:999px}::-webkit-scrollbar-thumb:hover{background:rgb(var(--outline))}::-moz-selection{background:rgb(var(--primary-fixed));color:rgb(var(--on-primary))}::selection{background:rgb(var(--primary-fixed));color:rgb(var(--on-primary))}.container{width:100%}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.prose{color:var(--tw-prose-body);max-width:65ch}.prose :where(p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}.prose :where([class~=lead]):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-lead);font-size:1.25em;line-height:1.6;margin-top:1.2em;margin-bottom:1.2em}.prose :where(a):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-links);text-decoration:underline;font-weight:500}.prose :where(strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-bold);font-weight:600}.prose :where(a strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(blockquote strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(thead th strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(ol):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:decimal;margin-top:1.25em;margin-bottom:1.25em;padding-inline-start:1.625em}.prose :where(ol[type=A]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-alpha}.prose :where(ol[type=a]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-alpha}.prose :where(ol[type=A s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-alpha}.prose :where(ol[type=a s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-alpha}.prose :where(ol[type=I]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-roman}.prose :where(ol[type=i]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-roman}.prose :where(ol[type=I s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-roman}.prose :where(ol[type=i s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-roman}.prose :where(ol[type="1"]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:decimal}.prose :where(ul):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:disc;margin-top:1.25em;margin-bottom:1.25em;padding-inline-start:1.625em}.prose :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *))::marker{font-weight:400;color:var(--tw-prose-counters)}.prose :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *))::marker{color:var(--tw-prose-bullets)}.prose :where(dt):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;margin-top:1.25em}.prose :where(hr):not(:where([class~=not-prose],[class~=not-prose] *)){border-color:var(--tw-prose-hr);border-top-width:1px;margin-top:3em;margin-bottom:3em}.prose :where(blockquote):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:500;font-style:italic;color:var(--tw-prose-quotes);border-inline-start-width:.25rem;border-inline-start-color:var(--tw-prose-quote-borders);quotes:"“""”""‘""’";margin-top:1.6em;margin-bottom:1.6em;padding-inline-start:1em}.prose :where(blockquote p:first-of-type):not(:where([class~=not-prose],[class~=not-prose] *)):before{content:open-quote}.prose :where(blockquote p:last-of-type):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:close-quote}.prose :where(h1):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:800;font-size:2.25em;margin-top:0;margin-bottom:.8888889em;line-height:1.1111111}.prose :where(h1 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:900;color:inherit}.prose :where(h2):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:700;font-size:1.5em;margin-top:2em;margin-bottom:1em;line-height:1.3333333}.prose :where(h2 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:800;color:inherit}.prose :where(h3):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;font-size:1.25em;margin-top:1.6em;margin-bottom:.6em;line-height:1.6}.prose :where(h3 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:700;color:inherit}.prose :where(h4):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;margin-top:1.5em;margin-bottom:.5em;line-height:1.5}.prose :where(h4 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:700;color:inherit}.prose :where(img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.prose :where(picture):not(:where([class~=not-prose],[class~=not-prose] *)){display:block;margin-top:2em;margin-bottom:2em}.prose :where(video):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.prose :where(kbd):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:500;font-family:inherit;color:var(--tw-prose-kbd);box-shadow:0 0 0 1px var(--tw-prose-kbd-shadows),0 3px 0 var(--tw-prose-kbd-shadows);font-size:.875em;border-radius:.3125rem;padding-top:.1875em;padding-inline-end:.375em;padding-bottom:.1875em;padding-inline-start:.375em}.prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-code);font-weight:600;font-size:.875em}.prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)):before{content:"`"}.prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:"`"}.prose :where(a code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(h1 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(h2 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-size:.875em}.prose :where(h3 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-size:.9em}.prose :where(h4 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(blockquote code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(thead th code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(pre):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-pre-code);background-color:var(--tw-prose-pre-bg);overflow-x:auto;font-weight:400;font-size:.875em;line-height:1.7142857;margin-top:1.7142857em;margin-bottom:1.7142857em;border-radius:.375rem;padding-top:.8571429em;padding-inline-end:1.1428571em;padding-bottom:.8571429em;padding-inline-start:1.1428571em}.prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)){background-color:transparent;border-width:0;border-radius:0;padding:0;font-weight:inherit;color:inherit;font-size:inherit;font-family:inherit;line-height:inherit}.prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)):before{content:none}.prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:none}.prose :where(table):not(:where([class~=not-prose],[class~=not-prose] *)){width:100%;table-layout:auto;margin-top:2em;margin-bottom:2em;font-size:.875em;line-height:1.7142857}.prose :where(thead):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-th-borders)}.prose :where(thead th):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;vertical-align:bottom;padding-inline-end:.5714286em;padding-bottom:.5714286em;padding-inline-start:.5714286em}.prose :where(tbody tr):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-td-borders)}.prose :where(tbody tr:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:0}.prose :where(tbody td):not(:where([class~=not-prose],[class~=not-prose] *)){vertical-align:baseline}.prose :where(tfoot):not(:where([class~=not-prose],[class~=not-prose] *)){border-top-width:1px;border-top-color:var(--tw-prose-th-borders)}.prose :where(tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){vertical-align:top}.prose :where(th,td):not(:where([class~=not-prose],[class~=not-prose] *)){text-align:start}.prose :where(figure>*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose :where(figcaption):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-captions);font-size:.875em;line-height:1.4285714;margin-top:.8571429em}.prose{--tw-prose-body: #374151;--tw-prose-headings: #111827;--tw-prose-lead: #4b5563;--tw-prose-links: #111827;--tw-prose-bold: #111827;--tw-prose-counters: #6b7280;--tw-prose-bullets: #d1d5db;--tw-prose-hr: #e5e7eb;--tw-prose-quotes: #111827;--tw-prose-quote-borders: #e5e7eb;--tw-prose-captions: #6b7280;--tw-prose-kbd: #111827;--tw-prose-kbd-shadows: rgb(17 24 39 / 10%);--tw-prose-code: #111827;--tw-prose-pre-code: #e5e7eb;--tw-prose-pre-bg: #1f2937;--tw-prose-th-borders: #d1d5db;--tw-prose-td-borders: #e5e7eb;--tw-prose-invert-body: #d1d5db;--tw-prose-invert-headings: #fff;--tw-prose-invert-lead: #9ca3af;--tw-prose-invert-links: #fff;--tw-prose-invert-bold: #fff;--tw-prose-invert-counters: #9ca3af;--tw-prose-invert-bullets: #4b5563;--tw-prose-invert-hr: #374151;--tw-prose-invert-quotes: #f3f4f6;--tw-prose-invert-quote-borders: #374151;--tw-prose-invert-captions: #9ca3af;--tw-prose-invert-kbd: #fff;--tw-prose-invert-kbd-shadows: rgb(255 255 255 / 10%);--tw-prose-invert-code: #fff;--tw-prose-invert-pre-code: #d1d5db;--tw-prose-invert-pre-bg: rgb(0 0 0 / 50%);--tw-prose-invert-th-borders: #4b5563;--tw-prose-invert-td-borders: #374151;font-size:1rem;line-height:1.75}.prose :where(picture>img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose :where(li):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5em;margin-bottom:.5em}.prose :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.375em}.prose :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.375em}.prose :where(.prose>ul>li p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.75em;margin-bottom:.75em}.prose :where(.prose>ul>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em}.prose :where(.prose>ul>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.25em}.prose :where(.prose>ol>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em}.prose :where(.prose>ol>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.25em}.prose :where(ul ul,ul ol,ol ul,ol ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.75em;margin-bottom:.75em}.prose :where(dl):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}.prose :where(dd):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5em;padding-inline-start:1.625em}.prose :where(hr+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(h2+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(h3+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(h4+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(thead th:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.prose :where(thead th:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.prose :where(tbody td,tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){padding-top:.5714286em;padding-inline-end:.5714286em;padding-bottom:.5714286em;padding-inline-start:.5714286em}.prose :where(tbody td:first-child,tfoot td:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.prose :where(tbody td:last-child,tfoot td:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.prose :where(figure):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.prose :where(.prose>:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(.prose>:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:0}.prose-sm{font-size:.875rem;line-height:1.7142857}.prose-sm :where(p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em;margin-bottom:1.1428571em}.prose-sm :where([class~=lead]):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:1.2857143em;line-height:1.5555556;margin-top:.8888889em;margin-bottom:.8888889em}.prose-sm :where(blockquote):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.3333333em;margin-bottom:1.3333333em;padding-inline-start:1.1111111em}.prose-sm :where(h1):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:2.1428571em;margin-top:0;margin-bottom:.8em;line-height:1.2}.prose-sm :where(h2):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:1.4285714em;margin-top:1.6em;margin-bottom:.8em;line-height:1.4}.prose-sm :where(h3):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:1.2857143em;margin-top:1.5555556em;margin-bottom:.4444444em;line-height:1.5555556}.prose-sm :where(h4):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.4285714em;margin-bottom:.5714286em;line-height:1.4285714}.prose-sm :where(img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7142857em;margin-bottom:1.7142857em}.prose-sm :where(picture):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7142857em;margin-bottom:1.7142857em}.prose-sm :where(picture>img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose-sm :where(video):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7142857em;margin-bottom:1.7142857em}.prose-sm :where(kbd):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em;border-radius:.3125rem;padding-top:.1428571em;padding-inline-end:.3571429em;padding-bottom:.1428571em;padding-inline-start:.3571429em}.prose-sm :where(code):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em}.prose-sm :where(h2 code):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.9em}.prose-sm :where(h3 code):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8888889em}.prose-sm :where(pre):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em;line-height:1.6666667;margin-top:1.6666667em;margin-bottom:1.6666667em;border-radius:.25rem;padding-top:.6666667em;padding-inline-end:1em;padding-bottom:.6666667em;padding-inline-start:1em}.prose-sm :where(ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em;margin-bottom:1.1428571em;padding-inline-start:1.5714286em}.prose-sm :where(ul):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em;margin-bottom:1.1428571em;padding-inline-start:1.5714286em}.prose-sm :where(li):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.2857143em;margin-bottom:.2857143em}.prose-sm :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.4285714em}.prose-sm :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.4285714em}.prose-sm :where(.prose-sm>ul>li p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5714286em;margin-bottom:.5714286em}.prose-sm :where(.prose-sm>ul>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em}.prose-sm :where(.prose-sm>ul>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.1428571em}.prose-sm :where(.prose-sm>ol>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em}.prose-sm :where(.prose-sm>ol>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.1428571em}.prose-sm :where(ul ul,ul ol,ol ul,ol ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5714286em;margin-bottom:.5714286em}.prose-sm :where(dl):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em;margin-bottom:1.1428571em}.prose-sm :where(dt):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em}.prose-sm :where(dd):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.2857143em;padding-inline-start:1.5714286em}.prose-sm :where(hr):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2.8571429em;margin-bottom:2.8571429em}.prose-sm :where(hr+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(h2+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(h3+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(h4+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(table):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em;line-height:1.5}.prose-sm :where(thead th):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:1em;padding-bottom:.6666667em;padding-inline-start:1em}.prose-sm :where(thead th:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.prose-sm :where(thead th:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.prose-sm :where(tbody td,tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){padding-top:.6666667em;padding-inline-end:1em;padding-bottom:.6666667em;padding-inline-start:1em}.prose-sm :where(tbody td:first-child,tfoot td:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.prose-sm :where(tbody td:last-child,tfoot td:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.prose-sm :where(figure):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7142857em;margin-bottom:1.7142857em}.prose-sm :where(figure>*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose-sm :where(figcaption):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em;line-height:1.3333333;margin-top:.6666667em}.prose-sm :where(.prose-sm>:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(.prose-sm>:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:0}.noise-overlay{pointer-events:none;position:fixed;top:0;right:0;bottom:0;left:0;background-image:url(https://www.transparenttextures.com/patterns/paper-fibers.png);opacity:.05;z-index:9999;mix-blend-mode:multiply}.dark .noise-overlay{opacity:.1;mix-blend-mode:screen}.highlight-marker{background:linear-gradient(104deg,rgb(var(--tertiary-fixed) / 0) .9%,rgb(var(--tertiary-fixed) / 1) 2.4%,rgb(var(--tertiary-fixed) / .5) 5.8%,rgb(var(--tertiary-fixed) / .1) 93%,rgb(var(--tertiary-fixed) / .7) 96%,rgb(var(--tertiary-fixed) / 0) 98%),linear-gradient(183deg,rgb(var(--tertiary-fixed) / 0),rgb(var(--tertiary-fixed) / .3) 7.9%,rgb(var(--tertiary-fixed) / 0) 15%);padding:.1em .3em}.shadow-callout{box-shadow:0 10px 40px #1d1c160f}.dark .shadow-callout{box-shadow:0 10px 40px #0006}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.visible{visibility:visible}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{top:0;right:0;bottom:0;left:0}.inset-y-0{top:0;bottom:0}.bottom-\[42px\]{bottom:42px}.left-0{left:0}.left-2\.5{left:.625rem}.left-3{left:.75rem}.right-0{right:0}.right-2{right:.5rem}.right-3{right:.75rem}.top-0{top:0}.top-1\/2{top:50%}.top-3{top:.75rem}.z-0{z-index:0}.z-10{z-index:10}.z-20{z-index:20}.z-40{z-index:40}.z-50{z-index:50}.m-auto{margin:auto}.-mx-2{margin-left:-.5rem;margin-right:-.5rem}.mx-2{margin-left:.5rem;margin-right:.5rem}.mx-auto{margin-left:auto;margin-right:auto}.my-1{margin-top:.25rem;margin-bottom:.25rem}.mb-0\.5{margin-bottom:.125rem}.mb-1{margin-bottom:.25rem}.mb-1\.5{margin-bottom:.375rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-6{margin-bottom:1.5rem}.mb-8{margin-bottom:2rem}.ml-1{margin-left:.25rem}.ml-2{margin-left:.5rem}.ml-3{margin-left:.75rem}.ml-7{margin-left:1.75rem}.ml-\[79px\]{margin-left:79px}.ml-auto{margin-left:auto}.mr-1{margin-right:.25rem}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-1\.5{margin-top:.375rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-8{margin-top:2rem}.mt-\[3px\]{margin-top:3px}.mt-\[6px\]{margin-top:6px}.mt-auto{margin-top:auto}.line-clamp-2{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.hidden{display:none}.h-1{height:.25rem}.h-1\.5{height:.375rem}.h-12{height:3rem}.h-14{height:3.5rem}.h-2{height:.5rem}.h-2\.5{height:.625rem}.h-3{height:.75rem}.h-3\.5{height:.875rem}.h-4{height:1rem}.h-44{height:11rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-\[5px\]{height:5px}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.max-h-48{max-height:12rem}.max-h-52{max-height:13rem}.max-h-80{max-height:20rem}.max-h-full{max-height:100%}.min-h-0{min-height:0px}.min-h-\[120px\]{min-height:120px}.min-h-\[48px\]{min-height:48px}.min-h-\[72px\]{min-height:72px}.w-1{width:.25rem}.w-1\.5{width:.375rem}.w-10{width:2.5rem}.w-12{width:3rem}.w-2{width:.5rem}.w-2\.5{width:.625rem}.w-3{width:.75rem}.w-3\.5{width:.875rem}.w-4{width:1rem}.w-40{width:10rem}.w-44{width:11rem}.w-5{width:1.25rem}.w-56{width:14rem}.w-6{width:1.5rem}.w-7{width:1.75rem}.w-72{width:18rem}.w-8{width:2rem}.w-80{width:20rem}.w-96{width:24rem}.w-\[52px\]{width:52px}.w-\[5px\]{width:5px}.w-\[70px\]{width:70px}.w-full{width:100%}.min-w-0{min-width:0px}.max-w-2xl{max-width:42rem}.max-w-3xl{max-width:48rem}.max-w-4xl{max-width:56rem}.max-w-\[260px\]{max-width:260px}.max-w-\[60\%\]{max-width:60%}.max-w-full{max-width:100%}.max-w-lg{max-width:32rem}.max-w-md{max-width:28rem}.max-w-none{max-width:none}.max-w-sm{max-width:24rem}.max-w-xl{max-width:36rem}.max-w-xs{max-width:20rem}.flex-1{flex:1 1 0%}.flex-shrink-0,.shrink-0{flex-shrink:0}.-translate-x-1\/2{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize-none{resize:none}.resize-y{resize:vertical}.appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0{gap:0px}.gap-0\.5{gap:.125rem}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-2\.5{gap:.625rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-5{gap:1.25rem}.gap-6{gap:1.5rem}.gap-x-3{-moz-column-gap:.75rem;column-gap:.75rem}.gap-y-1{row-gap:.25rem}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-1\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-2\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.625rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.625rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.self-start{align-self:flex-start}.self-end{align-self:flex-end}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.rounded{border-radius:.125rem}.rounded-full{border-radius:.75rem}.rounded-lg{border-radius:.25rem}.rounded-md{border-radius:.375rem}.rounded-sm{border-radius:.125rem}.rounded-xl{border-radius:.5rem}.border{border-width:1px}.border-0{border-width:0px}.border-2{border-width:2px}.border-b{border-bottom-width:1px}.border-l{border-left-width:1px}.border-l-2{border-left-width:2px}.border-t{border-top-width:1px}.border-amber-400\/20{border-color:#fbbf2433}.border-amber-800\/50{border-color:#92400e80}.border-error\/20{border-color:rgb(var(--error) / .2)}.border-info\/20{border-color:rgb(var(--info) / .2)}.border-outline-variant{--tw-border-opacity: 1;border-color:rgb(var(--outline-variant) / var(--tw-border-opacity, 1))}.border-outline-variant\/20{border-color:rgb(var(--outline-variant) / .2)}.border-outline-variant\/30{border-color:rgb(var(--outline-variant) / .3)}.border-outline-variant\/40{border-color:rgb(var(--outline-variant) / .4)}.border-outline-variant\/60{border-color:rgb(var(--outline-variant) / .6)}.border-primary\/20{border-color:rgb(var(--primary) / .2)}.border-primary\/40{border-color:rgb(var(--primary) / .4)}.border-red-800\/50{border-color:#991b1b80}.border-secondary\/30{border-color:rgb(var(--secondary) / .3)}.border-success\/20{border-color:rgb(var(--success) / .2)}.border-success\/30{border-color:rgb(var(--success) / .3)}.border-warning\/20{border-color:rgb(var(--warning) / .2)}.border-warning\/30{border-color:rgb(var(--warning) / .3)}.border-white\/\[0\.03\]{border-color:#ffffff08}.border-l-primary{--tw-border-opacity: 1;border-left-color:rgb(var(--primary) / var(--tw-border-opacity, 1))}.border-t-primary{--tw-border-opacity: 1;border-top-color:rgb(var(--primary) / var(--tw-border-opacity, 1))}.bg-amber-400\/10{background-color:#fbbf241a}.bg-amber-500\/20{background-color:#f59e0b33}.bg-amber-950\/40{background-color:#451a0366}.bg-background{--tw-bg-opacity: 1;background-color:rgb(var(--background) / var(--tw-bg-opacity, 1))}.bg-black\/60{background-color:#0009}.bg-blue-400{--tw-bg-opacity: 1;background-color:rgb(96 165 250 / var(--tw-bg-opacity, 1))}.bg-blue-400\/60{background-color:#60a5fa99}.bg-blue-500{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity, 1))}.bg-blue-500\/10{background-color:#3b82f61a}.bg-blue-500\/5{background-color:#3b82f60d}.bg-emerald-400{--tw-bg-opacity: 1;background-color:rgb(52 211 153 / var(--tw-bg-opacity, 1))}.bg-emerald-500{--tw-bg-opacity: 1;background-color:rgb(16 185 129 / var(--tw-bg-opacity, 1))}.bg-emerald-500\/10{background-color:#10b9811a}.bg-error{--tw-bg-opacity: 1;background-color:rgb(var(--error) / var(--tw-bg-opacity, 1))}.bg-error\/10{background-color:rgb(var(--error) / .1)}.bg-gray-500{--tw-bg-opacity: 1;background-color:rgb(107 114 128 / var(--tw-bg-opacity, 1))}.bg-gray-600{--tw-bg-opacity: 1;background-color:rgb(75 85 99 / var(--tw-bg-opacity, 1))}.bg-green-500{--tw-bg-opacity: 1;background-color:rgb(34 197 94 / var(--tw-bg-opacity, 1))}.bg-info{--tw-bg-opacity: 1;background-color:rgb(var(--info) / var(--tw-bg-opacity, 1))}.bg-info\/10{background-color:rgb(var(--info) / .1)}.bg-on-surface-variant\/30{background-color:rgb(var(--on-surface-variant) / .3)}.bg-outline{--tw-bg-opacity: 1;background-color:rgb(var(--outline) / var(--tw-bg-opacity, 1))}.bg-outline\/50{background-color:rgb(var(--outline) / .5)}.bg-outline\/60{background-color:rgb(var(--outline) / .6)}.bg-primary{--tw-bg-opacity: 1;background-color:rgb(var(--primary) / var(--tw-bg-opacity, 1))}.bg-primary-fixed{--tw-bg-opacity: 1;background-color:rgb(var(--primary-fixed) / var(--tw-bg-opacity, 1))}.bg-primary\/10{background-color:rgb(var(--primary) / .1)}.bg-primary\/15{background-color:rgb(var(--primary) / .15)}.bg-primary\/20{background-color:rgb(var(--primary) / .2)}.bg-primary\/25{background-color:rgb(var(--primary) / .25)}.bg-primary\/40{background-color:rgb(var(--primary) / .4)}.bg-primary\/50{background-color:rgb(var(--primary) / .5)}.bg-red-400{--tw-bg-opacity: 1;background-color:rgb(248 113 113 / var(--tw-bg-opacity, 1))}.bg-red-500{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity, 1))}.bg-red-500\/10{background-color:#ef44441a}.bg-red-500\/20{background-color:#ef444433}.bg-red-950\/15{background-color:#450a0a26}.bg-red-950\/30{background-color:#450a0a4d}.bg-red-950\/40{background-color:#450a0a66}.bg-secondary{--tw-bg-opacity: 1;background-color:rgb(var(--secondary) / var(--tw-bg-opacity, 1))}.bg-secondary-container{--tw-bg-opacity: 1;background-color:rgb(var(--secondary-container) / var(--tw-bg-opacity, 1))}.bg-secondary\/15{background-color:rgb(var(--secondary) / .15)}.bg-secondary\/20{background-color:rgb(var(--secondary) / .2)}.bg-secondary\/60{background-color:rgb(var(--secondary) / .6)}.bg-secondary\/70{background-color:rgb(var(--secondary) / .7)}.bg-success{--tw-bg-opacity: 1;background-color:rgb(var(--success) / var(--tw-bg-opacity, 1))}.bg-success\/10{background-color:rgb(var(--success) / .1)}.bg-success\/15{background-color:rgb(var(--success) / .15)}.bg-surface-container{--tw-bg-opacity: 1;background-color:rgb(var(--surface-container) / var(--tw-bg-opacity, 1))}.bg-surface-container-high{--tw-bg-opacity: 1;background-color:rgb(var(--surface-container-high) / var(--tw-bg-opacity, 1))}.bg-surface-container-highest{--tw-bg-opacity: 1;background-color:rgb(var(--surface-container-highest) / var(--tw-bg-opacity, 1))}.bg-surface-container-low{--tw-bg-opacity: 1;background-color:rgb(var(--surface-container-low) / var(--tw-bg-opacity, 1))}.bg-surface-container-lowest{--tw-bg-opacity: 1;background-color:rgb(var(--surface-container-lowest) / var(--tw-bg-opacity, 1))}.bg-surface-container-lowest\/90{background-color:rgb(var(--surface-container-lowest) / .9)}.bg-surface-container\/30{background-color:rgb(var(--surface-container) / .3)}.bg-surface-dim\/50{background-color:rgb(var(--surface-dim) / .5)}.bg-tertiary-fixed{--tw-bg-opacity: 1;background-color:rgb(var(--tertiary-fixed) / var(--tw-bg-opacity, 1))}.bg-transparent{background-color:transparent}.bg-warning{--tw-bg-opacity: 1;background-color:rgb(var(--warning) / var(--tw-bg-opacity, 1))}.bg-warning\/10{background-color:rgb(var(--warning) / .1)}.bg-yellow-400\/30{background-color:#facc154d}.bg-yellow-500\/50{background-color:#eab30880}.object-contain{-o-object-fit:contain;object-fit:contain}.p-2{padding:.5rem}.p-2\.5{padding:.625rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-5{padding:1.25rem}.p-6{padding:1.5rem}.p-8{padding:2rem}.px-0{padding-left:0;padding-right:0}.px-0\.5{padding-left:.125rem;padding-right:.125rem}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.px-8{padding-left:2rem;padding-right:2rem}.px-\[12px\]{padding-left:12px;padding-right:12px}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-16{padding-top:4rem;padding-bottom:4rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-5{padding-top:1.25rem;padding-bottom:1.25rem}.py-8{padding-top:2rem;padding-bottom:2rem}.py-\[1px\]{padding-top:1px;padding-bottom:1px}.py-\[2px\]{padding-top:2px;padding-bottom:2px}.py-\[5px\]{padding-top:5px;padding-bottom:5px}.py-\[7px\]{padding-top:7px;padding-bottom:7px}.pb-3{padding-bottom:.75rem}.pb-4{padding-bottom:1rem}.pl-8{padding-left:2rem}.pr-1{padding-right:.25rem}.pr-7{padding-right:1.75rem}.pt-0\.5{padding-top:.125rem}.pt-1{padding-top:.25rem}.pt-16{padding-top:4rem}.pt-2{padding-top:.5rem}.pt-20{padding-top:5rem}.pt-4{padding-top:1rem}.pt-8{padding-top:2rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.font-headline{font-family:"Noto Serif",Georgia,serif}.font-label{font-family:Space Grotesk,sans-serif}.font-mono{font-family:JetBrains Mono,monospace}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-4xl{font-size:2.25rem;line-height:2.5rem}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.text-\[12px\]{font-size:12px}.text-\[13px\]{font-size:13px}.text-\[15px\]{font-size:15px}.text-\[16px\]{font-size:16px}.text-\[17px\]{font-size:17px}.text-\[18px\]{font-size:18px}.text-\[20px\]{font-size:20px}.text-\[22px\]{font-size:22px}.text-\[32px\]{font-size:32px}.text-\[7px\]{font-size:7px}.text-\[8px\]{font-size:8px}.text-\[9px\]{font-size:9px}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.lowercase{text-transform:lowercase}.italic{font-style:italic}.tabular-nums{--tw-numeric-spacing: tabular-nums;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.leading-none{line-height:1}.leading-relaxed{line-height:1.625}.leading-snug{line-height:1.375}.leading-tight{line-height:1.25}.tracking-\[-0\.01em\]{letter-spacing:-.01em}.tracking-\[0\.08em\]{letter-spacing:.08em}.tracking-\[0\.14em\]{letter-spacing:.14em}.tracking-\[0\.15em\]{letter-spacing:.15em}.tracking-\[0\.18em\]{letter-spacing:.18em}.tracking-\[0\.1em\]{letter-spacing:.1em}.tracking-tight{letter-spacing:-.025em}.tracking-wide{letter-spacing:.025em}.tracking-wider{letter-spacing:.05em}.tracking-widest{letter-spacing:.1em}.text-amber-500\/30{color:#f59e0b4d}.text-amber-500\/60{color:#f59e0b99}.text-error{--tw-text-opacity: 1;color:rgb(var(--error) / var(--tw-text-opacity, 1))}.text-error\/30{color:rgb(var(--error) / .3)}.text-error\/40{color:rgb(var(--error) / .4)}.text-error\/50{color:rgb(var(--error) / .5)}.text-error\/60{color:rgb(var(--error) / .6)}.text-error\/70{color:rgb(var(--error) / .7)}.text-error\/80{color:rgb(var(--error) / .8)}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.text-info{--tw-text-opacity: 1;color:rgb(var(--info) / var(--tw-text-opacity, 1))}.text-info\/60{color:rgb(var(--info) / .6)}.text-on-primary{--tw-text-opacity: 1;color:rgb(var(--on-primary) / var(--tw-text-opacity, 1))}.text-on-surface{--tw-text-opacity: 1;color:rgb(var(--on-surface) / var(--tw-text-opacity, 1))}.text-on-surface-variant{--tw-text-opacity: 1;color:rgb(var(--on-surface-variant) / var(--tw-text-opacity, 1))}.text-on-surface-variant\/20{color:rgb(var(--on-surface-variant) / .2)}.text-on-surface-variant\/25{color:rgb(var(--on-surface-variant) / .25)}.text-on-surface-variant\/35{color:rgb(var(--on-surface-variant) / .35)}.text-on-surface-variant\/40{color:rgb(var(--on-surface-variant) / .4)}.text-on-surface-variant\/50{color:rgb(var(--on-surface-variant) / .5)}.text-on-surface-variant\/60{color:rgb(var(--on-surface-variant) / .6)}.text-on-surface-variant\/70{color:rgb(var(--on-surface-variant) / .7)}.text-on-surface\/70{color:rgb(var(--on-surface) / .7)}.text-on-surface\/80{color:rgb(var(--on-surface) / .8)}.text-on-surface\/90{color:rgb(var(--on-surface) / .9)}.text-primary{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity, 1))}.text-primary\/40{color:rgb(var(--primary) / .4)}.text-primary\/50{color:rgb(var(--primary) / .5)}.text-primary\/60{color:rgb(var(--primary) / .6)}.text-primary\/70{color:rgb(var(--primary) / .7)}.text-secondary{--tw-text-opacity: 1;color:rgb(var(--secondary) / var(--tw-text-opacity, 1))}.text-secondary\/50{color:rgb(var(--secondary) / .5)}.text-secondary\/60{color:rgb(var(--secondary) / .6)}.text-secondary\/70{color:rgb(var(--secondary) / .7)}.text-secondary\/80{color:rgb(var(--secondary) / .8)}.text-success{--tw-text-opacity: 1;color:rgb(var(--success) / var(--tw-text-opacity, 1))}.text-transparent{color:transparent}.text-warning{--tw-text-opacity: 1;color:rgb(var(--warning) / var(--tw-text-opacity, 1))}.text-warning\/30{color:rgb(var(--warning) / .3)}.text-warning\/50{color:rgb(var(--warning) / .5)}.text-warning\/60{color:rgb(var(--warning) / .6)}.text-warning\/80{color:rgb(var(--warning) / .8)}.text-yellow-200{--tw-text-opacity: 1;color:rgb(254 240 138 / var(--tw-text-opacity, 1))}.placeholder-on-surface-variant::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(var(--on-surface-variant) / var(--tw-placeholder-opacity, 1))}.placeholder-on-surface-variant::placeholder{--tw-placeholder-opacity: 1;color:rgb(var(--on-surface-variant) / var(--tw-placeholder-opacity, 1))}.opacity-0{opacity:0}.opacity-10{opacity:.1}.opacity-30{opacity:.3}.opacity-40{opacity:.4}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-90{opacity:.9}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-callout{--tw-shadow: 0 10px 40px rgba(29, 28, 22, .06);--tw-shadow-colored: 0 10px 40px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.ring{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-1{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-2{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-primary\/30{--tw-ring-color: rgb(var(--primary) / .3)}.ring-primary\/60{--tw-ring-color: rgb(var(--primary) / .6)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur-sm{--tw-backdrop-blur: blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[grid-template-rows\]{transition-property:grid-template-rows;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-shadow{transition-property:box-shadow;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-150{transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-500{transition-duration:.5s}.hover\:shadow-callout:hover{box-shadow:0 10px 40px #1d1c160f}.dark .hover\:shadow-callout:hover{box-shadow:0 10px 40px #0006}.dark\:prose-invert:is(.dark *){--tw-prose-body: var(--tw-prose-invert-body);--tw-prose-headings: var(--tw-prose-invert-headings);--tw-prose-lead: var(--tw-prose-invert-lead);--tw-prose-links: var(--tw-prose-invert-links);--tw-prose-bold: var(--tw-prose-invert-bold);--tw-prose-counters: var(--tw-prose-invert-counters);--tw-prose-bullets: var(--tw-prose-invert-bullets);--tw-prose-hr: var(--tw-prose-invert-hr);--tw-prose-quotes: var(--tw-prose-invert-quotes);--tw-prose-quote-borders: var(--tw-prose-invert-quote-borders);--tw-prose-captions: var(--tw-prose-invert-captions);--tw-prose-kbd: var(--tw-prose-invert-kbd);--tw-prose-kbd-shadows: var(--tw-prose-invert-kbd-shadows);--tw-prose-code: var(--tw-prose-invert-code);--tw-prose-pre-code: var(--tw-prose-invert-pre-code);--tw-prose-pre-bg: var(--tw-prose-invert-pre-bg);--tw-prose-th-borders: var(--tw-prose-invert-th-borders);--tw-prose-td-borders: var(--tw-prose-invert-td-borders)}.placeholder\:italic::-moz-placeholder{font-style:italic}.placeholder\:italic::placeholder{font-style:italic}.placeholder\:text-on-surface-variant::-moz-placeholder{--tw-text-opacity: 1;color:rgb(var(--on-surface-variant) / var(--tw-text-opacity, 1))}.placeholder\:text-on-surface-variant::placeholder{--tw-text-opacity: 1;color:rgb(var(--on-surface-variant) / var(--tw-text-opacity, 1))}.placeholder\:text-on-surface-variant\/25::-moz-placeholder{color:rgb(var(--on-surface-variant) / .25)}.placeholder\:text-on-surface-variant\/25::placeholder{color:rgb(var(--on-surface-variant) / .25)}.placeholder\:text-on-surface-variant\/40::-moz-placeholder{color:rgb(var(--on-surface-variant) / .4)}.placeholder\:text-on-surface-variant\/40::placeholder{color:rgb(var(--on-surface-variant) / .4)}.placeholder\:text-on-surface-variant\/60::-moz-placeholder{color:rgb(var(--on-surface-variant) / .6)}.placeholder\:text-on-surface-variant\/60::placeholder{color:rgb(var(--on-surface-variant) / .6)}.last\:border-0:last-child{border-width:0px}.hover\:border-outline:hover{--tw-border-opacity: 1;border-color:rgb(var(--outline) / var(--tw-border-opacity, 1))}.hover\:border-primary\/40:hover{border-color:rgb(var(--primary) / .4)}.hover\:bg-error\/10:hover{background-color:rgb(var(--error) / .1)}.hover\:bg-primary\/10:hover{background-color:rgb(var(--primary) / .1)}.hover\:bg-primary\/20:hover{background-color:rgb(var(--primary) / .2)}.hover\:bg-primary\/25:hover{background-color:rgb(var(--primary) / .25)}.hover\:bg-primary\/30:hover{background-color:rgb(var(--primary) / .3)}.hover\:bg-primary\/80:hover{background-color:rgb(var(--primary) / .8)}.hover\:bg-primary\/90:hover{background-color:rgb(var(--primary) / .9)}.hover\:bg-red-500\/30:hover{background-color:#ef44444d}.hover\:bg-red-950\/30:hover{background-color:#450a0a4d}.hover\:bg-red-950\/50:hover{background-color:#450a0a80}.hover\:bg-secondary\/30:hover{background-color:rgb(var(--secondary) / .3)}.hover\:bg-surface-container:hover{--tw-bg-opacity: 1;background-color:rgb(var(--surface-container) / var(--tw-bg-opacity, 1))}.hover\:bg-surface-container-highest:hover{--tw-bg-opacity: 1;background-color:rgb(var(--surface-container-highest) / var(--tw-bg-opacity, 1))}.hover\:bg-surface-container-lowest:hover{--tw-bg-opacity: 1;background-color:rgb(var(--surface-container-lowest) / var(--tw-bg-opacity, 1))}.hover\:bg-surface-container\/40:hover{background-color:rgb(var(--surface-container) / .4)}.hover\:bg-surface-container\/50:hover{background-color:rgb(var(--surface-container) / .5)}.hover\:bg-surface-dim\/50:hover{background-color:rgb(var(--surface-dim) / .5)}.hover\:bg-surface-tint:hover{--tw-bg-opacity: 1;background-color:rgb(var(--surface-tint) / var(--tw-bg-opacity, 1))}.hover\:bg-white\/\[0\.02\]:hover{background-color:#ffffff05}.hover\:\!text-error:hover{--tw-text-opacity: 1 !important;color:rgb(var(--error) / var(--tw-text-opacity, 1))!important}.hover\:text-error:hover{--tw-text-opacity: 1;color:rgb(var(--error) / var(--tw-text-opacity, 1))}.hover\:text-on-surface:hover{--tw-text-opacity: 1;color:rgb(var(--on-surface) / var(--tw-text-opacity, 1))}.hover\:text-on-surface-variant:hover{--tw-text-opacity: 1;color:rgb(var(--on-surface-variant) / var(--tw-text-opacity, 1))}.hover\:text-on-surface-variant\/60:hover{color:rgb(var(--on-surface-variant) / .6)}.hover\:text-on-surface-variant\/70:hover{color:rgb(var(--on-surface-variant) / .7)}.hover\:text-primary:hover{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity, 1))}.hover\:text-primary\/70:hover{color:rgb(var(--primary) / .7)}.hover\:text-primary\/80:hover{color:rgb(var(--primary) / .8)}.hover\:text-primary\/90:hover{color:rgb(var(--primary) / .9)}.hover\:text-surface-tint:hover{--tw-text-opacity: 1;color:rgb(var(--surface-tint) / var(--tw-text-opacity, 1))}.hover\:opacity-80:hover{opacity:.8}.hover\:opacity-90:hover{opacity:.9}.hover\:shadow-callout:hover{--tw-shadow: 0 10px 40px rgba(29, 28, 22, .06);--tw-shadow-colored: 0 10px 40px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\:shadow-md:hover{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\:brightness-110:hover{--tw-brightness: brightness(1.1);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.focus\:border-primary:focus{--tw-border-opacity: 1;border-color:rgb(var(--primary) / var(--tw-border-opacity, 1))}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-1:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-primary\/20:focus{--tw-ring-color: rgb(var(--primary) / .2)}.focus\:ring-primary\/25:focus{--tw-ring-color: rgb(var(--primary) / .25)}.focus\:ring-primary\/30:focus{--tw-ring-color: rgb(var(--primary) / .3)}.focus\:ring-primary\/40:focus{--tw-ring-color: rgb(var(--primary) / .4)}.active\:scale-\[0\.98\]:active{--tw-scale-x: .98;--tw-scale-y: .98;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-default:disabled{cursor:default}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-20:disabled{opacity:.2}.disabled\:opacity-30:disabled{opacity:.3}.disabled\:opacity-40:disabled{opacity:.4}.disabled\:opacity-50:disabled{opacity:.5}.group:hover .group-hover\:text-on-surface-variant\/70{color:rgb(var(--on-surface-variant) / .7)}.group:hover .group-hover\:text-on-surface\/90{color:rgb(var(--on-surface) / .9)}.group:hover .group-hover\:opacity-100{opacity:1}.group:hover .group-hover\:opacity-80{opacity:.8}.prose-headings\:mb-1 :is(:where(h1,h2,h3,h4,h5,h6,th):not(:where([class~=not-prose],[class~=not-prose] *))){margin-bottom:.25rem}.prose-headings\:mt-3 :is(:where(h1,h2,h3,h4,h5,h6,th):not(:where([class~=not-prose],[class~=not-prose] *))){margin-top:.75rem}.prose-p\:my-1 :is(:where(p):not(:where([class~=not-prose],[class~=not-prose] *))){margin-top:.25rem;margin-bottom:.25rem}.prose-a\:text-secondary :is(:where(a):not(:where([class~=not-prose],[class~=not-prose] *))){--tw-text-opacity: 1;color:rgb(var(--secondary) / var(--tw-text-opacity, 1))}.prose-strong\:text-on-surface :is(:where(strong):not(:where([class~=not-prose],[class~=not-prose] *))){--tw-text-opacity: 1;color:rgb(var(--on-surface) / var(--tw-text-opacity, 1))}.prose-code\:rounded :is(:where(code):not(:where([class~=not-prose],[class~=not-prose] *))){border-radius:.125rem}.prose-code\:bg-surface-dim :is(:where(code):not(:where([class~=not-prose],[class~=not-prose] *))){--tw-bg-opacity: 1;background-color:rgb(var(--surface-dim) / var(--tw-bg-opacity, 1))}.prose-code\:px-1 :is(:where(code):not(:where([class~=not-prose],[class~=not-prose] *))){padding-left:.25rem;padding-right:.25rem}.prose-code\:text-xs :is(:where(code):not(:where([class~=not-prose],[class~=not-prose] *))){font-size:.75rem;line-height:1rem}.prose-pre\:bg-surface-dim :is(:where(pre):not(:where([class~=not-prose],[class~=not-prose] *))){--tw-bg-opacity: 1;background-color:rgb(var(--surface-dim) / var(--tw-bg-opacity, 1))}.prose-pre\:text-xs :is(:where(pre):not(:where([class~=not-prose],[class~=not-prose] *))){font-size:.75rem;line-height:1rem}.prose-ol\:my-1 :is(:where(ol):not(:where([class~=not-prose],[class~=not-prose] *))){margin-top:.25rem;margin-bottom:.25rem}.prose-ul\:my-1 :is(:where(ul):not(:where([class~=not-prose],[class~=not-prose] *))){margin-top:.25rem;margin-bottom:.25rem}.prose-li\:my-0 :is(:where(li):not(:where([class~=not-prose],[class~=not-prose] *))){margin-top:0;margin-bottom:0}.prose-table\:w-full :is(:where(table):not(:where([class~=not-prose],[class~=not-prose] *))){width:100%}.prose-table\:border-collapse :is(:where(table):not(:where([class~=not-prose],[class~=not-prose] *))){border-collapse:collapse}.prose-table\:text-xs :is(:where(table):not(:where([class~=not-prose],[class~=not-prose] *))){font-size:.75rem;line-height:1rem}.prose-th\:border :is(:where(th):not(:where([class~=not-prose],[class~=not-prose] *))){border-width:1px}.prose-th\:border-outline-variant\/40 :is(:where(th):not(:where([class~=not-prose],[class~=not-prose] *))){border-color:rgb(var(--outline-variant) / .4)}.prose-th\:bg-surface-dim :is(:where(th):not(:where([class~=not-prose],[class~=not-prose] *))){--tw-bg-opacity: 1;background-color:rgb(var(--surface-dim) / var(--tw-bg-opacity, 1))}.prose-th\:px-2 :is(:where(th):not(:where([class~=not-prose],[class~=not-prose] *))){padding-left:.5rem;padding-right:.5rem}.prose-th\:py-1 :is(:where(th):not(:where([class~=not-prose],[class~=not-prose] *))){padding-top:.25rem;padding-bottom:.25rem}.prose-th\:text-left :is(:where(th):not(:where([class~=not-prose],[class~=not-prose] *))){text-align:left}.prose-th\:font-medium :is(:where(th):not(:where([class~=not-prose],[class~=not-prose] *))){font-weight:500}.prose-td\:border :is(:where(td):not(:where([class~=not-prose],[class~=not-prose] *))){border-width:1px}.prose-td\:border-outline-variant\/40 :is(:where(td):not(:where([class~=not-prose],[class~=not-prose] *))){border-color:rgb(var(--outline-variant) / .4)}.prose-td\:px-2 :is(:where(td):not(:where([class~=not-prose],[class~=not-prose] *))){padding-left:.5rem;padding-right:.5rem}.prose-td\:py-1 :is(:where(td):not(:where([class~=not-prose],[class~=not-prose] *))){padding-top:.25rem;padding-bottom:.25rem}@media (min-width: 768px){.md\:inline{display:inline}}
1
+ *,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:Inter,system-ui,sans-serif;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:JetBrains Mono,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}:root{--background: 254 249 239;--on-background: 29 28 22;--on-surface: 29 28 22;--on-surface-variant: 58 55 47;--surface-bright: 254 249 239;--surface-dim: 222 218 208;--surface-container-lowest: 251 246 235;--surface-container-low: 248 243 233;--surface-container: 242 237 227;--surface-container-high: 237 227 207;--surface-container-highest: 231 226 216;--primary: 93 57 224;--on-primary: 255 255 255;--primary-fixed: 230 222 255;--primary-fixed-dim: 202 190 255;--surface-tint: 96 60 227;--secondary: 177 46 9;--secondary-container: 253 100 61;--tertiary-fixed: 243 228 143;--outline: 121 117 135;--outline-variant: 201 196 216;--error: 186 26 26;--success: 16 122 75;--warning: 202 138 4;--info: 37 99 235}.dark{--background: 29 28 22;--on-background: 245 240 224;--on-surface: 245 240 224;--on-surface-variant: 185 179 195;--surface-bright: 58 54 39;--surface-dim: 20 19 16;--surface-container-lowest: 20 19 16;--surface-container-low: 36 34 26;--surface-container: 46 45 34;--surface-container-high: 58 55 43;--surface-container-highest: 70 67 52;--primary: 202 190 255;--on-primary: 34 16 112;--primary-fixed: 230 222 255;--primary-fixed-dim: 93 57 224;--surface-tint: 202 190 255;--secondary: 255 180 167;--secondary-container: 142 26 0;--tertiary-fixed: 92 81 42;--outline: 141 134 148;--outline-variant: 71 70 79;--error: 255 180 171;--success: 94 218 160;--warning: 250 204 21;--info: 96 165 250}*{box-sizing:border-box}html{scroll-behavior:smooth;scroll-padding-top:72px}body{--tw-bg-opacity: 1;background-color:rgb(var(--background) / var(--tw-bg-opacity, 1));font-family:Inter,system-ui,sans-serif;--tw-text-opacity: 1;color:rgb(var(--on-surface) / var(--tw-text-opacity, 1));background-image:linear-gradient(rgb(var(--on-surface) / .03) 1px,transparent 1px),radial-gradient(circle,rgb(var(--on-surface) / .02) 1px,transparent 1px);background-size:100% 28px,16px 16px;background-attachment:fixed;min-height:100vh}h1,h2,h3{font-family:"Noto Serif",Georgia,serif;--tw-text-opacity: 1;color:rgb(var(--on-surface) / var(--tw-text-opacity, 1))}::-webkit-scrollbar{width:6px;height:6px}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{background:rgb(var(--outline-variant));border-radius:999px}::-webkit-scrollbar-thumb:hover{background:rgb(var(--outline))}::-moz-selection{background:rgb(var(--primary-fixed));color:rgb(var(--on-primary))}::selection{background:rgb(var(--primary-fixed));color:rgb(var(--on-primary))}.container{width:100%}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.prose{color:var(--tw-prose-body);max-width:65ch}.prose :where(p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}.prose :where([class~=lead]):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-lead);font-size:1.25em;line-height:1.6;margin-top:1.2em;margin-bottom:1.2em}.prose :where(a):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-links);text-decoration:underline;font-weight:500}.prose :where(strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-bold);font-weight:600}.prose :where(a strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(blockquote strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(thead th strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(ol):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:decimal;margin-top:1.25em;margin-bottom:1.25em;padding-inline-start:1.625em}.prose :where(ol[type=A]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-alpha}.prose :where(ol[type=a]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-alpha}.prose :where(ol[type=A s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-alpha}.prose :where(ol[type=a s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-alpha}.prose :where(ol[type=I]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-roman}.prose :where(ol[type=i]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-roman}.prose :where(ol[type=I s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-roman}.prose :where(ol[type=i s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-roman}.prose :where(ol[type="1"]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:decimal}.prose :where(ul):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:disc;margin-top:1.25em;margin-bottom:1.25em;padding-inline-start:1.625em}.prose :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *))::marker{font-weight:400;color:var(--tw-prose-counters)}.prose :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *))::marker{color:var(--tw-prose-bullets)}.prose :where(dt):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;margin-top:1.25em}.prose :where(hr):not(:where([class~=not-prose],[class~=not-prose] *)){border-color:var(--tw-prose-hr);border-top-width:1px;margin-top:3em;margin-bottom:3em}.prose :where(blockquote):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:500;font-style:italic;color:var(--tw-prose-quotes);border-inline-start-width:.25rem;border-inline-start-color:var(--tw-prose-quote-borders);quotes:"“""”""‘""’";margin-top:1.6em;margin-bottom:1.6em;padding-inline-start:1em}.prose :where(blockquote p:first-of-type):not(:where([class~=not-prose],[class~=not-prose] *)):before{content:open-quote}.prose :where(blockquote p:last-of-type):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:close-quote}.prose :where(h1):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:800;font-size:2.25em;margin-top:0;margin-bottom:.8888889em;line-height:1.1111111}.prose :where(h1 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:900;color:inherit}.prose :where(h2):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:700;font-size:1.5em;margin-top:2em;margin-bottom:1em;line-height:1.3333333}.prose :where(h2 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:800;color:inherit}.prose :where(h3):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;font-size:1.25em;margin-top:1.6em;margin-bottom:.6em;line-height:1.6}.prose :where(h3 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:700;color:inherit}.prose :where(h4):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;margin-top:1.5em;margin-bottom:.5em;line-height:1.5}.prose :where(h4 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:700;color:inherit}.prose :where(img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.prose :where(picture):not(:where([class~=not-prose],[class~=not-prose] *)){display:block;margin-top:2em;margin-bottom:2em}.prose :where(video):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.prose :where(kbd):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:500;font-family:inherit;color:var(--tw-prose-kbd);box-shadow:0 0 0 1px var(--tw-prose-kbd-shadows),0 3px 0 var(--tw-prose-kbd-shadows);font-size:.875em;border-radius:.3125rem;padding-top:.1875em;padding-inline-end:.375em;padding-bottom:.1875em;padding-inline-start:.375em}.prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-code);font-weight:600;font-size:.875em}.prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)):before{content:"`"}.prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:"`"}.prose :where(a code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(h1 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(h2 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-size:.875em}.prose :where(h3 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-size:.9em}.prose :where(h4 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(blockquote code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(thead th code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(pre):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-pre-code);background-color:var(--tw-prose-pre-bg);overflow-x:auto;font-weight:400;font-size:.875em;line-height:1.7142857;margin-top:1.7142857em;margin-bottom:1.7142857em;border-radius:.375rem;padding-top:.8571429em;padding-inline-end:1.1428571em;padding-bottom:.8571429em;padding-inline-start:1.1428571em}.prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)){background-color:transparent;border-width:0;border-radius:0;padding:0;font-weight:inherit;color:inherit;font-size:inherit;font-family:inherit;line-height:inherit}.prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)):before{content:none}.prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:none}.prose :where(table):not(:where([class~=not-prose],[class~=not-prose] *)){width:100%;table-layout:auto;margin-top:2em;margin-bottom:2em;font-size:.875em;line-height:1.7142857}.prose :where(thead):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-th-borders)}.prose :where(thead th):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;vertical-align:bottom;padding-inline-end:.5714286em;padding-bottom:.5714286em;padding-inline-start:.5714286em}.prose :where(tbody tr):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-td-borders)}.prose :where(tbody tr:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:0}.prose :where(tbody td):not(:where([class~=not-prose],[class~=not-prose] *)){vertical-align:baseline}.prose :where(tfoot):not(:where([class~=not-prose],[class~=not-prose] *)){border-top-width:1px;border-top-color:var(--tw-prose-th-borders)}.prose :where(tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){vertical-align:top}.prose :where(th,td):not(:where([class~=not-prose],[class~=not-prose] *)){text-align:start}.prose :where(figure>*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose :where(figcaption):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-captions);font-size:.875em;line-height:1.4285714;margin-top:.8571429em}.prose{--tw-prose-body: #374151;--tw-prose-headings: #111827;--tw-prose-lead: #4b5563;--tw-prose-links: #111827;--tw-prose-bold: #111827;--tw-prose-counters: #6b7280;--tw-prose-bullets: #d1d5db;--tw-prose-hr: #e5e7eb;--tw-prose-quotes: #111827;--tw-prose-quote-borders: #e5e7eb;--tw-prose-captions: #6b7280;--tw-prose-kbd: #111827;--tw-prose-kbd-shadows: rgb(17 24 39 / 10%);--tw-prose-code: #111827;--tw-prose-pre-code: #e5e7eb;--tw-prose-pre-bg: #1f2937;--tw-prose-th-borders: #d1d5db;--tw-prose-td-borders: #e5e7eb;--tw-prose-invert-body: #d1d5db;--tw-prose-invert-headings: #fff;--tw-prose-invert-lead: #9ca3af;--tw-prose-invert-links: #fff;--tw-prose-invert-bold: #fff;--tw-prose-invert-counters: #9ca3af;--tw-prose-invert-bullets: #4b5563;--tw-prose-invert-hr: #374151;--tw-prose-invert-quotes: #f3f4f6;--tw-prose-invert-quote-borders: #374151;--tw-prose-invert-captions: #9ca3af;--tw-prose-invert-kbd: #fff;--tw-prose-invert-kbd-shadows: rgb(255 255 255 / 10%);--tw-prose-invert-code: #fff;--tw-prose-invert-pre-code: #d1d5db;--tw-prose-invert-pre-bg: rgb(0 0 0 / 50%);--tw-prose-invert-th-borders: #4b5563;--tw-prose-invert-td-borders: #374151;font-size:1rem;line-height:1.75}.prose :where(picture>img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose :where(li):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5em;margin-bottom:.5em}.prose :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.375em}.prose :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.375em}.prose :where(.prose>ul>li p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.75em;margin-bottom:.75em}.prose :where(.prose>ul>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em}.prose :where(.prose>ul>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.25em}.prose :where(.prose>ol>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em}.prose :where(.prose>ol>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.25em}.prose :where(ul ul,ul ol,ol ul,ol ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.75em;margin-bottom:.75em}.prose :where(dl):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}.prose :where(dd):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5em;padding-inline-start:1.625em}.prose :where(hr+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(h2+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(h3+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(h4+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(thead th:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.prose :where(thead th:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.prose :where(tbody td,tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){padding-top:.5714286em;padding-inline-end:.5714286em;padding-bottom:.5714286em;padding-inline-start:.5714286em}.prose :where(tbody td:first-child,tfoot td:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.prose :where(tbody td:last-child,tfoot td:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.prose :where(figure):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.prose :where(.prose>:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(.prose>:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:0}.prose-sm{font-size:.875rem;line-height:1.7142857}.prose-sm :where(p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em;margin-bottom:1.1428571em}.prose-sm :where([class~=lead]):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:1.2857143em;line-height:1.5555556;margin-top:.8888889em;margin-bottom:.8888889em}.prose-sm :where(blockquote):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.3333333em;margin-bottom:1.3333333em;padding-inline-start:1.1111111em}.prose-sm :where(h1):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:2.1428571em;margin-top:0;margin-bottom:.8em;line-height:1.2}.prose-sm :where(h2):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:1.4285714em;margin-top:1.6em;margin-bottom:.8em;line-height:1.4}.prose-sm :where(h3):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:1.2857143em;margin-top:1.5555556em;margin-bottom:.4444444em;line-height:1.5555556}.prose-sm :where(h4):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.4285714em;margin-bottom:.5714286em;line-height:1.4285714}.prose-sm :where(img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7142857em;margin-bottom:1.7142857em}.prose-sm :where(picture):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7142857em;margin-bottom:1.7142857em}.prose-sm :where(picture>img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose-sm :where(video):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7142857em;margin-bottom:1.7142857em}.prose-sm :where(kbd):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em;border-radius:.3125rem;padding-top:.1428571em;padding-inline-end:.3571429em;padding-bottom:.1428571em;padding-inline-start:.3571429em}.prose-sm :where(code):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em}.prose-sm :where(h2 code):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.9em}.prose-sm :where(h3 code):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8888889em}.prose-sm :where(pre):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em;line-height:1.6666667;margin-top:1.6666667em;margin-bottom:1.6666667em;border-radius:.25rem;padding-top:.6666667em;padding-inline-end:1em;padding-bottom:.6666667em;padding-inline-start:1em}.prose-sm :where(ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em;margin-bottom:1.1428571em;padding-inline-start:1.5714286em}.prose-sm :where(ul):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em;margin-bottom:1.1428571em;padding-inline-start:1.5714286em}.prose-sm :where(li):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.2857143em;margin-bottom:.2857143em}.prose-sm :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.4285714em}.prose-sm :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.4285714em}.prose-sm :where(.prose-sm>ul>li p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5714286em;margin-bottom:.5714286em}.prose-sm :where(.prose-sm>ul>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em}.prose-sm :where(.prose-sm>ul>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.1428571em}.prose-sm :where(.prose-sm>ol>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em}.prose-sm :where(.prose-sm>ol>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.1428571em}.prose-sm :where(ul ul,ul ol,ol ul,ol ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5714286em;margin-bottom:.5714286em}.prose-sm :where(dl):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em;margin-bottom:1.1428571em}.prose-sm :where(dt):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em}.prose-sm :where(dd):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.2857143em;padding-inline-start:1.5714286em}.prose-sm :where(hr):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2.8571429em;margin-bottom:2.8571429em}.prose-sm :where(hr+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(h2+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(h3+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(h4+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(table):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em;line-height:1.5}.prose-sm :where(thead th):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:1em;padding-bottom:.6666667em;padding-inline-start:1em}.prose-sm :where(thead th:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.prose-sm :where(thead th:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.prose-sm :where(tbody td,tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){padding-top:.6666667em;padding-inline-end:1em;padding-bottom:.6666667em;padding-inline-start:1em}.prose-sm :where(tbody td:first-child,tfoot td:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.prose-sm :where(tbody td:last-child,tfoot td:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.prose-sm :where(figure):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7142857em;margin-bottom:1.7142857em}.prose-sm :where(figure>*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose-sm :where(figcaption):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em;line-height:1.3333333;margin-top:.6666667em}.prose-sm :where(.prose-sm>:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(.prose-sm>:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:0}.noise-overlay{pointer-events:none;position:fixed;top:0;right:0;bottom:0;left:0;background-image:url(https://www.transparenttextures.com/patterns/paper-fibers.png);opacity:.05;z-index:9999;mix-blend-mode:multiply}.dark .noise-overlay{opacity:.1;mix-blend-mode:screen}.highlight-marker{background:linear-gradient(104deg,rgb(var(--tertiary-fixed) / 0) .9%,rgb(var(--tertiary-fixed) / 1) 2.4%,rgb(var(--tertiary-fixed) / .5) 5.8%,rgb(var(--tertiary-fixed) / .1) 93%,rgb(var(--tertiary-fixed) / .7) 96%,rgb(var(--tertiary-fixed) / 0) 98%),linear-gradient(183deg,rgb(var(--tertiary-fixed) / 0),rgb(var(--tertiary-fixed) / .3) 7.9%,rgb(var(--tertiary-fixed) / 0) 15%);padding:.1em .3em}.shadow-callout{box-shadow:0 10px 40px #1d1c160f}.dark .shadow-callout{box-shadow:0 10px 40px #0006}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.visible{visibility:visible}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{top:0;right:0;bottom:0;left:0}.inset-y-0{top:0;bottom:0}.bottom-\[42px\]{bottom:42px}.left-0{left:0}.left-2\.5{left:.625rem}.left-3{left:.75rem}.right-0{right:0}.right-2{right:.5rem}.right-3{right:.75rem}.top-0{top:0}.top-1\/2{top:50%}.top-3{top:.75rem}.z-0{z-index:0}.z-10{z-index:10}.z-20{z-index:20}.z-40{z-index:40}.z-50{z-index:50}.m-auto{margin:auto}.-mx-2{margin-left:-.5rem;margin-right:-.5rem}.mx-2{margin-left:.5rem;margin-right:.5rem}.mx-auto{margin-left:auto;margin-right:auto}.my-1{margin-top:.25rem;margin-bottom:.25rem}.mb-0\.5{margin-bottom:.125rem}.mb-1{margin-bottom:.25rem}.mb-1\.5{margin-bottom:.375rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-6{margin-bottom:1.5rem}.mb-8{margin-bottom:2rem}.ml-1{margin-left:.25rem}.ml-2{margin-left:.5rem}.ml-3{margin-left:.75rem}.ml-7{margin-left:1.75rem}.ml-\[79px\]{margin-left:79px}.ml-auto{margin-left:auto}.mr-1{margin-right:.25rem}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-1\.5{margin-top:.375rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-8{margin-top:2rem}.mt-\[3px\]{margin-top:3px}.mt-\[6px\]{margin-top:6px}.mt-auto{margin-top:auto}.line-clamp-2{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.hidden{display:none}.h-1{height:.25rem}.h-1\.5{height:.375rem}.h-12{height:3rem}.h-14{height:3.5rem}.h-2{height:.5rem}.h-2\.5{height:.625rem}.h-3{height:.75rem}.h-3\.5{height:.875rem}.h-4{height:1rem}.h-44{height:11rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-\[5px\]{height:5px}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.max-h-48{max-height:12rem}.max-h-52{max-height:13rem}.max-h-80{max-height:20rem}.max-h-full{max-height:100%}.min-h-0{min-height:0px}.min-h-\[120px\]{min-height:120px}.min-h-\[48px\]{min-height:48px}.min-h-\[72px\]{min-height:72px}.w-1{width:.25rem}.w-1\.5{width:.375rem}.w-10{width:2.5rem}.w-12{width:3rem}.w-2{width:.5rem}.w-2\.5{width:.625rem}.w-3{width:.75rem}.w-3\.5{width:.875rem}.w-4{width:1rem}.w-40{width:10rem}.w-44{width:11rem}.w-5{width:1.25rem}.w-56{width:14rem}.w-6{width:1.5rem}.w-7{width:1.75rem}.w-72{width:18rem}.w-8{width:2rem}.w-80{width:20rem}.w-96{width:24rem}.w-\[52px\]{width:52px}.w-\[5px\]{width:5px}.w-\[70px\]{width:70px}.w-full{width:100%}.min-w-0{min-width:0px}.max-w-2xl{max-width:42rem}.max-w-3xl{max-width:48rem}.max-w-4xl{max-width:56rem}.max-w-\[260px\]{max-width:260px}.max-w-\[60\%\]{max-width:60%}.max-w-full{max-width:100%}.max-w-lg{max-width:32rem}.max-w-md{max-width:28rem}.max-w-none{max-width:none}.max-w-sm{max-width:24rem}.max-w-xl{max-width:36rem}.max-w-xs{max-width:20rem}.flex-1{flex:1 1 0%}.flex-shrink-0,.shrink-0{flex-shrink:0}.-translate-x-1\/2{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize-none{resize:none}.resize-y{resize:vertical}.appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0{gap:0px}.gap-0\.5{gap:.125rem}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-2\.5{gap:.625rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-5{gap:1.25rem}.gap-6{gap:1.5rem}.gap-\[3px\]{gap:3px}.gap-x-3{-moz-column-gap:.75rem;column-gap:.75rem}.gap-y-1{row-gap:.25rem}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-1\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-2\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.625rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.625rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.self-start{align-self:flex-start}.self-end{align-self:flex-end}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.rounded{border-radius:.125rem}.rounded-full{border-radius:.75rem}.rounded-lg{border-radius:.25rem}.rounded-md{border-radius:.375rem}.rounded-sm{border-radius:.125rem}.rounded-xl{border-radius:.5rem}.border{border-width:1px}.border-0{border-width:0px}.border-2{border-width:2px}.border-b{border-bottom-width:1px}.border-l{border-left-width:1px}.border-l-2{border-left-width:2px}.border-t{border-top-width:1px}.border-amber-400\/20{border-color:#fbbf2433}.border-amber-800\/50{border-color:#92400e80}.border-error\/20{border-color:rgb(var(--error) / .2)}.border-info\/20{border-color:rgb(var(--info) / .2)}.border-outline-variant{--tw-border-opacity: 1;border-color:rgb(var(--outline-variant) / var(--tw-border-opacity, 1))}.border-outline-variant\/20{border-color:rgb(var(--outline-variant) / .2)}.border-outline-variant\/30{border-color:rgb(var(--outline-variant) / .3)}.border-outline-variant\/40{border-color:rgb(var(--outline-variant) / .4)}.border-outline-variant\/60{border-color:rgb(var(--outline-variant) / .6)}.border-primary\/20{border-color:rgb(var(--primary) / .2)}.border-primary\/40{border-color:rgb(var(--primary) / .4)}.border-red-800\/50{border-color:#991b1b80}.border-secondary\/30{border-color:rgb(var(--secondary) / .3)}.border-success\/20{border-color:rgb(var(--success) / .2)}.border-success\/30{border-color:rgb(var(--success) / .3)}.border-warning\/20{border-color:rgb(var(--warning) / .2)}.border-warning\/30{border-color:rgb(var(--warning) / .3)}.border-white\/\[0\.03\]{border-color:#ffffff08}.border-l-primary{--tw-border-opacity: 1;border-left-color:rgb(var(--primary) / var(--tw-border-opacity, 1))}.border-t-primary{--tw-border-opacity: 1;border-top-color:rgb(var(--primary) / var(--tw-border-opacity, 1))}.bg-amber-400\/10{background-color:#fbbf241a}.bg-amber-500\/20{background-color:#f59e0b33}.bg-amber-950\/40{background-color:#451a0366}.bg-background{--tw-bg-opacity: 1;background-color:rgb(var(--background) / var(--tw-bg-opacity, 1))}.bg-black\/60{background-color:#0009}.bg-blue-400{--tw-bg-opacity: 1;background-color:rgb(96 165 250 / var(--tw-bg-opacity, 1))}.bg-blue-400\/60{background-color:#60a5fa99}.bg-blue-500{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity, 1))}.bg-blue-500\/10{background-color:#3b82f61a}.bg-blue-500\/5{background-color:#3b82f60d}.bg-current{background-color:currentColor}.bg-emerald-400{--tw-bg-opacity: 1;background-color:rgb(52 211 153 / var(--tw-bg-opacity, 1))}.bg-emerald-500{--tw-bg-opacity: 1;background-color:rgb(16 185 129 / var(--tw-bg-opacity, 1))}.bg-emerald-500\/10{background-color:#10b9811a}.bg-error{--tw-bg-opacity: 1;background-color:rgb(var(--error) / var(--tw-bg-opacity, 1))}.bg-error\/10{background-color:rgb(var(--error) / .1)}.bg-gray-500{--tw-bg-opacity: 1;background-color:rgb(107 114 128 / var(--tw-bg-opacity, 1))}.bg-gray-600{--tw-bg-opacity: 1;background-color:rgb(75 85 99 / var(--tw-bg-opacity, 1))}.bg-green-500{--tw-bg-opacity: 1;background-color:rgb(34 197 94 / var(--tw-bg-opacity, 1))}.bg-info{--tw-bg-opacity: 1;background-color:rgb(var(--info) / var(--tw-bg-opacity, 1))}.bg-info\/10{background-color:rgb(var(--info) / .1)}.bg-on-surface-variant\/30{background-color:rgb(var(--on-surface-variant) / .3)}.bg-outline{--tw-bg-opacity: 1;background-color:rgb(var(--outline) / var(--tw-bg-opacity, 1))}.bg-outline\/50{background-color:rgb(var(--outline) / .5)}.bg-outline\/60{background-color:rgb(var(--outline) / .6)}.bg-primary{--tw-bg-opacity: 1;background-color:rgb(var(--primary) / var(--tw-bg-opacity, 1))}.bg-primary-fixed{--tw-bg-opacity: 1;background-color:rgb(var(--primary-fixed) / var(--tw-bg-opacity, 1))}.bg-primary\/10{background-color:rgb(var(--primary) / .1)}.bg-primary\/15{background-color:rgb(var(--primary) / .15)}.bg-primary\/20{background-color:rgb(var(--primary) / .2)}.bg-primary\/25{background-color:rgb(var(--primary) / .25)}.bg-primary\/40{background-color:rgb(var(--primary) / .4)}.bg-primary\/50{background-color:rgb(var(--primary) / .5)}.bg-red-400{--tw-bg-opacity: 1;background-color:rgb(248 113 113 / var(--tw-bg-opacity, 1))}.bg-red-500{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity, 1))}.bg-red-500\/10{background-color:#ef44441a}.bg-red-500\/20{background-color:#ef444433}.bg-red-950\/15{background-color:#450a0a26}.bg-red-950\/30{background-color:#450a0a4d}.bg-red-950\/40{background-color:#450a0a66}.bg-secondary{--tw-bg-opacity: 1;background-color:rgb(var(--secondary) / var(--tw-bg-opacity, 1))}.bg-secondary-container{--tw-bg-opacity: 1;background-color:rgb(var(--secondary-container) / var(--tw-bg-opacity, 1))}.bg-secondary\/15{background-color:rgb(var(--secondary) / .15)}.bg-secondary\/20{background-color:rgb(var(--secondary) / .2)}.bg-secondary\/60{background-color:rgb(var(--secondary) / .6)}.bg-secondary\/70{background-color:rgb(var(--secondary) / .7)}.bg-success{--tw-bg-opacity: 1;background-color:rgb(var(--success) / var(--tw-bg-opacity, 1))}.bg-success\/10{background-color:rgb(var(--success) / .1)}.bg-success\/15{background-color:rgb(var(--success) / .15)}.bg-surface-container{--tw-bg-opacity: 1;background-color:rgb(var(--surface-container) / var(--tw-bg-opacity, 1))}.bg-surface-container-high{--tw-bg-opacity: 1;background-color:rgb(var(--surface-container-high) / var(--tw-bg-opacity, 1))}.bg-surface-container-highest{--tw-bg-opacity: 1;background-color:rgb(var(--surface-container-highest) / var(--tw-bg-opacity, 1))}.bg-surface-container-low{--tw-bg-opacity: 1;background-color:rgb(var(--surface-container-low) / var(--tw-bg-opacity, 1))}.bg-surface-container-lowest{--tw-bg-opacity: 1;background-color:rgb(var(--surface-container-lowest) / var(--tw-bg-opacity, 1))}.bg-surface-container-lowest\/90{background-color:rgb(var(--surface-container-lowest) / .9)}.bg-surface-container\/30{background-color:rgb(var(--surface-container) / .3)}.bg-surface-dim\/50{background-color:rgb(var(--surface-dim) / .5)}.bg-tertiary-fixed{--tw-bg-opacity: 1;background-color:rgb(var(--tertiary-fixed) / var(--tw-bg-opacity, 1))}.bg-transparent{background-color:transparent}.bg-warning{--tw-bg-opacity: 1;background-color:rgb(var(--warning) / var(--tw-bg-opacity, 1))}.bg-warning\/10{background-color:rgb(var(--warning) / .1)}.bg-yellow-400\/30{background-color:#facc154d}.bg-yellow-500\/50{background-color:#eab30880}.object-contain{-o-object-fit:contain;object-fit:contain}.p-2{padding:.5rem}.p-2\.5{padding:.625rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-5{padding:1.25rem}.p-6{padding:1.5rem}.p-8{padding:2rem}.px-0{padding-left:0;padding-right:0}.px-0\.5{padding-left:.125rem;padding-right:.125rem}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.px-8{padding-left:2rem;padding-right:2rem}.px-\[12px\]{padding-left:12px;padding-right:12px}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-16{padding-top:4rem;padding-bottom:4rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-5{padding-top:1.25rem;padding-bottom:1.25rem}.py-8{padding-top:2rem;padding-bottom:2rem}.py-\[1px\]{padding-top:1px;padding-bottom:1px}.py-\[2px\]{padding-top:2px;padding-bottom:2px}.py-\[5px\]{padding-top:5px;padding-bottom:5px}.py-\[7px\]{padding-top:7px;padding-bottom:7px}.pb-3{padding-bottom:.75rem}.pb-4{padding-bottom:1rem}.pl-8{padding-left:2rem}.pr-1{padding-right:.25rem}.pr-7{padding-right:1.75rem}.pt-0\.5{padding-top:.125rem}.pt-1{padding-top:.25rem}.pt-16{padding-top:4rem}.pt-2{padding-top:.5rem}.pt-20{padding-top:5rem}.pt-4{padding-top:1rem}.pt-8{padding-top:2rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.font-headline{font-family:"Noto Serif",Georgia,serif}.font-label{font-family:Space Grotesk,sans-serif}.font-mono{font-family:JetBrains Mono,monospace}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-4xl{font-size:2.25rem;line-height:2.5rem}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.text-\[12px\]{font-size:12px}.text-\[13px\]{font-size:13px}.text-\[15px\]{font-size:15px}.text-\[16px\]{font-size:16px}.text-\[17px\]{font-size:17px}.text-\[18px\]{font-size:18px}.text-\[20px\]{font-size:20px}.text-\[22px\]{font-size:22px}.text-\[32px\]{font-size:32px}.text-\[7px\]{font-size:7px}.text-\[8px\]{font-size:8px}.text-\[9px\]{font-size:9px}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.lowercase{text-transform:lowercase}.italic{font-style:italic}.tabular-nums{--tw-numeric-spacing: tabular-nums;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.leading-none{line-height:1}.leading-relaxed{line-height:1.625}.leading-snug{line-height:1.375}.leading-tight{line-height:1.25}.tracking-\[-0\.01em\]{letter-spacing:-.01em}.tracking-\[0\.08em\]{letter-spacing:.08em}.tracking-\[0\.14em\]{letter-spacing:.14em}.tracking-\[0\.15em\]{letter-spacing:.15em}.tracking-\[0\.18em\]{letter-spacing:.18em}.tracking-\[0\.1em\]{letter-spacing:.1em}.tracking-tight{letter-spacing:-.025em}.tracking-wide{letter-spacing:.025em}.tracking-wider{letter-spacing:.05em}.tracking-widest{letter-spacing:.1em}.text-amber-500\/30{color:#f59e0b4d}.text-amber-500\/60{color:#f59e0b99}.text-error{--tw-text-opacity: 1;color:rgb(var(--error) / var(--tw-text-opacity, 1))}.text-error\/30{color:rgb(var(--error) / .3)}.text-error\/40{color:rgb(var(--error) / .4)}.text-error\/50{color:rgb(var(--error) / .5)}.text-error\/60{color:rgb(var(--error) / .6)}.text-error\/70{color:rgb(var(--error) / .7)}.text-error\/80{color:rgb(var(--error) / .8)}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.text-info{--tw-text-opacity: 1;color:rgb(var(--info) / var(--tw-text-opacity, 1))}.text-info\/60{color:rgb(var(--info) / .6)}.text-on-primary{--tw-text-opacity: 1;color:rgb(var(--on-primary) / var(--tw-text-opacity, 1))}.text-on-surface{--tw-text-opacity: 1;color:rgb(var(--on-surface) / var(--tw-text-opacity, 1))}.text-on-surface-variant{--tw-text-opacity: 1;color:rgb(var(--on-surface-variant) / var(--tw-text-opacity, 1))}.text-on-surface-variant\/20{color:rgb(var(--on-surface-variant) / .2)}.text-on-surface-variant\/25{color:rgb(var(--on-surface-variant) / .25)}.text-on-surface-variant\/35{color:rgb(var(--on-surface-variant) / .35)}.text-on-surface-variant\/40{color:rgb(var(--on-surface-variant) / .4)}.text-on-surface-variant\/50{color:rgb(var(--on-surface-variant) / .5)}.text-on-surface-variant\/60{color:rgb(var(--on-surface-variant) / .6)}.text-on-surface-variant\/70{color:rgb(var(--on-surface-variant) / .7)}.text-on-surface\/70{color:rgb(var(--on-surface) / .7)}.text-on-surface\/80{color:rgb(var(--on-surface) / .8)}.text-on-surface\/90{color:rgb(var(--on-surface) / .9)}.text-primary{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity, 1))}.text-primary\/40{color:rgb(var(--primary) / .4)}.text-primary\/50{color:rgb(var(--primary) / .5)}.text-primary\/60{color:rgb(var(--primary) / .6)}.text-primary\/70{color:rgb(var(--primary) / .7)}.text-secondary{--tw-text-opacity: 1;color:rgb(var(--secondary) / var(--tw-text-opacity, 1))}.text-secondary\/50{color:rgb(var(--secondary) / .5)}.text-secondary\/60{color:rgb(var(--secondary) / .6)}.text-secondary\/70{color:rgb(var(--secondary) / .7)}.text-secondary\/80{color:rgb(var(--secondary) / .8)}.text-success{--tw-text-opacity: 1;color:rgb(var(--success) / var(--tw-text-opacity, 1))}.text-transparent{color:transparent}.text-warning{--tw-text-opacity: 1;color:rgb(var(--warning) / var(--tw-text-opacity, 1))}.text-warning\/30{color:rgb(var(--warning) / .3)}.text-warning\/50{color:rgb(var(--warning) / .5)}.text-warning\/60{color:rgb(var(--warning) / .6)}.text-warning\/80{color:rgb(var(--warning) / .8)}.text-yellow-200{--tw-text-opacity: 1;color:rgb(254 240 138 / var(--tw-text-opacity, 1))}.placeholder-on-surface-variant::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(var(--on-surface-variant) / var(--tw-placeholder-opacity, 1))}.placeholder-on-surface-variant::placeholder{--tw-placeholder-opacity: 1;color:rgb(var(--on-surface-variant) / var(--tw-placeholder-opacity, 1))}.opacity-0{opacity:0}.opacity-10{opacity:.1}.opacity-30{opacity:.3}.opacity-40{opacity:.4}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-90{opacity:.9}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-callout{--tw-shadow: 0 10px 40px rgba(29, 28, 22, .06);--tw-shadow-colored: 0 10px 40px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.ring{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-1{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-2{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-primary\/30{--tw-ring-color: rgb(var(--primary) / .3)}.ring-primary\/60{--tw-ring-color: rgb(var(--primary) / .6)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur-sm{--tw-backdrop-blur: blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[grid-template-rows\]{transition-property:grid-template-rows;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-shadow{transition-property:box-shadow;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-150{transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-500{transition-duration:.5s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}@keyframes heartbeat-dot{0%,60%,to{transform:translateY(0);opacity:.4}30%{transform:translateY(-4px);opacity:1}}.hover\:shadow-callout:hover{box-shadow:0 10px 40px #1d1c160f}.dark .hover\:shadow-callout:hover{box-shadow:0 10px 40px #0006}.dark\:prose-invert:is(.dark *){--tw-prose-body: var(--tw-prose-invert-body);--tw-prose-headings: var(--tw-prose-invert-headings);--tw-prose-lead: var(--tw-prose-invert-lead);--tw-prose-links: var(--tw-prose-invert-links);--tw-prose-bold: var(--tw-prose-invert-bold);--tw-prose-counters: var(--tw-prose-invert-counters);--tw-prose-bullets: var(--tw-prose-invert-bullets);--tw-prose-hr: var(--tw-prose-invert-hr);--tw-prose-quotes: var(--tw-prose-invert-quotes);--tw-prose-quote-borders: var(--tw-prose-invert-quote-borders);--tw-prose-captions: var(--tw-prose-invert-captions);--tw-prose-kbd: var(--tw-prose-invert-kbd);--tw-prose-kbd-shadows: var(--tw-prose-invert-kbd-shadows);--tw-prose-code: var(--tw-prose-invert-code);--tw-prose-pre-code: var(--tw-prose-invert-pre-code);--tw-prose-pre-bg: var(--tw-prose-invert-pre-bg);--tw-prose-th-borders: var(--tw-prose-invert-th-borders);--tw-prose-td-borders: var(--tw-prose-invert-td-borders)}.placeholder\:italic::-moz-placeholder{font-style:italic}.placeholder\:italic::placeholder{font-style:italic}.placeholder\:text-on-surface-variant::-moz-placeholder{--tw-text-opacity: 1;color:rgb(var(--on-surface-variant) / var(--tw-text-opacity, 1))}.placeholder\:text-on-surface-variant::placeholder{--tw-text-opacity: 1;color:rgb(var(--on-surface-variant) / var(--tw-text-opacity, 1))}.placeholder\:text-on-surface-variant\/25::-moz-placeholder{color:rgb(var(--on-surface-variant) / .25)}.placeholder\:text-on-surface-variant\/25::placeholder{color:rgb(var(--on-surface-variant) / .25)}.placeholder\:text-on-surface-variant\/40::-moz-placeholder{color:rgb(var(--on-surface-variant) / .4)}.placeholder\:text-on-surface-variant\/40::placeholder{color:rgb(var(--on-surface-variant) / .4)}.placeholder\:text-on-surface-variant\/60::-moz-placeholder{color:rgb(var(--on-surface-variant) / .6)}.placeholder\:text-on-surface-variant\/60::placeholder{color:rgb(var(--on-surface-variant) / .6)}.last\:border-0:last-child{border-width:0px}.hover\:border-outline:hover{--tw-border-opacity: 1;border-color:rgb(var(--outline) / var(--tw-border-opacity, 1))}.hover\:border-primary\/40:hover{border-color:rgb(var(--primary) / .4)}.hover\:bg-error\/10:hover{background-color:rgb(var(--error) / .1)}.hover\:bg-primary\/10:hover{background-color:rgb(var(--primary) / .1)}.hover\:bg-primary\/20:hover{background-color:rgb(var(--primary) / .2)}.hover\:bg-primary\/25:hover{background-color:rgb(var(--primary) / .25)}.hover\:bg-primary\/30:hover{background-color:rgb(var(--primary) / .3)}.hover\:bg-primary\/80:hover{background-color:rgb(var(--primary) / .8)}.hover\:bg-primary\/90:hover{background-color:rgb(var(--primary) / .9)}.hover\:bg-red-500\/30:hover{background-color:#ef44444d}.hover\:bg-red-950\/30:hover{background-color:#450a0a4d}.hover\:bg-red-950\/50:hover{background-color:#450a0a80}.hover\:bg-secondary\/30:hover{background-color:rgb(var(--secondary) / .3)}.hover\:bg-surface-container:hover{--tw-bg-opacity: 1;background-color:rgb(var(--surface-container) / var(--tw-bg-opacity, 1))}.hover\:bg-surface-container-highest:hover{--tw-bg-opacity: 1;background-color:rgb(var(--surface-container-highest) / var(--tw-bg-opacity, 1))}.hover\:bg-surface-container-lowest:hover{--tw-bg-opacity: 1;background-color:rgb(var(--surface-container-lowest) / var(--tw-bg-opacity, 1))}.hover\:bg-surface-container\/40:hover{background-color:rgb(var(--surface-container) / .4)}.hover\:bg-surface-container\/50:hover{background-color:rgb(var(--surface-container) / .5)}.hover\:bg-surface-dim\/50:hover{background-color:rgb(var(--surface-dim) / .5)}.hover\:bg-surface-tint:hover{--tw-bg-opacity: 1;background-color:rgb(var(--surface-tint) / var(--tw-bg-opacity, 1))}.hover\:bg-white\/\[0\.02\]:hover{background-color:#ffffff05}.hover\:\!text-error:hover{--tw-text-opacity: 1 !important;color:rgb(var(--error) / var(--tw-text-opacity, 1))!important}.hover\:text-error:hover{--tw-text-opacity: 1;color:rgb(var(--error) / var(--tw-text-opacity, 1))}.hover\:text-on-surface:hover{--tw-text-opacity: 1;color:rgb(var(--on-surface) / var(--tw-text-opacity, 1))}.hover\:text-on-surface-variant:hover{--tw-text-opacity: 1;color:rgb(var(--on-surface-variant) / var(--tw-text-opacity, 1))}.hover\:text-on-surface-variant\/60:hover{color:rgb(var(--on-surface-variant) / .6)}.hover\:text-on-surface-variant\/70:hover{color:rgb(var(--on-surface-variant) / .7)}.hover\:text-primary:hover{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity, 1))}.hover\:text-primary\/70:hover{color:rgb(var(--primary) / .7)}.hover\:text-primary\/80:hover{color:rgb(var(--primary) / .8)}.hover\:text-primary\/90:hover{color:rgb(var(--primary) / .9)}.hover\:text-surface-tint:hover{--tw-text-opacity: 1;color:rgb(var(--surface-tint) / var(--tw-text-opacity, 1))}.hover\:opacity-80:hover{opacity:.8}.hover\:opacity-90:hover{opacity:.9}.hover\:shadow-callout:hover{--tw-shadow: 0 10px 40px rgba(29, 28, 22, .06);--tw-shadow-colored: 0 10px 40px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\:shadow-md:hover{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\:brightness-110:hover{--tw-brightness: brightness(1.1);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.focus\:border-primary:focus{--tw-border-opacity: 1;border-color:rgb(var(--primary) / var(--tw-border-opacity, 1))}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-1:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-primary\/20:focus{--tw-ring-color: rgb(var(--primary) / .2)}.focus\:ring-primary\/25:focus{--tw-ring-color: rgb(var(--primary) / .25)}.focus\:ring-primary\/30:focus{--tw-ring-color: rgb(var(--primary) / .3)}.focus\:ring-primary\/40:focus{--tw-ring-color: rgb(var(--primary) / .4)}.active\:scale-\[0\.98\]:active{--tw-scale-x: .98;--tw-scale-y: .98;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-default:disabled{cursor:default}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-20:disabled{opacity:.2}.disabled\:opacity-30:disabled{opacity:.3}.disabled\:opacity-40:disabled{opacity:.4}.disabled\:opacity-50:disabled{opacity:.5}.group:hover .group-hover\:text-on-surface-variant\/70{color:rgb(var(--on-surface-variant) / .7)}.group:hover .group-hover\:text-on-surface\/90{color:rgb(var(--on-surface) / .9)}.group:hover .group-hover\:opacity-100{opacity:1}.group:hover .group-hover\:opacity-80{opacity:.8}.prose-headings\:mb-1 :is(:where(h1,h2,h3,h4,h5,h6,th):not(:where([class~=not-prose],[class~=not-prose] *))){margin-bottom:.25rem}.prose-headings\:mt-3 :is(:where(h1,h2,h3,h4,h5,h6,th):not(:where([class~=not-prose],[class~=not-prose] *))){margin-top:.75rem}.prose-p\:my-1 :is(:where(p):not(:where([class~=not-prose],[class~=not-prose] *))){margin-top:.25rem;margin-bottom:.25rem}.prose-a\:text-secondary :is(:where(a):not(:where([class~=not-prose],[class~=not-prose] *))){--tw-text-opacity: 1;color:rgb(var(--secondary) / var(--tw-text-opacity, 1))}.prose-strong\:text-on-surface :is(:where(strong):not(:where([class~=not-prose],[class~=not-prose] *))){--tw-text-opacity: 1;color:rgb(var(--on-surface) / var(--tw-text-opacity, 1))}.prose-code\:rounded :is(:where(code):not(:where([class~=not-prose],[class~=not-prose] *))){border-radius:.125rem}.prose-code\:bg-surface-dim :is(:where(code):not(:where([class~=not-prose],[class~=not-prose] *))){--tw-bg-opacity: 1;background-color:rgb(var(--surface-dim) / var(--tw-bg-opacity, 1))}.prose-code\:px-1 :is(:where(code):not(:where([class~=not-prose],[class~=not-prose] *))){padding-left:.25rem;padding-right:.25rem}.prose-code\:text-xs :is(:where(code):not(:where([class~=not-prose],[class~=not-prose] *))){font-size:.75rem;line-height:1rem}.prose-pre\:bg-surface-dim :is(:where(pre):not(:where([class~=not-prose],[class~=not-prose] *))){--tw-bg-opacity: 1;background-color:rgb(var(--surface-dim) / var(--tw-bg-opacity, 1))}.prose-pre\:text-xs :is(:where(pre):not(:where([class~=not-prose],[class~=not-prose] *))){font-size:.75rem;line-height:1rem}.prose-ol\:my-1 :is(:where(ol):not(:where([class~=not-prose],[class~=not-prose] *))){margin-top:.25rem;margin-bottom:.25rem}.prose-ul\:my-1 :is(:where(ul):not(:where([class~=not-prose],[class~=not-prose] *))){margin-top:.25rem;margin-bottom:.25rem}.prose-li\:my-0 :is(:where(li):not(:where([class~=not-prose],[class~=not-prose] *))){margin-top:0;margin-bottom:0}.prose-table\:w-full :is(:where(table):not(:where([class~=not-prose],[class~=not-prose] *))){width:100%}.prose-table\:border-collapse :is(:where(table):not(:where([class~=not-prose],[class~=not-prose] *))){border-collapse:collapse}.prose-table\:text-xs :is(:where(table):not(:where([class~=not-prose],[class~=not-prose] *))){font-size:.75rem;line-height:1rem}.prose-th\:border :is(:where(th):not(:where([class~=not-prose],[class~=not-prose] *))){border-width:1px}.prose-th\:border-outline-variant\/40 :is(:where(th):not(:where([class~=not-prose],[class~=not-prose] *))){border-color:rgb(var(--outline-variant) / .4)}.prose-th\:bg-surface-dim :is(:where(th):not(:where([class~=not-prose],[class~=not-prose] *))){--tw-bg-opacity: 1;background-color:rgb(var(--surface-dim) / var(--tw-bg-opacity, 1))}.prose-th\:px-2 :is(:where(th):not(:where([class~=not-prose],[class~=not-prose] *))){padding-left:.5rem;padding-right:.5rem}.prose-th\:py-1 :is(:where(th):not(:where([class~=not-prose],[class~=not-prose] *))){padding-top:.25rem;padding-bottom:.25rem}.prose-th\:text-left :is(:where(th):not(:where([class~=not-prose],[class~=not-prose] *))){text-align:left}.prose-th\:font-medium :is(:where(th):not(:where([class~=not-prose],[class~=not-prose] *))){font-weight:500}.prose-td\:border :is(:where(td):not(:where([class~=not-prose],[class~=not-prose] *))){border-width:1px}.prose-td\:border-outline-variant\/40 :is(:where(td):not(:where([class~=not-prose],[class~=not-prose] *))){border-color:rgb(var(--outline-variant) / .4)}.prose-td\:px-2 :is(:where(td):not(:where([class~=not-prose],[class~=not-prose] *))){padding-left:.5rem;padding-right:.5rem}.prose-td\:py-1 :is(:where(td):not(:where([class~=not-prose],[class~=not-prose] *))){padding-top:.25rem;padding-bottom:.25rem}@media (min-width: 768px){.md\:inline{display:inline}}
@@ -27,8 +27,8 @@
27
27
  } catch (_) { /* SSR / blocked storage — ignore */ }
28
28
  })();
29
29
  </script>
30
- <script type="module" crossorigin src="/assets/index-CavSoqWA.js"></script>
31
- <link rel="stylesheet" crossorigin href="/assets/index-7sH8_RHK.css">
30
+ <script type="module" crossorigin src="/assets/index-CYJChurq.js"></script>
31
+ <link rel="stylesheet" crossorigin href="/assets/index-DETqMNr5.css">
32
32
  </head>
33
33
  <body class="bg-background text-on-surface">
34
34
  <div id="root"></div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "granclaw",
3
- "version": "0.0.1-beta.6",
3
+ "version": "0.0.1-beta.7",
4
4
  "description": "A personal AI assistant you run on your own machine.",
5
5
  "license": "MIT",
6
6
  "repository": {