@yoast/ai-insights-client 1.4.17 → 1.4.18
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.
|
@@ -65,7 +65,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
65
65
|
*/class t5{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=hb.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 Yn=new t5;const Cy="transparent",n5={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const r=hy(e||Cy),i=r.valid&&hy(t||Cy);return i&&i.valid?i.mix(r,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class r5{constructor(t,n,r,i){const s=n[r];i=sl([t.to,i,s,t.from]);const o=sl([t.from,s,i]);this._active=!0,this._fn=t.fn||n5[t.type||typeof o],this._easing=Ro[t.easing]||Ro.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=sl([t.to,n,i,t.from]),this._from=sl([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 Pb{constructor(t,n){this._chart=t,this._properties=new Map,this.configure(n)}configure(t){if(!Re(t))return;const n=Object.keys(lt.animation),r=this._properties;Object.getOwnPropertyNames(t).forEach(i=>{const s=t[i];if(!Re(s))return;const o={};for(const a of n)o[a]=s[a];(st(s.properties)&&s.properties||[i]).forEach(a=>{(a===i||!r.has(a))&&r.set(a,o)})})}_animateOptions(t,n){const r=n.options,i=s5(t,r);if(!i)return[];const s=this._createAnimations(i,r);return r.$shared&&i5(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 d=s[c];const f=r.get(c);if(d)if(f&&d.active()){d.update(f,u,a);continue}else d.cancel();if(!f||!f.duration){t[c]=u;continue}s[c]=d=new r5(f,t,c,u),i.push(d)}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 Yn.add(this._chart,r),!0}}function i5(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 s5(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 _y(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 o5(e,t,n){if(n===!1)return!1;const r=_y(e,n),i=_y(t,n);return{top:i.end,right:r.end,bottom:i.start,left:r.start}}function a5(e){let t,n,r,i;return Re(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 Tb(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 ky(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],yt(c)&&(s||t===0||$s(t)===$s(c))&&(t+=c)}return!u&&!r.all?0:t}function l5(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 wu(e,t){const n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function c5(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}function u5(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 d5(e,t,n){const r=e[t]||(e[t]={});return r[n]||(r[n]={})}function Oy(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 Ey(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=c5(s,o,r),d=t.length;let f;for(let h=0;h<d;++h){const g=t[h],{[l]:m,[c]:p}=g,v=g._stacks||(g._stacks={});f=v[c]=d5(i,u,m),f[a]=p,f._top=Oy(f,o,!0,r.type),f._bottom=Oy(f,o,!1,r.type);const b=f._visualValues||(f._visualValues={});b[a]=p}}function Su(e,t){const n=e.scales;return Object.keys(n).filter(r=>n[r].axis===t).shift()}function f5(e,t){return Gr(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function h5(e,t,n){return Gr(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function co(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 Cu=e=>e==="reset"||e==="none",Ay=(e,t)=>t?e:Object.assign({},e),g5=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:Tb(n,!0),values:null};class es{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=wu(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&&co(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,r=this.getDataset(),i=(d,f,h,g)=>d==="x"?f:d==="r"?g:h,s=n.xAxisID=Me(r.xAxisID,Su(t,"x")),o=n.yAxisID=Me(r.yAxisID,Su(t,"y")),a=n.rAxisID=Me(r.rAxisID,Su(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&&uy(this._data,this),t._stacked&&co(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),r=this._data;if(Re(n)){const i=this._cachedMeta;this._data=l5(n,i)}else if(r!==n){if(r){uy(r,this);const i=this._cachedMeta;co(i),i._parsed=[]}n&&Object.isExtensible(n)&&WP(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=wu(n.vScale,n),n.stack!==r.stack&&(i=!0,co(n),n.stack=r.stack),this._resyncElements(t),(i||s!==n._stacked)&&(Ey(this,n._parsed),n._stacked=wu(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,d,f;if(this._parsing===!1)r._parsed=i,r._sorted=!0,f=i;else{st(i[t])?f=this.parseArrayData(r,i,t,n):Re(i[t])?f=this.parseObjectData(r,i,t,n):f=this.parsePrimitiveData(r,i,t,n);const h=()=>d[a]===null||c&&d[a]<c[a];for(u=0;u<n;++u)r._parsed[u+t]=d=f[u],l&&(h()&&(l=!1),c=d);r._sorted=l}o&&Ey(this,f)}parsePrimitiveData(t,n,r,i){const{iScale:s,vScale:o}=t,a=s.axis,l=o.axis,c=s.getLabels(),u=s===o,d=new Array(i);let f,h,g;for(f=0,h=i;f<h;++f)g=f+r,d[f]={[a]:u||s.parse(c[g],g),[l]:o.parse(n[g],g)};return d}parseArrayData(t,n,r,i){const{xScale:s,yScale:o}=t,a=new Array(i);let l,c,u,d;for(l=0,c=i;l<c;++l)u=l+r,d=n[u],a[l]={x:s.parse(d[0],u),y:o.parse(d[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,d,f,h;for(u=0,d=i;u<d;++u)f=u+r,h=n[f],c[u]={x:s.parse(ra(h,a),f),y:o.parse(ra(h,l),f)};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:Tb(i,!0),values:n._stacks[t.axis]._visualValues};return ky(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=ky(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=g5(n,r,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:d}=u5(a);let f,h;function g(){h=i[f];const m=h[a.axis];return!yt(h[t.axis])||u>m||d<m}for(f=0;f<o&&!(!g()&&(this.updateRangeFromParsed(c,t,h,l),s));++f);if(s){for(f=o-1;f>=0;--f)if(!g()){this.updateRangeFromParsed(c,t,h,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],yt(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=a5(Me(this.options.clip,o5(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 d=i[u];d.hidden||(d.active&&c?o.push(d):d.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=h5(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=f5(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&&Ql(r);if(a)return Ay(a,l);const c=this.chart.config,u=c.datasetElementScopeKeys(this._type,t),d=i?[`${t}Hover`,"hover",t,""]:[t,""],f=c.getOptionScopes(this.getDataset(),u),h=Object.keys(lt.elements[t]),g=()=>this.getContext(r,i,n),m=c.resolveNamedOptions(f,h,g,d);return m.$shared&&(m.$shared=l,s[o]=Object.freeze(Ay(m,l))),m}_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,d=u.datasetAnimationScopeKeys(this._type,n),f=u.getOptionScopes(this.getDataset(),d);l=u.createResolver(f,this.getContext(t,r,n))}const c=new Pb(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||Cu(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){Cu(i)?Object.assign(t,r):this._resolveAnimations(n,i).update(t,r)}updateSharedOptions(t,n,r){t&&!Cu(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&&co(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])}}me(es,"defaults",{}),me(es,"datasetElementType",null),me(es,"dataElementType",null);class Al extends es{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}=YP(n,i,o);this._drawStart=a,this._drawCount=l,XP(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:d}=this._getSharedOptions(n,i),f=o.axis,h=a.axis,{spanGaps:g,segment:m}=this.options,p=ia(g)?g:Number.POSITIVE_INFINITY,v=this.chart._animationsDisabled||s||i==="none",b=n+r,w=t.length;let C=n>0&&this.getParsed(n-1);for(let x=0;x<w;++x){const k=t[x],S=v?k:{};if(x<n||x>=b){S.skip=!0;continue}const _=this.getParsed(x),O=Qe(_[h]),E=S[f]=o.getPixelForValue(_[f],x),T=S[h]=s||O?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,_,l):_[h],x);S.skip=isNaN(E)||isNaN(T)||O,S.stop=x>0&&Math.abs(_[f]-C[f])>p,m&&(S.parsed=_,S.raw=c.data[x]),d&&(S.options=u||this.resolveDataElementOptions(x,k.active?"active":i)),v||this.updateElement(k,x,S,i),C=_}}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()}}me(Al,"id","line"),me(Al,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),me(Al,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class Pl extends es{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 PT.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),d=o?s.xCenter:u.x,f=o?s.yCenter:u.y,h={x:d,y:f,angle:u.angle,skip:isNaN(d)||isNaN(f),options:c};this.updateElement(l,a,h,i)}}}me(Pl,"id","radar"),me(Pl,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),me(Pl,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});function ti(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Lf{constructor(t){me(this,"options");this.options=t||{}}static override(t){Object.assign(Lf.prototype,t)}init(){}formats(){return ti()}parse(){return ti()}format(){return ti()}add(){return ti()}diff(){return ti()}startOf(){return ti()}endOf(){return ti()}}var y5={_date:Lf};function m5(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?KP:ui;if(r){if(i._sharedOptions){const u=s[0],d=typeof u.getRange=="function"&&u.getRange(t);if(d){const f=c(s,t,n-d),h=c(s,t,n+d);return{lo:f.lo,hi:h.hi}}}}else{const u=c(s,t,n);if(l){const{vScale:d}=i._cachedMeta,{_parsed:f}=e,h=f.slice(0,u.lo+1).reverse().findIndex(m=>!Qe(m[d.axis]));u.lo-=Math.max(0,h);const g=f.slice(u.hi).findIndex(m=>!Qe(m[d.axis]));u.hi+=Math.max(0,g)}return u}}return{lo:0,hi:s.length-1}}function $c(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:d,hi:f}=m5(s[a],t,o,i);for(let h=d;h<=f;++h){const g=u[h];g.skip||r(g,c,h)}}}function p5(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 _u(e,t,n,r,i){const s=[];return!i&&!e.isPointInArea(t)||$c(e,n,t,function(a,l,c){!i&&!ir(a,e.chartArea,0)||a.inRange(t.x,t.y,r)&&s.push({element:a,datasetIndex:l,index:c})},!0),s}function v5(e,t,n,r){let i=[];function s(o,a,l){const{startAngle:c,endAngle:u}=o.getProps(["startAngle","endAngle"],r),{angle:d}=qP(o,{x:t.x,y:t.y});db(d,c,u)&&i.push({element:o,datasetIndex:a,index:l})}return $c(e,n,t,s),i}function b5(e,t,n,r,i,s){let o=[];const a=p5(n);let l=Number.POSITIVE_INFINITY;function c(u,d,f){const h=u.inRange(t.x,t.y,i);if(r&&!h)return;const g=u.getCenterPoint(i);if(!(!!s||e.isPointInArea(g))&&!h)return;const p=a(t,g);p<l?(o=[{element:u,datasetIndex:d,index:f}],l=p):p===l&&o.push({element:u,datasetIndex:d,index:f})}return $c(e,n,t,c),o}function ku(e,t,n,r,i,s){return!s&&!e.isPointInArea(t)?[]:n==="r"&&!r?v5(e,t,n,i):b5(e,t,n,r,i,s)}function Py(e,t,n,r,i){const s=[],o=n==="x"?"inXRange":"inYRange";let a=!1;return $c(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 x5={modes:{index(e,t,n,r){const i=ii(t,e),s=n.axis||"x",o=n.includeInvisible||!1,a=n.intersect?_u(e,i,s,r,o):ku(e,i,s,!1,r,o),l=[];return a.length?(e.getSortedVisibleDatasetMetas().forEach(c=>{const u=a[0].index,d=c.data[u];d&&!d.skip&&l.push({element:d,datasetIndex:c.index,index:u})}),l):[]},dataset(e,t,n,r){const i=ii(t,e),s=n.axis||"xy",o=n.includeInvisible||!1;let a=n.intersect?_u(e,i,s,r,o):ku(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=ii(t,e),s=n.axis||"xy",o=n.includeInvisible||!1;return _u(e,i,s,r,o)},nearest(e,t,n,r){const i=ii(t,e),s=n.axis||"xy",o=n.includeInvisible||!1;return ku(e,i,s,n.intersect,r,o)},x(e,t,n,r){const i=ii(t,e);return Py(e,i,"x",n.intersect,r)},y(e,t,n,r){const i=ii(t,e);return Py(e,i,"y",n.intersect,r)}}};const jb=["left","top","right","bottom"];function uo(e,t){return e.filter(n=>n.pos===t)}function Ty(e,t){return e.filter(n=>jb.indexOf(n.pos)===-1&&n.box.axis===t)}function fo(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 w5(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 S5(e){const t={};for(const n of e){const{stack:r,pos:i,stackWeight:s}=n;if(!r||!jb.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 C5(e,t){const n=S5(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 _5(e){const t=w5(e),n=fo(t.filter(c=>c.box.fullSize),!0),r=fo(uo(t,"left"),!0),i=fo(uo(t,"right")),s=fo(uo(t,"top"),!0),o=fo(uo(t,"bottom")),a=Ty(t,"x"),l=Ty(t,"y");return{fullSize:n,leftAndTop:r.concat(s),rightAndBottom:i.concat(l).concat(o).concat(a),chartArea:uo(t,"chartArea"),vertical:r.concat(i).concat(l),horizontal:s.concat(o).concat(a)}}function jy(e,t,n,r){return Math.max(e[n],t[n])+Math.max(e[r],t[r])}function Mb(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 k5(e,t,n,r){const{pos:i,box:s}=n,o=e.maxPadding;if(!Re(i)){n.size&&(e[i]-=n.size);const d=r[n.stack]||{size:0,count:1};d.size=Math.max(d.size,n.horizontal?s.height:s.width),n.size=d.size/d.count,e[i]+=n.size}s.getPadding&&Mb(o,s.getPadding());const a=Math.max(0,t.outerWidth-jy(o,e,"left","right")),l=Math.max(0,t.outerHeight-jy(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 O5(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 E5(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 Oo(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,E5(a.horizontal,t));const{same:d,other:f}=k5(t,n,a,r);c|=d&&i.length,u=u||f,l.fullSize||i.push(a)}return c&&Oo(i,t,n,r)||u}function cl(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 My(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 d=t.w*u,f=c.size||l.height;Ql(c.start)&&(o=c.start),l.fullSize?cl(l,i.left,o,n.outerWidth-i.right-i.left,f):cl(l,t.left+c.placed,o,d,f),c.start=o,c.placed+=d,o=l.bottom}else{const d=t.h*u,f=c.size||l.width;Ql(c.start)&&(s=c.start),l.fullSize?cl(l,s,i.top,f,n.outerHeight-i.bottom-i.top):cl(l,s,t.top+c.placed,f,d),c.start=s,c.placed+=d,s=l.right}}t.x=s,t.y=o}var cn={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=_5(e.boxes),l=a.vertical,c=a.horizontal;Ge(e.boxes,m=>{typeof m.beforeLayout=="function"&&m.beforeLayout()});const u=l.reduce((m,p)=>p.box.options&&p.box.options.display===!1?m:m+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:n,padding:i,availableWidth:s,availableHeight:o,vBoxMaxWidth:s/2/u,hBoxMaxHeight:o/2}),f=Object.assign({},i);Mb(f,Et(r));const h=Object.assign({maxPadding:f,w:s,h:o,x:i.left,y:i.top},i),g=C5(l.concat(c),d);Oo(a.fullSize,h,d,g),Oo(l,h,d,g),Oo(c,h,d,g)&&Oo(l,h,d,g),O5(h),My(a.leftAndTop,h,d,g),h.x+=h.w,h.y+=h.h,My(a.rightAndBottom,h,d,g),e.chartArea={left:h.left,top:h.top,right:h.left+h.w,bottom:h.top+h.h,height:h.h,width:h.w},Ge(a.chartArea,m=>{const p=m.box;Object.assign(p,e.chartArea),p.update(h.w,h.h,{left:0,top:0,right:0,bottom:0})})}};class $b{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 A5 extends $b{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Tl="$chartjs",P5={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},$y=e=>e===null||e==="";function T5(e,t){const n=e.style,r=e.getAttribute("height"),i=e.getAttribute("width");if(e[Tl]={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",$y(i)){const s=by(e,"width");s!==void 0&&(e.width=s)}if($y(r))if(e.style.height==="")e.height=e.width/(t||2);else{const s=by(e,"height");s!==void 0&&(e.height=s)}return e}const Db=HT?{passive:!0}:!1;function j5(e,t,n){e&&e.addEventListener(t,n,Db)}function M5(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,Db)}function $5(e,t){const n=P5[e.type]||e.type,{x:r,y:i}=ii(e,t);return{type:n,chart:t,native:e,x:r!==void 0?r:null,y:i!==void 0?i:null}}function ec(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function D5(e,t,n){const r=e.canvas,i=new MutationObserver(s=>{let o=!1;for(const a of s)o=o||ec(a.addedNodes,r),o=o&&!ec(a.removedNodes,r);o&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}function L5(e,t,n){const r=e.canvas,i=new MutationObserver(s=>{let o=!1;for(const a of s)o=o||ec(a.removedNodes,r),o=o&&!ec(a.addedNodes,r);o&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}const sa=new Map;let Dy=0;function Lb(){const e=window.devicePixelRatio;e!==Dy&&(Dy=e,sa.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function I5(e,t){sa.size||window.addEventListener("resize",Lb),sa.set(e,t)}function R5(e){sa.delete(e),sa.size||window.removeEventListener("resize",Lb)}function N5(e,t,n){const r=e.canvas,i=r&&Df(r);if(!i)return;const s=gb((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),I5(e,s),o}function Ou(e,t,n){n&&n.disconnect(),t==="resize"&&R5(e)}function F5(e,t,n){const r=e.canvas,i=gb(s=>{e.ctx!==null&&n($5(s,e))},e);return j5(r,t,i),i}class B5 extends $b{acquireContext(t,n){const r=t&&t.getContext&&t.getContext("2d");return r&&r.canvas===t?(T5(t,n),r):null}releaseContext(t){const n=t.canvas;if(!n[Tl])return!1;const r=n[Tl].initial;["height","width"].forEach(s=>{const o=r[s];Qe(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[Tl],!0}addEventListener(t,n,r){this.removeEventListener(t,n);const i=t.$proxies||(t.$proxies={}),o={attach:D5,detach:L5,resize:N5}[n]||F5;i[n]=o(t,n,r)}removeEventListener(t,n){const r=t.$proxies||(t.$proxies={}),i=r[n];if(!i)return;({attach:Ou,detach:Ou,resize:Ou}[n]||M5)(t,n,i),r[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,r,i){return zT(t,n,r,i)}isAttached(t){const n=t&&Df(t);return!!(n&&n.isConnected)}}function q5(e){return!$f()||typeof OffscreenCanvas!="undefined"&&e instanceof OffscreenCanvas?A5:B5}var xl;let Ni=(xl=class{constructor(){me(this,"x");me(this,"y");me(this,"active",!1);me(this,"options");me(this,"$animations")}tooltipPosition(t){const{x:n,y:r}=this.getProps(["x","y"],t);return{x:n,y:r}}hasValue(){return ia(this.x)&&ia(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}},me(xl,"defaults",{}),me(xl,"defaultRoutes"),xl);function z5(e,t){const n=e.options.ticks,r=H5(e),i=Math.min(n.maxTicksLimit||r,r),s=n.major.enabled?U5(t):[],o=s.length,a=s[0],l=s[o-1],c=[];if(o>i)return W5(t,c,s,o/i),c;const u=K5(s,t,i);if(o>0){let d,f;const h=o>1?Math.round((l-a)/(o-1)):null;for(ul(t,c,u,Qe(h)?0:a-h,a),d=0,f=o-1;d<f;d++)ul(t,c,u,s[d],s[d+1]);return ul(t,c,u,l,Qe(h)?t.length:l+h),c}return ul(t,c,u),c}function H5(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 K5(e,t,n){const r=V5(e),i=t.length/n;if(!r)return Math.max(i,1);const s=RP(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 U5(e){const t=[];let n,r;for(n=0,r=e.length;n<r;n++)e[n].major&&t.push(n);return t}function W5(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 ul(e,t,n,r,i){const s=Me(r,0),o=Math.min(Me(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 V5(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 G5=e=>e==="left"?"right":e==="right"?"left":e,Ly=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,Iy=(e,t)=>Math.min(t||e,e);function Ry(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 Q5(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 Y5(e,t){Ge(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 ho(e){return e.drawTicks?e.tickLength:0}function Ny(e,t){if(!e.display)return 0;const n=ft(e.font,t),r=Et(e.padding);return(st(e.text)?e.text.length:1)*n.lineHeight+r.height}function X5(e,t){return Gr(e,{scale:t,type:"scale"})}function J5(e,t,n){return Gr(e,{tick:n,index:t,type:"tick"})}function Z5(e,t,n){let r=Ef(e);return(n&&t!=="right"||!n&&t==="right")&&(r=G5(r)),r}function ej(e,t,n,r){const{top:i,left:s,bottom:o,right:a,chart:l}=e,{chartArea:c,scales:u}=l;let d=0,f,h,g;const m=o-i,p=a-s;if(e.isHorizontal()){if(h=St(r,s,a),Re(n)){const v=Object.keys(n)[0],b=n[v];g=u[v].getPixelForValue(b)+m-t}else n==="center"?g=(c.bottom+c.top)/2+m-t:g=Ly(e,n,t);f=a-s}else{if(Re(n)){const v=Object.keys(n)[0],b=n[v];h=u[v].getPixelForValue(b)-p+t}else n==="center"?h=(c.left+c.right)/2-p+t:h=Ly(e,n,t);g=St(r,o,i),d=n==="left"?-Xt:Xt}return{titleX:h,titleY:g,maxWidth:f,rotation:d}}class Ws extends Ni{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=jn(t,Number.POSITIVE_INFINITY),n=jn(n,Number.NEGATIVE_INFINITY),r=jn(r,Number.POSITIVE_INFINITY),i=jn(i,Number.NEGATIVE_INFINITY),{min:jn(t,r),max:jn(n,i),minDefined:yt(t),maxDefined:yt(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:jn(n,jn(r,n)),max:jn(r,jn(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(){et(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=bT(this,s,i),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?Ry(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),o.display&&(o.autoSkip||o.source==="auto")&&(this.ticks=z5(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(){et(this.options.afterUpdate,[this])}beforeSetDimensions(){et(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(){et(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),et(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){et(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=et(n.callback,[s.value,r,t],this)}afterTickToLabelConversion(){et(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){et(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,n=t.ticks,r=Iy(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(),d=u.widest.width,f=u.highest.height,h=ln(this.chart.width-d,0,this.maxWidth);a=t.offset?this.maxWidth/r:h/(r-1),d+6>a&&(a=h/(r-(t.offset?.5:1)),l=this.maxHeight-ho(t.grid)-n.padding-Ny(t.title,this.chart.options.font),c=Math.sqrt(d*d+f*f),o=kf(Math.min(Math.asin(ln((u.highest.height+6)/a,-1,1)),Math.asin(ln(l/c,-1,1))-Math.asin(ln(f/c,-1,1)))),o=Math.max(i,Math.min(s,o))),this.labelRotation=o}afterCalculateLabelRotation(){et(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){et(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=Ny(i,n.options.font);if(a?(t.width=this.maxWidth,t.height=ho(s)+l):(t.height=this.maxHeight,t.width=ho(s)+l),r.display&&this.ticks.length){const{first:c,last:u,widest:d,highest:f}=this._getLabelSizes(),h=r.padding*2,g=Dr(this.labelRotation),m=Math.cos(g),p=Math.sin(g);if(a){const v=r.mirror?0:p*d.width+m*f.height;t.height=Math.min(this.maxHeight,t.height+v+h)}else{const v=r.mirror?0:m*d.width+p*f.height;t.width=Math.min(this.maxWidth,t.width+v+h)}this._calculatePadding(c,u,p,m)}}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,d=this.right-this.getPixelForTick(this.ticks.length-1);let f=0,h=0;l?c?(f=i*t.width,h=r*n.height):(f=r*t.height,h=i*n.width):s==="start"?h=n.width:s==="end"?f=t.width:s!=="inner"&&(f=t.width/2,h=n.width/2),this.paddingLeft=Math.max((f-u+o)*this.width/(this.width-u),0),this.paddingRight=Math.max((h-d+o)*this.width/(this.width-d),0)}else{let u=n.height/2,d=t.height/2;s==="start"?(u=0,d=t.height):s==="end"&&(u=n.height,d=0),this.paddingTop=u+o,this.paddingBottom=d+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(){et(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++)Qe(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=Ry(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/Iy(n,r));let c=0,u=0,d,f,h,g,m,p,v,b,w,C,x;for(d=0;d<n;d+=l){if(g=t[d].label,m=this._resolveTickFontOptions(d),i.font=p=m.string,v=s[p]=s[p]||{data:{},gc:[]},b=m.lineHeight,w=C=0,!Qe(g)&&!st(g))w=Xl(i,v.data,v.gc,w,g),C=b;else if(st(g))for(f=0,h=g.length;f<h;++f)x=g[f],!Qe(x)&&!st(x)&&(w=Xl(i,v.data,v.gc,w,x),C+=b);o.push(w),a.push(C),c=Math.max(w,c),u=Math.max(C,u)}Y5(s,n);const k=o.indexOf(c),S=a.indexOf(u),_=O=>({width:o[O]||0,height:a[O]||0});return{first:_(0),last:_(n-1),widest:_(k),highest:_(S),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 HP(this._alignToPixels?ei(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=J5(this.getContext(),t,r))}return this.$context||(this.$context=X5(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,n=Dr(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(),d=this.ticks.length+(l?1:0),f=ho(s),h=[],g=a.setContext(this.getContext()),m=g.display?g.width:0,p=m/2,v=function(L){return ei(r,L,m)};let b,w,C,x,k,S,_,O,E,T,D,V;if(o==="top")b=v(this.bottom),S=this.bottom-f,O=b-p,T=v(t.top)+p,V=t.bottom;else if(o==="bottom")b=v(this.top),T=t.top,V=v(t.bottom)-p,S=b+p,O=this.top+f;else if(o==="left")b=v(this.right),k=this.right-f,_=b-p,E=v(t.left)+p,D=t.right;else if(o==="right")b=v(this.left),E=t.left,D=v(t.right)-p,k=b+p,_=this.left+f;else if(n==="x"){if(o==="center")b=v((t.top+t.bottom)/2+.5);else if(Re(o)){const L=Object.keys(o)[0],I=o[L];b=v(this.chart.scales[L].getPixelForValue(I))}T=t.top,V=t.bottom,S=b+p,O=S+f}else if(n==="y"){if(o==="center")b=v((t.left+t.right)/2);else if(Re(o)){const L=Object.keys(o)[0],I=o[L];b=v(this.chart.scales[L].getPixelForValue(I))}k=b-p,_=k-f,E=t.left,D=t.right}const N=Me(i.ticks.maxTicksLimit,d),$=Math.max(1,Math.ceil(d/N));for(w=0;w<d;w+=$){const L=this.getContext(w),I=s.setContext(L),oe=a.setContext(L),ue=I.lineWidth,B=I.color,J=oe.dash||[],ne=oe.dashOffset,ae=I.tickWidth,R=I.tickColor,G=I.tickBorderDash||[],z=I.tickBorderDashOffset;C=Q5(this,w,l),C!==void 0&&(x=ei(r,C,ue),c?k=_=E=D=x:S=O=T=V=x,h.push({tx1:k,ty1:S,tx2:_,ty2:O,x1:E,y1:T,x2:D,y2:V,width:ue,color:B,borderDash:J,borderDashOffset:ne,tickWidth:ae,tickColor:R,tickBorderDash:G,tickBorderDashOffset:z}))}return this._ticksLength=d,this._borderValue=b,h}_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:d}=s,f=ho(r.grid),h=f+u,g=d?-u:h,m=-Dr(this.labelRotation),p=[];let v,b,w,C,x,k,S,_,O,E,T,D,V="middle";if(i==="top")k=this.bottom-g,S=this._getXAxisLabelAlignment();else if(i==="bottom")k=this.top+g,S=this._getXAxisLabelAlignment();else if(i==="left"){const $=this._getYAxisLabelAlignment(f);S=$.textAlign,x=$.x}else if(i==="right"){const $=this._getYAxisLabelAlignment(f);S=$.textAlign,x=$.x}else if(n==="x"){if(i==="center")k=(t.top+t.bottom)/2+h;else if(Re(i)){const $=Object.keys(i)[0],L=i[$];k=this.chart.scales[$].getPixelForValue(L)+h}S=this._getXAxisLabelAlignment()}else if(n==="y"){if(i==="center")x=(t.left+t.right)/2-h;else if(Re(i)){const $=Object.keys(i)[0],L=i[$];x=this.chart.scales[$].getPixelForValue(L)}S=this._getYAxisLabelAlignment(f).textAlign}n==="y"&&(l==="start"?V="top":l==="end"&&(V="bottom"));const N=this._getLabelSizes();for(v=0,b=a.length;v<b;++v){w=a[v],C=w.label;const $=s.setContext(this.getContext(v));_=this.getPixelForTick(v)+s.labelOffset,O=this._resolveTickFontOptions(v),E=O.lineHeight,T=st(C)?C.length:1;const L=T/2,I=$.color,oe=$.textStrokeColor,ue=$.textStrokeWidth;let B=S;o?(x=_,S==="inner"&&(v===b-1?B=this.options.reverse?"left":"right":v===0?B=this.options.reverse?"right":"left":B="center"),i==="top"?c==="near"||m!==0?D=-T*E+E/2:c==="center"?D=-N.highest.height/2-L*E+E:D=-N.highest.height+E/2:c==="near"||m!==0?D=E/2:c==="center"?D=N.highest.height/2-L*E:D=N.highest.height-T*E,d&&(D*=-1),m!==0&&!$.showLabelBackdrop&&(x+=E/2*Math.sin(m))):(k=_,D=(1-T)*E/2);let J;if($.showLabelBackdrop){const ne=Et($.backdropPadding),ae=N.heights[v],R=N.widths[v];let G=D-ne.top,z=0-ne.left;switch(V){case"middle":G-=ae/2;break;case"bottom":G-=ae;break}switch(S){case"center":z-=R/2;break;case"right":z-=R;break;case"inner":v===b-1?z-=R:v>0&&(z-=R/2);break}J={left:z,top:G,width:R+ne.width,height:ae+ne.height,color:$.backdropColor}}p.push({label:C,font:O,textOffset:D,options:{rotation:m,color:I,strokeColor:oe,strokeWidth:ue,textAlign:B,textBaseline:V,translation:[x,k],backdrop:J}})}return p}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-Dr(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,d,f;this.isHorizontal()?(c=ei(t,this.left,o)-o/2,u=ei(t,this.right,a)+a/2,d=f=l):(d=ei(t,this.top,o)-o/2,f=ei(t,this.bottom,a)+a/2,c=u=l),n.save(),n.lineWidth=s.width,n.strokeStyle=s.color,n.beginPath(),n.moveTo(c,d),n.lineTo(u,f),n.stroke(),n.restore()}drawLabels(t){if(!this.options.ticks.display)return;const r=this.ctx,i=this._computeLabelArea();i&&Tc(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;Ti(r,c,0,u,l,a)}i&&jc(r)}drawTitle(){const{ctx:t,options:{position:n,title:r,reverse:i}}=this;if(!r.display)return;const s=ft(r.font),o=Et(r.padding),a=r.align;let l=s.lineHeight/2;n==="bottom"||n==="center"||Re(n)?(l+=o.bottom,st(r.text)&&(l+=s.lineHeight*(r.text.length-1))):l+=o.top;const{titleX:c,titleY:u,maxWidth:d,rotation:f}=ej(this,l,n,a);Ti(t,r.text,0,0,s,{color:r.color,maxWidth:d,rotation:f,textAlign:Z5(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=Me(t.grid&&t.grid.z,-1),i=Me(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==Ws.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 ft(n.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class dl{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;rj(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,tj(t,o,r),this.override&<.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 lt[i]&&(delete lt[i][r],this.override&&delete Pi[r])}}function tj(e,t,n){const r=na(Object.create(null),[n?lt.get(n):{},lt.get(t),e.defaults]);lt.set(t,r),e.defaultRoutes&&nj(t,e.defaultRoutes),e.descriptors&<.describe(t,e.descriptors)}function nj(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(".");lt.route(s,i,l,a)})}function rj(e){return"id"in e&&"defaults"in e}class ij{constructor(){this.controllers=new dl(es,"datasets",!0),this.elements=new dl(Ni,"elements"),this.plugins=new dl(Object,"plugins"),this.scales=new dl(Ws,"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):Ge(i,o=>{const a=r||this._getRegistryForType(o);this._exec(t,a,o)})})}_exec(t,n,r){const i=_f(t);et(r["before"+i],[],r),n[t](r),et(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 Dn=new ij;class sj{constructor(){this._init=[]}notify(t,n,r,i){n==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));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")),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(et(a,l,o)===!1&&i.cancelable)return!1}return!0}invalidate(){Qe(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=Me(r.options&&r.options.plugins,{}),s=oj(r);return i===!1&&!n?[]:lj(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 oj(e){const t={},n=[],r=Object.keys(Dn.plugins.items);for(let s=0;s<r.length;s++)n.push(Dn.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 aj(e,t){return!t&&e===!1?null:e===!0?{}:e}function lj(e,{plugins:t,localIds:n},r,i){const s=[],o=e.getContext();for(const a of t){const l=a.id,c=aj(r[l],i);c!==null&&s.push({plugin:a,options:cj(e.config,{plugin:a,local:n[l]},c,o)})}return s}function cj(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 kd(e,t){const n=lt.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function uj(e,t){let n=e;return e==="_index_"?n=t:e==="_value_"&&(n=t==="x"?"y":"x"),n}function dj(e,t){return e===t?"_index_":"_value_"}function Fy(e){if(e==="x"||e==="y"||e==="r")return e}function fj(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function Od(e,...t){if(Fy(e))return e;for(const n of t){const r=n.axis||fj(n.position)||e.length>1&&Fy(e[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function By(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function hj(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 By(e,"x",n[0])||By(e,"y",n[0])}return{}}function gj(e,t){const n=Pi[e.type]||{scales:{}},r=t.scales||{},i=kd(e.type,t),s=Object.create(null);return Object.keys(r).forEach(o=>{const a=r[o];if(!Re(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=Od(o,a,hj(o,e),lt.scales[a.type]),c=dj(l,i),u=n.scales||{};s[o]=Lo(Object.create(null),[{axis:l},a,u[l],u[c]])}),e.data.datasets.forEach(o=>{const a=o.type||e.type,l=o.indexAxis||kd(a,t),u=(Pi[a]||{}).scales||{};Object.keys(u).forEach(d=>{const f=uj(d,l),h=o[f+"AxisID"]||f;s[h]=s[h]||Object.create(null),Lo(s[h],[{axis:f},r[h],u[d]])})}),Object.keys(s).forEach(o=>{const a=s[o];Lo(a,[lt.scales[a.type],lt.scale])}),s}function Ib(e){const t=e.options||(e.options={});t.plugins=Me(t.plugins,{}),t.scales=gj(e,t)}function Rb(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function yj(e){return e=e||{},e.data=Rb(e.data),Ib(e),e}const qy=new Map,Nb=new Set;function fl(e,t){let n=qy.get(e);return n||(n=t(),qy.set(e,n),Nb.add(n)),n}const go=(e,t,n)=>{const r=ra(t,n);r!==void 0&&e.add(r)};class mj{constructor(t){this._config=yj(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=Rb(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(),Ib(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return fl(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return fl(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return fl(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,r=this.type;return fl(`${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(d=>go(l,t,d))),u.forEach(d=>go(l,i,d)),u.forEach(d=>go(l,Pi[s]||{},d)),u.forEach(d=>go(l,lt,d)),u.forEach(d=>go(l,Cd,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),Nb.has(n)&&o.set(n,c),c}chartOptionScopes(){const{options:t,type:n}=this;return[t,Pi[n]||{},lt.datasets[n]||{},{type:n},lt,Cd]}resolveNamedOptions(t,n,r,i=[""]){const s={$shared:!0},{resolver:o,subPrefixes:a}=zy(this._resolverCache,t,i);let l=o;if(vj(o,n)){s.$shared=!1,r=zr(r)?r():r;const c=this.createResolver(t,r,a);l=Ds(o,r,c)}for(const c of n)s[c]=l[c];return s}createResolver(t,n,r=[""],i){const{resolver:s}=zy(this._resolverCache,t,r);return Re(n)?Ds(s,n,void 0,i):s}}function zy(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:Tf(t,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},r.set(i,s)),s}const pj=e=>Re(e)&&Object.getOwnPropertyNames(e).some(t=>zr(e[t]));function vj(e,t){const{isScriptable:n,isIndexable:r}=vb(e);for(const i of t){const s=n(i),o=r(i),a=(o||s)&&e[i];if(s&&(zr(a)||pj(a))||o&&st(a))return!0}return!1}var bj="4.5.0";const xj=["top","bottom","left","right","chartArea"];function Hy(e,t){return e==="top"||e==="bottom"||xj.indexOf(e)===-1&&t==="x"}function Ky(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}function Uy(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),et(n&&n.onComplete,[e],t)}function wj(e){const t=e.chart,n=t.options.animation;et(n&&n.onProgress,[e],t)}function Fb(e){return $f()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const jl={},Wy=e=>{const t=Fb(e);return Object.values(jl).filter(n=>n.canvas===t).pop()};function Sj(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 Cj(e,t,n,r){return!n||e.type==="mouseout"?null:r?t:e}var wr;let Dc=(wr=class{static register(...t){Dn.add(...t),Vy()}static unregister(...t){Dn.remove(...t),Vy()}constructor(t,n){const r=this.config=new mj(n),i=Fb(t),s=Wy(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||q5(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=AP(),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 sj,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=GP(d=>this.update(d),o.resizeDelay||0),this._dataChanges=[],jl[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}Yn.listen(this,"complete",Uy),Yn.listen(this,"progress",wj),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:r,height:i,_aspectRatio:s}=this;return Qe(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 Dn}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():vy(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return yy(this.canvas,this.ctx),this}stop(){return Yn.stop(this),this}resize(t,n){Yn.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,vy(this,a,!0)&&(this.notifyPlugins("resize",{size:o}),et(r.onResize,[this,o],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};Ge(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=Od(o,a),c=l==="r",u=l==="x";return{options:a,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),Ge(s,o=>{const a=o.options,l=a.id,c=Od(l,a),u=Me(a.type,o.dtype);(a.position===void 0||Hy(a.position,c)!==Hy(o.dposition))&&(a.position=o.dposition),i[l]=!0;let d=null;if(l in r&&r[l].type===u)d=r[l];else{const f=Dn.getScale(u);d=new f({id:l,type:u,ctx:this.ctx,chart:this}),r[d.id]=d}d.init(a,t)}),Ge(i,(o,a)=>{o||delete r[a]}),Ge(r,o=>{cn.configure(this,o,o.options),cn.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(Ky("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||kd(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=Dn.getController(a),{datasetElementType:c,dataElementType:u}=lt.datasets[a];Object.assign(l,{dataElementType:Dn.getElement(u),datasetElementType:c&&Dn.getElement(c)}),o.controller=new l(this,r),t.push(o.controller)}}return this._updateMetasets(),t}_resetElements(){Ge(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:d}=this.getDatasetMeta(c),f=!i&&s.indexOf(d)===-1;d.buildOrUpdateElements(f),o=Math.max(+d.getMaxOverflow(),o)}o=this._minPadding=r.layout.autoPadding?o:0,this._updateLayout(o),i||Ge(s,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Ky("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){Ge(this.scales,t=>{cn.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),r=new Set(t.events);(!oy(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;Sj(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(!oy(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;cn.update(this,this.width,this.height,t);const n=this.chartArea,r=n.width<=0||n.height<=0;this._layers=[],Ge(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,zr(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&&(Yn.has(this)?this.attached&&!Yn.running(this)&&Yn.start(this):(this.draw(),Uy({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=Ab(this,t);this.notifyPlugins("beforeDatasetDraw",r)!==!1&&(i&&Tc(n,i),t.controller.draw(),i&&jc(n),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(t){return ir(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,r,i){const s=x5.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=Gr(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);Ql(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(),Yn.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(),yy(t,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete jl[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)};Ge(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(){Ge(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},Ge(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}});!Vl(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(d=>u.datasetIndex===d.datasetIndex&&u.index===d.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=DP(t),c=Cj(t,this._lastEvent,r,l);r&&(this._lastEvent=null,et(s.onHover,[t,a,this],this),l&&et(s.onClick,[t,a,this],this));const u=!Vl(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)}},me(wr,"defaults",lt),me(wr,"instances",jl),me(wr,"overrides",Pi),me(wr,"registry",Dn),me(wr,"version",bj),me(wr,"getChart",Wy),wr);function Vy(){return Ge(Dc.instances,e=>e._plugins.invalidate())}function Bb(e,t,n=t){e.lineCap=Me(n.borderCapStyle,t.borderCapStyle),e.setLineDash(Me(n.borderDash,t.borderDash)),e.lineDashOffset=Me(n.borderDashOffset,t.borderDashOffset),e.lineJoin=Me(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=Me(n.borderWidth,t.borderWidth),e.strokeStyle=Me(n.borderColor,t.borderColor)}function _j(e,t,n){e.lineTo(n.x,n.y)}function kj(e){return e.stepped?cT:e.tension||e.cubicInterpolationMode==="monotone"?uT:_j}function qb(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 Oj(e,t,n,r){const{points:i,options:s}=t,{count:o,start:a,loop:l,ilen:c}=qb(i,n,r),u=kj(s);let{move:d=!0,reverse:f}=r||{},h,g,m;for(h=0;h<=c;++h)g=i[(a+(f?c-h:h))%o],!g.skip&&(d?(e.moveTo(g.x,g.y),d=!1):u(e,m,g,f,s.stepped),m=g);return l&&(g=i[(a+(f?c:0))%o],u(e,m,g,f,s.stepped)),!!l}function Ej(e,t,n,r){const i=t.points,{count:s,start:o,ilen:a}=qb(i,n,r),{move:l=!0,reverse:c}=r||{};let u=0,d=0,f,h,g,m,p,v;const b=C=>(o+(c?a-C:C))%s,w=()=>{m!==p&&(e.lineTo(u,p),e.lineTo(u,m),e.lineTo(u,v))};for(l&&(h=i[b(0)],e.moveTo(h.x,h.y)),f=0;f<=a;++f){if(h=i[b(f)],h.skip)continue;const C=h.x,x=h.y,k=C|0;k===g?(x<m?m=x:x>p&&(p=x),u=(d*u+C)/++d):(w(),e.lineTo(C,x),g=k,d=0,m=p=x),v=x}w()}function Ed(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?Ej:Oj}function Aj(e){return e.stepped?KT:e.tension||e.cubicInterpolationMode==="monotone"?UT:si}function Pj(e,t,n,r){let i=t._path;i||(i=t._path=new Path2D,t.path(i,n,r)&&i.closePath()),Bb(e,t.options),e.stroke(i)}function Tj(e,t,n,r){const{segments:i,options:s}=t,o=Ed(t);for(const a of i)Bb(e,s,a.style),e.beginPath(),o(e,t,a,{start:n,end:n+r-1})&&e.closePath(),e.stroke()}const jj=typeof Path2D=="function";function Mj(e,t,n,r){jj&&!t.options.segment?Pj(e,t,n,r):Tj(e,t,n,r)}class Lr extends Ni{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;IT(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=XT(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=Eb(this,{property:n,start:i,end:i});if(!o.length)return;const a=[],l=Aj(r);let c,u;for(c=0,u=o.length;c<u;++c){const{start:d,end:f}=o[c],h=s[d],g=s[f];if(h===g){a.push(h);continue}const m=Math.abs((i-h[n])/(g[n]-h[n])),p=l(h,g,m,r.stepped);p[n]=t[n],a.push(p)}return a.length===1?a[0]:a}pathSegment(t,n,r){return Ed(this)(t,this,n,r)}path(t,n,r){const i=this.segments,s=Ed(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(),Mj(t,this,r,i),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}me(Lr,"id","line"),me(Lr,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),me(Lr,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),me(Lr,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function Gy(e,t,n,r){const i=e.options,{[n]:s}=e.getProps([n],r);return Math.abs(t-s)<i.radius+i.hitRadius}class Ml extends Ni{constructor(n){super();me(this,"parsed");me(this,"skip");me(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 Gy(this,n,"x",r)}inYRange(n,r){return Gy(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||!ir(this,r,this.size(i)/2)||(n.strokeStyle=i.borderColor,n.lineWidth=i.borderWidth,n.fillStyle=i.backgroundColor,_d(n,i,this.x,this.y))}getRange(){const n=this.options||{};return n.radius+n.hitRadius}}me(Ml,"id","point"),me(Ml,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),me(Ml,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function $j(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=Lc(l,c,i);const u=Ad(n,i[l],i[c],a.loop);if(!t.segments){o.push({source:a,target:u,start:i[l],end:i[c]});continue}const d=Eb(t,u);for(const f of d){const h=Ad(n,s[f.start],s[f.end],f.loop),g=Ob(a,i,h);for(const m of g)o.push({source:m,target:f,start:{[n]:Qy(u,h,"start",Math.max)},end:{[n]:Qy(u,h,"end",Math.min)}})}}return o}function Ad(e,t,n,r){if(r)return;let i=t[e],s=n[e];return e==="angle"&&(i=Gt(i),s=Gt(s)),{property:e,start:i,end:s}}function Dj(e,t){const{x:n=null,y:r=null}=e||{},i=t.points,s=[];return t.segments.forEach(({start:o,end:a})=>{a=Lc(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 Lc(e,t,n){for(;t>e;t--){const r=n[t];if(!isNaN(r.x)&&!isNaN(r.y))break}return t}function Qy(e,t,n,r){return e&&t?r(e[n],t[n]):e?e[n]:t?t[n]:0}function zb(e,t){let n=[],r=!1;return st(e)?(r=!0,n=e):n=Dj(e,t),n.length?new Lr({points:n,options:{tension:0},_loop:r,_fullLoop:r}):null}function Yy(e){return e&&e.fill!==!1}function Lj(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(!yt(i))return i;if(o=e[i],!o)return!1;if(o.visible)return i;s.push(i),i=o.fill}return!1}function Ij(e,t,n){const r=Bj(e);if(Re(r))return isNaN(r.value)?!1:r;let i=parseFloat(r);return yt(i)&&Math.floor(i)===i?Rj(r[0],t,i,n):["origin","start","end","stack","shape"].indexOf(r)>=0&&r}function Rj(e,t,n,r){return(e==="-"||e==="+")&&(n=t+n),n===t||n<0||n>=r?!1:n}function Nj(e,t){let n=null;return e==="start"?n=t.bottom:e==="end"?n=t.top:Re(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}function Fj(e,t,n){let r;return e==="start"?r=n:e==="end"?r=t.options.reverse?t.min:t.max:Re(e)?r=e.value:r=t.getBaseValue(),r}function Bj(e){const t=e.options,n=t.fill;let r=Me(n&&n.target,n);return r===void 0&&(r=!!t.backgroundColor),r===!1||r===null?!1:r===!0?"origin":r}function qj(e){const{scale:t,index:n,line:r}=e,i=[],s=r.segments,o=r.points,a=zj(t,n);a.push(zb({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++)Hj(i,o[u],a)}return new Lr({points:i,options:{}})}function zj(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 Hj(e,t,n){const r=[];for(let i=0;i<n.length;i++){const s=n[i],{first:o,last:a,point:l}=Kj(s,t,"x");if(!(!l||o&&a)){if(o)r.unshift(l);else if(e.push(l),!a)break}}e.push(...r)}function Kj(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],d=o[u.start][n],f=o[u.end][n];if(Xi(i,d,f)){a=i===d,l=i===f;break}}return{first:a,last:l,point:r}}class Hb{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:Jt},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 Uj(e){const{chart:t,fill:n,line:r}=e;if(yt(n))return Wj(t,n);if(n==="stack")return qj(e);if(n==="shape")return!0;const i=Vj(e);return i instanceof Hb?i:zb(i,r)}function Wj(e,t){const n=e.getDatasetMeta(t);return n&&e.isDatasetVisible(t)?n.dataset:null}function Vj(e){return(e.scale||{}).getPointPositionForValue?Qj(e):Gj(e)}function Gj(e){const{scale:t={},fill:n}=e,r=Nj(n,t);if(yt(r)){const i=t.isHorizontal();return{x:i?r:null,y:i?null:r}}return null}function Qj(e){const{scale:t,fill:n}=e,r=t.options,i=t.getLabels().length,s=r.reverse?t.max:t.min,o=Fj(n,t,s),a=[];if(r.grid.circular){const l=t.getPointPositionForValue(0,s);return new Hb({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 Eu(e,t,n){const r=Uj(t),{chart:i,index:s,line:o,scale:a,axis:l}=t,c=o.options,u=c.fill,d=c.backgroundColor,{above:f=d,below:h=d}=u||{},g=i.getDatasetMeta(s),m=Ab(i,g);r&&o.points.length&&(Tc(e,n),Yj(e,{line:o,target:r,above:f,below:h,area:n,scale:a,axis:l,clip:m}),jc(e))}function Yj(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"?(Xy(e,r,o.top),Au(e,{line:n,target:r,color:i,scale:a,property:c,clip:l}),e.restore(),e.save(),Xy(e,r,o.bottom)):c==="y"&&(Jy(e,r,o.left),Au(e,{line:n,target:r,color:s,scale:a,property:c,clip:l}),e.restore(),e.save(),Jy(e,r,o.right),u=i)),Au(e,{line:n,target:r,color:u,scale:a,property:c,clip:l}),e.restore()}function Xy(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],d=i[Lc(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(d.x,n)}e.lineTo(t.first().x,n),e.closePath(),e.clip()}function Jy(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],d=i[Lc(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,d.y)}e.lineTo(n,t.first().y),e.closePath(),e.clip()}function Au(e,t){const{line:n,target:r,property:i,color:s,scale:o,clip:a}=t,l=$j(n,r,i);for(const{source:c,target:u,start:d,end:f}of l){const{style:{backgroundColor:h=s}={}}=c,g=r!==!0;e.save(),e.fillStyle=h,Xj(e,o,a,g&&Ad(i,d,f)),e.beginPath();const m=!!n.pathSegment(e,c);let p;if(g){m?e.closePath():Zy(e,r,f,i);const v=!!r.pathSegment(e,u,{move:m,reverse:!0});p=m&&v,p||Zy(e,r,d,i)}e.closePath(),e.fill(p?"evenodd":"nonzero"),e.restore()}}function Xj(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,d;s==="x"?(l=o,c=i.top,u=a,d=i.bottom):(l=i.left,c=o,u=i.right,d=a),e.beginPath(),n&&(l=Math.max(l,n.left),u=Math.min(u,n.right),c=Math.max(c,n.top),d=Math.min(d,n.bottom)),e.rect(l,c,u-l,d-c),e.clip()}}function Zy(e,t,n,r){const i=t.interpolate(n,r);i&&e.lineTo(i.x,i.y)}var Jj={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 Lr&&(l={visible:e.isDatasetVisible(o),index:o,fill:Ij(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=Lj(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&&Eu(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;Yy(s)&&Eu(e.ctx,s,e.chartArea)}},beforeDatasetDraw(e,t,n){const r=t.meta.$filler;!Yy(r)||n.drawTime!=="beforeDatasetDraw"||Eu(e.ctx,r,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const em=(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)}},Zj=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class tm extends Ni{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=et(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=ft(r.font),s=i.size,o=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=em(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 d=t;s.textAlign="left",s.textBaseline="middle";let f=-1,h=-u;return this.legendItems.forEach((g,m)=>{const p=r+n/2+s.measureText(g.text).width;(m===0||c[c.length-1]+p+2*a>o)&&(d+=u,c[c.length-(m>0?0:1)]=0,h+=u,f++),l[m]={left:0,top:h,row:f,width:p,height:i},c[c.length-1]+=p+a}),d}_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 d=a,f=0,h=0,g=0,m=0;return this.legendItems.forEach((p,v)=>{const{itemWidth:b,itemHeight:w}=eM(r,n,s,p,i);v>0&&h+w+2*a>u&&(d+=f+a,c.push({width:f,height:h}),g+=f+a,m++,f=h=0),l[v]={left:g,top:h,col:m,width:b,height:w},f=Math.max(f,b),h+=w+a}),d+=f,c.push({width:f,height:h}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:r,labels:{padding:i},rtl:s}}=this,o=Zi(s,this.left,this.width);if(this.isHorizontal()){let a=0,l=St(r,this.left+i,this.right-this.lineWidths[a]);for(const c of n)a!==c.row&&(a=c.row,l=St(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=St(r,this.top+t+i,this.bottom-this.columnSizes[a].height);for(const c of n)c.col!==a&&(a=c.col,l=St(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;Tc(t,this),this._draw(),jc(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:r,ctx:i}=this,{align:s,labels:o}=t,a=lt.color,l=Zi(t.rtl,this.left,this.width),c=ft(o.font),{padding:u}=o,d=c.size,f=d/2;let h;this.drawTitle(),i.textAlign=l.textAlign("left"),i.textBaseline="middle",i.lineWidth=.5,i.font=c.string;const{boxWidth:g,boxHeight:m,itemHeight:p}=em(o,d),v=function(k,S,_){if(isNaN(g)||g<=0||isNaN(m)||m<0)return;i.save();const O=Me(_.lineWidth,1);if(i.fillStyle=Me(_.fillStyle,a),i.lineCap=Me(_.lineCap,"butt"),i.lineDashOffset=Me(_.lineDashOffset,0),i.lineJoin=Me(_.lineJoin,"miter"),i.lineWidth=O,i.strokeStyle=Me(_.strokeStyle,a),i.setLineDash(Me(_.lineDash,[])),o.usePointStyle){const E={radius:m*Math.SQRT2/2,pointStyle:_.pointStyle,rotation:_.rotation,borderWidth:O},T=l.xPlus(k,g/2),D=S+f;mb(i,E,T,D,o.pointStyleWidth&&g)}else{const E=S+Math.max((d-m)/2,0),T=l.leftForLtr(k,g),D=Ji(_.borderRadius);i.beginPath(),Object.values(D).some(V=>V!==0)?Jl(i,{x:T,y:E,w:g,h:m,radius:D}):i.rect(T,E,g,m),i.fill(),O!==0&&i.stroke()}i.restore()},b=function(k,S,_){Ti(i,_.text,k,S+p/2,c,{strikethrough:_.hidden,textAlign:l.textAlign(_.textAlign)})},w=this.isHorizontal(),C=this._computeTitleHeight();w?h={x:St(s,this.left+u,this.right-r[0]),y:this.top+u+C,line:0}:h={x:this.left+u,y:St(s,this.top+C+u,this.bottom-n[0].height),line:0},Cb(this.ctx,t.textDirection);const x=p+u;this.legendItems.forEach((k,S)=>{i.strokeStyle=k.fontColor,i.fillStyle=k.fontColor;const _=i.measureText(k.text).width,O=l.textAlign(k.textAlign||(k.textAlign=o.textAlign)),E=g+f+_;let T=h.x,D=h.y;l.setWidth(this.width),w?S>0&&T+E+u>this.right&&(D=h.y+=x,h.line++,T=h.x=St(s,this.left+u,this.right-r[h.line])):S>0&&D+x>this.bottom&&(T=h.x=T+n[h.line].width+u,h.line++,D=h.y=St(s,this.top+C+u,this.bottom-n[h.line].height));const V=l.x(T);if(v(V,D,k),T=QP(O,T+g+f,w?T+E:this.right,t.rtl),b(l.x(T),D,k),w)h.x+=E+u;else if(typeof k.text!="string"){const N=c.lineHeight;h.y+=Kb(k,N)+u}else h.y+=x}),_b(this.ctx,t.textDirection)}drawTitle(){const t=this.options,n=t.title,r=ft(n.font),i=Et(n.padding);if(!n.display)return;const s=Zi(t.rtl,this.left,this.width),o=this.ctx,a=n.position,l=r.size/2,c=i.top+l;let u,d=this.left,f=this.width;if(this.isHorizontal())f=Math.max(...this.lineWidths),u=this.top+c,d=St(t.align,d,this.right-f);else{const g=this.columnSizes.reduce((m,p)=>Math.max(m,p.height),0);u=c+St(t.align,this.top,this.bottom-g-t.labels.padding-this._computeTitleHeight())}const h=St(a,d,d+f);o.textAlign=s.textAlign(Ef(a)),o.textBaseline="middle",o.strokeStyle=n.color,o.fillStyle=n.color,o.font=r.string,Ti(o,n.text,h,u,r)}_computeTitleHeight(){const t=this.options.title,n=ft(t.font),r=Et(t.padding);return t.display?n.lineHeight+r.height:0}_getLegendItemAt(t,n){let r,i,s;if(Xi(t,this.left,this.right)&&Xi(n,this.top,this.bottom)){for(s=this.legendHitBoxes,r=0;r<s.length;++r)if(i=s[r],Xi(t,i.left,i.left+i.width)&&Xi(n,i.top,i.top+i.height))return this.legendItems[r]}return null}handleEvent(t){const n=this.options;if(!rM(t.type,n))return;const r=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const i=this._hoveredItem,s=Zj(i,r);i&&!s&&et(n.onLeave,[t,i,this],this),this._hoveredItem=r,r&&!s&&et(n.onHover,[t,r,this],this)}else r&&et(n.onClick,[t,r,this],this)}}function eM(e,t,n,r,i){const s=tM(r,e,t,n),o=nM(i,r,t.lineHeight);return{itemWidth:s,itemHeight:o}}function tM(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 nM(e,t,n){let r=e;return typeof t.text!="string"&&(r=Kb(t,n)),r}function Kb(e,t){const n=e.text?e.text.length:0;return t*n}function rM(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var iM={id:"legend",_element:tm,start(e,t,n){const r=e.legend=new tm({ctx:e.ctx,options:n,chart:e});cn.configure(e,r,n),cn.addBox(e,r)},stop(e){cn.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const r=e.legend;cn.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 Ub extends Ni{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=st(r.text)?r.text.length:1;this._padding=Et(r.padding);const s=i*ft(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,d;return this.isHorizontal()?(u=St(a,r,s),d=n+t,c=s-r):(o.position==="left"?(u=r+t,d=St(a,i,n),l=ut*-.5):(u=s-t,d=St(a,n,i),l=ut*.5),c=i-n),{titleX:u,titleY:d,maxWidth:c,rotation:l}}draw(){const t=this.ctx,n=this.options;if(!n.display)return;const r=ft(n.font),s=r.lineHeight/2+this._padding.top,{titleX:o,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(s);Ti(t,n.text,0,0,r,{color:n.color,maxWidth:l,rotation:c,textAlign:Ef(n.align),textBaseline:"middle",translation:[o,a]})}}function sM(e,t){const n=new Ub({ctx:e.ctx,options:t,chart:e});cn.configure(e,n,t),cn.addBox(e,n),e.titleBlock=n}var oM={id:"title",_element:Ub,start(e,t,n){sM(e,n)},stop(e){const t=e.titleBlock;cn.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){const r=e.titleBlock;cn.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 Eo={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=Sd(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 $n(e,t){return t&&(st(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function Xn(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(`
|
|
66
66
|
`)>-1?e.split(`
|
|
67
67
|
`):e}function aM(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 nm(e,t){const n=e.chart.ctx,{body:r,footer:i,title:s}=e,{boxWidth:o,boxHeight:a}=t,l=ft(t.bodyFont),c=ft(t.titleFont),u=ft(t.footerFont),d=s.length,f=i.length,h=r.length,g=Et(t.padding);let m=g.height,p=0,v=r.reduce((C,x)=>C+x.before.length+x.lines.length+x.after.length,0);if(v+=e.beforeBody.length+e.afterBody.length,d&&(m+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),v){const C=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;m+=h*C+(v-h)*l.lineHeight+(v-1)*t.bodySpacing}f&&(m+=t.footerMarginTop+f*u.lineHeight+(f-1)*t.footerSpacing);let b=0;const w=function(C){p=Math.max(p,n.measureText(C).width+b)};return n.save(),n.font=c.string,Ge(e.title,w),n.font=l.string,Ge(e.beforeBody.concat(e.afterBody),w),b=t.displayColors?o+2+t.boxPadding:0,Ge(r,C=>{Ge(C.before,w),Ge(C.lines,w),Ge(C.after,w)}),b=0,n.font=u.string,Ge(e.footer,w),n.restore(),p+=g.width,{width:p,height:m}}function lM(e,t){const{y:n,height:r}=t;return n<r/2?"top":n>e.height-r/2?"bottom":"center"}function cM(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 uM(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"),cM(c,e,t,n)&&(c="center"),c}function rm(e,t,n){const r=n.yAlign||t.yAlign||lM(e,n);return{xAlign:n.xAlign||t.xAlign||uM(e,t,n,r),yAlign:r}}function dM(e,t){let{x:n,width:r}=e;return t==="right"?n-=r:t==="center"&&(n-=r/2),n}function fM(e,t,n){let{y:r,height:i}=e;return t==="top"?r+=n:t==="bottom"?r-=i+n:r-=i/2,r}function im(e,t,n,r){const{caretSize:i,caretPadding:s,cornerRadius:o}=e,{xAlign:a,yAlign:l}=n,c=i+s,{topLeft:u,topRight:d,bottomLeft:f,bottomRight:h}=Ji(o);let g=dM(t,a);const m=fM(t,l,c);return l==="center"?a==="left"?g+=c:a==="right"&&(g-=c):a==="left"?g-=Math.max(u,f)+i:a==="right"&&(g+=Math.max(d,h)+i),{x:ln(g,0,r.width-t.width),y:ln(m,0,r.height-t.height)}}function hl(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 sm(e){return $n([],Xn(e))}function hM(e,t,n){return Gr(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function om(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const Wb={beforeTitle:Vn,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:Vn,beforeBody:Vn,beforeLabel:Vn,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 Qe(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:Vn,afterBody:Vn,beforeFooter:Vn,footer:Vn,afterFooter:Vn};function $t(e,t,n,r){const i=e[t].call(n,r);return typeof i=="undefined"?Wb[t].call(n,r):i}class Pd extends Ni{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 Pb(this.chart,i);return i._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=hM(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:r}=n,i=$t(r,"beforeTitle",this,t),s=$t(r,"title",this,t),o=$t(r,"afterTitle",this,t);let a=[];return a=$n(a,Xn(i)),a=$n(a,Xn(s)),a=$n(a,Xn(o)),a}getBeforeBody(t,n){return sm($t(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:r}=n,i=[];return Ge(t,s=>{const o={before:[],lines:[],after:[]},a=om(r,s);$n(o.before,Xn($t(a,"beforeLabel",this,s))),$n(o.lines,$t(a,"label",this,s)),$n(o.after,Xn($t(a,"afterLabel",this,s))),i.push(o)}),i}getAfterBody(t,n){return sm($t(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:r}=n,i=$t(r,"beforeFooter",this,t),s=$t(r,"footer",this,t),o=$t(r,"afterFooter",this,t);let a=[];return a=$n(a,Xn(i)),a=$n(a,Xn(s)),a=$n(a,Xn(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(aM(this.chart,n[l]));return t.filter&&(a=a.filter((u,d,f)=>t.filter(u,d,f,r))),t.itemSort&&(a=a.sort((u,d)=>t.itemSort(u,d,r))),Ge(a,u=>{const d=om(t.callbacks,u);i.push($t(d,"labelColor",this,u)),s.push($t(d,"labelPointStyle",this,u)),o.push($t(d,"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=Eo[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=nm(this,r),c=Object.assign({},a,l),u=rm(this.chart,r,c),d=im(r,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,s={opacity:1,x:d.x,y:d.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:d}=Ji(a),{x:f,y:h}=t,{width:g,height:m}=n;let p,v,b,w,C,x;return s==="center"?(C=h+m/2,i==="left"?(p=f,v=p-o,w=C+o,x=C-o):(p=f+g,v=p+o,w=C-o,x=C+o),b=p):(i==="left"?v=f+Math.max(l,u)+o:i==="right"?v=f+g-Math.max(c,d)-o:v=this.caretX,s==="top"?(w=h,C=w-o,p=v-o,b=v+o):(w=h+m,C=w+o,p=v+o,b=v-o),x=w),{x1:p,x2:v,x3:b,y1:w,y2:C,y3:x}}drawTitle(t,n,r){const i=this.title,s=i.length;let o,a,l;if(s){const c=Zi(r.rtl,this.x,this.width);for(t.x=hl(this,r.titleAlign,r),n.textAlign=c.textAlign(r.titleAlign),n.textBaseline="middle",o=ft(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=ft(s.bodyFont),d=hl(this,"left",s),f=i.x(d),h=l<u.lineHeight?(u.lineHeight-l)/2:0,g=n.y+h;if(s.usePointStyle){const m={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},p=i.leftForLtr(f,c)+c/2,v=g+l/2;t.strokeStyle=s.multiKeyBackground,t.fillStyle=s.multiKeyBackground,_d(t,m,p,v),t.strokeStyle=o.borderColor,t.fillStyle=o.backgroundColor,_d(t,m,p,v)}else{t.lineWidth=Re(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 m=i.leftForLtr(f,c),p=i.leftForLtr(i.xPlus(f,1),c-2),v=Ji(o.borderRadius);Object.values(v).some(b=>b!==0)?(t.beginPath(),t.fillStyle=s.multiKeyBackground,Jl(t,{x:m,y:g,w:c,h:l,radius:v}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),Jl(t,{x:p,y:g+1,w:c-2,h:l-2,radius:v}),t.fill()):(t.fillStyle=s.multiKeyBackground,t.fillRect(m,g,c,l),t.strokeRect(m,g,c,l),t.fillStyle=o.backgroundColor,t.fillRect(p,g+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,d=ft(r.bodyFont);let f=d.lineHeight,h=0;const g=Zi(r.rtl,this.x,this.width),m=function(_){n.fillText(_,g.x(t.x+h),t.y+f/2),t.y+=f+s},p=g.textAlign(o);let v,b,w,C,x,k,S;for(n.textAlign=o,n.textBaseline="middle",n.font=d.string,t.x=hl(this,p,r),n.fillStyle=r.bodyColor,Ge(this.beforeBody,m),h=a&&p!=="right"?o==="center"?c/2+u:c+2+u:0,C=0,k=i.length;C<k;++C){for(v=i[C],b=this.labelTextColors[C],n.fillStyle=b,Ge(v.before,m),w=v.lines,a&&w.length&&(this._drawColorBox(n,t,C,g,r),f=Math.max(d.lineHeight,l)),x=0,S=w.length;x<S;++x)m(w[x]),f=d.lineHeight;Ge(v.after,m)}h=0,f=d.lineHeight,Ge(this.afterBody,m),t.y-=s}drawFooter(t,n,r){const i=this.footer,s=i.length;let o,a;if(s){const l=Zi(r.rtl,this.x,this.width);for(t.x=hl(this,r.footerAlign,r),t.y+=r.footerMarginTop,n.textAlign=l.textAlign(r.footerAlign),n.textBaseline="middle",o=ft(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:d,topRight:f,bottomLeft:h,bottomRight:g}=Ji(i.cornerRadius);n.fillStyle=i.backgroundColor,n.strokeStyle=i.borderColor,n.lineWidth=i.borderWidth,n.beginPath(),n.moveTo(a+d,l),o==="top"&&this.drawCaret(t,n,r,i),n.lineTo(a+c-f,l),n.quadraticCurveTo(a+c,l,a+c,l+f),o==="center"&&s==="right"&&this.drawCaret(t,n,r,i),n.lineTo(a+c,l+u-g),n.quadraticCurveTo(a+c,l+u,a+c-g,l+u),o==="bottom"&&this.drawCaret(t,n,r,i),n.lineTo(a+h,l+u),n.quadraticCurveTo(a,l+u,a,l+u-h),o==="center"&&s==="left"&&this.drawCaret(t,n,r,i),n.lineTo(a,l+d),n.quadraticCurveTo(a,l,a+d,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=Eo[t.position].call(this,this._active,this._eventPosition);if(!o)return;const a=this._size=nm(this,t),l=Object.assign({},o,this._size),c=rm(n,t,l),u=im(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),Cb(t,n.textDirection),s.y+=o.top,this.drawTitle(s,t,n),this.drawBody(s,t,n),this.drawFooter(s,t,n),_b(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=!Vl(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||!Vl(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=Eo[s.position].call(this,t,n);return o!==!1&&(r!==o.x||i!==o.y)}}me(Pd,"positioners",Eo);var gM={id:"tooltip",_element:Pd,positioners:Eo,afterInit(e,t,n){n&&(e.tooltip=new Pd({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:Wb},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:e=>e!=="filter"&&e!=="itemSort"&&e!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const yM=(e,t,n,r)=>(typeof t=="string"?(n=e.push(t)-1,r.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function mM(e,t,n,r){const i=e.indexOf(t);if(i===-1)return yM(e,t,n,r);const s=e.lastIndexOf(t);return i!==s?n:i}const pM=(e,t)=>e===null?null:ln(Math.round(e),0,t);function am(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class Td extends Ws{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(Qe(t))return null;const r=this.getLabels();return n=isFinite(n)&&r[n]===t?n:mM(r,t,Me(n,t),this._addedLabels),pM(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 am.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}}me(Td,"id","category"),me(Td,"defaults",{ticks:{callback:am}});function vM(e,t){const n=[],{bounds:i,step:s,min:o,max:a,precision:l,count:c,maxTicks:u,maxDigits:d,includeBounds:f}=e,h=s||1,g=u-1,{min:m,max:p}=t,v=!Qe(o),b=!Qe(a),w=!Qe(c),C=(p-m)/(d+1);let x=ly((p-m)/g/h)*h,k,S,_,O;if(x<1e-14&&!v&&!b)return[{value:m},{value:p}];O=Math.ceil(p/x)-Math.floor(m/x),O>g&&(x=ly(O*x/g/h)*h),Qe(l)||(k=Math.pow(10,l),x=Math.ceil(x*k)/k),i==="ticks"?(S=Math.floor(m/x)*x,_=Math.ceil(p/x)*x):(S=m,_=p),v&&b&&s&&FP((a-o)/s,x/1e3)?(O=Math.round(Math.min((a-o)/x,u)),x=(a-o)/O,S=o,_=a):w?(S=v?o:S,_=b?a:_,O=c-1,x=(_-S)/O):(O=(_-S)/x,Io(O,Math.round(O),x/1e3)?O=Math.round(O):O=Math.ceil(O));const E=Math.max(cy(x),cy(S));k=Math.pow(10,Qe(l)?E:l),S=Math.round(S*k)/k,_=Math.round(_*k)/k;let T=0;for(v&&(f&&S!==o?(n.push({value:o}),S<o&&T++,Io(Math.round((S+T*x)*k)/k,o,lm(o,C,e))&&T++):S<o&&T++);T<O;++T){const D=Math.round((S+T*x)*k)/k;if(b&&D>a)break;n.push({value:D})}return b&&f&&_!==a?n.length&&Io(n[n.length-1].value,a,lm(a,C,e))?n[n.length-1].value=a:n.push({value:a}):(!b||_===a)&&n.push({value:_}),n}function lm(e,t,{horizontal:n,minRotation:r}){const i=Dr(r),s=(n?Math.sin(i):Math.cos(i))||.001,o=.75*t*(""+e).length;return Math.min(t/s,o)}class jd extends Ws{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 Qe(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=$s(i),c=$s(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=vM(i,s);return t.bounds==="ticks"&&BP(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 yb(t,this.chart.options.locale,this.options.ticks.format)}}class Md extends jd{determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=yt(t)?t:0,this.max=yt(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,r=Dr(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}}me(Md,"id","linear"),me(Md,"defaults",{ticks:{callback:Pf.formatters.numeric}});function $d(e){const t=e.ticks;if(t.display&&e.display){const n=Et(t.backdropPadding);return Me(t.font&&t.font.size,lt.font.size)+n.height}return 0}function bM(e,t,n){return n=st(n)?n:[n],{w:lT(e,t.string,n),h:n.length*t.lineHeight}}function cm(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 xM(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?ut/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),d=ft(c.font),f=bM(e.ctx,d,e._pointLabels[l]);r[l]=f;const h=Gt(e.getIndexAngle(l)+a),g=Math.round(kf(h)),m=cm(g,u.x,f.w,0,180),p=cm(g,u.y,f.h,90,270);wM(n,t,h,m,p)}e.setCenterPoint(t.l-n.l,n.r-t.r,t.t-n.t,n.b-t.b),e._pointLabelItems=_M(e,r,i)}function wM(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 SM(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(kf(Gt(l.angle+Xt))),u=EM(l.y,a.h,c),d=kM(c),f=OM(l.x,a.w,d);return{visible:!0,x:l.x,y:u,textAlign:d,left:f,top:u,right:f+a.w,bottom:u+a.h}}function CM(e,t){if(!t)return!0;const{left:n,top:r,right:i,bottom:s}=e;return!(ir({x:n,y:r},t)||ir({x:n,y:s},t)||ir({x:i,y:r},t)||ir({x:i,y:s},t))}function _M(e,t,n){const r=[],i=e._pointLabels.length,s=e.options,{centerPointLabels:o,display:a}=s.pointLabels,l={extra:$d(s)/2,additionalAngle:o?ut/i:0};let c;for(let u=0;u<i;u++){l.padding=n[u],l.size=t[u];const d=SM(e,u,l);r.push(d),a==="auto"&&(d.visible=CM(d,c),d.visible&&(c=d))}return r}function kM(e){return e===0||e===180?"center":e<180?"left":"right"}function OM(e,t,n){return n==="right"?e-=t:n==="center"&&(e-=t/2),e}function EM(e,t,n){return n===90||n===270?e-=t/2:(n>270||n<90)&&(e-=t),e}function AM(e,t,n){const{left:r,top:i,right:s,bottom:o}=n,{backdropColor:a}=t;if(!Qe(a)){const l=Ji(t.borderRadius),c=Et(t.backdropPadding);e.fillStyle=a;const u=r-c.left,d=i-c.top,f=s-r+c.width,h=o-i+c.height;Object.values(l).some(g=>g!==0)?(e.beginPath(),Jl(e,{x:u,y:d,w:f,h,radius:l}),e.fill()):e.fillRect(u,d,f,h)}}function PM(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));AM(n,o,s);const a=ft(o.font),{x:l,y:c,textAlign:u}=s;Ti(n,e._pointLabels[i],l,c+a.lineHeight/2,a,{color:o.color,textAlign:u,textBaseline:"middle"})}}function Vb(e,t,n,r){const{ctx:i}=e;if(n)i.arc(e.xCenter,e.yCenter,t,0,Jt);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 TM(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(),Vb(e,n,o,r),s.closePath(),s.stroke(),s.restore())}function jM(e,t,n){return Gr(e,{label:n,index:t,type:"pointLabel"})}class Ao extends jd{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($d(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=yt(t)&&!isNaN(t)?t:0,this.max=yt(n)&&!isNaN(n)?n:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/$d(this.options))}generateTickLabels(t){jd.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((n,r)=>{const i=et(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?xM(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=Jt/(this._pointLabels.length||1),r=this.options.startAngle||0;return Gt(t*n+Dr(r))}getDistanceFromCenterForValue(t){if(Qe(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(Qe(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 jM(this.getContext(),t,r)}}getPointPosition(t,n,r=0){const i=this.getIndexAngle(t)-Xt+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(),Vb(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&&PM(this,o),i.display&&this.ticks.forEach((u,d)=>{if(d!==0||d===0&&this.min<0){l=this.getDistanceFromCenterForValue(u.value);const f=this.getContext(d),h=i.setContext(f),g=s.setContext(f);TM(this,h,l,o,g)}}),r.display){for(t.save(),a=o-1;a>=0;a--){const u=r.setContext(this.getPointLabelContext(a)),{color:d,lineWidth:f}=u;!f||!d||(t.lineWidth=f,t.strokeStyle=d,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=ft(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 d=Et(c.backdropPadding);t.fillRect(-o/2-d.left,-s-u.size/2-d.top,o+d.width,u.size+d.height)}Ti(t,a.label,0,-s,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}me(Ao,"id","radialLinear"),me(Ao,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Pf.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),me(Ao,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),me(Ao,"descriptors",{angleLines:{_fallback:"grid"}});const Ic={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}},Rt=Object.keys(Ic);function um(e,t){return e-t}function dm(e,t){if(Qe(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)),yt(o)||(o=typeof r=="string"?n.parse(o,r):n.parse(o)),o===null?null:(i&&(o=i==="week"&&(ia(s)||s===!0)?n.startOf(o,"isoWeek",s):n.startOf(o,i)),+o)}function fm(e,t,n,r){const i=Rt.length;for(let s=Rt.indexOf(e);s<i-1;++s){const o=Ic[Rt[s]],a=o.steps?o.steps:Number.MAX_SAFE_INTEGER;if(o.common&&Math.ceil((n-t)/(a*o.size))<=r)return Rt[s]}return Rt[i-1]}function MM(e,t,n,r,i){for(let s=Rt.length-1;s>=Rt.indexOf(n);s--){const o=Rt[s];if(Ic[o].common&&e._adapter.diff(i,r,o)>=t-1)return o}return Rt[n?Rt.indexOf(n):0]}function $M(e){for(let t=Rt.indexOf(e)+1,n=Rt.length;t<n;++t)if(Ic[Rt[t]].common)return Rt[t]}function hm(e,t,n){if(!n)e[t]=!0;else if(n.length){const{lo:r,hi:i}=Of(n,t),s=n[r]>=t?n[r]:n[i];e[s]=!0}}function DM(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 gm(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:DM(e,r,i,n)}class tc extends Ws{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 y5._date(t.adapters.date);i.init(n),Lo(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:dm(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=yt(i)&&!isNaN(i)?i:+n.startOf(Date.now(),r),s=yt(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=UP(i,s,o);return this._unit=n.unit||(r.autoSkip?fm(n.minUnit,this.min,this.max,this._getLabelCapacity(s)):MM(this,a.length,n.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:$M(this._unit),this.initOffsets(i),t.reverse&&a.reverse(),gm(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=ln(n,0,o),r=ln(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||fm(s.minUnit,n,r,this._getLabelCapacity(n)),a=Me(i.ticks.stepSize,1),l=o==="week"?s.isoWeekday:!1,c=ia(l)||l===!0,u={};let d=n,f,h;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,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 g=i.ticks.source==="data"&&this.getDataTimestamps();for(f=d,h=0;f<r;f=+t.add(f,a,o),h++)hm(u,f,g);return(f===r||i.bounds==="ticks"||h===1)&&hm(u,f,g),Object.keys(u).sort(um).map(m=>+m)}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 et(o,[t,n,r],this);const a=s.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&a[l],d=c&&a[c],f=r[n],h=c&&d&&f&&f.major;return this._adapter.format(t,i||(h?d: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=Dr(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,gm(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(dm(this,i[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return VP(t.sort(um))}}me(tc,"id","time"),me(tc,"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 gl(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}=ui(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}=ui(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 ym extends tc{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=gl(n,this.min),this._tableRange=gl(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(gl(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return gl(this._table,r*this._tableRange+this._minPos,!0)}}me(ym,"id","timeseries"),me(ym,"defaults",tc.defaults);const Gb="label";function mm(e,t){typeof e=="function"?e(t):e&&(e.current=t)}function LM(e,t){const n=e.options;n&&t&&Object.assign(n,t)}function Qb(e,t){e.labels=t}function Yb(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Gb;const r=[];e.datasets=t.map(i=>{const s=e.datasets.find(o=>o[n]===i[n]);return!s||!i.data||r.includes(s)?{...i}:(r.push(s),Object.assign(s,i),s)})}function IM(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Gb;const n={labels:[],datasets:[]};return Qb(n,e.labels),Yb(n,e.datasets,t),n}function RM(e,t){const{height:n=150,width:r=300,redraw:i=!1,datasetIdKey:s,type:o,data:a,options:l,plugins:c=[],fallbackContent:u,updateMode:d,...f}=e,h=q.useRef(null),g=q.useRef(null),m=()=>{h.current&&(g.current=new Dc(h.current,{type:o,data:IM(a,s),options:l&&{...l},plugins:c}),mm(t,g.current))},p=()=>{mm(t,null),g.current&&(g.current.destroy(),g.current=null)};return q.useEffect(()=>{!i&&g.current&&l&&LM(g.current,l)},[i,l]),q.useEffect(()=>{!i&&g.current&&Qb(g.current.config.data,a.labels)},[i,a.labels]),q.useEffect(()=>{!i&&g.current&&a.datasets&&Yb(g.current.config.data,a.datasets,s)},[i,a.datasets]),q.useEffect(()=>{g.current&&(i?(p(),setTimeout(m)):g.current.update(d))},[i,l,a.labels,a.datasets,d]),q.useEffect(()=>{g.current&&(p(),setTimeout(m))},[o]),q.useEffect(()=>(m(),()=>p()),[]),q.createElement("canvas",{ref:h,role:"img",height:n,width:r,...f},u)}const NM=q.forwardRef(RM);function Xb(e,t){return Dc.register(t),q.forwardRef((n,r)=>q.createElement(NM,{...n,ref:r,type:e}))}const FM=Xb("line",Al),BM=Xb("radar",Pl);Dc.register(Td,Md,Ao,Lr,Ml,Jj,oM,gM,iM);var Dd={elements:{line:{backgroundColor:"rgba(166, 30, 105, 0.2)",borderColor:"rgba(166, 30, 105, 1)",borderWidth:4},point:{backgroundColor:"rgba(166, 30, 105, 1)",borderColor:"rgba(255,255,255, .9)",borderWidth:2,radius:5,hoverRadius:6,hoverBorderWidth:3}},responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!1},tooltip:{mode:"index",intersect:!1}},interaction:{mode:"nearest",axis:"x",intersect:!1}},qM=function(t){var n=t.chart.ctx,r=t.chart.chartArea;if(!r)return"rgba(166, 30, 105, 0.1)";var i=(r.left+r.right)/2,s=(r.top+r.bottom)/2,o=Math.min((r.right-r.left)/2,(r.bottom-r.top)/2),a=n.createRadialGradient(i,s,0,i,s,o);return a.addColorStop(0,"rgba(255, 255, 255, 0.4)"),a.addColorStop(.3,"rgba(255, 255, 255, 0.4)"),a.addColorStop(1,"rgba(166, 30, 105, 0.2)"),a};function pm(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function vm(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?pm(Object(n),!0).forEach(function(r){zM(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pm(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function zM(e,t,n){return(t=HM(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function HM(e){var t=KM(e,"string");return Is(t)=="symbol"?t:t+""}function KM(e,t){if(Is(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Is(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Is(e){"@babel/helpers - typeof";return Is=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Is(e)}function UM(e){var t=new Date(e);return isNaN(t.getTime())?String(e):t.toLocaleString("en-US",{month:"short",day:"numeric"})}var WM=function(){var t,n,r,i,s=Us(),o=s.data,a=s.isLoading,l=s.isRefetching,c=o==null?void 0:o.mentions,u=c==null||(t=c.mentionedInNumberOfQueries)===null||t===void 0||(t=t.previous)===null||t===void 0?void 0:t.difference,d=c==null?void 0:c.chart,f=Array.isArray(d==null?void 0:d.labels)?d.labels:d!=null&&d.labels&&Is(d.labels)==="object"?Object.values(d.labels):[],h=f.map(function(v){return UM(String(v))}),g=o==null?void 0:o.numberOfQueries;if(!g){var m=0;Array.isArray(d==null?void 0:d.datasets)&&d.datasets.forEach(function(v){Array.isArray(v==null?void 0:v.data)&&v.data.forEach(function(b){typeof b=="number"&&b>m&&(m=b)})}),g=m+2}var p=vm(vm({},Dd),{},{responsive:!0,maintainAspectRatio:!1,scales:{x:{display:!0,title:{display:!1,text:"Date"},grid:{display:!1}},y:{display:!0,title:{display:!1,text:"Number of Mentions"},beginAtZero:!0,max:g,ticks:{stepSize:1}}}});return y.jsx(A.Card,{className:"yst-overflow-visible",children:y.jsxs(A.Card.Content,{className:"yst-space-y-4",children:[y.jsxs("div",{className:"yst-space-y-2",children:[y.jsx($a,{title:"Mentions progress",tooltip:"Tracks how your brand mentions have changed over time across the same query set."}),y.jsx(Ma,{score:c==null||(n=c.mentionedInNumberOfQueries)===null||n===void 0?void 0:n.value,total:o==null?void 0:o.numberOfQueries,delta:u,deltaSuffix:"since last scan",suffix:"queries",isLoading:a||l})]}),Array.isArray(d==null||(r=d.datasets)===null||r===void 0?void 0:r.data)&&(d==null||(i=d.datasets)===null||i===void 0?void 0:i.data.length)<2?y.jsx(A.Alert,{variant:"info",children:"Needs multiple analyses before info can be shown."}):y.jsx("div",{className:"yst-h-72",children:y.jsx(FM,{data:function(){var v={labels:h,datasets:[d==null?void 0:d.datasets]};return v}(),options:p})})]})})};function yl(e){var t=e.value,n=t===void 0?"—":t,r=e.label,i=e.tooltip,s=e.className,o=e.borderBottom,a=o===void 0?!1:o,l=e.borderRight,c=l===void 0?!1:l,u=e.delta,d=e.tooltipPosition,f=d===void 0?"left":d;return y.jsxs("div",{className:Ce("yst-relative yst-flex yst-flex-col yst-items-center yst-gap-1 yst-p-4 yst-text-center",a&&"yst-border-b yst-border-slate-200",c&&"yst-border-r yst-border-slate-200",s),children:[y.jsx("p",{className:"yst-text-2xl yst-font-bold yst-text-slate-900",children:n}),y.jsx("p",{className:"yst-text-tiny yst-text-slate-600",children:r}),typeof u=="number"&&y.jsxs("p",{className:Ce("yst-flex yst-items-center yst-gap-1 yst-text-tiny yst-font-bold",Yo(u)),children:[u>0?y.jsx(Qv,{}):u<0?y.jsx(Gv,{}):null,u>-1e-6&&"+",u]}),i&&y.jsx(vf,{id:"tooltip-".concat(r.replace(/\s+/g,"-").toLowerCase()),className:"yst-absolute yst-right-2 yst-top-2",position:f,children:i})]})}function VM(e){var t=e.children,n=e.className;return y.jsx("div",{className:Ce("yst-grid yst-w-full yst-grid-cols-2 yst-gap-0 yst-rounded-lg",n),children:t})}function GM(e){return e>0?"yst-text-green-600":e<0?"yst-text-red-600":"yst-text-slate-500"}function QM(e){var t=e.current,n=e.previous,r=e.className;if(typeof n!="number")return null;var i=t-n,s=i>0,o=i<0,a="".concat(i>0?"+":"").concat(i.toFixed(1),"%");return y.jsxs("div",{className:Ce("yst-flex yst-items-center yst-gap-1 yst-text-tiny yst-font-bold",GM(i),r),"aria-label":s?"Visibility increased by ".concat(a):o?"Visibility decreased by ".concat(a):"No change in visibility",children:[s&&y.jsx(Qv,{className:"yst-w-4 yst-h-4"}),o&&y.jsx(Gv,{className:"yst-w-4 yst-h-4"}),a]})}function oa(e){"@babel/helpers - typeof";return oa=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},oa(e)}function YM(e,t){return e$(e)||ZM(e,t)||JM(e,t)||XM()}function XM(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
68
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function JM(e,t){if(e){if(typeof e=="string")return bm(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?bm(e,t):void 0}}function bm(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ZM(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,o,a=[],l=!0,c=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(l=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(u){c=!0,i=u}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw i}}return a}}function e$(e){if(Array.isArray(e))return e}function xm(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ml(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?xm(Object(n),!0).forEach(function(r){t$(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xm(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function t$(e,t,n){return(t=n$(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function n$(e){var t=r$(e,"string");return oa(t)=="symbol"?t:t+""}function r$(e,t){if(oa(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(oa(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function i$(){var e,t,n,r,i,s,o,a,l,c,u,d,f,h,g,m,p,v,b,w,C,x,k,S,_=En(),O=_.brandId,E=_.analysisId,T=_c(O,E,{query:{select:function(qe){var Y=qe.data;return Y},enabled:!!O&&!!E}}),D=T.data,V=T.isLoading,N=D==null||(e=D.analysis)===null||e===void 0?void 0:e.scans,$=Array.isArray(N)&&N.length>0?N.reduce(function(_e,qe){if(!_e)return qe;if(!(qe!=null&&qe.finishedAt)||!(_e!=null&&_e.finishedAt))return _e;var Y=new Date(qe.finishedAt),Pe=new Date(_e.finishedAt);return Y>Pe?qe:_e},void 0):void 0,L=$==null||(t=$.scores)===null||t===void 0?void 0:t.standardized,I=(n=$==null||(r=$.mentions)===null||r===void 0||(r=r.mentionedInNumberOfQueries)===null||r===void 0?void 0:r.value)!==null&&n!==void 0?n:0,oe=$==null||(i=$.mentions)===null||i===void 0||(i=i.mentionedInNumberOfQueries)===null||i===void 0||(i=i.previous)===null||i===void 0?void 0:i.difference,ue=(s=$==null||(o=$.scores)===null||o===void 0||(o=o.standardized)===null||o===void 0||(o=o.citations)===null||o===void 0?void 0:o.value)!==null&&s!==void 0?s:0,B=(a=$==null||(l=$.citations)===null||l===void 0||(l=l.total)===null||l===void 0?void 0:l.value)!==null&&a!==void 0?a:0,J=$==null||(c=$.citations)===null||c===void 0||(c=c.total)===null||c===void 0||(c=c.previous)===null||c===void 0?void 0:c.difference,ne=$==null||(u=$.rankings)===null||u===void 0||(u=u.list)===null||u===void 0?void 0:u.find(function(_e){var qe;return((qe=_e.brand)===null||qe===void 0?void 0:qe.isSelf)===!0}),ae=(d=ne==null||(f=ne.rank)===null||f===void 0?void 0:f.value)!==null&&d!==void 0?d:"—",R=ne==null||(h=ne.rank)===null||h===void 0||(h=h.previous)===null||h===void 0?void 0:h.difference;R&&(R=R*-1);var G=(g=L==null||(m=L.visibility)===null||m===void 0?void 0:m.value)!==null&&g!==void 0?g:0,z=L==null||(p=L.visibility)===null||p===void 0||(p=p.previous)===null||p===void 0?void 0:p.value,ce=(v=L==null||(b=L.ranking)===null||b===void 0?void 0:b.value)!==null&&v!==void 0?v:0,K=(w=L==null||(C=L.sentiment)===null||C===void 0?void 0:C.value)!==null&&w!==void 0?w:0,de=(x=L==null||(k=L.mentions)===null||k===void 0?void 0:k.value)!==null&&x!==void 0?x:0,fe={labels:["Mentions","Ranking","Citations","Sentiment"],datasets:[{data:[de,ce,ue,K],backgroundColor:qM,pointBackgroundColor:"rgba(166, 30, 105, 1)"}]},Ie=ml(ml({},Dd),{},{plugins:ml(ml({},Dd.plugins),{},{tooltip:{mode:"point",intersect:!0,callbacks:{label:function(qe){var Y=qe.label||"",Pe=qe.parsed.r||0;return"".concat(Y,": ").concat(Pe,"%")}}}}),interaction:{mode:"point",intersect:!0},scales:{r:{beginAtZero:!0,min:0,max:100,ticks:{stepSize:20}}}}),te=q.useState(typeof window!="undefined"&&window.innerWidth<800?"top":"left"),Je=YM(te,2),ke=Je[0],Ne=Je[1];return q.useEffect(function(){function _e(){Ne(window.innerWidth<800?"top":"left")}return window.addEventListener("resize",_e),function(){return window.removeEventListener("resize",_e)}},[]),y.jsx(A.Card,{className:"yst-overflow-visible md:yst-col-span-2",children:y.jsxs(A.Card.Content,{children:[y.jsx(A.Title,{size:"3",className:"yst-mb-2",children:"AI visibility score"}),y.jsx(Ma,{score:G,total:100,isLoading:V}),y.jsx(QM,{current:G,previous:z,className:"yst-mb-4"}),y.jsxs("div",{className:"yst-flex yst-flex-col yst-items-center yst-justify-around yst-justify-items-center yst-gap-8 md:yst-flex-row",children:[y.jsxs("div",{className:"yst-radar-chart-container yst-relative yst-aspect-square yst-h-full yst-w-full md:yst-flex md:yst-w-1/2 md:yst-items-center md:yst-justify-center",children:[y.jsx(BM,{data:fe,options:Ie}),y.jsx(vf,{id:"tooltip-radar-chart",className:"yst-absolute yst-right-2 yst-top-2",placement:"left",children:"The AI Visibility Index (AIVI) shows how visible your brand is across major AI platforms like ChatGPT, based on mentions, citations, sentiment, and rankings."})]}),y.jsx("div",{className:"yst-mt-6 yst-w-full md:yst-mt-0 md:yst-flex md:yst-w-1/2 md:yst-items-center",children:y.jsxs(VM,{children:[y.jsx(yl,{value:I,label:"Mentions",tooltip:"Mentions show how often your brand appears in AI-generated answers to the questions we send to LLMs.",borderBottom:!0,borderRight:!0,delta:oe,tooltipPosition:ke}),y.jsx(yl,{value:ae&&y.jsxs(y.Fragment,{children:[ae,ae===1&&" 🏆"]}),label:"Competitor ranking",tooltip:"Ranking shows the position your brand is mentioned in AI-generated answers—whether in a numbered list or the order of appearance in full-text responses.",borderBottom:!0,delta:R}),y.jsx(yl,{value:B,label:"Citations",tooltip:"Citations are the source links found in AI-generated answers. They form the basis for mentions, sentiment, and ranking insights.",borderRight:!0,delta:J,tooltipPosition:ke}),y.jsx(yl,{value:K?"".concat(K,"%"):"—",label:"Positive sentiment",tooltip:"Sentiment reflects how positively, neutrally, or negatively your brand is mentioned in AI-generated answers, based on the cited sources.",delta:$==null||(S=$.scores)===null||S===void 0||(S=S.standardized)===null||S===void 0||(S=S.sentiment)===null||S===void 0||(S=S.previous)===null||S===void 0?void 0:S.difference})]})})]})]})})}var Pu=function(){var t=En(),n=t.brandId,r=t.analysisId,i=Ri({query:{select:function(S){var _=S.data;return _==null?void 0:_.brands}}}),s=i.data,o=i.isLoading,a=Bv(n,{query:{enabled:!!n,select:function(S){var _=S.data;return _}}}),l=a.data,c=a.isLoading,u=_c(n,r,{query:{enabled:!!n&&!!r&&r!=="latest"&&typeof r=="string"&&r.length>0,select:function(S){var _=S.data;return _==null?void 0:_.analysis}}}),d=u.data,f=u.isLoading,h=(l==null?void 0:l.name)||"your brand",g=uE(l==null?void 0:l.nextScheduledAnalysis),m=d==null?void 0:d.status,p=function(){switch(m){case Jr.pending:return{alertContent:y.jsxs("div",{className:"yst-max-w-xl yst-space-y-2",children:[y.jsx("p",{className:"yst-font-medium",children:"Your analysis is scheduled"}),y.jsxs("p",{children:["You've completed the setup for"," ",y.jsx("b",{className:"yst-font-medium",children:h}),". The analysis is scheduled to run on"," ",y.jsx("b",{className:"yst-font-medium",children:g}),". You'll see the results here once it's ready, and we'll also notify you by email."]})]}),alertVariant:"info"};case Jr.processing:return{alertContent:y.jsxs(y.Fragment,{children:["You've completed the setup for ",h,". The analysis is now processing. You'll see the results here once it's ready, and we'll also notify you by email."]}),alertVariant:"info"};case Jr.failed:return{alertContent:y.jsx(y.Fragment,{children:"Analysis failed. Try restarting the analysis or contact support if the issue persists."}),alertVariant:"danger"};case Jr.cancelled:return{alertContent:y.jsx(y.Fragment,{children:"Analysis was cancelled. You can restart the analysis when ready."}),alertVariant:"warning"};case Jr.completed:return{alertContent:null};default:return{alertContent:null,alertVariant:"info"}}}(),v=p.alertContent,b=p.alertVariant,w=o||c||f,C=s&&(s==null?void 0:s.length)>0,x=!w&&d&&m===Jr.completed;return w?y.jsx("div",{className:"yst-flex yst-min-h-screen yst-items-center yst-justify-center",children:y.jsxs("div",{className:"yst-flex yst-items-center yst-gap-3 yst-text-center",children:[y.jsx(A.Spinner,{variant:"primary"}),y.jsx("span",{className:"yst-italic",children:"Just a moment while we get things ready for you..."})]})}):C?y.jsxs("div",{className:"yst-space-y-8",children:[y.jsx(iP,{}),m!==Jr.completed&&v&&y.jsx(A.Alert,{className:"md:yst-col-span-2",variant:b,children:v}),x&&y.jsxs("div",{className:"yst-space-y-4",children:[y.jsxs("div",{className:"yst-flex yst-items-center yst-justify-between",children:[y.jsx(A.Title,{size:"2",children:"Your brand analysis"}),y.jsxs(A.Button,{as:Wr,variant:"secondary",to:"/brands/".concat(n,"/brand-list"),className:Ce("yst-gap-1.5"),disabled:!n,children:[y.jsx(Kv,{})," Edit brand list"]})]}),y.jsxs("div",{className:"yst-grid yst-grid-cols-1 yst-gap-4 md:yst-grid-cols-2",children:[y.jsx(i$,{}),y.jsx(sP,{}),y.jsx(WM,{}),y.jsx(mA,{}),y.jsx(uA,{}),y.jsx(QE,{}),y.jsx(pA,{})]})]})]}):y.jsx($E,{})};function Jb(e){var t=e.children,n=e.description,r=e.title;return y.jsxs(A.Card.Header,{className:"yst-h-auto yst-flex-col yst-items-start yst-gap-0 yst-border-b-[1px] yst-border-b-slate-200 yst-bg-white yst-py-8",children:[r&&y.jsx(A.Title,{className:Ce({"yst-mb-3":n||t}),children:r}),n&&y.jsx("p",{children:n}),t]})}var s$=function(){return y.jsx(A.Card,{className:"yst-mb-4",children:y.jsxs(A.Card.Content,{className:"yst-flex yst-flex-col yst-gap-8",children:[y.jsx(A.Title,{size:"2",children:"Query - Best fish restaurant in Nijmegen"}),y.jsxs("div",{children:[y.jsx("p",{children:"AI Response:"}),y.jsx(A.Link,{href:"#todo",children:"Show more"})]}),y.jsxs("div",{children:[y.jsx("p",{children:"Extracted brands:"}),y.jsx(A.Badge,{children:"Example"}),y.jsx(A.Badge,{children:"Example"}),y.jsx(A.Badge,{children:"Example"}),y.jsx(A.Badge,{children:"Example"}),y.jsx(A.Badge,{children:"Example"})]}),y.jsxs(A.Table,{children:[y.jsx(A.Table.Head,{children:y.jsxs(A.Table.Row,{children:[y.jsx(A.Table.Header,{children:"URL"}),y.jsx(A.Table.Header,{children:"Associated brand"})]})}),y.jsxs(A.Table.Body,{children:[y.jsxs(A.Table.Row,{children:[y.jsx(A.Table.Cell,{children:y.jsx(A.Link,{href:"https://example.com",target:"_blank",children:"https://example.com"})}),y.jsx(A.Table.Cell,{children:"Example Brand"})]}),y.jsxs(A.Table.Row,{children:[y.jsx(A.Table.Cell,{children:y.jsx(A.Link,{href:"https://example2.com",target:"_blank",children:"https://example2.com"})}),y.jsx(A.Table.Cell,{children:"Example Brand 2"})]})]})]})]})})},o$=function(){return y.jsxs(A.Card,{children:[y.jsx(Jb,{title:"Query history"}),y.jsx(A.Card,{className:"yst-mb-4",children:y.jsxs(A.Card.Content,{children:[y.jsxs("p",{className:"yst-mb-8",children:["Manna Fish Restaurant - Analysis performed on:"," ",y.jsx(A.Badge,{children:"2025-04-08 12:31:21"})]}),[0,1,2,3,4].map(function(t){return y.jsx(s$,{},t)})]})})]})},a$=q.lazy(function(){return Promise.resolve().then(()=>mR)}),l$=q.lazy(function(){return Promise.resolve().then(()=>HR)}),c$=q.lazy(function(){return Promise.resolve().then(()=>WR)}),u$=q.lazy(function(){return Promise.resolve().then(()=>sN)}),d$=q.lazy(function(){return Promise.resolve().then(()=>wN)}),f$=q.lazy(function(){return Promise.resolve().then(()=>EN)}),h$=new j2({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:!1,staleTime:1e3*60*5},mutations:{retry:!1}}}),ni=function(){return y.jsx("div",{className:"yst-flex yst-min-h-[200px] yst-items-center yst-justify-center",children:y.jsxs("div",{className:"yst-w-full yst-max-w-md yst-space-y-3",children:[y.jsx(A.SkeletonLoader,{className:"yst-h-8 yst-w-3/4"}),y.jsx(A.SkeletonLoader,{className:"yst-h-6 yst-w-full"}),y.jsx(A.SkeletonLoader,{className:"yst-h-6 yst-w-2/3"})]})})},g$=function(t){var n=t.hideNav,r=n===void 0?!1:n,i=t.disableLayout,s=i===void 0?!1:i,o=t.DebugInfo;return y.jsx(Rw,{children:y.jsxs(xt,{element:y.jsx(oE,{hideNav:r,disableLayout:s,DebugInfo:o}),children:[y.jsxs(xt,{path:"/",element:y.jsx(Ts,{}),children:[y.jsx(xt,{index:!0,element:y.jsx(Pu,{})}),y.jsxs(xt,{path:"brands/:brandId",element:y.jsx(mg,{}),children:[y.jsx(xt,{index:!0,element:y.jsx(Pu,{})}),y.jsx(xt,{path:"brand-list",element:y.jsx(q.Suspense,{fallback:y.jsx(ni,{}),children:y.jsx(a$,{})})}),y.jsx(xt,{path:"analysis/:analysisId",element:y.jsx(aE,{}),children:y.jsx(xt,{index:!0,element:y.jsx(Pu,{})})})]}),y.jsxs(xt,{path:"/setup",element:y.jsx(q.Suspense,{fallback:y.jsx(ni,{}),children:y.jsx(c$,{})}),children:[y.jsx(xt,{index:!0,element:y.jsx(q.Suspense,{fallback:y.jsx(ni,{}),children:y.jsx(u$,{})})}),y.jsxs(xt,{path:":brandId",element:y.jsx(mg,{}),children:[y.jsx(xt,{path:"queries",element:y.jsx(q.Suspense,{fallback:y.jsx(ni,{}),children:y.jsx(d$,{})})}),y.jsx(xt,{path:"analysis",element:y.jsx(q.Suspense,{fallback:y.jsx(ni,{}),children:y.jsx(f$,{})})})]})]})]}),y.jsx(xt,{path:"/settings",element:y.jsx(q.Suspense,{fallback:y.jsx(ni,{}),children:y.jsx(l$,{})})}),y.jsx(xt,{path:"/query-history",element:y.jsx(q.Suspense,{fallback:y.jsx(ni,{}),children:y.jsx(o$,{})})})]})})},y$=function(t){var n=t.DebugInfo,r=t.hostAppProps;return y.jsxs(I2,{client:h$,children:[y.jsx(uO,{hostAppProps:r,children:y.jsx(g$,{DebugInfo:n})}),y.jsx(CC,{initialIsOpen:!1})]})};function m$(e){var t=e.subpath,n=t===void 0?"/":t,r=e.onNavigate,i=gn(),s=Bt(),o=q.useRef(n),a=q.useRef(null),l=q.useRef(!1),c="".concat(s.pathname).concat(s.search).concat(s.hash),u=q.useCallback(r,[r]);return q.useEffect(function(){if(n===c){o.current=n;return}l.current||n!==o.current&&(o.current=n,a.current=n,l.current=!0,i(n,{replace:!0}),setTimeout(function(){l.current=!1},10))},[n,c,i]),q.useEffect(function(){l.current||c!==n&&c!==a.current&&(a.current=c,u(c))},[c,n,u]),null}function p$(e,t){return w$(e)||x$(e,t)||b$(e,t)||v$()}function v$(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
68
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function JM(e,t){if(e){if(typeof e=="string")return bm(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?bm(e,t):void 0}}function bm(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ZM(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,o,a=[],l=!0,c=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(l=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(u){c=!0,i=u}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw i}}return a}}function e$(e){if(Array.isArray(e))return e}function xm(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ml(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?xm(Object(n),!0).forEach(function(r){t$(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xm(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function t$(e,t,n){return(t=n$(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function n$(e){var t=r$(e,"string");return oa(t)=="symbol"?t:t+""}function r$(e,t){if(oa(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(oa(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function i$(){var e,t,n,r,i,s,o,a,l,c,u,d,f,h,g,m,p,v,b,w,C,x,k,S,_=En(),O=_.brandId,E=_.analysisId,T=_c(O,E,{query:{select:function(qe){var Y=qe.data;return Y},enabled:!!O&&!!E}}),D=T.data,V=T.isLoading,N=D==null||(e=D.analysis)===null||e===void 0?void 0:e.scans,$=Array.isArray(N)&&N.length>0?N.reduce(function(_e,qe){if(!_e)return qe;if(!(qe!=null&&qe.finishedAt)||!(_e!=null&&_e.finishedAt))return _e;var Y=new Date(qe.finishedAt),Pe=new Date(_e.finishedAt);return Y>Pe?qe:_e},void 0):void 0,L=$==null||(t=$.scores)===null||t===void 0?void 0:t.standardized,I=(n=$==null||(r=$.mentions)===null||r===void 0||(r=r.mentionedInNumberOfQueries)===null||r===void 0?void 0:r.value)!==null&&n!==void 0?n:0,oe=$==null||(i=$.mentions)===null||i===void 0||(i=i.mentionedInNumberOfQueries)===null||i===void 0||(i=i.previous)===null||i===void 0?void 0:i.difference,ue=(s=$==null||(o=$.scores)===null||o===void 0||(o=o.standardized)===null||o===void 0||(o=o.citations)===null||o===void 0?void 0:o.value)!==null&&s!==void 0?s:0,B=(a=$==null||(l=$.citations)===null||l===void 0||(l=l.total)===null||l===void 0?void 0:l.value)!==null&&a!==void 0?a:0,J=$==null||(c=$.citations)===null||c===void 0||(c=c.total)===null||c===void 0||(c=c.previous)===null||c===void 0?void 0:c.difference,ne=$==null||(u=$.rankings)===null||u===void 0||(u=u.list)===null||u===void 0?void 0:u.find(function(_e){var qe;return((qe=_e.brand)===null||qe===void 0?void 0:qe.isSelf)===!0}),ae=(d=ne==null||(f=ne.rank)===null||f===void 0?void 0:f.value)!==null&&d!==void 0?d:"—",R=ne==null||(h=ne.rank)===null||h===void 0||(h=h.previous)===null||h===void 0?void 0:h.difference;R&&(R=R*-1);var G=(g=L==null||(m=L.visibility)===null||m===void 0?void 0:m.value)!==null&&g!==void 0?g:0,z=L==null||(p=L.visibility)===null||p===void 0||(p=p.previous)===null||p===void 0?void 0:p.value,ce=(v=L==null||(b=L.ranking)===null||b===void 0?void 0:b.value)!==null&&v!==void 0?v:0,K=(w=L==null||(C=L.sentiment)===null||C===void 0?void 0:C.value)!==null&&w!==void 0?w:0,de=(x=L==null||(k=L.mentions)===null||k===void 0?void 0:k.value)!==null&&x!==void 0?x:0,fe={labels:["Mentions","Ranking","Citations","Sentiment"],datasets:[{data:[de,ce,ue,K],backgroundColor:qM,pointBackgroundColor:"rgba(166, 30, 105, 1)"}]},Ie=ml(ml({},Dd),{},{plugins:ml(ml({},Dd.plugins),{},{tooltip:{mode:"point",intersect:!0,callbacks:{label:function(qe){var Y=qe.label||"",Pe=qe.parsed.r||0;return"".concat(Y,": ").concat(Pe,"%")}}}}),interaction:{mode:"point",intersect:!0},scales:{r:{beginAtZero:!0,min:0,max:100,ticks:{stepSize:20}}}}),te=q.useState(typeof window!="undefined"&&window.innerWidth<800?"top":"left"),Je=YM(te,2),ke=Je[0],Ne=Je[1];return q.useEffect(function(){function _e(){Ne(window.innerWidth<800?"top":"left")}return window.addEventListener("resize",_e),function(){return window.removeEventListener("resize",_e)}},[]),y.jsx(A.Card,{className:"yst-overflow-visible md:yst-col-span-2",children:y.jsxs(A.Card.Content,{children:[y.jsx(A.Title,{size:"3",className:"yst-mb-2",children:"AI visibility score"}),y.jsx(Ma,{score:G,total:100,isLoading:V}),y.jsx(QM,{current:G,previous:z,className:"yst-mb-4"}),y.jsxs("div",{className:"yst-flex yst-flex-col yst-items-center yst-justify-around yst-justify-items-center yst-gap-8 md:yst-flex-row",children:[y.jsxs("div",{className:"yst-radar-chart-container yst-relative yst-aspect-square yst-h-full yst-w-full md:yst-flex md:yst-w-1/2 md:yst-items-center md:yst-justify-center",children:[y.jsx(BM,{data:fe,options:Ie}),y.jsx(vf,{id:"tooltip-radar-chart",className:"yst-absolute yst-right-2 yst-top-2",placement:"left",children:"The AI Visibility Index (AIVI) shows how visible your brand is across major AI platforms like ChatGPT, based on mentions, citations, sentiment, and rankings."})]}),y.jsx("div",{className:"yst-mt-6 yst-w-full md:yst-mt-0 md:yst-flex md:yst-w-1/2 md:yst-items-center",children:y.jsxs(VM,{children:[y.jsx(yl,{value:I,label:"Mentions",tooltip:"Mentions show how often your brand appears in AI-generated answers to the questions we send to LLMs.",borderBottom:!0,borderRight:!0,delta:oe,tooltipPosition:ke}),y.jsx(yl,{value:ae&&y.jsxs(y.Fragment,{children:[ae,ae===1&&" 🏆"]}),label:"Competitor ranking",tooltip:"Ranking shows the position your brand is mentioned in AI-generated answers—whether in a numbered list or the order of appearance in full-text responses.",borderBottom:!0,delta:R}),y.jsx(yl,{value:B,label:"Citations",tooltip:"Citations are the source links found in AI-generated answers. They form the basis for mentions, sentiment, and ranking insights.",borderRight:!0,delta:J,tooltipPosition:ke}),y.jsx(yl,{value:K?"".concat(K,"%"):"—",label:"Positive sentiment",tooltip:"Sentiment reflects how positively, neutrally, or negatively your brand is mentioned in AI-generated answers, based on the cited sources.",delta:$==null||(S=$.scores)===null||S===void 0||(S=S.standardized)===null||S===void 0||(S=S.sentiment)===null||S===void 0||(S=S.previous)===null||S===void 0?void 0:S.difference})]})})]})]})})}var Pu=function(){var t=En(),n=t.brandId,r=t.analysisId,i=Ri({query:{select:function(k){var S=k.data;return S==null?void 0:S.brands}}}),s=i.data,o=i.isLoading,a=Bv(n,{query:{enabled:!!n,select:function(k){var S=k.data;return S}}}),l=a.data,c=a.isLoading,u=_c(n,r,{query:{enabled:!!n&&!!r&&r!=="latest"&&typeof r=="string"&&r.length>0,select:function(k){var S=k.data;return S==null?void 0:S.analysis}}}),d=u.data,f=(l==null?void 0:l.name)||"your brand",h=uE(l==null?void 0:l.nextScheduledAnalysis),g=d==null?void 0:d.status,m=function(){switch(g){case Jr.pending:return{alertContent:y.jsxs("div",{className:"yst-max-w-xl yst-space-y-2",children:[y.jsx("p",{className:"yst-font-medium",children:"Your analysis is scheduled"}),y.jsxs("p",{children:["You've completed the setup for"," ",y.jsx("b",{className:"yst-font-medium",children:f}),". The analysis is scheduled to run on"," ",y.jsx("b",{className:"yst-font-medium",children:h}),". You'll see the results here once it's ready, and we'll also notify you by email."]})]}),alertVariant:"info"};case Jr.processing:return{alertContent:y.jsxs(y.Fragment,{children:["You've completed the setup for ",f,". The analysis is now processing. You'll see the results here once it's ready, and we'll also notify you by email."]}),alertVariant:"info"};case Jr.failed:return{alertContent:y.jsx(y.Fragment,{children:"Analysis failed. Try restarting the analysis or contact support if the issue persists."}),alertVariant:"danger"};case Jr.cancelled:return{alertContent:y.jsx(y.Fragment,{children:"Analysis was cancelled. You can restart the analysis when ready."}),alertVariant:"warning"};case Jr.completed:return{alertContent:null};default:return{alertContent:null,alertVariant:"info"}}}(),p=m.alertContent,v=m.alertVariant,b=o||c,w=s&&(s==null?void 0:s.length)>0,C=!b&&d&&g===Jr.completed;return b?y.jsx("div",{className:"yst-flex yst-min-h-screen yst-items-center yst-justify-center",children:y.jsxs("div",{className:"yst-flex yst-items-center yst-gap-3 yst-text-center",children:[y.jsx(A.Spinner,{variant:"primary"}),y.jsx("span",{className:"yst-italic",children:"Just a moment while we get things ready for you..."})]})}):w?y.jsxs("div",{className:"yst-space-y-8",children:[y.jsx(iP,{}),g!==Jr.completed&&p&&y.jsx(A.Alert,{className:"md:yst-col-span-2",variant:v,children:p}),C&&y.jsxs("div",{className:"yst-space-y-4",children:[y.jsxs("div",{className:"yst-flex yst-items-center yst-justify-between",children:[y.jsx(A.Title,{size:"2",children:"Your brand analysis"}),y.jsxs(A.Button,{as:Wr,variant:"secondary",to:"/brands/".concat(n,"/brand-list"),className:Ce("yst-gap-1.5"),disabled:!n,children:[y.jsx(Kv,{})," Edit brand list"]})]}),y.jsxs("div",{className:"yst-grid yst-grid-cols-1 yst-gap-4 md:yst-grid-cols-2",children:[y.jsx(i$,{}),y.jsx(sP,{}),y.jsx(WM,{}),y.jsx(mA,{}),y.jsx(uA,{}),y.jsx(QE,{}),y.jsx(pA,{})]})]})]}):y.jsx($E,{})};function Jb(e){var t=e.children,n=e.description,r=e.title;return y.jsxs(A.Card.Header,{className:"yst-h-auto yst-flex-col yst-items-start yst-gap-0 yst-border-b-[1px] yst-border-b-slate-200 yst-bg-white yst-py-8",children:[r&&y.jsx(A.Title,{className:Ce({"yst-mb-3":n||t}),children:r}),n&&y.jsx("p",{children:n}),t]})}var s$=function(){return y.jsx(A.Card,{className:"yst-mb-4",children:y.jsxs(A.Card.Content,{className:"yst-flex yst-flex-col yst-gap-8",children:[y.jsx(A.Title,{size:"2",children:"Query - Best fish restaurant in Nijmegen"}),y.jsxs("div",{children:[y.jsx("p",{children:"AI Response:"}),y.jsx(A.Link,{href:"#todo",children:"Show more"})]}),y.jsxs("div",{children:[y.jsx("p",{children:"Extracted brands:"}),y.jsx(A.Badge,{children:"Example"}),y.jsx(A.Badge,{children:"Example"}),y.jsx(A.Badge,{children:"Example"}),y.jsx(A.Badge,{children:"Example"}),y.jsx(A.Badge,{children:"Example"})]}),y.jsxs(A.Table,{children:[y.jsx(A.Table.Head,{children:y.jsxs(A.Table.Row,{children:[y.jsx(A.Table.Header,{children:"URL"}),y.jsx(A.Table.Header,{children:"Associated brand"})]})}),y.jsxs(A.Table.Body,{children:[y.jsxs(A.Table.Row,{children:[y.jsx(A.Table.Cell,{children:y.jsx(A.Link,{href:"https://example.com",target:"_blank",children:"https://example.com"})}),y.jsx(A.Table.Cell,{children:"Example Brand"})]}),y.jsxs(A.Table.Row,{children:[y.jsx(A.Table.Cell,{children:y.jsx(A.Link,{href:"https://example2.com",target:"_blank",children:"https://example2.com"})}),y.jsx(A.Table.Cell,{children:"Example Brand 2"})]})]})]})]})})},o$=function(){return y.jsxs(A.Card,{children:[y.jsx(Jb,{title:"Query history"}),y.jsx(A.Card,{className:"yst-mb-4",children:y.jsxs(A.Card.Content,{children:[y.jsxs("p",{className:"yst-mb-8",children:["Manna Fish Restaurant - Analysis performed on:"," ",y.jsx(A.Badge,{children:"2025-04-08 12:31:21"})]}),[0,1,2,3,4].map(function(t){return y.jsx(s$,{},t)})]})})]})},a$=q.lazy(function(){return Promise.resolve().then(()=>mR)}),l$=q.lazy(function(){return Promise.resolve().then(()=>HR)}),c$=q.lazy(function(){return Promise.resolve().then(()=>WR)}),u$=q.lazy(function(){return Promise.resolve().then(()=>sN)}),d$=q.lazy(function(){return Promise.resolve().then(()=>wN)}),f$=q.lazy(function(){return Promise.resolve().then(()=>EN)}),h$=new j2({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:!1,staleTime:1e3*60*5},mutations:{retry:!1}}}),ni=function(){return y.jsx("div",{className:"yst-flex yst-min-h-[200px] yst-items-center yst-justify-center",children:y.jsxs("div",{className:"yst-w-full yst-max-w-md yst-space-y-3",children:[y.jsx(A.SkeletonLoader,{className:"yst-h-8 yst-w-3/4"}),y.jsx(A.SkeletonLoader,{className:"yst-h-6 yst-w-full"}),y.jsx(A.SkeletonLoader,{className:"yst-h-6 yst-w-2/3"})]})})},g$=function(t){var n=t.hideNav,r=n===void 0?!1:n,i=t.disableLayout,s=i===void 0?!1:i,o=t.DebugInfo;return y.jsx(Rw,{children:y.jsxs(xt,{element:y.jsx(oE,{hideNav:r,disableLayout:s,DebugInfo:o}),children:[y.jsxs(xt,{path:"/",element:y.jsx(Ts,{}),children:[y.jsx(xt,{index:!0,element:y.jsx(Pu,{})}),y.jsxs(xt,{path:"brands/:brandId",element:y.jsx(mg,{}),children:[y.jsx(xt,{index:!0,element:y.jsx(Pu,{})}),y.jsx(xt,{path:"brand-list",element:y.jsx(q.Suspense,{fallback:y.jsx(ni,{}),children:y.jsx(a$,{})})}),y.jsx(xt,{path:"analysis/:analysisId",element:y.jsx(aE,{}),children:y.jsx(xt,{index:!0,element:y.jsx(Pu,{})})})]}),y.jsxs(xt,{path:"/setup",element:y.jsx(q.Suspense,{fallback:y.jsx(ni,{}),children:y.jsx(c$,{})}),children:[y.jsx(xt,{index:!0,element:y.jsx(q.Suspense,{fallback:y.jsx(ni,{}),children:y.jsx(u$,{})})}),y.jsxs(xt,{path:":brandId",element:y.jsx(mg,{}),children:[y.jsx(xt,{path:"queries",element:y.jsx(q.Suspense,{fallback:y.jsx(ni,{}),children:y.jsx(d$,{})})}),y.jsx(xt,{path:"analysis",element:y.jsx(q.Suspense,{fallback:y.jsx(ni,{}),children:y.jsx(f$,{})})})]})]})]}),y.jsx(xt,{path:"/settings",element:y.jsx(q.Suspense,{fallback:y.jsx(ni,{}),children:y.jsx(l$,{})})}),y.jsx(xt,{path:"/query-history",element:y.jsx(q.Suspense,{fallback:y.jsx(ni,{}),children:y.jsx(o$,{})})})]})})},y$=function(t){var n=t.DebugInfo,r=t.hostAppProps;return y.jsxs(I2,{client:h$,children:[y.jsx(uO,{hostAppProps:r,children:y.jsx(g$,{DebugInfo:n})}),y.jsx(CC,{initialIsOpen:!1})]})};function m$(e){var t=e.subpath,n=t===void 0?"/":t,r=e.onNavigate,i=gn(),s=Bt(),o=q.useRef(n),a=q.useRef(null),l=q.useRef(!1),c="".concat(s.pathname).concat(s.search).concat(s.hash),u=q.useCallback(r,[r]);return q.useEffect(function(){if(n===c){o.current=n;return}l.current||n!==o.current&&(o.current=n,a.current=n,l.current=!0,i(n,{replace:!0}),setTimeout(function(){l.current=!1},10))},[n,c,i]),q.useEffect(function(){l.current||c!==n&&c!==a.current&&(a.current=c,u(c))},[c,n,u]),null}function p$(e,t){return w$(e)||x$(e,t)||b$(e,t)||v$()}function v$(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
69
69
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function b$(e,t){if(e){if(typeof e=="string")return wm(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?wm(e,t):void 0}}function wm(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function x$(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,o,a=[],l=!0,c=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(l=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(u){c=!0,i=u}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw i}}return a}}function w$(e){if(Array.isArray(e))return e}var S$=function(t){var n=t.isRtl,r=n===void 0?!1:n,i=t.className,s=t.style,o=t.token,a=o===void 0?"":o,l=t.apiUrl,c=t.DebugInfo,u=t.subpath,d=u===void 0?"/":u,f=t.onNavigate,h=f===void 0?function(){}:f,g=t.onLogout,m=g===void 0?function(){}:g,p=t.onAddSubscription,v=p===void 0?function(){}:p,b=q.useState(!!(a||l)),w=p$(b,2),C=w[0],x=w[1],k={onAddSubscription:v,onLogout:m,onNavigate:h,DebugInfo:c,subpath:d};return q.useEffect(function(){l&&Dv(l),sk(typeof a!="function"?function(){return a}:a),x(!1)},[l,a]),C?y.jsx("div",{className:i,style:s,children:y.jsx(A.Spinner,{})}):y.jsx("div",{className:i,style:s,children:y.jsxs(Lw,{initialEntries:[d||"/"],children:[y.jsx(m$,{subpath:d,onNavigate:h}),y.jsx(A.Root,{context:{isRtl:r},children:y.jsx(y$,{DebugInfo:c,hostAppProps:k})})]})})},C$=e=>e!=null,_$=e=>e.filter(C$);function k$(e){return(...t)=>{for(const n of e)n&&n(...t)}}var Q=e=>typeof e=="function"&&!e.length?e():e,Ld=e=>Array.isArray(e)?e:e?[e]:[];function O$(e,...t){return typeof e=="function"?e(...t):e}var E$=we;function A$(e,t,n,r){const i=e.length,s=t.length;let o=0;if(!s){for(;o<i;o++)n(e[o]);return}if(!i){for(;o<s;o++)r(t[o]);return}for(;o<s&&t[o]===e[o];o++);let a,l;t=t.slice(o),e=e.slice(o);for(a of t)e.includes(a)||r(a);for(l of e)t.includes(l)||n(l)}function P$(e){const[t,n]=re(),r=e!=null&&e.throw?(f,h)=>{throw n(f instanceof Error?f:new Error(h)),f}:(f,h)=>{n(f instanceof Error?f:new Error(h))},i=e!=null&&e.api?Array.isArray(e.api)?e.api:[e.api]:[globalThis.localStorage].filter(Boolean),s=e!=null&&e.prefix?`${e.prefix}.`:"",o=new Map,a=new Proxy({},{get(f,h){let g=o.get(h);g||(g=re(void 0,{equals:!1}),o.set(h,g)),g[0]();const m=i.reduce((p,v)=>{if(p!==null||!v)return p;try{return v.getItem(`${s}${h}`)}catch(b){return r(b,`Error reading ${s}${h} from ${v.name}`),null}},null);return m!==null&&(e!=null&&e.deserializer)?e.deserializer(m,h,e.options):m}}),l=(f,h,g)=>{const m=e!=null&&e.serializer?e.serializer(h,f,g!=null?g:e.options):h,p=`${s}${f}`;i.forEach(b=>{try{b.getItem(p)!==m&&b.setItem(p,m)}catch(w){r(w,`Error setting ${s}${f} to ${m} in ${b.name}`)}});const v=o.get(f);v&&v[1]()},c=f=>i.forEach(h=>{try{h.removeItem(`${s}${f}`)}catch(g){r(g,`Error removing ${s}${f} from ${h.name}`)}}),u=()=>i.forEach(f=>{try{f.clear()}catch(h){r(h,`Error clearing ${f.name}`)}}),d=()=>{const f={},h=(g,m)=>{if(!f.hasOwnProperty(g)){const p=m&&(e!=null&&e.deserializer)?e.deserializer(m,g,e.options):m;p&&(f[g]=p)}};return i.forEach(g=>{if(typeof g.getAll=="function"){let m;try{m=g.getAll()}catch(p){r(p,`Error getting all values from in ${g.name}`)}for(const p of m)h(p,m[p])}else{let m=0,p;try{for(;p=g.key(m++);)f.hasOwnProperty(p)||h(p,g.getItem(p))}catch(v){r(v,`Error getting all values from ${g.name}`)}}}),f};return(e==null?void 0:e.sync)!==!1&&dr(()=>{const f=h=>{var m;let g=!1;i.forEach(p=>{try{p!==h.storageArea&&h.key&&h.newValue!==p.getItem(h.key)&&(h.newValue?p.setItem(h.key,h.newValue):p.removeItem(h.key),g=!0)}catch(v){r(v,`Error synching api ${p.name} from storage event (${h.key}=${h.newValue})`)}}),g&&h.key&&((m=o.get(h.key))==null||m[1]())};"addEventListener"in globalThis?(globalThis.addEventListener("storage",f),we(()=>globalThis.removeEventListener("storage",f))):(i.forEach(h=>{var g;return(g=h.addEventListener)==null?void 0:g.call(h,"storage",f)}),we(()=>i.forEach(h=>{var g;return(g=h.removeEventListener)==null?void 0:g.call(h,"storage",f)})))}),[a,l,{clear:u,error:t,remove:c,toJSON:d}]}var Zb=P$,T$=e=>(typeof e.clear=="function"||(e.clear=()=>{let t;for(;t=e.key(0);)e.removeItem(t)}),e),Sm=e=>{if(!e)return"";let t="";for(const n in e){if(!e.hasOwnProperty(n))continue;const r=e[n];t+=r instanceof Date?`; ${n}=${r.toUTCString()}`:typeof r=="boolean"?`; ${n}`:`; ${n}=${r}`}return t},nn=T$({_cookies:[globalThis.document,"cookie"],getItem:e=>{var t,n;return(n=(t=nn._cookies[0][nn._cookies[1]].match("(^|;)\\s*"+e+"\\s*=\\s*([^;]+)"))==null?void 0:t.pop())!=null?n:null},setItem:(e,t,n)=>{const r=nn.getItem(e);nn._cookies[0][nn._cookies[1]]=`${e}=${t}${Sm(n)}`;const i=Object.assign(new Event("storage"),{key:e,oldValue:r,newValue:t,url:globalThis.document.URL,storageArea:nn});window.dispatchEvent(i)},removeItem:e=>{nn._cookies[0][nn._cookies[1]]=`${e}=deleted${Sm({expires:new Date(0)})}`},key:e=>{let t=null,n=0;return nn._cookies[0][nn._cookies[1]].replace(/(?:^|;)\s*(.+?)\s*=\s*[^;]+/g,(r,i)=>(!t&&i&&n++===e&&(t=i),"")),t},get length(){let e=0;return nn._cookies[0][nn._cookies[1]].replace(/(?:^|;)\s*.+?\s*=\s*[^;]+/g,t=>(e+=t?1:0,"")),e}}),j$=1024,ji=796,If=700,M$="bottom-right",Id="bottom",e1="system",$$=!1,t1=500,D$=500,n1=500,L$=Object.keys(od)[0],Cm=1,I$=Object.keys(ad)[0],Rf=pt({client:void 0,onlineManager:void 0,queryFlavor:"",version:"",shadowDOMTarget:void 0});function ye(){return vt(Rf)}var r1=pt(void 0),i1=e=>{const[t,n]=re(null),r=()=>{const o=t();o!=null&&(o.close(),n(null))},i=(o,a)=>{if(t()!=null)return;const l=window.open("","TSQD-Devtools-Panel",`width=${o},height=${a},popup`);if(!l)throw new Error("Failed to open popup. Please allow popups for this site to view the devtools in picture-in-picture mode.");l.document.head.innerHTML="",l.document.body.innerHTML="",kS(l.document),l.document.title="TanStack Query Devtools",l.document.body.style.margin="0",l.addEventListener("pagehide",()=>{e.setLocalStore("pip_open","false"),n(null)}),[...(ye().shadowDOMTarget||document).styleSheets].forEach(c=>{try{const u=[...c.cssRules].map(g=>g.cssText).join(""),d=document.createElement("style"),f=c.ownerNode;let h="";f&&"id"in f&&(h=f.id),h&&d.setAttribute("id",h),d.textContent=u,l.document.head.appendChild(d)}catch(u){const d=document.createElement("link");if(c.href==null)return;d.rel="stylesheet",d.type=c.type,d.media=c.media.toString(),d.href=c.href,l.document.head.appendChild(d)}}),yc(["focusin","focusout","pointermove","keydown","pointerdown","pointerup","click","mousedown","input"],l.document),e.setLocalStore("pip_open","true"),n(l)};be(()=>{var a;((a=e.localStore.pip_open)!=null?a:"false")==="true"&&!e.disabled&&i(Number(window.innerWidth),Number(e.localStore.height||D$))}),be(()=>{const o=(ye().shadowDOMTarget||document).querySelector("#_goober"),a=t();if(o&&a){const l=new MutationObserver(()=>{const c=(ye().shadowDOMTarget||a.document).querySelector("#_goober");c&&(c.textContent=o.textContent)});l.observe(o,{childList:!0,subtree:!0,characterDataOldValue:!0}),we(()=>{l.disconnect()})}});const s=H(()=>{var o;return{pipWindow:t(),requestPipWindow:i,closePipWindow:r,disabled:(o=e.disabled)!=null?o:!1}});return j(r1.Provider,{value:s,get children(){return e.children}})},Nf=()=>H(()=>{const t=vt(r1);if(!t)throw new Error("usePiPWindow must be used within a PiPProvider");return t()}),Ff=pt(()=>"dark");function mt(){return vt(Ff)}var s1={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",Ấ:"A",Ắ:"A",Ẳ:"A",Ẵ:"A",Ặ:"A",Æ:"AE",Ầ:"A",Ằ:"A",Ȃ:"A",Ç:"C",Ḉ:"C",È:"E",É:"E",Ê:"E",Ë:"E",Ế:"E",Ḗ:"E",Ề:"E",Ḕ:"E",Ḝ:"E",Ȇ:"E",Ì:"I",Í:"I",Î:"I",Ï:"I",Ḯ:"I",Ȋ:"I",Ð:"D",Ñ:"N",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",Ố:"O",Ṍ:"O",Ṓ:"O",Ȏ:"O",Ù:"U",Ú:"U",Û:"U",Ü:"U",Ý:"Y",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",ấ:"a",ắ:"a",ẳ:"a",ẵ:"a",ặ:"a",æ:"ae",ầ:"a",ằ:"a",ȃ:"a",ç:"c",ḉ:"c",è:"e",é:"e",ê:"e",ë:"e",ế:"e",ḗ:"e",ề:"e",ḕ:"e",ḝ:"e",ȇ:"e",ì:"i",í:"i",î:"i",ï:"i",ḯ:"i",ȋ:"i",ð:"d",ñ:"n",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",ố:"o",ṍ:"o",ṓ:"o",ȏ:"o",ù:"u",ú:"u",û:"u",ü:"u",ý:"y",ÿ:"y",Ā:"A",ā:"a",Ă:"A",ă:"a",Ą:"A",ą:"a",Ć:"C",ć:"c",Ĉ:"C",ĉ:"c",Ċ:"C",ċ:"c",Č:"C",č:"c",C̆:"C",c̆:"c",Ď:"D",ď:"d",Đ:"D",đ:"d",Ē:"E",ē:"e",Ĕ:"E",ĕ:"e",Ė:"E",ė:"e",Ę:"E",ę:"e",Ě:"E",ě:"e",Ĝ:"G",Ǵ:"G",ĝ:"g",ǵ:"g",Ğ:"G",ğ:"g",Ġ:"G",ġ:"g",Ģ:"G",ģ:"g",Ĥ:"H",ĥ:"h",Ħ:"H",ħ:"h",Ḫ:"H",ḫ:"h",Ĩ:"I",ĩ:"i",Ī:"I",ī:"i",Ĭ:"I",ĭ:"i",Į:"I",į:"i",İ:"I",ı:"i",IJ:"IJ",ij:"ij",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",Ḱ:"K",ḱ:"k",K̆:"K",k̆:"k",Ĺ:"L",ĺ:"l",Ļ:"L",ļ:"l",Ľ:"L",ľ:"l",Ŀ:"L",ŀ:"l",Ł:"l",ł:"l",Ḿ:"M",ḿ:"m",M̆:"M",m̆:"m",Ń:"N",ń:"n",Ņ:"N",ņ:"n",Ň:"N",ň:"n",ʼn:"n",N̆:"N",n̆:"n",Ō:"O",ō:"o",Ŏ:"O",ŏ:"o",Ő:"O",ő:"o",Œ:"OE",œ:"oe",P̆:"P",p̆:"p",Ŕ:"R",ŕ:"r",Ŗ:"R",ŗ:"r",Ř:"R",ř:"r",R̆:"R",r̆:"r",Ȓ:"R",ȓ:"r",Ś:"S",ś:"s",Ŝ:"S",ŝ:"s",Ş:"S",Ș:"S",ș:"s",ş:"s",Š:"S",š:"s",Ţ:"T",ţ:"t",ț:"t",Ț:"T",Ť:"T",ť:"t",Ŧ:"T",ŧ:"t",T̆:"T",t̆:"t",Ũ:"U",ũ:"u",Ū:"U",ū:"u",Ŭ:"U",ŭ:"u",Ů:"U",ů:"u",Ű:"U",ű:"u",Ų:"U",ų:"u",Ȗ:"U",ȗ:"u",V̆:"V",v̆:"v",Ŵ:"W",ŵ:"w",Ẃ:"W",ẃ:"w",X̆:"X",x̆:"x",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Y̆:"Y",y̆:"y",Ź:"Z",ź:"z",Ż:"Z",ż:"z",Ž:"Z",ž:"z",ſ:"s",ƒ:"f",Ơ:"O",ơ:"o",Ư:"U",ư:"u",Ǎ:"A",ǎ:"a",Ǐ:"I",ǐ:"i",Ǒ:"O",ǒ:"o",Ǔ:"U",ǔ:"u",Ǖ:"U",ǖ:"u",Ǘ:"U",ǘ:"u",Ǚ:"U",ǚ:"u",Ǜ:"U",ǜ:"u",Ứ:"U",ứ:"u",Ṹ:"U",ṹ:"u",Ǻ:"A",ǻ:"a",Ǽ:"AE",ǽ:"ae",Ǿ:"O",ǿ:"o",Þ:"TH",þ:"th",Ṕ:"P",ṕ:"p",Ṥ:"S",ṥ:"s",X́:"X",x́:"x",Ѓ:"Г",ѓ:"г",Ќ:"К",ќ:"к",A̋:"A",a̋:"a",E̋:"E",e̋:"e",I̋:"I",i̋:"i",Ǹ:"N",ǹ:"n",Ồ:"O",ồ:"o",Ṑ:"O",ṑ:"o",Ừ:"U",ừ:"u",Ẁ:"W",ẁ:"w",Ỳ:"Y",ỳ:"y",Ȁ:"A",ȁ:"a",Ȅ:"E",ȅ:"e",Ȉ:"I",ȉ:"i",Ȍ:"O",ȍ:"o",Ȑ:"R",ȑ:"r",Ȕ:"U",ȕ:"u",B̌:"B",b̌:"b",Č̣:"C",č̣:"c",Ê̌:"E",ê̌:"e",F̌:"F",f̌:"f",Ǧ:"G",ǧ:"g",Ȟ:"H",ȟ:"h",J̌:"J",ǰ:"j",Ǩ:"K",ǩ:"k",M̌:"M",m̌:"m",P̌:"P",p̌:"p",Q̌:"Q",q̌:"q",Ř̩:"R",ř̩:"r",Ṧ:"S",ṧ:"s",V̌:"V",v̌:"v",W̌:"W",w̌:"w",X̌:"X",x̌:"x",Y̌:"Y",y̌:"y",A̧:"A",a̧:"a",B̧:"B",b̧:"b",Ḑ:"D",ḑ:"d",Ȩ:"E",ȩ:"e",Ɛ̧:"E",ɛ̧:"e",Ḩ:"H",ḩ:"h",I̧:"I",i̧:"i",Ɨ̧:"I",ɨ̧:"i",M̧:"M",m̧:"m",O̧:"O",o̧:"o",Q̧:"Q",q̧:"q",U̧:"U",u̧:"u",X̧:"X",x̧:"x",Z̧:"Z",z̧:"z"},R$=Object.keys(s1).join("|"),N$=new RegExp(R$,"g");function F$(e){return e.replace(N$,t=>s1[t])}var It={CASE_SENSITIVE_EQUAL:7,EQUAL:6,STARTS_WITH:5,WORD_STARTS_WITH:4,CONTAINS:3,ACRONYM:2,MATCHES:1,NO_MATCH:0};function _m(e,t,n){var r;if(n=n||{},n.threshold=(r=n.threshold)!=null?r:It.MATCHES,!n.accessors){const o=km(e,t,n);return{rankedValue:e,rank:o,accessorIndex:-1,accessorThreshold:n.threshold,passed:o>=n.threshold}}const i=H$(e,n.accessors),s={rankedValue:e,rank:It.NO_MATCH,accessorIndex:-1,accessorThreshold:n.threshold,passed:!1};for(let o=0;o<i.length;o++){const a=i[o];let l=km(a.itemValue,t,n);const{minRanking:c,maxRanking:u,threshold:d=n.threshold}=a.attributes;l<c&&l>=It.MATCHES?l=c:l>u&&(l=u),l=Math.min(l,u),l>=d&&l>s.rank&&(s.rank=l,s.passed=!0,s.accessorIndex=o,s.accessorThreshold=d,s.rankedValue=a.itemValue)}return s}function km(e,t,n){return e=Om(e,n),t=Om(t,n),t.length>e.length?It.NO_MATCH:e===t?It.CASE_SENSITIVE_EQUAL:(e=e.toLowerCase(),t=t.toLowerCase(),e===t?It.EQUAL:e.startsWith(t)?It.STARTS_WITH:e.includes(` ${t}`)?It.WORD_STARTS_WITH:e.includes(t)?It.CONTAINS:t.length===1?It.NO_MATCH:B$(e).includes(t)?It.ACRONYM:q$(e,t))}function B$(e){let t="";return e.split(" ").forEach(r=>{r.split("-").forEach(s=>{t+=s.substr(0,1)})}),t}function q$(e,t){let n=0,r=0;function i(l,c,u){for(let d=u,f=c.length;d<f;d++)if(c[d]===l)return n+=1,d+1;return-1}function s(l){const c=1/l,u=n/t.length;return It.MATCHES+u*c}const o=i(t[0],e,0);if(o<0)return It.NO_MATCH;r=o;for(let l=1,c=t.length;l<c;l++){const u=t[l];if(r=i(u,e,r),!(r>-1))return It.NO_MATCH}const a=r-o;return s(a)}function Om(e,t){let{keepDiacritics:n}=t;return e=`${e}`,n||(e=F$(e)),e}function z$(e,t){let n=t;typeof t=="object"&&(n=t.accessor);const r=n(e);return r==null?[]:Array.isArray(r)?r:[String(r)]}function H$(e,t){const n=[];for(let r=0,i=t.length;r<i;r++){const s=t[r],o=K$(s),a=z$(e,s);for(let l=0,c=a.length;l<c;l++)n.push({itemValue:a[l],attributes:o})}return n}var Em={maxRanking:1/0,minRanking:-1/0};function K$(e){return typeof e=="function"?Em:{...Em,...e}}var U$={data:""},W$=e=>typeof window=="object"?((e?e.querySelector("#_goober"):window._goober)||Object.assign((e||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:e||U$,V$=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,G$=/\/\*[^]*?\*\/| +/g,Am=/\n+/g,oi=(e,t)=>{let n="",r="",i="";for(let s in e){let o=e[s];s[0]=="@"?s[1]=="i"?n=s+" "+o+";":r+=s[1]=="f"?oi(o,s):s+"{"+oi(o,s[1]=="k"?"":t)+"}":typeof o=="object"?r+=oi(o,t?t.replace(/([^,])+/g,a=>s.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,l=>/&/.test(l)?l.replace(/&/g,a):a?a+" "+l:l)):s):o!=null&&(s=/^--/.test(s)?s:s.replace(/[A-Z]/g,"-$&").toLowerCase(),i+=oi.p?oi.p(s,o):s+":"+o+";")}return n+(t&&i?t+"{"+i+"}":i)+r},Gn={},o1=e=>{if(typeof e=="object"){let t="";for(let n in e)t+=n+o1(e[n]);return t}return e},Q$=(e,t,n,r,i)=>{let s=o1(e),o=Gn[s]||(Gn[s]=(l=>{let c=0,u=11;for(;c<l.length;)u=101*u+l.charCodeAt(c++)>>>0;return"go"+u})(s));if(!Gn[o]){let l=s!==e?e:(c=>{let u,d,f=[{}];for(;u=V$.exec(c.replace(G$,""));)u[4]?f.shift():u[3]?(d=u[3].replace(Am," ").trim(),f.unshift(f[0][d]=f[0][d]||{})):f[0][u[1]]=u[2].replace(Am," ").trim();return f[0]})(e);Gn[o]=oi(i?{["@keyframes "+o]:l}:l,n?"":"."+o)}let a=n&&Gn.g?Gn.g:null;return n&&(Gn.g=Gn[o]),((l,c,u,d)=>{d?c.data=c.data.replace(d,l):c.data.indexOf(l)===-1&&(c.data=u?l+c.data:c.data+l)})(Gn[o],t,r,a),o},Y$=(e,t,n)=>e.reduce((r,i,s)=>{let o=t[s];if(o&&o.call){let a=o(n),l=a&&a.props&&a.props.className||/^go/.test(a)&&a;o=l?"."+l:a&&typeof a=="object"?a.props?"":oi(a,""):a===!1?"":a}return r+i+(o==null?"":o)},"");function je(e){let t=this||{},n=e.call?e(t.p):e;return Q$(n.unshift?n.raw?Y$(n,[].slice.call(arguments,1),t.p):n.reduce((r,i)=>Object.assign(r,i&&i.call?i(t.p):i),{}):n,W$(t.target),t.g,t.o,t.k)}je.bind({g:1});je.bind({k:1});function a1(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=a1(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function se(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=a1(e))&&(r&&(r+=" "),r+=t);return r}function X$(e,t){const n=ot(e),{onChange:r}=t;let i=new Set(t.appear?void 0:n);const s=new WeakSet,[o,a]=re([],{equals:!1}),[l]=nS(),c=d=>{a(f=>(f.push.apply(f,d),f));for(const f of d)s.delete(f)},u=(d,f,h)=>d.splice(h,0,f);return H(d=>{const f=o(),h=e();if(h[fc],ot(l))return l(),d;if(f.length){const g=d.filter(m=>!f.includes(m));return f.length=0,r({list:g,added:[],removed:[],unchanged:g,finishRemoved:c}),g}return ot(()=>{const g=new Set(h),m=h.slice(),p=[],v=[],b=[];for(const C of h)(i.has(C)?b:p).push(C);let w=!p.length;for(let C=0;C<d.length;C++){const x=d[C];g.has(x)||(s.has(x)||(v.push(x),s.add(x)),u(m,x,C)),w&&x!==m[C]&&(w=!1)}return!v.length&&w?d:(r({list:m,added:p,removed:v,unchanged:b,finishRemoved:c}),i=g,m)})},t.appear?[]:n.slice())}function Mt(...e){return k$(e)}var Pm=e=>e instanceof Element;function Rd(e,t){if(t(e))return e;if(typeof e=="function"&&!e.length)return Rd(e(),t);if(Array.isArray(e)){const n=[];for(const r of e){const i=Rd(r,t);i&&(Array.isArray(i)?n.push.apply(n,i):n.push(i))}return n.length?n:null}return null}function J$(e,t=Pm,n=Pm){const r=H(e),i=H(()=>Rd(r(),t));return i.toArray=()=>{const s=i();return Array.isArray(s)?s:s?[s]:[]},i}function Z$(e){return H(()=>{const t=e.name||"s";return{enterActive:(e.enterActiveClass||t+"-enter-active").split(" "),enter:(e.enterClass||t+"-enter").split(" "),enterTo:(e.enterToClass||t+"-enter-to").split(" "),exitActive:(e.exitActiveClass||t+"-exit-active").split(" "),exit:(e.exitClass||t+"-exit").split(" "),exitTo:(e.exitToClass||t+"-exit-to").split(" "),move:(e.moveClass||t+"-move").split(" ")}})}function l1(e){requestAnimationFrame(()=>requestAnimationFrame(e))}function e4(e,t,n,r){const{onBeforeEnter:i,onEnter:s,onAfterEnter:o}=t;i==null||i(n),n.classList.add(...e.enter),n.classList.add(...e.enterActive),queueMicrotask(()=>{if(!n.parentNode)return r==null?void 0:r();s==null||s(n,()=>a())}),l1(()=>{n.classList.remove(...e.enter),n.classList.add(...e.enterTo),(!s||s.length<2)&&(n.addEventListener("transitionend",a),n.addEventListener("animationend",a))});function a(l){(!l||l.target===n)&&(n.removeEventListener("transitionend",a),n.removeEventListener("animationend",a),n.classList.remove(...e.enterActive),n.classList.remove(...e.enterTo),o==null||o(n))}}function t4(e,t,n,r){const{onBeforeExit:i,onExit:s,onAfterExit:o}=t;if(!n.parentNode)return r==null?void 0:r();i==null||i(n),n.classList.add(...e.exit),n.classList.add(...e.exitActive),s==null||s(n,()=>a()),l1(()=>{n.classList.remove(...e.exit),n.classList.add(...e.exitTo),(!s||s.length<2)&&(n.addEventListener("transitionend",a),n.addEventListener("animationend",a))});function a(l){(!l||l.target===n)&&(r==null||r(),n.removeEventListener("transitionend",a),n.removeEventListener("animationend",a),n.classList.remove(...e.exitActive),n.classList.remove(...e.exitTo),o==null||o(n))}}var Tm=e=>{const t=Z$(e);return X$(J$(()=>e.children).toArray,{appear:e.appear,onChange({added:n,removed:r,finishRemoved:i,list:s}){const o=t();for(const l of n)e4(o,e,l);const a=[];for(const l of s)l.isConnected&&(l instanceof HTMLElement||l instanceof SVGElement)&&a.push({el:l,rect:l.getBoundingClientRect()});queueMicrotask(()=>{const l=[];for(const{el:c,rect:u}of a)if(c.isConnected){const d=c.getBoundingClientRect(),f=u.left-d.left,h=u.top-d.top;(f||h)&&(c.style.transform=`translate(${f}px, ${h}px)`,c.style.transitionDuration="0s",l.push(c))}document.body.offsetHeight;for(const c of l){let u=function(d){(d.target===c||/transform$/.test(d.propertyName))&&(c.removeEventListener("transitionend",u),c.classList.remove(...o.move))};c.classList.add(...o.move),c.style.transform=c.style.transitionDuration="",c.addEventListener("transitionend",u)}});for(const l of r)t4(o,e,l,()=>i([l]))}})},Tu=Symbol("fallback");function jm(e){for(const t of e)t.dispose()}function n4(e,t,n,r={}){const i=new Map;return we(()=>jm(i.values())),()=>{const o=e()||[];return o[fc],ot(()=>{var u,d;if(!o.length)return jm(i.values()),i.clear(),r.fallback?[ar(h=>(i.set(Tu,{dispose:h}),r.fallback()))]:[];const a=new Array(o.length),l=i.get(Tu);if(!i.size||l){l==null||l.dispose(),i.delete(Tu);for(let f=0;f<o.length;f++){const h=o[f],g=t(h,f);s(a,h,f,g)}return a}const c=new Set(i.keys());for(let f=0;f<o.length;f++){const h=o[f],g=t(h,f);c.delete(g);const m=i.get(g);m?(a[f]=m.mapped,(u=m.setIndex)==null||u.call(m,f),m.setItem(()=>h)):s(a,h,f,g)}for(const f of c)(d=i.get(f))==null||d.dispose(),i.delete(f);return a})};function s(o,a,l,c){ar(u=>{const[d,f]=re(a),h={setItem:f,dispose:u};if(n.length>1){const[g,m]=re(l);h.setIndex=m,h.mapped=n(d,g)}else h.mapped=n(d);i.set(c,h),o[l]=h.mapped})}}function nc(e){const{by:t}=e;return H(n4(()=>e.each,typeof t=="function"?t:n=>n[t],e.children,"fallback"in e?{fallback:()=>e.fallback}:void 0))}function r4(e,t,n,r){return e.addEventListener(t,n,r),E$(e.removeEventListener.bind(e,t,n,r))}function i4(e,t,n,r){const i=()=>{Ld(Q(e)).forEach(s=>{s&&Ld(Q(t)).forEach(o=>r4(s,o,n,r))})};typeof e=="function"?be(i):ve(i)}function s4(e,t){const n=new ResizeObserver(e);return we(n.disconnect.bind(n)),{observe:r=>n.observe(r,t),unobserve:n.unobserve.bind(n)}}function c1(e,t,n){const r=new WeakMap,{observe:i,unobserve:s}=s4(o=>{for(const a of o){const{contentRect:l,target:c}=a,u=Math.round(l.width),d=Math.round(l.height),f=r.get(c);(!f||f.width!==u||f.height!==d)&&(t(l,c,a),r.set(c,{width:u,height:d}))}},n);be(o=>{const a=_$(Ld(Q(e)));return A$(a,o,i,s),a},[])}var o4=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g;function Mm(e){const t={};let n;for(;n=o4.exec(e);)t[n[1]]=n[2];return t}function Rc(e,t){if(typeof e=="string"){if(typeof t=="string")return`${e};${t}`;e=Mm(e)}else typeof t=="string"&&(t=Mm(t));return{...e,...t}}function a4(e,t,n=-1){return n in e?[...e.slice(0,n),t,...e.slice(n)]:[...e,t]}function Nd(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function l4(e){return typeof e=="number"}function Vi(e){return Object.prototype.toString.call(e)==="[object String]"}function c4(e){return typeof e=="function"}function Ra(e){return t=>`${e()}-${t}`}function un(e,t){return e?e===t||e.contains(t):!1}function Po(e,t=!1){const{activeElement:n}=qn(e);if(!(n!=null&&n.nodeName))return null;if(u1(n)&&n.contentDocument)return Po(n.contentDocument.body,t);if(t){const r=n.getAttribute("aria-activedescendant");if(r){const i=qn(n).getElementById(r);if(i)return i}}return n}function u4(e){return qn(e).defaultView||window}function qn(e){return e?e.ownerDocument||e:document}function u1(e){return e.tagName==="IFRAME"}var Bf=(e=>(e.Escape="Escape",e.Enter="Enter",e.Tab="Tab",e.Space=" ",e.ArrowDown="ArrowDown",e.ArrowLeft="ArrowLeft",e.ArrowRight="ArrowRight",e.ArrowUp="ArrowUp",e.End="End",e.Home="Home",e.PageDown="PageDown",e.PageUp="PageUp",e))(Bf||{});function qf(e){var t;return typeof window!="undefined"&&window.navigator!=null?e.test(((t=window.navigator.userAgentData)==null?void 0:t.platform)||window.navigator.platform):!1}function Nc(){return qf(/^Mac/i)}function d4(){return qf(/^iPhone/i)}function f4(){return qf(/^iPad/i)||Nc()&&navigator.maxTouchPoints>1}function h4(){return d4()||f4()}function g4(){return Nc()||h4()}function tt(e,t){return t&&(c4(t)?t(e):t[0](t[1],e)),e==null?void 0:e.defaultPrevented}function gt(e){return t=>{for(const n of e)tt(t,n)}}function y4(e){return Nc()?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey}function _t(e){if(e)if(m4())e.focus({preventScroll:!0});else{const t=p4(e);e.focus(),v4(t)}}var pl=null;function m4(){if(pl==null){pl=!1;try{document.createElement("div").focus({get preventScroll(){return pl=!0,!0}})}catch(e){}}return pl}function p4(e){let t=e.parentNode;const n=[],r=document.scrollingElement||document.documentElement;for(;t instanceof HTMLElement&&t!==r;)(t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth)&&n.push({element:t,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}),t=t.parentNode;return r instanceof HTMLElement&&n.push({element:r,scrollTop:r.scrollTop,scrollLeft:r.scrollLeft}),n}function v4(e){for(const{element:t,scrollTop:n,scrollLeft:r}of e)t.scrollTop=n,t.scrollLeft=r}var d1=["input:not([type='hidden']):not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","a[href]","area[href]","[tabindex]","iframe","object","embed","audio[controls]","video[controls]","[contenteditable]:not([contenteditable='false'])"],b4=[...d1,'[tabindex]:not([tabindex="-1"]):not([disabled])'],zf=d1.join(":not([hidden]),")+",[tabindex]:not([disabled]):not([hidden])",x4=b4.join(':not([hidden]):not([tabindex="-1"]),');function f1(e,t){const r=Array.from(e.querySelectorAll(zf)).filter($m);return t&&$m(e)&&r.unshift(e),r.forEach((i,s)=>{if(u1(i)&&i.contentDocument){const o=i.contentDocument.body,a=f1(o,!1);r.splice(s,1,...a)}}),r}function $m(e){return h1(e)&&!w4(e)}function h1(e){return e.matches(zf)&&Hf(e)}function w4(e){return parseInt(e.getAttribute("tabindex")||"0",10)<0}function Hf(e,t){return e.nodeName!=="#comment"&&S4(e)&&C4(e,t)&&(!e.parentElement||Hf(e.parentElement,e))}function S4(e){if(!(e instanceof HTMLElement)&&!(e instanceof SVGElement))return!1;const{display:t,visibility:n}=e.style;let r=t!=="none"&&n!=="hidden"&&n!=="collapse";if(r){if(!e.ownerDocument.defaultView)return r;const{getComputedStyle:i}=e.ownerDocument.defaultView,{display:s,visibility:o}=i(e);r=s!=="none"&&o!=="hidden"&&o!=="collapse"}return r}function C4(e,t){return!e.hasAttribute("hidden")&&(e.nodeName==="DETAILS"&&t&&t.nodeName!=="SUMMARY"?e.hasAttribute("open"):!0)}function _4(e,t,n){const r=t!=null&&t.tabbable?x4:zf,i=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode(s){var o;return(o=t==null?void 0:t.from)!=null&&o.contains(s)?NodeFilter.FILTER_REJECT:s.matches(r)&&Hf(s)&&(!(t!=null&&t.accept)||t.accept(s))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});return t!=null&&t.from&&(i.currentNode=t.from),i}function Dm(e){for(;e&&!k4(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}function k4(e){const t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function O4(){}function E4(e,t){const[n,r]=e;let i=!1;const s=t.length;for(let o=s,a=0,l=o-1;a<o;l=a++){const[c,u]=t[a],[d,f]=t[l],[,h]=t[l===0?o-1:l-1]||[0,0],g=(u-f)*(n-c)-(c-d)*(r-u);if(f<u){if(r>=f&&r<u){if(g===0)return!0;g>0&&(r===f?r>h&&(i=!i):i=!i)}}else if(u<f){if(r>u&&r<=f){if(g===0)return!0;g<0&&(r===f?r<h&&(i=!i):i=!i)}}else if(r==u&&(n>=d&&n<=c||n>=c&&n<=d))return!0}return i}function Fe(e,t){return Ee(e,t)}var yo=new Map,Lm=new Set;function Im(){if(typeof window=="undefined")return;const e=n=>{if(!n.target)return;let r=yo.get(n.target);r||(r=new Set,yo.set(n.target,r),n.target.addEventListener("transitioncancel",t)),r.add(n.propertyName)},t=n=>{if(!n.target)return;const r=yo.get(n.target);if(r&&(r.delete(n.propertyName),r.size===0&&(n.target.removeEventListener("transitioncancel",t),yo.delete(n.target)),yo.size===0)){for(const i of Lm)i();Lm.clear()}};document.body.addEventListener("transitionrun",e),document.body.addEventListener("transitionend",t)}typeof document!="undefined"&&(document.readyState!=="loading"?Im():document.addEventListener("DOMContentLoaded",Im));function Fd(e,t){const n=Rm(e,t,"left"),r=Rm(e,t,"top"),i=t.offsetWidth,s=t.offsetHeight;let o=e.scrollLeft,a=e.scrollTop;const l=o+e.offsetWidth,c=a+e.offsetHeight;n<=o?o=n:n+i>l&&(o+=n+i-l),r<=a?a=r:r+s>c&&(a+=r+s-c),e.scrollLeft=o,e.scrollTop=a}function Rm(e,t,n){const r=n==="left"?"offsetLeft":"offsetTop";let i=0;for(;t.offsetParent&&(i+=t[r],t.offsetParent!==e);){if(t.offsetParent.contains(e)){i-=e[r];break}t=t.offsetParent}return i}function A4(e,t){var n,r;if(document.contains(e)){const i=document.scrollingElement||document.documentElement;if(window.getComputedStyle(i).overflow==="hidden"){let o=Dm(e);for(;e&&o&&e!==i&&o!==i;)Fd(o,e),e=o,o=Dm(e)}else{const{left:o,top:a}=e.getBoundingClientRect();(n=e==null?void 0:e.scrollIntoView)==null||n.call(e,{block:"nearest"});const{left:l,top:c}=e.getBoundingClientRect();(Math.abs(o-l)>1||Math.abs(a-c)>1)&&((r=e.scrollIntoView)==null||r.call(e,{block:"nearest"}))}}}var g1={border:"0",clip:"rect(0 0 0 0)","clip-path":"inset(50%)",height:"1px",margin:"0 -1px -1px 0",overflow:"hidden",padding:"0",position:"absolute",width:"1px","white-space":"nowrap"};function dn(e){return t=>(e(t),()=>e(void 0))}function Fc(e,t){const[n,r]=re(Nm(t==null?void 0:t()));return be(()=>{var i;r(((i=e())==null?void 0:i.tagName.toLowerCase())||Nm(t==null?void 0:t()))}),n}function Nm(e){return Vi(e)?e:void 0}function it(e){const[t,n]=We(e,["as"]);if(!t.as)throw new Error("[kobalte]: Polymorphic is missing the required `as` prop.");return j(IS,Ee(n,{get component(){return t.as}}))}var P4=["id","name","validationState","required","disabled","readOnly"];function T4(e){const t=`form-control-${yn()}`,n=Fe({id:t},e),[r,i]=re(),[s,o]=re(),[a,l]=re(),[c,u]=re(),d=(m,p,v)=>{const b=v!=null||r()!=null;return[v,r(),b&&p!=null?m:void 0].filter(Boolean).join(" ")||void 0},f=m=>[a(),c(),m].filter(Boolean).join(" ")||void 0,h=H(()=>({"data-valid":Q(n.validationState)==="valid"?"":void 0,"data-invalid":Q(n.validationState)==="invalid"?"":void 0,"data-required":Q(n.required)?"":void 0,"data-disabled":Q(n.disabled)?"":void 0,"data-readonly":Q(n.readOnly)?"":void 0}));return{formControlContext:{name:()=>{var m;return(m=Q(n.name))!=null?m:Q(n.id)},dataset:h,validationState:()=>Q(n.validationState),isRequired:()=>Q(n.required),isDisabled:()=>Q(n.disabled),isReadOnly:()=>Q(n.readOnly),labelId:r,fieldId:s,descriptionId:a,errorMessageId:c,getAriaLabelledBy:d,getAriaDescribedBy:f,generateId:Ra(()=>Q(n.id)),registerLabel:dn(i),registerField:dn(o),registerDescription:dn(l),registerErrorMessage:dn(u)}}}var y1=pt();function Na(){const e=vt(y1);if(e===void 0)throw new Error("[kobalte]: `useFormControlContext` must be used within a `FormControlContext.Provider` component");return e}function m1(e){const t=Na(),n=Fe({id:t.generateId("description")},e);return be(()=>we(t.registerDescription(n.id))),j(it,Ee({as:"div"},()=>t.dataset(),n))}function p1(e){const t=Na(),n=Fe({id:t.generateId("error-message")},e),[r,i]=We(n,["forceMount"]),s=()=>t.validationState()==="invalid";return be(()=>{s()&&we(t.registerErrorMessage(i.id))}),j(pe,{get when(){return r.forceMount||s()},get children(){return j(it,Ee({as:"div"},()=>t.dataset(),i))}})}function j4(e){let t;const n=Na(),r=Fe({id:n.generateId("label")},e),[i,s]=We(r,["ref"]),o=Fc(()=>t,()=>"label");return be(()=>we(n.registerLabel(s.id))),j(it,Ee({as:"label",ref(a){const l=Mt(c=>t=c,i.ref);typeof l=="function"&&l(a)},get for(){return H(()=>o()==="label")()?n.fieldId():void 0}},()=>n.dataset(),s))}function M4(e,t){be(ur(e,n=>{if(n==null)return;const r=$4(n);r!=null&&(r.addEventListener("reset",t,{passive:!0}),we(()=>{r.removeEventListener("reset",t)}))}))}function $4(e){return D4(e)?e.form:e.closest("form")}function D4(e){return e.matches("textarea, input, select, button")}function Fa(e){var o;const[t,n]=re((o=e.defaultValue)==null?void 0:o.call(e)),r=H(()=>{var a;return((a=e.value)==null?void 0:a.call(e))!==void 0}),i=H(()=>{var a;return r()?(a=e.value)==null?void 0:a.call(e):t()});return[i,a=>{ot(()=>{var c;const l=O$(a,i());return Object.is(l,i())||(r()||n(l),(c=e.onChange)==null||c.call(e,l)),l})}]}function v1(e){const[t,n]=Fa(e);return[()=>{var i;return(i=t())!=null?i:!1},n]}function L4(e){const[t,n]=Fa(e);return[()=>{var i;return(i=t())!=null?i:[]},n]}function I4(e={}){const[t,n]=v1({value:()=>Q(e.isSelected),defaultValue:()=>!!Q(e.defaultIsSelected),onChange:s=>{var o;return(o=e.onSelectedChange)==null?void 0:o.call(e,s)}});return{isSelected:t,setIsSelected:s=>{!Q(e.isReadOnly)&&!Q(e.isDisabled)&&n(s)},toggle:()=>{!Q(e.isReadOnly)&&!Q(e.isDisabled)&&n(!t())}}}var R4=Object.defineProperty,Bc=(e,t)=>{for(var n in t)R4(e,n,{get:t[n],enumerable:!0})},b1=pt();function x1(){return vt(b1)}function N4(){const e=x1();if(e===void 0)throw new Error("[kobalte]: `useDomCollectionContext` must be used within a `DomCollectionProvider` component");return e}function w1(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}function F4(e,t){var i;const n=t.ref();if(!n)return-1;let r=e.length;if(!r)return-1;for(;r--;){const s=(i=e[r])==null?void 0:i.ref();if(s&&w1(s,n))return r+1}return 0}function B4(e){const t=e.map((r,i)=>[i,r]);let n=!1;return t.sort(([r,i],[s,o])=>{const a=i.ref(),l=o.ref();return a===l||!a||!l?0:w1(a,l)?(r>s&&(n=!0),-1):(r<s&&(n=!0),1)}),n?t.map(([r,i])=>i):e}function S1(e,t){const n=B4(e);e!==n&&t(n)}function q4(e){var i,s;const t=e[0],n=(i=e[e.length-1])==null?void 0:i.ref();let r=(s=t==null?void 0:t.ref())==null?void 0:s.parentElement;for(;r;){if(n&&r.contains(n))return r;r=r.parentElement}return qn(r).body}function z4(e,t){be(()=>{const n=setTimeout(()=>{S1(e(),t)});we(()=>clearTimeout(n))})}function H4(e,t){if(typeof IntersectionObserver!="function"){z4(e,t);return}let n=[];be(()=>{const r=()=>{const o=!!n.length;n=e(),o&&S1(e(),t)},i=q4(e()),s=new IntersectionObserver(r,{root:i});for(const o of e()){const a=o.ref();a&&s.observe(a)}we(()=>s.disconnect())})}function K4(e={}){const[t,n]=L4({value:()=>Q(e.items),onChange:s=>{var o;return(o=e.onItemsChange)==null?void 0:o.call(e,s)}});H4(t,n);const r=s=>(n(o=>{const a=F4(o,s);return a4(o,s,a)}),()=>{n(o=>{const a=o.filter(l=>l.ref()!==s.ref());return o.length===a.length?o:a})});return{DomCollectionProvider:s=>j(b1.Provider,{value:{registerItem:r},get children(){return s.children}})}}function U4(e){const t=N4(),n=Fe({shouldRegisterItem:!0},e);be(()=>{if(!n.shouldRegisterItem)return;const r=t.registerItem(n.getItem());we(r)})}function C1(e){var l,c,u;let t=(l=e.startIndex)!=null?l:0;const n=(c=e.startLevel)!=null?c:0,r=[],i=d=>{var g;if(d==null)return"";const f=(g=e.getKey)!=null?g:"key",h=Vi(f)?d[f]:f(d);return h!=null?String(h):""},s=d=>{var g;if(d==null)return"";const f=(g=e.getTextValue)!=null?g:"textValue",h=Vi(f)?d[f]:f(d);return h!=null?String(h):""},o=d=>{var h,g;if(d==null)return!1;const f=(h=e.getDisabled)!=null?h:"disabled";return(g=Vi(f)?d[f]:f(d))!=null?g:!1},a=d=>{var f;if(d!=null)return Vi(e.getSectionChildren)?d[e.getSectionChildren]:(f=e.getSectionChildren)==null?void 0:f.call(e,d)};for(const d of e.dataSource){if(Vi(d)||l4(d)){r.push({type:"item",rawValue:d,key:String(d),textValue:String(d),disabled:o(d),level:n,index:t}),t++;continue}if(a(d)!=null){r.push({type:"section",rawValue:d,key:"",textValue:"",disabled:!1,level:n,index:t}),t++;const f=(u=a(d))!=null?u:[];if(f.length>0){const h=C1({dataSource:f,getKey:e.getKey,getTextValue:e.getTextValue,getDisabled:e.getDisabled,getSectionChildren:e.getSectionChildren,startIndex:t,startLevel:n+1});r.push(...h),t+=h.length}}else r.push({type:"item",rawValue:d,key:i(d),textValue:s(d),disabled:o(d),level:n,index:t}),t++}return r}function W4(e,t=[]){return H(()=>{const n=C1({dataSource:Q(e.dataSource),getKey:Q(e.getKey),getTextValue:Q(e.getTextValue),getDisabled:Q(e.getDisabled),getSectionChildren:Q(e.getSectionChildren)});for(let r=0;r<t.length;r++)t[r]();return e.factory(n)})}var V4=new Set(["Avst","Arab","Armi","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),G4=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]);function Q4(e){var n;if(Intl.Locale){const r=(n=new Intl.Locale(e).maximize().script)!=null?n:"";return V4.has(r)}const t=e.split("-")[0];return G4.has(t)}function Y4(e){return Q4(e)?"rtl":"ltr"}function _1(){let e=typeof navigator!="undefined"&&(navigator.language||navigator.userLanguage)||"en-US";return{locale:e,direction:Y4(e)}}var Bd=_1(),To=new Set;function Fm(){Bd=_1();for(const e of To)e(Bd)}function X4(){const[e,t]=re(Bd),n=H(()=>e());return dr(()=>{To.size===0&&window.addEventListener("languagechange",Fm),To.add(t),we(()=>{To.delete(t),To.size===0&&window.removeEventListener("languagechange",Fm)})}),{locale:()=>n().locale,direction:()=>n().direction}}var J4=pt();function Qr(){const e=X4();return vt(J4)||e}var ju=new Map;function Z4(e){const{locale:t}=Qr(),n=H(()=>t()+(e?Object.entries(e).sort((r,i)=>r[0]<i[0]?-1:1).join():""));return H(()=>{const r=n();let i;return ju.has(r)&&(i=ju.get(r)),i||(i=new Intl.Collator(t(),e),ju.set(r,i)),i})}var Zn=class k1 extends Set{constructor(n,r,i){super(n);me(this,"anchorKey");me(this,"currentKey");n instanceof k1?(this.anchorKey=r||n.anchorKey,this.currentKey=i||n.currentKey):(this.anchorKey=r,this.currentKey=i)}};function eD(e){const[t,n]=Fa(e);return[()=>{var i;return(i=t())!=null?i:new Zn},n]}function O1(e){return g4()?e.altKey:e.ctrlKey}function Gi(e){return Nc()?e.metaKey:e.ctrlKey}function Bm(e){return new Zn(e)}function tD(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function nD(e){const t=Fe({selectionMode:"none",selectionBehavior:"toggle"},e),[n,r]=re(!1),[i,s]=re(),o=H(()=>{const m=Q(t.selectedKeys);return m!=null?Bm(m):m}),a=H(()=>{const m=Q(t.defaultSelectedKeys);return m!=null?Bm(m):new Zn}),[l,c]=eD({value:o,defaultValue:a,onChange:m=>{var p;return(p=t.onSelectionChange)==null?void 0:p.call(t,m)}}),[u,d]=re(Q(t.selectionBehavior)),f=()=>Q(t.selectionMode),h=()=>{var m;return(m=Q(t.disallowEmptySelection))!=null?m:!1},g=m=>{(Q(t.allowDuplicateSelectionEvents)||!tD(m,l()))&&c(m)};return be(()=>{const m=l();Q(t.selectionBehavior)==="replace"&&u()==="toggle"&&typeof m=="object"&&m.size===0&&d("replace")}),be(()=>{var m;d((m=Q(t.selectionBehavior))!=null?m:"toggle")}),{selectionMode:f,disallowEmptySelection:h,selectionBehavior:u,setSelectionBehavior:d,isFocused:n,setFocused:r,focusedKey:i,setFocusedKey:s,selectedKeys:l,setSelectedKeys:g}}function rD(e){const[t,n]=re(""),[r,i]=re(-1);return{typeSelectHandlers:{onKeyDown:o=>{var f,h,g;if(Q(e.isDisabled))return;const a=Q(e.keyboardDelegate),l=Q(e.selectionManager);if(!a.getKeyForSearch)return;const c=iD(o.key);if(!c||o.ctrlKey||o.metaKey)return;c===" "&&t().trim().length>0&&(o.preventDefault(),o.stopPropagation());let u=n(m=>m+c),d=(f=a.getKeyForSearch(u,l.focusedKey()))!=null?f:a.getKeyForSearch(u);d==null&&sD(u)&&(u=u[0],d=(h=a.getKeyForSearch(u,l.focusedKey()))!=null?h:a.getKeyForSearch(u)),d!=null&&(l.setFocusedKey(d),(g=e.onTypeSelect)==null||g.call(e,d)),clearTimeout(r()),i(window.setTimeout(()=>n(""),500))}}}}function iD(e){return e.length===1||!/^[A-Z]/i.test(e)?e:""}function sD(e){return e.split("").every(t=>t===e[0])}function oD(e,t,n){const i=Ee({selectOnFocus:()=>Q(e.selectionManager).selectionBehavior()==="replace"},e),s=()=>t(),{direction:o}=Qr();let a={top:0,left:0};i4(()=>Q(i.isVirtualized)?void 0:s(),"scroll",()=>{const p=s();p&&(a={top:p.scrollTop,left:p.scrollLeft})});const{typeSelectHandlers:l}=rD({isDisabled:()=>Q(i.disallowTypeAhead),keyboardDelegate:()=>Q(i.keyboardDelegate),selectionManager:()=>Q(i.selectionManager)}),c=()=>{var p;return(p=Q(i.orientation))!=null?p:"vertical"},u=p=>{var _,O,E,T,D,V,N,$;tt(p,l.onKeyDown),p.altKey&&p.key==="Tab"&&p.preventDefault();const v=t();if(!(v!=null&&v.contains(p.target)))return;const b=Q(i.selectionManager),w=Q(i.selectOnFocus),C=L=>{L!=null&&(b.setFocusedKey(L),p.shiftKey&&b.selectionMode()==="multiple"?b.extendSelection(L):w&&!O1(p)&&b.replaceSelection(L))},x=Q(i.keyboardDelegate),k=Q(i.shouldFocusWrap),S=b.focusedKey();switch(p.key){case(c()==="vertical"?"ArrowDown":"ArrowRight"):{if(x.getKeyBelow){p.preventDefault();let L;S!=null?L=x.getKeyBelow(S):L=(_=x.getFirstKey)==null?void 0:_.call(x),L==null&&k&&(L=(O=x.getFirstKey)==null?void 0:O.call(x,S)),C(L)}break}case(c()==="vertical"?"ArrowUp":"ArrowLeft"):{if(x.getKeyAbove){p.preventDefault();let L;S!=null?L=x.getKeyAbove(S):L=(E=x.getLastKey)==null?void 0:E.call(x),L==null&&k&&(L=(T=x.getLastKey)==null?void 0:T.call(x,S)),C(L)}break}case(c()==="vertical"?"ArrowLeft":"ArrowUp"):{if(x.getKeyLeftOf){p.preventDefault();const L=o()==="rtl";let I;S!=null?I=x.getKeyLeftOf(S):I=L?(D=x.getFirstKey)==null?void 0:D.call(x):(V=x.getLastKey)==null?void 0:V.call(x),C(I)}break}case(c()==="vertical"?"ArrowRight":"ArrowDown"):{if(x.getKeyRightOf){p.preventDefault();const L=o()==="rtl";let I;S!=null?I=x.getKeyRightOf(S):I=L?(N=x.getLastKey)==null?void 0:N.call(x):($=x.getFirstKey)==null?void 0:$.call(x),C(I)}break}case"Home":if(x.getFirstKey){p.preventDefault();const L=x.getFirstKey(S,Gi(p));L!=null&&(b.setFocusedKey(L),Gi(p)&&p.shiftKey&&b.selectionMode()==="multiple"?b.extendSelection(L):w&&b.replaceSelection(L))}break;case"End":if(x.getLastKey){p.preventDefault();const L=x.getLastKey(S,Gi(p));L!=null&&(b.setFocusedKey(L),Gi(p)&&p.shiftKey&&b.selectionMode()==="multiple"?b.extendSelection(L):w&&b.replaceSelection(L))}break;case"PageDown":if(x.getKeyPageBelow&&S!=null){p.preventDefault();const L=x.getKeyPageBelow(S);C(L)}break;case"PageUp":if(x.getKeyPageAbove&&S!=null){p.preventDefault();const L=x.getKeyPageAbove(S);C(L)}break;case"a":Gi(p)&&b.selectionMode()==="multiple"&&Q(i.disallowSelectAll)!==!0&&(p.preventDefault(),b.selectAll());break;case"Escape":p.defaultPrevented||(p.preventDefault(),Q(i.disallowEmptySelection)||b.clearSelection());break;case"Tab":if(!Q(i.allowsTabNavigation)){if(p.shiftKey)v.focus();else{const L=_4(v,{tabbable:!0});let I,oe;do oe=L.lastChild(),oe&&(I=oe);while(oe);I&&!I.contains(document.activeElement)&&_t(I)}break}}},d=p=>{var C,x,k,S;const v=Q(i.selectionManager),b=Q(i.keyboardDelegate),w=Q(i.selectOnFocus);if(v.isFocused()){p.currentTarget.contains(p.target)||v.setFocused(!1);return}if(p.currentTarget.contains(p.target)){if(v.setFocused(!0),v.focusedKey()==null){const _=E=>{E!=null&&(v.setFocusedKey(E),w&&v.replaceSelection(E))},O=p.relatedTarget;O&&p.currentTarget.compareDocumentPosition(O)&Node.DOCUMENT_POSITION_FOLLOWING?_((x=v.lastSelectedKey())!=null?x:(C=b.getLastKey)==null?void 0:C.call(b)):_((S=v.firstSelectedKey())!=null?S:(k=b.getFirstKey)==null?void 0:k.call(b))}else if(!Q(i.isVirtualized)){const _=s();if(_){_.scrollTop=a.top,_.scrollLeft=a.left;const O=_.querySelector(`[data-key="${v.focusedKey()}"]`);O&&(_t(O),Fd(_,O))}}}},f=p=>{const v=Q(i.selectionManager);p.currentTarget.contains(p.relatedTarget)||v.setFocused(!1)},h=p=>{s()===p.target&&p.preventDefault()},g=()=>{var k,S;const p=Q(i.autoFocus);if(!p)return;const v=Q(i.selectionManager),b=Q(i.keyboardDelegate);let w;p==="first"&&(w=(k=b.getFirstKey)==null?void 0:k.call(b)),p==="last"&&(w=(S=b.getLastKey)==null?void 0:S.call(b));const C=v.selectedKeys();C.size&&(w=C.values().next().value),v.setFocused(!0),v.setFocusedKey(w);const x=t();x&&w==null&&!Q(i.shouldUseVirtualFocus)&&_t(x)};return dr(()=>{i.deferAutoFocus?setTimeout(g,0):g()}),be(ur([s,()=>Q(i.isVirtualized),()=>Q(i.selectionManager).focusedKey()],p=>{var C;const[v,b,w]=p;if(b)w&&((C=i.scrollToKey)==null||C.call(i,w));else if(w&&v){const x=v.querySelector(`[data-key="${w}"]`);x&&Fd(v,x)}})),{tabIndex:H(()=>{if(!Q(i.shouldUseVirtualFocus))return Q(i.selectionManager).focusedKey()==null?0:-1}),onKeyDown:u,onMouseDown:h,onFocusIn:d,onFocusOut:f}}function E1(e,t){const n=()=>Q(e.selectionManager),r=()=>Q(e.key),i=()=>Q(e.shouldUseVirtualFocus),s=b=>{n().selectionMode()!=="none"&&(n().selectionMode()==="single"?n().isSelected(r())&&!n().disallowEmptySelection()?n().toggleSelection(r()):n().replaceSelection(r()):b!=null&&b.shiftKey?n().extendSelection(r()):n().selectionBehavior()==="toggle"||Gi(b)||"pointerType"in b&&b.pointerType==="touch"?n().toggleSelection(r()):n().replaceSelection(r()))},o=()=>n().isSelected(r()),a=()=>Q(e.disabled)||n().isDisabled(r()),l=()=>!a()&&n().canSelectItem(r());let c=null;const u=b=>{l()&&(c=b.pointerType,b.pointerType==="mouse"&&b.button===0&&!Q(e.shouldSelectOnPressUp)&&s(b))},d=b=>{l()&&b.pointerType==="mouse"&&b.button===0&&Q(e.shouldSelectOnPressUp)&&Q(e.allowsDifferentPressOrigin)&&s(b)},f=b=>{l()&&(Q(e.shouldSelectOnPressUp)&&!Q(e.allowsDifferentPressOrigin)||c!=="mouse")&&s(b)},h=b=>{!l()||!["Enter"," "].includes(b.key)||(O1(b)?n().toggleSelection(r()):s(b))},g=b=>{a()&&b.preventDefault()},m=b=>{const w=t();i()||a()||!w||b.target===w&&n().setFocusedKey(r())},p=H(()=>{if(!(i()||a()))return r()===n().focusedKey()?0:-1}),v=H(()=>Q(e.virtualized)?void 0:r());return be(ur([t,r,i,()=>n().focusedKey(),()=>n().isFocused()],([b,w,C,x,k])=>{b&&w===x&&k&&!C&&document.activeElement!==b&&(e.focus?e.focus():_t(b))})),{isSelected:o,isDisabled:a,allowsSelection:l,tabIndex:p,dataKey:v,onPointerDown:u,onPointerUp:d,onClick:f,onKeyDown:h,onMouseDown:g,onFocus:m}}var aD=class{constructor(e,t){me(this,"collection");me(this,"state");this.collection=e,this.state=t}selectionMode(){return this.state.selectionMode()}disallowEmptySelection(){return this.state.disallowEmptySelection()}selectionBehavior(){return this.state.selectionBehavior()}setSelectionBehavior(e){this.state.setSelectionBehavior(e)}isFocused(){return this.state.isFocused()}setFocused(e){this.state.setFocused(e)}focusedKey(){return this.state.focusedKey()}setFocusedKey(e){(e==null||this.collection().getItem(e))&&this.state.setFocusedKey(e)}selectedKeys(){return this.state.selectedKeys()}isSelected(e){if(this.state.selectionMode()==="none")return!1;const t=this.getKey(e);return t==null?!1:this.state.selectedKeys().has(t)}isEmpty(){return this.state.selectedKeys().size===0}isSelectAll(){if(this.isEmpty())return!1;const e=this.state.selectedKeys();return this.getAllSelectableKeys().every(t=>e.has(t))}firstSelectedKey(){let e;for(const t of this.state.selectedKeys()){const n=this.collection().getItem(t),r=(n==null?void 0:n.index)!=null&&(e==null?void 0:e.index)!=null&&n.index<e.index;(!e||r)&&(e=n)}return e==null?void 0:e.key}lastSelectedKey(){let e;for(const t of this.state.selectedKeys()){const n=this.collection().getItem(t),r=(n==null?void 0:n.index)!=null&&(e==null?void 0:e.index)!=null&&n.index>e.index;(!e||r)&&(e=n)}return e==null?void 0:e.key}extendSelection(e){if(this.selectionMode()==="none")return;if(this.selectionMode()==="single"){this.replaceSelection(e);return}const t=this.getKey(e);if(t==null)return;const n=this.state.selectedKeys(),r=n.anchorKey||t,i=new Zn(n,r,t);for(const s of this.getKeyRange(r,n.currentKey||t))i.delete(s);for(const s of this.getKeyRange(t,r))this.canSelectItem(s)&&i.add(s);this.state.setSelectedKeys(i)}getKeyRange(e,t){const n=this.collection().getItem(e),r=this.collection().getItem(t);return n&&r?n.index!=null&&r.index!=null&&n.index<=r.index?this.getKeyRangeInternal(e,t):this.getKeyRangeInternal(t,e):[]}getKeyRangeInternal(e,t){const n=[];let r=e;for(;r!=null;){const i=this.collection().getItem(r);if(i&&i.type==="item"&&n.push(r),r===t)return n;r=this.collection().getKeyAfter(r)}return[]}getKey(e){const t=this.collection().getItem(e);return t?!t||t.type!=="item"?null:t.key:e}toggleSelection(e){if(this.selectionMode()==="none")return;if(this.selectionMode()==="single"&&!this.isSelected(e)){this.replaceSelection(e);return}const t=this.getKey(e);if(t==null)return;const n=new Zn(this.state.selectedKeys());n.has(t)?n.delete(t):this.canSelectItem(t)&&(n.add(t),n.anchorKey=t,n.currentKey=t),!(this.disallowEmptySelection()&&n.size===0)&&this.state.setSelectedKeys(n)}replaceSelection(e){if(this.selectionMode()==="none")return;const t=this.getKey(e);if(t==null)return;const n=this.canSelectItem(t)?new Zn([t],t,t):new Zn;this.state.setSelectedKeys(n)}setSelectedKeys(e){if(this.selectionMode()==="none")return;const t=new Zn;for(const n of e){const r=this.getKey(n);if(r!=null&&(t.add(r),this.selectionMode()==="single"))break}this.state.setSelectedKeys(t)}selectAll(){this.selectionMode()==="multiple"&&this.state.setSelectedKeys(new Set(this.getAllSelectableKeys()))}clearSelection(){const e=this.state.selectedKeys();!this.disallowEmptySelection()&&e.size>0&&this.state.setSelectedKeys(new Zn)}toggleSelectAll(){this.isSelectAll()?this.clearSelection():this.selectAll()}select(e,t){this.selectionMode()!=="none"&&(this.selectionMode()==="single"?this.isSelected(e)&&!this.disallowEmptySelection()?this.toggleSelection(e):this.replaceSelection(e):this.selectionBehavior()==="toggle"||t&&t.pointerType==="touch"?this.toggleSelection(e):this.replaceSelection(e))}isSelectionEqual(e){if(e===this.state.selectedKeys())return!0;const t=this.selectedKeys();if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;for(const n of t)if(!e.has(n))return!1;return!0}canSelectItem(e){if(this.state.selectionMode()==="none")return!1;const t=this.collection().getItem(e);return t!=null&&!t.disabled}isDisabled(e){const t=this.collection().getItem(e);return!t||t.disabled}getAllSelectableKeys(){const e=[];return(n=>{for(;n!=null;){if(this.canSelectItem(n)){const r=this.collection().getItem(n);if(!r)continue;r.type==="item"&&e.push(n)}n=this.collection().getKeyAfter(n)}})(this.collection().getFirstKey()),e}},qm=class{constructor(e){me(this,"keyMap",new Map);me(this,"iterable");me(this,"firstKey");me(this,"lastKey");this.iterable=e;for(const r of e)this.keyMap.set(r.key,r);if(this.keyMap.size===0)return;let t,n=0;for(const[r,i]of this.keyMap)t?(t.nextKey=r,i.prevKey=t.key):(this.firstKey=r,i.prevKey=void 0),i.type==="item"&&(i.index=n++),t=i,t.nextKey=void 0;this.lastKey=t.key}*[Symbol.iterator](){yield*this.iterable}getSize(){return this.keyMap.size}getKeys(){return this.keyMap.keys()}getKeyBefore(e){var t;return(t=this.keyMap.get(e))==null?void 0:t.prevKey}getKeyAfter(e){var t;return(t=this.keyMap.get(e))==null?void 0:t.nextKey}getFirstKey(){return this.firstKey}getLastKey(){return this.lastKey}getItem(e){return this.keyMap.get(e)}at(e){const t=[...this.getKeys()];return this.getItem(t[e])}};function lD(e){const t=nD(e),r=W4({dataSource:()=>Q(e.dataSource),getKey:()=>Q(e.getKey),getTextValue:()=>Q(e.getTextValue),getDisabled:()=>Q(e.getDisabled),getSectionChildren:()=>Q(e.getSectionChildren),factory:s=>e.filter?new qm(e.filter(s)):new qm(s)},[()=>e.filter]),i=new aD(r,t);return P0(()=>{const s=t.focusedKey();s!=null&&!r().getItem(s)&&t.setFocusedKey(void 0)}),{collection:r,selectionManager:()=>i}}var Ct=e=>typeof e=="function"?e():e,cD=e=>{const t=H(()=>{const o=Ct(e.element);if(o)return getComputedStyle(o)}),n=()=>{var o,a;return(a=(o=t())==null?void 0:o.animationName)!=null?a:"none"},[r,i]=re(Ct(e.show)?"present":"hidden");let s="none";return be(o=>{const a=Ct(e.show);return ot(()=>{var u;if(o===a)return a;const l=s,c=n();a?i("present"):c==="none"||((u=t())==null?void 0:u.display)==="none"?i("hidden"):i(o===!0&&l!==c?"hiding":"hidden")}),a}),be(()=>{const o=Ct(e.element);if(!o)return;const a=c=>{c.target===o&&(s=n())},l=c=>{const d=n().includes(c.animationName);c.target===o&&d&&r()==="hiding"&&i("hidden")};o.addEventListener("animationstart",a),o.addEventListener("animationcancel",l),o.addEventListener("animationend",l),we(()=>{o.removeEventListener("animationstart",a),o.removeEventListener("animationcancel",l),o.removeEventListener("animationend",l)})}),{present:()=>r()==="present"||r()==="hiding",state:r}},uD=cD,A1=uD,rc="data-kb-top-layer",P1,qd=!1,fr=[];function aa(e){return fr.findIndex(t=>t.node===e)}function dD(e){return fr[aa(e)]}function fD(e){return fr[fr.length-1].node===e}function T1(){return fr.filter(e=>e.isPointerBlocking)}function hD(){return[...T1()].slice(-1)[0]}function Kf(){return T1().length>0}function j1(e){var n;const t=aa((n=hD())==null?void 0:n.node);return aa(e)<t}function gD(e){fr.push(e)}function yD(e){const t=aa(e);t<0||fr.splice(t,1)}function mD(){for(const{node:e}of fr)e.style.pointerEvents=j1(e)?"none":"auto"}function pD(e){if(Kf()&&!qd){const t=qn(e);P1=document.body.style.pointerEvents,t.body.style.pointerEvents="none",qd=!0}}function vD(e){if(Kf())return;const t=qn(e);t.body.style.pointerEvents=P1,t.body.style.length===0&&t.body.removeAttribute("style"),qd=!1}var Ht={layers:fr,isTopMostLayer:fD,hasPointerBlockingLayer:Kf,isBelowPointerBlockingLayer:j1,addLayer:gD,removeLayer:yD,indexOf:aa,find:dD,assignPointerEventToLayers:mD,disableBodyPointerEvents:pD,restoreBodyPointerEvents:vD},bD={};Bc(bD,{Button:()=>SD,Root:()=>Uf});var xD=["button","color","file","image","reset","submit"];function wD(e){const t=e.tagName.toLowerCase();return t==="button"?!0:t==="input"&&e.type?xD.indexOf(e.type)!==-1:!1}function Uf(e){let t;const n=Fe({type:"button"},e),[r,i]=We(n,["ref","type","disabled"]),s=Fc(()=>t,()=>"button"),o=H(()=>{const c=s();return c==null?!1:wD({tagName:c,type:r.type})}),a=H(()=>s()==="input"),l=H(()=>s()==="a"&&(t==null?void 0:t.getAttribute("href"))!=null);return j(it,Ee({as:"button",ref(c){const u=Mt(d=>t=d,r.ref);typeof u=="function"&&u(c)},get type(){return o()||a()?r.type:void 0},get role(){return!o()&&!l()?"button":void 0},get tabIndex(){return!o()&&!l()&&!r.disabled?0:void 0},get disabled(){return o()||a()?r.disabled:void 0},get"aria-disabled"(){return!o()&&!a()&&r.disabled?!0:void 0},get"data-disabled"(){return r.disabled?"":void 0}},i))}var SD=Uf,CD=["top","right","bottom","left"],Fn=Math.min,Yt=Math.max,ic=Math.round,vl=Math.floor,Hr=e=>({x:e,y:e}),_D={left:"right",right:"left",bottom:"top",top:"bottom"},kD={start:"end",end:"start"};function zd(e,t,n){return Yt(e,Fn(t,n))}function Fi(e,t){return typeof e=="function"?e(t):e}function Kr(e){return e.split("-")[0]}function Vs(e){return e.split("-")[1]}function M1(e){return e==="x"?"y":"x"}function Wf(e){return e==="y"?"height":"width"}function Mi(e){return["top","bottom"].includes(Kr(e))?"y":"x"}function Vf(e){return M1(Mi(e))}function OD(e,t,n){n===void 0&&(n=!1);const r=Vs(e),i=Vf(e),s=Wf(i);let o=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(o=sc(o)),[o,sc(o)]}function ED(e){const t=sc(e);return[Hd(e),t,Hd(t)]}function Hd(e){return e.replace(/start|end/g,t=>kD[t])}function AD(e,t,n){const r=["left","right"],i=["right","left"],s=["top","bottom"],o=["bottom","top"];switch(e){case"top":case"bottom":return n?t?i:r:t?r:i;case"left":case"right":return t?s:o;default:return[]}}function PD(e,t,n,r){const i=Vs(e);let s=AD(Kr(e),n==="start",r);return i&&(s=s.map(o=>o+"-"+i),t&&(s=s.concat(s.map(Hd)))),s}function sc(e){return e.replace(/left|right|bottom|top/g,t=>_D[t])}function TD(e){return{top:0,right:0,bottom:0,left:0,...e}}function $1(e){return typeof e!="number"?TD(e):{top:e,right:e,bottom:e,left:e}}function oc(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function zm(e,t,n){let{reference:r,floating:i}=e;const s=Mi(t),o=Vf(t),a=Wf(o),l=Kr(t),c=s==="y",u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[a]/2-i[a]/2;let h;switch(l){case"top":h={x:u,y:r.y-i.height};break;case"bottom":h={x:u,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:d};break;case"left":h={x:r.x-i.width,y:d};break;default:h={x:r.x,y:r.y}}switch(Vs(t)){case"start":h[o]-=f*(n&&c?-1:1);break;case"end":h[o]+=f*(n&&c?-1:1);break}return h}var jD=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:s=[],platform:o}=n,a=s.filter(Boolean),l=await(o.isRTL==null?void 0:o.isRTL(t));let c=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=zm(c,r,l),f=r,h={},g=0;for(let m=0;m<a.length;m++){const{name:p,fn:v}=a[m],{x:b,y:w,data:C,reset:x}=await v({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:h,rects:c,platform:o,elements:{reference:e,floating:t}});u=b!=null?b:u,d=w!=null?w:d,h={...h,[p]:{...h[p],...C}},x&&g<=50&&(g++,typeof x=="object"&&(x.placement&&(f=x.placement),x.rects&&(c=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=zm(c,f,l)),m=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:h}};async function la(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:s,rects:o,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:h=0}=Fi(t,e),g=$1(h),p=a[f?d==="floating"?"reference":"floating":d],v=oc(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(p)))==null||n?p:p.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),b=d==="floating"?{x:r,y:i,width:o.floating.width,height:o.floating.height}:o.reference,w=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),C=await(s.isElement==null?void 0:s.isElement(w))?await(s.getScale==null?void 0:s.getScale(w))||{x:1,y:1}:{x:1,y:1},x=oc(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:b,offsetParent:w,strategy:l}):b);return{top:(v.top-x.top+g.top)/C.y,bottom:(x.bottom-v.bottom+g.bottom)/C.y,left:(v.left-x.left+g.left)/C.x,right:(x.right-v.right+g.right)/C.x}}var MD=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:s,platform:o,elements:a,middlewareData:l}=t,{element:c,padding:u=0}=Fi(e,t)||{};if(c==null)return{};const d=$1(u),f={x:n,y:r},h=Vf(i),g=Wf(h),m=await o.getDimensions(c),p=h==="y",v=p?"top":"left",b=p?"bottom":"right",w=p?"clientHeight":"clientWidth",C=s.reference[g]+s.reference[h]-f[h]-s.floating[g],x=f[h]-s.reference[h],k=await(o.getOffsetParent==null?void 0:o.getOffsetParent(c));let S=k?k[w]:0;(!S||!await(o.isElement==null?void 0:o.isElement(k)))&&(S=a.floating[w]||s.floating[g]);const _=C/2-x/2,O=S/2-m[g]/2-1,E=Fn(d[v],O),T=Fn(d[b],O),D=E,V=S-m[g]-T,N=S/2-m[g]/2+_,$=zd(D,N,V),L=!l.arrow&&Vs(i)!=null&&N!==$&&s.reference[g]/2-(N<D?E:T)-m[g]/2<0,I=L?N<D?N-D:N-V:0;return{[h]:f[h]+I,data:{[h]:$,centerOffset:N-$-I,...L&&{alignmentOffset:I}},reset:L}}}),$D=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:s,rects:o,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:m=!0,...p}=Fi(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const v=Kr(i),b=Mi(a),w=Kr(a)===a,C=await(l.isRTL==null?void 0:l.isRTL(c.floating)),x=f||(w||!m?[sc(a)]:ED(a)),k=g!=="none";!f&&k&&x.push(...PD(a,m,g,C));const S=[a,...x],_=await la(t,p),O=[];let E=((r=s.flip)==null?void 0:r.overflows)||[];if(u&&O.push(_[v]),d){const N=OD(i,o,C);O.push(_[N[0]],_[N[1]])}if(E=[...E,{placement:i,overflows:O}],!O.every(N=>N<=0)){var T,D;const N=(((T=s.flip)==null?void 0:T.index)||0)+1,$=S[N];if($)return{data:{index:N,overflows:E},reset:{placement:$}};let L=(D=E.filter(I=>I.overflows[0]<=0).sort((I,oe)=>I.overflows[1]-oe.overflows[1])[0])==null?void 0:D.placement;if(!L)switch(h){case"bestFit":{var V;const I=(V=E.filter(oe=>{if(k){const ue=Mi(oe.placement);return ue===b||ue==="y"}return!0}).map(oe=>[oe.placement,oe.overflows.filter(ue=>ue>0).reduce((ue,B)=>ue+B,0)]).sort((oe,ue)=>oe[1]-ue[1])[0])==null?void 0:V[0];I&&(L=I);break}case"initialPlacement":L=a;break}if(i!==L)return{reset:{placement:L}}}return{}}}};function Hm(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Km(e){return CD.some(t=>e[t]>=0)}var DD=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...i}=Fi(e,t);switch(r){case"referenceHidden":{const s=await la(t,{...i,elementContext:"reference"}),o=Hm(s,n.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:Km(o)}}}case"escaped":{const s=await la(t,{...i,altBoundary:!0}),o=Hm(s,n.floating);return{data:{escapedOffsets:o,escaped:Km(o)}}}default:return{}}}}};async function LD(e,t){const{placement:n,platform:r,elements:i}=e,s=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Kr(n),a=Vs(n),l=Mi(n)==="y",c=["left","top"].includes(o)?-1:1,u=s&&l?-1:1,d=Fi(t,e);let{mainAxis:f,crossAxis:h,alignmentAxis:g}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return a&&typeof g=="number"&&(h=a==="end"?g*-1:g),l?{x:h*u,y:f*c}:{x:f*c,y:h*u}}var ID=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:s,placement:o,middlewareData:a}=t,l=await LD(t,e);return o===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:s+l.y,data:{...l,placement:o}}}}},RD=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:s=!0,crossAxis:o=!1,limiter:a={fn:p=>{let{x:v,y:b}=p;return{x:v,y:b}}},...l}=Fi(e,t),c={x:n,y:r},u=await la(t,l),d=Mi(Kr(i)),f=M1(d);let h=c[f],g=c[d];if(s){const p=f==="y"?"top":"left",v=f==="y"?"bottom":"right",b=h+u[p],w=h-u[v];h=zd(b,h,w)}if(o){const p=d==="y"?"top":"left",v=d==="y"?"bottom":"right",b=g+u[p],w=g-u[v];g=zd(b,g,w)}const m=a.fn({...t,[f]:h,[d]:g});return{...m,data:{x:m.x-n,y:m.y-r}}}}},ND=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:i,elements:s}=t,{apply:o=()=>{},...a}=Fi(e,t),l=await la(t,a),c=Kr(n),u=Vs(n),d=Mi(n)==="y",{width:f,height:h}=r.floating;let g,m;c==="top"||c==="bottom"?(g=c,m=u===(await(i.isRTL==null?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(m=c,g=u==="end"?"top":"bottom");const p=h-l.top-l.bottom,v=f-l.left-l.right,b=Fn(h-l[g],p),w=Fn(f-l[m],v),C=!t.middlewareData.shift;let x=b,k=w;if(d?k=u||C?Fn(w,v):v:x=u||C?Fn(b,p):p,C&&!u){const _=Yt(l.left,0),O=Yt(l.right,0),E=Yt(l.top,0),T=Yt(l.bottom,0);d?k=f-2*(_!==0||O!==0?_+O:Yt(l.left,l.right)):x=h-2*(E!==0||T!==0?E+T:Yt(l.top,l.bottom))}await o({...t,availableWidth:k,availableHeight:x});const S=await i.getDimensions(s.floating);return f!==S.width||h!==S.height?{reset:{rects:!0}}:{}}}};function Gs(e){return D1(e)?(e.nodeName||"").toLowerCase():"#document"}function Zt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function yr(e){var t;return(t=(D1(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function D1(e){return e instanceof Node||e instanceof Zt(e).Node}function Cn(e){return e instanceof Element||e instanceof Zt(e).Element}function zn(e){return e instanceof HTMLElement||e instanceof Zt(e).HTMLElement}function Um(e){return typeof ShadowRoot=="undefined"?!1:e instanceof ShadowRoot||e instanceof Zt(e).ShadowRoot}function Ba(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=_n(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function FD(e){return["table","td","th"].includes(Gs(e))}function qc(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch(n){return!1}})}function Gf(e){const t=Qf(),n=Cn(e)?_n(e):e;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function BD(e){let t=Ur(e);for(;zn(t)&&!Rs(t);){if(Gf(t))return t;if(qc(t))return null;t=Ur(t)}return null}function Qf(){return typeof CSS=="undefined"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Rs(e){return["html","body","#document"].includes(Gs(e))}function _n(e){return Zt(e).getComputedStyle(e)}function zc(e){return Cn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ur(e){if(Gs(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Um(e)&&e.host||yr(e);return Um(t)?t.host:t}function L1(e){const t=Ur(e);return Rs(t)?e.ownerDocument?e.ownerDocument.body:e.body:zn(t)&&Ba(t)?t:L1(t)}function ca(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=L1(e),s=i===((r=e.ownerDocument)==null?void 0:r.body),o=Zt(i);return s?t.concat(o,o.visualViewport||[],Ba(i)?i:[],o.frameElement&&n?ca(o.frameElement):[]):t.concat(i,ca(i,[],n))}function I1(e){const t=_n(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=zn(e),s=i?e.offsetWidth:n,o=i?e.offsetHeight:r,a=ic(n)!==s||ic(r)!==o;return a&&(n=s,r=o),{width:n,height:r,$:a}}function Yf(e){return Cn(e)?e:e.contextElement}function ts(e){const t=Yf(e);if(!zn(t))return Hr(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:s}=I1(t);let o=(s?ic(n.width):n.width)/r,a=(s?ic(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}var qD=Hr(0);function R1(e){const t=Zt(e);return!Qf()||!t.visualViewport?qD:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function zD(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Zt(e)?!1:t}function $i(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),s=Yf(e);let o=Hr(1);t&&(r?Cn(r)&&(o=ts(r)):o=ts(e));const a=zD(s,n,r)?R1(s):Hr(0);let l=(i.left+a.x)/o.x,c=(i.top+a.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(s){const f=Zt(s),h=r&&Cn(r)?Zt(r):r;let g=f,m=g.frameElement;for(;m&&r&&h!==g;){const p=ts(m),v=m.getBoundingClientRect(),b=_n(m),w=v.left+(m.clientLeft+parseFloat(b.paddingLeft))*p.x,C=v.top+(m.clientTop+parseFloat(b.paddingTop))*p.y;l*=p.x,c*=p.y,u*=p.x,d*=p.y,l+=w,c+=C,g=Zt(m),m=g.frameElement}}return oc({width:u,height:d,x:l,y:c})}function HD(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const s=i==="fixed",o=yr(r),a=t?qc(t.floating):!1;if(r===o||a&&s)return n;let l={scrollLeft:0,scrollTop:0},c=Hr(1);const u=Hr(0),d=zn(r);if((d||!d&&!s)&&((Gs(r)!=="body"||Ba(o))&&(l=zc(r)),zn(r))){const f=$i(r);c=ts(r),u.x=f.x+r.clientLeft,u.y=f.y+r.clientTop}return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x,y:n.y*c.y-l.scrollTop*c.y+u.y}}function KD(e){return Array.from(e.getClientRects())}function N1(e){return $i(yr(e)).left+zc(e).scrollLeft}function UD(e){const t=yr(e),n=zc(e),r=e.ownerDocument.body,i=Yt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=Yt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+N1(e);const a=-n.scrollTop;return _n(r).direction==="rtl"&&(o+=Yt(t.clientWidth,r.clientWidth)-i),{width:i,height:s,x:o,y:a}}function WD(e,t){const n=Zt(e),r=yr(e),i=n.visualViewport;let s=r.clientWidth,o=r.clientHeight,a=0,l=0;if(i){s=i.width,o=i.height;const c=Qf();(!c||c&&t==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}return{width:s,height:o,x:a,y:l}}function VD(e,t){const n=$i(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,s=zn(e)?ts(e):Hr(1),o=e.clientWidth*s.x,a=e.clientHeight*s.y,l=i*s.x,c=r*s.y;return{width:o,height:a,x:l,y:c}}function Wm(e,t,n){let r;if(t==="viewport")r=WD(e,n);else if(t==="document")r=UD(yr(e));else if(Cn(t))r=VD(t,n);else{const i=R1(e);r={...t,x:t.x-i.x,y:t.y-i.y}}return oc(r)}function F1(e,t){const n=Ur(e);return n===t||!Cn(n)||Rs(n)?!1:_n(n).position==="fixed"||F1(n,t)}function GD(e,t){const n=t.get(e);if(n)return n;let r=ca(e,[],!1).filter(a=>Cn(a)&&Gs(a)!=="body"),i=null;const s=_n(e).position==="fixed";let o=s?Ur(e):e;for(;Cn(o)&&!Rs(o);){const a=_n(o),l=Gf(o);!l&&a.position==="fixed"&&(i=null),(s?!l&&!i:!l&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Ba(o)&&!l&&F1(e,o))?r=r.filter(u=>u!==o):i=a,o=Ur(o)}return t.set(e,r),r}function QD(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o=[...n==="clippingAncestors"?qc(t)?[]:GD(t,this._c):[].concat(n),r],a=o[0],l=o.reduce((c,u)=>{const d=Wm(t,u,i);return c.top=Yt(d.top,c.top),c.right=Fn(d.right,c.right),c.bottom=Fn(d.bottom,c.bottom),c.left=Yt(d.left,c.left),c},Wm(t,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function YD(e){const{width:t,height:n}=I1(e);return{width:t,height:n}}function XD(e,t,n){const r=zn(t),i=yr(t),s=n==="fixed",o=$i(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const l=Hr(0);if(r||!r&&!s)if((Gs(t)!=="body"||Ba(i))&&(a=zc(t)),r){const d=$i(t,!0,s,t);l.x=d.x+t.clientLeft,l.y=d.y+t.clientTop}else i&&(l.x=N1(i));const c=o.left+a.scrollLeft-l.x,u=o.top+a.scrollTop-l.y;return{x:c,y:u,width:o.width,height:o.height}}function Mu(e){return _n(e).position==="static"}function Vm(e,t){return!zn(e)||_n(e).position==="fixed"?null:t?t(e):e.offsetParent}function B1(e,t){const n=Zt(e);if(qc(e))return n;if(!zn(e)){let i=Ur(e);for(;i&&!Rs(i);){if(Cn(i)&&!Mu(i))return i;i=Ur(i)}return n}let r=Vm(e,t);for(;r&&FD(r)&&Mu(r);)r=Vm(r,t);return r&&Rs(r)&&Mu(r)&&!Gf(r)?n:r||BD(e)||n}var JD=async function(e){const t=this.getOffsetParent||B1,n=this.getDimensions,r=await n(e.floating);return{reference:XD(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function ZD(e){return _n(e).direction==="rtl"}var q1={convertOffsetParentRelativeRectToViewportRelativeRect:HD,getDocumentElement:yr,getClippingRect:QD,getOffsetParent:B1,getElementRects:JD,getClientRects:KD,getDimensions:YD,getScale:ts,isElement:Cn,isRTL:ZD};function e6(e,t){let n=null,r;const i=yr(e);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function o(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),s();const{left:c,top:u,width:d,height:f}=e.getBoundingClientRect();if(a||t(),!d||!f)return;const h=vl(u),g=vl(i.clientWidth-(c+d)),m=vl(i.clientHeight-(u+f)),p=vl(c),b={rootMargin:-h+"px "+-g+"px "+-m+"px "+-p+"px",threshold:Yt(0,Fn(1,l))||1};let w=!0;function C(x){const k=x[0].intersectionRatio;if(k!==l){if(!w)return o();k?o(!1,k):r=setTimeout(()=>{o(!1,1e-7)},1e3)}w=!1}try{n=new IntersectionObserver(C,{...b,root:i.ownerDocument})}catch(x){n=new IntersectionObserver(C,b)}n.observe(e)}return o(!0),s}function t6(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=Yf(e),u=i||s?[...c?ca(c):[],...ca(t)]:[];u.forEach(v=>{i&&v.addEventListener("scroll",n,{passive:!0}),s&&v.addEventListener("resize",n)});const d=c&&a?e6(c,n):null;let f=-1,h=null;o&&(h=new ResizeObserver(v=>{let[b]=v;b&&b.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var w;(w=h)==null||w.observe(t)})),n()}),c&&!l&&h.observe(c),h.observe(t));let g,m=l?$i(e):null;l&&p();function p(){const v=$i(e);m&&(v.x!==m.x||v.y!==m.y||v.width!==m.width||v.height!==m.height)&&n(),m=v,g=requestAnimationFrame(p)}return n(),()=>{var v;u.forEach(b=>{i&&b.removeEventListener("scroll",n),s&&b.removeEventListener("resize",n)}),d==null||d(),(v=h)==null||v.disconnect(),h=null,l&&cancelAnimationFrame(g)}}var n6=ID,r6=RD,i6=$D,s6=ND,o6=DD,a6=MD,l6=(e,t,n)=>{const r=new Map,i={platform:q1,...n},s={...i.platform,_c:r};return jD(e,t,{...i,platform:s})},Xf=pt();function Jf(){const e=vt(Xf);if(e===void 0)throw new Error("[kobalte]: `usePopperContext` must be used within a `Popper` component");return e}var c6=le('<svg display="block" viewBox="0 0 30 30" style="transform:scale(1.02)"><g><path fill="none" d="M23,27.8c1.1,1.2,3.4,2.2,5,2.2h2H0h2c1.7,0,3.9-1,5-2.2l6.6-7.2c0.7-0.8,2-0.8,2.7,0L23,27.8L23,27.8z"></path><path stroke="none" d="M23,27.8c1.1,1.2,3.4,2.2,5,2.2h2H0h2c1.7,0,3.9-1,5-2.2l6.6-7.2c0.7-0.8,2-0.8,2.7,0L23,27.8L23,27.8z">'),Kd=30,Gm=Kd/2,u6={top:180,right:-90,bottom:0,left:90};function Zf(e){const t=Jf(),n=Fe({size:Kd},e),[r,i]=We(n,["ref","style","size"]),s=()=>t.currentPlacement().split("-")[0],o=d6(t.contentRef),a=()=>{var f;return((f=o())==null?void 0:f.getPropertyValue("background-color"))||"none"},l=()=>{var f;return((f=o())==null?void 0:f.getPropertyValue(`border-${s()}-color`))||"none"},c=()=>{var f;return((f=o())==null?void 0:f.getPropertyValue(`border-${s()}-width`))||"0px"},u=()=>Number.parseInt(c())*2*(Kd/r.size),d=()=>`rotate(${u6[s()]} ${Gm} ${Gm}) translate(0 2)`;return j(it,Ee({as:"div",ref(f){const h=Mt(t.setArrowRef,r.ref);typeof h=="function"&&h(f)},"aria-hidden":"true",get style(){return Rc({position:"absolute","font-size":`${r.size}px`,width:"1em",height:"1em","pointer-events":"none",fill:a(),stroke:l(),"stroke-width":u()},r.style)}},i,{get children(){const f=c6(),h=f.firstChild;return ve(()=>Z(h,"transform",d())),f}}))}function d6(e){const[t,n]=re();return be(()=>{const r=e();r&&n(u4(r).getComputedStyle(r))}),t}function f6(e){const t=Jf(),[n,r]=We(e,["ref","style"]);return j(it,Ee({as:"div",ref(i){const s=Mt(t.setPositionerRef,n.ref);typeof s=="function"&&s(i)},"data-popper-positioner":"",get style(){return Rc({position:"absolute",top:0,left:0,"min-width":"max-content"},n.style)}},r))}function Qm(e){const{x:t=0,y:n=0,width:r=0,height:i=0}=e!=null?e:{};if(typeof DOMRect=="function")return new DOMRect(t,n,r,i);const s={x:t,y:n,width:r,height:i,top:n,right:t+r,bottom:n+i,left:t};return{...s,toJSON:()=>s}}function h6(e,t){return{contextElement:e,getBoundingClientRect:()=>{const r=t(e);return r?Qm(r):e?e.getBoundingClientRect():Qm()}}}function g6(e){return/^(?:top|bottom|left|right)(?:-(?:start|end))?$/.test(e)}var y6={top:"bottom",right:"left",bottom:"top",left:"right"};function m6(e,t){const[n,r]=e.split("-"),i=y6[n];return r?n==="left"||n==="right"?`${i} ${r==="start"?"top":"bottom"}`:r==="start"?`${i} ${t==="rtl"?"right":"left"}`:`${i} ${t==="rtl"?"left":"right"}`:`${i} center`}function p6(e){const t=Fe({getAnchorRect:f=>f==null?void 0:f.getBoundingClientRect(),placement:"bottom",gutter:0,shift:0,flip:!0,slide:!0,overlap:!1,sameWidth:!1,fitViewport:!1,hideWhenDetached:!1,detachedPadding:0,arrowPadding:4,overflowPadding:8},e),[n,r]=re(),[i,s]=re(),[o,a]=re(t.placement),l=()=>{var f;return h6((f=t.anchorRef)==null?void 0:f.call(t),t.getAnchorRect)},{direction:c}=Qr();async function u(){var k,S,_;const f=l(),h=n(),g=i();if(!f||!h)return;const m=((g==null?void 0:g.clientHeight)||0)/2,p=typeof t.gutter=="number"?t.gutter+m:(k=t.gutter)!=null?k:m;h.style.setProperty("--kb-popper-content-overflow-padding",`${t.overflowPadding}px`),f.getBoundingClientRect();const v=[n6(({placement:O})=>{const E=!!O.split("-")[1];return{mainAxis:p,crossAxis:E?void 0:t.shift,alignmentAxis:t.shift}})];if(t.flip!==!1){const O=typeof t.flip=="string"?t.flip.split(" "):void 0;if(O!==void 0&&!O.every(g6))throw new Error("`flip` expects a spaced-delimited list of placements");v.push(i6({padding:t.overflowPadding,fallbackPlacements:O}))}(t.slide||t.overlap)&&v.push(r6({mainAxis:t.slide,crossAxis:t.overlap,padding:t.overflowPadding})),v.push(s6({padding:t.overflowPadding,apply({availableWidth:O,availableHeight:E,rects:T}){const D=Math.round(T.reference.width);O=Math.floor(O),E=Math.floor(E),h.style.setProperty("--kb-popper-anchor-width",`${D}px`),h.style.setProperty("--kb-popper-content-available-width",`${O}px`),h.style.setProperty("--kb-popper-content-available-height",`${E}px`),t.sameWidth&&(h.style.width=`${D}px`),t.fitViewport&&(h.style.maxWidth=`${O}px`,h.style.maxHeight=`${E}px`)}})),t.hideWhenDetached&&v.push(o6({padding:t.detachedPadding})),g&&v.push(a6({element:g,padding:t.arrowPadding}));const b=await l6(f,h,{placement:t.placement,strategy:"absolute",middleware:v,platform:{...q1,isRTL:()=>c()==="rtl"}});if(a(b.placement),(S=t.onCurrentPlacementChange)==null||S.call(t,b.placement),!h)return;h.style.setProperty("--kb-popper-content-transform-origin",m6(b.placement,c()));const w=Math.round(b.x),C=Math.round(b.y);let x;if(t.hideWhenDetached&&(x=(_=b.middlewareData.hide)!=null&&_.referenceHidden?"hidden":"visible"),Object.assign(h.style,{top:"0",left:"0",transform:`translate3d(${w}px, ${C}px, 0)`,visibility:x}),g&&b.middlewareData.arrow){const{x:O,y:E}=b.middlewareData.arrow,T=b.placement.split("-")[0];Object.assign(g.style,{left:O!=null?`${O}px`:"",top:E!=null?`${E}px`:"",[T]:"100%"})}}be(()=>{const f=l(),h=n();if(!f||!h)return;const g=t6(f,h,u,{elementResize:typeof ResizeObserver=="function"});we(g)}),be(()=>{var g;const f=n(),h=(g=t.contentRef)==null?void 0:g.call(t);!f||!h||queueMicrotask(()=>{f.style.zIndex=getComputedStyle(h).zIndex})});const d={currentPlacement:o,contentRef:()=>{var f;return(f=t.contentRef)==null?void 0:f.call(t)},setPositionerRef:r,setArrowRef:s};return j(Xf.Provider,{value:d,get children(){return t.children}})}var z1=Object.assign(p6,{Arrow:Zf,Context:Xf,usePopperContext:Jf,Positioner:f6});function v6(e){const t=n=>{var r;n.key===Bf.Escape&&((r=e.onEscapeKeyDown)==null||r.call(e,n))};be(()=>{var r,i;if(Q(e.isDisabled))return;const n=(i=(r=e.ownerDocument)==null?void 0:r.call(e))!=null?i:qn();n.addEventListener("keydown",t),we(()=>{n.removeEventListener("keydown",t)})})}var Ym="interactOutside.pointerDownOutside",Xm="interactOutside.focusOutside";function b6(e,t){let n,r=O4;const i=()=>qn(t()),s=d=>{var f;return(f=e.onPointerDownOutside)==null?void 0:f.call(e,d)},o=d=>{var f;return(f=e.onFocusOutside)==null?void 0:f.call(e,d)},a=d=>{var f;return(f=e.onInteractOutside)==null?void 0:f.call(e,d)},l=d=>{var h;const f=d.target;return!(f instanceof HTMLElement)||f.closest(`[${rc}]`)||!un(i(),f)||un(t(),f)?!1:!((h=e.shouldExcludeElement)!=null&&h.call(e,f))},c=d=>{function f(){const h=t(),g=d.target;if(!h||!g||!l(d))return;const m=gt([s,a]);g.addEventListener(Ym,m,{once:!0});const p=new CustomEvent(Ym,{bubbles:!1,cancelable:!0,detail:{originalEvent:d,isContextMenu:d.button===2||y4(d)&&d.button===0}});g.dispatchEvent(p)}d.pointerType==="touch"?(i().removeEventListener("click",f),r=f,i().addEventListener("click",f,{once:!0})):f()},u=d=>{const f=t(),h=d.target;if(!f||!h||!l(d))return;const g=gt([o,a]);h.addEventListener(Xm,g,{once:!0});const m=new CustomEvent(Xm,{bubbles:!1,cancelable:!0,detail:{originalEvent:d,isContextMenu:!1}});h.dispatchEvent(m)};be(()=>{Q(e.isDisabled)||(n=window.setTimeout(()=>{i().addEventListener("pointerdown",c,!0)},0),i().addEventListener("focusin",u,!0),we(()=>{window.clearTimeout(n),i().removeEventListener("click",r),i().removeEventListener("pointerdown",c,!0),i().removeEventListener("focusin",u,!0)}))})}var H1=pt();function x6(){return vt(H1)}function w6(e){let t;const n=x6(),[r,i]=We(e,["ref","disableOutsidePointerEvents","excludedElements","onEscapeKeyDown","onPointerDownOutside","onFocusOutside","onInteractOutside","onDismiss","bypassTopMostLayerCheck"]),s=new Set([]),o=d=>{s.add(d);const f=n==null?void 0:n.registerNestedLayer(d);return()=>{s.delete(d),f==null||f()}};b6({shouldExcludeElement:d=>{var f;return t?((f=r.excludedElements)==null?void 0:f.some(h=>un(h(),d)))||[...s].some(h=>un(h,d)):!1},onPointerDownOutside:d=>{var f,h,g;!t||Ht.isBelowPointerBlockingLayer(t)||!r.bypassTopMostLayerCheck&&!Ht.isTopMostLayer(t)||((f=r.onPointerDownOutside)==null||f.call(r,d),(h=r.onInteractOutside)==null||h.call(r,d),d.defaultPrevented||(g=r.onDismiss)==null||g.call(r))},onFocusOutside:d=>{var f,h,g;(f=r.onFocusOutside)==null||f.call(r,d),(h=r.onInteractOutside)==null||h.call(r,d),d.defaultPrevented||(g=r.onDismiss)==null||g.call(r)}},()=>t),v6({ownerDocument:()=>qn(t),onEscapeKeyDown:d=>{var f;!t||!Ht.isTopMostLayer(t)||((f=r.onEscapeKeyDown)==null||f.call(r,d),!d.defaultPrevented&&r.onDismiss&&(d.preventDefault(),r.onDismiss()))}}),dr(()=>{if(!t)return;Ht.addLayer({node:t,isPointerBlocking:r.disableOutsidePointerEvents,dismiss:r.onDismiss});const d=n==null?void 0:n.registerNestedLayer(t);Ht.assignPointerEventToLayers(),Ht.disableBodyPointerEvents(t),we(()=>{t&&(Ht.removeLayer(t),d==null||d(),Ht.assignPointerEventToLayers(),Ht.restoreBodyPointerEvents(t))})}),be(ur([()=>t,()=>r.disableOutsidePointerEvents],([d,f])=>{if(!d)return;const h=Ht.find(d);h&&h.isPointerBlocking!==f&&(h.isPointerBlocking=f,Ht.assignPointerEventToLayers()),f&&Ht.disableBodyPointerEvents(d),we(()=>{Ht.restoreBodyPointerEvents(d)})},{defer:!0}));const u={registerNestedLayer:o};return j(H1.Provider,{value:u,get children(){return j(it,Ee({as:"div",ref(d){const f=Mt(h=>t=h,r.ref);typeof f=="function"&&f(d)}},i))}})}function K1(e={}){const[t,n]=v1({value:()=>Q(e.open),defaultValue:()=>!!Q(e.defaultOpen),onChange:o=>{var a;return(a=e.onOpenChange)==null?void 0:a.call(e,o)}}),r=()=>{n(!0)},i=()=>{n(!1)};return{isOpen:t,setIsOpen:n,open:r,close:i,toggle:()=>{t()?i():r()}}}var sn={};Bc(sn,{Description:()=>m1,ErrorMessage:()=>p1,Item:()=>G1,ItemControl:()=>Q1,ItemDescription:()=>Y1,ItemIndicator:()=>X1,ItemInput:()=>J1,ItemLabel:()=>Z1,Label:()=>ex,RadioGroup:()=>S6,Root:()=>tx});var U1=pt();function W1(){const e=vt(U1);if(e===void 0)throw new Error("[kobalte]: `useRadioGroupContext` must be used within a `RadioGroup` component");return e}var V1=pt();function qa(){const e=vt(V1);if(e===void 0)throw new Error("[kobalte]: `useRadioGroupItemContext` must be used within a `RadioGroup.Item` component");return e}function G1(e){const t=Na(),n=W1(),r=`${t.generateId("item")}-${yn()}`,i=Fe({id:r},e),[s,o]=We(i,["value","disabled","onPointerDown"]),[a,l]=re(),[c,u]=re(),[d,f]=re(),[h,g]=re(),[m,p]=re(!1),v=H(()=>n.isSelectedValue(s.value)),b=H(()=>s.disabled||t.isDisabled()||!1),w=k=>{tt(k,s.onPointerDown),m()&&k.preventDefault()},C=H(()=>({...t.dataset(),"data-disabled":b()?"":void 0,"data-checked":v()?"":void 0})),x={value:()=>s.value,dataset:C,isSelected:v,isDisabled:b,inputId:a,labelId:c,descriptionId:d,inputRef:h,select:()=>n.setSelectedValue(s.value),generateId:Ra(()=>o.id),registerInput:dn(l),registerLabel:dn(u),registerDescription:dn(f),setIsFocused:p,setInputRef:g};return j(V1.Provider,{value:x,get children(){return j(it,Ee({as:"div",role:"group",onPointerDown:w},C,o))}})}function Q1(e){const t=qa(),n=Fe({id:t.generateId("control")},e),[r,i]=We(n,["onClick","onKeyDown"]);return j(it,Ee({as:"div",onClick:a=>{var l;tt(a,r.onClick),t.select(),(l=t.inputRef())==null||l.focus()},onKeyDown:a=>{var l;tt(a,r.onKeyDown),a.key===Bf.Space&&(t.select(),(l=t.inputRef())==null||l.focus())}},()=>t.dataset(),i))}function Y1(e){const t=qa(),n=Fe({id:t.generateId("description")},e);return be(()=>we(t.registerDescription(n.id))),j(it,Ee({as:"div"},()=>t.dataset(),n))}function X1(e){const t=qa(),n=Fe({id:t.generateId("indicator")},e),[r,i]=We(n,["ref","forceMount"]),[s,o]=re(),{present:a}=A1({show:()=>r.forceMount||t.isSelected(),element:()=>{var l;return(l=s())!=null?l:null}});return j(pe,{get when(){return a()},get children(){return j(it,Ee({as:"div",ref(l){const c=Mt(o,r.ref);typeof c=="function"&&c(l)}},()=>t.dataset(),i))}})}function J1(e){const t=Na(),n=W1(),r=qa(),i=Fe({id:r.generateId("input")},e),[s,o]=We(i,["ref","style","aria-labelledby","aria-describedby","onChange","onFocus","onBlur"]),a=()=>[s["aria-labelledby"],r.labelId(),s["aria-labelledby"]!=null&&o["aria-label"]!=null?o.id:void 0].filter(Boolean).join(" ")||void 0,l=()=>[s["aria-describedby"],r.descriptionId(),n.ariaDescribedBy()].filter(Boolean).join(" ")||void 0,[c,u]=re(!1),d=g=>{if(tt(g,s.onChange),g.stopPropagation(),!c()){n.setSelectedValue(r.value());const m=g.target;m.checked=r.isSelected()}u(!1)},f=g=>{tt(g,s.onFocus),r.setIsFocused(!0)},h=g=>{tt(g,s.onBlur),r.setIsFocused(!1)};return be(ur([()=>r.isSelected(),()=>r.value()],g=>{if(!g[0]&&g[1]===r.value())return;u(!0);const m=r.inputRef();m==null||m.dispatchEvent(new Event("input",{bubbles:!0,cancelable:!0})),m==null||m.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0}))},{defer:!0})),be(()=>we(r.registerInput(o.id))),j(it,Ee({as:"input",ref(g){const m=Mt(r.setInputRef,s.ref);typeof m=="function"&&m(g)},type:"radio",get name(){return t.name()},get value(){return r.value()},get checked(){return r.isSelected()},get required(){return t.isRequired()},get disabled(){return r.isDisabled()},get readonly(){return t.isReadOnly()},get style(){return Rc({...g1},s.style)},get"aria-labelledby"(){return a()},get"aria-describedby"(){return l()},onChange:d,onFocus:f,onBlur:h},()=>r.dataset(),o))}function Z1(e){const t=qa(),n=Fe({id:t.generateId("label")},e);return be(()=>we(t.registerLabel(n.id))),j(it,Ee({as:"label",get for(){return t.inputId()}},()=>t.dataset(),n))}function ex(e){return j(j4,Ee({as:"span"},e))}function tx(e){let t;const n=`radiogroup-${yn()}`,r=Fe({id:n,orientation:"vertical"},e),[i,s,o]=We(r,["ref","value","defaultValue","onChange","orientation","aria-labelledby","aria-describedby"],P4),[a,l]=Fa({value:()=>i.value,defaultValue:()=>i.defaultValue,onChange:g=>{var m;return(m=i.onChange)==null?void 0:m.call(i,g)}}),{formControlContext:c}=T4(s);M4(()=>t,()=>{var g;return l((g=i.defaultValue)!=null?g:"")});const u=()=>c.getAriaLabelledBy(Q(s.id),o["aria-label"],i["aria-labelledby"]),d=()=>c.getAriaDescribedBy(i["aria-describedby"]),f=g=>g===a(),h={ariaDescribedBy:d,isSelectedValue:f,setSelectedValue:g=>{if(!(c.isReadOnly()||c.isDisabled())&&(l(g),t))for(const m of t.querySelectorAll("[type='radio']")){const p=m;p.checked=f(p.value)}}};return j(y1.Provider,{value:c,get children(){return j(U1.Provider,{value:h,get children(){return j(it,Ee({as:"div",ref(g){const m=Mt(p=>t=p,i.ref);typeof m=="function"&&m(g)},role:"radiogroup",get id(){return Q(s.id)},get"aria-invalid"(){return c.validationState()==="invalid"||void 0},get"aria-required"(){return c.isRequired()||void 0},get"aria-disabled"(){return c.isDisabled()||void 0},get"aria-readonly"(){return c.isReadOnly()||void 0},get"aria-orientation"(){return i.orientation},get"aria-labelledby"(){return u()},get"aria-describedby"(){return d()}},()=>c.dataset(),o))}})}})}var S6=Object.assign(tx,{Description:m1,ErrorMessage:p1,Item:G1,ItemControl:Q1,ItemDescription:Y1,ItemIndicator:X1,ItemInput:J1,ItemLabel:Z1,Label:ex}),C6=class{constructor(e,t,n){me(this,"collection");me(this,"ref");me(this,"collator");this.collection=e,this.ref=t,this.collator=n}getKeyBelow(e){let t=this.collection().getKeyAfter(e);for(;t!=null;){const n=this.collection().getItem(t);if(n&&n.type==="item"&&!n.disabled)return t;t=this.collection().getKeyAfter(t)}}getKeyAbove(e){let t=this.collection().getKeyBefore(e);for(;t!=null;){const n=this.collection().getItem(t);if(n&&n.type==="item"&&!n.disabled)return t;t=this.collection().getKeyBefore(t)}}getFirstKey(){let e=this.collection().getFirstKey();for(;e!=null;){const t=this.collection().getItem(e);if(t&&t.type==="item"&&!t.disabled)return e;e=this.collection().getKeyAfter(e)}}getLastKey(){let e=this.collection().getLastKey();for(;e!=null;){const t=this.collection().getItem(e);if(t&&t.type==="item"&&!t.disabled)return e;e=this.collection().getKeyBefore(e)}}getItem(e){var t,n,r;return(r=(n=(t=this.ref)==null?void 0:t.call(this))==null?void 0:n.querySelector(`[data-key="${e}"]`))!=null?r:null}getKeyPageAbove(e){var s;const t=(s=this.ref)==null?void 0:s.call(this);let n=this.getItem(e);if(!t||!n)return;const r=Math.max(0,n.offsetTop+n.offsetHeight-t.offsetHeight);let i=e;for(;i&&n&&n.offsetTop>r;)i=this.getKeyAbove(i),n=i!=null?this.getItem(i):null;return i}getKeyPageBelow(e){var s;const t=(s=this.ref)==null?void 0:s.call(this);let n=this.getItem(e);if(!t||!n)return;const r=Math.min(t.scrollHeight,n.offsetTop-n.offsetHeight+t.offsetHeight);let i=e;for(;i&&n&&n.offsetTop<r;)i=this.getKeyBelow(i),n=i!=null?this.getItem(i):null;return i}getKeyForSearch(e,t){var i;const n=(i=this.collator)==null?void 0:i.call(this);if(!n)return;let r=t!=null?this.getKeyBelow(t):this.getFirstKey();for(;r!=null;){const s=this.collection().getItem(r);if(s){const o=s.textValue.slice(0,e.length);if(s.textValue&&n.compare(o,e)===0)return r}r=this.getKeyBelow(r)}}};function _6(e,t,n){const r=Z4({usage:"search",sensitivity:"base"}),i=H(()=>{const s=Q(e.keyboardDelegate);return s||new C6(e.collection,t,r)});return oD({selectionManager:()=>Q(e.selectionManager),keyboardDelegate:i,autoFocus:()=>Q(e.autoFocus),deferAutoFocus:()=>Q(e.deferAutoFocus),shouldFocusWrap:()=>Q(e.shouldFocusWrap),disallowEmptySelection:()=>Q(e.disallowEmptySelection),selectOnFocus:()=>Q(e.selectOnFocus),disallowTypeAhead:()=>Q(e.disallowTypeAhead),shouldUseVirtualFocus:()=>Q(e.shouldUseVirtualFocus),allowsTabNavigation:()=>Q(e.allowsTabNavigation),isVirtualized:()=>Q(e.isVirtualized),scrollToKey:s=>{var o;return(o=Q(e.scrollToKey))==null?void 0:o(s)},orientation:()=>Q(e.orientation)},t)}var $u="focusScope.autoFocusOnMount",Du="focusScope.autoFocusOnUnmount",Jm={bubbles:!1,cancelable:!0},Zm={stack:[],active(){return this.stack[0]},add(e){var t;e!==this.active()&&((t=this.active())==null||t.pause()),this.stack=Nd(this.stack,e),this.stack.unshift(e)},remove(e){var t;this.stack=Nd(this.stack,e),(t=this.active())==null||t.resume()}};function k6(e,t){const[n,r]=re(!1),i={pause(){r(!0)},resume(){r(!1)}};let s=null;const o=g=>{var m;return(m=e.onMountAutoFocus)==null?void 0:m.call(e,g)},a=g=>{var m;return(m=e.onUnmountAutoFocus)==null?void 0:m.call(e,g)},l=()=>qn(t()),c=()=>{const g=l().createElement("span");return g.setAttribute("data-focus-trap",""),g.tabIndex=0,Object.assign(g.style,g1),g},u=()=>{const g=t();return g?f1(g,!0).filter(m=>!m.hasAttribute("data-focus-trap")):[]},d=()=>{const g=u();return g.length>0?g[0]:null},f=()=>{const g=u();return g.length>0?g[g.length-1]:null},h=()=>{const g=t();if(!g)return!1;const m=Po(g);return!m||un(g,m)?!1:h1(m)};be(()=>{const g=t();if(!g)return;Zm.add(i);const m=Po(g);if(!un(g,m)){const v=new CustomEvent($u,Jm);g.addEventListener($u,o),g.dispatchEvent(v),v.defaultPrevented||setTimeout(()=>{_t(d()),Po(g)===m&&_t(g)},0)}we(()=>{g.removeEventListener($u,o),setTimeout(()=>{const v=new CustomEvent(Du,Jm);h()&&v.preventDefault(),g.addEventListener(Du,a),g.dispatchEvent(v),v.defaultPrevented||_t(m!=null?m:l().body),g.removeEventListener(Du,a),Zm.remove(i)},0)})}),be(()=>{const g=t();if(!g||!Q(e.trapFocus)||n())return;const m=v=>{const b=v.target;b!=null&&b.closest(`[${rc}]`)||(un(g,b)?s=b:_t(s))},p=v=>{const b=v.relatedTarget,w=b!=null?b:Po(g);w!=null&&w.closest(`[${rc}]`)||un(g,w)||_t(s)};l().addEventListener("focusin",m),l().addEventListener("focusout",p),we(()=>{l().removeEventListener("focusin",m),l().removeEventListener("focusout",p)})}),be(()=>{const g=t();if(!g||!Q(e.trapFocus)||n())return;const m=c();g.insertAdjacentElement("afterbegin",m);const p=c();g.insertAdjacentElement("beforeend",p);function v(w){const C=d(),x=f();w.relatedTarget===C?_t(x):_t(C)}m.addEventListener("focusin",v),p.addEventListener("focusin",v);const b=new MutationObserver(w=>{for(const C of w)C.previousSibling===p&&(p.remove(),g.insertAdjacentElement("beforeend",p)),C.nextSibling===m&&(m.remove(),g.insertAdjacentElement("afterbegin",m))});b.observe(g,{childList:!0,subtree:!1}),we(()=>{m.removeEventListener("focusin",v),p.removeEventListener("focusin",v),m.remove(),p.remove(),b.disconnect()})})}var O6="data-live-announcer";function E6(e){be(()=>{Q(e.isDisabled)||we(A6(Q(e.targets),Q(e.root)))})}var mo=new WeakMap,rn=[];function A6(e,t=document.body){const n=new Set(e),r=new Set,i=l=>{for(const f of l.querySelectorAll(`[${O6}], [${rc}]`))n.add(f);const c=f=>{if(n.has(f)||f.parentElement&&r.has(f.parentElement)&&f.parentElement.getAttribute("role")!=="row")return NodeFilter.FILTER_REJECT;for(const h of n)if(f.contains(h))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_ACCEPT},u=document.createTreeWalker(l,NodeFilter.SHOW_ELEMENT,{acceptNode:c}),d=c(l);if(d===NodeFilter.FILTER_ACCEPT&&s(l),d!==NodeFilter.FILTER_REJECT){let f=u.nextNode();for(;f!=null;)s(f),f=u.nextNode()}},s=l=>{var u;const c=(u=mo.get(l))!=null?u:0;l.getAttribute("aria-hidden")==="true"&&c===0||(c===0&&l.setAttribute("aria-hidden","true"),r.add(l),mo.set(l,c+1))};rn.length&&rn[rn.length-1].disconnect(),i(t);const o=new MutationObserver(l=>{for(const c of l)if(!(c.type!=="childList"||c.addedNodes.length===0)&&![...n,...r].some(u=>u.contains(c.target))){for(const u of c.removedNodes)u instanceof Element&&(n.delete(u),r.delete(u));for(const u of c.addedNodes)(u instanceof HTMLElement||u instanceof SVGElement)&&(u.dataset.liveAnnouncer==="true"||u.dataset.reactAriaTopLayer==="true")?n.add(u):u instanceof Element&&i(u)}});o.observe(t,{childList:!0,subtree:!0});const a={observe(){o.observe(t,{childList:!0,subtree:!0})},disconnect(){o.disconnect()}};return rn.push(a),()=>{o.disconnect();for(const l of r){const c=mo.get(l);if(c==null)return;c===1?(l.removeAttribute("aria-hidden"),mo.delete(l)):mo.set(l,c-1)}a===rn[rn.length-1]?(rn.pop(),rn.length&&rn[rn.length-1].observe()):rn.splice(rn.indexOf(a),1)}}var bl=new Map,P6=e=>{be(()=>{var s,o;const t=(s=Ct(e.style))!=null?s:{},n=(o=Ct(e.properties))!=null?o:[],r={};for(const a in t)r[a]=e.element.style[a];const i=bl.get(e.key);i?i.activeCount++:bl.set(e.key,{activeCount:1,originalStyles:r,properties:n.map(a=>a.key)}),Object.assign(e.element.style,e.style);for(const a of n)e.element.style.setProperty(a.key,a.value);we(()=>{var l;const a=bl.get(e.key);if(a){if(a.activeCount!==1){a.activeCount--;return}bl.delete(e.key);for(const[c,u]of Object.entries(a.originalStyles))e.element.style[c]=u;for(const c of a.properties)e.element.style.removeProperty(c);e.element.style.length===0&&e.element.removeAttribute("style"),(l=e.cleanup)==null||l.call(e)}})})},ep=P6,T6=(e,t)=>{switch(t){case"x":return[e.clientWidth,e.scrollLeft,e.scrollWidth];case"y":return[e.clientHeight,e.scrollTop,e.scrollHeight]}},j6=(e,t)=>{const n=getComputedStyle(e),r=t==="x"?n.overflowX:n.overflowY;return r==="auto"||r==="scroll"||e.tagName==="HTML"&&r==="visible"},M6=(e,t,n)=>{var l;const r=t==="x"&&window.getComputedStyle(e).direction==="rtl"?-1:1;let i=e,s=0,o=0,a=!1;do{const[c,u,d]=T6(i,t),f=d-c-r*u;(u!==0||f!==0)&&j6(i,t)&&(s+=f,o+=u),i===(n!=null?n:document.documentElement)?a=!0:i=(l=i._$host)!=null?l:i.parentElement}while(i&&!a);return[s,o]},[tp,np]=re([]),$6=e=>tp().indexOf(e)===tp().length-1,D6=e=>{const t=Ee({element:null,enabled:!0,hideScrollbar:!0,preventScrollbarShift:!0,preventScrollbarShiftMode:"padding",restoreScrollPosition:!0,allowPinchZoom:!1},e),n=yn();let r=[0,0],i=null,s=null;be(()=>{Ct(t.enabled)&&(np(c=>[...c,n]),we(()=>{np(c=>c.filter(u=>u!==n))}))}),be(()=>{if(!Ct(t.enabled)||!Ct(t.hideScrollbar))return;const{body:c}=document,u=window.innerWidth-c.offsetWidth;if(Ct(t.preventScrollbarShift)){const d={overflow:"hidden"},f=[];u>0&&(Ct(t.preventScrollbarShiftMode)==="padding"?d.paddingRight=`calc(${window.getComputedStyle(c).paddingRight} + ${u}px)`:d.marginRight=`calc(${window.getComputedStyle(c).marginRight} + ${u}px)`,f.push({key:"--scrollbar-width",value:`${u}px`}));const h=window.scrollY,g=window.scrollX;ep({key:"prevent-scroll",element:c,style:d,properties:f,cleanup:()=>{Ct(t.restoreScrollPosition)&&u>0&&window.scrollTo(g,h)}})}else ep({key:"prevent-scroll",element:c,style:{overflow:"hidden"}})}),be(()=>{!$6(n)||!Ct(t.enabled)||(document.addEventListener("wheel",a,{passive:!1}),document.addEventListener("touchstart",o,{passive:!1}),document.addEventListener("touchmove",l,{passive:!1}),we(()=>{document.removeEventListener("wheel",a),document.removeEventListener("touchstart",o),document.removeEventListener("touchmove",l)}))});const o=c=>{r=rp(c),i=null,s=null},a=c=>{const u=c.target,d=Ct(t.element),f=L6(c),h=Math.abs(f[0])>Math.abs(f[1])?"x":"y",g=h==="x"?f[0]:f[1],m=ip(u,h,g,d);let p;d&&Ud(d,u)?p=!m:p=!0,p&&c.cancelable&&c.preventDefault()},l=c=>{const u=Ct(t.element),d=c.target;let f;if(c.touches.length===2)f=!Ct(t.allowPinchZoom);else{if(i==null||s===null){const h=rp(c).map((m,p)=>r[p]-m),g=Math.abs(h[0])>Math.abs(h[1])?"x":"y";i=g,s=g==="x"?h[0]:h[1]}if(d.type==="range")f=!1;else{const h=ip(d,i,s,u);u&&Ud(u,d)?f=!h:f=!0}}f&&c.cancelable&&c.preventDefault()}},L6=e=>[e.deltaX,e.deltaY],rp=e=>e.changedTouches[0]?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0],ip=(e,t,n,r)=>{const i=r!==null&&Ud(r,e),[s,o]=M6(e,t,i?r:void 0);return!(n>0&&Math.abs(s)<=1||n<0&&Math.abs(o)<1)},Ud=(e,t)=>{var r;if(e.contains(t))return!0;let n=t;for(;n;){if(n===e)return!0;n=(r=n._$host)!=null?r:n.parentElement}return!1},I6=D6,R6=I6,nx=pt();function rx(){return vt(nx)}function mr(){const e=rx();if(e===void 0)throw new Error("[kobalte]: `useMenuContext` must be used within a `Menu` component");return e}var ix=pt();function eh(){const e=vt(ix);if(e===void 0)throw new Error("[kobalte]: `useMenuItemContext` must be used within a `Menu.Item` component");return e}var sx=pt();function Hn(){const e=vt(sx);if(e===void 0)throw new Error("[kobalte]: `useMenuRootContext` must be used within a `MenuRoot` component");return e}function th(e){let t;const n=Hn(),r=mr(),i=Fe({id:n.generateId(`item-${yn()}`)},e),[s,o]=We(i,["ref","textValue","disabled","closeOnSelect","checked","indeterminate","onSelect","onPointerMove","onPointerLeave","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]),[a,l]=re(),[c,u]=re(),[d,f]=re(),h=()=>r.listState().selectionManager(),g=()=>o.id,m=()=>h().focusedKey()===g(),p=()=>{var O;(O=s.onSelect)==null||O.call(s),s.closeOnSelect&&setTimeout(()=>{r.close(!0)})};U4({getItem:()=>{var O,E,T,D,V;return{ref:()=>t,type:"item",key:g(),textValue:(D=(T=(E=s.textValue)!=null?E:(O=d())==null?void 0:O.textContent)!=null?T:t==null?void 0:t.textContent)!=null?D:"",disabled:(V=s.disabled)!=null?V:!1}}});const v=E1({key:g,selectionManager:h,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>s.disabled},()=>t),b=O=>{tt(O,s.onPointerMove),O.pointerType==="mouse"&&(s.disabled?r.onItemLeave(O):(r.onItemEnter(O),O.defaultPrevented||(_t(O.currentTarget),r.listState().selectionManager().setFocused(!0),r.listState().selectionManager().setFocusedKey(g()))))},w=O=>{tt(O,s.onPointerLeave),O.pointerType==="mouse"&&r.onItemLeave(O)},C=O=>{tt(O,s.onPointerUp),!s.disabled&&O.button===0&&p()},x=O=>{if(tt(O,s.onKeyDown),!O.repeat&&!s.disabled)switch(O.key){case"Enter":case" ":p();break}},k=H(()=>{if(s.indeterminate)return"mixed";if(s.checked!=null)return s.checked}),S=H(()=>({"data-indeterminate":s.indeterminate?"":void 0,"data-checked":s.checked&&!s.indeterminate?"":void 0,"data-disabled":s.disabled?"":void 0,"data-highlighted":m()?"":void 0})),_={isChecked:()=>s.checked,dataset:S,setLabelRef:f,generateId:Ra(()=>o.id),registerLabel:dn(l),registerDescription:dn(u)};return j(ix.Provider,{value:_,get children(){return j(it,Ee({as:"div",ref(O){const E=Mt(T=>t=T,s.ref);typeof E=="function"&&E(O)},get tabIndex(){return v.tabIndex()},get"aria-checked"(){return k()},get"aria-disabled"(){return s.disabled},get"aria-labelledby"(){return a()},get"aria-describedby"(){return c()},get"data-key"(){return v.dataKey()},get onPointerDown(){return gt([s.onPointerDown,v.onPointerDown])},get onPointerUp(){return gt([C,v.onPointerUp])},get onClick(){return gt([s.onClick,v.onClick])},get onKeyDown(){return gt([x,v.onKeyDown])},get onMouseDown(){return gt([s.onMouseDown,v.onMouseDown])},get onFocus(){return gt([s.onFocus,v.onFocus])},onPointerMove:b,onPointerLeave:w},S,o))}})}function ox(e){const t=Fe({closeOnSelect:!1},e),[n,r]=We(t,["checked","defaultChecked","onChange","onSelect"]),i=I4({isSelected:()=>n.checked,defaultIsSelected:()=>n.defaultChecked,onSelectedChange:o=>{var a;return(a=n.onChange)==null?void 0:a.call(n,o)},isDisabled:()=>r.disabled});return j(th,Ee({role:"menuitemcheckbox",get checked(){return i.isSelected()},onSelect:()=>{var o;(o=n.onSelect)==null||o.call(n),i.toggle()}},r))}var N6=pt();function Hc(){return vt(N6)}var ua={next:(e,t)=>e==="ltr"?t==="horizontal"?"ArrowRight":"ArrowDown":t==="horizontal"?"ArrowLeft":"ArrowUp",previous:(e,t)=>ua.next(e==="ltr"?"rtl":"ltr",t)},sp={first:e=>e==="horizontal"?"ArrowDown":"ArrowRight",last:e=>e==="horizontal"?"ArrowUp":"ArrowLeft"};function ax(e){const t=Hn(),n=mr(),r=Hc(),{direction:i}=Qr(),s=Fe({id:t.generateId("trigger")},e),[o,a]=We(s,["ref","id","disabled","onPointerDown","onClick","onKeyDown","onMouseOver","onFocus"]);let l=()=>t.value();r!==void 0&&(l=()=>{var v;return(v=t.value())!=null?v:o.id},r.lastValue()===void 0&&r.setLastValue(l));const c=Fc(()=>n.triggerRef(),()=>"button"),u=H(()=>{var v;return c()==="a"&&((v=n.triggerRef())==null?void 0:v.getAttribute("href"))!=null});be(ur(()=>r==null?void 0:r.value(),v=>{var b;u()&&v===l()&&((b=n.triggerRef())==null||b.focus())}));const d=()=>{r!==void 0?n.isOpen()?r.value()===l()&&r.closeMenu():(r.autoFocusMenu()||r.setAutoFocusMenu(!0),n.open(!1)):n.toggle(!0)},f=v=>{tt(v,o.onPointerDown),v.currentTarget.dataset.pointerType=v.pointerType,!o.disabled&&v.pointerType!=="touch"&&v.button===0&&d()},h=v=>{tt(v,o.onClick),o.disabled||v.currentTarget.dataset.pointerType==="touch"&&d()},g=v=>{if(tt(v,o.onKeyDown),!o.disabled){if(u())switch(v.key){case"Enter":case" ":return}switch(v.key){case"Enter":case" ":case sp.first(t.orientation()):v.stopPropagation(),v.preventDefault(),A4(v.currentTarget),n.open("first"),r==null||r.setAutoFocusMenu(!0),r==null||r.setValue(l);break;case sp.last(t.orientation()):v.stopPropagation(),v.preventDefault(),n.open("last");break;case ua.next(i(),t.orientation()):if(r===void 0)break;v.stopPropagation(),v.preventDefault(),r.nextMenu();break;case ua.previous(i(),t.orientation()):if(r===void 0)break;v.stopPropagation(),v.preventDefault(),r.previousMenu();break}}},m=v=>{var b;tt(v,o.onMouseOver),((b=n.triggerRef())==null?void 0:b.dataset.pointerType)!=="touch"&&!o.disabled&&r!==void 0&&r.value()!==void 0&&r.setValue(l)},p=v=>{tt(v,o.onFocus),r!==void 0&&v.currentTarget.dataset.pointerType!=="touch"&&r.setValue(l)};return be(()=>we(n.registerTriggerId(o.id))),j(Uf,Ee({ref(v){const b=Mt(n.setTriggerRef,o.ref);typeof b=="function"&&b(v)},get"data-kb-menu-value-trigger"(){return t.value()},get id(){return o.id},get disabled(){return o.disabled},"aria-haspopup":"true",get"aria-expanded"(){return n.isOpen()},get"aria-controls"(){return H(()=>!!n.isOpen())()?n.contentId():void 0},get"data-highlighted"(){return l()!==void 0&&(r==null?void 0:r.value())===l()?!0:void 0},get tabIndex(){return r!==void 0?r.value()===l()||r.lastValue()===l()?0:-1:void 0},onPointerDown:f,onMouseOver:m,onClick:h,onKeyDown:g,onFocus:p,role:r!==void 0?"menuitem":void 0},()=>n.dataset(),a))}var F6=pt();function lx(){return vt(F6)}function cx(e){let t;const n=Hn(),r=mr(),i=Hc(),s=lx(),{direction:o}=Qr(),a=Fe({id:n.generateId(`content-${yn()}`)},e),[l,c]=We(a,["ref","id","style","onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onPointerEnter","onPointerMove","onKeyDown","onMouseDown","onFocusIn","onFocusOut"]);let u=0;const d=()=>r.parentMenuContext()==null&&i===void 0&&n.isModal(),f=_6({selectionManager:r.listState().selectionManager,collection:r.listState().collection,autoFocus:r.autoFocus,deferAutoFocus:!0,shouldFocusWrap:!0,disallowTypeAhead:()=>!r.listState().selectionManager().isFocused(),orientation:()=>n.orientation()==="horizontal"?"vertical":"horizontal"},()=>t);k6({trapFocus:()=>d()&&r.isOpen(),onMountAutoFocus:w=>{var C;i===void 0&&((C=l.onOpenAutoFocus)==null||C.call(l,w))},onUnmountAutoFocus:l.onCloseAutoFocus},()=>t);const h=w=>{if(un(w.currentTarget,w.target)&&(w.key==="Tab"&&r.isOpen()&&w.preventDefault(),i!==void 0&&w.currentTarget.getAttribute("aria-haspopup")!=="true"))switch(w.key){case ua.next(o(),n.orientation()):w.stopPropagation(),w.preventDefault(),r.close(!0),i.setAutoFocusMenu(!0),i.nextMenu();break;case ua.previous(o(),n.orientation()):if(w.currentTarget.hasAttribute("data-closed"))break;w.stopPropagation(),w.preventDefault(),r.close(!0),i.setAutoFocusMenu(!0),i.previousMenu();break}},g=w=>{var C;(C=l.onEscapeKeyDown)==null||C.call(l,w),i==null||i.setAutoFocusMenu(!1),r.close(!0)},m=w=>{var C;(C=l.onFocusOutside)==null||C.call(l,w),n.isModal()&&w.preventDefault()},p=w=>{var C,x;tt(w,l.onPointerEnter),r.isOpen()&&((C=r.parentMenuContext())==null||C.listState().selectionManager().setFocused(!1),(x=r.parentMenuContext())==null||x.listState().selectionManager().setFocusedKey(void 0))},v=w=>{if(tt(w,l.onPointerMove),w.pointerType!=="mouse")return;const C=w.target,x=u!==w.clientX;un(w.currentTarget,C)&&x&&(r.setPointerDir(w.clientX>u?"right":"left"),u=w.clientX)};be(()=>we(r.registerContentId(l.id)));const b={ref:Mt(w=>{r.setContentRef(w),t=w},l.ref),role:"menu",get id(){return l.id},get tabIndex(){return f.tabIndex()},get"aria-labelledby"(){return r.triggerId()},onKeyDown:gt([l.onKeyDown,f.onKeyDown,h]),onMouseDown:gt([l.onMouseDown,f.onMouseDown]),onFocusIn:gt([l.onFocusIn,f.onFocusIn]),onFocusOut:gt([l.onFocusOut,f.onFocusOut]),onPointerEnter:p,onPointerMove:v,get"data-orientation"(){return n.orientation()}};return j(pe,{get when(){return r.contentPresent()},get children(){return j(pe,{get when(){return s===void 0||r.parentMenuContext()!=null},get fallback(){return j(it,Ee({as:"div"},()=>r.dataset(),b,c))},get children(){return j(z1.Positioner,{get children(){return j(w6,Ee({get disableOutsidePointerEvents(){return H(()=>!!d())()&&r.isOpen()},get excludedElements(){return[r.triggerRef]},bypassTopMostLayerCheck:!0,get style(){return Rc({"--kb-menu-content-transform-origin":"var(--kb-popper-content-transform-origin)",position:"relative"},l.style)},onEscapeKeyDown:g,onFocusOutside:m,get onDismiss(){return r.close}},()=>r.dataset(),b,c))}})}})}})}function B6(e){let t;const n=Hn(),r=mr(),[i,s]=We(e,["ref"]);return R6({element:()=>t!=null?t:null,enabled:()=>r.contentPresent()&&n.preventScroll()}),j(cx,Ee({ref(o){const a=Mt(l=>{t=l},i.ref);typeof a=="function"&&a(o)}},s))}var ux=pt();function q6(){const e=vt(ux);if(e===void 0)throw new Error("[kobalte]: `useMenuGroupContext` must be used within a `Menu.Group` component");return e}function nh(e){const t=Hn(),n=Fe({id:t.generateId(`group-${yn()}`)},e),[r,i]=re(),s={generateId:Ra(()=>n.id),registerLabelId:dn(i)};return j(ux.Provider,{value:s,get children(){return j(it,Ee({as:"div",role:"group",get"aria-labelledby"(){return r()}},n))}})}function dx(e){const t=q6(),n=Fe({id:t.generateId("label")},e),[r,i]=We(n,["id"]);return be(()=>we(t.registerLabelId(r.id))),j(it,Ee({as:"span",get id(){return r.id},"aria-hidden":"true"},i))}function fx(e){const t=mr(),n=Fe({children:"▼"},e);return j(it,Ee({as:"span","aria-hidden":"true"},()=>t.dataset(),n))}function hx(e){return j(th,Ee({role:"menuitem",closeOnSelect:!0},e))}function gx(e){const t=eh(),n=Fe({id:t.generateId("description")},e),[r,i]=We(n,["id"]);return be(()=>we(t.registerDescription(r.id))),j(it,Ee({as:"div",get id(){return r.id}},()=>t.dataset(),i))}function yx(e){const t=eh(),n=Fe({id:t.generateId("indicator")},e),[r,i]=We(n,["forceMount"]);return j(pe,{get when(){return r.forceMount||t.isChecked()},get children(){return j(it,Ee({as:"div"},()=>t.dataset(),i))}})}function mx(e){const t=eh(),n=Fe({id:t.generateId("label")},e),[r,i]=We(n,["ref","id"]);return be(()=>we(t.registerLabel(r.id))),j(it,Ee({as:"div",ref(s){const o=Mt(t.setLabelRef,r.ref);typeof o=="function"&&o(s)},get id(){return r.id}},()=>t.dataset(),i))}function px(e){const t=mr();return j(pe,{get when(){return t.contentPresent()},get children(){return j(z0,e)}})}var vx=pt();function z6(){const e=vt(vx);if(e===void 0)throw new Error("[kobalte]: `useMenuRadioGroupContext` must be used within a `Menu.RadioGroup` component");return e}function bx(e){const n=Hn().generateId(`radiogroup-${yn()}`),r=Fe({id:n},e),[i,s]=We(r,["value","defaultValue","onChange","disabled"]),[o,a]=Fa({value:()=>i.value,defaultValue:()=>i.defaultValue,onChange:c=>{var u;return(u=i.onChange)==null?void 0:u.call(i,c)}}),l={isDisabled:()=>i.disabled,isSelectedValue:c=>c===o(),setSelectedValue:a};return j(vx.Provider,{value:l,get children(){return j(nh,s)}})}function xx(e){const t=z6(),n=Fe({closeOnSelect:!1},e),[r,i]=We(n,["value","onSelect"]);return j(th,Ee({role:"menuitemradio",get checked(){return t.isSelectedValue(r.value)},onSelect:()=>{var o;(o=r.onSelect)==null||o.call(r),t.setSelectedValue(r.value)}},i))}function H6(e,t,n){const r=e.split("-")[0],i=n.getBoundingClientRect(),s=[],o=t.clientX,a=t.clientY;switch(r){case"top":s.push([o,a+5]),s.push([i.left,i.bottom]),s.push([i.left,i.top]),s.push([i.right,i.top]),s.push([i.right,i.bottom]);break;case"right":s.push([o-5,a]),s.push([i.left,i.top]),s.push([i.right,i.top]),s.push([i.right,i.bottom]),s.push([i.left,i.bottom]);break;case"bottom":s.push([o,a-5]),s.push([i.right,i.top]),s.push([i.right,i.bottom]),s.push([i.left,i.bottom]),s.push([i.left,i.top]);break;case"left":s.push([o+5,a]),s.push([i.right,i.bottom]),s.push([i.left,i.bottom]),s.push([i.left,i.top]),s.push([i.right,i.top]);break}return s}function K6(e,t){return t?E4([e.clientX,e.clientY],t):!1}function wx(e){const t=Hn(),n=x1(),r=rx(),i=Hc(),s=lx(),o=Fe({placement:t.orientation()==="horizontal"?"bottom-start":"right-start"},e),[a,l]=We(o,["open","defaultOpen","onOpenChange"]);let c=0,u=null,d="right";const[f,h]=re(),[g,m]=re(),[p,v]=re(),[b,w]=re(),[C,x]=re(!0),[k,S]=re(l.placement),[_,O]=re([]),[E,T]=re([]),{DomCollectionProvider:D}=K4({items:E,onItemsChange:T}),V=K1({open:()=>a.open,defaultOpen:()=>a.defaultOpen,onOpenChange:K=>{var de;return(de=a.onOpenChange)==null?void 0:de.call(a,K)}}),{present:N}=A1({show:()=>t.forceMount()||V.isOpen(),element:()=>{var K;return(K=b())!=null?K:null}}),$=lD({selectionMode:"none",dataSource:E}),L=K=>{x(K),V.open()},I=(K=!1)=>{V.close(),K&&r&&r.close(!0)},oe=K=>{x(K),V.toggle()},ue=()=>{const K=b();K&&(_t(K),$.selectionManager().setFocused(!0),$.selectionManager().setFocusedKey(void 0))},B=()=>{s!=null?setTimeout(()=>ue()):ue()},J=K=>{O(fe=>[...fe,K]);const de=r==null?void 0:r.registerNestedMenu(K);return()=>{O(fe=>Nd(fe,K)),de==null||de()}},ne=K=>d===(u==null?void 0:u.side)&&K6(K,u==null?void 0:u.area),ae=K=>{ne(K)&&K.preventDefault()},R=K=>{ne(K)||B()},G=K=>{ne(K)&&K.preventDefault()};E6({isDisabled:()=>!(r==null&&V.isOpen()&&t.isModal()),targets:()=>[b(),..._()].filter(Boolean)}),be(()=>{const K=b();if(!K||!r)return;const de=r.registerNestedMenu(K);we(()=>{de()})}),be(()=>{r===void 0&&(i==null||i.registerMenu(t.value(),[b(),..._()]))}),be(()=>{var K;r!==void 0||i===void 0||(i.value()===t.value()?((K=p())==null||K.focus(),i.autoFocusMenu()&&L(!0)):I())}),be(()=>{r!==void 0||i===void 0||V.isOpen()&&i.setValue(t.value())}),we(()=>{r===void 0&&(i==null||i.unregisterMenu(t.value()))});const ce={dataset:H(()=>({"data-expanded":V.isOpen()?"":void 0,"data-closed":V.isOpen()?void 0:""})),isOpen:V.isOpen,contentPresent:N,nestedMenus:_,currentPlacement:k,pointerGraceTimeoutId:()=>c,autoFocus:C,listState:()=>$,parentMenuContext:()=>r,triggerRef:p,contentRef:b,triggerId:f,contentId:g,setTriggerRef:v,setContentRef:w,open:L,close:I,toggle:oe,focusContent:B,onItemEnter:ae,onItemLeave:R,onTriggerLeave:G,setPointerDir:K=>d=K,setPointerGraceTimeoutId:K=>c=K,setPointerGraceIntent:K=>u=K,registerNestedMenu:J,registerItemToParentDomCollection:n==null?void 0:n.registerItem,registerTriggerId:dn(h),registerContentId:dn(m)};return j(D,{get children(){return j(nx.Provider,{value:ce,get children(){return j(pe,{when:s===void 0,get fallback(){return l.children},get children(){return j(z1,Ee({anchorRef:p,contentRef:b,onCurrentPlacementChange:S},l))}})}})}})}function Sx(e){const{direction:t}=Qr();return j(wx,Ee({get placement(){return t()==="rtl"?"left-start":"right-start"},flip:!0},e))}var U6={close:(e,t)=>e==="ltr"?[t==="horizontal"?"ArrowLeft":"ArrowUp"]:[t==="horizontal"?"ArrowRight":"ArrowDown"]};function Cx(e){const t=mr(),n=Hn(),[r,i]=We(e,["onFocusOutside","onKeyDown"]),{direction:s}=Qr();return j(cx,Ee({onOpenAutoFocus:u=>{u.preventDefault()},onCloseAutoFocus:u=>{u.preventDefault()},onFocusOutside:u=>{var f;(f=r.onFocusOutside)==null||f.call(r,u);const d=u.target;un(t.triggerRef(),d)||t.close()},onKeyDown:u=>{tt(u,r.onKeyDown);const d=un(u.currentTarget,u.target),f=U6.close(s(),n.orientation()).includes(u.key),h=t.parentMenuContext()!=null;d&&f&&h&&(t.close(),_t(t.triggerRef()))}},i))}var op=["Enter"," "],W6={open:(e,t)=>e==="ltr"?[...op,t==="horizontal"?"ArrowRight":"ArrowDown"]:[...op,t==="horizontal"?"ArrowLeft":"ArrowUp"]};function _x(e){let t;const n=Hn(),r=mr(),i=Fe({id:n.generateId(`sub-trigger-${yn()}`)},e),[s,o]=We(i,["ref","id","textValue","disabled","onPointerMove","onPointerLeave","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]);let a=null;const l=()=>{a&&window.clearTimeout(a),a=null},{direction:c}=Qr(),u=()=>s.id,d=()=>{const w=r.parentMenuContext();if(w==null)throw new Error("[kobalte]: `Menu.SubTrigger` must be used within a `Menu.Sub` component");return w.listState().selectionManager()},f=()=>r.listState().collection(),h=()=>d().focusedKey()===u(),g=E1({key:u,selectionManager:d,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>s.disabled},()=>t),m=w=>{tt(w,s.onClick),!r.isOpen()&&!s.disabled&&r.open(!0)},p=w=>{var x;if(tt(w,s.onPointerMove),w.pointerType!=="mouse")return;const C=r.parentMenuContext();if(C==null||C.onItemEnter(w),!w.defaultPrevented){if(s.disabled){C==null||C.onItemLeave(w);return}!r.isOpen()&&!a&&((x=r.parentMenuContext())==null||x.setPointerGraceIntent(null),a=window.setTimeout(()=>{r.open(!1),l()},100)),C==null||C.onItemEnter(w),w.defaultPrevented||(r.listState().selectionManager().isFocused()&&(r.listState().selectionManager().setFocused(!1),r.listState().selectionManager().setFocusedKey(void 0)),_t(w.currentTarget),C==null||C.listState().selectionManager().setFocused(!0),C==null||C.listState().selectionManager().setFocusedKey(u()))}},v=w=>{if(tt(w,s.onPointerLeave),w.pointerType!=="mouse")return;l();const C=r.parentMenuContext(),x=r.contentRef();if(x){C==null||C.setPointerGraceIntent({area:H6(r.currentPlacement(),w,x),side:r.currentPlacement().split("-")[0]}),window.clearTimeout(C==null?void 0:C.pointerGraceTimeoutId());const k=window.setTimeout(()=>{C==null||C.setPointerGraceIntent(null)},300);C==null||C.setPointerGraceTimeoutId(k)}else{if(C==null||C.onTriggerLeave(w),w.defaultPrevented)return;C==null||C.setPointerGraceIntent(null)}C==null||C.onItemLeave(w)},b=w=>{tt(w,s.onKeyDown),!w.repeat&&(s.disabled||W6.open(c(),n.orientation()).includes(w.key)&&(w.stopPropagation(),w.preventDefault(),d().setFocused(!1),d().setFocusedKey(void 0),r.isOpen()||r.open("first"),r.focusContent(),r.listState().selectionManager().setFocused(!0),r.listState().selectionManager().setFocusedKey(f().getFirstKey())))};return be(()=>{var C,x,k;if(r.registerItemToParentDomCollection==null)throw new Error("[kobalte]: `Menu.SubTrigger` must be used within a `Menu.Sub` component");const w=r.registerItemToParentDomCollection({ref:()=>t,type:"item",key:u(),textValue:(x=(C=s.textValue)!=null?C:t==null?void 0:t.textContent)!=null?x:"",disabled:(k=s.disabled)!=null?k:!1});we(w)}),be(ur(()=>{var w;return(w=r.parentMenuContext())==null?void 0:w.pointerGraceTimeoutId()},w=>{we(()=>{var C;window.clearTimeout(w),(C=r.parentMenuContext())==null||C.setPointerGraceIntent(null)})})),be(()=>we(r.registerTriggerId(s.id))),we(()=>{l()}),j(it,Ee({as:"div",ref(w){const C=Mt(x=>{r.setTriggerRef(x),t=x},s.ref);typeof C=="function"&&C(w)},get id(){return s.id},role:"menuitem",get tabIndex(){return g.tabIndex()},"aria-haspopup":"true",get"aria-expanded"(){return r.isOpen()},get"aria-controls"(){return H(()=>!!r.isOpen())()?r.contentId():void 0},get"aria-disabled"(){return s.disabled},get"data-key"(){return g.dataKey()},get"data-highlighted"(){return h()?"":void 0},get"data-disabled"(){return s.disabled?"":void 0},get onPointerDown(){return gt([s.onPointerDown,g.onPointerDown])},get onPointerUp(){return gt([s.onPointerUp,g.onPointerUp])},get onClick(){return gt([m,g.onClick])},get onKeyDown(){return gt([b,g.onKeyDown])},get onMouseDown(){return gt([s.onMouseDown,g.onMouseDown])},get onFocus(){return gt([s.onFocus,g.onFocus])},onPointerMove:p,onPointerLeave:v},()=>r.dataset(),o))}function V6(e){const t=Hc(),n=`menu-${yn()}`,r=Fe({id:n,modal:!0},e),[i,s]=We(r,["id","modal","preventScroll","forceMount","open","defaultOpen","onOpenChange","value","orientation"]),o=K1({open:()=>i.open,defaultOpen:()=>i.defaultOpen,onOpenChange:l=>{var c;return(c=i.onOpenChange)==null?void 0:c.call(i,l)}}),a={isModal:()=>{var l;return(l=i.modal)!=null?l:!0},preventScroll:()=>{var l;return(l=i.preventScroll)!=null?l:a.isModal()},forceMount:()=>{var l;return(l=i.forceMount)!=null?l:!1},generateId:Ra(()=>i.id),value:()=>i.value,orientation:()=>{var l,c;return(c=(l=i.orientation)!=null?l:t==null?void 0:t.orientation())!=null?c:"horizontal"}};return j(sx.Provider,{value:a,get children(){return j(wx,Ee({get open(){return o.isOpen()},get onOpenChange(){return o.setIsOpen}},s))}})}var G6={};Bc(G6,{Root:()=>Kc,Separator:()=>Q6});function Kc(e){let t;const n=Fe({orientation:"horizontal"},e),[r,i]=We(n,["ref","orientation"]),s=Fc(()=>t,()=>"hr");return j(it,Ee({as:"hr",ref(o){const a=Mt(l=>t=l,r.ref);typeof a=="function"&&a(o)},get role(){return s()!=="hr"?"separator":void 0},get"aria-orientation"(){return r.orientation==="vertical"?"vertical":void 0},get"data-orientation"(){return r.orientation}},i))}var Q6=Kc,ct={};Bc(ct,{Arrow:()=>Zf,CheckboxItem:()=>ox,Content:()=>kx,DropdownMenu:()=>Y6,Group:()=>nh,GroupLabel:()=>dx,Icon:()=>fx,Item:()=>hx,ItemDescription:()=>gx,ItemIndicator:()=>yx,ItemLabel:()=>mx,Portal:()=>px,RadioGroup:()=>bx,RadioItem:()=>xx,Root:()=>Ox,Separator:()=>Kc,Sub:()=>Sx,SubContent:()=>Cx,SubTrigger:()=>_x,Trigger:()=>ax});function kx(e){const t=Hn(),n=mr(),[r,i]=We(e,["onCloseAutoFocus","onInteractOutside"]);let s=!1;return j(B6,Ee({onCloseAutoFocus:l=>{var c;(c=r.onCloseAutoFocus)==null||c.call(r,l),s||_t(n.triggerRef()),s=!1,l.preventDefault()},onInteractOutside:l=>{var c;(c=r.onInteractOutside)==null||c.call(r,l),(!t.isModal()||l.detail.isContextMenu)&&(s=!0)}},i))}function Ox(e){const t=`dropdownmenu-${yn()}`,n=Fe({id:t},e);return j(V6,n)}var Y6=Object.assign(Ox,{Arrow:Zf,CheckboxItem:ox,Content:kx,Group:nh,GroupLabel:dx,Icon:fx,Item:hx,ItemDescription:gx,ItemIndicator:yx,ItemLabel:mx,Portal:px,RadioGroup:bx,RadioItem:xx,Separator:Kc,Sub:Sx,SubContent:Cx,SubTrigger:_x,Trigger:ax}),U={colors:{inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000000",white:"#ffffff",neutral:{50:"#f9fafb",100:"#f2f4f7",200:"#eaecf0",300:"#d0d5dd",400:"#98a2b3",500:"#667085",600:"#475467",700:"#344054",800:"#1d2939",900:"#101828"},darkGray:{50:"#525c7a",100:"#49536e",200:"#414962",300:"#394056",400:"#313749",500:"#292e3d",600:"#212530",700:"#191c24",800:"#111318",900:"#0b0d10"},gray:{50:"#f9fafb",100:"#f2f4f7",200:"#eaecf0",300:"#d0d5dd",400:"#98a2b3",500:"#667085",600:"#475467",700:"#344054",800:"#1d2939",900:"#101828"},blue:{25:"#F5FAFF",50:"#EFF8FF",100:"#D1E9FF",200:"#B2DDFF",300:"#84CAFF",400:"#53B1FD",500:"#2E90FA",600:"#1570EF",700:"#175CD3",800:"#1849A9",900:"#194185"},green:{25:"#F6FEF9",50:"#ECFDF3",100:"#D1FADF",200:"#A6F4C5",300:"#6CE9A6",400:"#32D583",500:"#12B76A",600:"#039855",700:"#027A48",800:"#05603A",900:"#054F31"},red:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d",950:"#450a0a"},yellow:{25:"#FFFCF5",50:"#FFFAEB",100:"#FEF0C7",200:"#FEDF89",300:"#FEC84B",400:"#FDB022",500:"#F79009",600:"#DC6803",700:"#B54708",800:"#93370D",900:"#7A2E0E"},purple:{25:"#FAFAFF",50:"#F4F3FF",100:"#EBE9FE",200:"#D9D6FE",300:"#BDB4FE",400:"#9B8AFB",500:"#7A5AF8",600:"#6938EF",700:"#5925DC",800:"#4A1FB8",900:"#3E1C96"},teal:{25:"#F6FEFC",50:"#F0FDF9",100:"#CCFBEF",200:"#99F6E0",300:"#5FE9D0",400:"#2ED3B7",500:"#15B79E",600:"#0E9384",700:"#107569",800:"#125D56",900:"#134E48"},pink:{25:"#fdf2f8",50:"#fce7f3",100:"#fbcfe8",200:"#f9a8d4",300:"#f472b6",400:"#ec4899",500:"#db2777",600:"#be185d",700:"#9d174d",800:"#831843",900:"#500724"},cyan:{25:"#ecfeff",50:"#cffafe",100:"#a5f3fc",200:"#67e8f9",300:"#22d3ee",400:"#06b6d4",500:"#0891b2",600:"#0e7490",700:"#155e75",800:"#164e63",900:"#083344"}},alpha:{90:"e5",80:"cc"},font:{size:{xs:"calc(var(--tsqd-font-size) * 0.75)",sm:"calc(var(--tsqd-font-size) * 0.875)",md:"var(--tsqd-font-size)"},lineHeight:{xs:"calc(var(--tsqd-font-size) * 1)",sm:"calc(var(--tsqd-font-size) * 1.25)",md:"calc(var(--tsqd-font-size) * 1.5)"},weight:{medium:"500",semibold:"600",bold:"700"}},border:{radius:{xs:"calc(var(--tsqd-font-size) * 0.125)",sm:"calc(var(--tsqd-font-size) * 0.25)",full:"9999px"}},size:{.25:"calc(var(--tsqd-font-size) * 0.0625)",.5:"calc(var(--tsqd-font-size) * 0.125)",1:"calc(var(--tsqd-font-size) * 0.25)",1.5:"calc(var(--tsqd-font-size) * 0.375)",2:"calc(var(--tsqd-font-size) * 0.5)",2.5:"calc(var(--tsqd-font-size) * 0.625)",3:"calc(var(--tsqd-font-size) * 0.75)",3.5:"calc(var(--tsqd-font-size) * 0.875)",4:"calc(var(--tsqd-font-size) * 1)",4.5:"calc(var(--tsqd-font-size) * 1.125)",5:"calc(var(--tsqd-font-size) * 1.25)",6:"calc(var(--tsqd-font-size) * 1.5)",6.5:"calc(var(--tsqd-font-size) * 1.625)",14:"calc(var(--tsqd-font-size) * 3.5)"},shadow:{xs:(e="rgb(0 0 0 / 0.1)")=>"0 1px 2px 0 rgb(0 0 0 / 0.05)",sm:(e="rgb(0 0 0 / 0.1)")=>`0 1px 3px 0 ${e}, 0 1px 2px -1px ${e}`,md:(e="rgb(0 0 0 / 0.1)")=>`0 4px 6px -1px ${e}, 0 2px 4px -2px ${e}`,lg:(e="rgb(0 0 0 / 0.1)")=>`0 10px 15px -3px ${e}, 0 4px 6px -4px ${e}`,xl:(e="rgb(0 0 0 / 0.1)")=>`0 20px 25px -5px ${e}, 0 8px 10px -6px ${e}`,"2xl":(e="rgb(0 0 0 / 0.25)")=>`0 25px 50px -12px ${e}`,inner:(e="rgb(0 0 0 / 0.05)")=>`inset 0 2px 4px 0 ${e}`,none:()=>"none"}},X6=le('<svg width=14 height=14 viewBox="0 0 14 14"fill=none xmlns=http://www.w3.org/2000/svg><path d="M13 13L9.00007 9M10.3333 5.66667C10.3333 8.244 8.244 10.3333 5.66667 10.3333C3.08934 10.3333 1 8.244 1 5.66667C1 3.08934 3.08934 1 5.66667 1C8.244 1 10.3333 3.08934 10.3333 5.66667Z"stroke=currentColor stroke-width=1.66667 stroke-linecap=round stroke-linejoin=round>'),J6=le('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M9 3H15M3 6H21M19 6L18.2987 16.5193C18.1935 18.0975 18.1409 18.8867 17.8 19.485C17.4999 20.0118 17.0472 20.4353 16.5017 20.6997C15.882 21 15.0911 21 13.5093 21H10.4907C8.90891 21 8.11803 21 7.49834 20.6997C6.95276 20.4353 6.50009 20.0118 6.19998 19.485C5.85911 18.8867 5.8065 18.0975 5.70129 16.5193L5 6M10 10.5V15.5M14 10.5V15.5"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),Z6=le('<svg width=10 height=6 viewBox="0 0 10 6"fill=none xmlns=http://www.w3.org/2000/svg><path d="M1 1L5 5L9 1"stroke=currentColor stroke-width=1.66667 stroke-linecap=round stroke-linejoin=round>'),eL=le('<svg width=12 height=12 viewBox="0 0 16 16"fill=none xmlns=http://www.w3.org/2000/svg><path d="M8 13.3333V2.66667M8 2.66667L4 6.66667M8 2.66667L12 6.66667"stroke=currentColor stroke-width=1.66667 stroke-linecap=round stroke-linejoin=round>'),rh=le('<svg width=12 height=12 viewBox="0 0 16 16"fill=none xmlns=http://www.w3.org/2000/svg><path d="M8 2.66667V13.3333M8 13.3333L4 9.33333M8 13.3333L12 9.33333"stroke=currentColor stroke-width=1.66667 stroke-linecap=round stroke-linejoin=round>'),tL=le('<svg viewBox="0 0 24 24"height=12 width=12 fill=none xmlns=http://www.w3.org/2000/svg><path d="M12 2v2m0 16v2M4 12H2m4.314-5.686L4.9 4.9m12.786 1.414L19.1 4.9M6.314 17.69 4.9 19.104m12.786-1.414 1.414 1.414M22 12h-2m-3 0a5 5 0 1 1-10 0 5 5 0 0 1 10 0Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),nL=le('<svg viewBox="0 0 24 24"height=12 width=12 fill=none xmlns=http://www.w3.org/2000/svg><path d="M22 15.844a10.424 10.424 0 0 1-4.306.925c-5.779 0-10.463-4.684-10.463-10.462 0-1.536.33-2.994.925-4.307A10.464 10.464 0 0 0 2 11.538C2 17.316 6.684 22 12.462 22c4.243 0 7.896-2.526 9.538-6.156Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),rL=le('<svg viewBox="0 0 24 24"height=12 width=12 fill=none xmlns=http://www.w3.org/2000/svg><path d="M8 21h8m-4-4v4m-5.2-4h10.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C22 14.72 22 13.88 22 12.2V7.8c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C19.72 3 18.88 3 17.2 3H6.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C2 5.28 2 6.12 2 7.8v4.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C4.28 17 5.12 17 6.8 17Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),iL=le('<svg stroke=currentColor fill=currentColor stroke-width=0 viewBox="0 0 24 24"height=1em width=1em xmlns=http://www.w3.org/2000/svg><path fill=none d="M0 0h24v24H0z"></path><path d="M1 9l2 2c4.97-4.97 13.03-4.97 18 0l2-2C16.93 2.93 7.08 2.93 1 9zm8 8l3 3 3-3a4.237 4.237 0 00-6 0zm-4-4l2 2a7.074 7.074 0 0110 0l2-2C15.14 9.14 8.87 9.14 5 13z">'),sL=le('<svg stroke-width=0 viewBox="0 0 24 24"height=1em width=1em xmlns=http://www.w3.org/2000/svg><path fill=none d="M24 .01c0-.01 0-.01 0 0L0 0v24h24V.01zM0 0h24v24H0V0zm0 0h24v24H0V0z"></path><path d="M22.99 9C19.15 5.16 13.8 3.76 8.84 4.78l2.52 2.52c3.47-.17 6.99 1.05 9.63 3.7l2-2zm-4 4a9.793 9.793 0 00-4.49-2.56l3.53 3.53.96-.97zM2 3.05L5.07 6.1C3.6 6.82 2.22 7.78 1 9l1.99 2c1.24-1.24 2.67-2.16 4.2-2.77l2.24 2.24A9.684 9.684 0 005 13v.01L6.99 15a7.042 7.042 0 014.92-2.06L18.98 20l1.27-1.26L3.29 1.79 2 3.05zM9 17l3 3 3-3a4.237 4.237 0 00-6 0z">'),oL=le('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M9.3951 19.3711L9.97955 20.6856C10.1533 21.0768 10.4368 21.4093 10.7958 21.6426C11.1547 21.8759 11.5737 22.0001 12.0018 22C12.4299 22.0001 12.8488 21.8759 13.2078 21.6426C13.5667 21.4093 13.8503 21.0768 14.024 20.6856L14.6084 19.3711C14.8165 18.9047 15.1664 18.5159 15.6084 18.26C16.0532 18.0034 16.5678 17.8941 17.0784 17.9478L18.5084 18.1C18.9341 18.145 19.3637 18.0656 19.7451 17.8713C20.1265 17.6771 20.4434 17.3763 20.6573 17.0056C20.8715 16.635 20.9735 16.2103 20.9511 15.7829C20.9286 15.3555 20.7825 14.9438 20.5307 14.5978L19.684 13.4344C19.3825 13.0171 19.2214 12.5148 19.224 12C19.2239 11.4866 19.3865 10.9864 19.6884 10.5711L20.5351 9.40778C20.787 9.06175 20.933 8.65007 20.9555 8.22267C20.978 7.79528 20.8759 7.37054 20.6618 7C20.4479 6.62923 20.131 6.32849 19.7496 6.13423C19.3681 5.93997 18.9386 5.86053 18.5129 5.90556L17.0829 6.05778C16.5722 6.11141 16.0577 6.00212 15.6129 5.74556C15.17 5.48825 14.82 5.09736 14.6129 4.62889L14.024 3.31444C13.8503 2.92317 13.5667 2.59072 13.2078 2.3574C12.8488 2.12408 12.4299 1.99993 12.0018 2C11.5737 1.99993 11.1547 2.12408 10.7958 2.3574C10.4368 2.59072 10.1533 2.92317 9.97955 3.31444L9.3951 4.62889C9.18803 5.09736 8.83798 5.48825 8.3951 5.74556C7.95032 6.00212 7.43577 6.11141 6.9251 6.05778L5.49066 5.90556C5.06499 5.86053 4.6354 5.93997 4.25397 6.13423C3.87255 6.32849 3.55567 6.62923 3.34177 7C3.12759 7.37054 3.02555 7.79528 3.04804 8.22267C3.07052 8.65007 3.21656 9.06175 3.46844 9.40778L4.3151 10.5711C4.61704 10.9864 4.77964 11.4866 4.77955 12C4.77964 12.5134 4.61704 13.0137 4.3151 13.4289L3.46844 14.5922C3.21656 14.9382 3.07052 15.3499 3.04804 15.7773C3.02555 16.2047 3.12759 16.6295 3.34177 17C3.55589 17.3706 3.8728 17.6712 4.25417 17.8654C4.63554 18.0596 5.06502 18.1392 5.49066 18.0944L6.92066 17.9422C7.43133 17.8886 7.94587 17.9979 8.39066 18.2544C8.83519 18.511 9.18687 18.902 9.3951 19.3711Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round></path><path d="M12 15C13.6568 15 15 13.6569 15 12C15 10.3431 13.6568 9 12 9C10.3431 9 8.99998 10.3431 8.99998 12C8.99998 13.6569 10.3431 15 12 15Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),aL=le('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M16 21H16.2C17.8802 21 18.7202 21 19.362 20.673C19.9265 20.3854 20.3854 19.9265 20.673 19.362C21 18.7202 21 17.8802 21 16.2V7.8C21 6.11984 21 5.27976 20.673 4.63803C20.3854 4.07354 19.9265 3.6146 19.362 3.32698C18.7202 3 17.8802 3 16.2 3H7.8C6.11984 3 5.27976 3 4.63803 3.32698C4.07354 3.6146 3.6146 4.07354 3.32698 4.63803C3 5.27976 3 6.11984 3 7.8V8M11.5 12.5L17 7M17 7H12M17 7V12M6.2 21H8.8C9.9201 21 10.4802 21 10.908 20.782C11.2843 20.5903 11.5903 20.2843 11.782 19.908C12 19.4802 12 18.9201 12 17.8V15.2C12 14.0799 12 13.5198 11.782 13.092C11.5903 12.7157 11.2843 12.4097 10.908 12.218C10.4802 12 9.92011 12 8.8 12H6.2C5.0799 12 4.51984 12 4.09202 12.218C3.71569 12.4097 3.40973 12.7157 3.21799 13.092C3 13.5198 3 14.0799 3 15.2V17.8C3 18.9201 3 19.4802 3.21799 19.908C3.40973 20.2843 3.71569 20.5903 4.09202 20.782C4.51984 21 5.07989 21 6.2 21Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),lL=le('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path class=copier d="M8 8V5.2C8 4.0799 8 3.51984 8.21799 3.09202C8.40973 2.71569 8.71569 2.40973 9.09202 2.21799C9.51984 2 10.0799 2 11.2 2H18.8C19.9201 2 20.4802 2 20.908 2.21799C21.2843 2.40973 21.5903 2.71569 21.782 3.09202C22 3.51984 22 4.0799 22 5.2V12.8C22 13.9201 22 14.4802 21.782 14.908C21.5903 15.2843 21.2843 15.5903 20.908 15.782C20.4802 16 19.9201 16 18.8 16H16M5.2 22H12.8C13.9201 22 14.4802 22 14.908 21.782C15.2843 21.5903 15.5903 21.2843 15.782 20.908C16 20.4802 16 19.9201 16 18.8V11.2C16 10.0799 16 9.51984 15.782 9.09202C15.5903 8.71569 15.2843 8.40973 14.908 8.21799C14.4802 8 13.9201 8 12.8 8H5.2C4.0799 8 3.51984 8 3.09202 8.21799C2.71569 8.40973 2.40973 8.71569 2.21799 9.09202C2 9.51984 2 10.0799 2 11.2V18.8C2 19.9201 2 20.4802 2.21799 20.908C2.40973 21.2843 2.71569 21.5903 3.09202 21.782C3.51984 22 4.07989 22 5.2 22Z"stroke-width=2 stroke-linecap=round stroke-linejoin=round stroke=currentColor>'),cL=le('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M2.5 21.4998L8.04927 19.3655C8.40421 19.229 8.58168 19.1607 8.74772 19.0716C8.8952 18.9924 9.0358 18.901 9.16804 18.7984C9.31692 18.6829 9.45137 18.5484 9.72028 18.2795L21 6.99982C22.1046 5.89525 22.1046 4.10438 21 2.99981C19.8955 1.89525 18.1046 1.89524 17 2.99981L5.72028 14.2795C5.45138 14.5484 5.31692 14.6829 5.20139 14.8318C5.09877 14.964 5.0074 15.1046 4.92823 15.2521C4.83911 15.4181 4.77085 15.5956 4.63433 15.9506L2.5 21.4998ZM2.5 21.4998L4.55812 16.1488C4.7054 15.7659 4.77903 15.5744 4.90534 15.4867C5.01572 15.4101 5.1523 15.3811 5.2843 15.4063C5.43533 15.4351 5.58038 15.5802 5.87048 15.8703L8.12957 18.1294C8.41967 18.4195 8.56472 18.5645 8.59356 18.7155C8.61877 18.8475 8.58979 18.9841 8.51314 19.0945C8.42545 19.2208 8.23399 19.2944 7.85107 19.4417L2.5 21.4998Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),Ex=le('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M7.5 12L10.5 15L16.5 9M7.8 21H16.2C17.8802 21 18.7202 21 19.362 20.673C19.9265 20.3854 20.3854 19.9265 20.673 19.362C21 18.7202 21 17.8802 21 16.2V7.8C21 6.11984 21 5.27976 20.673 4.63803C20.3854 4.07354 19.9265 3.6146 19.362 3.32698C18.7202 3 17.8802 3 16.2 3H7.8C6.11984 3 5.27976 3 4.63803 3.32698C4.07354 3.6146 3.6146 4.07354 3.32698 4.63803C3 5.27976 3 6.11984 3 7.8V16.2C3 17.8802 3 18.7202 3.32698 19.362C3.6146 19.9265 4.07354 20.3854 4.63803 20.673C5.27976 21 6.11984 21 7.8 21Z"stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),uL=le('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M9 9L15 15M15 9L9 15M7.8 21H16.2C17.8802 21 18.7202 21 19.362 20.673C19.9265 20.3854 20.3854 19.9265 20.673 19.362C21 18.7202 21 17.8802 21 16.2V7.8C21 6.11984 21 5.27976 20.673 4.63803C20.3854 4.07354 19.9265 3.6146 19.362 3.32698C18.7202 3 17.8802 3 16.2 3H7.8C6.11984 3 5.27976 3 4.63803 3.32698C4.07354 3.6146 3.6146 4.07354 3.32698 4.63803C3 5.27976 3 6.11984 3 7.8V16.2C3 17.8802 3 18.7202 3.32698 19.362C3.6146 19.9265 4.07354 20.3854 4.63803 20.673C5.27976 21 6.11984 21 7.8 21Z"stroke=#F04438 stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),dL=le('<svg width=24 height=24 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 xmlns=http://www.w3.org/2000/svg><rect class=list width=20 height=20 y=2 x=2 rx=2></rect><line class=list-item y1=7 y2=7 x1=6 x2=18></line><line class=list-item y2=12 y1=12 x1=6 x2=18></line><line class=list-item y1=17 y2=17 x1=6 x2=18>'),fL=le('<svg viewBox="0 0 24 24"height=20 width=20 fill=none xmlns=http://www.w3.org/2000/svg><path d="M3 7.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3h8.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C21 5.28 21 6.12 21 7.8v8.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.72 21 17.88 21 16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V7.8Z"stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),hL=le('<svg width=14 height=14 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M7.5 12L10.5 15L16.5 9M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),gL=le('<svg width=14 height=14 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M12 2V6M12 18V22M6 12H2M22 12H18M19.0784 19.0784L16.25 16.25M19.0784 4.99994L16.25 7.82837M4.92157 19.0784L7.75 16.25M4.92157 4.99994L7.75 7.82837"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round></path><animateTransform attributeName=transform attributeType=XML type=rotate from=0 to=360 dur=2s repeatCount=indefinite>'),yL=le('<svg width=14 height=14 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M15 9L9 15M9 9L15 15M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),mL=le('<svg width=14 height=14 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M9.5 15V9M14.5 15V9M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),pL=le('<svg version=1.0 viewBox="0 0 633 633"><linearGradient x1=-666.45 x2=-666.45 y1=163.28 y2=163.99 gradientTransform="matrix(633 0 0 633 422177 -103358)"gradientUnits=userSpaceOnUse><stop stop-color=#6BDAFF offset=0></stop><stop stop-color=#F9FFB5 offset=.32></stop><stop stop-color=#FFA770 offset=.71></stop><stop stop-color=#FF7373 offset=1></stop></linearGradient><circle cx=316.5 cy=316.5 r=316.5></circle><defs><filter x=-137.5 y=412 width=454 height=396.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=-137.5 y=412 width=454 height=396.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><ellipse cx=89.5 cy=610.5 rx=214.5 ry=186 fill=#015064 stroke=#00CFE2 stroke-width=25></ellipse></g><defs><filter x=316.5 y=412 width=454 height=396.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=316.5 y=412 width=454 height=396.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><ellipse cx=543.5 cy=610.5 rx=214.5 ry=186 fill=#015064 stroke=#00CFE2 stroke-width=25></ellipse></g><defs><filter x=-137.5 y=450 width=454 height=396.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=-137.5 y=450 width=454 height=396.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><ellipse cx=89.5 cy=648.5 rx=214.5 ry=186 fill=#015064 stroke=#00A8B8 stroke-width=25></ellipse></g><defs><filter x=316.5 y=450 width=454 height=396.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=316.5 y=450 width=454 height=396.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><ellipse cx=543.5 cy=648.5 rx=214.5 ry=186 fill=#015064 stroke=#00A8B8 stroke-width=25></ellipse></g><defs><filter x=-137.5 y=486 width=454 height=396.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=-137.5 y=486 width=454 height=396.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><ellipse cx=89.5 cy=684.5 rx=214.5 ry=186 fill=#015064 stroke=#007782 stroke-width=25></ellipse></g><defs><filter x=316.5 y=486 width=454 height=396.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=316.5 y=486 width=454 height=396.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><ellipse cx=543.5 cy=684.5 rx=214.5 ry=186 fill=#015064 stroke=#007782 stroke-width=25></ellipse></g><defs><filter x=272.2 y=308 width=176.9 height=129.3 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=272.2 y=308 width=176.9 height=129.3 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><line x1=436 x2=431 y1=403.2 y2=431.8 fill=none stroke=#000 stroke-linecap=round stroke-linejoin=bevel stroke-width=11></line><line x1=291 x2=280 y1=341.5 y2=403.5 fill=none stroke=#000 stroke-linecap=round stroke-linejoin=bevel stroke-width=11></line><line x1=332.9 x2=328.6 y1=384.1 y2=411.2 fill=none stroke=#000 stroke-linecap=round stroke-linejoin=bevel stroke-width=11></line><linearGradient x1=-670.75 x2=-671.59 y1=164.4 y2=164.49 gradientTransform="matrix(-184.16 -32.472 -11.461 64.997 -121359 -32126)"gradientUnits=userSpaceOnUse><stop stop-color=#EE2700 offset=0></stop><stop stop-color=#FF008E offset=1></stop></linearGradient><path d="m344.1 363 97.7 17.2c5.8 2.1 8.2 6.1 7.1 12.1s-4.7 9.2-11 9.9l-106-18.7-57.5-59.2c-3.2-4.8-2.9-9.1 0.8-12.8s8.3-4.4 13.7-2.1l55.2 53.6z"clip-rule=evenodd fill-rule=evenodd></path><line x1=428.2 x2=429.1 y1=384.5 y2=378 fill=none stroke=#fff stroke-linecap=round stroke-linejoin=bevel stroke-width=7></line><line x1=395.2 x2=396.1 y1=379.5 y2=373 fill=none stroke=#fff stroke-linecap=round stroke-linejoin=bevel stroke-width=7></line><line x1=362.2 x2=363.1 y1=373.5 y2=367.4 fill=none stroke=#fff stroke-linecap=round stroke-linejoin=bevel stroke-width=7></line><line x1=324.2 x2=328.4 y1=351.3 y2=347.4 fill=none stroke=#fff stroke-linecap=round stroke-linejoin=bevel stroke-width=7></line><line x1=303.2 x2=307.4 y1=331.3 y2=327.4 fill=none stroke=#fff stroke-linecap=round stroke-linejoin=bevel stroke-width=7></line></g><defs><filter x=73.2 y=113.8 width=280.6 height=317.4 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=73.2 y=113.8 width=280.6 height=317.4 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><linearGradient x1=-672.16 x2=-672.16 y1=165.03 y2=166.03 gradientTransform="matrix(-100.18 48.861 97.976 200.88 -83342 -93.059)"gradientUnits=userSpaceOnUse><stop stop-color=#A17500 offset=0></stop><stop stop-color=#5D2100 offset=1></stop></linearGradient><path d="m192.3 203c8.1 37.3 14 73.6 17.8 109.1 3.8 35.4 2.8 75.1-3 119.2l61.2-16.7c-15.6-59-25.2-97.9-28.6-116.6s-10.8-51.9-22.1-99.6l-25.3 4.6"clip-rule=evenodd fill-rule=evenodd></path><g stroke=#2F8A00><linearGradient x1=-660.23 x2=-660.23 y1=166.72 y2=167.72 gradientTransform="matrix(92.683 4.8573 -2.0259 38.657 61680 -3088.6)"gradientUnits=userSpaceOnUse><stop stop-color=#2F8A00 offset=0></stop><stop stop-color=#90FF57 offset=1></stop></linearGradient><path d="m195 183.9s-12.6-22.1-36.5-29.9c-15.9-5.2-34.4-1.5-55.5 11.1 15.9 14.3 29.5 22.6 40.7 24.9 16.8 3.6 51.3-6.1 51.3-6.1z"clip-rule=evenodd fill-rule=evenodd stroke-width=13></path><linearGradient x1=-661.36 x2=-661.36 y1=164.18 y2=165.18 gradientTransform="matrix(110 5.7648 -6.3599 121.35 73933 -15933)"gradientUnits=userSpaceOnUse><stop stop-color=#2F8A00 offset=0></stop><stop stop-color=#90FF57 offset=1></stop></linearGradient><path d="m194.9 184.5s-47.5-8.5-83.2 15.7c-23.8 16.2-34.3 49.3-31.6 99.4 30.3-27.8 52.1-48.5 65.2-61.9 19.8-20.2 49.6-53.2 49.6-53.2z"clip-rule=evenodd fill-rule=evenodd stroke-width=13></path><linearGradient x1=-656.79 x2=-656.79 y1=165.15 y2=166.15 gradientTransform="matrix(62.954 3.2993 -3.5023 66.828 42156 -8754.1)"gradientUnits=userSpaceOnUse><stop stop-color=#2F8A00 offset=0></stop><stop stop-color=#90FF57 offset=1></stop></linearGradient><path d="m195 183.9c-0.8-21.9 6-38 20.6-48.2s29.8-15.4 45.5-15.3c-6.1 21.4-14.5 35.8-25.2 43.4s-24.4 14.2-40.9 20.1z"clip-rule=evenodd fill-rule=evenodd stroke-width=13></path><linearGradient x1=-663.07 x2=-663.07 y1=165.44 y2=166.44 gradientTransform="matrix(152.47 7.9907 -3.0936 59.029 101884 -4318.7)"gradientUnits=userSpaceOnUse><stop stop-color=#2F8A00 offset=0></stop><stop stop-color=#90FF57 offset=1></stop></linearGradient><path d="m194.9 184.5c31.9-30 64.1-39.7 96.7-29s50.8 30.4 54.6 59.1c-35.2-5.5-60.4-9.6-75.8-12.1-15.3-2.6-40.5-8.6-75.5-18z"clip-rule=evenodd fill-rule=evenodd stroke-width=13></path><linearGradient x1=-662.57 x2=-662.57 y1=164.44 y2=165.44 gradientTransform="matrix(136.46 7.1517 -5.2163 99.533 91536 -11442)"gradientUnits=userSpaceOnUse><stop stop-color=#2F8A00 offset=0></stop><stop stop-color=#90FF57 offset=1></stop></linearGradient><path d="m194.9 184.5c35.8-7.6 65.6-0.2 89.2 22s37.7 49 42.3 80.3c-39.8-9.7-68.3-23.8-85.5-42.4s-32.5-38.5-46-59.9z"clip-rule=evenodd fill-rule=evenodd stroke-width=13></path><linearGradient x1=-656.43 x2=-656.43 y1=163.86 y2=164.86 gradientTransform="matrix(60.866 3.1899 -8.7773 167.48 41560 -25168)"gradientUnits=userSpaceOnUse><stop stop-color=#2F8A00 offset=0></stop><stop stop-color=#90FF57 offset=1></stop></linearGradient><path d="m194.9 184.5c-33.6 13.8-53.6 35.7-60.1 65.6s-3.6 63.1 8.7 99.6c27.4-40.3 43.2-69.6 47.4-88s5.6-44.1 4-77.2z"clip-rule=evenodd fill-rule=evenodd stroke-width=13></path><path d="m196.5 182.3c-14.8 21.6-25.1 41.4-30.8 59.4s-9.5 33-11.1 45.1"fill=none stroke-linecap=round stroke-width=8></path><path d="m194.9 185.7c-24.4 1.7-43.8 9-58.1 21.8s-24.7 25.4-31.3 37.8"fill=none stroke-linecap=round stroke-width=8></path><path d="m204.5 176.4c29.7-6.7 52-8.4 67-5.1s26.9 8.6 35.8 15.9"fill=none stroke-linecap=round stroke-width=8></path><path d="m196.5 181.4c20.3 9.9 38.2 20.5 53.9 31.9s27.4 22.1 35.1 32"fill=none stroke-linecap=round stroke-width=8></path></g></g><defs><filter x=50.5 y=399 width=532 height=633 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=50.5 y=399 width=532 height=633 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><linearGradient x1=-666.06 x2=-666.23 y1=163.36 y2=163.75 gradientTransform="matrix(532 0 0 633 354760 -102959)"gradientUnits=userSpaceOnUse><stop stop-color=#FFF400 offset=0></stop><stop stop-color=#3C8700 offset=1></stop></linearGradient><ellipse cx=316.5 cy=715.5 rx=266 ry=316.5></ellipse></g><defs><filter x=391 y=-24 width=288 height=283 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=391 y=-24 width=288 height=283 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><linearGradient x1=-664.56 x2=-664.56 y1=163.79 y2=164.79 gradientTransform="matrix(227 0 0 227 151421 -37204)"gradientUnits=userSpaceOnUse><stop stop-color=#FFDF00 offset=0></stop><stop stop-color=#FF9D00 offset=1></stop></linearGradient><circle cx=565.5 cy=89.5 r=113.5></circle><linearGradient x1=-644.5 x2=-645.77 y1=342 y2=342 gradientTransform="matrix(30 0 0 1 19770 -253)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=427 x2=397 y1=89 y2=89 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=-641.56 x2=-642.83 y1=196.02 y2=196.07 gradientTransform="matrix(26.5 0 0 5.5 17439 -1025.5)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=430.5 x2=404 y1=55.5 y2=50 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=-643.73 x2=-645 y1=185.83 y2=185.9 gradientTransform="matrix(29 0 0 8 19107 -1361)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=431 x2=402 y1=122 y2=130 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=-638.94 x2=-640.22 y1=177.09 y2=177.39 gradientTransform="matrix(24 0 0 13 15783 -2145)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=442 x2=418 y1=153 y2=166 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=-633.42 x2=-634.7 y1=172.41 y2=173.31 gradientTransform="matrix(20 0 0 19 13137 -3096)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=464 x2=444 y1=180 y2=199 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=-619.05 x2=-619.52 y1=170.82 y2=171.82 gradientTransform="matrix(13.83 0 0 22.85 9050 -3703.4)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=491.4 x2=477.5 y1=203 y2=225.9 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=-578.5 x2=-578.63 y1=170.31 y2=171.31 gradientTransform="matrix(7.5 0 0 24.5 4860 -3953)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=524.5 x2=517 y1=219.5 y2=244 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=666.5 x2=666.5 y1=170.31 y2=171.31 gradientTransform="matrix(.5 0 0 24.5 231.5 -3944)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=564.5 x2=565 y1=228.5 y2=253 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12>');function vL(){return X6()}function Ax(){return J6()}function Fo(){return Z6()}function ap(){return eL()}function lp(){return rh()}function bL(){return(()=>{var e=rh();return e.style.setProperty("transform","rotate(90deg)"),e})()}function xL(){return(()=>{var e=rh();return e.style.setProperty("transform","rotate(-90deg)"),e})()}function wL(){return tL()}function SL(){return nL()}function CL(){return rL()}function _L(){return iL()}function kL(){return sL()}function OL(){return oL()}function EL(){return aL()}function AL(){return lL()}function PL(){return cL()}function TL(e){return(()=>{var t=Ex(),n=t.firstChild;return ve(()=>Z(n,"stroke",e.theme==="dark"?"#12B76A":"#027A48")),t})()}function jL(){return uL()}function ML(){return dL()}function $L(e){return[j(pe,{get when(){return e.checked},get children(){var t=Ex(),n=t.firstChild;return ve(()=>Z(n,"stroke",e.theme==="dark"?"#9B8AFB":"#6938EF")),t}}),j(pe,{get when(){return!e.checked},get children(){var t=fL(),n=t.firstChild;return ve(()=>Z(n,"stroke",e.theme==="dark"?"#9B8AFB":"#6938EF")),t}})]}function DL(){return hL()}function LL(){return gL()}function IL(){return yL()}function RL(){return mL()}function cp(){const e=yn();return(()=>{var t=pL(),n=t.firstChild,r=n.nextSibling,i=r.nextSibling,s=i.firstChild,o=i.nextSibling,a=o.firstChild,l=o.nextSibling,c=l.nextSibling,u=c.firstChild,d=c.nextSibling,f=d.firstChild,h=d.nextSibling,g=h.nextSibling,m=g.firstChild,p=g.nextSibling,v=p.firstChild,b=p.nextSibling,w=b.nextSibling,C=w.firstChild,x=w.nextSibling,k=x.firstChild,S=x.nextSibling,_=S.nextSibling,O=_.firstChild,E=_.nextSibling,T=E.firstChild,D=E.nextSibling,V=D.nextSibling,N=V.firstChild,$=V.nextSibling,L=$.firstChild,I=$.nextSibling,oe=I.nextSibling,ue=oe.firstChild,B=oe.nextSibling,J=B.firstChild,ne=B.nextSibling,ae=ne.firstChild,R=ae.nextSibling,G=R.nextSibling,z=G.nextSibling,ce=z.nextSibling,K=ne.nextSibling,de=K.firstChild,fe=K.nextSibling,Ie=fe.firstChild,te=fe.nextSibling,Je=te.firstChild,ke=Je.nextSibling,Ne=ke.nextSibling,_e=Ne.firstChild,qe=_e.nextSibling,Y=qe.nextSibling,Pe=Y.nextSibling,Ze=Pe.nextSibling,$e=Ze.nextSibling,De=$e.nextSibling,he=De.nextSibling,xe=he.nextSibling,ge=xe.nextSibling,Be=ge.nextSibling,Kn=Be.nextSibling,vn=te.nextSibling,Yr=vn.firstChild,Un=vn.nextSibling,Xr=Un.firstChild,Wn=Un.nextSibling,pr=Wn.firstChild,Ha=pr.nextSibling,Xs=Wn.nextSibling,Ka=Xs.firstChild,Bi=Xs.nextSibling,Ua=Bi.firstChild,Js=Bi.nextSibling,Zs=Js.firstChild,eo=Zs.nextSibling,qi=eo.nextSibling,ah=qi.nextSibling,lh=ah.nextSibling,ch=lh.nextSibling,uh=ch.nextSibling,dh=uh.nextSibling,fh=dh.nextSibling,hh=fh.nextSibling,gh=hh.nextSibling,yh=gh.nextSibling,mh=yh.nextSibling,ph=mh.nextSibling,vh=ph.nextSibling,bh=vh.nextSibling,xh=bh.nextSibling,qx=xh.nextSibling;return Z(n,"id",`a-${e}`),Z(r,"fill",`url(#a-${e})`),Z(s,"id",`am-${e}`),Z(o,"id",`b-${e}`),Z(a,"filter",`url(#am-${e})`),Z(l,"mask",`url(#b-${e})`),Z(u,"id",`ah-${e}`),Z(d,"id",`k-${e}`),Z(f,"filter",`url(#ah-${e})`),Z(h,"mask",`url(#k-${e})`),Z(m,"id",`ae-${e}`),Z(p,"id",`j-${e}`),Z(v,"filter",`url(#ae-${e})`),Z(b,"mask",`url(#j-${e})`),Z(C,"id",`ai-${e}`),Z(x,"id",`i-${e}`),Z(k,"filter",`url(#ai-${e})`),Z(S,"mask",`url(#i-${e})`),Z(O,"id",`aj-${e}`),Z(E,"id",`h-${e}`),Z(T,"filter",`url(#aj-${e})`),Z(D,"mask",`url(#h-${e})`),Z(N,"id",`ag-${e}`),Z($,"id",`g-${e}`),Z(L,"filter",`url(#ag-${e})`),Z(I,"mask",`url(#g-${e})`),Z(ue,"id",`af-${e}`),Z(B,"id",`f-${e}`),Z(J,"filter",`url(#af-${e})`),Z(ne,"mask",`url(#f-${e})`),Z(z,"id",`m-${e}`),Z(ce,"fill",`url(#m-${e})`),Z(de,"id",`ak-${e}`),Z(fe,"id",`e-${e}`),Z(Ie,"filter",`url(#ak-${e})`),Z(te,"mask",`url(#e-${e})`),Z(Je,"id",`n-${e}`),Z(ke,"fill",`url(#n-${e})`),Z(_e,"id",`r-${e}`),Z(qe,"fill",`url(#r-${e})`),Z(Y,"id",`s-${e}`),Z(Pe,"fill",`url(#s-${e})`),Z(Ze,"id",`q-${e}`),Z($e,"fill",`url(#q-${e})`),Z(De,"id",`p-${e}`),Z(he,"fill",`url(#p-${e})`),Z(xe,"id",`o-${e}`),Z(ge,"fill",`url(#o-${e})`),Z(Be,"id",`l-${e}`),Z(Kn,"fill",`url(#l-${e})`),Z(Yr,"id",`al-${e}`),Z(Un,"id",`d-${e}`),Z(Xr,"filter",`url(#al-${e})`),Z(Wn,"mask",`url(#d-${e})`),Z(pr,"id",`u-${e}`),Z(Ha,"fill",`url(#u-${e})`),Z(Ka,"id",`ad-${e}`),Z(Bi,"id",`c-${e}`),Z(Ua,"filter",`url(#ad-${e})`),Z(Js,"mask",`url(#c-${e})`),Z(Zs,"id",`t-${e}`),Z(eo,"fill",`url(#t-${e})`),Z(qi,"id",`v-${e}`),Z(ah,"stroke",`url(#v-${e})`),Z(lh,"id",`aa-${e}`),Z(ch,"stroke",`url(#aa-${e})`),Z(uh,"id",`w-${e}`),Z(dh,"stroke",`url(#w-${e})`),Z(fh,"id",`ac-${e}`),Z(hh,"stroke",`url(#ac-${e})`),Z(gh,"id",`ab-${e}`),Z(yh,"stroke",`url(#ab-${e})`),Z(mh,"id",`y-${e}`),Z(ph,"stroke",`url(#y-${e})`),Z(vh,"id",`x-${e}`),Z(bh,"stroke",`url(#x-${e})`),Z(xh,"id",`z-${e}`),Z(qx,"stroke",`url(#z-${e})`),t})()}var NL=le('<span><svg width=16 height=16 viewBox="0 0 16 16"fill=none xmlns=http://www.w3.org/2000/svg><path d="M6 12L10 8L6 4"stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),FL=le('<button title="Copy object to clipboard">'),BL=le('<button title="Remove all items"aria-label="Remove all items">'),qL=le('<button title="Delete item"aria-label="Delete item">'),zL=le('<button title="Toggle value"aria-label="Toggle value">'),HL=le('<button title="Bulk Edit Data"aria-label="Bulk Edit Data">'),po=le("<div>"),KL=le("<div><button> <span></span> <span> "),UL=le("<input>"),up=le("<span>"),WL=le("<div><span>:"),VL=le("<div><div><button> [<!>...<!>]");function GL(e,t){let n=0;const r=[];for(;n<e.length;)r.push(e.slice(n,n+t)),n=n+t;return r}var dp=e=>{const t=mt(),n=ye().shadowDOMTarget?je.bind({target:ye().shadowDOMTarget}):je,r=H(()=>t()==="dark"?Ys(n):Qs(n));return(()=>{var i=NL();return ve(()=>ee(i,se(r().expander,n`
|
|
70
70
|
transform: rotate(${e.expanded?90:0}deg);
|
|
71
71
|
`,e.expanded&&n`
|