react-semaphor 0.0.411 → 0.0.413

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.
@@ -1,356 +0,0 @@
1
- "use strict";var K3=Object.defineProperty;var tC=e=>{throw TypeError(e)};var X3=(e,t,n)=>t in e?K3(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var fe=(e,t,n)=>X3(e,typeof t!="symbol"?t+"":t,n),Tm=(e,t,n)=>t.has(e)||tC("Cannot "+n);var Y=(e,t,n)=>(Tm(e,t,"read from private field"),n?n.call(e):t.get(e)),_e=(e,t,n)=>t.has(e)?tC("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),ge=(e,t,n,r)=>(Tm(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),Ge=(e,t,n)=>(Tm(e,t,"access private method"),n);var ef=(e,t,n,r)=>({set _(o){ge(e,t,o,n)},get _(){return Y(e,t,r)}});const E=require("react"),gn=require("react-dom"),m=require("react/jsx-runtime");function rx(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const S=rx(E),Js=rx(gn),nC=rx(m);function Y2(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=Y2(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Ph(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Y2(e))&&(r&&(r+=" "),r+=t);return r}const Q3=Object.freeze(Object.defineProperty({__proto__:null,clsx:Ph,default:Ph},Symbol.toStringTag,{value:"Module"})),ox="-",J3=e=>{const t=e6(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:s=>{const a=s.split(ox);return a[0]===""&&a.length!==1&&a.shift(),K2(a,t)||Z3(s)},getConflictingClassGroupIds:(s,a)=>{const l=n[s]||[];return a&&r[s]?[...l,...r[s]]:l}}},K2=(e,t)=>{var s;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?K2(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const i=e.join(ox);return(s=t.validators.find(({validator:a})=>a(i)))==null?void 0:s.classGroupId},rC=/^\[(.+)\]$/,Z3=e=>{if(rC.test(e)){const t=rC.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},e6=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return n6(Object.entries(e.classGroups),n).forEach(([i,s])=>{k0(s,r,i,t)}),r},k0=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const i=o===""?t:oC(t,o);i.classGroupId=n;return}if(typeof o=="function"){if(t6(o)){k0(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([i,s])=>{k0(s,oC(t,i),n,r)})})},oC=(e,t)=>{let n=e;return t.split(ox).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},t6=e=>e.isThemeGetter,n6=(e,t)=>t?e.map(([n,r])=>{const o=r.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([s,a])=>[t+s,a])):i);return[n,o]}):e,r6=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const o=(i,s)=>{n.set(i,s),t++,t>e&&(t=0,r=n,n=new Map)};return{get(i){let s=n.get(i);if(s!==void 0)return s;if((s=r.get(i))!==void 0)return o(i,s),s},set(i,s){n.has(i)?n.set(i,s):o(i,s)}}},X2="!",o6=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,o=t[0],i=t.length,s=a=>{const l=[];let c=0,u=0,d;for(let b=0;b<a.length;b++){let v=a[b];if(c===0){if(v===o&&(r||a.slice(b,b+i)===t)){l.push(a.slice(u,b)),u=b+i;continue}if(v==="/"){d=b;continue}}v==="["?c++:v==="]"&&c--}const h=l.length===0?a:a.substring(u),f=h.startsWith(X2),p=f?h.substring(1):h,g=d&&d>u?d-u:void 0;return{modifiers:l,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:g}};return n?a=>n({className:a,parseClassName:s}):s},i6=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},s6=e=>({cache:r6(e.cacheSize),parseClassName:o6(e),...J3(e)}),a6=/\s+/,l6=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,i=[],s=e.trim().split(a6);let a="";for(let l=s.length-1;l>=0;l-=1){const c=s[l],{modifiers:u,hasImportantModifier:d,baseClassName:h,maybePostfixModifierPosition:f}=n(c);let p=!!f,g=r(p?h.substring(0,f):h);if(!g){if(!p){a=c+(a.length>0?" "+a:a);continue}if(g=r(h),!g){a=c+(a.length>0?" "+a:a);continue}p=!1}const b=i6(u).join(":"),v=d?b+X2:b,x=v+g;if(i.includes(x))continue;i.push(x);const y=o(g,p);for(let _=0;_<y.length;++_){const w=y[_];i.push(v+w)}a=c+(a.length>0?" "+a:a)}return a};function c6(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Q2(t))&&(r&&(r+=" "),r+=n);return r}const Q2=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Q2(e[r]))&&(n&&(n+=" "),n+=t);return n};function u6(e,...t){let n,r,o,i=s;function s(l){const c=t.reduce((u,d)=>d(u),e());return n=s6(c),r=n.cache.get,o=n.cache.set,i=a,a(l)}function a(l){const c=r(l);if(c)return c;const u=l6(l,n);return o(l,u),u}return function(){return i(c6.apply(null,arguments))}}const Ct=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},J2=/^\[(?:([a-z-]+):)?(.+)\]$/i,d6=/^\d+\/\d+$/,f6=new Set(["px","full","screen"]),h6=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,p6=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,g6=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,m6=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,b6=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,No=e=>Xa(e)||f6.has(e)||d6.test(e),di=e=>Ql(e,"length",E6),Xa=e=>!!e&&!Number.isNaN(Number(e)),Im=e=>Ql(e,"number",Xa),xc=e=>!!e&&Number.isInteger(Number(e)),v6=e=>e.endsWith("%")&&Xa(e.slice(0,-1)),Fe=e=>J2.test(e),fi=e=>h6.test(e),y6=new Set(["length","size","percentage"]),x6=e=>Ql(e,y6,Z2),w6=e=>Ql(e,"position",Z2),S6=new Set(["image","url"]),C6=e=>Ql(e,S6,P6),_6=e=>Ql(e,"",R6),wc=()=>!0,Ql=(e,t,n)=>{const r=J2.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},E6=e=>p6.test(e)&&!g6.test(e),Z2=()=>!1,R6=e=>m6.test(e),P6=e=>b6.test(e),M6=()=>{const e=Ct("colors"),t=Ct("spacing"),n=Ct("blur"),r=Ct("brightness"),o=Ct("borderColor"),i=Ct("borderRadius"),s=Ct("borderSpacing"),a=Ct("borderWidth"),l=Ct("contrast"),c=Ct("grayscale"),u=Ct("hueRotate"),d=Ct("invert"),h=Ct("gap"),f=Ct("gradientColorStops"),p=Ct("gradientColorStopPositions"),g=Ct("inset"),b=Ct("margin"),v=Ct("opacity"),x=Ct("padding"),y=Ct("saturate"),_=Ct("scale"),w=Ct("sepia"),C=Ct("skew"),R=Ct("space"),k=Ct("translate"),D=()=>["auto","contain","none"],I=()=>["auto","hidden","clip","visible","scroll"],T=()=>["auto",Fe,t],N=()=>[Fe,t],G=()=>["",No,di],z=()=>["auto",Xa,Fe],O=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],A=()=>["solid","dashed","dotted","double","none"],L=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],j=()=>["start","end","center","between","around","evenly","stretch"],B=()=>["","0",Fe],M=()=>["auto","avoid","all","avoid-page","page","left","right","column"],W=()=>[Xa,Fe];return{cacheSize:500,separator:":",theme:{colors:[wc],spacing:[No,di],blur:["none","",fi,Fe],brightness:W(),borderColor:[e],borderRadius:["none","","full",fi,Fe],borderSpacing:N(),borderWidth:G(),contrast:W(),grayscale:B(),hueRotate:W(),invert:B(),gap:N(),gradientColorStops:[e],gradientColorStopPositions:[v6,di],inset:T(),margin:T(),opacity:W(),padding:N(),saturate:W(),scale:W(),sepia:B(),skew:W(),space:N(),translate:N()},classGroups:{aspect:[{aspect:["auto","square","video",Fe]}],container:["container"],columns:[{columns:[fi]}],"break-after":[{"break-after":M()}],"break-before":[{"break-before":M()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...O(),Fe]}],overflow:[{overflow:I()}],"overflow-x":[{"overflow-x":I()}],"overflow-y":[{"overflow-y":I()}],overscroll:[{overscroll:D()}],"overscroll-x":[{"overscroll-x":D()}],"overscroll-y":[{"overscroll-y":D()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[g]}],"inset-x":[{"inset-x":[g]}],"inset-y":[{"inset-y":[g]}],start:[{start:[g]}],end:[{end:[g]}],top:[{top:[g]}],right:[{right:[g]}],bottom:[{bottom:[g]}],left:[{left:[g]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",xc,Fe]}],basis:[{basis:T()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Fe]}],grow:[{grow:B()}],shrink:[{shrink:B()}],order:[{order:["first","last","none",xc,Fe]}],"grid-cols":[{"grid-cols":[wc]}],"col-start-end":[{col:["auto",{span:["full",xc,Fe]},Fe]}],"col-start":[{"col-start":z()}],"col-end":[{"col-end":z()}],"grid-rows":[{"grid-rows":[wc]}],"row-start-end":[{row:["auto",{span:[xc,Fe]},Fe]}],"row-start":[{"row-start":z()}],"row-end":[{"row-end":z()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Fe]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Fe]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...j()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...j(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...j(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[x]}],px:[{px:[x]}],py:[{py:[x]}],ps:[{ps:[x]}],pe:[{pe:[x]}],pt:[{pt:[x]}],pr:[{pr:[x]}],pb:[{pb:[x]}],pl:[{pl:[x]}],m:[{m:[b]}],mx:[{mx:[b]}],my:[{my:[b]}],ms:[{ms:[b]}],me:[{me:[b]}],mt:[{mt:[b]}],mr:[{mr:[b]}],mb:[{mb:[b]}],ml:[{ml:[b]}],"space-x":[{"space-x":[R]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[R]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Fe,t]}],"min-w":[{"min-w":[Fe,t,"min","max","fit"]}],"max-w":[{"max-w":[Fe,t,"none","full","min","max","fit","prose",{screen:[fi]},fi]}],h:[{h:[Fe,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Fe,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Fe,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Fe,t,"auto","min","max","fit"]}],"font-size":[{text:["base",fi,di]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Im]}],"font-family":[{font:[wc]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Fe]}],"line-clamp":[{"line-clamp":["none",Xa,Im]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",No,Fe]}],"list-image":[{"list-image":["none",Fe]}],"list-style-type":[{list:["none","disc","decimal",Fe]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[v]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[v]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...A(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",No,di]}],"underline-offset":[{"underline-offset":["auto",No,Fe]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:N()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Fe]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Fe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[v]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...O(),w6]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",x6]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},C6]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[p]}],"gradient-via-pos":[{via:[p]}],"gradient-to-pos":[{to:[p]}],"gradient-from":[{from:[f]}],"gradient-via":[{via:[f]}],"gradient-to":[{to:[f]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[v]}],"border-style":[{border:[...A(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[v]}],"divide-style":[{divide:A()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...A()]}],"outline-offset":[{"outline-offset":[No,Fe]}],"outline-w":[{outline:[No,di]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:G()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[v]}],"ring-offset-w":[{"ring-offset":[No,di]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",fi,_6]}],"shadow-color":[{shadow:[wc]}],opacity:[{opacity:[v]}],"mix-blend":[{"mix-blend":[...L(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":L()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",fi,Fe]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[y]}],sepia:[{sepia:[w]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[v]}],"backdrop-saturate":[{"backdrop-saturate":[y]}],"backdrop-sepia":[{"backdrop-sepia":[w]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Fe]}],duration:[{duration:W()}],ease:[{ease:["linear","in","out","in-out",Fe]}],delay:[{delay:W()}],animate:[{animate:["none","spin","ping","pulse","bounce",Fe]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[_]}],"scale-x":[{"scale-x":[_]}],"scale-y":[{"scale-y":[_]}],rotate:[{rotate:[xc,Fe]}],"translate-x":[{"translate-x":[k]}],"translate-y":[{"translate-y":[k]}],"skew-x":[{"skew-x":[C]}],"skew-y":[{"skew-y":[C]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Fe]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Fe]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":N()}],"scroll-mx":[{"scroll-mx":N()}],"scroll-my":[{"scroll-my":N()}],"scroll-ms":[{"scroll-ms":N()}],"scroll-me":[{"scroll-me":N()}],"scroll-mt":[{"scroll-mt":N()}],"scroll-mr":[{"scroll-mr":N()}],"scroll-mb":[{"scroll-mb":N()}],"scroll-ml":[{"scroll-ml":N()}],"scroll-p":[{"scroll-p":N()}],"scroll-px":[{"scroll-px":N()}],"scroll-py":[{"scroll-py":N()}],"scroll-ps":[{"scroll-ps":N()}],"scroll-pe":[{"scroll-pe":N()}],"scroll-pt":[{"scroll-pt":N()}],"scroll-pr":[{"scroll-pr":N()}],"scroll-pb":[{"scroll-pb":N()}],"scroll-pl":[{"scroll-pl":N()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Fe]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[No,di,Im]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},k6=u6(M6);class Lc extends Error{}Lc.prototype.name="InvalidTokenError";function O6(e){return decodeURIComponent(atob(e).replace(/(.)/g,(t,n)=>{let r=n.charCodeAt(0).toString(16).toUpperCase();return r.length<2&&(r="0"+r),"%"+r}))}function D6(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return O6(t)}catch{return atob(t)}}function ix(e,t){if(typeof e!="string")throw new Lc("Invalid token specified: must be a string");t||(t={});const n=t.header===!0?0:1,r=e.split(".")[n];if(typeof r!="string")throw new Lc(`Invalid token specified: missing part #${n+1}`);let o;try{o=D6(r)}catch(i){throw new Lc(`Invalid token specified: invalid base64 for part #${n+1} (${i.message})`)}try{return JSON.parse(o)}catch(i){throw new Lc(`Invalid token specified: invalid json for part #${n+1} (${i.message})`)}}const T6={},iC=e=>{let t;const n=new Set,r=(u,d)=>{const h=typeof u=="function"?u(t):u;if(!Object.is(h,t)){const f=t;t=d??(typeof h!="object"||h===null)?h:Object.assign({},t,h),n.forEach(p=>p(t,f))}},o=()=>t,l={setState:r,getState:o,getInitialState:()=>c,subscribe:u=>(n.add(u),()=>n.delete(u)),destroy:()=>{(T6?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},c=t=e(r,o,l);return l},I6=e=>e?iC(e):iC;var Qo=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Yi(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function sx(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,o.get?o:{enumerable:!0,get:function(){return e[r]}})}),n}var O0={exports:{}},Am={},tf={exports:{}},Nm={};/**
2
- * @license React
3
- * use-sync-external-store-shim.production.js
4
- *
5
- * Copyright (c) Meta Platforms, Inc. and affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */var sC;function A6(){if(sC)return Nm;sC=1;var e=E;function t(d,h){return d===h&&(d!==0||1/d===1/h)||d!==d&&h!==h}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,o=e.useEffect,i=e.useLayoutEffect,s=e.useDebugValue;function a(d,h){var f=h(),p=r({inst:{value:f,getSnapshot:h}}),g=p[0].inst,b=p[1];return i(function(){g.value=f,g.getSnapshot=h,l(g)&&b({inst:g})},[d,f,h]),o(function(){return l(g)&&b({inst:g}),d(function(){l(g)&&b({inst:g})})},[d]),s(f),f}function l(d){var h=d.getSnapshot;d=d.value;try{var f=h();return!n(d,f)}catch{return!0}}function c(d,h){return h()}var u=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:a;return Nm.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:u,Nm}var jm={};/**
10
- * @license React
11
- * use-sync-external-store-shim.development.js
12
- *
13
- * Copyright (c) Meta Platforms, Inc. and affiliates.
14
- *
15
- * This source code is licensed under the MIT license found in the
16
- * LICENSE file in the root directory of this source tree.
17
- */var aC;function N6(){return aC||(aC=1,process.env.NODE_ENV!=="production"&&function(){function e(f,p){return f===p&&(f!==0||1/f===1/p)||f!==f&&p!==p}function t(f,p){u||o.startTransition===void 0||(u=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var g=p();if(!d){var b=p();i(g,b)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),d=!0)}b=s({inst:{value:g,getSnapshot:p}});var v=b[0].inst,x=b[1];return l(function(){v.value=g,v.getSnapshot=p,n(v)&&x({inst:v})},[f,g,p]),a(function(){return n(v)&&x({inst:v}),f(function(){n(v)&&x({inst:v})})},[f]),c(g),g}function n(f){var p=f.getSnapshot;f=f.value;try{var g=p();return!i(f,g)}catch{return!0}}function r(f,p){return p()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var o=E,i=typeof Object.is=="function"?Object.is:e,s=o.useState,a=o.useEffect,l=o.useLayoutEffect,c=o.useDebugValue,u=!1,d=!1,h=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?r:t;jm.useSyncExternalStore=o.useSyncExternalStore!==void 0?o.useSyncExternalStore:h,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),jm}var lC;function ax(){return lC||(lC=1,process.env.NODE_ENV==="production"?tf.exports=A6():tf.exports=N6()),tf.exports}/**
18
- * @license React
19
- * use-sync-external-store-shim/with-selector.production.js
20
- *
21
- * Copyright (c) Meta Platforms, Inc. and affiliates.
22
- *
23
- * This source code is licensed under the MIT license found in the
24
- * LICENSE file in the root directory of this source tree.
25
- */var cC;function j6(){if(cC)return Am;cC=1;var e=E,t=ax();function n(c,u){return c===u&&(c!==0||1/c===1/u)||c!==c&&u!==u}var r=typeof Object.is=="function"?Object.is:n,o=t.useSyncExternalStore,i=e.useRef,s=e.useEffect,a=e.useMemo,l=e.useDebugValue;return Am.useSyncExternalStoreWithSelector=function(c,u,d,h,f){var p=i(null);if(p.current===null){var g={hasValue:!1,value:null};p.current=g}else g=p.current;p=a(function(){function v(C){if(!x){if(x=!0,y=C,C=h(C),f!==void 0&&g.hasValue){var R=g.value;if(f(R,C))return _=R}return _=C}if(R=_,r(y,C))return R;var k=h(C);return f!==void 0&&f(R,k)?(y=C,R):(y=C,_=k)}var x=!1,y,_,w=d===void 0?null:d;return[function(){return v(u())},w===null?void 0:function(){return v(w())}]},[u,d,h,f]);var b=o(c,p[0],p[1]);return s(function(){g.hasValue=!0,g.value=b},[b]),l(b),b},Am}var Fm={};/**
26
- * @license React
27
- * use-sync-external-store-shim/with-selector.development.js
28
- *
29
- * Copyright (c) Meta Platforms, Inc. and affiliates.
30
- *
31
- * This source code is licensed under the MIT license found in the
32
- * LICENSE file in the root directory of this source tree.
33
- */var uC;function F6(){return uC||(uC=1,process.env.NODE_ENV!=="production"&&function(){function e(c,u){return c===u&&(c!==0||1/c===1/u)||c!==c&&u!==u}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=E,n=ax(),r=typeof Object.is=="function"?Object.is:e,o=n.useSyncExternalStore,i=t.useRef,s=t.useEffect,a=t.useMemo,l=t.useDebugValue;Fm.useSyncExternalStoreWithSelector=function(c,u,d,h,f){var p=i(null);if(p.current===null){var g={hasValue:!1,value:null};p.current=g}else g=p.current;p=a(function(){function v(C){if(!x){if(x=!0,y=C,C=h(C),f!==void 0&&g.hasValue){var R=g.value;if(f(R,C))return _=R}return _=C}if(R=_,r(y,C))return R;var k=h(C);return f!==void 0&&f(R,k)?(y=C,R):(y=C,_=k)}var x=!1,y,_,w=d===void 0?null:d;return[function(){return v(u())},w===null?void 0:function(){return v(w())}]},[u,d,h,f]);var b=o(c,p[0],p[1]);return s(function(){g.hasValue=!0,g.value=b},[b]),l(b),b},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),Fm}process.env.NODE_ENV==="production"?O0.exports=j6():O0.exports=F6();var L6=O0.exports;const $6=Yi(L6),eM={},{useDebugValue:z6}=E,{useSyncExternalStoreWithSelector:B6}=$6;let dC=!1;const V6=e=>e;function H6(e,t=V6,n){(eM?"production":void 0)!=="production"&&n&&!dC&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),dC=!0);const r=B6(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return z6(r),r}const W6=e=>{(eM?"production":void 0)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t=typeof e=="function"?I6(e):e,n=(r,o)=>H6(t,r,o);return Object.assign(n,t),n},tM=e=>W6;var nM=Symbol.for("immer-nothing"),fC=Symbol.for("immer-draftable"),pr=Symbol.for("immer-state"),U6=process.env.NODE_ENV!=="production"?[function(e){return`The plugin for '${e}' has not been loaded into Immer. To enable the plugin, import and call \`enable${e}()\` when initializing your application.`},function(e){return`produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${e}'`},"This object has been frozen and should not be mutated",function(e){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+e},"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.","Immer forbids circular references","The first or second argument to `produce` must be a function","The third argument to `produce` must be a function or undefined","First argument to `createDraft` must be a plain object, an array, or an immerable object","First argument to `finishDraft` must be a draft returned by `createDraft`",function(e){return`'current' expects a draft, got: ${e}`},"Object.defineProperty() cannot be used on an Immer draft","Object.setPrototypeOf() cannot be used on an Immer draft","Immer only supports deleting array indices","Immer only supports setting array indices and the 'length' property",function(e){return`'original' expects a draft, got: ${e}`}]:[];function Wn(e,...t){if(process.env.NODE_ENV!=="production"){const n=U6[e],r=typeof n=="function"?n.apply(null,t):n;throw new Error(`[Immer] ${r}`)}throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Pl=Object.getPrototypeOf;function Ml(e){return!!e&&!!e[pr]}function Zs(e){var t;return e?rM(e)||Array.isArray(e)||!!e[fC]||!!((t=e.constructor)!=null&&t[fC])||Bp(e)||Vp(e):!1}var q6=Object.prototype.constructor.toString();function rM(e){if(!e||typeof e!="object")return!1;const t=Pl(e);if(t===null)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object?!0:typeof n=="function"&&Function.toString.call(n)===q6}function Mh(e,t){zp(e)===0?Reflect.ownKeys(e).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function zp(e){const t=e[pr];return t?t.type_:Array.isArray(e)?1:Bp(e)?2:Vp(e)?3:0}function D0(e,t){return zp(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function oM(e,t,n){const r=zp(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function G6(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Bp(e){return e instanceof Map}function Vp(e){return e instanceof Set}function gs(e){return e.copy_||e.base_}function T0(e,t){if(Bp(e))return new Map(e);if(Vp(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=rM(e);if(t===!0||t==="class_only"&&!n){const r=Object.getOwnPropertyDescriptors(e);delete r[pr];let o=Reflect.ownKeys(r);for(let i=0;i<o.length;i++){const s=o[i],a=r[s];a.writable===!1&&(a.writable=!0,a.configurable=!0),(a.get||a.set)&&(r[s]={configurable:!0,writable:!0,enumerable:a.enumerable,value:e[s]})}return Object.create(Pl(e),r)}else{const r=Pl(e);if(r!==null&&n)return{...e};const o=Object.create(r);return Object.assign(o,e)}}function lx(e,t=!1){return Hp(e)||Ml(e)||!Zs(e)||(zp(e)>1&&(e.set=e.add=e.clear=e.delete=Y6),Object.freeze(e),t&&Object.entries(e).forEach(([n,r])=>lx(r,!0))),e}function Y6(){Wn(2)}function Hp(e){return Object.isFrozen(e)}var K6={};function ea(e){const t=K6[e];return t||Wn(0,e),t}var Cu;function iM(){return Cu}function X6(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function hC(e,t){t&&(ea("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function I0(e){A0(e),e.drafts_.forEach(Q6),e.drafts_=null}function A0(e){e===Cu&&(Cu=e.parent_)}function pC(e){return Cu=X6(Cu,e)}function Q6(e){const t=e[pr];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function gC(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[pr].modified_&&(I0(t),Wn(4)),Zs(e)&&(e=kh(t,e),t.parent_||Oh(t,e)),t.patches_&&ea("Patches").generateReplacementPatches_(n[pr].base_,e,t.patches_,t.inversePatches_)):e=kh(t,n,[]),I0(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==nM?e:void 0}function kh(e,t,n){if(Hp(t))return t;const r=t[pr];if(!r)return Mh(t,(o,i)=>mC(e,r,t,o,i,n)),t;if(r.scope_!==e)return t;if(!r.modified_)return Oh(e,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;const o=r.copy_;let i=o,s=!1;r.type_===3&&(i=new Set(o),o.clear(),s=!0),Mh(i,(a,l)=>mC(e,r,o,a,l,n,s)),Oh(e,o,!1),n&&e.patches_&&ea("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function mC(e,t,n,r,o,i,s){if(process.env.NODE_ENV!=="production"&&o===n&&Wn(5),Ml(o)){const a=i&&t&&t.type_!==3&&!D0(t.assigned_,r)?i.concat(r):void 0,l=kh(e,o,a);if(oM(n,r,l),Ml(l))e.canAutoFreeze_=!1;else return}else s&&n.add(o);if(Zs(o)&&!Hp(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;kh(e,o),(!t||!t.scope_.parent_)&&typeof r!="symbol"&&Object.prototype.propertyIsEnumerable.call(n,r)&&Oh(e,o)}}function Oh(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&lx(t,n)}function J6(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:iM(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let o=r,i=cx;n&&(o=[r],i=_u);const{revoke:s,proxy:a}=Proxy.revocable(o,i);return r.draft_=a,r.revoke_=s,a}var cx={get(e,t){if(t===pr)return e;const n=gs(e);if(!D0(n,t))return Z6(e,n,t);const r=n[t];return e.finalized_||!Zs(r)?r:r===Lm(e.base_,t)?($m(e),e.copy_[t]=j0(r,e)):r},has(e,t){return t in gs(e)},ownKeys(e){return Reflect.ownKeys(gs(e))},set(e,t,n){const r=sM(gs(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const o=Lm(gs(e),t),i=o==null?void 0:o[pr];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(G6(n,o)&&(n!==void 0||D0(e.base_,t)))return!0;$m(e),N0(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty(e,t){return Lm(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,$m(e),N0(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=gs(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){Wn(11)},getPrototypeOf(e){return Pl(e.base_)},setPrototypeOf(){Wn(12)}},_u={};Mh(cx,(e,t)=>{_u[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});_u.deleteProperty=function(e,t){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(t))&&Wn(13),_u.set.call(this,e,t,void 0)};_u.set=function(e,t,n){return process.env.NODE_ENV!=="production"&&t!=="length"&&isNaN(parseInt(t))&&Wn(14),cx.set.call(this,e[0],t,n,e[0])};function Lm(e,t){const n=e[pr];return(n?gs(n):e)[t]}function Z6(e,t,n){var o;const r=sM(t,n);return r?"value"in r?r.value:(o=r.get)==null?void 0:o.call(e.draft_):void 0}function sM(e,t){if(!(t in e))return;let n=Pl(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Pl(n)}}function N0(e){e.modified_||(e.modified_=!0,e.parent_&&N0(e.parent_))}function $m(e){e.copy_||(e.copy_=T0(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var e8=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,n,r)=>{if(typeof t=="function"&&typeof n!="function"){const i=n;n=t;const s=this;return function(l=i,...c){return s.produce(l,u=>n.call(this,u,...c))}}typeof n!="function"&&Wn(6),r!==void 0&&typeof r!="function"&&Wn(7);let o;if(Zs(t)){const i=pC(this),s=j0(t,void 0);let a=!0;try{o=n(s),a=!1}finally{a?I0(i):A0(i)}return hC(i,r),gC(o,i)}else if(!t||typeof t!="object"){if(o=n(t),o===void 0&&(o=t),o===nM&&(o=void 0),this.autoFreeze_&&lx(o,!0),r){const i=[],s=[];ea("Patches").generateReplacementPatches_(t,o,i,s),r(i,s)}return o}else Wn(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(s,...a)=>this.produceWithPatches(s,l=>t(l,...a));let r,o;return[this.produce(t,n,(s,a)=>{r=s,o=a}),r,o]},typeof(e==null?void 0:e.autoFreeze)=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof(e==null?void 0:e.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){Zs(e)||Wn(8),Ml(e)&&(e=t8(e));const t=pC(this),n=j0(e,void 0);return n[pr].isManual_=!0,A0(t),n}finishDraft(e,t){const n=e&&e[pr];(!n||!n.isManual_)&&Wn(9);const{scope_:r}=n;return hC(r,t),gC(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const o=t[n];if(o.path.length===0&&o.op==="replace"){e=o.value;break}}n>-1&&(t=t.slice(n+1));const r=ea("Patches").applyPatches_;return Ml(e)?r(e,t):this.produce(e,o=>r(o,t))}};function j0(e,t){const n=Bp(e)?ea("MapSet").proxyMap_(e,t):Vp(e)?ea("MapSet").proxySet_(e,t):J6(e,t);return(t?t.scope_:iM()).drafts_.push(n),n}function t8(e){return Ml(e)||Wn(10,e),aM(e)}function aM(e){if(!Zs(e)||Hp(e))return e;const t=e[pr];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=T0(e,t.scope_.immer_.useStrictShallowCopy_)}else n=T0(e,!0);return Mh(n,(r,o)=>{oM(n,r,aM(o))}),t&&(t.finalized_=!1),n}var gr=new e8,n8=gr.produce;gr.produceWithPatches.bind(gr);gr.setAutoFreeze.bind(gr);gr.setUseStrictShallowCopy.bind(gr);gr.applyPatches.bind(gr);gr.createDraft.bind(gr);gr.finishDraft.bind(gr);const r8=e=>(t,n,r)=>(r.setState=(o,i,...s)=>{const a=typeof o=="function"?n8(o):o;return t(a,i,...s)},e(r.setState,n,r)),lM=r8;var F0,nf=gn;if(process.env.NODE_ENV==="production")F0=nf.createRoot,nf.hydrateRoot;else{var bC=nf.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;F0=function(e,t){bC.usingClientEntryPoint=!0;try{return nf.createRoot(e,t)}finally{bC.usingClientEntryPoint=!1}}}var cM={},uM={},ux={exports:{}},Le=String,dM=function(){return{isColorSupported:!1,reset:Le,bold:Le,dim:Le,italic:Le,underline:Le,inverse:Le,hidden:Le,strikethrough:Le,black:Le,red:Le,green:Le,yellow:Le,blue:Le,magenta:Le,cyan:Le,white:Le,gray:Le,bgBlack:Le,bgRed:Le,bgGreen:Le,bgYellow:Le,bgBlue:Le,bgMagenta:Le,bgCyan:Le,bgWhite:Le,blackBright:Le,redBright:Le,greenBright:Le,yellowBright:Le,blueBright:Le,magentaBright:Le,cyanBright:Le,whiteBright:Le,bgBlackBright:Le,bgRedBright:Le,bgGreenBright:Le,bgYellowBright:Le,bgBlueBright:Le,bgMagentaBright:Le,bgCyanBright:Le,bgWhiteBright:Le}};ux.exports=dM();ux.exports.createColors=dM;var o8=ux.exports;(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(l,c){for(var u in c)Object.defineProperty(l,u,{enumerable:!0,get:c[u]})}t(e,{dim:function(){return s},default:function(){return a}});const n=r(o8);function r(l){return l&&l.__esModule?l:{default:l}}let o=new Set;function i(l,c,u){typeof process<"u"&&process.env.JEST_WORKER_ID||u&&o.has(u)||(u&&o.add(u),console.warn(""),c.forEach(d=>console.warn(l,"-",d)))}function s(l){return n.default.dim(l)}const a={info(l,c){i(n.default.bold(n.default.cyan("info")),...Array.isArray(l)?[l]:[c,l])},warn(l,c){i(n.default.bold(n.default.yellow("warn")),...Array.isArray(l)?[l]:[c,l])},risk(l,c){i(n.default.bold(n.default.magenta("risk")),...Array.isArray(l)?[l]:[c,l])}}})(uM);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return o}});const t=n(uM);function n(i){return i&&i.__esModule?i:{default:i}}function r({version:i,from:s,to:a}){t.default.warn(`${s}-color-renamed`,[`As of Tailwind CSS ${i}, \`${s}\` has been renamed to \`${a}\`.`,"Update your configuration file to silence this warning."])}const o={inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000",white:"#fff",slate:{50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a",950:"#020617"},gray:{50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827",950:"#030712"},zinc:{50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b",950:"#09090b"},neutral:{50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717",950:"#0a0a0a"},stone:{50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917",950:"#0c0a09"},red:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d",950:"#450a0a"},orange:{50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12",950:"#431407"},amber:{50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f",950:"#451a03"},yellow:{50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12",950:"#422006"},lime:{50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314",950:"#1a2e05"},green:{50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d",950:"#052e16"},emerald:{50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b",950:"#022c22"},teal:{50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a",950:"#042f2e"},cyan:{50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63",950:"#083344"},sky:{50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e",950:"#082f49"},blue:{50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a",950:"#172554"},indigo:{50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81",950:"#1e1b4b"},violet:{50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95",950:"#2e1065"},purple:{50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87",950:"#3b0764"},fuchsia:{50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75",950:"#4a044e"},pink:{50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843",950:"#500724"},rose:{50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337",950:"#4c0519"},get lightBlue(){return r({version:"v2.2",from:"lightBlue",to:"sky"}),this.sky},get warmGray(){return r({version:"v3.0",from:"warmGray",to:"stone"}),this.stone},get trueGray(){return r({version:"v3.0",from:"trueGray",to:"neutral"}),this.neutral},get coolGray(){return r({version:"v3.0",from:"coolGray",to:"gray"}),this.gray},get blueGray(){return r({version:"v3.0",from:"blueGray",to:"slate"}),this.slate}}})(cM);let zm=cM;var i8=(zm.__esModule?zm:{default:zm}).default;const Xe=Yi(i8),Dh=!1,dx=`import pandas as pd
34
- df = pd.DataFrame(data) # 'data' contains the query result
35
- result = df.to_dict('records') # must return 'result' as [dict] type
36
- `,Th="dm",L0=[{locale:"en-US",currency:"USD",currencyName:"US Dollar"},{locale:"en-GB",currency:"GBP",currencyName:"British Pound"},{locale:"en-CA",currency:"CAD",currencyName:"Canadian Dollar"},{locale:"en-AU",currency:"AUD",currencyName:"Australian Dollar"},{locale:"en-IN",currency:"INR",currencyName:"Indian Rupee"},{locale:"ja-JP",currency:"JPY",currencyName:"Japanese Yen"},{locale:"de-DE",currency:"EUR",currencyName:"Germany (Eurozone)"},{locale:"fr-FR",currency:"EUR",currencyName:"France (Eurozone)"},{locale:"es-ES",currency:"EUR",currencyName:"Spain (Eurozone)"},{locale:"it-IT",currency:"EUR",currencyName:"Italy (Eurozone)"},{locale:"fi-FI",currency:"EUR",currencyName:"Finland (Eurozone)"},{locale:"nl-NL",currency:"EUR",currencyName:"Netherlands (Eurozone)"},{locale:"zh-CN",currency:"CNY",currencyName:"Chinese Yuan"},{locale:"ru-RU",currency:"RUB",currencyName:"Russian Ruble"},{locale:"pt-BR",currency:"BRL",currencyName:"Brazilian Real"},{locale:"ko-KR",currency:"KRW",currencyName:"South Korean Won"},{locale:"ar-SA",currency:"SAR",currencyName:"Saudi Riyal"},{locale:"sv-SE",currency:"SEK",currencyName:"Swedish Krona"},{locale:"no-NO",currency:"NOK",currencyName:"Norwegian Krone"},{locale:"da-DK",currency:"DKK",currencyName:"Danish Krone"},{locale:"pl-PL",currency:"PLN",currencyName:"Polish Zloty"},{locale:"tr-TR",currency:"TRY",currencyName:"Turkish Lira"},{locale:"he-IL",currency:"ILS",currencyName:"Israeli Shekel"},{locale:"th-TH",currency:"THB",currencyName:"Thai Baht"},{locale:"vi-VN",currency:"VND",currencyName:"Vietnamese Dong"},{locale:"id-ID",currency:"IDR",currencyName:"Indonesian Rupiah"},{locale:"mx-MX",currency:"MXN",currencyName:"Mexican Peso"},{locale:"za-ZA",currency:"ZAR",currencyName:"South African Rand"},{locale:"sg-SG",currency:"SGD",currencyName:"Singapore Dollar"},{locale:"hk-HK",currency:"HKD",currencyName:"Hong Kong Dollar"},{locale:"ch-CH",currency:"CHF",currencyName:"Swiss Franc"},{locale:"my-MY",currency:"MYR",currencyName:"Malaysian Ringgit"},{locale:"ph-PH",currency:"PHP",currencyName:"Philippine Peso"},{locale:"eg-EG",currency:"EGP",currencyName:"Egyptian Pound"},{locale:"nz-NZ",currency:"NZD",currencyName:"New Zealand Dollar"}],s8=[{label:"English",locales:[{code:"en-US",name:"US English"},{code:"en-GB",name:"British English"},{code:"en-AU",name:"Australian English"},{code:"en-CA",name:"Canadian English"}]},{label:"French",locales:[{code:"fr-FR",name:"France French"},{code:"fr-CA",name:"Canadian French"}]},{label:"Spanish",locales:[{code:"es-ES",name:"Spain Spanish"},{code:"es-MX",name:"Mexican Spanish"},{code:"es-419",name:"Latin American Spanish"}]},{label:"German",locales:[{code:"de-DE",name:"Germany German"},{code:"de-CH",name:"Swiss German"}]},{label:"Chinese",locales:[{code:"zh-CN",name:"Simplified Chinese (China)"},{code:"zh-TW",name:"Traditional Chinese (Taiwan)"},{code:"zh-HK",name:"Hong Kong Chinese"}]},{label:"Japanese",locales:[{code:"ja-JP",name:"Japanese"}]},{label:"Arabic",locales:[{code:"ar-EG",name:"Egypt Arabic"},{code:"ar-SA",name:"Saudi Arabia Arabic"}]},{label:"Russian",locales:[{code:"ru-RU",name:"Russian"}]},{label:"Portuguese",locales:[{code:"pt-PT",name:"Portugal Portuguese"},{code:"pt-BR",name:"Brazil Portuguese"}]},{label:"Indian Languages",locales:[{code:"hi-IN",name:"Hindi (India)"},{code:"ta-IN",name:"Tamil (India)"}]},{label:"Korean",locales:[{code:"ko-KR",name:"Korean"}]},{label:"Italian",locales:[{code:"it-IT",name:"Italian (Italy)"}]},{label:"Dutch",locales:[{code:"nl-NL",name:"Dutch (Netherlands)"}]},{label:"Swedish",locales:[{code:"sv-SE",name:"Swedish (Sweden)"}]},{label:"Turkish",locales:[{code:"tr-TR",name:"Turkish (Turkey)"}]},{label:"Hebrew",locales:[{code:"he-IL",name:"Hebrew (Israel)"}]},{label:"Thai",locales:[{code:"th-TH",name:"Thai (Thailand)"}]},{label:"Polish",locales:[{code:"pl-PL",name:"Polish (Poland)"}]},{label:"Greek",locales:[{code:"el-GR",name:"Greek (Greece)"}]},{label:"Norwegian",locales:[{code:"no-NO",name:"Norwegian (Norway)"}]}],fx=["lg","md","sm","xs","xxs"],Ih={default:{dashboardPanel:"",dashboardTabsContainer:"",gridLayout:{className:""},chart:{font:{family:"Open Sans, Arial, sans-serif"},dataset:{backgroundColor:[Xe.blue[500],Xe.teal[500],Xe.amber[500],Xe.red[500],Xe.indigo[500],Xe.green[500]],borderColor:[Xe.blue[500],Xe.teal[500],Xe.amber[500],Xe.red[500],Xe.indigo[500],Xe.green[500]]},options:{interaction:{mode:"index"},plugins:{datalabels:{display:!1,color:$0},title:{display:!0},tooltip:{backgroundColor:"#fff",bodyColor:"#000",borderWidth:.25,titleColor:"#000",borderColor:"rgb(128,131,139)",cornerRadius:4,usePointStyle:!0,pointStyle:"rectRounded",boxPadding:4},legend:{position:"top",align:"center",maxHeight:0,labels:{useBorderRadius:!0,borderRadius:2}}},scales:{y:{grid:{display:!0},title:{display:!0,text:""},beginAtZero:!0,ticks:{precision:0}},x:{grid:{display:!0},title:{display:!0}}},layout:{padding:{top:-40}},borderRadius:2,responsive:!0,maintainAspectRatio:!1}}},dark:{chart:{dataset:{backgroundColor:[Xe.blue[500],Xe.teal[500],Xe.amber[500],Xe.red[500],Xe.indigo[500],Xe.green[500]],borderColor:[Xe.blue[500],Xe.teal[500],Xe.amber[500],Xe.red[500],Xe.indigo[500],Xe.green[500]],datalables:{color:$0}},options:{plugins:{tooltip:{backgroundColor:"#000",bodyColor:"#fff",borderWidth:.25,titleColor:"#fff",borderColor:"rgb(128,131,139)",cornerRadius:2,boxPadding:4}},datalabels:{display:!1},scales:{x:{grid:{display:!0,color:Xe.slate[800]}},y:{grid:{display:!0,color:Xe.slate[800]}}}}}}};function $0(e){var r,o,i,s,a,l;const t=(a=(s=(i=(o=(r=e==null?void 0:e.chart)==null?void 0:r.config)==null?void 0:o._config)==null?void 0:i.options)==null?void 0:s.plugins)==null?void 0:a.datalabels;let n=(l=e==null?void 0:e.dataset)==null?void 0:l.backgroundColor;return(t==null?void 0:t.align)==="end"&&(t==null?void 0:t.anchor)==="end"&&(n=Eu()),(t==null?void 0:t.align)==="start"&&(t==null?void 0:t.anchor)==="start"&&(n=Eu()),kl(n)}function Eu(){return se.getState().theme==="dark"?"#000000":"#FFFFFF"}function kl(e){let t=0,n=0,r=0,o=0;const i=u=>{if(!u)return Xe.gray[500];const d=u.replace("#",""),h=parseInt(d.substring(0,2),16),f=parseInt(d.substring(2,4),16),p=parseInt(d.substring(4,6),16);t+=h,n+=f,r+=p,o++};Array.isArray(e)?e.forEach(u=>{i(u)}):i(e);const s=t/o,a=n/o,l=r/o;return(s*299+a*587+l*114)/1e3>=180?"black":"white"}const a8=["text","name","enum","varchar","nvarchar","nvarchar2","char","character","longtext","nchar","char varying","nchar varying","character varying","string"],l8=["number","integer","int","int64","bigint","smallint","tinyint","byteint","numeric","decimal","dec","double","real","double precision","float","float4","float8","float64"],c8=["date","datetime","time","timestamp","timestamp without time zone","timestamp_ns"],u8=["boolean"];function hx(e){return e.match(/[A-Z]/)?`"${e}"`:e}function Wp(e){return a8.includes(e.toLowerCase())||/varchar/i.test(e)}function dd(e){return l8.includes(e.toLowerCase())||/int|decimal|float|double/i.test(e)}function Jl(e){return c8.includes(e.toLowerCase())||/date|time|timestamp/i.test(e)}function px(e){return u8.includes(e.toLowerCase())||/boolean/i.test(e)}function d8(e,t,n,r,o){const{measures:i,dimensions:s}=e,a=i==null?void 0:i.map(d=>`${d.calc}(${d.name}) as ${d.calc}_${d.name.replace(/"/g,"")}`).join(", "),l=(s==null?void 0:s.join(", "))||"";let c="";const u=r?`${Th}.${r}`:gx(t,n,o);if(a&&l)return c=`SELECT ${l}, COUNT(*) as count, ${a} FROM ${u} GROUP BY ${l} ORDER BY ${l} DESC LIMIT 100`,c;if(!a&&l)return c=`SELECT ${l}, COUNT(*) as count FROM ${u} GROUP BY ${l} ORDER BY ${l} DESC LIMIT 100`,c;if(a&&!l)return c=`SELECT ${a} FROM ${u} LIMIT 100`,c}function f8(e,t,n="AVG"){var i,s,a,l;let r={};const o=hx(e.column_name);return Wp(e.data_type)&&(((i=t.dimensions)==null?void 0:i.includes(o))?r={...t,dimensions:(s=t.dimensions)==null?void 0:s.filter(u=>u!==o)}:r={...t,dimensions:[...t.dimensions||[],o]}),dd(e.data_type)&&(((a=t.measures)==null?void 0:a.some(u=>u.name===o&&u.calc===n))?r={...t,measures:(l=t.measures)==null?void 0:l.filter(u=>!(u.name===o&&u.calc===n))}:r={...t,measures:[...t.measures||[],{name:o,calc:n||"SUM"}]}),r}function Qa(e){return Wp(e.dataType)?"string":dd(e.dataType)?"number":Jl(e.dataType)?"date":px(e.dataType)?"boolean":"string"}function h8(e){let t;const n=e.data_type.toLowerCase();return Wp(n)?t="T":dd(n)?t="#":Jl(n)?t="D":px(n)?t="B":t="?",t}function p8(e,t){const{dimensions:n,measures:r}=t,o=n==null?void 0:n.includes(e.column_name),i=r==null?void 0:r.some(s=>s.name===e.column_name);return o||i}function fM(e){return e?e!=null&&e.startsWith(`${Th}.`)?e:`${Th}.${e}`:""}function hM({schemaName:e,tableName:t,modelName:n,connectionType:r}){let o=gx(e,t,r);n&&(o=fM(n));let i=o;return(a=>/[A-Z]/.test(a))(t)&&(i=i.split(".").map(l=>`"${l}"`).join(".")),i}function gx(e,t,n){return t==="api"||e===hx("NA")||n==="S3"||n==="API"?t:e?`${e}.${t}`:`${t}`}const g8=e=>{const t=new Date(e);return!isNaN(t.getTime())},m8=e=>!isNaN(Number(e))&&!isNaN(parseFloat(e)),Up=e=>{let t;return typeof e=="number"?t="number":typeof e=="string"?g8(e)?t="date":m8(e)?t="number":t="string":typeof e=="boolean"?t="boolean":e instanceof Date?t="date":t="unknown",t};function b8({get:e,dataPoint:t,card:n}){var h;const{addOrUpdateFilterValue:r,addFilteringCard:o,removeFilterValues:i,replaceFilterValue:s,removeFilteringCard:a}=e().actions,l=e().filteringCards,{columnName:c,columnValue:u}=t,d={filterId:n.id,connectionId:n==null?void 0:n.connectionId,tableName:n.lastSelectedTable,name:c,expression:(h=n.preferences)==null?void 0:h.filterOnClickField,valueType:Up(u),operation:"=",values:[u]};if(l!=null&&l.find(f=>f.id===n.id)){const f=n.id;if(u==null){a(n),i(f);return}else s(d)}o(n),r(d)}function vC({id:e,layouts:t,initialHeight:n,y:r,x:o,w:i,minH:s}){const a={i:e,x:o??0,y:r??1/0,w:i||20,h:n||35,minW:6,minH:s||10},l=t?{...t}:{};return fx.forEach(c=>{l[c]||(l[c]=[]);const u=l[c].reduce((d,h)=>Math.max(d,h.y+h.h),0);a.y=a.y===1/0?u:a.y,l[c].push({...a})}),l}function yC(e,t){if(!t)return;const n={...t};return fx.forEach(r=>{n[r]&&(n[r]=n[r].filter(o=>o.i!==e))}),n}function pM(e){const t=se.getState().dashboard.globalCacheConfig,{card:n,filter:r}=e;return t}const se=tM()(lM((e,t)=>({isSessionExpired:!1,currentBreakpoint:"lg",dashboard:{id:"",style:Ih},showContext:!1,selectedSheetId:null,selectedCardId:null,selectedFrameId:null,selectedCard:null,showFilters:!1,isDashboardEditing:!1,isVisualEditing:!1,showDashboardJSON:!1,filteringCards:[],actions:{setInitStore:()=>{e(n=>{n.isSessionExpired=!1,n.currentBreakpoint="lg",n.dashboard={id:"",style:Ih},n.showContext=!1,n.selectedSheetId=null,n.selectedCardId=null,n.selectedFrameId=null,n.selectedCard=null,n.showFilters=!1,n.isDashboardEditing=!1,n.isVisualEditing=!1,n.showDashboardJSON=!1,n.filteringCards=[],n.selectedLensId=void 0,n.filterValues=void 0})},updateEmailSettings:n=>{e(r=>{r.dashboard.emailSettings=n})},setIsDownloadingPdf:n=>{e(r=>{r.isDownloadingPdf=n})},setGlobalCacheConfig:n=>{e(r=>{r.dashboard.globalCacheConfig=n})},setLenses:n=>{e(r=>{r.lenses=n})},setSelectedLensId:n=>{e(r=>{r.selectedLensId=n})},deleteSheet:n=>{e(r=>{var i,s,a,l,c,u,d,h;const o=(i=r.dashboard.sheets)==null?void 0:i.findIndex(f=>f.id===n);if(o!==void 0&&o>-1){(s=r.dashboard.sheets)==null||s.splice(o,1);const f=(a=r.dashboard.filters)==null?void 0:a.filter(g=>g.sheetId===n),p=(l=r.filterValues)==null?void 0:l.filter(g=>f==null?void 0:f.some(b=>b.id===g.filterId));r.filterValues=(c=r.filterValues)==null?void 0:c.filter(g=>!(p!=null&&p.some(b=>b.filterId===g.filterId))),r.dashboard.filters=(u=r.dashboard.filters)==null?void 0:u.filter(g=>g.sheetId!==n),r.selectedSheetId=(h=(d=r.dashboard.sheets)==null?void 0:d[0])==null?void 0:h.id}})},addSheet:n=>{e(r=>{r.dashboard.sheets||(r.dashboard.sheets=[]);const o=r.dashboard.filters;let i={};o==null||o.forEach(a=>{fx.forEach(l=>{i!=null&&i[l]||(i={...i,[l]:[]});const c={i:a.id,x:0,y:0,w:10,h:8};i[l].push(c)})});const s={...n,layouts:i};r.dashboard.sheets.push(s)})},setGlobalStyle:n=>{e(r=>{r.dashboard.globalStyle=n})},setAIScopeTables:n=>{e(r=>{r.dashboard.aiScopeTables=n})},addToAIScope:n=>{e(r=>{const{connectionId:o,connectionType:i,databaseName:s,schemaName:a,tableName:l,datamodelName:c,datamodelId:u}=n,d={connectionId:o||"",connectionType:i||"",databaseName:s||"",schemaName:a||"",tableName:l||"",datamodelName:c||"",datamodelId:u||""};let f=[...r.dashboard.aiScopeTables||[],d];f=f.filter((p,g,b)=>b.findIndex(v=>v.tableName===p.tableName&&v.datamodelName===p.datamodelName)===g),r.dashboard.aiScopeTables=f})},removeFromAIScope:n=>{e(r=>{const{connectionId:o,tableName:i,datamodelName:s}=n,a=r.dashboard.aiScopeTables||[];if(s){const l=a.filter(c=>!(c.datamodelName===s&&c.connectionId===o));r.dashboard.aiScopeTables=l}else if(i){const l=a.filter(c=>!(c.tableName===i&&c.connectionId===o));r.dashboard.aiScopeTables=l}})},setIsSessionExpired:n=>{e(()=>({isSessionExpired:n}))},setCardPython:(n,r)=>{e(o=>{var s,a,l;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(c=>c.id===o.selectedSheetId);i&&((l=i==null?void 0:i.frames)==null||l.forEach(c=>{var d;const u=(d=c.cards)==null?void 0:d.find(h=>h.id===n);u&&(u.python=r)}))})},addBaseQuery:n=>{e(r=>{var o;r.dashboard.baseQueries||(r.dashboard.baseQueries=[]),(o=r.dashboard.baseQueries)==null||o.push(n)})},removeBaseQuery:n=>{e(r=>{var i,s;const o=(i=r.dashboard.baseQueries)==null?void 0:i.findIndex(a=>a.id===n);o!=null&&o>-1&&((s=r.dashboard.baseQueries)==null||s.splice(o,1))})},setBaseQueries:n=>{e(r=>{r.dashboard.baseQueries=n})},setCurrentBreakpoint:n=>{e(()=>({currentBreakpoint:n}))},setFilteringCards:n=>{e(()=>({filteringCards:n}))},addFilteringCard:n=>{e(r=>{var o;(o=r.filteringCards)==null||o.push(n)})},removeFilteringCard:n=>{e(r=>{var i,s;const o=(i=r.filteringCards)==null?void 0:i.findIndex(a=>a.id===n.id);o!==void 0&&o>-1&&((s=r.filteringCards)==null||s.splice(o,1))})},setCustomCards:n=>{e(r=>{r.dashboard.customCards=n})},setAuthToken:n=>{e(()=>({authToken:n}))},setThemeStyle:n=>{e(()=>({themeStyle:n}))},setDashboard:n=>e({dashboard:n}),setDashboardWithFilterValues:(n,r)=>{e(o=>{o.dashboard=n,o.filterValues=r})},setDashboardTheme:n=>{e(r=>{r.theme=n})},setSheets:n=>{e(r=>{r.dashboard&&(r.dashboard.sheets=n)})},setSheetTitle:(n,r)=>{e(o=>{var s,a;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===n);i&&(i.title=r)})},setCardTitle:(n,r,o)=>{e(i=>{var a,l,c;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(u=>u.id===n);s&&((c=s==null?void 0:s.frames)==null||c.forEach(u=>{var h;const d=(h=u.cards)==null?void 0:h.find(f=>f.id===r);d&&(d.title=o)}))})},setCardInfo:(n,r)=>{e(o=>{var s,a,l;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(c=>c.id===o.selectedSheetId);i&&((l=i==null?void 0:i.frames)==null||l.forEach(c=>{var d;const u=(d=c.cards)==null?void 0:d.find(h=>h.id===n);u&&(u.info=r)}))})},setCardDescription:(n,r,o)=>{e(i=>{var a,l,c;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(u=>u.id===n);s&&((c=s==null?void 0:s.frames)==null||c.forEach(u=>{var h;const d=(h=u.cards)==null?void 0:h.find(f=>f.id===r);d&&(d.description=o)}))})},setCardSql:(n,r,o)=>{e(i=>{var a,l,c,u;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(d=>d.id===n);if(s){const d=(c=s.cards)==null?void 0:c.find(h=>h.id===r);d&&(d.sql=o,(u=i.onUpdateCard)==null||u.call(i,d,n))}})},setSheetLayout:(n,r)=>{e(o=>{var s,a;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===n);i&&(i.layout=r)})},setSheetLayouts:(n,r)=>{e(o=>{var s,a;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===n);i&&(i.layouts=r)})},setShowContext:n=>{e(()=>({showContext:n}))},setShowFilters:n=>{e(()=>({showFilters:n}))},setFilterValues:n=>{e(()=>({filterValues:n}))},addOrUpdateFilterValue:n=>{e(r=>{if(r.filterValues){const o=r.filterValues.findIndex(i=>i.filterId===n.filterId);o>-1?r.filterValues.splice(o,1,n):r.filterValues.push(n)}else r.filterValues=[n]})},addOrUpdateFilterValues:n=>{e(r=>{r.filterValues?n.forEach(o=>{var s,a,l,c;const i=(s=r==null?void 0:r.filterValues)==null?void 0:s.findIndex(u=>u.filterId===o.filterId);if(o.values.length===0){r.filterValues=(a=r.filterValues)==null?void 0:a.filter(u=>u.filterId!==o.filterId);return}i!==void 0&&i>-1?(l=r.filterValues)==null||l.splice(i,1,o):(c=r.filterValues)==null||c.push(o)}):r.filterValues=n})},removeFilterValues:n=>{e(r=>{if(r.filterValues){const o=r.filterValues.filter(i=>i.filterId!==n&&!i.filterId.startsWith(n));r.filterValues=o}})},replaceFilterValue:n=>{e(r=>{if(r.filterValues){const o=r.filterValues.findIndex(i=>i.filterId===n.filterId);o>-1&&r.filterValues.splice(o,1,n)}})},addFilter:n=>{e(r=>{var i,s;r.dashboard.filters?(i=r.dashboard.filters)==null||i.push(n):r.dashboard.filters=[n],(s=r.dashboard.sheets)==null||s.find(a=>a.id===r.selectedSheetId);const o=r.dashboard.sheets;o==null||o.forEach(a=>{vC({id:n.id,layouts:a.layouts,y:0,initialHeight:8,minH:7,w:10})})})},removeFilter:n=>{e(r=>{var o,i,s;if(r.dashboard.filters){const a=(o=r.dashboard.filters)==null?void 0:o.findIndex(l=>l.id===n);if(a>-1){(i=r.dashboard.filters)==null||i.splice(a,1),(s=r.dashboard.sheets)==null||s.find(c=>c.id===r.selectedSheetId);const l=r.dashboard.sheets;l==null||l.forEach(c=>{const u=yC(n,c.layouts);c.layouts=u})}}})},updateFrameCard:(n,r,o)=>{e(i=>{var l,c,u,d,h;const s=(c=(l=i.dashboard)==null?void 0:l.sheets)==null?void 0:c.find(f=>f.id===n);if(!s)return;const a=(u=s==null?void 0:s.frames)==null?void 0:u.find(f=>f.id===r);if(a){const f=(d=a.cards)==null?void 0:d.findIndex(p=>p.id===o.id);f>-1&&((h=a.cards)==null||h.splice(f,1,o))}})},updateFilter:n=>{e(r=>{var o,i;if(r.dashboard.filters){const s=(o=r.dashboard.filters)==null?void 0:o.findIndex(a=>a.id===n.id);s>-1&&((i=r.dashboard.filters)==null||i.splice(s,1,n))}})},updateFilterId:(n,r)=>{e(o=>{var a,l;const i=(a=o.dashboard.filters)==null?void 0:a.find(c=>c.id===n),s=(l=o.dashboard.filters)==null?void 0:l.some(c=>c.id===r);i&&!s&&(i.id=r)})},setIsDashboardEditing:n=>{e(()=>({isDashboardEditing:n}))},setShowDashboardJSON:n=>{e(()=>({showDashboardJSON:n}))},setIsVisualEditing:n=>{e(()=>({isVisualEditing:n}))},addFrame:(n,r,o)=>{e(i=>{var a,l,c,u;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(d=>d.id===n);if(s){s.frames||(s.frames=[]),(c=s.frames)==null||c.push(r);let d=1/0;const h=0;o==="start"&&(d=0);const f=vC({id:r.id,layouts:s.layouts,minH:10,x:h,y:d});s.layouts=f,(u=i.onAddFrame)==null||u.call(i,r,n)}})},removeFrame:(n,r)=>{e(o=>{var s,a,l,c,u;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(d=>d.id===n);if(i){const d=(l=i.frames)==null?void 0:l.findIndex(h=>h.id===r);console.log(d),typeof d=="number"&&d>-1&&((c=i.frames)==null||c.splice(d,1),(u=i.layout)==null||u.splice(d,1),yC(r,i.layouts))}})},updateFrame:(n,r)=>{e(o=>{var a,l,c,u,d;const i=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(h=>h.id===n),s=(c=i==null?void 0:i.frames)==null?void 0:c.findIndex(h=>h.id===r.id);i&&((u=i.frames)==null||u.splice(s,1,r)),(d=o.onAcceptChanges)==null||d.call(o,r,o.dashboard)})},updateCard:(n,r)=>{e(o=>{var a,l,c,u,d;const i=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(h=>h.id===n),s=(c=i==null?void 0:i.cards)==null?void 0:c.findIndex(h=>h.id===r.id);i&&((u=i.cards)==null||u.splice(s,1,r),(d=o.onUpdateCard)==null||d.call(o,r,n))})},removeCard:(n,r)=>{e(o=>{var a,l,c,u,d,h;const i=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(f=>f.id===n),s=(c=i==null?void 0:i.cards)==null?void 0:c.findIndex(f=>f.id===r.id);i&&((u=i.cards)==null||u.splice(s,1),(d=i.layout)==null||d.splice(s,1),(h=o.onRemoveCard)==null||h.call(o,r,n))})},setStyle:n=>{e(r=>{r.dashboard&&(r.dashboard.style=n)})},setSelectedCardId:(n,r)=>{e(o=>{var s,a,l;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(c=>c.id===n);i&&(((l=i.cards)==null?void 0:l.find(u=>u.id===r))?o.selectedCardId=r:o.selectedCardId=null)})},setSelectedFrameId:n=>{e(r=>{var i,s;((s=(i=r.dashboard)==null?void 0:i.sheets)==null?void 0:s.find(a=>a.id===r.selectedSheetId))&&(r.selectedFrameId=n)})},setSelectedSheetId:n=>{e(r=>{var i,s;((s=(i=r.dashboard)==null?void 0:i.sheets)==null?void 0:s.find(a=>a.id===n))&&(r.selectedSheetId=n)})},setOnSaveFunction:n=>{e(()=>({onSaveFunction:n}))},setOnAddCard:n=>{e(()=>({onAddCard:n}))},setOnAcceptChanges:n=>{e(()=>({onAcceptChanges:n}))},setOnUpdateCard:n=>{e(()=>({onUpdateCard:n}))},setOnRemoveCard:n=>{e(()=>({onRemoveCard:n}))},setOnEvent:n=>{e(()=>({onEvent:n}))},getDashboard:()=>t().dashboard,getSelectedSheet:()=>{var n,r;return(r=(n=t().dashboard)==null?void 0:n.sheets)==null?void 0:r.find(o=>o.id===t().selectedSheetId)},getCardFrame:n=>{var o,i;const r=(o=t().dashboard)==null?void 0:o.sheets;if(r)for(let s=0;s<r.length;s++){const a=r[s].frames;if(a){for(let l=0;l<a.length;l++)if((i=a[l].cards)==null?void 0:i.find(u=>u.id===n))return a[l]}}},getSelectedFrame:()=>{var r,o,i;const n=(o=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:o.find(s=>s.id===t().selectedSheetId);return(i=n==null?void 0:n.frames)==null?void 0:i.find(s=>s.id===t().selectedFrameId)},getCard:n=>{var o,i;const r=(o=t().dashboard)==null?void 0:o.sheets;if(r)for(let s=0;s<r.length;s++){const a=r[s].frames;if(a)for(let l=0;l<a.length;l++){const c=(i=a[l].cards)==null?void 0:i.find(u=>u.id===n);if(c)return c}}},getSelectedSheetLayout:()=>{var r,o;const n=(o=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:o.find(i=>i.id===t().selectedSheetId);return n==null?void 0:n.layout},getSelectedSheetLayouts:()=>{var r,o;const n=(o=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:o.find(i=>i.id===t().selectedSheetId);return n==null?void 0:n.layouts},getStyle:()=>{var n;return(n=t().dashboard)==null?void 0:n.style},getCardSheet(n){var o,i;const r=(o=t().dashboard)==null?void 0:o.sheets;if(r)for(let s=0;s<r.length;s++){const a=r[s].frames;if(a){for(let l=0;l<a.length;l++)if((i=a[l].cards)==null?void 0:i.find(u=>u.id===n))return r[s]}}},handleDataPointClickAction:(n,r)=>{b8({card:n,dataPoint:r,get:t})}}}))),zt=()=>se(e=>e.actions);async function v8(e,t){const n=t.slice(0,16),r=new TextEncoder,o=await window.crypto.subtle.importKey("raw",r.encode(n),{name:"PBKDF2"},!1,["deriveKey"]),i=await window.crypto.subtle.deriveKey({name:"PBKDF2",salt:r.encode(n),iterations:1e5,hash:"SHA-256"},o,{name:"AES-GCM",length:256},!1,["encrypt"]),s=window.crypto.getRandomValues(new Uint8Array(12)),a=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:s},i,r.encode(e)),l=new Uint8Array(s.length+a.byteLength);return l.set(s,0),l.set(new Uint8Array(a),s.length),{payload:btoa(String.fromCharCode(...l))}}async function gM(e,t){const n=t.slice(0,16),r=new TextEncoder,o=new TextDecoder,i=await window.crypto.subtle.importKey("raw",r.encode(n),{name:"PBKDF2"},!1,["deriveKey"]),s=await window.crypto.subtle.deriveKey({name:"PBKDF2",salt:r.encode(n),iterations:1e5,hash:"SHA-256"},i,{name:"AES-GCM",length:256},!1,["decrypt"]),a=Uint8Array.from(atob(e),h=>h.charCodeAt(0)),l=a.slice(0,12),c=a.slice(a.length-16),u=a.slice(12,a.length-16),d=new Uint8Array(u.length+c.length);d.set(u),d.set(c,u.length);try{const h=await window.crypto.subtle.decrypt({name:"AES-GCM",iv:l},s,d);return{decryptedData:o.decode(h)}}catch(h){throw new Error(`Decryption failed: ${h}`)}}function ie(...e){return k6(Ph(e))}const y8=e=>Object.keys(e).length===0;async function x8(e,t,n={}){try{const r=new URLSearchParams(n).toString(),o=`${e}?${r}`,i=await fetch(o,{method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`}});if(!i.ok){const a=await i.json();throw new Error((a==null?void 0:a.error)||`HTTP error! status: ${i.status}`)}return await i.json()}catch(r){throw console.error("Error during fetch:",r),r}}async function mx(e,t,n={}){try{const r=JSON.stringify(n),o=await v8(r,t),i=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`},body:JSON.stringify(o)});if(!i.ok)return i.json().then(a=>{throw console.log(a.detail||"Unknown error occurred"),new Error((a==null?void 0:a.error)||`HTTP error! status: ${i.status}`)});const s=await i.json();if(s.payload){const a=await gM(s.payload,t);return JSON.parse(a.decryptedData)}return s}catch(r){throw console.error("Error during fetch:",r),r}}async function w8(e,t,n={}){try{const r=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`},body:JSON.stringify(n)});return r.ok?await r.json():r.json().then(i=>{throw console.log(i.detail||"Unknown error occurred"),new Error((i==null?void 0:i.error)||`HTTP error! status: ${r.status}`)})}catch(r){throw console.error("Error during fetch:",r),r}}function S8(e){if(!e)return{tenantId:"",endUserId:""};const t=ix(e);return{tenantId:t==null?void 0:t.tenantId,endUserId:t==null?void 0:t.endUserId}}function C8(e){if(!e)return;const t=ix(e);if(t.params&&t.params.currencyFormat)return t.params.currencyFormat}function mM(e){return e?ix(e).params:void 0}function _8(e){return e.charAt(0).toUpperCase()+e.slice(1)}const Ja="focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0";async function E8(){var o,i;const e=(i=(o=se.getState())==null?void 0:o.authToken)==null?void 0:i.accessToken;if(!e)return;const n=await fetch("https://semaphor.cloud/api/v1/invalidate-token",{method:"POST",headers:{Authorization:`Bearer ${e}`}});if(!n.ok)throw new Error("Failed to invalidate token");const r=await n.json();return console.log("invalidateToken",r),r}async function R8(e,t={}){if(!e)return null;let n="https://semaphor.cloud/api/v1/dashboard";const r=Object.fromEntries(Object.entries(t).filter(([a,l])=>l!==void 0)),o=new URLSearchParams(r).toString();o&&(n+=`?${o}`);let s=await(await fetch(n,{headers:{Authorization:`Bearer ${e}`}})).json();if("payload"in s){const a=await gM(atob(s.payload),e);s=JSON.parse(a.decryptedData)}return s}async function P8(e){return e?await(await fetch("https://semaphor.cloud/api/v1/plugins",{headers:{Authorization:`Bearer ${e}`}})).json():null}var Ah={exports:{}};Ah.exports;(function(e,t){var n=200,r="__lodash_hash_undefined__",o=800,i=16,s=9007199254740991,a="[object Arguments]",l="[object Array]",c="[object AsyncFunction]",u="[object Boolean]",d="[object Date]",h="[object Error]",f="[object Function]",p="[object GeneratorFunction]",g="[object Map]",b="[object Number]",v="[object Null]",x="[object Object]",y="[object Proxy]",_="[object RegExp]",w="[object Set]",C="[object String]",R="[object Undefined]",k="[object WeakMap]",D="[object ArrayBuffer]",I="[object DataView]",T="[object Float32Array]",N="[object Float64Array]",G="[object Int8Array]",z="[object Int16Array]",O="[object Int32Array]",A="[object Uint8Array]",L="[object Uint8ClampedArray]",j="[object Uint16Array]",B="[object Uint32Array]",M=/[\\^$.*+?()[\]{}|]/g,W=/^\[object .+?Constructor\]$/,F=/^(?:0|[1-9]\d*)$/,P={};P[T]=P[N]=P[G]=P[z]=P[O]=P[A]=P[L]=P[j]=P[B]=!0,P[a]=P[l]=P[D]=P[u]=P[I]=P[d]=P[h]=P[f]=P[g]=P[b]=P[x]=P[_]=P[w]=P[C]=P[k]=!1;var U=typeof Qo=="object"&&Qo&&Qo.Object===Object&&Qo,q=typeof self=="object"&&self&&self.Object===Object&&self,K=U||q||Function("return this")(),H=t&&!t.nodeType&&t,V=H&&!0&&e&&!e.nodeType&&e,Q=V&&V.exports===H,Z=Q&&U.process,ne=function(){try{var $=V&&V.require&&V.require("util").types;return $||Z&&Z.binding&&Z.binding("util")}catch{}}(),J=ne&&ne.isTypedArray;function oe($,X,re){switch(re.length){case 0:return $.call(X);case 1:return $.call(X,re[0]);case 2:return $.call(X,re[0],re[1]);case 3:return $.call(X,re[0],re[1],re[2])}return $.apply(X,re)}function ee($,X){for(var re=-1,be=Array($);++re<$;)be[re]=X(re);return be}function ue($){return function(X){return $(X)}}function de($,X){return $==null?void 0:$[X]}function ye($,X){return function(re){return $(X(re))}}var he=Array.prototype,me=Function.prototype,je=Object.prototype,et=K["__core-js_shared__"],Bt=me.toString,Ue=je.hasOwnProperty,Zn=function(){var $=/[^.]+$/.exec(et&&et.keys&&et.keys.IE_PROTO||"");return $?"Symbol(src)_1."+$:""}(),wt=je.toString,te=Bt.call(Object),le=RegExp("^"+Bt.call(Ue).replace(M,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ve=Q?K.Buffer:void 0,Re=K.Symbol,Ve=K.Uint8Array;ve&&ve.allocUnsafe;var sn=ye(Object.getPrototypeOf,Object),er=Object.create,wn=je.propertyIsEnumerable,Tn=he.splice,an=Re?Re.toStringTag:void 0,St=function(){try{var $=_m(Object,"defineProperty");return $({},"",{}),$}catch{}}(),Xr=ve?ve.isBuffer:void 0,In=Math.max,Kd=Date.now,mc=_m(K,"Map"),os=_m(Object,"create"),bc=function(){function $(){}return function(X){if(!is(X))return{};if(er)return er(X);$.prototype=X;var re=new $;return $.prototype=void 0,re}}();function ln($){var X=-1,re=$==null?0:$.length;for(this.clear();++X<re;){var be=$[X];this.set(be[0],be[1])}}function wm(){this.__data__=os?os(null):{},this.size=0}function De($){var X=this.has($)&&delete this.__data__[$];return this.size-=X?1:0,X}function st($){var X=this.__data__;if(os){var re=X[$];return re===r?void 0:re}return Ue.call(X,$)?X[$]:void 0}function bt($){var X=this.__data__;return os?X[$]!==void 0:Ue.call(X,$)}function tr($,X){var re=this.__data__;return this.size+=this.has($)?0:1,re[$]=os&&X===void 0?r:X,this}ln.prototype.clear=wm,ln.prototype.delete=De,ln.prototype.get=st,ln.prototype.has=bt,ln.prototype.set=tr;function Lt($){var X=-1,re=$==null?0:$.length;for(this.clear();++X<re;){var be=$[X];this.set(be[0],be[1])}}function Qr(){this.__data__=[],this.size=0}function Ao($){var X=this.__data__,re=Xd(X,$);if(re<0)return!1;var be=X.length-1;return re==be?X.pop():Tn.call(X,re,1),--this.size,!0}function nr($){var X=this.__data__,re=Xd(X,$);return re<0?void 0:X[re][1]}function Jr($){return Xd(this.__data__,$)>-1}function i3($,X){var re=this.__data__,be=Xd(re,$);return be<0?(++this.size,re.push([$,X])):re[be][1]=X,this}Lt.prototype.clear=Qr,Lt.prototype.delete=Ao,Lt.prototype.get=nr,Lt.prototype.has=Jr,Lt.prototype.set=i3;function Ea($){var X=-1,re=$==null?0:$.length;for(this.clear();++X<re;){var be=$[X];this.set(be[0],be[1])}}function s3(){this.size=0,this.__data__={hash:new ln,map:new(mc||Lt),string:new ln}}function a3($){var X=Jd(this,$).delete($);return this.size-=X?1:0,X}function l3($){return Jd(this,$).get($)}function c3($){return Jd(this,$).has($)}function u3($,X){var re=Jd(this,$),be=re.size;return re.set($,X),this.size+=re.size==be?0:1,this}Ea.prototype.clear=s3,Ea.prototype.delete=a3,Ea.prototype.get=l3,Ea.prototype.has=c3,Ea.prototype.set=u3;function Ra($){var X=this.__data__=new Lt($);this.size=X.size}function d3(){this.__data__=new Lt,this.size=0}function f3($){var X=this.__data__,re=X.delete($);return this.size=X.size,re}function h3($){return this.__data__.get($)}function p3($){return this.__data__.has($)}function g3($,X){var re=this.__data__;if(re instanceof Lt){var be=re.__data__;if(!mc||be.length<n-1)return be.push([$,X]),this.size=++re.size,this;re=this.__data__=new Ea(be)}return re.set($,X),this.size=re.size,this}Ra.prototype.clear=d3,Ra.prototype.delete=f3,Ra.prototype.get=h3,Ra.prototype.has=p3,Ra.prototype.set=g3;function m3($,X){var re=Pm($),be=!re&&Rm($),Ke=!re&&!be&&KS($),gt=!re&&!be&&!Ke&&QS($),Ot=re||be||Ke||gt,tt=Ot?ee($.length,String):[],Dt=tt.length;for(var Tr in $)Ot&&(Tr=="length"||Ke&&(Tr=="offset"||Tr=="parent")||gt&&(Tr=="buffer"||Tr=="byteLength"||Tr=="byteOffset")||GS(Tr,Dt))||tt.push(Tr);return tt}function Sm($,X,re){(re!==void 0&&!Zd($[X],re)||re===void 0&&!(X in $))&&Cm($,X,re)}function b3($,X,re){var be=$[X];(!(Ue.call($,X)&&Zd(be,re))||re===void 0&&!(X in $))&&Cm($,X,re)}function Xd($,X){for(var re=$.length;re--;)if(Zd($[re][0],X))return re;return-1}function Cm($,X,re){X=="__proto__"&&St?St($,X,{configurable:!0,enumerable:!0,value:re,writable:!0}):$[X]=re}var v3=D3();function Qd($){return $==null?$===void 0?R:v:an&&an in Object($)?T3($):L3($)}function US($){return vc($)&&Qd($)==a}function y3($){if(!is($)||j3($))return!1;var X=km($)?le:W;return X.test(V3($))}function x3($){return vc($)&&XS($.length)&&!!P[Qd($)]}function w3($){if(!is($))return F3($);var X=YS($),re=[];for(var be in $)be=="constructor"&&(X||!Ue.call($,be))||re.push(be);return re}function qS($,X,re,be,Ke){$!==X&&v3(X,function(gt,Ot){if(Ke||(Ke=new Ra),is(gt))S3($,X,Ot,re,qS,be,Ke);else{var tt=be?be(Em($,Ot),gt,Ot+"",$,X,Ke):void 0;tt===void 0&&(tt=gt),Sm($,Ot,tt)}},JS)}function S3($,X,re,be,Ke,gt,Ot){var tt=Em($,re),Dt=Em(X,re),Tr=Ot.get(Dt);if(Tr){Sm($,re,Tr);return}var rr=gt?gt(tt,Dt,re+"",$,X,Ot):void 0,yc=rr===void 0;if(yc){var Om=Pm(Dt),Dm=!Om&&KS(Dt),eC=!Om&&!Dm&&QS(Dt);rr=Dt,Om||Dm||eC?Pm(tt)?rr=tt:H3(tt)?rr=M3(tt):Dm?(yc=!1,rr=E3(Dt)):eC?(yc=!1,rr=P3(Dt)):rr=[]:W3(Dt)||Rm(Dt)?(rr=tt,Rm(tt)?rr=U3(tt):(!is(tt)||km(tt))&&(rr=I3(Dt))):yc=!1}yc&&(Ot.set(Dt,rr),Ke(rr,Dt,be,gt,Ot),Ot.delete(Dt)),Sm($,re,rr)}function C3($,X){return z3($3($,X,ZS),$+"")}var _3=St?function($,X){return St($,"toString",{configurable:!0,enumerable:!1,value:G3(X),writable:!0})}:ZS;function E3($,X){return $.slice()}function R3($){var X=new $.constructor($.byteLength);return new Ve(X).set(new Ve($)),X}function P3($,X){var re=R3($.buffer);return new $.constructor(re,$.byteOffset,$.length)}function M3($,X){var re=-1,be=$.length;for(X||(X=Array(be));++re<be;)X[re]=$[re];return X}function k3($,X,re,be){var Ke=!re;re||(re={});for(var gt=-1,Ot=X.length;++gt<Ot;){var tt=X[gt],Dt=void 0;Dt===void 0&&(Dt=$[tt]),Ke?Cm(re,tt,Dt):b3(re,tt,Dt)}return re}function O3($){return C3(function(X,re){var be=-1,Ke=re.length,gt=Ke>1?re[Ke-1]:void 0,Ot=Ke>2?re[2]:void 0;for(gt=$.length>3&&typeof gt=="function"?(Ke--,gt):void 0,Ot&&A3(re[0],re[1],Ot)&&(gt=Ke<3?void 0:gt,Ke=1),X=Object(X);++be<Ke;){var tt=re[be];tt&&$(X,tt,be,gt)}return X})}function D3($){return function(X,re,be){for(var Ke=-1,gt=Object(X),Ot=be(X),tt=Ot.length;tt--;){var Dt=Ot[++Ke];if(re(gt[Dt],Dt,gt)===!1)break}return X}}function Jd($,X){var re=$.__data__;return N3(X)?re[typeof X=="string"?"string":"hash"]:re.map}function _m($,X){var re=de($,X);return y3(re)?re:void 0}function T3($){var X=Ue.call($,an),re=$[an];try{$[an]=void 0;var be=!0}catch{}var Ke=wt.call($);return be&&(X?$[an]=re:delete $[an]),Ke}function I3($){return typeof $.constructor=="function"&&!YS($)?bc(sn($)):{}}function GS($,X){var re=typeof $;return X=X??s,!!X&&(re=="number"||re!="symbol"&&F.test($))&&$>-1&&$%1==0&&$<X}function A3($,X,re){if(!is(re))return!1;var be=typeof X;return(be=="number"?Mm(re)&&GS(X,re.length):be=="string"&&X in re)?Zd(re[X],$):!1}function N3($){var X=typeof $;return X=="string"||X=="number"||X=="symbol"||X=="boolean"?$!=="__proto__":$===null}function j3($){return!!Zn&&Zn in $}function YS($){var X=$&&$.constructor,re=typeof X=="function"&&X.prototype||je;return $===re}function F3($){var X=[];if($!=null)for(var re in Object($))X.push(re);return X}function L3($){return wt.call($)}function $3($,X,re){return X=In(X===void 0?$.length-1:X,0),function(){for(var be=arguments,Ke=-1,gt=In(be.length-X,0),Ot=Array(gt);++Ke<gt;)Ot[Ke]=be[X+Ke];Ke=-1;for(var tt=Array(X+1);++Ke<X;)tt[Ke]=be[Ke];return tt[X]=re(Ot),oe($,this,tt)}}function Em($,X){if(!(X==="constructor"&&typeof $[X]=="function")&&X!="__proto__")return $[X]}var z3=B3(_3);function B3($){var X=0,re=0;return function(){var be=Kd(),Ke=i-(be-re);if(re=be,Ke>0){if(++X>=o)return arguments[0]}else X=0;return $.apply(void 0,arguments)}}function V3($){if($!=null){try{return Bt.call($)}catch{}try{return $+""}catch{}}return""}function Zd($,X){return $===X||$!==$&&X!==X}var Rm=US(function(){return arguments}())?US:function($){return vc($)&&Ue.call($,"callee")&&!wn.call($,"callee")},Pm=Array.isArray;function Mm($){return $!=null&&XS($.length)&&!km($)}function H3($){return vc($)&&Mm($)}var KS=Xr||Y3;function km($){if(!is($))return!1;var X=Qd($);return X==f||X==p||X==c||X==y}function XS($){return typeof $=="number"&&$>-1&&$%1==0&&$<=s}function is($){var X=typeof $;return $!=null&&(X=="object"||X=="function")}function vc($){return $!=null&&typeof $=="object"}function W3($){if(!vc($)||Qd($)!=x)return!1;var X=sn($);if(X===null)return!0;var re=Ue.call(X,"constructor")&&X.constructor;return typeof re=="function"&&re instanceof re&&Bt.call(re)==te}var QS=J?ue(J):x3;function U3($){return k3($,JS($))}function JS($){return Mm($)?m3($):w3($)}var q3=O3(function($,X,re){qS($,X,re)});function G3($){return function(){return $}}function ZS($){return $}function Y3(){return!1}e.exports=q3})(Ah,Ah.exports);var M8=Ah.exports;const Ru=Yi(M8),k8={theme:"system",setTheme:()=>null},bM=E.createContext(k8);function O8({children:e,defaultTheme:t="system",storageKey:n="vite-ui-theme",...r}){const[o,i]=E.useState(()=>localStorage.getItem(n)||t);E.useEffect(()=>{const a=window.document.documentElement;if(a.classList.remove("light","dark"),o==="system"){const l=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";a.classList.add(l);return}a.classList.add(o)},[o]);const s={theme:o,setTheme:a=>{localStorage.setItem(n,a),i(a)}};return m.jsx(bM.Provider,{...r,value:s,children:e})}const vM=()=>{const e=E.useContext(bM);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e};var fd=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},ta=typeof window>"u"||"Deno"in globalThis;function Sr(){}function D8(e,t){return typeof e=="function"?e(t):e}function z0(e){return typeof e=="number"&&e>=0&&e!==1/0}function yM(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Za(e,t){return typeof e=="function"?e(t):e}function Lr(e,t){return typeof e=="function"?e(t):e}function xC(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:i,queryKey:s,stale:a}=e;if(s){if(r){if(t.queryHash!==bx(s,t.options))return!1}else if(!Mu(t.queryKey,s))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||o&&o!==t.state.fetchStatus||i&&!i(t))}function wC(e,t){const{exact:n,status:r,predicate:o,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(Pu(t.options.mutationKey)!==Pu(i))return!1}else if(!Mu(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function bx(e,t){return((t==null?void 0:t.queryKeyHashFn)||Pu)(e)}function Pu(e){return JSON.stringify(e,(t,n)=>H0(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function Mu(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!Mu(e[n],t[n])):!1}function B0(e,t){if(e===t)return e;const n=SC(e)&&SC(t);if(n||H0(e)&&H0(t)){const r=n?e:Object.keys(e),o=r.length,i=n?t:Object.keys(t),s=i.length,a=n?[]:{};let l=0;for(let c=0;c<s;c++){const u=n?c:i[c];(!n&&r.includes(u)||n)&&e[u]===void 0&&t[u]===void 0?(a[u]=void 0,l++):(a[u]=B0(e[u],t[u]),a[u]===e[u]&&e[u]!==void 0&&l++)}return o===s&&l===o?e:a}return t}function V0(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function SC(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function H0(e){if(!CC(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!CC(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function CC(e){return Object.prototype.toString.call(e)==="[object Object]"}function T8(e){return new Promise(t=>{setTimeout(t,e)})}function W0(e,t,n){if(typeof n.structuralSharing=="function")return n.structuralSharing(e,t);if(n.structuralSharing!==!1){if(process.env.NODE_ENV!=="production")try{return B0(e,t)}catch(r){console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${n.queryHash}]: ${r}`)}return B0(e,t)}return t}function I8(e){return e}function A8(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function N8(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Nh=Symbol();function xM(e,t){return process.env.NODE_ENV!=="production"&&e.queryFn===Nh&&console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`),!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Nh?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var Ts,wi,pl,$2,j8=($2=class extends fd{constructor(){super();_e(this,Ts);_e(this,wi);_e(this,pl);ge(this,pl,t=>{if(!ta&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){Y(this,wi)||this.setEventListener(Y(this,pl))}onUnsubscribe(){var t;this.hasListeners()||((t=Y(this,wi))==null||t.call(this),ge(this,wi,void 0))}setEventListener(t){var n;ge(this,pl,t),(n=Y(this,wi))==null||n.call(this),ge(this,wi,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){Y(this,Ts)!==t&&(ge(this,Ts,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof Y(this,Ts)=="boolean"?Y(this,Ts):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Ts=new WeakMap,wi=new WeakMap,pl=new WeakMap,$2),vx=new j8,gl,Si,ml,z2,F8=(z2=class extends fd{constructor(){super();_e(this,gl,!0);_e(this,Si);_e(this,ml);ge(this,ml,t=>{if(!ta&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){Y(this,Si)||this.setEventListener(Y(this,ml))}onUnsubscribe(){var t;this.hasListeners()||((t=Y(this,Si))==null||t.call(this),ge(this,Si,void 0))}setEventListener(t){var n;ge(this,ml,t),(n=Y(this,Si))==null||n.call(this),ge(this,Si,t(this.setOnline.bind(this)))}setOnline(t){Y(this,gl)!==t&&(ge(this,gl,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return Y(this,gl)}},gl=new WeakMap,Si=new WeakMap,ml=new WeakMap,z2),jh=new F8;function U0(){let e,t;const n=new Promise((o,i)=>{e=o,t=i});n.status="pending",n.catch(()=>{});function r(o){Object.assign(n,o),delete n.resolve,delete n.reject}return n.resolve=o=>{r({status:"fulfilled",value:o}),e(o)},n.reject=o=>{r({status:"rejected",reason:o}),t(o)},n}function L8(e){return Math.min(1e3*2**e,3e4)}function wM(e){return(e??"online")==="online"?jh.isOnline():!0}var SM=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Bm(e){return e instanceof SM}function CM(e){let t=!1,n=0,r=!1,o;const i=U0(),s=g=>{var b;r||(h(new SM(g)),(b=e.abort)==null||b.call(e))},a=()=>{t=!0},l=()=>{t=!1},c=()=>vx.isFocused()&&(e.networkMode==="always"||jh.isOnline())&&e.canRun(),u=()=>wM(e.networkMode)&&e.canRun(),d=g=>{var b;r||(r=!0,(b=e.onSuccess)==null||b.call(e,g),o==null||o(),i.resolve(g))},h=g=>{var b;r||(r=!0,(b=e.onError)==null||b.call(e,g),o==null||o(),i.reject(g))},f=()=>new Promise(g=>{var b;o=v=>{(r||c())&&g(v)},(b=e.onPause)==null||b.call(e)}).then(()=>{var g;o=void 0,r||(g=e.onContinue)==null||g.call(e)}),p=()=>{if(r)return;let g;const b=n===0?e.initialPromise:void 0;try{g=b??e.fn()}catch(v){g=Promise.reject(v)}Promise.resolve(g).then(d).catch(v=>{var C;if(r)return;const x=e.retry??(ta?0:3),y=e.retryDelay??L8,_=typeof y=="function"?y(n,v):y,w=x===!0||typeof x=="number"&&n<x||typeof x=="function"&&x(n,v);if(t||!w){h(v);return}n++,(C=e.onFail)==null||C.call(e,n,v),T8(_).then(()=>c()?void 0:f()).then(()=>{t?h(v):p()})})};return{promise:i,cancel:s,continue:()=>(o==null||o(),i),cancelRetry:a,continueRetry:l,canStart:u,start:()=>(u()?p():f().then(p),i)}}function $8(){let e=[],t=0,n=a=>{a()},r=a=>{a()},o=a=>setTimeout(a,0);const i=a=>{t?e.push(a):o(()=>{n(a)})},s=()=>{const a=e;e=[],a.length&&o(()=>{r(()=>{a.forEach(l=>{n(l)})})})};return{batch:a=>{let l;t++;try{l=a()}finally{t--,t||s()}return l},batchCalls:a=>(...l)=>{i(()=>{a(...l)})},schedule:i,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{o=a}}}var nn=$8(),Is,B2,_M=(B2=class{constructor(){_e(this,Is)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),z0(this.gcTime)&&ge(this,Is,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(ta?1/0:5*60*1e3))}clearGcTimeout(){Y(this,Is)&&(clearTimeout(Y(this,Is)),ge(this,Is,void 0))}},Is=new WeakMap,B2),bl,vl,wr,As,fn,ad,Ns,jr,$o,V2,z8=(V2=class extends _M{constructor(t){super();_e(this,jr);_e(this,bl);_e(this,vl);_e(this,wr);_e(this,As);_e(this,fn);_e(this,ad);_e(this,Ns);ge(this,Ns,!1),ge(this,ad,t.defaultOptions),this.setOptions(t.options),this.observers=[],ge(this,As,t.client),ge(this,wr,Y(this,As).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,ge(this,bl,B8(this.options)),this.state=t.state??Y(this,bl),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=Y(this,fn))==null?void 0:t.promise}setOptions(t){this.options={...Y(this,ad),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&Y(this,wr).remove(this)}setData(t,n){const r=W0(this.state.data,t,this.options);return Ge(this,jr,$o).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){Ge(this,jr,$o).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,o;const n=(r=Y(this,fn))==null?void 0:r.promise;return(o=Y(this,fn))==null||o.cancel(t),n?n.then(Sr).catch(Sr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(Y(this,bl))}isActive(){return this.observers.some(t=>Lr(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Nh||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(t=0){return this.state.isInvalidated||this.state.data===void 0||!yM(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=Y(this,fn))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=Y(this,fn))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),Y(this,wr).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(Y(this,fn)&&(Y(this,Ns)?Y(this,fn).cancel({revert:!0}):Y(this,fn).cancelRetry()),this.scheduleGc()),Y(this,wr).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Ge(this,jr,$o).call(this,{type:"invalidate"})}fetch(t,n){var l,c,u;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(Y(this,fn))return Y(this,fn).continueRetry(),Y(this,fn).promise}if(t&&this.setOptions(t),!this.options.queryFn){const d=this.observers.find(h=>h.options.queryFn);d&&this.setOptions(d.options)}process.env.NODE_ENV!=="production"&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const r=new AbortController,o=d=>{Object.defineProperty(d,"signal",{enumerable:!0,get:()=>(ge(this,Ns,!0),r.signal)})},i=()=>{const d=xM(this.options,n),h={client:Y(this,As),queryKey:this.queryKey,meta:this.meta};return o(h),ge(this,Ns,!1),this.options.persister?this.options.persister(d,h,this):d(h)},s={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:Y(this,As),state:this.state,fetchFn:i};o(s),(l=this.options.behavior)==null||l.onFetch(s,this),ge(this,vl,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((c=s.fetchOptions)==null?void 0:c.meta))&&Ge(this,jr,$o).call(this,{type:"fetch",meta:(u=s.fetchOptions)==null?void 0:u.meta});const a=d=>{var h,f,p,g;Bm(d)&&d.silent||Ge(this,jr,$o).call(this,{type:"error",error:d}),Bm(d)||((f=(h=Y(this,wr).config).onError)==null||f.call(h,d,this),(g=(p=Y(this,wr).config).onSettled)==null||g.call(p,this.state.data,d,this)),this.scheduleGc()};return ge(this,fn,CM({initialPromise:n==null?void 0:n.initialPromise,fn:s.fetchFn,abort:r.abort.bind(r),onSuccess:d=>{var h,f,p,g;if(d===void 0){process.env.NODE_ENV!=="production"&&console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),a(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(d)}catch(b){a(b);return}(f=(h=Y(this,wr).config).onSuccess)==null||f.call(h,d,this),(g=(p=Y(this,wr).config).onSettled)==null||g.call(p,d,this.state.error,this),this.scheduleGc()},onError:a,onFail:(d,h)=>{Ge(this,jr,$o).call(this,{type:"failed",failureCount:d,error:h})},onPause:()=>{Ge(this,jr,$o).call(this,{type:"pause"})},onContinue:()=>{Ge(this,jr,$o).call(this,{type:"continue"})},retry:s.options.retry,retryDelay:s.options.retryDelay,networkMode:s.options.networkMode,canRun:()=>!0})),Y(this,fn).start()}},bl=new WeakMap,vl=new WeakMap,wr=new WeakMap,As=new WeakMap,fn=new WeakMap,ad=new WeakMap,Ns=new WeakMap,jr=new WeakSet,$o=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...EM(r.data,this.options),fetchMeta:t.meta??null};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const o=t.error;return Bm(o)&&o.revert&&Y(this,vl)?{...Y(this,vl),fetchStatus:"idle"}:{...r,error:o,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),nn.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),Y(this,wr).notify({query:this,type:"updated",action:t})})},V2);function EM(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:wM(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function B8(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var oo,H2,RM=(H2=class extends fd{constructor(t={}){super();_e(this,oo);this.config=t,ge(this,oo,new Map)}build(t,n,r){const o=n.queryKey,i=n.queryHash??bx(o,n);let s=this.get(i);return s||(s=new z8({client:t,queryKey:o,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(s)),s}add(t){Y(this,oo).has(t.queryHash)||(Y(this,oo).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=Y(this,oo).get(t.queryHash);n&&(t.destroy(),n===t&&Y(this,oo).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){nn.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return Y(this,oo).get(t)}getAll(){return[...Y(this,oo).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>xC(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>xC(t,r)):n}notify(t){nn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){nn.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){nn.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},oo=new WeakMap,H2),io,Cn,js,so,bi,W2,V8=(W2=class extends _M{constructor(t){super();_e(this,so);_e(this,io);_e(this,Cn);_e(this,js);this.mutationId=t.mutationId,ge(this,Cn,t.mutationCache),ge(this,io,[]),this.state=t.state||H8(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){Y(this,io).includes(t)||(Y(this,io).push(t),this.clearGcTimeout(),Y(this,Cn).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){ge(this,io,Y(this,io).filter(n=>n!==t)),this.scheduleGc(),Y(this,Cn).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){Y(this,io).length||(this.state.status==="pending"?this.scheduleGc():Y(this,Cn).remove(this))}continue(){var t;return((t=Y(this,js))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,i,s,a,l,c,u,d,h,f,p,g,b,v,x,y,_,w,C,R;ge(this,js,CM({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(k,D)=>{Ge(this,so,bi).call(this,{type:"failed",failureCount:k,error:D})},onPause:()=>{Ge(this,so,bi).call(this,{type:"pause"})},onContinue:()=>{Ge(this,so,bi).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>Y(this,Cn).canRun(this)}));const n=this.state.status==="pending",r=!Y(this,js).canStart();try{if(!n){Ge(this,so,bi).call(this,{type:"pending",variables:t,isPaused:r}),await((i=(o=Y(this,Cn).config).onMutate)==null?void 0:i.call(o,t,this));const D=await((a=(s=this.options).onMutate)==null?void 0:a.call(s,t));D!==this.state.context&&Ge(this,so,bi).call(this,{type:"pending",context:D,variables:t,isPaused:r})}const k=await Y(this,js).start();return await((c=(l=Y(this,Cn).config).onSuccess)==null?void 0:c.call(l,k,t,this.state.context,this)),await((d=(u=this.options).onSuccess)==null?void 0:d.call(u,k,t,this.state.context)),await((f=(h=Y(this,Cn).config).onSettled)==null?void 0:f.call(h,k,null,this.state.variables,this.state.context,this)),await((g=(p=this.options).onSettled)==null?void 0:g.call(p,k,null,t,this.state.context)),Ge(this,so,bi).call(this,{type:"success",data:k}),k}catch(k){try{throw await((v=(b=Y(this,Cn).config).onError)==null?void 0:v.call(b,k,t,this.state.context,this)),await((y=(x=this.options).onError)==null?void 0:y.call(x,k,t,this.state.context)),await((w=(_=Y(this,Cn).config).onSettled)==null?void 0:w.call(_,void 0,k,this.state.variables,this.state.context,this)),await((R=(C=this.options).onSettled)==null?void 0:R.call(C,void 0,k,t,this.state.context)),k}finally{Ge(this,so,bi).call(this,{type:"error",error:k})}}finally{Y(this,Cn).runNext(this)}}},io=new WeakMap,Cn=new WeakMap,js=new WeakMap,so=new WeakSet,bi=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),nn.batch(()=>{Y(this,io).forEach(r=>{r.onMutationUpdate(t)}),Y(this,Cn).notify({mutation:this,type:"updated",action:t})})},W2);function H8(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var qo,Fr,ld,U2,W8=(U2=class extends fd{constructor(t={}){super();_e(this,qo);_e(this,Fr);_e(this,ld);this.config=t,ge(this,qo,new Set),ge(this,Fr,new Map),ge(this,ld,0)}build(t,n,r){const o=new V8({mutationCache:this,mutationId:++ef(this,ld)._,options:t.defaultMutationOptions(n),state:r});return this.add(o),o}add(t){Y(this,qo).add(t);const n=rf(t);if(typeof n=="string"){const r=Y(this,Fr).get(n);r?r.push(t):Y(this,Fr).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(Y(this,qo).delete(t)){const n=rf(t);if(typeof n=="string"){const r=Y(this,Fr).get(n);if(r)if(r.length>1){const o=r.indexOf(t);o!==-1&&r.splice(o,1)}else r[0]===t&&Y(this,Fr).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=rf(t);if(typeof n=="string"){const r=Y(this,Fr).get(n),o=r==null?void 0:r.find(i=>i.state.status==="pending");return!o||o===t}else return!0}runNext(t){var r;const n=rf(t);if(typeof n=="string"){const o=(r=Y(this,Fr).get(n))==null?void 0:r.find(i=>i!==t&&i.state.isPaused);return(o==null?void 0:o.continue())??Promise.resolve()}else return Promise.resolve()}clear(){nn.batch(()=>{Y(this,qo).forEach(t=>{this.notify({type:"removed",mutation:t})}),Y(this,qo).clear(),Y(this,Fr).clear()})}getAll(){return Array.from(Y(this,qo))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>wC(n,r))}findAll(t={}){return this.getAll().filter(n=>wC(t,n))}notify(t){nn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return nn.batch(()=>Promise.all(t.map(n=>n.continue().catch(Sr))))}},qo=new WeakMap,Fr=new WeakMap,ld=new WeakMap,U2);function rf(e){var t;return(t=e.options.scope)==null?void 0:t.id}function _C(e){return{onFetch:(t,n)=>{var u,d,h,f,p;const r=t.options,o=(h=(d=(u=t.fetchOptions)==null?void 0:u.meta)==null?void 0:d.fetchMore)==null?void 0:h.direction,i=((f=t.state.data)==null?void 0:f.pages)||[],s=((p=t.state.data)==null?void 0:p.pageParams)||[];let a={pages:[],pageParams:[]},l=0;const c=async()=>{let g=!1;const b=y=>{Object.defineProperty(y,"signal",{enumerable:!0,get:()=>(t.signal.aborted?g=!0:t.signal.addEventListener("abort",()=>{g=!0}),t.signal)})},v=xM(t.options,t.fetchOptions),x=async(y,_,w)=>{if(g)return Promise.reject();if(_==null&&y.pages.length)return Promise.resolve(y);const C={client:t.client,queryKey:t.queryKey,pageParam:_,direction:w?"backward":"forward",meta:t.options.meta};b(C);const R=await v(C),{maxPages:k}=t.options,D=w?N8:A8;return{pages:D(y.pages,R,k),pageParams:D(y.pageParams,_,k)}};if(o&&i.length){const y=o==="backward",_=y?U8:EC,w={pages:i,pageParams:s},C=_(r,w);a=await x(w,C,y)}else{const y=e??i.length;do{const _=l===0?s[0]??r.initialPageParam:EC(r,a);if(l>0&&_==null)break;a=await x(a,_),l++}while(l<y)}return a};t.options.persister?t.fetchFn=()=>{var g,b;return(b=(g=t.options).persister)==null?void 0:b.call(g,c,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=c}}}function EC(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function U8(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var It,Ci,_i,yl,xl,Ei,wl,Sl,q2,q8=(q2=class{constructor(e={}){_e(this,It);_e(this,Ci);_e(this,_i);_e(this,yl);_e(this,xl);_e(this,Ei);_e(this,wl);_e(this,Sl);ge(this,It,e.queryCache||new RM),ge(this,Ci,e.mutationCache||new W8),ge(this,_i,e.defaultOptions||{}),ge(this,yl,new Map),ge(this,xl,new Map),ge(this,Ei,0)}mount(){ef(this,Ei)._++,Y(this,Ei)===1&&(ge(this,wl,vx.subscribe(async e=>{e&&(await this.resumePausedMutations(),Y(this,It).onFocus())})),ge(this,Sl,jh.subscribe(async e=>{e&&(await this.resumePausedMutations(),Y(this,It).onOnline())})))}unmount(){var e,t;ef(this,Ei)._--,Y(this,Ei)===0&&((e=Y(this,wl))==null||e.call(this),ge(this,wl,void 0),(t=Y(this,Sl))==null||t.call(this),ge(this,Sl,void 0))}isFetching(e){return Y(this,It).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return Y(this,Ci).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=Y(this,It).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=Y(this,It).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Za(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return Y(this,It).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),o=Y(this,It).get(r.queryHash),i=o==null?void 0:o.state.data,s=D8(t,i);if(s!==void 0)return Y(this,It).build(this,r).setData(s,{...n,manual:!0})}setQueriesData(e,t,n){return nn.batch(()=>Y(this,It).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=Y(this,It).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=Y(this,It);nn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=Y(this,It);return nn.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=nn.batch(()=>Y(this,It).findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(Sr).catch(Sr)}invalidateQueries(e,t={}){return nn.batch(()=>(Y(this,It).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=nn.batch(()=>Y(this,It).findAll(e).filter(o=>!o.isDisabled()).map(o=>{let i=o.fetch(void 0,n);return n.throwOnError||(i=i.catch(Sr)),o.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(Sr)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=Y(this,It).build(this,t);return n.isStaleByTime(Za(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Sr).catch(Sr)}fetchInfiniteQuery(e){return e.behavior=_C(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Sr).catch(Sr)}ensureInfiniteQueryData(e){return e.behavior=_C(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return jh.isOnline()?Y(this,Ci).resumePausedMutations():Promise.resolve()}getQueryCache(){return Y(this,It)}getMutationCache(){return Y(this,Ci)}getDefaultOptions(){return Y(this,_i)}setDefaultOptions(e){ge(this,_i,e)}setQueryDefaults(e,t){Y(this,yl).set(Pu(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...Y(this,yl).values()],n={};return t.forEach(r=>{Mu(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){Y(this,xl).set(Pu(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...Y(this,xl).values()],n={};return t.forEach(r=>{Mu(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...Y(this,_i).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=bx(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Nh&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...Y(this,_i).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){Y(this,It).clear(),Y(this,Ci).clear()}},It=new WeakMap,Ci=new WeakMap,_i=new WeakMap,yl=new WeakMap,xl=new WeakMap,Ei=new WeakMap,wl=new WeakMap,Sl=new WeakMap,q2),zn,Ye,cd,_n,Fs,Cl,Ri,ao,ud,_l,El,Ls,$s,Pi,Rl,ut,$c,q0,G0,Y0,K0,X0,Q0,J0,PM,G2,G8=(G2=class extends fd{constructor(t,n){super();_e(this,ut);_e(this,zn);_e(this,Ye);_e(this,cd);_e(this,_n);_e(this,Fs);_e(this,Cl);_e(this,Ri);_e(this,ao);_e(this,ud);_e(this,_l);_e(this,El);_e(this,Ls);_e(this,$s);_e(this,Pi);_e(this,Rl,new Set);this.options=n,ge(this,zn,t),ge(this,ao,null),ge(this,Ri,U0()),this.options.experimental_prefetchInRender||Y(this,Ri).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(Y(this,Ye).addObserver(this),RC(Y(this,Ye),this.options)?Ge(this,ut,$c).call(this):this.updateResult(),Ge(this,ut,K0).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Z0(Y(this,Ye),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Z0(Y(this,Ye),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Ge(this,ut,X0).call(this),Ge(this,ut,Q0).call(this),Y(this,Ye).removeObserver(this)}setOptions(t,n){const r=this.options,o=Y(this,Ye);if(this.options=Y(this,zn).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Lr(this.options.enabled,Y(this,Ye))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Ge(this,ut,J0).call(this),Y(this,Ye).setOptions(this.options),r._defaulted&&!V0(this.options,r)&&Y(this,zn).getQueryCache().notify({type:"observerOptionsUpdated",query:Y(this,Ye),observer:this});const i=this.hasListeners();i&&PC(Y(this,Ye),o,this.options,r)&&Ge(this,ut,$c).call(this),this.updateResult(n),i&&(Y(this,Ye)!==o||Lr(this.options.enabled,Y(this,Ye))!==Lr(r.enabled,Y(this,Ye))||Za(this.options.staleTime,Y(this,Ye))!==Za(r.staleTime,Y(this,Ye)))&&Ge(this,ut,q0).call(this);const s=Ge(this,ut,G0).call(this);i&&(Y(this,Ye)!==o||Lr(this.options.enabled,Y(this,Ye))!==Lr(r.enabled,Y(this,Ye))||s!==Y(this,Pi))&&Ge(this,ut,Y0).call(this,s)}getOptimisticResult(t){const n=Y(this,zn).getQueryCache().build(Y(this,zn),t),r=this.createResult(n,t);return K8(this,r)&&(ge(this,_n,r),ge(this,Cl,this.options),ge(this,Fs,Y(this,Ye).state)),r}getCurrentResult(){return Y(this,_n)}trackResult(t,n){const r={};return Object.keys(t).forEach(o=>{Object.defineProperty(r,o,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(o),n==null||n(o),t[o])})}),r}trackProp(t){Y(this,Rl).add(t)}getCurrentQuery(){return Y(this,Ye)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=Y(this,zn).defaultQueryOptions(t),r=Y(this,zn).getQueryCache().build(Y(this,zn),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return Ge(this,ut,$c).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),Y(this,_n)))}createResult(t,n){var k;const r=Y(this,Ye),o=this.options,i=Y(this,_n),s=Y(this,Fs),a=Y(this,Cl),c=t!==r?t.state:Y(this,cd),{state:u}=t;let d={...u},h=!1,f;if(n._optimisticResults){const D=this.hasListeners(),I=!D&&RC(t,n),T=D&&PC(t,r,n,o);(I||T)&&(d={...d,...EM(u.data,t.options)}),n._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:p,errorUpdatedAt:g,status:b}=d;if(n.select&&d.data!==void 0)if(i&&d.data===(s==null?void 0:s.data)&&n.select===Y(this,ud))f=Y(this,_l);else try{ge(this,ud,n.select),f=n.select(d.data),f=W0(i==null?void 0:i.data,f,n),ge(this,_l,f),ge(this,ao,null)}catch(D){ge(this,ao,D)}else f=d.data;if(n.placeholderData!==void 0&&f===void 0&&b==="pending"){let D;if(i!=null&&i.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData))D=i.data;else if(D=typeof n.placeholderData=="function"?n.placeholderData((k=Y(this,El))==null?void 0:k.state.data,Y(this,El)):n.placeholderData,n.select&&D!==void 0)try{D=n.select(D),ge(this,ao,null)}catch(I){ge(this,ao,I)}D!==void 0&&(b="success",f=W0(i==null?void 0:i.data,D,n),h=!0)}Y(this,ao)&&(p=Y(this,ao),f=Y(this,_l),g=Date.now(),b="error");const v=d.fetchStatus==="fetching",x=b==="pending",y=b==="error",_=x&&v,w=f!==void 0,R={status:b,fetchStatus:d.fetchStatus,isPending:x,isSuccess:b==="success",isError:y,isInitialLoading:_,isLoading:_,data:f,dataUpdatedAt:d.dataUpdatedAt,error:p,errorUpdatedAt:g,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>c.dataUpdateCount||d.errorUpdateCount>c.errorUpdateCount,isFetching:v,isRefetching:v&&!x,isLoadingError:y&&!w,isPaused:d.fetchStatus==="paused",isPlaceholderData:h,isRefetchError:y&&w,isStale:yx(t,n),refetch:this.refetch,promise:Y(this,Ri)};if(this.options.experimental_prefetchInRender){const D=N=>{R.status==="error"?N.reject(R.error):R.data!==void 0&&N.resolve(R.data)},I=()=>{const N=ge(this,Ri,R.promise=U0());D(N)},T=Y(this,Ri);switch(T.status){case"pending":t.queryHash===r.queryHash&&D(T);break;case"fulfilled":(R.status==="error"||R.data!==T.value)&&I();break;case"rejected":(R.status!=="error"||R.error!==T.reason)&&I();break}}return R}updateResult(t){const n=Y(this,_n),r=this.createResult(Y(this,Ye),this.options);if(ge(this,Fs,Y(this,Ye).state),ge(this,Cl,this.options),Y(this,Fs).data!==void 0&&ge(this,El,Y(this,Ye)),V0(r,n))return;ge(this,_n,r);const o={},i=()=>{if(!n)return!0;const{notifyOnChangeProps:s}=this.options,a=typeof s=="function"?s():s;if(a==="all"||!a&&!Y(this,Rl).size)return!0;const l=new Set(a??Y(this,Rl));return this.options.throwOnError&&l.add("error"),Object.keys(Y(this,_n)).some(c=>{const u=c;return Y(this,_n)[u]!==n[u]&&l.has(u)})};(t==null?void 0:t.listeners)!==!1&&i()&&(o.listeners=!0),Ge(this,ut,PM).call(this,{...o,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Ge(this,ut,K0).call(this)}},zn=new WeakMap,Ye=new WeakMap,cd=new WeakMap,_n=new WeakMap,Fs=new WeakMap,Cl=new WeakMap,Ri=new WeakMap,ao=new WeakMap,ud=new WeakMap,_l=new WeakMap,El=new WeakMap,Ls=new WeakMap,$s=new WeakMap,Pi=new WeakMap,Rl=new WeakMap,ut=new WeakSet,$c=function(t){Ge(this,ut,J0).call(this);let n=Y(this,Ye).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Sr)),n},q0=function(){Ge(this,ut,X0).call(this);const t=Za(this.options.staleTime,Y(this,Ye));if(ta||Y(this,_n).isStale||!z0(t))return;const r=yM(Y(this,_n).dataUpdatedAt,t)+1;ge(this,Ls,setTimeout(()=>{Y(this,_n).isStale||this.updateResult()},r))},G0=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(Y(this,Ye)):this.options.refetchInterval)??!1},Y0=function(t){Ge(this,ut,Q0).call(this),ge(this,Pi,t),!(ta||Lr(this.options.enabled,Y(this,Ye))===!1||!z0(Y(this,Pi))||Y(this,Pi)===0)&&ge(this,$s,setInterval(()=>{(this.options.refetchIntervalInBackground||vx.isFocused())&&Ge(this,ut,$c).call(this)},Y(this,Pi)))},K0=function(){Ge(this,ut,q0).call(this),Ge(this,ut,Y0).call(this,Ge(this,ut,G0).call(this))},X0=function(){Y(this,Ls)&&(clearTimeout(Y(this,Ls)),ge(this,Ls,void 0))},Q0=function(){Y(this,$s)&&(clearInterval(Y(this,$s)),ge(this,$s,void 0))},J0=function(){const t=Y(this,zn).getQueryCache().build(Y(this,zn),this.options);if(t===Y(this,Ye))return;const n=Y(this,Ye);ge(this,Ye,t),ge(this,cd,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},PM=function(t){nn.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(Y(this,_n))}),Y(this,zn).getQueryCache().notify({query:Y(this,Ye),type:"observerResultsUpdated"})})},G2);function Y8(e,t){return Lr(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function RC(e,t){return Y8(e,t)||e.state.data!==void 0&&Z0(e,t,t.refetchOnMount)}function Z0(e,t,n){if(Lr(t.enabled,e)!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&yx(e,t)}return!1}function PC(e,t,n,r){return(e!==t||Lr(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&yx(e,n)}function yx(e,t){return Lr(t.enabled,e)!==!1&&e.isStaleByTime(Za(t.staleTime,e))}function K8(e,t){return!V0(e.getCurrentResult(),t)}var xx=S.createContext(void 0),wx=e=>{const t=S.useContext(xx);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},X8=({client:e,children:t})=>(S.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),m.jsx(xx.Provider,{value:e,children:t})),MM=S.createContext(!1),Q8=()=>S.useContext(MM);MM.Provider;function J8(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Z8=S.createContext(J8()),e$=()=>S.useContext(Z8);function t$(e,t){return typeof e=="function"?e(...t):!!e}function MC(){}var n$=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},r$=e=>{S.useEffect(()=>{e.clearReset()},[e])},o$=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:o})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(o&&e.data===void 0||t$(n,[e.error,r])),i$=e=>{const t=e.staleTime;e.suspense&&(e.staleTime=typeof t=="function"?(...n)=>Math.max(t(...n),1e3):Math.max(t??1e3,1e3),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3)))},s$=(e,t)=>e.isLoading&&e.isFetching&&!t,a$=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,kC=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function l$(e,t,n){var d,h,f,p,g;if(process.env.NODE_ENV!=="production"&&(typeof e!="object"||Array.isArray(e)))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');const r=wx(),o=Q8(),i=e$(),s=r.defaultQueryOptions(e);(h=(d=r.getDefaultOptions().queries)==null?void 0:d._experimental_beforeQuery)==null||h.call(d,s),process.env.NODE_ENV!=="production"&&(s.queryFn||console.error(`[${s.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`)),s._optimisticResults=o?"isRestoring":"optimistic",i$(s),n$(s,i),r$(i);const a=!r.getQueryCache().get(s.queryHash),[l]=S.useState(()=>new t(r,s)),c=l.getOptimisticResult(s),u=!o&&e.subscribed!==!1;if(S.useSyncExternalStore(S.useCallback(b=>{const v=u?l.subscribe(nn.batchCalls(b)):MC;return l.updateResult(),v},[l,u]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),S.useEffect(()=>{l.setOptions(s,{listeners:!1})},[s,l]),a$(s,c))throw kC(s,l,i);if(o$({result:c,errorResetBoundary:i,throwOnError:s.throwOnError,query:r.getQueryCache().get(s.queryHash),suspense:s.suspense}))throw c.error;if((p=(f=r.getDefaultOptions().queries)==null?void 0:f._experimental_afterQuery)==null||p.call(f,s,c),s.experimental_prefetchInRender&&!ta&&s$(c,o)){const b=a?kC(s,l,i):(g=r.getQueryCache().get(s.queryHash))==null?void 0:g.promise;b==null||b.catch(MC).finally(()=>{l.updateResult()})}return s.notifyOnChangeProps?c:l.trackResult(c)}function hd(e,t){return l$(e,G8)}function c$(){const e=E.useContext(xx);if(e&&e.isSemaphorClient)return e}function kM({children:e}){const{setIsSessionExpired:t}=zt(),n=c$(),[r]=E.useState(()=>{const o=new q8({queryCache:new RM({onError:i=>{i instanceof Error?(console.error(`Something went wrong: ${i.message}`),i.message==="invalid token"&&t(!0)):console.error("Something went wrong:",i)}}),defaultOptions:{queries:{gcTime:36e5,staleTime:3e5,refetchOnWindowFocus:!1,retry:1}}});return o.isSemaphorClient=!0,o});return n?m.jsx(m.Fragment,{children:e}):m.jsx(X8,{client:r,children:e})}const Ki=E.forwardRef(({children:e,className:t,...n},r)=>m.jsx("div",{className:ie("semaphor-scope",t),ref:r,...n,children:e})),u$={id:"",authToken:void 0},OM=E.createContext(u$),DM=({children:e,dashboardProps:t})=>m.jsx(kM,{children:m.jsx(OM.Provider,{value:t,children:m.jsx(Ki,{style:{height:"100%"},children:e})})});function vr(){const e=E.useContext(OM);if(e===void 0)throw new Error("useApplicationContext must be used within a ApplicationContextProvider");return e}function d$(){const{authToken:e,version:t}=vr(),n=se(l=>l.selectedLensId);function r(){if(!(e!=null&&e.accessToken))return!1}const{data:o,isLoading:i,isFetching:s,isError:a}=hd({queryKey:["dashboard",n,e==null?void 0:e.accessToken],queryFn:()=>R8(e==null?void 0:e.accessToken,{lensId:n,version:t}),enabled:r()});return{data:o,isLoading:i,isFetching:s,isError:a}}function f$(){const{authToken:e}=vr(),t=se(r=>r.authToken),{setAuthToken:n}=zt();return E.useEffect(()=>{e&&(e==null?void 0:e.toString())!==(t==null?void 0:t.toString())&&n(e)},[e,t,n]),e}const TM=(e,t)=>{const n={};if(e===null||t===null)return t;const r=new Set([...Object.keys(e),...Object.keys(t)]);for(const o of r){if(!(o in e)&&o in t){n[o]=t[o];continue}if(o in e&&!(o in t)){n[o]=void 0;continue}const i=e[o],s=t[o];if(!ev(i,s))if(Array.isArray(i)&&Array.isArray(s))n[o]=s;else if(OC(i)&&OC(s)){const a=TM(i,s);Object.keys(a).length>0&&(n[o]=a)}else n[o]=s}return n},ev=(e,t)=>{if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(Array.isArray(e)&&Array.isArray(t))return e.length!==t.length?!1:e.every((o,i)=>ev(o,t[i]));const n=Object.keys(e),r=Object.keys(t);return n.length!==r.length?!1:n.every(o=>ev(e[o],t[o]))}return!1},OC=e=>e!==null&&typeof e=="object"&&!Array.isArray(e),ku=e=>{if(e===null||typeof e!="object")return e;if(e instanceof Date)return new Date(e);if(e instanceof RegExp)return new RegExp(e);if(Array.isArray(e))return e.map(n=>ku(n));const t={};for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=ku(e[n]));return t};function IM(e){return e==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e}function DC(e,t){const n=IM(e);return n==="dark"?Ru({...t==null?void 0:t.default},{...t==null?void 0:t.dark}):t==null?void 0:t.default}function h$({customStyle:e,currentTheme:t,onSave:n,onEvent:r,defaultFilterValues:o,selectedSheetId:i,onFilterValuesChange:s}){const{authToken:a}=vr();f$();const l=se(A=>A.selectedLensId),{data:c,isLoading:u,isFetching:d,isError:h}=d$(),[f,p]=E.useState(o||[]),{theme:g,setTheme:b}=vM(),v=se(A=>A.dashboard.globalStyle),{setDashboard:x,setDashboardWithFilterValues:y,setSelectedSheetId:_,setStyle:w,setOnSaveFunction:C,setLenses:R,setSelectedLensId:k,setInitStore:D}=zt();se(A=>A.actions.setCustomCards);const I=se(A=>A.actions.setFilterValues),T=se(A=>A.filterValues),N=se(A=>A.actions.setThemeStyle),G=se(A=>A.actions.setDashboardTheme),z=se(A=>A.actions.setOnEvent);E.useEffect(()=>{a&&D()},[a,D]),E.useEffect(()=>{if(g){const A=IM(g);G(A)}},[g,G]),E.useEffect(()=>{t&&b(t)},[t,b]);const O=E.useCallback(()=>{const A=ku(Ih),L=Ru(A,v);if(e){const j=Ru(L,e),B=DC(g,j);N(B),w(j)}else{const j=DC(g,L);N(j),w(Ih)}},[g,e,v,N,w]);return E.useEffect(()=>{c&&c.dashboard&&O()},[g,e,v,O,c]),E.useEffect(()=>{var F,P;function A(U,q){const K=U.filters||[],H=[];for(const V of q){const Q=K.find(Z=>Z.id===V.filterId);Q&&H.push({filterId:V.filterId,connectionType:Q.database==="NA"?"api":"database",name:Q.column,operation:Q.operation,valueType:Qa(Q),values:V.values})}return H}if(!c||!c.dashboard)return;const{dashboard:L,filterValues:j,defaultLensId:B,lenses:M}=c,W=A(L,f||[]);y(L,(!j||(j==null?void 0:j.length)===0?W:j)||[]),M&&R(M),B&&k(B),_(i||((P=(F=L==null?void 0:L.sheets)==null?void 0:F[0])==null?void 0:P.id)||null)},[c,x,_,I,l,R,y,k,f,i]),E.useEffect(()=>{s&&T&&s(T)},[T,s]),E.useEffect(()=>{n&&C(n),r&&z(r)},[n,C,r,z]),{isFetching:d,isLoading:u,isError:h}}function el({className:e,...t}){return m.jsx("div",{className:ie("animate-pulse rounded-md bg-muted",e),...t})}const AM=S.forwardRef(({className:e,...t},n)=>m.jsx("div",{ref:n,className:ie("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));AM.displayName="Card";const qp=S.forwardRef(({className:e,...t},n)=>m.jsx("div",{ref:n,className:ie("flex flex-col space-y-1.5 p-6",e),...t}));qp.displayName="CardHeader";const Zl=S.forwardRef(({className:e,...t},n)=>m.jsx("h3",{ref:n,className:ie("text-2xl font-semibold leading-none tracking-tight",e),...t}));Zl.displayName="CardTitle";const Sx=S.forwardRef(({className:e,...t},n)=>m.jsx("p",{ref:n,className:ie("text-sm text-muted-foreground",e),...t}));Sx.displayName="CardDescription";const Gp=S.forwardRef(({className:e,...t},n)=>m.jsx("div",{ref:n,className:ie("px-6 pt-0",e),...t}));Gp.displayName="CardContent";const NM=S.forwardRef(({className:e,...t},n)=>m.jsx("div",{ref:n,className:ie("flex items-center p-6 pt-0",e),...t}));NM.displayName="CardFooter";function jM({className:e,customStyle:t,onSave:n,onEvent:r,LoadingComponent:o,ErrorComponent:i,onChartElementClicked:s,id:a,authToken:l,currentTheme:c,version:u,customCards:d,showAssistant:h,defaultFilterValues:f,onFilterValuesChange:p,selectedSheetId:g,...b}){const{placeholders:v}=vr(),x=se(C=>C.themeStyle),y=se(C=>C.isSessionExpired),{isLoading:_,isError:w}=h$({customStyle:t,currentTheme:c,onSave:n,onEvent:r,defaultFilterValues:f,onFilterValuesChange:p,selectedSheetId:g});return _||!l?(r==null||r({type:"info",message:"Loading dashboard"}),o?m.jsx(o,{message:"loading"}):m.jsx("div",{className:"flex items-center gap-3",children:m.jsx(el,{className:"h-1 w-full dark:h-[2px]"})})):w?(r==null||r({type:"error",message:"Error fetching dashboard"}),i?(console.log("Error fetching dashboard"),m.jsx(i,{})):m.jsx("div",{children:"Error"})):y?(r==null||r({type:"error",message:"Session Expired"}),v!=null&&v.SessionExpired?m.jsx("div",{className:"flex h-full items-center justify-center",children:m.jsx("div",{children:v.SessionExpired})}):m.jsx("div",{className:"flex h-full items-center justify-center",children:m.jsxs("div",{className:"space-y-4 rounded-md border border-muted p-10",children:[m.jsx(Zl,{children:"Session Expired"}),m.jsx("p",{className:"text-muted-foreground",children:"Please refresh your page to continue."})]})})):m.jsx("div",{className:ie("isolate flex h-full flex-col justify-between",x==null?void 0:x.dashboardPanel,e),style:{},"data-role":"dashboard-panel",...b})}function ae(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function p$(e,t){const n=S.createContext(t),r=i=>{const{children:s,...a}=i,l=S.useMemo(()=>a,Object.values(a));return m.jsx(n.Provider,{value:l,children:s})};r.displayName=e+"Provider";function o(i){const s=S.useContext(n);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,o]}function Kt(e,t=[]){let n=[];function r(i,s){const a=S.createContext(s),l=n.length;n=[...n,s];const c=d=>{var v;const{scope:h,children:f,...p}=d,g=((v=h==null?void 0:h[e])==null?void 0:v[l])||a,b=S.useMemo(()=>p,Object.values(p));return m.jsx(g.Provider,{value:b,children:f})};c.displayName=i+"Provider";function u(d,h){var g;const f=((g=h==null?void 0:h[e])==null?void 0:g[l])||a,p=S.useContext(f);if(p)return p;if(s!==void 0)return s;throw new Error(`\`${d}\` must be used within \`${i}\``)}return[c,u]}const o=()=>{const i=n.map(s=>S.createContext(s));return function(a){const l=(a==null?void 0:a[e])||i;return S.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,g$(o,...t)]}function g$(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=r.reduce((a,{useScope:l,scopeName:c})=>{const d=l(i)[`__scope${c}`];return{...a,...d}},{});return S.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function TC(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Yp(...e){return t=>{let n=!1;const r=e.map(o=>{const i=TC(o,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let o=0;o<r.length;o++){const i=r[o];typeof i=="function"?i():TC(e[o],null)}}}}function Oe(...e){return S.useCallback(Yp(...e),e)}var ri=S.forwardRef((e,t)=>{const{children:n,...r}=e,o=S.Children.toArray(n),i=o.find(m$);if(i){const s=i.props.children,a=o.map(l=>l===i?S.Children.count(s)>1?S.Children.only(null):S.isValidElement(s)?s.props.children:null:l);return m.jsx(tv,{...r,ref:t,children:S.isValidElement(s)?S.cloneElement(s,void 0,a):null})}return m.jsx(tv,{...r,ref:t,children:n})});ri.displayName="Slot";var tv=S.forwardRef((e,t)=>{const{children:n,...r}=e;if(S.isValidElement(n)){const o=v$(n),i=b$(r,n.props);return n.type!==S.Fragment&&(i.ref=t?Yp(t,o):o),S.cloneElement(n,i)}return S.Children.count(n)>1?S.Children.only(null):null});tv.displayName="SlotClone";var Cx=({children:e})=>m.jsx(m.Fragment,{children:e});function m$(e){return S.isValidElement(e)&&e.type===Cx}function b$(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{i(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function v$(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Kp(e){const t=e+"CollectionProvider",[n,r]=Kt(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=f=>{const{scope:p,children:g}=f,b=E.useRef(null),v=E.useRef(new Map).current;return m.jsx(o,{scope:p,itemMap:v,collectionRef:b,children:g})};s.displayName=t;const a=e+"CollectionSlot",l=E.forwardRef((f,p)=>{const{scope:g,children:b}=f,v=i(a,g),x=Oe(p,v.collectionRef);return m.jsx(ri,{ref:x,children:b})});l.displayName=a;const c=e+"CollectionItemSlot",u="data-radix-collection-item",d=E.forwardRef((f,p)=>{const{scope:g,children:b,...v}=f,x=E.useRef(null),y=Oe(p,x),_=i(c,g);return E.useEffect(()=>(_.itemMap.set(x,{ref:x,...v}),()=>void _.itemMap.delete(x))),m.jsx(ri,{[u]:"",ref:y,children:b})});d.displayName=c;function h(f){const p=i(e+"CollectionConsumer",f);return E.useCallback(()=>{const b=p.collectionRef.current;if(!b)return[];const v=Array.from(b.querySelectorAll(`[${u}]`));return Array.from(p.itemMap.values()).sort((_,w)=>v.indexOf(_.ref.current)-v.indexOf(w.ref.current))},[p.collectionRef,p.itemMap])}return[{Provider:s,Slot:l,ItemSlot:d},h,r]}var rn=globalThis!=null&&globalThis.document?S.useLayoutEffect:()=>{},y$=S.useId||(()=>{}),x$=0;function Ut(e){const[t,n]=S.useState(y$());return rn(()=>{n(r=>r??String(x$++))},[e]),t?`radix-${t}`:""}var w$=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],pe=w$.reduce((e,t)=>{const n=S.forwardRef((r,o)=>{const{asChild:i,...s}=r,a=i?ri:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),m.jsx(a,{...s,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function FM(e,t){e&&Js.flushSync(()=>e.dispatchEvent(t))}function Gt(e){const t=S.useRef(e);return S.useEffect(()=>{t.current=e}),S.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function yn({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=S$({defaultProp:t,onChange:n}),i=e!==void 0,s=i?e:r,a=Gt(n),l=S.useCallback(c=>{if(i){const d=typeof c=="function"?c(e):c;d!==e&&a(d)}else o(c)},[i,e,o,a]);return[s,l]}function S$({defaultProp:e,onChange:t}){const n=S.useState(e),[r]=n,o=S.useRef(r),i=Gt(t);return S.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}var C$=S.createContext(void 0);function ga(e){const t=S.useContext(C$);return e||t||"ltr"}var Vm="rovingFocusGroup.onEntryFocus",_$={bubbles:!1,cancelable:!0},Xp="RovingFocusGroup",[nv,LM,E$]=Kp(Xp),[R$,ec]=Kt(Xp,[E$]),[P$,M$]=R$(Xp),$M=S.forwardRef((e,t)=>m.jsx(nv.Provider,{scope:e.__scopeRovingFocusGroup,children:m.jsx(nv.Slot,{scope:e.__scopeRovingFocusGroup,children:m.jsx(k$,{...e,ref:t})})}));$M.displayName=Xp;var k$=S.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:c,preventScrollOnEntryFocus:u=!1,...d}=e,h=S.useRef(null),f=Oe(t,h),p=ga(i),[g=null,b]=yn({prop:s,defaultProp:a,onChange:l}),[v,x]=S.useState(!1),y=Gt(c),_=LM(n),w=S.useRef(!1),[C,R]=S.useState(0);return S.useEffect(()=>{const k=h.current;if(k)return k.addEventListener(Vm,y),()=>k.removeEventListener(Vm,y)},[y]),m.jsx(P$,{scope:n,orientation:r,dir:p,loop:o,currentTabStopId:g,onItemFocus:S.useCallback(k=>b(k),[b]),onItemShiftTab:S.useCallback(()=>x(!0),[]),onFocusableItemAdd:S.useCallback(()=>R(k=>k+1),[]),onFocusableItemRemove:S.useCallback(()=>R(k=>k-1),[]),children:m.jsx(pe.div,{tabIndex:v||C===0?-1:0,"data-orientation":r,...d,ref:f,style:{outline:"none",...e.style},onMouseDown:ae(e.onMouseDown,()=>{w.current=!0}),onFocus:ae(e.onFocus,k=>{const D=!w.current;if(k.target===k.currentTarget&&D&&!v){const I=new CustomEvent(Vm,_$);if(k.currentTarget.dispatchEvent(I),!I.defaultPrevented){const T=_().filter(A=>A.focusable),N=T.find(A=>A.active),G=T.find(A=>A.id===g),O=[N,G,...T].filter(Boolean).map(A=>A.ref.current);VM(O,u)}}w.current=!1}),onBlur:ae(e.onBlur,()=>x(!1))})})}),zM="RovingFocusGroupItem",BM=S.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:i,...s}=e,a=Ut(),l=i||a,c=M$(zM,n),u=c.currentTabStopId===l,d=LM(n),{onFocusableItemAdd:h,onFocusableItemRemove:f}=c;return S.useEffect(()=>{if(r)return h(),()=>f()},[r,h,f]),m.jsx(nv.ItemSlot,{scope:n,id:l,focusable:r,active:o,children:m.jsx(pe.span,{tabIndex:u?0:-1,"data-orientation":c.orientation,...s,ref:t,onMouseDown:ae(e.onMouseDown,p=>{r?c.onItemFocus(l):p.preventDefault()}),onFocus:ae(e.onFocus,()=>c.onItemFocus(l)),onKeyDown:ae(e.onKeyDown,p=>{if(p.key==="Tab"&&p.shiftKey){c.onItemShiftTab();return}if(p.target!==p.currentTarget)return;const g=T$(p,c.orientation,c.dir);if(g!==void 0){if(p.metaKey||p.ctrlKey||p.altKey||p.shiftKey)return;p.preventDefault();let v=d().filter(x=>x.focusable).map(x=>x.ref.current);if(g==="last")v.reverse();else if(g==="prev"||g==="next"){g==="prev"&&v.reverse();const x=v.indexOf(p.currentTarget);v=c.loop?I$(v,x+1):v.slice(x+1)}setTimeout(()=>VM(v))}})})})});BM.displayName=zM;var O$={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function D$(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function T$(e,t,n){const r=D$(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return O$[r]}function VM(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function I$(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var _x=$M,Ex=BM;function A$(e,t){return S.useReducer((n,r)=>t[n][r]??n,e)}var qt=e=>{const{present:t,children:n}=e,r=N$(t),o=typeof n=="function"?n({present:r.isPresent}):S.Children.only(n),i=Oe(r.ref,j$(o));return typeof n=="function"||r.isPresent?S.cloneElement(o,{ref:i}):null};qt.displayName="Presence";function N$(e){const[t,n]=S.useState(),r=S.useRef({}),o=S.useRef(e),i=S.useRef("none"),s=e?"mounted":"unmounted",[a,l]=A$(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return S.useEffect(()=>{const c=of(r.current);i.current=a==="mounted"?c:"none"},[a]),rn(()=>{const c=r.current,u=o.current;if(u!==e){const h=i.current,f=of(c);e?l("MOUNT"):f==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(u&&h!==f?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),rn(()=>{if(t){let c;const u=t.ownerDocument.defaultView??window,d=f=>{const g=of(r.current).includes(f.animationName);if(f.target===t&&g&&(l("ANIMATION_END"),!o.current)){const b=t.style.animationFillMode;t.style.animationFillMode="forwards",c=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=b)})}},h=f=>{f.target===t&&(i.current=of(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{u.clearTimeout(c),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:S.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function of(e){return(e==null?void 0:e.animationName)||"none"}function j$(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Rx="Tabs",[F$,nve]=Kt(Rx,[ec]),HM=ec(),[L$,Px]=F$(Rx),WM=S.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:i,orientation:s="horizontal",dir:a,activationMode:l="automatic",...c}=e,u=ga(a),[d,h]=yn({prop:r,onChange:o,defaultProp:i});return m.jsx(L$,{scope:n,baseId:Ut(),value:d,onValueChange:h,orientation:s,dir:u,activationMode:l,children:m.jsx(pe.div,{dir:u,"data-orientation":s,...c,ref:t})})});WM.displayName=Rx;var UM="TabsList",qM=S.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,i=Px(UM,n),s=HM(n);return m.jsx(_x,{asChild:!0,...s,orientation:i.orientation,dir:i.dir,loop:r,children:m.jsx(pe.div,{role:"tablist","aria-orientation":i.orientation,...o,ref:t})})});qM.displayName=UM;var GM="TabsTrigger",YM=S.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...i}=e,s=Px(GM,n),a=HM(n),l=QM(s.baseId,r),c=JM(s.baseId,r),u=r===s.value;return m.jsx(Ex,{asChild:!0,...a,focusable:!o,active:u,children:m.jsx(pe.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":c,"data-state":u?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:l,...i,ref:t,onMouseDown:ae(e.onMouseDown,d=>{!o&&d.button===0&&d.ctrlKey===!1?s.onValueChange(r):d.preventDefault()}),onKeyDown:ae(e.onKeyDown,d=>{[" ","Enter"].includes(d.key)&&s.onValueChange(r)}),onFocus:ae(e.onFocus,()=>{const d=s.activationMode!=="manual";!u&&!o&&d&&s.onValueChange(r)})})})});YM.displayName=GM;var KM="TabsContent",XM=S.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:i,...s}=e,a=Px(KM,n),l=QM(a.baseId,r),c=JM(a.baseId,r),u=r===a.value,d=S.useRef(u);return S.useEffect(()=>{const h=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(h)},[]),m.jsx(qt,{present:o||u,children:({present:h})=>m.jsx(pe.div,{"data-state":u?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":l,hidden:!h,id:c,tabIndex:0,...s,ref:t,style:{...e.style,animationDuration:d.current?"0s":void 0},children:h&&i})})});XM.displayName=KM;function QM(e,t){return`${e}-trigger-${t}`}function JM(e,t){return`${e}-content-${t}`}var $$=WM,ZM=qM,ek=YM,tk=XM;const Mx=$$,Qp=S.forwardRef(({className:e,...t},n)=>m.jsx(ZM,{ref:n,className:ie("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));Qp.displayName=ZM.displayName;const Jp=S.forwardRef(({className:e,...t},n)=>m.jsx(ek,{ref:n,className:ie("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",e),...t}));Jp.displayName=ek.displayName;const kx=S.forwardRef(({className:e,...t},n)=>m.jsx(tk,{ref:n,className:ie("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));kx.displayName=tk.displayName;var nk={exports:{}},pd={},rv={exports:{}};(function(e,t){(function(n,r){r(t)})(Qo,function(n){function r(V){return function(Z,ne,J,oe,ee,ue,de){return V(Z,ne,de)}}function o(V){return function(Z,ne,J,oe){if(!Z||!ne||typeof Z!="object"||typeof ne!="object")return V(Z,ne,J,oe);var ee=oe.get(Z),ue=oe.get(ne);if(ee&&ue)return ee===ne&&ue===Z;oe.set(Z,ne),oe.set(ne,Z);var de=V(Z,ne,J,oe);return oe.delete(Z),oe.delete(ne),de}}function i(V,Q){var Z={};for(var ne in V)Z[ne]=V[ne];for(var ne in Q)Z[ne]=Q[ne];return Z}function s(V){return V.constructor===Object||V.constructor==null}function a(V){return typeof V.then=="function"}function l(V,Q){return V===Q||V!==V&&Q!==Q}var c="[object Arguments]",u="[object Boolean]",d="[object Date]",h="[object RegExp]",f="[object Map]",p="[object Number]",g="[object Object]",b="[object Set]",v="[object String]",x=Object.prototype.toString;function y(V){var Q=V.areArraysEqual,Z=V.areDatesEqual,ne=V.areMapsEqual,J=V.areObjectsEqual,oe=V.areRegExpsEqual,ee=V.areSetsEqual,ue=V.createIsNestedEqual,de=ue(ye);function ye(he,me,je){if(he===me)return!0;if(!he||!me||typeof he!="object"||typeof me!="object")return he!==he&&me!==me;if(s(he)&&s(me))return J(he,me,de,je);var et=Array.isArray(he),Bt=Array.isArray(me);if(et||Bt)return et===Bt&&Q(he,me,de,je);var Ue=x.call(he);return Ue!==x.call(me)?!1:Ue===d?Z(he,me,de,je):Ue===h?oe(he,me,de,je):Ue===f?ne(he,me,de,je):Ue===b?ee(he,me,de,je):Ue===g||Ue===c?a(he)||a(me)?!1:J(he,me,de,je):Ue===u||Ue===p||Ue===v?l(he.valueOf(),me.valueOf()):!1}return ye}function _(V,Q,Z,ne){var J=V.length;if(Q.length!==J)return!1;for(;J-- >0;)if(!Z(V[J],Q[J],J,J,V,Q,ne))return!1;return!0}var w=o(_);function C(V,Q){return l(V.valueOf(),Q.valueOf())}function R(V,Q,Z,ne){var J=V.size===Q.size;if(!J)return!1;if(!V.size)return!0;var oe={},ee=0;return V.forEach(function(ue,de){if(J){var ye=!1,he=0;Q.forEach(function(me,je){!ye&&!oe[he]&&(ye=Z(de,je,ee,he,V,Q,ne)&&Z(ue,me,de,je,V,Q,ne))&&(oe[he]=!0),he++}),ee++,J=ye}}),J}var k=o(R),D="_owner",I=Object.prototype.hasOwnProperty;function T(V,Q,Z,ne){var J=Object.keys(V),oe=J.length;if(Object.keys(Q).length!==oe)return!1;for(var ee;oe-- >0;){if(ee=J[oe],ee===D){var ue=!!V.$$typeof,de=!!Q.$$typeof;if((ue||de)&&ue!==de)return!1}if(!I.call(Q,ee)||!Z(V[ee],Q[ee],ee,ee,V,Q,ne))return!1}return!0}var N=o(T);function G(V,Q){return V.source===Q.source&&V.flags===Q.flags}function z(V,Q,Z,ne){var J=V.size===Q.size;if(!J)return!1;if(!V.size)return!0;var oe={};return V.forEach(function(ee,ue){if(J){var de=!1,ye=0;Q.forEach(function(he,me){!de&&!oe[ye]&&(de=Z(ee,he,ue,me,V,Q,ne))&&(oe[ye]=!0),ye++}),J=de}}),J}var O=o(z),A=Object.freeze({areArraysEqual:_,areDatesEqual:C,areMapsEqual:R,areObjectsEqual:T,areRegExpsEqual:G,areSetsEqual:z,createIsNestedEqual:r}),L=Object.freeze({areArraysEqual:w,areDatesEqual:C,areMapsEqual:k,areObjectsEqual:N,areRegExpsEqual:G,areSetsEqual:O,createIsNestedEqual:r}),j=y(A);function B(V,Q){return j(V,Q,void 0)}var M=y(i(A,{createIsNestedEqual:function(){return l}}));function W(V,Q){return M(V,Q,void 0)}var F=y(L);function P(V,Q){return F(V,Q,new WeakMap)}var U=y(i(L,{createIsNestedEqual:function(){return l}}));function q(V,Q){return U(V,Q,new WeakMap)}function K(V){return y(i(A,V(A)))}function H(V){var Q=y(i(L,V(L)));return function(Z,ne,J){return J===void 0&&(J=new WeakMap),Q(Z,ne,J)}}n.circularDeepEqual=P,n.circularShallowEqual=q,n.createCustomCircularEqual=H,n.createCustomEqual=K,n.deepEqual=B,n.sameValueZeroEqual=l,n.shallowEqual=W,Object.defineProperty(n,"__esModule",{value:!0})})})(rv,rv.exports);var Ox=rv.exports;const Dx=sx(Q3);var We={},z$=function(t,n,r){return t===n?!0:t.className===n.className&&r(t.style,n.style)&&t.width===n.width&&t.autoSize===n.autoSize&&t.cols===n.cols&&t.draggableCancel===n.draggableCancel&&t.draggableHandle===n.draggableHandle&&r(t.verticalCompact,n.verticalCompact)&&r(t.compactType,n.compactType)&&r(t.layout,n.layout)&&r(t.margin,n.margin)&&r(t.containerPadding,n.containerPadding)&&t.rowHeight===n.rowHeight&&t.maxRows===n.maxRows&&t.isBounded===n.isBounded&&t.isDraggable===n.isDraggable&&t.isResizable===n.isResizable&&t.allowOverlap===n.allowOverlap&&t.preventCollision===n.preventCollision&&t.useCSSTransforms===n.useCSSTransforms&&t.transformScale===n.transformScale&&t.isDroppable===n.isDroppable&&r(t.resizeHandles,n.resizeHandles)&&r(t.resizeHandle,n.resizeHandle)&&t.onLayoutChange===n.onLayoutChange&&t.onDragStart===n.onDragStart&&t.onDrag===n.onDrag&&t.onDragStop===n.onDragStop&&t.onResizeStart===n.onResizeStart&&t.onResize===n.onResize&&t.onResizeStop===n.onResizeStop&&t.onDrop===n.onDrop&&r(t.droppingItem,n.droppingItem)&&r(t.innerRef,n.innerRef)};Object.defineProperty(We,"__esModule",{value:!0});We.bottom=Tx;We.childrenEqual=W$;We.cloneLayout=rk;We.cloneLayoutItem=zs;We.collides=Zp;We.compact=ik;We.compactItem=sk;We.compactType=r7;We.correctBounds=ak;We.fastPositionEqual=U$;We.fastRGLPropsEqual=void 0;We.getAllCollisions=lk;We.getFirstCollision=_s;We.getLayoutItem=Ix;We.getStatics=Ax;We.modifyLayout=ok;We.moveElement=Bc;We.moveElementAwayFromCollision=iv;We.noop=void 0;We.perc=G$;We.resizeItemInDirection=Z$;We.setTopLeft=t7;We.setTransform=e7;We.sortLayoutItems=zx;We.sortLayoutItemsByColRow=hk;We.sortLayoutItemsByRowCol=fk;We.synchronizeLayoutWithChildren=n7;We.validateLayout=pk;We.withLayoutItem=H$;var IC=Ox,zc=B$(E);function B$(e){return e&&e.__esModule?e:{default:e}}const V$=process.env.NODE_ENV==="production";function Tx(e){let t=0,n;for(let r=0,o=e.length;r<o;r++)n=e[r].y+e[r].h,n>t&&(t=n);return t}function rk(e){const t=Array(e.length);for(let n=0,r=e.length;n<r;n++)t[n]=zs(e[n]);return t}function ok(e,t){const n=Array(e.length);for(let r=0,o=e.length;r<o;r++)t.i===e[r].i?n[r]=t:n[r]=e[r];return n}function H$(e,t,n){let r=Ix(e,t);return r?(r=n(zs(r)),e=ok(e,r),[e,r]):[e,null]}function zs(e){return{w:e.w,h:e.h,x:e.x,y:e.y,i:e.i,minW:e.minW,maxW:e.maxW,minH:e.minH,maxH:e.maxH,moved:!!e.moved,static:!!e.static,isDraggable:e.isDraggable,isResizable:e.isResizable,resizeHandles:e.resizeHandles,isBounded:e.isBounded}}function W$(e,t){return(0,IC.deepEqual)(zc.default.Children.map(e,n=>n==null?void 0:n.key),zc.default.Children.map(t,n=>n==null?void 0:n.key))&&(0,IC.deepEqual)(zc.default.Children.map(e,n=>n==null?void 0:n.props["data-grid"]),zc.default.Children.map(t,n=>n==null?void 0:n.props["data-grid"]))}We.fastRGLPropsEqual=z$;function U$(e,t){return e.left===t.left&&e.top===t.top&&e.width===t.width&&e.height===t.height}function Zp(e,t){return!(e.i===t.i||e.x+e.w<=t.x||e.x>=t.x+t.w||e.y+e.h<=t.y||e.y>=t.y+t.h)}function ik(e,t,n,r){const o=Ax(e),i=zx(e,t),s=Array(e.length);for(let a=0,l=i.length;a<l;a++){let c=zs(i[a]);c.static||(c=sk(o,c,t,n,i,r),o.push(c)),s[e.indexOf(i[a])]=c,c.moved=!1}return s}const q$={x:"w",y:"h"};function ov(e,t,n,r){const o=q$[r];t[r]+=1;const i=e.map(s=>s.i).indexOf(t.i);for(let s=i+1;s<e.length;s++){const a=e[s];if(!a.static){if(a.y>t.y+t.h)break;Zp(t,a)&&ov(e,a,n+t[o],r)}}t[r]=n}function sk(e,t,n,r,o,i){const s=n==="vertical",a=n==="horizontal";if(s)for(t.y=Math.min(Tx(e),t.y);t.y>0&&!_s(e,t);)t.y--;else if(a)for(;t.x>0&&!_s(e,t);)t.x--;let l;for(;(l=_s(e,t))&&!(n===null&&i);)if(a?ov(o,t,l.x+l.w,"x"):ov(o,t,l.y+l.h,"y"),a&&t.x+t.w>r)for(t.x=r-t.w,t.y++;t.x>0&&!_s(e,t);)t.x--;return t.y=Math.max(t.y,0),t.x=Math.max(t.x,0),t}function ak(e,t){const n=Ax(e);for(let r=0,o=e.length;r<o;r++){const i=e[r];if(i.x+i.w>t.cols&&(i.x=t.cols-i.w),i.x<0&&(i.x=0,i.w=t.cols),!i.static)n.push(i);else for(;_s(n,i);)i.y++}return e}function Ix(e,t){for(let n=0,r=e.length;n<r;n++)if(e[n].i===t)return e[n]}function _s(e,t){for(let n=0,r=e.length;n<r;n++)if(Zp(e[n],t))return e[n]}function lk(e,t){return e.filter(n=>Zp(n,t))}function Ax(e){return e.filter(t=>t.static)}function Bc(e,t,n,r,o,i,s,a,l){if(t.static&&t.isDraggable!==!0||t.y===r&&t.x===n)return e;`${t.i}${String(n)}${String(r)}${t.x}${t.y}`;const c=t.x,u=t.y;typeof n=="number"&&(t.x=n),typeof r=="number"&&(t.y=r),t.moved=!0;let d=zx(e,s);(s==="vertical"&&typeof r=="number"?u>=r:s==="horizontal"&&typeof n=="number"?c>=n:!1)&&(d=d.reverse());const f=lk(d,t),p=f.length>0;if(p&&l)return rk(e);if(p&&i)return`${t.i}`,t.x=c,t.y=u,t.moved=!1,e;for(let g=0,b=f.length;g<b;g++){const v=f[g];`${t.i}${t.x}${t.y}${v.i}${v.x}${v.y}`,!v.moved&&(v.static?e=iv(e,v,t,o,s):e=iv(e,t,v,o,s))}return e}function iv(e,t,n,r,o,i){const s=o==="horizontal",a=o==="vertical",l=t.static;if(r){r=!1;const d={x:s?Math.max(t.x-n.w,0):n.x,y:a?Math.max(t.y-n.h,0):n.y,w:n.w,h:n.h,i:"-1"},h=_s(e,d),f=h&&h.y+h.h>t.y,p=h&&t.x+t.w>h.x;if(h){if(f&&a)return Bc(e,n,void 0,t.y+1,r,l,o);if(f&&o==null)return t.y=n.y,n.y=n.y+n.h,e;if(p&&s)return Bc(e,t,n.x,void 0,r,l,o)}else return`${n.i}${d.x}${d.y}`,Bc(e,n,s?d.x:void 0,a?d.y:void 0,r,l,o)}const c=s?n.x+1:void 0,u=a?n.y+1:void 0;return c==null&&u==null?e:Bc(e,n,s?n.x+1:void 0,a?n.y+1:void 0,r,l,o)}function G$(e){return e*100+"%"}const ck=(e,t,n,r)=>e+n>r?t:n,uk=(e,t,n)=>e<0?t:n,dk=e=>Math.max(0,e),Nx=e=>Math.max(0,e),jx=(e,t,n)=>{let{left:r,height:o,width:i}=t;const s=e.top-(o-e.height);return{left:r,width:i,height:uk(s,e.height,o),top:Nx(s)}},Fx=(e,t,n)=>{let{top:r,left:o,height:i,width:s}=t;return{top:r,height:i,width:ck(e.left,e.width,s,n),left:dk(o)}},Lx=(e,t,n)=>{let{top:r,height:o,width:i}=t;const s=e.left-(i-e.width);return{height:o,width:s<0?e.width:ck(e.left,e.width,i,n),top:Nx(r),left:dk(s)}},$x=(e,t,n)=>{let{top:r,left:o,height:i,width:s}=t;return{width:s,left:o,height:uk(r,e.height,i),top:Nx(r)}},Y$=function(){return jx(arguments.length<=0?void 0:arguments[0],Fx(...arguments))},K$=function(){return jx(arguments.length<=0?void 0:arguments[0],Lx(...arguments))},X$=function(){return $x(arguments.length<=0?void 0:arguments[0],Fx(...arguments))},Q$=function(){return $x(arguments.length<=0?void 0:arguments[0],Lx(...arguments))},J$={n:jx,ne:Y$,e:Fx,se:X$,s:$x,sw:Q$,w:Lx,nw:K$};function Z$(e,t,n,r){const o=J$[e];return o?o(t,{...t,...n},r):n}function e7(e){let{top:t,left:n,width:r,height:o}=e;const i=`translate(${n}px,${t}px)`;return{transform:i,WebkitTransform:i,MozTransform:i,msTransform:i,OTransform:i,width:`${r}px`,height:`${o}px`,position:"absolute"}}function t7(e){let{top:t,left:n,width:r,height:o}=e;return{top:`${t}px`,left:`${n}px`,width:`${r}px`,height:`${o}px`,position:"absolute"}}function zx(e,t){return t==="horizontal"?hk(e):t==="vertical"?fk(e):e}function fk(e){return e.slice(0).sort(function(t,n){return t.y>n.y||t.y===n.y&&t.x>n.x?1:t.y===n.y&&t.x===n.x?0:-1})}function hk(e){return e.slice(0).sort(function(t,n){return t.x>n.x||t.x===n.x&&t.y>n.y?1:-1})}function n7(e,t,n,r,o){e=e||[];const i=[];zc.default.Children.forEach(t,a=>{if((a==null?void 0:a.key)==null)return;const l=Ix(e,String(a.key)),c=a.props["data-grid"];l&&c==null?i.push(zs(l)):c?(V$||pk([c],"ReactGridLayout.children"),i.push(zs({...c,i:a.key}))):i.push(zs({w:1,h:1,x:0,y:Tx(i),i:String(a.key)}))});const s=ak(i,{cols:n});return o?s:ik(s,r,n)}function pk(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Layout";const n=["x","y","w","h"];if(!Array.isArray(e))throw new Error(t+" must be an array!");for(let r=0,o=e.length;r<o;r++){const i=e[r];for(let s=0;s<n.length;s++){const a=n[s],l=i[a];if(typeof l!="number"||Number.isNaN(l))throw new Error(`ReactGridLayout: ${t}[${r}].${a} must be a number! Received: ${l} (${typeof l})`)}if(typeof i.i<"u"&&typeof i.i!="string")throw new Error(`ReactGridLayout: ${t}[${r}].i must be a string! Received: ${i.i} (${typeof i.i})`)}}function r7(e){const{verticalCompact:t,compactType:n}=e||{};return t===!1?null:n}const o7=()=>{};We.noop=o7;var Po={};Object.defineProperty(Po,"__esModule",{value:!0});Po.calcGridColWidth=eg;Po.calcGridItemPosition=i7;Po.calcGridItemWHPx=sv;Po.calcWH=a7;Po.calcXY=s7;Po.clamp=Es;function eg(e){const{margin:t,containerPadding:n,containerWidth:r,cols:o}=e;return(r-t[0]*(o-1)-n[0]*2)/o}function sv(e,t,n){return Number.isFinite(e)?Math.round(t*e+Math.max(0,e-1)*n):e}function i7(e,t,n,r,o,i){const{margin:s,containerPadding:a,rowHeight:l}=e,c=eg(e),u={};return i&&i.resizing?(u.width=Math.round(i.resizing.width),u.height=Math.round(i.resizing.height)):(u.width=sv(r,c,s[0]),u.height=sv(o,l,s[1])),i&&i.dragging?(u.top=Math.round(i.dragging.top),u.left=Math.round(i.dragging.left)):i&&i.resizing&&typeof i.resizing.top=="number"&&typeof i.resizing.left=="number"?(u.top=Math.round(i.resizing.top),u.left=Math.round(i.resizing.left)):(u.top=Math.round((l+s[1])*n+a[1]),u.left=Math.round((c+s[0])*t+a[0])),u}function s7(e,t,n,r,o){const{margin:i,containerPadding:s,cols:a,rowHeight:l,maxRows:c}=e,u=eg(e);let d=Math.round((n-s[0])/(u+i[0])),h=Math.round((t-s[1])/(l+i[1]));return d=Es(d,0,a-r),h=Es(h,0,c-o),{x:d,y:h}}function a7(e,t,n,r,o,i){const{margin:s,maxRows:a,cols:l,rowHeight:c}=e,u=eg(e);let d=Math.round((t+s[0])/(u+s[0])),h=Math.round((n+s[1])/(c+s[1])),f=Es(d,0,l-r),p=Es(h,0,a-o);return["sw","w","nw"].indexOf(i)!==-1&&(f=Es(d,0,l)),["nw","n","ne"].indexOf(i)!==-1&&(p=Es(h,0,a)),{w:f,h:p}}function Es(e,t,n){return Math.max(Math.min(e,n),t)}var tg={},av={exports:{}},sf={exports:{}},at={};/** @license React v16.13.1
37
- * react-is.production.min.js
38
- *
39
- * Copyright (c) Facebook, Inc. and its affiliates.
40
- *
41
- * This source code is licensed under the MIT license found in the
42
- * LICENSE file in the root directory of this source tree.
43
- */var AC;function l7(){if(AC)return at;AC=1;var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,s=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,d=e?Symbol.for("react.suspense"):60113,h=e?Symbol.for("react.suspense_list"):60120,f=e?Symbol.for("react.memo"):60115,p=e?Symbol.for("react.lazy"):60116,g=e?Symbol.for("react.block"):60121,b=e?Symbol.for("react.fundamental"):60117,v=e?Symbol.for("react.responder"):60118,x=e?Symbol.for("react.scope"):60119;function y(w){if(typeof w=="object"&&w!==null){var C=w.$$typeof;switch(C){case t:switch(w=w.type,w){case l:case c:case r:case i:case o:case d:return w;default:switch(w=w&&w.$$typeof,w){case a:case u:case p:case f:case s:return w;default:return C}}case n:return C}}}function _(w){return y(w)===c}return at.AsyncMode=l,at.ConcurrentMode=c,at.ContextConsumer=a,at.ContextProvider=s,at.Element=t,at.ForwardRef=u,at.Fragment=r,at.Lazy=p,at.Memo=f,at.Portal=n,at.Profiler=i,at.StrictMode=o,at.Suspense=d,at.isAsyncMode=function(w){return _(w)||y(w)===l},at.isConcurrentMode=_,at.isContextConsumer=function(w){return y(w)===a},at.isContextProvider=function(w){return y(w)===s},at.isElement=function(w){return typeof w=="object"&&w!==null&&w.$$typeof===t},at.isForwardRef=function(w){return y(w)===u},at.isFragment=function(w){return y(w)===r},at.isLazy=function(w){return y(w)===p},at.isMemo=function(w){return y(w)===f},at.isPortal=function(w){return y(w)===n},at.isProfiler=function(w){return y(w)===i},at.isStrictMode=function(w){return y(w)===o},at.isSuspense=function(w){return y(w)===d},at.isValidElementType=function(w){return typeof w=="string"||typeof w=="function"||w===r||w===c||w===i||w===o||w===d||w===h||typeof w=="object"&&w!==null&&(w.$$typeof===p||w.$$typeof===f||w.$$typeof===s||w.$$typeof===a||w.$$typeof===u||w.$$typeof===b||w.$$typeof===v||w.$$typeof===x||w.$$typeof===g)},at.typeOf=y,at}var lt={};/** @license React v16.13.1
44
- * react-is.development.js
45
- *
46
- * Copyright (c) Facebook, Inc. and its affiliates.
47
- *
48
- * This source code is licensed under the MIT license found in the
49
- * LICENSE file in the root directory of this source tree.
50
- */var NC;function c7(){return NC||(NC=1,process.env.NODE_ENV!=="production"&&function(){var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,s=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,d=e?Symbol.for("react.suspense"):60113,h=e?Symbol.for("react.suspense_list"):60120,f=e?Symbol.for("react.memo"):60115,p=e?Symbol.for("react.lazy"):60116,g=e?Symbol.for("react.block"):60121,b=e?Symbol.for("react.fundamental"):60117,v=e?Symbol.for("react.responder"):60118,x=e?Symbol.for("react.scope"):60119;function y(J){return typeof J=="string"||typeof J=="function"||J===r||J===c||J===i||J===o||J===d||J===h||typeof J=="object"&&J!==null&&(J.$$typeof===p||J.$$typeof===f||J.$$typeof===s||J.$$typeof===a||J.$$typeof===u||J.$$typeof===b||J.$$typeof===v||J.$$typeof===x||J.$$typeof===g)}function _(J){if(typeof J=="object"&&J!==null){var oe=J.$$typeof;switch(oe){case t:var ee=J.type;switch(ee){case l:case c:case r:case i:case o:case d:return ee;default:var ue=ee&&ee.$$typeof;switch(ue){case a:case u:case p:case f:case s:return ue;default:return oe}}case n:return oe}}}var w=l,C=c,R=a,k=s,D=t,I=u,T=r,N=p,G=f,z=n,O=i,A=o,L=d,j=!1;function B(J){return j||(j=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),M(J)||_(J)===l}function M(J){return _(J)===c}function W(J){return _(J)===a}function F(J){return _(J)===s}function P(J){return typeof J=="object"&&J!==null&&J.$$typeof===t}function U(J){return _(J)===u}function q(J){return _(J)===r}function K(J){return _(J)===p}function H(J){return _(J)===f}function V(J){return _(J)===n}function Q(J){return _(J)===i}function Z(J){return _(J)===o}function ne(J){return _(J)===d}lt.AsyncMode=w,lt.ConcurrentMode=C,lt.ContextConsumer=R,lt.ContextProvider=k,lt.Element=D,lt.ForwardRef=I,lt.Fragment=T,lt.Lazy=N,lt.Memo=G,lt.Portal=z,lt.Profiler=O,lt.StrictMode=A,lt.Suspense=L,lt.isAsyncMode=B,lt.isConcurrentMode=M,lt.isContextConsumer=W,lt.isContextProvider=F,lt.isElement=P,lt.isForwardRef=U,lt.isFragment=q,lt.isLazy=K,lt.isMemo=H,lt.isPortal=V,lt.isProfiler=Q,lt.isStrictMode=Z,lt.isSuspense=ne,lt.isValidElementType=y,lt.typeOf=_}()),lt}var jC;function gk(){return jC||(jC=1,process.env.NODE_ENV==="production"?sf.exports=l7():sf.exports=c7()),sf.exports}/*
51
- object-assign
52
- (c) Sindre Sorhus
53
- @license MIT
54
- */var Hm,FC;function u7(){if(FC)return Hm;FC=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(i){if(i==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(i)}function o(){try{if(!Object.assign)return!1;var i=new String("abc");if(i[5]="de",Object.getOwnPropertyNames(i)[0]==="5")return!1;for(var s={},a=0;a<10;a++)s["_"+String.fromCharCode(a)]=a;var l=Object.getOwnPropertyNames(s).map(function(u){return s[u]});if(l.join("")!=="0123456789")return!1;var c={};return"abcdefghijklmnopqrst".split("").forEach(function(u){c[u]=u}),Object.keys(Object.assign({},c)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return Hm=o()?Object.assign:function(i,s){for(var a,l=r(i),c,u=1;u<arguments.length;u++){a=Object(arguments[u]);for(var d in a)t.call(a,d)&&(l[d]=a[d]);if(e){c=e(a);for(var h=0;h<c.length;h++)n.call(a,c[h])&&(l[c[h]]=a[c[h]])}}return l},Hm}var Wm,LC;function Bx(){if(LC)return Wm;LC=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Wm=e,Wm}var Um,$C;function mk(){return $C||($C=1,Um=Function.call.bind(Object.prototype.hasOwnProperty)),Um}var qm,zC;function d7(){if(zC)return qm;zC=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=Bx(),n={},r=mk();e=function(i){var s="Warning: "+i;typeof console<"u"&&console.error(s);try{throw new Error(s)}catch{}}}function o(i,s,a,l,c){if(process.env.NODE_ENV!=="production"){for(var u in i)if(r(i,u)){var d;try{if(typeof i[u]!="function"){var h=Error((l||"React class")+": "+a+" type `"+u+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof i[u]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw h.name="Invariant Violation",h}d=i[u](s,u,l,a,null,t)}catch(p){d=p}if(d&&!(d instanceof Error)&&e((l||"React class")+": type specification of "+a+" `"+u+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof d+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),d instanceof Error&&!(d.message in n)){n[d.message]=!0;var f=c?c():"";e("Failed "+a+" type: "+d.message+(f??""))}}}}return o.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},qm=o,qm}var Gm,BC;function f7(){if(BC)return Gm;BC=1;var e=gk(),t=u7(),n=Bx(),r=mk(),o=d7(),i=function(){};process.env.NODE_ENV!=="production"&&(i=function(a){var l="Warning: "+a;typeof console<"u"&&console.error(l);try{throw new Error(l)}catch{}});function s(){return null}return Gm=function(a,l){var c=typeof Symbol=="function"&&Symbol.iterator,u="@@iterator";function d(M){var W=M&&(c&&M[c]||M[u]);if(typeof W=="function")return W}var h="<<anonymous>>",f={array:v("array"),bigint:v("bigint"),bool:v("boolean"),func:v("function"),number:v("number"),object:v("object"),string:v("string"),symbol:v("symbol"),any:x(),arrayOf:y,element:_(),elementType:w(),instanceOf:C,node:I(),objectOf:k,oneOf:R,oneOfType:D,shape:N,exact:G};function p(M,W){return M===W?M!==0||1/M===1/W:M!==M&&W!==W}function g(M,W){this.message=M,this.data=W&&typeof W=="object"?W:{},this.stack=""}g.prototype=Error.prototype;function b(M){if(process.env.NODE_ENV!=="production")var W={},F=0;function P(q,K,H,V,Q,Z,ne){if(V=V||h,Z=Z||H,ne!==n){if(l){var J=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw J.name="Invariant Violation",J}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var oe=V+":"+H;!W[oe]&&F<3&&(i("You are manually calling a React.PropTypes validation function for the `"+Z+"` prop on `"+V+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),W[oe]=!0,F++)}}return K[H]==null?q?K[H]===null?new g("The "+Q+" `"+Z+"` is marked as required "+("in `"+V+"`, but its value is `null`.")):new g("The "+Q+" `"+Z+"` is marked as required in "+("`"+V+"`, but its value is `undefined`.")):null:M(K,H,V,Q,Z)}var U=P.bind(null,!1);return U.isRequired=P.bind(null,!0),U}function v(M){function W(F,P,U,q,K,H){var V=F[P],Q=A(V);if(Q!==M){var Z=L(V);return new g("Invalid "+q+" `"+K+"` of type "+("`"+Z+"` supplied to `"+U+"`, expected ")+("`"+M+"`."),{expectedType:M})}return null}return b(W)}function x(){return b(s)}function y(M){function W(F,P,U,q,K){if(typeof M!="function")return new g("Property `"+K+"` of component `"+U+"` has invalid PropType notation inside arrayOf.");var H=F[P];if(!Array.isArray(H)){var V=A(H);return new g("Invalid "+q+" `"+K+"` of type "+("`"+V+"` supplied to `"+U+"`, expected an array."))}for(var Q=0;Q<H.length;Q++){var Z=M(H,Q,U,q,K+"["+Q+"]",n);if(Z instanceof Error)return Z}return null}return b(W)}function _(){function M(W,F,P,U,q){var K=W[F];if(!a(K)){var H=A(K);return new g("Invalid "+U+" `"+q+"` of type "+("`"+H+"` supplied to `"+P+"`, expected a single ReactElement."))}return null}return b(M)}function w(){function M(W,F,P,U,q){var K=W[F];if(!e.isValidElementType(K)){var H=A(K);return new g("Invalid "+U+" `"+q+"` of type "+("`"+H+"` supplied to `"+P+"`, expected a single ReactElement type."))}return null}return b(M)}function C(M){function W(F,P,U,q,K){if(!(F[P]instanceof M)){var H=M.name||h,V=B(F[P]);return new g("Invalid "+q+" `"+K+"` of type "+("`"+V+"` supplied to `"+U+"`, expected ")+("instance of `"+H+"`."))}return null}return b(W)}function R(M){if(!Array.isArray(M))return process.env.NODE_ENV!=="production"&&(arguments.length>1?i("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):i("Invalid argument supplied to oneOf, expected an array.")),s;function W(F,P,U,q,K){for(var H=F[P],V=0;V<M.length;V++)if(p(H,M[V]))return null;var Q=JSON.stringify(M,function(ne,J){var oe=L(J);return oe==="symbol"?String(J):J});return new g("Invalid "+q+" `"+K+"` of value `"+String(H)+"` "+("supplied to `"+U+"`, expected one of "+Q+"."))}return b(W)}function k(M){function W(F,P,U,q,K){if(typeof M!="function")return new g("Property `"+K+"` of component `"+U+"` has invalid PropType notation inside objectOf.");var H=F[P],V=A(H);if(V!=="object")return new g("Invalid "+q+" `"+K+"` of type "+("`"+V+"` supplied to `"+U+"`, expected an object."));for(var Q in H)if(r(H,Q)){var Z=M(H,Q,U,q,K+"."+Q,n);if(Z instanceof Error)return Z}return null}return b(W)}function D(M){if(!Array.isArray(M))return process.env.NODE_ENV!=="production"&&i("Invalid argument supplied to oneOfType, expected an instance of array."),s;for(var W=0;W<M.length;W++){var F=M[W];if(typeof F!="function")return i("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+j(F)+" at index "+W+"."),s}function P(U,q,K,H,V){for(var Q=[],Z=0;Z<M.length;Z++){var ne=M[Z],J=ne(U,q,K,H,V,n);if(J==null)return null;J.data&&r(J.data,"expectedType")&&Q.push(J.data.expectedType)}var oe=Q.length>0?", expected one of type ["+Q.join(", ")+"]":"";return new g("Invalid "+H+" `"+V+"` supplied to "+("`"+K+"`"+oe+"."))}return b(P)}function I(){function M(W,F,P,U,q){return z(W[F])?null:new g("Invalid "+U+" `"+q+"` supplied to "+("`"+P+"`, expected a ReactNode."))}return b(M)}function T(M,W,F,P,U){return new g((M||"React class")+": "+W+" type `"+F+"."+P+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+U+"`.")}function N(M){function W(F,P,U,q,K){var H=F[P],V=A(H);if(V!=="object")return new g("Invalid "+q+" `"+K+"` of type `"+V+"` "+("supplied to `"+U+"`, expected `object`."));for(var Q in M){var Z=M[Q];if(typeof Z!="function")return T(U,q,K,Q,L(Z));var ne=Z(H,Q,U,q,K+"."+Q,n);if(ne)return ne}return null}return b(W)}function G(M){function W(F,P,U,q,K){var H=F[P],V=A(H);if(V!=="object")return new g("Invalid "+q+" `"+K+"` of type `"+V+"` "+("supplied to `"+U+"`, expected `object`."));var Q=t({},F[P],M);for(var Z in Q){var ne=M[Z];if(r(M,Z)&&typeof ne!="function")return T(U,q,K,Z,L(ne));if(!ne)return new g("Invalid "+q+" `"+K+"` key `"+Z+"` supplied to `"+U+"`.\nBad object: "+JSON.stringify(F[P],null," ")+`
55
- Valid keys: `+JSON.stringify(Object.keys(M),null," "));var J=ne(H,Z,U,q,K+"."+Z,n);if(J)return J}return null}return b(W)}function z(M){switch(typeof M){case"number":case"string":case"undefined":return!0;case"boolean":return!M;case"object":if(Array.isArray(M))return M.every(z);if(M===null||a(M))return!0;var W=d(M);if(W){var F=W.call(M),P;if(W!==M.entries){for(;!(P=F.next()).done;)if(!z(P.value))return!1}else for(;!(P=F.next()).done;){var U=P.value;if(U&&!z(U[1]))return!1}}else return!1;return!0;default:return!1}}function O(M,W){return M==="symbol"?!0:W?W["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&W instanceof Symbol:!1}function A(M){var W=typeof M;return Array.isArray(M)?"array":M instanceof RegExp?"object":O(W,M)?"symbol":W}function L(M){if(typeof M>"u"||M===null)return""+M;var W=A(M);if(W==="object"){if(M instanceof Date)return"date";if(M instanceof RegExp)return"regexp"}return W}function j(M){var W=L(M);switch(W){case"array":case"object":return"an "+W;case"boolean":case"date":case"regexp":return"a "+W;default:return W}}function B(M){return!M.constructor||!M.constructor.name?h:M.constructor.name}return f.checkPropTypes=o,f.resetWarningCache=o.resetWarningCache,f.PropTypes=f,f},Gm}var Ym,VC;function h7(){if(VC)return Ym;VC=1;var e=Bx();function t(){}function n(){}return n.resetWarningCache=t,Ym=function(){function r(s,a,l,c,u,d){if(d!==e){var h=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw h.name="Invariant Violation",h}}r.isRequired=r;function o(){return r}var i={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:o,element:r,elementType:r,instanceOf:o,node:r,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:t};return i.PropTypes=i,i},Ym}if(process.env.NODE_ENV!=="production"){var p7=gk(),g7=!0;av.exports=f7()(p7.isElement,g7)}else av.exports=h7()();var Xi=av.exports,ng={exports:{}},bk={};function vk(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=vk(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function HC(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=vk(e))&&(r&&(r+=" "),r+=t);return r}const m7=Object.freeze(Object.defineProperty({__proto__:null,clsx:HC,default:HC},Symbol.toStringTag,{value:"Module"})),b7=sx(m7);var Ft={},Mo={};Object.defineProperty(Mo,"__esModule",{value:!0});Mo.dontSetMe=S7;Mo.findInArray=v7;Mo.int=w7;Mo.isFunction=y7;Mo.isNum=x7;function v7(e,t){for(let n=0,r=e.length;n<r;n++)if(t.apply(t,[e[n],n,e]))return e[n]}function y7(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Function]"}function x7(e){return typeof e=="number"&&!isNaN(e)}function w7(e){return parseInt(e,10)}function S7(e,t,n){if(e[t])return new Error("Invalid prop ".concat(t," passed to ").concat(n," - do not set this, set it on the child."))}var ma={};Object.defineProperty(ma,"__esModule",{value:!0});ma.browserPrefixToKey=xk;ma.browserPrefixToStyle=C7;ma.default=void 0;ma.getPrefix=yk;const Km=["Moz","Webkit","O","ms"];function yk(){var e;let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";const n=(e=window.document)===null||e===void 0||(e=e.documentElement)===null||e===void 0?void 0:e.style;if(!n||t in n)return"";for(let r=0;r<Km.length;r++)if(xk(t,Km[r])in n)return Km[r];return""}function xk(e,t){return t?"".concat(t).concat(_7(e)):e}function C7(e,t){return t?"-".concat(t.toLowerCase(),"-").concat(e):e}function _7(e){let t="",n=!0;for(let r=0;r<e.length;r++)n?(t+=e[r].toUpperCase(),n=!1):e[r]==="-"?n=!0:t+=e[r];return t}ma.default=yk();Object.defineProperty(Ft,"__esModule",{value:!0});Ft.addClassName=Ck;Ft.addEvent=P7;Ft.addUserSelectStyles=L7;Ft.createCSSTransform=A7;Ft.createSVGTransform=N7;Ft.getTouch=j7;Ft.getTouchIdentifier=F7;Ft.getTranslation=Vx;Ft.innerHeight=D7;Ft.innerWidth=T7;Ft.matchesSelector=Sk;Ft.matchesSelectorAndParentsTo=R7;Ft.offsetXYFromParent=I7;Ft.outerHeight=k7;Ft.outerWidth=O7;Ft.removeClassName=_k;Ft.removeEvent=M7;Ft.removeUserSelectStyles=$7;var fr=Mo,WC=E7(ma);function wk(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(wk=function(r){return r?n:t})(e)}function E7(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=wk(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}let af="";function Sk(e,t){return af||(af=(0,fr.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(n){return(0,fr.isFunction)(e[n])})),(0,fr.isFunction)(e[af])?e[af](t):!1}function R7(e,t,n){let r=e;do{if(Sk(r,t))return!0;if(r===n)return!1;r=r.parentNode}while(r);return!1}function P7(e,t,n,r){if(!e)return;const o={capture:!0,...r};e.addEventListener?e.addEventListener(t,n,o):e.attachEvent?e.attachEvent("on"+t,n):e["on"+t]=n}function M7(e,t,n,r){if(!e)return;const o={capture:!0,...r};e.removeEventListener?e.removeEventListener(t,n,o):e.detachEvent?e.detachEvent("on"+t,n):e["on"+t]=null}function k7(e){let t=e.clientHeight;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,fr.int)(n.borderTopWidth),t+=(0,fr.int)(n.borderBottomWidth),t}function O7(e){let t=e.clientWidth;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,fr.int)(n.borderLeftWidth),t+=(0,fr.int)(n.borderRightWidth),t}function D7(e){let t=e.clientHeight;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,fr.int)(n.paddingTop),t-=(0,fr.int)(n.paddingBottom),t}function T7(e){let t=e.clientWidth;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,fr.int)(n.paddingLeft),t-=(0,fr.int)(n.paddingRight),t}function I7(e,t,n){const o=t===t.ownerDocument.body?{left:0,top:0}:t.getBoundingClientRect(),i=(e.clientX+t.scrollLeft-o.left)/n,s=(e.clientY+t.scrollTop-o.top)/n;return{x:i,y:s}}function A7(e,t){const n=Vx(e,t,"px");return{[(0,WC.browserPrefixToKey)("transform",WC.default)]:n}}function N7(e,t){return Vx(e,t,"")}function Vx(e,t,n){let{x:r,y:o}=e,i="translate(".concat(r).concat(n,",").concat(o).concat(n,")");if(t){const s="".concat(typeof t.x=="string"?t.x:t.x+n),a="".concat(typeof t.y=="string"?t.y:t.y+n);i="translate(".concat(s,", ").concat(a,")")+i}return i}function j7(e,t){return e.targetTouches&&(0,fr.findInArray)(e.targetTouches,n=>t===n.identifier)||e.changedTouches&&(0,fr.findInArray)(e.changedTouches,n=>t===n.identifier)}function F7(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier}function L7(e){if(!e)return;let t=e.getElementById("react-draggable-style-el");t||(t=e.createElement("style"),t.type="text/css",t.id="react-draggable-style-el",t.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
56
- `,t.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
57
- `,e.getElementsByTagName("head")[0].appendChild(t)),e.body&&Ck(e.body,"react-draggable-transparent-selection")}function $7(e){if(e)try{if(e.body&&_k(e.body,"react-draggable-transparent-selection"),e.selection)e.selection.empty();else{const t=(e.defaultView||window).getSelection();t&&t.type!=="Caret"&&t.removeAllRanges()}}catch{}}function Ck(e,t){e.classList?e.classList.add(t):e.className.match(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)")))||(e.className+=" ".concat(t))}function _k(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)"),"g"),"")}var ko={};Object.defineProperty(ko,"__esModule",{value:!0});ko.canDragX=V7;ko.canDragY=H7;ko.createCoreData=U7;ko.createDraggableData=q7;ko.getBoundPosition=z7;ko.getControlPosition=W7;ko.snapToGrid=B7;var or=Mo,Ha=Ft;function z7(e,t,n){if(!e.props.bounds)return[t,n];let{bounds:r}=e.props;r=typeof r=="string"?r:G7(r);const o=Hx(e);if(typeof r=="string"){const{ownerDocument:i}=o,s=i.defaultView;let a;if(r==="parent"?a=o.parentNode:a=i.querySelector(r),!(a instanceof s.HTMLElement))throw new Error('Bounds selector "'+r+'" could not find an element.');const l=a,c=s.getComputedStyle(o),u=s.getComputedStyle(l);r={left:-o.offsetLeft+(0,or.int)(u.paddingLeft)+(0,or.int)(c.marginLeft),top:-o.offsetTop+(0,or.int)(u.paddingTop)+(0,or.int)(c.marginTop),right:(0,Ha.innerWidth)(l)-(0,Ha.outerWidth)(o)-o.offsetLeft+(0,or.int)(u.paddingRight)-(0,or.int)(c.marginRight),bottom:(0,Ha.innerHeight)(l)-(0,Ha.outerHeight)(o)-o.offsetTop+(0,or.int)(u.paddingBottom)-(0,or.int)(c.marginBottom)}}return(0,or.isNum)(r.right)&&(t=Math.min(t,r.right)),(0,or.isNum)(r.bottom)&&(n=Math.min(n,r.bottom)),(0,or.isNum)(r.left)&&(t=Math.max(t,r.left)),(0,or.isNum)(r.top)&&(n=Math.max(n,r.top)),[t,n]}function B7(e,t,n){const r=Math.round(t/e[0])*e[0],o=Math.round(n/e[1])*e[1];return[r,o]}function V7(e){return e.props.axis==="both"||e.props.axis==="x"}function H7(e){return e.props.axis==="both"||e.props.axis==="y"}function W7(e,t,n){const r=typeof t=="number"?(0,Ha.getTouch)(e,t):null;if(typeof t=="number"&&!r)return null;const o=Hx(n),i=n.props.offsetParent||o.offsetParent||o.ownerDocument.body;return(0,Ha.offsetXYFromParent)(r||e,i,n.props.scale)}function U7(e,t,n){const r=!(0,or.isNum)(e.lastX),o=Hx(e);return r?{node:o,deltaX:0,deltaY:0,lastX:t,lastY:n,x:t,y:n}:{node:o,deltaX:t-e.lastX,deltaY:n-e.lastY,lastX:e.lastX,lastY:e.lastY,x:t,y:n}}function q7(e,t){const n=e.props.scale;return{node:t.node,x:e.state.x+t.deltaX/n,y:e.state.y+t.deltaY/n,deltaX:t.deltaX/n,deltaY:t.deltaY/n,lastX:e.state.x,lastY:e.state.y}}function G7(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}function Hx(e){const t=e.findDOMNode();if(!t)throw new Error("<DraggableCore>: Unmounted during event!");return t}var rg={},og={};Object.defineProperty(og,"__esModule",{value:!0});og.default=Y7;function Y7(){}Object.defineProperty(rg,"__esModule",{value:!0});rg.default=void 0;var Xm=X7(E),An=Wx(Xi),K7=Wx(gn),cn=Ft,hi=ko,Qm=Mo,Sc=Wx(og);function Wx(e){return e&&e.__esModule?e:{default:e}}function Ek(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(Ek=function(r){return r?n:t})(e)}function X7(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=Ek(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function Sn(e,t,n){return t=Q7(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Q7(e){var t=J7(e,"string");return typeof t=="symbol"?t:String(t)}function J7(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const Ar={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let pi=Ar.mouse,ig=class extends Xm.Component{constructor(){super(...arguments),Sn(this,"dragging",!1),Sn(this,"lastX",NaN),Sn(this,"lastY",NaN),Sn(this,"touchIdentifier",null),Sn(this,"mounted",!1),Sn(this,"handleDragStart",t=>{if(this.props.onMouseDown(t),!this.props.allowAnyClick&&typeof t.button=="number"&&t.button!==0)return!1;const n=this.findDOMNode();if(!n||!n.ownerDocument||!n.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:r}=n;if(this.props.disabled||!(t.target instanceof r.defaultView.Node)||this.props.handle&&!(0,cn.matchesSelectorAndParentsTo)(t.target,this.props.handle,n)||this.props.cancel&&(0,cn.matchesSelectorAndParentsTo)(t.target,this.props.cancel,n))return;t.type==="touchstart"&&t.preventDefault();const o=(0,cn.getTouchIdentifier)(t);this.touchIdentifier=o;const i=(0,hi.getControlPosition)(t,o,this);if(i==null)return;const{x:s,y:a}=i,l=(0,hi.createCoreData)(this,s,a);(0,Sc.default)("DraggableCore: handleDragStart: %j",l),(0,Sc.default)("calling",this.props.onStart),!(this.props.onStart(t,l)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,cn.addUserSelectStyles)(r),this.dragging=!0,this.lastX=s,this.lastY=a,(0,cn.addEvent)(r,pi.move,this.handleDrag),(0,cn.addEvent)(r,pi.stop,this.handleDragStop))}),Sn(this,"handleDrag",t=>{const n=(0,hi.getControlPosition)(t,this.touchIdentifier,this);if(n==null)return;let{x:r,y:o}=n;if(Array.isArray(this.props.grid)){let a=r-this.lastX,l=o-this.lastY;if([a,l]=(0,hi.snapToGrid)(this.props.grid,a,l),!a&&!l)return;r=this.lastX+a,o=this.lastY+l}const i=(0,hi.createCoreData)(this,r,o);if((0,Sc.default)("DraggableCore: handleDrag: %j",i),this.props.onDrag(t,i)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const l=document.createEvent("MouseEvents");l.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(l)}return}this.lastX=r,this.lastY=o}),Sn(this,"handleDragStop",t=>{if(!this.dragging)return;const n=(0,hi.getControlPosition)(t,this.touchIdentifier,this);if(n==null)return;let{x:r,y:o}=n;if(Array.isArray(this.props.grid)){let l=r-this.lastX||0,c=o-this.lastY||0;[l,c]=(0,hi.snapToGrid)(this.props.grid,l,c),r=this.lastX+l,o=this.lastY+c}const i=(0,hi.createCoreData)(this,r,o);if(this.props.onStop(t,i)===!1||this.mounted===!1)return!1;const a=this.findDOMNode();a&&this.props.enableUserSelectHack&&(0,cn.removeUserSelectStyles)(a.ownerDocument),(0,Sc.default)("DraggableCore: handleDragStop: %j",i),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,a&&((0,Sc.default)("DraggableCore: Removing handlers"),(0,cn.removeEvent)(a.ownerDocument,pi.move,this.handleDrag),(0,cn.removeEvent)(a.ownerDocument,pi.stop,this.handleDragStop))}),Sn(this,"onMouseDown",t=>(pi=Ar.mouse,this.handleDragStart(t))),Sn(this,"onMouseUp",t=>(pi=Ar.mouse,this.handleDragStop(t))),Sn(this,"onTouchStart",t=>(pi=Ar.touch,this.handleDragStart(t))),Sn(this,"onTouchEnd",t=>(pi=Ar.touch,this.handleDragStop(t)))}componentDidMount(){this.mounted=!0;const t=this.findDOMNode();t&&(0,cn.addEvent)(t,Ar.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const t=this.findDOMNode();if(t){const{ownerDocument:n}=t;(0,cn.removeEvent)(n,Ar.mouse.move,this.handleDrag),(0,cn.removeEvent)(n,Ar.touch.move,this.handleDrag),(0,cn.removeEvent)(n,Ar.mouse.stop,this.handleDragStop),(0,cn.removeEvent)(n,Ar.touch.stop,this.handleDragStop),(0,cn.removeEvent)(t,Ar.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,cn.removeUserSelectStyles)(n)}}findDOMNode(){var t,n;return(t=this.props)!==null&&t!==void 0&&t.nodeRef?(n=this.props)===null||n===void 0||(n=n.nodeRef)===null||n===void 0?void 0:n.current:K7.default.findDOMNode(this)}render(){return Xm.cloneElement(Xm.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};rg.default=ig;Sn(ig,"displayName","DraggableCore");Sn(ig,"propTypes",{allowAnyClick:An.default.bool,children:An.default.node.isRequired,disabled:An.default.bool,enableUserSelectHack:An.default.bool,offsetParent:function(e,t){if(e[t]&&e[t].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:An.default.arrayOf(An.default.number),handle:An.default.string,cancel:An.default.string,nodeRef:An.default.object,onStart:An.default.func,onDrag:An.default.func,onStop:An.default.func,onMouseDown:An.default.func,scale:An.default.number,className:Qm.dontSetMe,style:Qm.dontSetMe,transform:Qm.dontSetMe});Sn(ig,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1});(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"DraggableCore",{enumerable:!0,get:function(){return l.default}}),e.default=void 0;var t=h(E),n=u(Xi),r=u(gn),o=u(b7),i=Ft,s=ko,a=Mo,l=u(rg),c=u(og);function u(x){return x&&x.__esModule?x:{default:x}}function d(x){if(typeof WeakMap!="function")return null;var y=new WeakMap,_=new WeakMap;return(d=function(w){return w?_:y})(x)}function h(x,y){if(x&&x.__esModule)return x;if(x===null||typeof x!="object"&&typeof x!="function")return{default:x};var _=d(y);if(_&&_.has(x))return _.get(x);var w={},C=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var R in x)if(R!=="default"&&Object.prototype.hasOwnProperty.call(x,R)){var k=C?Object.getOwnPropertyDescriptor(x,R):null;k&&(k.get||k.set)?Object.defineProperty(w,R,k):w[R]=x[R]}return w.default=x,_&&_.set(x,w),w}function f(){return f=Object.assign?Object.assign.bind():function(x){for(var y=1;y<arguments.length;y++){var _=arguments[y];for(var w in _)Object.prototype.hasOwnProperty.call(_,w)&&(x[w]=_[w])}return x},f.apply(this,arguments)}function p(x,y,_){return y=g(y),y in x?Object.defineProperty(x,y,{value:_,enumerable:!0,configurable:!0,writable:!0}):x[y]=_,x}function g(x){var y=b(x,"string");return typeof y=="symbol"?y:String(y)}function b(x,y){if(typeof x!="object"||x===null)return x;var _=x[Symbol.toPrimitive];if(_!==void 0){var w=_.call(x,y);if(typeof w!="object")return w;throw new TypeError("@@toPrimitive must return a primitive value.")}return(y==="string"?String:Number)(x)}class v extends t.Component{static getDerivedStateFromProps(y,_){let{position:w}=y,{prevPropsPosition:C}=_;return w&&(!C||w.x!==C.x||w.y!==C.y)?((0,c.default)("Draggable: getDerivedStateFromProps %j",{position:w,prevPropsPosition:C}),{x:w.x,y:w.y,prevPropsPosition:{...w}}):null}constructor(y){super(y),p(this,"onDragStart",(_,w)=>{if((0,c.default)("Draggable: onDragStart: %j",w),this.props.onStart(_,(0,s.createDraggableData)(this,w))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),p(this,"onDrag",(_,w)=>{if(!this.state.dragging)return!1;(0,c.default)("Draggable: onDrag: %j",w);const C=(0,s.createDraggableData)(this,w),R={x:C.x,y:C.y,slackX:0,slackY:0};if(this.props.bounds){const{x:D,y:I}=R;R.x+=this.state.slackX,R.y+=this.state.slackY;const[T,N]=(0,s.getBoundPosition)(this,R.x,R.y);R.x=T,R.y=N,R.slackX=this.state.slackX+(D-R.x),R.slackY=this.state.slackY+(I-R.y),C.x=R.x,C.y=R.y,C.deltaX=R.x-this.state.x,C.deltaY=R.y-this.state.y}if(this.props.onDrag(_,C)===!1)return!1;this.setState(R)}),p(this,"onDragStop",(_,w)=>{if(!this.state.dragging||this.props.onStop(_,(0,s.createDraggableData)(this,w))===!1)return!1;(0,c.default)("Draggable: onDragStop: %j",w);const R={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:D,y:I}=this.props.position;R.x=D,R.y=I}this.setState(R)}),this.state={dragging:!1,dragged:!1,x:y.position?y.position.x:y.defaultPosition.x,y:y.position?y.position.y:y.defaultPosition.y,prevPropsPosition:{...y.position},slackX:0,slackY:0,isElementSVG:!1},y.position&&!(y.onDrag||y.onStop)&&console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){typeof window.SVGElement<"u"&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.setState({dragging:!1})}findDOMNode(){var y,_;return(y=(_=this.props)===null||_===void 0||(_=_.nodeRef)===null||_===void 0?void 0:_.current)!==null&&y!==void 0?y:r.default.findDOMNode(this)}render(){const{axis:y,bounds:_,children:w,defaultPosition:C,defaultClassName:R,defaultClassNameDragging:k,defaultClassNameDragged:D,position:I,positionOffset:T,scale:N,...G}=this.props;let z={},O=null;const L=!!!I||this.state.dragging,j=I||C,B={x:(0,s.canDragX)(this)&&L?this.state.x:j.x,y:(0,s.canDragY)(this)&&L?this.state.y:j.y};this.state.isElementSVG?O=(0,i.createSVGTransform)(B,T):z=(0,i.createCSSTransform)(B,T);const M=(0,o.default)(w.props.className||"",R,{[k]:this.state.dragging,[D]:this.state.dragged});return t.createElement(l.default,f({},G,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),t.cloneElement(t.Children.only(w),{className:M,style:{...w.props.style,...z},transform:O}))}}e.default=v,p(v,"displayName","Draggable"),p(v,"propTypes",{...l.default.propTypes,axis:n.default.oneOf(["both","x","y","none"]),bounds:n.default.oneOfType([n.default.shape({left:n.default.number,right:n.default.number,top:n.default.number,bottom:n.default.number}),n.default.string,n.default.oneOf([!1])]),defaultClassName:n.default.string,defaultClassNameDragging:n.default.string,defaultClassNameDragged:n.default.string,defaultPosition:n.default.shape({x:n.default.number,y:n.default.number}),positionOffset:n.default.shape({x:n.default.oneOfType([n.default.number,n.default.string]),y:n.default.oneOfType([n.default.number,n.default.string])}),position:n.default.shape({x:n.default.number,y:n.default.number}),className:a.dontSetMe,style:a.dontSetMe,transform:a.dontSetMe}),p(v,"defaultProps",{...l.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})})(bk);const{default:Rk,DraggableCore:Z7}=bk;ng.exports=Rk;ng.exports.default=Rk;ng.exports.DraggableCore=Z7;var Pk=ng.exports,sg={exports:{}},gd={},Ux={};Ux.__esModule=!0;Ux.cloneElement=i9;var e9=t9(E);function t9(e){return e&&e.__esModule?e:{default:e}}function UC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function qC(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?UC(Object(n),!0).forEach(function(r){n9(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):UC(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function n9(e,t,n){return t=r9(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r9(e){var t=o9(e,"string");return typeof t=="symbol"?t:String(t)}function o9(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function i9(e,t){return t.style&&e.props.style&&(t.style=qC(qC({},e.props.style),t.style)),t.className&&e.props.className&&(t.className=e.props.className+" "+t.className),e9.default.cloneElement(e,t)}var md={};md.__esModule=!0;md.resizableProps=void 0;var $e=s9(Xi);function s9(e){return e&&e.__esModule?e:{default:e}}var a9={axis:$e.default.oneOf(["both","x","y","none"]),className:$e.default.string,children:$e.default.element.isRequired,draggableOpts:$e.default.shape({allowAnyClick:$e.default.bool,cancel:$e.default.string,children:$e.default.node,disabled:$e.default.bool,enableUserSelectHack:$e.default.bool,offsetParent:$e.default.node,grid:$e.default.arrayOf($e.default.number),handle:$e.default.string,nodeRef:$e.default.object,onStart:$e.default.func,onDrag:$e.default.func,onStop:$e.default.func,onMouseDown:$e.default.func,scale:$e.default.number}),height:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var o=n[0];if(o.axis==="both"||o.axis==="y"){var i;return(i=$e.default.number).isRequired.apply(i,n)}return $e.default.number.apply($e.default,n)},handle:$e.default.oneOfType([$e.default.node,$e.default.func]),handleSize:$e.default.arrayOf($e.default.number),lockAspectRatio:$e.default.bool,maxConstraints:$e.default.arrayOf($e.default.number),minConstraints:$e.default.arrayOf($e.default.number),onResizeStop:$e.default.func,onResizeStart:$e.default.func,onResize:$e.default.func,resizeHandles:$e.default.arrayOf($e.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:$e.default.number,width:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var o=n[0];if(o.axis==="both"||o.axis==="x"){var i;return(i=$e.default.number).isRequired.apply(i,n)}return $e.default.number.apply($e.default,n)}};md.resizableProps=a9;gd.__esModule=!0;gd.default=void 0;var Cc=f9(E),l9=Pk,c9=Ux,u9=md,d9=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function Mk(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(Mk=function(o){return o?n:t})(e)}function f9(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=Mk(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function lv(){return lv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},lv.apply(this,arguments)}function h9(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}function GC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Jm(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?GC(Object(n),!0).forEach(function(r){p9(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):GC(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function p9(e,t,n){return t=g9(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function g9(e){var t=m9(e,"string");return typeof t=="symbol"?t:String(t)}function m9(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function b9(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,cv(e,t)}function cv(e,t){return cv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},cv(e,t)}var qx=function(e){b9(t,e);function t(){for(var r,o=arguments.length,i=new Array(o),s=0;s<o;s++)i[s]=arguments[s];return r=e.call.apply(e,[this].concat(i))||this,r.handleRefs={},r.lastHandleRect=null,r.slack=null,r}var n=t.prototype;return n.componentWillUnmount=function(){this.resetData()},n.resetData=function(){this.lastHandleRect=this.slack=null},n.runConstraints=function(o,i){var s=this.props,a=s.minConstraints,l=s.maxConstraints,c=s.lockAspectRatio;if(!a&&!l&&!c)return[o,i];if(c){var u=this.props.width/this.props.height,d=o-this.props.width,h=i-this.props.height;Math.abs(d)>Math.abs(h*u)?i=o/u:o=i*u}var f=o,p=i,g=this.slack||[0,0],b=g[0],v=g[1];return o+=b,i+=v,a&&(o=Math.max(a[0],o),i=Math.max(a[1],i)),l&&(o=Math.min(l[0],o),i=Math.min(l[1],i)),this.slack=[b+(f-o),v+(p-i)],[o,i]},n.resizeHandler=function(o,i){var s=this;return function(a,l){var c=l.node,u=l.deltaX,d=l.deltaY;o==="onResizeStart"&&s.resetData();var h=(s.props.axis==="both"||s.props.axis==="x")&&i!=="n"&&i!=="s",f=(s.props.axis==="both"||s.props.axis==="y")&&i!=="e"&&i!=="w";if(!(!h&&!f)){var p=i[0],g=i[i.length-1],b=c.getBoundingClientRect();if(s.lastHandleRect!=null){if(g==="w"){var v=b.left-s.lastHandleRect.left;u+=v}if(p==="n"){var x=b.top-s.lastHandleRect.top;d+=x}}s.lastHandleRect=b,g==="w"&&(u=-u),p==="n"&&(d=-d);var y=s.props.width+(h?u/s.props.transformScale:0),_=s.props.height+(f?d/s.props.transformScale:0),w=s.runConstraints(y,_);y=w[0],_=w[1];var C=y!==s.props.width||_!==s.props.height,R=typeof s.props[o]=="function"?s.props[o]:null,k=o==="onResize"&&!C;R&&!k&&(a.persist==null||a.persist(),R(a,{node:c,size:{width:y,height:_},handle:i})),o==="onResizeStop"&&s.resetData()}}},n.renderResizeHandle=function(o,i){var s=this.props.handle;if(!s)return Cc.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+o,ref:i});if(typeof s=="function")return s(o,i);var a=typeof s.type=="string",l=Jm({ref:i},a?{}:{handleAxis:o});return Cc.cloneElement(s,l)},n.render=function(){var o=this,i=this.props,s=i.children,a=i.className,l=i.draggableOpts;i.width,i.height,i.handle,i.handleSize,i.lockAspectRatio,i.axis,i.minConstraints,i.maxConstraints,i.onResize,i.onResizeStop,i.onResizeStart;var c=i.resizeHandles;i.transformScale;var u=h9(i,d9);return(0,c9.cloneElement)(s,Jm(Jm({},u),{},{className:(a?a+" ":"")+"react-resizable",children:[].concat(s.props.children,c.map(function(d){var h,f=(h=o.handleRefs[d])!=null?h:o.handleRefs[d]=Cc.createRef();return Cc.createElement(l9.DraggableCore,lv({},l,{nodeRef:f,key:"resizableHandle-"+d,onStop:o.resizeHandler("onResizeStop",d),onStart:o.resizeHandler("onResizeStart",d),onDrag:o.resizeHandler("onResize",d)}),o.renderResizeHandle(d,f))}))}))},t}(Cc.Component);gd.default=qx;qx.propTypes=u9.resizableProps;qx.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1};var ag={};ag.__esModule=!0;ag.default=void 0;var Zm=S9(E),v9=kk(Xi),y9=kk(gd),x9=md,w9=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function kk(e){return e&&e.__esModule?e:{default:e}}function Ok(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(Ok=function(o){return o?n:t})(e)}function S9(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=Ok(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function uv(){return uv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},uv.apply(this,arguments)}function YC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Fh(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?YC(Object(n),!0).forEach(function(r){C9(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):YC(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function C9(e,t,n){return t=_9(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _9(e){var t=E9(e,"string");return typeof t=="symbol"?t:String(t)}function E9(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function R9(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}function P9(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,dv(e,t)}function dv(e,t){return dv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},dv(e,t)}var Dk=function(e){P9(t,e);function t(){for(var r,o=arguments.length,i=new Array(o),s=0;s<o;s++)i[s]=arguments[s];return r=e.call.apply(e,[this].concat(i))||this,r.state={width:r.props.width,height:r.props.height,propsWidth:r.props.width,propsHeight:r.props.height},r.onResize=function(a,l){var c=l.size;r.props.onResize?(a.persist==null||a.persist(),r.setState(c,function(){return r.props.onResize&&r.props.onResize(a,l)})):r.setState(c)},r}t.getDerivedStateFromProps=function(o,i){return i.propsWidth!==o.width||i.propsHeight!==o.height?{width:o.width,height:o.height,propsWidth:o.width,propsHeight:o.height}:null};var n=t.prototype;return n.render=function(){var o=this.props,i=o.handle,s=o.handleSize;o.onResize;var a=o.onResizeStart,l=o.onResizeStop,c=o.draggableOpts,u=o.minConstraints,d=o.maxConstraints,h=o.lockAspectRatio,f=o.axis;o.width,o.height;var p=o.resizeHandles,g=o.style,b=o.transformScale,v=R9(o,w9);return Zm.createElement(y9.default,{axis:f,draggableOpts:c,handle:i,handleSize:s,height:this.state.height,lockAspectRatio:h,maxConstraints:d,minConstraints:u,onResizeStart:a,onResize:this.onResize,onResizeStop:l,resizeHandles:p,transformScale:b,width:this.state.width},Zm.createElement("div",uv({},v,{style:Fh(Fh({},g),{},{width:this.state.width+"px",height:this.state.height+"px"})})))},t}(Zm.Component);ag.default=Dk;Dk.propTypes=Fh(Fh({},x9.resizableProps),{},{children:v9.default.element});sg.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")};sg.exports.Resizable=gd.default;sg.exports.ResizableBox=ag.default;var M9=sg.exports,ni={};Object.defineProperty(ni,"__esModule",{value:!0});ni.resizeHandleType=ni.resizeHandleAxesType=ni.default=void 0;var ze=Tk(Xi),k9=Tk(E);function Tk(e){return e&&e.__esModule?e:{default:e}}const O9=ni.resizeHandleAxesType=ze.default.arrayOf(ze.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),D9=ni.resizeHandleType=ze.default.oneOfType([ze.default.node,ze.default.func]);ni.default={className:ze.default.string,style:ze.default.object,width:ze.default.number,autoSize:ze.default.bool,cols:ze.default.number,draggableCancel:ze.default.string,draggableHandle:ze.default.string,verticalCompact:function(e){e.verticalCompact===!1&&process.env.NODE_ENV!=="production"&&console.warn('`verticalCompact` on <ReactGridLayout> is deprecated and will be removed soon. Use `compactType`: "horizontal" | "vertical" | null.')},compactType:ze.default.oneOf(["vertical","horizontal"]),layout:function(e){var t=e.layout;t!==void 0&&We.validateLayout(t,"layout")},margin:ze.default.arrayOf(ze.default.number),containerPadding:ze.default.arrayOf(ze.default.number),rowHeight:ze.default.number,maxRows:ze.default.number,isBounded:ze.default.bool,isDraggable:ze.default.bool,isResizable:ze.default.bool,allowOverlap:ze.default.bool,preventCollision:ze.default.bool,useCSSTransforms:ze.default.bool,transformScale:ze.default.number,isDroppable:ze.default.bool,resizeHandles:O9,resizeHandle:D9,onLayoutChange:ze.default.func,onDragStart:ze.default.func,onDrag:ze.default.func,onDragStop:ze.default.func,onResizeStart:ze.default.func,onResize:ze.default.func,onResizeStop:ze.default.func,onDrop:ze.default.func,droppingItem:ze.default.shape({i:ze.default.string.isRequired,w:ze.default.number.isRequired,h:ze.default.number.isRequired}),children:function(e,t){const n=e[t],r={};k9.default.Children.forEach(n,function(o){if((o==null?void 0:o.key)!=null){if(r[o.key])throw new Error('Duplicate child key "'+o.key+'" found! This will cause problems in ReactGridLayout.');r[o.key]=!0}})},innerRef:ze.default.any};Object.defineProperty(tg,"__esModule",{value:!0});tg.default=void 0;var Pa=Gx(E),nt=Gx(Xi),T9=Pk,I9=M9,Ma=We,en=Po,KC=ni,A9=Gx(Dx);function Gx(e){return e&&e.__esModule?e:{default:e}}function eo(e,t,n){return t=N9(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function N9(e){var t=j9(e,"string");return typeof t=="symbol"?t:String(t)}function j9(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}class Yx extends Pa.default.Component{constructor(){super(...arguments),eo(this,"state",{resizing:null,dragging:null,className:""}),eo(this,"elementRef",Pa.default.createRef()),eo(this,"onDragStart",(t,n)=>{let{node:r}=n;const{onDragStart:o,transformScale:i}=this.props;if(!o)return;const s={top:0,left:0},{offsetParent:a}=r;if(!a)return;const l=a.getBoundingClientRect(),c=r.getBoundingClientRect(),u=c.left/i,d=l.left/i,h=c.top/i,f=l.top/i;s.left=u-d+a.scrollLeft,s.top=h-f+a.scrollTop,this.setState({dragging:s});const{x:p,y:g}=(0,en.calcXY)(this.getPositionParams(),s.top,s.left,this.props.w,this.props.h);return o.call(this,this.props.i,p,g,{e:t,node:r,newPosition:s})}),eo(this,"onDrag",(t,n)=>{let{node:r,deltaX:o,deltaY:i}=n;const{onDrag:s}=this.props;if(!s)return;if(!this.state.dragging)throw new Error("onDrag called before onDragStart.");let a=this.state.dragging.top+i,l=this.state.dragging.left+o;const{isBounded:c,i:u,w:d,h,containerWidth:f}=this.props,p=this.getPositionParams();if(c){const{offsetParent:x}=r;if(x){const{margin:y,rowHeight:_,containerPadding:w}=this.props,C=x.clientHeight-(0,en.calcGridItemWHPx)(h,_,y[1]);a=(0,en.clamp)(a-w[1],0,C);const R=(0,en.calcGridColWidth)(p),k=f-(0,en.calcGridItemWHPx)(d,R,y[0]);l=(0,en.clamp)(l-w[0],0,k)}}const g={top:a,left:l};this.setState({dragging:g});const{x:b,y:v}=(0,en.calcXY)(p,a,l,d,h);return s.call(this,u,b,v,{e:t,node:r,newPosition:g})}),eo(this,"onDragStop",(t,n)=>{let{node:r}=n;const{onDragStop:o}=this.props;if(!o)return;if(!this.state.dragging)throw new Error("onDragEnd called before onDragStart.");const{w:i,h:s,i:a}=this.props,{left:l,top:c}=this.state.dragging,u={top:c,left:l};this.setState({dragging:null});const{x:d,y:h}=(0,en.calcXY)(this.getPositionParams(),c,l,i,s);return o.call(this,a,d,h,{e:t,node:r,newPosition:u})}),eo(this,"onResizeStop",(t,n,r)=>this.onResizeHandler(t,n,r,"onResizeStop")),eo(this,"onResizeStart",(t,n,r)=>this.onResizeHandler(t,n,r,"onResizeStart")),eo(this,"onResize",(t,n,r)=>this.onResizeHandler(t,n,r,"onResize"))}shouldComponentUpdate(t,n){if(this.props.children!==t.children||this.props.droppingPosition!==t.droppingPosition)return!0;const r=(0,en.calcGridItemPosition)(this.getPositionParams(this.props),this.props.x,this.props.y,this.props.w,this.props.h,this.state),o=(0,en.calcGridItemPosition)(this.getPositionParams(t),t.x,t.y,t.w,t.h,n);return!(0,Ma.fastPositionEqual)(r,o)||this.props.useCSSTransforms!==t.useCSSTransforms}componentDidMount(){this.moveDroppingItem({})}componentDidUpdate(t){this.moveDroppingItem(t)}moveDroppingItem(t){const{droppingPosition:n}=this.props;if(!n)return;const r=this.elementRef.current;if(!r)return;const o=t.droppingPosition||{left:0,top:0},{dragging:i}=this.state,s=i&&n.left!==o.left||n.top!==o.top;if(!i)this.onDragStart(n.e,{node:r,deltaX:n.left,deltaY:n.top});else if(s){const a=n.left-i.left,l=n.top-i.top;this.onDrag(n.e,{node:r,deltaX:a,deltaY:l})}}getPositionParams(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.props;return{cols:t.cols,containerPadding:t.containerPadding,containerWidth:t.containerWidth,margin:t.margin,maxRows:t.maxRows,rowHeight:t.rowHeight}}createStyle(t){const{usePercentages:n,containerWidth:r,useCSSTransforms:o}=this.props;let i;return o?i=(0,Ma.setTransform)(t):(i=(0,Ma.setTopLeft)(t),n&&(i.left=(0,Ma.perc)(t.left/r),i.width=(0,Ma.perc)(t.width/r))),i}mixinDraggable(t,n){return Pa.default.createElement(T9.DraggableCore,{disabled:!n,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop,handle:this.props.handle,cancel:".react-resizable-handle"+(this.props.cancel?","+this.props.cancel:""),scale:this.props.transformScale,nodeRef:this.elementRef},t)}curryResizeHandler(t,n){return(r,o)=>n(r,o,t)}mixinResizable(t,n,r){const{cols:o,minW:i,minH:s,maxW:a,maxH:l,transformScale:c,resizeHandles:u,resizeHandle:d}=this.props,h=this.getPositionParams(),f=(0,en.calcGridItemPosition)(h,0,0,o,0).width,p=(0,en.calcGridItemPosition)(h,0,0,i,s),g=(0,en.calcGridItemPosition)(h,0,0,a,l),b=[p.width,p.height],v=[Math.min(g.width,f),Math.min(g.height,1/0)];return Pa.default.createElement(I9.Resizable,{draggableOpts:{disabled:!r},className:r?void 0:"react-resizable-hide",width:n.width,height:n.height,minConstraints:b,maxConstraints:v,onResizeStop:this.curryResizeHandler(n,this.onResizeStop),onResizeStart:this.curryResizeHandler(n,this.onResizeStart),onResize:this.curryResizeHandler(n,this.onResize),transformScale:c,resizeHandles:u,handle:d},t)}onResizeHandler(t,n,r,o){let{node:i,size:s,handle:a}=n;const l=this.props[o];if(!l)return;const{x:c,y:u,i:d,maxH:h,minH:f,containerWidth:p}=this.props,{minW:g,maxW:b}=this.props;let v=s;i&&(v=(0,Ma.resizeItemInDirection)(a,r,s,p),this.setState({resizing:o==="onResizeStop"?null:v}));let{w:x,h:y}=(0,en.calcWH)(this.getPositionParams(),v.width,v.height,c,u,a);x=(0,en.clamp)(x,Math.max(g,1),b),y=(0,en.clamp)(y,f,h),l.call(this,d,x,y,{e:t,node:i,size:v,handle:a})}render(){const{x:t,y:n,w:r,h:o,isDraggable:i,isResizable:s,droppingPosition:a,useCSSTransforms:l}=this.props,c=(0,en.calcGridItemPosition)(this.getPositionParams(),t,n,r,o,this.state),u=Pa.default.Children.only(this.props.children);let d=Pa.default.cloneElement(u,{ref:this.elementRef,className:(0,A9.default)("react-grid-item",u.props.className,this.props.className,{static:this.props.static,resizing:!!this.state.resizing,"react-draggable":i,"react-draggable-dragging":!!this.state.dragging,dropping:!!a,cssTransforms:l}),style:{...this.props.style,...u.props.style,...this.createStyle(c)}});return d=this.mixinResizable(d,c,s),d=this.mixinDraggable(d,i),d}}tg.default=Yx;eo(Yx,"propTypes",{children:nt.default.element,cols:nt.default.number.isRequired,containerWidth:nt.default.number.isRequired,rowHeight:nt.default.number.isRequired,margin:nt.default.array.isRequired,maxRows:nt.default.number.isRequired,containerPadding:nt.default.array.isRequired,x:nt.default.number.isRequired,y:nt.default.number.isRequired,w:nt.default.number.isRequired,h:nt.default.number.isRequired,minW:function(e,t){const n=e[t];if(typeof n!="number")return new Error("minWidth not Number");if(n>e.w||n>e.maxW)return new Error("minWidth larger than item width/maxWidth")},maxW:function(e,t){const n=e[t];if(typeof n!="number")return new Error("maxWidth not Number");if(n<e.w||n<e.minW)return new Error("maxWidth smaller than item width/minWidth")},minH:function(e,t){const n=e[t];if(typeof n!="number")return new Error("minHeight not Number");if(n>e.h||n>e.maxH)return new Error("minHeight larger than item height/maxHeight")},maxH:function(e,t){const n=e[t];if(typeof n!="number")return new Error("maxHeight not Number");if(n<e.h||n<e.minH)return new Error("maxHeight smaller than item height/minHeight")},i:nt.default.string.isRequired,resizeHandles:KC.resizeHandleAxesType,resizeHandle:KC.resizeHandleType,onDragStop:nt.default.func,onDragStart:nt.default.func,onDrag:nt.default.func,onResizeStop:nt.default.func,onResizeStart:nt.default.func,onResize:nt.default.func,isDraggable:nt.default.bool.isRequired,isResizable:nt.default.bool.isRequired,isBounded:nt.default.bool.isRequired,static:nt.default.bool,useCSSTransforms:nt.default.bool.isRequired,transformScale:nt.default.number,className:nt.default.string,handle:nt.default.string,cancel:nt.default.string,droppingPosition:nt.default.shape({e:nt.default.object.isRequired,left:nt.default.number.isRequired,top:nt.default.number.isRequired})});eo(Yx,"defaultProps",{className:"",cancel:"",handle:"",minH:1,minW:1,maxH:1/0,maxW:1/0,transformScale:1});Object.defineProperty(pd,"__esModule",{value:!0});pd.default=void 0;var ss=z9(E),eb=Ox,F9=Kx(Dx),Me=We,L9=Po,XC=Kx(tg),$9=Kx(ni);function Kx(e){return e&&e.__esModule?e:{default:e}}function Ik(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(Ik=function(r){return r?n:t})(e)}function z9(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=Ik(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function dn(e,t,n){return t=B9(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function B9(e){var t=V9(e,"string");return typeof t=="symbol"?t:String(t)}function V9(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const QC="react-grid-layout";let Ak=!1;try{Ak=/firefox/i.test(navigator.userAgent)}catch{}class lg extends ss.Component{constructor(){super(...arguments),dn(this,"state",{activeDrag:null,layout:(0,Me.synchronizeLayoutWithChildren)(this.props.layout,this.props.children,this.props.cols,(0,Me.compactType)(this.props),this.props.allowOverlap),mounted:!1,oldDragItem:null,oldLayout:null,oldResizeItem:null,resizing:!1,droppingDOMNode:null,children:[]}),dn(this,"dragEnterCounter",0),dn(this,"onDragStart",(t,n,r,o)=>{let{e:i,node:s}=o;const{layout:a}=this.state,l=(0,Me.getLayoutItem)(a,t);if(!l)return;const c={w:l.w,h:l.h,x:l.x,y:l.y,placeholder:!0,i:t};return this.setState({oldDragItem:(0,Me.cloneLayoutItem)(l),oldLayout:a,activeDrag:c}),this.props.onDragStart(a,l,l,null,i,s)}),dn(this,"onDrag",(t,n,r,o)=>{let{e:i,node:s}=o;const{oldDragItem:a}=this.state;let{layout:l}=this.state;const{cols:c,allowOverlap:u,preventCollision:d}=this.props,h=(0,Me.getLayoutItem)(l,t);if(!h)return;const f={w:h.w,h:h.h,x:h.x,y:h.y,placeholder:!0,i:t};l=(0,Me.moveElement)(l,h,n,r,!0,d,(0,Me.compactType)(this.props),c,u),this.props.onDrag(l,a,h,f,i,s),this.setState({layout:u?l:(0,Me.compact)(l,(0,Me.compactType)(this.props),c),activeDrag:f})}),dn(this,"onDragStop",(t,n,r,o)=>{let{e:i,node:s}=o;if(!this.state.activeDrag)return;const{oldDragItem:a}=this.state;let{layout:l}=this.state;const{cols:c,preventCollision:u,allowOverlap:d}=this.props,h=(0,Me.getLayoutItem)(l,t);if(!h)return;l=(0,Me.moveElement)(l,h,n,r,!0,u,(0,Me.compactType)(this.props),c,d);const p=d?l:(0,Me.compact)(l,(0,Me.compactType)(this.props),c);this.props.onDragStop(p,a,h,null,i,s);const{oldLayout:g}=this.state;this.setState({activeDrag:null,layout:p,oldDragItem:null,oldLayout:null}),this.onLayoutMaybeChanged(p,g)}),dn(this,"onResizeStart",(t,n,r,o)=>{let{e:i,node:s}=o;const{layout:a}=this.state,l=(0,Me.getLayoutItem)(a,t);l&&(this.setState({oldResizeItem:(0,Me.cloneLayoutItem)(l),oldLayout:this.state.layout,resizing:!0}),this.props.onResizeStart(a,l,l,null,i,s))}),dn(this,"onResize",(t,n,r,o)=>{let{e:i,node:s,size:a,handle:l}=o;const{oldResizeItem:c}=this.state,{layout:u}=this.state,{cols:d,preventCollision:h,allowOverlap:f}=this.props;let p=!1,g,b,v;const[x,y]=(0,Me.withLayoutItem)(u,t,w=>{let C;return b=w.x,v=w.y,["sw","w","nw","n","ne"].indexOf(l)!==-1&&(["sw","nw","w"].indexOf(l)!==-1&&(b=w.x+(w.w-n),n=w.x!==b&&b<0?w.w:n,b=b<0?0:b),["ne","n","nw"].indexOf(l)!==-1&&(v=w.y+(w.h-r),r=w.y!==v&&v<0?w.h:r,v=v<0?0:v),p=!0),h&&!f&&(C=(0,Me.getAllCollisions)(u,{...w,w:n,h:r,x:b,y:v}).filter(k=>k.i!==w.i).length>0,C&&(v=w.y,r=w.h,b=w.x,n=w.w,p=!1)),w.w=n,w.h=r,w});if(!y)return;g=x,p&&(g=(0,Me.moveElement)(x,y,b,v,!0,this.props.preventCollision,(0,Me.compactType)(this.props),d,f));const _={w:y.w,h:y.h,x:y.x,y:y.y,static:!0,i:t};this.props.onResize(g,c,y,_,i,s),this.setState({layout:f?g:(0,Me.compact)(g,(0,Me.compactType)(this.props),d),activeDrag:_})}),dn(this,"onResizeStop",(t,n,r,o)=>{let{e:i,node:s}=o;const{layout:a,oldResizeItem:l}=this.state,{cols:c,allowOverlap:u}=this.props,d=(0,Me.getLayoutItem)(a,t),h=u?a:(0,Me.compact)(a,(0,Me.compactType)(this.props),c);this.props.onResizeStop(h,l,d,null,i,s);const{oldLayout:f}=this.state;this.setState({activeDrag:null,layout:h,oldResizeItem:null,oldLayout:null,resizing:!1}),this.onLayoutMaybeChanged(h,f)}),dn(this,"onDragOver",t=>{var x;if(t.preventDefault(),t.stopPropagation(),Ak&&!((x=t.nativeEvent.target)!=null&&x.classList.contains(QC)))return!1;const{droppingItem:n,onDropDragOver:r,margin:o,cols:i,rowHeight:s,maxRows:a,width:l,containerPadding:c,transformScale:u}=this.props,d=r==null?void 0:r(t);if(d===!1)return this.state.droppingDOMNode&&this.removeDroppingPlaceholder(),!1;const h={...n,...d},{layout:f}=this.state,p=t.currentTarget.getBoundingClientRect(),g=t.clientX-p.left,b=t.clientY-p.top,v={left:g/u,top:b/u,e:t};if(this.state.droppingDOMNode){if(this.state.droppingPosition){const{left:y,top:_}=this.state.droppingPosition;(y!=g||_!=b)&&this.setState({droppingPosition:v})}}else{const y={cols:i,margin:o,maxRows:a,rowHeight:s,containerWidth:l,containerPadding:c||o},_=(0,L9.calcXY)(y,b,g,h.w,h.h);this.setState({droppingDOMNode:ss.createElement("div",{key:h.i}),droppingPosition:v,layout:[...f,{...h,x:_.x,y:_.y,static:!1,isDraggable:!0}]})}}),dn(this,"removeDroppingPlaceholder",()=>{const{droppingItem:t,cols:n}=this.props,{layout:r}=this.state,o=(0,Me.compact)(r.filter(i=>i.i!==t.i),(0,Me.compactType)(this.props),n,this.props.allowOverlap);this.setState({layout:o,droppingDOMNode:null,activeDrag:null,droppingPosition:void 0})}),dn(this,"onDragLeave",t=>{t.preventDefault(),t.stopPropagation(),this.dragEnterCounter--,this.dragEnterCounter===0&&this.removeDroppingPlaceholder()}),dn(this,"onDragEnter",t=>{t.preventDefault(),t.stopPropagation(),this.dragEnterCounter++}),dn(this,"onDrop",t=>{t.preventDefault(),t.stopPropagation();const{droppingItem:n}=this.props,{layout:r}=this.state,o=r.find(i=>i.i===n.i);this.dragEnterCounter=0,this.removeDroppingPlaceholder(),this.props.onDrop(r,o,t)})}componentDidMount(){this.setState({mounted:!0}),this.onLayoutMaybeChanged(this.state.layout,this.props.layout)}static getDerivedStateFromProps(t,n){let r;return n.activeDrag?null:(!(0,eb.deepEqual)(t.layout,n.propsLayout)||t.compactType!==n.compactType?r=t.layout:(0,Me.childrenEqual)(t.children,n.children)||(r=n.layout),r?{layout:(0,Me.synchronizeLayoutWithChildren)(r,t.children,t.cols,(0,Me.compactType)(t),t.allowOverlap),compactType:t.compactType,children:t.children,propsLayout:t.layout}:null)}shouldComponentUpdate(t,n){return this.props.children!==t.children||!(0,Me.fastRGLPropsEqual)(this.props,t,eb.deepEqual)||this.state.activeDrag!==n.activeDrag||this.state.mounted!==n.mounted||this.state.droppingPosition!==n.droppingPosition}componentDidUpdate(t,n){if(!this.state.activeDrag){const r=this.state.layout,o=n.layout;this.onLayoutMaybeChanged(r,o)}}containerHeight(){if(!this.props.autoSize)return;const t=(0,Me.bottom)(this.state.layout),n=this.props.containerPadding?this.props.containerPadding[1]:this.props.margin[1];return t*this.props.rowHeight+(t-1)*this.props.margin[1]+n*2+"px"}onLayoutMaybeChanged(t,n){n||(n=this.state.layout),(0,eb.deepEqual)(n,t)||this.props.onLayoutChange(t)}placeholder(){const{activeDrag:t}=this.state;if(!t)return null;const{width:n,cols:r,margin:o,containerPadding:i,rowHeight:s,maxRows:a,useCSSTransforms:l,transformScale:c}=this.props;return ss.createElement(XC.default,{w:t.w,h:t.h,x:t.x,y:t.y,i:t.i,className:`react-grid-placeholder ${this.state.resizing?"placeholder-resizing":""}`,containerWidth:n,cols:r,margin:o,containerPadding:i||o,maxRows:a,rowHeight:s,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:l,transformScale:c},ss.createElement("div",null))}processGridItem(t,n){if(!t||!t.key)return;const r=(0,Me.getLayoutItem)(this.state.layout,String(t.key));if(!r)return null;const{width:o,cols:i,margin:s,containerPadding:a,rowHeight:l,maxRows:c,isDraggable:u,isResizable:d,isBounded:h,useCSSTransforms:f,transformScale:p,draggableCancel:g,draggableHandle:b,resizeHandles:v,resizeHandle:x}=this.props,{mounted:y,droppingPosition:_}=this.state,w=typeof r.isDraggable=="boolean"?r.isDraggable:!r.static&&u,C=typeof r.isResizable=="boolean"?r.isResizable:!r.static&&d,R=r.resizeHandles||v,k=w&&h&&r.isBounded!==!1;return ss.createElement(XC.default,{containerWidth:o,cols:i,margin:s,containerPadding:a||s,maxRows:c,rowHeight:l,cancel:g,handle:b,onDragStop:this.onDragStop,onDragStart:this.onDragStart,onDrag:this.onDrag,onResizeStart:this.onResizeStart,onResize:this.onResize,onResizeStop:this.onResizeStop,isDraggable:w,isResizable:C,isBounded:k,useCSSTransforms:f&&y,usePercentages:!y,transformScale:p,w:r.w,h:r.h,x:r.x,y:r.y,i:r.i,minH:r.minH,minW:r.minW,maxH:r.maxH,maxW:r.maxW,static:r.static,droppingPosition:n?_:void 0,resizeHandles:R,resizeHandle:x},t)}render(){const{className:t,style:n,isDroppable:r,innerRef:o}=this.props,i=(0,F9.default)(QC,t),s={height:this.containerHeight(),...n};return ss.createElement("div",{ref:o,className:i,style:s,onDrop:r?this.onDrop:Me.noop,onDragLeave:r?this.onDragLeave:Me.noop,onDragEnter:r?this.onDragEnter:Me.noop,onDragOver:r?this.onDragOver:Me.noop},ss.Children.map(this.props.children,a=>this.processGridItem(a)),r&&this.state.droppingDOMNode&&this.processGridItem(this.state.droppingDOMNode,!0),this.placeholder())}}pd.default=lg;dn(lg,"displayName","ReactGridLayout");dn(lg,"propTypes",$9.default);dn(lg,"defaultProps",{autoSize:!0,cols:12,className:"",style:{},draggableHandle:"",draggableCancel:"",containerPadding:null,rowHeight:150,maxRows:1/0,layout:[],margin:[10,10],isBounded:!1,isDraggable:!0,isResizable:!0,allowOverlap:!1,isDroppable:!1,useCSSTransforms:!0,transformScale:1,verticalCompact:!0,compactType:"vertical",preventCollision:!1,droppingItem:{i:"__dropping-elem__",h:1,w:1},resizeHandles:["se"],onLayoutChange:Me.noop,onDragStart:Me.noop,onDrag:Me.noop,onDragStop:Me.noop,onResizeStart:Me.noop,onResize:Me.noop,onResizeStop:Me.noop,onDrop:Me.noop,onDropDragOver:Me.noop});var cg={},ba={};Object.defineProperty(ba,"__esModule",{value:!0});ba.findOrGenerateResponsiveLayout=U9;ba.getBreakpointFromWidth=H9;ba.getColsFromBreakpoint=W9;ba.sortBreakpoints=Xx;var lf=We;function H9(e,t){const n=Xx(e);let r=n[0];for(let o=1,i=n.length;o<i;o++){const s=n[o];t>e[s]&&(r=s)}return r}function W9(e,t){if(!t[e])throw new Error("ResponsiveReactGridLayout: `cols` entry for breakpoint "+e+" is missing!");return t[e]}function U9(e,t,n,r,o,i){if(e[n])return(0,lf.cloneLayout)(e[n]);let s=e[r];const a=Xx(t),l=a.slice(a.indexOf(n));for(let c=0,u=l.length;c<u;c++){const d=l[c];if(e[d]){s=e[d];break}}return s=(0,lf.cloneLayout)(s||[]),(0,lf.compact)((0,lf.correctBounds)(s,{cols:o}),i,o)}function Xx(e){return Object.keys(e).sort(function(n,r){return e[n]-e[r]})}Object.defineProperty(cg,"__esModule",{value:!0});cg.default=void 0;var JC=G9(E),Nn=Nk(Xi),tb=Ox,tl=We,as=ba,q9=Nk(pd);function Nk(e){return e&&e.__esModule?e:{default:e}}function jk(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(jk=function(r){return r?n:t})(e)}function G9(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=jk(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function fv(){return fv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},fv.apply(this,arguments)}function Lh(e,t,n){return t=Y9(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Y9(e){var t=K9(e,"string");return typeof t=="symbol"?t:String(t)}function K9(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const ZC=e=>Object.prototype.toString.call(e);function cf(e,t){return e==null?null:Array.isArray(e)?e:e[t]}class Qx extends JC.Component{constructor(){super(...arguments),Lh(this,"state",this.generateInitialState()),Lh(this,"onLayoutChange",t=>{this.props.onLayoutChange(t,{...this.props.layouts,[this.state.breakpoint]:t})})}generateInitialState(){const{width:t,breakpoints:n,layouts:r,cols:o}=this.props,i=(0,as.getBreakpointFromWidth)(n,t),s=(0,as.getColsFromBreakpoint)(i,o),a=this.props.verticalCompact===!1?null:this.props.compactType;return{layout:(0,as.findOrGenerateResponsiveLayout)(r,n,i,i,s,a),breakpoint:i,cols:s}}static getDerivedStateFromProps(t,n){if(!(0,tb.deepEqual)(t.layouts,n.layouts)){const{breakpoint:r,cols:o}=n;return{layout:(0,as.findOrGenerateResponsiveLayout)(t.layouts,t.breakpoints,r,r,o,t.compactType),layouts:t.layouts}}return null}componentDidUpdate(t){(this.props.width!=t.width||this.props.breakpoint!==t.breakpoint||!(0,tb.deepEqual)(this.props.breakpoints,t.breakpoints)||!(0,tb.deepEqual)(this.props.cols,t.cols))&&this.onWidthChange(t)}onWidthChange(t){const{breakpoints:n,cols:r,layouts:o,compactType:i}=this.props,s=this.props.breakpoint||(0,as.getBreakpointFromWidth)(this.props.breakpoints,this.props.width),a=this.state.breakpoint,l=(0,as.getColsFromBreakpoint)(s,r),c={...o};if(a!==s||t.breakpoints!==n||t.cols!==r){a in c||(c[a]=(0,tl.cloneLayout)(this.state.layout));let h=(0,as.findOrGenerateResponsiveLayout)(c,n,s,a,l,i);h=(0,tl.synchronizeLayoutWithChildren)(h,this.props.children,l,i,this.props.allowOverlap),c[s]=h,this.props.onBreakpointChange(s,l),this.props.onLayoutChange(h,c),this.setState({breakpoint:s,layout:h,cols:l})}const u=cf(this.props.margin,s),d=cf(this.props.containerPadding,s);this.props.onWidthChange(this.props.width,u,l,d)}render(){const{breakpoint:t,breakpoints:n,cols:r,layouts:o,margin:i,containerPadding:s,onBreakpointChange:a,onLayoutChange:l,onWidthChange:c,...u}=this.props;return JC.createElement(q9.default,fv({},u,{margin:cf(i,this.state.breakpoint),containerPadding:cf(s,this.state.breakpoint),onLayoutChange:this.onLayoutChange,layout:this.state.layout,cols:this.state.cols}))}}cg.default=Qx;Lh(Qx,"propTypes",{breakpoint:Nn.default.string,breakpoints:Nn.default.object,allowOverlap:Nn.default.bool,cols:Nn.default.object,margin:Nn.default.oneOfType([Nn.default.array,Nn.default.object]),containerPadding:Nn.default.oneOfType([Nn.default.array,Nn.default.object]),layouts(e,t){if(ZC(e[t])!=="[object Object]")throw new Error("Layout property must be an object. Received: "+ZC(e[t]));Object.keys(e[t]).forEach(n=>{if(!(n in e.breakpoints))throw new Error("Each key in layouts must align with a key in breakpoints.");(0,tl.validateLayout)(e.layouts[n],"layouts."+n)})},width:Nn.default.number.isRequired,onBreakpointChange:Nn.default.func,onLayoutChange:Nn.default.func,onWidthChange:Nn.default.func});Lh(Qx,"defaultProps",{breakpoints:{lg:1200,md:996,sm:768,xs:480,xxs:0},cols:{lg:12,md:10,sm:6,xs:4,xxs:2},containerPadding:{lg:null,md:null,sm:null,xs:null,xxs:null},layouts:{},margin:[10,10],allowOverlap:!1,onBreakpointChange:tl.noop,onLayoutChange:tl.noop,onWidthChange:tl.noop});var Jx={},Fk=function(){if(typeof Map<"u")return Map;function e(t,n){var r=-1;return t.some(function(o,i){return o[0]===n?(r=i,!0):!1}),r}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(n){var r=e(this.__entries__,n),o=this.__entries__[r];return o&&o[1]},t.prototype.set=function(n,r){var o=e(this.__entries__,n);~o?this.__entries__[o][1]=r:this.__entries__.push([n,r])},t.prototype.delete=function(n){var r=this.__entries__,o=e(r,n);~o&&r.splice(o,1)},t.prototype.has=function(n){return!!~e(this.__entries__,n)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(n,r){r===void 0&&(r=null);for(var o=0,i=this.__entries__;o<i.length;o++){var s=i[o];n.call(r,s[1],s[0])}},t}()}(),hv=typeof window<"u"&&typeof document<"u"&&window.document===document,$h=function(){return typeof global<"u"&&global.Math===Math?global:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")()}(),X9=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind($h):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)}}(),Q9=2;function J9(e,t){var n=!1,r=!1,o=0;function i(){n&&(n=!1,e()),r&&a()}function s(){X9(i)}function a(){var l=Date.now();if(n){if(l-o<Q9)return;r=!0}else n=!0,r=!1,setTimeout(s,t);o=l}return a}var Z9=20,ez=["top","right","bottom","left","width","height","size","weight"],tz=typeof MutationObserver<"u",nz=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=J9(this.refresh.bind(this),Z9)}return e.prototype.addObserver=function(t){~this.observers_.indexOf(t)||this.observers_.push(t),this.connected_||this.connect_()},e.prototype.removeObserver=function(t){var n=this.observers_,r=n.indexOf(t);~r&&n.splice(r,1),!n.length&&this.connected_&&this.disconnect_()},e.prototype.refresh=function(){var t=this.updateObservers_();t&&this.refresh()},e.prototype.updateObservers_=function(){var t=this.observers_.filter(function(n){return n.gatherActive(),n.hasActive()});return t.forEach(function(n){return n.broadcastActive()}),t.length>0},e.prototype.connect_=function(){!hv||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),tz?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){!hv||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(t){var n=t.propertyName,r=n===void 0?"":n,o=ez.some(function(i){return!!~r.indexOf(i)});o&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),Lk=function(e,t){for(var n=0,r=Object.keys(t);n<r.length;n++){var o=r[n];Object.defineProperty(e,o,{value:t[o],enumerable:!1,writable:!1,configurable:!0})}return e},Ol=function(e){var t=e&&e.ownerDocument&&e.ownerDocument.defaultView;return t||$h},$k=ug(0,0,0,0);function zh(e){return parseFloat(e)||0}function e_(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.reduce(function(r,o){var i=e["border-"+o+"-width"];return r+zh(i)},0)}function rz(e){for(var t=["top","right","bottom","left"],n={},r=0,o=t;r<o.length;r++){var i=o[r],s=e["padding-"+i];n[i]=zh(s)}return n}function oz(e){var t=e.getBBox();return ug(0,0,t.width,t.height)}function iz(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return $k;var r=Ol(e).getComputedStyle(e),o=rz(r),i=o.left+o.right,s=o.top+o.bottom,a=zh(r.width),l=zh(r.height);if(r.boxSizing==="border-box"&&(Math.round(a+i)!==t&&(a-=e_(r,"left","right")+i),Math.round(l+s)!==n&&(l-=e_(r,"top","bottom")+s)),!az(e)){var c=Math.round(a+i)-t,u=Math.round(l+s)-n;Math.abs(c)!==1&&(a-=c),Math.abs(u)!==1&&(l-=u)}return ug(o.left,o.top,a,l)}var sz=function(){return typeof SVGGraphicsElement<"u"?function(e){return e instanceof Ol(e).SVGGraphicsElement}:function(e){return e instanceof Ol(e).SVGElement&&typeof e.getBBox=="function"}}();function az(e){return e===Ol(e).document.documentElement}function lz(e){return hv?sz(e)?oz(e):iz(e):$k}function cz(e){var t=e.x,n=e.y,r=e.width,o=e.height,i=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,s=Object.create(i.prototype);return Lk(s,{x:t,y:n,width:r,height:o,top:n,right:t+r,bottom:o+n,left:t}),s}function ug(e,t,n,r){return{x:e,y:t,width:n,height:r}}var uz=function(){function e(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=ug(0,0,0,0),this.target=t}return e.prototype.isActive=function(){var t=lz(this.target);return this.contentRect_=t,t.width!==this.broadcastWidth||t.height!==this.broadcastHeight},e.prototype.broadcastRect=function(){var t=this.contentRect_;return this.broadcastWidth=t.width,this.broadcastHeight=t.height,t},e}(),dz=function(){function e(t,n){var r=cz(n);Lk(this,{target:t,contentRect:r})}return e}(),fz=function(){function e(t,n,r){if(this.activeObservations_=[],this.observations_=new Fk,typeof t!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=t,this.controller_=n,this.callbackCtx_=r}return e.prototype.observe=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof Ol(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)||(n.set(t,new uz(t)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof Ol(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)&&(n.delete(t),n.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var t=this;this.clearActive(),this.observations_.forEach(function(n){n.isActive()&&t.activeObservations_.push(n)})},e.prototype.broadcastActive=function(){if(this.hasActive()){var t=this.callbackCtx_,n=this.activeObservations_.map(function(r){return new dz(r.target,r.broadcastRect())});this.callback_.call(t,n,t),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),zk=typeof WeakMap<"u"?new WeakMap:new Fk,Bk=function(){function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=nz.getInstance(),r=new fz(t,n,this);zk.set(this,r)}return e}();["observe","unobserve","disconnect"].forEach(function(e){Bk.prototype[e]=function(){var t;return(t=zk.get(this))[e].apply(t,arguments)}});var hz=function(){return typeof $h.ResizeObserver<"u"?$h.ResizeObserver:Bk}();const pz=Object.freeze(Object.defineProperty({__proto__:null,default:hz},Symbol.toStringTag,{value:"Module"})),gz=sx(pz);Object.defineProperty(Jx,"__esModule",{value:!0});Jx.default=Cz;var uf=yz(E),mz=Zx(Xi),bz=Zx(gz),vz=Zx(Dx);function Zx(e){return e&&e.__esModule?e:{default:e}}function Vk(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(Vk=function(r){return r?n:t})(e)}function yz(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=Vk(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function pv(){return pv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},pv.apply(this,arguments)}function ka(e,t,n){return t=xz(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xz(e){var t=wz(e,"string");return typeof t=="symbol"?t:String(t)}function wz(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const Sz="react-grid-layout";function Cz(e){var t;return t=class extends uf.Component{constructor(){super(...arguments),ka(this,"state",{width:1280}),ka(this,"elementRef",uf.createRef()),ka(this,"mounted",!1),ka(this,"resizeObserver",void 0)}componentDidMount(){this.mounted=!0,this.resizeObserver=new bz.default(o=>{if(this.elementRef.current instanceof HTMLElement){const s=o[0].contentRect.width;this.setState({width:s})}});const r=this.elementRef.current;r instanceof HTMLElement&&this.resizeObserver.observe(r)}componentWillUnmount(){this.mounted=!1;const r=this.elementRef.current;r instanceof HTMLElement&&this.resizeObserver.unobserve(r),this.resizeObserver.disconnect()}render(){const{measureBeforeMount:r,...o}=this.props;return r&&!this.mounted?uf.createElement("div",{className:(0,vz.default)(this.props.className,Sz),style:this.props.style,ref:this.elementRef}):uf.createElement(e,pv({innerRef:this.elementRef},o,this.state))}},ka(t,"defaultProps",{measureBeforeMount:!1}),ka(t,"propTypes",{measureBeforeMount:mz.default.bool}),t}(function(e){e.exports=pd.default,e.exports.utils=We,e.exports.calculateUtils=Po,e.exports.Responsive=cg.default,e.exports.Responsive.utils=ba,e.exports.WidthProvider=Jx.default})(nk);var t_=nk.exports;function va(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}var _z=["color"],Ez=E.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=va(e,_z);return E.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),E.createElement("path",{d:"M4.93179 5.43179C4.75605 5.60753 4.75605 5.89245 4.93179 6.06819C5.10753 6.24392 5.39245 6.24392 5.56819 6.06819L7.49999 4.13638L9.43179 6.06819C9.60753 6.24392 9.89245 6.24392 10.0682 6.06819C10.2439 5.89245 10.2439 5.60753 10.0682 5.43179L7.81819 3.18179C7.73379 3.0974 7.61933 3.04999 7.49999 3.04999C7.38064 3.04999 7.26618 3.0974 7.18179 3.18179L4.93179 5.43179ZM10.0682 9.56819C10.2439 9.39245 10.2439 9.10753 10.0682 8.93179C9.89245 8.75606 9.60753 8.75606 9.43179 8.93179L7.49999 10.8636L5.56819 8.93179C5.39245 8.75606 5.10753 8.75606 4.93179 8.93179C4.75605 9.10753 4.75605 9.39245 4.93179 9.56819L7.18179 11.8182C7.35753 11.9939 7.64245 11.9939 7.81819 11.8182L10.0682 9.56819Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),Rz=["color"],ew=E.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=va(e,Rz);return E.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),E.createElement("path",{d:"M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),Pz=["color"],Hk=E.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=va(e,Pz);return E.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),E.createElement("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),Mz=["color"],kz=E.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=va(e,Mz);return E.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),E.createElement("path",{d:"M14.7649 6.07596C14.9991 6.22231 15.0703 6.53079 14.9239 6.76495C14.4849 7.46743 13.9632 8.10645 13.3702 8.66305L14.5712 9.86406C14.7664 10.0593 14.7664 10.3759 14.5712 10.5712C14.3759 10.7664 14.0593 10.7664 13.8641 10.5712L12.6011 9.30817C11.805 9.90283 10.9089 10.3621 9.93375 10.651L10.383 12.3277C10.4544 12.5944 10.2961 12.8685 10.0294 12.94C9.76267 13.0115 9.4885 12.8532 9.41704 12.5865L8.95917 10.8775C8.48743 10.958 8.00036 10.9999 7.50001 10.9999C6.99965 10.9999 6.51257 10.958 6.04082 10.8775L5.58299 12.5864C5.51153 12.8532 5.23737 13.0115 4.97064 12.94C4.7039 12.8686 4.5456 12.5944 4.61706 12.3277L5.06625 10.651C4.09111 10.3621 3.19503 9.90282 2.3989 9.30815L1.1359 10.5712C0.940638 10.7664 0.624058 10.7664 0.428798 10.5712C0.233537 10.3759 0.233537 10.0593 0.428798 9.86405L1.62982 8.66303C1.03682 8.10643 0.515113 7.46742 0.0760677 6.76495C-0.0702867 6.53079 0.000898544 6.22231 0.235065 6.07596C0.469231 5.9296 0.777703 6.00079 0.924058 6.23496C1.40354 7.00213 1.989 7.68057 2.66233 8.2427C2.67315 8.25096 2.6837 8.25972 2.69397 8.26898C4.00897 9.35527 5.65537 9.99991 7.50001 9.99991C10.3078 9.99991 12.6564 8.5063 14.076 6.23495C14.2223 6.00079 14.5308 5.9296 14.7649 6.07596Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),Oz=["color"],Dz=E.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=va(e,Oz);return E.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),E.createElement("path",{d:"M7.5 11C4.80285 11 2.52952 9.62184 1.09622 7.50001C2.52952 5.37816 4.80285 4 7.5 4C10.1971 4 12.4705 5.37816 13.9038 7.50001C12.4705 9.62183 10.1971 11 7.5 11ZM7.5 3C4.30786 3 1.65639 4.70638 0.0760002 7.23501C-0.0253338 7.39715 -0.0253334 7.60288 0.0760014 7.76501C1.65639 10.2936 4.30786 12 7.5 12C10.6921 12 13.3436 10.2936 14.924 7.76501C15.0253 7.60288 15.0253 7.39715 14.924 7.23501C13.3436 4.70638 10.6921 3 7.5 3ZM7.5 9.5C8.60457 9.5 9.5 8.60457 9.5 7.5C9.5 6.39543 8.60457 5.5 7.5 5.5C6.39543 5.5 5.5 6.39543 5.5 7.5C5.5 8.60457 6.39543 9.5 7.5 9.5Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),Tz=["color"],Wk=E.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=va(e,Tz);return E.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),E.createElement("path",{d:"M4 6H11L7.5 10.5L4 6Z",fill:r}))}),Iz=["color"],Uk=E.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=va(e,Iz);return E.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),E.createElement("path",{d:"M4 9H11L7.5 4.5L4 9Z",fill:r}))});/**
58
- * @license lucide-react v0.453.0 - ISC
59
- *
60
- * This source code is licensed under the ISC license.
61
- * See the LICENSE file in the root directory of this source tree.
62
- */const Az=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),qk=(...e)=>e.filter((t,n,r)=>!!t&&r.indexOf(t)===n).join(" ");/**
63
- * @license lucide-react v0.453.0 - ISC
64
- *
65
- * This source code is licensed under the ISC license.
66
- * See the LICENSE file in the root directory of this source tree.
67
- */var Nz={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
68
- * @license lucide-react v0.453.0 - ISC
69
- *
70
- * This source code is licensed under the ISC license.
71
- * See the LICENSE file in the root directory of this source tree.
72
- */const jz=E.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:i,iconNode:s,...a},l)=>E.createElement("svg",{ref:l,...Nz,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:qk("lucide",o),...a},[...s.map(([c,u])=>E.createElement(c,u)),...Array.isArray(i)?i:[i]]));/**
73
- * @license lucide-react v0.453.0 - ISC
74
- *
75
- * This source code is licensed under the ISC license.
76
- * See the LICENSE file in the root directory of this source tree.
77
- */const ot=(e,t)=>{const n=E.forwardRef(({className:r,...o},i)=>E.createElement(jz,{ref:i,iconNode:t,className:qk(`lucide-${Az(e)}`,r),...o}));return n.displayName=`${e}`,n};/**
78
- * @license lucide-react v0.453.0 - ISC
79
- *
80
- * This source code is licensed under the ISC license.
81
- * See the LICENSE file in the root directory of this source tree.
82
- */const Gk=ot("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
83
- * @license lucide-react v0.453.0 - ISC
84
- *
85
- * This source code is licensed under the ISC license.
86
- * See the LICENSE file in the root directory of this source tree.
87
- */const Yk=ot("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/**
88
- * @license lucide-react v0.453.0 - ISC
89
- *
90
- * This source code is licensed under the ISC license.
91
- * See the LICENSE file in the root directory of this source tree.
92
- */const tc=ot("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
93
- * @license lucide-react v0.453.0 - ISC
94
- *
95
- * This source code is licensed under the ISC license.
96
- * See the LICENSE file in the root directory of this source tree.
97
- */const bd=ot("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
98
- * @license lucide-react v0.453.0 - ISC
99
- *
100
- * This source code is licensed under the ISC license.
101
- * See the LICENSE file in the root directory of this source tree.
102
- */const Kk=ot("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
103
- * @license lucide-react v0.453.0 - ISC
104
- *
105
- * This source code is licensed under the ISC license.
106
- * See the LICENSE file in the root directory of this source tree.
107
- */const tw=ot("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
108
- * @license lucide-react v0.453.0 - ISC
109
- *
110
- * This source code is licensed under the ISC license.
111
- * See the LICENSE file in the root directory of this source tree.
112
- */const Xk=ot("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
113
- * @license lucide-react v0.453.0 - ISC
114
- *
115
- * This source code is licensed under the ISC license.
116
- * See the LICENSE file in the root directory of this source tree.
117
- */const Qk=ot("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
118
- * @license lucide-react v0.453.0 - ISC
119
- *
120
- * This source code is licensed under the ISC license.
121
- * See the LICENSE file in the root directory of this source tree.
122
- */const Jk=ot("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
123
- * @license lucide-react v0.453.0 - ISC
124
- *
125
- * This source code is licensed under the ISC license.
126
- * See the LICENSE file in the root directory of this source tree.
127
- */const Zk=ot("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
128
- * @license lucide-react v0.453.0 - ISC
129
- *
130
- * This source code is licensed under the ISC license.
131
- * See the LICENSE file in the root directory of this source tree.
132
- */const Fz=ot("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
133
- * @license lucide-react v0.453.0 - ISC
134
- *
135
- * This source code is licensed under the ISC license.
136
- * See the LICENSE file in the root directory of this source tree.
137
- */const eO=ot("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
138
- * @license lucide-react v0.453.0 - ISC
139
- *
140
- * This source code is licensed under the ISC license.
141
- * See the LICENSE file in the root directory of this source tree.
142
- */const tO=ot("FilterX",[["path",{d:"M13.013 3H2l8 9.46V19l4 2v-8.54l.9-1.055",key:"1fi1da"}],["path",{d:"m22 3-5 5",key:"12jva0"}],["path",{d:"m17 3 5 5",key:"k36vhe"}]]);/**
143
- * @license lucide-react v0.453.0 - ISC
144
- *
145
- * This source code is licensed under the ISC license.
146
- * See the LICENSE file in the root directory of this source tree.
147
- */const Lz=ot("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/**
148
- * @license lucide-react v0.453.0 - ISC
149
- *
150
- * This source code is licensed under the ISC license.
151
- * See the LICENSE file in the root directory of this source tree.
152
- */const $z=ot("IdCard",[["path",{d:"M16 10h2",key:"8sgtl7"}],["path",{d:"M16 14h2",key:"epxaof"}],["path",{d:"M6.17 15a3 3 0 0 1 5.66 0",key:"n6f512"}],["circle",{cx:"9",cy:"11",r:"2",key:"yxgjnd"}],["rect",{x:"2",y:"5",width:"20",height:"14",rx:"2",key:"qneu4z"}]]);/**
153
- * @license lucide-react v0.453.0 - ISC
154
- *
155
- * This source code is licensed under the ISC license.
156
- * See the LICENSE file in the root directory of this source tree.
157
- */const nO=ot("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
158
- * @license lucide-react v0.453.0 - ISC
159
- *
160
- * This source code is licensed under the ISC license.
161
- * See the LICENSE file in the root directory of this source tree.
162
- */const zz=ot("LightbulbOff",[["path",{d:"M16.8 11.2c.8-.9 1.2-2 1.2-3.2a6 6 0 0 0-9.3-5",key:"1fkcox"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M6.3 6.3a4.67 4.67 0 0 0 1.2 5.2c.7.7 1.3 1.5 1.5 2.5",key:"10m8kw"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);/**
163
- * @license lucide-react v0.453.0 - ISC
164
- *
165
- * This source code is licensed under the ISC license.
166
- * See the LICENSE file in the root directory of this source tree.
167
- */const Bz=ot("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);/**
168
- * @license lucide-react v0.453.0 - ISC
169
- *
170
- * This source code is licensed under the ISC license.
171
- * See the LICENSE file in the root directory of this source tree.
172
- */const Vz=ot("Octagon",[["path",{d:"M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z",key:"2d38gg"}]]);/**
173
- * @license lucide-react v0.453.0 - ISC
174
- *
175
- * This source code is licensed under the ISC license.
176
- * See the LICENSE file in the root directory of this source tree.
177
- */const rO=ot("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
178
- * @license lucide-react v0.453.0 - ISC
179
- *
180
- * This source code is licensed under the ISC license.
181
- * See the LICENSE file in the root directory of this source tree.
182
- */const Hz=ot("Percent",[["line",{x1:"19",x2:"5",y1:"5",y2:"19",key:"1x9vlm"}],["circle",{cx:"6.5",cy:"6.5",r:"2.5",key:"4mh3h7"}],["circle",{cx:"17.5",cy:"17.5",r:"2.5",key:"1mdrzq"}]]);/**
183
- * @license lucide-react v0.453.0 - ISC
184
- *
185
- * This source code is licensed under the ISC license.
186
- * See the LICENSE file in the root directory of this source tree.
187
- */const oO=ot("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
188
- * @license lucide-react v0.453.0 - ISC
189
- *
190
- * This source code is licensed under the ISC license.
191
- * See the LICENSE file in the root directory of this source tree.
192
- */const dg=ot("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
193
- * @license lucide-react v0.453.0 - ISC
194
- *
195
- * This source code is licensed under the ISC license.
196
- * See the LICENSE file in the root directory of this source tree.
197
- */const iO=ot("RefreshCcw",[["path",{d:"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"14sxne"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16",key:"1hlbsb"}],["path",{d:"M16 16h5v5",key:"ccwih5"}]]);/**
198
- * @license lucide-react v0.453.0 - ISC
199
- *
200
- * This source code is licensed under the ISC license.
201
- * See the LICENSE file in the root directory of this source tree.
202
- */const Wz=ot("SearchX",[["path",{d:"m13.5 8.5-5 5",key:"1cs55j"}],["path",{d:"m8.5 8.5 5 5",key:"a8mexj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
203
- * @license lucide-react v0.453.0 - ISC
204
- *
205
- * This source code is licensed under the ISC license.
206
- * See the LICENSE file in the root directory of this source tree.
207
- */const Uz=ot("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
208
- * @license lucide-react v0.453.0 - ISC
209
- *
210
- * This source code is licensed under the ISC license.
211
- * See the LICENSE file in the root directory of this source tree.
212
- */const sO=ot("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
213
- * @license lucide-react v0.453.0 - ISC
214
- *
215
- * This source code is licensed under the ISC license.
216
- * See the LICENSE file in the root directory of this source tree.
217
- */const aO=ot("TreePalm",[["path",{d:"M13 8c0-2.76-2.46-5-5.5-5S2 5.24 2 8h2l1-1 1 1h4",key:"foxbe7"}],["path",{d:"M13 7.14A5.82 5.82 0 0 1 16.5 6c3.04 0 5.5 2.24 5.5 5h-3l-1-1-1 1h-3",key:"18arnh"}],["path",{d:"M5.89 9.71c-2.15 2.15-2.3 5.47-.35 7.43l4.24-4.25.7-.7.71-.71 2.12-2.12c-1.95-1.96-5.27-1.8-7.42.35",key:"ywahnh"}],["path",{d:"M11 15.5c.5 2.5-.17 4.5-1 6.5h4c2-5.5-.5-12-1-14",key:"ft0feo"}]]);/**
218
- * @license lucide-react v0.453.0 - ISC
219
- *
220
- * This source code is licensed under the ISC license.
221
- * See the LICENSE file in the root directory of this source tree.
222
- */const qz=ot("UserRound",[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]]);/**
223
- * @license lucide-react v0.453.0 - ISC
224
- *
225
- * This source code is licensed under the ISC license.
226
- * See the LICENSE file in the root directory of this source tree.
227
- */const ya=ot("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Gz=({data:e,filename:t="output.csv"})=>{const n=()=>{if(e.length===0)return;const r=[],o=Object.keys(e[0]);r.push(o.join(","));for(const c of e){const u=o.map(d=>`"${(""+c[d]).replace(/"/g,'""')}"`);r.push(u.join(","))}const i=r.join(`
228
- `),s=new Blob([i],{type:"text/csv"}),a=window.URL.createObjectURL(s),l=document.createElement("a");l.setAttribute("hidden",""),l.setAttribute("href",a),l.setAttribute("download",t),document.body.appendChild(l),l.click(),document.body.removeChild(l)};return m.jsx(Zk,{onClick:n,className:"h-[14px] w-[14px] text-foreground/30 hover:cursor-pointer hover:text-foreground/50"})};var Dl=1e3,Tl=Dl*60,Il=Tl*60,na=Il*24,Yz=na*7,Kz=na*365.25,Xz=function(e,t){t=t||{};var n=typeof e;if(n==="string"&&e.length>0)return Qz(e);if(n==="number"&&isFinite(e))return t.long?Zz(e):Jz(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function Qz(e){if(e=String(e),!(e.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var n=parseFloat(t[1]),r=(t[2]||"ms").toLowerCase();switch(r){case"years":case"year":case"yrs":case"yr":case"y":return n*Kz;case"weeks":case"week":case"w":return n*Yz;case"days":case"day":case"d":return n*na;case"hours":case"hour":case"hrs":case"hr":case"h":return n*Il;case"minutes":case"minute":case"mins":case"min":case"m":return n*Tl;case"seconds":case"second":case"secs":case"sec":case"s":return n*Dl;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function Jz(e){var t=Math.abs(e);return t>=na?Math.round(e/na)+"d":t>=Il?Math.round(e/Il)+"h":t>=Tl?Math.round(e/Tl)+"m":t>=Dl?Math.round(e/Dl)+"s":e+"ms"}function Zz(e){var t=Math.abs(e);return t>=na?df(e,t,na,"day"):t>=Il?df(e,t,Il,"hour"):t>=Tl?df(e,t,Tl,"minute"):t>=Dl?df(e,t,Dl,"second"):e+" ms"}function df(e,t,n,r){var o=t>=n*1.5;return Math.round(e/n)+" "+r+(o?"s":"")}const eB=Yi(Xz);function lO(){const e=se(i=>i.dashboard.filters),t=se(i=>i.filterValues),n=se(i=>i.selectedSheetId),r=e==null?void 0:e.filter(i=>i.sheetId===n||!i.sheetId),o=t==null?void 0:t.filter(i=>(r==null?void 0:r.some(s=>s.id===i.filterId))||i.filterId.endsWith(n));return{sheetFilters:r,sheetFilterValues:o}}function tB(e){const t=se(s=>s.selectedLensId),{sheetFilterValues:n}=lO(),r=(e==null?void 0:e.sql)||"",o=nB((e==null?void 0:e.python)||"");return{queryKey:["query",e==null?void 0:e.id,e==null?void 0:e.title,r,o,t||"",JSON.stringify(n)],sql:r,sheetFilterValues:n}}function nB(e){return e===dx?"":e}function oi(e){const{authToken:t}=vr(),n=se(x=>x.filteringCards),r=se(x=>x.isVisualEditing),o=se(x=>x.actions.getCardFrame),i=se(x=>x.authToken),s=(n==null?void 0:n.some(x=>x.id===e.id))||!1,a=o(e.id),l=(a==null?void 0:a.cards)||[],c=(l==null?void 0:l.length)==1,u=eB((e==null?void 0:e.refreshInterval)||"0"),{queryKey:d,sql:h,sheetFilterValues:f}=tB(e);let p={};r||(p={refetchInterval:u});const g=hd({queryKey:d,queryFn:async()=>{var x;if(!(e!=null&&e.connectionId)||!((x=e==null?void 0:e.sql)!=null&&x.trim()))return null;try{return await mx("https://semaphor.cloud/api/v1/query",(t==null?void 0:t.accessToken)||(i==null?void 0:i.accessToken)||"",{connection_id:e.connectionId,sql:h,python:e.python===dx?"":e.python,active_filters:f,cache_config:pM({card:e})})}catch(y){if(r)return{records:[],error:y};throw y}},placeholderData:I8,...p,enabled:b()});function b(){var x;return!(t!=null&&t.accessToken)||s&&c?!1:!!(e!=null&&e.connectionId&&((x=e==null?void 0:e.sql)!=null&&x.trim())&&!r)}return{...g,queryKey:d,isFilteringCard:s,isSingleCardFrame:c}}function rB(e){return/^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/.test(e)}function oB(e,t=1){if(!rB(e)||t===1)return e;e=e.replace(/^#/,"");const n=parseInt(e.substring(0,2),16),r=parseInt(e.substring(2,4),16),o=parseInt(e.substring(4,6),16);return t=Math.min(Math.max(t,0),1),`rgba(${n}, ${r}, ${o}, ${t})`}function iB(e,t,n,r=1){var c,u,d,h;const o=n==null?void 0:n.datasetOptions,i=se.getState().themeStyle,s=(u=(c=i==null?void 0:i.chart)==null?void 0:c.dataset)==null?void 0:u.backgroundColor,a=(h=(d=i==null?void 0:i.chart)==null?void 0:d.dataset)==null?void 0:h.borderColor;return e.map((f,p)=>{var _;const g=o==null?void 0:o.find(w=>w.idx===p),b=oB(s==null?void 0:s[p%s.length],r),v=a==null?void 0:a[p%a.length],x=a==null?void 0:a[p%a.length];return{label:f.charAt(0).toUpperCase()+f.slice(1),data:t.map(w=>w[f]),...g,datalabels:{...g==null?void 0:g.datalabels,color:sB((_=g==null?void 0:g.datalabels)==null?void 0:_.align,b)},backgroundColor:b,pointBackgroundColor:v,borderColor:x}})}function sB(e,t){return kl(e==="end"||e==="start"?Eu():t)}function aB(e,t){var c,u,d,h;const{metricKeys:n,dimensionKeys:r}=Xt(e);let o=[];const i=se.getState().themeStyle,s=(u=(c=i==null?void 0:i.chart)==null?void 0:c.dataset)==null?void 0:u.backgroundColor,a=(h=(d=i==null?void 0:i.chart)==null?void 0:d.dataset)==null?void 0:h.borderColor;let l={};return t==="scatter"&&(l={radius:5}),(r==null?void 0:r.length)===1&&(o=e.map((f,p)=>({label:f[r==null?void 0:r[0]],data:[{x:f[n[0]],y:f[n[1]],r:f[n[2]]}],backgroundColor:(s==null?void 0:s[p%s.length])+"CC",borderColor:a==null?void 0:a[p%a.length],...l}))),(r==null?void 0:r.length)>1&&(o=[...new Set(e.map(p=>p[r==null?void 0:r[1]]))].map((p,g)=>{const b=e.filter(v=>v[r==null?void 0:r[1]]===p);return{label:p,data:b.map(v=>({x:v[n[0]],y:v[n[1]],r:v[n[2]],label:v[r==null?void 0:r[0]]})),backgroundColor:(s==null?void 0:s[g%s.length])+"CC",borderColor:a==null?void 0:a[g%a.length],...l}})),o}function lB(e){var c,u,d,h;const{dimensionKeys:t,metricKeys:n}=Xt(e),r=se.getState().themeStyle,o=(u=(c=r==null?void 0:r.chart)==null?void 0:c.dataset)==null?void 0:u.backgroundColor,i=(h=(d=r==null?void 0:r.chart)==null?void 0:d.dataset)==null?void 0:h.borderColor,s=t==null?void 0:t[1];return[...new Set(e.map(f=>f==null?void 0:f[s]))].map((f,p)=>({label:f,data:e.filter(g=>(g==null?void 0:g[s])===f).map(g=>[g==null?void 0:g[n[0]],g==null?void 0:g[n[1]],g==null?void 0:g[n[2]]]),backgroundColor:o==null?void 0:o[p%o.length],borderColor:i==null?void 0:i[p%i.length],borderSkipped:!1}))}function cB(e,t){var s,a,l,c;const n=se.getState().themeStyle,r=(a=(s=n==null?void 0:n.chart)==null?void 0:s.dataset)==null?void 0:a.backgroundColor,o=(c=(l=n==null?void 0:n.chart)==null?void 0:l.dataset)==null?void 0:c.borderColor;return e.map(u=>({label:u.charAt(0).toUpperCase()+u.slice(1),data:t.map(d=>d[u]),backgroundColor:t.map((d,h)=>(d==null?void 0:d._color)||(r==null?void 0:r[h%r.length])),borderColor:t.map((d,h)=>(d==null?void 0:d._color)||(o==null?void 0:o[h%o.length]))}))}function uB(e){let t=-1,n=0;return e.forEach((r,o)=>{const i=Object.keys(r).length;i>n&&(t=o,n=i)}),t}function Xt(e){if(!e||e.length===0)return{keys:[],dimensionKeys:[],metricKeys:[]};const t=uB(e),n=Object.keys(e[t]),r=n.filter(i=>{var s,a,l,c,u,d,h,f;return!!(typeof((s=e==null?void 0:e[t])==null?void 0:s[i])&&typeof((a=e==null?void 0:e[t])==null?void 0:a[i])=="string"||typeof((l=e==null?void 0:e[0])==null?void 0:l[i])&&typeof((c=e==null?void 0:e[0])==null?void 0:c[i])=="string"||typeof((u=e==null?void 0:e[1])==null?void 0:u[i])&&typeof((d=e==null?void 0:e[1])==null?void 0:d[i])=="string"||typeof((h=e==null?void 0:e[2])==null?void 0:h[i])&&typeof((f=e==null?void 0:e[2])==null?void 0:f[i])=="string")});r.length===0&&r.push(n[0]);const o=n.filter(i=>{var s,a;return((s=e==null?void 0:e[t])==null?void 0:s[i])===+((a=e==null?void 0:e[t])==null?void 0:a[i])});return{keys:n,dimensionKeys:r,metricKeys:o}}function Vc(e,t){var r;const n=(r=t==null?void 0:t.data)==null?void 0:r.datasets;return n&&n.length>0?e.map((i,s)=>({...i,...n==null?void 0:n[s],data:i.data,label:i.label})):e}function dB(e,t="asc"){function n(r){return Object.entries(r).slice(1).reduce((s,[a,l])=>{const c=typeof l=="number"?l:parseFloat(l);return s+(isNaN(c)?0:c)},0)}return e.sort((r,o)=>{const i=n(r),s=n(o);return t==="asc"?i-s:s-i})}function Bh({dataArray:e,groupKey:t,pivotKey:n,valueKey:r,sortChart:o}){const i=e.reduce((l,c)=>{const u=c[t],d=c[n],h=c[r];return l[u]||(l[u]={[t]:u}),l[u][d]=h,l},{});let s=Object.values(i);return o!=="none"&&o!==void 0&&(s=dB(s,o)),s.map(l=>Object.fromEntries(Object.entries(l).filter(([c,u])=>u!==0)))}function ar(e,t){var s;const n=se.getState().themeStyle,r=(s=n==null?void 0:n.chart)==null?void 0:s.options,o=ku(r);return Ru(o,e,t)}function gv(e,t){return e.map(n=>n[t]?n[t]:"BLANK")}function fB(e){se(y=>y.isDashboardEditing);const t=se(y=>y.filterValues),n=se(y=>y.isVisualEditing);se(y=>y.selectedSheetId),se(y=>y.currentBreakpoint);const{removeFrame:r}=se(y=>y.actions),o=se(y=>y.actions.setIsVisualEditing),i=Vn(y=>y.actions.setFilterValues),s=Vn(y=>y.actions.setApplyFilters),{setCard:a,setFrame:l,setQueryResultColumns:c,setActiveTabCardId:u}=fg(),d=Vn(y=>y.actions.setSelectedConnectionId),h=Vn(y=>y.actions.setSelectedDatamodelId),f=Vn(y=>y.actions.setSelectedDatabaseName),p=Vn(y=>y.actions.setSelectedSchemaName),g=Vn(y=>y.actions.setSelectedTableName),b=e.cards.find(y=>y.id===e.activeCardId),{data:v}=oi(b);function x(y=!1){y||o(!n),a(b),u(e.activeCardId);const{dimensionKeys:_}=Xt((v==null?void 0:v.records)||[]);c(_),l(e),b!=null&&b.connectionId&&d(b==null?void 0:b.connectionId),b!=null&&b.datamodelId&&b.datamodelId!=="none"&&(h(b==null?void 0:b.datamodelId),f("")),b!=null&&b.lastSelectedDatabase&&b.lastSelectedDatabase!=="none"&&(f(b==null?void 0:b.lastSelectedDatabase),h("")),b!=null&&b.lastSelectedSchema&&p(b==null?void 0:b.lastSelectedSchema),b!=null&&b.lastSelectedTable&&g(b==null?void 0:b.lastSelectedTable),t&&(i(t),s(!0))}return{handleEditVisual:x,card:b,data:v}}function cO({frame:e}){var c;const t=se(u=>u.isDashboardEditing),n=se(u=>u.isVisualEditing),r=se(u=>u.selectedSheetId),{removeFrame:o}=se(u=>u.actions),i=se(u=>u.actions.setIsVisualEditing),{handleEditVisual:s,card:a,data:l}=fB(e);return m.jsx("section",{onMouseDown:u=>{u.stopPropagation()},className:"absolute right-2 top-2 z-50",children:m.jsxs("div",{className:"flex items-center gap-2",children:[t&&(n?m.jsx("button",{onClick:()=>{i(!n)},children:m.jsx(kz,{className:"size-3.5 text-center text-foreground/30 hover:cursor-pointer hover:text-foreground/50"})}):m.jsx("button",{role:"edit-visual",onClick:()=>s(),children:m.jsx(Dz,{className:"ml-1 size-3.5 text-center text-foreground/30 hover:cursor-pointer hover:text-foreground/50"})})),t&&m.jsx("button",{onClick:()=>o(r,e.id),children:m.jsx(Hk,{className:"size-3.5 text-center text-muted-foreground/70 hover:cursor-pointer hover:text-muted-foreground"})}),((c=a.preferences)==null?void 0:c.allowDownload)===!0&&m.jsx(Gz,{data:(l==null?void 0:l.records)||[],filename:a.title})]})})}let ff;const hB=new Uint8Array(16);function pB(){if(!ff&&(ff=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!ff))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ff(hB)}const tn=[];for(let e=0;e<256;++e)tn.push((e+256).toString(16).slice(1));function gB(e,t=0){return tn[e[t+0]]+tn[e[t+1]]+tn[e[t+2]]+tn[e[t+3]]+"-"+tn[e[t+4]]+tn[e[t+5]]+"-"+tn[e[t+6]]+tn[e[t+7]]+"-"+tn[e[t+8]]+tn[e[t+9]]+"-"+tn[e[t+10]]+tn[e[t+11]]+tn[e[t+12]]+tn[e[t+13]]+tn[e[t+14]]+tn[e[t+15]]}const mB=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),n_={randomUUID:mB};function Li(e,t,n){if(n_.randomUUID&&!e)return n_.randomUUID();e=e||{};const r=e.random||(e.rng||pB)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,gB(r)}const Vn=tM()(lM((e,t)=>({userInputForAI:"",triggerAIRun:!1,showAIDialog:!1,isShowingVisual:!0,runSql:!1,sqlGen:{},sql:"",isSqlRunning:!1,queryResultColumns:[],showFilters:!1,applyFilters:!1,filterValues:[{filterId:"sample-filter-id",valueType:"string",name:"",operation:"in",values:[""]}],card:{id:Li(),title:"Editor Card",description:"Description",type:"bar",data:[]},frame:{id:Li(),cards:[],activeCardId:""},actions:{setCurrentAssitantScope:n=>{e(r=>{r.currentAssitantScope=n})},setLegendOptions:n=>{e(r=>{var o,i,s,a,l,c;r.card.preferences={...r.card.preferences,chartOptions:{...(o=r.card.preferences)==null?void 0:o.chartOptions,plugins:{...(s=(i=r.card.preferences)==null?void 0:i.chartOptions)==null?void 0:s.plugins,legend:{...(c=(l=(a=r.card.preferences)==null?void 0:a.chartOptions)==null?void 0:l.plugins)==null?void 0:c.legend,...n}}}}})},setChartGrid:n=>{e(r=>{var o,i,s,a,l,c,u,d,h,f,p,g,b,v,x;r.card.preferences={...r.card.preferences,chartOptions:{...(o=r.card.preferences)==null?void 0:o.chartOptions,scales:{x:{...(a=(s=(i=r.card.preferences)==null?void 0:i.chartOptions)==null?void 0:s.scales)==null?void 0:a.x,grid:{...(d=(u=(c=(l=r.card.preferences)==null?void 0:l.chartOptions)==null?void 0:c.scales)==null?void 0:u.x)==null?void 0:d.grid,display:n==="x"||n==="xy"}},y:{...(p=(f=(h=r.card.preferences)==null?void 0:h.chartOptions)==null?void 0:f.scales)==null?void 0:p.y,grid:{...(x=(v=(b=(g=r.card.preferences)==null?void 0:g.chartOptions)==null?void 0:b.scales)==null?void 0:v.y)==null?void 0:x.grid,display:n==="y"||n==="xy"}}}}}})},runAssistant:n=>{e(r=>{r.showAIDialog=!0,r.userInputForAI=n,r.triggerAIRun=!0})},setShowAIDialog:n=>{e(r=>{r.showAIDialog=n})},setUserInputForAI:n=>{e(r=>{r.userInputForAI=n})},setTriggerAIRun:n=>{e(r=>{r.triggerAIRun=n})},updateCardTab:(n,r)=>{e(o=>{const i=o.frame,s={...i,cards:i.cards.map(l=>l.id===r.id?r:l),activeCardId:n};o.frame=s;const a=s.cards.find(l=>l.id===n);o.card=a})},setActiveTabCardId:n=>{e(r=>{r.activeTabCardId=n})},setCustomCardPreferences:n=>{e(r=>{r.card.customCardPreferences=n})},setChartOrientation:n=>{e(r=>{var s,a,l,c,u,d;const o=r.card.preferences;let i={};((s=o==null?void 0:o.chartOptions)==null?void 0:s.indexAxis)!==n&&(i={x:(l=(a=o==null?void 0:o.chartOptions)==null?void 0:a.scales)==null?void 0:l.y,y:(u=(c=o==null?void 0:o.chartOptions)==null?void 0:c.scales)==null?void 0:u.x}),r.card.preferences={...o,chartOptions:{...o==null?void 0:o.chartOptions,scales:{...(d=o==null?void 0:o.chartOptions)==null?void 0:d.scales,...i},indexAxis:n}}})},setSortChart:n=>{e(r=>{r.card.preferences={...r.card.preferences,sortChart:n}})},setCustomVisualCode:n=>{e(r=>{r.card.preferences={...r.card.preferences,customVisualCode:n}})},setNumberFormat:(n,r,o,i)=>{e(s=>{var a,l,c;s.card.preferences={...(a=s.card)==null?void 0:a.preferences,formatNumber:{...(c=(l=s.card)==null?void 0:l.preferences)==null?void 0:c.formatNumber,decimalPlaces:n,currency:r,locale:o,suffix:i,enabled:!0}}})},setColorRanges:n=>{e(r=>{var o,i;r.card.preferences={...r.card.preferences,formatNumber:{...(i=(o=r.card)==null?void 0:o.preferences)==null?void 0:i.formatNumber,colorRanges:n}}})},setQueryResultColumns:n=>{e(r=>{r.queryResultColumns=n})},setCardPreferences:n=>{e(r=>{r.card.preferences=n})},setFilterOnClickColumnIndex:n=>{e(r=>{r.card.preferences={...r.card.preferences,filterOnClickColumnIndex:n}})},setFilterOnClickField:n=>{e(r=>{r.card.preferences={...r.card.preferences,filterOnClick:!0,filterOnClickField:n}})},setCardRefreshInterval:n=>{e(r=>{r.card.refreshInterval=n})},setIsShowingVisual:n=>{e({isShowingVisual:n})},setRunSql:n=>{e({runSql:n})},setIsSqlRunning:n=>{e({isSqlRunning:n})},updateCardInFrame:n=>{e(r=>{r.frame.cards=r.frame.cards.map(o=>o.id===n.id?n:o)})},setFrame:n=>{e({frame:n})},setCard:n=>{e({card:n})},switchCardType:n=>{e(r=>{r.card.type=n,r.card.sql="",r.card.python="",r.card.customCfg={},r.card.preferences={}})},setCardType:n=>{e(r=>{var o;r.card.type=n,n==="range"&&(r.card.preferences={...r.card.preferences,chartOptions:{...(o=r.card.preferences)==null?void 0:o.chartOptions,indexAxis:"y"}})})},setCardSql:n=>{e(r=>{r.card.sql=n})},setCardPython:n=>{e(r=>{r.card.python=n})},setPythonStdOut:n=>{e(r=>{r.pythonStdOut=n})},setCardCustomCfg:n=>{e(r=>{r.card.customCfg=n})},setShowFilters:n=>{e(r=>{r.showFilters=n})},setApplyFilters:n=>{e(r=>{r.applyFilters=n})},setFilterValues:n=>{e(r=>{r.filterValues=n})},setSqlGen:n=>{e(r=>{r.sqlGen=n})},setSqlGenMeasure:(n,r)=>{e(o=>{o.sqlGen.measures=[...o.sqlGen.measures||[],{name:n,calc:r}]})},setSqlGenDimension:n=>{e(r=>{r.sqlGen.dimensions=[...r.sqlGen.dimensions||[],n]})},setSelectedDatamodelId:n=>{var r,o;e(i=>{i.selectedDatamodelId=n,i.card.datamodelId=n}),(o=(r=t()).onDatamodelChange)==null||o.call(r,n)},setSelectedConnectionId:n=>{var r,o;e(i=>{i.selectedConnectionId=n,i.card.connectionId=n}),(o=(r=t()).onConnectionChange)==null||o.call(r,n)},setSelectedDatabaseName:n=>{var r,o;e(i=>{i.selectedDatabaseName=n,i.card.lastSelectedDatabase=n}),(o=(r=t()).onDatabaseChange)==null||o.call(r,n)},setSelectedSchemaName:n=>{var r,o;e(i=>{i.selectedSchemaName=n,i.card.lastSelectedSchema=n}),(o=(r=t()).onSchemaChange)==null||o.call(r,n)},setSelectedTableName:n=>{var r,o;e(i=>{i.selectedTableName=n,i.card.lastSelectedTable=n}),(o=(r=t()).onTableChange)==null||o.call(r,n)},setCurrentColumns:n=>{e(r=>{r.currentColumns=n})},setOnConnectionChange:n=>{e({onConnectionChange:n})},setOnDatabaseChange:n=>{e({onDatabaseChange:n})},setOnSchemaChange:n=>{e({onSchemaChange:n})},setOnTableChange:n=>{e({onTableChange:n})},setOnSave:n=>{e({onSave:n})},setOnClose:n=>{e({onClose:n})}}}))),fg=()=>Vn(e=>e.actions),bB=E.createContext(null),nb={didCatch:!1,error:null};class vd extends E.Component{constructor(t){super(t),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=nb}static getDerivedStateFromError(t){return{didCatch:!0,error:t}}resetErrorBoundary(){const{error:t}=this.state;if(t!==null){for(var n,r,o=arguments.length,i=new Array(o),s=0;s<o;s++)i[s]=arguments[s];(n=(r=this.props).onReset)===null||n===void 0||n.call(r,{args:i,reason:"imperative-api"}),this.setState(nb)}}componentDidCatch(t,n){var r,o;(r=(o=this.props).onError)===null||r===void 0||r.call(o,t,n)}componentDidUpdate(t,n){const{didCatch:r}=this.state,{resetKeys:o}=this.props;if(r&&n.error!==null&&vB(t.resetKeys,o)){var i,s;(i=(s=this.props).onReset)===null||i===void 0||i.call(s,{next:o,prev:t.resetKeys,reason:"keys"}),this.setState(nb)}}render(){const{children:t,fallbackRender:n,FallbackComponent:r,fallback:o}=this.props,{didCatch:i,error:s}=this.state;let a=t;if(i){const l={error:s,resetErrorBoundary:this.resetErrorBoundary};if(typeof n=="function")a=n(l);else if(r)a=E.createElement(r,l);else if(o!==void 0)a=o;else throw s}return E.createElement(bB.Provider,{value:{didCatch:i,error:s,resetErrorBoundary:this.resetErrorBoundary}},a)}}function vB(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return e.length!==t.length||e.some((n,r)=>!Object.is(n,t[r]))}function yB({error:e}){return m.jsx("div",{className:"flex w-full flex-col items-center justify-center",role:"alert",children:m.jsxs("div",{className:"flex flex-col justify-center space-y-2 text-wrap rounded-md bg-muted p-5",children:[m.jsx("p",{className:"font-semibold",children:"Error Creating Chart. Please try again"}),Dh]})})}function nw({error:e}){return m.jsx("div",{className:"flex flex-col items-center justify-center",role:"alert",style:{height:"100%",width:"100%"},children:m.jsxs("div",{className:"flex flex-col justify-center space-y-2 rounded-md bg-muted p-10",children:[m.jsx("p",{className:"text-lg font-semibold",children:"Oops! Looks like we tripped on a loose wire!"}),m.jsx("p",{className:"text-sm",children:"Something went wrong:"}),m.jsx("pre",{className:"text-xs",children:e.message})]})})}function xB({error:e,frame:t}){return m.jsxs("div",{className:"flex h-full flex-col items-center justify-center border",role:"alert",children:[m.jsx(cO,{frame:t}),m.jsx("div",{className:"flex flex-col justify-center space-y-2 rounded-md p-10"}),m.jsxs("div",{className:"flex flex-col justify-center space-y-2 rounded-md p-10",children:[m.jsx("p",{className:"text-lg font-semibold",children:"Oops! Looks like we tripped on a loose wire!"}),m.jsx("p",{className:"text-sm",children:"Something went wrong:"}),m.jsx("pre",{className:"text-xs",children:e.message})]})]})}function wB({error:e}){return m.jsxs("div",{className:"flex h-full flex-col items-center justify-center",role:"alert",children:[m.jsx("div",{className:"flex flex-col justify-center space-y-2 rounded-md p-10"}),m.jsxs("div",{className:"flex flex-col justify-center space-y-2 rounded-md p-10",children:[m.jsx("p",{className:"text-lg font-semibold",children:"Oops! Something went wrong!"}),m.jsx("p",{className:"text-sm",children:"Something went wrong:"}),m.jsx("pre",{className:"text-xs",children:e.message})]})]})}function Rr({number:e,decimalPlaces:t=0,useSuffix:n=!1,customSuffix:r="",currency:o="",locale:i="en-US"}){let s=1,a=r,l=i;const c=t;n&&!r&&(e>=1e9?(s=1e9,a="B"):e>=1e7&&i==="en-IN"?(s=1e7,a="Cr"):e>=1e5&&i==="en-IN"?(s=1e5,a="L"):e>=1e6?(s=1e6,a="M"):e>=1e3&&(s=1e3,a="K"));const u=e/s,d={maximumFractionDigits:c,minimumFractionDigits:c};if(o){d.style="currency",d.currency=o;try{new Intl.NumberFormat(i,d).format(0)}catch{}}try{new Intl.NumberFormat(i,d).format(0)}catch{l="en-US"}let f=new Intl.NumberFormat(l,d).format(u);return n&&(f+=a),f}function rw(e,t){if(!t)return"";const n=t.find(r=>e>=r.start&&e<=r.end);return(n==null?void 0:n.color)||""}function mv(e){try{const n=new Function("getDatalabelColor",e)($0);return{options:n==null?void 0:n.options,plugins:(n==null?void 0:n.plugins)||[]}}catch(t){return console.error("Error processing custom visual code",t),{options:{},plugins:[]}}}function SB(e){var t,n,r,o,i,s,a,l,c,u,d,h,f,p,g,b,v,x;return!e||((r=(n=(t=e==null?void 0:e.scales)==null?void 0:t.x)==null?void 0:n.grid)==null?void 0:r.display)===!0&&((s=(i=(o=e==null?void 0:e.scales)==null?void 0:o.y)==null?void 0:i.grid)==null?void 0:s.display)===!0?"xy":(c=(l=(a=e.scales)==null?void 0:a.x)==null?void 0:l.grid)!=null&&c.display?"x":(h=(d=(u=e.scales)==null?void 0:u.y)==null?void 0:d.grid)!=null&&h.display?"y":((g=(p=(f=e.scales)==null?void 0:f.x)==null?void 0:p.grid)==null?void 0:g.display)===!1&&((x=(v=(b=e.scales)==null?void 0:b.y)==null?void 0:v.grid)==null?void 0:x.display)===!1?"none":"xy"}function CB(e){const t=getComputedStyle(document.documentElement).getPropertyValue(e);return uO(t)}function uO(e){const[t,n,r]=e.split(" "),o=parseFloat(t),i=parseFloat(n),s=parseFloat(r),a=i/100,l=s/100,c=(1-Math.abs(2*l-1))*a,u=c*(1-Math.abs(o/60%2-1)),d=l-c/2;let h=0,f=0,p=0;0<=o&&o<60?(h=c,f=u,p=0):60<=o&&o<120?(h=u,f=c,p=0):120<=o&&o<180?(h=0,f=c,p=u):180<=o&&o<240?(h=0,f=u,p=c):240<=o&&o<300?(h=u,f=0,p=c):300<=o&&o<360&&(h=c,f=0,p=u),h=Math.round((h+d)*255),f=Math.round((f+d)*255),p=Math.round((p+d)*255);const g=b=>{const v=b.toString(16);return v.length==1?"0"+v:v};return`#${g(h)}${g(f)}${g(p)}`}function ls({data:e,cfg:t,customCfg:n,preferences:r,cardType:o}){se.getState().themeStyle;const i=o==="radar"?.2:1,{dimensionKeys:s,metricKeys:a}=Xt(e),l=iB(a,e,r,i),c=Vc(l,n),u=s[0],d=gv(e,u);ow(r,t),dO(r);const{options:h,plugins:f}=bv({cardType:o,cfg:t,preferences:r,customCfg:n});return{type:(n==null?void 0:n.type)||(t==null?void 0:t.type)||"bar",data:{labels:d,datasets:c},options:h,plugins:f}}function ow(e,t){var o,i,s;const n=((o=t==null?void 0:t.options)==null?void 0:o.indexAxis)==="y"?"x":"y";return(i=e==null?void 0:e.chartOptions)!=null&&i.indexAxis?((s=e==null?void 0:e.chartOptions)==null?void 0:s.indexAxis)==="x"?"y":"x":n}function dO(e){var n,r;return(n=e==null?void 0:e.chartOptions)!=null&&n.indexAxis?((r=e==null?void 0:e.chartOptions)==null?void 0:r.indexAxis)==="x"?"x":"y":"x"}function fO(e,t){var i,s,a,l,c,u,d,h,f,p,g,b;const n=ow(t,e),r=dO(t);return{...e==null?void 0:e.options,scales:{...(i=e==null?void 0:e.options)==null?void 0:i.scales,[n]:{...(a=(s=e==null?void 0:e.options)==null?void 0:s.scales)==null?void 0:a[n],ticks:{...(u=(c=(l=e==null?void 0:e.options)==null?void 0:l.scales)==null?void 0:c[n])==null?void 0:u.ticks,callback:v=>{var x,y,_,w;return Rr({number:Number(v),decimalPlaces:((x=t==null?void 0:t.numberAxisFormat)==null?void 0:x.decimalPlaces)||0,useSuffix:!!((y=t==null?void 0:t.numberAxisFormat)!=null&&y.suffix),customSuffix:"",locale:((_=t==null?void 0:t.numberAxisFormat)==null?void 0:_.locale)||"",currency:((w=t==null?void 0:t.numberAxisFormat)==null?void 0:w.currency)||""})}}},[r]:{...(f=(h=(d=e==null?void 0:e.options)==null?void 0:d.scales)==null?void 0:h[r])==null?void 0:f.ticks,callback:null}},plugins:{...(p=e==null?void 0:e.options)==null?void 0:p.plugins,datalabels:{...(b=(g=e==null?void 0:e.options)==null?void 0:g.plugins)==null?void 0:b.datalabels,formatter:function(v){var x,y,_,w;return Rr({number:Number(v),decimalPlaces:((x=t==null?void 0:t.numberAxisFormat)==null?void 0:x.decimalPlaces)||0,useSuffix:!!((y=t==null?void 0:t.numberAxisFormat)!=null&&y.suffix),customSuffix:"",locale:((_=t==null?void 0:t.numberAxisFormat)==null?void 0:_.locale)||"",currency:((w=t==null?void 0:t.numberAxisFormat)==null?void 0:w.currency)||""})}}}}}function bv({cardType:e,cfg:t,preferences:n,customCfg:r}){var f,p,g,b,v,x,y,_,w,C,R,k,D,I,T,N,G,z,O,A,L,j,B,M,W,F,P,U,q,K,H;const o=se.getState().themeStyle,i=fO(t,n),s=ar((t==null?void 0:t.options)||{},n==null?void 0:n.chartOptions),a=ar(i,s),l=ar(a,(r==null?void 0:r.options)||{}),c={...l,scales:{...l==null?void 0:l.scales,x:{...(f=l==null?void 0:l.scales)==null?void 0:f.x,grid:{...(g=(p=l==null?void 0:l.scales)==null?void 0:p.x)==null?void 0:g.grid,color:(_=(y=(x=(v=(b=o==null?void 0:o.chart)==null?void 0:b.options)==null?void 0:v.scales)==null?void 0:x.x)==null?void 0:y.grid)==null?void 0:_.color}},y:{...(w=l==null?void 0:l.scales)==null?void 0:w.y,grid:{...(R=(C=l==null?void 0:l.scales)==null?void 0:C.y)==null?void 0:R.grid,color:(N=(T=(I=(D=(k=o==null?void 0:o.chart)==null?void 0:k.options)==null?void 0:D.scales)==null?void 0:I.y)==null?void 0:T.grid)==null?void 0:N.color}}},plugins:{...l==null?void 0:l.plugins,tooltip:{filter:function(V){return V.raw!==void 0&&V.raw!==0},callbacks:{title:function(V){var Z,ne,J,oe,ee;const Q=((Z=V==null?void 0:V[0])==null?void 0:Z.label)||"";if(V.length>1&&["stackedBar","stackedLine"].includes(e||"")){const ue=V.reduce((ye,he)=>{const me=he.raw;return me!==void 0&&me!==0?ye+me:ye},0),de=Rr({number:ue,decimalPlaces:((ne=n==null?void 0:n.numberAxisFormat)==null?void 0:ne.decimalPlaces)||0,useSuffix:!!((J=n==null?void 0:n.numberAxisFormat)!=null&&J.suffix),customSuffix:"",locale:((oe=n==null?void 0:n.numberAxisFormat)==null?void 0:oe.locale)||"",currency:((ee=n==null?void 0:n.numberAxisFormat)==null?void 0:ee.currency)||""});return`${Q} (${de})`}return Q},label:function(V){var J,oe,ee,ue,de;const Q=((J=V==null?void 0:V.dataset)==null?void 0:J.label)||"",Z=V==null?void 0:V.raw;if(Z===void 0||Z===0)return;const ne=Rr({number:Number(Z),decimalPlaces:((oe=n==null?void 0:n.numberAxisFormat)==null?void 0:oe.decimalPlaces)||0,useSuffix:!!((ee=n==null?void 0:n.numberAxisFormat)!=null&&ee.suffix),customSuffix:"",locale:((ue=n==null?void 0:n.numberAxisFormat)==null?void 0:ue.locale)||"",currency:((de=n==null?void 0:n.numberAxisFormat)==null?void 0:de.currency)||""});return`${Q}: ${ne}`},...(z=(G=l==null?void 0:l.plugins)==null?void 0:G.tooltip)==null?void 0:z.callbacks},...(O=l==null?void 0:l.plugins)==null?void 0:O.tooltip,backgroundColor:(B=(j=(L=(A=o==null?void 0:o.chart)==null?void 0:A.options)==null?void 0:L.plugins)==null?void 0:j.tooltip)==null?void 0:B.backgroundColor,bodyColor:(P=(F=(W=(M=o==null?void 0:o.chart)==null?void 0:M.options)==null?void 0:W.plugins)==null?void 0:F.tooltip)==null?void 0:P.bodyColor,titleColor:(H=(K=(q=(U=o==null?void 0:o.chart)==null?void 0:U.options)==null?void 0:q.plugins)==null?void 0:K.tooltip)==null?void 0:H.titleColor}}},{plugins:u,options:d}=mv((n==null?void 0:n.customVisualCode)||"");return{options:ar(c,d),plugins:u}}/*!
229
- * @kurkle/color v0.3.4
230
- * https://github.com/kurkle/color#readme
231
- * (c) 2024 Jukka Kurkela
232
- * Released under the MIT License
233
- */function yd(e){return e+.5|0}const Mi=(e,t,n)=>Math.max(Math.min(e,n),t);function Hc(e){return Mi(yd(e*2.55),0,255)}function Ni(e){return Mi(yd(e*255),0,255)}function Uo(e){return Mi(yd(e/2.55)/100,0,1)}function r_(e){return Mi(yd(e*100),0,100)}const xr={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},vv=[..."0123456789ABCDEF"],_B=e=>vv[e&15],EB=e=>vv[(e&240)>>4]+vv[e&15],hf=e=>(e&240)>>4===(e&15),RB=e=>hf(e.r)&&hf(e.g)&&hf(e.b)&&hf(e.a);function PB(e){var t=e.length,n;return e[0]==="#"&&(t===4||t===5?n={r:255&xr[e[1]]*17,g:255&xr[e[2]]*17,b:255&xr[e[3]]*17,a:t===5?xr[e[4]]*17:255}:(t===7||t===9)&&(n={r:xr[e[1]]<<4|xr[e[2]],g:xr[e[3]]<<4|xr[e[4]],b:xr[e[5]]<<4|xr[e[6]],a:t===9?xr[e[7]]<<4|xr[e[8]]:255})),n}const MB=(e,t)=>e<255?t(e):"";function kB(e){var t=RB(e)?_B:EB;return e?"#"+t(e.r)+t(e.g)+t(e.b)+MB(e.a,t):void 0}const OB=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function hO(e,t,n){const r=t*Math.min(n,1-n),o=(i,s=(i+e/30)%12)=>n-r*Math.max(Math.min(s-3,9-s,1),-1);return[o(0),o(8),o(4)]}function DB(e,t,n){const r=(o,i=(o+e/60)%6)=>n-n*t*Math.max(Math.min(i,4-i,1),0);return[r(5),r(3),r(1)]}function TB(e,t,n){const r=hO(e,1,.5);let o;for(t+n>1&&(o=1/(t+n),t*=o,n*=o),o=0;o<3;o++)r[o]*=1-t-n,r[o]+=t;return r}function IB(e,t,n,r,o){return e===o?(t-n)/r+(t<n?6:0):t===o?(n-e)/r+2:(e-t)/r+4}function iw(e){const n=e.r/255,r=e.g/255,o=e.b/255,i=Math.max(n,r,o),s=Math.min(n,r,o),a=(i+s)/2;let l,c,u;return i!==s&&(u=i-s,c=a>.5?u/(2-i-s):u/(i+s),l=IB(n,r,o,u,i),l=l*60+.5),[l|0,c||0,a]}function sw(e,t,n,r){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,r)).map(Ni)}function aw(e,t,n){return sw(hO,e,t,n)}function AB(e,t,n){return sw(TB,e,t,n)}function NB(e,t,n){return sw(DB,e,t,n)}function pO(e){return(e%360+360)%360}function jB(e){const t=OB.exec(e);let n=255,r;if(!t)return;t[5]!==r&&(n=t[6]?Hc(+t[5]):Ni(+t[5]));const o=pO(+t[2]),i=+t[3]/100,s=+t[4]/100;return t[1]==="hwb"?r=AB(o,i,s):t[1]==="hsv"?r=NB(o,i,s):r=aw(o,i,s),{r:r[0],g:r[1],b:r[2],a:n}}function FB(e,t){var n=iw(e);n[0]=pO(n[0]+t),n=aw(n),e.r=n[0],e.g=n[1],e.b=n[2]}function LB(e){if(!e)return;const t=iw(e),n=t[0],r=r_(t[1]),o=r_(t[2]);return e.a<255?`hsla(${n}, ${r}%, ${o}%, ${Uo(e.a)})`:`hsl(${n}, ${r}%, ${o}%)`}const o_={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},i_={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function $B(){const e={},t=Object.keys(i_),n=Object.keys(o_);let r,o,i,s,a;for(r=0;r<t.length;r++){for(s=a=t[r],o=0;o<n.length;o++)i=n[o],a=a.replace(i,o_[i]);i=parseInt(i_[s],16),e[a]=[i>>16&255,i>>8&255,i&255]}return e}let pf;function zB(e){pf||(pf=$B(),pf.transparent=[0,0,0,0]);const t=pf[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const BB=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function VB(e){const t=BB.exec(e);let n=255,r,o,i;if(t){if(t[7]!==r){const s=+t[7];n=t[8]?Hc(s):Mi(s*255,0,255)}return r=+t[1],o=+t[3],i=+t[5],r=255&(t[2]?Hc(r):Mi(r,0,255)),o=255&(t[4]?Hc(o):Mi(o,0,255)),i=255&(t[6]?Hc(i):Mi(i,0,255)),{r,g:o,b:i,a:n}}}function HB(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${Uo(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}const rb=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,Oa=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function WB(e,t,n){const r=Oa(Uo(e.r)),o=Oa(Uo(e.g)),i=Oa(Uo(e.b));return{r:Ni(rb(r+n*(Oa(Uo(t.r))-r))),g:Ni(rb(o+n*(Oa(Uo(t.g))-o))),b:Ni(rb(i+n*(Oa(Uo(t.b))-i))),a:e.a+n*(t.a-e.a)}}function gf(e,t,n){if(e){let r=iw(e);r[t]=Math.max(0,Math.min(r[t]+r[t]*n,t===0?360:1)),r=aw(r),e.r=r[0],e.g=r[1],e.b=r[2]}}function gO(e,t){return e&&Object.assign(t||{},e)}function s_(e){var t={r:0,g:0,b:0,a:255};return Array.isArray(e)?e.length>=3&&(t={r:e[0],g:e[1],b:e[2],a:255},e.length>3&&(t.a=Ni(e[3]))):(t=gO(e,{r:0,g:0,b:0,a:1}),t.a=Ni(t.a)),t}function UB(e){return e.charAt(0)==="r"?VB(e):jB(e)}let mO=class yv{constructor(t){if(t instanceof yv)return t;const n=typeof t;let r;n==="object"?r=s_(t):n==="string"&&(r=PB(t)||zB(t)||UB(t)),this._rgb=r,this._valid=!!r}get valid(){return this._valid}get rgb(){var t=gO(this._rgb);return t&&(t.a=Uo(t.a)),t}set rgb(t){this._rgb=s_(t)}rgbString(){return this._valid?HB(this._rgb):void 0}hexString(){return this._valid?kB(this._rgb):void 0}hslString(){return this._valid?LB(this._rgb):void 0}mix(t,n){if(t){const r=this.rgb,o=t.rgb;let i;const s=n===i?.5:n,a=2*s-1,l=r.a-o.a,c=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;i=1-c,r.r=255&c*r.r+i*o.r+.5,r.g=255&c*r.g+i*o.g+.5,r.b=255&c*r.b+i*o.b+.5,r.a=s*r.a+(1-s)*o.a,this.rgb=r}return this}interpolate(t,n){return t&&(this._rgb=WB(this._rgb,t._rgb,n)),this}clone(){return new yv(this.rgb)}alpha(t){return this._rgb.a=Ni(t),this}clearer(t){const n=this._rgb;return n.a*=1-t,this}greyscale(){const t=this._rgb,n=yd(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=n,this}opaquer(t){const n=this._rgb;return n.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return gf(this._rgb,2,t),this}darken(t){return gf(this._rgb,2,-t),this}saturate(t){return gf(this._rgb,1,t),this}desaturate(t){return gf(this._rgb,1,-t),this}rotate(t){return FB(this._rgb,t),this}};/*!
234
- * Chart.js v4.4.8
235
- * https://www.chartjs.org
236
- * (c) 2025 Chart.js Contributors
237
- * Released under the MIT License
238
- */function jo(){}const qB=(()=>{let e=0;return()=>e++})();function Ne(e){return e==null}function Rt(e){if(Array.isArray&&Array.isArray(e))return!0;const t=Object.prototype.toString.call(e);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function qe(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function jt(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function sr(e,t){return jt(e)?e:t}function ke(e,t){return typeof e>"u"?t:e}const GB=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100:+e/t,bO=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;function ht(e,t,n){if(e&&typeof e.call=="function")return e.apply(n,t)}function ct(e,t,n,r){let o,i,s;if(Rt(e))for(i=e.length,o=0;o<i;o++)t.call(n,e[o],o);else if(qe(e))for(s=Object.keys(e),i=s.length,o=0;o<i;o++)t.call(n,e[s[o]],s[o])}function Vh(e,t){let n,r,o,i;if(!e||!t||e.length!==t.length)return!1;for(n=0,r=e.length;n<r;++n)if(o=e[n],i=t[n],o.datasetIndex!==i.datasetIndex||o.index!==i.index)return!1;return!0}function Hh(e){if(Rt(e))return e.map(Hh);if(qe(e)){const t=Object.create(null),n=Object.keys(e),r=n.length;let o=0;for(;o<r;++o)t[n[o]]=Hh(e[n[o]]);return t}return e}function vO(e){return["__proto__","prototype","constructor"].indexOf(e)===-1}function YB(e,t,n,r){if(!vO(e))return;const o=t[e],i=n[e];qe(o)&&qe(i)?Zt(o,i,r):t[e]=Hh(i)}function Zt(e,t,n){const r=Rt(t)?t:[t],o=r.length;if(!qe(e))return e;n=n||{};const i=n.merger||YB;let s;for(let a=0;a<o;++a){if(s=r[a],!qe(s))continue;const l=Object.keys(s);for(let c=0,u=l.length;c<u;++c)i(l[c],e,s,n)}return e}function nu(e,t){return Zt(e,t,{merger:KB})}function KB(e,t,n){if(!vO(e))return;const r=t[e],o=n[e];qe(r)&&qe(o)?nu(r,o):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=Hh(o))}const a_={"":e=>e,x:e=>e.x,y:e=>e.y};function XB(e){const t=e.split("."),n=[];let r="";for(const o of t)r+=o,r.endsWith("\\")?r=r.slice(0,-1)+".":(n.push(r),r="");return n}function QB(e){const t=XB(e);return n=>{for(const r of t){if(r==="")break;n=n&&n[r]}return n}}function $i(e,t){return(a_[t]||(a_[t]=QB(t)))(e)}function lw(e){return e.charAt(0).toUpperCase()+e.slice(1)}const Ou=e=>typeof e<"u",zi=e=>typeof e=="function",l_=(e,t)=>{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0};function JB(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const kt=Math.PI,Pt=2*kt,ZB=Pt+kt,Wh=Number.POSITIVE_INFINITY,eV=kt/180,$t=kt/2,cs=kt/4,c_=kt*2/3,ki=Math.log10,go=Math.sign;function ru(e,t,n){return Math.abs(e-t)<n}function u_(e){const t=Math.round(e);e=ru(e,t,e/1e3)?t:e;const n=Math.pow(10,Math.floor(ki(e))),r=e/n;return(r<=1?1:r<=2?2:r<=5?5:10)*n}function tV(e){const t=[],n=Math.sqrt(e);let r;for(r=1;r<n;r++)e%r===0&&(t.push(r),t.push(e/r));return n===(n|0)&&t.push(n),t.sort((o,i)=>o-i).pop(),t}function nV(e){return typeof e=="symbol"||typeof e=="object"&&e!==null&&!(Symbol.toPrimitive in e||"toString"in e||"valueOf"in e)}function Al(e){return!nV(e)&&!isNaN(parseFloat(e))&&isFinite(e)}function rV(e,t){const n=Math.round(e);return n-t<=e&&n+t>=e}function yO(e,t,n){let r,o,i;for(r=0,o=e.length;r<o;r++)i=e[r][n],isNaN(i)||(t.min=Math.min(t.min,i),t.max=Math.max(t.max,i))}function zr(e){return e*(kt/180)}function cw(e){return e*(180/kt)}function d_(e){if(!jt(e))return;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n++;return n}function xO(e,t){const n=t.x-e.x,r=t.y-e.y,o=Math.sqrt(n*n+r*r);let i=Math.atan2(r,n);return i<-.5*kt&&(i+=Pt),{angle:i,distance:o}}function xv(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function oV(e,t){return(e-t+ZB)%Pt-kt}function cr(e){return(e%Pt+Pt)%Pt}function Du(e,t,n,r){const o=cr(e),i=cr(t),s=cr(n),a=cr(i-o),l=cr(s-o),c=cr(o-i),u=cr(o-s);return o===i||o===s||r&&i===s||a>l&&c<u}function Jt(e,t,n){return Math.max(t,Math.min(n,e))}function iV(e){return Jt(e,-32768,32767)}function Jo(e,t,n,r=1e-6){return e>=Math.min(t,n)-r&&e<=Math.max(t,n)+r}function uw(e,t,n){n=n||(s=>e[s]<t);let r=e.length-1,o=0,i;for(;r-o>1;)i=o+r>>1,n(i)?o=i:r=i;return{lo:o,hi:r}}const Zo=(e,t,n,r)=>uw(e,n,r?o=>{const i=e[o][t];return i<n||i===n&&e[o+1][t]===n}:o=>e[o][t]<n),sV=(e,t,n)=>uw(e,n,r=>e[r][t]>=n);function aV(e,t,n){let r=0,o=e.length;for(;r<o&&e[r]<t;)r++;for(;o>r&&e[o-1]>n;)o--;return r>0||o<e.length?e.slice(r,o):e}const wO=["push","pop","shift","splice","unshift"];function lV(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),wO.forEach(n=>{const r="_onData"+lw(n),o=e[n];Object.defineProperty(e,n,{configurable:!0,enumerable:!1,value(...i){const s=o.apply(this,i);return e._chartjs.listeners.forEach(a=>{typeof a[r]=="function"&&a[r](...i)}),s}})})}function f_(e,t){const n=e._chartjs;if(!n)return;const r=n.listeners,o=r.indexOf(t);o!==-1&&r.splice(o,1),!(r.length>0)&&(wO.forEach(i=>{delete e[i]}),delete e._chartjs)}function SO(e){const t=new Set(e);return t.size===e.length?e:Array.from(t)}const CO=function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame}();function _O(e,t){let n=[],r=!1;return function(...o){n=o,r||(r=!0,CO.call(window,()=>{r=!1,e.apply(t,n)}))}}function cV(e,t){let n;return function(...r){return t?(clearTimeout(n),n=setTimeout(e,t,r)):e.apply(this,r),t}}const dw=e=>e==="start"?"left":e==="end"?"right":"center",hn=(e,t,n)=>e==="start"?t:e==="end"?n:(t+n)/2,uV=(e,t,n,r)=>e===(r?"left":"right")?n:e==="center"?(t+n)/2:t;function EO(e,t,n){const r=t.length;let o=0,i=r;if(e._sorted){const{iScale:s,vScale:a,_parsed:l}=e,c=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null,u=s.axis,{min:d,max:h,minDefined:f,maxDefined:p}=s.getUserBounds();if(f){if(o=Math.min(Zo(l,u,d).lo,n?r:Zo(t,u,s.getPixelForValue(d)).lo),c){const g=l.slice(0,o+1).reverse().findIndex(b=>!Ne(b[a.axis]));o-=Math.max(0,g)}o=Jt(o,0,r-1)}if(p){let g=Math.max(Zo(l,s.axis,h,!0).hi+1,n?0:Zo(t,u,s.getPixelForValue(h),!0).hi+1);if(c){const b=l.slice(g-1).findIndex(v=>!Ne(v[a.axis]));g+=Math.max(0,b)}i=Jt(g,o,r)-o}else i=r-o}return{start:o,count:i}}function RO(e){const{xScale:t,yScale:n,_scaleRanges:r}=e,o={xmin:t.min,xmax:t.max,ymin:n.min,ymax:n.max};if(!r)return e._scaleRanges=o,!0;const i=r.xmin!==t.min||r.xmax!==t.max||r.ymin!==n.min||r.ymax!==n.max;return Object.assign(r,o),i}const mf=e=>e===0||e===1,h_=(e,t,n)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*Pt/n)),p_=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*Pt/n)+1,ou={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>-e*(e-2),easeInOutQuad:e=>(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1),easeInCubic:e=>e*e*e,easeOutCubic:e=>(e-=1)*e*e+1,easeInOutCubic:e=>(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2),easeInQuart:e=>e*e*e*e,easeOutQuart:e=>-((e-=1)*e*e*e-1),easeInOutQuart:e=>(e/=.5)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2),easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>(e-=1)*e*e*e*e+1,easeInOutQuint:e=>(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2),easeInSine:e=>-Math.cos(e*$t)+1,easeOutSine:e=>Math.sin(e*$t),easeInOutSine:e=>-.5*(Math.cos(kt*e)-1),easeInExpo:e=>e===0?0:Math.pow(2,10*(e-1)),easeOutExpo:e=>e===1?1:-Math.pow(2,-10*e)+1,easeInOutExpo:e=>mf(e)?e:e<.5?.5*Math.pow(2,10*(e*2-1)):.5*(-Math.pow(2,-10*(e*2-1))+2),easeInCirc:e=>e>=1?e:-(Math.sqrt(1-e*e)-1),easeOutCirc:e=>Math.sqrt(1-(e-=1)*e),easeInOutCirc:e=>(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1),easeInElastic:e=>mf(e)?e:h_(e,.075,.3),easeOutElastic:e=>mf(e)?e:p_(e,.075,.3),easeInOutElastic(e){return mf(e)?e:e<.5?.5*h_(e*2,.1125,.45):.5+.5*p_(e*2-1,.1125,.45)},easeInBack(e){return e*e*((1.70158+1)*e-1.70158)},easeOutBack(e){return(e-=1)*e*((1.70158+1)*e+1.70158)+1},easeInOutBack(e){let t=1.70158;return(e/=.5)<1?.5*(e*e*(((t*=1.525)+1)*e-t)):.5*((e-=2)*e*(((t*=1.525)+1)*e+t)+2)},easeInBounce:e=>1-ou.easeOutBounce(1-e),easeOutBounce(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},easeInOutBounce:e=>e<.5?ou.easeInBounce(e*2)*.5:ou.easeOutBounce(e*2-1)*.5+.5};function fw(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function g_(e){return fw(e)?e:new mO(e)}function ob(e){return fw(e)?e:new mO(e).saturate(.5).darken(.1).hexString()}const dV=["x","y","borderWidth","radius","tension"],fV=["color","borderColor","backgroundColor"];function hV(e){e.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),e.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),e.set("animations",{colors:{type:"color",properties:fV},numbers:{type:"number",properties:dV}}),e.describe("animations",{_fallback:"animation"}),e.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>t|0}}}})}function pV(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const m_=new Map;function gV(e,t){t=t||{};const n=e+JSON.stringify(t);let r=m_.get(n);return r||(r=new Intl.NumberFormat(e,t),m_.set(n,r)),r}function xd(e,t,n){return gV(t,n).format(e)}const PO={values(e){return Rt(e)?e:""+e},numeric(e,t,n){if(e===0)return"0";const r=this.chart.options.locale;let o,i=e;if(n.length>1){const c=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(c<1e-4||c>1e15)&&(o="scientific"),i=mV(e,n)}const s=ki(Math.abs(i)),a=isNaN(s)?1:Math.max(Math.min(-1*Math.floor(s),20),0),l={notation:o,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),xd(e,r,l)},logarithmic(e,t,n){if(e===0)return"0";const r=n[t].significand||e/Math.pow(10,Math.floor(ki(e)));return[1,2,3,5,10,15].includes(r)||t>.8*n.length?PO.numeric.call(this,e,t,n):""}};function mV(e,t){let n=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(n)>=1&&e!==Math.floor(e)&&(n=e-Math.floor(e)),n}var hg={formatters:PO};function bV(e){e.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,n)=>n.lineWidth,tickColor:(t,n)=>n.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:hg.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),e.route("scale.ticks","color","","color"),e.route("scale.grid","color","","borderColor"),e.route("scale.border","color","","borderColor"),e.route("scale.title","color","","color"),e.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),e.describe("scales",{_fallback:"scale"}),e.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const ra=Object.create(null),wv=Object.create(null);function iu(e,t){if(!t)return e;const n=t.split(".");for(let r=0,o=n.length;r<o;++r){const i=n[r];e=e[i]||(e[i]=Object.create(null))}return e}function ib(e,t,n){return typeof t=="string"?Zt(iu(e,t),n):Zt(iu(e,""),t)}class vV{constructor(t,n){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=r=>r.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(r,o)=>ob(o.backgroundColor),this.hoverBorderColor=(r,o)=>ob(o.borderColor),this.hoverColor=(r,o)=>ob(o.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(n)}set(t,n){return ib(this,t,n)}get(t){return iu(this,t)}describe(t,n){return ib(wv,t,n)}override(t,n){return ib(ra,t,n)}route(t,n,r,o){const i=iu(this,t),s=iu(this,r),a="_"+n;Object.defineProperties(i,{[a]:{value:i[n],writable:!0},[n]:{enumerable:!0,get(){const l=this[a],c=s[o];return qe(l)?Object.assign({},c,l):ke(l,c)},set(l){this[a]=l}}})}apply(t){t.forEach(n=>n(this))}}var Mt=new vV({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[hV,pV,bV]);function yV(e){return!e||Ne(e.size)||Ne(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function Uh(e,t,n,r,o){let i=t[o];return i||(i=t[o]=e.measureText(o).width,n.push(o)),i>r&&(r=i),r}function xV(e,t,n,r){r=r||{};let o=r.data=r.data||{},i=r.garbageCollect=r.garbageCollect||[];r.font!==t&&(o=r.data={},i=r.garbageCollect=[],r.font=t),e.save(),e.font=t;let s=0;const a=n.length;let l,c,u,d,h;for(l=0;l<a;l++)if(d=n[l],d!=null&&!Rt(d))s=Uh(e,o,i,s,d);else if(Rt(d))for(c=0,u=d.length;c<u;c++)h=d[c],h!=null&&!Rt(h)&&(s=Uh(e,o,i,s,h));e.restore();const f=i.length/2;if(f>n.length){for(l=0;l<f;l++)delete o[i[l]];i.splice(0,f)}return s}function us(e,t,n){const r=e.currentDevicePixelRatio,o=n!==0?Math.max(n/2,.5):0;return Math.round((t-o)*r)/r+o}function b_(e,t){!t&&!e||(t=t||e.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore())}function qh(e,t,n,r){MO(e,t,n,r,null)}function MO(e,t,n,r,o){let i,s,a,l,c,u,d,h;const f=t.pointStyle,p=t.rotation,g=t.radius;let b=(p||0)*eV;if(f&&typeof f=="object"&&(i=f.toString(),i==="[object HTMLImageElement]"||i==="[object HTMLCanvasElement]")){e.save(),e.translate(n,r),e.rotate(b),e.drawImage(f,-f.width/2,-f.height/2,f.width,f.height),e.restore();return}if(!(isNaN(g)||g<=0)){switch(e.beginPath(),f){default:o?e.ellipse(n,r,o/2,g,0,0,Pt):e.arc(n,r,g,0,Pt),e.closePath();break;case"triangle":u=o?o/2:g,e.moveTo(n+Math.sin(b)*u,r-Math.cos(b)*g),b+=c_,e.lineTo(n+Math.sin(b)*u,r-Math.cos(b)*g),b+=c_,e.lineTo(n+Math.sin(b)*u,r-Math.cos(b)*g),e.closePath();break;case"rectRounded":c=g*.516,l=g-c,s=Math.cos(b+cs)*l,d=Math.cos(b+cs)*(o?o/2-c:l),a=Math.sin(b+cs)*l,h=Math.sin(b+cs)*(o?o/2-c:l),e.arc(n-d,r-a,c,b-kt,b-$t),e.arc(n+h,r-s,c,b-$t,b),e.arc(n+d,r+a,c,b,b+$t),e.arc(n-h,r+s,c,b+$t,b+kt),e.closePath();break;case"rect":if(!p){l=Math.SQRT1_2*g,u=o?o/2:l,e.rect(n-u,r-l,2*u,2*l);break}b+=cs;case"rectRot":d=Math.cos(b)*(o?o/2:g),s=Math.cos(b)*g,a=Math.sin(b)*g,h=Math.sin(b)*(o?o/2:g),e.moveTo(n-d,r-a),e.lineTo(n+h,r-s),e.lineTo(n+d,r+a),e.lineTo(n-h,r+s),e.closePath();break;case"crossRot":b+=cs;case"cross":d=Math.cos(b)*(o?o/2:g),s=Math.cos(b)*g,a=Math.sin(b)*g,h=Math.sin(b)*(o?o/2:g),e.moveTo(n-d,r-a),e.lineTo(n+d,r+a),e.moveTo(n+h,r-s),e.lineTo(n-h,r+s);break;case"star":d=Math.cos(b)*(o?o/2:g),s=Math.cos(b)*g,a=Math.sin(b)*g,h=Math.sin(b)*(o?o/2:g),e.moveTo(n-d,r-a),e.lineTo(n+d,r+a),e.moveTo(n+h,r-s),e.lineTo(n-h,r+s),b+=cs,d=Math.cos(b)*(o?o/2:g),s=Math.cos(b)*g,a=Math.sin(b)*g,h=Math.sin(b)*(o?o/2:g),e.moveTo(n-d,r-a),e.lineTo(n+d,r+a),e.moveTo(n+h,r-s),e.lineTo(n-h,r+s);break;case"line":s=o?o/2:Math.cos(b)*g,a=Math.sin(b)*g,e.moveTo(n-s,r-a),e.lineTo(n+s,r+a);break;case"dash":e.moveTo(n,r),e.lineTo(n+Math.cos(b)*(o?o/2:g),r+Math.sin(b)*g);break;case!1:e.closePath();break}e.fill(),t.borderWidth>0&&e.stroke()}}function ei(e,t,n){return n=n||.5,!t||e&&e.x>t.left-n&&e.x<t.right+n&&e.y>t.top-n&&e.y<t.bottom+n}function Bs(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function Vs(e){e.restore()}function wV(e,t,n,r,o){if(!t)return e.lineTo(n.x,n.y);if(o==="middle"){const i=(t.x+n.x)/2;e.lineTo(i,t.y),e.lineTo(i,n.y)}else o==="after"!=!!r?e.lineTo(t.x,n.y):e.lineTo(n.x,t.y);e.lineTo(n.x,n.y)}function SV(e,t,n,r){if(!t)return e.lineTo(n.x,n.y);e.bezierCurveTo(r?t.cp1x:t.cp2x,r?t.cp1y:t.cp2y,r?n.cp2x:n.cp1x,r?n.cp2y:n.cp1y,n.x,n.y)}function CV(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),Ne(t.rotation)||e.rotate(t.rotation),t.color&&(e.fillStyle=t.color),t.textAlign&&(e.textAlign=t.textAlign),t.textBaseline&&(e.textBaseline=t.textBaseline)}function _V(e,t,n,r,o){if(o.strikethrough||o.underline){const i=e.measureText(r),s=t-i.actualBoundingBoxLeft,a=t+i.actualBoundingBoxRight,l=n-i.actualBoundingBoxAscent,c=n+i.actualBoundingBoxDescent,u=o.strikethrough?(l+c)/2:c;e.strokeStyle=e.fillStyle,e.beginPath(),e.lineWidth=o.decorationWidth||2,e.moveTo(s,u),e.lineTo(a,u),e.stroke()}}function EV(e,t){const n=e.fillStyle;e.fillStyle=t.color,e.fillRect(t.left,t.top,t.width,t.height),e.fillStyle=n}function oa(e,t,n,r,o,i={}){const s=Rt(t)?t:[t],a=i.strokeWidth>0&&i.strokeColor!=="";let l,c;for(e.save(),e.font=o.string,CV(e,i),l=0;l<s.length;++l)c=s[l],i.backdrop&&EV(e,i.backdrop),a&&(i.strokeColor&&(e.strokeStyle=i.strokeColor),Ne(i.strokeWidth)||(e.lineWidth=i.strokeWidth),e.strokeText(c,n,r,i.maxWidth)),e.fillText(c,n,r,i.maxWidth),_V(e,n,r,c,i),r+=Number(o.lineHeight);e.restore()}function Tu(e,t){const{x:n,y:r,w:o,h:i,radius:s}=t;e.arc(n+s.topLeft,r+s.topLeft,s.topLeft,1.5*kt,kt,!0),e.lineTo(n,r+i-s.bottomLeft),e.arc(n+s.bottomLeft,r+i-s.bottomLeft,s.bottomLeft,kt,$t,!0),e.lineTo(n+o-s.bottomRight,r+i),e.arc(n+o-s.bottomRight,r+i-s.bottomRight,s.bottomRight,$t,0,!0),e.lineTo(n+o,r+s.topRight),e.arc(n+o-s.topRight,r+s.topRight,s.topRight,0,-$t,!0),e.lineTo(n+s.topLeft,r)}const RV=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,PV=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function MV(e,t){const n=(""+e).match(RV);if(!n||n[1]==="normal")return t*1.2;switch(e=+n[2],n[3]){case"px":return e;case"%":e/=100;break}return t*e}const kV=e=>+e||0;function hw(e,t){const n={},r=qe(t),o=r?Object.keys(t):t,i=qe(e)?r?s=>ke(e[s],e[t[s]]):s=>e[s]:()=>e;for(const s of o)n[s]=kV(i(s));return n}function kO(e){return hw(e,{top:"y",right:"x",bottom:"y",left:"x"})}function Hs(e){return hw(e,["topLeft","topRight","bottomLeft","bottomRight"])}function on(e){const t=kO(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function Wt(e,t){e=e||{},t=t||Mt.font;let n=ke(e.size,t.size);typeof n=="string"&&(n=parseInt(n,10));let r=ke(e.style,t.style);r&&!(""+r).match(PV)&&(console.warn('Invalid font style specified: "'+r+'"'),r=void 0);const o={family:ke(e.family,t.family),lineHeight:MV(ke(e.lineHeight,t.lineHeight),n),size:n,style:r,weight:ke(e.weight,t.weight),string:""};return o.string=yV(o),o}function _t(e,t,n,r){let o,i,s;for(o=0,i=e.length;o<i;++o)if(s=e[o],s!==void 0&&(t!==void 0&&typeof s=="function"&&(s=s(t)),n!==void 0&&Rt(s)&&(s=s[n%s.length]),s!==void 0))return s}function OV(e,t,n){const{min:r,max:o}=e,i=bO(t,(o-r)/2),s=(a,l)=>n&&a===0?0:a+l;return{min:s(r,-Math.abs(i)),max:s(o,i)}}function Qi(e,t){return Object.assign(Object.create(e),t)}function pw(e,t=[""],n,r,o=()=>e[0]){const i=n||e;typeof r>"u"&&(r=IO("_fallback",e));const s={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:i,_fallback:r,_getTarget:o,override:a=>pw([a,...e],t,i,r)};return new Proxy(s,{deleteProperty(a,l){return delete a[l],delete a._keys,delete e[0][l],!0},get(a,l){return DO(a,l,()=>LV(l,t,e,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(a,l){return y_(a).includes(l)},ownKeys(a){return y_(a)},set(a,l,c){const u=a._storage||(a._storage=o());return a[l]=u[l]=c,delete a._keys,!0}})}function Nl(e,t,n,r){const o={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:OO(e,r),setContext:i=>Nl(e,i,n,r),override:i=>Nl(e.override(i),t,n,r)};return new Proxy(o,{deleteProperty(i,s){return delete i[s],delete e[s],!0},get(i,s,a){return DO(i,s,()=>TV(i,s,a))},getOwnPropertyDescriptor(i,s){return i._descriptors.allKeys?Reflect.has(e,s)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,s)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(i,s){return Reflect.has(e,s)},ownKeys(){return Reflect.ownKeys(e)},set(i,s,a){return e[s]=a,delete i[s],!0}})}function OO(e,t={scriptable:!0,indexable:!0}){const{_scriptable:n=t.scriptable,_indexable:r=t.indexable,_allKeys:o=t.allKeys}=e;return{allKeys:o,scriptable:n,indexable:r,isScriptable:zi(n)?n:()=>n,isIndexable:zi(r)?r:()=>r}}const DV=(e,t)=>e?e+lw(t):t,gw=(e,t)=>qe(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function DO(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t)||t==="constructor")return e[t];const r=n();return e[t]=r,r}function TV(e,t,n){const{_proxy:r,_context:o,_subProxy:i,_descriptors:s}=e;let a=r[t];return zi(a)&&s.isScriptable(t)&&(a=IV(t,a,e,n)),Rt(a)&&a.length&&(a=AV(t,a,e,s.isIndexable)),gw(t,a)&&(a=Nl(a,o,i&&i[t],s)),a}function IV(e,t,n,r){const{_proxy:o,_context:i,_subProxy:s,_stack:a}=n;if(a.has(e))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+e);a.add(e);let l=t(i,s||r);return a.delete(e),gw(e,l)&&(l=mw(o._scopes,o,e,l)),l}function AV(e,t,n,r){const{_proxy:o,_context:i,_subProxy:s,_descriptors:a}=n;if(typeof i.index<"u"&&r(e))return t[i.index%t.length];if(qe(t[0])){const l=t,c=o._scopes.filter(u=>u!==l);t=[];for(const u of l){const d=mw(c,o,e,u);t.push(Nl(d,i,s&&s[e],a))}}return t}function TO(e,t,n){return zi(e)?e(t,n):e}const NV=(e,t)=>e===!0?t:typeof e=="string"?$i(t,e):void 0;function jV(e,t,n,r,o){for(const i of t){const s=NV(n,i);if(s){e.add(s);const a=TO(s._fallback,n,o);if(typeof a<"u"&&a!==n&&a!==r)return a}else if(s===!1&&typeof r<"u"&&n!==r)return null}return!1}function mw(e,t,n,r){const o=t._rootScopes,i=TO(t._fallback,n,r),s=[...e,...o],a=new Set;a.add(r);let l=v_(a,s,n,i||n,r);return l===null||typeof i<"u"&&i!==n&&(l=v_(a,s,i,l,r),l===null)?!1:pw(Array.from(a),[""],o,i,()=>FV(t,n,r))}function v_(e,t,n,r,o){for(;n;)n=jV(e,t,n,r,o);return n}function FV(e,t,n){const r=e._getTarget();t in r||(r[t]={});const o=r[t];return Rt(o)&&qe(n)?n:o||{}}function LV(e,t,n,r){let o;for(const i of t)if(o=IO(DV(i,e),n),typeof o<"u")return gw(e,o)?mw(n,r,e,o):o}function IO(e,t){for(const n of t){if(!n)continue;const r=n[e];if(typeof r<"u")return r}}function y_(e){let t=e._keys;return t||(t=e._keys=$V(e._scopes)),t}function $V(e){const t=new Set;for(const n of e)for(const r of Object.keys(n).filter(o=>!o.startsWith("_")))t.add(r);return Array.from(t)}function AO(e,t,n,r){const{iScale:o}=e,{key:i="r"}=this._parsing,s=new Array(r);let a,l,c,u;for(a=0,l=r;a<l;++a)c=a+n,u=t[c],s[a]={r:o.parse($i(u,i),c)};return s}const zV=Number.EPSILON||1e-14,jl=(e,t)=>t<e.length&&!e[t].skip&&e[t],NO=e=>e==="x"?"y":"x";function BV(e,t,n,r){const o=e.skip?t:e,i=t,s=n.skip?t:n,a=xv(i,o),l=xv(s,i);let c=a/(a+l),u=l/(a+l);c=isNaN(c)?0:c,u=isNaN(u)?0:u;const d=r*c,h=r*u;return{previous:{x:i.x-d*(s.x-o.x),y:i.y-d*(s.y-o.y)},next:{x:i.x+h*(s.x-o.x),y:i.y+h*(s.y-o.y)}}}function VV(e,t,n){const r=e.length;let o,i,s,a,l,c=jl(e,0);for(let u=0;u<r-1;++u)if(l=c,c=jl(e,u+1),!(!l||!c)){if(ru(t[u],0,zV)){n[u]=n[u+1]=0;continue}o=n[u]/t[u],i=n[u+1]/t[u],a=Math.pow(o,2)+Math.pow(i,2),!(a<=9)&&(s=3/Math.sqrt(a),n[u]=o*s*t[u],n[u+1]=i*s*t[u])}}function HV(e,t,n="x"){const r=NO(n),o=e.length;let i,s,a,l=jl(e,0);for(let c=0;c<o;++c){if(s=a,a=l,l=jl(e,c+1),!a)continue;const u=a[n],d=a[r];s&&(i=(u-s[n])/3,a[`cp1${n}`]=u-i,a[`cp1${r}`]=d-i*t[c]),l&&(i=(l[n]-u)/3,a[`cp2${n}`]=u+i,a[`cp2${r}`]=d+i*t[c])}}function WV(e,t="x"){const n=NO(t),r=e.length,o=Array(r).fill(0),i=Array(r);let s,a,l,c=jl(e,0);for(s=0;s<r;++s)if(a=l,l=c,c=jl(e,s+1),!!l){if(c){const u=c[t]-l[t];o[s]=u!==0?(c[n]-l[n])/u:0}i[s]=a?c?go(o[s-1])!==go(o[s])?0:(o[s-1]+o[s])/2:o[s-1]:o[s]}VV(e,o,i),HV(e,i,t)}function bf(e,t,n){return Math.max(Math.min(e,n),t)}function UV(e,t){let n,r,o,i,s,a=ei(e[0],t);for(n=0,r=e.length;n<r;++n)s=i,i=a,a=n<r-1&&ei(e[n+1],t),i&&(o=e[n],s&&(o.cp1x=bf(o.cp1x,t.left,t.right),o.cp1y=bf(o.cp1y,t.top,t.bottom)),a&&(o.cp2x=bf(o.cp2x,t.left,t.right),o.cp2y=bf(o.cp2y,t.top,t.bottom)))}function qV(e,t,n,r,o){let i,s,a,l;if(t.spanGaps&&(e=e.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")WV(e,o);else{let c=r?e[e.length-1]:e[0];for(i=0,s=e.length;i<s;++i)a=e[i],l=BV(c,a,e[Math.min(i+1,s-(r?0:1))%s],t.tension),a.cp1x=l.previous.x,a.cp1y=l.previous.y,a.cp2x=l.next.x,a.cp2y=l.next.y,c=a}t.capBezierPoints&&UV(e,n)}function bw(){return typeof window<"u"&&typeof document<"u"}function vw(e){let t=e.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function Gh(e,t,n){let r;return typeof e=="string"?(r=parseInt(e,10),e.indexOf("%")!==-1&&(r=r/100*t.parentNode[n])):r=e,r}const pg=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);function GV(e,t){return pg(e).getPropertyValue(t)}const YV=["top","right","bottom","left"];function Ws(e,t,n){const r={};n=n?"-"+n:"";for(let o=0;o<4;o++){const i=YV[o];r[i]=parseFloat(e[t+"-"+i+n])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}const KV=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function XV(e,t){const n=e.touches,r=n&&n.length?n[0]:e,{offsetX:o,offsetY:i}=r;let s=!1,a,l;if(KV(o,i,e.target))a=o,l=i;else{const c=t.getBoundingClientRect();a=r.clientX-c.left,l=r.clientY-c.top,s=!0}return{x:a,y:l,box:s}}function ms(e,t){if("native"in e)return e;const{canvas:n,currentDevicePixelRatio:r}=t,o=pg(n),i=o.boxSizing==="border-box",s=Ws(o,"padding"),a=Ws(o,"border","width"),{x:l,y:c,box:u}=XV(e,n),d=s.left+(u&&a.left),h=s.top+(u&&a.top);let{width:f,height:p}=t;return i&&(f-=s.width+a.width,p-=s.height+a.height),{x:Math.round((l-d)/f*n.width/r),y:Math.round((c-h)/p*n.height/r)}}function QV(e,t,n){let r,o;if(t===void 0||n===void 0){const i=e&&vw(e);if(!i)t=e.clientWidth,n=e.clientHeight;else{const s=i.getBoundingClientRect(),a=pg(i),l=Ws(a,"border","width"),c=Ws(a,"padding");t=s.width-c.width-l.width,n=s.height-c.height-l.height,r=Gh(a.maxWidth,i,"clientWidth"),o=Gh(a.maxHeight,i,"clientHeight")}}return{width:t,height:n,maxWidth:r||Wh,maxHeight:o||Wh}}const vf=e=>Math.round(e*10)/10;function JV(e,t,n,r){const o=pg(e),i=Ws(o,"margin"),s=Gh(o.maxWidth,e,"clientWidth")||Wh,a=Gh(o.maxHeight,e,"clientHeight")||Wh,l=QV(e,t,n);let{width:c,height:u}=l;if(o.boxSizing==="content-box"){const h=Ws(o,"border","width"),f=Ws(o,"padding");c-=f.width+h.width,u-=f.height+h.height}return c=Math.max(0,c-i.width),u=Math.max(0,r?c/r:u-i.height),c=vf(Math.min(c,s,l.maxWidth)),u=vf(Math.min(u,a,l.maxHeight)),c&&!u&&(u=vf(c/2)),(t!==void 0||n!==void 0)&&r&&l.height&&u>l.height&&(u=l.height,c=vf(Math.floor(u*r))),{width:c,height:u}}function x_(e,t,n){const r=t||1,o=Math.floor(e.height*r),i=Math.floor(e.width*r);e.height=Math.floor(e.height),e.width=Math.floor(e.width);const s=e.canvas;return s.style&&(n||!s.style.height&&!s.style.width)&&(s.style.height=`${e.height}px`,s.style.width=`${e.width}px`),e.currentDevicePixelRatio!==r||s.height!==o||s.width!==i?(e.currentDevicePixelRatio=r,s.height=o,s.width=i,e.ctx.setTransform(r,0,0,r,0,0),!0):!1}const ZV=function(){let e=!1;try{const t={get passive(){return e=!0,!1}};bw()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return e}();function w_(e,t){const n=GV(e,t),r=n&&n.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}function bs(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function eH(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:r==="middle"?n<.5?e.y:t.y:r==="after"?n<1?e.y:t.y:n>0?t.y:e.y}}function tH(e,t,n,r){const o={x:e.cp2x,y:e.cp2y},i={x:t.cp1x,y:t.cp1y},s=bs(e,o,n),a=bs(o,i,n),l=bs(i,t,n),c=bs(s,a,n),u=bs(a,l,n);return bs(c,u,n)}const nH=function(e,t){return{x(n){return e+e+t-n},setWidth(n){t=n},textAlign(n){return n==="center"?n:n==="right"?"left":"right"},xPlus(n,r){return n-r},leftForLtr(n,r){return n-r}}},rH=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function nl(e,t,n){return e?nH(t,n):rH()}function jO(e,t){let n,r;(t==="ltr"||t==="rtl")&&(n=e.canvas.style,r=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",t,"important"),e.prevTextDirection=r)}function FO(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function LO(e){return e==="angle"?{between:Du,compare:oV,normalize:cr}:{between:Jo,compare:(t,n)=>t-n,normalize:t=>t}}function S_({start:e,end:t,count:n,loop:r,style:o}){return{start:e%n,end:t%n,loop:r&&(t-e+1)%n===0,style:o}}function oH(e,t,n){const{property:r,start:o,end:i}=n,{between:s,normalize:a}=LO(r),l=t.length;let{start:c,end:u,loop:d}=e,h,f;if(d){for(c+=l,u+=l,h=0,f=l;h<f&&s(a(t[c%l][r]),o,i);++h)c--,u--;c%=l,u%=l}return u<c&&(u+=l),{start:c,end:u,loop:d,style:e.style}}function $O(e,t,n){if(!n)return[e];const{property:r,start:o,end:i}=n,s=t.length,{compare:a,between:l,normalize:c}=LO(r),{start:u,end:d,loop:h,style:f}=oH(e,t,n),p=[];let g=!1,b=null,v,x,y;const _=()=>l(o,y,v)&&a(o,y)!==0,w=()=>a(i,v)===0||l(i,y,v),C=()=>g||_(),R=()=>!g||w();for(let k=u,D=u;k<=d;++k)x=t[k%s],!x.skip&&(v=c(x[r]),v!==y&&(g=l(v,o,i),b===null&&C()&&(b=a(v,o)===0?k:D),b!==null&&R()&&(p.push(S_({start:b,end:k,loop:h,count:s,style:f})),b=null),D=k,y=v));return b!==null&&p.push(S_({start:b,end:d,loop:h,count:s,style:f})),p}function zO(e,t){const n=[],r=e.segments;for(let o=0;o<r.length;o++){const i=$O(r[o],e.points,t);i.length&&n.push(...i)}return n}function iH(e,t,n,r){let o=0,i=t-1;if(n&&!r)for(;o<t&&!e[o].skip;)o++;for(;o<t&&e[o].skip;)o++;for(o%=t,n&&(i+=o);i>o&&e[i%t].skip;)i--;return i%=t,{start:o,end:i}}function sH(e,t,n,r){const o=e.length,i=[];let s=t,a=e[t],l;for(l=t+1;l<=n;++l){const c=e[l%o];c.skip||c.stop?a.skip||(r=!1,i.push({start:t%o,end:(l-1)%o,loop:r}),t=s=c.stop?l:null):(s=l,a.skip&&(t=l)),a=c}return s!==null&&i.push({start:t%o,end:s%o,loop:r}),i}function aH(e,t){const n=e.points,r=e.options.spanGaps,o=n.length;if(!o)return[];const i=!!e._loop,{start:s,end:a}=iH(n,o,i,r);if(r===!0)return C_(e,[{start:s,end:a,loop:i}],n,t);const l=a<s?a+o:a,c=!!e._fullLoop&&s===0&&a===o-1;return C_(e,sH(n,s,l,c),n,t)}function C_(e,t,n,r){return!r||!r.setContext||!n?t:lH(e,t,n,r)}function lH(e,t,n,r){const o=e._chart.getContext(),i=__(e.options),{_datasetIndex:s,options:{spanGaps:a}}=e,l=n.length,c=[];let u=i,d=t[0].start,h=d;function f(p,g,b,v){const x=a?-1:1;if(p!==g){for(p+=l;n[p%l].skip;)p-=x;for(;n[g%l].skip;)g+=x;p%l!==g%l&&(c.push({start:p%l,end:g%l,loop:b,style:v}),u=v,d=g%l)}}for(const p of t){d=a?d:p.start;let g=n[d%l],b;for(h=d+1;h<=p.end;h++){const v=n[h%l];b=__(r.setContext(Qi(o,{type:"segment",p0:g,p1:v,p0DataIndex:(h-1)%l,p1DataIndex:h%l,datasetIndex:s}))),cH(b,u)&&f(d,h-1,p.loop,u),g=v,u=b}d<h-1&&f(d,h-1,p.loop,u)}return c}function __(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function cH(e,t){if(!t)return!1;const n=[],r=function(o,i){return fw(i)?(n.includes(i)||n.push(i),n.indexOf(i)):i};return JSON.stringify(e,r)!==JSON.stringify(t,r)}/*!
239
- * Chart.js v4.4.8
240
- * https://www.chartjs.org
241
- * (c) 2025 Chart.js Contributors
242
- * Released under the MIT License
243
- */class uH{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,n,r,o){const i=n.listeners[o],s=n.duration;i.forEach(a=>a({chart:t,initial:n.initial,numSteps:s,currentStep:Math.min(r-n.start,s)}))}_refresh(){this._request||(this._running=!0,this._request=CO.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let n=0;this._charts.forEach((r,o)=>{if(!r.running||!r.items.length)return;const i=r.items;let s=i.length-1,a=!1,l;for(;s>=0;--s)l=i[s],l._active?(l._total>r.duration&&(r.duration=l._total),l.tick(t),a=!0):(i[s]=i[i.length-1],i.pop());a&&(o.draw(),this._notify(o,r,t,"progress")),i.length||(r.running=!1,this._notify(o,r,t,"complete"),r.initial=!1),n+=i.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,o)=>Math.max(r,o._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 o=r.length-1;for(;o>=0;--o)r[o].cancel();n.items=[],this._notify(t,n,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var zo=new uH;const E_="transparent",dH={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const r=g_(e||E_),o=r.valid&&g_(t||E_);return o&&o.valid?o.mix(r,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class fH{constructor(t,n,r,o){const i=n[r];o=_t([t.to,o,i,t.from]);const s=_t([t.from,i,o]);this._active=!0,this._fn=t.fn||dH[t.type||typeof s],this._easing=ou[t.easing]||ou.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=s,this._to=o,this._promises=void 0}active(){return this._active}update(t,n,r){if(this._active){this._notify(!1);const o=this._target[this._prop],i=r-this._start,s=this._duration-i;this._start=r,this._duration=Math.floor(Math.max(s,t.duration)),this._total+=i,this._loop=!!t.loop,this._to=_t([t.to,n,o,t.from]),this._from=_t([t.from,o,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const n=t-this._start,r=this._duration,o=this._prop,i=this._from,s=this._loop,a=this._to;let l;if(this._active=i!==a&&(s||n<r),!this._active){this._target[o]=a,this._notify(!0);return}if(n<0){this._target[o]=i;return}l=n/r%2,l=s&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[o]=this._fn(i,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 o=0;o<r.length;o++)r[o][n]()}}class BO{constructor(t,n){this._chart=t,this._properties=new Map,this.configure(n)}configure(t){if(!qe(t))return;const n=Object.keys(Mt.animation),r=this._properties;Object.getOwnPropertyNames(t).forEach(o=>{const i=t[o];if(!qe(i))return;const s={};for(const a of n)s[a]=i[a];(Rt(i.properties)&&i.properties||[o]).forEach(a=>{(a===o||!r.has(a))&&r.set(a,s)})})}_animateOptions(t,n){const r=n.options,o=pH(t,r);if(!o)return[];const i=this._createAnimations(o,r);return r.$shared&&hH(t.options.$animations,r).then(()=>{t.options=r},()=>{}),i}_createAnimations(t,n){const r=this._properties,o=[],i=t.$animations||(t.$animations={}),s=Object.keys(n),a=Date.now();let l;for(l=s.length-1;l>=0;--l){const c=s[l];if(c.charAt(0)==="$")continue;if(c==="options"){o.push(...this._animateOptions(t,n));continue}const u=n[c];let d=i[c];const h=r.get(c);if(d)if(h&&d.active()){d.update(h,u,a);continue}else d.cancel();if(!h||!h.duration){t[c]=u;continue}i[c]=d=new fH(h,t,c,u),o.push(d)}return o}update(t,n){if(this._properties.size===0){Object.assign(t,n);return}const r=this._createAnimations(t,n);if(r.length)return zo.add(this._chart,r),!0}}function hH(e,t){const n=[],r=Object.keys(t);for(let o=0;o<r.length;o++){const i=e[r[o]];i&&i.active()&&n.push(i.wait())}return Promise.all(n)}function pH(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 R_(e,t){const n=e&&e.options||{},r=n.reverse,o=n.min===void 0?t:0,i=n.max===void 0?t:0;return{start:r?i:o,end:r?o:i}}function gH(e,t,n){if(n===!1)return!1;const r=R_(e,n),o=R_(t,n);return{top:o.end,right:r.end,bottom:o.start,left:r.start}}function mH(e){let t,n,r,o;return qe(e)?(t=e.top,n=e.right,r=e.bottom,o=e.left):t=n=r=o=e,{top:t,right:n,bottom:r,left:o,disabled:e===!1}}function VO(e,t){const n=[],r=e._getSortedDatasetMetas(t);let o,i;for(o=0,i=r.length;o<i;++o)n.push(r[o].index);return n}function P_(e,t,n,r={}){const o=e.keys,i=r.mode==="single";let s,a,l,c;if(t===null)return;let u=!1;for(s=0,a=o.length;s<a;++s){if(l=+o[s],l===n){if(u=!0,r.all)continue;break}c=e.values[l],jt(c)&&(i||t===0||go(t)===go(c))&&(t+=c)}return!u&&!r.all?0:t}function bH(e,t){const{iScale:n,vScale:r}=t,o=n.axis==="x"?"x":"y",i=r.axis==="x"?"x":"y",s=Object.keys(e),a=new Array(s.length);let l,c,u;for(l=0,c=s.length;l<c;++l)u=s[l],a[l]={[o]:u,[i]:e[u]};return a}function sb(e,t){const n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function vH(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}function yH(e){const{min:t,max:n,minDefined:r,maxDefined:o}=e.getUserBounds();return{min:r?t:Number.NEGATIVE_INFINITY,max:o?n:Number.POSITIVE_INFINITY}}function xH(e,t,n){const r=e[t]||(e[t]={});return r[n]||(r[n]={})}function M_(e,t,n,r){for(const o of t.getMatchingVisibleMetas(r).reverse()){const i=e[o.index];if(n&&i>0||!n&&i<0)return o.index}return null}function k_(e,t){const{chart:n,_cachedMeta:r}=e,o=n._stacks||(n._stacks={}),{iScale:i,vScale:s,index:a}=r,l=i.axis,c=s.axis,u=vH(i,s,r),d=t.length;let h;for(let f=0;f<d;++f){const p=t[f],{[l]:g,[c]:b}=p,v=p._stacks||(p._stacks={});h=v[c]=xH(o,u,g),h[a]=b,h._top=M_(h,s,!0,r.type),h._bottom=M_(h,s,!1,r.type);const x=h._visualValues||(h._visualValues={});x[a]=b}}function ab(e,t){const n=e.scales;return Object.keys(n).filter(r=>n[r].axis===t).shift()}function wH(e,t){return Qi(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function SH(e,t,n){return Qi(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function _c(e,t){const n=e.controller.index,r=e.vScale&&e.vScale.axis;if(r){t=t||e._parsed;for(const o of t){const i=o._stacks;if(!i||i[r]===void 0||i[r][n]===void 0)return;delete i[r][n],i[r]._visualValues!==void 0&&i[r]._visualValues[n]!==void 0&&delete i[r]._visualValues[n]}}}const lb=e=>e==="reset"||e==="none",O_=(e,t)=>t?e:Object.assign({},e),CH=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:VO(n,!0),values:null};class Mr{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=sb(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&&_c(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,r=this.getDataset(),o=(d,h,f,p)=>d==="x"?h:d==="r"?p:f,i=n.xAxisID=ke(r.xAxisID,ab(t,"x")),s=n.yAxisID=ke(r.yAxisID,ab(t,"y")),a=n.rAxisID=ke(r.rAxisID,ab(t,"r")),l=n.indexAxis,c=n.iAxisID=o(l,i,s,a),u=n.vAxisID=o(l,s,i,a);n.xScale=this.getScaleForId(i),n.yScale=this.getScaleForId(s),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&&f_(this._data,this),t._stacked&&_c(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),r=this._data;if(qe(n)){const o=this._cachedMeta;this._data=bH(n,o)}else if(r!==n){if(r){f_(r,this);const o=this._cachedMeta;_c(o),o._parsed=[]}n&&Object.isExtensible(n)&&lV(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 o=!1;this._dataCheck();const i=n._stacked;n._stacked=sb(n.vScale,n),n.stack!==r.stack&&(o=!0,_c(n),n.stack=r.stack),this._resyncElements(t),(o||i!==n._stacked)&&(k_(this,n._parsed),n._stacked=sb(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:o}=this,{iScale:i,_stacked:s}=r,a=i.axis;let l=t===0&&n===o.length?!0:r._sorted,c=t>0&&r._parsed[t-1],u,d,h;if(this._parsing===!1)r._parsed=o,r._sorted=!0,h=o;else{Rt(o[t])?h=this.parseArrayData(r,o,t,n):qe(o[t])?h=this.parseObjectData(r,o,t,n):h=this.parsePrimitiveData(r,o,t,n);const f=()=>d[a]===null||c&&d[a]<c[a];for(u=0;u<n;++u)r._parsed[u+t]=d=h[u],l&&(f()&&(l=!1),c=d);r._sorted=l}s&&k_(this,h)}parsePrimitiveData(t,n,r,o){const{iScale:i,vScale:s}=t,a=i.axis,l=s.axis,c=i.getLabels(),u=i===s,d=new Array(o);let h,f,p;for(h=0,f=o;h<f;++h)p=h+r,d[h]={[a]:u||i.parse(c[p],p),[l]:s.parse(n[p],p)};return d}parseArrayData(t,n,r,o){const{xScale:i,yScale:s}=t,a=new Array(o);let l,c,u,d;for(l=0,c=o;l<c;++l)u=l+r,d=n[u],a[l]={x:i.parse(d[0],u),y:s.parse(d[1],u)};return a}parseObjectData(t,n,r,o){const{xScale:i,yScale:s}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=new Array(o);let u,d,h,f;for(u=0,d=o;u<d;++u)h=u+r,f=n[h],c[u]={x:i.parse($i(f,a),h),y:s.parse($i(f,l),h)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,n,r){const o=this.chart,i=this._cachedMeta,s=n[t.axis],a={keys:VO(o,!0),values:n._stacks[t.axis]._visualValues};return P_(a,s,i.index,{mode:r})}updateRangeFromParsed(t,n,r,o){const i=r[n.axis];let s=i===null?NaN:i;const a=o&&r._stacks[n.axis];o&&a&&(o.values=a,s=P_(o,i,this._cachedMeta.index)),t.min=Math.min(t.min,s),t.max=Math.max(t.max,s)}getMinMax(t,n){const r=this._cachedMeta,o=r._parsed,i=r._sorted&&t===r.iScale,s=o.length,a=this._getOtherScale(t),l=CH(n,r,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:d}=yH(a);let h,f;function p(){f=o[h];const g=f[a.axis];return!jt(f[t.axis])||u>g||d<g}for(h=0;h<s&&!(!p()&&(this.updateRangeFromParsed(c,t,f,l),i));++h);if(i){for(h=s-1;h>=0;--h)if(!p()){this.updateRangeFromParsed(c,t,f,l);break}}return c}getAllParsedValues(t){const n=this._cachedMeta._parsed,r=[];let o,i,s;for(o=0,i=n.length;o<i;++o)s=n[o][t.axis],jt(s)&&r.push(s);return r}getMaxOverflow(){return!1}getLabelAndValue(t){const n=this._cachedMeta,r=n.iScale,o=n.vScale,i=this.getParsed(t);return{label:r?""+r.getLabelForValue(i[r.axis]):"",value:o?""+o.getLabelForValue(i[o.axis]):""}}_update(t){const n=this._cachedMeta;this.update(t||"default"),n._clip=mH(ke(this.options.clip,gH(n.xScale,n.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,n=this.chart,r=this._cachedMeta,o=r.data||[],i=n.chartArea,s=[],a=this._drawStart||0,l=this._drawCount||o.length-a,c=this.options.drawActiveElementsOnTop;let u;for(r.dataset&&r.dataset.draw(t,i,a,l),u=a;u<a+l;++u){const d=o[u];d.hidden||(d.active&&c?s.push(d):d.draw(t,i))}for(u=0;u<s.length;++u)s[u].draw(t,i)}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 o=this.getDataset();let i;if(t>=0&&t<this._cachedMeta.data.length){const s=this._cachedMeta.data[t];i=s.$context||(s.$context=SH(this.getContext(),t,s)),i.parsed=this.getParsed(t),i.raw=o.data[t],i.index=i.dataIndex=t}else i=this.$context||(this.$context=wH(this.chart.getContext(),this.index)),i.dataset=o,i.index=i.datasetIndex=this.index;return i.active=!!n,i.mode=r,i}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 o=n==="active",i=this._cachedDataOpts,s=t+"-"+n,a=i[s],l=this.enableOptionSharing&&Ou(r);if(a)return O_(a,l);const c=this.chart.config,u=c.datasetElementScopeKeys(this._type,t),d=o?[`${t}Hover`,"hover",t,""]:[t,""],h=c.getOptionScopes(this.getDataset(),u),f=Object.keys(Mt.elements[t]),p=()=>this.getContext(r,o,n),g=c.resolveNamedOptions(h,f,p,d);return g.$shared&&(g.$shared=l,i[s]=Object.freeze(O_(g,l))),g}_resolveAnimations(t,n,r){const o=this.chart,i=this._cachedDataOpts,s=`animation-${n}`,a=i[s];if(a)return a;let l;if(o.options.animation!==!1){const u=this.chart.config,d=u.datasetAnimationScopeKeys(this._type,n),h=u.getOptionScopes(this.getDataset(),d);l=u.createResolver(h,this.getContext(t,r,n))}const c=new BO(o,l&&l.animations);return l&&l._cacheable&&(i[s]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,n){return!n||lb(t)||this.chart._animationsDisabled}_getSharedOptions(t,n){const r=this.resolveDataElementOptions(t,n),o=this._sharedOptions,i=this.getSharedOptions(r),s=this.includeOptions(n,i)||i!==o;return this.updateSharedOptions(i,n,r),{sharedOptions:i,includeOptions:s}}updateElement(t,n,r,o){lb(o)?Object.assign(t,r):this._resolveAnimations(n,o).update(t,r)}updateSharedOptions(t,n,r){t&&!lb(n)&&this._resolveAnimations(void 0,n).update(t,r)}_setStyle(t,n,r,o){t.active=o;const i=this.getStyle(n,o);this._resolveAnimations(n,r,o).update(t,{options:!o&&this.getSharedOptions(i)||i})}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 o=r.length,i=n.length,s=Math.min(i,o);s&&this.parse(0,s),i>o?this._insertElements(o,i-o,t):i<o&&this._removeElements(i,o-i)}_insertElements(t,n,r=!0){const o=this._cachedMeta,i=o.data,s=t+n;let a;const l=c=>{for(c.length+=n,a=c.length-1;a>=s;a--)c[a]=c[a-n]};for(l(i),a=t;a<s;++a)i[a]=new this.dataElementType;this._parsing&&l(o._parsed),this.parse(t,n),r&&this.updateElements(i,t,n,"reset")}updateElements(t,n,r,o){}_removeElements(t,n){const r=this._cachedMeta;if(this._parsing){const o=r._parsed.splice(t,n);r._stacked&&_c(r,o)}r.data.splice(t,n)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[n,r,o]=t;this[n](r,o)}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])}}fe(Mr,"defaults",{}),fe(Mr,"datasetElementType",null),fe(Mr,"dataElementType",null);function _H(e,t){if(!e._cache.$bar){const n=e.getMatchingVisibleMetas(t);let r=[];for(let o=0,i=n.length;o<i;o++)r=r.concat(n[o].controller.getAllParsedValues(e));e._cache.$bar=SO(r.sort((o,i)=>o-i))}return e._cache.$bar}function EH(e){const t=e.iScale,n=_H(t,e.type);let r=t._length,o,i,s,a;const l=()=>{s===32767||s===-32768||(Ou(a)&&(r=Math.min(r,Math.abs(s-a)||r)),a=s)};for(o=0,i=n.length;o<i;++o)s=t.getPixelForValue(n[o]),l();for(a=void 0,o=0,i=t.ticks.length;o<i;++o)s=t.getPixelForTick(o),l();return r}function RH(e,t,n,r){const o=n.barThickness;let i,s;return Ne(o)?(i=t.min*n.categoryPercentage,s=n.barPercentage):(i=o*r,s=1),{chunk:i/r,ratio:s,start:t.pixels[e]-i/2}}function PH(e,t,n,r){const o=t.pixels,i=o[e];let s=e>0?o[e-1]:null,a=e<o.length-1?o[e+1]:null;const l=n.categoryPercentage;s===null&&(s=i-(a===null?t.end-t.start:a-i)),a===null&&(a=i+i-s);const c=i-(i-Math.min(s,a))/2*l;return{chunk:Math.abs(a-s)/2*l/r,ratio:n.barPercentage,start:c}}function MH(e,t,n,r){const o=n.parse(e[0],r),i=n.parse(e[1],r),s=Math.min(o,i),a=Math.max(o,i);let l=s,c=a;Math.abs(s)>Math.abs(a)&&(l=a,c=s),t[n.axis]=c,t._custom={barStart:l,barEnd:c,start:o,end:i,min:s,max:a}}function HO(e,t,n,r){return Rt(e)?MH(e,t,n,r):t[n.axis]=n.parse(e,r),t}function D_(e,t,n,r){const o=e.iScale,i=e.vScale,s=o.getLabels(),a=o===i,l=[];let c,u,d,h;for(c=n,u=n+r;c<u;++c)h=t[c],d={},d[o.axis]=a||o.parse(s[c],c),l.push(HO(h,d,i,c));return l}function cb(e){return e&&e.barStart!==void 0&&e.barEnd!==void 0}function kH(e,t,n){return e!==0?go(e):(t.isHorizontal()?1:-1)*(t.min>=n?1:-1)}function OH(e){let t,n,r,o,i;return e.horizontal?(t=e.base>e.x,n="left",r="right"):(t=e.base<e.y,n="bottom",r="top"),t?(o="end",i="start"):(o="start",i="end"),{start:n,end:r,reverse:t,top:o,bottom:i}}function DH(e,t,n,r){let o=t.borderSkipped;const i={};if(!o){e.borderSkipped=i;return}if(o===!0){e.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:s,end:a,reverse:l,top:c,bottom:u}=OH(e);o==="middle"&&n&&(e.enableBorderRadius=!0,(n._top||0)===r?o=c:(n._bottom||0)===r?o=u:(i[T_(u,s,a,l)]=!0,o=c)),i[T_(o,s,a,l)]=!0,e.borderSkipped=i}function T_(e,t,n,r){return r?(e=TH(e,t,n),e=I_(e,n,t)):e=I_(e,t,n),e}function TH(e,t,n){return e===t?n:e===n?t:e}function I_(e,t,n){return e==="start"?t:e==="end"?n:e}function IH(e,{inflateAmount:t},n){e.inflateAmount=t==="auto"?n===1?.33:0:t}class dh extends Mr{parsePrimitiveData(t,n,r,o){return D_(t,n,r,o)}parseArrayData(t,n,r,o){return D_(t,n,r,o)}parseObjectData(t,n,r,o){const{iScale:i,vScale:s}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=i.axis==="x"?a:l,u=s.axis==="x"?a:l,d=[];let h,f,p,g;for(h=r,f=r+o;h<f;++h)g=n[h],p={},p[i.axis]=i.parse($i(g,c),h),d.push(HO($i(g,u),p,s,h));return d}updateRangeFromParsed(t,n,r,o){super.updateRangeFromParsed(t,n,r,o);const i=r._custom;i&&n===this._cachedMeta.vScale&&(t.min=Math.min(t.min,i.min),t.max=Math.max(t.max,i.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const n=this._cachedMeta,{iScale:r,vScale:o}=n,i=this.getParsed(t),s=i._custom,a=cb(s)?"["+s.start+", "+s.end+"]":""+o.getLabelForValue(i[o.axis]);return{label:""+r.getLabelForValue(i[r.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const n=this._cachedMeta;this.updateElements(n.data,0,n.data.length,t)}updateElements(t,n,r,o){const i=o==="reset",{index:s,_cachedMeta:{vScale:a}}=this,l=a.getBasePixel(),c=a.isHorizontal(),u=this._getRuler(),{sharedOptions:d,includeOptions:h}=this._getSharedOptions(n,o);for(let f=n;f<n+r;f++){const p=this.getParsed(f),g=i||Ne(p[a.axis])?{base:l,head:l}:this._calculateBarValuePixels(f),b=this._calculateBarIndexPixels(f,u),v=(p._stacks||{})[a.axis],x={horizontal:c,base:g.base,enableBorderRadius:!v||cb(p._custom)||s===v._top||s===v._bottom,x:c?g.head:b.center,y:c?b.center:g.head,height:c?b.size:Math.abs(g.size),width:c?Math.abs(g.size):b.size};h&&(x.options=d||this.resolveDataElementOptions(f,t[f].active?"active":o));const y=x.options||t[f].options;DH(x,y,v,s),IH(x,y,u.ratio),this.updateElement(t[f],f,x,o)}}_getStacks(t,n){const{iScale:r}=this._cachedMeta,o=r.getMatchingVisibleMetas(this._type).filter(u=>u.controller.options.grouped),i=r.options.stacked,s=[],a=this._cachedMeta.controller.getParsed(n),l=a&&a[r.axis],c=u=>{const d=u._parsed.find(f=>f[r.axis]===l),h=d&&d[u.vScale.axis];if(Ne(h)||isNaN(h))return!0};for(const u of o)if(!(n!==void 0&&c(u))&&((i===!1||s.indexOf(u.stack)===-1||i===void 0&&u.stack===void 0)&&s.push(u.stack),u.index===t))break;return s.length||s.push(void 0),s}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,n,r){const o=this._getStacks(t,r),i=n!==void 0?o.indexOf(n):-1;return i===-1?o.length-1:i}_getRuler(){const t=this.options,n=this._cachedMeta,r=n.iScale,o=[];let i,s;for(i=0,s=n.data.length;i<s;++i)o.push(r.getPixelForValue(this.getParsed(i)[r.axis],i));const a=t.barThickness;return{min:a||EH(n),pixels:o,start:r._startPixel,end:r._endPixel,stackCount:this._getStackCount(),scale:r,grouped:t.grouped,ratio:a?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:n,_stacked:r,index:o},options:{base:i,minBarLength:s}}=this,a=i||0,l=this.getParsed(t),c=l._custom,u=cb(c);let d=l[n.axis],h=0,f=r?this.applyStack(n,l,r):d,p,g;f!==d&&(h=f-d,f=d),u&&(d=c.barStart,f=c.barEnd-c.barStart,d!==0&&go(d)!==go(c.barEnd)&&(h=0),h+=d);const b=!Ne(i)&&!u?i:h;let v=n.getPixelForValue(b);if(this.chart.getDataVisibility(t)?p=n.getPixelForValue(h+f):p=v,g=p-v,Math.abs(g)<s){g=kH(g,n,a)*s,d===a&&(v-=g/2);const x=n.getPixelForDecimal(0),y=n.getPixelForDecimal(1),_=Math.min(x,y),w=Math.max(x,y);v=Math.max(Math.min(v,w),_),p=v+g,r&&!u&&(l._stacks[n.axis]._visualValues[o]=n.getValueForPixel(p)-n.getValueForPixel(v))}if(v===n.getPixelForValue(a)){const x=go(g)*n.getLineWidthForValue(a)/2;v+=x,g-=x}return{size:g,base:v,head:p,center:p+g/2}}_calculateBarIndexPixels(t,n){const r=n.scale,o=this.options,i=o.skipNull,s=ke(o.maxBarThickness,1/0);let a,l;if(n.grouped){const c=i?this._getStackCount(t):n.stackCount,u=o.barThickness==="flex"?PH(t,n,o,c):RH(t,n,o,c),d=this._getStackIndex(this.index,this._cachedMeta.stack,i?t:void 0);a=u.start+u.chunk*d+u.chunk/2,l=Math.min(s,u.chunk*u.ratio)}else a=r.getPixelForValue(this.getParsed(t)[r.axis],t),l=Math.min(s,n.min*n.ratio);return{base:a-l/2,head:a+l/2,center:a,size:l}}draw(){const t=this._cachedMeta,n=t.vScale,r=t.data,o=r.length;let i=0;for(;i<o;++i)this.getParsed(i)[n.axis]!==null&&!r[i].hidden&&r[i].draw(this._ctx)}}fe(dh,"id","bar"),fe(dh,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),fe(dh,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class fh extends Mr{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,n,r,o){const i=super.parsePrimitiveData(t,n,r,o);for(let s=0;s<i.length;s++)i[s]._custom=this.resolveDataElementOptions(s+r).radius;return i}parseArrayData(t,n,r,o){const i=super.parseArrayData(t,n,r,o);for(let s=0;s<i.length;s++){const a=n[r+s];i[s]._custom=ke(a[2],this.resolveDataElementOptions(s+r).radius)}return i}parseObjectData(t,n,r,o){const i=super.parseObjectData(t,n,r,o);for(let s=0;s<i.length;s++){const a=n[r+s];i[s]._custom=ke(a&&a.r&&+a.r,this.resolveDataElementOptions(s+r).radius)}return i}getMaxOverflow(){const t=this._cachedMeta.data;let n=0;for(let r=t.length-1;r>=0;--r)n=Math.max(n,t[r].size(this.resolveDataElementOptions(r))/2);return n>0&&n}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart.data.labels||[],{xScale:o,yScale:i}=n,s=this.getParsed(t),a=o.getLabelForValue(s.x),l=i.getLabelForValue(s.y),c=s._custom;return{label:r[t]||"",value:"("+a+", "+l+(c?", "+c:"")+")"}}update(t){const n=this._cachedMeta.data;this.updateElements(n,0,n.length,t)}updateElements(t,n,r,o){const i=o==="reset",{iScale:s,vScale:a}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(n,o),u=s.axis,d=a.axis;for(let h=n;h<n+r;h++){const f=t[h],p=!i&&this.getParsed(h),g={},b=g[u]=i?s.getPixelForDecimal(.5):s.getPixelForValue(p[u]),v=g[d]=i?a.getBasePixel():a.getPixelForValue(p[d]);g.skip=isNaN(b)||isNaN(v),c&&(g.options=l||this.resolveDataElementOptions(h,f.active?"active":o),i&&(g.options.radius=0)),this.updateElement(f,h,g,o)}}resolveDataElementOptions(t,n){const r=this.getParsed(t);let o=super.resolveDataElementOptions(t,n);o.$shared&&(o=Object.assign({},o,{$shared:!1}));const i=o.radius;return n!=="active"&&(o.radius=0),o.radius+=ke(r&&r._custom,i),o}}fe(fh,"id","bubble"),fe(fh,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),fe(fh,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function AH(e,t,n){let r=1,o=1,i=0,s=0;if(t<Pt){const a=e,l=a+t,c=Math.cos(a),u=Math.sin(a),d=Math.cos(l),h=Math.sin(l),f=(y,_,w)=>Du(y,a,l,!0)?1:Math.max(_,_*n,w,w*n),p=(y,_,w)=>Du(y,a,l,!0)?-1:Math.min(_,_*n,w,w*n),g=f(0,c,d),b=f($t,u,h),v=p(kt,c,d),x=p(kt+$t,u,h);r=(g-v)/2,o=(b-x)/2,i=-(g+v)/2,s=-(b+x)/2}return{ratioX:r,ratioY:o,offsetX:i,offsetY:s}}class Rs extends Mr{constructor(t,n){super(t,n),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,n){const r=this.getDataset().data,o=this._cachedMeta;if(this._parsing===!1)o._parsed=r;else{let i=l=>+r[l];if(qe(r[t])){const{key:l="value"}=this._parsing;i=c=>+$i(r[c],l)}let s,a;for(s=t,a=t+n;s<a;++s)o._parsed[s]=i(s)}}_getRotation(){return zr(this.options.rotation-90)}_getCircumference(){return zr(this.options.circumference)}_getRotationExtents(){let t=Pt,n=-Pt;for(let r=0;r<this.chart.data.datasets.length;++r)if(this.chart.isDatasetVisible(r)&&this.chart.getDatasetMeta(r).type===this._type){const o=this.chart.getDatasetMeta(r).controller,i=o._getRotation(),s=o._getCircumference();t=Math.min(t,i),n=Math.max(n,i+s)}return{rotation:t,circumference:n-t}}update(t){const n=this.chart,{chartArea:r}=n,o=this._cachedMeta,i=o.data,s=this.getMaxBorderWidth()+this.getMaxOffset(i)+this.options.spacing,a=Math.max((Math.min(r.width,r.height)-s)/2,0),l=Math.min(GB(this.options.cutout,a),1),c=this._getRingWeight(this.index),{circumference:u,rotation:d}=this._getRotationExtents(),{ratioX:h,ratioY:f,offsetX:p,offsetY:g}=AH(d,u,l),b=(r.width-s)/h,v=(r.height-s)/f,x=Math.max(Math.min(b,v)/2,0),y=bO(this.options.radius,x),_=Math.max(y*l,0),w=(y-_)/this._getVisibleDatasetWeightTotal();this.offsetX=p*y,this.offsetY=g*y,o.total=this.calculateTotal(),this.outerRadius=y-w*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-w*c,0),this.updateElements(i,0,i.length,t)}_circumference(t,n){const r=this.options,o=this._cachedMeta,i=this._getCircumference();return n&&r.animation.animateRotate||!this.chart.getDataVisibility(t)||o._parsed[t]===null||o.data[t].hidden?0:this.calculateCircumference(o._parsed[t]*i/Pt)}updateElements(t,n,r,o){const i=o==="reset",s=this.chart,a=s.chartArea,c=s.options.animation,u=(a.left+a.right)/2,d=(a.top+a.bottom)/2,h=i&&c.animateScale,f=h?0:this.innerRadius,p=h?0:this.outerRadius,{sharedOptions:g,includeOptions:b}=this._getSharedOptions(n,o);let v=this._getRotation(),x;for(x=0;x<n;++x)v+=this._circumference(x,i);for(x=n;x<n+r;++x){const y=this._circumference(x,i),_=t[x],w={x:u+this.offsetX,y:d+this.offsetY,startAngle:v,endAngle:v+y,circumference:y,outerRadius:p,innerRadius:f};b&&(w.options=g||this.resolveDataElementOptions(x,_.active?"active":o)),v+=y,this.updateElement(_,x,w,o)}}calculateTotal(){const t=this._cachedMeta,n=t.data;let r=0,o;for(o=0;o<n.length;o++){const i=t._parsed[o];i!==null&&!isNaN(i)&&this.chart.getDataVisibility(o)&&!n[o].hidden&&(r+=Math.abs(i))}return r}calculateCircumference(t){const n=this._cachedMeta.total;return n>0&&!isNaN(t)?Pt*(Math.abs(t)/n):0}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart,o=r.data.labels||[],i=xd(n._parsed[t],r.options.locale);return{label:o[t]||"",value:i}}getMaxBorderWidth(t){let n=0;const r=this.chart;let o,i,s,a,l;if(!t){for(o=0,i=r.data.datasets.length;o<i;++o)if(r.isDatasetVisible(o)){s=r.getDatasetMeta(o),t=s.data,a=s.controller;break}}if(!t)return 0;for(o=0,i=t.length;o<i;++o)l=a.resolveDataElementOptions(o),l.borderAlign!=="inner"&&(n=Math.max(n,l.borderWidth||0,l.hoverBorderWidth||0));return n}getMaxOffset(t){let n=0;for(let r=0,o=t.length;r<o;++r){const i=this.resolveDataElementOptions(r);n=Math.max(n,i.offset||0,i.hoverOffset||0)}return n}_getRingWeightOffset(t){let n=0;for(let r=0;r<t;++r)this.chart.isDatasetVisible(r)&&(n+=this._getRingWeight(r));return n}_getRingWeight(t){return Math.max(ke(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}fe(Rs,"id","doughnut"),fe(Rs,"defaults",{datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"}),fe(Rs,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),fe(Rs,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:r,color:o}}=t.legend.options;return n.labels.map((i,s)=>{const l=t.getDatasetMeta(0).controller.getStyle(s);return{text:i,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:o,lineWidth:l.borderWidth,pointStyle:r,hidden:!t.getDataVisibility(s),index:s}})}return[]}},onClick(t,n,r){r.chart.toggleDataVisibility(n.index),r.chart.update()}}}});class hh extends Mr{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const n=this._cachedMeta,{dataset:r,data:o=[],_dataset:i}=n,s=this.chart._animationsDisabled;let{start:a,count:l}=EO(n,o,s);this._drawStart=a,this._drawCount=l,RO(n)&&(a=0,l=o.length),r._chart=this.chart,r._datasetIndex=this.index,r._decimated=!!i._decimated,r.points=o;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(r,void 0,{animated:!s,options:c},t),this.updateElements(o,a,l,t)}updateElements(t,n,r,o){const i=o==="reset",{iScale:s,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:u,includeOptions:d}=this._getSharedOptions(n,o),h=s.axis,f=a.axis,{spanGaps:p,segment:g}=this.options,b=Al(p)?p:Number.POSITIVE_INFINITY,v=this.chart._animationsDisabled||i||o==="none",x=n+r,y=t.length;let _=n>0&&this.getParsed(n-1);for(let w=0;w<y;++w){const C=t[w],R=v?C:{};if(w<n||w>=x){R.skip=!0;continue}const k=this.getParsed(w),D=Ne(k[f]),I=R[h]=s.getPixelForValue(k[h],w),T=R[f]=i||D?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,k,l):k[f],w);R.skip=isNaN(I)||isNaN(T)||D,R.stop=w>0&&Math.abs(k[h]-_[h])>b,g&&(R.parsed=k,R.raw=c.data[w]),d&&(R.options=u||this.resolveDataElementOptions(w,C.active?"active":o)),v||this.updateElement(C,w,R,o),_=k}}getMaxOverflow(){const t=this._cachedMeta,n=t.dataset,r=n.options&&n.options.borderWidth||0,o=t.data||[];if(!o.length)return r;const i=o[0].size(this.resolveDataElementOptions(0)),s=o[o.length-1].size(this.resolveDataElementOptions(o.length-1));return Math.max(r,i,s)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}fe(hh,"id","line"),fe(hh,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),fe(hh,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class su extends Mr{constructor(t,n){super(t,n),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart,o=r.data.labels||[],i=xd(n._parsed[t].r,r.options.locale);return{label:o[t]||"",value:i}}parseObjectData(t,n,r,o){return AO.bind(this)(t,n,r,o)}update(t){const n=this._cachedMeta.data;this._updateRadius(),this.updateElements(n,0,n.length,t)}getMinMax(){const t=this._cachedMeta,n={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((r,o)=>{const i=this.getParsed(o).r;!isNaN(i)&&this.chart.getDataVisibility(o)&&(i<n.min&&(n.min=i),i>n.max&&(n.max=i))}),n}_updateRadius(){const t=this.chart,n=t.chartArea,r=t.options,o=Math.min(n.right-n.left,n.bottom-n.top),i=Math.max(o/2,0),s=Math.max(r.cutoutPercentage?i/100*r.cutoutPercentage:1,0),a=(i-s)/t.getVisibleDatasetCount();this.outerRadius=i-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(t,n,r,o){const i=o==="reset",s=this.chart,l=s.options.animation,c=this._cachedMeta.rScale,u=c.xCenter,d=c.yCenter,h=c.getIndexAngle(0)-.5*kt;let f=h,p;const g=360/this.countVisibleElements();for(p=0;p<n;++p)f+=this._computeAngle(p,o,g);for(p=n;p<n+r;p++){const b=t[p];let v=f,x=f+this._computeAngle(p,o,g),y=s.getDataVisibility(p)?c.getDistanceFromCenterForValue(this.getParsed(p).r):0;f=x,i&&(l.animateScale&&(y=0),l.animateRotate&&(v=x=h));const _={x:u,y:d,innerRadius:0,outerRadius:y,startAngle:v,endAngle:x,options:this.resolveDataElementOptions(p,b.active?"active":o)};this.updateElement(b,p,_,o)}}countVisibleElements(){const t=this._cachedMeta;let n=0;return t.data.forEach((r,o)=>{!isNaN(this.getParsed(o).r)&&this.chart.getDataVisibility(o)&&n++}),n}_computeAngle(t,n,r){return this.chart.getDataVisibility(t)?zr(this.resolveDataElementOptions(t,n).angle||r):0}}fe(su,"id","polarArea"),fe(su,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),fe(su,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:r,color:o}}=t.legend.options;return n.labels.map((i,s)=>{const l=t.getDatasetMeta(0).controller.getStyle(s);return{text:i,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:o,lineWidth:l.borderWidth,pointStyle:r,hidden:!t.getDataVisibility(s),index:s}})}return[]}},onClick(t,n,r){r.chart.toggleDataVisibility(n.index),r.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class Sv extends Rs{}fe(Sv,"id","pie"),fe(Sv,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class ph extends Mr{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,o){return AO.bind(this)(t,n,r,o)}update(t){const n=this._cachedMeta,r=n.dataset,o=n.data||[],i=n.iScale.getLabels();if(r.points=o,t!=="resize"){const s=this.resolveDatasetElementOptions(t);this.options.showLine||(s.borderWidth=0);const a={_loop:!0,_fullLoop:i.length===o.length,options:s};this.updateElement(r,void 0,a,t)}this.updateElements(o,0,o.length,t)}updateElements(t,n,r,o){const i=this._cachedMeta.rScale,s=o==="reset";for(let a=n;a<n+r;a++){const l=t[a],c=this.resolveDataElementOptions(a,l.active?"active":o),u=i.getPointPositionForValue(a,this.getParsed(a).r),d=s?i.xCenter:u.x,h=s?i.yCenter:u.y,f={x:d,y:h,angle:u.angle,skip:isNaN(d)||isNaN(h),options:c};this.updateElement(l,a,f,o)}}}fe(ph,"id","radar"),fe(ph,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),fe(ph,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class gh extends Mr{getLabelAndValue(t){const n=this._cachedMeta,r=this.chart.data.labels||[],{xScale:o,yScale:i}=n,s=this.getParsed(t),a=o.getLabelForValue(s.x),l=i.getLabelForValue(s.y);return{label:r[t]||"",value:"("+a+", "+l+")"}}update(t){const n=this._cachedMeta,{data:r=[]}=n,o=this.chart._animationsDisabled;let{start:i,count:s}=EO(n,r,o);if(this._drawStart=i,this._drawCount=s,RO(n)&&(i=0,s=r.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:a,_dataset:l}=n;a._chart=this.chart,a._datasetIndex=this.index,a._decimated=!!l._decimated,a.points=r;const c=this.resolveDatasetElementOptions(t);c.segment=this.options.segment,this.updateElement(a,void 0,{animated:!o,options:c},t)}else this.datasetElementType&&(delete n.dataset,this.datasetElementType=!1);this.updateElements(r,i,s,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,n,r,o){const i=o==="reset",{iScale:s,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,u=this.resolveDataElementOptions(n,o),d=this.getSharedOptions(u),h=this.includeOptions(o,d),f=s.axis,p=a.axis,{spanGaps:g,segment:b}=this.options,v=Al(g)?g:Number.POSITIVE_INFINITY,x=this.chart._animationsDisabled||i||o==="none";let y=n>0&&this.getParsed(n-1);for(let _=n;_<n+r;++_){const w=t[_],C=this.getParsed(_),R=x?w:{},k=Ne(C[p]),D=R[f]=s.getPixelForValue(C[f],_),I=R[p]=i||k?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,C,l):C[p],_);R.skip=isNaN(D)||isNaN(I)||k,R.stop=_>0&&Math.abs(C[f]-y[f])>v,b&&(R.parsed=C,R.raw=c.data[_]),h&&(R.options=d||this.resolveDataElementOptions(_,w.active?"active":o)),x||this.updateElement(w,_,R,o),y=C}this.updateSharedOptions(d,o,u)}getMaxOverflow(){const t=this._cachedMeta,n=t.data||[];if(!this.options.showLine){let a=0;for(let l=n.length-1;l>=0;--l)a=Math.max(a,n[l].size(this.resolveDataElementOptions(l))/2);return a>0&&a}const r=t.dataset,o=r.options&&r.options.borderWidth||0;if(!n.length)return o;const i=n[0].size(this.resolveDataElementOptions(0)),s=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(o,i,s)/2}}fe(gh,"id","scatter"),fe(gh,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),fe(gh,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var NH=Object.freeze({__proto__:null,BarController:dh,BubbleController:fh,DoughnutController:Rs,LineController:hh,PieController:Sv,PolarAreaController:su,RadarController:ph,ScatterController:gh});function ds(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class yw{constructor(t){fe(this,"options");this.options=t||{}}static override(t){Object.assign(yw.prototype,t)}init(){}formats(){return ds()}parse(){return ds()}format(){return ds()}add(){return ds()}diff(){return ds()}startOf(){return ds()}endOf(){return ds()}}var jH={_date:yw};function FH(e,t,n,r){const{controller:o,data:i,_sorted:s}=e,a=o._cachedMeta.iScale,l=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null;if(a&&t===a.axis&&t!=="r"&&s&&i.length){const c=a._reversePixels?sV:Zo;if(r){if(o._sharedOptions){const u=i[0],d=typeof u.getRange=="function"&&u.getRange(t);if(d){const h=c(i,t,n-d),f=c(i,t,n+d);return{lo:h.lo,hi:f.hi}}}}else{const u=c(i,t,n);if(l){const{vScale:d}=o._cachedMeta,{_parsed:h}=e,f=h.slice(0,u.lo+1).reverse().findIndex(g=>!Ne(g[d.axis]));u.lo-=Math.max(0,f);const p=h.slice(u.hi).findIndex(g=>!Ne(g[d.axis]));u.hi+=Math.max(0,p)}return u}}return{lo:0,hi:i.length-1}}function gg(e,t,n,r,o){const i=e.getSortedVisibleDatasetMetas(),s=n[t];for(let a=0,l=i.length;a<l;++a){const{index:c,data:u}=i[a],{lo:d,hi:h}=FH(i[a],t,s,o);for(let f=d;f<=h;++f){const p=u[f];p.skip||r(p,c,f)}}}function LH(e){const t=e.indexOf("x")!==-1,n=e.indexOf("y")!==-1;return function(r,o){const i=t?Math.abs(r.x-o.x):0,s=n?Math.abs(r.y-o.y):0;return Math.sqrt(Math.pow(i,2)+Math.pow(s,2))}}function ub(e,t,n,r,o){const i=[];return!o&&!e.isPointInArea(t)||gg(e,n,t,function(a,l,c){!o&&!ei(a,e.chartArea,0)||a.inRange(t.x,t.y,r)&&i.push({element:a,datasetIndex:l,index:c})},!0),i}function $H(e,t,n,r){let o=[];function i(s,a,l){const{startAngle:c,endAngle:u}=s.getProps(["startAngle","endAngle"],r),{angle:d}=xO(s,{x:t.x,y:t.y});Du(d,c,u)&&o.push({element:s,datasetIndex:a,index:l})}return gg(e,n,t,i),o}function zH(e,t,n,r,o,i){let s=[];const a=LH(n);let l=Number.POSITIVE_INFINITY;function c(u,d,h){const f=u.inRange(t.x,t.y,o);if(r&&!f)return;const p=u.getCenterPoint(o);if(!(!!i||e.isPointInArea(p))&&!f)return;const b=a(t,p);b<l?(s=[{element:u,datasetIndex:d,index:h}],l=b):b===l&&s.push({element:u,datasetIndex:d,index:h})}return gg(e,n,t,c),s}function db(e,t,n,r,o,i){return!i&&!e.isPointInArea(t)?[]:n==="r"&&!r?$H(e,t,n,o):zH(e,t,n,r,o,i)}function A_(e,t,n,r,o){const i=[],s=n==="x"?"inXRange":"inYRange";let a=!1;return gg(e,n,t,(l,c,u)=>{l[s]&&l[s](t[n],o)&&(i.push({element:l,datasetIndex:c,index:u}),a=a||l.inRange(t.x,t.y,o))}),r&&!a?[]:i}var BH={modes:{index(e,t,n,r){const o=ms(t,e),i=n.axis||"x",s=n.includeInvisible||!1,a=n.intersect?ub(e,o,i,r,s):db(e,o,i,!1,r,s),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 o=ms(t,e),i=n.axis||"xy",s=n.includeInvisible||!1;let a=n.intersect?ub(e,o,i,r,s):db(e,o,i,!1,r,s);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 o=ms(t,e),i=n.axis||"xy",s=n.includeInvisible||!1;return ub(e,o,i,r,s)},nearest(e,t,n,r){const o=ms(t,e),i=n.axis||"xy",s=n.includeInvisible||!1;return db(e,o,i,n.intersect,r,s)},x(e,t,n,r){const o=ms(t,e);return A_(e,o,"x",n.intersect,r)},y(e,t,n,r){const o=ms(t,e);return A_(e,o,"y",n.intersect,r)}}};const WO=["left","top","right","bottom"];function Ec(e,t){return e.filter(n=>n.pos===t)}function N_(e,t){return e.filter(n=>WO.indexOf(n.pos)===-1&&n.box.axis===t)}function Rc(e,t){return e.sort((n,r)=>{const o=t?r:n,i=t?n:r;return o.weight===i.weight?o.index-i.index:o.weight-i.weight})}function VH(e){const t=[];let n,r,o,i,s,a;for(n=0,r=(e||[]).length;n<r;++n)o=e[n],{position:i,options:{stack:s,stackWeight:a=1}}=o,t.push({index:n,box:o,pos:i,horizontal:o.isHorizontal(),weight:o.weight,stack:s&&i+s,stackWeight:a});return t}function HH(e){const t={};for(const n of e){const{stack:r,pos:o,stackWeight:i}=n;if(!r||!WO.includes(o))continue;const s=t[r]||(t[r]={count:0,placed:0,weight:0,size:0});s.count++,s.weight+=i}return t}function WH(e,t){const n=HH(e),{vBoxMaxWidth:r,hBoxMaxHeight:o}=t;let i,s,a;for(i=0,s=e.length;i<s;++i){a=e[i];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=o):(a.width=r,a.height=u?u*o:l&&t.availableHeight)}return n}function UH(e){const t=VH(e),n=Rc(t.filter(c=>c.box.fullSize),!0),r=Rc(Ec(t,"left"),!0),o=Rc(Ec(t,"right")),i=Rc(Ec(t,"top"),!0),s=Rc(Ec(t,"bottom")),a=N_(t,"x"),l=N_(t,"y");return{fullSize:n,leftAndTop:r.concat(i),rightAndBottom:o.concat(l).concat(s).concat(a),chartArea:Ec(t,"chartArea"),vertical:r.concat(o).concat(l),horizontal:i.concat(s).concat(a)}}function j_(e,t,n,r){return Math.max(e[n],t[n])+Math.max(e[r],t[r])}function UO(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 qH(e,t,n,r){const{pos:o,box:i}=n,s=e.maxPadding;if(!qe(o)){n.size&&(e[o]-=n.size);const d=r[n.stack]||{size:0,count:1};d.size=Math.max(d.size,n.horizontal?i.height:i.width),n.size=d.size/d.count,e[o]+=n.size}i.getPadding&&UO(s,i.getPadding());const a=Math.max(0,t.outerWidth-j_(s,e,"left","right")),l=Math.max(0,t.outerHeight-j_(s,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 GH(e){const t=e.maxPadding;function n(r){const o=Math.max(t[r]-e[r],0);return e[r]+=o,o}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}function YH(e,t){const n=t.maxPadding;function r(o){const i={left:0,top:0,right:0,bottom:0};return o.forEach(s=>{i[s]=Math.max(t[s],n[s])}),i}return r(e?["left","right"]:["top","bottom"])}function Wc(e,t,n,r){const o=[];let i,s,a,l,c,u;for(i=0,s=e.length,c=0;i<s;++i){a=e[i],l=a.box,l.update(a.width||t.w,a.height||t.h,YH(a.horizontal,t));const{same:d,other:h}=qH(t,n,a,r);c|=d&&o.length,u=u||h,l.fullSize||o.push(a)}return c&&Wc(o,t,n,r)||u}function yf(e,t,n,r,o){e.top=n,e.left=t,e.right=t+r,e.bottom=n+o,e.width=r,e.height=o}function F_(e,t,n,r){const o=n.padding;let{x:i,y:s}=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,h=c.size||l.height;Ou(c.start)&&(s=c.start),l.fullSize?yf(l,o.left,s,n.outerWidth-o.right-o.left,h):yf(l,t.left+c.placed,s,d,h),c.start=s,c.placed+=d,s=l.bottom}else{const d=t.h*u,h=c.size||l.width;Ou(c.start)&&(i=c.start),l.fullSize?yf(l,i,o.top,h,n.outerHeight-o.bottom-o.top):yf(l,i,t.top+c.placed,h,d),c.start=i,c.placed+=d,i=l.right}}t.x=i,t.y=s}var mn={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 o=on(e.options.layout.padding),i=Math.max(t-o.width,0),s=Math.max(n-o.height,0),a=UH(e.boxes),l=a.vertical,c=a.horizontal;ct(e.boxes,g=>{typeof g.beforeLayout=="function"&&g.beforeLayout()});const u=l.reduce((g,b)=>b.box.options&&b.box.options.display===!1?g:g+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:n,padding:o,availableWidth:i,availableHeight:s,vBoxMaxWidth:i/2/u,hBoxMaxHeight:s/2}),h=Object.assign({},o);UO(h,on(r));const f=Object.assign({maxPadding:h,w:i,h:s,x:o.left,y:o.top},o),p=WH(l.concat(c),d);Wc(a.fullSize,f,d,p),Wc(l,f,d,p),Wc(c,f,d,p)&&Wc(l,f,d,p),GH(f),F_(a.leftAndTop,f,d,p),f.x+=f.w,f.y+=f.h,F_(a.rightAndBottom,f,d,p),e.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},ct(a.chartArea,g=>{const b=g.box;Object.assign(b,e.chartArea),b.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}};class qO{acquireContext(t,n){}releaseContext(t){return!1}addEventListener(t,n,r){}removeEventListener(t,n,r){}getDevicePixelRatio(){return 1}getMaximumSize(t,n,r,o){return n=Math.max(0,n||t.width),r=r||t.height,{width:n,height:Math.max(0,o?Math.floor(n/o):r)}}isAttached(t){return!0}updateConfig(t){}}class KH extends qO{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const mh="$chartjs",XH={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},L_=e=>e===null||e==="";function QH(e,t){const n=e.style,r=e.getAttribute("height"),o=e.getAttribute("width");if(e[mh]={initial:{height:r,width:o,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",L_(o)){const i=w_(e,"width");i!==void 0&&(e.width=i)}if(L_(r))if(e.style.height==="")e.height=e.width/(t||2);else{const i=w_(e,"height");i!==void 0&&(e.height=i)}return e}const GO=ZV?{passive:!0}:!1;function JH(e,t,n){e&&e.addEventListener(t,n,GO)}function ZH(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,GO)}function eW(e,t){const n=XH[e.type]||e.type,{x:r,y:o}=ms(e,t);return{type:n,chart:t,native:e,x:r!==void 0?r:null,y:o!==void 0?o:null}}function Yh(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function tW(e,t,n){const r=e.canvas,o=new MutationObserver(i=>{let s=!1;for(const a of i)s=s||Yh(a.addedNodes,r),s=s&&!Yh(a.removedNodes,r);s&&n()});return o.observe(document,{childList:!0,subtree:!0}),o}function nW(e,t,n){const r=e.canvas,o=new MutationObserver(i=>{let s=!1;for(const a of i)s=s||Yh(a.removedNodes,r),s=s&&!Yh(a.addedNodes,r);s&&n()});return o.observe(document,{childList:!0,subtree:!0}),o}const Iu=new Map;let $_=0;function YO(){const e=window.devicePixelRatio;e!==$_&&($_=e,Iu.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function rW(e,t){Iu.size||window.addEventListener("resize",YO),Iu.set(e,t)}function oW(e){Iu.delete(e),Iu.size||window.removeEventListener("resize",YO)}function iW(e,t,n){const r=e.canvas,o=r&&vw(r);if(!o)return;const i=_O((a,l)=>{const c=o.clientWidth;n(a,l),c<o.clientWidth&&n()},window),s=new ResizeObserver(a=>{const l=a[0],c=l.contentRect.width,u=l.contentRect.height;c===0&&u===0||i(c,u)});return s.observe(o),rW(e,i),s}function fb(e,t,n){n&&n.disconnect(),t==="resize"&&oW(e)}function sW(e,t,n){const r=e.canvas,o=_O(i=>{e.ctx!==null&&n(eW(i,e))},e);return JH(r,t,o),o}class aW extends qO{acquireContext(t,n){const r=t&&t.getContext&&t.getContext("2d");return r&&r.canvas===t?(QH(t,n),r):null}releaseContext(t){const n=t.canvas;if(!n[mh])return!1;const r=n[mh].initial;["height","width"].forEach(i=>{const s=r[i];Ne(s)?n.removeAttribute(i):n.setAttribute(i,s)});const o=r.style||{};return Object.keys(o).forEach(i=>{n.style[i]=o[i]}),n.width=n.width,delete n[mh],!0}addEventListener(t,n,r){this.removeEventListener(t,n);const o=t.$proxies||(t.$proxies={}),s={attach:tW,detach:nW,resize:iW}[n]||sW;o[n]=s(t,n,r)}removeEventListener(t,n){const r=t.$proxies||(t.$proxies={}),o=r[n];if(!o)return;({attach:fb,detach:fb,resize:fb}[n]||ZH)(t,n,o),r[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,r,o){return JV(t,n,r,o)}isAttached(t){const n=t&&vw(t);return!!(n&&n.isConnected)}}function lW(e){return!bw()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?KH:aW}var uh;let Oo=(uh=class{constructor(){fe(this,"x");fe(this,"y");fe(this,"active",!1);fe(this,"options");fe(this,"$animations")}tooltipPosition(t){const{x:n,y:r}=this.getProps(["x","y"],t);return{x:n,y:r}}hasValue(){return Al(this.x)&&Al(this.y)}getProps(t,n){const r=this.$animations;if(!n||!r)return this;const o={};return t.forEach(i=>{o[i]=r[i]&&r[i].active()?r[i]._to:this[i]}),o}},fe(uh,"defaults",{}),fe(uh,"defaultRoutes"),uh);function cW(e,t){const n=e.options.ticks,r=uW(e),o=Math.min(n.maxTicksLimit||r,r),i=n.major.enabled?fW(t):[],s=i.length,a=i[0],l=i[s-1],c=[];if(s>o)return hW(t,c,i,s/o),c;const u=dW(i,t,o);if(s>0){let d,h;const f=s>1?Math.round((l-a)/(s-1)):null;for(xf(t,c,u,Ne(f)?0:a-f,a),d=0,h=s-1;d<h;d++)xf(t,c,u,i[d],i[d+1]);return xf(t,c,u,l,Ne(f)?t.length:l+f),c}return xf(t,c,u),c}function uW(e){const t=e.options.offset,n=e._tickSize(),r=e._length/n+(t?0:1),o=e._maxLength/n;return Math.floor(Math.min(r,o))}function dW(e,t,n){const r=pW(e),o=t.length/n;if(!r)return Math.max(o,1);const i=tV(r);for(let s=0,a=i.length-1;s<a;s++){const l=i[s];if(l>o)return l}return Math.max(o,1)}function fW(e){const t=[];let n,r;for(n=0,r=e.length;n<r;n++)e[n].major&&t.push(n);return t}function hW(e,t,n,r){let o=0,i=n[0],s;for(r=Math.ceil(r),s=0;s<e.length;s++)s===i&&(t.push(e[s]),o++,i=n[o*r])}function xf(e,t,n,r,o){const i=ke(r,0),s=Math.min(ke(o,e.length),e.length);let a=0,l,c,u;for(n=Math.ceil(n),o&&(l=o-r,n=l/Math.floor(l/n)),u=i;u<0;)a++,u=Math.round(i+a*n);for(c=Math.max(i,0);c<s;c++)c===u&&(t.push(e[c]),a++,u=Math.round(i+a*n))}function pW(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 gW=e=>e==="left"?"right":e==="right"?"left":e,z_=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,B_=(e,t)=>Math.min(t||e,e);function V_(e,t){const n=[],r=e.length/t,o=e.length;let i=0;for(;i<o;i+=r)n.push(e[Math.floor(i)]);return n}function mW(e,t,n){const r=e.ticks.length,o=Math.min(t,r-1),i=e._startPixel,s=e._endPixel,a=1e-6;let l=e.getPixelForTick(o),c;if(!(n&&(r===1?c=Math.max(l-i,s-l):t===0?c=(e.getPixelForTick(1)-l)/2:c=(l-e.getPixelForTick(o-1))/2,l+=o<t?c:-c,l<i-a||l>s+a)))return l}function bW(e,t){ct(e,n=>{const r=n.gc,o=r.length/2;let i;if(o>t){for(i=0;i<o;++i)delete n.data[r[i]];r.splice(0,o)}})}function Pc(e){return e.drawTicks?e.tickLength:0}function H_(e,t){if(!e.display)return 0;const n=Wt(e.font,t),r=on(e.padding);return(Rt(e.text)?e.text.length:1)*n.lineHeight+r.height}function vW(e,t){return Qi(e,{scale:t,type:"scale"})}function yW(e,t,n){return Qi(e,{tick:n,index:t,type:"tick"})}function xW(e,t,n){let r=dw(e);return(n&&t!=="right"||!n&&t==="right")&&(r=gW(r)),r}function wW(e,t,n,r){const{top:o,left:i,bottom:s,right:a,chart:l}=e,{chartArea:c,scales:u}=l;let d=0,h,f,p;const g=s-o,b=a-i;if(e.isHorizontal()){if(f=hn(r,i,a),qe(n)){const v=Object.keys(n)[0],x=n[v];p=u[v].getPixelForValue(x)+g-t}else n==="center"?p=(c.bottom+c.top)/2+g-t:p=z_(e,n,t);h=a-i}else{if(qe(n)){const v=Object.keys(n)[0],x=n[v];f=u[v].getPixelForValue(x)-b+t}else n==="center"?f=(c.left+c.right)/2-b+t:f=z_(e,n,t);p=hn(r,s,o),d=n==="left"?-$t:$t}return{titleX:f,titleY:p,maxWidth:h,rotation:d}}class Ji extends Oo{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:o}=this;return t=sr(t,Number.POSITIVE_INFINITY),n=sr(n,Number.NEGATIVE_INFINITY),r=sr(r,Number.POSITIVE_INFINITY),o=sr(o,Number.NEGATIVE_INFINITY),{min:sr(t,r),max:sr(n,o),minDefined:jt(t),maxDefined:jt(n)}}getMinMax(t){let{min:n,max:r,minDefined:o,maxDefined:i}=this.getUserBounds(),s;if(o&&i)return{min:n,max:r};const a=this.getMatchingVisibleMetas();for(let l=0,c=a.length;l<c;++l)s=a[l].controller.getMinMax(this,t),o||(n=Math.min(n,s.min)),i||(r=Math.max(r,s.max));return n=i&&n>r?r:n,r=o&&n>r?n:r,{min:sr(n,sr(r,n)),max:sr(r,sr(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(){ht(this.options.beforeUpdate,[this])}update(t,n,r){const{beginAtZero:o,grace:i,ticks:s}=this.options,a=s.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=OV(this,i,o),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?V_(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),s.display&&(s.autoSkip||s.source==="auto")&&(this.ticks=cW(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(){ht(this.options.afterUpdate,[this])}beforeSetDimensions(){ht(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(){ht(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),ht(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){ht(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const n=this.options.ticks;let r,o,i;for(r=0,o=t.length;r<o;r++)i=t[r],i.label=ht(n.callback,[i.value,r,t],this)}afterTickToLabelConversion(){ht(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){ht(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,n=t.ticks,r=B_(this.ticks.length,t.ticks.maxTicksLimit),o=n.minRotation||0,i=n.maxRotation;let s=o,a,l,c;if(!this._isVisible()||!n.display||o>=i||r<=1||!this.isHorizontal()){this.labelRotation=o;return}const u=this._getLabelSizes(),d=u.widest.width,h=u.highest.height,f=Jt(this.chart.width-d,0,this.maxWidth);a=t.offset?this.maxWidth/r:f/(r-1),d+6>a&&(a=f/(r-(t.offset?.5:1)),l=this.maxHeight-Pc(t.grid)-n.padding-H_(t.title,this.chart.options.font),c=Math.sqrt(d*d+h*h),s=cw(Math.min(Math.asin(Jt((u.highest.height+6)/a,-1,1)),Math.asin(Jt(l/c,-1,1))-Math.asin(Jt(h/c,-1,1)))),s=Math.max(o,Math.min(i,s))),this.labelRotation=s}afterCalculateLabelRotation(){ht(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){ht(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:n,options:{ticks:r,title:o,grid:i}}=this,s=this._isVisible(),a=this.isHorizontal();if(s){const l=H_(o,n.options.font);if(a?(t.width=this.maxWidth,t.height=Pc(i)+l):(t.height=this.maxHeight,t.width=Pc(i)+l),r.display&&this.ticks.length){const{first:c,last:u,widest:d,highest:h}=this._getLabelSizes(),f=r.padding*2,p=zr(this.labelRotation),g=Math.cos(p),b=Math.sin(p);if(a){const v=r.mirror?0:b*d.width+g*h.height;t.height=Math.min(this.maxHeight,t.height+v+f)}else{const v=r.mirror?0:g*d.width+b*h.height;t.width=Math.min(this.maxWidth,t.width+v+f)}this._calculatePadding(c,u,b,g)}}this._handleMargins(),a?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,n,r,o){const{ticks:{align:i,padding:s},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 h=0,f=0;l?c?(h=o*t.width,f=r*n.height):(h=r*t.height,f=o*n.width):i==="start"?f=n.width:i==="end"?h=t.width:i!=="inner"&&(h=t.width/2,f=n.width/2),this.paddingLeft=Math.max((h-u+s)*this.width/(this.width-u),0),this.paddingRight=Math.max((f-d+s)*this.width/(this.width-d),0)}else{let u=n.height/2,d=t.height/2;i==="start"?(u=0,d=t.height):i==="end"&&(u=n.height,d=0),this.paddingTop=u+s,this.paddingBottom=d+s}}_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(){ht(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++)Ne(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=V_(r,n)),this._labelSizes=t=this._computeLabelSizes(r,r.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,n,r){const{ctx:o,_longestTextCache:i}=this,s=[],a=[],l=Math.floor(n/B_(n,r));let c=0,u=0,d,h,f,p,g,b,v,x,y,_,w;for(d=0;d<n;d+=l){if(p=t[d].label,g=this._resolveTickFontOptions(d),o.font=b=g.string,v=i[b]=i[b]||{data:{},gc:[]},x=g.lineHeight,y=_=0,!Ne(p)&&!Rt(p))y=Uh(o,v.data,v.gc,y,p),_=x;else if(Rt(p))for(h=0,f=p.length;h<f;++h)w=p[h],!Ne(w)&&!Rt(w)&&(y=Uh(o,v.data,v.gc,y,w),_+=x);s.push(y),a.push(_),c=Math.max(y,c),u=Math.max(_,u)}bW(i,n);const C=s.indexOf(c),R=a.indexOf(u),k=D=>({width:s[D]||0,height:a[D]||0});return{first:k(0),last:k(n-1),widest:k(C),highest:k(R),widths:s,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 iV(this._alignToPixels?us(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=yW(this.getContext(),t,r))}return this.$context||(this.$context=vW(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,n=zr(this.labelRotation),r=Math.abs(Math.cos(n)),o=Math.abs(Math.sin(n)),i=this._getLabelSizes(),s=t.autoSkipPadding||0,a=i?i.widest.width+s:0,l=i?i.highest.height+s:0;return this.isHorizontal()?l*r>a*o?a/r:l/o:l*o<a*r?l/r:a/o}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const n=this.axis,r=this.chart,o=this.options,{grid:i,position:s,border:a}=o,l=i.offset,c=this.isHorizontal(),d=this.ticks.length+(l?1:0),h=Pc(i),f=[],p=a.setContext(this.getContext()),g=p.display?p.width:0,b=g/2,v=function(A){return us(r,A,g)};let x,y,_,w,C,R,k,D,I,T,N,G;if(s==="top")x=v(this.bottom),R=this.bottom-h,D=x-b,T=v(t.top)+b,G=t.bottom;else if(s==="bottom")x=v(this.top),T=t.top,G=v(t.bottom)-b,R=x+b,D=this.top+h;else if(s==="left")x=v(this.right),C=this.right-h,k=x-b,I=v(t.left)+b,N=t.right;else if(s==="right")x=v(this.left),I=t.left,N=v(t.right)-b,C=x+b,k=this.left+h;else if(n==="x"){if(s==="center")x=v((t.top+t.bottom)/2+.5);else if(qe(s)){const A=Object.keys(s)[0],L=s[A];x=v(this.chart.scales[A].getPixelForValue(L))}T=t.top,G=t.bottom,R=x+b,D=R+h}else if(n==="y"){if(s==="center")x=v((t.left+t.right)/2);else if(qe(s)){const A=Object.keys(s)[0],L=s[A];x=v(this.chart.scales[A].getPixelForValue(L))}C=x-b,k=C-h,I=t.left,N=t.right}const z=ke(o.ticks.maxTicksLimit,d),O=Math.max(1,Math.ceil(d/z));for(y=0;y<d;y+=O){const A=this.getContext(y),L=i.setContext(A),j=a.setContext(A),B=L.lineWidth,M=L.color,W=j.dash||[],F=j.dashOffset,P=L.tickWidth,U=L.tickColor,q=L.tickBorderDash||[],K=L.tickBorderDashOffset;_=mW(this,y,l),_!==void 0&&(w=us(r,_,B),c?C=k=I=N=w:R=D=T=G=w,f.push({tx1:C,ty1:R,tx2:k,ty2:D,x1:I,y1:T,x2:N,y2:G,width:B,color:M,borderDash:W,borderDashOffset:F,tickWidth:P,tickColor:U,tickBorderDash:q,tickBorderDashOffset:K}))}return this._ticksLength=d,this._borderValue=x,f}_computeLabelItems(t){const n=this.axis,r=this.options,{position:o,ticks:i}=r,s=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:c,padding:u,mirror:d}=i,h=Pc(r.grid),f=h+u,p=d?-u:f,g=-zr(this.labelRotation),b=[];let v,x,y,_,w,C,R,k,D,I,T,N,G="middle";if(o==="top")C=this.bottom-p,R=this._getXAxisLabelAlignment();else if(o==="bottom")C=this.top+p,R=this._getXAxisLabelAlignment();else if(o==="left"){const O=this._getYAxisLabelAlignment(h);R=O.textAlign,w=O.x}else if(o==="right"){const O=this._getYAxisLabelAlignment(h);R=O.textAlign,w=O.x}else if(n==="x"){if(o==="center")C=(t.top+t.bottom)/2+f;else if(qe(o)){const O=Object.keys(o)[0],A=o[O];C=this.chart.scales[O].getPixelForValue(A)+f}R=this._getXAxisLabelAlignment()}else if(n==="y"){if(o==="center")w=(t.left+t.right)/2-f;else if(qe(o)){const O=Object.keys(o)[0],A=o[O];w=this.chart.scales[O].getPixelForValue(A)}R=this._getYAxisLabelAlignment(h).textAlign}n==="y"&&(l==="start"?G="top":l==="end"&&(G="bottom"));const z=this._getLabelSizes();for(v=0,x=a.length;v<x;++v){y=a[v],_=y.label;const O=i.setContext(this.getContext(v));k=this.getPixelForTick(v)+i.labelOffset,D=this._resolveTickFontOptions(v),I=D.lineHeight,T=Rt(_)?_.length:1;const A=T/2,L=O.color,j=O.textStrokeColor,B=O.textStrokeWidth;let M=R;s?(w=k,R==="inner"&&(v===x-1?M=this.options.reverse?"left":"right":v===0?M=this.options.reverse?"right":"left":M="center"),o==="top"?c==="near"||g!==0?N=-T*I+I/2:c==="center"?N=-z.highest.height/2-A*I+I:N=-z.highest.height+I/2:c==="near"||g!==0?N=I/2:c==="center"?N=z.highest.height/2-A*I:N=z.highest.height-T*I,d&&(N*=-1),g!==0&&!O.showLabelBackdrop&&(w+=I/2*Math.sin(g))):(C=k,N=(1-T)*I/2);let W;if(O.showLabelBackdrop){const F=on(O.backdropPadding),P=z.heights[v],U=z.widths[v];let q=N-F.top,K=0-F.left;switch(G){case"middle":q-=P/2;break;case"bottom":q-=P;break}switch(R){case"center":K-=U/2;break;case"right":K-=U;break;case"inner":v===x-1?K-=U:v>0&&(K-=U/2);break}W={left:K,top:q,width:U+F.width,height:P+F.height,color:O.backdropColor}}b.push({label:_,font:D,textOffset:N,options:{rotation:g,color:L,strokeColor:j,strokeWidth:B,textAlign:M,textBaseline:G,translation:[w,C],backdrop:W}})}return b}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-zr(this.labelRotation))return t==="top"?"left":"right";let o="center";return n.align==="start"?o="left":n.align==="end"?o="right":n.align==="inner"&&(o="inner"),o}_getYAxisLabelAlignment(t){const{position:n,ticks:{crossAlign:r,mirror:o,padding:i}}=this.options,s=this._getLabelSizes(),a=t+i,l=s.widest.width;let c,u;return n==="left"?o?(u=this.right+i,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"?o?(u=this.left+i,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:o,width:i,height:s}=this;n&&(t.save(),t.fillStyle=n,t.fillRect(r,o,i,s),t.restore())}getLineWidthForValue(t){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const o=this.ticks.findIndex(i=>i.value===t);return o>=0?n.setContext(this.getContext(o)).lineWidth:0}drawGrid(t){const n=this.options.grid,r=this.ctx,o=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let i,s;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(i=0,s=o.length;i<s;++i){const l=o[i];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:o}}=this,i=r.setContext(this.getContext()),s=r.display?i.width:0;if(!s)return;const a=o.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,u,d,h;this.isHorizontal()?(c=us(t,this.left,s)-s/2,u=us(t,this.right,a)+a/2,d=h=l):(d=us(t,this.top,s)-s/2,h=us(t,this.bottom,a)+a/2,c=u=l),n.save(),n.lineWidth=i.width,n.strokeStyle=i.color,n.beginPath(),n.moveTo(c,d),n.lineTo(u,h),n.stroke(),n.restore()}drawLabels(t){if(!this.options.ticks.display)return;const r=this.ctx,o=this._computeLabelArea();o&&Bs(r,o);const i=this.getLabelItems(t);for(const s of i){const a=s.options,l=s.font,c=s.label,u=s.textOffset;oa(r,c,0,u,l,a)}o&&Vs(r)}drawTitle(){const{ctx:t,options:{position:n,title:r,reverse:o}}=this;if(!r.display)return;const i=Wt(r.font),s=on(r.padding),a=r.align;let l=i.lineHeight/2;n==="bottom"||n==="center"||qe(n)?(l+=s.bottom,Rt(r.text)&&(l+=i.lineHeight*(r.text.length-1))):l+=s.top;const{titleX:c,titleY:u,maxWidth:d,rotation:h}=wW(this,l,n,a);oa(t,r.text,0,0,i,{color:r.color,maxWidth:d,rotation:h,textAlign:xW(a,n,o),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=ke(t.grid&&t.grid.z,-1),o=ke(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==Ji.prototype.draw?[{z:n,draw:i=>{this.draw(i)}}]:[{z:r,draw:i=>{this.drawBackground(),this.drawGrid(i),this.drawTitle()}},{z:o,draw:()=>{this.drawBorder()}},{z:n,draw:i=>{this.drawLabels(i)}}]}getMatchingVisibleMetas(t){const n=this.chart.getSortedVisibleDatasetMetas(),r=this.axis+"AxisID",o=[];let i,s;for(i=0,s=n.length;i<s;++i){const a=n[i];a[r]===this.id&&(!t||a.type===t)&&o.push(a)}return o}_resolveTickFontOptions(t){const n=this.options.ticks.setContext(this.getContext(t));return Wt(n.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class wf{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;_W(n)&&(r=this.register(n));const o=this.items,i=t.id,s=this.scope+"."+i;if(!i)throw new Error("class does not have id: "+t);return i in o||(o[i]=t,SW(t,s,r),this.override&&Mt.override(t.id,t.overrides)),s}get(t){return this.items[t]}unregister(t){const n=this.items,r=t.id,o=this.scope;r in n&&delete n[r],o&&r in Mt[o]&&(delete Mt[o][r],this.override&&delete ra[r])}}function SW(e,t,n){const r=Zt(Object.create(null),[n?Mt.get(n):{},Mt.get(t),e.defaults]);Mt.set(t,r),e.defaultRoutes&&CW(t,e.defaultRoutes),e.descriptors&&Mt.describe(t,e.descriptors)}function CW(e,t){Object.keys(t).forEach(n=>{const r=n.split("."),o=r.pop(),i=[e].concat(r).join("."),s=t[n].split("."),a=s.pop(),l=s.join(".");Mt.route(i,o,l,a)})}function _W(e){return"id"in e&&"defaults"in e}class EW{constructor(){this.controllers=new wf(Mr,"datasets",!0),this.elements=new wf(Oo,"elements"),this.plugins=new wf(Object,"plugins"),this.scales=new wf(Ji,"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(o=>{const i=r||this._getRegistryForType(o);r||i.isForType(o)||i===this.plugins&&o.id?this._exec(t,i,o):ct(o,s=>{const a=r||this._getRegistryForType(s);this._exec(t,a,s)})})}_exec(t,n,r){const o=lw(t);ht(r["before"+o],[],r),n[t](r),ht(r["after"+o],[],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 o=n.get(t);if(o===void 0)throw new Error('"'+t+'" is not a registered '+r+".");return o}}var Pn=new EW;class RW{constructor(){this._init=[]}notify(t,n,r,o){n==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const i=o?this._descriptors(t).filter(o):this._descriptors(t),s=this._notify(i,t,n,r);return n==="afterDestroy"&&(this._notify(i,t,"stop"),this._notify(this._init,t,"uninstall")),s}_notify(t,n,r,o){o=o||{};for(const i of t){const s=i.plugin,a=s[r],l=[n,o,i.options];if(ht(a,l,s)===!1&&o.cancelable)return!1}return!0}invalidate(){Ne(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,o=ke(r.options&&r.options.plugins,{}),i=PW(r);return o===!1&&!n?[]:kW(t,i,o,n)}_notifyStateChanges(t){const n=this._oldCache||[],r=this._cache,o=(i,s)=>i.filter(a=>!s.some(l=>a.plugin.id===l.plugin.id));this._notify(o(n,r),t,"stop"),this._notify(o(r,n),t,"start")}}function PW(e){const t={},n=[],r=Object.keys(Pn.plugins.items);for(let i=0;i<r.length;i++)n.push(Pn.getPlugin(r[i]));const o=e.plugins||[];for(let i=0;i<o.length;i++){const s=o[i];n.indexOf(s)===-1&&(n.push(s),t[s.id]=!0)}return{plugins:n,localIds:t}}function MW(e,t){return!t&&e===!1?null:e===!0?{}:e}function kW(e,{plugins:t,localIds:n},r,o){const i=[],s=e.getContext();for(const a of t){const l=a.id,c=MW(r[l],o);c!==null&&i.push({plugin:a,options:OW(e.config,{plugin:a,local:n[l]},c,s)})}return i}function OW(e,{plugin:t,local:n},r,o){const i=e.pluginScopeKeys(t),s=e.getOptionScopes(r,i);return n&&t.defaults&&s.push(t.defaults),e.createResolver(s,o,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Cv(e,t){const n=Mt.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function DW(e,t){let n=e;return e==="_index_"?n=t:e==="_value_"&&(n=t==="x"?"y":"x"),n}function TW(e,t){return e===t?"_index_":"_value_"}function W_(e){if(e==="x"||e==="y"||e==="r")return e}function IW(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function _v(e,...t){if(W_(e))return e;for(const n of t){const r=n.axis||IW(n.position)||e.length>1&&W_(e[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function U_(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function AW(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 U_(e,"x",n[0])||U_(e,"y",n[0])}return{}}function NW(e,t){const n=ra[e.type]||{scales:{}},r=t.scales||{},o=Cv(e.type,t),i=Object.create(null);return Object.keys(r).forEach(s=>{const a=r[s];if(!qe(a))return console.error(`Invalid scale configuration for scale: ${s}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${s}`);const l=_v(s,a,AW(s,e),Mt.scales[a.type]),c=TW(l,o),u=n.scales||{};i[s]=nu(Object.create(null),[{axis:l},a,u[l],u[c]])}),e.data.datasets.forEach(s=>{const a=s.type||e.type,l=s.indexAxis||Cv(a,t),u=(ra[a]||{}).scales||{};Object.keys(u).forEach(d=>{const h=DW(d,l),f=s[h+"AxisID"]||h;i[f]=i[f]||Object.create(null),nu(i[f],[{axis:h},r[f],u[d]])})}),Object.keys(i).forEach(s=>{const a=i[s];nu(a,[Mt.scales[a.type],Mt.scale])}),i}function KO(e){const t=e.options||(e.options={});t.plugins=ke(t.plugins,{}),t.scales=NW(e,t)}function XO(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function jW(e){return e=e||{},e.data=XO(e.data),KO(e),e}const q_=new Map,QO=new Set;function Sf(e,t){let n=q_.get(e);return n||(n=t(),q_.set(e,n),QO.add(n)),n}const Mc=(e,t,n)=>{const r=$i(t,n);r!==void 0&&e.add(r)};class FW{constructor(t){this._config=jW(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=XO(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(),KO(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Sf(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return Sf(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return Sf(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,r=this.type;return Sf(`${r}-plugin-${n}`,()=>[[`plugins.${n}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,n){const r=this._scopeCache;let o=r.get(t);return(!o||n)&&(o=new Map,r.set(t,o)),o}getOptionScopes(t,n,r){const{options:o,type:i}=this,s=this._cachedScopes(t,r),a=s.get(n);if(a)return a;const l=new Set;n.forEach(u=>{t&&(l.add(t),u.forEach(d=>Mc(l,t,d))),u.forEach(d=>Mc(l,o,d)),u.forEach(d=>Mc(l,ra[i]||{},d)),u.forEach(d=>Mc(l,Mt,d)),u.forEach(d=>Mc(l,wv,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),QO.has(n)&&s.set(n,c),c}chartOptionScopes(){const{options:t,type:n}=this;return[t,ra[n]||{},Mt.datasets[n]||{},{type:n},Mt,wv]}resolveNamedOptions(t,n,r,o=[""]){const i={$shared:!0},{resolver:s,subPrefixes:a}=G_(this._resolverCache,t,o);let l=s;if($W(s,n)){i.$shared=!1,r=zi(r)?r():r;const c=this.createResolver(t,r,a);l=Nl(s,r,c)}for(const c of n)i[c]=l[c];return i}createResolver(t,n,r=[""],o){const{resolver:i}=G_(this._resolverCache,t,r);return qe(n)?Nl(i,n,void 0,o):i}}function G_(e,t,n){let r=e.get(t);r||(r=new Map,e.set(t,r));const o=n.join();let i=r.get(o);return i||(i={resolver:pw(t,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},r.set(o,i)),i}const LW=e=>qe(e)&&Object.getOwnPropertyNames(e).some(t=>zi(e[t]));function $W(e,t){const{isScriptable:n,isIndexable:r}=OO(e);for(const o of t){const i=n(o),s=r(o),a=(s||i)&&e[o];if(i&&(zi(a)||LW(a))||s&&Rt(a))return!0}return!1}var zW="4.4.8";const BW=["top","bottom","left","right","chartArea"];function Y_(e,t){return e==="top"||e==="bottom"||BW.indexOf(e)===-1&&t==="x"}function K_(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}function X_(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),ht(n&&n.onComplete,[e],t)}function VW(e){const t=e.chart,n=t.options.animation;ht(n&&n.onProgress,[e],t)}function JO(e){return bw()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const bh={},Q_=e=>{const t=JO(e);return Object.values(bh).filter(n=>n.canvas===t).pop()};function HW(e,t,n){const r=Object.keys(e);for(const o of r){const i=+o;if(i>=t){const s=e[o];delete e[o],(n>0||i>t)&&(e[i+n]=s)}}}function WW(e,t,n,r){return!n||e.type==="mouseout"?null:r?t:e}function Cf(e,t,n){return e.options.clip?e[n]:t[n]}function UW(e,t){const{xScale:n,yScale:r}=e;return n&&r?{left:Cf(n,t,"left"),right:Cf(n,t,"right"),top:Cf(r,t,"top"),bottom:Cf(r,t,"bottom")}:t}class Tt{static register(...t){Pn.add(...t),J_()}static unregister(...t){Pn.remove(...t),J_()}constructor(t,n){const r=this.config=new FW(n),o=JO(t),i=Q_(o);if(i)throw new Error("Canvas is already in use. Chart with ID '"+i.id+"' must be destroyed before the canvas with ID '"+i.canvas.id+"' can be reused.");const s=r.createResolver(r.chartOptionScopes(),this.getContext());this.platform=new(r.platform||lW(o)),this.platform.updateConfig(r);const a=this.platform.acquireContext(o,s.aspectRatio),l=a&&a.canvas,c=l&&l.height,u=l&&l.width;if(this.id=qB(),this.ctx=a,this.canvas=l,this.width=u,this.height=c,this._options=s,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 RW,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=cV(d=>this.update(d),s.resizeDelay||0),this._dataChanges=[],bh[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}zo.listen(this,"complete",X_),zo.listen(this,"progress",VW),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:r,height:o,_aspectRatio:i}=this;return Ne(t)?n&&i?i:o?r/o: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 Pn}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():x_(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return b_(this.canvas,this.ctx),this}stop(){return zo.stop(this),this}resize(t,n){zo.running(this)?this._resizeBeforeDraw={width:t,height:n}:this._resize(t,n)}_resize(t,n){const r=this.options,o=this.canvas,i=r.maintainAspectRatio&&this.aspectRatio,s=this.platform.getMaximumSize(o,t,n,i),a=r.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=s.width,this.height=s.height,this._aspectRatio=this.aspectRatio,x_(this,a,!0)&&(this.notifyPlugins("resize",{size:s}),ht(r.onResize,[this,s],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};ct(n,(r,o)=>{r.id=o})}buildOrUpdateScales(){const t=this.options,n=t.scales,r=this.scales,o=Object.keys(r).reduce((s,a)=>(s[a]=!1,s),{});let i=[];n&&(i=i.concat(Object.keys(n).map(s=>{const a=n[s],l=_v(s,a),c=l==="r",u=l==="x";return{options:a,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),ct(i,s=>{const a=s.options,l=a.id,c=_v(l,a),u=ke(a.type,s.dtype);(a.position===void 0||Y_(a.position,c)!==Y_(s.dposition))&&(a.position=s.dposition),o[l]=!0;let d=null;if(l in r&&r[l].type===u)d=r[l];else{const h=Pn.getScale(u);d=new h({id:l,type:u,ctx:this.ctx,chart:this}),r[d.id]=d}d.init(a,t)}),ct(o,(s,a)=>{s||delete r[a]}),ct(r,s=>{mn.configure(this,s,s.options),mn.addBox(this,s)})}_updateMetasets(){const t=this._metasets,n=this.data.datasets.length,r=t.length;if(t.sort((o,i)=>o.index-i.index),r>n){for(let o=n;o<r;++o)this._destroyDatasetMeta(o);t.splice(n,r-n)}this._sortedMetasets=t.slice(0).sort(K_("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:n}}=this;t.length>n.length&&delete this._stacks,t.forEach((r,o)=>{n.filter(i=>i===r._dataset).length===0&&this._destroyDatasetMeta(o)})}buildOrUpdateControllers(){const t=[],n=this.data.datasets;let r,o;for(this._removeUnreferencedMetasets(),r=0,o=n.length;r<o;r++){const i=n[r];let s=this.getDatasetMeta(r);const a=i.type||this.config.type;if(s.type&&s.type!==a&&(this._destroyDatasetMeta(r),s=this.getDatasetMeta(r)),s.type=a,s.indexAxis=i.indexAxis||Cv(a,this.options),s.order=i.order||0,s.index=r,s.label=""+i.label,s.visible=this.isDatasetVisible(r),s.controller)s.controller.updateIndex(r),s.controller.linkScales();else{const l=Pn.getController(a),{datasetElementType:c,dataElementType:u}=Mt.datasets[a];Object.assign(l,{dataElementType:Pn.getElement(u),datasetElementType:c&&Pn.getElement(c)}),s.controller=new l(this,r),t.push(s.controller)}}return this._updateMetasets(),t}_resetElements(){ct(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()),o=this._animationsDisabled=!r.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const i=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let s=0;for(let c=0,u=this.data.datasets.length;c<u;c++){const{controller:d}=this.getDatasetMeta(c),h=!o&&i.indexOf(d)===-1;d.buildOrUpdateElements(h),s=Math.max(+d.getMaxOverflow(),s)}s=this._minPadding=r.layout.autoPadding?s:0,this._updateLayout(s),o||ct(i,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(K_("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){ct(this.scales,t=>{mn.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),r=new Set(t.events);(!l_(n,r)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,n=this._getUniformDataChanges()||[];for(const{method:r,start:o,count:i}of n){const s=r==="_removeElements"?-i:i;HW(t,o,s)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const n=this.data.datasets.length,r=i=>new Set(t.filter(s=>s[0]===i).map((s,a)=>a+","+s.splice(1).join(","))),o=r(0);for(let i=1;i<n;i++)if(!l_(o,r(i)))return;return Array.from(o).map(i=>i.split(",")).map(i=>({method:i[1],start:+i[2],count:+i[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;mn.update(this,this.width,this.height,t);const n=this.chartArea,r=n.width<=0||n.height<=0;this._layers=[],ct(this.boxes,o=>{r&&o.position==="chartArea"||(o.configure&&o.configure(),this._layers.push(...o._layers()))},this),this._layers.forEach((o,i)=>{o._idx=i}),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,zi(t)?t({datasetIndex:n}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,n){const r=this.getDatasetMeta(t),o={meta:r,index:t,mode:n,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",o)!==!1&&(r.controller._update(n),o.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",o))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(zo.has(this)?this.attached&&!zo.running(this)&&zo.start(this):(this.draw(),X_({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:r,height:o}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(r,o)}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 o,i;for(o=0,i=n.length;o<i;++o){const s=n[o];(!t||s.visible)&&r.push(s)}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=t._clip,o=!r.disabled,i=UW(t,this.chartArea),s={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",s)!==!1&&(o&&Bs(n,{left:r.left===!1?0:i.left-r.left,right:r.right===!1?this.width:i.right+r.right,top:r.top===!1?0:i.top-r.top,bottom:r.bottom===!1?this.height:i.bottom+r.bottom}),t.controller.draw(),o&&Vs(n),s.cancelable=!1,this.notifyPlugins("afterDatasetDraw",s))}isPointInArea(t){return ei(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,r,o){const i=BH.modes[n];return typeof i=="function"?i(this,t,r,o):[]}getDatasetMeta(t){const n=this.data.datasets[t],r=this._metasets;let o=r.filter(i=>i&&i._dataset===n).pop();return o||(o={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(o)),o}getContext(){return this.$context||(this.$context=Qi(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 o=r?"show":"hide",i=this.getDatasetMeta(t),s=i.controller._resolveAnimations(void 0,o);Ou(n)?(i.data[n].hidden=!r,this.update()):(this.setDatasetVisibility(t,r),s.update(i,{visible:r}),this.update(a=>a.datasetIndex===t?o: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(),zo.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(),b_(t,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete bh[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=(i,s)=>{n.addEventListener(this,i,s),t[i]=s},o=(i,s,a)=>{i.offsetX=s,i.offsetY=a,this._eventHandler(i)};ct(this.options.events,i=>r(i,o))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,n=this.platform,r=(l,c)=>{n.addEventListener(this,l,c),t[l]=c},o=(l,c)=>{t[l]&&(n.removeEventListener(this,l,c),delete t[l])},i=(l,c)=>{this.canvas&&this.resize(l,c)};let s;const a=()=>{o("attach",a),this.attached=!0,this.resize(),r("resize",i),r("detach",s)};s=()=>{this.attached=!1,o("resize",i),this._stop(),this._resize(0,0),r("attach",a)},n.isAttached(this.canvas)?a():s()}unbindEvents(){ct(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},ct(this._responsiveListeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,n,r){const o=r?"set":"remove";let i,s,a,l;for(n==="dataset"&&(i=this.getDatasetMeta(t[0].datasetIndex),i.controller["_"+o+"DatasetHoverStyle"]()),a=0,l=t.length;a<l;++a){s=t[a];const c=s&&this.getDatasetMeta(s.datasetIndex).controller;c&&c[o+"HoverStyle"](s.element,s.datasetIndex,s.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const n=this._active||[],r=t.map(({datasetIndex:i,index:s})=>{const a=this.getDatasetMeta(i);if(!a)throw new Error("No dataset found at index "+i);return{datasetIndex:i,element:a.data[s],index:s}});!Vh(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 o=this.options.hover,i=(l,c)=>l.filter(u=>!c.some(d=>u.datasetIndex===d.datasetIndex&&u.index===d.index)),s=i(n,t),a=r?t:i(t,n);s.length&&this.updateHoverStyle(s,o.mode,!1),a.length&&o.mode&&this.updateHoverStyle(a,o.mode,!0)}_eventHandler(t,n){const r={event:t,replay:n,cancelable:!0,inChartArea:this.isPointInArea(t)},o=s=>(s.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",r,o)===!1)return;const i=this._handleEvent(t,n,r.inChartArea);return r.cancelable=!1,this.notifyPlugins("afterEvent",r,o),(i||r.changed)&&this.render(),this}_handleEvent(t,n,r){const{_active:o=[],options:i}=this,s=n,a=this._getActiveElements(t,o,r,s),l=JB(t),c=WW(t,this._lastEvent,r,l);r&&(this._lastEvent=null,ht(i.onHover,[t,a,this],this),l&&ht(i.onClick,[t,a,this],this));const u=!Vh(a,o);return(u||n)&&(this._active=a,this._updateHoverStyles(a,o,n)),this._lastEvent=c,u}_getActiveElements(t,n,r,o){if(t.type==="mouseout")return[];if(!r)return n;const i=this.options.hover;return this.getElementsAtEventForMode(t,i.mode,i,o)}}fe(Tt,"defaults",Mt),fe(Tt,"instances",bh),fe(Tt,"overrides",ra),fe(Tt,"registry",Pn),fe(Tt,"version",zW),fe(Tt,"getChart",Q_);function J_(){return ct(Tt.instances,e=>e._plugins.invalidate())}function qW(e,t,n){const{startAngle:r,pixelMargin:o,x:i,y:s,outerRadius:a,innerRadius:l}=t;let c=o/a;e.beginPath(),e.arc(i,s,a,r-c,n+c),l>o?(c=o/l,e.arc(i,s,l,n+c,r-c,!0)):e.arc(i,s,o,n+$t,r-$t),e.closePath(),e.clip()}function GW(e){return hw(e,["outerStart","outerEnd","innerStart","innerEnd"])}function YW(e,t,n,r){const o=GW(e.options.borderRadius),i=(n-t)/2,s=Math.min(i,r*t/2),a=l=>{const c=(n-Math.min(i,l))*r/2;return Jt(l,0,Math.min(i,c))};return{outerStart:a(o.outerStart),outerEnd:a(o.outerEnd),innerStart:Jt(o.innerStart,0,s),innerEnd:Jt(o.innerEnd,0,s)}}function Da(e,t,n,r){return{x:n+e*Math.cos(t),y:r+e*Math.sin(t)}}function Kh(e,t,n,r,o,i){const{x:s,y:a,startAngle:l,pixelMargin:c,innerRadius:u}=t,d=Math.max(t.outerRadius+r+n-c,0),h=u>0?u+r+n+c:0;let f=0;const p=o-l;if(r){const O=u>0?u-r:0,A=d>0?d-r:0,L=(O+A)/2,j=L!==0?p*L/(L+r):p;f=(p-j)/2}const g=Math.max(.001,p*d-n/kt)/d,b=(p-g)/2,v=l+b+f,x=o-b-f,{outerStart:y,outerEnd:_,innerStart:w,innerEnd:C}=YW(t,h,d,x-v),R=d-y,k=d-_,D=v+y/R,I=x-_/k,T=h+w,N=h+C,G=v+w/T,z=x-C/N;if(e.beginPath(),i){const O=(D+I)/2;if(e.arc(s,a,d,D,O),e.arc(s,a,d,O,I),_>0){const B=Da(k,I,s,a);e.arc(B.x,B.y,_,I,x+$t)}const A=Da(N,x,s,a);if(e.lineTo(A.x,A.y),C>0){const B=Da(N,z,s,a);e.arc(B.x,B.y,C,x+$t,z+Math.PI)}const L=(x-C/h+(v+w/h))/2;if(e.arc(s,a,h,x-C/h,L,!0),e.arc(s,a,h,L,v+w/h,!0),w>0){const B=Da(T,G,s,a);e.arc(B.x,B.y,w,G+Math.PI,v-$t)}const j=Da(R,v,s,a);if(e.lineTo(j.x,j.y),y>0){const B=Da(R,D,s,a);e.arc(B.x,B.y,y,v-$t,D)}}else{e.moveTo(s,a);const O=Math.cos(D)*d+s,A=Math.sin(D)*d+a;e.lineTo(O,A);const L=Math.cos(I)*d+s,j=Math.sin(I)*d+a;e.lineTo(L,j)}e.closePath()}function KW(e,t,n,r,o){const{fullCircles:i,startAngle:s,circumference:a}=t;let l=t.endAngle;if(i){Kh(e,t,n,r,l,o);for(let c=0;c<i;++c)e.fill();isNaN(a)||(l=s+(a%Pt||Pt))}return Kh(e,t,n,r,l,o),e.fill(),l}function XW(e,t,n,r,o){const{fullCircles:i,startAngle:s,circumference:a,options:l}=t,{borderWidth:c,borderJoinStyle:u,borderDash:d,borderDashOffset:h}=l,f=l.borderAlign==="inner";if(!c)return;e.setLineDash(d||[]),e.lineDashOffset=h,f?(e.lineWidth=c*2,e.lineJoin=u||"round"):(e.lineWidth=c,e.lineJoin=u||"bevel");let p=t.endAngle;if(i){Kh(e,t,n,r,p,o);for(let g=0;g<i;++g)e.stroke();isNaN(a)||(p=s+(a%Pt||Pt))}f&&qW(e,t,p),i||(Kh(e,t,n,r,p,o),e.stroke())}class Wa extends Oo{constructor(n){super();fe(this,"circumference");fe(this,"endAngle");fe(this,"fullCircles");fe(this,"innerRadius");fe(this,"outerRadius");fe(this,"pixelMargin");fe(this,"startAngle");this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,n&&Object.assign(this,n)}inRange(n,r,o){const i=this.getProps(["x","y"],o),{angle:s,distance:a}=xO(i,{x:n,y:r}),{startAngle:l,endAngle:c,innerRadius:u,outerRadius:d,circumference:h}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],o),f=(this.options.spacing+this.options.borderWidth)/2,p=ke(h,c-l),g=Du(s,l,c)&&l!==c,b=p>=Pt||g,v=Jo(a,u+f,d+f);return b&&v}getCenterPoint(n){const{x:r,y:o,startAngle:i,endAngle:s,innerRadius:a,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],n),{offset:c,spacing:u}=this.options,d=(i+s)/2,h=(a+l+u+c)/2;return{x:r+Math.cos(d)*h,y:o+Math.sin(d)*h}}tooltipPosition(n){return this.getCenterPoint(n)}draw(n){const{options:r,circumference:o}=this,i=(r.offset||0)/4,s=(r.spacing||0)/2,a=r.circular;if(this.pixelMargin=r.borderAlign==="inner"?.33:0,this.fullCircles=o>Pt?Math.floor(o/Pt):0,o===0||this.innerRadius<0||this.outerRadius<0)return;n.save();const l=(this.startAngle+this.endAngle)/2;n.translate(Math.cos(l)*i,Math.sin(l)*i);const c=1-Math.sin(Math.min(kt,o||0)),u=i*c;n.fillStyle=r.backgroundColor,n.strokeStyle=r.borderColor,KW(n,this,u,s,a),XW(n,this,u,s,a),n.restore()}}fe(Wa,"id","arc"),fe(Wa,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),fe(Wa,"defaultRoutes",{backgroundColor:"backgroundColor"}),fe(Wa,"descriptors",{_scriptable:!0,_indexable:n=>n!=="borderDash"});function ZO(e,t,n=t){e.lineCap=ke(n.borderCapStyle,t.borderCapStyle),e.setLineDash(ke(n.borderDash,t.borderDash)),e.lineDashOffset=ke(n.borderDashOffset,t.borderDashOffset),e.lineJoin=ke(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=ke(n.borderWidth,t.borderWidth),e.strokeStyle=ke(n.borderColor,t.borderColor)}function QW(e,t,n){e.lineTo(n.x,n.y)}function JW(e){return e.stepped?wV:e.tension||e.cubicInterpolationMode==="monotone"?SV:QW}function eD(e,t,n={}){const r=e.length,{start:o=0,end:i=r-1}=n,{start:s,end:a}=t,l=Math.max(o,s),c=Math.min(i,a),u=o<s&&i<s||o>a&&i>a;return{count:r,start:l,loop:t.loop,ilen:c<l&&!u?r+c-l:c-l}}function ZW(e,t,n,r){const{points:o,options:i}=t,{count:s,start:a,loop:l,ilen:c}=eD(o,n,r),u=JW(i);let{move:d=!0,reverse:h}=r||{},f,p,g;for(f=0;f<=c;++f)p=o[(a+(h?c-f:f))%s],!p.skip&&(d?(e.moveTo(p.x,p.y),d=!1):u(e,g,p,h,i.stepped),g=p);return l&&(p=o[(a+(h?c:0))%s],u(e,g,p,h,i.stepped)),!!l}function eU(e,t,n,r){const o=t.points,{count:i,start:s,ilen:a}=eD(o,n,r),{move:l=!0,reverse:c}=r||{};let u=0,d=0,h,f,p,g,b,v;const x=_=>(s+(c?a-_:_))%i,y=()=>{g!==b&&(e.lineTo(u,b),e.lineTo(u,g),e.lineTo(u,v))};for(l&&(f=o[x(0)],e.moveTo(f.x,f.y)),h=0;h<=a;++h){if(f=o[x(h)],f.skip)continue;const _=f.x,w=f.y,C=_|0;C===p?(w<g?g=w:w>b&&(b=w),u=(d*u+_)/++d):(y(),e.lineTo(_,w),p=C,d=0,g=b=w),v=w}y()}function Ev(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?eU:ZW}function tU(e){return e.stepped?eH:e.tension||e.cubicInterpolationMode==="monotone"?tH:bs}function nU(e,t,n,r){let o=t._path;o||(o=t._path=new Path2D,t.path(o,n,r)&&o.closePath()),ZO(e,t.options),e.stroke(o)}function rU(e,t,n,r){const{segments:o,options:i}=t,s=Ev(t);for(const a of o)ZO(e,i,a.style),e.beginPath(),s(e,t,a,{start:n,end:n+r-1})&&e.closePath(),e.stroke()}const oU=typeof Path2D=="function";function iU(e,t,n,r){oU&&!t.options.segment?nU(e,t,n,r):rU(e,t,n,r)}class Oi extends Oo{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 o=r.spanGaps?this._loop:this._fullLoop;qV(this._points,r,t,o,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=aH(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,o=t[n],i=this.points,s=zO(this,{property:n,start:o,end:o});if(!s.length)return;const a=[],l=tU(r);let c,u;for(c=0,u=s.length;c<u;++c){const{start:d,end:h}=s[c],f=i[d],p=i[h];if(f===p){a.push(f);continue}const g=Math.abs((o-f[n])/(p[n]-f[n])),b=l(f,p,g,r.stepped);b[n]=t[n],a.push(b)}return a.length===1?a[0]:a}pathSegment(t,n,r){return Ev(this)(t,this,n,r)}path(t,n,r){const o=this.segments,i=Ev(this);let s=this._loop;n=n||0,r=r||this.points.length-n;for(const a of o)s&=i(t,this,a,{start:n,end:n+r-1});return!!s}draw(t,n,r,o){const i=this.options||{};(this.points||[]).length&&i.borderWidth&&(t.save(),iU(t,this,r,o),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}fe(Oi,"id","line"),fe(Oi,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),fe(Oi,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),fe(Oi,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function Z_(e,t,n,r){const o=e.options,{[n]:i}=e.getProps([n],r);return Math.abs(t-i)<o.radius+o.hitRadius}class Us extends Oo{constructor(n){super();fe(this,"parsed");fe(this,"skip");fe(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,o){const i=this.options,{x:s,y:a}=this.getProps(["x","y"],o);return Math.pow(n-s,2)+Math.pow(r-a,2)<Math.pow(i.hitRadius+i.radius,2)}inXRange(n,r){return Z_(this,n,"x",r)}inYRange(n,r){return Z_(this,n,"y",r)}getCenterPoint(n){const{x:r,y:o}=this.getProps(["x","y"],n);return{x:r,y:o}}size(n){n=n||this.options||{};let r=n.radius||0;r=Math.max(r,r&&n.hoverRadius||0);const o=r&&n.borderWidth||0;return(r+o)*2}draw(n,r){const o=this.options;this.skip||o.radius<.1||!ei(this,r,this.size(o)/2)||(n.strokeStyle=o.borderColor,n.lineWidth=o.borderWidth,n.fillStyle=o.backgroundColor,qh(n,o,this.x,this.y))}getRange(){const n=this.options||{};return n.radius+n.hitRadius}}fe(Us,"id","point"),fe(Us,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),fe(Us,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function tD(e,t){const{x:n,y:r,base:o,width:i,height:s}=e.getProps(["x","y","base","width","height"],t);let a,l,c,u,d;return e.horizontal?(d=s/2,a=Math.min(n,o),l=Math.max(n,o),c=r-d,u=r+d):(d=i/2,a=n-d,l=n+d,c=Math.min(r,o),u=Math.max(r,o)),{left:a,top:c,right:l,bottom:u}}function Di(e,t,n,r){return e?0:Jt(t,n,r)}function sU(e,t,n){const r=e.options.borderWidth,o=e.borderSkipped,i=kO(r);return{t:Di(o.top,i.top,0,n),r:Di(o.right,i.right,0,t),b:Di(o.bottom,i.bottom,0,n),l:Di(o.left,i.left,0,t)}}function aU(e,t,n){const{enableBorderRadius:r}=e.getProps(["enableBorderRadius"]),o=e.options.borderRadius,i=Hs(o),s=Math.min(t,n),a=e.borderSkipped,l=r||qe(o);return{topLeft:Di(!l||a.top||a.left,i.topLeft,0,s),topRight:Di(!l||a.top||a.right,i.topRight,0,s),bottomLeft:Di(!l||a.bottom||a.left,i.bottomLeft,0,s),bottomRight:Di(!l||a.bottom||a.right,i.bottomRight,0,s)}}function lU(e){const t=tD(e),n=t.right-t.left,r=t.bottom-t.top,o=sU(e,n/2,r/2),i=aU(e,n/2,r/2);return{outer:{x:t.left,y:t.top,w:n,h:r,radius:i},inner:{x:t.left+o.l,y:t.top+o.t,w:n-o.l-o.r,h:r-o.t-o.b,radius:{topLeft:Math.max(0,i.topLeft-Math.max(o.t,o.l)),topRight:Math.max(0,i.topRight-Math.max(o.t,o.r)),bottomLeft:Math.max(0,i.bottomLeft-Math.max(o.b,o.l)),bottomRight:Math.max(0,i.bottomRight-Math.max(o.b,o.r))}}}}function hb(e,t,n,r){const o=t===null,i=n===null,a=e&&!(o&&i)&&tD(e,r);return a&&(o||Jo(t,a.left,a.right))&&(i||Jo(n,a.top,a.bottom))}function cU(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}function uU(e,t){e.rect(t.x,t.y,t.w,t.h)}function pb(e,t,n={}){const r=e.x!==n.x?-t:0,o=e.y!==n.y?-t:0,i=(e.x+e.w!==n.x+n.w?t:0)-r,s=(e.y+e.h!==n.y+n.h?t:0)-o;return{x:e.x+r,y:e.y+o,w:e.w+i,h:e.h+s,radius:e.radius}}class qs extends Oo{constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:n,options:{borderColor:r,backgroundColor:o}}=this,{inner:i,outer:s}=lU(this),a=cU(s.radius)?Tu:uU;t.save(),(s.w!==i.w||s.h!==i.h)&&(t.beginPath(),a(t,pb(s,n,i)),t.clip(),a(t,pb(i,-n,s)),t.fillStyle=r,t.fill("evenodd")),t.beginPath(),a(t,pb(i,n)),t.fillStyle=o,t.fill(),t.restore()}inRange(t,n,r){return hb(this,t,n,r)}inXRange(t,n){return hb(this,t,null,n)}inYRange(t,n){return hb(this,null,t,n)}getCenterPoint(t){const{x:n,y:r,base:o,horizontal:i}=this.getProps(["x","y","base","horizontal"],t);return{x:i?(n+o)/2:n,y:i?r:(r+o)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}fe(qs,"id","bar"),fe(qs,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),fe(qs,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var dU=Object.freeze({__proto__:null,ArcElement:Wa,BarElement:qs,LineElement:Oi,PointElement:Us});const Rv=["rgb(54, 162, 235)","rgb(255, 99, 132)","rgb(255, 159, 64)","rgb(255, 205, 86)","rgb(75, 192, 192)","rgb(153, 102, 255)","rgb(201, 203, 207)"],eE=Rv.map(e=>e.replace("rgb(","rgba(").replace(")",", 0.5)"));function nD(e){return Rv[e%Rv.length]}function rD(e){return eE[e%eE.length]}function fU(e,t){return e.borderColor=nD(t),e.backgroundColor=rD(t),++t}function hU(e,t){return e.backgroundColor=e.data.map(()=>nD(t++)),t}function pU(e,t){return e.backgroundColor=e.data.map(()=>rD(t++)),t}function gU(e){let t=0;return(n,r)=>{const o=e.getDatasetMeta(r).controller;o instanceof Rs?t=hU(n,t):o instanceof su?t=pU(n,t):o&&(t=fU(n,t))}}function tE(e){let t;for(t in e)if(e[t].borderColor||e[t].backgroundColor)return!0;return!1}function mU(e){return e&&(e.borderColor||e.backgroundColor)}function bU(){return Mt.borderColor!=="rgba(0,0,0,0.1)"||Mt.backgroundColor!=="rgba(0,0,0,0.1)"}var vU={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(e,t,n){if(!n.enabled)return;const{data:{datasets:r},options:o}=e.config,{elements:i}=o,s=tE(r)||mU(o)||i&&tE(i)||bU();if(!n.forceOverride&&s)return;const a=gU(e);r.forEach(a)}};function yU(e,t,n,r,o){const i=o.samples||r;if(i>=n)return e.slice(t,t+n);const s=[],a=(n-2)/(i-2);let l=0;const c=t+n-1;let u=t,d,h,f,p,g;for(s[l++]=e[u],d=0;d<i-2;d++){let b=0,v=0,x;const y=Math.floor((d+1)*a)+1+t,_=Math.min(Math.floor((d+2)*a)+1,n)+t,w=_-y;for(x=y;x<_;x++)b+=e[x].x,v+=e[x].y;b/=w,v/=w;const C=Math.floor(d*a)+1+t,R=Math.min(Math.floor((d+1)*a)+1,n)+t,{x:k,y:D}=e[u];for(f=p=-1,x=C;x<R;x++)p=.5*Math.abs((k-b)*(e[x].y-D)-(k-e[x].x)*(v-D)),p>f&&(f=p,h=e[x],g=x);s[l++]=h,u=g}return s[l++]=e[c],s}function xU(e,t,n,r){let o=0,i=0,s,a,l,c,u,d,h,f,p,g;const b=[],v=t+n-1,x=e[t].x,_=e[v].x-x;for(s=t;s<t+n;++s){a=e[s],l=(a.x-x)/_*r,c=a.y;const w=l|0;if(w===u)c<p?(p=c,d=s):c>g&&(g=c,h=s),o=(i*o+a.x)/++i;else{const C=s-1;if(!Ne(d)&&!Ne(h)){const R=Math.min(d,h),k=Math.max(d,h);R!==f&&R!==C&&b.push({...e[R],x:o}),k!==f&&k!==C&&b.push({...e[k],x:o})}s>0&&C!==f&&b.push(e[C]),b.push(a),u=w,i=0,p=g=c,d=h=f=s}}return b}function oD(e){if(e._decimated){const t=e._data;delete e._decimated,delete e._data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function nE(e){e.data.datasets.forEach(t=>{oD(t)})}function wU(e,t){const n=t.length;let r=0,o;const{iScale:i}=e,{min:s,max:a,minDefined:l,maxDefined:c}=i.getUserBounds();return l&&(r=Jt(Zo(t,i.axis,s).lo,0,n-1)),c?o=Jt(Zo(t,i.axis,a).hi+1,r,n)-r:o=n-r,{start:r,count:o}}var SU={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(e,t,n)=>{if(!n.enabled){nE(e);return}const r=e.width;e.data.datasets.forEach((o,i)=>{const{_data:s,indexAxis:a}=o,l=e.getDatasetMeta(i),c=s||o.data;if(_t([a,e.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;const u=e.scales[l.xAxisID];if(u.type!=="linear"&&u.type!=="time"||e.options.parsing)return;let{start:d,count:h}=wU(l,c);const f=n.threshold||4*r;if(h<=f){oD(o);return}Ne(s)&&(o._data=c,delete o.data,Object.defineProperty(o,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(g){this._data=g}}));let p;switch(n.algorithm){case"lttb":p=yU(c,d,h,r,n);break;case"min-max":p=xU(c,d,h,r);break;default:throw new Error(`Unsupported decimation algorithm '${n.algorithm}'`)}o._decimated=p})},destroy(e){nE(e)}};function CU(e,t,n){const r=e.segments,o=e.points,i=t.points,s=[];for(const a of r){let{start:l,end:c}=a;c=xw(l,c,o);const u=Pv(n,o[l],o[c],a.loop);if(!t.segments){s.push({source:a,target:u,start:o[l],end:o[c]});continue}const d=zO(t,u);for(const h of d){const f=Pv(n,i[h.start],i[h.end],h.loop),p=$O(a,o,f);for(const g of p)s.push({source:g,target:h,start:{[n]:rE(u,f,"start",Math.max)},end:{[n]:rE(u,f,"end",Math.min)}})}}return s}function Pv(e,t,n,r){if(r)return;let o=t[e],i=n[e];return e==="angle"&&(o=cr(o),i=cr(i)),{property:e,start:o,end:i}}function _U(e,t){const{x:n=null,y:r=null}=e||{},o=t.points,i=[];return t.segments.forEach(({start:s,end:a})=>{a=xw(s,a,o);const l=o[s],c=o[a];r!==null?(i.push({x:l.x,y:r}),i.push({x:c.x,y:r})):n!==null&&(i.push({x:n,y:l.y}),i.push({x:n,y:c.y}))}),i}function xw(e,t,n){for(;t>e;t--){const r=n[t];if(!isNaN(r.x)&&!isNaN(r.y))break}return t}function rE(e,t,n,r){return e&&t?r(e[n],t[n]):e?e[n]:t?t[n]:0}function iD(e,t){let n=[],r=!1;return Rt(e)?(r=!0,n=e):n=_U(e,t),n.length?new Oi({points:n,options:{tension:0},_loop:r,_fullLoop:r}):null}function oE(e){return e&&e.fill!==!1}function EU(e,t,n){let o=e[t].fill;const i=[t];let s;if(!n)return o;for(;o!==!1&&i.indexOf(o)===-1;){if(!jt(o))return o;if(s=e[o],!s)return!1;if(s.visible)return o;i.push(o),o=s.fill}return!1}function RU(e,t,n){const r=OU(e);if(qe(r))return isNaN(r.value)?!1:r;let o=parseFloat(r);return jt(o)&&Math.floor(o)===o?PU(r[0],t,o,n):["origin","start","end","stack","shape"].indexOf(r)>=0&&r}function PU(e,t,n,r){return(e==="-"||e==="+")&&(n=t+n),n===t||n<0||n>=r?!1:n}function MU(e,t){let n=null;return e==="start"?n=t.bottom:e==="end"?n=t.top:qe(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}function kU(e,t,n){let r;return e==="start"?r=n:e==="end"?r=t.options.reverse?t.min:t.max:qe(e)?r=e.value:r=t.getBaseValue(),r}function OU(e){const t=e.options,n=t.fill;let r=ke(n&&n.target,n);return r===void 0&&(r=!!t.backgroundColor),r===!1||r===null?!1:r===!0?"origin":r}function DU(e){const{scale:t,index:n,line:r}=e,o=[],i=r.segments,s=r.points,a=TU(t,n);a.push(iD({x:null,y:t.bottom},r));for(let l=0;l<i.length;l++){const c=i[l];for(let u=c.start;u<=c.end;u++)IU(o,s[u],a)}return new Oi({points:o,options:{}})}function TU(e,t){const n=[],r=e.getMatchingVisibleMetas("line");for(let o=0;o<r.length;o++){const i=r[o];if(i.index===t)break;i.hidden||n.unshift(i.dataset)}return n}function IU(e,t,n){const r=[];for(let o=0;o<n.length;o++){const i=n[o],{first:s,last:a,point:l}=AU(i,t,"x");if(!(!l||s&&a)){if(s)r.unshift(l);else if(e.push(l),!a)break}}e.push(...r)}function AU(e,t,n){const r=e.interpolate(t,n);if(!r)return{};const o=r[n],i=e.segments,s=e.points;let a=!1,l=!1;for(let c=0;c<i.length;c++){const u=i[c],d=s[u.start][n],h=s[u.end][n];if(Jo(o,d,h)){a=o===d,l=o===h;break}}return{first:a,last:l,point:r}}class sD{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,n,r){const{x:o,y:i,radius:s}=this;return n=n||{start:0,end:Pt},t.arc(o,i,s,n.end,n.start,!0),!r.bounds}interpolate(t){const{x:n,y:r,radius:o}=this,i=t.angle;return{x:n+Math.cos(i)*o,y:r+Math.sin(i)*o,angle:i}}}function NU(e){const{chart:t,fill:n,line:r}=e;if(jt(n))return jU(t,n);if(n==="stack")return DU(e);if(n==="shape")return!0;const o=FU(e);return o instanceof sD?o:iD(o,r)}function jU(e,t){const n=e.getDatasetMeta(t);return n&&e.isDatasetVisible(t)?n.dataset:null}function FU(e){return(e.scale||{}).getPointPositionForValue?$U(e):LU(e)}function LU(e){const{scale:t={},fill:n}=e,r=MU(n,t);if(jt(r)){const o=t.isHorizontal();return{x:o?r:null,y:o?null:r}}return null}function $U(e){const{scale:t,fill:n}=e,r=t.options,o=t.getLabels().length,i=r.reverse?t.max:t.min,s=kU(n,t,i),a=[];if(r.grid.circular){const l=t.getPointPositionForValue(0,i);return new sD({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(s)})}for(let l=0;l<o;++l)a.push(t.getPointPositionForValue(l,s));return a}function gb(e,t,n){const r=NU(t),{line:o,scale:i,axis:s}=t,a=o.options,l=a.fill,c=a.backgroundColor,{above:u=c,below:d=c}=l||{};r&&o.points.length&&(Bs(e,n),zU(e,{line:o,target:r,above:u,below:d,area:n,scale:i,axis:s}),Vs(e))}function zU(e,t){const{line:n,target:r,above:o,below:i,area:s,scale:a}=t,l=n._loop?"angle":t.axis;e.save(),l==="x"&&i!==o&&(iE(e,r,s.top),sE(e,{line:n,target:r,color:o,scale:a,property:l}),e.restore(),e.save(),iE(e,r,s.bottom)),sE(e,{line:n,target:r,color:i,scale:a,property:l}),e.restore()}function iE(e,t,n){const{segments:r,points:o}=t;let i=!0,s=!1;e.beginPath();for(const a of r){const{start:l,end:c}=a,u=o[l],d=o[xw(l,c,o)];i?(e.moveTo(u.x,u.y),i=!1):(e.lineTo(u.x,n),e.lineTo(u.x,u.y)),s=!!t.pathSegment(e,a,{move:s}),s?e.closePath():e.lineTo(d.x,n)}e.lineTo(t.first().x,n),e.closePath(),e.clip()}function sE(e,t){const{line:n,target:r,property:o,color:i,scale:s}=t,a=CU(n,r,o);for(const{source:l,target:c,start:u,end:d}of a){const{style:{backgroundColor:h=i}={}}=l,f=r!==!0;e.save(),e.fillStyle=h,BU(e,s,f&&Pv(o,u,d)),e.beginPath();const p=!!n.pathSegment(e,l);let g;if(f){p?e.closePath():aE(e,r,d,o);const b=!!r.pathSegment(e,c,{move:p,reverse:!0});g=p&&b,g||aE(e,r,u,o)}e.closePath(),e.fill(g?"evenodd":"nonzero"),e.restore()}}function BU(e,t,n){const{top:r,bottom:o}=t.chart.chartArea,{property:i,start:s,end:a}=n||{};i==="x"&&(e.beginPath(),e.rect(s,r,a-s,o-r),e.clip())}function aE(e,t,n,r){const o=t.interpolate(n,r);o&&e.lineTo(o.x,o.y)}var VU={id:"filler",afterDatasetsUpdate(e,t,n){const r=(e.data.datasets||[]).length,o=[];let i,s,a,l;for(s=0;s<r;++s)i=e.getDatasetMeta(s),a=i.dataset,l=null,a&&a.options&&a instanceof Oi&&(l={visible:e.isDatasetVisible(s),index:s,fill:RU(a,s,r),chart:e,axis:i.controller.options.indexAxis,scale:i.vScale,line:a}),i.$filler=l,o.push(l);for(s=0;s<r;++s)l=o[s],!(!l||l.fill===!1)&&(l.fill=EU(o,s,n.propagate))},beforeDraw(e,t,n){const r=n.drawTime==="beforeDraw",o=e.getSortedVisibleDatasetMetas(),i=e.chartArea;for(let s=o.length-1;s>=0;--s){const a=o[s].$filler;a&&(a.line.updateControlPoints(i,a.axis),r&&a.fill&&gb(e.ctx,a,i))}},beforeDatasetsDraw(e,t,n){if(n.drawTime!=="beforeDatasetsDraw")return;const r=e.getSortedVisibleDatasetMetas();for(let o=r.length-1;o>=0;--o){const i=r[o].$filler;oE(i)&&gb(e.ctx,i,e.chartArea)}},beforeDatasetDraw(e,t,n){const r=t.meta.$filler;!oE(r)||n.drawTime!=="beforeDatasetDraw"||gb(e.ctx,r,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const lE=(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)}},HU=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class cE extends Oo{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=ht(t.generateLabels,[this.chart],this)||[];t.filter&&(n=n.filter(r=>t.filter(r,this.chart.data))),t.sort&&(n=n.sort((r,o)=>t.sort(r,o,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,o=Wt(r.font),i=o.size,s=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=lE(r,i);let c,u;n.font=o.string,this.isHorizontal()?(c=this.maxWidth,u=this._fitRows(s,i,a,l)+10):(u=this.maxHeight,c=this._fitCols(s,o,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,o){const{ctx:i,maxWidth:s,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],u=o+a;let d=t;i.textAlign="left",i.textBaseline="middle";let h=-1,f=-u;return this.legendItems.forEach((p,g)=>{const b=r+n/2+i.measureText(p.text).width;(g===0||c[c.length-1]+b+2*a>s)&&(d+=u,c[c.length-(g>0?0:1)]=0,f+=u,h++),l[g]={left:0,top:f,row:h,width:b,height:o},c[c.length-1]+=b+a}),d}_fitCols(t,n,r,o){const{ctx:i,maxHeight:s,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],u=s-t;let d=a,h=0,f=0,p=0,g=0;return this.legendItems.forEach((b,v)=>{const{itemWidth:x,itemHeight:y}=WU(r,n,i,b,o);v>0&&f+y+2*a>u&&(d+=h+a,c.push({width:h,height:f}),p+=h+a,g++,h=f=0),l[v]={left:p,top:f,col:g,width:x,height:y},h=Math.max(h,x),f+=y+a}),d+=h,c.push({width:h,height:f}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:r,labels:{padding:o},rtl:i}}=this,s=nl(i,this.left,this.width);if(this.isHorizontal()){let a=0,l=hn(r,this.left+o,this.right-this.lineWidths[a]);for(const c of n)a!==c.row&&(a=c.row,l=hn(r,this.left+o,this.right-this.lineWidths[a])),c.top+=this.top+t+o,c.left=s.leftForLtr(s.x(l),c.width),l+=c.width+o}else{let a=0,l=hn(r,this.top+t+o,this.bottom-this.columnSizes[a].height);for(const c of n)c.col!==a&&(a=c.col,l=hn(r,this.top+t+o,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+o,c.left=s.leftForLtr(s.x(c.left),c.width),l+=c.height+o}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;Bs(t,this),this._draw(),Vs(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:r,ctx:o}=this,{align:i,labels:s}=t,a=Mt.color,l=nl(t.rtl,this.left,this.width),c=Wt(s.font),{padding:u}=s,d=c.size,h=d/2;let f;this.drawTitle(),o.textAlign=l.textAlign("left"),o.textBaseline="middle",o.lineWidth=.5,o.font=c.string;const{boxWidth:p,boxHeight:g,itemHeight:b}=lE(s,d),v=function(C,R,k){if(isNaN(p)||p<=0||isNaN(g)||g<0)return;o.save();const D=ke(k.lineWidth,1);if(o.fillStyle=ke(k.fillStyle,a),o.lineCap=ke(k.lineCap,"butt"),o.lineDashOffset=ke(k.lineDashOffset,0),o.lineJoin=ke(k.lineJoin,"miter"),o.lineWidth=D,o.strokeStyle=ke(k.strokeStyle,a),o.setLineDash(ke(k.lineDash,[])),s.usePointStyle){const I={radius:g*Math.SQRT2/2,pointStyle:k.pointStyle,rotation:k.rotation,borderWidth:D},T=l.xPlus(C,p/2),N=R+h;MO(o,I,T,N,s.pointStyleWidth&&p)}else{const I=R+Math.max((d-g)/2,0),T=l.leftForLtr(C,p),N=Hs(k.borderRadius);o.beginPath(),Object.values(N).some(G=>G!==0)?Tu(o,{x:T,y:I,w:p,h:g,radius:N}):o.rect(T,I,p,g),o.fill(),D!==0&&o.stroke()}o.restore()},x=function(C,R,k){oa(o,k.text,C,R+b/2,c,{strikethrough:k.hidden,textAlign:l.textAlign(k.textAlign)})},y=this.isHorizontal(),_=this._computeTitleHeight();y?f={x:hn(i,this.left+u,this.right-r[0]),y:this.top+u+_,line:0}:f={x:this.left+u,y:hn(i,this.top+_+u,this.bottom-n[0].height),line:0},jO(this.ctx,t.textDirection);const w=b+u;this.legendItems.forEach((C,R)=>{o.strokeStyle=C.fontColor,o.fillStyle=C.fontColor;const k=o.measureText(C.text).width,D=l.textAlign(C.textAlign||(C.textAlign=s.textAlign)),I=p+h+k;let T=f.x,N=f.y;l.setWidth(this.width),y?R>0&&T+I+u>this.right&&(N=f.y+=w,f.line++,T=f.x=hn(i,this.left+u,this.right-r[f.line])):R>0&&N+w>this.bottom&&(T=f.x=T+n[f.line].width+u,f.line++,N=f.y=hn(i,this.top+_+u,this.bottom-n[f.line].height));const G=l.x(T);if(v(G,N,C),T=uV(D,T+p+h,y?T+I:this.right,t.rtl),x(l.x(T),N,C),y)f.x+=I+u;else if(typeof C.text!="string"){const z=c.lineHeight;f.y+=aD(C,z)+u}else f.y+=w}),FO(this.ctx,t.textDirection)}drawTitle(){const t=this.options,n=t.title,r=Wt(n.font),o=on(n.padding);if(!n.display)return;const i=nl(t.rtl,this.left,this.width),s=this.ctx,a=n.position,l=r.size/2,c=o.top+l;let u,d=this.left,h=this.width;if(this.isHorizontal())h=Math.max(...this.lineWidths),u=this.top+c,d=hn(t.align,d,this.right-h);else{const p=this.columnSizes.reduce((g,b)=>Math.max(g,b.height),0);u=c+hn(t.align,this.top,this.bottom-p-t.labels.padding-this._computeTitleHeight())}const f=hn(a,d,d+h);s.textAlign=i.textAlign(dw(a)),s.textBaseline="middle",s.strokeStyle=n.color,s.fillStyle=n.color,s.font=r.string,oa(s,n.text,f,u,r)}_computeTitleHeight(){const t=this.options.title,n=Wt(t.font),r=on(t.padding);return t.display?n.lineHeight+r.height:0}_getLegendItemAt(t,n){let r,o,i;if(Jo(t,this.left,this.right)&&Jo(n,this.top,this.bottom)){for(i=this.legendHitBoxes,r=0;r<i.length;++r)if(o=i[r],Jo(t,o.left,o.left+o.width)&&Jo(n,o.top,o.top+o.height))return this.legendItems[r]}return null}handleEvent(t){const n=this.options;if(!GU(t.type,n))return;const r=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const o=this._hoveredItem,i=HU(o,r);o&&!i&&ht(n.onLeave,[t,o,this],this),this._hoveredItem=r,r&&!i&&ht(n.onHover,[t,r,this],this)}else r&&ht(n.onClick,[t,r,this],this)}}function WU(e,t,n,r,o){const i=UU(r,e,t,n),s=qU(o,r,t.lineHeight);return{itemWidth:i,itemHeight:s}}function UU(e,t,n,r){let o=e.text;return o&&typeof o!="string"&&(o=o.reduce((i,s)=>i.length>s.length?i:s)),t+n.size/2+r.measureText(o).width}function qU(e,t,n){let r=e;return typeof t.text!="string"&&(r=aD(t,n)),r}function aD(e,t){const n=e.text?e.text.length:0;return t*n}function GU(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var YU={id:"legend",_element:cE,start(e,t,n){const r=e.legend=new cE({ctx:e.ctx,options:n,chart:e});mn.configure(e,r,n),mn.addBox(e,r)},stop(e){mn.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const r=e.legend;mn.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,o=n.chart;o.isDatasetVisible(r)?(o.hide(r),t.hidden=!0):(o.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:o,color:i,useBorderRadius:s,borderRadius:a}}=e.legend.options;return e._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(n?0:void 0),u=on(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:i,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:o||c.textAlign,borderRadius:s&&(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)}}};let ww=class extends Oo{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 o=Rt(r.text)?r.text.length:1;this._padding=on(r.padding);const i=o*Wt(r.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=i:this.width=i}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:n,left:r,bottom:o,right:i,options:s}=this,a=s.align;let l=0,c,u,d;return this.isHorizontal()?(u=hn(a,r,i),d=n+t,c=i-r):(s.position==="left"?(u=r+t,d=hn(a,o,n),l=kt*-.5):(u=i-t,d=hn(a,n,o),l=kt*.5),c=o-n),{titleX:u,titleY:d,maxWidth:c,rotation:l}}draw(){const t=this.ctx,n=this.options;if(!n.display)return;const r=Wt(n.font),i=r.lineHeight/2+this._padding.top,{titleX:s,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(i);oa(t,n.text,0,0,r,{color:n.color,maxWidth:l,rotation:c,textAlign:dw(n.align),textBaseline:"middle",translation:[s,a]})}};function KU(e,t){const n=new ww({ctx:e.ctx,options:t,chart:e});mn.configure(e,n,t),mn.addBox(e,n),e.titleBlock=n}var XU={id:"title",_element:ww,start(e,t,n){KU(e,n)},stop(e){const t=e.titleBlock;mn.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){const r=e.titleBlock;mn.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 _f=new WeakMap;var QU={id:"subtitle",start(e,t,n){const r=new ww({ctx:e.ctx,options:n,chart:e});mn.configure(e,r,n),mn.addBox(e,r),_f.set(e,r)},stop(e){mn.removeBox(e,_f.get(e)),_f.delete(e)},beforeUpdate(e,t,n){const r=_f.get(e);mn.configure(e,r,n),r.options=n},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Uc={average(e){if(!e.length)return!1;let t,n,r=new Set,o=0,i=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),o+=l.y,++i}}return i===0||r.size===0?!1:{x:[...r].reduce((a,l)=>a+l)/r.size,y:o/i}},nearest(e,t){if(!e.length)return!1;let n=t.x,r=t.y,o=Number.POSITIVE_INFINITY,i,s,a;for(i=0,s=e.length;i<s;++i){const l=e[i].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),u=xv(t,c);u<o&&(o=u,a=l)}}if(a){const l=a.tooltipPosition();n=l.x,r=l.y}return{x:n,y:r}}};function Zr(e,t){return t&&(Rt(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function Bo(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(`
244
- `)>-1?e.split(`
245
- `):e}function JU(e,t){const{element:n,datasetIndex:r,index:o}=t,i=e.getDatasetMeta(r).controller,{label:s,value:a}=i.getLabelAndValue(o);return{chart:e,label:s,parsed:i.getParsed(o),raw:e.data.datasets[r].data[o],formattedValue:a,dataset:i.getDataset(),dataIndex:o,datasetIndex:r,element:n}}function uE(e,t){const n=e.chart.ctx,{body:r,footer:o,title:i}=e,{boxWidth:s,boxHeight:a}=t,l=Wt(t.bodyFont),c=Wt(t.titleFont),u=Wt(t.footerFont),d=i.length,h=o.length,f=r.length,p=on(t.padding);let g=p.height,b=0,v=r.reduce((_,w)=>_+w.before.length+w.lines.length+w.after.length,0);if(v+=e.beforeBody.length+e.afterBody.length,d&&(g+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),v){const _=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;g+=f*_+(v-f)*l.lineHeight+(v-1)*t.bodySpacing}h&&(g+=t.footerMarginTop+h*u.lineHeight+(h-1)*t.footerSpacing);let x=0;const y=function(_){b=Math.max(b,n.measureText(_).width+x)};return n.save(),n.font=c.string,ct(e.title,y),n.font=l.string,ct(e.beforeBody.concat(e.afterBody),y),x=t.displayColors?s+2+t.boxPadding:0,ct(r,_=>{ct(_.before,y),ct(_.lines,y),ct(_.after,y)}),x=0,n.font=u.string,ct(e.footer,y),n.restore(),b+=p.width,{width:b,height:g}}function ZU(e,t){const{y:n,height:r}=t;return n<r/2?"top":n>e.height-r/2?"bottom":"center"}function eq(e,t,n,r){const{x:o,width:i}=r,s=n.caretSize+n.caretPadding;if(e==="left"&&o+i+s>t.width||e==="right"&&o-i-s<0)return!0}function tq(e,t,n,r){const{x:o,width:i}=n,{width:s,chartArea:{left:a,right:l}}=e;let c="center";return r==="center"?c=o<=(a+l)/2?"left":"right":o<=i/2?c="left":o>=s-i/2&&(c="right"),eq(c,e,t,n)&&(c="center"),c}function dE(e,t,n){const r=n.yAlign||t.yAlign||ZU(e,n);return{xAlign:n.xAlign||t.xAlign||tq(e,t,n,r),yAlign:r}}function nq(e,t){let{x:n,width:r}=e;return t==="right"?n-=r:t==="center"&&(n-=r/2),n}function rq(e,t,n){let{y:r,height:o}=e;return t==="top"?r+=n:t==="bottom"?r-=o+n:r-=o/2,r}function fE(e,t,n,r){const{caretSize:o,caretPadding:i,cornerRadius:s}=e,{xAlign:a,yAlign:l}=n,c=o+i,{topLeft:u,topRight:d,bottomLeft:h,bottomRight:f}=Hs(s);let p=nq(t,a);const g=rq(t,l,c);return l==="center"?a==="left"?p+=c:a==="right"&&(p-=c):a==="left"?p-=Math.max(u,h)+o:a==="right"&&(p+=Math.max(d,f)+o),{x:Jt(p,0,r.width-t.width),y:Jt(g,0,r.height-t.height)}}function Ef(e,t,n){const r=on(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-r.right:e.x+r.left}function hE(e){return Zr([],Bo(e))}function oq(e,t,n){return Qi(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function pE(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const lD={beforeTitle:jo,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:jo,beforeBody:jo,beforeLabel:jo,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 Ne(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:jo,afterBody:jo,beforeFooter:jo,footer:jo,afterFooter:jo};function jn(e,t,n,r){const o=e[t].call(n,r);return typeof o>"u"?lD[t].call(n,r):o}var M0;let gE=(M0=class extends Oo{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()),o=r.enabled&&n.options.animation&&r.animations,i=new BO(this.chart,o);return o._cacheable&&(this._cachedAnimations=Object.freeze(i)),i}getContext(){return this.$context||(this.$context=oq(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:r}=n,o=jn(r,"beforeTitle",this,t),i=jn(r,"title",this,t),s=jn(r,"afterTitle",this,t);let a=[];return a=Zr(a,Bo(o)),a=Zr(a,Bo(i)),a=Zr(a,Bo(s)),a}getBeforeBody(t,n){return hE(jn(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:r}=n,o=[];return ct(t,i=>{const s={before:[],lines:[],after:[]},a=pE(r,i);Zr(s.before,Bo(jn(a,"beforeLabel",this,i))),Zr(s.lines,jn(a,"label",this,i)),Zr(s.after,Bo(jn(a,"afterLabel",this,i))),o.push(s)}),o}getAfterBody(t,n){return hE(jn(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:r}=n,o=jn(r,"beforeFooter",this,t),i=jn(r,"footer",this,t),s=jn(r,"afterFooter",this,t);let a=[];return a=Zr(a,Bo(o)),a=Zr(a,Bo(i)),a=Zr(a,Bo(s)),a}_createItems(t){const n=this._active,r=this.chart.data,o=[],i=[],s=[];let a=[],l,c;for(l=0,c=n.length;l<c;++l)a.push(JU(this.chart,n[l]));return t.filter&&(a=a.filter((u,d,h)=>t.filter(u,d,h,r))),t.itemSort&&(a=a.sort((u,d)=>t.itemSort(u,d,r))),ct(a,u=>{const d=pE(t.callbacks,u);o.push(jn(d,"labelColor",this,u)),i.push(jn(d,"labelPointStyle",this,u)),s.push(jn(d,"labelTextColor",this,u))}),this.labelColors=o,this.labelPointStyles=i,this.labelTextColors=s,this.dataPoints=a,a}update(t,n){const r=this.options.setContext(this.getContext()),o=this._active;let i,s=[];if(!o.length)this.opacity!==0&&(i={opacity:0});else{const a=Uc[r.position].call(this,o,this._eventPosition);s=this._createItems(r),this.title=this.getTitle(s,r),this.beforeBody=this.getBeforeBody(s,r),this.body=this.getBody(s,r),this.afterBody=this.getAfterBody(s,r),this.footer=this.getFooter(s,r);const l=this._size=uE(this,r),c=Object.assign({},a,l),u=dE(this.chart,r,c),d=fE(r,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,i={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=s,this.$context=void 0,i&&this._resolveAnimations().update(this,i),t&&r.external&&r.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(t,n,r,o){const i=this.getCaretPosition(t,r,o);n.lineTo(i.x1,i.y1),n.lineTo(i.x2,i.y2),n.lineTo(i.x3,i.y3)}getCaretPosition(t,n,r){const{xAlign:o,yAlign:i}=this,{caretSize:s,cornerRadius:a}=r,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:d}=Hs(a),{x:h,y:f}=t,{width:p,height:g}=n;let b,v,x,y,_,w;return i==="center"?(_=f+g/2,o==="left"?(b=h,v=b-s,y=_+s,w=_-s):(b=h+p,v=b+s,y=_-s,w=_+s),x=b):(o==="left"?v=h+Math.max(l,u)+s:o==="right"?v=h+p-Math.max(c,d)-s:v=this.caretX,i==="top"?(y=f,_=y-s,b=v-s,x=v+s):(y=f+g,_=y+s,b=v+s,x=v-s),w=y),{x1:b,x2:v,x3:x,y1:y,y2:_,y3:w}}drawTitle(t,n,r){const o=this.title,i=o.length;let s,a,l;if(i){const c=nl(r.rtl,this.x,this.width);for(t.x=Ef(this,r.titleAlign,r),n.textAlign=c.textAlign(r.titleAlign),n.textBaseline="middle",s=Wt(r.titleFont),a=r.titleSpacing,n.fillStyle=r.titleColor,n.font=s.string,l=0;l<i;++l)n.fillText(o[l],c.x(t.x),t.y+s.lineHeight/2),t.y+=s.lineHeight+a,l+1===i&&(t.y+=r.titleMarginBottom-a)}}_drawColorBox(t,n,r,o,i){const s=this.labelColors[r],a=this.labelPointStyles[r],{boxHeight:l,boxWidth:c}=i,u=Wt(i.bodyFont),d=Ef(this,"left",i),h=o.x(d),f=l<u.lineHeight?(u.lineHeight-l)/2:0,p=n.y+f;if(i.usePointStyle){const g={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},b=o.leftForLtr(h,c)+c/2,v=p+l/2;t.strokeStyle=i.multiKeyBackground,t.fillStyle=i.multiKeyBackground,qh(t,g,b,v),t.strokeStyle=s.borderColor,t.fillStyle=s.backgroundColor,qh(t,g,b,v)}else{t.lineWidth=qe(s.borderWidth)?Math.max(...Object.values(s.borderWidth)):s.borderWidth||1,t.strokeStyle=s.borderColor,t.setLineDash(s.borderDash||[]),t.lineDashOffset=s.borderDashOffset||0;const g=o.leftForLtr(h,c),b=o.leftForLtr(o.xPlus(h,1),c-2),v=Hs(s.borderRadius);Object.values(v).some(x=>x!==0)?(t.beginPath(),t.fillStyle=i.multiKeyBackground,Tu(t,{x:g,y:p,w:c,h:l,radius:v}),t.fill(),t.stroke(),t.fillStyle=s.backgroundColor,t.beginPath(),Tu(t,{x:b,y:p+1,w:c-2,h:l-2,radius:v}),t.fill()):(t.fillStyle=i.multiKeyBackground,t.fillRect(g,p,c,l),t.strokeRect(g,p,c,l),t.fillStyle=s.backgroundColor,t.fillRect(b,p+1,c-2,l-2))}t.fillStyle=this.labelTextColors[r]}drawBody(t,n,r){const{body:o}=this,{bodySpacing:i,bodyAlign:s,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:u}=r,d=Wt(r.bodyFont);let h=d.lineHeight,f=0;const p=nl(r.rtl,this.x,this.width),g=function(k){n.fillText(k,p.x(t.x+f),t.y+h/2),t.y+=h+i},b=p.textAlign(s);let v,x,y,_,w,C,R;for(n.textAlign=s,n.textBaseline="middle",n.font=d.string,t.x=Ef(this,b,r),n.fillStyle=r.bodyColor,ct(this.beforeBody,g),f=a&&b!=="right"?s==="center"?c/2+u:c+2+u:0,_=0,C=o.length;_<C;++_){for(v=o[_],x=this.labelTextColors[_],n.fillStyle=x,ct(v.before,g),y=v.lines,a&&y.length&&(this._drawColorBox(n,t,_,p,r),h=Math.max(d.lineHeight,l)),w=0,R=y.length;w<R;++w)g(y[w]),h=d.lineHeight;ct(v.after,g)}f=0,h=d.lineHeight,ct(this.afterBody,g),t.y-=i}drawFooter(t,n,r){const o=this.footer,i=o.length;let s,a;if(i){const l=nl(r.rtl,this.x,this.width);for(t.x=Ef(this,r.footerAlign,r),t.y+=r.footerMarginTop,n.textAlign=l.textAlign(r.footerAlign),n.textBaseline="middle",s=Wt(r.footerFont),n.fillStyle=r.footerColor,n.font=s.string,a=0;a<i;++a)n.fillText(o[a],l.x(t.x),t.y+s.lineHeight/2),t.y+=s.lineHeight+r.footerSpacing}}drawBackground(t,n,r,o){const{xAlign:i,yAlign:s}=this,{x:a,y:l}=t,{width:c,height:u}=r,{topLeft:d,topRight:h,bottomLeft:f,bottomRight:p}=Hs(o.cornerRadius);n.fillStyle=o.backgroundColor,n.strokeStyle=o.borderColor,n.lineWidth=o.borderWidth,n.beginPath(),n.moveTo(a+d,l),s==="top"&&this.drawCaret(t,n,r,o),n.lineTo(a+c-h,l),n.quadraticCurveTo(a+c,l,a+c,l+h),s==="center"&&i==="right"&&this.drawCaret(t,n,r,o),n.lineTo(a+c,l+u-p),n.quadraticCurveTo(a+c,l+u,a+c-p,l+u),s==="bottom"&&this.drawCaret(t,n,r,o),n.lineTo(a+f,l+u),n.quadraticCurveTo(a,l+u,a,l+u-f),s==="center"&&i==="left"&&this.drawCaret(t,n,r,o),n.lineTo(a,l+d),n.quadraticCurveTo(a,l,a+d,l),n.closePath(),n.fill(),o.borderWidth>0&&n.stroke()}_updateAnimationTarget(t){const n=this.chart,r=this.$animations,o=r&&r.x,i=r&&r.y;if(o||i){const s=Uc[t.position].call(this,this._active,this._eventPosition);if(!s)return;const a=this._size=uE(this,t),l=Object.assign({},s,this._size),c=dE(n,t,l),u=fE(t,l,c,n);(o._to!==u.x||i._to!==u.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=s.x,this.caretY=s.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 o={width:this.width,height:this.height},i={x:this.x,y:this.y};r=Math.abs(r)<.001?0:r;const s=on(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(i,t,o,n),jO(t,n.textDirection),i.y+=s.top,this.drawTitle(i,t,n),this.drawBody(i,t,n),this.drawFooter(i,t,n),FO(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){const r=this._active,o=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}}),i=!Vh(r,o),s=this._positionChanged(o,n);(i||s)&&(this._active=o,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,n,r=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const o=this.options,i=this._active||[],s=this._getActiveElements(t,i,n,r),a=this._positionChanged(s,t),l=n||!Vh(s,i)||a;return l&&(this._active=s,(o.enabled||o.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,n))),l}_getActiveElements(t,n,r,o){const i=this.options;if(t.type==="mouseout")return[];if(!o)return n.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);const s=this.chart.getElementsAtEventForMode(t,i.mode,i,r);return i.reverse&&s.reverse(),s}_positionChanged(t,n){const{caretX:r,caretY:o,options:i}=this,s=Uc[i.position].call(this,t,n);return s!==!1&&(r!==s.x||o!==s.y)}},fe(M0,"positioners",Uc),M0);var cD={id:"tooltip",_element:gE,positioners:Uc,afterInit(e,t,n){n&&(e.tooltip=new gE({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:lD},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"]},iq=Object.freeze({__proto__:null,Colors:vU,Decimation:SU,Filler:VU,Legend:YU,SubTitle:QU,Title:XU,Tooltip:cD});const sq=(e,t,n,r)=>(typeof t=="string"?(n=e.push(t)-1,r.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function aq(e,t,n,r){const o=e.indexOf(t);if(o===-1)return sq(e,t,n,r);const i=e.lastIndexOf(t);return o!==i?n:o}const lq=(e,t)=>e===null?null:Jt(Math.round(e),0,t);function mE(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class Xh extends Ji{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:o,label:i}of n)r[o]===i&&r.splice(o,1);this._addedLabels=[]}super.init(t)}parse(t,n){if(Ne(t))return null;const r=this.getLabels();return n=isFinite(n)&&r[n]===t?n:aq(r,t,ke(n,t),this._addedLabels),lq(n,r.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let{min:r,max:o}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(r=0),n||(o=this.getLabels().length-1)),this.min=r,this.max=o}buildTicks(){const t=this.min,n=this.max,r=this.options.offset,o=[];let i=this.getLabels();i=t===0&&n===i.length-1?i:i.slice(t,n+1),this._valueRange=Math.max(i.length-(r?0:1),1),this._startValue=this.min-(r?.5:0);for(let s=t;s<=n;s++)o.push({value:s});return o}getLabelForValue(t){return mE.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}}fe(Xh,"id","category"),fe(Xh,"defaults",{ticks:{callback:mE}});function cq(e,t){const n=[],{bounds:o,step:i,min:s,max:a,precision:l,count:c,maxTicks:u,maxDigits:d,includeBounds:h}=e,f=i||1,p=u-1,{min:g,max:b}=t,v=!Ne(s),x=!Ne(a),y=!Ne(c),_=(b-g)/(d+1);let w=u_((b-g)/p/f)*f,C,R,k,D;if(w<1e-14&&!v&&!x)return[{value:g},{value:b}];D=Math.ceil(b/w)-Math.floor(g/w),D>p&&(w=u_(D*w/p/f)*f),Ne(l)||(C=Math.pow(10,l),w=Math.ceil(w*C)/C),o==="ticks"?(R=Math.floor(g/w)*w,k=Math.ceil(b/w)*w):(R=g,k=b),v&&x&&i&&rV((a-s)/i,w/1e3)?(D=Math.round(Math.min((a-s)/w,u)),w=(a-s)/D,R=s,k=a):y?(R=v?s:R,k=x?a:k,D=c-1,w=(k-R)/D):(D=(k-R)/w,ru(D,Math.round(D),w/1e3)?D=Math.round(D):D=Math.ceil(D));const I=Math.max(d_(w),d_(R));C=Math.pow(10,Ne(l)?I:l),R=Math.round(R*C)/C,k=Math.round(k*C)/C;let T=0;for(v&&(h&&R!==s?(n.push({value:s}),R<s&&T++,ru(Math.round((R+T*w)*C)/C,s,bE(s,_,e))&&T++):R<s&&T++);T<D;++T){const N=Math.round((R+T*w)*C)/C;if(x&&N>a)break;n.push({value:N})}return x&&h&&k!==a?n.length&&ru(n[n.length-1].value,a,bE(a,_,e))?n[n.length-1].value=a:n.push({value:a}):(!x||k===a)&&n.push({value:k}),n}function bE(e,t,{horizontal:n,minRotation:r}){const o=zr(r),i=(n?Math.sin(o):Math.cos(o))||.001,s=.75*t*(""+e).length;return Math.min(t/i,s)}class Qh extends Ji{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 Ne(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:o,max:i}=this;const s=l=>o=n?o:l,a=l=>i=r?i:l;if(t){const l=go(o),c=go(i);l<0&&c<0?a(0):l>0&&c>0&&s(0)}if(o===i){let l=i===0?1:Math.abs(i*.05);a(i+l),t||s(o-l)}this.min=o,this.max=i}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:n,stepSize:r}=t,o;return r?(o=Math.ceil(this.max/r)-Math.floor(this.min/r)+1,o>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${r} would result generating up to ${o} ticks. Limiting to 1000.`),o=1e3)):(o=this.computeTickLimit(),n=n||11),n&&(o=Math.min(n,o)),o}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,n=t.ticks;let r=this.getTickLimit();r=Math.max(2,r);const o={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},i=this._range||this,s=cq(o,i);return t.bounds==="ticks"&&yO(s,this,"value"),t.reverse?(s.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),s}configure(){const t=this.ticks;let n=this.min,r=this.max;if(super.configure(),this.options.offset&&t.length){const o=(r-n)/Math.max(t.length-1,1)/2;n-=o,r+=o}this._startValue=n,this._endValue=r,this._valueRange=r-n}getLabelForValue(t){return xd(t,this.chart.options.locale,this.options.ticks.format)}}class Fl extends Qh{determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=jt(t)?t:0,this.max=jt(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,r=zr(this.options.ticks.minRotation),o=(t?Math.sin(r):Math.cos(r))||.001,i=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,i.lineHeight/o))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}fe(Fl,"id","linear"),fe(Fl,"defaults",{ticks:{callback:hg.formatters.numeric}});const Au=e=>Math.floor(ki(e)),fs=(e,t)=>Math.pow(10,Au(e)+t);function vE(e){return e/Math.pow(10,Au(e))===1}function yE(e,t,n){const r=Math.pow(10,n),o=Math.floor(e/r);return Math.ceil(t/r)-o}function uq(e,t){const n=t-e;let r=Au(n);for(;yE(e,t,r)>10;)r++;for(;yE(e,t,r)<10;)r--;return Math.min(r,Au(e))}function dq(e,{min:t,max:n}){t=sr(e.min,t);const r=[],o=Au(t);let i=uq(t,n),s=i<0?Math.pow(10,Math.abs(i)):1;const a=Math.pow(10,i),l=o>i?Math.pow(10,o):0,c=Math.round((t-l)*s)/s,u=Math.floor((t-l)/a/10)*a*10;let d=Math.floor((c-u)/Math.pow(10,i)),h=sr(e.min,Math.round((l+u+d*Math.pow(10,i))*s)/s);for(;h<n;)r.push({value:h,major:vE(h),significand:d}),d>=10?d=d<15?15:20:d++,d>=20&&(i++,d=2,s=i>=0?1:s),h=Math.round((l+u+d*Math.pow(10,i))*s)/s;const f=sr(e.max,h);return r.push({value:f,major:vE(f),significand:d}),r}class Ll extends Ji{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,n){const r=Qh.prototype.parse.apply(this,[t,n]);if(r===0){this._zero=!0;return}return jt(r)&&r>0?r:null}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=jt(t)?Math.max(0,t):null,this.max=jt(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!jt(this._userMin)&&(this.min=t===fs(this.min,0)?fs(this.min,-1):fs(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let r=this.min,o=this.max;const i=a=>r=t?r:a,s=a=>o=n?o:a;r===o&&(r<=0?(i(1),s(10)):(i(fs(r,-1)),s(fs(o,1)))),r<=0&&i(fs(o,-1)),o<=0&&s(fs(r,1)),this.min=r,this.max=o}buildTicks(){const t=this.options,n={min:this._userMin,max:this._userMax},r=dq(n,this);return t.bounds==="ticks"&&yO(r,this,"value"),t.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}getLabelForValue(t){return t===void 0?"0":xd(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=ki(t),this._valueRange=ki(this.max)-ki(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(ki(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const n=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+n*this._valueRange)}}fe(Ll,"id","logarithmic"),fe(Ll,"defaults",{ticks:{callback:hg.formatters.logarithmic,major:{enabled:!0}}});function Mv(e){const t=e.ticks;if(t.display&&e.display){const n=on(t.backdropPadding);return ke(t.font&&t.font.size,Mt.font.size)+n.height}return 0}function fq(e,t,n){return n=Rt(n)?n:[n],{w:xV(e,t.string,n),h:n.length*t.lineHeight}}function xE(e,t,n,r,o){return e===r||e===o?{start:t-n/2,end:t+n/2}:e<r||e>o?{start:t-n,end:t}:{start:t,end:t+n}}function hq(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=[],o=[],i=e._pointLabels.length,s=e.options.pointLabels,a=s.centerPointLabels?kt/i:0;for(let l=0;l<i;l++){const c=s.setContext(e.getPointLabelContext(l));o[l]=c.padding;const u=e.getPointPosition(l,e.drawingArea+o[l],a),d=Wt(c.font),h=fq(e.ctx,d,e._pointLabels[l]);r[l]=h;const f=cr(e.getIndexAngle(l)+a),p=Math.round(cw(f)),g=xE(p,u.x,h.w,0,180),b=xE(p,u.y,h.h,90,270);pq(n,t,f,g,b)}e.setCenterPoint(t.l-n.l,n.r-t.r,t.t-n.t,n.b-t.b),e._pointLabelItems=bq(e,r,o)}function pq(e,t,n,r,o){const i=Math.abs(Math.sin(n)),s=Math.abs(Math.cos(n));let a=0,l=0;r.start<t.l?(a=(t.l-r.start)/i,e.l=Math.min(e.l,t.l-a)):r.end>t.r&&(a=(r.end-t.r)/i,e.r=Math.max(e.r,t.r+a)),o.start<t.t?(l=(t.t-o.start)/s,e.t=Math.min(e.t,t.t-l)):o.end>t.b&&(l=(o.end-t.b)/s,e.b=Math.max(e.b,t.b+l))}function gq(e,t,n){const r=e.drawingArea,{extra:o,additionalAngle:i,padding:s,size:a}=n,l=e.getPointPosition(t,r+o+s,i),c=Math.round(cw(cr(l.angle+$t))),u=xq(l.y,a.h,c),d=vq(c),h=yq(l.x,a.w,d);return{visible:!0,x:l.x,y:u,textAlign:d,left:h,top:u,right:h+a.w,bottom:u+a.h}}function mq(e,t){if(!t)return!0;const{left:n,top:r,right:o,bottom:i}=e;return!(ei({x:n,y:r},t)||ei({x:n,y:i},t)||ei({x:o,y:r},t)||ei({x:o,y:i},t))}function bq(e,t,n){const r=[],o=e._pointLabels.length,i=e.options,{centerPointLabels:s,display:a}=i.pointLabels,l={extra:Mv(i)/2,additionalAngle:s?kt/o:0};let c;for(let u=0;u<o;u++){l.padding=n[u],l.size=t[u];const d=gq(e,u,l);r.push(d),a==="auto"&&(d.visible=mq(d,c),d.visible&&(c=d))}return r}function vq(e){return e===0||e===180?"center":e<180?"left":"right"}function yq(e,t,n){return n==="right"?e-=t:n==="center"&&(e-=t/2),e}function xq(e,t,n){return n===90||n===270?e-=t/2:(n>270||n<90)&&(e-=t),e}function wq(e,t,n){const{left:r,top:o,right:i,bottom:s}=n,{backdropColor:a}=t;if(!Ne(a)){const l=Hs(t.borderRadius),c=on(t.backdropPadding);e.fillStyle=a;const u=r-c.left,d=o-c.top,h=i-r+c.width,f=s-o+c.height;Object.values(l).some(p=>p!==0)?(e.beginPath(),Tu(e,{x:u,y:d,w:h,h:f,radius:l}),e.fill()):e.fillRect(u,d,h,f)}}function Sq(e,t){const{ctx:n,options:{pointLabels:r}}=e;for(let o=t-1;o>=0;o--){const i=e._pointLabelItems[o];if(!i.visible)continue;const s=r.setContext(e.getPointLabelContext(o));wq(n,s,i);const a=Wt(s.font),{x:l,y:c,textAlign:u}=i;oa(n,e._pointLabels[o],l,c+a.lineHeight/2,a,{color:s.color,textAlign:u,textBaseline:"middle"})}}function uD(e,t,n,r){const{ctx:o}=e;if(n)o.arc(e.xCenter,e.yCenter,t,0,Pt);else{let i=e.getPointPosition(0,t);o.moveTo(i.x,i.y);for(let s=1;s<r;s++)i=e.getPointPosition(s,t),o.lineTo(i.x,i.y)}}function Cq(e,t,n,r,o){const i=e.ctx,s=t.circular,{color:a,lineWidth:l}=t;!s&&!r||!a||!l||n<0||(i.save(),i.strokeStyle=a,i.lineWidth=l,i.setLineDash(o.dash||[]),i.lineDashOffset=o.dashOffset,i.beginPath(),uD(e,n,s,r),i.closePath(),i.stroke(),i.restore())}function _q(e,t,n){return Qi(e,{label:n,index:t,type:"pointLabel"})}class qc extends Qh{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=on(Mv(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=jt(t)&&!isNaN(t)?t:0,this.max=jt(n)&&!isNaN(n)?n:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Mv(this.options))}generateTickLabels(t){Qh.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((n,r)=>{const o=ht(this.options.pointLabels.callback,[n,r],this);return o||o===0?o:""}).filter((n,r)=>this.chart.getDataVisibility(r))}fit(){const t=this.options;t.display&&t.pointLabels.display?hq(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,n,r,o){this.xCenter+=Math.floor((t-n)/2),this.yCenter+=Math.floor((r-o)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,n,r,o))}getIndexAngle(t){const n=Pt/(this._pointLabels.length||1),r=this.options.startAngle||0;return cr(t*n+zr(r))}getDistanceFromCenterForValue(t){if(Ne(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(Ne(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 _q(this.getContext(),t,r)}}getPointPosition(t,n,r=0){const o=this.getIndexAngle(t)-$t+r;return{x:Math.cos(o)*n+this.xCenter,y:Math.sin(o)*n+this.yCenter,angle:o}}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:o,bottom:i}=this._pointLabelItems[t];return{left:n,top:r,right:o,bottom:i}}drawBackground(){const{backgroundColor:t,grid:{circular:n}}=this.options;if(t){const r=this.ctx;r.save(),r.beginPath(),uD(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:o,border:i}=n,s=this._pointLabels.length;let a,l,c;if(n.pointLabels.display&&Sq(this,s),o.display&&this.ticks.forEach((u,d)=>{if(d!==0||d===0&&this.min<0){l=this.getDistanceFromCenterForValue(u.value);const h=this.getContext(d),f=o.setContext(h),p=i.setContext(h);Cq(this,f,l,s,p)}}),r.display){for(t.save(),a=s-1;a>=0;a--){const u=r.setContext(this.getPointLabelContext(a)),{color:d,lineWidth:h}=u;!h||!d||(t.lineWidth=h,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 o=this.getIndexAngle(0);let i,s;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(o),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=Wt(c.font);if(i=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=u.string,s=t.measureText(a.label).width,t.fillStyle=c.backdropColor;const d=on(c.backdropPadding);t.fillRect(-s/2-d.left,-i-u.size/2-d.top,s+d.width,u.size+d.height)}oa(t,a.label,0,-i,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}fe(qc,"id","radialLinear"),fe(qc,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:hg.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),fe(qc,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),fe(qc,"descriptors",{angleLines:{_fallback:"grid"}});const mg={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}},Un=Object.keys(mg);function wE(e,t){return e-t}function SE(e,t){if(Ne(t))return null;const n=e._adapter,{parser:r,round:o,isoWeekday:i}=e._parseOpts;let s=t;return typeof r=="function"&&(s=r(s)),jt(s)||(s=typeof r=="string"?n.parse(s,r):n.parse(s)),s===null?null:(o&&(s=o==="week"&&(Al(i)||i===!0)?n.startOf(s,"isoWeek",i):n.startOf(s,o)),+s)}function CE(e,t,n,r){const o=Un.length;for(let i=Un.indexOf(e);i<o-1;++i){const s=mg[Un[i]],a=s.steps?s.steps:Number.MAX_SAFE_INTEGER;if(s.common&&Math.ceil((n-t)/(a*s.size))<=r)return Un[i]}return Un[o-1]}function Eq(e,t,n,r,o){for(let i=Un.length-1;i>=Un.indexOf(n);i--){const s=Un[i];if(mg[s].common&&e._adapter.diff(o,r,s)>=t-1)return s}return Un[n?Un.indexOf(n):0]}function Rq(e){for(let t=Un.indexOf(e)+1,n=Un.length;t<n;++t)if(mg[Un[t]].common)return Un[t]}function _E(e,t,n){if(!n)e[t]=!0;else if(n.length){const{lo:r,hi:o}=uw(n,t),i=n[r]>=t?n[r]:n[o];e[i]=!0}}function Pq(e,t,n,r){const o=e._adapter,i=+o.startOf(t[0].value,r),s=t[t.length-1].value;let a,l;for(a=i;a<=s;a=+o.add(a,1,r))l=n[a],l>=0&&(t[l].major=!0);return t}function EE(e,t,n){const r=[],o={},i=t.length;let s,a;for(s=0;s<i;++s)a=t[s],o[a]=s,r.push({value:a,major:!1});return i===0||!n?r:Pq(e,r,o,n)}class Nu extends Ji{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={}),o=this._adapter=new jH._date(t.adapters.date);o.init(n),nu(r.displayFormats,o.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:SE(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:o,max:i,minDefined:s,maxDefined:a}=this.getUserBounds();function l(c){!s&&!isNaN(c.min)&&(o=Math.min(o,c.min)),!a&&!isNaN(c.max)&&(i=Math.max(i,c.max))}(!s||!a)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),o=jt(o)&&!isNaN(o)?o:+n.startOf(Date.now(),r),i=jt(i)&&!isNaN(i)?i:+n.endOf(Date.now(),r)+1,this.min=Math.min(o,i-1),this.max=Math.max(o+1,i)}_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,o=r.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&o.length&&(this.min=this._userMin||o[0],this.max=this._userMax||o[o.length-1]);const i=this.min,s=this.max,a=aV(o,i,s);return this._unit=n.unit||(r.autoSkip?CE(n.minUnit,this.min,this.max,this._getLabelCapacity(i)):Eq(this,a.length,n.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:Rq(this._unit),this.initOffsets(o),t.reverse&&a.reverse(),EE(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let n=0,r=0,o,i;this.options.offset&&t.length&&(o=this.getDecimalForValue(t[0]),t.length===1?n=1-o:n=(this.getDecimalForValue(t[1])-o)/2,i=this.getDecimalForValue(t[t.length-1]),t.length===1?r=i:r=(i-this.getDecimalForValue(t[t.length-2]))/2);const s=t.length<3?.5:.25;n=Jt(n,0,s),r=Jt(r,0,s),this._offsets={start:n,end:r,factor:1/(n+1+r)}}_generate(){const t=this._adapter,n=this.min,r=this.max,o=this.options,i=o.time,s=i.unit||CE(i.minUnit,n,r,this._getLabelCapacity(n)),a=ke(o.ticks.stepSize,1),l=s==="week"?i.isoWeekday:!1,c=Al(l)||l===!0,u={};let d=n,h,f;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":s),t.diff(r,n,s)>1e5*a)throw new Error(n+" and "+r+" are too far apart with stepSize of "+a+" "+s);const p=o.ticks.source==="data"&&this.getDataTimestamps();for(h=d,f=0;h<r;h=+t.add(h,a,s),f++)_E(u,h,p);return(h===r||o.bounds==="ticks"||f===1)&&_E(u,h,p),Object.keys(u).sort(wE).map(g=>+g)}getLabelForValue(t){const n=this._adapter,r=this.options.time;return r.tooltipFormat?n.format(t,r.tooltipFormat):n.format(t,r.displayFormats.datetime)}format(t,n){const o=this.options.time.displayFormats,i=this._unit,s=n||o[i];return this._adapter.format(t,s)}_tickFormatFunction(t,n,r,o){const i=this.options,s=i.ticks.callback;if(s)return ht(s,[t,n,r],this);const a=i.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&a[l],d=c&&a[c],h=r[n],f=c&&d&&h&&h.major;return this._adapter.format(t,o||(f?d:u))}generateTickLabels(t){let n,r,o;for(n=0,r=t.length;n<r;++n)o=t[n],o.label=this._tickFormatFunction(o.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,o=zr(this.isHorizontal()?n.maxRotation:n.minRotation),i=Math.cos(o),s=Math.sin(o),a=this._resolveTickFontOptions(0).size;return{w:r*i+a*s,h:r*s+a*i}}_getLabelCapacity(t){const n=this.options.time,r=n.displayFormats,o=r[n.unit]||r.millisecond,i=this._tickFormatFunction(t,0,EE(this,[t],this._majorUnit),o),s=this._getLabelSize(i),a=Math.floor(this.isHorizontal()?this.width/s.w:this.height/s.h)-1;return a>0?a:1}getDataTimestamps(){let t=this._cache.data||[],n,r;if(t.length)return t;const o=this.getMatchingVisibleMetas();if(this._normalized&&o.length)return this._cache.data=o[0].controller.getAllParsedValues(this);for(n=0,r=o.length;n<r;++n)t=t.concat(o[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 o=this.getLabels();for(n=0,r=o.length;n<r;++n)t.push(SE(this,o[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return SO(t.sort(wE))}}fe(Nu,"id","time"),fe(Nu,"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 Rf(e,t,n){let r=0,o=e.length-1,i,s,a,l;n?(t>=e[r].pos&&t<=e[o].pos&&({lo:r,hi:o}=Zo(e,"pos",t)),{pos:i,time:a}=e[r],{pos:s,time:l}=e[o]):(t>=e[r].time&&t<=e[o].time&&({lo:r,hi:o}=Zo(e,"time",t)),{time:i,pos:a}=e[r],{time:s,pos:l}=e[o]);const c=s-i;return c?a+(l-a)*(t-i)/c:a}class kv extends Nu{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=Rf(n,this.min),this._tableRange=Rf(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:n,max:r}=this,o=[],i=[];let s,a,l,c,u;for(s=0,a=t.length;s<a;++s)c=t[s],c>=n&&c<=r&&o.push(c);if(o.length<2)return[{time:n,pos:0},{time:r,pos:1}];for(s=0,a=o.length;s<a;++s)u=o[s+1],l=o[s-1],c=o[s],Math.round((u+l)/2)!==c&&i.push({time:c,pos:s/(a-1)});return i}_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((o,i)=>o-i)}_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(Rf(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return Rf(this._table,r*this._tableRange+this._minPos,!0)}}fe(kv,"id","timeseries"),fe(kv,"defaults",Nu.defaults);var Mq=Object.freeze({__proto__:null,CategoryScale:Xh,LinearScale:Fl,LogarithmicScale:Ll,RadialLinearScale:qc,TimeScale:Nu,TimeSeriesScale:kv});const kq=[NH,dU,iq,Mq];class Bi{constructor(){this._partials=new Float64Array(32),this._n=0}add(t){const n=this._partials;let r=0;for(let o=0;o<this._n&&o<32;o++){const i=n[o],s=t+i,a=Math.abs(t)<Math.abs(i)?t-(s-i):i-(s-t);a&&(n[r++]=a),t=s}return n[r]=t,this._n=r+1,this}valueOf(){const t=this._partials;let n=this._n,r,o,i,s=0;if(n>0){for(s=t[--n];n>0&&(r=s,o=t[--n],s=r+o,i=o-(s-r),!i););n>0&&(i<0&&t[n-1]<0||i>0&&t[n-1]>0)&&(o=i*2,r=s+o,o==r-s&&(s=r))}return s}}function*Oq(e){for(const t of e)yield*t}function dD(e){return Array.from(Oq(e))}function Ua(e,t,n){e=+e,t=+t,n=(o=arguments.length)<2?(t=e,e=0,1):o<3?1:+n;for(var r=-1,o=Math.max(0,Math.ceil((t-e)/n))|0,i=new Array(o);++r<o;)i[r]=e+r*n;return i}var Ce=1e-6,fD=1e-12,He=Math.PI,Nt=He/2,RE=He/4,mr=He*2,En=180/He,pt=He/180,Ze=Math.abs,nc=Math.atan,xo=Math.atan2,Ae=Math.cos,Pf=Math.ceil,hD=Math.exp,Jh=Math.log,mb=Math.pow,Te=Math.sin,Pr=Math.sign||function(e){return e>0?1:e<0?-1:0},On=Math.sqrt,Sw=Math.tan;function pD(e){return e>1?0:e<-1?He:Math.acos(e)}function Or(e){return e>1?Nt:e<-1?-Nt:Math.asin(e)}function Qt(){}function Zh(e,t){e&&ME.hasOwnProperty(e.type)&&ME[e.type](e,t)}var PE={Feature:function(e,t){Zh(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,o=n.length;++r<o;)Zh(n[r].geometry,t)}},ME={Sphere:function(e,t){t.sphere()},Point:function(e,t){e=e.coordinates,t.point(e[0],e[1],e[2])},MultiPoint:function(e,t){for(var n=e.coordinates,r=-1,o=n.length;++r<o;)e=n[r],t.point(e[0],e[1],e[2])},LineString:function(e,t){Ov(e.coordinates,t,0)},MultiLineString:function(e,t){for(var n=e.coordinates,r=-1,o=n.length;++r<o;)Ov(n[r],t,0)},Polygon:function(e,t){kE(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,r=-1,o=n.length;++r<o;)kE(n[r],t)},GeometryCollection:function(e,t){for(var n=e.geometries,r=-1,o=n.length;++r<o;)Zh(n[r],t)}};function Ov(e,t,n){var r=-1,o=e.length-n,i;for(t.lineStart();++r<o;)i=e[r],t.point(i[0],i[1],i[2]);t.lineEnd()}function kE(e,t){var n=-1,r=e.length;for(t.polygonStart();++n<r;)Ov(e[n],t,1);t.polygonEnd()}function ys(e,t){e&&PE.hasOwnProperty(e.type)?PE[e.type](e,t):Zh(e,t)}function Dv(e){return[xo(e[1],e[0]),Or(e[2])]}function $l(e){var t=e[0],n=e[1],r=Ae(n);return[r*Ae(t),r*Te(t),Te(n)]}function Mf(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function ep(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function bb(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function kf(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function Tv(e){var t=On(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}function Iv(e,t){function n(r,o){return r=e(r,o),t(r[0],r[1])}return e.invert&&t.invert&&(n.invert=function(r,o){return r=t.invert(r,o),r&&e.invert(r[0],r[1])}),n}function Av(e,t){return Ze(e)>He&&(e-=Math.round(e/mr)*mr),[e,t]}Av.invert=Av;function gD(e,t,n){return(e%=mr)?t||n?Iv(DE(e),TE(t,n)):DE(e):t||n?TE(t,n):Av}function OE(e){return function(t,n){return t+=e,Ze(t)>He&&(t-=Math.round(t/mr)*mr),[t,n]}}function DE(e){var t=OE(e);return t.invert=OE(-e),t}function TE(e,t){var n=Ae(e),r=Te(e),o=Ae(t),i=Te(t);function s(a,l){var c=Ae(l),u=Ae(a)*c,d=Te(a)*c,h=Te(l),f=h*n+u*r;return[xo(d*o-f*i,u*n-h*r),Or(f*o+d*i)]}return s.invert=function(a,l){var c=Ae(l),u=Ae(a)*c,d=Te(a)*c,h=Te(l),f=h*o-d*i;return[xo(d*o+h*i,u*n+f*r),Or(f*n-u*r)]},s}function Dq(e){e=gD(e[0]*pt,e[1]*pt,e.length>2?e[2]*pt:0);function t(n){return n=e(n[0]*pt,n[1]*pt),n[0]*=En,n[1]*=En,n}return t.invert=function(n){return n=e.invert(n[0]*pt,n[1]*pt),n[0]*=En,n[1]*=En,n},t}function Tq(e,t,n,r,o,i){if(n){var s=Ae(t),a=Te(t),l=r*n;o==null?(o=t+r*mr,i=t-l/2):(o=IE(s,o),i=IE(s,i),(r>0?o<i:o>i)&&(o+=r*mr));for(var c,u=o;r>0?u>i:u<i;u-=l)c=Dv([s,-a*Ae(u),-a*Te(u)]),e.point(c[0],c[1])}}function IE(e,t){t=$l(t),t[0]-=e,Tv(t);var n=pD(-t[1]);return((-t[2]<0?-n:n)+mr-Ce)%mr}function mD(){var e=[],t;return{point:function(n,r,o){t.push([n,r,o])},lineStart:function(){e.push(t=[])},lineEnd:Qt,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function vh(e,t){return Ze(e[0]-t[0])<Ce&&Ze(e[1]-t[1])<Ce}function Of(e,t,n,r){this.x=e,this.z=t,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function bD(e,t,n,r,o){var i=[],s=[],a,l;if(e.forEach(function(p){if(!((g=p.length-1)<=0)){var g,b=p[0],v=p[g],x;if(vh(b,v)){if(!b[2]&&!v[2]){for(o.lineStart(),a=0;a<g;++a)o.point((b=p[a])[0],b[1]);o.lineEnd();return}v[0]+=2*Ce}i.push(x=new Of(b,p,null,!0)),s.push(x.o=new Of(b,null,x,!1)),i.push(x=new Of(v,p,null,!1)),s.push(x.o=new Of(v,null,x,!0))}}),!!i.length){for(s.sort(t),AE(i),AE(s),a=0,l=s.length;a<l;++a)s[a].e=n=!n;for(var c=i[0],u,d;;){for(var h=c,f=!0;h.v;)if((h=h.n)===c)return;u=h.z,o.lineStart();do{if(h.v=h.o.v=!0,h.e){if(f)for(a=0,l=u.length;a<l;++a)o.point((d=u[a])[0],d[1]);else r(h.x,h.n.x,1,o);h=h.n}else{if(f)for(u=h.p.z,a=u.length-1;a>=0;--a)o.point((d=u[a])[0],d[1]);else r(h.x,h.p.x,-1,o);h=h.p}h=h.o,u=h.z,f=!f}while(!h.v);o.lineEnd()}}}function AE(e){if(t=e.length){for(var t,n=0,r=e[0],o;++n<t;)r.n=o=e[n],o.p=r,r=o;r.n=o=e[0],o.p=r}}function vb(e){return Ze(e[0])<=He?e[0]:Pr(e[0])*((Ze(e[0])+He)%mr-He)}function vD(e,t){var n=vb(t),r=t[1],o=Te(r),i=[Te(n),-Ae(n),0],s=0,a=0,l=new Bi;o===1?r=Nt+Ce:o===-1&&(r=-Nt-Ce);for(var c=0,u=e.length;c<u;++c)if(h=(d=e[c]).length)for(var d,h,f=d[h-1],p=vb(f),g=f[1]/2+RE,b=Te(g),v=Ae(g),x=0;x<h;++x,p=_,b=C,v=R,f=y){var y=d[x],_=vb(y),w=y[1]/2+RE,C=Te(w),R=Ae(w),k=_-p,D=k>=0?1:-1,I=D*k,T=I>He,N=b*C;if(l.add(xo(N*D*Te(I),v*R+N*Ae(I))),s+=T?k+D*mr:k,T^p>=n^_>=n){var G=ep($l(f),$l(y));Tv(G);var z=ep(i,G);Tv(z);var O=(T^k>=0?-1:1)*Or(z[2]);(r>O||r===O&&(G[0]||G[1]))&&(a+=T^k>=0?1:-1)}}return(s<-1e-6||s<Ce&&l<-1e-12)^a&1}function yD(e,t,n,r){return function(o){var i=t(o),s=mD(),a=t(s),l=!1,c,u,d,h={point:f,lineStart:g,lineEnd:b,polygonStart:function(){h.point=v,h.lineStart=x,h.lineEnd=y,u=[],c=[]},polygonEnd:function(){h.point=f,h.lineStart=g,h.lineEnd=b,u=dD(u);var _=vD(c,r);u.length?(l||(o.polygonStart(),l=!0),bD(u,Aq,_,n,o)):_&&(l||(o.polygonStart(),l=!0),o.lineStart(),n(null,null,1,o),o.lineEnd()),l&&(o.polygonEnd(),l=!1),u=c=null},sphere:function(){o.polygonStart(),o.lineStart(),n(null,null,1,o),o.lineEnd(),o.polygonEnd()}};function f(_,w){e(_,w)&&o.point(_,w)}function p(_,w){i.point(_,w)}function g(){h.point=p,i.lineStart()}function b(){h.point=f,i.lineEnd()}function v(_,w){d.push([_,w]),a.point(_,w)}function x(){a.lineStart(),d=[]}function y(){v(d[0][0],d[0][1]),a.lineEnd();var _=a.clean(),w=s.result(),C,R=w.length,k,D,I;if(d.pop(),c.push(d),d=null,!!R){if(_&1){if(D=w[0],(k=D.length-1)>0){for(l||(o.polygonStart(),l=!0),o.lineStart(),C=0;C<k;++C)o.point((I=D[C])[0],I[1]);o.lineEnd()}return}R>1&&_&2&&w.push(w.pop().concat(w.shift())),u.push(w.filter(Iq))}}return h}}function Iq(e){return e.length>1}function Aq(e,t){return((e=e.x)[0]<0?e[1]-Nt-Ce:Nt-e[1])-((t=t.x)[0]<0?t[1]-Nt-Ce:Nt-t[1])}const NE=yD(function(){return!0},Nq,Fq,[-He,-Nt]);function Nq(e){var t=NaN,n=NaN,r=NaN,o;return{lineStart:function(){e.lineStart(),o=1},point:function(i,s){var a=i>0?He:-He,l=Ze(i-t);Ze(l-He)<Ce?(e.point(t,n=(n+s)/2>0?Nt:-Nt),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(a,n),e.point(i,n),o=0):r!==a&&l>=He&&(Ze(t-r)<Ce&&(t-=r*Ce),Ze(i-a)<Ce&&(i-=a*Ce),n=jq(t,n,i,s),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(a,n),o=0),e.point(t=i,n=s),r=a},lineEnd:function(){e.lineEnd(),t=n=NaN},clean:function(){return 2-o}}}function jq(e,t,n,r){var o,i,s=Te(e-n);return Ze(s)>Ce?nc((Te(t)*(i=Ae(r))*Te(n)-Te(r)*(o=Ae(t))*Te(e))/(o*i*s)):(t+r)/2}function Fq(e,t,n,r){var o;if(e==null)o=n*Nt,r.point(-He,o),r.point(0,o),r.point(He,o),r.point(He,0),r.point(He,-o),r.point(0,-o),r.point(-He,-o),r.point(-He,0),r.point(-He,o);else if(Ze(e[0]-t[0])>Ce){var i=e[0]<t[0]?He:-He;o=n*i/2,r.point(-i,o),r.point(0,o),r.point(i,o)}else r.point(t[0],t[1])}function Lq(e){var t=Ae(e),n=2*pt,r=t>0,o=Ze(t)>Ce;function i(u,d,h,f){Tq(f,e,n,h,u,d)}function s(u,d){return Ae(u)*Ae(d)>t}function a(u){var d,h,f,p,g;return{lineStart:function(){p=f=!1,g=1},point:function(b,v){var x=[b,v],y,_=s(b,v),w=r?_?0:c(b,v):_?c(b+(b<0?He:-He),v):0;if(!d&&(p=f=_)&&u.lineStart(),_!==f&&(y=l(d,x),(!y||vh(d,y)||vh(x,y))&&(x[2]=1)),_!==f)g=0,_?(u.lineStart(),y=l(x,d),u.point(y[0],y[1])):(y=l(d,x),u.point(y[0],y[1],2),u.lineEnd()),d=y;else if(o&&d&&r^_){var C;!(w&h)&&(C=l(x,d,!0))&&(g=0,r?(u.lineStart(),u.point(C[0][0],C[0][1]),u.point(C[1][0],C[1][1]),u.lineEnd()):(u.point(C[1][0],C[1][1]),u.lineEnd(),u.lineStart(),u.point(C[0][0],C[0][1],3)))}_&&(!d||!vh(d,x))&&u.point(x[0],x[1]),d=x,f=_,h=w},lineEnd:function(){f&&u.lineEnd(),d=null},clean:function(){return g|(p&&f)<<1}}}function l(u,d,h){var f=$l(u),p=$l(d),g=[1,0,0],b=ep(f,p),v=Mf(b,b),x=b[0],y=v-x*x;if(!y)return!h&&u;var _=t*v/y,w=-t*x/y,C=ep(g,b),R=kf(g,_),k=kf(b,w);bb(R,k);var D=C,I=Mf(R,D),T=Mf(D,D),N=I*I-T*(Mf(R,R)-1);if(!(N<0)){var G=On(N),z=kf(D,(-I-G)/T);if(bb(z,R),z=Dv(z),!h)return z;var O=u[0],A=d[0],L=u[1],j=d[1],B;A<O&&(B=O,O=A,A=B);var M=A-O,W=Ze(M-He)<Ce,F=W||M<Ce;if(!W&&j<L&&(B=L,L=j,j=B),F?W?L+j>0^z[1]<(Ze(z[0]-O)<Ce?L:j):L<=z[1]&&z[1]<=j:M>He^(O<=z[0]&&z[0]<=A)){var P=kf(D,(-I+G)/T);return bb(P,R),[z,Dv(P)]}}}function c(u,d){var h=r?e:He-e,f=0;return u<-h?f|=1:u>h&&(f|=2),d<-h?f|=4:d>h&&(f|=8),f}return yD(s,a,i,r?[0,-e]:[-He,e-He])}function $q(e,t,n,r,o,i){var s=e[0],a=e[1],l=t[0],c=t[1],u=0,d=1,h=l-s,f=c-a,p;if(p=n-s,!(!h&&p>0)){if(p/=h,h<0){if(p<u)return;p<d&&(d=p)}else if(h>0){if(p>d)return;p>u&&(u=p)}if(p=o-s,!(!h&&p<0)){if(p/=h,h<0){if(p>d)return;p>u&&(u=p)}else if(h>0){if(p<u)return;p<d&&(d=p)}if(p=r-a,!(!f&&p>0)){if(p/=f,f<0){if(p<u)return;p<d&&(d=p)}else if(f>0){if(p>d)return;p>u&&(u=p)}if(p=i-a,!(!f&&p<0)){if(p/=f,f<0){if(p>d)return;p>u&&(u=p)}else if(f>0){if(p<u)return;p<d&&(d=p)}return u>0&&(e[0]=s+u*h,e[1]=a+u*f),d<1&&(t[0]=s+d*h,t[1]=a+d*f),!0}}}}}var Df=1e9,Tf=-1e9;function zq(e,t,n,r){function o(c,u){return e<=c&&c<=n&&t<=u&&u<=r}function i(c,u,d,h){var f=0,p=0;if(c==null||(f=s(c,d))!==(p=s(u,d))||l(c,u)<0^d>0)do h.point(f===0||f===3?e:n,f>1?r:t);while((f=(f+d+4)%4)!==p);else h.point(u[0],u[1])}function s(c,u){return Ze(c[0]-e)<Ce?u>0?0:3:Ze(c[0]-n)<Ce?u>0?2:1:Ze(c[1]-t)<Ce?u>0?1:0:u>0?3:2}function a(c,u){return l(c.x,u.x)}function l(c,u){var d=s(c,1),h=s(u,1);return d!==h?d-h:d===0?u[1]-c[1]:d===1?c[0]-u[0]:d===2?c[1]-u[1]:u[0]-c[0]}return function(c){var u=c,d=mD(),h,f,p,g,b,v,x,y,_,w,C,R={point:k,lineStart:N,lineEnd:G,polygonStart:I,polygonEnd:T};function k(O,A){o(O,A)&&u.point(O,A)}function D(){for(var O=0,A=0,L=f.length;A<L;++A)for(var j=f[A],B=1,M=j.length,W=j[0],F,P,U=W[0],q=W[1];B<M;++B)F=U,P=q,W=j[B],U=W[0],q=W[1],P<=r?q>r&&(U-F)*(r-P)>(q-P)*(e-F)&&++O:q<=r&&(U-F)*(r-P)<(q-P)*(e-F)&&--O;return O}function I(){u=d,h=[],f=[],C=!0}function T(){var O=D(),A=C&&O,L=(h=dD(h)).length;(A||L)&&(c.polygonStart(),A&&(c.lineStart(),i(null,null,1,c),c.lineEnd()),L&&bD(h,a,O,i,c),c.polygonEnd()),u=c,h=f=p=null}function N(){R.point=z,f&&f.push(p=[]),w=!0,_=!1,x=y=NaN}function G(){h&&(z(g,b),v&&_&&d.rejoin(),h.push(d.result())),R.point=k,_&&u.lineEnd()}function z(O,A){var L=o(O,A);if(f&&p.push([O,A]),w)g=O,b=A,v=L,w=!1,L&&(u.lineStart(),u.point(O,A));else if(L&&_)u.point(O,A);else{var j=[x=Math.max(Tf,Math.min(Df,x)),y=Math.max(Tf,Math.min(Df,y))],B=[O=Math.max(Tf,Math.min(Df,O)),A=Math.max(Tf,Math.min(Df,A))];$q(j,B,e,t,n,r)?(_||(u.lineStart(),u.point(j[0],j[1])),u.point(B[0],B[1]),L||u.lineEnd(),C=!1):L&&(u.lineStart(),u.point(O,A),C=!1)}x=O,y=A,_=L}return R}}var Nv,jv,yh,xh,zl={sphere:Qt,point:Qt,lineStart:Bq,lineEnd:Qt,polygonStart:Qt,polygonEnd:Qt};function Bq(){zl.point=Hq,zl.lineEnd=Vq}function Vq(){zl.point=zl.lineEnd=Qt}function Hq(e,t){e*=pt,t*=pt,jv=e,yh=Te(t),xh=Ae(t),zl.point=Wq}function Wq(e,t){e*=pt,t*=pt;var n=Te(t),r=Ae(t),o=Ze(e-jv),i=Ae(o),s=Te(o),a=r*s,l=xh*n-yh*r*i,c=yh*n+xh*r*i;Nv.add(xo(On(a*a+l*l),c)),jv=e,yh=n,xh=r}function Uq(e){return Nv=new Bi,ys(e,zl),+Nv}var Fv=[null,null],qq={type:"LineString",coordinates:Fv};function Lv(e,t){return Fv[0]=e,Fv[1]=t,Uq(qq)}var jE={Feature:function(e,t){return tp(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,o=n.length;++r<o;)if(tp(n[r].geometry,t))return!0;return!1}},FE={Sphere:function(){return!0},Point:function(e,t){return LE(e.coordinates,t)},MultiPoint:function(e,t){for(var n=e.coordinates,r=-1,o=n.length;++r<o;)if(LE(n[r],t))return!0;return!1},LineString:function(e,t){return $E(e.coordinates,t)},MultiLineString:function(e,t){for(var n=e.coordinates,r=-1,o=n.length;++r<o;)if($E(n[r],t))return!0;return!1},Polygon:function(e,t){return zE(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,r=-1,o=n.length;++r<o;)if(zE(n[r],t))return!0;return!1},GeometryCollection:function(e,t){for(var n=e.geometries,r=-1,o=n.length;++r<o;)if(tp(n[r],t))return!0;return!1}};function tp(e,t){return e&&FE.hasOwnProperty(e.type)?FE[e.type](e,t):!1}function LE(e,t){return Lv(e,t)===0}function $E(e,t){for(var n,r,o,i=0,s=e.length;i<s;i++){if(r=Lv(e[i],t),r===0||i>0&&(o=Lv(e[i],e[i-1]),o>0&&n<=o&&r<=o&&(n+r-o)*(1-Math.pow((n-r)/o,2))<fD*o))return!0;n=r}return!1}function zE(e,t){return!!vD(e.map(Gq),xD(t))}function Gq(e){return e=e.map(xD),e.pop(),e}function xD(e){return[e[0]*pt,e[1]*pt]}function Yq(e,t){return(e&&jE.hasOwnProperty(e.type)?jE[e.type]:tp)(e,t)}function BE(e,t,n){var r=Ua(e,t-Ce,n).concat(t);return function(o){return r.map(function(i){return[o,i]})}}function VE(e,t,n){var r=Ua(e,t-Ce,n).concat(t);return function(o){return r.map(function(i){return[i,o]})}}function wD(){var e,t,n,r,o,i,s,a,l=10,c=l,u=90,d=360,h,f,p,g,b=2.5;function v(){return{type:"MultiLineString",coordinates:x()}}function x(){return Ua(Pf(r/u)*u,n,u).map(p).concat(Ua(Pf(a/d)*d,s,d).map(g)).concat(Ua(Pf(t/l)*l,e,l).filter(function(y){return Ze(y%u)>Ce}).map(h)).concat(Ua(Pf(i/c)*c,o,c).filter(function(y){return Ze(y%d)>Ce}).map(f))}return v.lines=function(){return x().map(function(y){return{type:"LineString",coordinates:y}})},v.outline=function(){return{type:"Polygon",coordinates:[p(r).concat(g(s).slice(1),p(n).reverse().slice(1),g(a).reverse().slice(1))]}},v.extent=function(y){return arguments.length?v.extentMajor(y).extentMinor(y):v.extentMinor()},v.extentMajor=function(y){return arguments.length?(r=+y[0][0],n=+y[1][0],a=+y[0][1],s=+y[1][1],r>n&&(y=r,r=n,n=y),a>s&&(y=a,a=s,s=y),v.precision(b)):[[r,a],[n,s]]},v.extentMinor=function(y){return arguments.length?(t=+y[0][0],e=+y[1][0],i=+y[0][1],o=+y[1][1],t>e&&(y=t,t=e,e=y),i>o&&(y=i,i=o,o=y),v.precision(b)):[[t,i],[e,o]]},v.step=function(y){return arguments.length?v.stepMajor(y).stepMinor(y):v.stepMinor()},v.stepMajor=function(y){return arguments.length?(u=+y[0],d=+y[1],v):[u,d]},v.stepMinor=function(y){return arguments.length?(l=+y[0],c=+y[1],v):[l,c]},v.precision=function(y){return arguments.length?(b=+y,h=BE(i,o,90),f=VE(t,e,b),p=BE(a,s,90),g=VE(r,n,b),v):b},v.extentMajor([[-180,-90+Ce],[180,90-Ce]]).extentMinor([[-180,-80-Ce],[180,80+Ce]])}function Kq(){return wD()()}const $v=e=>e;var yb=new Bi,zv=new Bi,SD,CD,Bv,Vv,Go={point:Qt,lineStart:Qt,lineEnd:Qt,polygonStart:function(){Go.lineStart=Xq,Go.lineEnd=Jq},polygonEnd:function(){Go.lineStart=Go.lineEnd=Go.point=Qt,yb.add(Ze(zv)),zv=new Bi},result:function(){var e=yb/2;return yb=new Bi,e}};function Xq(){Go.point=Qq}function Qq(e,t){Go.point=_D,SD=Bv=e,CD=Vv=t}function _D(e,t){zv.add(Vv*e-Bv*t),Bv=e,Vv=t}function Jq(){_D(SD,CD)}var Bl=1/0,np=Bl,ju=-Bl,rp=ju,op={point:Zq,lineStart:Qt,lineEnd:Qt,polygonStart:Qt,polygonEnd:Qt,result:function(){var e=[[Bl,np],[ju,rp]];return ju=rp=-(np=Bl=1/0),e}};function Zq(e,t){e<Bl&&(Bl=e),e>ju&&(ju=e),t<np&&(np=t),t>rp&&(rp=t)}var Hv=0,Wv=0,Gc=0,ip=0,sp=0,qa=0,Uv=0,qv=0,Yc=0,ED,RD,lo,co,Er={point:ia,lineStart:HE,lineEnd:WE,polygonStart:function(){Er.lineStart=nG,Er.lineEnd=rG},polygonEnd:function(){Er.point=ia,Er.lineStart=HE,Er.lineEnd=WE},result:function(){var e=Yc?[Uv/Yc,qv/Yc]:qa?[ip/qa,sp/qa]:Gc?[Hv/Gc,Wv/Gc]:[NaN,NaN];return Hv=Wv=Gc=ip=sp=qa=Uv=qv=Yc=0,e}};function ia(e,t){Hv+=e,Wv+=t,++Gc}function HE(){Er.point=eG}function eG(e,t){Er.point=tG,ia(lo=e,co=t)}function tG(e,t){var n=e-lo,r=t-co,o=On(n*n+r*r);ip+=o*(lo+e)/2,sp+=o*(co+t)/2,qa+=o,ia(lo=e,co=t)}function WE(){Er.point=ia}function nG(){Er.point=oG}function rG(){PD(ED,RD)}function oG(e,t){Er.point=PD,ia(ED=lo=e,RD=co=t)}function PD(e,t){var n=e-lo,r=t-co,o=On(n*n+r*r);ip+=o*(lo+e)/2,sp+=o*(co+t)/2,qa+=o,o=co*e-lo*t,Uv+=o*(lo+e),qv+=o*(co+t),Yc+=o*3,ia(lo=e,co=t)}function MD(e){this._context=e}MD.prototype={_radius:4.5,pointRadius:function(e){return this._radius=e,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._context.closePath(),this._point=NaN},point:function(e,t){switch(this._point){case 0:{this._context.moveTo(e,t),this._point=1;break}case 1:{this._context.lineTo(e,t);break}default:{this._context.moveTo(e+this._radius,t),this._context.arc(e,t,this._radius,0,mr);break}}},result:Qt};var Gv=new Bi,xb,kD,OD,Kc,Xc,Fu={point:Qt,lineStart:function(){Fu.point=iG},lineEnd:function(){xb&&DD(kD,OD),Fu.point=Qt},polygonStart:function(){xb=!0},polygonEnd:function(){xb=null},result:function(){var e=+Gv;return Gv=new Bi,e}};function iG(e,t){Fu.point=DD,kD=Kc=e,OD=Xc=t}function DD(e,t){Kc-=e,Xc-=t,Gv.add(On(Kc*Kc+Xc*Xc)),Kc=e,Xc=t}let UE,ap,qE,GE;class YE{constructor(t){this._append=t==null?TD:sG(t),this._radius=4.5,this._=""}pointRadius(t){return this._radius=+t,this}polygonStart(){this._line=0}polygonEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){this._line===0&&(this._+="Z"),this._point=NaN}point(t,n){switch(this._point){case 0:{this._append`M${t},${n}`,this._point=1;break}case 1:{this._append`L${t},${n}`;break}default:{if(this._append`M${t},${n}`,this._radius!==qE||this._append!==ap){const r=this._radius,o=this._;this._="",this._append`m0,${r}a${r},${r} 0 1,1 0,${-2*r}a${r},${r} 0 1,1 0,${2*r}z`,qE=r,ap=this._append,GE=this._,this._=o}this._+=GE;break}}}result(){const t=this._;return this._="",t.length?t:null}}function TD(e){let t=1;this._+=e[0];for(const n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function sG(e){const t=Math.floor(e);if(!(t>=0))throw new RangeError(`invalid digits: ${e}`);if(t>15)return TD;if(t!==UE){const n=10**t;UE=t,ap=function(o){let i=1;this._+=o[0];for(const s=o.length;i<s;++i)this._+=Math.round(arguments[i]*n)/n+o[i]}}return ap}function KE(e,t){let n=3,r=4.5,o,i;function s(a){return a&&(typeof r=="function"&&i.pointRadius(+r.apply(this,arguments)),ys(a,o(i))),i.result()}return s.area=function(a){return ys(a,o(Go)),Go.result()},s.measure=function(a){return ys(a,o(Fu)),Fu.result()},s.bounds=function(a){return ys(a,o(op)),op.result()},s.centroid=function(a){return ys(a,o(Er)),Er.result()},s.projection=function(a){return arguments.length?(o=a==null?(e=null,$v):(e=a).stream,s):e},s.context=function(a){return arguments.length?(i=a==null?(t=null,new YE(n)):new MD(t=a),typeof r!="function"&&i.pointRadius(r),s):t},s.pointRadius=function(a){return arguments.length?(r=typeof a=="function"?a:(i.pointRadius(+a),+a),s):r},s.digits=function(a){if(!arguments.length)return n;if(a==null)n=null;else{const l=Math.floor(a);if(!(l>=0))throw new RangeError(`invalid digits: ${a}`);n=l}return t===null&&(i=new YE(n)),s},s.projection(e).digits(n).context(t)}function Cw(e){return function(t){var n=new Yv;for(var r in e)n[r]=e[r];return n.stream=t,n}}function Yv(){}Yv.prototype={constructor:Yv,point:function(e,t){this.stream.point(e,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};function _w(e,t,n){var r=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),r!=null&&e.clipExtent(null),ys(n,e.stream(op)),t(op.result()),r!=null&&e.clipExtent(r),e}function Ew(e,t,n){return _w(e,function(r){var o=t[1][0]-t[0][0],i=t[1][1]-t[0][1],s=Math.min(o/(r[1][0]-r[0][0]),i/(r[1][1]-r[0][1])),a=+t[0][0]+(o-s*(r[1][0]+r[0][0]))/2,l=+t[0][1]+(i-s*(r[1][1]+r[0][1]))/2;e.scale(150*s).translate([a,l])},n)}function ID(e,t,n){return Ew(e,[[0,0],t],n)}function AD(e,t,n){return _w(e,function(r){var o=+t,i=o/(r[1][0]-r[0][0]),s=(o-i*(r[1][0]+r[0][0]))/2,a=-i*r[0][1];e.scale(150*i).translate([s,a])},n)}function ND(e,t,n){return _w(e,function(r){var o=+t,i=o/(r[1][1]-r[0][1]),s=-i*r[0][0],a=(o-i*(r[1][1]+r[0][1]))/2;e.scale(150*i).translate([s,a])},n)}var XE=16,aG=Ae(30*pt);function QE(e,t){return+t?cG(e,t):lG(e)}function lG(e){return Cw({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}function cG(e,t){function n(r,o,i,s,a,l,c,u,d,h,f,p,g,b){var v=c-r,x=u-o,y=v*v+x*x;if(y>4*t&&g--){var _=s+h,w=a+f,C=l+p,R=On(_*_+w*w+C*C),k=Or(C/=R),D=Ze(Ze(C)-1)<Ce||Ze(i-d)<Ce?(i+d)/2:xo(w,_),I=e(D,k),T=I[0],N=I[1],G=T-r,z=N-o,O=x*G-v*z;(O*O/y>t||Ze((v*G+x*z)/y-.5)>.3||s*h+a*f+l*p<aG)&&(n(r,o,i,s,a,l,T,N,D,_/=R,w/=R,C,g,b),b.point(T,N),n(T,N,D,_,w,C,c,u,d,h,f,p,g,b))}}return function(r){var o,i,s,a,l,c,u,d,h,f,p,g,b={point:v,lineStart:x,lineEnd:_,polygonStart:function(){r.polygonStart(),b.lineStart=w},polygonEnd:function(){r.polygonEnd(),b.lineStart=x}};function v(k,D){k=e(k,D),r.point(k[0],k[1])}function x(){d=NaN,b.point=y,r.lineStart()}function y(k,D){var I=$l([k,D]),T=e(k,D);n(d,h,u,f,p,g,d=T[0],h=T[1],u=k,f=I[0],p=I[1],g=I[2],XE,r),r.point(d,h)}function _(){b.point=v,r.lineEnd()}function w(){x(),b.point=C,b.lineEnd=R}function C(k,D){y(o=k,D),i=d,s=h,a=f,l=p,c=g,b.point=y}function R(){n(d,h,u,f,p,g,i,s,o,a,l,c,XE,r),b.lineEnd=_,_()}return b}}var uG=Cw({point:function(e,t){this.stream.point(e*pt,t*pt)}});function dG(e){return Cw({point:function(t,n){var r=e(t,n);return this.stream.point(r[0],r[1])}})}function fG(e,t,n,r,o){function i(s,a){return s*=r,a*=o,[t+e*s,n-e*a]}return i.invert=function(s,a){return[(s-t)/e*r,(n-a)/e*o]},i}function JE(e,t,n,r,o,i){if(!i)return fG(e,t,n,r,o);var s=Ae(i),a=Te(i),l=s*e,c=a*e,u=s/e,d=a/e,h=(a*n-s*t)/e,f=(a*t+s*n)/e;function p(g,b){return g*=r,b*=o,[l*g-c*b+t,n-c*g-l*b]}return p.invert=function(g,b){return[r*(u*g-d*b+h),o*(f-d*g-u*b)]},p}function li(e){return jD(function(){return e})()}function jD(e){var t,n=150,r=480,o=250,i=0,s=0,a=0,l=0,c=0,u,d=0,h=1,f=1,p=null,g=NE,b=null,v,x,y,_=$v,w=.5,C,R,k,D,I;function T(O){return k(O[0]*pt,O[1]*pt)}function N(O){return O=k.invert(O[0],O[1]),O&&[O[0]*En,O[1]*En]}T.stream=function(O){return D&&I===O?D:D=uG(dG(u)(g(C(_(I=O)))))},T.preclip=function(O){return arguments.length?(g=O,p=void 0,z()):g},T.postclip=function(O){return arguments.length?(_=O,b=v=x=y=null,z()):_},T.clipAngle=function(O){return arguments.length?(g=+O?Lq(p=O*pt):(p=null,NE),z()):p*En},T.clipExtent=function(O){return arguments.length?(_=O==null?(b=v=x=y=null,$v):zq(b=+O[0][0],v=+O[0][1],x=+O[1][0],y=+O[1][1]),z()):b==null?null:[[b,v],[x,y]]},T.scale=function(O){return arguments.length?(n=+O,G()):n},T.translate=function(O){return arguments.length?(r=+O[0],o=+O[1],G()):[r,o]},T.center=function(O){return arguments.length?(i=O[0]%360*pt,s=O[1]%360*pt,G()):[i*En,s*En]},T.rotate=function(O){return arguments.length?(a=O[0]%360*pt,l=O[1]%360*pt,c=O.length>2?O[2]%360*pt:0,G()):[a*En,l*En,c*En]},T.angle=function(O){return arguments.length?(d=O%360*pt,G()):d*En},T.reflectX=function(O){return arguments.length?(h=O?-1:1,G()):h<0},T.reflectY=function(O){return arguments.length?(f=O?-1:1,G()):f<0},T.precision=function(O){return arguments.length?(C=QE(R,w=O*O),z()):On(w)},T.fitExtent=function(O,A){return Ew(T,O,A)},T.fitSize=function(O,A){return ID(T,O,A)},T.fitWidth=function(O,A){return AD(T,O,A)},T.fitHeight=function(O,A){return ND(T,O,A)};function G(){var O=JE(n,0,0,h,f,d).apply(null,t(i,s)),A=JE(n,r-O[0],o-O[1],h,f,d);return u=gD(a,l,c),R=Iv(t,A),k=Iv(u,R),C=QE(R,w),z()}function z(){return D=I=null,T}return function(){return t=e.apply(this,arguments),T.invert=t.invert&&N,G()}}function Rw(e){var t=0,n=He/3,r=jD(e),o=r(t,n);return o.parallels=function(i){return arguments.length?r(t=i[0]*pt,n=i[1]*pt):[t*En,n*En]},o}function hG(e){var t=Ae(e);function n(r,o){return[r*t,Te(o)/t]}return n.invert=function(r,o){return[r/t,Or(o*t)]},n}function pG(e,t){var n=Te(e),r=(n+Te(t))/2;if(Ze(r)<Ce)return hG(e);var o=1+n*(2*r-n),i=On(o)/r;function s(a,l){var c=On(o-2*r*Te(l))/r;return[c*Te(a*=r),i-c*Ae(a)]}return s.invert=function(a,l){var c=i-l,u=xo(a,Ze(c))*Pr(c);return c*r<0&&(u-=He*Pr(a)*Pr(c)),[u/r,Or((o-(a*a+c*c)*r*r)/(2*r))]},s}function lp(){return Rw(pG).scale(155.424).center([0,33.6442])}function FD(){return lp().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function gG(e){var t=e.length;return{point:function(n,r){for(var o=-1;++o<t;)e[o].point(n,r)},sphere:function(){for(var n=-1;++n<t;)e[n].sphere()},lineStart:function(){for(var n=-1;++n<t;)e[n].lineStart()},lineEnd:function(){for(var n=-1;++n<t;)e[n].lineEnd()},polygonStart:function(){for(var n=-1;++n<t;)e[n].polygonStart()},polygonEnd:function(){for(var n=-1;++n<t;)e[n].polygonEnd()}}}function mG(){var e,t,n=FD(),r,o=lp().rotate([154,0]).center([-2,58.5]).parallels([55,65]),i,s=lp().rotate([157,0]).center([-3,19.9]).parallels([8,18]),a,l,c={point:function(h,f){l=[h,f]}};function u(h){var f=h[0],p=h[1];return l=null,r.point(f,p),l||(i.point(f,p),l)||(a.point(f,p),l)}u.invert=function(h){var f=n.scale(),p=n.translate(),g=(h[0]-p[0])/f,b=(h[1]-p[1])/f;return(b>=.12&&b<.234&&g>=-.425&&g<-.214?o:b>=.166&&b<.234&&g>=-.214&&g<-.115?s:n).invert(h)},u.stream=function(h){return e&&t===h?e:e=gG([n.stream(t=h),o.stream(h),s.stream(h)])},u.precision=function(h){return arguments.length?(n.precision(h),o.precision(h),s.precision(h),d()):n.precision()},u.scale=function(h){return arguments.length?(n.scale(h),o.scale(h*.35),s.scale(h),u.translate(n.translate())):n.scale()},u.translate=function(h){if(!arguments.length)return n.translate();var f=n.scale(),p=+h[0],g=+h[1];return r=n.translate(h).clipExtent([[p-.455*f,g-.238*f],[p+.455*f,g+.238*f]]).stream(c),i=o.translate([p-.307*f,g+.201*f]).clipExtent([[p-.425*f+Ce,g+.12*f+Ce],[p-.214*f-Ce,g+.234*f-Ce]]).stream(c),a=s.translate([p-.205*f,g+.212*f]).clipExtent([[p-.214*f+Ce,g+.166*f+Ce],[p-.115*f-Ce,g+.234*f-Ce]]).stream(c),d()},u.fitExtent=function(h,f){return Ew(u,h,f)},u.fitSize=function(h,f){return ID(u,h,f)},u.fitWidth=function(h,f){return AD(u,h,f)},u.fitHeight=function(h,f){return ND(u,h,f)};function d(){return e=t=null,u}return u.scale(1070)}function LD(e){return function(t,n){var r=Ae(t),o=Ae(n),i=e(r*o);return i===1/0?[2,0]:[i*o*Te(t),i*Te(n)]}}function wd(e){return function(t,n){var r=On(t*t+n*n),o=e(r),i=Te(o),s=Ae(o);return[xo(t*i,r*s),Or(r&&n*i/r)]}}var $D=LD(function(e){return On(2/(1+e))});$D.invert=wd(function(e){return 2*Or(e/2)});function bG(){return li($D).scale(124.75).clipAngle(180-.001)}var zD=LD(function(e){return(e=pD(e))&&e/Te(e)});zD.invert=wd(function(e){return e});function vG(){return li(zD).scale(79.4188).clipAngle(180-.001)}function bg(e,t){return[e,Jh(Sw((Nt+t)/2))]}bg.invert=function(e,t){return[e,2*nc(hD(t))-Nt]};function yG(){return BD(bg).scale(961/mr)}function BD(e){var t=li(e),n=t.center,r=t.scale,o=t.translate,i=t.clipExtent,s=null,a,l,c;t.scale=function(d){return arguments.length?(r(d),u()):r()},t.translate=function(d){return arguments.length?(o(d),u()):o()},t.center=function(d){return arguments.length?(n(d),u()):n()},t.clipExtent=function(d){return arguments.length?(d==null?s=a=l=c=null:(s=+d[0][0],a=+d[0][1],l=+d[1][0],c=+d[1][1]),u()):s==null?null:[[s,a],[l,c]]};function u(){var d=He*r(),h=t(Dq(t.rotate()).invert([0,0]));return i(s==null?[[h[0]-d,h[1]-d],[h[0]+d,h[1]+d]]:e===bg?[[Math.max(h[0]-d,s),a],[Math.min(h[0]+d,l),c]]:[[s,Math.max(h[1]-d,a)],[l,Math.min(h[1]+d,c)]])}return u()}function If(e){return Sw((Nt+e)/2)}function xG(e,t){var n=Ae(e),r=e===t?Te(e):Jh(n/Ae(t))/Jh(If(t)/If(e)),o=n*mb(If(e),r)/r;if(!r)return bg;function i(s,a){o>0?a<-Nt+Ce&&(a=-Nt+Ce):a>Nt-Ce&&(a=Nt-Ce);var l=o/mb(If(a),r);return[l*Te(r*s),o-l*Ae(r*s)]}return i.invert=function(s,a){var l=o-a,c=Pr(r)*On(s*s+l*l),u=xo(s,Ze(l))*Pr(l);return l*r<0&&(u-=He*Pr(s)*Pr(l)),[u/r,2*nc(mb(o/c,1/r))-Nt]},i}function wG(){return Rw(xG).scale(109.5).parallels([30,30])}function cp(e,t){return[e,t]}cp.invert=cp;function SG(){return li(cp).scale(152.63)}function CG(e,t){var n=Ae(e),r=e===t?Te(e):(n-Ae(t))/(t-e),o=n/r+e;if(Ze(r)<Ce)return cp;function i(s,a){var l=o-a,c=r*s;return[l*Te(c),o-l*Ae(c)]}return i.invert=function(s,a){var l=o-a,c=xo(s,Ze(l))*Pr(l);return l*r<0&&(c-=He*Pr(s)*Pr(l)),[c/r,o-Pr(r)*On(s*s+l*l)]},i}function _G(){return Rw(CG).scale(131.154).center([0,13.9389])}var au=1.340264,lu=-.081106,cu=893e-6,uu=.003796,up=On(3)/2,EG=12;function VD(e,t){var n=Or(up*Te(t)),r=n*n,o=r*r*r;return[e*Ae(n)/(up*(au+3*lu*r+o*(7*cu+9*uu*r))),n*(au+lu*r+o*(cu+uu*r))]}VD.invert=function(e,t){for(var n=t,r=n*n,o=r*r*r,i=0,s,a,l;i<EG&&(a=n*(au+lu*r+o*(cu+uu*r))-t,l=au+3*lu*r+o*(7*cu+9*uu*r),n-=s=a/l,r=n*n,o=r*r*r,!(Ze(s)<fD));++i);return[up*e*(au+3*lu*r+o*(7*cu+9*uu*r))/Ae(n),Or(Te(n)/up)]};function RG(){return li(VD).scale(177.158)}function HD(e,t){var n=Ae(t),r=Ae(e)*n;return[n*Te(e)/r,Te(t)/r]}HD.invert=wd(nc);function PG(){return li(HD).scale(144.049).clipAngle(60)}function WD(e,t){var n=t*t,r=n*n;return[e*(.8707-.131979*n+r*(-.013791+r*(.003971*n-.001529*r))),t*(1.007226+n*(.015085+r*(-.044475+.028874*n-.005916*r)))]}WD.invert=function(e,t){var n=t,r=25,o;do{var i=n*n,s=i*i;n-=o=(n*(1.007226+i*(.015085+s*(-.044475+.028874*i-.005916*s)))-t)/(1.007226+i*(.015085*3+s*(-.044475*7+.028874*9*i-.005916*11*s)))}while(Ze(o)>Ce&&--r>0);return[e/(.8707+(i=n*n)*(-.131979+i*(-.013791+i*i*i*(.003971-.001529*i)))),n]};function MG(){return li(WD).scale(175.295)}function UD(e,t){return[Ae(t)*Te(e),Te(t)]}UD.invert=wd(Or);function kG(){return li(UD).scale(249.5).clipAngle(90+Ce)}function qD(e,t){var n=Ae(t),r=1+Ae(e)*n;return[n*Te(e)/r,Te(t)/r]}qD.invert=wd(function(e){return 2*nc(e)});function OG(){return li(qD).scale(250).clipAngle(142)}function GD(e,t){return[Jh(Sw((Nt+t)/2)),-e]}GD.invert=function(e,t){return[-t,2*nc(hD(e))-Nt]};function DG(){var e=BD(GD),t=e.center,n=e.rotate;return e.center=function(r){return arguments.length?t([-r[1],r[0]]):(r=t(),[r[1],-r[0]])},e.rotate=function(r){return arguments.length?n([r[0],r[1],r.length>2?r[2]+90:90]):(r=n(),[r[0],r[1],r[2]-90])},n([0,0,90]).scale(159.155)}function it(e){for(var t=e.length/6|0,n=new Array(t),r=0;r<t;)n[r]="#"+e.slice(r*6,++r*6);return n}function vg(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Pw(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function rc(){}var sa=.7,Vl=1/sa,rl="\\s*([+-]?\\d+)\\s*",Lu="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",mo="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",TG=/^#([0-9a-f]{3,8})$/,IG=new RegExp(`^rgb\\(${rl},${rl},${rl}\\)$`),AG=new RegExp(`^rgb\\(${mo},${mo},${mo}\\)$`),NG=new RegExp(`^rgba\\(${rl},${rl},${rl},${Lu}\\)$`),jG=new RegExp(`^rgba\\(${mo},${mo},${mo},${Lu}\\)$`),FG=new RegExp(`^hsl\\(${Lu},${mo},${mo}\\)$`),LG=new RegExp(`^hsla\\(${Lu},${mo},${mo},${Lu}\\)$`),ZE={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};vg(rc,Mw,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:eR,formatHex:eR,formatHex8:$G,formatHsl:zG,formatRgb:tR,toString:tR});function eR(){return this.rgb().formatHex()}function $G(){return this.rgb().formatHex8()}function zG(){return KD(this).formatHsl()}function tR(){return this.rgb().formatRgb()}function Mw(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=TG.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?nR(t):n===3?new bn(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Af(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Af(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=IG.exec(e))?new bn(t[1],t[2],t[3],1):(t=AG.exec(e))?new bn(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=NG.exec(e))?Af(t[1],t[2],t[3],t[4]):(t=jG.exec(e))?Af(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=FG.exec(e))?iR(t[1],t[2]/100,t[3]/100,1):(t=LG.exec(e))?iR(t[1],t[2]/100,t[3]/100,t[4]):ZE.hasOwnProperty(e)?nR(ZE[e]):e==="transparent"?new bn(NaN,NaN,NaN,0):null}function nR(e){return new bn(e>>16&255,e>>8&255,e&255,1)}function Af(e,t,n,r){return r<=0&&(e=t=n=NaN),new bn(e,t,n,r)}function YD(e){return e instanceof rc||(e=Mw(e)),e?(e=e.rgb(),new bn(e.r,e.g,e.b,e.opacity)):new bn}function $u(e,t,n,r){return arguments.length===1?YD(e):new bn(e,t,n,r??1)}function bn(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}vg(bn,$u,Pw(rc,{brighter(e){return e=e==null?Vl:Math.pow(Vl,e),new bn(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?sa:Math.pow(sa,e),new bn(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new bn(Gs(this.r),Gs(this.g),Gs(this.b),dp(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:rR,formatHex:rR,formatHex8:BG,formatRgb:oR,toString:oR}));function rR(){return`#${Ps(this.r)}${Ps(this.g)}${Ps(this.b)}`}function BG(){return`#${Ps(this.r)}${Ps(this.g)}${Ps(this.b)}${Ps((isNaN(this.opacity)?1:this.opacity)*255)}`}function oR(){const e=dp(this.opacity);return`${e===1?"rgb(":"rgba("}${Gs(this.r)}, ${Gs(this.g)}, ${Gs(this.b)}${e===1?")":`, ${e})`}`}function dp(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Gs(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Ps(e){return e=Gs(e),(e<16?"0":"")+e.toString(16)}function iR(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new $r(e,t,n,r)}function KD(e){if(e instanceof $r)return new $r(e.h,e.s,e.l,e.opacity);if(e instanceof rc||(e=Mw(e)),!e)return new $r;if(e instanceof $r)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,o=Math.min(t,n,r),i=Math.max(t,n,r),s=NaN,a=i-o,l=(i+o)/2;return a?(t===i?s=(n-r)/a+(n<r)*6:n===i?s=(r-t)/a+2:s=(t-n)/a+4,a/=l<.5?i+o:2-i-o,s*=60):a=l>0&&l<1?0:s,new $r(s,a,l,e.opacity)}function VG(e,t,n,r){return arguments.length===1?KD(e):new $r(e,t,n,r??1)}function $r(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}vg($r,VG,Pw(rc,{brighter(e){return e=e==null?Vl:Math.pow(Vl,e),new $r(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?sa:Math.pow(sa,e),new $r(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,o=2*n-r;return new bn(wb(e>=240?e-240:e+120,o,r),wb(e,o,r),wb(e<120?e+240:e-120,o,r),this.opacity)},clamp(){return new $r(sR(this.h),Nf(this.s),Nf(this.l),dp(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=dp(this.opacity);return`${e===1?"hsl(":"hsla("}${sR(this.h)}, ${Nf(this.s)*100}%, ${Nf(this.l)*100}%${e===1?")":`, ${e})`}`}}));function sR(e){return e=(e||0)%360,e<0?e+360:e}function Nf(e){return Math.max(0,Math.min(1,e||0))}function wb(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const HG=Math.PI/180,WG=180/Math.PI;var XD=-.14861,kw=1.78277,Ow=-.29227,yg=-.90649,zu=1.97294,aR=zu*yg,lR=zu*kw,cR=kw*Ow-yg*XD;function UG(e){if(e instanceof Ys)return new Ys(e.h,e.s,e.l,e.opacity);e instanceof bn||(e=YD(e));var t=e.r/255,n=e.g/255,r=e.b/255,o=(cR*r+aR*t-lR*n)/(cR+aR-lR),i=r-o,s=(zu*(n-o)-Ow*i)/yg,a=Math.sqrt(s*s+i*i)/(zu*o*(1-o)),l=a?Math.atan2(s,i)*WG-120:NaN;return new Ys(l<0?l+360:l,a,o,e.opacity)}function wo(e,t,n,r){return arguments.length===1?UG(e):new Ys(e,t,n,r??1)}function Ys(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}vg(Ys,wo,Pw(rc,{brighter(e){return e=e==null?Vl:Math.pow(Vl,e),new Ys(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?sa:Math.pow(sa,e),new Ys(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=isNaN(this.h)?0:(this.h+120)*HG,t=+this.l,n=isNaN(this.s)?0:this.s*t*(1-t),r=Math.cos(e),o=Math.sin(e);return new bn(255*(t+n*(XD*r+kw*o)),255*(t+n*(Ow*r+yg*o)),255*(t+n*(zu*r)),this.opacity)}}));function qG(e,t,n,r,o){var i=e*e,s=i*e;return((1-3*e+3*i-s)*t+(4-6*i+3*s)*n+(1+3*e+3*i-3*s)*r+s*o)/6}function GG(e){var t=e.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,t-1):Math.floor(n*t),o=e[r],i=e[r+1],s=r>0?e[r-1]:2*o-i,a=r<t-1?e[r+2]:2*i-o;return qG((n-r/t)*t,s,o,i,a)}}const Dw=e=>()=>e;function QD(e,t){return function(n){return e+n*t}}function YG(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function KG(e,t){var n=t-e;return n?QD(e,n>180||n<-180?n-360*Math.round(n/360):n):Dw(isNaN(e)?t:e)}function XG(e){return(e=+e)==1?ol:function(t,n){return n-t?YG(t,n,e):Dw(isNaN(t)?n:t)}}function ol(e,t){var n=t-e;return n?QD(e,n):Dw(isNaN(e)?t:e)}(function e(t){var n=XG(t);function r(o,i){var s=n((o=$u(o)).r,(i=$u(i)).r),a=n(o.g,i.g),l=n(o.b,i.b),c=ol(o.opacity,i.opacity);return function(u){return o.r=s(u),o.g=a(u),o.b=l(u),o.opacity=c(u),o+""}}return r.gamma=e,r})(1);function QG(e){return function(t){var n=t.length,r=new Array(n),o=new Array(n),i=new Array(n),s,a;for(s=0;s<n;++s)a=$u(t[s]),r[s]=a.r||0,o[s]=a.g||0,i[s]=a.b||0;return r=e(r),o=e(o),i=e(i),a.opacity=1,function(l){return a.r=r(l),a.g=o(l),a.b=i(l),a+""}}}var JG=QG(GG);function JD(e){return function t(n){n=+n;function r(o,i){var s=e((o=wo(o)).h,(i=wo(i)).h),a=ol(o.s,i.s),l=ol(o.l,i.l),c=ol(o.opacity,i.opacity);return function(u){return o.h=s(u),o.s=a(u),o.l=l(Math.pow(u,n)),o.opacity=c(u),o+""}}return r.gamma=t,r}(1)}JD(KG);var Tw=JD(ol);const mt=e=>JG(e[e.length-1]);var ZG=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(it);const eY=mt(ZG);var tY=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(it);const nY=mt(tY);var rY=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(it);const oY=mt(rY);var iY=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(it);const sY=mt(iY);var aY=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(it);const lY=mt(aY);var cY=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(it);const uY=mt(cY);var dY=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(it);const fY=mt(dY);var hY=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(it);const pY=mt(hY);var gY=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(it);const mY=mt(gY);var bY=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(it);const vY=mt(bY);var yY=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(it);const xY=mt(yY);var wY=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(it);const SY=mt(wY);var CY=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(it);const _Y=mt(CY);var EY=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(it);const RY=mt(EY);var PY=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(it);const MY=mt(PY);var kY=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(it);const OY=mt(kY);var DY=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(it);const TY=mt(DY);var IY=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(it);const AY=mt(IY);var NY=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(it);const jY=mt(NY);var FY=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(it);const LY=mt(FY);var $Y=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(it);const zY=mt($Y);var BY=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(it);const VY=mt(BY);var HY=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(it);const WY=mt(HY);var UY=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(it);const qY=mt(UY);var GY=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(it);const YY=mt(GY);var KY=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(it);const XY=mt(KY);var QY=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(it);const JY=mt(QY);function ZY(e){return e=Math.max(0,Math.min(1,e)),"rgb("+Math.max(0,Math.min(255,Math.round(-4.54-e*(35.34-e*(2381.73-e*(6402.7-e*(7024.72-e*2710.57)))))))+", "+Math.max(0,Math.min(255,Math.round(32.49+e*(170.73+e*(52.82-e*(131.46-e*(176.58-e*67.37)))))))+", "+Math.max(0,Math.min(255,Math.round(81.24+e*(442.36-e*(2482.43-e*(6167.24-e*(6614.94-e*2475.67)))))))+")"}const eK=Tw(wo(300,.5,0),wo(-240,.5,1));var tK=Tw(wo(-100,.75,.35),wo(80,1.5,.8)),nK=Tw(wo(260,.75,.35),wo(80,1.5,.8)),jf=wo();function rK(e){(e<0||e>1)&&(e-=Math.floor(e));var t=Math.abs(e-.5);return jf.h=360*e-100,jf.s=1.5-1.5*t,jf.l=.8-.9*t,jf+""}var Ff=$u(),oK=Math.PI/3,iK=Math.PI*2/3;function sK(e){var t;return e=(.5-e)*Math.PI,Ff.r=255*(t=Math.sin(e))*t,Ff.g=255*(t=Math.sin(e+oK))*t,Ff.b=255*(t=Math.sin(e+iK))*t,Ff+""}function aK(e){return e=Math.max(0,Math.min(1,e)),"rgb("+Math.max(0,Math.min(255,Math.round(34.61+e*(1172.33-e*(10793.56-e*(33300.12-e*(38394.49-e*14825.05)))))))+", "+Math.max(0,Math.min(255,Math.round(23.31+e*(557.33+e*(1225.33-e*(3574.96-e*(1073.77+e*707.56)))))))+", "+Math.max(0,Math.min(255,Math.round(27.2+e*(3211.1-e*(15327.97-e*(27814-e*(22569.18-e*6838.66)))))))+")"}function xg(e){var t=e.length;return function(n){return e[Math.max(0,Math.min(t-1,Math.floor(n*t)))]}}const lK=xg(it("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725"));var cK=xg(it("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),uK=xg(it("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),dK=xg(it("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));function fK(e){return e}function hK(e){if(e==null)return fK;var t,n,r=e.scale[0],o=e.scale[1],i=e.translate[0],s=e.translate[1];return function(a,l){l||(t=n=0);var c=2,u=a.length,d=new Array(u);for(d[0]=(t+=a[0])*r+i,d[1]=(n+=a[1])*o+s;c<u;)d[c]=a[c],++c;return d}}function pK(e,t){for(var n,r=e.length,o=r-t;o<--r;)n=e[o],e[o++]=e[r],e[r]=n}function gK(e,t){return typeof t=="string"&&(t=e.objects[t]),t.type==="GeometryCollection"?{type:"FeatureCollection",features:t.geometries.map(function(n){return uR(e,n)})}:uR(e,t)}function uR(e,t){var n=t.id,r=t.bbox,o=t.properties==null?{}:t.properties,i=mK(e,t);return n==null&&r==null?{type:"Feature",properties:o,geometry:i}:r==null?{type:"Feature",id:n,properties:o,geometry:i}:{type:"Feature",id:n,bbox:r,properties:o,geometry:i}}function mK(e,t){var n=hK(e.transform),r=e.arcs;function o(u,d){d.length&&d.pop();for(var h=r[u<0?~u:u],f=0,p=h.length;f<p;++f)d.push(n(h[f],f));u<0&&pK(d,p)}function i(u){return n(u)}function s(u){for(var d=[],h=0,f=u.length;h<f;++h)o(u[h],d);return d.length<2&&d.push(d[0]),d}function a(u){for(var d=s(u);d.length<4;)d.push(d[0]);return d}function l(u){return u.map(a)}function c(u){var d=u.type,h;switch(d){case"GeometryCollection":return{type:d,geometries:u.geometries.map(c)};case"Point":h=i(u.coordinates);break;case"MultiPoint":h=u.coordinates.map(i);break;case"LineString":h=s(u.arcs);break;case"MultiLineString":h=u.arcs.map(s);break;case"Polygon":h=l(u.arcs);break;case"MultiPolygon":h=u.arcs.map(l);break;default:return null}return{type:d,coordinates:h}}return c(t)}const du={geoAzimuthalEqualArea:bG,geoAzimuthalEquidistant:vG,geoGnomonic:PG,geoOrthographic:kG,geoStereographic:OG,geoEqualEarth:RG,geoAlbers:FD,geoAlbersUsa:mG,geoConicConformal:wG,geoConicEqualArea:lp,geoConicEquidistant:_G,geoEquirectangular:SG,geoMercator:yG,geoTransverseMercator:DG,geoNaturalEarth1:MG};Object.keys(du).forEach(e=>{du[`${e.charAt(3).toLowerCase()}${e.slice(4)}`]=du[e]});class xa extends Ji{constructor(t){super(t),this.outlineBounds=null,this.oldChartBounds=null,this.geoPath=KE()}init(t){t.position="chartArea",super.init(t),typeof t.projection=="function"?this.projection=t.projection:this.projection=(du[t.projection]||du.albersUsa)(),this.geoPath.projection(this.projection),this.outlineBounds=null,this.oldChartBounds=null}computeBounds(t){const n=KE(this.projection.fitWidth(1e3,t)).bounds(t),r=Math.ceil(n[1][1]-n[0][1]),o=Math.ceil(n[1][0]-n[0][0]),i=this.projection.translate();this.outlineBounds={width:o,height:r,aspectRatio:o/r,refScale:this.projection.scale(),refX:i[0],refY:i[1]}}updateBounds(){const t=this.chart.chartArea,n=this.outlineBounds;if(!n)return!1;const r=this.options.padding,o=typeof r=="number"?r:r.top,i=typeof r=="number"?r:r.left,s=typeof r=="number"?r:r.bottom,a=typeof r=="number"?r:r.right,l=t.right-t.left-i-a,c=t.bottom-t.top-o-s,u=this.oldChartBounds;this.oldChartBounds={chartWidth:l,chartHeight:c};const d=Math.min(l/n.width,c/n.height),h=n.width*d,f=n.height*d,p=(l-h)*.5+t.left+i,g=(c-f)*.5+t.top+o,b=this.options;return this.projection.scale(n.refScale*d*b.projectionScale).translate([d*n.refX+p+b.projectionOffset[0],d*n.refY+g+b.projectionOffset[1]]),!u||u.chartWidth!==this.oldChartBounds.chartWidth||u.chartHeight!==this.oldChartBounds.chartHeight}}xa.id="projection";xa.defaults={projection:"albersUsa",projectionScale:1,projectionOffset:[0,0],padding:0};xa.descriptors={_scriptable:e=>e!=="projection",_indexable:e=>e!=="projectionOffset"};const wg={position:"chartArea",property:"value",grid:{z:1,drawOnChartArea:!1},ticks:{z:1},legend:{align:"right",position:"bottom-right",length:100,width:50,margin:8,indicatorWidth:10}};function bK(e){const{indicatorWidth:t,align:n,margin:r}=e,o=(typeof r=="number"?r:r.left)+(n==="right"?t:0),i=(typeof r=="number"?r:r.top)+(n==="bottom"?t:0),s=(typeof r=="number"?r:r.right)+(n==="left"?t:0),a=(typeof r=="number"?r:r.bottom)+(n==="top"?t:0);return{left:o,top:i,right:s,bottom:a}}function vK(e,t,n,r,o){const{indicatorWidth:i,align:s,position:a}=t,l=s==="top"||s==="bottom",c=(s==="left"?o.w:n)+(l?i:0),u=(s==="top"?o.h:r)+(l?0:i),d=bK(t);if(typeof a=="string")switch(a){case"top-left":return[d.left,d.top];case"top":return[(e.right-c)/2,d.top];case"left":return[d.left,(e.bottom-u)/2];case"top-right":return[e.right-c-d.right,d.top];case"bottom-right":return[e.right-c-d.right,e.bottom-u-d.bottom];case"bottom":return[(e.right-c)/2,e.bottom-u-d.bottom];case"bottom-left":return[d.left,e.bottom-u-d.bottom];default:return[e.right-c-d.right,(e.bottom-u)/2]}return[a.x,a.y]}class Ga extends Fl{constructor(){super(...arguments),this.legendSize={w:0,h:0}}init(t){t.position="chartArea",super.init(t),this.axis="r"}parse(t,n){return t&&typeof t[this.options.property]=="number"?t[this.options.property]:super.parse(t,n)}isHorizontal(){return this.options.legend.align==="top"||this.options.legend.align==="bottom"}_getNormalizedValue(t){return t==null||Number.isNaN(t)?null:(t-this._startValue)/this._valueRange}update(t,n,r){const o=Math.min(n,this.bottom==null?Number.POSITIVE_INFINITY:this.bottom),i=Math.min(t,this.right==null?Number.POSITIVE_INFINITY:this.right),s=this.options.legend,a=this.isHorizontal(),l=(f,p)=>f<1?p*f:f,c=Math.min(i,l(a?s.length:s.width,i))-(a?0:s.indicatorWidth),u=Math.min(o,l(a?s.width:s.length,o))-(a?s.indicatorWidth:0);this.legendSize={w:c,h:u},this.bottom=u,this.height=u,this.right=c,this.width=c;const d=this.options.position;this.options.position=this.options.legend.align;const h=super.update(c,u,r);return this.options.position=d,this.height=Math.min(u,this.height),this.width=Math.min(c,this.width),h}_computeLabelArea(){}draw(t){if(!this._isVisible())return;const n=vK(t,this.options.legend,this.width,this.height,this.legendSize),{ctx:r}=this;r.save(),r.translate(n[0],n[1]);const o=this.options.position;this.options.position=this.options.legend.align,super.draw({...t,bottom:this.height+10,right:this.width}),this.options.position=o;const{indicatorWidth:i}=this.options.legend;switch(this.options.legend.align){case"left":r.translate(this.legendSize.w,0);break;case"top":r.translate(0,this.legendSize.h);break;case"bottom":r.translate(0,-i);break;default:r.translate(-i,0);break}this._drawIndicator(),r.restore()}_drawIndicator(){}}class ZD extends Ll{constructor(){super(...arguments),this.legendSize={w:0,h:0}}init(t){Ga.prototype.init.call(this,t)}parse(t,n){return Ga.prototype.parse.call(this,t,n)}isHorizontal(){return this.options.legend.align==="top"||this.options.legend.align==="bottom"}_getNormalizedValue(t){return t==null||Number.isNaN(t)?null:(Math.log10(t)-this._startValue)/this._valueRange}update(t,n,r){return Ga.prototype.update.call(this,t,n,r)}_computeLabelArea(){}draw(t){return Ga.prototype.draw.call(this,t)}_drawIndicator(){}}const Yo={interpolateBlues:VY,interpolateBrBG:eY,interpolateBuGn:vY,interpolateBuPu:xY,interpolateCividis:ZY,interpolateCool:nK,interpolateCubehelixDefault:eK,interpolateGnBu:SY,interpolateGreens:WY,interpolateGreys:qY,interpolateInferno:uK,interpolateMagma:cK,interpolateOrRd:_Y,interpolateOranges:JY,interpolatePRGn:nY,interpolatePiYG:oY,interpolatePlasma:dK,interpolatePuBu:MY,interpolatePuBuGn:RY,interpolatePuOr:sY,interpolatePuRd:OY,interpolatePurples:YY,interpolateRainbow:rK,interpolateRdBu:lY,interpolateRdGy:uY,interpolateRdPu:TY,interpolateRdYlBu:fY,interpolateRdYlGn:pY,interpolateReds:XY,interpolateSinebow:sK,interpolateSpectral:mY,interpolateTurbo:aK,interpolateViridis:lK,interpolateWarm:tK,interpolateYlGn:jY,interpolateYlGnBu:AY,interpolateYlOrBr:LY,interpolateYlOrRd:zY};Object.keys(Yo).forEach(e=>{Yo[`${e.charAt(11).toLowerCase()}${e.slice(12)}`]=Yo[e],Yo[e.slice(11)]=Yo[e]});function eT(e,t){const n=1/t;if(e<=n)return 0;if(e>=1-n)return 1;for(let r=0;r<1;r+=n)if(e<r)return r-n/2;return e}const tT={interpolate:"blues",missing:"transparent",quantize:0};class Vi extends Ga{get interpolate(){const t=this.options;return t?typeof t.interpolate=="function"?t.interpolate:Yo[t.interpolate]||Yo.blues:n=>`rgb(${n},${n},${n})`}getColorForValue(t){const n=this._getNormalizedValue(t);return n==null||Number.isNaN(n)?this.options.missing:this.getColor(n)}getColor(t){let n=t;return this.options.quantize>0&&(n=eT(n,this.options.quantize)),this.interpolate(n)}_drawIndicator(){const{indicatorWidth:t}=this.options.legend,n=this._reversePixels;if(this.isHorizontal()){const r=this.width;if(this.options.quantize>0){const o=r/this.options.quantize,i=n?s=>r-o-s:s=>s;for(let s=0;s<r;s+=o){const a=(s+o/2)/r;this.ctx.fillStyle=this.getColor(a),this.ctx.fillRect(i(s),0,o,t)}}else{const o=n?i=>r-1-i:i=>i;for(let i=0;i<r;i+=1)this.ctx.fillStyle=this.getColor((i+.5)/r),this.ctx.fillRect(o(i),0,1,t)}}else{const r=this.height;if(this.options.quantize>0){const o=r/this.options.quantize,i=n?s=>r-o-s:s=>s;for(let s=0;s<r;s+=o){const a=(s+o/2)/r;this.ctx.fillStyle=this.getColor(a),this.ctx.fillRect(0,i(s),t,o)}}else{const o=n?i=>r-1-i:i=>i;for(let i=0;i<r;i+=1)this.ctx.fillStyle=this.getColor((i+.5)/r),this.ctx.fillRect(0,o(i),t,1)}}}}Vi.id="color";Vi.defaults=Zt({},[Fl.defaults,wg,tT]);Vi.descriptors={_scriptable:e=>e!=="interpolate",_indexable:!1};class Iw extends ZD{constructor(){super(...arguments),this.interpolate=t=>`rgb(${t},${t},${t})`}init(t){super.init(t),typeof t.interpolate=="function"?this.interpolate=t.interpolate:this.interpolate=Yo[t.interpolate]||Yo.blues}getColorForValue(t){return Vi.prototype.getColorForValue.call(this,t)}getColor(t){let n=t;return this.options.quantize>0&&(n=eT(n,this.options.quantize)),this.interpolate(n)}_drawIndicator(){return Vi.prototype._drawIndicator.call(this)}}Iw.id="colorLogarithmic";Iw.defaults=Zt({},[Ll.defaults,wg,tT]);Iw.descriptors={_scriptable:e=>e!=="interpolate",_indexable:!1};const nT={missing:1,mode:"area",range:[2,20],legend:{align:"bottom",length:90,width:70,indicatorWidth:42}};class Hi extends Ga{constructor(){super(...arguments),this._model=null}getSizeForValue(t){const n=this._getNormalizedValue(t);return n==null||Number.isNaN(n)?this.options.missing:this.getSizeImpl(n)}getSizeImpl(t){const[n,r]=this.options.range;if(this.options.mode==="area"){const i=r*r*Math.PI,s=n*n*Math.PI,a=i-s,l=t*a+s;return Math.sqrt(l/Math.PI)}const o=r-n;return t*o+n}_drawIndicator(){const{ctx:t}=this,n=this.options.legend.indicatorWidth/2,r=this.isHorizontal(),o=this.ticks,i=this.getLabelItems(),s=i?i.map(a=>({[r?"x":"y"]:a.options.translation[r?0:1]})):o.map((a,l)=>({[r?"x":"y"]:this.getPixelForTick(l)}));if((this._gridLineItems||[]).forEach(a=>{if(t.save(),t.strokeStyle=a.color,t.lineWidth=a.width,t.setLineDash&&(t.setLineDash(a.borderDash),t.lineDashOffset=a.borderDashOffset),t.beginPath(),this.options.grid.drawTicks)switch(this.options.legend.align){case"left":t.moveTo(0,a.ty1),t.lineTo(n,a.ty2);break;case"top":t.moveTo(a.tx1,0),t.lineTo(a.tx2,n);break;case"bottom":t.moveTo(a.tx1,n),t.lineTo(a.tx2,n*2);break;default:t.moveTo(n,a.ty1),t.lineTo(n*2,a.ty2);break}t.stroke(),t.restore()}),this._model){const a=this._model;t.strokeStyle=a.borderColor,t.lineWidth=a.borderWidth||0,t.fillStyle=a.backgroundColor}else t.fillStyle="blue";o.forEach((a,l)=>{const c=s[l],u=this.getSizeForValue(a.value),d=r?c.x:n,h=r?n:c.y,f={pointStyle:"circle",borderWidth:0,...this._model||{},radius:u};qh(t,f,d,h)})}}Hi.id="size";Hi.defaults=Zt({},[Fl.defaults,wg,nT]);Hi.descriptors={_scriptable:!0,_indexable:e=>e!=="range"};class rT extends ZD{constructor(){super(...arguments),this._model=null}getSizeForValue(t){const n=this._getNormalizedValue(t);return n==null||Number.isNaN(n)?this.options.missing:this.getSizeImpl(n)}getSizeImpl(t){return Hi.prototype.getSizeImpl.call(this,t)}_drawIndicator(){Hi.prototype._drawIndicator.call(this)}}rT.id="sizeLogarithmic";rT.defaults=Zt({},[Ll.defaults,wg,nT]);function yK(e,t){return[[e[0][0]-t,e[0][1]-t],[e[1][0]+t,e[1][1]+t]]}class ii extends Oo{constructor(){super(...arguments),this.cache=void 0}inRange(t,n){const r=this.getBounds(),o=(Number.isNaN(t)||t>=r.x&&t<=r.x2)&&(Number.isNaN(n)||n>=r.y&&n<=r.y2),i=this.projectionScale.geoPath.projection();if(o&&!Number.isNaN(t)&&!Number.isNaN(n)&&typeof i.invert=="function"){const s=i.invert([t,n]);return s!=null&&Yq(this.feature,s)}return o}inXRange(t){return this.inRange(t,Number.NaN)}inYRange(t){return this.inRange(Number.NaN,t)}getCenterPoint(){if(this.cache&&this.cache.center)return this.cache.center;let t;if(this.center){const n=this.projectionScale.projection([this.center.longitude,this.center.latitude]);t={x:n[0],y:n[1]}}else{const n=this.projectionScale.geoPath.centroid(this.feature);t={x:n[0],y:n[1]}}return this.cache={...this.cache||{},center:t},t}getBounds(){if(this.cache&&this.cache.bounds)return this.cache.bounds;const t=yK(this.projectionScale.geoPath.bounds(this.feature),this.options.borderWidth/2),n={x:t[0][0],x2:t[1][0],y:t[0][1],y2:t[1][1],width:t[1][0]-t[0][0],height:t[1][1]-t[0][1]};return this.cache={...this.cache||{},bounds:n},n}_drawInCache(t){const n=this.getBounds();if(!Number.isFinite(n.x))return;const r=this.cache&&this.cache.canvas?this.cache.canvas:t.createElement("canvas"),o=Math.floor(n.x),i=Math.floor(n.y),s=Math.ceil(n.x+n.width),a=Math.ceil(n.y+n.height),l=this.pixelRatio||1,c=Math.ceil(Math.max(s-o,1)*l),u=Math.ceil(Math.max(a-i,1)*l);if(c<=0||u<=0)return;r.width=c,r.height=u;const d=r.getContext("2d");d&&(d.clearRect(0,0,r.width,r.height),d.save(),d.scale(l,l),d.translate(-o,-i),this._drawImpl(d),d.restore(),this.cache={...this.cache||{},canvas:r,canvasKey:this._optionsToKey()})}_optionsToKey(){const{options:t}=this;return`${t.backgroundColor};${t.borderColor};${t.borderWidth};${this.pixelRatio}`}_drawImpl(t){const{feature:n}=this,{options:r}=this;t.beginPath(),this.projectionScale.geoPath.context(t)(n),r.backgroundColor&&(t.fillStyle=r.backgroundColor,t.fill()),r.borderColor&&(t.strokeStyle=r.borderColor,t.lineWidth=r.borderWidth,t.stroke())}draw(t){const{feature:n}=this;if(!n)return;(!this.cache||this.cache.canvasKey!==this._optionsToKey())&&t.canvas.ownerDocument!=null&&this._drawInCache(t.canvas.ownerDocument);const r=this.getBounds();if(this.cache&&this.cache.canvas&&this.cache.canvas.width>0&&this.cache.canvas.height>0){const o=Math.floor(r.x),i=Math.floor(r.y),s=Math.ceil(r.x+r.width),a=Math.ceil(r.y+r.height),l=s-o,c=a-i;l>0&&c>0&&t.drawImage(this.cache.canvas,o,i,s-o,a-i)}else Number.isFinite(r.x)&&(t.save(),this._drawImpl(t),t.restore())}}ii.id="geoFeature";ii.defaults={...qs.defaults,outlineBackgroundColor:null,outlineBorderWidth:0,graticuleBorderColor:"#CCCCCC",graticuleBorderWidth:0};ii.defaultRoutes={outlineBorderColor:"borderColor",...qs.defaultRoutes||{}};const oT={showOutline:!1,showGraticule:!1,clipMap:!0},iT={scales:{projection:{axis:"x",type:xa.id,position:"chartArea",display:!1}}};function dR(e){const t={...e};return Object.keys(e).forEach(n=>{let r=n;if(n.startsWith("outline")){const o=n.slice(7);r=o[0].toLowerCase()+o.slice(1)}else if(n.startsWith("hoverOutline"))r=`hover${n.slice(12)}`;else return;delete t[n],t[r]=e[n]}),t}class sT extends Mr{getGeoDataset(){return super.getDataset()}getGeoOptions(){return this.chart.options}getProjectionScale(){return this.getScaleForId("projection")}linkScales(){const t=this.getGeoDataset(),n=this.getMeta();n.xAxisID="projection",t.xAxisID="projection",n.yAxisID="projection",t.yAxisID="projection",n.xScale=this.getScaleForId("projection"),n.yScale=this.getScaleForId("projection"),this.getProjectionScale().computeBounds(this.resolveOutline())}showOutline(){return ke(this.getGeoDataset().showOutline,this.getGeoOptions().showOutline)}clipMap(){return ke(this.getGeoDataset().clipMap,this.getGeoOptions().clipMap)}getGraticule(){return ke(this.getGeoDataset().showGraticule,this.getGeoOptions().showGraticule)}update(t){super.update(t);const n=this.getMeta(),r=this.getProjectionScale(),o=r.updateBounds();if(this.showOutline()){const i=n.dataset;if(o&&delete i.cache,i.projectionScale=r,i.pixelRatio=this.chart.currentDevicePixelRatio,t!=="resize"){const s=dR(this.resolveDatasetElementOptions(t)),a={feature:this.resolveOutline(),options:s};this.updateElement(i,void 0,a,t),this.getGraticule()&&(n.graticule=s)}}else this.getGraticule()&&t!=="resize"&&(n.graticule=dR(this.resolveDatasetElementOptions(t)));this.updateElements(n.data,0,n.data.length,t),o&&n.data.forEach(i=>delete i.cache)}resolveOutline(){const n=this.getGeoDataset().outline||{type:"Sphere"};return Array.isArray(n)?{type:"FeatureCollection",features:n}:n}showGraticule(){const t=this.getGraticule(),n=this.getMeta().graticule;if(!t||!n)return;const{ctx:r}=this.chart,i=this.getProjectionScale().geoPath.context(r);if(r.save(),r.beginPath(),typeof t=="boolean")t&&i(Kq());else{const s=wD();t.stepMajor&&s.stepMajor(t.stepMajor),t.stepMinor&&s.stepMinor(t.stepMinor),i(s())}r.strokeStyle=n.graticuleBorderColor,r.lineWidth=n.graticuleBorderWidth,r.stroke(),r.restore()}draw(){const{chart:t}=this,n=this.clipMap();let r=!1;(n===!0||n==="outline"||n==="outline+graticule")&&(r=!0,Bs(t.ctx,t.chartArea)),this.showOutline()&&this.getMeta().dataset&&this.getMeta().dataset.draw.call(this.getMeta().dataset,t.ctx,t.chartArea),n===!0||n==="graticule"||n==="outline+graticule"?r||Bs(t.ctx,t.chartArea):r&&(r=!1,Vs(t.ctx)),this.showGraticule(),n===!0||n==="items"?r||Bs(t.ctx,t.chartArea):r&&(r=!1,Vs(t.ctx)),this.getMeta().data.forEach(o=>o.draw.call(o,t.ctx,t.chartArea)),r&&(r=!1,Vs(t.ctx))}}function aT(e,t,n,r=[],o=[]){Pn.addControllers(n),Array.isArray(r)?Pn.addElements(...r):Pn.addElements(r),Array.isArray(o)?Pn.addScales(...o):Pn.addScales(o);const i=t;return i.type=e,i}class oc extends sT{initialize(){super.initialize(),this.enableOptionSharing=!0}linkScales(){super.linkScales();const t=this.getGeoDataset(),n=this.getMeta();n.vAxisID="color",n.rAxisID="color",t.vAxisID="color",t.rAxisID="color",n.rScale=this.getScaleForId("color"),n.vScale=n.rScale,n.iScale=n.xScale,n.iAxisID=n.xAxisID,t.iAxisID=n.xAxisID}_getOtherScale(t){return t}parse(t,n){const r=this.getMeta().rScale,{data:o}=this.getDataset(),i=this._cachedMeta;for(let s=t;s<t+n;s+=1)i._parsed[s]={[r.axis]:r.parse(o[s],s)}}updateElements(t,n,r,o){const i=this.resolveDataElementOptions(n,o),s=this.getSharedOptions(i),a=this.includeOptions(o,s),l=this.getProjectionScale();this.updateSharedOptions(s,o,i);for(let c=n;c<n+r;c+=1){const u=t[c];u.projectionScale=l,u.feature=this._data[c].feature,u.center=this._data[c].center,u.pixelRatio=this.chart.currentDevicePixelRatio;const d=u.getCenterPoint(),h={x:d.x,y:d.y};a&&(h.options=s||this.resolveDataElementOptions(c,o)),this.updateElement(u,c,h,o)}}indexToColor(t){const n=this.getMeta().rScale;return n.getColorForValue(this.getParsed(t)[n.axis])}}oc.id="choropleth";oc.defaults=Zt({},[oT,{datasetElementType:ii.id,dataElementType:ii.id}]);oc.overrides=Zt({},[iT,{plugins:{tooltip:{callbacks:{title(){return""},label(e){var t,n,r,o;return e.formattedValue==null?(n=(t=e.chart.data)===null||t===void 0?void 0:t.labels)===null||n===void 0?void 0:n[e.dataIndex]:`${(o=(r=e.chart.data)===null||r===void 0?void 0:r.labels)===null||o===void 0?void 0:o[e.dataIndex]}: ${e.formattedValue}`}}},colors:{enabled:!1}},scales:{color:{type:Vi.id,axis:"x"}},elements:{geoFeature:{backgroundColor(e){return e.dataIndex==null?null:e.chart.getDatasetMeta(e.datasetIndex).controller.indexToColor(e.dataIndex)}}}}]);class xK extends Tt{constructor(t,n){super(t,aT("choropleth",n,oc,ii,[Vi,xa]))}}xK.id=oc.id;class ic extends sT{initialize(){super.initialize(),this.enableOptionSharing=!0}linkScales(){super.linkScales();const t=this.getGeoDataset(),n=this.getMeta();n.vAxisID="size",n.rAxisID="size",t.vAxisID="size",t.rAxisID="size",n.rScale=this.getScaleForId("size"),n.vScale=n.rScale,n.iScale=n.xScale,n.iAxisID=n.xAxisID,t.iAxisID=n.xAxisID}_getOtherScale(t){return t}parse(t,n){const r=this.getMeta().rScale,o=this.getDataset().data,i=this._cachedMeta;for(let s=t;s<t+n;s+=1){const a=o[s];i._parsed[s]={x:a.longitude==null?a.x:a.longitude,y:a.latitude==null?a.y:a.latitude,[r.axis]:r.parse(a,s)}}}updateElements(t,n,r,o){const i=o==="reset",s=this.resolveDataElementOptions(n,o),a=this.getSharedOptions(s),l=this.includeOptions(o,a),c=this.getProjectionScale();this.getMeta().rScale._model=s,this.updateSharedOptions(a,o,s);for(let u=n;u<n+r;u+=1){const d=t[u],h=this.getParsed(u),f=c.projection([h.x,h.y]),p={x:f?f[0]:0,y:f?f[1]:0,skip:Number.isNaN(h.x)||Number.isNaN(h.y)};l&&(p.options=a||this.resolveDataElementOptions(u,o),i&&(p.options.radius=0)),this.updateElement(d,u,p,o)}}indexToRadius(t){const n=this.getMeta().rScale;return n.getSizeForValue(this.getParsed(t)[n.axis])}}ic.id="bubbleMap";ic.defaults=Zt({},[oT,{dataElementType:Us.id,datasetElementType:ii.id,showOutline:!0,clipMap:"outline+graticule"}]);ic.overrides=Zt({},[iT,{plugins:{tooltip:{callbacks:{title(){return""},label(e){var t,n,r,o;return e.formattedValue==null?(n=(t=e.chart.data)===null||t===void 0?void 0:t.labels)===null||n===void 0?void 0:n[e.dataIndex]:`${(o=(r=e.chart.data)===null||r===void 0?void 0:r.labels)===null||o===void 0?void 0:o[e.dataIndex]}: ${e.formattedValue}`}}}},scales:{size:{axis:"x",type:Hi.id}},elements:{point:{radius(e){return e.dataIndex==null?null:e.chart.getDatasetMeta(e.datasetIndex).controller.indexToRadius(e.dataIndex)},hoverRadius(e){return e.dataIndex==null?null:e.chart.getDatasetMeta(e.datasetIndex).controller.indexToRadius(e.dataIndex)+1}}}}]);class wK extends Tt{constructor(t,n){super(t,aT("bubbleMap",n,ic,ii,[Hi,xa]))}}wK.id=ic.id;function SK(e){var n;return{...e,type:"bar",options:{...e==null?void 0:e.options,indexAxis:"y",scales:{x:{display:!0},y:{display:!0}},plugins:{...(n=e==null?void 0:e.options)==null?void 0:n.plugins,legend:{position:"bottom",align:"center"}}}}}function CK(e){var n;return{...e,type:"bar",options:{...e==null?void 0:e.options,indexAxis:"y",scales:{x:{beginAtZero:!0,stack:1,reverse:!0},y:{stacked:!0,beginAtZero:!0}},plugins:{...(n=e==null?void 0:e.options)==null?void 0:n.plugins,legend:{position:"bottom",align:"center"}}}}}function _K(e){var n;return{...e,type:"bar",options:{...e==null?void 0:e.options,scales:{x:{display:!0},y:{display:!0}},plugins:{...(n=e==null?void 0:e.options)==null?void 0:n.plugins,legend:{position:"bottom",align:"center"}}}}}function EK(e,t=!1){var r;return{...e,type:"bar",options:{...e==null?void 0:e.options,indexAxis:"y",scales:{x:{display:!0,beginAtZero:!1},y:{display:!0,stacked:t}},plugins:{...(r=e==null?void 0:e.options)==null?void 0:r.plugins,legend:{position:"bottom",align:"center"}}}}}function RK(e,t){var r,o,i,s,a;return{...e,type:t==="stackedBar"?"bar":"line",options:{...e==null?void 0:e.options,scales:{x:{...(o=(r=e==null?void 0:e.options)==null?void 0:r.scales)==null?void 0:o.x,display:!0,stacked:!0},y:{...(s=(i=e==null?void 0:e.options)==null?void 0:i.scales)==null?void 0:s.y,display:!0,stacked:t==="stackedBar"}},plugins:{...(a=e==null?void 0:e.options)==null?void 0:a.plugins,legend:{position:"bottom",align:"center"}}}}}function PK(e){var n;return{...e,type:"line",options:{...e==null?void 0:e.options,scales:{x:{display:!0},y:{display:!0}},plugins:{...(n=e==null?void 0:e.options)==null?void 0:n.plugins,legend:{position:"bottom",align:"center"}}}}}function MK(e,t){var r;return{...t,type:e,options:{...t==null?void 0:t.options,scales:{x:{display:!1},y:{display:!1}},plugins:{...(r=t==null?void 0:t.options)==null?void 0:r.plugins,legend:{position:"bottom",align:"center",maxHeight:0,labels:{useBorderRadius:!0,borderRadius:2}}},borderRadius:0}}}function kK(e){var r,o;const t=se.getState().theme;let n={...e,type:"radar",options:{...e==null?void 0:e.options,scales:{x:{display:!1},y:{display:!1},r:{grid:{display:!0},angleLines:{},ticks:{}}},plugins:{...(r=e==null?void 0:e.options)==null?void 0:r.plugins,legend:{position:"bottom",align:"center"}}}};return t==="dark"&&(n={...n,options:{...n.options,scales:{...(o=n==null?void 0:n.options)==null?void 0:o.scales,r:{grid:{color:Xe.slate[800]},angleLines:{color:Xe.slate[800]},ticks:{color:Xe.slate[800],showLabelBackdrop:!1}}}}}),n}function OK(e,t,n){const r={interaction:{mode:"point"},plugins:{tooltip:{callbacks:{label:function(i){var f;const s=i.dataset.label,a=i.dataIndex,l=i.dataset.data,c=(f=l==null?void 0:l[a])==null?void 0:f.label,u=n==null?void 0:n[0],d=n==null?void 0:n[1],h=n==null?void 0:n[2];if(t==="bubble")return c?`${s} (${c}): ${u}: ${i.raw.x.toFixed(2)}, ${d}: ${i.raw.y.toFixed(2)}, ${h}: ${i.raw.r.toFixed(2)}`:`${s}: ${u}: ${i.raw.x.toFixed(2)}, ${d}: ${i.raw.y.toFixed(2)}, ${h}: ${i.raw.r.toFixed(2)}`;if(t==="scatter")return c?`${s} (${c}): ${u}: ${i.raw.x.toFixed(2)}, ${d}: ${i.raw.y.toFixed(2)}`:`${s}: ${u}: ${i.raw.x.toFixed(2)}, ${d}: ${i.raw.y.toFixed(2)}`}}},datalabels:{display:!1}},scales:{x:{title:{display:!0,text:n[0]},beginAtZero:!0,ticks:{precision:0}},y:{title:{display:!0,text:n[1]},beginAtZero:!0,ticks:{precision:0}}}};return{...e,options:{...e==null?void 0:e.options,...r}}}function Aw({data:e,cardType:t="bar",cfg:n,customCfg:r,provider:o="chartjs",userSettings:i,preferences:s,topoJson:a}){var l,c,u,d,h,f,p,g,b,v;if(t==="map"){if(!a)return null;const x=(l=s==null?void 0:s.mapVisualOptions)==null?void 0:l.objectKey;if(!x)return null;const y=gK(a,(c=a==null?void 0:a.objects)==null?void 0:c[x]).features;if(!y)return null;const _={plugins:{datalabels:{display:!1}},scales:{x:{display:!1,grid:{display:!1}},y:{display:!1,grid:{display:!1}},projection:{axis:"x",projection:((u=s==null?void 0:s.mapVisualOptions)==null?void 0:u.projection)||"mercator",projectionScale:((d=s==null?void 0:s.mapVisualOptions)==null?void 0:d.projectionScale)||1,projectionOffset:((h=s==null?void 0:s.mapVisualOptions)==null?void 0:h.projectionOffset)||[0,0]},color:{axis:"x",interpolate:((f=s==null?void 0:s.mapVisualOptions)==null?void 0:f.colorScale)||"blues",quantize:5,legend:{position:"bottom-right",align:"right"}}}},{keys:w}=Xt(e),C=y.map(N=>{var A;const G=w==null?void 0:w[0],z=w==null?void 0:w[1],O=(A=e.find(L=>(L==null?void 0:L[G])===N.properties.NAME||(L==null?void 0:L[G])===N.properties.name))==null?void 0:A[z];return{feature:N,value:O}}),k=Vc([{label:x,data:C,borderColor:"lightgray"}],r),D={type:"choropleth",data:{labels:y.map(N=>N.properties.NAME||N.properties.name),datasets:k},options:_},{options:I}=bv({cfg:D,preferences:s,customCfg:r,cardType:t});return{...D,options:I}}if(t==="bar"){const x=_K(n);return ls({data:e,cfg:x,customCfg:r,cardType:t,preferences:s})}if(t==="horizontalBar"){const x=SK(n);return ls({data:e,cfg:x,customCfg:r,cardType:t,preferences:s})}if(t==="pyramid"){const x=CK(n),{dimensionKeys:y,metricKeys:_}=Xt(e),w=Bh({dataArray:e,groupKey:y[0],pivotKey:y[1],valueKey:_[0]}),C=ls({data:w,cfg:x,customCfg:r,cardType:t,preferences:s}),R="x2";return{...C,data:{...C.data,datasets:C.data.datasets.map((D,I)=>I===1?{...D,xAxisID:R}:D)},options:{...C.options,scales:{...(p=C==null?void 0:C.options)==null?void 0:p.scales,[R]:{beginAtZero:!0,stack:1}}}}}if(t==="stackedBar"||t==="stackedLine"){const x=RK(n,t),{dimensionKeys:y,metricKeys:_}=Xt(e),w=Bh({dataArray:e,groupKey:y[0],pivotKey:y[1],valueKey:_[0],sortChart:s==null?void 0:s.sortChart});return ls({data:w,cfg:x,customCfg:r,cardType:t,preferences:s})}if(t==="line"){const x=PK(n);return ls({data:e,cfg:x,customCfg:r,cardType:t,preferences:s})}if(t==="range"){const x=EK(n),y=lB(e),_=Vc(y,r),{plugins:w,options:C}=mv((s==null?void 0:s.customVisualCode)||""),R=ar((x==null?void 0:x.options)||{},(n==null?void 0:n.options)||{}),k=ar(R,(s==null?void 0:s.chartOptions)||{}),D=ar(k,(r==null?void 0:r.options)||{}),I=ar(D,C),T=fO(n,s),N=ar(I,T),G={...N,plugins:{...N==null?void 0:N.plugins,datalabels:{...(g=N==null?void 0:N.plugins)==null?void 0:g.datalabels,formatter:(j,B)=>j.map(W=>{var F,P,U,q;return Rr({number:Number(W),decimalPlaces:((F=s==null?void 0:s.numberAxisFormat)==null?void 0:F.decimalPlaces)||0,useSuffix:!!((P=s==null?void 0:s.numberAxisFormat)!=null&&P.suffix),customSuffix:"",locale:((U=s==null?void 0:s.numberAxisFormat)==null?void 0:U.locale)||"",currency:((q=s==null?void 0:s.numberAxisFormat)==null?void 0:q.currency)||""})}).slice(0,2).join(" - ")}}},{dimensionKeys:z}=Xt(e),O=z[0];return{type:"bar",data:{labels:[...new Set(gv(e,O))],datasets:_},options:G,plugins:[...w]}}if(t==="pie"||t==="doughnut"||t==="polarArea"){const x=MK(t,n),{dimensionKeys:y,metricKeys:_}=Xt(e),w=cB(_,e),C=Vc(w,r),{plugins:R,options:k}=mv((s==null?void 0:s.customVisualCode)||""),D=y[0],I=gv(e,D),T=ar((x==null?void 0:x.options)||{},(r==null?void 0:r.options)||{}),N=ar(T,(s==null?void 0:s.chartOptions)||{}),G={...N,plugins:{...N.plugins,datalabels:{...(b=N.plugins)==null?void 0:b.datalabels,formatter:(j,B)=>{var M,W,F,P;return Rr({number:Number(j),decimalPlaces:((M=s==null?void 0:s.numberAxisFormat)==null?void 0:M.decimalPlaces)||0,useSuffix:!!((W=s==null?void 0:s.numberAxisFormat)!=null&&W.suffix),customSuffix:"",locale:((F=s==null?void 0:s.numberAxisFormat)==null?void 0:F.locale)||"",currency:((P=s==null?void 0:s.numberAxisFormat)==null?void 0:P.currency)||""})}},tooltip:{...(v=N.plugins)==null?void 0:v.tooltip,callbacks:{label:function(j){var U,q,K,H;j.dataset.label;const M=j.dataset.data.reduce((V,Q)=>V+Q,0),W=j.parsed,F=Rr({number:Number(W),decimalPlaces:((U=s==null?void 0:s.numberAxisFormat)==null?void 0:U.decimalPlaces)||0,useSuffix:!!((q=s==null?void 0:s.numberAxisFormat)!=null&&q.suffix),customSuffix:"",locale:((K=s==null?void 0:s.numberAxisFormat)==null?void 0:K.locale)||"",currency:((H=s==null?void 0:s.numberAxisFormat)==null?void 0:H.currency)||""}),P=(W/M*100).toFixed(2);return F+` (${P}%)`}}}}},z=ar(N,G),O=ar(z,k);return{type:t,data:{labels:I,datasets:C},options:O,plugins:[t==="doughnut"?{id:"doughnutLabel",beforeDatasetsDraw:function(j,B,M){var Q,Z,ne,J;const{ctx:W,data:F}=j;W.save();const P=j.getDatasetMeta(0).data[0].x,U=j.getDatasetMeta(0).data[0].y,q=kl(Eu()),K=window.getComputedStyle(W.canvas).fontFamily;W.font=`1em ${K}`,W.fontWeight="bolder",W.fillStyle=q,W.textAlign="center",W.textBaseline="middle";const H=F.datasets[0].data.reduce((oe,ee)=>oe+ee,0),V=Rr({number:Number(H),decimalPlaces:((Q=s==null?void 0:s.numberAxisFormat)==null?void 0:Q.decimalPlaces)||0,useSuffix:!!((Z=s==null?void 0:s.numberAxisFormat)!=null&&Z.suffix),customSuffix:"",locale:((ne=s==null?void 0:s.numberAxisFormat)==null?void 0:ne.locale)||"",currency:((J=s==null?void 0:s.numberAxisFormat)==null?void 0:J.currency)||""});W.fillText(V,P,U)}}:"",...R]}}if(t==="radar"){const x=kK(n);return ls({data:e,cfg:x,customCfg:r,cardType:t,preferences:s})}if(t==="bubble"||t==="scatter"){const{metricKeys:x}=Xt(e),y=aB(e,t),_=Vc(y,r),w=OK(n,t,x),{options:C}=bv({cardType:t,cfg:w,preferences:s,customCfg:r});return{type:t,data:{datasets:_},options:C}}return ls({data:e,cfg:n,customCfg:r,cardType:t,preferences:s})}function DK({chart:e,elementIndex:t,datasetIndex:n,cardType:r,cfg:o,apply:i}){const s=se.getState().theme;if(!o)return;const a=s==="dark"?"rgb(238,238,238,0.2)":"rgb(238,238,238,0.8)";["bar","line","horizontalBar","bubble","scatter"].includes(r)&&IK(e,t,o,i,a),["pie","doughnut","polarArea"].includes(r)&&AK(e,t,o,i,a),["stackedBar","pyramid"].includes(r)&&TK({chart:e,elementIndex:t,datasetIndex:n,cfg:o,apply:i,blurColor:a})}function TK(e){var a,l,c,u;const{chart:t,elementIndex:n,datasetIndex:r,cfg:o,apply:i,blurColor:s}=e;i?(l=(a=t==null?void 0:t.data)==null?void 0:a.datasets)==null||l.forEach((d,h)=>{var f,p;typeof d.backgroundColor=="string"&&(d.backgroundColor=new Array(d.data.length).fill(d.backgroundColor),d.borderColor=new Array(d.data.length).fill(d.borderColor)),d.backgroundColor=(f=d==null?void 0:d.backgroundColor)==null?void 0:f.map((g,b)=>b===n&&h===r?g:s),d.borderColor=(p=d==null?void 0:d.borderColor)==null?void 0:p.map((g,b)=>b===n&&h===r?g:s)}):(u=(c=t==null?void 0:t.data)==null?void 0:c.datasets)==null||u.forEach((d,h)=>{var f,p,g,b,v,x;d.backgroundColor=new Array(d.data.length).fill((g=(p=(f=o==null?void 0:o.data)==null?void 0:f.datasets)==null?void 0:p[h])==null?void 0:g.backgroundColor),d.borderColor=new Array(d.data.length).fill((x=(v=(b=o==null?void 0:o.data)==null?void 0:b.datasets)==null?void 0:v[h])==null?void 0:x.borderColor)}),t==null||t.update()}function IK(e,t,n,r,o){var i,s,a,l;r?(s=(i=e==null?void 0:e.data)==null?void 0:i.datasets)==null||s.forEach(c=>{var u,d;typeof c.backgroundColor=="string"&&(c.backgroundColor=new Array(c.data.length).fill(c.backgroundColor),c.borderColor=new Array(c.data.length).fill(c.borderColor)),c.backgroundColor=(u=c==null?void 0:c.backgroundColor)==null?void 0:u.map((h,f)=>f===t?h:o),c.borderColor=(d=c==null?void 0:c.borderColor)==null?void 0:d.map((h,f)=>f===t?h:o)}):(l=(a=e==null?void 0:e.data)==null?void 0:a.datasets)==null||l.forEach((c,u)=>{var d,h,f,p,g,b;c.backgroundColor=new Array(c.data.length).fill((f=(h=(d=n==null?void 0:n.data)==null?void 0:d.datasets)==null?void 0:h[u])==null?void 0:f.backgroundColor),c.borderColor=new Array(c.data.length).fill((b=(g=(p=n==null?void 0:n.data)==null?void 0:p.datasets)==null?void 0:g[u])==null?void 0:b.borderColor)}),e==null||e.update()}function AK(e,t,n,r,o){var i,s,a,l;r?(s=(i=e==null?void 0:e.data)==null?void 0:i.datasets)==null||s.forEach(c=>{var u,d;c.backgroundColor=(u=c==null?void 0:c.backgroundColor)==null?void 0:u.map((h,f)=>f===t?h:o),c.borderColor=(d=c==null?void 0:c.borderColor)==null?void 0:d.map((h,f)=>f===t?h:o)}):(l=(a=e==null?void 0:e.data)==null?void 0:a.datasets)==null||l.forEach((c,u)=>{var d,h,f,p,g,b,v,x;typeof c.backgroundColor=="string"&&(c.backgroundColor=(f=(h=(d=n==null?void 0:n.data)==null?void 0:d.datasets)==null?void 0:h[u])==null?void 0:f.backgroundColor,c.borderColor=(b=(g=(p=n==null?void 0:n.data)==null?void 0:p.datasets)==null?void 0:g[u])==null?void 0:b.borderColor),c.backgroundColor=(v=c==null?void 0:c.backgroundColor)==null?void 0:v.map((y,_)=>{var w;return(w=n.data.datasets[u].backgroundColor)==null?void 0:w[_]}),c.borderColor=(x=c==null?void 0:c.borderColor)==null?void 0:x.map((y,_)=>{var w;return(w=n.data.datasets[u].borderColor)==null?void 0:w[_]})}),e==null||e.update()}function NK({card:e,data:t,datasetIndex:n,clickIndex:r,value:o}){var i,s,a,l,c,u;try{if(!t)return;const{keys:d,dimensionKeys:h,metricKeys:f}=Xt(t);if(e.type==="map"){const p=d[0],g=((s=(i=o==null?void 0:o.feature)==null?void 0:i.properties)==null?void 0:s.name)||((l=(a=o==null?void 0:o.feature)==null?void 0:a.properties)==null?void 0:l.NAME);return[{columnName:p,columnValue:g}]}if(["bar","horizontalBar","line","pie","doughnut","radar","polarArea"].includes(e.type)){const p=h[0],g=(c=t[r])==null?void 0:c[p];return[{columnName:p,columnValue:g,metric:f[n],value:o}]}if(["stackedBar","pyramid"].includes(e.type)){const p=Bh({dataArray:t,groupKey:h[0],pivotKey:h[1],valueKey:f[0]}),g=h[0],b=(u=p[r])==null?void 0:u[g],v=h[1],{metricKeys:x}=Xt(p),y=x[n];return[{columnName:g,columnValue:b,metric:f[0],value:o},{columnName:v,columnValue:y,metric:f[0],value:o}]}if(e.type==="bubble"||e.type==="scatter"){const p=h[0],g=o.label;return[{columnName:p,columnValue:g,metric1:f[0],value1:o.x,metric2:f[1],value2:o.y,metric3:f==null?void 0:f[2],value3:o==null?void 0:o.r}]}}catch(d){console.error("Error in getAdhocFilter",d)}}function jK(e,t){var r,o;if((((r=e.data.datasets)==null?void 0:r.filter(i=>!!i.fill))||[]).length>0){const i=(o=e==null?void 0:e.data.datasets)==null?void 0:o.map(a=>({...a,backgroundColor:[a.backgroundColor].map(l=>{const c=t.createLinearGradient(0,0,0,400);return c.addColorStop(0,l),c.addColorStop(.7,CB("--semaphor-background")),c})}));return{...e,data:{...e.data,datasets:i}}}return e}function lT(e){var a,l,c,u,d,h;const t=(((l=(a=e.preferences)==null?void 0:a.mapVisualOptions)==null?void 0:l.topoJsonUrl)==="custom"?(u=(c=e.preferences)==null?void 0:c.mapVisualOptions)==null?void 0:u.customTopoJsonUrl:(h=(d=e.preferences)==null?void 0:d.mapVisualOptions)==null?void 0:h.topoJsonUrl)||"",n=!!t&&e.type==="map",{data:r,isLoading:o,isFetching:i,isError:s}=hd({queryKey:["topojson",t],queryFn:()=>fetch(t).then(f=>f.json()),enabled:n,staleTime:1/0});return{data:r,isLoading:o,isFetching:i,isError:s}}function FK(e){var s,a;const[t]=E.useState({id:"",title:"",type:"bar"}),{getCard:n}=zt(),r=n(e),o=cT(r||t),i={...r,data:((s=o==null?void 0:o.data)==null?void 0:s.records)||[]};return{...o,data:((a=o==null?void 0:o.data)==null?void 0:a.records)||[],card:i}}function cT(e){var I;const{onChartElementClicked:t}=vr(),[n,r]=E.useState(0),o=se(T=>T.themeStyle),i=se(T=>T.filteringCards),s=se(T=>T.selectedSheetId),a=se(T=>T.selectedLensId),l=se(T=>T.filterValues),c=E.useRef(l),u=(I=e==null?void 0:e.preferences)==null?void 0:I.onClickFilter,{addFilteringCard:d,addOrUpdateFilterValues:h,removeFilterValues:f,removeFilteringCard:p}=zt(),{data:g,isLoading:b,isFetching:v,isError:x,queryKey:y,isFilteringCard:_,isSingleCardFrame:w}=oi(e),{data:C}=lT(e);let R;R=E.useMemo(()=>{if(!(!(g!=null&&g.records)||!(g!=null&&g.records.length)))return Aw({data:g==null?void 0:g.records,cardType:e.type,customCfg:e.customCfg,preferences:e.preferences,topoJson:C})},[g==null?void 0:g.records,e.type,e.customCfg,e.preferences,C,o]);const k=E.useRef({filteringCards:i});E.useEffect(()=>{e.connectionId&&!_&&(c.current=l)},[l,a,e.connectionId,_]),E.useEffect(()=>{var N;_&&(k.current.filteringCards=[...i||[]]),!_&&((N=k.current.filteringCards)==null?void 0:N.find(G=>G.id===e.id))&&w&&r(G=>G+1)},[_,w,e.id,i]);function D(T,N,G,z){var L;let O=!1;if(!(g!=null&&g.records))return;const A=NK({card:e,data:g==null?void 0:g.records,datasetIndex:N,clickIndex:G,value:z});if(console.log("fieldValues",A),t==null||t(e,A),!!(((L=e==null?void 0:e.preferences)==null?void 0:L.onClickFilter)??[]).length){if(_){const j=e.id;f(j),p(e)}else{if(O=!0,!A)return;const j=[];A.forEach((B,M)=>{const W=u==null?void 0:u.find(P=>P.columnIndex===M);if(!W)return;const F={filterId:e.id+"-"+B.columnName+"-"+s,connectionId:e==null?void 0:e.connectionId,tableName:e.lastSelectedTable,name:B.columnName,expression:W.expression,valueType:Up(A[W.columnIndex].columnValue),operation:"=",values:[A[W.columnIndex].columnValue]};j.push(F)}),h(j),d(e)}DK({chart:T,elementIndex:G,datasetIndex:N,cardType:e.type,cfg:R,apply:O})}}return{isError:x,isLoading:b,isFetching:v,data:g,visualKey:n,handleDatapointClick:D,cfg:R,queryKey:y}}function bo({children:e,containerClassName:t,className:n,text:r,onSave:o,type:i="input"}){const[s,a]=E.useState(!1),[l,c]=E.useState(r),u=se(f=>f.isDashboardEditing),d=f=>{f.stopPropagation(),u&&a(!0)};function h(){return i==="textarea"?m.jsx("textarea",{className:ie("grow rounded-sm bg-background px-2 py-1 text-sm outline-dashed outline-[0.5px] outline-primary/50",n),onChange:f=>c(f.target.value),value:l,autoFocus:!0,onBlur:()=>a(!1),onKeyDown:f=>{f.stopPropagation(),!(f.key==="Enter"&&f.shiftKey)&&(f.key==="Enter"||f.key==="Tab")&&(a(!1),o(l))}}):m.jsx("input",{onMouseDown:f=>f.stopPropagation(),type:"text",className:ie("rounded-sm bg-background px-2 py-1 text-sm outline-dashed outline-[0.5px] outline-primary/50",n),onChange:f=>c(f.target.value),value:l,autoFocus:!0,onBlur:()=>a(!1),onKeyDown:f=>{f.stopPropagation(),(f.key==="Enter"||f.key==="Tab")&&(a(!1),o(l))}})}return m.jsx("div",{className:ie("flex",t),role:"editable",onDoubleClick:d,children:s?h():e})}function uT(e){const{authToken:t}=vr(),n=C8(t==null?void 0:t.accessToken);function r(){var i,s,a,l,c,u;if((s=(i=e.preferences)==null?void 0:i.formatNumber)!=null&&s.currency&&((l=(a=e.preferences)==null?void 0:a.formatNumber)==null?void 0:l.currency)!=="none")return n!=null&&n.currency?n==null?void 0:n.currency:(u=(c=e.preferences)==null?void 0:c.formatNumber)==null?void 0:u.currency}function o(){var i,s,a,l,c,u;if((s=(i=e.preferences)==null?void 0:i.formatNumber)!=null&&s.locale&&((l=(a=e.preferences)==null?void 0:a.formatNumber)==null?void 0:l.locale)!=="none")return n!=null&&n.locale?n==null?void 0:n.locale:(u=(c=e.preferences)==null?void 0:c.formatNumber)==null?void 0:u.locale}return{getCurrency:r,getLocale:o}}function fp({card:e,data:t}){var x,y,_,w,C,R,k,D,I,T,N,G,z,O,A,L;const n=se(j=>j.actions.setCardTitle),r=se(j=>j.actions.setCardDescription),o=se(j=>j.isVisualEditing),i=Vn(j=>j.card),s=Vn(j=>j.actions.setCard);Vn(j=>j.actions.setNumberFormat);const{getCurrency:a,getLocale:l}=uT(e),c=se(j=>j.selectedSheetId),u=(y=(x=e.preferences)==null?void 0:x.formatNumber)==null?void 0:y.colorRanges,{metricKeys:d}=Xt(t),h=(_=t==null?void 0:t[0])==null?void 0:_[d==null?void 0:d[0]],f=(w=t==null?void 0:t[0])==null?void 0:w[d==null?void 0:d[1]],p=t&&t.length>0;function g(j){o?s({...i,title:j}):n(c,e.id,j)}function b(j){o?s({...i,description:j}):r(c,e.id,j)}const v=f&&f-h!==0?(h-f)/f:null;return m.jsxs("div",{className:"kpi-card flex grow flex-col overflow-auto",children:[m.jsxs(qp,{className:"grow pb-3",children:[m.jsx(bo,{text:o?i.title:e.title,onSave:g,children:m.jsx("div",{className:"flex items-center gap-2",children:m.jsx(Zl,{className:"text-base font-medium text-muted-foreground",children:e.title})})}),p&&m.jsxs("div",{className:"flex flex-wrap items-end gap-3 text-foreground",children:[m.jsx("p",{style:{color:rw(h,u)},className:"text-3xl font-semibold",children:Rr({number:h,decimalPlaces:((R=(C=e.preferences)==null?void 0:C.formatNumber)==null?void 0:R.decimalPlaces)||0,useSuffix:!!((D=(k=e.preferences)==null?void 0:k.formatNumber)!=null&&D.suffix),customSuffix:((T=(I=e.preferences)==null?void 0:I.formatNumber)==null?void 0:T.suffix)||"",locale:l()||"",currency:a()||""})}),f&&m.jsxs("span",{className:"min-w-fit text-base font-normal text-muted-foreground",children:["from  ",Rr({number:f,decimalPlaces:((G=(N=e.preferences)==null?void 0:N.formatNumber)==null?void 0:G.decimalPlaces)||0,useSuffix:!!((O=(z=e.preferences)==null?void 0:z.formatNumber)!=null&&O.suffix),customSuffix:((L=(A=e.preferences)==null?void 0:A.formatNumber)==null?void 0:L.suffix)||"",locale:l()||"",currency:a()||""})]})]})]}),v&&m.jsxs(Gp,{className:"grow items-start gap-1 pb-4 text-sm",children:[m.jsx(dT,{children:v}),m.jsxs("div",{className:"flex gap-1 text-muted-foreground",children:[v>0?"up ":"down ",m.jsx(bo,{text:e.description||"",onSave:b,children:e.description})]})]})]})}function dT({children:e,className:t}){var i,s;const n=se(a=>a.themeStyle),r=e>0?m.jsx("span",{children:"+"}):m.jsx("span",{children:"-"}),o=`${Math.abs(e*100).toFixed(0)}%`;return m.jsxs("div",{style:{borderRadius:(s=(i=n==null?void 0:n.chart)==null?void 0:i.options)==null?void 0:s.borderRadius},className:ie("flex items-center px-1 text-sm font-semibold",{"bg-green-600/10 text-green-600":e>0,"bg-destructive/10 text-destructive":e<0},t),children:[r,m.jsx("span",{className:"ml-[1px]",children:o})]})}const LK=["top","right","bottom","left"],si=Math.min,pn=Math.max,Bu=Math.round,Lf=Math.floor,vo=e=>({x:e,y:e}),$K={left:"right",right:"left",bottom:"top",top:"bottom"},zK={start:"end",end:"start"};function Kv(e,t,n){return pn(e,si(t,n))}function So(e,t){return typeof e=="function"?e(t):e}function ai(e){return e.split("-")[0]}function sc(e){return e.split("-")[1]}function Nw(e){return e==="x"?"y":"x"}function jw(e){return e==="y"?"height":"width"}function Wi(e){return["top","bottom"].includes(ai(e))?"y":"x"}function Fw(e){return Nw(Wi(e))}function BK(e,t,n){n===void 0&&(n=!1);const r=sc(e),o=Fw(e),i=jw(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=hp(s)),[s,hp(s)]}function VK(e){const t=hp(e);return[Xv(e),t,Xv(t)]}function Xv(e){return e.replace(/start|end/g,t=>zK[t])}function HK(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:s;default:return[]}}function WK(e,t,n,r){const o=sc(e);let i=HK(ai(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(Xv)))),i}function hp(e){return e.replace(/left|right|bottom|top/g,t=>$K[t])}function UK(e){return{top:0,right:0,bottom:0,left:0,...e}}function fT(e){return typeof e!="number"?UK(e):{top:e,right:e,bottom:e,left:e}}function pp(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function fR(e,t,n){let{reference:r,floating:o}=e;const i=Wi(t),s=Fw(t),a=jw(s),l=ai(t),c=i==="y",u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,h=r[a]/2-o[a]/2;let f;switch(l){case"top":f={x:u,y:r.y-o.height};break;case"bottom":f={x:u,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:d};break;case"left":f={x:r.x-o.width,y:d};break;default:f={x:r.x,y:r.y}}switch(sc(t)){case"start":f[s]-=h*(n&&c?-1:1);break;case"end":f[s]+=h*(n&&c?-1:1);break}return f}const qK=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=fR(c,r,l),h=r,f={},p=0;for(let g=0;g<a.length;g++){const{name:b,fn:v}=a[g],{x,y,data:_,reset:w}=await v({x:u,y:d,initialPlacement:r,placement:h,strategy:o,middlewareData:f,rects:c,platform:s,elements:{reference:e,floating:t}});u=x??u,d=y??d,f={...f,[b]:{...f[b],..._}},w&&p<=50&&(p++,typeof w=="object"&&(w.placement&&(h=w.placement),w.rects&&(c=w.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):w.rects),{x:u,y:d}=fR(c,h,l)),g=-1)}return{x:u,y:d,placement:h,strategy:o,middlewareData:f}};async function Hl(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:h=!1,padding:f=0}=So(t,e),p=fT(f),b=a[h?d==="floating"?"reference":"floating":d],v=pp(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(b)))==null||n?b:b.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),x=d==="floating"?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,y=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),_=await(i.isElement==null?void 0:i.isElement(y))?await(i.getScale==null?void 0:i.getScale(y))||{x:1,y:1}:{x:1,y:1},w=pp(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:x,offsetParent:y,strategy:l}):x);return{top:(v.top-w.top+p.top)/_.y,bottom:(w.bottom-v.bottom+p.bottom)/_.y,left:(v.left-w.left+p.left)/_.x,right:(w.right-v.right+p.right)/_.x}}const GK=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:c,padding:u=0}=So(e,t)||{};if(c==null)return{};const d=fT(u),h={x:n,y:r},f=Fw(o),p=jw(f),g=await s.getDimensions(c),b=f==="y",v=b?"top":"left",x=b?"bottom":"right",y=b?"clientHeight":"clientWidth",_=i.reference[p]+i.reference[f]-h[f]-i.floating[p],w=h[f]-i.reference[f],C=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let R=C?C[y]:0;(!R||!await(s.isElement==null?void 0:s.isElement(C)))&&(R=a.floating[y]||i.floating[p]);const k=_/2-w/2,D=R/2-g[p]/2-1,I=si(d[v],D),T=si(d[x],D),N=I,G=R-g[p]-T,z=R/2-g[p]/2+k,O=Kv(N,z,G),A=!l.arrow&&sc(o)!=null&&z!==O&&i.reference[p]/2-(z<N?I:T)-g[p]/2<0,L=A?z<N?z-N:z-G:0;return{[f]:h[f]+L,data:{[f]:O,centerOffset:z-O-L,...A&&{alignmentOffset:L}},reset:A}}}),YK=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:g=!0,...b}=So(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const v=ai(o),x=Wi(a),y=ai(a)===a,_=await(l.isRTL==null?void 0:l.isRTL(c.floating)),w=h||(y||!g?[hp(a)]:VK(a)),C=p!=="none";!h&&C&&w.push(...WK(a,g,p,_));const R=[a,...w],k=await Hl(t,b),D=[];let I=((r=i.flip)==null?void 0:r.overflows)||[];if(u&&D.push(k[v]),d){const z=BK(o,s,_);D.push(k[z[0]],k[z[1]])}if(I=[...I,{placement:o,overflows:D}],!D.every(z=>z<=0)){var T,N;const z=(((T=i.flip)==null?void 0:T.index)||0)+1,O=R[z];if(O)return{data:{index:z,overflows:I},reset:{placement:O}};let A=(N=I.filter(L=>L.overflows[0]<=0).sort((L,j)=>L.overflows[1]-j.overflows[1])[0])==null?void 0:N.placement;if(!A)switch(f){case"bestFit":{var G;const L=(G=I.filter(j=>{if(C){const B=Wi(j.placement);return B===x||B==="y"}return!0}).map(j=>[j.placement,j.overflows.filter(B=>B>0).reduce((B,M)=>B+M,0)]).sort((j,B)=>j[1]-B[1])[0])==null?void 0:G[0];L&&(A=L);break}case"initialPlacement":A=a;break}if(o!==A)return{reset:{placement:A}}}return{}}}};function hR(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function pR(e){return LK.some(t=>e[t]>=0)}const KK=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=So(e,t);switch(r){case"referenceHidden":{const i=await Hl(t,{...o,elementContext:"reference"}),s=hR(i,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:pR(s)}}}case"escaped":{const i=await Hl(t,{...o,altBoundary:!0}),s=hR(i,n.floating);return{data:{escapedOffsets:s,escaped:pR(s)}}}default:return{}}}}};async function XK(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=ai(n),a=sc(n),l=Wi(n)==="y",c=["left","top"].includes(s)?-1:1,u=i&&l?-1:1,d=So(t,e);let{mainAxis:h,crossAxis:f,alignmentAxis:p}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof p=="number"&&(f=a==="end"?p*-1:p),l?{x:f*u,y:h*c}:{x:h*c,y:f*u}}const QK=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:a}=t,l=await XK(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:s}}}}},JK=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:a={fn:b=>{let{x:v,y:x}=b;return{x:v,y:x}}},...l}=So(e,t),c={x:n,y:r},u=await Hl(t,l),d=Wi(ai(o)),h=Nw(d);let f=c[h],p=c[d];if(i){const b=h==="y"?"top":"left",v=h==="y"?"bottom":"right",x=f+u[b],y=f-u[v];f=Kv(x,f,y)}if(s){const b=d==="y"?"top":"left",v=d==="y"?"bottom":"right",x=p+u[b],y=p-u[v];p=Kv(x,p,y)}const g=a.fn({...t,[h]:f,[d]:p});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[h]:i,[d]:s}}}}}},ZK=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:s}=t,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=So(e,t),u={x:n,y:r},d=Wi(o),h=Nw(d);let f=u[h],p=u[d];const g=So(a,t),b=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(l){const y=h==="y"?"height":"width",_=i.reference[h]-i.floating[y]+b.mainAxis,w=i.reference[h]+i.reference[y]-b.mainAxis;f<_?f=_:f>w&&(f=w)}if(c){var v,x;const y=h==="y"?"width":"height",_=["top","left"].includes(ai(o)),w=i.reference[d]-i.floating[y]+(_&&((v=s.offset)==null?void 0:v[d])||0)+(_?0:b.crossAxis),C=i.reference[d]+i.reference[y]+(_?0:((x=s.offset)==null?void 0:x[d])||0)-(_?b.crossAxis:0);p<w?p=w:p>C&&(p=C)}return{[h]:f,[d]:p}}}},eX=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:s,elements:a}=t,{apply:l=()=>{},...c}=So(e,t),u=await Hl(t,c),d=ai(o),h=sc(o),f=Wi(o)==="y",{width:p,height:g}=i.floating;let b,v;d==="top"||d==="bottom"?(b=d,v=h===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(v=d,b=h==="end"?"top":"bottom");const x=g-u.top-u.bottom,y=p-u.left-u.right,_=si(g-u[b],x),w=si(p-u[v],y),C=!t.middlewareData.shift;let R=_,k=w;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(k=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(R=x),C&&!h){const I=pn(u.left,0),T=pn(u.right,0),N=pn(u.top,0),G=pn(u.bottom,0);f?k=p-2*(I!==0||T!==0?I+T:pn(u.left,u.right)):R=g-2*(N!==0||G!==0?N+G:pn(u.top,u.bottom))}await l({...t,availableWidth:k,availableHeight:R});const D=await s.getDimensions(a.floating);return p!==D.width||g!==D.height?{reset:{rects:!0}}:{}}}};function Sg(){return typeof window<"u"}function ac(e){return hT(e)?(e.nodeName||"").toLowerCase():"#document"}function hr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Do(e){var t;return(t=(hT(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function hT(e){return Sg()?e instanceof Node||e instanceof hr(e).Node:!1}function vn(e){return Sg()?e instanceof Element||e instanceof hr(e).Element:!1}function Co(e){return Sg()?e instanceof HTMLElement||e instanceof hr(e).HTMLElement:!1}function gR(e){return!Sg()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof hr(e).ShadowRoot}function Sd(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Ur(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function tX(e){return["table","td","th"].includes(ac(e))}function Cg(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Lw(e){const t=$w(),n=vn(e)?Ur(e):e;return["transform","translate","scale","rotate","perspective"].some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function nX(e){let t=Ui(e);for(;Co(t)&&!Wl(t);){if(Lw(t))return t;if(Cg(t))return null;t=Ui(t)}return null}function $w(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Wl(e){return["html","body","#document"].includes(ac(e))}function Ur(e){return hr(e).getComputedStyle(e)}function _g(e){return vn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ui(e){if(ac(e)==="html")return e;const t=e.assignedSlot||e.parentNode||gR(e)&&e.host||Do(e);return gR(t)?t.host:t}function pT(e){const t=Ui(e);return Wl(t)?e.ownerDocument?e.ownerDocument.body:e.body:Co(t)&&Sd(t)?t:pT(t)}function Vu(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=pT(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=hr(o);if(i){const a=Qv(s);return t.concat(s,s.visualViewport||[],Sd(o)?o:[],a&&n?Vu(a):[])}return t.concat(o,Vu(o,[],n))}function Qv(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function gT(e){const t=Ur(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Co(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=Bu(n)!==i||Bu(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function zw(e){return vn(e)?e:e.contextElement}function il(e){const t=zw(e);if(!Co(t))return vo(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=gT(t);let s=(i?Bu(n.width):n.width)/r,a=(i?Bu(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const rX=vo(0);function mT(e){const t=hr(e);return!$w()||!t.visualViewport?rX:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function oX(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==hr(e)?!1:t}function aa(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=zw(e);let s=vo(1);t&&(r?vn(r)&&(s=il(r)):s=il(e));const a=oX(i,n,r)?mT(i):vo(0);let l=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,u=o.width/s.x,d=o.height/s.y;if(i){const h=hr(i),f=r&&vn(r)?hr(r):r;let p=h,g=Qv(p);for(;g&&r&&f!==p;){const b=il(g),v=g.getBoundingClientRect(),x=Ur(g),y=v.left+(g.clientLeft+parseFloat(x.paddingLeft))*b.x,_=v.top+(g.clientTop+parseFloat(x.paddingTop))*b.y;l*=b.x,c*=b.y,u*=b.x,d*=b.y,l+=y,c+=_,p=hr(g),g=Qv(p)}}return pp({width:u,height:d,x:l,y:c})}function Bw(e,t){const n=_g(e).scrollLeft;return t?t.left+n:aa(Do(e)).left+n}function bT(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-(n?0:Bw(e,r)),i=r.top+t.scrollTop;return{x:o,y:i}}function iX(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",s=Do(r),a=t?Cg(t.floating):!1;if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=vo(1);const u=vo(0),d=Co(r);if((d||!d&&!i)&&((ac(r)!=="body"||Sd(s))&&(l=_g(r)),Co(r))){const f=aa(r);c=il(r),u.x=f.x+r.clientLeft,u.y=f.y+r.clientTop}const h=s&&!d&&!i?bT(s,l,!0):vo(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+h.x,y:n.y*c.y-l.scrollTop*c.y+u.y+h.y}}function sX(e){return Array.from(e.getClientRects())}function aX(e){const t=Do(e),n=_g(e),r=e.ownerDocument.body,o=pn(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=pn(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+Bw(e);const a=-n.scrollTop;return Ur(r).direction==="rtl"&&(s+=pn(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}function lX(e,t){const n=hr(e),r=Do(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const c=$w();(!c||c&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a,y:l}}function cX(e,t){const n=aa(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Co(e)?il(e):vo(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,l=o*i.x,c=r*i.y;return{width:s,height:a,x:l,y:c}}function mR(e,t,n){let r;if(t==="viewport")r=lX(e,n);else if(t==="document")r=aX(Do(e));else if(vn(t))r=cX(t,n);else{const o=mT(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return pp(r)}function vT(e,t){const n=Ui(e);return n===t||!vn(n)||Wl(n)?!1:Ur(n).position==="fixed"||vT(n,t)}function uX(e,t){const n=t.get(e);if(n)return n;let r=Vu(e,[],!1).filter(a=>vn(a)&&ac(a)!=="body"),o=null;const i=Ur(e).position==="fixed";let s=i?Ui(e):e;for(;vn(s)&&!Wl(s);){const a=Ur(s),l=Lw(s);!l&&a.position==="fixed"&&(o=null),(i?!l&&!o:!l&&a.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||Sd(s)&&!l&&vT(e,s))?r=r.filter(u=>u!==s):o=a,s=Ui(s)}return t.set(e,r),r}function dX(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?Cg(t)?[]:uX(t,this._c):[].concat(n),r],a=s[0],l=s.reduce((c,u)=>{const d=mR(t,u,o);return c.top=pn(d.top,c.top),c.right=si(d.right,c.right),c.bottom=si(d.bottom,c.bottom),c.left=pn(d.left,c.left),c},mR(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function fX(e){const{width:t,height:n}=gT(e);return{width:t,height:n}}function hX(e,t,n){const r=Co(t),o=Do(t),i=n==="fixed",s=aa(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=vo(0);if(r||!r&&!i)if((ac(t)!=="body"||Sd(o))&&(a=_g(t)),r){const h=aa(t,!0,i,t);l.x=h.x+t.clientLeft,l.y=h.y+t.clientTop}else o&&(l.x=Bw(o));const c=o&&!r&&!i?bT(o,a):vo(0),u=s.left+a.scrollLeft-l.x-c.x,d=s.top+a.scrollTop-l.y-c.y;return{x:u,y:d,width:s.width,height:s.height}}function Sb(e){return Ur(e).position==="static"}function bR(e,t){if(!Co(e)||Ur(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Do(e)===n&&(n=n.ownerDocument.body),n}function yT(e,t){const n=hr(e);if(Cg(e))return n;if(!Co(e)){let o=Ui(e);for(;o&&!Wl(o);){if(vn(o)&&!Sb(o))return o;o=Ui(o)}return n}let r=bR(e,t);for(;r&&tX(r)&&Sb(r);)r=bR(r,t);return r&&Wl(r)&&Sb(r)&&!Lw(r)?n:r||nX(e)||n}const pX=async function(e){const t=this.getOffsetParent||yT,n=this.getDimensions,r=await n(e.floating);return{reference:hX(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function gX(e){return Ur(e).direction==="rtl"}const mX={convertOffsetParentRelativeRectToViewportRelativeRect:iX,getDocumentElement:Do,getClippingRect:dX,getOffsetParent:yT,getElementRects:pX,getClientRects:sX,getDimensions:fX,getScale:il,isElement:vn,isRTL:gX};function xT(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function bX(e,t){let n=null,r;const o=Do(e);function i(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),i();const c=e.getBoundingClientRect(),{left:u,top:d,width:h,height:f}=c;if(a||t(),!h||!f)return;const p=Lf(d),g=Lf(o.clientWidth-(u+h)),b=Lf(o.clientHeight-(d+f)),v=Lf(u),y={rootMargin:-p+"px "+-g+"px "+-b+"px "+-v+"px",threshold:pn(0,si(1,l))||1};let _=!0;function w(C){const R=C[0].intersectionRatio;if(R!==l){if(!_)return s();R?s(!1,R):r=setTimeout(()=>{s(!1,1e-7)},1e3)}R===1&&!xT(c,e.getBoundingClientRect())&&s(),_=!1}try{n=new IntersectionObserver(w,{...y,root:o.ownerDocument})}catch{n=new IntersectionObserver(w,y)}n.observe(e)}return s(!0),i}function wT(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=zw(e),u=o||i?[...c?Vu(c):[],...Vu(t)]:[];u.forEach(v=>{o&&v.addEventListener("scroll",n,{passive:!0}),i&&v.addEventListener("resize",n)});const d=c&&a?bX(c,n):null;let h=-1,f=null;s&&(f=new ResizeObserver(v=>{let[x]=v;x&&x.target===c&&f&&(f.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var y;(y=f)==null||y.observe(t)})),n()}),c&&!l&&f.observe(c),f.observe(t));let p,g=l?aa(e):null;l&&b();function b(){const v=aa(e);g&&!xT(g,v)&&n(),g=v,p=requestAnimationFrame(b)}return n(),()=>{var v;u.forEach(x=>{o&&x.removeEventListener("scroll",n),i&&x.removeEventListener("resize",n)}),d==null||d(),(v=f)==null||v.disconnect(),f=null,l&&cancelAnimationFrame(p)}}const Cb=Hl,vX=QK,yX=JK,xX=YK,wX=eX,SX=KK,vR=GK,CX=ZK,_X=(e,t,n)=>{const r=new Map,o={platform:mX,...n},i={...o.platform,_c:r};return qK(e,t,{...o,platform:i})};var wh=typeof document<"u"?E.useLayoutEffect:E.useEffect;function gp(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!gp(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!gp(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function ST(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function yR(e,t){const n=ST(e);return Math.round(t*n)/n}function _b(e){const t=S.useRef(e);return wh(()=>{t.current=e}),t}function CT(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:s}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[u,d]=S.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,f]=S.useState(r);gp(h,r)||f(r);const[p,g]=S.useState(null),[b,v]=S.useState(null),x=S.useCallback(j=>{j!==C.current&&(C.current=j,g(j))},[]),y=S.useCallback(j=>{j!==R.current&&(R.current=j,v(j))},[]),_=i||p,w=s||b,C=S.useRef(null),R=S.useRef(null),k=S.useRef(u),D=l!=null,I=_b(l),T=_b(o),N=_b(c),G=S.useCallback(()=>{if(!C.current||!R.current)return;const j={placement:t,strategy:n,middleware:h};T.current&&(j.platform=T.current),_X(C.current,R.current,j).then(B=>{const M={...B,isPositioned:N.current!==!1};z.current&&!gp(k.current,M)&&(k.current=M,Js.flushSync(()=>{d(M)}))})},[h,t,n,T,N]);wh(()=>{c===!1&&k.current.isPositioned&&(k.current.isPositioned=!1,d(j=>({...j,isPositioned:!1})))},[c]);const z=S.useRef(!1);wh(()=>(z.current=!0,()=>{z.current=!1}),[]),wh(()=>{if(_&&(C.current=_),w&&(R.current=w),_&&w){if(I.current)return I.current(_,w,G);G()}},[_,w,G,I,D]);const O=S.useMemo(()=>({reference:C,floating:R,setReference:x,setFloating:y}),[x,y]),A=S.useMemo(()=>({reference:_,floating:w}),[_,w]),L=S.useMemo(()=>{const j={position:n,left:0,top:0};if(!A.floating)return j;const B=yR(A.floating,u.x),M=yR(A.floating,u.y);return a?{...j,transform:"translate("+B+"px, "+M+"px)",...ST(A.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:B,top:M}},[n,a,A.floating,u.x,u.y]);return S.useMemo(()=>({...u,update:G,refs:O,elements:A,floatingStyles:L}),[u,G,O,A,L])}const EX=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?vR({element:r.current,padding:o}).fn(n):{}:r?vR({element:r,padding:o}).fn(n):{}}}},Vw=(e,t)=>({...vX(e),options:[e,t]}),_T=(e,t)=>({...yX(e),options:[e,t]}),RX=(e,t)=>({...CX(e),options:[e,t]}),ET=(e,t)=>({...xX(e),options:[e,t]}),RT=(e,t)=>({...wX(e),options:[e,t]}),PX=(e,t)=>({...SX(e),options:[e,t]}),MX=(e,t)=>({...EX(e),options:[e,t]});var kX="Arrow",PT=S.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...i}=e;return m.jsx(pe.svg,{...i,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:m.jsx("polygon",{points:"0,0 30,0 15,10"})})});PT.displayName=kX;var OX=PT;function Eg(e){const[t,n]=S.useState(void 0);return rn(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let s,a;if("borderBoxSize"in i){const l=i.borderBoxSize,c=Array.isArray(l)?l[0]:l;s=c.inlineSize,a=c.blockSize}else s=e.offsetWidth,a=e.offsetHeight;n({width:s,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var Hw="Popper",[MT,To]=Kt(Hw),[DX,kT]=MT(Hw),OT=e=>{const{__scopePopper:t,children:n}=e,[r,o]=S.useState(null);return m.jsx(DX,{scope:t,anchor:r,onAnchorChange:o,children:n})};OT.displayName=Hw;var DT="PopperAnchor",TT=S.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=kT(DT,n),s=S.useRef(null),a=Oe(t,s);return S.useEffect(()=>{i.onAnchorChange((r==null?void 0:r.current)||s.current)}),r?null:m.jsx(pe.div,{...o,ref:a})});TT.displayName=DT;var Ww="PopperContent",[TX,IX]=MT(Ww),IT=S.forwardRef((e,t)=>{var H,V,Q,Z,ne,J;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:i="center",alignOffset:s=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:c=[],collisionPadding:u=0,sticky:d="partial",hideWhenDetached:h=!1,updatePositionStrategy:f="optimized",onPlaced:p,...g}=e,b=kT(Ww,n),[v,x]=S.useState(null),y=Oe(t,oe=>x(oe)),[_,w]=S.useState(null),C=Eg(_),R=(C==null?void 0:C.width)??0,k=(C==null?void 0:C.height)??0,D=r+(i!=="center"?"-"+i:""),I=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},T=Array.isArray(c)?c:[c],N=T.length>0,G={padding:I,boundary:T.filter(NX),altBoundary:N},{refs:z,floatingStyles:O,placement:A,isPositioned:L,middlewareData:j}=CT({strategy:"fixed",placement:D,whileElementsMounted:(...oe)=>wT(...oe,{animationFrame:f==="always"}),elements:{reference:b.anchor},middleware:[Vw({mainAxis:o+k,alignmentAxis:s}),l&&_T({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?RX():void 0,...G}),l&&ET({...G}),RT({...G,apply:({elements:oe,rects:ee,availableWidth:ue,availableHeight:de})=>{const{width:ye,height:he}=ee.reference,me=oe.floating.style;me.setProperty("--radix-popper-available-width",`${ue}px`),me.setProperty("--radix-popper-available-height",`${de}px`),me.setProperty("--radix-popper-anchor-width",`${ye}px`),me.setProperty("--radix-popper-anchor-height",`${he}px`)}}),_&&MX({element:_,padding:a}),jX({arrowWidth:R,arrowHeight:k}),h&&PX({strategy:"referenceHidden",...G})]}),[B,M]=jT(A),W=Gt(p);rn(()=>{L&&(W==null||W())},[L,W]);const F=(H=j.arrow)==null?void 0:H.x,P=(V=j.arrow)==null?void 0:V.y,U=((Q=j.arrow)==null?void 0:Q.centerOffset)!==0,[q,K]=S.useState();return rn(()=>{v&&K(window.getComputedStyle(v).zIndex)},[v]),m.jsx("div",{ref:z.setFloating,"data-radix-popper-content-wrapper":"",style:{...O,transform:L?O.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:q,"--radix-popper-transform-origin":[(Z=j.transformOrigin)==null?void 0:Z.x,(ne=j.transformOrigin)==null?void 0:ne.y].join(" "),...((J=j.hide)==null?void 0:J.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:m.jsx(TX,{scope:n,placedSide:B,onArrowChange:w,arrowX:F,arrowY:P,shouldHideArrow:U,children:m.jsx(pe.div,{"data-side":B,"data-align":M,...g,ref:y,style:{...g.style,animation:L?void 0:"none"}})})})});IT.displayName=Ww;var AT="PopperArrow",AX={top:"bottom",right:"left",bottom:"top",left:"right"},NT=S.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,i=IX(AT,r),s=AX[i.placedSide];return m.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:m.jsx(OX,{...o,ref:n,style:{...o.style,display:"block"}})})});NT.displayName=AT;function NX(e){return e!==null}var jX=e=>({name:"transformOrigin",options:e,fn(t){var b,v,x;const{placement:n,rects:r,middlewareData:o}=t,s=((b=o.arrow)==null?void 0:b.centerOffset)!==0,a=s?0:e.arrowWidth,l=s?0:e.arrowHeight,[c,u]=jT(n),d={start:"0%",center:"50%",end:"100%"}[u],h=(((v=o.arrow)==null?void 0:v.x)??0)+a/2,f=(((x=o.arrow)==null?void 0:x.y)??0)+l/2;let p="",g="";return c==="bottom"?(p=s?d:`${h}px`,g=`${-l}px`):c==="top"?(p=s?d:`${h}px`,g=`${r.floating.height+l}px`):c==="right"?(p=`${-l}px`,g=s?d:`${f}px`):c==="left"&&(p=`${r.floating.width+l}px`,g=s?d:`${f}px`),{data:{x:p,y:g}}}});function jT(e){const[t,n="center"]=e.split("-");return[t,n]}var Cd=OT,lc=TT,_d=IT,Ed=NT,FX="Portal",Rd=S.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[o,i]=S.useState(!1);rn(()=>i(!0),[]);const s=n||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return s?gn.createPortal(m.jsx(pe.div,{...r,ref:t}),s):null});Rd.displayName=FX;function LX(e,t=globalThis==null?void 0:globalThis.document){const n=Gt(e);S.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var $X="DismissableLayer",Jv="dismissableLayer.update",zX="dismissableLayer.pointerDownOutside",BX="dismissableLayer.focusOutside",xR,FT=S.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),wa=S.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,onDismiss:a,...l}=e,c=S.useContext(FT),[u,d]=S.useState(null),h=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,f]=S.useState({}),p=Oe(t,R=>d(R)),g=Array.from(c.layers),[b]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),v=g.indexOf(b),x=u?g.indexOf(u):-1,y=c.layersWithOutsidePointerEventsDisabled.size>0,_=x>=v,w=WX(R=>{const k=R.target,D=[...c.branches].some(I=>I.contains(k));!_||D||(o==null||o(R),s==null||s(R),R.defaultPrevented||a==null||a())},h),C=UX(R=>{const k=R.target;[...c.branches].some(I=>I.contains(k))||(i==null||i(R),s==null||s(R),R.defaultPrevented||a==null||a())},h);return LX(R=>{x===c.layers.size-1&&(r==null||r(R),!R.defaultPrevented&&a&&(R.preventDefault(),a()))},h),S.useEffect(()=>{if(u)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(xR=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),wR(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=xR)}},[u,h,n,c]),S.useEffect(()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),wR())},[u,c]),S.useEffect(()=>{const R=()=>f({});return document.addEventListener(Jv,R),()=>document.removeEventListener(Jv,R)},[]),m.jsx(pe.div,{...l,ref:p,style:{pointerEvents:y?_?"auto":"none":void 0,...e.style},onFocusCapture:ae(e.onFocusCapture,C.onFocusCapture),onBlurCapture:ae(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:ae(e.onPointerDownCapture,w.onPointerDownCapture)})});wa.displayName=$X;var VX="DismissableLayerBranch",HX=S.forwardRef((e,t)=>{const n=S.useContext(FT),r=S.useRef(null),o=Oe(t,r);return S.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),m.jsx(pe.div,{...e,ref:o})});HX.displayName=VX;function WX(e,t=globalThis==null?void 0:globalThis.document){const n=Gt(e),r=S.useRef(!1),o=S.useRef(()=>{});return S.useEffect(()=>{const i=a=>{if(a.target&&!r.current){let l=function(){LT(zX,n,c,{discrete:!0})};const c={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=l,t.addEventListener("click",o.current,{once:!0})):l()}else t.removeEventListener("click",o.current);r.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function UX(e,t=globalThis==null?void 0:globalThis.document){const n=Gt(e),r=S.useRef(!1);return S.useEffect(()=>{const o=i=>{i.target&&!r.current&&LT(BX,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function wR(){const e=new CustomEvent(Jv);document.dispatchEvent(e)}function LT(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?FM(o,i):o.dispatchEvent(i)}var Eb,Uw="HoverCard",[$T,lve]=Kt(Uw,[To]),Rg=To(),[qX,qw]=$T(Uw),zT=e=>{const{__scopeHoverCard:t,children:n,open:r,defaultOpen:o,onOpenChange:i,openDelay:s=700,closeDelay:a=300}=e,l=Rg(t),c=S.useRef(0),u=S.useRef(0),d=S.useRef(!1),h=S.useRef(!1),[f=!1,p]=yn({prop:r,defaultProp:o,onChange:i}),g=S.useCallback(()=>{clearTimeout(u.current),c.current=window.setTimeout(()=>p(!0),s)},[s,p]),b=S.useCallback(()=>{clearTimeout(c.current),!d.current&&!h.current&&(u.current=window.setTimeout(()=>p(!1),a))},[a,p]),v=S.useCallback(()=>p(!1),[p]);return S.useEffect(()=>()=>{clearTimeout(c.current),clearTimeout(u.current)},[]),m.jsx(qX,{scope:t,open:f,onOpenChange:p,onOpen:g,onClose:b,onDismiss:v,hasSelectionRef:d,isPointerDownOnContentRef:h,children:m.jsx(Cd,{...l,children:n})})};zT.displayName=Uw;var BT="HoverCardTrigger",VT=S.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,o=qw(BT,n),i=Rg(n);return m.jsx(lc,{asChild:!0,...i,children:m.jsx(pe.a,{"data-state":o.open?"open":"closed",...r,ref:t,onPointerEnter:ae(e.onPointerEnter,bp(o.onOpen)),onPointerLeave:ae(e.onPointerLeave,bp(o.onClose)),onFocus:ae(e.onFocus,o.onOpen),onBlur:ae(e.onBlur,o.onClose),onTouchStart:ae(e.onTouchStart,s=>s.preventDefault())})})});VT.displayName=BT;var GX="HoverCardPortal",[cve,YX]=$T(GX,{forceMount:void 0}),mp="HoverCardContent",HT=S.forwardRef((e,t)=>{const n=YX(mp,e.__scopeHoverCard),{forceMount:r=n.forceMount,...o}=e,i=qw(mp,e.__scopeHoverCard);return m.jsx(qt,{present:r||i.open,children:m.jsx(KX,{"data-state":i.open?"open":"closed",...o,onPointerEnter:ae(e.onPointerEnter,bp(i.onOpen)),onPointerLeave:ae(e.onPointerLeave,bp(i.onClose)),ref:t})})});HT.displayName=mp;var KX=S.forwardRef((e,t)=>{const{__scopeHoverCard:n,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,...a}=e,l=qw(mp,n),c=Rg(n),u=S.useRef(null),d=Oe(t,u),[h,f]=S.useState(!1);return S.useEffect(()=>{if(h){const p=document.body;return Eb=p.style.userSelect||p.style.webkitUserSelect,p.style.userSelect="none",p.style.webkitUserSelect="none",()=>{p.style.userSelect=Eb,p.style.webkitUserSelect=Eb}}},[h]),S.useEffect(()=>{if(u.current){const p=()=>{f(!1),l.isPointerDownOnContentRef.current=!1,setTimeout(()=>{var b;((b=document.getSelection())==null?void 0:b.toString())!==""&&(l.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",p),()=>{document.removeEventListener("pointerup",p),l.hasSelectionRef.current=!1,l.isPointerDownOnContentRef.current=!1}}},[l.isPointerDownOnContentRef,l.hasSelectionRef]),S.useEffect(()=>{u.current&&JX(u.current).forEach(g=>g.setAttribute("tabindex","-1"))}),m.jsx(wa,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:s,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:ae(i,p=>{p.preventDefault()}),onDismiss:l.onDismiss,children:m.jsx(_d,{...c,...a,onPointerDown:ae(a.onPointerDown,p=>{p.currentTarget.contains(p.target)&&f(!0),l.hasSelectionRef.current=!1,l.isPointerDownOnContentRef.current=!0}),ref:d,style:{...a.style,userSelect:h?"text":void 0,WebkitUserSelect:h?"text":void 0,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-hover-card-content-available-width":"var(--radix-popper-available-width)","--radix-hover-card-content-available-height":"var(--radix-popper-available-height)","--radix-hover-card-trigger-width":"var(--radix-popper-anchor-width)","--radix-hover-card-trigger-height":"var(--radix-popper-anchor-height)"}})})}),XX="HoverCardArrow",QX=S.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,o=Rg(n);return m.jsx(Ed,{...o,...r,ref:t})});QX.displayName=XX;function bp(e){return t=>t.pointerType==="touch"?void 0:e()}function JX(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;n.nextNode();)t.push(n.currentNode);return t}var ZX=zT,eQ=VT,WT=HT;const Pg=ZX,Mg=eQ,Pd=S.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},o)=>m.jsx(WT,{ref:o,align:t,sideOffset:n,className:ie("z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r}));Pd.displayName=WT.displayName;function UT({card:e}){const{setCardInfo:t}=zt();return m.jsxs(Pg,{openDelay:0,children:[m.jsx(Mg,{children:m.jsx(nO,{className:"size-4 text-muted-foreground/40"})}),m.jsx(Pd,{align:"start",className:"w-[300px]",onMouseDown:n=>n.stopPropagation(),children:m.jsx(bo,{type:"textarea",text:e.info||"",onSave:n=>t(e.id,n),children:m.jsx("p",{className:"text-sm text-muted-foreground",children:e.info||"Double-click to add info"})})})]})}function tQ({card:e,renderFilterInfo:t}){var p,g,b,v,x,y,_,w,C,R,k,D,I,T,N,G;se(z=>z.themeStyle);const{data:n,isLoading:r}=oi(e),o=(n==null?void 0:n.records)||[],i=se(z=>z.isDashboardEditing),{getCurrency:s,getLocale:a}=uT(e),l=(g=(p=e.preferences)==null?void 0:p.formatNumber)==null?void 0:g.colorRanges,{metricKeys:c}=Xt(o||[]),u=(b=o==null?void 0:o[0])==null?void 0:b[c==null?void 0:c[0]],d=(v=o==null?void 0:o[0])==null?void 0:v[c==null?void 0:c[1]],h=(o==null?void 0:o.length)>0,f=d&&d-u!==0?(u-d)/d:null;return m.jsx("div",{className:"flex min-w-fit grow flex-col overflow-auto",children:m.jsxs("div",{className:"grow",children:[h?m.jsx("div",{className:"",children:m.jsxs("div",{className:ie("flex items-end gap-1.5",{"animate-pulse":r}),children:[m.jsx("p",{style:{color:rw(u,l)},className:"text-3xl font-semibold",children:Rr({number:u,decimalPlaces:((y=(x=e.preferences)==null?void 0:x.formatNumber)==null?void 0:y.decimalPlaces)||0,useSuffix:!!((w=(_=e.preferences)==null?void 0:_.formatNumber)!=null&&w.suffix),customSuffix:((R=(C=e.preferences)==null?void 0:C.formatNumber)==null?void 0:R.suffix)||"",locale:a()||"",currency:s()||""})}),f&&m.jsxs("div",{className:"flex items-end gap-1",children:[m.jsx(dT,{className:"",children:f}),d&&m.jsx("div",{className:"ml-0.5 mr-1 min-w-fit text-sm font-normal text-muted-foreground",children:`from ${Rr({number:d,decimalPlaces:((D=(k=e.preferences)==null?void 0:k.formatNumber)==null?void 0:D.decimalPlaces)||0,useSuffix:!!((T=(I=e.preferences)==null?void 0:I.formatNumber)!=null&&T.suffix),customSuffix:((G=(N=e.preferences)==null?void 0:N.formatNumber)==null?void 0:G.suffix)||"",locale:a()||"",currency:s()||""})}`})]})]})}):m.jsx("div",{className:"flex h-9 items-center justify-center"}),m.jsxs("div",{className:"flex items-center gap-3",children:[m.jsxs(Zl,{className:"flex items-center gap-2 text-base font-medium text-muted-foreground",children:[e.title,(i||e.info)&&m.jsx(UT,{card:e})]}),t==null?void 0:t()]})]})})}var nQ="VisuallyHidden",Gw=S.forwardRef((e,t)=>m.jsx(pe.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));Gw.displayName=nQ;var rQ=Gw,[kg,uve]=Kt("Tooltip",[To]),Og=To(),qT="TooltipProvider",oQ=700,Zv="tooltip.open",[iQ,Yw]=kg(qT),Kw=e=>{const{__scopeTooltip:t,delayDuration:n=oQ,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:i}=e,[s,a]=S.useState(!0),l=S.useRef(!1),c=S.useRef(0);return S.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),m.jsx(iQ,{scope:t,isOpenDelayed:s,delayDuration:n,onOpen:S.useCallback(()=>{window.clearTimeout(c.current),a(!1)},[]),onClose:S.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>a(!0),r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:S.useCallback(u=>{l.current=u},[]),disableHoverableContent:o,children:i})};Kw.displayName=qT;var Dg="Tooltip",[sQ,Tg]=kg(Dg),GT=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o=!1,onOpenChange:i,disableHoverableContent:s,delayDuration:a}=e,l=Yw(Dg,e.__scopeTooltip),c=Og(t),[u,d]=S.useState(null),h=Ut(),f=S.useRef(0),p=s??l.disableHoverableContent,g=a??l.delayDuration,b=S.useRef(!1),[v=!1,x]=yn({prop:r,defaultProp:o,onChange:R=>{R?(l.onOpen(),document.dispatchEvent(new CustomEvent(Zv))):l.onClose(),i==null||i(R)}}),y=S.useMemo(()=>v?b.current?"delayed-open":"instant-open":"closed",[v]),_=S.useCallback(()=>{window.clearTimeout(f.current),f.current=0,b.current=!1,x(!0)},[x]),w=S.useCallback(()=>{window.clearTimeout(f.current),f.current=0,x(!1)},[x]),C=S.useCallback(()=>{window.clearTimeout(f.current),f.current=window.setTimeout(()=>{b.current=!0,x(!0),f.current=0},g)},[g,x]);return S.useEffect(()=>()=>{f.current&&(window.clearTimeout(f.current),f.current=0)},[]),m.jsx(Cd,{...c,children:m.jsx(sQ,{scope:t,contentId:h,open:v,stateAttribute:y,trigger:u,onTriggerChange:d,onTriggerEnter:S.useCallback(()=>{l.isOpenDelayed?C():_()},[l.isOpenDelayed,C,_]),onTriggerLeave:S.useCallback(()=>{p?w():(window.clearTimeout(f.current),f.current=0)},[w,p]),onOpen:_,onClose:w,disableHoverableContent:p,children:n})})};GT.displayName=Dg;var ey="TooltipTrigger",Xw=S.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=Tg(ey,n),i=Yw(ey,n),s=Og(n),a=S.useRef(null),l=Oe(t,a,o.onTriggerChange),c=S.useRef(!1),u=S.useRef(!1),d=S.useCallback(()=>c.current=!1,[]);return S.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),m.jsx(lc,{asChild:!0,...s,children:m.jsx(pe.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:l,onPointerMove:ae(e.onPointerMove,h=>{h.pointerType!=="touch"&&!u.current&&!i.isPointerInTransitRef.current&&(o.onTriggerEnter(),u.current=!0)}),onPointerLeave:ae(e.onPointerLeave,()=>{o.onTriggerLeave(),u.current=!1}),onPointerDown:ae(e.onPointerDown,()=>{c.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:ae(e.onFocus,()=>{c.current||o.onOpen()}),onBlur:ae(e.onBlur,o.onClose),onClick:ae(e.onClick,o.onClose)})})});Xw.displayName=ey;var aQ="TooltipPortal",[dve,lQ]=kg(aQ,{forceMount:void 0}),Ul="TooltipContent",YT=S.forwardRef((e,t)=>{const n=lQ(Ul,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...i}=e,s=Tg(Ul,e.__scopeTooltip);return m.jsx(qt,{present:r||s.open,children:s.disableHoverableContent?m.jsx(KT,{side:o,...i,ref:t}):m.jsx(cQ,{side:o,...i,ref:t})})}),cQ=S.forwardRef((e,t)=>{const n=Tg(Ul,e.__scopeTooltip),r=Yw(Ul,e.__scopeTooltip),o=S.useRef(null),i=Oe(t,o),[s,a]=S.useState(null),{trigger:l,onClose:c}=n,u=o.current,{onPointerInTransitChange:d}=r,h=S.useCallback(()=>{a(null),d(!1)},[d]),f=S.useCallback((p,g)=>{const b=p.currentTarget,v={x:p.clientX,y:p.clientY},x=hQ(v,b.getBoundingClientRect()),y=pQ(v,x),_=gQ(g.getBoundingClientRect()),w=bQ([...y,..._]);a(w),d(!0)},[d]);return S.useEffect(()=>()=>h(),[h]),S.useEffect(()=>{if(l&&u){const p=b=>f(b,u),g=b=>f(b,l);return l.addEventListener("pointerleave",p),u.addEventListener("pointerleave",g),()=>{l.removeEventListener("pointerleave",p),u.removeEventListener("pointerleave",g)}}},[l,u,f,h]),S.useEffect(()=>{if(s){const p=g=>{const b=g.target,v={x:g.clientX,y:g.clientY},x=(l==null?void 0:l.contains(b))||(u==null?void 0:u.contains(b)),y=!mQ(v,s);x?h():y&&(h(),c())};return document.addEventListener("pointermove",p),()=>document.removeEventListener("pointermove",p)}},[l,u,s,c,h]),m.jsx(KT,{...e,ref:i})}),[uQ,dQ]=kg(Dg,{isInside:!1}),KT=S.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:i,onPointerDownOutside:s,...a}=e,l=Tg(Ul,n),c=Og(n),{onClose:u}=l;return S.useEffect(()=>(document.addEventListener(Zv,u),()=>document.removeEventListener(Zv,u)),[u]),S.useEffect(()=>{if(l.trigger){const d=h=>{const f=h.target;f!=null&&f.contains(l.trigger)&&u()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[l.trigger,u]),m.jsx(wa,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:d=>d.preventDefault(),onDismiss:u,children:m.jsxs(_d,{"data-state":l.stateAttribute,...c,...a,ref:t,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[m.jsx(Cx,{children:r}),m.jsx(uQ,{scope:n,isInside:!0,children:m.jsx(rQ,{id:l.contentId,role:"tooltip",children:o||r})})]})})});YT.displayName=Ul;var XT="TooltipArrow",fQ=S.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=Og(n);return dQ(XT,n).isInside?null:m.jsx(Ed,{...o,...r,ref:t})});fQ.displayName=XT;function hQ(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,o,i)){case i:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function pQ(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function gQ(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function mQ(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,s=t.length-1;i<t.length;s=i++){const a=t[i].x,l=t[i].y,c=t[s].x,u=t[s].y;l>r!=u>r&&n<(c-a)*(r-l)/(u-l)+a&&(o=!o)}return o}function bQ(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),vQ(t)}function vQ(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const o=e[r];for(;t.length>=2;){const i=t[t.length-1],s=t[t.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const i=n[n.length-1],s=n[n.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var yQ=Kw,xQ=GT,wQ=Xw,QT=YT;const JT=yQ,Qw=xQ,Jw=wQ,Ig=S.forwardRef(({className:e,sideOffset:t=4,...n},r)=>m.jsx(QT,{ref:r,sideOffset:t,className:ie("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n}));Ig.displayName=QT.displayName;function vp({card:e,isLoading:t,data:n}){var h,f;const r=n||[],{keys:o}=Xt(r),i=se(p=>p.selectedSheetId),s=se(p=>p.isVisualEditing),a=(f=(h=e==null?void 0:e.preferences)==null?void 0:h.textVisualOptions)==null?void 0:f.isDynamicText,{setCardDescription:l}=zt(),{setCard:c}=fg();function u(){var v;if(t)return m.jsxs("div",{className:"space-y-2",children:[m.jsx(el,{className:"h-3 w-full animate-pulse bg-muted"}),m.jsx(el,{className:"h-3 w-3/4 animate-pulse bg-muted"}),m.jsx(el,{className:"h-3 w-1/2 animate-pulse bg-muted"})]});const g=(v=r==null?void 0:r[0])==null?void 0:v[o[0]],b=m.jsx("div",{dangerouslySetInnerHTML:{__html:g}});return m.jsx("div",{className:"text-sm text-foreground/80 hover:cursor-text",onMouseDown:x=>x.stopPropagation(),children:b})}function d(){const p=(e==null?void 0:e.description)||"";return m.jsx("div",{onMouseDown:g=>g.stopPropagation(),children:m.jsx(bo,{type:"textarea",className:"w-full rounded-md bg-muted",text:(e==null?void 0:e.description)||"Double click to add description",onSave:g=>{s===!1&&l(i,e.id,g),s===!0&&c({...e,description:g})},children:m.jsx("div",{className:"text-sm text-foreground/70 hover:cursor-text",dangerouslySetInnerHTML:{__html:p}})})})}return m.jsxs(m.Fragment,{children:[!a&&d(),a===!0&&u()]})}const SR=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,CR=Ph,Zw=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return CR(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:i}=t,s=Object.keys(o).map(c=>{const u=n==null?void 0:n[c],d=i==null?void 0:i[c];if(u===null)return null;const h=SR(u)||SR(d);return o[c][h]}),a=n&&Object.entries(n).reduce((c,u)=>{let[d,h]=u;return h===void 0||(c[d]=h),c},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,u)=>{let{class:d,className:h,...f}=u;return Object.entries(f).every(p=>{let[g,b]=p;return Array.isArray(b)?b.includes({...i,...a}[g]):{...i,...a}[g]===b})?[...c,d,h]:c},[]);return CR(e,s,l,n==null?void 0:n.class,n==null?void 0:n.className)},Hu=Zw("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),Yt=S.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...o},i)=>{const s=r?ri:"button";return m.jsx(s,{className:ie(Hu({variant:t,size:n,className:e})),ref:i,...o})});Yt.displayName="Button";var SQ="Label",ZT=S.forwardRef((e,t)=>m.jsx(pe.label,{...e,ref:t,onMouseDown:n=>{var o;n.target.closest("button, input, select, textarea")||((o=e.onMouseDown)==null||o.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));ZT.displayName=SQ;var eI=ZT;const CQ=Zw("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Et=S.forwardRef(({className:e,...t},n)=>m.jsx(eI,{ref:n,className:ie(CQ(),e),...t}));Et.displayName=eI.displayName;var _Q="Separator",_R="horizontal",EQ=["horizontal","vertical"],tI=S.forwardRef((e,t)=>{const{decorative:n,orientation:r=_R,...o}=e,i=RQ(r)?r:_R,a=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return m.jsx(pe.div,{"data-orientation":i,...a,...o,ref:t})});tI.displayName=_Q;function RQ(e){return EQ.includes(e)}var nI=tI;const Ag=S.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},o)=>m.jsx(nI,{ref:o,decorative:n,orientation:t,className:ie("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));Ag.displayName=nI.displayName;function PQ(){const e=se(g=>g.themeStyle),t=se(g=>g.filterValues),n=se(g=>g.dashboard.filters),r=se(g=>g.filteringCards),o=se(g=>g.selectedSheetId),{removeFilterValues:i,removeFilteringCard:s,setFilterValues:a,setFilteringCards:l}=zt(),c=n==null?void 0:n.filter(g=>g.sheetId===o||!g.sheetId),u=t==null?void 0:t.filter(g=>(c==null?void 0:c.some(b=>b.id===g.filterId))||g.filterId.endsWith(o));if(!u||u.length===0)return null;const d=u.map(g=>{const b=n==null?void 0:n.find(v=>v.id===g.filterId);return{filterId:g.filterId,name:(b==null?void 0:b.title)||g.name,values:g.values}});function h(g){return g instanceof Date?g.toLocaleDateString():g}function f(g){const b=r==null?void 0:r.find(v=>g.filterId.startsWith(v.id));b&&s(b),i(g.filterId)}function p(g){return m.jsxs("div",{className:"space-y-2",children:[m.jsxs("div",{style:{borderRadius:e==null?void 0:e.controlInputRadius},className:"flex w-fit items-center gap-2 border border-border bg-muted px-2 py-1",children:[m.jsx("span",{className:"break-words",children:g.name}),m.jsx(ya,{onClick:()=>f(g),className:"size-3 hover:cursor-pointer"})]}),m.jsx("div",{className:"flex flex-col gap-1 px-1",children:g.values.map((b,v)=>m.jsx("div",{style:{borderRadius:e==null?void 0:e.cardBorderRadius},className:"inline-block",children:h(b)},(b==null?void 0:b.toString())+v))})]})}return m.jsxs(Pg,{openDelay:50,children:[m.jsx(Mg,{children:m.jsx(tO,{onClick:()=>{l([]),a([])},className:"size-3.5 text-muted-foreground hover:cursor-pointer"})}),m.jsxs(Pd,{style:{borderRadius:e==null?void 0:e.cardBorderRadius},className:"min-h-fit w-[300px] flex-col space-y-4 px-0 text-xs",align:"start",children:[m.jsx(Et,{className:"px-5 font-medium",children:"Active Filters"}),m.jsx("div",{className:"h-fit max-h-[150px] min-h-0 grow overflow-auto",children:d==null?void 0:d.map((g,b)=>m.jsxs("div",{className:"px-5",children:[p(g),b<d.length-1&&m.jsx(Ag,{className:"my-4"})]},g.name))})]})]})}const MQ=S.forwardRef(({className:e,containerClassName:t,containerStyle:n,...r},o)=>m.jsx("div",{style:n,className:ie("relative w-full overflow-auto",t),children:m.jsx("table",{ref:o,className:ie("w-full caption-bottom text-sm",e),...r})}));MQ.displayName="Table";const e1=S.forwardRef(({className:e,...t},n)=>m.jsx("thead",{ref:n,className:ie("[&_tr]:border-b",e),...t}));e1.displayName="TableHeader";const t1=S.forwardRef(({className:e,...t},n)=>m.jsx("tbody",{ref:n,className:ie("[&_tr:last-child]:border-0",e),...t}));t1.displayName="TableBody";const kQ=S.forwardRef(({className:e,...t},n)=>m.jsx("tfoot",{ref:n,className:ie("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));kQ.displayName="TableFooter";const fu=S.forwardRef(({className:e,...t},n)=>m.jsx("tr",{ref:n,className:ie("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));fu.displayName="TableRow";const n1=S.forwardRef(({className:e,...t},n)=>m.jsx("th",{ref:n,className:ie("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));n1.displayName="TableHead";const yp=S.forwardRef(({className:e,...t},n)=>m.jsx("td",{ref:n,className:ie("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));yp.displayName="TableCell";const OQ=S.forwardRef(({className:e,...t},n)=>m.jsx("caption",{ref:n,className:ie("mt-4 text-sm text-muted-foreground",e),...t}));OQ.displayName="TableCaption";/**
246
- * table-core
247
- *
248
- * Copyright (c) TanStack
249
- *
250
- * This source code is licensed under the MIT license found in the
251
- * LICENSE.md file in the root directory of this source tree.
252
- *
253
- * @license MIT
254
- */function Ti(e,t){return typeof e=="function"?e(t):e}function br(e,t){return n=>{t.setState(r=>({...r,[e]:Ti(n,r[e])}))}}function Ng(e){return e instanceof Function}function DQ(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function TQ(e,t){const n=[],r=o=>{o.forEach(i=>{n.push(i);const s=t(i);s!=null&&s.length&&r(s)})};return r(e),n}function we(e,t,n){let r=[],o;return i=>{let s;n.key&&n.debug&&(s=Date.now());const a=e(i);if(!(a.length!==r.length||a.some((u,d)=>r[d]!==u)))return o;r=a;let c;if(n.key&&n.debug&&(c=Date.now()),o=t(...a),n==null||n.onChange==null||n.onChange(o),n.key&&n.debug&&n!=null&&n.debug()){const u=Math.round((Date.now()-s)*100)/100,d=Math.round((Date.now()-c)*100)/100,h=d/16,f=(p,g)=>{for(p=String(p);p.length<g;)p=" "+p;return p};console.info(`%c⏱ ${f(d,5)} /${f(u,5)} ms`,`
255
- font-size: .6rem;
256
- font-weight: bold;
257
- color: hsl(${Math.max(0,Math.min(120-120*h,120))}deg 100% 31%);`,n==null?void 0:n.key)}return o}}function Se(e,t,n,r){return{debug:()=>{var o;return(o=e==null?void 0:e.debugAll)!=null?o:e[t]},key:process.env.NODE_ENV==="development"&&n,onChange:r}}function IQ(e,t,n,r){const o=()=>{var s;return(s=i.getValue())!=null?s:e.options.renderFallbackValue},i={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(r),renderValue:o,getContext:we(()=>[e,n,t,i],(s,a,l,c)=>({table:s,column:a,row:l,cell:c,getValue:c.getValue,renderValue:c.renderValue}),Se(e.options,"debugCells","cell.getContext"))};return e._features.forEach(s=>{s.createCell==null||s.createCell(i,n,t,e)},{}),i}function AQ(e,t,n,r){var o,i;const a={...e._getDefaultColumnDef(),...t},l=a.accessorKey;let c=(o=(i=a.id)!=null?i:l?typeof String.prototype.replaceAll=="function"?l.replaceAll(".","_"):l.replace(/\./g,"_"):void 0)!=null?o:typeof a.header=="string"?a.header:void 0,u;if(a.accessorFn?u=a.accessorFn:l&&(l.includes(".")?u=h=>{let f=h;for(const g of l.split(".")){var p;f=(p=f)==null?void 0:p[g],process.env.NODE_ENV!=="production"&&f===void 0&&console.warn(`"${g}" in deeply nested key "${l}" returned undefined.`)}return f}:u=h=>h[a.accessorKey]),!c)throw process.env.NODE_ENV!=="production"?new Error(a.accessorFn?"Columns require an id when using an accessorFn":"Columns require an id when using a non-string header"):new Error;let d={id:`${String(c)}`,accessorFn:u,parent:r,depth:n,columnDef:a,columns:[],getFlatColumns:we(()=>[!0],()=>{var h;return[d,...(h=d.columns)==null?void 0:h.flatMap(f=>f.getFlatColumns())]},Se(e.options,"debugColumns","column.getFlatColumns")),getLeafColumns:we(()=>[e._getOrderColumnsFn()],h=>{var f;if((f=d.columns)!=null&&f.length){let p=d.columns.flatMap(g=>g.getLeafColumns());return h(p)}return[d]},Se(e.options,"debugColumns","column.getLeafColumns"))};for(const h of e._features)h.createColumn==null||h.createColumn(d,e);return d}const un="debugHeaders";function ER(e,t,n){var r;let i={id:(r=n.id)!=null?r:t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const s=[],a=l=>{l.subHeaders&&l.subHeaders.length&&l.subHeaders.map(a),s.push(l)};return a(i),s},getContext:()=>({table:e,header:i,column:t})};return e._features.forEach(s=>{s.createHeader==null||s.createHeader(i,e)}),i}const NQ={createTable:e=>{e.getHeaderGroups=we(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,o)=>{var i,s;const a=(i=r==null?void 0:r.map(d=>n.find(h=>h.id===d)).filter(Boolean))!=null?i:[],l=(s=o==null?void 0:o.map(d=>n.find(h=>h.id===d)).filter(Boolean))!=null?s:[],c=n.filter(d=>!(r!=null&&r.includes(d.id))&&!(o!=null&&o.includes(d.id)));return $f(t,[...a,...c,...l],e)},Se(e.options,un,"getHeaderGroups")),e.getCenterHeaderGroups=we(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,o)=>(n=n.filter(i=>!(r!=null&&r.includes(i.id))&&!(o!=null&&o.includes(i.id))),$f(t,n,e,"center")),Se(e.options,un,"getCenterHeaderGroups")),e.getLeftHeaderGroups=we(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,r)=>{var o;const i=(o=r==null?void 0:r.map(s=>n.find(a=>a.id===s)).filter(Boolean))!=null?o:[];return $f(t,i,e,"left")},Se(e.options,un,"getLeftHeaderGroups")),e.getRightHeaderGroups=we(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,r)=>{var o;const i=(o=r==null?void 0:r.map(s=>n.find(a=>a.id===s)).filter(Boolean))!=null?o:[];return $f(t,i,e,"right")},Se(e.options,un,"getRightHeaderGroups")),e.getFooterGroups=we(()=>[e.getHeaderGroups()],t=>[...t].reverse(),Se(e.options,un,"getFooterGroups")),e.getLeftFooterGroups=we(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),Se(e.options,un,"getLeftFooterGroups")),e.getCenterFooterGroups=we(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),Se(e.options,un,"getCenterFooterGroups")),e.getRightFooterGroups=we(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),Se(e.options,un,"getRightFooterGroups")),e.getFlatHeaders=we(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),Se(e.options,un,"getFlatHeaders")),e.getLeftFlatHeaders=we(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),Se(e.options,un,"getLeftFlatHeaders")),e.getCenterFlatHeaders=we(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),Se(e.options,un,"getCenterFlatHeaders")),e.getRightFlatHeaders=we(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),Se(e.options,un,"getRightFlatHeaders")),e.getCenterLeafHeaders=we(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Se(e.options,un,"getCenterLeafHeaders")),e.getLeftLeafHeaders=we(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Se(e.options,un,"getLeftLeafHeaders")),e.getRightLeafHeaders=we(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Se(e.options,un,"getRightLeafHeaders")),e.getLeafHeaders=we(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,r)=>{var o,i,s,a,l,c;return[...(o=(i=t[0])==null?void 0:i.headers)!=null?o:[],...(s=(a=n[0])==null?void 0:a.headers)!=null?s:[],...(l=(c=r[0])==null?void 0:c.headers)!=null?l:[]].map(u=>u.getLeafHeaders()).flat()},Se(e.options,un,"getLeafHeaders"))}};function $f(e,t,n,r){var o,i;let s=0;const a=function(h,f){f===void 0&&(f=1),s=Math.max(s,f),h.filter(p=>p.getIsVisible()).forEach(p=>{var g;(g=p.columns)!=null&&g.length&&a(p.columns,f+1)},0)};a(e);let l=[];const c=(h,f)=>{const p={depth:f,id:[r,`${f}`].filter(Boolean).join("_"),headers:[]},g=[];h.forEach(b=>{const v=[...g].reverse()[0],x=b.column.depth===p.depth;let y,_=!1;if(x&&b.column.parent?y=b.column.parent:(y=b.column,_=!0),v&&(v==null?void 0:v.column)===y)v.subHeaders.push(b);else{const w=ER(n,y,{id:[r,f,y.id,b==null?void 0:b.id].filter(Boolean).join("_"),isPlaceholder:_,placeholderId:_?`${g.filter(C=>C.column===y).length}`:void 0,depth:f,index:g.length});w.subHeaders.push(b),g.push(w)}p.headers.push(b),b.headerGroup=p}),l.push(p),f>0&&c(g,f-1)},u=t.map((h,f)=>ER(n,h,{depth:s,index:f}));c(u,s-1),l.reverse();const d=h=>h.filter(p=>p.column.getIsVisible()).map(p=>{let g=0,b=0,v=[0];p.subHeaders&&p.subHeaders.length?(v=[],d(p.subHeaders).forEach(y=>{let{colSpan:_,rowSpan:w}=y;g+=_,v.push(w)})):g=1;const x=Math.min(...v);return b=b+x,p.colSpan=g,p.rowSpan=b,{colSpan:g,rowSpan:b}});return d((o=(i=l[0])==null?void 0:i.headers)!=null?o:[]),l}const jQ=(e,t,n,r,o,i,s)=>{let a={id:t,index:r,original:n,depth:o,parentId:s,_valuesCache:{},_uniqueValuesCache:{},getValue:l=>{if(a._valuesCache.hasOwnProperty(l))return a._valuesCache[l];const c=e.getColumn(l);if(c!=null&&c.accessorFn)return a._valuesCache[l]=c.accessorFn(a.original,r),a._valuesCache[l]},getUniqueValues:l=>{if(a._uniqueValuesCache.hasOwnProperty(l))return a._uniqueValuesCache[l];const c=e.getColumn(l);if(c!=null&&c.accessorFn)return c.columnDef.getUniqueValues?(a._uniqueValuesCache[l]=c.columnDef.getUniqueValues(a.original,r),a._uniqueValuesCache[l]):(a._uniqueValuesCache[l]=[a.getValue(l)],a._uniqueValuesCache[l])},renderValue:l=>{var c;return(c=a.getValue(l))!=null?c:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>TQ(a.subRows,l=>l.subRows),getParentRow:()=>a.parentId?e.getRow(a.parentId,!0):void 0,getParentRows:()=>{let l=[],c=a;for(;;){const u=c.getParentRow();if(!u)break;l.push(u),c=u}return l.reverse()},getAllCells:we(()=>[e.getAllLeafColumns()],l=>l.map(c=>IQ(e,a,c,c.id)),Se(e.options,"debugRows","getAllCells")),_getAllCellsByColumnId:we(()=>[a.getAllCells()],l=>l.reduce((c,u)=>(c[u.column.id]=u,c),{}),Se(e.options,"debugRows","getAllCellsByColumnId"))};for(let l=0;l<e._features.length;l++){const c=e._features[l];c==null||c.createRow==null||c.createRow(a,e)}return a},FQ={createColumn:(e,t)=>{e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},rI=(e,t,n)=>{var r,o;const i=n==null||(r=n.toString())==null?void 0:r.toLowerCase();return!!(!((o=e.getValue(t))==null||(o=o.toString())==null||(o=o.toLowerCase())==null)&&o.includes(i))};rI.autoRemove=e=>Vr(e);const oI=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};oI.autoRemove=e=>Vr(e);const iI=(e,t,n)=>{var r;return((r=e.getValue(t))==null||(r=r.toString())==null?void 0:r.toLowerCase())===(n==null?void 0:n.toLowerCase())};iI.autoRemove=e=>Vr(e);const sI=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};sI.autoRemove=e=>Vr(e);const aI=(e,t,n)=>!n.some(r=>{var o;return!((o=e.getValue(t))!=null&&o.includes(r))});aI.autoRemove=e=>Vr(e)||!(e!=null&&e.length);const lI=(e,t,n)=>n.some(r=>{var o;return(o=e.getValue(t))==null?void 0:o.includes(r)});lI.autoRemove=e=>Vr(e)||!(e!=null&&e.length);const cI=(e,t,n)=>e.getValue(t)===n;cI.autoRemove=e=>Vr(e);const uI=(e,t,n)=>e.getValue(t)==n;uI.autoRemove=e=>Vr(e);const r1=(e,t,n)=>{let[r,o]=n;const i=e.getValue(t);return i>=r&&i<=o};r1.resolveFilterValue=e=>{let[t,n]=e,r=typeof t!="number"?parseFloat(t):t,o=typeof n!="number"?parseFloat(n):n,i=t===null||Number.isNaN(r)?-1/0:r,s=n===null||Number.isNaN(o)?1/0:o;if(i>s){const a=i;i=s,s=a}return[i,s]};r1.autoRemove=e=>Vr(e)||Vr(e[0])&&Vr(e[1]);const Vo={includesString:rI,includesStringSensitive:oI,equalsString:iI,arrIncludes:sI,arrIncludesAll:aI,arrIncludesSome:lI,equals:cI,weakEquals:uI,inNumberRange:r1};function Vr(e){return e==null||e===""}const LQ={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:br("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(e.id);return typeof r=="string"?Vo.includesString:typeof r=="number"?Vo.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?Vo.equals:Array.isArray(r)?Vo.arrIncludes:Vo.weakEquals},e.getFilterFn=()=>{var n,r;return Ng(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(n=(r=t.options.filterFns)==null?void 0:r[e.columnDef.filterFn])!=null?n:Vo[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,r,o;return((n=e.columnDef.enableColumnFilter)!=null?n:!0)&&((r=t.options.enableColumnFilters)!=null?r:!0)&&((o=t.options.enableFilters)!=null?o:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return(n=t.getState().columnFilters)==null||(n=n.find(r=>r.id===e.id))==null?void 0:n.value},e.getFilterIndex=()=>{var n,r;return(n=(r=t.getState().columnFilters)==null?void 0:r.findIndex(o=>o.id===e.id))!=null?n:-1},e.setFilterValue=n=>{t.setColumnFilters(r=>{const o=e.getFilterFn(),i=r==null?void 0:r.find(u=>u.id===e.id),s=Ti(n,i?i.value:void 0);if(RR(o,s,e)){var a;return(a=r==null?void 0:r.filter(u=>u.id!==e.id))!=null?a:[]}const l={id:e.id,value:s};if(i){var c;return(c=r==null?void 0:r.map(u=>u.id===e.id?l:u))!=null?c:[]}return r!=null&&r.length?[...r,l]:[l]})}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{const n=e.getAllLeafColumns(),r=o=>{var i;return(i=Ti(t,o))==null?void 0:i.filter(s=>{const a=n.find(l=>l.id===s.id);if(a){const l=a.getFilterFn();if(RR(l,s.value,a))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(r)},e.resetColumnFilters=t=>{var n,r;e.setColumnFilters(t?[]:(n=(r=e.initialState)==null?void 0:r.columnFilters)!=null?n:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel())}};function RR(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const $Q=(e,t,n)=>n.reduce((r,o)=>{const i=o.getValue(e);return r+(typeof i=="number"?i:0)},0),zQ=(e,t,n)=>{let r;return n.forEach(o=>{const i=o.getValue(e);i!=null&&(r>i||r===void 0&&i>=i)&&(r=i)}),r},BQ=(e,t,n)=>{let r;return n.forEach(o=>{const i=o.getValue(e);i!=null&&(r<i||r===void 0&&i>=i)&&(r=i)}),r},VQ=(e,t,n)=>{let r,o;return n.forEach(i=>{const s=i.getValue(e);s!=null&&(r===void 0?s>=s&&(r=o=s):(r>s&&(r=s),o<s&&(o=s)))}),[r,o]},HQ=(e,t)=>{let n=0,r=0;if(t.forEach(o=>{let i=o.getValue(e);i!=null&&(i=+i)>=i&&(++n,r+=i)}),n)return r/n},WQ=(e,t)=>{if(!t.length)return;const n=t.map(i=>i.getValue(e));if(!DQ(n))return;if(n.length===1)return n[0];const r=Math.floor(n.length/2),o=n.sort((i,s)=>i-s);return n.length%2!==0?o[r]:(o[r-1]+o[r])/2},UQ=(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),qQ=(e,t)=>new Set(t.map(n=>n.getValue(e))).size,GQ=(e,t)=>t.length,Rb={sum:$Q,min:zQ,max:BQ,extent:VQ,mean:HQ,median:WQ,unique:UQ,uniqueCount:qQ,count:GQ},YQ={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,n;return(t=(n=e.getValue())==null||n.toString==null?void 0:n.toString())!=null?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:br("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(n=>n!=null&&n.includes(e.id)?n.filter(r=>r!==e.id):[...n??[],e.id])},e.getCanGroup=()=>{var n,r;return((n=e.columnDef.enableGrouping)!=null?n:!0)&&((r=t.options.enableGrouping)!=null?r:!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.includes(e.id)},e.getGroupedIndex=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const n=e.getCanGroup();return()=>{n&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(e.id);if(typeof r=="number")return Rb.sum;if(Object.prototype.toString.call(r)==="[object Date]")return Rb.extent},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return Ng(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(n=(r=t.options.aggregationFns)==null?void 0:r[e.columnDef.aggregationFn])!=null?n:Rb[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var n,r;e.setGrouping(t?[]:(n=(r=e.initialState)==null?void 0:r.grouping)!=null?n:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];const r=t.getColumn(n);return r!=null&&r.columnDef.getGroupingValue?(e._groupingValuesCache[n]=r.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,r)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===n.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var o;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((o=n.subRows)!=null&&o.length)}}};function KQ(e,t,n){if(!(t!=null&&t.length)||!n)return e;const r=e.filter(i=>!t.includes(i.id));return n==="remove"?r:[...t.map(i=>e.find(s=>s.id===i)).filter(Boolean),...r]}const XQ={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:br("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=we(n=>[hu(t,n)],n=>n.findIndex(r=>r.id===e.id),Se(t.options,"debugColumns","getIndex")),e.getIsFirstColumn=n=>{var r;return((r=hu(t,n)[0])==null?void 0:r.id)===e.id},e.getIsLastColumn=n=>{var r;const o=hu(t,n);return((r=o[o.length-1])==null?void 0:r.id)===e.id}},createTable:e=>{e.setColumnOrder=t=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var n;e.setColumnOrder(t?[]:(n=e.initialState.columnOrder)!=null?n:[])},e._getOrderColumnsFn=we(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,n,r)=>o=>{let i=[];if(!(t!=null&&t.length))i=o;else{const s=[...t],a=[...o];for(;a.length&&s.length;){const l=s.shift(),c=a.findIndex(u=>u.id===l);c>-1&&i.push(a.splice(c,1)[0])}i=[...i,...a]}return KQ(i,n,r)},Se(e.options,"debugTable","_getOrderColumnsFn"))}},Pb=()=>({left:[],right:[]}),QQ={getInitialState:e=>({columnPinning:Pb(),...e}),getDefaultOptions:e=>({onColumnPinningChange:br("columnPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const r=e.getLeafColumns().map(o=>o.id).filter(Boolean);t.setColumnPinning(o=>{var i,s;if(n==="right"){var a,l;return{left:((a=o==null?void 0:o.left)!=null?a:[]).filter(d=>!(r!=null&&r.includes(d))),right:[...((l=o==null?void 0:o.right)!=null?l:[]).filter(d=>!(r!=null&&r.includes(d))),...r]}}if(n==="left"){var c,u;return{left:[...((c=o==null?void 0:o.left)!=null?c:[]).filter(d=>!(r!=null&&r.includes(d))),...r],right:((u=o==null?void 0:o.right)!=null?u:[]).filter(d=>!(r!=null&&r.includes(d)))}}return{left:((i=o==null?void 0:o.left)!=null?i:[]).filter(d=>!(r!=null&&r.includes(d))),right:((s=o==null?void 0:o.right)!=null?s:[]).filter(d=>!(r!=null&&r.includes(d)))}})},e.getCanPin=()=>e.getLeafColumns().some(r=>{var o,i,s;return((o=r.columnDef.enablePinning)!=null?o:!0)&&((i=(s=t.options.enableColumnPinning)!=null?s:t.options.enablePinning)!=null?i:!0)}),e.getIsPinned=()=>{const n=e.getLeafColumns().map(a=>a.id),{left:r,right:o}=t.getState().columnPinning,i=n.some(a=>r==null?void 0:r.includes(a)),s=n.some(a=>o==null?void 0:o.includes(a));return i?"left":s?"right":!1},e.getPinnedIndex=()=>{var n,r;const o=e.getIsPinned();return o?(n=(r=t.getState().columnPinning)==null||(r=r[o])==null?void 0:r.indexOf(e.id))!=null?n:-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=we(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(n,r,o)=>{const i=[...r??[],...o??[]];return n.filter(s=>!i.includes(s.column.id))},Se(t.options,"debugRows","getCenterVisibleCells")),e.getLeftVisibleCells=we(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(n,r)=>(r??[]).map(i=>n.find(s=>s.column.id===i)).filter(Boolean).map(i=>({...i,position:"left"})),Se(t.options,"debugRows","getLeftVisibleCells")),e.getRightVisibleCells=we(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(n,r)=>(r??[]).map(i=>n.find(s=>s.column.id===i)).filter(Boolean).map(i=>({...i,position:"right"})),Se(t.options,"debugRows","getRightVisibleCells"))},createTable:e=>{e.setColumnPinning=t=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var n,r;return e.setColumnPinning(t?Pb():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:Pb())},e.getIsSomeColumnsPinned=t=>{var n;const r=e.getState().columnPinning;if(!t){var o,i;return!!((o=r.left)!=null&&o.length||(i=r.right)!=null&&i.length)}return!!((n=r[t])!=null&&n.length)},e.getLeftLeafColumns=we(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(r=>t.find(o=>o.id===r)).filter(Boolean),Se(e.options,"debugColumns","getLeftLeafColumns")),e.getRightLeafColumns=we(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(r=>t.find(o=>o.id===r)).filter(Boolean),Se(e.options,"debugColumns","getRightLeafColumns")),e.getCenterLeafColumns=we(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r)=>{const o=[...n??[],...r??[]];return t.filter(i=>!o.includes(i.id))},Se(e.options,"debugColumns","getCenterLeafColumns"))}},zf={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},Mb=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),JQ={getDefaultColumnDef:()=>zf,getInitialState:e=>({columnSizing:{},columnSizingInfo:Mb(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:br("columnSizing",e),onColumnSizingInfoChange:br("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,r,o;const i=t.getState().columnSizing[e.id];return Math.min(Math.max((n=e.columnDef.minSize)!=null?n:zf.minSize,(r=i??e.columnDef.size)!=null?r:zf.size),(o=e.columnDef.maxSize)!=null?o:zf.maxSize)},e.getStart=we(n=>[n,hu(t,n),t.getState().columnSizing],(n,r)=>r.slice(0,e.getIndex(n)).reduce((o,i)=>o+i.getSize(),0),Se(t.options,"debugColumns","getStart")),e.getAfter=we(n=>[n,hu(t,n),t.getState().columnSizing],(n,r)=>r.slice(e.getIndex(n)+1).reduce((o,i)=>o+i.getSize(),0),Se(t.options,"debugColumns","getAfter")),e.resetSize=()=>{t.setColumnSizing(n=>{let{[e.id]:r,...o}=n;return o})},e.getCanResize=()=>{var n,r;return((n=e.columnDef.enableResizing)!=null?n:!0)&&((r=t.options.enableColumnResizing)!=null?r:!0)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let n=0;const r=o=>{if(o.subHeaders.length)o.subHeaders.forEach(r);else{var i;n+=(i=o.column.getSize())!=null?i:0}};return r(e),n},e.getStart=()=>{if(e.index>0){const n=e.headerGroup.headers[e.index-1];return n.getStart()+n.getSize()}return 0},e.getResizeHandler=n=>{const r=t.getColumn(e.column.id),o=r==null?void 0:r.getCanResize();return i=>{if(!r||!o||(i.persist==null||i.persist(),kb(i)&&i.touches&&i.touches.length>1))return;const s=e.getSize(),a=e?e.getLeafHeaders().map(v=>[v.column.id,v.column.getSize()]):[[r.id,r.getSize()]],l=kb(i)?Math.round(i.touches[0].clientX):i.clientX,c={},u=(v,x)=>{typeof x=="number"&&(t.setColumnSizingInfo(y=>{var _,w;const C=t.options.columnResizeDirection==="rtl"?-1:1,R=(x-((_=y==null?void 0:y.startOffset)!=null?_:0))*C,k=Math.max(R/((w=y==null?void 0:y.startSize)!=null?w:0),-.999999);return y.columnSizingStart.forEach(D=>{let[I,T]=D;c[I]=Math.round(Math.max(T+T*k,0)*100)/100}),{...y,deltaOffset:R,deltaPercentage:k}}),(t.options.columnResizeMode==="onChange"||v==="end")&&t.setColumnSizing(y=>({...y,...c})))},d=v=>u("move",v),h=v=>{u("end",v),t.setColumnSizingInfo(x=>({...x,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},f=n||typeof document<"u"?document:null,p={moveHandler:v=>d(v.clientX),upHandler:v=>{f==null||f.removeEventListener("mousemove",p.moveHandler),f==null||f.removeEventListener("mouseup",p.upHandler),h(v.clientX)}},g={moveHandler:v=>(v.cancelable&&(v.preventDefault(),v.stopPropagation()),d(v.touches[0].clientX),!1),upHandler:v=>{var x;f==null||f.removeEventListener("touchmove",g.moveHandler),f==null||f.removeEventListener("touchend",g.upHandler),v.cancelable&&(v.preventDefault(),v.stopPropagation()),h((x=v.touches[0])==null?void 0:x.clientX)}},b=ZQ()?{passive:!1}:!1;kb(i)?(f==null||f.addEventListener("touchmove",g.moveHandler,b),f==null||f.addEventListener("touchend",g.upHandler,b)):(f==null||f.addEventListener("mousemove",p.moveHandler,b),f==null||f.addEventListener("mouseup",p.upHandler,b)),t.setColumnSizingInfo(v=>({...v,startOffset:l,startSize:s,deltaOffset:0,deltaPercentage:0,columnSizingStart:a,isResizingColumn:r.id}))}}},createTable:e=>{e.setColumnSizing=t=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var n;e.setColumnSizing(t?{}:(n=e.initialState.columnSizing)!=null?n:{})},e.resetHeaderSizeInfo=t=>{var n;e.setColumnSizingInfo(t?Mb():(n=e.initialState.columnSizingInfo)!=null?n:Mb())},e.getTotalSize=()=>{var t,n;return(t=(n=e.getHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getLeftTotalSize=()=>{var t,n;return(t=(n=e.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getCenterTotalSize=()=>{var t,n;return(t=(n=e.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getRightTotalSize=()=>{var t,n;return(t=(n=e.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0}}};let Bf=null;function ZQ(){if(typeof Bf=="boolean")return Bf;let e=!1;try{const t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener("test",n,t),window.removeEventListener("test",n)}catch{e=!1}return Bf=e,Bf}function kb(e){return e.type==="touchstart"}const eJ={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:br("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility(r=>({...r,[e.id]:n??!e.getIsVisible()}))},e.getIsVisible=()=>{var n,r;const o=e.columns;return(n=o.length?o.some(i=>i.getIsVisible()):(r=t.getState().columnVisibility)==null?void 0:r[e.id])!=null?n:!0},e.getCanHide=()=>{var n,r;return((n=e.columnDef.enableHiding)!=null?n:!0)&&((r=t.options.enableHiding)!=null?r:!0)},e.getToggleVisibilityHandler=()=>n=>{e.toggleVisibility==null||e.toggleVisibility(n.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=we(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),Se(t.options,"debugRows","_getAllVisibleCells")),e.getVisibleCells=we(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,r,o)=>[...n,...r,...o],Se(t.options,"debugRows","getVisibleCells"))},createTable:e=>{const t=(n,r)=>we(()=>[r(),r().filter(o=>o.getIsVisible()).map(o=>o.id).join("_")],o=>o.filter(i=>i.getIsVisible==null?void 0:i.getIsVisible()),Se(e.options,"debugColumns",n));e.getVisibleFlatColumns=t("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=n=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(n),e.resetColumnVisibility=n=>{var r;e.setColumnVisibility(n?{}:(r=e.initialState.columnVisibility)!=null?r:{})},e.toggleAllColumnsVisible=n=>{var r;n=(r=n)!=null?r:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((o,i)=>({...o,[i.id]:n||!(i.getCanHide!=null&&i.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>n=>{var r;e.toggleAllColumnsVisible((r=n.target)==null?void 0:r.checked)}}};function hu(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const tJ={createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},nJ={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:br("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;const r=(n=e.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[t.id])==null?void 0:n.getValue();return typeof r=="string"||typeof r=="number"}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>{var n,r,o,i;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((r=t.options.enableGlobalFilter)!=null?r:!0)&&((o=t.options.enableFilters)!=null?o:!0)&&((i=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?i:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>Vo.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return Ng(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[r])!=null?t:Vo[r]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},rJ={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:br("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var r,o;if(!t){e._queue(()=>{t=!0});return}if((r=(o=e.options.autoResetAll)!=null?o:e.options.autoResetExpanded)!=null?r:!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}},e.setExpanded=r=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(r),e.toggleAllRowsExpanded=r=>{r??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=r=>{var o,i;e.setExpanded(r?{}:(o=(i=e.initialState)==null?void 0:i.expanded)!=null?o:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(r=>r.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>r=>{r.persist==null||r.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const r=e.getState().expanded;return r===!0||Object.values(r).some(Boolean)},e.getIsAllRowsExpanded=()=>{const r=e.getState().expanded;return typeof r=="boolean"?r===!0:!(!Object.keys(r).length||e.getRowModel().flatRows.some(o=>!o.getIsExpanded()))},e.getExpandedDepth=()=>{let r=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(i=>{const s=i.split(".");r=Math.max(r,s.length)}),r},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,t)=>{e.toggleExpanded=n=>{t.setExpanded(r=>{var o;const i=r===!0?!0:!!(r!=null&&r[e.id]);let s={};if(r===!0?Object.keys(t.getRowModel().rowsById).forEach(a=>{s[a]=!0}):s=r,n=(o=n)!=null?o:!i,!i&&n)return{...s,[e.id]:!0};if(i&&!n){const{[e.id]:a,...l}=s;return l}return r})},e.getIsExpanded=()=>{var n;const r=t.getState().expanded;return!!((n=t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))!=null?n:r===!0||r!=null&&r[e.id])},e.getCanExpand=()=>{var n,r,o;return(n=t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))!=null?n:((r=t.options.enableExpanding)!=null?r:!0)&&!!((o=e.subRows)!=null&&o.length)},e.getIsAllParentsExpanded=()=>{let n=!0,r=e;for(;n&&r.parentId;)r=t.getRow(r.parentId,!0),n=r.getIsExpanded();return n},e.getToggleExpandedHandler=()=>{const n=e.getCanExpand();return()=>{n&&e.toggleExpanded()}}}},ty=0,ny=10,Ob=()=>({pageIndex:ty,pageSize:ny}),oJ={getInitialState:e=>({...e,pagination:{...Ob(),...e==null?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:br("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var r,o;if(!t){e._queue(()=>{t=!0});return}if((r=(o=e.options.autoResetAll)!=null?o:e.options.autoResetPageIndex)!=null?r:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},e.setPagination=r=>{const o=i=>Ti(r,i);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(o)},e.resetPagination=r=>{var o;e.setPagination(r?Ob():(o=e.initialState.pagination)!=null?o:Ob())},e.setPageIndex=r=>{e.setPagination(o=>{let i=Ti(r,o.pageIndex);const s=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return i=Math.max(0,Math.min(i,s)),{...o,pageIndex:i}})},e.resetPageIndex=r=>{var o,i;e.setPageIndex(r?ty:(o=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageIndex)!=null?o:ty)},e.resetPageSize=r=>{var o,i;e.setPageSize(r?ny:(o=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageSize)!=null?o:ny)},e.setPageSize=r=>{e.setPagination(o=>{const i=Math.max(1,Ti(r,o.pageSize)),s=o.pageSize*o.pageIndex,a=Math.floor(s/i);return{...o,pageIndex:a,pageSize:i}})},e.setPageCount=r=>e.setPagination(o=>{var i;let s=Ti(r,(i=e.options.pageCount)!=null?i:-1);return typeof s=="number"&&(s=Math.max(-1,s)),{...o,pageCount:s}}),e.getPageOptions=we(()=>[e.getPageCount()],r=>{let o=[];return r&&r>0&&(o=[...new Array(r)].fill(null).map((i,s)=>s)),o},Se(e.options,"debugTable","getPageOptions")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:r}=e.getState().pagination,o=e.getPageCount();return o===-1?!0:o===0?!1:r<o-1},e.previousPage=()=>e.setPageIndex(r=>r-1),e.nextPage=()=>e.setPageIndex(r=>r+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var r;return(r=e.options.pageCount)!=null?r:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var r;return(r=e.options.rowCount)!=null?r:e.getPrePaginationRowModel().rows.length}}},Db=()=>({top:[],bottom:[]}),iJ={getInitialState:e=>({rowPinning:Db(),...e}),getDefaultOptions:e=>({onRowPinningChange:br("rowPinning",e)}),createRow:(e,t)=>{e.pin=(n,r,o)=>{const i=r?e.getLeafRows().map(l=>{let{id:c}=l;return c}):[],s=o?e.getParentRows().map(l=>{let{id:c}=l;return c}):[],a=new Set([...s,e.id,...i]);t.setRowPinning(l=>{var c,u;if(n==="bottom"){var d,h;return{top:((d=l==null?void 0:l.top)!=null?d:[]).filter(g=>!(a!=null&&a.has(g))),bottom:[...((h=l==null?void 0:l.bottom)!=null?h:[]).filter(g=>!(a!=null&&a.has(g))),...Array.from(a)]}}if(n==="top"){var f,p;return{top:[...((f=l==null?void 0:l.top)!=null?f:[]).filter(g=>!(a!=null&&a.has(g))),...Array.from(a)],bottom:((p=l==null?void 0:l.bottom)!=null?p:[]).filter(g=>!(a!=null&&a.has(g)))}}return{top:((c=l==null?void 0:l.top)!=null?c:[]).filter(g=>!(a!=null&&a.has(g))),bottom:((u=l==null?void 0:l.bottom)!=null?u:[]).filter(g=>!(a!=null&&a.has(g)))}})},e.getCanPin=()=>{var n;const{enableRowPinning:r,enablePinning:o}=t.options;return typeof r=="function"?r(e):(n=r??o)!=null?n:!0},e.getIsPinned=()=>{const n=[e.id],{top:r,bottom:o}=t.getState().rowPinning,i=n.some(a=>r==null?void 0:r.includes(a)),s=n.some(a=>o==null?void 0:o.includes(a));return i?"top":s?"bottom":!1},e.getPinnedIndex=()=>{var n,r;const o=e.getIsPinned();if(!o)return-1;const i=(n=o==="top"?t.getTopRows():t.getBottomRows())==null?void 0:n.map(s=>{let{id:a}=s;return a});return(r=i==null?void 0:i.indexOf(e.id))!=null?r:-1}},createTable:e=>{e.setRowPinning=t=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,r;return e.setRowPinning(t?Db():(n=(r=e.initialState)==null?void 0:r.rowPinning)!=null?n:Db())},e.getIsSomeRowsPinned=t=>{var n;const r=e.getState().rowPinning;if(!t){var o,i;return!!((o=r.top)!=null&&o.length||(i=r.bottom)!=null&&i.length)}return!!((n=r[t])!=null&&n.length)},e._getPinnedRows=(t,n,r)=>{var o;return((o=e.options.keepPinnedRows)==null||o?(n??[]).map(s=>{const a=e.getRow(s,!0);return a.getIsAllParentsExpanded()?a:null}):(n??[]).map(s=>t.find(a=>a.id===s))).filter(Boolean).map(s=>({...s,position:r}))},e.getTopRows=we(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),Se(e.options,"debugRows","getTopRows")),e.getBottomRows=we(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),Se(e.options,"debugRows","getBottomRows")),e.getCenterRows=we(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(t,n,r)=>{const o=new Set([...n??[],...r??[]]);return t.filter(i=>!o.has(i.id))},Se(e.options,"debugRows","getCenterRows"))}},sJ={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:br("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var n;return e.setRowSelection(t?{}:(n=e.initialState.rowSelection)!=null?n:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection(n=>{t=typeof t<"u"?t:!e.getIsAllRowsSelected();const r={...n},o=e.getPreGroupedRowModel().flatRows;return t?o.forEach(i=>{i.getCanSelect()&&(r[i.id]=!0)}):o.forEach(i=>{delete r[i.id]}),r})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{const r=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),o={...n};return e.getRowModel().rows.forEach(i=>{ry(o,i.id,r,!0,e)}),o}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=we(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?Tb(e,n):{rows:[],flatRows:[],rowsById:{}},Se(e.options,"debugTable","getSelectedRowModel")),e.getFilteredSelectedRowModel=we(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?Tb(e,n):{rows:[],flatRows:[],rowsById:{}},Se(e.options,"debugTable","getFilteredSelectedRowModel")),e.getGroupedSelectedRowModel=we(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?Tb(e,n):{rows:[],flatRows:[],rowsById:{}},Se(e.options,"debugTable","getGroupedSelectedRowModel")),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let r=!!(t.length&&Object.keys(n).length);return r&&t.some(o=>o.getCanSelect()&&!n[o.id])&&(r=!1),r},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter(o=>o.getCanSelect()),{rowSelection:n}=e.getState();let r=!!t.length;return r&&t.some(o=>!n[o.id])&&(r=!1),r},e.getIsSomeRowsSelected=()=>{var t;const n=Object.keys((t=e.getState().rowSelection)!=null?t:{}).length;return n>0&&n<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:t.filter(n=>n.getCanSelect()).some(n=>n.getIsSelected()||n.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,r)=>{const o=e.getIsSelected();t.setRowSelection(i=>{var s;if(n=typeof n<"u"?n:!o,e.getCanSelect()&&o===n)return i;const a={...i};return ry(a,e.id,n,(s=r==null?void 0:r.selectChildren)!=null?s:!0,t),a})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return o1(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return oy(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return oy(e,n)==="all"},e.getCanSelect=()=>{var n;return typeof t.options.enableRowSelection=="function"?t.options.enableRowSelection(e):(n=t.options.enableRowSelection)!=null?n:!0},e.getCanSelectSubRows=()=>{var n;return typeof t.options.enableSubRowSelection=="function"?t.options.enableSubRowSelection(e):(n=t.options.enableSubRowSelection)!=null?n:!0},e.getCanMultiSelect=()=>{var n;return typeof t.options.enableMultiRowSelection=="function"?t.options.enableMultiRowSelection(e):(n=t.options.enableMultiRowSelection)!=null?n:!0},e.getToggleSelectedHandler=()=>{const n=e.getCanSelect();return r=>{var o;n&&e.toggleSelected((o=r.target)==null?void 0:o.checked)}}}},ry=(e,t,n,r,o)=>{var i;const s=o.getRow(t,!0);n?(s.getCanMultiSelect()||Object.keys(e).forEach(a=>delete e[a]),s.getCanSelect()&&(e[t]=!0)):delete e[t],r&&(i=s.subRows)!=null&&i.length&&s.getCanSelectSubRows()&&s.subRows.forEach(a=>ry(e,a.id,n,r,o))};function Tb(e,t){const n=e.getState().rowSelection,r=[],o={},i=function(s,a){return s.map(l=>{var c;const u=o1(l,n);if(u&&(r.push(l),o[l.id]=l),(c=l.subRows)!=null&&c.length&&(l={...l,subRows:i(l.subRows)}),u)return l}).filter(Boolean)};return{rows:i(t.rows),flatRows:r,rowsById:o}}function o1(e,t){var n;return(n=t[e.id])!=null?n:!1}function oy(e,t,n){var r;if(!((r=e.subRows)!=null&&r.length))return!1;let o=!0,i=!1;return e.subRows.forEach(s=>{if(!(i&&!o)&&(s.getCanSelect()&&(o1(s,t)?i=!0:o=!1),s.subRows&&s.subRows.length)){const a=oy(s,t);a==="all"?i=!0:(a==="some"&&(i=!0),o=!1)}}),o?"all":i?"some":!1}const iy=/([0-9]+)/gm,aJ=(e,t,n)=>dI(qi(e.getValue(n)).toLowerCase(),qi(t.getValue(n)).toLowerCase()),lJ=(e,t,n)=>dI(qi(e.getValue(n)),qi(t.getValue(n))),cJ=(e,t,n)=>i1(qi(e.getValue(n)).toLowerCase(),qi(t.getValue(n)).toLowerCase()),uJ=(e,t,n)=>i1(qi(e.getValue(n)),qi(t.getValue(n))),dJ=(e,t,n)=>{const r=e.getValue(n),o=t.getValue(n);return r>o?1:r<o?-1:0},fJ=(e,t,n)=>i1(e.getValue(n),t.getValue(n));function i1(e,t){return e===t?0:e>t?1:-1}function qi(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function dI(e,t){const n=e.split(iy).filter(Boolean),r=t.split(iy).filter(Boolean);for(;n.length&&r.length;){const o=n.shift(),i=r.shift(),s=parseInt(o,10),a=parseInt(i,10),l=[s,a].sort();if(isNaN(l[0])){if(o>i)return 1;if(i>o)return-1;continue}if(isNaN(l[1]))return isNaN(s)?-1:1;if(s>a)return 1;if(a>s)return-1}return n.length-r.length}const kc={alphanumeric:aJ,alphanumericCaseSensitive:lJ,text:cJ,textCaseSensitive:uJ,datetime:dJ,basic:fJ},hJ={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:br("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let r=!1;for(const o of n){const i=o==null?void 0:o.getValue(e.id);if(Object.prototype.toString.call(i)==="[object Date]")return kc.datetime;if(typeof i=="string"&&(r=!0,i.split(iy).length>1))return kc.alphanumeric}return r?kc.text:kc.basic},e.getAutoSortDir=()=>{const n=t.getFilteredRowModel().flatRows[0];return typeof(n==null?void 0:n.getValue(e.id))=="string"?"asc":"desc"},e.getSortingFn=()=>{var n,r;if(!e)throw new Error;return Ng(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(n=(r=t.options.sortingFns)==null?void 0:r[e.columnDef.sortingFn])!=null?n:kc[e.columnDef.sortingFn]},e.toggleSorting=(n,r)=>{const o=e.getNextSortingOrder(),i=typeof n<"u"&&n!==null;t.setSorting(s=>{const a=s==null?void 0:s.find(f=>f.id===e.id),l=s==null?void 0:s.findIndex(f=>f.id===e.id);let c=[],u,d=i?n:o==="desc";if(s!=null&&s.length&&e.getCanMultiSort()&&r?a?u="toggle":u="add":s!=null&&s.length&&l!==s.length-1?u="replace":a?u="toggle":u="replace",u==="toggle"&&(i||o||(u="remove")),u==="add"){var h;c=[...s,{id:e.id,desc:d}],c.splice(0,c.length-((h=t.options.maxMultiSortColCount)!=null?h:Number.MAX_SAFE_INTEGER))}else u==="toggle"?c=s.map(f=>f.id===e.id?{...f,desc:d}:f):u==="remove"?c=s.filter(f=>f.id!==e.id):c=[{id:e.id,desc:d}];return c})},e.getFirstSortDir=()=>{var n,r;return((n=(r=e.columnDef.sortDescFirst)!=null?r:t.options.sortDescFirst)!=null?n:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=n=>{var r,o;const i=e.getFirstSortDir(),s=e.getIsSorted();return s?s!==i&&((r=t.options.enableSortingRemoval)==null||r)&&(!(n&&(o=t.options.enableMultiRemove)!=null)||o)?!1:s==="desc"?"asc":"desc":i},e.getCanSort=()=>{var n,r;return((n=e.columnDef.enableSorting)!=null?n:!0)&&((r=t.options.enableSorting)!=null?r:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,r;return(n=(r=e.columnDef.enableMultiSort)!=null?r:t.options.enableMultiSort)!=null?n:!!e.accessorFn},e.getIsSorted=()=>{var n;const r=(n=t.getState().sorting)==null?void 0:n.find(o=>o.id===e.id);return r?r.desc?"desc":"asc":!1},e.getSortIndex=()=>{var n,r;return(n=(r=t.getState().sorting)==null?void 0:r.findIndex(o=>o.id===e.id))!=null?n:-1},e.clearSorting=()=>{t.setSorting(n=>n!=null&&n.length?n.filter(r=>r.id!==e.id):[])},e.getToggleSortingHandler=()=>{const n=e.getCanSort();return r=>{n&&(r.persist==null||r.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?t.options.isMultiSortEvent==null?void 0:t.options.isMultiSortEvent(r):!1))}}},createTable:e=>{e.setSorting=t=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,r;e.setSorting(t?[]:(n=(r=e.initialState)==null?void 0:r.sorting)!=null?n:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},pJ=[NQ,eJ,XQ,QQ,FQ,LQ,tJ,nJ,hJ,YQ,rJ,oJ,iJ,sJ,JQ];function gJ(e){var t,n;process.env.NODE_ENV!=="production"&&(e.debugAll||e.debugTable)&&console.info("Creating Table Instance...");const r=[...pJ,...(t=e._features)!=null?t:[]];let o={_features:r};const i=o._features.reduce((h,f)=>Object.assign(h,f.getDefaultOptions==null?void 0:f.getDefaultOptions(o)),{}),s=h=>o.options.mergeOptions?o.options.mergeOptions(i,h):{...i,...h};let l={...{},...(n=e.initialState)!=null?n:{}};o._features.forEach(h=>{var f;l=(f=h.getInitialState==null?void 0:h.getInitialState(l))!=null?f:l});const c=[];let u=!1;const d={_features:r,options:{...i,...e},initialState:l,_queue:h=>{c.push(h),u||(u=!0,Promise.resolve().then(()=>{for(;c.length;)c.shift()();u=!1}).catch(f=>setTimeout(()=>{throw f})))},reset:()=>{o.setState(o.initialState)},setOptions:h=>{const f=Ti(h,o.options);o.options=s(f)},getState:()=>o.options.state,setState:h=>{o.options.onStateChange==null||o.options.onStateChange(h)},_getRowId:(h,f,p)=>{var g;return(g=o.options.getRowId==null?void 0:o.options.getRowId(h,f,p))!=null?g:`${p?[p.id,f].join("."):f}`},getCoreRowModel:()=>(o._getCoreRowModel||(o._getCoreRowModel=o.options.getCoreRowModel(o)),o._getCoreRowModel()),getRowModel:()=>o.getPaginationRowModel(),getRow:(h,f)=>{let p=(f?o.getPrePaginationRowModel():o.getRowModel()).rowsById[h];if(!p&&(p=o.getCoreRowModel().rowsById[h],!p))throw process.env.NODE_ENV!=="production"?new Error(`getRow could not find row with ID: ${h}`):new Error;return p},_getDefaultColumnDef:we(()=>[o.options.defaultColumn],h=>{var f;return h=(f=h)!=null?f:{},{header:p=>{const g=p.header.column.columnDef;return g.accessorKey?g.accessorKey:g.accessorFn?g.id:null},cell:p=>{var g,b;return(g=(b=p.renderValue())==null||b.toString==null?void 0:b.toString())!=null?g:null},...o._features.reduce((p,g)=>Object.assign(p,g.getDefaultColumnDef==null?void 0:g.getDefaultColumnDef()),{}),...h}},Se(e,"debugColumns","_getDefaultColumnDef")),_getColumnDefs:()=>o.options.columns,getAllColumns:we(()=>[o._getColumnDefs()],h=>{const f=function(p,g,b){return b===void 0&&(b=0),p.map(v=>{const x=AQ(o,v,b,g),y=v;return x.columns=y.columns?f(y.columns,x,b+1):[],x})};return f(h)},Se(e,"debugColumns","getAllColumns")),getAllFlatColumns:we(()=>[o.getAllColumns()],h=>h.flatMap(f=>f.getFlatColumns()),Se(e,"debugColumns","getAllFlatColumns")),_getAllFlatColumnsById:we(()=>[o.getAllFlatColumns()],h=>h.reduce((f,p)=>(f[p.id]=p,f),{}),Se(e,"debugColumns","getAllFlatColumnsById")),getAllLeafColumns:we(()=>[o.getAllColumns(),o._getOrderColumnsFn()],(h,f)=>{let p=h.flatMap(g=>g.getLeafColumns());return f(p)},Se(e,"debugColumns","getAllLeafColumns")),getColumn:h=>{const f=o._getAllFlatColumnsById()[h];return process.env.NODE_ENV!=="production"&&!f&&console.error(`[Table] Column with id '${h}' does not exist.`),f}};Object.assign(o,d);for(let h=0;h<o._features.length;h++){const f=o._features[h];f==null||f.createTable==null||f.createTable(o)}return o}function fI(){return e=>we(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(o,i,s){i===void 0&&(i=0);const a=[];for(let c=0;c<o.length;c++){const u=jQ(e,e._getRowId(o[c],c,s),o[c],c,i,void 0,s==null?void 0:s.id);if(n.flatRows.push(u),n.rowsById[u.id]=u,a.push(u),e.options.getSubRows){var l;u.originalSubRows=e.options.getSubRows(o[c],c),(l=u.originalSubRows)!=null&&l.length&&(u.subRows=r(u.originalSubRows,i+1,u))}}return a};return n.rows=r(t),n},Se(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function mJ(e){const t=[],n=r=>{var o;t.push(r),(o=r.subRows)!=null&&o.length&&r.getIsExpanded()&&r.subRows.forEach(n)};return e.rows.forEach(n),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}function hI(e){return t=>we(()=>[t.getState().pagination,t.getPrePaginationRowModel(),t.options.paginateExpandedRows?void 0:t.getState().expanded],(n,r)=>{if(!r.rows.length)return r;const{pageSize:o,pageIndex:i}=n;let{rows:s,flatRows:a,rowsById:l}=r;const c=o*i,u=c+o;s=s.slice(c,u);let d;t.options.paginateExpandedRows?d={rows:s,flatRows:a,rowsById:l}:d=mJ({rows:s,flatRows:a,rowsById:l}),d.flatRows=[];const h=f=>{d.flatRows.push(f),f.subRows.length&&f.subRows.forEach(h)};return d.rows.forEach(h),d},Se(t.options,"debugTable","getPaginationRowModel"))}function pI(){return e=>we(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||!(t!=null&&t.length))return n;const r=e.getState().sorting,o=[],i=r.filter(l=>{var c;return(c=e.getColumn(l.id))==null?void 0:c.getCanSort()}),s={};i.forEach(l=>{const c=e.getColumn(l.id);c&&(s[l.id]={sortUndefined:c.columnDef.sortUndefined,invertSorting:c.columnDef.invertSorting,sortingFn:c.getSortingFn()})});const a=l=>{const c=l.map(u=>({...u}));return c.sort((u,d)=>{for(let f=0;f<i.length;f+=1){var h;const p=i[f],g=s[p.id],b=g.sortUndefined,v=(h=p==null?void 0:p.desc)!=null?h:!1;let x=0;if(b){const y=u.getValue(p.id),_=d.getValue(p.id),w=y===void 0,C=_===void 0;if(w||C){if(b==="first")return w?-1:1;if(b==="last")return w?1:-1;x=w&&C?0:w?b:-b}}if(x===0&&(x=g.sortingFn(u,d,p.id)),x!==0)return v&&(x*=-1),g.invertSorting&&(x*=-1),x}return u.index-d.index}),c.forEach(u=>{var d;o.push(u),(d=u.subRows)!=null&&d.length&&(u.subRows=a(u.subRows))}),c};return{rows:a(n.rows),flatRows:o,rowsById:n.rowsById}},Se(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}/**
258
- * react-table
259
- *
260
- * Copyright (c) TanStack
261
- *
262
- * This source code is licensed under the MIT license found in the
263
- * LICENSE.md file in the root directory of this source tree.
264
- *
265
- * @license MIT
266
- */function sy(e,t){return e?bJ(e)?S.createElement(e,t):e:null}function bJ(e){return vJ(e)||typeof e=="function"||yJ(e)}function vJ(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function yJ(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function gI(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=S.useState(()=>({current:gJ(t)})),[r,o]=S.useState(()=>n.current.initialState);return n.current.setOptions(i=>({...i,...e,state:{...r,...e.state},onStateChange:s=>{o(s),e.onStateChange==null||e.onStateChange(s)}})),n.current}function ay(e,[t,n]){return Math.min(n,Math.max(t,e))}var Ib=0;function jg(){S.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??PR()),document.body.insertAdjacentElement("beforeend",e[1]??PR()),Ib++,()=>{Ib===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Ib--}},[])}function PR(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Ab="focusScope.autoFocusOnMount",Nb="focusScope.autoFocusOnUnmount",MR={bubbles:!1,cancelable:!0},xJ="FocusScope",Md=S.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=e,[a,l]=S.useState(null),c=Gt(o),u=Gt(i),d=S.useRef(null),h=Oe(t,g=>l(g)),f=S.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;S.useEffect(()=>{if(r){let g=function(y){if(f.paused||!a)return;const _=y.target;a.contains(_)?d.current=_:vi(d.current,{select:!0})},b=function(y){if(f.paused||!a)return;const _=y.relatedTarget;_!==null&&(a.contains(_)||vi(d.current,{select:!0}))},v=function(y){if(document.activeElement===document.body)for(const w of y)w.removedNodes.length>0&&vi(a)};document.addEventListener("focusin",g),document.addEventListener("focusout",b);const x=new MutationObserver(v);return a&&x.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",g),document.removeEventListener("focusout",b),x.disconnect()}}},[r,a,f.paused]),S.useEffect(()=>{if(a){OR.add(f);const g=document.activeElement;if(!a.contains(g)){const v=new CustomEvent(Ab,MR);a.addEventListener(Ab,c),a.dispatchEvent(v),v.defaultPrevented||(wJ(RJ(mI(a)),{select:!0}),document.activeElement===g&&vi(a))}return()=>{a.removeEventListener(Ab,c),setTimeout(()=>{const v=new CustomEvent(Nb,MR);a.addEventListener(Nb,u),a.dispatchEvent(v),v.defaultPrevented||vi(g??document.body,{select:!0}),a.removeEventListener(Nb,u),OR.remove(f)},0)}}},[a,c,u,f]);const p=S.useCallback(g=>{if(!n&&!r||f.paused)return;const b=g.key==="Tab"&&!g.altKey&&!g.ctrlKey&&!g.metaKey,v=document.activeElement;if(b&&v){const x=g.currentTarget,[y,_]=SJ(x);y&&_?!g.shiftKey&&v===_?(g.preventDefault(),n&&vi(y,{select:!0})):g.shiftKey&&v===y&&(g.preventDefault(),n&&vi(_,{select:!0})):v===x&&g.preventDefault()}},[n,r,f.paused]);return m.jsx(pe.div,{tabIndex:-1,...s,ref:h,onKeyDown:p})});Md.displayName=xJ;function wJ(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(vi(r,{select:t}),document.activeElement!==n)return}function SJ(e){const t=mI(e),n=kR(t,e),r=kR(t.reverse(),e);return[n,r]}function mI(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function kR(e,t){for(const n of e)if(!CJ(n,{upTo:t}))return n}function CJ(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function _J(e){return e instanceof HTMLInputElement&&"select"in e}function vi(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&_J(e)&&t&&e.select()}}var OR=EJ();function EJ(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=DR(e,t),e.unshift(t)},remove(t){var n;e=DR(e,t),(n=e[0])==null||n.resume()}}}function DR(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function RJ(e){return e.filter(t=>t.tagName!=="A")}function Fg(e){const t=S.useRef({value:e,previous:e});return S.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var PJ=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Ta=new WeakMap,Vf=new WeakMap,Hf={},jb=0,bI=function(e){return e&&(e.host||bI(e.parentNode))},MJ=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=bI(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},kJ=function(e,t,n,r){var o=MJ(t,Array.isArray(e)?e:[e]);Hf[n]||(Hf[n]=new WeakMap);var i=Hf[n],s=[],a=new Set,l=new Set(o),c=function(d){!d||a.has(d)||(a.add(d),c(d.parentNode))};o.forEach(c);var u=function(d){!d||l.has(d)||Array.prototype.forEach.call(d.children,function(h){if(a.has(h))u(h);else try{var f=h.getAttribute(r),p=f!==null&&f!=="false",g=(Ta.get(h)||0)+1,b=(i.get(h)||0)+1;Ta.set(h,g),i.set(h,b),s.push(h),g===1&&p&&Vf.set(h,!0),b===1&&h.setAttribute(n,"true"),p||h.setAttribute(r,"true")}catch(v){console.error("aria-hidden: cannot operate on ",h,v)}})};return u(t),a.clear(),jb++,function(){s.forEach(function(d){var h=Ta.get(d)-1,f=i.get(d)-1;Ta.set(d,h),i.set(d,f),h||(Vf.has(d)||d.removeAttribute(r),Vf.delete(d)),f||d.removeAttribute(n)}),jb--,jb||(Ta=new WeakMap,Ta=new WeakMap,Vf=new WeakMap,Hf={})}},Lg=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=PJ(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),kJ(r,o,n,"aria-hidden")):function(){return null}},uo=function(){return uo=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},uo.apply(this,arguments)};function vI(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function OJ(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,i;r<o;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var Sh="right-scroll-bar-position",Ch="width-before-scroll-bar",DJ="with-scroll-bars-hidden",TJ="--removed-body-scroll-bar-size";function Fb(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function IJ(e,t){var n=E.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var AJ=typeof window<"u"?S.useLayoutEffect:S.useEffect,TR=new WeakMap;function NJ(e,t){var n=IJ(null,function(r){return e.forEach(function(o){return Fb(o,r)})});return AJ(function(){var r=TR.get(n);if(r){var o=new Set(r),i=new Set(e),s=n.current;o.forEach(function(a){i.has(a)||Fb(a,null)}),i.forEach(function(a){o.has(a)||Fb(a,s)})}TR.set(n,e)},[e]),n}function jJ(e){return e}function FJ(e,t){t===void 0&&(t=jJ);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(i){var s=t(i,r);return n.push(s),function(){n=n.filter(function(a){return a!==s})}},assignSyncMedium:function(i){for(r=!0;n.length;){var s=n;n=[],s.forEach(i)}n={push:function(a){return i(a)},filter:function(){return n}}},assignMedium:function(i){r=!0;var s=[];if(n.length){var a=n;n=[],a.forEach(i),s=n}var l=function(){var u=s;s=[],u.forEach(i)},c=function(){return Promise.resolve().then(l)};c(),n={push:function(u){s.push(u),c()},filter:function(u){return s=s.filter(u),n}}}};return o}function LJ(e){e===void 0&&(e={});var t=FJ(null);return t.options=uo({async:!0,ssr:!1},e),t}var yI=function(e){var t=e.sideCar,n=vI(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return S.createElement(r,uo({},n))};yI.isSideCarExport=!0;function $J(e,t){return e.useMedium(t),yI}var xI=LJ(),Lb=function(){},$g=S.forwardRef(function(e,t){var n=S.useRef(null),r=S.useState({onScrollCapture:Lb,onWheelCapture:Lb,onTouchMoveCapture:Lb}),o=r[0],i=r[1],s=e.forwardProps,a=e.children,l=e.className,c=e.removeScrollBar,u=e.enabled,d=e.shards,h=e.sideCar,f=e.noIsolation,p=e.inert,g=e.allowPinchZoom,b=e.as,v=b===void 0?"div":b,x=e.gapMode,y=vI(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),_=h,w=NJ([n,t]),C=uo(uo({},y),o);return S.createElement(S.Fragment,null,u&&S.createElement(_,{sideCar:xI,removeScrollBar:c,shards:d,noIsolation:f,inert:p,setCallbacks:i,allowPinchZoom:!!g,lockRef:n,gapMode:x}),s?S.cloneElement(S.Children.only(a),uo(uo({},C),{ref:w})):S.createElement(v,uo({},C,{className:l,ref:w}),a))});$g.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};$g.classNames={fullWidth:Ch,zeroRight:Sh};var zJ=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function BJ(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=zJ();return t&&e.setAttribute("nonce",t),e}function VJ(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function HJ(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var WJ=function(){var e=0,t=null;return{add:function(n){e==0&&(t=BJ())&&(VJ(t,n),HJ(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},UJ=function(){var e=WJ();return function(t,n){S.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},wI=function(){var e=UJ(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},qJ={left:0,top:0,right:0,gap:0},$b=function(e){return parseInt(e||"",10)||0},GJ=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[$b(n),$b(r),$b(o)]},YJ=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return qJ;var t=GJ(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},KJ=wI(),sl="data-scroll-locked",XJ=function(e,t,n,r){var o=e.left,i=e.top,s=e.right,a=e.gap;return n===void 0&&(n="margin"),`
267
- .`.concat(DJ,` {
268
- overflow: hidden `).concat(r,`;
269
- padding-right: `).concat(a,"px ").concat(r,`;
270
- }
271
- body[`).concat(sl,`] {
272
- overflow: hidden `).concat(r,`;
273
- overscroll-behavior: contain;
274
- `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
275
- padding-left: `.concat(o,`px;
276
- padding-top: `).concat(i,`px;
277
- padding-right: `).concat(s,`px;
278
- margin-left:0;
279
- margin-top:0;
280
- margin-right: `).concat(a,"px ").concat(r,`;
281
- `),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),`
282
- }
283
-
284
- .`).concat(Sh,` {
285
- right: `).concat(a,"px ").concat(r,`;
286
- }
287
-
288
- .`).concat(Ch,` {
289
- margin-right: `).concat(a,"px ").concat(r,`;
290
- }
291
-
292
- .`).concat(Sh," .").concat(Sh,` {
293
- right: 0 `).concat(r,`;
294
- }
295
-
296
- .`).concat(Ch," .").concat(Ch,` {
297
- margin-right: 0 `).concat(r,`;
298
- }
299
-
300
- body[`).concat(sl,`] {
301
- `).concat(TJ,": ").concat(a,`px;
302
- }
303
- `)},IR=function(){var e=parseInt(document.body.getAttribute(sl)||"0",10);return isFinite(e)?e:0},QJ=function(){S.useEffect(function(){return document.body.setAttribute(sl,(IR()+1).toString()),function(){var e=IR()-1;e<=0?document.body.removeAttribute(sl):document.body.setAttribute(sl,e.toString())}},[])},JJ=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;QJ();var i=S.useMemo(function(){return YJ(o)},[o]);return S.createElement(KJ,{styles:XJ(i,!t,o,n?"":"!important")})},ly=!1;if(typeof window<"u")try{var Wf=Object.defineProperty({},"passive",{get:function(){return ly=!0,!0}});window.addEventListener("test",Wf,Wf),window.removeEventListener("test",Wf,Wf)}catch{ly=!1}var Ia=ly?{passive:!1}:!1,ZJ=function(e){return e.tagName==="TEXTAREA"},SI=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!ZJ(e)&&n[t]==="visible")},eZ=function(e){return SI(e,"overflowY")},tZ=function(e){return SI(e,"overflowX")},AR=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=CI(e,r);if(o){var i=_I(e,r),s=i[1],a=i[2];if(s>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},nZ=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},rZ=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},CI=function(e,t){return e==="v"?eZ(t):tZ(t)},_I=function(e,t){return e==="v"?nZ(t):rZ(t)},oZ=function(e,t){return e==="h"&&t==="rtl"?-1:1},iZ=function(e,t,n,r,o){var i=oZ(e,window.getComputedStyle(t).direction),s=i*r,a=n.target,l=t.contains(a),c=!1,u=s>0,d=0,h=0;do{var f=_I(e,a),p=f[0],g=f[1],b=f[2],v=g-b-i*p;(p||v)&&CI(e,a)&&(d+=v,h+=p),a instanceof ShadowRoot?a=a.host:a=a.parentNode}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(u&&Math.abs(d)<1||!u&&Math.abs(h)<1)&&(c=!0),c},Uf=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},NR=function(e){return[e.deltaX,e.deltaY]},jR=function(e){return e&&"current"in e?e.current:e},sZ=function(e,t){return e[0]===t[0]&&e[1]===t[1]},aZ=function(e){return`
304
- .block-interactivity-`.concat(e,` {pointer-events: none;}
305
- .allow-interactivity-`).concat(e,` {pointer-events: all;}
306
- `)},lZ=0,Aa=[];function cZ(e){var t=S.useRef([]),n=S.useRef([0,0]),r=S.useRef(),o=S.useState(lZ++)[0],i=S.useState(wI)[0],s=S.useRef(e);S.useEffect(function(){s.current=e},[e]),S.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var g=OJ([e.lockRef.current],(e.shards||[]).map(jR),!0).filter(Boolean);return g.forEach(function(b){return b.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),g.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=S.useCallback(function(g,b){if("touches"in g&&g.touches.length===2||g.type==="wheel"&&g.ctrlKey)return!s.current.allowPinchZoom;var v=Uf(g),x=n.current,y="deltaX"in g?g.deltaX:x[0]-v[0],_="deltaY"in g?g.deltaY:x[1]-v[1],w,C=g.target,R=Math.abs(y)>Math.abs(_)?"h":"v";if("touches"in g&&R==="h"&&C.type==="range")return!1;var k=AR(R,C);if(!k)return!0;if(k?w=R:(w=R==="v"?"h":"v",k=AR(R,C)),!k)return!1;if(!r.current&&"changedTouches"in g&&(y||_)&&(r.current=w),!w)return!0;var D=r.current||w;return iZ(D,b,g,D==="h"?y:_)},[]),l=S.useCallback(function(g){var b=g;if(!(!Aa.length||Aa[Aa.length-1]!==i)){var v="deltaY"in b?NR(b):Uf(b),x=t.current.filter(function(w){return w.name===b.type&&(w.target===b.target||b.target===w.shadowParent)&&sZ(w.delta,v)})[0];if(x&&x.should){b.cancelable&&b.preventDefault();return}if(!x){var y=(s.current.shards||[]).map(jR).filter(Boolean).filter(function(w){return w.contains(b.target)}),_=y.length>0?a(b,y[0]):!s.current.noIsolation;_&&b.cancelable&&b.preventDefault()}}},[]),c=S.useCallback(function(g,b,v,x){var y={name:g,delta:b,target:v,should:x,shadowParent:uZ(v)};t.current.push(y),setTimeout(function(){t.current=t.current.filter(function(_){return _!==y})},1)},[]),u=S.useCallback(function(g){n.current=Uf(g),r.current=void 0},[]),d=S.useCallback(function(g){c(g.type,NR(g),g.target,a(g,e.lockRef.current))},[]),h=S.useCallback(function(g){c(g.type,Uf(g),g.target,a(g,e.lockRef.current))},[]);S.useEffect(function(){return Aa.push(i),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:h}),document.addEventListener("wheel",l,Ia),document.addEventListener("touchmove",l,Ia),document.addEventListener("touchstart",u,Ia),function(){Aa=Aa.filter(function(g){return g!==i}),document.removeEventListener("wheel",l,Ia),document.removeEventListener("touchmove",l,Ia),document.removeEventListener("touchstart",u,Ia)}},[]);var f=e.removeScrollBar,p=e.inert;return S.createElement(S.Fragment,null,p?S.createElement(i,{styles:aZ(o)}):null,f?S.createElement(JJ,{gapMode:e.gapMode}):null)}function uZ(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const dZ=$J(xI,cZ);var kd=S.forwardRef(function(e,t){return S.createElement($g,uo({},e,{ref:t,sideCar:dZ}))});kd.classNames=$g.classNames;var fZ=[" ","Enter","ArrowUp","ArrowDown"],hZ=[" ","Enter"],Od="Select",[zg,Bg,pZ]=Kp(Od),[cc,fve]=Kt(Od,[pZ,To]),Vg=To(),[gZ,Zi]=cc(Od),[mZ,bZ]=cc(Od),EI=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:i,value:s,defaultValue:a,onValueChange:l,dir:c,name:u,autoComplete:d,disabled:h,required:f,form:p}=e,g=Vg(t),[b,v]=S.useState(null),[x,y]=S.useState(null),[_,w]=S.useState(!1),C=ga(c),[R=!1,k]=yn({prop:r,defaultProp:o,onChange:i}),[D,I]=yn({prop:s,defaultProp:a,onChange:l}),T=S.useRef(null),N=b?p||!!b.closest("form"):!0,[G,z]=S.useState(new Set),O=Array.from(G).map(A=>A.props.value).join(";");return m.jsx(Cd,{...g,children:m.jsxs(gZ,{required:f,scope:t,trigger:b,onTriggerChange:v,valueNode:x,onValueNodeChange:y,valueNodeHasChildren:_,onValueNodeHasChildrenChange:w,contentId:Ut(),value:D,onValueChange:I,open:R,onOpenChange:k,dir:C,triggerPointerDownPosRef:T,disabled:h,children:[m.jsx(zg.Provider,{scope:t,children:m.jsx(mZ,{scope:e.__scopeSelect,onNativeOptionAdd:S.useCallback(A=>{z(L=>new Set(L).add(A))},[]),onNativeOptionRemove:S.useCallback(A=>{z(L=>{const j=new Set(L);return j.delete(A),j})},[]),children:n})}),N?m.jsxs(QI,{"aria-hidden":!0,required:f,tabIndex:-1,name:u,autoComplete:d,value:D,onChange:A=>I(A.target.value),disabled:h,form:p,children:[D===void 0?m.jsx("option",{value:""}):null,Array.from(G)]},O):null]})})};EI.displayName=Od;var RI="SelectTrigger",PI=S.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,i=Vg(n),s=Zi(RI,n),a=s.disabled||r,l=Oe(t,s.onTriggerChange),c=Bg(n),u=S.useRef("touch"),[d,h,f]=JI(g=>{const b=c().filter(y=>!y.disabled),v=b.find(y=>y.value===s.value),x=ZI(b,g,v);x!==void 0&&s.onValueChange(x.value)}),p=g=>{a||(s.onOpenChange(!0),f()),g&&(s.triggerPointerDownPosRef.current={x:Math.round(g.pageX),y:Math.round(g.pageY)})};return m.jsx(lc,{asChild:!0,...i,children:m.jsx(pe.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":XI(s.value)?"":void 0,...o,ref:l,onClick:ae(o.onClick,g=>{g.currentTarget.focus(),u.current!=="mouse"&&p(g)}),onPointerDown:ae(o.onPointerDown,g=>{u.current=g.pointerType;const b=g.target;b.hasPointerCapture(g.pointerId)&&b.releasePointerCapture(g.pointerId),g.button===0&&g.ctrlKey===!1&&g.pointerType==="mouse"&&(p(g),g.preventDefault())}),onKeyDown:ae(o.onKeyDown,g=>{const b=d.current!=="";!(g.ctrlKey||g.altKey||g.metaKey)&&g.key.length===1&&h(g.key),!(b&&g.key===" ")&&fZ.includes(g.key)&&(p(),g.preventDefault())})})})});PI.displayName=RI;var MI="SelectValue",kI=S.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:i,placeholder:s="",...a}=e,l=Zi(MI,n),{onValueNodeHasChildrenChange:c}=l,u=i!==void 0,d=Oe(t,l.onValueNodeChange);return rn(()=>{c(u)},[c,u]),m.jsx(pe.span,{...a,ref:d,style:{pointerEvents:"none"},children:XI(l.value)?m.jsx(m.Fragment,{children:s}):i})});kI.displayName=MI;var vZ="SelectIcon",OI=S.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return m.jsx(pe.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});OI.displayName=vZ;var yZ="SelectPortal",DI=e=>m.jsx(Rd,{asChild:!0,...e});DI.displayName=yZ;var la="SelectContent",TI=S.forwardRef((e,t)=>{const n=Zi(la,e.__scopeSelect),[r,o]=S.useState();if(rn(()=>{o(new DocumentFragment)},[]),!n.open){const i=r;return i?Js.createPortal(m.jsx(II,{scope:e.__scopeSelect,children:m.jsx(zg.Slot,{scope:e.__scopeSelect,children:m.jsx("div",{children:e.children})})}),i):null}return m.jsx(AI,{...e,ref:t})});TI.displayName=la;var Nr=10,[II,es]=cc(la),xZ="SelectContentImpl",AI=S.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:i,onPointerDownOutside:s,side:a,sideOffset:l,align:c,alignOffset:u,arrowPadding:d,collisionBoundary:h,collisionPadding:f,sticky:p,hideWhenDetached:g,avoidCollisions:b,...v}=e,x=Zi(la,n),[y,_]=S.useState(null),[w,C]=S.useState(null),R=Oe(t,H=>_(H)),[k,D]=S.useState(null),[I,T]=S.useState(null),N=Bg(n),[G,z]=S.useState(!1),O=S.useRef(!1);S.useEffect(()=>{if(y)return Lg(y)},[y]),jg();const A=S.useCallback(H=>{const[V,...Q]=N().map(J=>J.ref.current),[Z]=Q.slice(-1),ne=document.activeElement;for(const J of H)if(J===ne||(J==null||J.scrollIntoView({block:"nearest"}),J===V&&w&&(w.scrollTop=0),J===Z&&w&&(w.scrollTop=w.scrollHeight),J==null||J.focus(),document.activeElement!==ne))return},[N,w]),L=S.useCallback(()=>A([k,y]),[A,k,y]);S.useEffect(()=>{G&&L()},[G,L]);const{onOpenChange:j,triggerPointerDownPosRef:B}=x;S.useEffect(()=>{if(y){let H={x:0,y:0};const V=Z=>{var ne,J;H={x:Math.abs(Math.round(Z.pageX)-(((ne=B.current)==null?void 0:ne.x)??0)),y:Math.abs(Math.round(Z.pageY)-(((J=B.current)==null?void 0:J.y)??0))}},Q=Z=>{H.x<=10&&H.y<=10?Z.preventDefault():y.contains(Z.target)||j(!1),document.removeEventListener("pointermove",V),B.current=null};return B.current!==null&&(document.addEventListener("pointermove",V),document.addEventListener("pointerup",Q,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",V),document.removeEventListener("pointerup",Q,{capture:!0})}}},[y,j,B]),S.useEffect(()=>{const H=()=>j(!1);return window.addEventListener("blur",H),window.addEventListener("resize",H),()=>{window.removeEventListener("blur",H),window.removeEventListener("resize",H)}},[j]);const[M,W]=JI(H=>{const V=N().filter(ne=>!ne.disabled),Q=V.find(ne=>ne.ref.current===document.activeElement),Z=ZI(V,H,Q);Z&&setTimeout(()=>Z.ref.current.focus())}),F=S.useCallback((H,V,Q)=>{const Z=!O.current&&!Q;(x.value!==void 0&&x.value===V||Z)&&(D(H),Z&&(O.current=!0))},[x.value]),P=S.useCallback(()=>y==null?void 0:y.focus(),[y]),U=S.useCallback((H,V,Q)=>{const Z=!O.current&&!Q;(x.value!==void 0&&x.value===V||Z)&&T(H)},[x.value]),q=r==="popper"?cy:NI,K=q===cy?{side:a,sideOffset:l,align:c,alignOffset:u,arrowPadding:d,collisionBoundary:h,collisionPadding:f,sticky:p,hideWhenDetached:g,avoidCollisions:b}:{};return m.jsx(II,{scope:n,content:y,viewport:w,onViewportChange:C,itemRefCallback:F,selectedItem:k,onItemLeave:P,itemTextRefCallback:U,focusSelectedItem:L,selectedItemText:I,position:r,isPositioned:G,searchRef:M,children:m.jsx(kd,{as:ri,allowPinchZoom:!0,children:m.jsx(Md,{asChild:!0,trapped:x.open,onMountAutoFocus:H=>{H.preventDefault()},onUnmountAutoFocus:ae(o,H=>{var V;(V=x.trigger)==null||V.focus({preventScroll:!0}),H.preventDefault()}),children:m.jsx(wa,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:H=>H.preventDefault(),onDismiss:()=>x.onOpenChange(!1),children:m.jsx(q,{role:"listbox",id:x.contentId,"data-state":x.open?"open":"closed",dir:x.dir,onContextMenu:H=>H.preventDefault(),...v,...K,onPlaced:()=>z(!0),ref:R,style:{display:"flex",flexDirection:"column",outline:"none",...v.style},onKeyDown:ae(v.onKeyDown,H=>{const V=H.ctrlKey||H.altKey||H.metaKey;if(H.key==="Tab"&&H.preventDefault(),!V&&H.key.length===1&&W(H.key),["ArrowUp","ArrowDown","Home","End"].includes(H.key)){let Z=N().filter(ne=>!ne.disabled).map(ne=>ne.ref.current);if(["ArrowUp","End"].includes(H.key)&&(Z=Z.slice().reverse()),["ArrowUp","ArrowDown"].includes(H.key)){const ne=H.target,J=Z.indexOf(ne);Z=Z.slice(J+1)}setTimeout(()=>A(Z)),H.preventDefault()}})})})})})})});AI.displayName=xZ;var wZ="SelectItemAlignedPosition",NI=S.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,i=Zi(la,n),s=es(la,n),[a,l]=S.useState(null),[c,u]=S.useState(null),d=Oe(t,R=>u(R)),h=Bg(n),f=S.useRef(!1),p=S.useRef(!0),{viewport:g,selectedItem:b,selectedItemText:v,focusSelectedItem:x}=s,y=S.useCallback(()=>{if(i.trigger&&i.valueNode&&a&&c&&g&&b&&v){const R=i.trigger.getBoundingClientRect(),k=c.getBoundingClientRect(),D=i.valueNode.getBoundingClientRect(),I=v.getBoundingClientRect();if(i.dir!=="rtl"){const ne=I.left-k.left,J=D.left-ne,oe=R.left-J,ee=R.width+oe,ue=Math.max(ee,k.width),de=window.innerWidth-Nr,ye=ay(J,[Nr,Math.max(Nr,de-ue)]);a.style.minWidth=ee+"px",a.style.left=ye+"px"}else{const ne=k.right-I.right,J=window.innerWidth-D.right-ne,oe=window.innerWidth-R.right-J,ee=R.width+oe,ue=Math.max(ee,k.width),de=window.innerWidth-Nr,ye=ay(J,[Nr,Math.max(Nr,de-ue)]);a.style.minWidth=ee+"px",a.style.right=ye+"px"}const T=h(),N=window.innerHeight-Nr*2,G=g.scrollHeight,z=window.getComputedStyle(c),O=parseInt(z.borderTopWidth,10),A=parseInt(z.paddingTop,10),L=parseInt(z.borderBottomWidth,10),j=parseInt(z.paddingBottom,10),B=O+A+G+j+L,M=Math.min(b.offsetHeight*5,B),W=window.getComputedStyle(g),F=parseInt(W.paddingTop,10),P=parseInt(W.paddingBottom,10),U=R.top+R.height/2-Nr,q=N-U,K=b.offsetHeight/2,H=b.offsetTop+K,V=O+A+H,Q=B-V;if(V<=U){const ne=T.length>0&&b===T[T.length-1].ref.current;a.style.bottom="0px";const J=c.clientHeight-g.offsetTop-g.offsetHeight,oe=Math.max(q,K+(ne?P:0)+J+L),ee=V+oe;a.style.height=ee+"px"}else{const ne=T.length>0&&b===T[0].ref.current;a.style.top="0px";const oe=Math.max(U,O+g.offsetTop+(ne?F:0)+K)+Q;a.style.height=oe+"px",g.scrollTop=V-U+g.offsetTop}a.style.margin=`${Nr}px 0`,a.style.minHeight=M+"px",a.style.maxHeight=N+"px",r==null||r(),requestAnimationFrame(()=>f.current=!0)}},[h,i.trigger,i.valueNode,a,c,g,b,v,i.dir,r]);rn(()=>y(),[y]);const[_,w]=S.useState();rn(()=>{c&&w(window.getComputedStyle(c).zIndex)},[c]);const C=S.useCallback(R=>{R&&p.current===!0&&(y(),x==null||x(),p.current=!1)},[y,x]);return m.jsx(CZ,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:f,onScrollButtonChange:C,children:m.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:_},children:m.jsx(pe.div,{...o,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});NI.displayName=wZ;var SZ="SelectPopperPosition",cy=S.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=Nr,...i}=e,s=Vg(n);return m.jsx(_d,{...s,...i,ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});cy.displayName=SZ;var[CZ,s1]=cc(la,{}),uy="SelectViewport",jI=S.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,i=es(uy,n),s=s1(uy,n),a=Oe(t,i.onViewportChange),l=S.useRef(0);return m.jsxs(m.Fragment,{children:[m.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),m.jsx(zg.Slot,{scope:n,children:m.jsx(pe.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:ae(o.onScroll,c=>{const u=c.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:h}=s;if(h!=null&&h.current&&d){const f=Math.abs(l.current-u.scrollTop);if(f>0){const p=window.innerHeight-Nr*2,g=parseFloat(d.style.minHeight),b=parseFloat(d.style.height),v=Math.max(g,b);if(v<p){const x=v+f,y=Math.min(p,x),_=x-y;d.style.height=y+"px",d.style.bottom==="0px"&&(u.scrollTop=_>0?_:0,d.style.justifyContent="flex-end")}}}l.current=u.scrollTop})})})]})});jI.displayName=uy;var FI="SelectGroup",[_Z,EZ]=cc(FI),LI=S.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Ut();return m.jsx(_Z,{scope:n,id:o,children:m.jsx(pe.div,{role:"group","aria-labelledby":o,...r,ref:t})})});LI.displayName=FI;var $I="SelectLabel",zI=S.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=EZ($I,n);return m.jsx(pe.div,{id:o.id,...r,ref:t})});zI.displayName=$I;var xp="SelectItem",[RZ,BI]=cc(xp),VI=S.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:i,...s}=e,a=Zi(xp,n),l=es(xp,n),c=a.value===r,[u,d]=S.useState(i??""),[h,f]=S.useState(!1),p=Oe(t,x=>{var y;return(y=l.itemRefCallback)==null?void 0:y.call(l,x,r,o)}),g=Ut(),b=S.useRef("touch"),v=()=>{o||(a.onValueChange(r),a.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return m.jsx(RZ,{scope:n,value:r,disabled:o,textId:g,isSelected:c,onItemTextChange:S.useCallback(x=>{d(y=>y||((x==null?void 0:x.textContent)??"").trim())},[]),children:m.jsx(zg.ItemSlot,{scope:n,value:r,disabled:o,textValue:u,children:m.jsx(pe.div,{role:"option","aria-labelledby":g,"data-highlighted":h?"":void 0,"aria-selected":c&&h,"data-state":c?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...s,ref:p,onFocus:ae(s.onFocus,()=>f(!0)),onBlur:ae(s.onBlur,()=>f(!1)),onClick:ae(s.onClick,()=>{b.current!=="mouse"&&v()}),onPointerUp:ae(s.onPointerUp,()=>{b.current==="mouse"&&v()}),onPointerDown:ae(s.onPointerDown,x=>{b.current=x.pointerType}),onPointerMove:ae(s.onPointerMove,x=>{var y;b.current=x.pointerType,o?(y=l.onItemLeave)==null||y.call(l):b.current==="mouse"&&x.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ae(s.onPointerLeave,x=>{var y;x.currentTarget===document.activeElement&&((y=l.onItemLeave)==null||y.call(l))}),onKeyDown:ae(s.onKeyDown,x=>{var _;((_=l.searchRef)==null?void 0:_.current)!==""&&x.key===" "||(hZ.includes(x.key)&&v(),x.key===" "&&x.preventDefault())})})})})});VI.displayName=xp;var Qc="SelectItemText",HI=S.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...i}=e,s=Zi(Qc,n),a=es(Qc,n),l=BI(Qc,n),c=bZ(Qc,n),[u,d]=S.useState(null),h=Oe(t,v=>d(v),l.onItemTextChange,v=>{var x;return(x=a.itemTextRefCallback)==null?void 0:x.call(a,v,l.value,l.disabled)}),f=u==null?void 0:u.textContent,p=S.useMemo(()=>m.jsx("option",{value:l.value,disabled:l.disabled,children:f},l.value),[l.disabled,l.value,f]),{onNativeOptionAdd:g,onNativeOptionRemove:b}=c;return rn(()=>(g(p),()=>b(p)),[g,b,p]),m.jsxs(m.Fragment,{children:[m.jsx(pe.span,{id:l.textId,...i,ref:h}),l.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Js.createPortal(i.children,s.valueNode):null]})});HI.displayName=Qc;var WI="SelectItemIndicator",UI=S.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return BI(WI,n).isSelected?m.jsx(pe.span,{"aria-hidden":!0,...r,ref:t}):null});UI.displayName=WI;var dy="SelectScrollUpButton",qI=S.forwardRef((e,t)=>{const n=es(dy,e.__scopeSelect),r=s1(dy,e.__scopeSelect),[o,i]=S.useState(!1),s=Oe(t,r.onScrollButtonChange);return rn(()=>{if(n.viewport&&n.isPositioned){let a=function(){const c=l.scrollTop>0;i(c)};const l=n.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?m.jsx(YI,{...e,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop-l.offsetHeight)}}):null});qI.displayName=dy;var fy="SelectScrollDownButton",GI=S.forwardRef((e,t)=>{const n=es(fy,e.__scopeSelect),r=s1(fy,e.__scopeSelect),[o,i]=S.useState(!1),s=Oe(t,r.onScrollButtonChange);return rn(()=>{if(n.viewport&&n.isPositioned){let a=function(){const c=l.scrollHeight-l.clientHeight,u=Math.ceil(l.scrollTop)<c;i(u)};const l=n.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?m.jsx(YI,{...e,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop+l.offsetHeight)}}):null});GI.displayName=fy;var YI=S.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,i=es("SelectScrollButton",n),s=S.useRef(null),a=Bg(n),l=S.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return S.useEffect(()=>()=>l(),[l]),rn(()=>{var u;const c=a().find(d=>d.ref.current===document.activeElement);(u=c==null?void 0:c.ref.current)==null||u.scrollIntoView({block:"nearest"})},[a]),m.jsx(pe.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:ae(o.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(r,50))}),onPointerMove:ae(o.onPointerMove,()=>{var c;(c=i.onItemLeave)==null||c.call(i),s.current===null&&(s.current=window.setInterval(r,50))}),onPointerLeave:ae(o.onPointerLeave,()=>{l()})})}),PZ="SelectSeparator",KI=S.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return m.jsx(pe.div,{"aria-hidden":!0,...r,ref:t})});KI.displayName=PZ;var hy="SelectArrow",MZ=S.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Vg(n),i=Zi(hy,n),s=es(hy,n);return i.open&&s.position==="popper"?m.jsx(Ed,{...o,...r,ref:t}):null});MZ.displayName=hy;function XI(e){return e===""||e===void 0}var QI=S.forwardRef((e,t)=>{const{value:n,...r}=e,o=S.useRef(null),i=Oe(t,o),s=Fg(n);return S.useEffect(()=>{const a=o.current,l=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(l,"value").set;if(s!==n&&u){const d=new Event("change",{bubbles:!0});u.call(a,n),a.dispatchEvent(d)}},[s,n]),m.jsx(Gw,{asChild:!0,children:m.jsx("select",{...r,ref:i,defaultValue:n})})});QI.displayName="BubbleSelect";function JI(e){const t=Gt(e),n=S.useRef(""),r=S.useRef(0),o=S.useCallback(s=>{const a=n.current+s;t(a),function l(c){n.current=c,window.clearTimeout(r.current),c!==""&&(r.current=window.setTimeout(()=>l(""),1e3))}(a)},[t]),i=S.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return S.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,i]}function ZI(e,t,n){const o=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let s=kZ(e,Math.max(i,0));o.length===1&&(s=s.filter(c=>c!==n));const l=s.find(c=>c.textValue.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function kZ(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var OZ=EI,eA=PI,DZ=kI,TZ=OI,IZ=DI,tA=TI,AZ=jI,NZ=LI,nA=zI,rA=VI,jZ=HI,FZ=UI,oA=qI,iA=GI,sA=KI;const Ho=OZ,za=NZ,Wo=DZ,no=S.forwardRef(({className:e,children:t,...n},r)=>m.jsxs(eA,{ref:r,className:ie("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,m.jsx(TZ,{asChild:!0,children:m.jsx(bd,{className:"h-4 w-4 opacity-50"})})]}));no.displayName=eA.displayName;const aA=S.forwardRef(({className:e,...t},n)=>m.jsx(oA,{ref:n,className:ie("flex cursor-default items-center justify-center py-1",e),...t,children:m.jsx(Xk,{className:"h-4 w-4"})}));aA.displayName=oA.displayName;const lA=S.forwardRef(({className:e,...t},n)=>m.jsx(iA,{ref:n,className:ie("flex cursor-default items-center justify-center py-1",e),...t,children:m.jsx(bd,{className:"h-4 w-4"})}));lA.displayName=iA.displayName;const ro=S.forwardRef(({className:e,children:t,position:n="popper",...r},o)=>m.jsx(IZ,{children:m.jsx(Ki,{children:m.jsxs(tA,{ref:o,className:ie("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[m.jsx(aA,{}),m.jsx(AZ,{className:ie("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),m.jsx(lA,{})]})})}));ro.displayName=tA.displayName;const xs=S.forwardRef(({className:e,...t},n)=>m.jsx(nA,{ref:n,className:ie("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));xs.displayName=nA.displayName;const At=S.forwardRef(({className:e,children:t,...n},r)=>m.jsxs(rA,{ref:r,className:ie("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[m.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:m.jsx(FZ,{children:m.jsx(tc,{className:"h-4 w-4"})})}),m.jsx(jZ,{children:t})]}));At.displayName=rA.displayName;const pu=S.forwardRef(({className:e,...t},n)=>m.jsx(sA,{ref:n,className:ie("-mx-1 my-1 h-px bg-muted",e),...t}));pu.displayName=sA.displayName;const al=S.forwardRef(({className:e,type:t,...n},r)=>m.jsx("input",{type:t,className:ie("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...n}));al.displayName="Input";var a1="Popover",[cA,hve]=Kt(a1,[To]),Dd=To(),[LZ,ts]=cA(a1),uA=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:s=!1}=e,a=Dd(t),l=S.useRef(null),[c,u]=S.useState(!1),[d=!1,h]=yn({prop:r,defaultProp:o,onChange:i});return m.jsx(Cd,{...a,children:m.jsx(LZ,{scope:t,contentId:Ut(),triggerRef:l,open:d,onOpenChange:h,onOpenToggle:S.useCallback(()=>h(f=>!f),[h]),hasCustomAnchor:c,onCustomAnchorAdd:S.useCallback(()=>u(!0),[]),onCustomAnchorRemove:S.useCallback(()=>u(!1),[]),modal:s,children:n})})};uA.displayName=a1;var dA="PopoverAnchor",$Z=S.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=ts(dA,n),i=Dd(n),{onCustomAnchorAdd:s,onCustomAnchorRemove:a}=o;return S.useEffect(()=>(s(),()=>a()),[s,a]),m.jsx(lc,{...i,...r,ref:t})});$Z.displayName=dA;var fA="PopoverTrigger",hA=S.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=ts(fA,n),i=Dd(n),s=Oe(t,o.triggerRef),a=m.jsx(pe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":vA(o.open),...r,ref:s,onClick:ae(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?a:m.jsx(lc,{asChild:!0,...i,children:a})});hA.displayName=fA;var l1="PopoverPortal",[zZ,BZ]=cA(l1,{forceMount:void 0}),pA=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,i=ts(l1,t);return m.jsx(zZ,{scope:t,forceMount:n,children:m.jsx(qt,{present:n||i.open,children:m.jsx(Rd,{asChild:!0,container:o,children:r})})})};pA.displayName=l1;var ql="PopoverContent",gA=S.forwardRef((e,t)=>{const n=BZ(ql,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,i=ts(ql,e.__scopePopover);return m.jsx(qt,{present:r||i.open,children:i.modal?m.jsx(VZ,{...o,ref:t}):m.jsx(HZ,{...o,ref:t})})});gA.displayName=ql;var VZ=S.forwardRef((e,t)=>{const n=ts(ql,e.__scopePopover),r=S.useRef(null),o=Oe(t,r),i=S.useRef(!1);return S.useEffect(()=>{const s=r.current;if(s)return Lg(s)},[]),m.jsx(kd,{as:ri,allowPinchZoom:!0,children:m.jsx(mA,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ae(e.onCloseAutoFocus,s=>{var a;s.preventDefault(),i.current||(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:ae(e.onPointerDownOutside,s=>{const a=s.detail.originalEvent,l=a.button===0&&a.ctrlKey===!0,c=a.button===2||l;i.current=c},{checkForDefaultPrevented:!1}),onFocusOutside:ae(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})})}),HZ=S.forwardRef((e,t)=>{const n=ts(ql,e.__scopePopover),r=S.useRef(!1),o=S.useRef(!1);return m.jsx(mA,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var s,a;(s=e.onCloseAutoFocus)==null||s.call(e,i),i.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),i.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:i=>{var l,c;(l=e.onInteractOutside)==null||l.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const s=i.target;((c=n.triggerRef.current)==null?void 0:c.contains(s))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}})}),mA=S.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:s,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:u,...d}=e,h=ts(ql,n),f=Dd(n);return jg(),m.jsx(Md,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i,children:m.jsx(wa,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:u,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onDismiss:()=>h.onOpenChange(!1),children:m.jsx(_d,{"data-state":vA(h.open),role:"dialog",id:h.contentId,...f,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),bA="PopoverClose",WZ=S.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=ts(bA,n);return m.jsx(pe.button,{type:"button",...r,ref:t,onClick:ae(e.onClick,()=>o.onOpenChange(!1))})});WZ.displayName=bA;var UZ="PopoverArrow",qZ=S.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Dd(n);return m.jsx(Ed,{...o,...r,ref:t})});qZ.displayName=UZ;function vA(e){return e?"open":"closed"}var GZ=uA,YZ=hA,KZ=pA,Hg=gA;const Wg=GZ,Ug=YZ,Td=S.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},o)=>m.jsx(KZ,{children:m.jsx(Ki,{children:m.jsx(Hg,{ref:o,align:t,sideOffset:n,className:ie("z-49 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r})})}));Td.displayName=Hg.displayName;function XZ(e,t){switch(t){case"full-date-time":return{locale:e,format:"full-date-time",options:{weekday:"short",year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hour12:!0}};case"short-date-time":return{locale:e,format:"short-date-time",options:{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!0}};case"hours-date-time":return{locale:e,format:"hours-date-time",options:{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}};case"short-date":return{format:"short-date",locale:e,options:{}};case"long-date":return{format:"long-date",locale:e,options:{year:"numeric",month:"long",day:"numeric"}};default:return{format:"short-date-time",locale:e,options:{}}}}function yA({colorRanges:e,setColorRanges:t}){const n={start:-1/0,end:100,color:""};function r(s,a,l){const c=[...e];c[s]={...c[s],[a]:l},t(c)}function o(s){const a=[...e];a.splice(s,1),t(a)}function i(){t([...e,n])}return m.jsxs("div",{className:"space-y-3",children:[m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx(Et,{children:"Color Range"}),m.jsx(Yt,{onClick:i,variant:"secondary",className:"h-5 p-1 text-muted-foreground",children:m.jsx(dg,{className:"size-3"})})]}),e.map((s,a)=>m.jsxs("div",{className:"flex items-center gap-2 px-2",children:[m.jsx(al,{onChange:l=>r(a,"start",l.target.value),value:s.start,className:ie(`h-7 ${Ja}`)}),m.jsx("span",{children:"-"}),m.jsx(al,{value:s.end,onChange:l=>r(a,"end",l.target.value),className:ie(`h-7 ${Ja}`)}),m.jsx(al,{onChange:l=>r(a,"color",l.target.value),value:s.color,className:ie(`h-7 min-w-14 p-0 ${Ja}`),type:"color",list:"presetColors"}),m.jsxs("datalist",{id:"presetColors",children:[m.jsx("option",{children:Xe.green[600]}),m.jsx("option",{children:Xe.red[500]}),m.jsx("option",{children:Xe.yellow[400]}),m.jsx("option",{children:Xe.orange[500]})]}),m.jsx(Yt,{onClick:()=>o(a),variant:"secondary",className:"h-5 p-1 text-muted-foreground",children:m.jsx(ya,{className:"size-3"})})]},a))]})}var QZ="Toggle",xA=S.forwardRef((e,t)=>{const{pressed:n,defaultPressed:r=!1,onPressedChange:o,...i}=e,[s=!1,a]=yn({prop:n,onChange:o,defaultProp:r});return m.jsx(pe.button,{type:"button","aria-pressed":s,"data-state":s?"on":"off","data-disabled":e.disabled?"":void 0,...i,ref:t,onClick:ae(e.onClick,()=>{e.disabled||a(!s)})})});xA.displayName=QZ;var wA=xA;const JZ=Zw("inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent hover:bg-accent hover:text-accent-foreground"},size:{default:"h-10 px-3",sm:"h-9 px-2.5",lg:"h-11 px-5"}},defaultVariants:{variant:"default",size:"default"}}),qg=S.forwardRef(({className:e,variant:t,size:n,...r},o)=>m.jsx(wA,{ref:o,className:ie(JZ({variant:t,size:n,className:e})),...r}));qg.displayName=wA.displayName;function ZZ(e,t){var r;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(o=>o.columnIdx===t);return n==null?void 0:n.type}function eee(e,t){var r,o;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(i=>i.columnIdx===t);return((o=n==null?void 0:n.options)==null?void 0:o.locale)||"en-US"}function tee(e,t){var r,o;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(i=>i.columnIdx===t&&i.type==="date");return((o=n==null?void 0:n.options)==null?void 0:o.format)||"short-date-time"}function nee(e,t){var r,o;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(i=>i.columnIdx===t);return(o=n==null?void 0:n.options)==null?void 0:o.currency}function ree(e,t){var r,o,i;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(s=>s.columnIdx===t);return((i=(o=n==null?void 0:n.options)==null?void 0:o.options)==null?void 0:i.minimumFractionDigits)||0}function oee(e,t){var r,o;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(i=>i.columnIdx===t);return((o=n==null?void 0:n.options)==null?void 0:o.colorRanges)||[]}function iee(e,t){var r,o,i;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(s=>s.columnIdx===t);return((i=(o=n==null?void 0:n.options)==null?void 0:o.options)==null?void 0:i.style)==="percent"}function see(e,t){var r;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(o=>o.columnIdx===t);return n==null?void 0:n.textAlign}function aee(e,t){var r;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(o=>o.columnIdx===t);return n==null?void 0:n.width}function lee({columnIndex:e,columnName:t}){const[n,r]=E.useState(!1),o=Vn(A=>{var L;return(L=A.card)==null?void 0:L.preferences}),[i,s]=E.useState(ZZ(o,e)),[a,l]=E.useState(see(o,e)),[c,u]=E.useState(aee(o,e)),[d,h]=E.useState(oee(o,e)),[f,p]=E.useState(eee(o,e)),[g,b]=E.useState(tee(o,e)),[v,x]=E.useState(nee(o,e)),[y,_]=E.useState(ree(o,e).toString()),[w,C]=E.useState(iee(o,e)),[R,k]=E.useState(""),D=Vn(A=>A.actions.setCardPreferences);function I(){return m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"grid grid-cols-9 items-center gap-2",children:[m.jsx(Et,{className:"col-span-3",htmlFor:"format",children:"Text Align"}),m.jsxs(Ho,{value:a||"left",onValueChange:A=>l(A),children:[m.jsx(no,{className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0",children:m.jsx(Wo,{})}),m.jsxs(ro,{children:[m.jsx(At,{value:"left",children:"Left"}),m.jsx(At,{value:"center",children:"Center"}),m.jsx(At,{value:"right",children:"Right"})]})]})]}),m.jsxs("div",{className:"grid grid-cols-9 items-center gap-2",children:[m.jsx(Et,{className:"col-span-3",htmlFor:"format",children:"Width (px)"}),m.jsx(al,{placeholder:"Auto",value:c?c.toString():"",className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0 focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0",onChange:A=>{A.target.value===""?u(void 0):u(Number(A.target.value))}})]})]})}function T(){const A=[...new Set(L0.map(L=>L.currency))];return m.jsx(m.Fragment,{children:m.jsxs("div",{className:"grid grid-cols-9 items-center gap-2",children:[m.jsx(Et,{className:"col-span-3",htmlFor:"format",children:"Locale"}),m.jsxs(Ho,{value:f,onValueChange:L=>p(L),children:[m.jsx(no,{className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0",children:m.jsx(Wo,{})}),m.jsx(ro,{children:m.jsxs(za,{children:[m.jsx(xs,{children:"Locale"}),L0.map(L=>m.jsx(At,{value:L.locale,children:L.locale},L.locale))]})})]}),m.jsx(Et,{className:"col-span-3",htmlFor:"format",children:"Currency"}),m.jsxs(Ho,{value:v||"none",onValueChange:L=>x(L==="none"?void 0:L),children:[m.jsx(no,{className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0",children:m.jsx(Wo,{})}),m.jsx(ro,{children:m.jsxs(za,{children:[m.jsx(xs,{children:"Currency"}),m.jsx(At,{value:"none",children:"None"}),A.map(L=>m.jsx(At,{value:L,children:L},L))]})})]}),m.jsx(Et,{className:"col-span-3",htmlFor:"format",children:"Decimals"}),m.jsxs(Ho,{value:y,onValueChange:L=>_(L),children:[m.jsx(no,{className:"col-span-3 h-8 w-full focus:ring-1 focus:ring-offset-0",children:m.jsx(Wo,{})}),m.jsx(ro,{children:["0","1","2","3","4"].map(L=>m.jsx(At,{value:L,children:L},L))})]}),!v&&m.jsx(qg,{onPressedChange:L=>C(L),variant:"outline",size:"sm",className:"col-span-3 h-8","aria-label":"Toggle italic",children:m.jsx(Hz,{className:"size-3"})})]})})}function N(){return m.jsx(m.Fragment,{children:m.jsxs("div",{className:"grid grid-cols-9 items-center gap-2",children:[m.jsx(Et,{className:"col-span-3",htmlFor:"format",children:"Locale"}),m.jsxs(Ho,{defaultValue:"en-US",value:f,onValueChange:A=>p(A),children:[m.jsx(no,{className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0",children:m.jsx(Wo,{})}),m.jsx(ro,{children:s8.map(A=>m.jsxs(za,{children:[m.jsx(xs,{children:A.label}),A.locales.map(L=>m.jsx(At,{value:L.code,children:L.name},L.code))]},A.label))})]}),m.jsx(Et,{className:"col-span-3",htmlFor:"format",children:"Format"}),m.jsxs(Ho,{defaultValue:"short-date-time",value:g,onValueChange:A=>{console.log("format",A),b(A)},children:[m.jsx(no,{className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0",children:m.jsx(Wo,{})}),m.jsx(ro,{className:"",id:"type",children:m.jsxs(za,{children:[m.jsx(xs,{children:"Option"}),m.jsx(At,{value:"full-date-time",children:"Full Date-Time"}),m.jsx(At,{value:"short-date-time",children:"Short Date-Time"}),m.jsx(At,{value:"hours-date-time",children:"24-Hour Date-Time"}),m.jsx(At,{value:"short-date",children:"Short Date"}),m.jsx(At,{value:"long-date",children:"Long Date"})]})})]})]})})}function G(){D({...o,columnSettings:[]})}function z(){var A;D({...o,columnSettings:[...((A=o==null?void 0:o.columnSettings)==null?void 0:A.filter(L=>L.columnIdx!==e))||[]]})}function O(){var A,L,j,B;if(i==="date"){const M=XZ(f,g),W={columnIdx:e,type:i,options:M};D({...o,columnSettings:[...((A=o==null?void 0:o.columnSettings)==null?void 0:A.filter(F=>F.columnIdx!==e))||[],W]})}else if(i==="number"){let M;v?M={locale:f,currency:v,options:{style:"currency",currency:v,minimumFractionDigits:Number(y)},colorRanges:d.length>0?d:void 0}:M={locale:f,currency:void 0,options:{style:w?"percent":"decimal",minimumFractionDigits:Number(y)},colorRanges:d.length>0?d:void 0};const W={columnIdx:e,type:i,textAlign:a,width:c,options:M};D({...o,columnSettings:[...((L=o==null?void 0:o.columnSettings)==null?void 0:L.filter(F=>F.columnIdx!==e))||[],W]})}else if(i==="html"){const M={columnIdx:e,type:i,options:{html:""}};D({...o,columnSettings:[...((j=o==null?void 0:o.columnSettings)==null?void 0:j.filter(W=>W.columnIdx!==e))||[],M]})}else{const M={columnIdx:e,type:"none",textAlign:a,width:c,options:{}};D({...o,columnSettings:[...((B=o==null?void 0:o.columnSettings)==null?void 0:B.filter(W=>W.columnIdx!==e))||[],M]})}}return m.jsxs(Wg,{onOpenChange:A=>r(A),children:[m.jsx(Ug,{asChild:!0,children:m.jsx(rO,{className:"size-3 cursor-pointer text-muted"})}),m.jsx(Td,{align:"center",className:"max-w-70 z-20",children:m.jsxs("div",{className:"grid gap-4",children:[m.jsxs("div",{className:"space-y-2",children:[m.jsx("h4",{className:"font-medium leading-none",children:"Display Settings"}),m.jsx("p",{className:"text-sm text-muted-foreground",children:`Display setting for '${t}'`})]}),m.jsxs("div",{className:"grid gap-2",children:[m.jsxs("div",{className:"grid grid-cols-3 items-center gap-2",children:[m.jsx(Et,{htmlFor:"scale",children:"Type"}),m.jsxs(Ho,{value:i||"none",onValueChange:A=>s(A),children:[m.jsx(no,{className:"col-span-2 h-8 w-full focus:ring-1 focus:ring-offset-0",children:m.jsx(Wo,{})}),m.jsx(ro,{id:"type",children:m.jsxs(za,{children:[m.jsx(xs,{children:"Option"}),m.jsx(At,{value:"number",children:"Number"}),m.jsx(At,{value:"date",children:"Date"}),m.jsx(At,{value:"html",children:"HTML"}),m.jsx(At,{value:"none",children:"None"})]})})]})]}),I(),m.jsx(pu,{}),i==="number"&&T(),i==="date"&&N(),i==="number"&&m.jsxs(m.Fragment,{children:[m.jsx(pu,{}),m.jsx(yA,{colorRanges:d,setColorRanges:h})]}),m.jsx(pu,{}),m.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[m.jsx(Yt,{onClick:G,variant:"secondary",className:"col-span-1 col-start-1 h-8 w-full text-destructive",children:"Reset All"}),m.jsx(Yt,{onClick:z,variant:"secondary",className:"col-span-1 col-start-2 h-8 w-full",children:"Reset"}),m.jsx(Yt,{onClick:O,variant:"secondary",className:"col-span-1 col-start-3 h-8 w-full",children:"Apply"})]})]})]})})]})}function cee({card:e,column:t,columnKey:n,columnIndex:r}){var d;const o=se(h=>h.isVisualEditing),i=e==null?void 0:e.preferences,s=t.getIsSorted(),a=(d=i==null?void 0:i.columnSettings)==null?void 0:d.find(h=>h.columnIdx===r),l=a==null?void 0:a.textAlign,c=a==null?void 0:a.width,u=c?{width:c}:{};return m.jsxs("div",{className:"flex w-full items-center justify-between",children:[m.jsxs("div",{className:ie("flex grow cursor-pointer items-center justify-between gap-4",{"justify-center":l==="center","flex-row-reverse":l==="right","justify-start":l==="left"}),style:u,onClick:()=>t.toggleSorting(t.getIsSorted()==="asc"),children:[m.jsx("span",{className:"whitespace-nowrap",children:n}),m.jsx("span",{children:s==="asc"?m.jsx(Uk,{className:"h-5 w-5"}):s==="desc"?m.jsx(Wk,{className:"h-5 w-5"}):null})]}),o&&m.jsx("div",{className:"opacity-0 group-hover:opacity-100",children:m.jsx(lee,{columnName:t.id,columnIndex:r})})]})}function uee(e){const t=new Date(e);return!isNaN(t.getTime())}function dee({card:e,cell:t,columnIndex:n}){var u,d;const r=e==null?void 0:e.preferences,o=t.getValue(),i=(u=r==null?void 0:r.columnSettings)==null?void 0:u.find(h=>h.columnIdx===n),s=c(o,i),a=rw(o,(d=i==null?void 0:i.options)==null?void 0:d.colorRanges),l=i==null?void 0:i.textAlign;i!=null&&i.width&&i.width;function c(h,f){const p=h;if((f==null?void 0:f.type)==="date"&&uee(h)){const{locale:g,options:b}=f.options,v=new Date(h);return new Date(v.getTime()).toLocaleDateString(g,b)}if((f==null?void 0:f.type)==="number"){const{locale:g,currency:b,options:v}=f.options;return b?new Intl.NumberFormat(g,{style:"currency",currency:b,...v}).format(h):new Intl.NumberFormat(g,v).format(h)}return(f==null?void 0:f.type)==="html"?m.jsx("div",{className:"hover:underline",dangerouslySetInnerHTML:{__html:p}}):h}return m.jsx("p",{title:s,className:ie("overflow-auto",{"text-center":l==="center","text-right":l==="right","text-left":l==="left"}),style:{backgroundColor:a},children:s})}function fee(e,t){var d;const n=se(h=>h.selectedSheetId),r=se(h=>h.filterValues),o=(d=e==null?void 0:e.preferences)==null?void 0:d.onClickFilter,{addOrUpdateFilterValues:i,addFilteringCard:s}=zt(),{data:a}=oi(e),l=a==null?void 0:a.records;E.useEffect(()=>{(!r||(r==null?void 0:r.length)===0)&&t.getRowModel().rows.forEach(h=>{h.getIsSelected()&&h.toggleSelected()})},[r,t]);const c=E.useCallback(h=>e.id+"-"+h+"-"+n,[e.id,n]);function u(h){console.log("handleRowSelect",h);const f=h.id;if(o){t.getRow(f).toggleSelected();const p=t.getRow(f).getIsSelected();let g=[];const b=t.getRowModel().rows.filter(y=>y.getIsSelected());p===!1?g=[...b,h]:g=b.filter(y=>y!==h);const{dimensionKeys:v}=Xt(l),x=o.map(y=>{const _=v==null?void 0:v[y.columnIndex],w=g==null?void 0:g.map(R=>R==null?void 0:R.getValue(_));return{filterId:c(_),connectionId:e==null?void 0:e.connectionId,tableName:e.lastSelectedTable,name:_,expression:y.expression,valueType:Up(w[0]===void 0?"":w[0]),operation:"in",values:w}});i(x),s(e)}}return{handleRowSelect:u}}function SA({data:e,card:t}){var d,h,f,p;const[n,r]=E.useState([]),o=se(g=>g.themeStyle),i=(d=t==null?void 0:t.preferences)==null?void 0:d.onClickFilter,s=t==null?void 0:t.preferences,{keys:a}=Xt(e),l=a.map((g,b)=>({accessorKey:g,header:({column:v})=>m.jsx(cee,{card:t,column:v,columnKey:g,columnIndex:b}),cell:({cell:v})=>m.jsx(dee,{card:t,cell:v,columnIndex:b})})),c=gI({data:e,columns:l,getCoreRowModel:fI(),getPaginationRowModel:hI(),onSortingChange:r,getSortedRowModel:pI(),manualPagination:!0,state:{sorting:n}}),{handleRowSelect:u}=fee(t,c);return m.jsx("div",{className:"rounded-md text-sm text-foreground/80",style:{borderTopRightRadius:(h=o==null?void 0:o.chart)==null?void 0:h.options.borderRadius,borderTopLeftRadius:(f=o==null?void 0:o.chart)==null?void 0:f.options.borderRadius},children:m.jsxs("table",{className:"w-full",onMouseDown:g=>g.stopPropagation(),children:[m.jsx(e1,{className:"group",children:c.getHeaderGroups().map(g=>m.jsx(fu,{children:g.headers.map(b=>{var v,x,y,_,w,C,R;return m.jsx(n1,{style:{backgroundColor:(y=(x=(v=o==null?void 0:o.chart)==null?void 0:v.dataset)==null?void 0:x.backgroundColor)==null?void 0:y[0],color:kl((C=(w=(_=o==null?void 0:o.chart)==null?void 0:_.dataset)==null?void 0:w.backgroundColor)==null?void 0:C[0])},className:ie("sticky -top-[1px] h-9 bg-muted-foreground text-background",{},(R=o==null?void 0:o.table)==null?void 0:R.tableHeaderColor),children:b.isPlaceholder?null:sy(b.column.columnDef.header,b.getContext())},b.id)})},g.id))}),m.jsx(t1,{children:(p=c.getRowModel().rows)!=null&&p.length?c.getRowModel().rows.map((g,b)=>m.jsx(fu,{onClick:()=>u(g),className:ie("whitespace-nowrap border-border/50 hover:bg-muted-foreground/10",{"data-[state=selected]:border-1 cursor-pointer data-[state=selected]:border-dashed data-[state=selected]:bg-muted-foreground/30 data-[state=selected]:shadow-inner":i&&(i==null?void 0:i.length)>0}),"data-state":g.getIsSelected()&&"selected",children:g.getVisibleCells().map((v,x)=>{var C,R;const y=(C=s==null?void 0:s.columnSettings)==null?void 0:C.find(k=>k.columnIdx===x),_=y==null?void 0:y.width,w=_?{width:_,maxWidth:_}:{};return m.jsx(yp,{style:w,onClick:k=>{var I;const D=((I=window==null?void 0:window.getSelection())==null?void 0:I.toString())||"";(D==null?void 0:D.length)>0&&k.stopPropagation()},className:ie("border-border/20 px-4 py-1",{"border-l":x==0,"border-r":x===l.length-1,"border-b":b===((R=c.getRowModel().rows)==null?void 0:R.length)-1}),children:sy(v.column.columnDef.cell,v.getContext())},v.id)})},g.id)):m.jsx(fu,{children:m.jsx(yp,{colSpan:l.length,className:"p-1 text-center",children:"No results."})})})]})})}async function hee(e,t){const n=`${e}/index.js`,r=`${e}/style.css`;return document.querySelector(`link[href="${r}"]`)||await new Promise((i,s)=>{const a=document.createElement("link");a.rel="stylesheet",a.href=r,a.onload=()=>i(void 0),a.onerror=()=>s(new Error("Failed to load CSS")),document.head.appendChild(a)}),{default:(await import(n))[t]}}async function pee(e){try{const t=await import(e),n=Object.keys(t),r=[];return n.forEach(o=>{typeof t[o]=="function"&&(o==null?void 0:o[0])===(o==null?void 0:o[0].toUpperCase())&&r.push({name:o,component:o})}),r}catch(t){return console.error("Error loading the library:",t),[]}}async function CA(e){try{const t=await fetch(`${e}/manifest.json`);if(!t.ok)throw new Error(`Failed to fetch manifest: ${t.statusText}`);return await t.json()}catch(t){throw console.error("Error loading manifest:",t),t}}const _A=e=>{const[t,n]=E.useState([]),[r,o]=E.useState(!1),[i,s]=E.useState(null);E.useEffect(()=>{window.React=E,window.ReactDOM=gn,window.React.jsx=nC.jsx,window.React.jsxs=nC.jsxs,o(!0)},[]),E.useEffect(()=>{e&&r&&CA(e).then(c=>{n(c.visuals),s(c)}).catch(()=>{pee(e).then(c=>{console.log("componentNames",c),n(c)}).catch(c=>{console.error("Error loading manifest:",c)})})},[e,r]);const a=E.useMemo(()=>(t==null?void 0:t.map(c=>{const{name:u,component:d,dataInputs:h}=c;return{name:u,componentName:d,Component:E.lazy(()=>hee(e,d)),type:h&&h.length>1?"multiple":"single"}}))||[],[t,e]);function l(c){const u=a==null?void 0:a.find(d=>d.name===c);return u?u.Component:null}return{getCard:l,components:a,manifest:i}};function EA({onLoadingStatus:e,onDataChange:t,card:n}){const{isFetching:r,isLoading:o,data:i,queryKey:s}=oi(n),a=JSON.stringify(s);return E.useEffect(()=>{e==null||e(o)},[r,o,e]),E.useEffect(()=>{t(n.id,(i==null?void 0:i.records)||[])},[i==null?void 0:i.records,n.id,a,t]),m.jsx(m.Fragment,{})}function gee({card:e,frame:t}){var x,y,_,w,C,R,k,D;const[n,r]=E.useState([]),{authToken:o}=vr(),i=mM(o==null?void 0:o.accessToken),s=se(I=>I.themeStyle),a={colors:((y=(x=s==null?void 0:s.chart)==null?void 0:x.dataset)==null?void 0:y.backgroundColor)||[]},[l,c]=E.useState(!1),{getCard:u}=_A(((_=e.customCardPreferences)==null?void 0:_.url)||""),d=((w=e.customCardPreferences)==null?void 0:w.visualType)||"single",h=(C=e.customCardPreferences)==null?void 0:C.componentName,{data:f}=oi(e),p=E.useCallback((I,T)=>{r(N=>({...N,[I]:T}))},[]);if(!h)return null;const g=u(h),b=Object.keys(((R=e.customCardPreferences)==null?void 0:R.dataInputCardIds)||{}).map(I=>{var G,z,O;const T=(z=(G=e.customCardPreferences)==null?void 0:G.dataInputCardIds)==null?void 0:z[I].cardId,N=(O=t==null?void 0:t.cards)==null?void 0:O.find(A=>A.id===T);return N||null});function v(I){c(I)}return m.jsx("div",{className:"semaphor-custom mb-3 flex grow basis-0 flex-col space-y-2 overflow-y-auto",children:m.jsxs(E.Suspense,{fallback:m.jsx(m.Fragment,{}),children:[g&&d==="single"&&m.jsx(g,{params:i,theme:a,settings:(k=e.customCardPreferences)==null?void 0:k.settings,onDataChange:p,data:(f==null?void 0:f.records)||[]}),g&&d==="multiple"&&m.jsxs("div",{children:[Object.keys(((D=e.customCardPreferences)==null?void 0:D.dataInputCardIds)||{}).map(I=>{var G,z,O;const T=(z=(G=e.customCardPreferences)==null?void 0:G.dataInputCardIds)==null?void 0:z[I].cardId,N=(O=t==null?void 0:t.cards)==null?void 0:O.find(A=>A.id===T);if(N)return m.jsx(EA,{onLoadingStatus:v,onDataChange:p,dataInputIndex:I,card:N},N.id+I)}),d==="multiple"&&m.jsx("div",{className:ie("flex flex-col gap-2",{"opacity-50":l}),children:m.jsx(g,{params:i,theme:a,onDataChange:p,settings:b.map(I=>{var T;return(T=I==null?void 0:I.customCardPreferences)==null?void 0:T.settings}),data:b.map(I=>I!=null&&I.id?n==null?void 0:n[I.id]:[])})})]})]},e.id)})}/*!
307
- * chartjs-plugin-datalabels v2.2.0
308
- * https://chartjs-plugin-datalabels.netlify.app
309
- * (c) 2017-2022 chartjs-plugin-datalabels contributors
310
- * Released under the MIT license
311
- */var FR=function(){if(typeof window<"u"){if(window.devicePixelRatio)return window.devicePixelRatio;var e=window.screen;if(e)return(e.deviceXDPI||1)/(e.logicalXDPI||1)}return 1}(),gu={toTextLines:function(e){var t=[],n;for(e=[].concat(e);e.length;)n=e.pop(),typeof n=="string"?t.unshift.apply(t,n.split(`
312
- `)):Array.isArray(n)?e.push.apply(e,n):Ne(e)||t.unshift(""+n);return t},textSize:function(e,t,n){var r=[].concat(t),o=r.length,i=e.font,s=0,a;for(e.font=n.string,a=0;a<o;++a)s=Math.max(e.measureText(r[a]).width,s);return e.font=i,{height:o*n.lineHeight,width:s}},bound:function(e,t,n){return Math.max(e,Math.min(t,n))},arrayDiff:function(e,t){var n=e.slice(),r=[],o,i,s,a;for(o=0,s=t.length;o<s;++o)a=t[o],i=n.indexOf(a),i===-1?r.push([a,1]):n.splice(i,1);for(o=0,s=n.length;o<s;++o)r.push([n[o],-1]);return r},rasterize:function(e){return Math.round(e*FR)/FR}};function zb(e,t){var n=t.x,r=t.y;if(n===null)return{x:0,y:-1};if(r===null)return{x:1,y:0};var o=e.x-n,i=e.y-r,s=Math.sqrt(o*o+i*i);return{x:s?o/s:0,y:s?i/s:-1}}function mee(e,t,n,r,o){switch(o){case"center":n=r=0;break;case"bottom":n=0,r=1;break;case"right":n=1,r=0;break;case"left":n=-1,r=0;break;case"top":n=0,r=-1;break;case"start":n=-n,r=-r;break;case"end":break;default:o*=Math.PI/180,n=Math.cos(o),r=Math.sin(o);break}return{x:e,y:t,vx:n,vy:r}}var bee=0,RA=1,PA=2,MA=4,kA=8;function qf(e,t,n){var r=bee;return e<n.left?r|=RA:e>n.right&&(r|=PA),t<n.top?r|=kA:t>n.bottom&&(r|=MA),r}function vee(e,t){for(var n=e.x0,r=e.y0,o=e.x1,i=e.y1,s=qf(n,r,t),a=qf(o,i,t),l,c,u;!(!(s|a)||s&a);)l=s||a,l&kA?(c=n+(o-n)*(t.top-r)/(i-r),u=t.top):l&MA?(c=n+(o-n)*(t.bottom-r)/(i-r),u=t.bottom):l&PA?(u=r+(i-r)*(t.right-n)/(o-n),c=t.right):l&RA&&(u=r+(i-r)*(t.left-n)/(o-n),c=t.left),l===s?(n=c,r=u,s=qf(n,r,t)):(o=c,i=u,a=qf(o,i,t));return{x0:n,x1:o,y0:r,y1:i}}function Gf(e,t){var n=t.anchor,r=e,o,i;return t.clamp&&(r=vee(r,t.area)),n==="start"?(o=r.x0,i=r.y0):n==="end"?(o=r.x1,i=r.y1):(o=(r.x0+r.x1)/2,i=(r.y0+r.y1)/2),mee(o,i,e.vx,e.vy,t.align)}var Yf={arc:function(e,t){var n=(e.startAngle+e.endAngle)/2,r=Math.cos(n),o=Math.sin(n),i=e.innerRadius,s=e.outerRadius;return Gf({x0:e.x+r*i,y0:e.y+o*i,x1:e.x+r*s,y1:e.y+o*s,vx:r,vy:o},t)},point:function(e,t){var n=zb(e,t.origin),r=n.x*e.options.radius,o=n.y*e.options.radius;return Gf({x0:e.x-r,y0:e.y-o,x1:e.x+r,y1:e.y+o,vx:n.x,vy:n.y},t)},bar:function(e,t){var n=zb(e,t.origin),r=e.x,o=e.y,i=0,s=0;return e.horizontal?(r=Math.min(e.x,e.base),i=Math.abs(e.base-e.x)):(o=Math.min(e.y,e.base),s=Math.abs(e.base-e.y)),Gf({x0:r,y0:o+s,x1:r+i,y1:o,vx:n.x,vy:n.y},t)},fallback:function(e,t){var n=zb(e,t.origin);return Gf({x0:e.x,y0:e.y,x1:e.x+(e.width||0),y1:e.y+(e.height||0),vx:n.x,vy:n.y},t)}},ti=gu.rasterize;function yee(e){var t=e.borderWidth||0,n=e.padding,r=e.size.height,o=e.size.width,i=-o/2,s=-r/2;return{frame:{x:i-n.left-t,y:s-n.top-t,w:o+n.width+t*2,h:r+n.height+t*2},text:{x:i,y:s,w:o,h:r}}}function xee(e,t){var n=t.chart.getDatasetMeta(t.datasetIndex).vScale;if(!n)return null;if(n.xCenter!==void 0&&n.yCenter!==void 0)return{x:n.xCenter,y:n.yCenter};var r=n.getBasePixel();return e.horizontal?{x:r,y:null}:{x:null,y:r}}function wee(e){return e instanceof Wa?Yf.arc:e instanceof Us?Yf.point:e instanceof qs?Yf.bar:Yf.fallback}function See(e,t,n,r,o,i){var s=Math.PI/2;if(i){var a=Math.min(i,o/2,r/2),l=t+a,c=n+a,u=t+r-a,d=n+o-a;e.moveTo(t,c),l<u&&c<d?(e.arc(l,c,a,-Math.PI,-s),e.arc(u,c,a,-s,0),e.arc(u,d,a,0,s),e.arc(l,d,a,s,Math.PI)):l<u?(e.moveTo(l,n),e.arc(u,c,a,-s,s),e.arc(l,c,a,s,Math.PI+s)):c<d?(e.arc(l,c,a,-Math.PI,0),e.arc(l,d,a,0,Math.PI)):e.arc(l,c,a,-Math.PI,Math.PI),e.closePath(),e.moveTo(t,n)}else e.rect(t,n,r,o)}function Cee(e,t,n){var r=n.backgroundColor,o=n.borderColor,i=n.borderWidth;!r&&(!o||!i)||(e.beginPath(),See(e,ti(t.x)+i/2,ti(t.y)+i/2,ti(t.w)-i,ti(t.h)-i,n.borderRadius),e.closePath(),r&&(e.fillStyle=r,e.fill()),o&&i&&(e.strokeStyle=o,e.lineWidth=i,e.lineJoin="miter",e.stroke()))}function _ee(e,t,n){var r=n.lineHeight,o=e.w,i=e.x,s=e.y+r/2;return t==="center"?i+=o/2:(t==="end"||t==="right")&&(i+=o),{h:r,w:o,x:i,y:s}}function Eee(e,t,n){var r=e.shadowBlur,o=n.stroked,i=ti(n.x),s=ti(n.y),a=ti(n.w);o&&e.strokeText(t,i,s,a),n.filled&&(r&&o&&(e.shadowBlur=0),e.fillText(t,i,s,a),r&&o&&(e.shadowBlur=r))}function Ree(e,t,n,r){var o=r.textAlign,i=r.color,s=!!i,a=r.font,l=t.length,c=r.textStrokeColor,u=r.textStrokeWidth,d=c&&u,h;if(!(!l||!s&&!d))for(n=_ee(n,o,a),e.font=a.string,e.textAlign=o,e.textBaseline="middle",e.shadowBlur=r.textShadowBlur,e.shadowColor=r.textShadowColor,s&&(e.fillStyle=i),d&&(e.lineJoin="round",e.lineWidth=u,e.strokeStyle=c),h=0,l=t.length;h<l;++h)Eee(e,t[h],{stroked:d,filled:s,w:n.w,x:n.x,y:n.y+n.h*h})}var OA=function(e,t,n,r){var o=this;o._config=e,o._index=r,o._model=null,o._rects=null,o._ctx=t,o._el=n};Zt(OA.prototype,{_modelize:function(e,t,n,r){var o=this,i=o._index,s=Wt(_t([n.font,{}],r,i)),a=_t([n.color,Mt.color],r,i);return{align:_t([n.align,"center"],r,i),anchor:_t([n.anchor,"center"],r,i),area:r.chart.chartArea,backgroundColor:_t([n.backgroundColor,null],r,i),borderColor:_t([n.borderColor,null],r,i),borderRadius:_t([n.borderRadius,0],r,i),borderWidth:_t([n.borderWidth,0],r,i),clamp:_t([n.clamp,!1],r,i),clip:_t([n.clip,!1],r,i),color:a,display:e,font:s,lines:t,offset:_t([n.offset,4],r,i),opacity:_t([n.opacity,1],r,i),origin:xee(o._el,r),padding:on(_t([n.padding,4],r,i)),positioner:wee(o._el),rotation:_t([n.rotation,0],r,i)*(Math.PI/180),size:gu.textSize(o._ctx,t,s),textAlign:_t([n.textAlign,"start"],r,i),textShadowBlur:_t([n.textShadowBlur,0],r,i),textShadowColor:_t([n.textShadowColor,a],r,i),textStrokeColor:_t([n.textStrokeColor,a],r,i),textStrokeWidth:_t([n.textStrokeWidth,0],r,i)}},update:function(e){var t=this,n=null,r=null,o=t._index,i=t._config,s,a,l,c=_t([i.display,!0],e,o);c&&(s=e.dataset.data[o],a=ke(ht(i.formatter,[s,e]),s),l=Ne(a)?[]:gu.toTextLines(a),l.length&&(n=t._modelize(c,l,i,e),r=yee(n))),t._model=n,t._rects=r},geometry:function(){return this._rects?this._rects.frame:{}},rotation:function(){return this._model?this._model.rotation:0},visible:function(){return this._model&&this._model.opacity},model:function(){return this._model},draw:function(e,t){var n=this,r=e.ctx,o=n._model,i=n._rects,s;this.visible()&&(r.save(),o.clip&&(s=o.area,r.beginPath(),r.rect(s.left,s.top,s.right-s.left,s.bottom-s.top),r.clip()),r.globalAlpha=gu.bound(0,o.opacity,1),r.translate(ti(t.x),ti(t.y)),r.rotate(o.rotation),Cee(r,i.frame,o),Ree(r,o.lines,i.text,o),r.restore())}});var Pee=Number.MIN_SAFE_INTEGER||-9007199254740991,Mee=Number.MAX_SAFE_INTEGER||9007199254740991;function Oc(e,t,n){var r=Math.cos(n),o=Math.sin(n),i=t.x,s=t.y;return{x:i+r*(e.x-i)-o*(e.y-s),y:s+o*(e.x-i)+r*(e.y-s)}}function LR(e,t){var n=Mee,r=Pee,o=t.origin,i,s,a,l,c;for(i=0;i<e.length;++i)s=e[i],a=s.x-o.x,l=s.y-o.y,c=t.vx*a+t.vy*l,n=Math.min(n,c),r=Math.max(r,c);return{min:n,max:r}}function Kf(e,t){var n=t.x-e.x,r=t.y-e.y,o=Math.sqrt(n*n+r*r);return{vx:(t.x-e.x)/o,vy:(t.y-e.y)/o,origin:e,ln:o}}var DA=function(){this._rotation=0,this._rect={x:0,y:0,w:0,h:0}};Zt(DA.prototype,{center:function(){var e=this._rect;return{x:e.x+e.w/2,y:e.y+e.h/2}},update:function(e,t,n){this._rotation=n,this._rect={x:t.x+e.x,y:t.y+e.y,w:t.w,h:t.h}},contains:function(e){var t=this,n=1,r=t._rect;return e=Oc(e,t.center(),-t._rotation),!(e.x<r.x-n||e.y<r.y-n||e.x>r.x+r.w+n*2||e.y>r.y+r.h+n*2)},intersects:function(e){var t=this._points(),n=e._points(),r=[Kf(t[0],t[1]),Kf(t[0],t[3])],o,i,s;for(this._rotation!==e._rotation&&r.push(Kf(n[0],n[1]),Kf(n[0],n[3])),o=0;o<r.length;++o)if(i=LR(t,r[o]),s=LR(n,r[o]),i.max<s.min||s.max<i.min)return!1;return!0},_points:function(){var e=this,t=e._rect,n=e._rotation,r=e.center();return[Oc({x:t.x,y:t.y},r,n),Oc({x:t.x+t.w,y:t.y},r,n),Oc({x:t.x+t.w,y:t.y+t.h},r,n),Oc({x:t.x,y:t.y+t.h},r,n)]}});function TA(e,t,n){var r=t.positioner(e,t),o=r.vx,i=r.vy;if(!o&&!i)return{x:r.x,y:r.y};var s=n.w,a=n.h,l=t.rotation,c=Math.abs(s/2*Math.cos(l))+Math.abs(a/2*Math.sin(l)),u=Math.abs(s/2*Math.sin(l))+Math.abs(a/2*Math.cos(l)),d=1/Math.max(Math.abs(o),Math.abs(i));return c*=o*d,u*=i*d,c+=t.offset*o,u+=t.offset*i,{x:r.x+c,y:r.y+u}}function kee(e,t){var n,r,o,i;for(n=e.length-1;n>=0;--n)for(o=e[n].$layout,r=n-1;r>=0&&o._visible;--r)i=e[r].$layout,i._visible&&o._box.intersects(i._box)&&t(o,i);return e}function Oee(e){var t,n,r,o,i,s,a;for(t=0,n=e.length;t<n;++t)r=e[t],o=r.$layout,o._visible&&(a=new Proxy(r._el,{get:(l,c)=>l.getProps([c],!0)[c]}),i=r.geometry(),s=TA(a,r.model(),i),o._box.update(s,i,r.rotation()));return kee(e,function(l,c){var u=l._hidable,d=c._hidable;u&&d||d?c._visible=!1:u&&(l._visible=!1)})}var mu={prepare:function(e){var t=[],n,r,o,i,s;for(n=0,o=e.length;n<o;++n)for(r=0,i=e[n].length;r<i;++r)s=e[n][r],t.push(s),s.$layout={_box:new DA,_hidable:!1,_visible:!0,_set:n,_idx:s._index};return t.sort(function(a,l){var c=a.$layout,u=l.$layout;return c._idx===u._idx?u._set-c._set:u._idx-c._idx}),this.update(t),t},update:function(e){var t=!1,n,r,o,i,s;for(n=0,r=e.length;n<r;++n)o=e[n],i=o.model(),s=o.$layout,s._hidable=i&&i.display==="auto",s._visible=o.visible(),t|=s._hidable;t&&Oee(e)},lookup:function(e,t){var n,r;for(n=e.length-1;n>=0;--n)if(r=e[n].$layout,r&&r._visible&&r._box.contains(t))return e[n];return null},draw:function(e,t){var n,r,o,i,s,a;for(n=0,r=t.length;n<r;++n)o=t[n],i=o.$layout,i._visible&&(s=o.geometry(),a=TA(o._el,o.model(),s),i._box.update(a,s,o.rotation()),o.draw(e,a))}},Dee=function(e){if(Ne(e))return null;var t=e,n,r,o;if(qe(e))if(!Ne(e.label))t=e.label;else if(!Ne(e.r))t=e.r;else for(t="",n=Object.keys(e),o=0,r=n.length;o<r;++o)t+=(o!==0?", ":"")+n[o]+": "+e[n[o]];return""+t},Tee={align:"center",anchor:"center",backgroundColor:null,borderColor:null,borderRadius:0,borderWidth:0,clamp:!1,clip:!1,color:void 0,display:!0,font:{family:void 0,lineHeight:1.2,size:void 0,style:void 0,weight:null},formatter:Dee,labels:void 0,listeners:{},offset:4,opacity:1,padding:{top:4,right:4,bottom:4,left:4},rotation:0,textAlign:"start",textStrokeColor:void 0,textStrokeWidth:0,textShadowBlur:0,textShadowColor:void 0},$n="$datalabels",IA="$default";function Iee(e,t){var n=e.datalabels,r={},o=[],i,s;return n===!1?null:(n===!0&&(n={}),t=Zt({},[t,n]),i=t.labels||{},s=Object.keys(i),delete t.labels,s.length?s.forEach(function(a){i[a]&&o.push(Zt({},[t,i[a],{_key:a}]))}):o.push(t),r=o.reduce(function(a,l){return ct(l.listeners||{},function(c,u){a[u]=a[u]||{},a[u][l._key||IA]=c}),delete l.listeners,a},{}),{labels:o,listeners:r})}function py(e,t,n,r){if(t){var o=n.$context,i=n.$groups,s;t[i._set]&&(s=t[i._set][i._key],s&&ht(s,[o,r])===!0&&(e[$n]._dirty=!0,n.update(o)))}}function Aee(e,t,n,r,o){var i,s;!n&&!r||(n?r?n!==r&&(s=i=!0):s=!0:i=!0,s&&py(e,t.leave,n,o),i&&py(e,t.enter,r,o))}function Nee(e,t){var n=e[$n],r=n._listeners,o,i;if(!(!r.enter&&!r.leave)){if(t.type==="mousemove")i=mu.lookup(n._labels,t);else if(t.type!=="mouseout")return;o=n._hovered,n._hovered=i,Aee(e,r,o,i,t)}}function jee(e,t){var n=e[$n],r=n._listeners.click,o=r&&mu.lookup(n._labels,t);o&&py(e,r,o,t)}var Fee={id:"datalabels",defaults:Tee,beforeInit:function(e){e[$n]={_actives:[]}},beforeUpdate:function(e){var t=e[$n];t._listened=!1,t._listeners={},t._datasets=[],t._labels=[]},afterDatasetUpdate:function(e,t,n){var r=t.index,o=e[$n],i=o._datasets[r]=[],s=e.isDatasetVisible(r),a=e.data.datasets[r],l=Iee(a,n),c=t.meta.data||[],u=e.ctx,d,h,f,p,g,b,v,x;for(u.save(),d=0,f=c.length;d<f;++d)if(v=c[d],v[$n]=[],s&&v&&e.getDataVisibility(d)&&!v.skip)for(h=0,p=l.labels.length;h<p;++h)g=l.labels[h],b=g._key,x=new OA(g,u,v,d),x.$groups={_set:r,_key:b||IA},x.$context={active:!1,chart:e,dataIndex:d,dataset:a,datasetIndex:r},x.update(x.$context),v[$n].push(x),i.push(x);u.restore(),Zt(o._listeners,l.listeners,{merger:function(y,_,w){_[y]=_[y]||{},_[y][t.index]=w[y],o._listened=!0}})},afterUpdate:function(e){e[$n]._labels=mu.prepare(e[$n]._datasets)},afterDatasetsDraw:function(e){mu.draw(e,e[$n]._labels)},beforeEvent:function(e,t){if(e[$n]._listened){var n=t.event;switch(n.type){case"mousemove":case"mouseout":Nee(e,n);break;case"click":jee(e,n);break}}},afterEvent:function(e){var t=e[$n],n=t._actives,r=t._actives=e.getActiveElements(),o=gu.arrayDiff(n,r),i,s,a,l,c,u,d;for(i=0,s=o.length;i<s;++i)if(c=o[i],c[1])for(d=c[0].element[$n]||[],a=0,l=d.length;a<l;++a)u=d[a],u.$context.active=c[1]===1,u.update(u.$context);(t._dirty||o.length)&&(mu.update(t._labels),e.render()),delete t._dirty}};Tt.register(...kq);Tt.register(Fee);Tt.register(Us);Tt.register(oc);Tt.register(ic);Tt.register(ii);Tt.register(xa);Tt.register(Vi);Tt.register(Hi);Tt.register(Xh);Tt.register(cD);function c1({cfg:e,onDatapointClick:t}){var d;const[n,r]=E.useState(""),o=se(h=>h.selectedLensId),i=E.useRef(null),[s,a]=E.useState(),l=se(h=>h.themeStyle);E.useEffect(()=>{if(i.current){const h=window.getComputedStyle(i.current);r(h.fontFamily)}},[]),E.useEffect(()=>{var g,b,v,x;if(!n)return;(b=(g=l==null?void 0:l.chart)==null?void 0:g.font)!=null&&b.family&&(Tt.defaults.font={...Tt.defaults.font,...(v=l==null?void 0:l.chart)==null?void 0:v.font,family:n});const h=ku(e);h.options={...e.options,responsive:!0,maintainAspectRatio:!1};const f=(x=i==null?void 0:i.current)==null?void 0:x.getContext("2d");if(!f)return;let p;try{const y=jK(h,f);p=new Tt(f,y),a(p)}catch(y){console.log("error creating chart",y)}return()=>{p&&p.destroy()}},[(d=l==null?void 0:l.chart)==null?void 0:d.font,o,n,e]);function c(h){var p,g;if(!s)return;const f=s==null?void 0:s.getElementsAtEventForMode(h,"nearest",{intersect:!0},!0);if(f&&f.length>0){const b=f[0].datasetIndex,v=f[0].index,x=(g=(p=f[0].element)==null?void 0:p.$context)==null?void 0:g.raw;t==null||t(s,b,v,x)}}const u=e.type==="doughnut"||e.type==="pie";return m.jsx("div",{onClick:c,className:ie("relative h-[99%]",{"mx-14":u}),children:m.jsx("canvas",{ref:i})})}function Lee(e,t){return S.useReducer((n,r)=>t[n][r]??n,e)}var u1="ScrollArea",[AA,pve]=Kt(u1),[$ee,Dr]=AA(u1),NA=S.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:o,scrollHideDelay:i=600,...s}=e,[a,l]=S.useState(null),[c,u]=S.useState(null),[d,h]=S.useState(null),[f,p]=S.useState(null),[g,b]=S.useState(null),[v,x]=S.useState(0),[y,_]=S.useState(0),[w,C]=S.useState(!1),[R,k]=S.useState(!1),D=Oe(t,T=>l(T)),I=ga(o);return m.jsx($ee,{scope:n,type:r,dir:I,scrollHideDelay:i,scrollArea:a,viewport:c,onViewportChange:u,content:d,onContentChange:h,scrollbarX:f,onScrollbarXChange:p,scrollbarXEnabled:w,onScrollbarXEnabledChange:C,scrollbarY:g,onScrollbarYChange:b,scrollbarYEnabled:R,onScrollbarYEnabledChange:k,onCornerWidthChange:x,onCornerHeightChange:_,children:m.jsx(pe.div,{dir:I,...s,ref:D,style:{position:"relative","--radix-scroll-area-corner-width":v+"px","--radix-scroll-area-corner-height":y+"px",...e.style}})})});NA.displayName=u1;var jA="ScrollAreaViewport",FA=S.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:o,...i}=e,s=Dr(jA,n),a=S.useRef(null),l=Oe(t,a,s.onViewportChange);return m.jsxs(m.Fragment,{children:[m.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),m.jsx(pe.div,{"data-radix-scroll-area-viewport":"",...i,ref:l,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...e.style},children:m.jsx("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});FA.displayName=jA;var Io="ScrollAreaScrollbar",d1=S.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Dr(Io,e.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:s}=o,a=e.orientation==="horizontal";return S.useEffect(()=>(a?i(!0):s(!0),()=>{a?i(!1):s(!1)}),[a,i,s]),o.type==="hover"?m.jsx(zee,{...r,ref:t,forceMount:n}):o.type==="scroll"?m.jsx(Bee,{...r,ref:t,forceMount:n}):o.type==="auto"?m.jsx(LA,{...r,ref:t,forceMount:n}):o.type==="always"?m.jsx(f1,{...r,ref:t}):null});d1.displayName=Io;var zee=S.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Dr(Io,e.__scopeScrollArea),[i,s]=S.useState(!1);return S.useEffect(()=>{const a=o.scrollArea;let l=0;if(a){const c=()=>{window.clearTimeout(l),s(!0)},u=()=>{l=window.setTimeout(()=>s(!1),o.scrollHideDelay)};return a.addEventListener("pointerenter",c),a.addEventListener("pointerleave",u),()=>{window.clearTimeout(l),a.removeEventListener("pointerenter",c),a.removeEventListener("pointerleave",u)}}},[o.scrollArea,o.scrollHideDelay]),m.jsx(qt,{present:n||i,children:m.jsx(LA,{"data-state":i?"visible":"hidden",...r,ref:t})})}),Bee=S.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Dr(Io,e.__scopeScrollArea),i=e.orientation==="horizontal",s=Yg(()=>l("SCROLL_END"),100),[a,l]=Lee("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return S.useEffect(()=>{if(a==="idle"){const c=window.setTimeout(()=>l("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(c)}},[a,o.scrollHideDelay,l]),S.useEffect(()=>{const c=o.viewport,u=i?"scrollLeft":"scrollTop";if(c){let d=c[u];const h=()=>{const f=c[u];d!==f&&(l("SCROLL"),s()),d=f};return c.addEventListener("scroll",h),()=>c.removeEventListener("scroll",h)}},[o.viewport,i,l,s]),m.jsx(qt,{present:n||a!=="hidden",children:m.jsx(f1,{"data-state":a==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:ae(e.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:ae(e.onPointerLeave,()=>l("POINTER_LEAVE"))})})}),LA=S.forwardRef((e,t)=>{const n=Dr(Io,e.__scopeScrollArea),{forceMount:r,...o}=e,[i,s]=S.useState(!1),a=e.orientation==="horizontal",l=Yg(()=>{if(n.viewport){const c=n.viewport.offsetWidth<n.viewport.scrollWidth,u=n.viewport.offsetHeight<n.viewport.scrollHeight;s(a?c:u)}},10);return Gl(n.viewport,l),Gl(n.content,l),m.jsx(qt,{present:r||i,children:m.jsx(f1,{"data-state":i?"visible":"hidden",...o,ref:t})})}),f1=S.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,o=Dr(Io,e.__scopeScrollArea),i=S.useRef(null),s=S.useRef(0),[a,l]=S.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),c=HA(a.viewport,a.content),u={...r,sizes:a,onSizesChange:l,hasThumb:c>0&&c<1,onThumbChange:h=>i.current=h,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:h=>s.current=h};function d(h,f){return Gee(h,s.current,a,f)}return n==="horizontal"?m.jsx(Vee,{...u,ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const h=o.viewport.scrollLeft,f=$R(h,a,o.dir);i.current.style.transform=`translate3d(${f}px, 0, 0)`}},onWheelScroll:h=>{o.viewport&&(o.viewport.scrollLeft=h)},onDragScroll:h=>{o.viewport&&(o.viewport.scrollLeft=d(h,o.dir))}}):n==="vertical"?m.jsx(Hee,{...u,ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const h=o.viewport.scrollTop,f=$R(h,a);i.current.style.transform=`translate3d(0, ${f}px, 0)`}},onWheelScroll:h=>{o.viewport&&(o.viewport.scrollTop=h)},onDragScroll:h=>{o.viewport&&(o.viewport.scrollTop=d(h))}}):null}),Vee=S.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,i=Dr(Io,e.__scopeScrollArea),[s,a]=S.useState(),l=S.useRef(null),c=Oe(t,l,i.onScrollbarXChange);return S.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),m.jsx(zA,{"data-orientation":"horizontal",...o,ref:c,sizes:n,style:{bottom:0,left:i.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:i.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Gg(n)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.x),onDragScroll:u=>e.onDragScroll(u.x),onWheelScroll:(u,d)=>{if(i.viewport){const h=i.viewport.scrollLeft+u.deltaX;e.onWheelScroll(h),UA(h,d)&&u.preventDefault()}},onResize:()=>{l.current&&i.viewport&&s&&r({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:Sp(s.paddingLeft),paddingEnd:Sp(s.paddingRight)}})}})}),Hee=S.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,i=Dr(Io,e.__scopeScrollArea),[s,a]=S.useState(),l=S.useRef(null),c=Oe(t,l,i.onScrollbarYChange);return S.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),m.jsx(zA,{"data-orientation":"vertical",...o,ref:c,sizes:n,style:{top:0,right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Gg(n)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.y),onDragScroll:u=>e.onDragScroll(u.y),onWheelScroll:(u,d)=>{if(i.viewport){const h=i.viewport.scrollTop+u.deltaY;e.onWheelScroll(h),UA(h,d)&&u.preventDefault()}},onResize:()=>{l.current&&i.viewport&&s&&r({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:Sp(s.paddingTop),paddingEnd:Sp(s.paddingBottom)}})}})}),[Wee,$A]=AA(Io),zA=S.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:o,onThumbChange:i,onThumbPointerUp:s,onThumbPointerDown:a,onThumbPositionChange:l,onDragScroll:c,onWheelScroll:u,onResize:d,...h}=e,f=Dr(Io,n),[p,g]=S.useState(null),b=Oe(t,D=>g(D)),v=S.useRef(null),x=S.useRef(""),y=f.viewport,_=r.content-r.viewport,w=Gt(u),C=Gt(l),R=Yg(d,10);function k(D){if(v.current){const I=D.clientX-v.current.left,T=D.clientY-v.current.top;c({x:I,y:T})}}return S.useEffect(()=>{const D=I=>{const T=I.target;(p==null?void 0:p.contains(T))&&w(I,_)};return document.addEventListener("wheel",D,{passive:!1}),()=>document.removeEventListener("wheel",D,{passive:!1})},[y,p,_,w]),S.useEffect(C,[r,C]),Gl(p,R),Gl(f.content,R),m.jsx(Wee,{scope:n,scrollbar:p,hasThumb:o,onThumbChange:Gt(i),onThumbPointerUp:Gt(s),onThumbPositionChange:C,onThumbPointerDown:Gt(a),children:m.jsx(pe.div,{...h,ref:b,style:{position:"absolute",...h.style},onPointerDown:ae(e.onPointerDown,D=>{D.button===0&&(D.target.setPointerCapture(D.pointerId),v.current=p.getBoundingClientRect(),x.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",f.viewport&&(f.viewport.style.scrollBehavior="auto"),k(D))}),onPointerMove:ae(e.onPointerMove,k),onPointerUp:ae(e.onPointerUp,D=>{const I=D.target;I.hasPointerCapture(D.pointerId)&&I.releasePointerCapture(D.pointerId),document.body.style.webkitUserSelect=x.current,f.viewport&&(f.viewport.style.scrollBehavior=""),v.current=null})})})}),wp="ScrollAreaThumb",BA=S.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=$A(wp,e.__scopeScrollArea);return m.jsx(qt,{present:n||o.hasThumb,children:m.jsx(Uee,{ref:t,...r})})}),Uee=S.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...o}=e,i=Dr(wp,n),s=$A(wp,n),{onThumbPositionChange:a}=s,l=Oe(t,d=>s.onThumbChange(d)),c=S.useRef(void 0),u=Yg(()=>{c.current&&(c.current(),c.current=void 0)},100);return S.useEffect(()=>{const d=i.viewport;if(d){const h=()=>{if(u(),!c.current){const f=Yee(d,a);c.current=f,a()}};return a(),d.addEventListener("scroll",h),()=>d.removeEventListener("scroll",h)}},[i.viewport,u,a]),m.jsx(pe.div,{"data-state":s.hasThumb?"visible":"hidden",...o,ref:l,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:ae(e.onPointerDownCapture,d=>{const f=d.target.getBoundingClientRect(),p=d.clientX-f.left,g=d.clientY-f.top;s.onThumbPointerDown({x:p,y:g})}),onPointerUp:ae(e.onPointerUp,s.onThumbPointerUp)})});BA.displayName=wp;var h1="ScrollAreaCorner",VA=S.forwardRef((e,t)=>{const n=Dr(h1,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?m.jsx(qee,{...e,ref:t}):null});VA.displayName=h1;var qee=S.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,o=Dr(h1,n),[i,s]=S.useState(0),[a,l]=S.useState(0),c=!!(i&&a);return Gl(o.scrollbarX,()=>{var d;const u=((d=o.scrollbarX)==null?void 0:d.offsetHeight)||0;o.onCornerHeightChange(u),l(u)}),Gl(o.scrollbarY,()=>{var d;const u=((d=o.scrollbarY)==null?void 0:d.offsetWidth)||0;o.onCornerWidthChange(u),s(u)}),c?m.jsx(pe.div,{...r,ref:t,style:{width:i,height:a,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function Sp(e){return e?parseInt(e,10):0}function HA(e,t){const n=e/t;return isNaN(n)?0:n}function Gg(e){const t=HA(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function Gee(e,t,n,r="ltr"){const o=Gg(n),i=o/2,s=t||i,a=o-s,l=n.scrollbar.paddingStart+s,c=n.scrollbar.size-n.scrollbar.paddingEnd-a,u=n.content-n.viewport,d=r==="ltr"?[0,u]:[u*-1,0];return WA([l,c],d)(e)}function $R(e,t,n="ltr"){const r=Gg(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=t.scrollbar.size-o,s=t.content-t.viewport,a=i-r,l=n==="ltr"?[0,s]:[s*-1,0],c=ay(e,l);return WA([0,s],[0,a])(c)}function WA(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function UA(e,t){return e>0&&e<t}var Yee=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function o(){const i={left:e.scrollLeft,top:e.scrollTop},s=n.left!==i.left,a=n.top!==i.top;(s||a)&&t(),n=i,r=window.requestAnimationFrame(o)}(),()=>window.cancelAnimationFrame(r)};function Yg(e,t){const n=Gt(e),r=S.useRef(0);return S.useEffect(()=>()=>window.clearTimeout(r.current),[]),S.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function Gl(e,t){const n=Gt(t);rn(()=>{let r=0;if(e){const o=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return o.observe(e),()=>{window.cancelAnimationFrame(r),o.unobserve(e)}}},[e,n])}var Kg=NA,qA=FA,GA=VA;const ll=S.forwardRef(({className:e,children:t,...n},r)=>m.jsxs(Kg,{ref:r,className:ie("relative overflow-hidden",e),...n,children:[m.jsx(qA,{className:"h-full w-full rounded-[inherit]",children:t}),m.jsx(uc,{}),m.jsx(GA,{})]}));ll.displayName=Kg.displayName;const uc=S.forwardRef(({className:e,orientation:t="vertical",...n},r)=>m.jsx(d1,{ref:r,orientation:t,className:ie("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...n,children:m.jsx(BA,{className:"relative flex-1 rounded-full bg-border"})}));uc.displayName=d1.displayName;function Qe(e){const t=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&t==="[object Date]"?new e.constructor(+e):typeof e=="number"||t==="[object Number]"||typeof e=="string"||t==="[object String]"?new Date(e):new Date(NaN)}function Kn(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function Mn(e,t){const n=Qe(e);return isNaN(t)?Kn(e,NaN):(t&&n.setDate(n.getDate()+t),n)}function qr(e,t){const n=Qe(e);if(isNaN(t))return Kn(e,NaN);if(!t)return n;const r=n.getDate(),o=Kn(e,n.getTime());o.setMonth(n.getMonth()+t+1,0);const i=o.getDate();return r>=i?o:(n.setFullYear(o.getFullYear(),o.getMonth(),r),n)}function Kee(e,t){const n=+Qe(e);return Kn(e,n+t)}const p1=6048e5,Xee=864e5,Qee=36e5;function zR(e,t){return Kee(e,t*Qee)}let Jee={};function Id(){return Jee}function _o(e,t){var a,l,c,u;const n=Id(),r=(t==null?void 0:t.weekStartsOn)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)??n.weekStartsOn??((u=(c=n.locale)==null?void 0:c.options)==null?void 0:u.weekStartsOn)??0,o=Qe(e),i=o.getDay(),s=(i<r?7:0)+i-r;return o.setDate(o.getDate()-s),o.setHours(0,0,0,0),o}function ca(e){return _o(e,{weekStartsOn:1})}function YA(e){const t=Qe(e),n=t.getFullYear(),r=Kn(e,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const o=ca(r),i=Kn(e,0);i.setFullYear(n,0,4),i.setHours(0,0,0,0);const s=ca(i);return t.getTime()>=o.getTime()?n+1:t.getTime()>=s.getTime()?n:n-1}function Yl(e){const t=Qe(e);return t.setHours(0,0,0,0),t}function Cp(e){const t=Qe(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function po(e,t){const n=Yl(e),r=Yl(t),o=+n-Cp(n),i=+r-Cp(r);return Math.round((o-i)/Xee)}function Zee(e){const t=YA(e),n=Kn(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),ca(n)}function gy(e,t){const n=t*7;return Mn(e,n)}function ete(e,t){return qr(e,t*12)}function tte(e){let t;return e.forEach(function(n){const r=Qe(n);(t===void 0||t<r||isNaN(Number(r)))&&(t=r)}),t||new Date(NaN)}function nte(e){let t;return e.forEach(n=>{const r=Qe(n);(!t||t>r||isNaN(+r))&&(t=r)}),t||new Date(NaN)}function qn(e,t){const n=Yl(e),r=Yl(t);return+n==+r}function g1(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function rte(e){if(!g1(e)&&typeof e!="number")return!1;const t=Qe(e);return!isNaN(Number(t))}function Wu(e,t){const n=Qe(e),r=Qe(t),o=n.getFullYear()-r.getFullYear(),i=n.getMonth()-r.getMonth();return o*12+i}function ote(e,t,n){const r=_o(e,n),o=_o(t,n),i=+r-Cp(r),s=+o-Cp(o);return Math.round((i-s)/p1)}function m1(e){const t=Qe(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function Gn(e){const t=Qe(e);return t.setDate(1),t.setHours(0,0,0,0),t}function KA(e){const t=Qe(e),n=Kn(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}function b1(e,t){var a,l,c,u;const n=Id(),r=(t==null?void 0:t.weekStartsOn)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)??n.weekStartsOn??((u=(c=n.locale)==null?void 0:c.options)==null?void 0:u.weekStartsOn)??0,o=Qe(e),i=o.getDay(),s=(i<r?-7:0)+6-(i-r);return o.setDate(o.getDate()+s),o.setHours(23,59,59,999),o}function XA(e){return b1(e,{weekStartsOn:1})}const ite={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},ste=(e,t,n)=>{let r;const o=ite[e];return typeof o=="string"?r=o:t===1?r=o.one:r=o.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function Bb(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const ate={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},lte={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},cte={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},ute={date:Bb({formats:ate,defaultWidth:"full"}),time:Bb({formats:lte,defaultWidth:"full"}),dateTime:Bb({formats:cte,defaultWidth:"full"})},dte={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},fte=(e,t,n,r)=>dte[e];function Dc(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let o;if(r==="formatting"&&e.formattingValues){const s=e.defaultFormattingWidth||e.defaultWidth,a=n!=null&&n.width?String(n.width):s;o=e.formattingValues[a]||e.formattingValues[s]}else{const s=e.defaultWidth,a=n!=null&&n.width?String(n.width):e.defaultWidth;o=e.values[a]||e.values[s]}const i=e.argumentCallback?e.argumentCallback(t):t;return o[i]}}const hte={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},pte={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},gte={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},mte={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},bte={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},vte={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},yte=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},xte={ordinalNumber:yte,era:Dc({values:hte,defaultWidth:"wide"}),quarter:Dc({values:pte,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Dc({values:gte,defaultWidth:"wide"}),day:Dc({values:mte,defaultWidth:"wide"}),dayPeriod:Dc({values:bte,defaultWidth:"wide",formattingValues:vte,defaultFormattingWidth:"wide"})};function Tc(e){return(t,n={})=>{const r=n.width,o=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],i=t.match(o);if(!i)return null;const s=i[0],a=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(a)?Ste(a,d=>d.test(s)):wte(a,d=>d.test(s));let c;c=e.valueCallback?e.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c;const u=t.slice(s.length);return{value:c,rest:u}}}function wte(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function Ste(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function Cte(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const o=r[0],i=t.match(e.parsePattern);if(!i)return null;let s=e.valueCallback?e.valueCallback(i[0]):i[0];s=n.valueCallback?n.valueCallback(s):s;const a=t.slice(o.length);return{value:s,rest:a}}}const _te=/^(\d+)(th|st|nd|rd)?/i,Ete=/\d+/i,Rte={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Pte={any:[/^b/i,/^(a|c)/i]},Mte={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},kte={any:[/1/i,/2/i,/3/i,/4/i]},Ote={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Dte={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Tte={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Ite={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Ate={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Nte={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},jte={ordinalNumber:Cte({matchPattern:_te,parsePattern:Ete,valueCallback:e=>parseInt(e,10)}),era:Tc({matchPatterns:Rte,defaultMatchWidth:"wide",parsePatterns:Pte,defaultParseWidth:"any"}),quarter:Tc({matchPatterns:Mte,defaultMatchWidth:"wide",parsePatterns:kte,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Tc({matchPatterns:Ote,defaultMatchWidth:"wide",parsePatterns:Dte,defaultParseWidth:"any"}),day:Tc({matchPatterns:Tte,defaultMatchWidth:"wide",parsePatterns:Ite,defaultParseWidth:"any"}),dayPeriod:Tc({matchPatterns:Ate,defaultMatchWidth:"any",parsePatterns:Nte,defaultParseWidth:"any"})},QA={code:"en-US",formatDistance:ste,formatLong:ute,formatRelative:fte,localize:xte,match:jte,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Fte(e){const t=Qe(e);return po(t,KA(t))+1}function JA(e){const t=Qe(e),n=+ca(t)-+Zee(t);return Math.round(n/p1)+1}function ZA(e,t){var u,d,h,f;const n=Qe(e),r=n.getFullYear(),o=Id(),i=(t==null?void 0:t.firstWeekContainsDate)??((d=(u=t==null?void 0:t.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)??o.firstWeekContainsDate??((f=(h=o.locale)==null?void 0:h.options)==null?void 0:f.firstWeekContainsDate)??1,s=Kn(e,0);s.setFullYear(r+1,0,i),s.setHours(0,0,0,0);const a=_o(s,t),l=Kn(e,0);l.setFullYear(r,0,i),l.setHours(0,0,0,0);const c=_o(l,t);return n.getTime()>=a.getTime()?r+1:n.getTime()>=c.getTime()?r:r-1}function Lte(e,t){var a,l,c,u;const n=Id(),r=(t==null?void 0:t.firstWeekContainsDate)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.firstWeekContainsDate)??n.firstWeekContainsDate??((u=(c=n.locale)==null?void 0:c.options)==null?void 0:u.firstWeekContainsDate)??1,o=ZA(e,t),i=Kn(e,0);return i.setFullYear(o,0,r),i.setHours(0,0,0,0),_o(i,t)}function eN(e,t){const n=Qe(e),r=+_o(n,t)-+Lte(n,t);return Math.round(r/p1)+1}function dt(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const gi={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return dt(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):dt(n+1,2)},d(e,t){return dt(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return dt(e.getHours()%12||12,t.length)},H(e,t){return dt(e.getHours(),t.length)},m(e,t){return dt(e.getMinutes(),t.length)},s(e,t){return dt(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),o=Math.trunc(r*Math.pow(10,n-3));return dt(o,t.length)}},Na={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},BR={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),o=r>0?r:1-r;return n.ordinalNumber(o,{unit:"year"})}return gi.y(e,t)},Y:function(e,t,n,r){const o=ZA(e,r),i=o>0?o:1-o;if(t==="YY"){const s=i%100;return dt(s,2)}return t==="Yo"?n.ordinalNumber(i,{unit:"year"}):dt(i,t.length)},R:function(e,t){const n=YA(e);return dt(n,t.length)},u:function(e,t){const n=e.getFullYear();return dt(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return dt(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return dt(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return gi.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return dt(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const o=eN(e,r);return t==="wo"?n.ordinalNumber(o,{unit:"week"}):dt(o,t.length)},I:function(e,t,n){const r=JA(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):dt(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):gi.d(e,t)},D:function(e,t,n){const r=Fte(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):dt(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const o=e.getDay(),i=(o-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return dt(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});case"eeee":default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const o=e.getDay(),i=(o-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return dt(i,t.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});case"cccc":default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),o=r===0?7:r;switch(t){case"i":return String(o);case"ii":return dt(o,t.length);case"io":return n.ordinalNumber(o,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const o=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let o;switch(r===12?o=Na.noon:r===0?o=Na.midnight:o=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let o;switch(r>=17?o=Na.evening:r>=12?o=Na.afternoon:r>=4?o=Na.morning:o=Na.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return gi.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):gi.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):dt(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):dt(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):gi.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):gi.s(e,t)},S:function(e,t){return gi.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return HR(r);case"XXXX":case"XX":return vs(r);case"XXXXX":case"XXX":default:return vs(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return HR(r);case"xxxx":case"xx":return vs(r);case"xxxxx":case"xxx":default:return vs(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+VR(r,":");case"OOOO":default:return"GMT"+vs(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+VR(r,":");case"zzzz":default:return"GMT"+vs(r,":")}},t:function(e,t,n){const r=Math.trunc(e.getTime()/1e3);return dt(r,t.length)},T:function(e,t,n){const r=e.getTime();return dt(r,t.length)}};function VR(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=Math.trunc(r/60),i=r%60;return i===0?n+String(o):n+String(o)+t+dt(i,2)}function HR(e,t){return e%60===0?(e>0?"-":"+")+dt(Math.abs(e)/60,2):vs(e,t)}function vs(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=dt(Math.trunc(r/60),2),i=dt(r%60,2);return n+o+t+i}const WR=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},tN=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},$te=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],o=n[2];if(!o)return WR(e,t);let i;switch(r){case"P":i=t.dateTime({width:"short"});break;case"PP":i=t.dateTime({width:"medium"});break;case"PPP":i=t.dateTime({width:"long"});break;case"PPPP":default:i=t.dateTime({width:"full"});break}return i.replace("{{date}}",WR(r,t)).replace("{{time}}",tN(o,t))},zte={p:tN,P:$te},Bte=/^D+$/,Vte=/^Y+$/,Hte=["D","DD","YY","YYYY"];function Wte(e){return Bte.test(e)}function Ute(e){return Vte.test(e)}function qte(e,t,n){const r=Gte(e,t,n);if(console.warn(r),Hte.includes(e))throw new RangeError(r)}function Gte(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Yte=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Kte=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Xte=/^'([^]*?)'?$/,Qte=/''/g,Jte=/[a-zA-Z]/;function yo(e,t,n){var u,d,h,f,p,g,b,v;const r=Id(),o=(n==null?void 0:n.locale)??r.locale??QA,i=(n==null?void 0:n.firstWeekContainsDate)??((d=(u=n==null?void 0:n.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)??r.firstWeekContainsDate??((f=(h=r.locale)==null?void 0:h.options)==null?void 0:f.firstWeekContainsDate)??1,s=(n==null?void 0:n.weekStartsOn)??((g=(p=n==null?void 0:n.locale)==null?void 0:p.options)==null?void 0:g.weekStartsOn)??r.weekStartsOn??((v=(b=r.locale)==null?void 0:b.options)==null?void 0:v.weekStartsOn)??0,a=Qe(e);if(!rte(a))throw new RangeError("Invalid time value");let l=t.match(Kte).map(x=>{const y=x[0];if(y==="p"||y==="P"){const _=zte[y];return _(x,o.formatLong)}return x}).join("").match(Yte).map(x=>{if(x==="''")return{isToken:!1,value:"'"};const y=x[0];if(y==="'")return{isToken:!1,value:Zte(x)};if(BR[y])return{isToken:!0,value:x};if(y.match(Jte))throw new RangeError("Format string contains an unescaped latin alphabet character `"+y+"`");return{isToken:!1,value:x}});o.localize.preprocessor&&(l=o.localize.preprocessor(a,l));const c={firstWeekContainsDate:i,weekStartsOn:s,locale:o};return l.map(x=>{if(!x.isToken)return x.value;const y=x.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&Ute(y)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&Wte(y))&&qte(y,t,String(e));const _=BR[y[0]];return _(a,y,o.localize,c)}).join("")}function Zte(e){const t=e.match(Xte);return t?t[1].replace(Qte,"'"):e}function ene(e){const t=Qe(e),n=t.getFullYear(),r=t.getMonth(),o=Kn(e,0);return o.setFullYear(n,r+1,0),o.setHours(0,0,0,0),o.getDate()}function tne(e){return Math.trunc(+Qe(e)/1e3)}function nne(e){const t=Qe(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(0,0,0,0),t}function rne(e,t){return ote(nne(e),Gn(e),t)+1}function my(e,t){const n=Qe(e),r=Qe(t);return n.getTime()>r.getTime()}function nN(e,t){const n=Qe(e),r=Qe(t);return+n<+r}function v1(e,t){const n=Qe(e),r=Qe(t);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()}function one(e,t){const n=Qe(e),r=Qe(t);return n.getFullYear()===r.getFullYear()}function Vb(e,t){return Mn(e,-t)}function Hb(e,t){const n=Qe(e),r=n.getFullYear(),o=n.getDate(),i=Kn(e,0);i.setFullYear(r,t,15),i.setHours(0,0,0,0);const s=ene(i);return n.setMonth(t,Math.min(o,s)),n}function UR(e,t){const n=Qe(e);return isNaN(+n)?Kn(e,NaN):(n.setFullYear(t),n)}var Ee=function(){return Ee=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},Ee.apply(this,arguments)};function ine(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function rN(e,t,n){for(var r=0,o=t.length,i;r<o;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}function Ad(e){return e.mode==="multiple"}function Nd(e){return e.mode==="range"}function Xg(e){return e.mode==="single"}var sne={root:"rdp",multiple_months:"rdp-multiple_months",with_weeknumber:"rdp-with_weeknumber",vhidden:"rdp-vhidden",button_reset:"rdp-button_reset",button:"rdp-button",caption:"rdp-caption",caption_start:"rdp-caption_start",caption_end:"rdp-caption_end",caption_between:"rdp-caption_between",caption_label:"rdp-caption_label",caption_dropdowns:"rdp-caption_dropdowns",dropdown:"rdp-dropdown",dropdown_month:"rdp-dropdown_month",dropdown_year:"rdp-dropdown_year",dropdown_icon:"rdp-dropdown_icon",months:"rdp-months",month:"rdp-month",table:"rdp-table",tbody:"rdp-tbody",tfoot:"rdp-tfoot",head:"rdp-head",head_row:"rdp-head_row",head_cell:"rdp-head_cell",nav:"rdp-nav",nav_button:"rdp-nav_button",nav_button_previous:"rdp-nav_button_previous",nav_button_next:"rdp-nav_button_next",nav_icon:"rdp-nav_icon",row:"rdp-row",weeknumber:"rdp-weeknumber",cell:"rdp-cell",day:"rdp-day",day_today:"rdp-day_today",day_outside:"rdp-day_outside",day_selected:"rdp-day_selected",day_disabled:"rdp-day_disabled",day_hidden:"rdp-day_hidden",day_range_start:"rdp-day_range_start",day_range_end:"rdp-day_range_end",day_range_middle:"rdp-day_range_middle"};function ane(e,t){return yo(e,"LLLL y",t)}function lne(e,t){return yo(e,"d",t)}function cne(e,t){return yo(e,"LLLL",t)}function une(e){return"".concat(e)}function dne(e,t){return yo(e,"cccccc",t)}function fne(e,t){return yo(e,"yyyy",t)}var hne=Object.freeze({__proto__:null,formatCaption:ane,formatDay:lne,formatMonthCaption:cne,formatWeekNumber:une,formatWeekdayName:dne,formatYearCaption:fne}),pne=function(e,t,n){return yo(e,"do MMMM (EEEE)",n)},gne=function(){return"Month: "},mne=function(){return"Go to next month"},bne=function(){return"Go to previous month"},vne=function(e,t){return yo(e,"cccc",t)},yne=function(e){return"Week n. ".concat(e)},xne=function(){return"Year: "},wne=Object.freeze({__proto__:null,labelDay:pne,labelMonthDropdown:gne,labelNext:mne,labelPrevious:bne,labelWeekNumber:yne,labelWeekday:vne,labelYearDropdown:xne});function Sne(){var e="buttons",t=sne,n=QA,r={},o={},i=1,s={},a=new Date;return{captionLayout:e,classNames:t,formatters:hne,labels:wne,locale:n,modifiersClassNames:r,modifiers:o,numberOfMonths:i,styles:s,today:a,mode:"default"}}function Cne(e){var t=e.fromYear,n=e.toYear,r=e.fromMonth,o=e.toMonth,i=e.fromDate,s=e.toDate;return r?i=Gn(r):t&&(i=new Date(t,0,1)),o?s=m1(o):n&&(s=new Date(n,11,31)),{fromDate:i?Yl(i):void 0,toDate:s?Yl(s):void 0}}var oN=E.createContext(void 0);function _ne(e){var t,n=e.initialProps,r=Sne(),o=Cne(n),i=o.fromDate,s=o.toDate,a=(t=n.captionLayout)!==null&&t!==void 0?t:r.captionLayout;a!=="buttons"&&(!i||!s)&&(a="buttons");var l;(Xg(n)||Ad(n)||Nd(n))&&(l=n.onSelect);var c=Ee(Ee(Ee({},r),n),{captionLayout:a,classNames:Ee(Ee({},r.classNames),n.classNames),components:Ee({},n.components),formatters:Ee(Ee({},r.formatters),n.formatters),fromDate:i,labels:Ee(Ee({},r.labels),n.labels),mode:n.mode||r.mode,modifiers:Ee(Ee({},r.modifiers),n.modifiers),modifiersClassNames:Ee(Ee({},r.modifiersClassNames),n.modifiersClassNames),onSelect:l,styles:Ee(Ee({},r.styles),n.styles),toDate:s});return m.jsx(oN.Provider,{value:c,children:e.children})}function xt(){var e=E.useContext(oN);if(!e)throw new Error("useDayPicker must be used within a DayPickerProvider.");return e}function iN(e){var t=xt(),n=t.locale,r=t.classNames,o=t.styles,i=t.formatters.formatCaption;return m.jsx("div",{className:r.caption_label,style:o.caption_label,"aria-live":"polite",role:"presentation",id:e.id,children:i(e.displayMonth,{locale:n})})}function Ene(e){return m.jsx("svg",Ee({width:"8px",height:"8px",viewBox:"0 0 120 120","data-testid":"iconDropdown"},e,{children:m.jsx("path",{d:"M4.22182541,48.2218254 C8.44222828,44.0014225 15.2388494,43.9273804 19.5496459,47.9996989 L19.7781746,48.2218254 L60,88.443 L100.221825,48.2218254 C104.442228,44.0014225 111.238849,43.9273804 115.549646,47.9996989 L115.778175,48.2218254 C119.998577,52.4422283 120.07262,59.2388494 116.000301,63.5496459 L115.778175,63.7781746 L67.7781746,111.778175 C63.5577717,115.998577 56.7611506,116.07262 52.4503541,112.000301 L52.2218254,111.778175 L4.22182541,63.7781746 C-0.0739418023,59.4824074 -0.0739418023,52.5175926 4.22182541,48.2218254 Z",fill:"currentColor",fillRule:"nonzero"})}))}function sN(e){var t,n,r=e.onChange,o=e.value,i=e.children,s=e.caption,a=e.className,l=e.style,c=xt(),u=(n=(t=c.components)===null||t===void 0?void 0:t.IconDropdown)!==null&&n!==void 0?n:Ene;return m.jsxs("div",{className:a,style:l,children:[m.jsx("span",{className:c.classNames.vhidden,children:e["aria-label"]}),m.jsx("select",{name:e.name,"aria-label":e["aria-label"],className:c.classNames.dropdown,style:c.styles.dropdown,value:o,onChange:r,children:i}),m.jsxs("div",{className:c.classNames.caption_label,style:c.styles.caption_label,"aria-hidden":"true",children:[s,m.jsx(u,{className:c.classNames.dropdown_icon,style:c.styles.dropdown_icon})]})]})}function Rne(e){var t,n=xt(),r=n.fromDate,o=n.toDate,i=n.styles,s=n.locale,a=n.formatters.formatMonthCaption,l=n.classNames,c=n.components,u=n.labels.labelMonthDropdown;if(!r)return m.jsx(m.Fragment,{});if(!o)return m.jsx(m.Fragment,{});var d=[];if(one(r,o))for(var h=Gn(r),f=r.getMonth();f<=o.getMonth();f++)d.push(Hb(h,f));else for(var h=Gn(new Date),f=0;f<=11;f++)d.push(Hb(h,f));var p=function(b){var v=Number(b.target.value),x=Hb(Gn(e.displayMonth),v);e.onChange(x)},g=(t=c==null?void 0:c.Dropdown)!==null&&t!==void 0?t:sN;return m.jsx(g,{name:"months","aria-label":u(),className:l.dropdown_month,style:i.dropdown_month,onChange:p,value:e.displayMonth.getMonth(),caption:a(e.displayMonth,{locale:s}),children:d.map(function(b){return m.jsx("option",{value:b.getMonth(),children:a(b,{locale:s})},b.getMonth())})})}function Pne(e){var t,n=e.displayMonth,r=xt(),o=r.fromDate,i=r.toDate,s=r.locale,a=r.styles,l=r.classNames,c=r.components,u=r.formatters.formatYearCaption,d=r.labels.labelYearDropdown,h=[];if(!o)return m.jsx(m.Fragment,{});if(!i)return m.jsx(m.Fragment,{});for(var f=o.getFullYear(),p=i.getFullYear(),g=f;g<=p;g++)h.push(UR(KA(new Date),g));var b=function(x){var y=UR(Gn(n),Number(x.target.value));e.onChange(y)},v=(t=c==null?void 0:c.Dropdown)!==null&&t!==void 0?t:sN;return m.jsx(v,{name:"years","aria-label":d(),className:l.dropdown_year,style:a.dropdown_year,onChange:b,value:n.getFullYear(),caption:u(n,{locale:s}),children:h.map(function(x){return m.jsx("option",{value:x.getFullYear(),children:u(x,{locale:s})},x.getFullYear())})})}function Mne(e,t){var n=E.useState(e),r=n[0],o=n[1],i=t===void 0?r:t;return[i,o]}function kne(e){var t=e.month,n=e.defaultMonth,r=e.today,o=t||n||r||new Date,i=e.toDate,s=e.fromDate,a=e.numberOfMonths,l=a===void 0?1:a;if(i&&Wu(i,o)<0){var c=-1*(l-1);o=qr(i,c)}return s&&Wu(o,s)<0&&(o=s),Gn(o)}function One(){var e=xt(),t=kne(e),n=Mne(t,e.month),r=n[0],o=n[1],i=function(s){var a;if(!e.disableNavigation){var l=Gn(s);o(l),(a=e.onMonthChange)===null||a===void 0||a.call(e,l)}};return[r,i]}function Dne(e,t){for(var n=t.reverseMonths,r=t.numberOfMonths,o=Gn(e),i=Gn(qr(o,r)),s=Wu(i,o),a=[],l=0;l<s;l++){var c=qr(o,l);a.push(c)}return n&&(a=a.reverse()),a}function Tne(e,t){if(!t.disableNavigation){var n=t.toDate,r=t.pagedNavigation,o=t.numberOfMonths,i=o===void 0?1:o,s=r?i:1,a=Gn(e);if(!n)return qr(a,s);var l=Wu(n,e);if(!(l<i))return qr(a,s)}}function Ine(e,t){if(!t.disableNavigation){var n=t.fromDate,r=t.pagedNavigation,o=t.numberOfMonths,i=o===void 0?1:o,s=r?i:1,a=Gn(e);if(!n)return qr(a,-s);var l=Wu(a,n);if(!(l<=0))return qr(a,-s)}}var aN=E.createContext(void 0);function Ane(e){var t=xt(),n=One(),r=n[0],o=n[1],i=Dne(r,t),s=Tne(r,t),a=Ine(r,t),l=function(d){return i.some(function(h){return v1(d,h)})},c=function(d,h){l(d)||(h&&nN(d,h)?o(qr(d,1+t.numberOfMonths*-1)):o(d))},u={currentMonth:r,displayMonths:i,goToMonth:o,goToDate:c,previousMonth:a,nextMonth:s,isDateDisplayed:l};return m.jsx(aN.Provider,{value:u,children:e.children})}function jd(){var e=E.useContext(aN);if(!e)throw new Error("useNavigation must be used within a NavigationProvider");return e}function qR(e){var t,n=xt(),r=n.classNames,o=n.styles,i=n.components,s=jd().goToMonth,a=function(u){s(qr(u,e.displayIndex?-e.displayIndex:0))},l=(t=i==null?void 0:i.CaptionLabel)!==null&&t!==void 0?t:iN,c=m.jsx(l,{id:e.id,displayMonth:e.displayMonth});return m.jsxs("div",{className:r.caption_dropdowns,style:o.caption_dropdowns,children:[m.jsx("div",{className:r.vhidden,children:c}),m.jsx(Rne,{onChange:a,displayMonth:e.displayMonth}),m.jsx(Pne,{onChange:a,displayMonth:e.displayMonth})]})}function Nne(e){return m.jsx("svg",Ee({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:m.jsx("path",{d:"M69.490332,3.34314575 C72.6145263,0.218951416 77.6798462,0.218951416 80.8040405,3.34314575 C83.8617626,6.40086786 83.9268205,11.3179931 80.9992143,14.4548388 L80.8040405,14.6568542 L35.461,60 L80.8040405,105.343146 C83.8617626,108.400868 83.9268205,113.317993 80.9992143,116.454839 L80.8040405,116.656854 C77.7463184,119.714576 72.8291931,119.779634 69.6923475,116.852028 L69.490332,116.656854 L18.490332,65.6568542 C15.4326099,62.5991321 15.367552,57.6820069 18.2951583,54.5451612 L18.490332,54.3431458 L69.490332,3.34314575 Z",fill:"currentColor",fillRule:"nonzero"})}))}function jne(e){return m.jsx("svg",Ee({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:m.jsx("path",{d:"M49.8040405,3.34314575 C46.6798462,0.218951416 41.6145263,0.218951416 38.490332,3.34314575 C35.4326099,6.40086786 35.367552,11.3179931 38.2951583,14.4548388 L38.490332,14.6568542 L83.8333725,60 L38.490332,105.343146 C35.4326099,108.400868 35.367552,113.317993 38.2951583,116.454839 L38.490332,116.656854 C41.5480541,119.714576 46.4651794,119.779634 49.602025,116.852028 L49.8040405,116.656854 L100.804041,65.6568542 C103.861763,62.5991321 103.926821,57.6820069 100.999214,54.5451612 L100.804041,54.3431458 L49.8040405,3.34314575 Z",fill:"currentColor"})}))}var _p=E.forwardRef(function(e,t){var n=xt(),r=n.classNames,o=n.styles,i=[r.button_reset,r.button];e.className&&i.push(e.className);var s=i.join(" "),a=Ee(Ee({},o.button_reset),o.button);return e.style&&Object.assign(a,e.style),m.jsx("button",Ee({},e,{ref:t,type:"button",className:s,style:a}))});function Fne(e){var t,n,r=xt(),o=r.dir,i=r.locale,s=r.classNames,a=r.styles,l=r.labels,c=l.labelPrevious,u=l.labelNext,d=r.components;if(!e.nextMonth&&!e.previousMonth)return m.jsx(m.Fragment,{});var h=c(e.previousMonth,{locale:i}),f=[s.nav_button,s.nav_button_previous].join(" "),p=u(e.nextMonth,{locale:i}),g=[s.nav_button,s.nav_button_next].join(" "),b=(t=d==null?void 0:d.IconRight)!==null&&t!==void 0?t:jne,v=(n=d==null?void 0:d.IconLeft)!==null&&n!==void 0?n:Nne;return m.jsxs("div",{className:s.nav,style:a.nav,children:[!e.hidePrevious&&m.jsx(_p,{name:"previous-month","aria-label":h,className:f,style:a.nav_button_previous,disabled:!e.previousMonth,onClick:e.onPreviousClick,children:o==="rtl"?m.jsx(b,{className:s.nav_icon,style:a.nav_icon}):m.jsx(v,{className:s.nav_icon,style:a.nav_icon})}),!e.hideNext&&m.jsx(_p,{name:"next-month","aria-label":p,className:g,style:a.nav_button_next,disabled:!e.nextMonth,onClick:e.onNextClick,children:o==="rtl"?m.jsx(v,{className:s.nav_icon,style:a.nav_icon}):m.jsx(b,{className:s.nav_icon,style:a.nav_icon})})]})}function GR(e){var t=xt().numberOfMonths,n=jd(),r=n.previousMonth,o=n.nextMonth,i=n.goToMonth,s=n.displayMonths,a=s.findIndex(function(p){return v1(e.displayMonth,p)}),l=a===0,c=a===s.length-1,u=t>1&&(l||!c),d=t>1&&(c||!l),h=function(){r&&i(r)},f=function(){o&&i(o)};return m.jsx(Fne,{displayMonth:e.displayMonth,hideNext:u,hidePrevious:d,nextMonth:o,previousMonth:r,onPreviousClick:h,onNextClick:f})}function Lne(e){var t,n=xt(),r=n.classNames,o=n.disableNavigation,i=n.styles,s=n.captionLayout,a=n.components,l=(t=a==null?void 0:a.CaptionLabel)!==null&&t!==void 0?t:iN,c;return o?c=m.jsx(l,{id:e.id,displayMonth:e.displayMonth}):s==="dropdown"?c=m.jsx(qR,{displayMonth:e.displayMonth,id:e.id}):s==="dropdown-buttons"?c=m.jsxs(m.Fragment,{children:[m.jsx(qR,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id}),m.jsx(GR,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id})]}):c=m.jsxs(m.Fragment,{children:[m.jsx(l,{id:e.id,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),m.jsx(GR,{displayMonth:e.displayMonth,id:e.id})]}),m.jsx("div",{className:r.caption,style:i.caption,children:c})}function $ne(e){var t=xt(),n=t.footer,r=t.styles,o=t.classNames.tfoot;return n?m.jsx("tfoot",{className:o,style:r.tfoot,children:m.jsx("tr",{children:m.jsx("td",{colSpan:8,children:n})})}):m.jsx(m.Fragment,{})}function zne(e,t,n){for(var r=n?ca(new Date):_o(new Date,{locale:e,weekStartsOn:t}),o=[],i=0;i<7;i++){var s=Mn(r,i);o.push(s)}return o}function Bne(){var e=xt(),t=e.classNames,n=e.styles,r=e.showWeekNumber,o=e.locale,i=e.weekStartsOn,s=e.ISOWeek,a=e.formatters.formatWeekdayName,l=e.labels.labelWeekday,c=zne(o,i,s);return m.jsxs("tr",{style:n.head_row,className:t.head_row,children:[r&&m.jsx("td",{style:n.head_cell,className:t.head_cell}),c.map(function(u,d){return m.jsx("th",{scope:"col",className:t.head_cell,style:n.head_cell,"aria-label":l(u,{locale:o}),children:a(u,{locale:o})},d)})]})}function Vne(){var e,t=xt(),n=t.classNames,r=t.styles,o=t.components,i=(e=o==null?void 0:o.HeadRow)!==null&&e!==void 0?e:Bne;return m.jsx("thead",{style:r.head,className:n.head,children:m.jsx(i,{})})}function Hne(e){var t=xt(),n=t.locale,r=t.formatters.formatDay;return m.jsx(m.Fragment,{children:r(e.date,{locale:n})})}var y1=E.createContext(void 0);function Wne(e){if(!Ad(e.initialProps)){var t={selected:void 0,modifiers:{disabled:[]}};return m.jsx(y1.Provider,{value:t,children:e.children})}return m.jsx(Une,{initialProps:e.initialProps,children:e.children})}function Une(e){var t=e.initialProps,n=e.children,r=t.selected,o=t.min,i=t.max,s=function(c,u,d){var h,f;(h=t.onDayClick)===null||h===void 0||h.call(t,c,u,d);var p=!!(u.selected&&o&&(r==null?void 0:r.length)===o);if(!p){var g=!!(!u.selected&&i&&(r==null?void 0:r.length)===i);if(!g){var b=r?rN([],r):[];if(u.selected){var v=b.findIndex(function(x){return qn(c,x)});b.splice(v,1)}else b.push(c);(f=t.onSelect)===null||f===void 0||f.call(t,b,c,u,d)}}},a={disabled:[]};r&&a.disabled.push(function(c){var u=i&&r.length>i-1,d=r.some(function(h){return qn(h,c)});return!!(u&&!d)});var l={selected:r,onDayClick:s,modifiers:a};return m.jsx(y1.Provider,{value:l,children:n})}function x1(){var e=E.useContext(y1);if(!e)throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");return e}function qne(e,t){var n=t||{},r=n.from,o=n.to;return r&&o?qn(o,e)&&qn(r,e)?void 0:qn(o,e)?{from:o,to:void 0}:qn(r,e)?void 0:my(r,e)?{from:e,to:o}:{from:r,to:e}:o?my(e,o)?{from:o,to:e}:{from:e,to:o}:r?nN(e,r)?{from:e,to:r}:{from:r,to:e}:{from:e,to:void 0}}var w1=E.createContext(void 0);function Gne(e){if(!Nd(e.initialProps)){var t={selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}};return m.jsx(w1.Provider,{value:t,children:e.children})}return m.jsx(Yne,{initialProps:e.initialProps,children:e.children})}function Yne(e){var t=e.initialProps,n=e.children,r=t.selected,o=r||{},i=o.from,s=o.to,a=t.min,l=t.max,c=function(f,p,g){var b,v;(b=t.onDayClick)===null||b===void 0||b.call(t,f,p,g);var x=qne(f,r);(v=t.onSelect)===null||v===void 0||v.call(t,x,f,p,g)},u={range_start:[],range_end:[],range_middle:[],disabled:[]};if(i?(u.range_start=[i],s?(u.range_end=[s],qn(i,s)||(u.range_middle=[{after:i,before:s}])):u.range_end=[i]):s&&(u.range_start=[s],u.range_end=[s]),a&&(i&&!s&&u.disabled.push({after:Vb(i,a-1),before:Mn(i,a-1)}),i&&s&&u.disabled.push({after:i,before:Mn(i,a-1)}),!i&&s&&u.disabled.push({after:Vb(s,a-1),before:Mn(s,a-1)})),l){if(i&&!s&&(u.disabled.push({before:Mn(i,-l+1)}),u.disabled.push({after:Mn(i,l-1)})),i&&s){var d=po(s,i)+1,h=l-d;u.disabled.push({before:Vb(i,h)}),u.disabled.push({after:Mn(s,h)})}!i&&s&&(u.disabled.push({before:Mn(s,-l+1)}),u.disabled.push({after:Mn(s,l-1)}))}return m.jsx(w1.Provider,{value:{selected:r,onDayClick:c,modifiers:u},children:n})}function S1(){var e=E.useContext(w1);if(!e)throw new Error("useSelectRange must be used within a SelectRangeProvider");return e}function _h(e){return Array.isArray(e)?rN([],e):e!==void 0?[e]:[]}function Kne(e){var t={};return Object.entries(e).forEach(function(n){var r=n[0],o=n[1];t[r]=_h(o)}),t}var Gr;(function(e){e.Outside="outside",e.Disabled="disabled",e.Selected="selected",e.Hidden="hidden",e.Today="today",e.RangeStart="range_start",e.RangeEnd="range_end",e.RangeMiddle="range_middle"})(Gr||(Gr={}));var Xne=Gr.Selected,Fo=Gr.Disabled,Qne=Gr.Hidden,Jne=Gr.Today,Wb=Gr.RangeEnd,Ub=Gr.RangeMiddle,qb=Gr.RangeStart,Zne=Gr.Outside;function ere(e,t,n){var r,o=(r={},r[Xne]=_h(e.selected),r[Fo]=_h(e.disabled),r[Qne]=_h(e.hidden),r[Jne]=[e.today],r[Wb]=[],r[Ub]=[],r[qb]=[],r[Zne]=[],r);return e.fromDate&&o[Fo].push({before:e.fromDate}),e.toDate&&o[Fo].push({after:e.toDate}),Ad(e)?o[Fo]=o[Fo].concat(t.modifiers[Fo]):Nd(e)&&(o[Fo]=o[Fo].concat(n.modifiers[Fo]),o[qb]=n.modifiers[qb],o[Ub]=n.modifiers[Ub],o[Wb]=n.modifiers[Wb]),o}var lN=E.createContext(void 0);function tre(e){var t=xt(),n=x1(),r=S1(),o=ere(t,n,r),i=Kne(t.modifiers),s=Ee(Ee({},o),i);return m.jsx(lN.Provider,{value:s,children:e.children})}function cN(){var e=E.useContext(lN);if(!e)throw new Error("useModifiers must be used within a ModifiersProvider");return e}function nre(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function rre(e){return!!(e&&typeof e=="object"&&"from"in e)}function ore(e){return!!(e&&typeof e=="object"&&"after"in e)}function ire(e){return!!(e&&typeof e=="object"&&"before"in e)}function sre(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function are(e,t){var n,r=t.from,o=t.to;if(r&&o){var i=po(o,r)<0;i&&(n=[o,r],r=n[0],o=n[1]);var s=po(e,r)>=0&&po(o,e)>=0;return s}return o?qn(o,e):r?qn(r,e):!1}function lre(e){return g1(e)}function cre(e){return Array.isArray(e)&&e.every(g1)}function ure(e,t){return t.some(function(n){if(typeof n=="boolean")return n;if(lre(n))return qn(e,n);if(cre(n))return n.includes(e);if(rre(n))return are(e,n);if(sre(n))return n.dayOfWeek.includes(e.getDay());if(nre(n)){var r=po(n.before,e),o=po(n.after,e),i=r>0,s=o<0,a=my(n.before,n.after);return a?s&&i:i||s}return ore(n)?po(e,n.after)>0:ire(n)?po(n.before,e)>0:typeof n=="function"?n(e):!1})}function C1(e,t,n){var r=Object.keys(t).reduce(function(i,s){var a=t[s];return ure(e,a)&&i.push(s),i},[]),o={};return r.forEach(function(i){return o[i]=!0}),n&&!v1(e,n)&&(o.outside=!0),o}function dre(e,t){for(var n=Gn(e[0]),r=m1(e[e.length-1]),o,i,s=n;s<=r;){var a=C1(s,t),l=!a.disabled&&!a.hidden;if(!l){s=Mn(s,1);continue}if(a.selected)return s;a.today&&!i&&(i=s),o||(o=s),s=Mn(s,1)}return i||o}var fre=365;function uN(e,t){var n=t.moveBy,r=t.direction,o=t.context,i=t.modifiers,s=t.retry,a=s===void 0?{count:0,lastFocused:e}:s,l=o.weekStartsOn,c=o.fromDate,u=o.toDate,d=o.locale,h={day:Mn,week:gy,month:qr,year:ete,startOfWeek:function(b){return o.ISOWeek?ca(b):_o(b,{locale:d,weekStartsOn:l})},endOfWeek:function(b){return o.ISOWeek?XA(b):b1(b,{locale:d,weekStartsOn:l})}},f=h[n](e,r==="after"?1:-1);r==="before"&&c?f=tte([c,f]):r==="after"&&u&&(f=nte([u,f]));var p=!0;if(i){var g=C1(f,i);p=!g.disabled&&!g.hidden}return p?f:a.count>fre?a.lastFocused:uN(f,{moveBy:n,direction:r,context:o,modifiers:i,retry:Ee(Ee({},a),{count:a.count+1})})}var dN=E.createContext(void 0);function hre(e){var t=jd(),n=cN(),r=E.useState(),o=r[0],i=r[1],s=E.useState(),a=s[0],l=s[1],c=dre(t.displayMonths,n),u=o??(a&&t.isDateDisplayed(a))?a:c,d=function(){l(o),i(void 0)},h=function(b){i(b)},f=xt(),p=function(b,v){if(o){var x=uN(o,{moveBy:b,direction:v,context:f,modifiers:n});qn(o,x)||(t.goToDate(x,o),h(x))}},g={focusedDay:o,focusTarget:u,blur:d,focus:h,focusDayAfter:function(){return p("day","after")},focusDayBefore:function(){return p("day","before")},focusWeekAfter:function(){return p("week","after")},focusWeekBefore:function(){return p("week","before")},focusMonthBefore:function(){return p("month","before")},focusMonthAfter:function(){return p("month","after")},focusYearBefore:function(){return p("year","before")},focusYearAfter:function(){return p("year","after")},focusStartOfWeek:function(){return p("startOfWeek","before")},focusEndOfWeek:function(){return p("endOfWeek","after")}};return m.jsx(dN.Provider,{value:g,children:e.children})}function _1(){var e=E.useContext(dN);if(!e)throw new Error("useFocusContext must be used within a FocusProvider");return e}function pre(e,t){var n=cN(),r=C1(e,n,t);return r}var E1=E.createContext(void 0);function gre(e){if(!Xg(e.initialProps)){var t={selected:void 0};return m.jsx(E1.Provider,{value:t,children:e.children})}return m.jsx(mre,{initialProps:e.initialProps,children:e.children})}function mre(e){var t=e.initialProps,n=e.children,r=function(i,s,a){var l,c,u;if((l=t.onDayClick)===null||l===void 0||l.call(t,i,s,a),s.selected&&!t.required){(c=t.onSelect)===null||c===void 0||c.call(t,void 0,i,s,a);return}(u=t.onSelect)===null||u===void 0||u.call(t,i,i,s,a)},o={selected:t.selected,onDayClick:r};return m.jsx(E1.Provider,{value:o,children:n})}function fN(){var e=E.useContext(E1);if(!e)throw new Error("useSelectSingle must be used within a SelectSingleProvider");return e}function bre(e,t){var n=xt(),r=fN(),o=x1(),i=S1(),s=_1(),a=s.focusDayAfter,l=s.focusDayBefore,c=s.focusWeekAfter,u=s.focusWeekBefore,d=s.blur,h=s.focus,f=s.focusMonthBefore,p=s.focusMonthAfter,g=s.focusYearBefore,b=s.focusYearAfter,v=s.focusStartOfWeek,x=s.focusEndOfWeek,y=function(L){var j,B,M,W;Xg(n)?(j=r.onDayClick)===null||j===void 0||j.call(r,e,t,L):Ad(n)?(B=o.onDayClick)===null||B===void 0||B.call(o,e,t,L):Nd(n)?(M=i.onDayClick)===null||M===void 0||M.call(i,e,t,L):(W=n.onDayClick)===null||W===void 0||W.call(n,e,t,L)},_=function(L){var j;h(e),(j=n.onDayFocus)===null||j===void 0||j.call(n,e,t,L)},w=function(L){var j;d(),(j=n.onDayBlur)===null||j===void 0||j.call(n,e,t,L)},C=function(L){var j;(j=n.onDayMouseEnter)===null||j===void 0||j.call(n,e,t,L)},R=function(L){var j;(j=n.onDayMouseLeave)===null||j===void 0||j.call(n,e,t,L)},k=function(L){var j;(j=n.onDayPointerEnter)===null||j===void 0||j.call(n,e,t,L)},D=function(L){var j;(j=n.onDayPointerLeave)===null||j===void 0||j.call(n,e,t,L)},I=function(L){var j;(j=n.onDayTouchCancel)===null||j===void 0||j.call(n,e,t,L)},T=function(L){var j;(j=n.onDayTouchEnd)===null||j===void 0||j.call(n,e,t,L)},N=function(L){var j;(j=n.onDayTouchMove)===null||j===void 0||j.call(n,e,t,L)},G=function(L){var j;(j=n.onDayTouchStart)===null||j===void 0||j.call(n,e,t,L)},z=function(L){var j;(j=n.onDayKeyUp)===null||j===void 0||j.call(n,e,t,L)},O=function(L){var j;switch(L.key){case"ArrowLeft":L.preventDefault(),L.stopPropagation(),n.dir==="rtl"?a():l();break;case"ArrowRight":L.preventDefault(),L.stopPropagation(),n.dir==="rtl"?l():a();break;case"ArrowDown":L.preventDefault(),L.stopPropagation(),c();break;case"ArrowUp":L.preventDefault(),L.stopPropagation(),u();break;case"PageUp":L.preventDefault(),L.stopPropagation(),L.shiftKey?g():f();break;case"PageDown":L.preventDefault(),L.stopPropagation(),L.shiftKey?b():p();break;case"Home":L.preventDefault(),L.stopPropagation(),v();break;case"End":L.preventDefault(),L.stopPropagation(),x();break}(j=n.onDayKeyDown)===null||j===void 0||j.call(n,e,t,L)},A={onClick:y,onFocus:_,onBlur:w,onKeyDown:O,onKeyUp:z,onMouseEnter:C,onMouseLeave:R,onPointerEnter:k,onPointerLeave:D,onTouchCancel:I,onTouchEnd:T,onTouchMove:N,onTouchStart:G};return A}function vre(){var e=xt(),t=fN(),n=x1(),r=S1(),o=Xg(e)?t.selected:Ad(e)?n.selected:Nd(e)?r.selected:void 0;return o}function yre(e){return Object.values(Gr).includes(e)}function xre(e,t){var n=[e.classNames.day];return Object.keys(t).forEach(function(r){var o=e.modifiersClassNames[r];if(o)n.push(o);else if(yre(r)){var i=e.classNames["day_".concat(r)];i&&n.push(i)}}),n}function wre(e,t){var n=Ee({},e.styles.day);return Object.keys(t).forEach(function(r){var o;n=Ee(Ee({},n),(o=e.modifiersStyles)===null||o===void 0?void 0:o[r])}),n}function Sre(e,t,n){var r,o,i,s=xt(),a=_1(),l=pre(e,t),c=bre(e,l),u=vre(),d=!!(s.onDayClick||s.mode!=="default");E.useEffect(function(){var C;l.outside||a.focusedDay&&d&&qn(a.focusedDay,e)&&((C=n.current)===null||C===void 0||C.focus())},[a.focusedDay,e,n,d,l.outside]);var h=xre(s,l).join(" "),f=wre(s,l),p=!!(l.outside&&!s.showOutsideDays||l.hidden),g=(i=(o=s.components)===null||o===void 0?void 0:o.DayContent)!==null&&i!==void 0?i:Hne,b=m.jsx(g,{date:e,displayMonth:t,activeModifiers:l}),v={style:f,className:h,children:b,role:"gridcell"},x=a.focusTarget&&qn(a.focusTarget,e)&&!l.outside,y=a.focusedDay&&qn(a.focusedDay,e),_=Ee(Ee(Ee({},v),(r={disabled:l.disabled,role:"gridcell"},r["aria-selected"]=l.selected,r.tabIndex=y||x?0:-1,r)),c),w={isButton:d,isHidden:p,activeModifiers:l,selectedDays:u,buttonProps:_,divProps:v};return w}function Cre(e){var t=E.useRef(null),n=Sre(e.date,e.displayMonth,t);return n.isHidden?m.jsx("div",{role:"gridcell"}):n.isButton?m.jsx(_p,Ee({name:"day",ref:t},n.buttonProps)):m.jsx("div",Ee({},n.divProps))}function _re(e){var t=e.number,n=e.dates,r=xt(),o=r.onWeekNumberClick,i=r.styles,s=r.classNames,a=r.locale,l=r.labels.labelWeekNumber,c=r.formatters.formatWeekNumber,u=c(Number(t),{locale:a});if(!o)return m.jsx("span",{className:s.weeknumber,style:i.weeknumber,children:u});var d=l(Number(t),{locale:a}),h=function(f){o(t,n,f)};return m.jsx(_p,{name:"week-number","aria-label":d,className:s.weeknumber,style:i.weeknumber,onClick:h,children:u})}function Ere(e){var t,n,r=xt(),o=r.styles,i=r.classNames,s=r.showWeekNumber,a=r.components,l=(t=a==null?void 0:a.Day)!==null&&t!==void 0?t:Cre,c=(n=a==null?void 0:a.WeekNumber)!==null&&n!==void 0?n:_re,u;return s&&(u=m.jsx("td",{className:i.cell,style:o.cell,children:m.jsx(c,{number:e.weekNumber,dates:e.dates})})),m.jsxs("tr",{className:i.row,style:o.row,children:[u,e.dates.map(function(d){return m.jsx("td",{className:i.cell,style:o.cell,role:"presentation",children:m.jsx(l,{displayMonth:e.displayMonth,date:d})},tne(d))})]})}function YR(e,t,n){for(var r=n!=null&&n.ISOWeek?XA(t):b1(t,n),o=n!=null&&n.ISOWeek?ca(e):_o(e,n),i=po(r,o),s=[],a=0;a<=i;a++)s.push(Mn(o,a));var l=s.reduce(function(c,u){var d=n!=null&&n.ISOWeek?JA(u):eN(u,n),h=c.find(function(f){return f.weekNumber===d});return h?(h.dates.push(u),c):(c.push({weekNumber:d,dates:[u]}),c)},[]);return l}function Rre(e,t){var n=YR(Gn(e),m1(e),t);if(t!=null&&t.useFixedWeeks){var r=rne(e,t);if(r<6){var o=n[n.length-1],i=o.dates[o.dates.length-1],s=gy(i,6-r),a=YR(gy(i,1),s,t);n.push.apply(n,a)}}return n}function Pre(e){var t,n,r,o=xt(),i=o.locale,s=o.classNames,a=o.styles,l=o.hideHead,c=o.fixedWeeks,u=o.components,d=o.weekStartsOn,h=o.firstWeekContainsDate,f=o.ISOWeek,p=Rre(e.displayMonth,{useFixedWeeks:!!c,ISOWeek:f,locale:i,weekStartsOn:d,firstWeekContainsDate:h}),g=(t=u==null?void 0:u.Head)!==null&&t!==void 0?t:Vne,b=(n=u==null?void 0:u.Row)!==null&&n!==void 0?n:Ere,v=(r=u==null?void 0:u.Footer)!==null&&r!==void 0?r:$ne;return m.jsxs("table",{id:e.id,className:s.table,style:a.table,role:"grid","aria-labelledby":e["aria-labelledby"],children:[!l&&m.jsx(g,{}),m.jsx("tbody",{className:s.tbody,style:a.tbody,children:p.map(function(x){return m.jsx(b,{displayMonth:e.displayMonth,dates:x.dates,weekNumber:x.weekNumber},x.weekNumber)})}),m.jsx(v,{displayMonth:e.displayMonth})]})}function Mre(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var kre=Mre()?E.useLayoutEffect:E.useEffect,Gb=!1,Ore=0;function KR(){return"react-day-picker-".concat(++Ore)}function Dre(e){var t,n=e??(Gb?KR():null),r=E.useState(n),o=r[0],i=r[1];return kre(function(){o===null&&i(KR())},[]),E.useEffect(function(){Gb===!1&&(Gb=!0)},[]),(t=e??o)!==null&&t!==void 0?t:void 0}function Tre(e){var t,n,r=xt(),o=r.dir,i=r.classNames,s=r.styles,a=r.components,l=jd().displayMonths,c=Dre(r.id?"".concat(r.id,"-").concat(e.displayIndex):void 0),u=r.id?"".concat(r.id,"-grid-").concat(e.displayIndex):void 0,d=[i.month],h=s.month,f=e.displayIndex===0,p=e.displayIndex===l.length-1,g=!f&&!p;o==="rtl"&&(t=[f,p],p=t[0],f=t[1]),f&&(d.push(i.caption_start),h=Ee(Ee({},h),s.caption_start)),p&&(d.push(i.caption_end),h=Ee(Ee({},h),s.caption_end)),g&&(d.push(i.caption_between),h=Ee(Ee({},h),s.caption_between));var b=(n=a==null?void 0:a.Caption)!==null&&n!==void 0?n:Lne;return m.jsxs("div",{className:d.join(" "),style:h,children:[m.jsx(b,{id:c,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),m.jsx(Pre,{id:u,"aria-labelledby":c,displayMonth:e.displayMonth})]},e.displayIndex)}function Ire(e){var t=xt(),n=t.classNames,r=t.styles;return m.jsx("div",{className:n.months,style:r.months,children:e.children})}function Are(e){var t,n,r=e.initialProps,o=xt(),i=_1(),s=jd(),a=E.useState(!1),l=a[0],c=a[1];E.useEffect(function(){o.initialFocus&&i.focusTarget&&(l||(i.focus(i.focusTarget),c(!0)))},[o.initialFocus,l,i.focus,i.focusTarget,i]);var u=[o.classNames.root,o.className];o.numberOfMonths>1&&u.push(o.classNames.multiple_months),o.showWeekNumber&&u.push(o.classNames.with_weeknumber);var d=Ee(Ee({},o.styles.root),o.style),h=Object.keys(r).filter(function(p){return p.startsWith("data-")}).reduce(function(p,g){var b;return Ee(Ee({},p),(b={},b[g]=r[g],b))},{}),f=(n=(t=r.components)===null||t===void 0?void 0:t.Months)!==null&&n!==void 0?n:Ire;return m.jsx("div",Ee({className:u.join(" "),style:d,dir:o.dir,id:o.id,nonce:r.nonce,title:r.title,lang:r.lang},h,{children:m.jsx(f,{children:s.displayMonths.map(function(p,g){return m.jsx(Tre,{displayIndex:g,displayMonth:p},g)})})}))}function Nre(e){var t=e.children,n=ine(e,["children"]);return m.jsx(_ne,{initialProps:n,children:m.jsx(Ane,{children:m.jsx(gre,{initialProps:n,children:m.jsx(Wne,{initialProps:n,children:m.jsx(Gne,{initialProps:n,children:m.jsx(tre,{children:m.jsx(hre,{children:t})})})})})})})}function jre(e){return m.jsx(Nre,Ee({},e,{children:m.jsx(Are,{initialProps:e})}))}function hN({className:e,classNames:t,showOutsideDays:n=!0,...r}){return m.jsx(jre,{showOutsideDays:n,className:ie("p-3",e),classNames:{months:"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-center pt-1 relative items-center",caption_label:"text-sm font-medium",nav:"space-x-1 flex items-center",nav_button:ie(Hu({variant:"outline"}),"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:"h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-md [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected])]:bg-accent first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20",day:ie(Hu({variant:"ghost"}),"h-9 w-9 p-0 font-normal aria-selected:opacity-100"),day_range_end:"day-range-end",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...t},components:{IconLeft:({...o})=>m.jsx(Kk,{...o,className:"h-4 w-4"}),IconRight:({...o})=>m.jsx(tw,{...o,className:"h-4 w-4"})},...r})}hN.displayName="Calendar";function pN(e){const{authToken:t}=vr(),n=se(_=>_.authToken),r=t||n,o=se(_=>_.dashboard.filters),i=se(_=>_.selectedSheetId),s=se(_=>_.filterValues),[a,l]=E.useState(!0),c=o==null?void 0:o.filter(_=>_.sheetId===i||!_.sheetId),u=s==null?void 0:s.filter(_=>(c==null?void 0:c.some(w=>w.id===_.filterId))||_.filterId.endsWith(i));function d(_){return a?{allowQuery:!0,filterValues:_.filter(R=>R.filterId!==e.id)}:(_==null?void 0:_.find(C=>C.filterId===e.id))?{allowQuery:!1,filterValues:_}:{allowQuery:!0,filterValues:_}}const{allowQuery:h,filterValues:f}=d(u||[]),{data:p,isLoading:g,isFetching:b,isError:v,refetch:x,isSuccess:y}=hd({queryKey:["filter",e.id,e.sql,JSON.stringify(f)],queryFn:()=>mx("https://semaphor.cloud/api/v1/query",(r==null?void 0:r.accessToken)||"",{connection_id:e.connectionId,sql:e.sql,active_filters:f,cache_config:pM({filter:e})}),enabled:!!e.sql&&!!e.connectionId&&h&&!!(r!=null&&r.accessToken),placeholderData:_=>_});return E.useEffect(()=>{y&&a&&l(!1)},[y,a]),{data:p,isLoading:g,isFetching:b,isError:v,refetch:x}}function Fre(e){const t=se(o=>{var i,s;return(s=(i=o.dashboard)==null?void 0:i.filters)==null?void 0:s.find(a=>a.id===e)}),{setDateRange:n,...r}=gN(t||{});return r}function gN(e){const[t,n]=E.useState(),[r,o]=E.useState(),i=se(p=>p.filterValues),s=se(p=>p.actions.addOrUpdateFilterValue),{removeFilterValues:a}=zt(),{data:l,isLoading:c,isFetching:u,isError:d}=pN(e);E.useEffect(()=>{var p;if(((p=l==null?void 0:l.records)==null?void 0:p.length)>0){const g=l.records[0];if(!g.min||!g.max)return;n({from:new Date(g.min),to:new Date(g.max)}),o({from:new Date(g.min),to:new Date(g.max)})}},[l]),E.useEffect(()=>{var p;if(i){const g=i.find(b=>b.filterId===e.id);if(!g)n(r);else if(((p=g.values)==null?void 0:p.length)===2){const[b,v]=g.values;n({from:b?new Date(b):void 0,to:v?new Date(v):void 0})}}},[i,e.id,r]);function h(){a(e.id),n(r)}function f(p){if(!p)return;let g=[p==null?void 0:p.from,p==null?void 0:p.to];p.from&&p.to===void 0?g=[p.from,zR(p.from,24)]:p.from&&p.to&&p.from.getTime()===p.to.getTime()?g=[p.from,zR(p.to,24)]:g=[p.from,p.to],n({from:g[0],to:g[1]});const b={filterId:e.id,connectionType:e.database==="NA"?"api":"database",valueType:Qa(e),name:e.column,operation:"between",values:g};s(b)}return{records:l==null?void 0:l.records,isLoading:c,isFetching:u,isError:d,initialDateRange:r,dateRange:t,setDateRange:n,handleClear:h,handleChange:f}}function Lre({filter:e,className:t}){const n=se(f=>f.themeStyle),[r,o]=E.useState(!1),{records:i,dateRange:s,isLoading:a,isFetching:l,isError:c,setDateRange:u,handleClear:d,handleChange:h}=gN(e);return a||l?m.jsx("div",{children:m.jsx(el,{className:"h-8 w-full bg-foreground/10"})}):c?m.jsx("div",{className:"h-8 w-full bg-muted px-2",children:"Error"}):i?m.jsx("div",{className:ie("grid gap-2",t),children:m.jsxs(Wg,{open:r,onOpenChange:o,children:[m.jsx(Ug,{style:{borderRadius:n==null?void 0:n.controlInputRadius},asChild:!0,children:m.jsxs(Yt,{size:"sm",id:"date",variant:"outline",className:ie("h-9 w-full justify-start rounded-sm text-left font-normal",!s&&"text-muted-foreground"),children:[m.jsx(Yk,{className:"mr-2 h-4 w-4"}),s!=null&&s.from?s.to?m.jsxs(m.Fragment,{children:[yo(s.from,"LLL dd, y")," -"," ",yo(s.to,"LLL dd, y")]}):yo(s.from,"LLL dd, y"):m.jsx("span",{children:"Pick a date"})]})}),m.jsxs(Td,{style:{borderRadius:n==null?void 0:n.controlInputRadius},className:"w-auto p-0",align:"start",children:[m.jsx("div",{className:"px-4 pt-3",children:m.jsx(Et,{children:e.title})}),m.jsx(hN,{initialFocus:!0,mode:"range",defaultMonth:s==null?void 0:s.from,selected:s,onSelect:u,numberOfMonths:2}),m.jsxs("div",{className:"flex justify-end gap-2 px-4 py-3",children:[m.jsx(Yt,{style:{borderRadius:n==null?void 0:n.controlInputRadius},size:"sm",variant:"outline",onClick:()=>{h(s),o(!1)},children:"Apply"}),m.jsx(Yt,{style:{borderRadius:n==null?void 0:n.controlInputRadius},size:"sm",variant:"outline",onClick:d,children:"Clear"})]})]})]})}):m.jsxs(Et,{className:"w-fulll flex h-8 items-center bg-muted px-2",children:[" ","No Data"]})}const mN=typeof document<"u"?E.useLayoutEffect:()=>{};function $re(e){const t=E.useRef(null);return mN(()=>{t.current=e},[e]),E.useCallback((...n)=>{const r=t.current;return r==null?void 0:r(...n)},[])}const Fd=e=>{var t;return(t=e==null?void 0:e.ownerDocument)!==null&&t!==void 0?t:document},Ms=e=>e&&"window"in e&&e.window===e?e:Fd(e).defaultView||window;function zre(e){var t;return typeof window>"u"||window.navigator==null?!1:((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.brands.some(n=>e.test(n.brand)))||e.test(window.navigator.userAgent)}function Bre(e){var t;return typeof window<"u"&&window.navigator!=null?e.test(((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.platform)||window.navigator.platform):!1}function bN(e){let t=null;return()=>(t==null&&(t=e()),t)}const Vre=bN(function(){return Bre(/^Mac/i)}),Hre=bN(function(){return zre(/Android/i)});function Wre(e){return e.mozInputSource===0&&e.isTrusted?!0:Hre()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}class Ure{isDefaultPrevented(){return this.nativeEvent.defaultPrevented}preventDefault(){this.defaultPrevented=!0,this.nativeEvent.preventDefault()}stopPropagation(){this.nativeEvent.stopPropagation(),this.isPropagationStopped=()=>!0}isPropagationStopped(){return!1}persist(){}constructor(t,n){this.nativeEvent=n,this.target=n.target,this.currentTarget=n.currentTarget,this.relatedTarget=n.relatedTarget,this.bubbles=n.bubbles,this.cancelable=n.cancelable,this.defaultPrevented=n.defaultPrevented,this.eventPhase=n.eventPhase,this.isTrusted=n.isTrusted,this.timeStamp=n.timeStamp,this.type=t}}function vN(e){let t=E.useRef({isFocused:!1,observer:null});mN(()=>{const r=t.current;return()=>{r.observer&&(r.observer.disconnect(),r.observer=null)}},[]);let n=$re(r=>{e==null||e(r)});return E.useCallback(r=>{if(r.target instanceof HTMLButtonElement||r.target instanceof HTMLInputElement||r.target instanceof HTMLTextAreaElement||r.target instanceof HTMLSelectElement){t.current.isFocused=!0;let o=r.target,i=s=>{t.current.isFocused=!1,o.disabled&&n(new Ure("blur",s)),t.current.observer&&(t.current.observer.disconnect(),t.current.observer=null)};o.addEventListener("focusout",i,{once:!0}),t.current.observer=new MutationObserver(()=>{if(t.current.isFocused&&o.disabled){var s;(s=t.current.observer)===null||s===void 0||s.disconnect();let a=o===document.activeElement?null:document.activeElement;o.dispatchEvent(new FocusEvent("blur",{relatedTarget:a})),o.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:a}))}}),t.current.observer.observe(o,{attributes:!0,attributeFilter:["disabled"]})}},[n])}function qre(e){let{isDisabled:t,onFocus:n,onBlur:r,onFocusChange:o}=e;const i=E.useCallback(l=>{if(l.target===l.currentTarget)return r&&r(l),o&&o(!1),!0},[r,o]),s=vN(i),a=E.useCallback(l=>{const c=Fd(l.target);l.target===l.currentTarget&&c.activeElement===l.target&&(n&&n(l),o&&o(!0),s(l))},[o,n,s]);return{focusProps:{onFocus:!t&&(n||o||r)?a:void 0,onBlur:!t&&(r||o)?i:void 0}}}let Ld=null,by=new Set,bu=new Map,ua=!1,vy=!1;const Gre={Tab:!0,Escape:!0};function R1(e,t){for(let n of by)n(e,t)}function Yre(e){return!(e.metaKey||!Vre()&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function Ep(e){ua=!0,Yre(e)&&(Ld="keyboard",R1("keyboard",e))}function Cr(e){Ld="pointer",(e.type==="mousedown"||e.type==="pointerdown")&&(ua=!0,R1("pointer",e))}function yN(e){Wre(e)&&(ua=!0,Ld="virtual")}function xN(e){e.target===window||e.target===document||(!ua&&!vy&&(Ld="virtual",R1("virtual",e)),ua=!1,vy=!1)}function wN(){ua=!1,vy=!0}function yy(e){if(typeof window>"u"||bu.get(Ms(e)))return;const t=Ms(e),n=Fd(e);let r=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){ua=!0,r.apply(this,arguments)},n.addEventListener("keydown",Ep,!0),n.addEventListener("keyup",Ep,!0),n.addEventListener("click",yN,!0),t.addEventListener("focus",xN,!0),t.addEventListener("blur",wN,!1),typeof PointerEvent<"u"?(n.addEventListener("pointerdown",Cr,!0),n.addEventListener("pointermove",Cr,!0),n.addEventListener("pointerup",Cr,!0)):(n.addEventListener("mousedown",Cr,!0),n.addEventListener("mousemove",Cr,!0),n.addEventListener("mouseup",Cr,!0)),t.addEventListener("beforeunload",()=>{SN(e)},{once:!0}),bu.set(t,{focus:r})}const SN=(e,t)=>{const n=Ms(e),r=Fd(e);t&&r.removeEventListener("DOMContentLoaded",t),bu.has(n)&&(n.HTMLElement.prototype.focus=bu.get(n).focus,r.removeEventListener("keydown",Ep,!0),r.removeEventListener("keyup",Ep,!0),r.removeEventListener("click",yN,!0),n.removeEventListener("focus",xN,!0),n.removeEventListener("blur",wN,!1),typeof PointerEvent<"u"?(r.removeEventListener("pointerdown",Cr,!0),r.removeEventListener("pointermove",Cr,!0),r.removeEventListener("pointerup",Cr,!0)):(r.removeEventListener("mousedown",Cr,!0),r.removeEventListener("mousemove",Cr,!0),r.removeEventListener("mouseup",Cr,!0)),bu.delete(n))};function Kre(e){const t=Fd(e);let n;return t.readyState!=="loading"?yy(e):(n=()=>{yy(e)},t.addEventListener("DOMContentLoaded",n)),()=>SN(e,n)}typeof document<"u"&&Kre();function CN(){return Ld!=="pointer"}const Xre=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function Qre(e,t,n){var r;const o=typeof window<"u"?Ms(n==null?void 0:n.target).HTMLInputElement:HTMLInputElement,i=typeof window<"u"?Ms(n==null?void 0:n.target).HTMLTextAreaElement:HTMLTextAreaElement,s=typeof window<"u"?Ms(n==null?void 0:n.target).HTMLElement:HTMLElement,a=typeof window<"u"?Ms(n==null?void 0:n.target).KeyboardEvent:KeyboardEvent;return e=e||(n==null?void 0:n.target)instanceof o&&!Xre.has(n==null||(r=n.target)===null||r===void 0?void 0:r.type)||(n==null?void 0:n.target)instanceof i||(n==null?void 0:n.target)instanceof s&&(n==null?void 0:n.target.isContentEditable),!(e&&t==="keyboard"&&n instanceof a&&!Gre[n.key])}function Jre(e,t,n){yy(),E.useEffect(()=>{let r=(o,i)=>{Qre(!!(n!=null&&n.isTextInput),o,i)&&e(CN())};return by.add(r),()=>{by.delete(r)}},t)}function Zre(e){let{isDisabled:t,onBlurWithin:n,onFocusWithin:r,onFocusWithinChange:o}=e,i=E.useRef({isFocusWithin:!1}),s=E.useCallback(c=>{i.current.isFocusWithin&&!c.currentTarget.contains(c.relatedTarget)&&(i.current.isFocusWithin=!1,n&&n(c),o&&o(!1))},[n,o,i]),a=vN(s),l=E.useCallback(c=>{!i.current.isFocusWithin&&document.activeElement===c.target&&(r&&r(c),o&&o(!0),i.current.isFocusWithin=!0,a(c))},[r,o,a]);return t?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:l,onBlur:s}}}let Rp=!1,Yb=0;function xy(){Rp=!0,setTimeout(()=>{Rp=!1},50)}function XR(e){e.pointerType==="touch"&&xy()}function eoe(){if(!(typeof document>"u"))return typeof PointerEvent<"u"?document.addEventListener("pointerup",XR):document.addEventListener("touchend",xy),Yb++,()=>{Yb--,!(Yb>0)&&(typeof PointerEvent<"u"?document.removeEventListener("pointerup",XR):document.removeEventListener("touchend",xy))}}function _N(e){let{onHoverStart:t,onHoverChange:n,onHoverEnd:r,isDisabled:o}=e,[i,s]=E.useState(!1),a=E.useRef({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:"",target:null}).current;E.useEffect(eoe,[]);let{hoverProps:l,triggerHoverEnd:c}=E.useMemo(()=>{let u=(f,p)=>{if(a.pointerType=p,o||p==="touch"||a.isHovered||!f.currentTarget.contains(f.target))return;a.isHovered=!0;let g=f.currentTarget;a.target=g,t&&t({type:"hoverstart",target:g,pointerType:p}),n&&n(!0),s(!0)},d=(f,p)=>{if(a.pointerType="",a.target=null,p==="touch"||!a.isHovered)return;a.isHovered=!1;let g=f.currentTarget;r&&r({type:"hoverend",target:g,pointerType:p}),n&&n(!1),s(!1)},h={};return typeof PointerEvent<"u"?(h.onPointerEnter=f=>{Rp&&f.pointerType==="mouse"||u(f,f.pointerType)},h.onPointerLeave=f=>{!o&&f.currentTarget.contains(f.target)&&d(f,f.pointerType)}):(h.onTouchStart=()=>{a.ignoreEmulatedMouseEvents=!0},h.onMouseEnter=f=>{!a.ignoreEmulatedMouseEvents&&!Rp&&u(f,"mouse"),a.ignoreEmulatedMouseEvents=!1},h.onMouseLeave=f=>{!o&&f.currentTarget.contains(f.target)&&d(f,"mouse")}),{hoverProps:h,triggerHoverEnd:d}},[t,n,r,o,a]);return E.useEffect(()=>{o&&c({currentTarget:a.target},a.pointerType)},[o]),{hoverProps:l,isHovered:i}}function EN(e={}){let{autoFocus:t=!1,isTextInput:n,within:r}=e,o=E.useRef({isFocused:!1,isFocusVisible:t||CN()}),[i,s]=E.useState(!1),[a,l]=E.useState(()=>o.current.isFocused&&o.current.isFocusVisible),c=E.useCallback(()=>l(o.current.isFocused&&o.current.isFocusVisible),[]),u=E.useCallback(f=>{o.current.isFocused=f,s(f),c()},[c]);Jre(f=>{o.current.isFocusVisible=f,c()},[],{isTextInput:n});let{focusProps:d}=qre({isDisabled:r,onFocusChange:u}),{focusWithinProps:h}=Zre({isDisabled:!r,onFocusWithinChange:u});return{isFocused:i,isFocusVisible:a,focusProps:r?h:d}}var toe=Object.defineProperty,noe=(e,t,n)=>t in e?toe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Kb=(e,t,n)=>(noe(e,typeof t!="symbol"?t+"":t,n),n);let roe=class{constructor(){Kb(this,"current",this.detect()),Kb(this,"handoffState","pending"),Kb(this,"currentId",0)}set(t){this.current!==t&&(this.handoffState="pending",this.currentId=0,this.current=t)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window>"u"||typeof document>"u"?"server":"client"}handoff(){this.handoffState==="pending"&&(this.handoffState="complete")}get isHandoffComplete(){return this.handoffState==="complete"}},Ks=new roe;function $d(e){return Ks.isServer?null:e instanceof Node?e.ownerDocument:e!=null&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}function RN(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function Eo(){let e=[],t={addEventListener(n,r,o,i){return n.addEventListener(r,o,i),t.add(()=>n.removeEventListener(r,o,i))},requestAnimationFrame(...n){let r=requestAnimationFrame(...n);return t.add(()=>cancelAnimationFrame(r))},nextFrame(...n){return t.requestAnimationFrame(()=>t.requestAnimationFrame(...n))},setTimeout(...n){let r=setTimeout(...n);return t.add(()=>clearTimeout(r))},microTask(...n){let r={current:!0};return RN(()=>{r.current&&n[0]()}),t.add(()=>{r.current=!1})},style(n,r,o){let i=n.style.getPropertyValue(r);return Object.assign(n.style,{[r]:o}),this.add(()=>{Object.assign(n.style,{[r]:i})})},group(n){let r=Eo();return n(r),this.add(()=>r.dispose())},add(n){return e.includes(n)||e.push(n),()=>{let r=e.indexOf(n);if(r>=0)for(let o of e.splice(r,1))o()}},dispose(){for(let n of e.splice(0))n()}};return t}function dc(){let[e]=E.useState(Eo);return E.useEffect(()=>()=>e.dispose(),[e]),e}let ft=(e,t)=>{Ks.isServer?E.useEffect(e,t):E.useLayoutEffect(e,t)};function ns(e){let t=E.useRef(e);return ft(()=>{t.current=e},[e]),t}let xe=function(e){let t=ns(e);return E.useCallback((...n)=>t.current(...n),[t])};function ooe(e){let t=e.width/2,n=e.height/2;return{top:e.clientY-n,right:e.clientX+t,bottom:e.clientY+n,left:e.clientX-t}}function ioe(e,t){return!(!e||!t||e.right<t.left||e.left>t.right||e.bottom<t.top||e.top>t.bottom)}function soe({disabled:e=!1}={}){let t=E.useRef(null),[n,r]=E.useState(!1),o=dc(),i=xe(()=>{t.current=null,r(!1),o.dispose()}),s=xe(a=>{if(o.dispose(),t.current===null){t.current=a.currentTarget,r(!0);{let l=$d(a.currentTarget);o.addEventListener(l,"pointerup",i,!1),o.addEventListener(l,"pointermove",c=>{if(t.current){let u=ooe(c);r(ioe(u,t.current.getBoundingClientRect()))}},!1),o.addEventListener(l,"pointercancel",i,!1)}}});return{pressed:n,pressProps:e?{}:{onPointerDown:s,onPointerUp:i,onClick:i}}}let aoe=E.createContext(void 0);function P1(){return E.useContext(aoe)}function wy(...e){return Array.from(new Set(e.flatMap(t=>typeof t=="string"?t.split(" "):[]))).filter(Boolean).join(" ")}function Hr(e,t,...n){if(e in t){let o=t[e];return typeof o=="function"?o(...n):o}let r=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(o=>`"${o}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,Hr),r}var Pp=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(Pp||{}),Ii=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(Ii||{});function yr(){let e=coe();return E.useCallback(t=>loe({mergeRefs:e,...t}),[e])}function loe({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:o,visible:i=!0,name:s,mergeRefs:a}){a=a??uoe;let l=PN(t,e);if(i)return Xf(l,n,r,s,a);let c=o??0;if(c&2){let{static:u=!1,...d}=l;if(u)return Xf(d,n,r,s,a)}if(c&1){let{unmount:u=!0,...d}=l;return Hr(u?0:1,{0(){return null},1(){return Xf({...d,hidden:!0,style:{display:"none"}},n,r,s,a)}})}return Xf(l,n,r,s,a)}function Xf(e,t={},n,r,o){let{as:i=n,children:s,refName:a="ref",...l}=Xb(e,["unmount","static"]),c=e.ref!==void 0?{[a]:e.ref}:{},u=typeof s=="function"?s(t):s;"className"in l&&l.className&&typeof l.className=="function"&&(l.className=l.className(t)),l["aria-labelledby"]&&l["aria-labelledby"]===l.id&&(l["aria-labelledby"]=void 0);let d={};if(t){let h=!1,f=[];for(let[p,g]of Object.entries(t))typeof g=="boolean"&&(h=!0),g===!0&&f.push(p.replace(/([A-Z])/g,b=>`-${b.toLowerCase()}`));if(h){d["data-headlessui-state"]=f.join(" ");for(let p of f)d[`data-${p}`]=""}}if(i===E.Fragment&&(Object.keys(yi(l)).length>0||Object.keys(yi(d)).length>0))if(!E.isValidElement(u)||Array.isArray(u)&&u.length>1){if(Object.keys(yi(l)).length>0)throw new Error(['Passing props on "Fragment"!',"",`The current component <${r} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(yi(l)).concat(Object.keys(yi(d))).map(h=>` - ${h}`).join(`
313
- `),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(h=>` - ${h}`).join(`
314
- `)].join(`
315
- `))}else{let h=u.props,f=h==null?void 0:h.className,p=typeof f=="function"?(...v)=>wy(f(...v),l.className):wy(f,l.className),g=p?{className:p}:{},b=PN(u.props,yi(Xb(l,["ref"])));for(let v in d)v in b&&delete d[v];return E.cloneElement(u,Object.assign({},b,d,c,{ref:o(doe(u),c.ref)},g))}return E.createElement(i,Object.assign({},Xb(l,["ref"]),i!==E.Fragment&&c,i!==E.Fragment&&d),u)}function coe(){let e=E.useRef([]),t=E.useCallback(n=>{for(let r of e.current)r!=null&&(typeof r=="function"?r(n):r.current=n)},[]);return(...n)=>{if(!n.every(r=>r==null))return e.current=n,t}}function uoe(...e){return e.every(t=>t==null)?void 0:t=>{for(let n of e)n!=null&&(typeof n=="function"?n(t):n.current=t)}}function PN(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let o in r)o.startsWith("on")&&typeof r[o]=="function"?(n[o]!=null||(n[o]=[]),n[o].push(r[o])):t[o]=r[o];if(t.disabled||t["aria-disabled"])for(let r in n)/^(on(?:Click|Pointer|Mouse|Key)(?:Down|Up|Press)?)$/.test(r)&&(n[r]=[o=>{var i;return(i=o==null?void 0:o.preventDefault)==null?void 0:i.call(o)}]);for(let r in n)Object.assign(t,{[r](o,...i){let s=n[r];for(let a of s){if((o instanceof Event||(o==null?void 0:o.nativeEvent)instanceof Event)&&o.defaultPrevented)return;a(o,...i)}}});return t}function M1(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let o in r)o.startsWith("on")&&typeof r[o]=="function"?(n[o]!=null||(n[o]=[]),n[o].push(r[o])):t[o]=r[o];for(let r in n)Object.assign(t,{[r](...o){let i=n[r];for(let s of i)s==null||s(...o)}});return t}function Xn(e){var t;return Object.assign(E.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function yi(e){let t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function Xb(e,t=[]){let n=Object.assign({},e);for(let r of t)r in n&&delete n[r];return n}function doe(e){return E.version.split(".")[0]>="19"?e.props.ref:e.ref}function foe(e,t,n){let[r,o]=E.useState(n),i=e!==void 0,s=E.useRef(i),a=E.useRef(!1),l=E.useRef(!1);return i&&!s.current&&!a.current?(a.current=!0,s.current=i,console.error("A component is changing from uncontrolled to controlled. This may be caused by the value changing from undefined to a defined value, which should not happen.")):!i&&s.current&&!l.current&&(l.current=!0,s.current=i,console.error("A component is changing from controlled to uncontrolled. This may be caused by the value changing from a defined value to undefined, which should not happen.")),[i?e:r,xe(c=>(i||o(c),t==null?void 0:t(c)))]}function hoe(e){let[t]=E.useState(e);return t}function MN(e={},t=null,n=[]){for(let[r,o]of Object.entries(e))ON(n,kN(t,r),o);return n}function kN(e,t){return e?e+"["+t+"]":t}function ON(e,t,n){if(Array.isArray(n))for(let[r,o]of n.entries())ON(e,kN(t,r.toString()),o);else n instanceof Date?e.push([t,n.toISOString()]):typeof n=="boolean"?e.push([t,n?"1":"0"]):typeof n=="string"?e.push([t,n]):typeof n=="number"?e.push([t,`${n}`]):n==null?e.push([t,""]):MN(n,t,e)}let poe="span";var k1=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(k1||{});function goe(e,t){var n;let{features:r=1,...o}=e,i={ref:t,"aria-hidden":(r&2)===2?!0:(n=o["aria-hidden"])!=null?n:void 0,hidden:(r&4)===4?!0:void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(r&4)===4&&(r&2)!==2&&{display:"none"}}};return yr()({ourProps:i,theirProps:o,slot:{},defaultTag:poe,name:"Hidden"})}let DN=Xn(goe),moe=E.createContext(null);function boe({children:e}){let t=E.useContext(moe);if(!t)return E.createElement(E.Fragment,null,e);let{target:n}=t;return n?gn.createPortal(E.createElement(E.Fragment,null,e),n):null}function voe({data:e,form:t,disabled:n,onReset:r,overrides:o}){let[i,s]=E.useState(null),a=dc();return E.useEffect(()=>{if(r&&i)return a.addEventListener(i,"reset",r)},[i,t,r]),E.createElement(boe,null,E.createElement(yoe,{setForm:s,formId:t}),MN(e).map(([l,c])=>E.createElement(DN,{features:k1.Hidden,...yi({key:l,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:t,disabled:n,name:l,value:c,...o})})))}function yoe({setForm:e,formId:t}){return E.useEffect(()=>{if(t){let n=document.getElementById(t);n&&e(n)}},[e,t]),t?null:E.createElement(DN,{features:k1.Hidden,as:"input",type:"hidden",hidden:!0,readOnly:!0,ref:n=>{if(!n)return;let r=n.closest("form");r&&e(r)}})}let xoe=E.createContext(void 0);function TN(){return E.useContext(xoe)}function woe(e){let t=e.parentElement,n=null;for(;t&&!(t instanceof HTMLFieldSetElement);)t instanceof HTMLLegendElement&&(n=t),t=t.parentElement;let r=(t==null?void 0:t.getAttribute("disabled"))==="";return r&&Soe(n)?!1:r}function Soe(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}let IN=Symbol();function Coe(e,t=!0){return Object.assign(e,{[IN]:t})}function Yr(...e){let t=E.useRef(e);E.useEffect(()=>{t.current=e},[e]);let n=xe(r=>{for(let o of t.current)o!=null&&(typeof o=="function"?o(r):o.current=r)});return e.every(r=>r==null||(r==null?void 0:r[IN]))?void 0:n}let O1=E.createContext(null);O1.displayName="DescriptionContext";function AN(){let e=E.useContext(O1);if(e===null){let t=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,AN),t}return e}function _oe(){var e,t;return(t=(e=E.useContext(O1))==null?void 0:e.value)!=null?t:void 0}let Eoe="p";function Roe(e,t){let n=E.useId(),r=P1(),{id:o=`headlessui-description-${n}`,...i}=e,s=AN(),a=Yr(t);ft(()=>s.register(o),[o,s.register]);let l=r||!1,c=E.useMemo(()=>({...s.slot,disabled:l}),[s.slot,l]),u={ref:a,...s.props,id:o};return yr()({ourProps:u,theirProps:i,slot:c,defaultTag:Eoe,name:s.name||"Description"})}let Poe=Xn(Roe);Object.assign(Poe,{});var Rn=(e=>(e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.Delete="Delete",e.ArrowLeft="ArrowLeft",e.ArrowUp="ArrowUp",e.ArrowRight="ArrowRight",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab",e))(Rn||{});let Qg=E.createContext(null);Qg.displayName="LabelContext";function NN(){let e=E.useContext(Qg);if(e===null){let t=new Error("You used a <Label /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,NN),t}return e}function Jg(e){var t,n,r;let o=(n=(t=E.useContext(Qg))==null?void 0:t.value)!=null?n:void 0;return((r=e==null?void 0:e.length)!=null?r:0)>0?[o,...e].filter(Boolean).join(" "):o}function Moe({inherit:e=!1}={}){let t=Jg(),[n,r]=E.useState([]),o=e?[t,...n].filter(Boolean):n;return[o.length>0?o.join(" "):void 0,E.useMemo(()=>function(i){let s=xe(l=>(r(c=>[...c,l]),()=>r(c=>{let u=c.slice(),d=u.indexOf(l);return d!==-1&&u.splice(d,1),u}))),a=E.useMemo(()=>({register:s,slot:i.slot,name:i.name,props:i.props,value:i.value}),[s,i.slot,i.name,i.props,i.value]);return E.createElement(Qg.Provider,{value:a},i.children)},[r])]}let koe="label";function Ooe(e,t){var n;let r=E.useId(),o=NN(),i=TN(),s=P1(),{id:a=`headlessui-label-${r}`,htmlFor:l=i??((n=o.props)==null?void 0:n.htmlFor),passive:c=!1,...u}=e,d=Yr(t);ft(()=>o.register(a),[a,o.register]);let h=xe(b=>{let v=b.currentTarget;if(v instanceof HTMLLabelElement&&b.preventDefault(),o.props&&"onClick"in o.props&&typeof o.props.onClick=="function"&&o.props.onClick(b),v instanceof HTMLLabelElement){let x=document.getElementById(v.htmlFor);if(x){let y=x.getAttribute("disabled");if(y==="true"||y==="")return;let _=x.getAttribute("aria-disabled");if(_==="true"||_==="")return;(x instanceof HTMLInputElement&&(x.type==="radio"||x.type==="checkbox")||x.role==="radio"||x.role==="checkbox"||x.role==="switch")&&x.click(),x.focus({preventScroll:!0})}}}),f=s||!1,p=E.useMemo(()=>({...o.slot,disabled:f}),[o.slot,f]),g={ref:d,...o.props,id:a,htmlFor:l,onClick:h};return c&&("onClick"in g&&(delete g.htmlFor,delete g.onClick),"onClick"in u&&delete u.onClick),yr()({ourProps:g,theirProps:u,slot:p,defaultTag:l?koe:"div",name:o.name||"Label"})}let Doe=Xn(Ooe),Toe=Object.assign(Doe,{});function ja(e,t,n){let r=n.initialDeps??[],o;return()=>{var i,s,a,l;let c;n.key&&((i=n.debug)!=null&&i.call(n))&&(c=Date.now());const u=e();if(!(u.length!==r.length||u.some((f,p)=>r[p]!==f)))return o;r=u;let h;if(n.key&&((s=n.debug)!=null&&s.call(n))&&(h=Date.now()),o=t(...u),n.key&&((a=n.debug)!=null&&a.call(n))){const f=Math.round((Date.now()-c)*100)/100,p=Math.round((Date.now()-h)*100)/100,g=p/16,b=(v,x)=>{for(v=String(v);v.length<x;)v=" "+v;return v};console.info(`%c⏱ ${b(p,5)} /${b(f,5)} ms`,`
316
- font-size: .6rem;
317
- font-weight: bold;
318
- color: hsl(${Math.max(0,Math.min(120-120*g,120))}deg 100% 31%);`,n==null?void 0:n.key)}return(l=n==null?void 0:n.onChange)==null||l.call(n,o),o}}function Qb(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const Ioe=(e,t)=>Math.abs(e-t)<1,Aoe=(e,t,n)=>{let r;return function(...o){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,o),n)}},Noe=e=>e,joe=e=>{const t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1),r=[];for(let o=t;o<=n;o++)r.push(o);return r},Foe=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;const o=s=>{const{width:a,height:l}=s;t({width:Math.round(a),height:Math.round(l)})};if(o(n.getBoundingClientRect()),!r.ResizeObserver)return()=>{};const i=new r.ResizeObserver(s=>{const a=()=>{const l=s[0];if(l!=null&&l.borderBoxSize){const c=l.borderBoxSize[0];if(c){o({width:c.inlineSize,height:c.blockSize});return}}o(n.getBoundingClientRect())};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()});return i.observe(n,{box:"border-box"}),()=>{i.unobserve(n)}},QR={passive:!0},JR=typeof window>"u"?!0:"onscrollend"in window,Loe=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;let o=0;const i=e.options.useScrollendEvent&&JR?()=>{}:Aoe(r,()=>{t(o,!1)},e.options.isScrollingResetDelay),s=u=>()=>{const{horizontal:d,isRtl:h}=e.options;o=d?n.scrollLeft*(h&&-1||1):n.scrollTop,i(),t(o,u)},a=s(!0),l=s(!1);l(),n.addEventListener("scroll",a,QR);const c=e.options.useScrollendEvent&&JR;return c&&n.addEventListener("scrollend",l,QR),()=>{n.removeEventListener("scroll",a),c&&n.removeEventListener("scrollend",l)}},$oe=(e,t,n)=>{if(t!=null&&t.borderBoxSize){const r=t.borderBoxSize[0];if(r)return Math.round(r[n.options.horizontal?"inlineSize":"blockSize"])}return Math.round(e.getBoundingClientRect()[n.options.horizontal?"width":"height"])},zoe=(e,{adjustments:t=0,behavior:n},r)=>{var o,i;const s=e+t;(i=(o=r.scrollElement)==null?void 0:o.scrollTo)==null||i.call(o,{[r.options.horizontal?"left":"top"]:s,behavior:n})};class Boe{constructor(t){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollToIndexTimeoutId=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let n=null;const r=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(o=>{o.forEach(i=>{const s=()=>{this._measureElement(i.target,i)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(s):s()})}));return{disconnect:()=>{var o;(o=r())==null||o.disconnect(),n=null},observe:o=>{var i;return(i=r())==null?void 0:i.observe(o,{box:"border-box"})},unobserve:o=>{var i;return(i=r())==null?void 0:i.unobserve(o)}}})(),this.range=null,this.setOptions=n=>{Object.entries(n).forEach(([r,o])=>{typeof o>"u"&&delete n[r]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Noe,rangeExtractor:joe,onChange:()=>{},measureElement:$oe,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!0,useAnimationFrameWithResizeObserver:!1,...n}},this.notify=n=>{var r,o;(o=(r=this.options).onChange)==null||o.call(r,this,n)},this.maybeNotify=ja(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:process.env.NODE_ENV!=="production"&&"maybeNotify",debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.maybeNotify();return}this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void 0:n.window)??null,this.elementsCache.forEach(o=>{this.observer.observe(o)}),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,o=>{this.scrollRect=o,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(o,i)=>{this.scrollAdjustments=0,this.scrollDirection=i?this.getScrollOffset()<o?"forward":"backward":null,this.scrollOffset=o,this.isScrolling=i,this.maybeNotify()}))}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(n,r)=>{const o=new Map,i=new Map;for(let s=r-1;s>=0;s--){const a=n[s];if(o.has(a.lane))continue;const l=i.get(a.lane);if(l==null||a.end>l.end?i.set(a.lane,a):a.end<l.end&&o.set(a.lane,!0),o.size===this.options.lanes)break}return i.size===this.options.lanes?Array.from(i.values()).sort((s,a)=>s.end===a.end?s.index-a.index:s.end-a.end)[0]:void 0},this.getMeasurementOptions=ja(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled],(n,r,o,i,s)=>(this.pendingMeasuredCacheIndexes=[],{count:n,paddingStart:r,scrollMargin:o,getItemKey:i,enabled:s}),{key:!1}),this.getMeasurements=ja(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:n,paddingStart:r,scrollMargin:o,getItemKey:i,enabled:s},a)=>{if(!s)return this.measurementsCache=[],this.itemSizeCache.clear(),[];this.measurementsCache.length===0&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(u=>{this.itemSizeCache.set(u.key,u.size)}));const l=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const c=this.measurementsCache.slice(0,l);for(let u=l;u<n;u++){const d=i(u),h=this.options.lanes===1?c[u-1]:this.getFurthestMeasurement(c,u),f=h?h.end+this.options.gap:r+o,p=a.get(d),g=typeof p=="number"?p:this.options.estimateSize(u),b=f+g,v=h?h.lane:u%this.options.lanes;c[u]={index:u,start:f,size:g,end:b,key:d,lane:v}}return this.measurementsCache=c,c},{key:process.env.NODE_ENV!=="production"&&"getMeasurements",debug:()=>this.options.debug}),this.calculateRange=ja(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,r,o,i)=>this.range=n.length>0&&r>0?Voe({measurements:n,outerSize:r,scrollOffset:o,lanes:i}):null,{key:process.env.NODE_ENV!=="production"&&"calculateRange",debug:()=>this.options.debug}),this.getVirtualIndexes=ja(()=>{let n=null,r=null;const o=this.calculateRange();return o&&(n=o.startIndex,r=o.endIndex),[this.options.rangeExtractor,this.options.overscan,this.options.count,n,r]},(n,r,o,i,s)=>i===null||s===null?[]:n({startIndex:i,endIndex:s,overscan:r,count:o}),{key:process.env.NODE_ENV!=="production"&&"getVirtualIndexes",debug:()=>this.options.debug}),this.indexFromElement=n=>{const r=this.options.indexAttribute,o=n.getAttribute(r);return o?parseInt(o,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this._measureElement=(n,r)=>{const o=this.indexFromElement(n),i=this.measurementsCache[o];if(!i)return;const s=i.key,a=this.elementsCache.get(s);a!==n&&(a&&this.observer.unobserve(a),this.observer.observe(n),this.elementsCache.set(s,n)),n.isConnected&&this.resizeItem(o,this.options.measureElement(n,r,this))},this.resizeItem=(n,r)=>{const o=this.measurementsCache[n];if(!o)return;const i=this.itemSizeCache.get(o.key)??o.size,s=r-i;s!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(o,s,this):o.start<this.getScrollOffset()+this.scrollAdjustments)&&(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("correction",s),this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=s,behavior:void 0})),this.pendingMeasuredCacheIndexes.push(o.index),this.itemSizeCache=new Map(this.itemSizeCache.set(o.key,r)),this.notify(!1))},this.measureElement=n=>{if(!n){this.elementsCache.forEach((r,o)=>{r.isConnected||(this.observer.unobserve(r),this.elementsCache.delete(o))});return}this._measureElement(n,void 0)},this.getVirtualItems=ja(()=>[this.getVirtualIndexes(),this.getMeasurements()],(n,r)=>{const o=[];for(let i=0,s=n.length;i<s;i++){const a=n[i],l=r[a];o.push(l)}return o},{key:process.env.NODE_ENV!=="production"&&"getVirtualItems",debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const r=this.getMeasurements();if(r.length!==0)return Qb(r[jN(0,r.length-1,o=>Qb(r[o]).start,n)])},this.getOffsetForAlignment=(n,r,o=0)=>{const i=this.getSize(),s=this.getScrollOffset();r==="auto"&&(r=n>=s+i?"end":"start"),r==="center"?n+=(o-i)/2:r==="end"&&(n-=i);const a=this.options.horizontal?"scrollWidth":"scrollHeight",c=(this.scrollElement?"document"in this.scrollElement?this.scrollElement.document.documentElement[a]:this.scrollElement[a]:0)-i;return Math.max(Math.min(c,n),0)},this.getOffsetForIndex=(n,r="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const o=this.measurementsCache[n];if(!o)return;const i=this.getSize(),s=this.getScrollOffset();if(r==="auto")if(o.end>=s+i-this.options.scrollPaddingEnd)r="end";else if(o.start<=s+this.options.scrollPaddingStart)r="start";else return[s,r];const a=r==="end"?o.end+this.options.scrollPaddingEnd:o.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,r,o.size),r]},this.isDynamicMode=()=>this.elementsCache.size>0,this.cancelScrollToIndex=()=>{this.scrollToIndexTimeoutId!==null&&this.targetWindow&&(this.targetWindow.clearTimeout(this.scrollToIndexTimeoutId),this.scrollToIndexTimeoutId=null)},this.scrollToOffset=(n,{align:r="start",behavior:o}={})=>{this.cancelScrollToIndex(),o==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(n,r),{adjustments:void 0,behavior:o})},this.scrollToIndex=(n,{align:r="auto",behavior:o}={})=>{n=Math.max(0,Math.min(n,this.options.count-1)),this.cancelScrollToIndex(),o==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size.");const i=this.getOffsetForIndex(n,r);if(!i)return;const[s,a]=i;this._scrollToOffset(s,{adjustments:void 0,behavior:o}),o!=="smooth"&&this.isDynamicMode()&&this.targetWindow&&(this.scrollToIndexTimeoutId=this.targetWindow.setTimeout(()=>{if(this.scrollToIndexTimeoutId=null,this.elementsCache.has(this.options.getItemKey(n))){const[c]=Qb(this.getOffsetForIndex(n,a));Ioe(c,this.getScrollOffset())||this.scrollToIndex(n,{align:a,behavior:o})}else this.scrollToIndex(n,{align:a,behavior:o})}))},this.scrollBy=(n,{behavior:r}={})=>{this.cancelScrollToIndex(),r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+n,{adjustments:void 0,behavior:r})},this.getTotalSize=()=>{var n;const r=this.getMeasurements();let o;return r.length===0?o=this.options.paddingStart:o=this.options.lanes===1?((n=r[r.length-1])==null?void 0:n.end)??0:Math.max(...r.slice(-this.options.lanes).map(i=>i.end)),Math.max(o-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(n,{adjustments:r,behavior:o})=>{this.options.scrollToFn(n,{behavior:o,adjustments:r},this)},this.measure=()=>{this.itemSizeCache=new Map,this.notify(!1)},this.setOptions(t)}}const jN=(e,t,n,r)=>{for(;e<=t;){const o=(e+t)/2|0,i=n(o);if(i<r)e=o+1;else if(i>r)t=o-1;else return o}return e>0?e-1:0};function Voe({measurements:e,outerSize:t,scrollOffset:n,lanes:r}){const o=e.length-1;let s=jN(0,o,l=>e[l].start,n),a=s;for(;a<o&&e[a].end<n+t;)a++;return r>1&&(s=Math.max(0,s-s%r),a=Math.min(o,a+(r-1-a%r))),{startIndex:s,endIndex:a}}const ZR=typeof document<"u"?S.useLayoutEffect:S.useEffect;function Hoe(e){const t=S.useReducer(()=>({}),{})[1],n={...e,onChange:(o,i)=>{var s;i?gn.flushSync(t):t(),(s=e.onChange)==null||s.call(e,o,i)}},[r]=S.useState(()=>new Boe(n));return r.setOptions(n),ZR(()=>r._didMount(),[]),ZR(()=>r._willUpdate()),r}function Woe(e){return Hoe({observeElementRect:Foe,observeElementOffset:Loe,scrollToFn:zoe,...e})}function Uoe(e,t){return e!==null&&t!==null&&typeof e=="object"&&typeof t=="object"&&"id"in e&&"id"in t?e.id===t.id:e===t}function qoe(e=Uoe){return E.useCallback((t,n)=>{if(typeof e=="string"){let r=e;return(t==null?void 0:t[r])===(n==null?void 0:n[r])}return e(t,n)},[e])}function Goe(e){if(e===null)return{width:0,height:0};let{width:t,height:n}=e.getBoundingClientRect();return{width:t,height:n}}function eP(e,t=!1){let[n,r]=E.useReducer(()=>({}),{}),o=E.useMemo(()=>Goe(e),[e,n]);return ft(()=>{if(!e)return;let i=new ResizeObserver(r);return i.observe(e),()=>{i.disconnect()}},[e]),t?{width:`${o.width}px`,height:`${o.height}px`}:o}let Yoe=class extends Map{constructor(t){super(),this.factory=t}get(t){let n=super.get(t);return n===void 0&&(n=this.factory(t),this.set(t,n)),n}};function FN(e,t){let n=e(),r=new Set;return{getSnapshot(){return n},subscribe(o){return r.add(o),()=>r.delete(o)},dispatch(o,...i){let s=t[o].call(n,...i);s&&(n=s,r.forEach(a=>a()))}}}function LN(e){return E.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot)}let Koe=new Yoe(()=>FN(()=>[],{ADD(e){return this.includes(e)?this:[...this,e]},REMOVE(e){let t=this.indexOf(e);if(t===-1)return this;let n=this.slice();return n.splice(t,1),n}}));function D1(e,t){let n=Koe.get(t),r=E.useId(),o=LN(n);if(ft(()=>{if(e)return n.dispatch("ADD",r),()=>n.dispatch("REMOVE",r)},[n,e]),!e)return!1;let i=o.indexOf(r),s=o.length;return i===-1&&(i=s,s+=1),i===s-1}let Sy=new Map,vu=new Map;function tP(e){var t;let n=(t=vu.get(e))!=null?t:0;return vu.set(e,n+1),n!==0?()=>nP(e):(Sy.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),e.setAttribute("aria-hidden","true"),e.inert=!0,()=>nP(e))}function nP(e){var t;let n=(t=vu.get(e))!=null?t:1;if(n===1?vu.delete(e):vu.set(e,n-1),n!==1)return;let r=Sy.get(e);r&&(r["aria-hidden"]===null?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",r["aria-hidden"]),e.inert=r.inert,Sy.delete(e))}function Xoe(e,{allowed:t,disallowed:n}={}){let r=D1(e,"inert-others");ft(()=>{var o,i;if(!r)return;let s=Eo();for(let l of(o=n==null?void 0:n())!=null?o:[])l&&s.add(tP(l));let a=(i=t==null?void 0:t())!=null?i:[];for(let l of a){if(!l)continue;let c=$d(l);if(!c)continue;let u=l.parentElement;for(;u&&u!==c.body;){for(let d of u.children)a.some(h=>d.contains(h))||s.add(tP(d));u=u.parentElement}}return s.dispose},[r,t,n])}function Qoe(e,t,n){let r=ns(o=>{let i=o.getBoundingClientRect();i.x===0&&i.y===0&&i.width===0&&i.height===0&&n()});E.useEffect(()=>{if(!e)return;let o=t===null?null:t instanceof HTMLElement?t:t.current;if(!o)return;let i=Eo();if(typeof ResizeObserver<"u"){let s=new ResizeObserver(()=>r.current(o));s.observe(o),i.add(()=>s.disconnect())}if(typeof IntersectionObserver<"u"){let s=new IntersectionObserver(()=>r.current(o));s.observe(o),i.add(()=>s.disconnect())}return()=>i.dispose()},[t,r,e])}let Cy=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var Joe=(e=>(e[e.First=1]="First",e[e.Previous=2]="Previous",e[e.Next=4]="Next",e[e.Last=8]="Last",e[e.WrapAround=16]="WrapAround",e[e.NoScroll=32]="NoScroll",e[e.AutoFocus=64]="AutoFocus",e))(Joe||{}),Zoe=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(Zoe||{}),eie=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(eie||{}),$N=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))($N||{});function tie(e,t=0){var n;return e===((n=$d(e))==null?void 0:n.body)?!1:Hr(t,{0(){return e.matches(Cy)},1(){let r=e;for(;r!==null;){if(r.matches(Cy))return!0;r=r.parentElement}return!1}})}var nie=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(nie||{});typeof window<"u"&&typeof document<"u"&&(document.addEventListener("keydown",e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",e=>{e.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:e.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));function rie(e,t=n=>n){return e.slice().sort((n,r)=>{let o=t(n),i=t(r);if(o===null||i===null)return 0;let s=o.compareDocumentPosition(i);return s&Node.DOCUMENT_POSITION_FOLLOWING?-1:s&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function zN(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function oie(){return/Android/gi.test(window.navigator.userAgent)}function BN(){return zN()||oie()}function Ic(e,t,n,r){let o=ns(n);E.useEffect(()=>{if(!e)return;function i(s){o.current(s)}return document.addEventListener(t,i,r),()=>document.removeEventListener(t,i,r)},[e,t,r])}function iie(e,t,n,r){let o=ns(n);E.useEffect(()=>{if(!e)return;function i(s){o.current(s)}return window.addEventListener(t,i,r),()=>window.removeEventListener(t,i,r)},[e,t,r])}const rP=30;function sie(e,t,n){let r=D1(e,"outside-click"),o=ns(n),i=E.useCallback(function(l,c){if(l.defaultPrevented)return;let u=c(l);if(u===null||!u.getRootNode().contains(u)||!u.isConnected)return;let d=function h(f){return typeof f=="function"?h(f()):Array.isArray(f)||f instanceof Set?f:[f]}(t);for(let h of d)if(h!==null&&(h.contains(u)||l.composed&&l.composedPath().includes(h)))return;return!tie(u,$N.Loose)&&u.tabIndex!==-1&&l.preventDefault(),o.current(l,u)},[o,t]),s=E.useRef(null);Ic(r,"pointerdown",l=>{var c,u;s.current=((u=(c=l.composedPath)==null?void 0:c.call(l))==null?void 0:u[0])||l.target},!0),Ic(r,"mousedown",l=>{var c,u;s.current=((u=(c=l.composedPath)==null?void 0:c.call(l))==null?void 0:u[0])||l.target},!0),Ic(r,"click",l=>{BN()||s.current&&(i(l,()=>s.current),s.current=null)},!0);let a=E.useRef({x:0,y:0});Ic(r,"touchstart",l=>{a.current.x=l.touches[0].clientX,a.current.y=l.touches[0].clientY},!0),Ic(r,"touchend",l=>{let c={x:l.changedTouches[0].clientX,y:l.changedTouches[0].clientY};if(!(Math.abs(c.x-a.current.x)>=rP||Math.abs(c.y-a.current.y)>=rP))return i(l,()=>l.target instanceof HTMLElement?l.target:null)},!0),iie(r,"blur",l=>i(l,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function Zg(...e){return E.useMemo(()=>$d(...e),[...e])}function aie(e,t,n,r){let o=ns(n);E.useEffect(()=>{e=e??window;function i(s){o.current(s)}return e.addEventListener(t,i,r),()=>e.removeEventListener(t,i,r)},[e,t,r])}function VN(e){let t=E.useRef({value:"",selectionStart:null,selectionEnd:null});return aie(e,"blur",n=>{let r=n.target;r instanceof HTMLInputElement&&(t.current={value:r.value,selectionStart:r.selectionStart,selectionEnd:r.selectionEnd})}),xe(()=>{if(document.activeElement!==e&&e instanceof HTMLInputElement&&e.isConnected){if(e.focus({preventScroll:!0}),e.value!==t.current.value)e.setSelectionRange(e.value.length,e.value.length);else{let{selectionStart:n,selectionEnd:r}=t.current;n!==null&&r!==null&&e.setSelectionRange(n,r)}t.current={value:"",selectionStart:null,selectionEnd:null}}})}function lie(e,t){return E.useMemo(()=>{var n;if(e.type)return e.type;let r=(n=e.as)!=null?n:"button";if(typeof r=="string"&&r.toLowerCase()==="button"||(t==null?void 0:t.tagName)==="BUTTON"&&!t.hasAttribute("type"))return"button"},[e.type,e.as,t])}function cie(){let e;return{before({doc:t}){var n;let r=t.documentElement,o=(n=t.defaultView)!=null?n:window;e=Math.max(0,o.innerWidth-r.clientWidth)},after({doc:t,d:n}){let r=t.documentElement,o=Math.max(0,r.clientWidth-r.offsetWidth),i=Math.max(0,e-o);n.style(r,"paddingRight",`${i}px`)}}}function uie(){return zN()?{before({doc:e,d:t,meta:n}){function r(o){return n.containers.flatMap(i=>i()).some(i=>i.contains(o))}t.microTask(()=>{var o;if(window.getComputedStyle(e.documentElement).scrollBehavior!=="auto"){let a=Eo();a.style(e.documentElement,"scrollBehavior","auto"),t.add(()=>t.microTask(()=>a.dispose()))}let i=(o=window.scrollY)!=null?o:window.pageYOffset,s=null;t.addEventListener(e,"click",a=>{if(a.target instanceof HTMLElement)try{let l=a.target.closest("a");if(!l)return;let{hash:c}=new URL(l.href),u=e.querySelector(c);u&&!r(u)&&(s=u)}catch{}},!0),t.addEventListener(e,"touchstart",a=>{if(a.target instanceof HTMLElement)if(r(a.target)){let l=a.target;for(;l.parentElement&&r(l.parentElement);)l=l.parentElement;t.style(l,"overscrollBehavior","contain")}else t.style(a.target,"touchAction","none")}),t.addEventListener(e,"touchmove",a=>{if(a.target instanceof HTMLElement){if(a.target.tagName==="INPUT")return;if(r(a.target)){let l=a.target;for(;l.parentElement&&l.dataset.headlessuiPortal!==""&&!(l.scrollHeight>l.clientHeight||l.scrollWidth>l.clientWidth);)l=l.parentElement;l.dataset.headlessuiPortal===""&&a.preventDefault()}else a.preventDefault()}},{passive:!1}),t.add(()=>{var a;let l=(a=window.scrollY)!=null?a:window.pageYOffset;i!==l&&window.scrollTo(0,i),s&&s.isConnected&&(s.scrollIntoView({block:"nearest"}),s=null)})})}}:{}}function die(){return{before({doc:e,d:t}){t.style(e.documentElement,"overflow","hidden")}}}function fie(e){let t={};for(let n of e)Object.assign(t,n(t));return t}let ks=FN(()=>new Map,{PUSH(e,t){var n;let r=(n=this.get(e))!=null?n:{doc:e,count:0,d:Eo(),meta:new Set};return r.count++,r.meta.add(t),this.set(e,r),this},POP(e,t){let n=this.get(e);return n&&(n.count--,n.meta.delete(t)),this},SCROLL_PREVENT({doc:e,d:t,meta:n}){let r={doc:e,d:t,meta:fie(n)},o=[uie(),cie(),die()];o.forEach(({before:i})=>i==null?void 0:i(r)),o.forEach(({after:i})=>i==null?void 0:i(r))},SCROLL_ALLOW({d:e}){e.dispose()},TEARDOWN({doc:e}){this.delete(e)}});ks.subscribe(()=>{let e=ks.getSnapshot(),t=new Map;for(let[n]of e)t.set(n,n.documentElement.style.overflow);for(let n of e.values()){let r=t.get(n.doc)==="hidden",o=n.count!==0;(o&&!r||!o&&r)&&ks.dispatch(n.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",n),n.count===0&&ks.dispatch("TEARDOWN",n)}});function hie(e,t,n=()=>({containers:[]})){let r=LN(ks),o=t?r.get(t):void 0,i=o?o.count>0:!1;return ft(()=>{if(!(!t||!e))return ks.dispatch("PUSH",t,n),()=>ks.dispatch("POP",t,n)},[e,t]),i}function pie(e,t,n=()=>[document.body]){let r=D1(e,"scroll-lock");hie(r,t,o=>{var i;return{containers:[...(i=o.containers)!=null?i:[],n]}})}function oP(e){return[e.screenX,e.screenY]}function gie(){let e=E.useRef([-1,-1]);return{wasMoved(t){let n=oP(t);return e.current[0]===n[0]&&e.current[1]===n[1]?!1:(e.current=n,!0)},update(t){e.current=oP(t)}}}function mie(e=0){let[t,n]=E.useState(e),r=E.useCallback(l=>n(l),[t]),o=E.useCallback(l=>n(c=>c|l),[t]),i=E.useCallback(l=>(t&l)===l,[t]),s=E.useCallback(l=>n(c=>c&~l),[n]),a=E.useCallback(l=>n(c=>c^l),[n]);return{flags:t,setFlag:r,addFlag:o,hasFlag:i,removeFlag:s,toggleFlag:a}}var iP,sP;typeof process<"u"&&typeof globalThis<"u"&&typeof Element<"u"&&((iP=process==null?void 0:process.env)==null?void 0:iP.NODE_ENV)==="test"&&typeof((sP=Element==null?void 0:Element.prototype)==null?void 0:sP.getAnimations)>"u"&&(Element.prototype.getAnimations=function(){return console.warn(["Headless UI has polyfilled `Element.prototype.getAnimations` for your tests.","Please install a proper polyfill e.g. `jsdom-testing-mocks`, to silence these warnings.","","Example usage:","```js","import { mockAnimationsApi } from 'jsdom-testing-mocks'","mockAnimationsApi()","```"].join(`
319
- `)),[]});var bie=(e=>(e[e.None=0]="None",e[e.Closed=1]="Closed",e[e.Enter=2]="Enter",e[e.Leave=4]="Leave",e))(bie||{});function HN(e){let t={};for(let n in e)e[n]===!0&&(t[`data-${n}`]="");return t}function WN(e,t,n,r){let[o,i]=E.useState(n),{hasFlag:s,addFlag:a,removeFlag:l}=mie(e&&o?3:0),c=E.useRef(!1),u=E.useRef(!1),d=dc();return ft(()=>{var h;if(e){if(n&&i(!0),!t){n&&a(3);return}return(h=r==null?void 0:r.start)==null||h.call(r,n),vie(t,{inFlight:c,prepare(){u.current?u.current=!1:u.current=c.current,c.current=!0,!u.current&&(n?(a(3),l(4)):(a(4),l(2)))},run(){u.current?n?(l(3),a(4)):(l(4),a(3)):n?l(1):a(1)},done(){var f;u.current&&typeof t.getAnimations=="function"&&t.getAnimations().length>0||(c.current=!1,l(7),n||i(!1),(f=r==null?void 0:r.end)==null||f.call(r,n))}})}},[e,n,t,d]),e?[o,{closed:s(1),enter:s(2),leave:s(4),transition:s(2)||s(4)}]:[n,{closed:void 0,enter:void 0,leave:void 0,transition:void 0}]}function vie(e,{prepare:t,run:n,done:r,inFlight:o}){let i=Eo();return xie(e,{prepare:t,inFlight:o}),i.nextFrame(()=>{n(),i.requestAnimationFrame(()=>{i.add(yie(e,r))})}),i.dispose}function yie(e,t){var n,r;let o=Eo();if(!e)return o.dispose;let i=!1;o.add(()=>{i=!0});let s=(r=(n=e.getAnimations)==null?void 0:n.call(e).filter(a=>a instanceof CSSTransition))!=null?r:[];return s.length===0?(t(),o.dispose):(Promise.allSettled(s.map(a=>a.finished)).then(()=>{i||t()}),o.dispose)}function xie(e,{inFlight:t,prepare:n}){if(t!=null&&t.current){n();return}let r=e.style.transition;e.style.transition="none",n(),e.offsetHeight,e.style.transition=r}function wie(e,{container:t,accept:n,walk:r}){let o=E.useRef(n),i=E.useRef(r);E.useEffect(()=>{o.current=n,i.current=r},[n,r]),ft(()=>{if(!t||!e)return;let s=$d(t);if(!s)return;let a=o.current,l=i.current,c=Object.assign(d=>a(d),{acceptNode:a}),u=s.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,c,!1);for(;u.nextNode();)l(u.currentNode)},[t,e,o,i])}function aP(e,t){let n=E.useRef([]),r=xe(e);E.useEffect(()=>{let o=[...n.current];for(let[i,s]of t.entries())if(n.current[i]!==s){let a=r(t,o);return n.current=t,a}},[r,...t])}function Sie(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:r}=t;return n+"/"+r}).join(" "):navigator.userAgent}const UN={...S},Cie=UN.useInsertionEffect,_ie=Cie||(e=>e());function qN(e){const t=S.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return _ie(()=>{t.current=e}),S.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}var _y=typeof document<"u"?E.useLayoutEffect:E.useEffect;let lP=!1,Eie=0;const cP=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+Eie++;function Rie(){const[e,t]=S.useState(()=>lP?cP():void 0);return _y(()=>{e==null&&t(cP())},[]),S.useEffect(()=>{lP=!0},[]),e}const Pie=UN.useId,Mie=Pie||Rie;let Uu;process.env.NODE_ENV!=="production"&&(Uu=new Set);function kie(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");if(!((e=Uu)!=null&&e.has(o))){var i;(i=Uu)==null||i.add(o),console.warn(o)}}function Oie(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");if(!((e=Uu)!=null&&e.has(o))){var i;(i=Uu)==null||i.add(o),console.error(o)}}function Die(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(o=>o(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,((r=e.get(t))==null?void 0:r.filter(o=>o!==n))||[])}}}const Tie=S.createContext(null),Iie=S.createContext(null),Aie=()=>{var e;return((e=S.useContext(Tie))==null?void 0:e.id)||null},Nie=()=>S.useContext(Iie),jie="data-floating-ui-focusable";function Fie(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=Mie(),i=S.useRef({}),[s]=S.useState(()=>Die()),a=Aie()!=null;if(process.env.NODE_ENV!=="production"){const f=r.reference;f&&!vn(f)&&Oie("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[l,c]=S.useState(r.reference),u=qN((f,p,g)=>{i.current.openEvent=f?p:void 0,s.emit("openchange",{open:f,event:p,reason:g,nested:a}),n==null||n(f,p,g)}),d=S.useMemo(()=>({setPositionReference:c}),[]),h=S.useMemo(()=>({reference:l||r.reference||null,floating:r.floating||null,domReference:r.reference}),[l,r.reference,r.floating]);return S.useMemo(()=>({dataRef:i,open:t,onOpenChange:u,elements:h,events:s,floatingId:o,refs:d}),[t,u,h,s,o,d])}function Lie(e){e===void 0&&(e={});const{nodeId:t}=e,n=Fie({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[i,s]=S.useState(null),[a,l]=S.useState(null),u=(o==null?void 0:o.domReference)||i,d=S.useRef(null),h=Nie();_y(()=>{u&&(d.current=u)},[u]);const f=CT({...e,elements:{...o,...a&&{reference:a}}}),p=S.useCallback(y=>{const _=vn(y)?{getBoundingClientRect:()=>y.getBoundingClientRect(),contextElement:y}:y;l(_),f.refs.setReference(_)},[f.refs]),g=S.useCallback(y=>{(vn(y)||y===null)&&(d.current=y,s(y)),(vn(f.refs.reference.current)||f.refs.reference.current===null||y!==null&&!vn(y))&&f.refs.setReference(y)},[f.refs]),b=S.useMemo(()=>({...f.refs,setReference:g,setPositionReference:p,domReference:d}),[f.refs,g,p]),v=S.useMemo(()=>({...f.elements,domReference:u}),[f.elements,u]),x=S.useMemo(()=>({...f,...r,refs:b,elements:v,nodeId:t}),[f,b,v,t,r]);return _y(()=>{r.dataRef.current.floatingContext=x;const y=h==null?void 0:h.nodesRef.current.find(_=>_.id===t);y&&(y.context=x)}),S.useMemo(()=>({...f,context:x,refs:b,elements:v}),[f,b,v,x])}const uP="active",dP="selected";function Jb(e,t,n){const r=new Map,o=n==="item";let i=e;if(o&&e){const{[uP]:s,[dP]:a,...l}=e;i=l}return{...n==="floating"&&{tabIndex:-1,[jie]:""},...i,...t.map(s=>{const a=s?s[n]:null;return typeof a=="function"?e?a(e):null:a}).concat(e).reduce((s,a)=>(a&&Object.entries(a).forEach(l=>{let[c,u]=l;if(!(o&&[uP,dP].includes(c)))if(c.indexOf("on")===0){if(r.has(c)||r.set(c,[]),typeof u=="function"){var d;(d=r.get(c))==null||d.push(u),s[c]=function(){for(var h,f=arguments.length,p=new Array(f),g=0;g<f;g++)p[g]=arguments[g];return(h=r.get(c))==null?void 0:h.map(b=>b(...p)).find(b=>b!==void 0)}}}else s[c]=u}),s),{})}}function $ie(e){e===void 0&&(e=[]);const t=e.map(a=>a==null?void 0:a.reference),n=e.map(a=>a==null?void 0:a.floating),r=e.map(a=>a==null?void 0:a.item),o=S.useCallback(a=>Jb(a,e,"reference"),t),i=S.useCallback(a=>Jb(a,e,"floating"),n),s=S.useCallback(a=>Jb(a,e,"item"),r);return S.useMemo(()=>({getReferenceProps:o,getFloatingProps:i,getItemProps:s}),[o,i,s])}function fP(e,t){return{...e,rects:{...e.rects,floating:{...e.rects.floating,height:t}}}}const zie=e=>({name:"inner",options:e,async fn(t){const{listRef:n,overflowRef:r,onFallbackChange:o,offset:i=0,index:s=0,minItemsVisible:a=4,referenceOverflowThreshold:l=0,scrollRef:c,...u}=So(e,t),{rects:d,elements:{floating:h}}=t,f=n.current[s],p=(c==null?void 0:c.current)||h,g=h.clientTop||p.clientTop,b=h.clientTop!==0,v=p.clientTop!==0,x=h===p;if(process.env.NODE_ENV!=="production"&&(t.placement.startsWith("bottom")||kie('`placement` side must be "bottom" when using the `inner`',"middleware.")),!f)return{};const y={...t,...await Vw(-f.offsetTop-h.clientTop-d.reference.height/2-f.offsetHeight/2-i).fn(t)},_=await Cb(fP(y,p.scrollHeight+g+h.clientTop),u),w=await Cb(y,{...u,elementContext:"reference"}),C=pn(0,_.top),R=y.y+C,I=(p.scrollHeight>p.clientHeight?T=>T:Bu)(pn(0,p.scrollHeight+(b&&x||v?g*2:0)-C-pn(0,_.bottom)));if(p.style.maxHeight=I+"px",p.scrollTop=C,o){const T=p.offsetHeight<f.offsetHeight*si(a,n.current.length)-1||w.top>=-l||w.bottom>=-l;Js.flushSync(()=>o(T))}return r&&(r.current=await Cb(fP({...y,y:R},p.offsetHeight+g+h.clientTop),u)),{y:R}}});function Bie(e,t){const{open:n,elements:r}=e,{enabled:o=!0,overflowRef:i,scrollRef:s,onChange:a}=t,l=qN(a),c=S.useRef(!1),u=S.useRef(null),d=S.useRef(null);S.useEffect(()=>{if(!o)return;function f(g){if(g.ctrlKey||!p||i.current==null)return;const b=g.deltaY,v=i.current.top>=-.5,x=i.current.bottom>=-.5,y=p.scrollHeight-p.clientHeight,_=b<0?-1:1,w=b<0?"max":"min";p.scrollHeight<=p.clientHeight||(!v&&b>0||!x&&b<0?(g.preventDefault(),Js.flushSync(()=>{l(C=>C+Math[w](b,y*_))})):/firefox/i.test(Sie())&&(p.scrollTop+=b))}const p=(s==null?void 0:s.current)||r.floating;if(n&&p)return p.addEventListener("wheel",f),requestAnimationFrame(()=>{u.current=p.scrollTop,i.current!=null&&(d.current={...i.current})}),()=>{u.current=null,d.current=null,p.removeEventListener("wheel",f)}},[o,n,r.floating,i,s,l]);const h=S.useMemo(()=>({onKeyDown(){c.current=!0},onWheel(){c.current=!1},onPointerMove(){c.current=!1},onScroll(){const f=(s==null?void 0:s.current)||r.floating;if(!(!i.current||!f||!c.current)){if(u.current!==null){const p=f.scrollTop-u.current;(i.current.bottom<-.5&&p<-1||i.current.top<-.5&&p>1)&&Js.flushSync(()=>l(g=>g+p))}requestAnimationFrame(()=>{u.current=f.scrollTop})}}}),[r.floating,l,i,s]);return S.useMemo(()=>o?{floating:h}:{},[o,h])}let zd=E.createContext({styles:void 0,setReference:()=>{},setFloating:()=>{},getReferenceProps:()=>({}),getFloatingProps:()=>({}),slot:{}});zd.displayName="FloatingContext";let T1=E.createContext(null);T1.displayName="PlacementContext";function Vie(e){return E.useMemo(()=>e?typeof e=="string"?{to:e}:e:null,[e])}function Hie(){return E.useContext(zd).setReference}function Wie(){let{getFloatingProps:e,slot:t}=E.useContext(zd);return E.useCallback((...n)=>Object.assign({},e(...n),{"data-anchor":t.anchor}),[e,t])}function Uie(e=null){e===!1&&(e=null),typeof e=="string"&&(e={to:e});let t=E.useContext(T1),n=E.useMemo(()=>e,[JSON.stringify(e,(o,i)=>{var s;return(s=i==null?void 0:i.outerHTML)!=null?s:i})]);ft(()=>{t==null||t(n??null)},[t,n]);let r=E.useContext(zd);return E.useMemo(()=>[r.setFloating,e?r.styles:{}],[r.setFloating,e,r.styles])}let hP=4;function qie({children:e,enabled:t=!0}){let[n,r]=E.useState(null),[o,i]=E.useState(0),s=E.useRef(null),[a,l]=E.useState(null);Gie(a);let c=t&&n!==null&&a!==null,{to:u="bottom",gap:d=0,offset:h=0,padding:f=0,inner:p}=Yie(n,a),[g,b="center"]=u.split(" ");ft(()=>{c&&i(0)},[c]);let{refs:v,floatingStyles:x,context:y}=Lie({open:c,placement:g==="selection"?b==="center"?"bottom":`bottom-${b}`:b==="center"?`${g}`:`${g}-${b}`,strategy:"absolute",transform:!1,middleware:[Vw({mainAxis:g==="selection"?0:d,crossAxis:h}),_T({padding:f}),g!=="selection"&&ET({padding:f}),g==="selection"&&p?zie({...p,padding:f,overflowRef:s,offset:o,minItemsVisible:hP,referenceOverflowThreshold:f,onFallbackChange(T){var N,G;if(!T)return;let z=y.elements.floating;if(!z)return;let O=parseFloat(getComputedStyle(z).scrollPaddingBottom)||0,A=Math.min(hP,z.childElementCount),L=0,j=0;for(let B of(G=(N=y.elements.floating)==null?void 0:N.childNodes)!=null?G:[])if(B instanceof HTMLElement){let M=B.offsetTop,W=M+B.clientHeight+O,F=z.scrollTop,P=F+z.clientHeight;if(M>=F&&W<=P)A--;else{j=Math.max(0,Math.min(W,P)-Math.max(M,F)),L=B.clientHeight;break}}A>=1&&i(B=>{let M=L*A-j+O;return B>=M?B:M})}}):null,RT({padding:f,apply({availableWidth:T,availableHeight:N,elements:G}){Object.assign(G.floating.style,{overflow:"auto",maxWidth:`${T}px`,maxHeight:`min(var(--anchor-max-height, 100vh), ${N}px)`})}})].filter(Boolean),whileElementsMounted:wT}),[_=g,w=b]=y.placement.split("-");g==="selection"&&(_="selection");let C=E.useMemo(()=>({anchor:[_,w].filter(Boolean).join(" ")}),[_,w]),R=Bie(y,{overflowRef:s,onChange:i}),{getReferenceProps:k,getFloatingProps:D}=$ie([R]),I=xe(T=>{l(T),v.setFloating(T)});return S.createElement(T1.Provider,{value:r},S.createElement(zd.Provider,{value:{setFloating:I,setReference:v.setReference,styles:x,getReferenceProps:k,getFloatingProps:D,slot:C}},e))}function Gie(e){ft(()=>{if(!e)return;let t=new MutationObserver(()=>{let n=window.getComputedStyle(e).maxHeight,r=parseFloat(n);if(isNaN(r))return;let o=parseInt(n);isNaN(o)||r!==o&&(e.style.maxHeight=`${Math.ceil(r)}px`)});return t.observe(e,{attributes:!0,attributeFilter:["style"]}),()=>{t.disconnect()}},[e])}function Yie(e,t){var n,r,o;let i=Zb((n=e==null?void 0:e.gap)!=null?n:"var(--anchor-gap, 0)",t),s=Zb((r=e==null?void 0:e.offset)!=null?r:"var(--anchor-offset, 0)",t),a=Zb((o=e==null?void 0:e.padding)!=null?o:"var(--anchor-padding, 0)",t);return{...e,gap:i,offset:s,padding:a}}function Zb(e,t,n=void 0){let r=dc(),o=xe((l,c)=>{if(l==null)return[n,null];if(typeof l=="number")return[l,null];if(typeof l=="string"){if(!c)return[n,null];let u=pP(l,c);return[u,d=>{let h=GN(l);{let f=h.map(p=>window.getComputedStyle(c).getPropertyValue(p));r.requestAnimationFrame(function p(){r.nextFrame(p);let g=!1;for(let[v,x]of h.entries()){let y=window.getComputedStyle(c).getPropertyValue(x);if(f[v]!==y){f[v]=y,g=!0;break}}if(!g)return;let b=pP(l,c);u!==b&&(d(b),u=b)})}return r.dispose}]}return[n,null]}),i=E.useMemo(()=>o(e,t)[0],[e,t]),[s=i,a]=E.useState();return ft(()=>{let[l,c]=o(e,t);if(a(l),!!c)return c(a)},[e,t]),s}function GN(e){let t=/var\((.*)\)/.exec(e);if(t){let n=t[1].indexOf(",");if(n===-1)return[t[1]];let r=t[1].slice(0,n).trim(),o=t[1].slice(n+1).trim();return o?[r,...GN(o)]:[r]}return[]}function pP(e,t){let n=document.createElement("div");t.appendChild(n),n.style.setProperty("margin-top","0px","important"),n.style.setProperty("margin-top",e,"important");let r=parseFloat(window.getComputedStyle(n).marginTop)||0;return t.removeChild(n),r}function Kie({children:e,freeze:t}){let n=Ey(t,e);return E.createElement(E.Fragment,null,n)}function Ey(e,t){let[n,r]=E.useState(t);return!e&&n!==t&&r(t),e?n:t}let I1=E.createContext(null);I1.displayName="OpenClosedContext";var Br=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(Br||{});function A1(){return E.useContext(I1)}function YN({value:e,children:t}){return E.createElement(I1.Provider,{value:e},t)}function Xie(e){function t(){document.readyState!=="loading"&&(e(),document.removeEventListener("DOMContentLoaded",t))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",t),t())}let ws=[];Xie(()=>{function e(t){if(!(t.target instanceof HTMLElement)||t.target===document.body||ws[0]===t.target)return;let n=t.target;n=n.closest(Cy),ws.unshift(n??t.target),ws=ws.filter(r=>r!=null&&r.isConnected),ws.splice(10)}window.addEventListener("click",e,{capture:!0}),window.addEventListener("mousedown",e,{capture:!0}),window.addEventListener("focus",e,{capture:!0}),document.body.addEventListener("click",e,{capture:!0}),document.body.addEventListener("mousedown",e,{capture:!0}),document.body.addEventListener("focus",e,{capture:!0})});function Qie(e){throw new Error("Unexpected object: "+e)}var Ht=(e=>(e[e.First=0]="First",e[e.Previous=1]="Previous",e[e.Next=2]="Next",e[e.Last=3]="Last",e[e.Specific=4]="Specific",e[e.Nothing=5]="Nothing",e))(Ht||{});function gP(e,t){let n=t.resolveItems();if(n.length<=0)return null;let r=t.resolveActiveIndex(),o=r??-1;switch(e.focus){case 0:{for(let i=0;i<n.length;++i)if(!t.resolveDisabled(n[i],i,n))return i;return r}case 1:{o===-1&&(o=n.length);for(let i=o-1;i>=0;--i)if(!t.resolveDisabled(n[i],i,n))return i;return r}case 2:{for(let i=o+1;i<n.length;++i)if(!t.resolveDisabled(n[i],i,n))return i;return r}case 3:{for(let i=n.length-1;i>=0;--i)if(!t.resolveDisabled(n[i],i,n))return i;return r}case 4:{for(let i=0;i<n.length;++i)if(t.resolveId(n[i],i,n)===e.id)return i;return r}case 5:return null;default:Qie(e)}}var N1=(e=>(e[e.Left=0]="Left",e[e.Right=2]="Right",e))(N1||{});function Jie(e){let t=xe(e),n=E.useRef(!1);E.useEffect(()=>(n.current=!1,()=>{n.current=!0,RN(()=>{n.current&&t()})}),[t])}function Zie(){let e=typeof document>"u";return"useSyncExternalStore"in S?(t=>t.useSyncExternalStore)(S)(()=>()=>{},()=>!1,()=>!e):!1}function j1(){let e=Zie(),[t,n]=S.useState(Ks.isHandoffComplete);return t&&Ks.isHandoffComplete===!1&&n(!1),S.useEffect(()=>{t!==!0&&n(!0)},[t]),S.useEffect(()=>Ks.handoff(),[]),e?!1:t}let ese=E.createContext(!1);function tse(){return E.useContext(ese)}function nse(e){let t=tse(),n=E.useContext(XN),r=Zg(e),[o,i]=E.useState(()=>{var s;if(!t&&n!==null)return(s=n.current)!=null?s:null;if(Ks.isServer)return null;let a=r==null?void 0:r.getElementById("headlessui-portal-root");if(a)return a;if(r===null)return null;let l=r.createElement("div");return l.setAttribute("id","headlessui-portal-root"),r.body.appendChild(l)});return E.useEffect(()=>{o!==null&&(r!=null&&r.body.contains(o)||r==null||r.body.appendChild(o))},[o,r]),E.useEffect(()=>{t||n!==null&&i(n.current)},[n,i,t]),o}let KN=E.Fragment,rse=Xn(function(e,t){let n=e,r=E.useRef(null),o=Yr(Coe(d=>{r.current=d}),t),i=Zg(r),s=nse(r),[a]=E.useState(()=>{var d;return Ks.isServer?null:(d=i==null?void 0:i.createElement("div"))!=null?d:null}),l=E.useContext(ase),c=j1();ft(()=>{!s||!a||s.contains(a)||(a.setAttribute("data-headlessui-portal",""),s.appendChild(a))},[s,a]),ft(()=>{if(a&&l)return l.register(a)},[l,a]),Jie(()=>{var d;!s||!a||(a instanceof Node&&s.contains(a)&&s.removeChild(a),s.childNodes.length<=0&&((d=s.parentElement)==null||d.removeChild(s)))});let u=yr();return c?!s||!a?null:gn.createPortal(u({ourProps:{ref:o},theirProps:n,slot:{},defaultTag:KN,name:"Portal"}),a):null});function ose(e,t){let n=Yr(t),{enabled:r=!0,...o}=e,i=yr();return r?E.createElement(rse,{...o,ref:n}):i({ourProps:{ref:n},theirProps:o,slot:{},defaultTag:KN,name:"Portal"})}let ise=E.Fragment,XN=E.createContext(null);function sse(e,t){let{target:n,...r}=e,o={ref:Yr(t)},i=yr();return E.createElement(XN.Provider,{value:n},i({ourProps:o,theirProps:r,defaultTag:ise,name:"Popover.Group"}))}let ase=E.createContext(null),lse=Xn(ose),cse=Xn(sse),use=Object.assign(lse,{Group:cse});var dse=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(dse||{}),fse=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(fse||{}),hse=(e=>(e[e.Pointer=0]="Pointer",e[e.Focus=1]="Focus",e[e.Other=2]="Other",e))(hse||{}),pse=(e=>(e[e.OpenCombobox=0]="OpenCombobox",e[e.CloseCombobox=1]="CloseCombobox",e[e.GoToOption=2]="GoToOption",e[e.SetTyping=3]="SetTyping",e[e.RegisterOption=4]="RegisterOption",e[e.UnregisterOption=5]="UnregisterOption",e[e.SetActivationTrigger=6]="SetActivationTrigger",e[e.UpdateVirtualConfiguration=7]="UpdateVirtualConfiguration",e[e.SetInputElement=8]="SetInputElement",e[e.SetButtonElement=9]="SetButtonElement",e[e.SetOptionsElement=10]="SetOptionsElement",e))(pse||{});function e0(e,t=n=>n){let n=e.activeOptionIndex!==null?e.options[e.activeOptionIndex]:null,r=t(e.options.slice()),o=r.length>0&&r[0].dataRef.current.order!==null?r.sort((s,a)=>s.dataRef.current.order-a.dataRef.current.order):rie(r,s=>s.dataRef.current.domRef.current),i=n?o.indexOf(n):null;return i===-1&&(i=null),{options:o,activeOptionIndex:i}}let gse={1(e){var t;return(t=e.dataRef.current)!=null&&t.disabled||e.comboboxState===1?e:{...e,activeOptionIndex:null,comboboxState:1,isTyping:!1,activationTrigger:2,__demoMode:!1}},0(e){var t,n;if((t=e.dataRef.current)!=null&&t.disabled||e.comboboxState===0)return e;if((n=e.dataRef.current)!=null&&n.value){let r=e.dataRef.current.calculateIndex(e.dataRef.current.value);if(r!==-1)return{...e,activeOptionIndex:r,comboboxState:0,__demoMode:!1}}return{...e,comboboxState:0,__demoMode:!1}},3(e,t){return e.isTyping===t.isTyping?e:{...e,isTyping:t.isTyping}},2(e,t){var n,r,o,i;if((n=e.dataRef.current)!=null&&n.disabled||e.optionsElement&&!((r=e.dataRef.current)!=null&&r.optionsPropsRef.current.static)&&e.comboboxState===1)return e;if(e.virtual){let{options:c,disabled:u}=e.virtual,d=t.focus===Ht.Specific?t.idx:gP(t,{resolveItems:()=>c,resolveActiveIndex:()=>{var f,p;return(p=(f=e.activeOptionIndex)!=null?f:c.findIndex(g=>!u(g)))!=null?p:null},resolveDisabled:u,resolveId(){throw new Error("Function not implemented.")}}),h=(o=t.trigger)!=null?o:2;return e.activeOptionIndex===d&&e.activationTrigger===h?e:{...e,activeOptionIndex:d,activationTrigger:h,isTyping:!1,__demoMode:!1}}let s=e0(e);if(s.activeOptionIndex===null){let c=s.options.findIndex(u=>!u.dataRef.current.disabled);c!==-1&&(s.activeOptionIndex=c)}let a=t.focus===Ht.Specific?t.idx:gP(t,{resolveItems:()=>s.options,resolveActiveIndex:()=>s.activeOptionIndex,resolveId:c=>c.id,resolveDisabled:c=>c.dataRef.current.disabled}),l=(i=t.trigger)!=null?i:2;return e.activeOptionIndex===a&&e.activationTrigger===l?e:{...e,...s,isTyping:!1,activeOptionIndex:a,activationTrigger:l,__demoMode:!1}},4:(e,t)=>{var n,r,o;if((n=e.dataRef.current)!=null&&n.virtual)return{...e,options:[...e.options,t.payload]};let i=t.payload,s=e0(e,l=>(l.push(i),l));e.activeOptionIndex===null&&(r=e.dataRef.current)!=null&&r.isSelected(t.payload.dataRef.current.value)&&(s.activeOptionIndex=s.options.indexOf(i));let a={...e,...s,activationTrigger:2};return(o=e.dataRef.current)!=null&&o.__demoMode&&e.dataRef.current.value===void 0&&(a.activeOptionIndex=0),a},5:(e,t)=>{var n;if((n=e.dataRef.current)!=null&&n.virtual)return{...e,options:e.options.filter(o=>o.id!==t.id)};let r=e0(e,o=>{let i=o.findIndex(s=>s.id===t.id);return i!==-1&&o.splice(i,1),o});return{...e,...r,activationTrigger:2}},6:(e,t)=>e.activationTrigger===t.trigger?e:{...e,activationTrigger:t.trigger},7:(e,t)=>{var n,r;if(e.virtual===null)return{...e,virtual:{options:t.options,disabled:(n=t.disabled)!=null?n:()=>!1}};if(e.virtual.options===t.options&&e.virtual.disabled===t.disabled)return e;let o=e.activeOptionIndex;if(e.activeOptionIndex!==null){let i=t.options.indexOf(e.virtual.options[e.activeOptionIndex]);i!==-1?o=i:o=null}return{...e,activeOptionIndex:o,virtual:{options:t.options,disabled:(r=t.disabled)!=null?r:()=>!1}}},8:(e,t)=>e.inputElement===t.element?e:{...e,inputElement:t.element},9:(e,t)=>e.buttonElement===t.element?e:{...e,buttonElement:t.element},10:(e,t)=>e.optionsElement===t.element?e:{...e,optionsElement:t.element}},F1=E.createContext(null);F1.displayName="ComboboxActionsContext";function Bd(e){let t=E.useContext(F1);if(t===null){let n=new Error(`<${e} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Bd),n}return t}let QN=E.createContext(null);function mse(e){let t=fc("VirtualProvider"),{options:n}=t.virtual,[r,o]=E.useMemo(()=>{let c=t.optionsElement;if(!c)return[0,0];let u=window.getComputedStyle(c);return[parseFloat(u.paddingBlockStart||u.paddingTop),parseFloat(u.paddingBlockEnd||u.paddingBottom)]},[t.optionsElement]),i=Woe({enabled:n.length!==0,scrollPaddingStart:r,scrollPaddingEnd:o,count:n.length,estimateSize(){return 40},getScrollElement(){return t.optionsElement},overscan:12}),[s,a]=E.useState(0);ft(()=>{a(c=>c+1)},[n]);let l=i.getVirtualItems();return l.length===0?null:E.createElement(QN.Provider,{value:i},E.createElement("div",{style:{position:"relative",width:"100%",height:`${i.getTotalSize()}px`},ref:c=>{c&&t.activationTrigger!==0&&t.activeOptionIndex!==null&&n.length>t.activeOptionIndex&&i.scrollToIndex(t.activeOptionIndex)}},l.map(c=>{var u;return E.createElement(E.Fragment,{key:c.key},E.cloneElement((u=e.children)==null?void 0:u.call(e,{...e.slot,option:n[c.index]}),{key:`${s}-${c.key}`,"data-index":c.index,"aria-setsize":n.length,"aria-posinset":c.index+1,style:{position:"absolute",top:0,left:0,transform:`translateY(${c.start}px)`,overflowAnchor:"none"}}))})))}let qu=E.createContext(null);qu.displayName="ComboboxDataContext";function fc(e){let t=E.useContext(qu);if(t===null){let n=new Error(`<${e} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,fc),n}return t}function bse(e,t){return Hr(t.type,gse,e,t)}let vse=E.Fragment;function yse(e,t){var n,r;let o=P1(),{value:i,defaultValue:s,onChange:a,form:l,name:c,by:u,disabled:d=o||!1,onClose:h,__demoMode:f=!1,multiple:p=!1,immediate:g=!1,virtual:b=null,nullable:v,...x}=e,y=hoe(s),[_=p?[]:void 0,w]=foe(i,a,y),[C,R]=E.useReducer(bse,{dataRef:E.createRef(),comboboxState:f?0:1,isTyping:!1,options:[],virtual:b?{options:b.options,disabled:(n=b.disabled)!=null?n:()=>!1}:null,activeOptionIndex:null,activationTrigger:2,inputElement:null,buttonElement:null,optionsElement:null,__demoMode:f}),k=E.useRef(!1),D=E.useRef({static:!1,hold:!1}),I=qoe(u),T=xe(ee=>b?u===null?b.options.indexOf(ee):b.options.findIndex(ue=>I(ue,ee)):C.options.findIndex(ue=>I(ue.dataRef.current.value,ee))),N=E.useCallback(ee=>Hr(z.mode,{1:()=>_.some(ue=>I(ue,ee)),0:()=>I(_,ee)}),[_]),G=xe(ee=>C.activeOptionIndex===T(ee)),z=E.useMemo(()=>({...C,immediate:g,optionsPropsRef:D,value:_,defaultValue:y,disabled:d,mode:p?1:0,virtual:b?C.virtual:null,get activeOptionIndex(){if(k.current&&C.activeOptionIndex===null&&(b?b.options.length>0:C.options.length>0)){if(b){let ue=b.options.findIndex(de=>{var ye,he;return!((he=(ye=b.disabled)==null?void 0:ye.call(b,de))!=null&&he)});if(ue!==-1)return ue}let ee=C.options.findIndex(ue=>!ue.dataRef.current.disabled);if(ee!==-1)return ee}return C.activeOptionIndex},calculateIndex:T,compare:I,isSelected:N,isActive:G}),[_,y,d,p,f,C,b]);ft(()=>{var ee;b&&R({type:7,options:b.options,disabled:(ee=b.disabled)!=null?ee:null})},[b,b==null?void 0:b.options,b==null?void 0:b.disabled]),ft(()=>{C.dataRef.current=z},[z]);let O=z.comboboxState===0;sie(O,[z.buttonElement,z.inputElement,z.optionsElement],()=>V.closeCombobox());let A=E.useMemo(()=>{var ee,ue,de;return{open:z.comboboxState===0,disabled:d,activeIndex:z.activeOptionIndex,activeOption:z.activeOptionIndex===null?null:z.virtual?z.virtual.options[(ee=z.activeOptionIndex)!=null?ee:0]:(de=(ue=z.options[z.activeOptionIndex])==null?void 0:ue.dataRef.current.value)!=null?de:null,value:_}},[z,d,_]),L=xe(()=>{if(z.activeOptionIndex!==null){if(V.setIsTyping(!1),z.virtual)P(z.virtual.options[z.activeOptionIndex]);else{let{dataRef:ee}=z.options[z.activeOptionIndex];P(ee.current.value)}V.goToOption(Ht.Specific,z.activeOptionIndex)}}),j=xe(()=>{R({type:0}),k.current=!0}),B=xe(()=>{R({type:1}),k.current=!1,h==null||h()}),M=xe(ee=>{R({type:3,isTyping:ee})}),W=xe((ee,ue,de)=>(k.current=!1,ee===Ht.Specific?R({type:2,focus:Ht.Specific,idx:ue,trigger:de}):R({type:2,focus:ee,trigger:de}))),F=xe((ee,ue)=>(R({type:4,payload:{id:ee,dataRef:ue}}),()=>{z.isActive(ue.current.value)&&(k.current=!0),R({type:5,id:ee})})),P=xe(ee=>Hr(z.mode,{0(){return w==null?void 0:w(ee)},1(){let ue=z.value.slice(),de=ue.findIndex(ye=>I(ye,ee));return de===-1?ue.push(ee):ue.splice(de,1),w==null?void 0:w(ue)}})),U=xe(ee=>{R({type:6,trigger:ee})}),q=xe(ee=>{R({type:8,element:ee})}),K=xe(ee=>{R({type:9,element:ee})}),H=xe(ee=>{R({type:10,element:ee})}),V=E.useMemo(()=>({onChange:P,registerOption:F,goToOption:W,setIsTyping:M,closeCombobox:B,openCombobox:j,setActivationTrigger:U,selectActiveOption:L,setInputElement:q,setButtonElement:K,setOptionsElement:H}),[]),[Q,Z]=Moe(),ne=t===null?{}:{ref:t},J=E.useCallback(()=>{if(y!==void 0)return w==null?void 0:w(y)},[w,y]),oe=yr();return E.createElement(Z,{value:Q,props:{htmlFor:(r=z.inputElement)==null?void 0:r.id},slot:{open:z.comboboxState===0,disabled:d}},E.createElement(qie,null,E.createElement(F1.Provider,{value:V},E.createElement(qu.Provider,{value:z},E.createElement(YN,{value:Hr(z.comboboxState,{0:Br.Open,1:Br.Closed})},c!=null&&E.createElement(voe,{disabled:d,data:_!=null?{[c]:_}:{},form:l,onReset:J}),oe({ourProps:ne,theirProps:x,slot:A,defaultTag:vse,name:"Combobox"}))))))}let xse="input";function wse(e,t){var n,r,o,i,s;let a=fc("Combobox.Input"),l=Bd("Combobox.Input"),c=E.useId(),u=TN(),{id:d=u||`headlessui-combobox-input-${c}`,onChange:h,displayValue:f,disabled:p=a.disabled||!1,autoFocus:g=!1,type:b="text",...v}=e,x=E.useRef(null),y=Yr(x,t,Hie(),l.setInputElement),_=Zg(a.inputElement),w=dc(),C=xe(()=>{l.onChange(null),a.optionsElement&&(a.optionsElement.scrollTop=0),l.goToOption(Ht.Nothing)}),R=E.useMemo(()=>{var P;return typeof f=="function"&&a.value!==void 0?(P=f(a.value))!=null?P:"":typeof a.value=="string"?a.value:""},[a.value,f]);aP(([P,U],[q,K])=>{if(a.isTyping)return;let H=x.current;H&&((K===0&&U===1||P!==q)&&(H.value=P),requestAnimationFrame(()=>{if(a.isTyping||!H||(_==null?void 0:_.activeElement)!==H)return;let{selectionStart:V,selectionEnd:Q}=H;Math.abs((Q??0)-(V??0))===0&&V===0&&H.setSelectionRange(H.value.length,H.value.length)}))},[R,a.comboboxState,_,a.isTyping]),aP(([P],[U])=>{if(P===0&&U===1){if(a.isTyping)return;let q=x.current;if(!q)return;let K=q.value,{selectionStart:H,selectionEnd:V,selectionDirection:Q}=q;q.value="",q.value=K,Q!==null?q.setSelectionRange(H,V,Q):q.setSelectionRange(H,V)}},[a.comboboxState]);let k=E.useRef(!1),D=xe(()=>{k.current=!0}),I=xe(()=>{w.nextFrame(()=>{k.current=!1})}),T=xe(P=>{switch(l.setIsTyping(!0),P.key){case Rn.Enter:if(a.comboboxState!==0||k.current)return;if(P.preventDefault(),P.stopPropagation(),a.activeOptionIndex===null){l.closeCombobox();return}l.selectActiveOption(),a.mode===0&&l.closeCombobox();break;case Rn.ArrowDown:return P.preventDefault(),P.stopPropagation(),Hr(a.comboboxState,{0:()=>l.goToOption(Ht.Next),1:()=>l.openCombobox()});case Rn.ArrowUp:return P.preventDefault(),P.stopPropagation(),Hr(a.comboboxState,{0:()=>l.goToOption(Ht.Previous),1:()=>{gn.flushSync(()=>l.openCombobox()),a.value||l.goToOption(Ht.Last)}});case Rn.Home:if(P.shiftKey)break;return P.preventDefault(),P.stopPropagation(),l.goToOption(Ht.First);case Rn.PageUp:return P.preventDefault(),P.stopPropagation(),l.goToOption(Ht.First);case Rn.End:if(P.shiftKey)break;return P.preventDefault(),P.stopPropagation(),l.goToOption(Ht.Last);case Rn.PageDown:return P.preventDefault(),P.stopPropagation(),l.goToOption(Ht.Last);case Rn.Escape:return a.comboboxState!==0?void 0:(P.preventDefault(),a.optionsElement&&!a.optionsPropsRef.current.static&&P.stopPropagation(),a.mode===0&&a.value===null&&C(),l.closeCombobox());case Rn.Tab:if(a.comboboxState!==0)return;a.mode===0&&a.activationTrigger!==1&&l.selectActiveOption(),l.closeCombobox();break}}),N=xe(P=>{h==null||h(P),a.mode===0&&P.target.value===""&&C(),l.openCombobox()}),G=xe(P=>{var U,q,K;let H=(U=P.relatedTarget)!=null?U:ws.find(V=>V!==P.currentTarget);if(!((q=a.optionsElement)!=null&&q.contains(H))&&!((K=a.buttonElement)!=null&&K.contains(H))&&a.comboboxState===0)return P.preventDefault(),a.mode===0&&a.value===null&&C(),l.closeCombobox()}),z=xe(P=>{var U,q,K;let H=(U=P.relatedTarget)!=null?U:ws.find(V=>V!==P.currentTarget);(q=a.buttonElement)!=null&&q.contains(H)||(K=a.optionsElement)!=null&&K.contains(H)||a.disabled||a.immediate&&a.comboboxState!==0&&w.microTask(()=>{gn.flushSync(()=>l.openCombobox()),l.setActivationTrigger(1)})}),O=Jg(),A=_oe(),{isFocused:L,focusProps:j}=EN({autoFocus:g}),{isHovered:B,hoverProps:M}=_N({isDisabled:p}),W=E.useMemo(()=>({open:a.comboboxState===0,disabled:p,hover:B,focus:L,autofocus:g}),[a,B,L,g,p]),F=M1({ref:y,id:d,role:"combobox",type:b,"aria-controls":(n=a.optionsElement)==null?void 0:n.id,"aria-expanded":a.comboboxState===0,"aria-activedescendant":a.activeOptionIndex===null?void 0:a.virtual?(r=a.options.find(P=>!P.dataRef.current.disabled&&a.compare(P.dataRef.current.value,a.virtual.options[a.activeOptionIndex])))==null?void 0:r.id:(o=a.options[a.activeOptionIndex])==null?void 0:o.id,"aria-labelledby":O,"aria-describedby":A,"aria-autocomplete":"list",defaultValue:(s=(i=e.defaultValue)!=null?i:a.defaultValue!==void 0?f==null?void 0:f(a.defaultValue):null)!=null?s:a.defaultValue,disabled:p||void 0,autoFocus:g,onCompositionStart:D,onCompositionEnd:I,onKeyDown:T,onChange:N,onFocus:z,onBlur:G},j,M);return yr()({ourProps:F,theirProps:v,slot:W,defaultTag:xse,name:"Combobox.Input"})}let Sse="button";function Cse(e,t){var n;let r=fc("Combobox.Button"),o=Bd("Combobox.Button"),i=Yr(t,o.setButtonElement),s=E.useId(),{id:a=`headlessui-combobox-button-${s}`,disabled:l=r.disabled||!1,autoFocus:c=!1,...u}=e,d=VN(r.inputElement),h=xe(R=>{switch(R.key){case Rn.Space:case Rn.Enter:R.preventDefault(),R.stopPropagation(),r.comboboxState===1&&gn.flushSync(()=>o.openCombobox()),d();return;case Rn.ArrowDown:R.preventDefault(),R.stopPropagation(),r.comboboxState===1&&(gn.flushSync(()=>o.openCombobox()),r.value||o.goToOption(Ht.First)),d();return;case Rn.ArrowUp:R.preventDefault(),R.stopPropagation(),r.comboboxState===1&&(gn.flushSync(()=>o.openCombobox()),r.value||o.goToOption(Ht.Last)),d();return;case Rn.Escape:if(r.comboboxState!==0)return;R.preventDefault(),r.optionsElement&&!r.optionsPropsRef.current.static&&R.stopPropagation(),gn.flushSync(()=>o.closeCombobox()),d();return;default:return}}),f=xe(R=>{R.preventDefault(),!woe(R.currentTarget)&&(R.button===N1.Left&&(r.comboboxState===0?o.closeCombobox():o.openCombobox()),d())}),p=Jg([a]),{isFocusVisible:g,focusProps:b}=EN({autoFocus:c}),{isHovered:v,hoverProps:x}=_N({isDisabled:l}),{pressed:y,pressProps:_}=soe({disabled:l}),w=E.useMemo(()=>({open:r.comboboxState===0,active:y||r.comboboxState===0,disabled:l,value:r.value,hover:v,focus:g}),[r,v,g,y,l]),C=M1({ref:i,id:a,type:lie(e,r.buttonElement),tabIndex:-1,"aria-haspopup":"listbox","aria-controls":(n=r.optionsElement)==null?void 0:n.id,"aria-expanded":r.comboboxState===0,"aria-labelledby":p,disabled:l||void 0,autoFocus:c,onMouseDown:f,onKeyDown:h},b,x,_);return yr()({ourProps:C,theirProps:u,slot:w,defaultTag:Sse,name:"Combobox.Button"})}let _se="div",Ese=Pp.RenderStrategy|Pp.Static;function Rse(e,t){var n,r,o;let i=E.useId(),{id:s=`headlessui-combobox-options-${i}`,hold:a=!1,anchor:l,portal:c=!1,modal:u=!0,transition:d=!1,...h}=e,f=fc("Combobox.Options"),p=Bd("Combobox.Options"),g=Vie(l);g&&(c=!0);let[b,v]=Uie(g),[x,y]=E.useState(null),_=Wie(),w=Yr(t,g?b:null,p.setOptionsElement,y),C=Zg(f.optionsElement),R=A1(),[k,D]=WN(d,x,R!==null?(R&Br.Open)===Br.Open:f.comboboxState===0);Qoe(k,f.inputElement,p.closeCombobox);let I=f.__demoMode?!1:u&&f.comboboxState===0;pie(I,C);let T=f.__demoMode?!1:u&&f.comboboxState===0;Xoe(T,{allowed:E.useCallback(()=>[f.inputElement,f.buttonElement,f.optionsElement],[f.inputElement,f.buttonElement,f.optionsElement])}),ft(()=>{var F;f.optionsPropsRef.current.static=(F=e.static)!=null?F:!1},[f.optionsPropsRef,e.static]),ft(()=>{f.optionsPropsRef.current.hold=a},[f.optionsPropsRef,a]),wie(f.comboboxState===0,{container:f.optionsElement,accept(F){return F.getAttribute("role")==="option"?NodeFilter.FILTER_REJECT:F.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(F){F.setAttribute("role","none")}});let N=Jg([(n=f.buttonElement)==null?void 0:n.id]),G=E.useMemo(()=>({open:f.comboboxState===0,option:void 0}),[f.comboboxState]),z=xe(()=>{p.setActivationTrigger(0)}),O=xe(F=>{F.preventDefault(),p.setActivationTrigger(0)}),A=M1(g?_():{},{"aria-labelledby":N,role:"listbox","aria-multiselectable":f.mode===1?!0:void 0,id:s,ref:w,style:{...h.style,...v,"--input-width":eP(f.inputElement,!0).width,"--button-width":eP(f.buttonElement,!0).width},onWheel:f.activationTrigger===0?void 0:z,onMouseDown:O,...HN(D)}),L=k&&f.comboboxState===1,j=Ey(L,(r=f.virtual)==null?void 0:r.options),B=Ey(L,f.value),M=xe(F=>f.compare(B,F));if(f.virtual){if(j===void 0)throw new Error("Missing `options` in virtual mode");Object.assign(h,{children:E.createElement(qu.Provider,{value:j!==f.virtual.options?{...f,virtual:{...f.virtual,options:j}}:f},E.createElement(mse,{slot:G},h.children))})}let W=yr();return E.createElement(use,{enabled:c?e.static||k:!1},E.createElement(qu.Provider,{value:f.mode===1?f:{...f,isSelected:M}},W({ourProps:A,theirProps:{...h,children:E.createElement(Kie,{freeze:L},typeof h.children=="function"?(o=h.children)==null?void 0:o.call(h,G):h.children)},slot:G,defaultTag:_se,features:Ese,visible:k,name:"Combobox.Options"})))}let Pse="div";function Mse(e,t){var n,r,o,i;let s=fc("Combobox.Option"),a=Bd("Combobox.Option"),l=E.useId(),{id:c=`headlessui-combobox-option-${l}`,value:u,disabled:d=(o=(r=(n=s.virtual)==null?void 0:n.disabled)==null?void 0:r.call(n,u))!=null?o:!1,order:h=null,...f}=e,p=VN(s.inputElement),g=s.virtual?s.activeOptionIndex===s.calculateIndex(u):s.activeOptionIndex===null?!1:((i=s.options[s.activeOptionIndex])==null?void 0:i.id)===c,b=s.isSelected(u),v=E.useRef(null),x=ns({disabled:d,value:u,domRef:v,order:h}),y=E.useContext(QN),_=Yr(t,v,y?y.measureElement:null),w=xe(()=>{a.setIsTyping(!1),a.onChange(u)});ft(()=>a.registerOption(c,x),[x,c]);let C=E.useRef(!(s.virtual||s.__demoMode));ft(()=>{if(!s.virtual&&!s.__demoMode)return Eo().requestAnimationFrame(()=>{C.current=!0})},[s.virtual,s.__demoMode]),ft(()=>{if(C.current&&s.comboboxState===0&&g&&s.activationTrigger!==0)return Eo().requestAnimationFrame(()=>{var O,A;(A=(O=v.current)==null?void 0:O.scrollIntoView)==null||A.call(O,{block:"nearest"})})},[v,g,s.comboboxState,s.activationTrigger,s.activeOptionIndex]);let R=xe(O=>{O.preventDefault(),O.button===N1.Left&&(d||(w(),BN()||requestAnimationFrame(()=>p()),s.mode===0&&a.closeCombobox()))}),k=xe(()=>{if(d)return a.goToOption(Ht.Nothing);let O=s.calculateIndex(u);a.goToOption(Ht.Specific,O)}),D=gie(),I=xe(O=>D.update(O)),T=xe(O=>{if(!D.wasMoved(O)||d||g)return;let A=s.calculateIndex(u);a.goToOption(Ht.Specific,A,0)}),N=xe(O=>{D.wasMoved(O)&&(d||g&&(s.optionsPropsRef.current.hold||a.goToOption(Ht.Nothing)))}),G=E.useMemo(()=>({active:g,focus:g,selected:b,disabled:d}),[g,b,d]),z={id:c,ref:_,role:"option",tabIndex:d===!0?void 0:-1,"aria-disabled":d===!0?!0:void 0,"aria-selected":b,disabled:void 0,onMouseDown:R,onFocus:k,onPointerEnter:I,onMouseEnter:I,onPointerMove:T,onMouseMove:T,onPointerLeave:N,onMouseLeave:N};return yr()({ourProps:z,theirProps:f,slot:G,defaultTag:Pse,name:"Combobox.Option"})}let kse=Xn(yse),JN=Xn(Cse),ZN=Xn(wse),Ose=Toe,e5=Xn(Rse),t5=Xn(Mse),Dse=Object.assign(kse,{Input:ZN,Button:JN,Label:Ose,Options:e5,Option:t5});function Tse(){let e=E.useRef(!1);return ft(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function n5(e){var t;return!!(e.enter||e.enterFrom||e.enterTo||e.leave||e.leaveFrom||e.leaveTo)||((t=e.as)!=null?t:o5)!==E.Fragment||E.Children.count(e.children)===1}let em=E.createContext(null);em.displayName="TransitionContext";var Ise=(e=>(e.Visible="visible",e.Hidden="hidden",e))(Ise||{});function Ase(){let e=E.useContext(em);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function Nse(){let e=E.useContext(tm);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}let tm=E.createContext(null);tm.displayName="NestingContext";function nm(e){return"children"in e?nm(e.children):e.current.filter(({el:t})=>t.current!==null).filter(({state:t})=>t==="visible").length>0}function r5(e,t){let n=ns(e),r=E.useRef([]),o=Tse(),i=dc(),s=xe((f,p=Ii.Hidden)=>{let g=r.current.findIndex(({el:b})=>b===f);g!==-1&&(Hr(p,{[Ii.Unmount](){r.current.splice(g,1)},[Ii.Hidden](){r.current[g].state="hidden"}}),i.microTask(()=>{var b;!nm(r)&&o.current&&((b=n.current)==null||b.call(n))}))}),a=xe(f=>{let p=r.current.find(({el:g})=>g===f);return p?p.state!=="visible"&&(p.state="visible"):r.current.push({el:f,state:"visible"}),()=>s(f,Ii.Unmount)}),l=E.useRef([]),c=E.useRef(Promise.resolve()),u=E.useRef({enter:[],leave:[]}),d=xe((f,p,g)=>{l.current.splice(0),t&&(t.chains.current[p]=t.chains.current[p].filter(([b])=>b!==f)),t==null||t.chains.current[p].push([f,new Promise(b=>{l.current.push(b)})]),t==null||t.chains.current[p].push([f,new Promise(b=>{Promise.all(u.current[p].map(([v,x])=>x)).then(()=>b())})]),p==="enter"?c.current=c.current.then(()=>t==null?void 0:t.wait.current).then(()=>g(p)):g(p)}),h=xe((f,p,g)=>{Promise.all(u.current[p].splice(0).map(([b,v])=>v)).then(()=>{var b;(b=l.current.shift())==null||b()}).then(()=>g(p))});return E.useMemo(()=>({children:r,register:a,unregister:s,onStart:d,onStop:h,wait:c,chains:u}),[a,s,r,d,h,u,c])}let o5=E.Fragment,i5=Pp.RenderStrategy;function jse(e,t){var n,r;let{transition:o=!0,beforeEnter:i,afterEnter:s,beforeLeave:a,afterLeave:l,enter:c,enterFrom:u,enterTo:d,entered:h,leave:f,leaveFrom:p,leaveTo:g,...b}=e,[v,x]=E.useState(null),y=E.useRef(null),_=n5(e),w=Yr(..._?[y,t,x]:t===null?[]:[t]),C=(n=b.unmount)==null||n?Ii.Unmount:Ii.Hidden,{show:R,appear:k,initial:D}=Ase(),[I,T]=E.useState(R?"visible":"hidden"),N=Nse(),{register:G,unregister:z}=N;ft(()=>G(y),[G,y]),ft(()=>{if(C===Ii.Hidden&&y.current){if(R&&I!=="visible"){T("visible");return}return Hr(I,{hidden:()=>z(y),visible:()=>G(y)})}},[I,y,G,z,R,C]);let O=j1();ft(()=>{if(_&&O&&I==="visible"&&y.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[y,I,O,_]);let A=D&&!k,L=k&&R&&D,j=E.useRef(!1),B=r5(()=>{j.current||(T("hidden"),z(y))},N),M=xe(H=>{j.current=!0;let V=H?"enter":"leave";B.onStart(y,V,Q=>{Q==="enter"?i==null||i():Q==="leave"&&(a==null||a())})}),W=xe(H=>{let V=H?"enter":"leave";j.current=!1,B.onStop(y,V,Q=>{Q==="enter"?s==null||s():Q==="leave"&&(l==null||l())}),V==="leave"&&!nm(B)&&(T("hidden"),z(y))});E.useEffect(()=>{_&&o||(M(R),W(R))},[R,_,o]);let F=!(!o||!_||!O||A),[,P]=WN(F,v,R,{start:M,end:W}),U=yi({ref:w,className:((r=wy(b.className,L&&c,L&&u,P.enter&&c,P.enter&&P.closed&&u,P.enter&&!P.closed&&d,P.leave&&f,P.leave&&!P.closed&&p,P.leave&&P.closed&&g,!P.transition&&R&&h))==null?void 0:r.trim())||void 0,...HN(P)}),q=0;I==="visible"&&(q|=Br.Open),I==="hidden"&&(q|=Br.Closed),P.enter&&(q|=Br.Opening),P.leave&&(q|=Br.Closing);let K=yr();return E.createElement(tm.Provider,{value:B},E.createElement(YN,{value:q},K({ourProps:U,theirProps:b,defaultTag:o5,features:i5,visible:I==="visible",name:"Transition.Child"})))}function Fse(e,t){let{show:n,appear:r=!1,unmount:o=!0,...i}=e,s=E.useRef(null),a=n5(e),l=Yr(...a?[s,t]:t===null?[]:[t]);j1();let c=A1();if(n===void 0&&c!==null&&(n=(c&Br.Open)===Br.Open),n===void 0)throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[u,d]=E.useState(n?"visible":"hidden"),h=r5(()=>{n||d("hidden")}),[f,p]=E.useState(!0),g=E.useRef([n]);ft(()=>{f!==!1&&g.current[g.current.length-1]!==n&&(g.current.push(n),p(!1))},[g,n]);let b=E.useMemo(()=>({show:n,appear:r,initial:f}),[n,r,f]);ft(()=>{n?d("visible"):!nm(h)&&s.current!==null&&d("hidden")},[n,h]);let v={unmount:o},x=xe(()=>{var w;f&&p(!1),(w=e.beforeEnter)==null||w.call(e)}),y=xe(()=>{var w;f&&p(!1),(w=e.beforeLeave)==null||w.call(e)}),_=yr();return E.createElement(tm.Provider,{value:h},E.createElement(em.Provider,{value:b},_({ourProps:{...v,as:E.Fragment,children:E.createElement(s5,{ref:l,...v,...i,beforeEnter:x,beforeLeave:y})},theirProps:{},defaultTag:E.Fragment,features:i5,visible:u==="visible",name:"Transition"})))}function Lse(e,t){let n=E.useContext(em)!==null,r=A1()!==null;return E.createElement(E.Fragment,null,!n&&r?E.createElement(Ry,{ref:t,...e}):E.createElement(s5,{ref:t,...e}))}let Ry=Xn(Fse),s5=Xn(jse),$se=Xn(Lse),zse=Object.assign(Ry,{Child:$se,Root:Ry});var L1="Checkbox",[Bse,bve]=Kt(L1),[Vse,Hse]=Bse(L1),a5=S.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:o,defaultChecked:i,required:s,disabled:a,value:l="on",onCheckedChange:c,form:u,...d}=e,[h,f]=S.useState(null),p=Oe(t,_=>f(_)),g=S.useRef(!1),b=h?u||!!h.closest("form"):!0,[v=!1,x]=yn({prop:o,defaultProp:i,onChange:c}),y=S.useRef(v);return S.useEffect(()=>{const _=h==null?void 0:h.form;if(_){const w=()=>x(y.current);return _.addEventListener("reset",w),()=>_.removeEventListener("reset",w)}},[h,x]),m.jsxs(Vse,{scope:n,state:v,disabled:a,children:[m.jsx(pe.button,{type:"button",role:"checkbox","aria-checked":ji(v)?"mixed":v,"aria-required":s,"data-state":u5(v),"data-disabled":a?"":void 0,disabled:a,value:l,...d,ref:p,onKeyDown:ae(e.onKeyDown,_=>{_.key==="Enter"&&_.preventDefault()}),onClick:ae(e.onClick,_=>{x(w=>ji(w)?!0:!w),b&&(g.current=_.isPropagationStopped(),g.current||_.stopPropagation())})}),b&&m.jsx(Wse,{control:h,bubbles:!g.current,name:r,value:l,checked:v,required:s,disabled:a,form:u,style:{transform:"translateX(-100%)"},defaultChecked:ji(i)?!1:i})]})});a5.displayName=L1;var l5="CheckboxIndicator",c5=S.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...o}=e,i=Hse(l5,n);return m.jsx(qt,{present:r||ji(i.state)||i.state===!0,children:m.jsx(pe.span,{"data-state":u5(i.state),"data-disabled":i.disabled?"":void 0,...o,ref:t,style:{pointerEvents:"none",...e.style}})})});c5.displayName=l5;var Wse=e=>{const{control:t,checked:n,bubbles:r=!0,defaultChecked:o,...i}=e,s=S.useRef(null),a=Fg(n),l=Eg(t);S.useEffect(()=>{const u=s.current,d=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(d,"checked").set;if(a!==n&&f){const p=new Event("click",{bubbles:r});u.indeterminate=ji(n),f.call(u,ji(n)?!1:n),u.dispatchEvent(p)}},[a,n,r]);const c=S.useRef(ji(n)?!1:n);return m.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:o??c.current,...i,tabIndex:-1,ref:s,style:{...e.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function ji(e){return e==="indeterminate"}function u5(e){return ji(e)?"indeterminate":e?"checked":"unchecked"}var d5=a5,Use=c5;const rm=S.forwardRef(({className:e,...t},n)=>m.jsx(d5,{ref:n,className:ie("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:m.jsx(Use,{className:ie("flex items-center justify-center text-current"),children:m.jsx(tc,{className:"h-4 w-4"})})}));rm.displayName=d5.displayName;function qse(e){const t=/(>=|<=|>|<|=)/,n=e.match(t);if(n){const r=n[0],[o,i]=e.split(r);return{operation:r,value:i.trim()}}else return null}function Gse(e,t,n){const r=`SELECT ${n}, COUNT(*) FROM ${t} {{ filters | where }} GROUP BY ${n} ORDER BY ${n} ASC LIMIT 50`,o=`SELECT min(${n}) as min, max(${n}) as max FROM ${t} {{ filters | where }}`;return Jl(e)?o:r}function Yse(e){const t=se(i=>{var s,a;return(a=(s=i==null?void 0:i.dashboard)==null?void 0:s.filters)==null?void 0:a.find(l=>l.id===e)}),{query:n,setQuery:r,...o}=$1(t||{});return o}function $1(e){const[t,n]=E.useState([]),[r,o]=E.useState(""),i=se(C=>C.filterValues),s=se(C=>C.selectedSheetId),{addOrUpdateFilterValue:a,removeFilterValues:l}=zt(),{data:c,isLoading:u,isFetching:d,isError:h}=pN(e),f=E.useMemo(()=>{var R;return e.column?(R=c==null?void 0:c.records)==null?void 0:R.map(k=>{let D=e.column.split(".").slice(-1)[0].replace(/"/g,"");return k[D]===void 0&&(D=D.toLowerCase()),{id:k[D],value:k[D]}}):[]},[c,e.column]);E.useEffect(()=>{if(i){const C=i.find(R=>R.filterId===e.id);if(!C){n([]);return}if(C.operation==="in"){const R=f==null?void 0:f.filter(k=>C.values.includes(k.value));R&&n(R)}}},[c,s,i,e.id,f]),E.useEffect(()=>{if(i&&!i.find(R=>R.filterId===e.id)){n([]);return}},[i,e.id]);function p(C){const R=qse(C[0].toString());if(!(R!=null&&R.value)||!(R!=null&&R.operation))return;const k={filterId:e.id,connectionType:e.database==="NA"?"api":"database",valueType:Qa(e),name:e.column,operation:R.operation,values:[Number(R.value)]};a(k)}function g(C){if(Array.isArray(C)||(C=[C]),C.length===1&&f.find(k=>k.value===C[0].value)===void 0){p(C);return}if(n(C),C.length===0){l(e.id);return}const R={filterId:e.id,connectionType:e.database==="NA"?"api":"database",name:e.column,valueType:Qa(e),operation:e.operation,values:C.map(k=>k.value)};a(R)}function b(){n([]),l(e.id)}function v(C){if(C){n(f);const R={filterId:e.id,connectionType:e.database==="NA"?"api":"database",name:e.column,valueType:Qa(e),operation:e.operation,values:f.map(k=>k.value)};a(R)}else b()}function x(){if(dd(e.dataType))return f;const C=r.toLowerCase().replace(/\s+/g,"");return r===""?f:f.filter(R=>R.value.toLowerCase().replace(/\s+/g,"").includes(C))}const y=x(),_=e.type==="single",w=t.length===(f==null?void 0:f.length);return{isLoading:u,isFetching:d,isError:h,records:f,selectedRecords:t,handleChange:g,handleClear:b,handleSelectAll:v,query:r,setQuery:o,filteredRecords:y,isSingleSelect:_,allSelected:w}}function Kse({filter:e}){const t=se(f=>f.themeStyle),{filteredRecords:n,isSingleSelect:r,allSelected:o,handleChange:i,handleSelectAll:s,query:a,setQuery:l,isLoading:c,isFetching:u,isError:d,selectedRecords:h}=$1(e);return c||u?m.jsx(el,{style:{borderRadius:t==null?void 0:t.controlInputRadius},className:"h-8 w-full bg-foreground/10"}):d?m.jsx("div",{className:"flex h-8 w-full items-center bg-muted px-2 text-sm",children:"Error"}):m.jsx("div",{className:"w-full",children:m.jsx(Dse,{value:h,multiple:!r,onChange:i,children:m.jsxs("div",{className:"relative",children:[m.jsxs("div",{style:{borderRadius:t==null?void 0:t.controlInputRadius},className:"relative w-full cursor-default overflow-hidden rounded-sm border bg-background text-left focus:outline-none focus-visible:ring-2 focus-visible:ring-background/75 focus-visible:ring-offset-2 sm:text-sm",children:[m.jsx(ZN,{className:"flex h-8 w-full rounded border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0 disabled:cursor-not-allowed disabled:opacity-50",displayValue:f=>f.map(g=>g.value).join(", "),onChange:f=>{l(f.target.value)}}),m.jsx(JN,{className:"absolute inset-y-0 right-0 flex items-center bg-background pl-1 pr-2",children:m.jsx(bd,{className:"size-4 text-gray-400","aria-hidden":"true"})})]}),m.jsx(zse,{as:E.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",afterLeave:()=>l(""),children:m.jsxs(e5,{style:{borderRadius:t==null?void 0:t.controlInputRadius},className:"absolute z-10 mt-1 max-h-60 w-full overflow-auto rounded-sm border bg-background py-1 text-base text-foreground/80 shadow-lg focus:outline-none sm:text-sm",children:[e.type==="multiple"||e.type===void 0&&m.jsxs("div",{className:"flex items-center justify-between gap-2 border-b border-b-muted px-4 py-2",children:[m.jsx("span",{children:"Select All"}),m.jsx(rm,{className:"border-muted-foreground/50",checked:o,onCheckedChange:s})]}),(n==null?void 0:n.length)===0&&a!==""?m.jsx("div",{className:"relative cursor-default select-none px-4 py-2 text-gray-700",children:"Nothing found."}):n==null?void 0:n.map(f=>m.jsx(t5,{style:{borderRadius:t==null?void 0:t.controlInputRadius},className:({active:p})=>`relative m-1 cursor-default select-none py-2 pl-10 pr-4 ${p?"bg-muted":"text-foreground-900"}`,value:f,children:({selected:p,active:g})=>m.jsxs("div",{className:"",children:[m.jsx("span",{className:`block ${p?"font-medium":"font-normal"}`,children:typeof f.value=="boolean"?f.value?"True":"False":f.value}),p?m.jsx("span",{className:"absolute inset-y-0 left-0 flex items-center pl-3 text-foreground",children:m.jsx(ew,{className:"size-4","aria-hidden":"true"})}):null]})},f.value))]})})]})})})}var z1="Radio",[Xse,f5]=Kt(z1),[Qse,Jse]=Xse(z1),h5=S.forwardRef((e,t)=>{const{__scopeRadio:n,name:r,checked:o=!1,required:i,disabled:s,value:a="on",onCheck:l,form:c,...u}=e,[d,h]=S.useState(null),f=Oe(t,b=>h(b)),p=S.useRef(!1),g=d?c||!!d.closest("form"):!0;return m.jsxs(Qse,{scope:n,checked:o,disabled:s,children:[m.jsx(pe.button,{type:"button",role:"radio","aria-checked":o,"data-state":m5(o),"data-disabled":s?"":void 0,disabled:s,value:a,...u,ref:f,onClick:ae(e.onClick,b=>{o||l==null||l(),g&&(p.current=b.isPropagationStopped(),p.current||b.stopPropagation())})}),g&&m.jsx(Zse,{control:d,bubbles:!p.current,name:r,value:a,checked:o,required:i,disabled:s,form:c,style:{transform:"translateX(-100%)"}})]})});h5.displayName=z1;var p5="RadioIndicator",g5=S.forwardRef((e,t)=>{const{__scopeRadio:n,forceMount:r,...o}=e,i=Jse(p5,n);return m.jsx(qt,{present:r||i.checked,children:m.jsx(pe.span,{"data-state":m5(i.checked),"data-disabled":i.disabled?"":void 0,...o,ref:t})})});g5.displayName=p5;var Zse=e=>{const{control:t,checked:n,bubbles:r=!0,...o}=e,i=S.useRef(null),s=Fg(n),a=Eg(t);return S.useEffect(()=>{const l=i.current,c=window.HTMLInputElement.prototype,d=Object.getOwnPropertyDescriptor(c,"checked").set;if(s!==n&&d){const h=new Event("click",{bubbles:r});d.call(l,n),l.dispatchEvent(h)}},[s,n,r]),m.jsx("input",{type:"radio","aria-hidden":!0,defaultChecked:n,...o,tabIndex:-1,ref:i,style:{...e.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function m5(e){return e?"checked":"unchecked"}var eae=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],B1="RadioGroup",[tae,vve]=Kt(B1,[ec,f5]),b5=ec(),v5=f5(),[nae,rae]=tae(B1),y5=S.forwardRef((e,t)=>{const{__scopeRadioGroup:n,name:r,defaultValue:o,value:i,required:s=!1,disabled:a=!1,orientation:l,dir:c,loop:u=!0,onValueChange:d,...h}=e,f=b5(n),p=ga(c),[g,b]=yn({prop:i,defaultProp:o,onChange:d});return m.jsx(nae,{scope:n,name:r,required:s,disabled:a,value:g,onValueChange:b,children:m.jsx(_x,{asChild:!0,...f,orientation:l,dir:p,loop:u,children:m.jsx(pe.div,{role:"radiogroup","aria-required":s,"aria-orientation":l,"data-disabled":a?"":void 0,dir:p,...h,ref:t})})})});y5.displayName=B1;var x5="RadioGroupItem",w5=S.forwardRef((e,t)=>{const{__scopeRadioGroup:n,disabled:r,...o}=e,i=rae(x5,n),s=i.disabled||r,a=b5(n),l=v5(n),c=S.useRef(null),u=Oe(t,c),d=i.value===o.value,h=S.useRef(!1);return S.useEffect(()=>{const f=g=>{eae.includes(g.key)&&(h.current=!0)},p=()=>h.current=!1;return document.addEventListener("keydown",f),document.addEventListener("keyup",p),()=>{document.removeEventListener("keydown",f),document.removeEventListener("keyup",p)}},[]),m.jsx(Ex,{asChild:!0,...a,focusable:!s,active:d,children:m.jsx(h5,{disabled:s,required:i.required,checked:d,...l,...o,name:i.name,ref:u,onCheck:()=>i.onValueChange(o.value),onKeyDown:ae(f=>{f.key==="Enter"&&f.preventDefault()}),onFocus:ae(o.onFocus,()=>{var f;h.current&&((f=c.current)==null||f.click())})})})});w5.displayName=x5;var oae="RadioGroupIndicator",S5=S.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...r}=e,o=v5(n);return m.jsx(g5,{...o,...r,ref:t})});S5.displayName=oae;var C5=y5,_5=w5,iae=S5;const Gu=S.forwardRef(({className:e,...t},n)=>m.jsx(C5,{className:ie("grid gap-2",e),...t,ref:n}));Gu.displayName=C5.displayName;const Os=S.forwardRef(({className:e,...t},n)=>m.jsx(_5,{ref:n,className:ie("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:m.jsx(iae,{className:"flex items-center justify-center",children:m.jsx(Qk,{className:"h-2.5 w-2.5 fill-current text-current"})})}));Os.displayName=_5.displayName;function sae({filter:e}){var i;const{filteredRecords:t,handleChange:n,selectedRecords:r}=$1(e);function o(s){n([{value:s,id:s}])}return m.jsx(Gu,{onValueChange:o,value:((i=r==null?void 0:r[0])==null?void 0:i.value)||"",className:"mt-2 flex gap-3 overflow-x-auto",children:t==null?void 0:t.map(s=>m.jsxs("div",{className:"flex gap-2",children:[m.jsx(Os,{value:s.value,id:"r1"}),m.jsx(Et,{className:"text-muted-foreground",htmlFor:"r1",children:s.value})]},s.value))})}function V1({filter:e}){return Jl(e.dataType)?m.jsx(Lre,{filter:e}):e.uiType==="radio"&&e.type==="single"?m.jsx(sae,{filter:e}):m.jsx(Kse,{filter:e})}function aae({frame:e}){const[t,n]=E.useState(!1),r=e==null?void 0:e.cards[0],{data:o}=oi(r),i=e==null?void 0:e.cards[1],{data:s,isLoading:a,isFetching:l}=oi(i);return(i==null?void 0:i.type)!=="text"?m.jsx(fp,{card:r,data:(o==null?void 0:o.records)||[]}):m.jsxs(ll,{className:ie("group relative overflow-y-auto",t?"m-4":"mx-0"),children:[t?m.jsx("div",{className:"overflow-y-auto break-words p-1",children:m.jsx(vp,{card:i,data:(s==null?void 0:s.records)||[],isLoading:!1})}):m.jsx(fp,{card:r,data:(o==null?void 0:o.records)||[]}),m.jsx("div",{className:ie("fixed z-10",{"invisible bottom-4 right-4 group-hover:visible":t,"right-6 top-6":!t}),children:m.jsx(qg,{disabled:a||l,className:ie("h-7 p-1"),pressed:t,onPressedChange:n,"aria-label":"Toggle bold",children:t?m.jsx(zz,{className:"size-4 text-muted-foreground/70"}):m.jsx(Bz,{className:"size-4 text-muted-foreground/70"})})})]})}function lae({card:e,frame:t}){var N,G,z;const{customCards:n,placeholders:r}=vr(),o=se(O=>O.themeStyle),i=se(O=>O.selectedSheetId),s=se(O=>O.isDashboardEditing);se(O=>O.selectedLensId);const a=se(O=>O.dashboard.filters),l=a==null?void 0:a.find(O=>O.id===t.filterId&&!O.hide),{setCardTitle:c,setCardDescription:u,setSelectedFrameId:d,updateFilter:h}=zt(),{updateFrame:f}=zt(),p=((N=e.customCardPreferences)==null?void 0:N.showCardHeader)??!0,{isError:g,isLoading:b,isFetching:v,cfg:x,data:y,handleDatapointClick:_}=cT(e);function w(){var O,A,L;if(n&&n.length>0){const j=n.find(B=>B.cardId===e.id);if(j&&j.replaceDefault){const B=j.content;if(B)return m.jsx(B,{card:e})}}if(e.type==="kpi"){if(((O=t==null?void 0:t.cards)==null?void 0:O.length)===1)return m.jsx(fp,{card:e,data:(y==null?void 0:y.records)||[]});if(((A=t==null?void 0:t.cards)==null?void 0:A.length)>1)return m.jsx(aae,{frame:t})}return e.type==="text"&&((L=t==null?void 0:t.cards)==null?void 0:L.length)===1?m.jsx(ll,{className:"mx-3 my-6 overflow-y-auto break-words px-3",children:m.jsx(vp,{isLoading:b||v,card:e,data:(y==null?void 0:y.records)||[]})}):T}function C(){return["{{ filters | where }}","{{ filters | and }}"].some(A=>{var L;return(L=e.sql)==null?void 0:L.includes(A)})?m.jsx(PQ,{}):null}function R(){if(g)return m.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-2",children:[m.jsx(Wz,{className:"size-8 text-destructive"}),m.jsx("p",{className:"text-sm text-muted-foreground",children:"Error fetching data. Check your card settings."})]});if(y!=null&&y.records&&(y==null?void 0:y.records.length)===0)return r!=null&&r.NoRecords?m.jsx("div",{className:"flex h-full flex-col items-center justify-center gap-2",children:r.NoRecords}):m.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-2",children:[m.jsx(aO,{className:"size-8 text-muted-foreground"}),m.jsx("p",{className:"text-sm text-muted-foreground",children:"No records to display"})]});if(e.type==="table"&&(y!=null&&y.records)&&(y==null?void 0:y.records.length)>0)return m.jsxs(ll,{className:"relative flex h-full min-h-0 w-full flex-1 grow basis-0",children:[m.jsx(SA,{card:e,data:(y==null?void 0:y.records)||[]}),m.jsx(uc,{orientation:"horizontal"})]});if(e.type==="text")return m.jsx(ll,{className:"overflow-y-auto break-words pr-2",children:m.jsx(vp,{isLoading:b||v,card:e,data:(y==null?void 0:y.records)||[]})});if(e.type==="custom")return m.jsx(gee,{frame:t,card:e});if(n&&n.length>0){const O=n.find(A=>A.cardId===e.id);if(O&&O.content){const A=O.content;return m.jsx(A,{card:e})}}if(x)return m.jsx(c1,{cfg:x,onDatapointClick:_})}function k(){if(n&&n.length>0){const O=n.find(A=>A.cardId===e.id);if(O&&O.footer){const A=O.footer;if(A)return m.jsx(A,{card:e})}}return null}function D(){var L;const O=t.cards.filter(j=>{var B;return!((B=j.tabTitle)!=null&&B.endsWith("__Header"))&&(j.displayTab===!0||j.displayTab===void 0)}),A=o==null?void 0:o.controlInputRadius;return m.jsx(Mx,{value:t.activeCardId,className:"flex items-center justify-end gap-3",onValueChange:j=>{const B={...t,activeCardId:j};f(i,B)},children:m.jsx(Qp,{style:{borderRadius:o==null?void 0:o.controlInputRadius},className:"flex-end flex h-9 flex-wrap items-center border border-border bg-background p-0",children:(L=t.cards.filter(j=>{var B;return!((B=j.tabTitle)!=null&&B.endsWith("__Header"))&&(j.displayTab===!0||j.displayTab===void 0)}))==null?void 0:L.map((j,B)=>m.jsx(Jp,{className:ie("h-full items-center rounded-none data-[state=active]:bg-muted data-[state=active]:shadow-none",{"border-r":B!==O.length-1}),style:{borderTopLeftRadius:B===0?A:0,borderTopRightRadius:B===O.length-1?A:0,borderBottomLeftRadius:B===0?A:0,borderBottomRightRadius:B===O.length-1?A:0},value:j.id,children:j.tabTitle||j.title},j.id))})})}function I(){let O=t.cards.find(A=>A.type==="kpi"&&A.tabTitle===`${e.tabTitle}__Header`);return O||(O=t.cards.find(A=>A.type==="kpi"&&A.tabTitle==="All__Header")),O?m.jsx("div",{className:"flex items-end gap-2",children:m.jsx(tQ,{renderFilterInfo:C,card:O})}):m.jsxs(m.Fragment,{children:[m.jsxs("div",{role:"card-title-container",className:"flex items-center gap-2",children:[m.jsx(bo,{text:e.title,onSave:A=>c(i,e.id,A),children:m.jsx(Zl,{className:ie("text-base",{}),children:e.title})}),(s||e.info)&&m.jsx(UT,{card:e}),e.refreshInterval&&m.jsxs(Qw,{children:[m.jsx(Jw,{className:"pr-1",children:m.jsx("div",{className:ie("h-2 w-2 rounded-full bg-green-500 transition-opacity",{"opacity-10":b||v})})}),m.jsx(Ig,{side:"right",align:"center",children:m.jsx("p",{className:"text-xs",children:`Realtime (${e==null?void 0:e.refreshInterval})`})})]}),C()]}),m.jsx("div",{role:"card-description-container",children:m.jsx(bo,{text:(e==null?void 0:e.description)||"",onSave:A=>u(i,e.id,A),children:m.jsxs(Sx,{className:ie("",{}),children:[" ",e.description]})})})]})}if(!e.id)return null;const T=m.jsxs(m.Fragment,{children:[p?m.jsx(qp,{children:m.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-2",children:[m.jsx("div",{className:"grow",role:"header-container",children:I()}),m.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[m.jsx("div",{children:l&&m.jsxs("div",{style:{borderRadius:(z=(G=o==null?void 0:o.chart)==null?void 0:G.options)==null?void 0:z.borderRadius},"data-content":"frame-filter-container",className:"flex shrink-0 items-center",children:[!Jl(l.dataType)&&m.jsx(bo,{className:"my-1",containerClassName:"shrink-0",text:l.title||l.column,onSave:O=>h({...l,title:O}),children:m.jsx(Et,{className:"px-3",children:l.title})}),m.jsx(V1,{filter:l})]})}),t.cards.length>1&&D()]})]})}):m.jsx("div",{className:"h-8"}),m.jsx(Gp,{className:"relative flex min-h-0 grow flex-col",children:R()}),m.jsx(NM,{children:k()})]});return m.jsx("div",{className:ie("flex h-full flex-col",{"animate-pulse":b||v}),children:w()})}function cae({frame:e,footer:t,className:n,...r}){const o=E.useRef(null),i=se(b=>b.themeStyle),s=se(b=>b.isVisualEditing),a=se(b=>b.selectedFrameId),l=se(b=>b.isDashboardEditing),{setSelectedFrameId:c}=zt(),{setSelectedConnectionId:u,setSelectedDatabaseName:d,setSelectedSchemaName:h,setSelectedTableName:f}=fg();E.useEffect(()=>{if(a===e.id&&l&&!s){const b=o==null?void 0:o.current;b==null||b.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})}},[a,e.id,l,s,o]);const p=e.cards.find(b=>b.id===e.activeCardId);function g(b){b.stopPropagation(),c(e.id),p!=null&&p.connectionId&&u(p==null?void 0:p.connectionId),p!=null&&p.lastSelectedDatabase&&d(p==null?void 0:p.lastSelectedDatabase),p!=null&&p.lastSelectedSchema&&h(p==null?void 0:p.lastSelectedSchema),p!=null&&p.lastSelectedTable&&f(p==null?void 0:p.lastSelectedTable)}return m.jsx(vd,{FallbackComponent:nw,children:m.jsxs("div",{tabIndex:-1,ref:o,role:"card-frame",onClick:g,style:{borderRadius:i==null?void 0:i.cardBorderRadius},className:ie("relative flex h-full flex-col rounded-sm border bg-background shadow-sm",{"border-dashed border-foreground/50":a===e.id&&l},i==null?void 0:i.dashboardCard,n,"semaphor-card-frame"),...r,children:[m.jsx(cO,{frame:e}),m.jsx(lae,{card:p,frame:e},p.id)]})})}const H1=S.forwardRef(({className:e,...t},n)=>m.jsx("textarea",{className:ie("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:n,...t}));H1.displayName="Textarea";function uae({label:e,onCheckedChange:t,checked:n}){return m.jsxs("div",{className:"flex items-center space-x-2",children:[m.jsx(rm,{onCheckedChange:t,id:"terms",checked:n}),m.jsx("label",{htmlFor:"terms",className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:e})]})}function E5({text:e,className:t}){const[n,r]=E.useState(!1);return m.jsx(Yt,{className:ie("h-7 w-fit px-1 font-mono text-xs text-muted-foreground/70",t),variant:"ghost",size:"icon",onClick:()=>{navigator.clipboard.writeText(e),r(!0),setTimeout(()=>{r(!1)},1e3)},children:n?m.jsx(ew,{className:"size-3.5"}):m.jsx(Jk,{className:"size-3.5"})})}function dae({filter:e}){const[t,n]=E.useState(e.sql),[r,o]=E.useState(!1),i=se(f=>f.selectedSheetId),{updateFilter:s,updateFilterId:a}=zt();function l(){const f={...e,sql:t};s(f),o(!1)}function c(f){console.log("operation",f);const p={...e,operation:f};s(p)}function u(f){const p={...e,type:f};s(p)}function d(f){const p={...e,uiType:f};s(p)}function h(f){if(!i)return;const p={...e,sheetId:f?i:void 0};s(p)}return m.jsxs(Wg,{open:r,onOpenChange:o,children:[m.jsx(Ug,{children:m.jsx(sO,{className:"invisible h-3 w-3 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"})}),m.jsxs(Td,{onMouseDown:f=>f.stopPropagation(),onDoubleClick:f=>f.stopPropagation(),className:"z-50 m-2 w-full min-w-[350px] space-y-4",children:[m.jsxs("div",{className:"space-y-2",children:[m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx("p",{className:"font-semibold text-foreground",children:e.column}),m.jsx("div",{className:"flex items-center gap-2",children:m.jsxs(Pg,{children:[m.jsx(Mg,{children:m.jsx($z,{className:"size-5 cursor-pointer text-muted-foreground hover:text-foreground/80"})}),m.jsxs(Pd,{align:"start",className:"flex w-auto items-center gap-2 px-3 py-2",children:[m.jsx("p",{className:"font-mono text-xs text-muted-foreground",children:e.id}),m.jsx(E5,{text:e.id})]})]})})]}),m.jsx("p",{className:"text-sm text-muted-foreground",children:"Customize filter operation and SQL"})]}),m.jsx(Ag,{}),m.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[m.jsxs("div",{className:"space-y-2",children:[m.jsx(Et,{children:"Type"}),m.jsxs(Gu,{onValueChange:u,value:e.type||"multiple",className:"flex gap-3",defaultValue:"x",children:[m.jsxs("div",{className:"flex items-center space-x-2",children:[m.jsx(Os,{value:"multiple",id:"r1"}),m.jsx("label",{className:"text-sm",htmlFor:"r1",children:"Multiple"})]}),m.jsxs("div",{className:"flex items-center space-x-2",children:[m.jsx(Os,{value:"single",id:"r2"}),m.jsx("label",{className:"text-sm",htmlFor:"r2",children:"Single"})]})]})]}),e.type==="single"&&m.jsxs("div",{className:"space-y-2",children:[m.jsx(Et,{children:"Filter Element"}),m.jsxs(Gu,{onValueChange:d,value:e.uiType||"dropdown",className:"flex gap-3",defaultValue:"x",children:[m.jsxs("div",{className:"flex items-center space-x-2",children:[m.jsx(Os,{value:"dropdown",id:"r2"}),m.jsx("label",{className:"text-sm",htmlFor:"r2",children:"Dropdown"})]}),m.jsxs("div",{className:"flex items-center space-x-2",children:[m.jsx(Os,{value:"radio",id:"r1"}),m.jsx("label",{className:"text-sm",htmlFor:"r1",children:"Radio"})]})]})]})]}),m.jsxs("div",{className:"grid grid-cols-6 gap-4 text-sm",children:[m.jsxs("div",{className:"col-span-2 space-y-1",children:[m.jsx(Et,{children:"Table Column"}),m.jsx(Et,{className:"block rounded-md bg-muted p-2 font-mono text-xs",children:e.column})]}),m.jsxs("div",{className:"col-span-2 space-y-1",children:[m.jsx(Et,{children:"Data Type"}),m.jsx(Et,{className:"block rounded-md bg-muted p-2 font-mono text-xs",children:e.dataType})]}),m.jsxs("div",{className:"col-span-2 space-y-1",children:[m.jsx(Et,{className:"text-sm",children:"Filter Operation"}),m.jsx(fae,{updateFilterOperation:c,value:e.operation})]})]}),m.jsxs("div",{className:"flex grow flex-col space-y-1",role:"container",children:[m.jsx(Et,{className:"text-sm",children:"Values SQL"}),m.jsx(H1,{onKeyDown:f=>{f.stopPropagation()},value:t,onChange:f=>n(f.target.value),className:`min-w-full grow resize font-mono text-xs ${Ja}`})]}),m.jsx("div",{children:m.jsx(uae,{label:"Local to sheet",onCheckedChange:h,checked:!!e.sheetId})}),m.jsx("div",{className:"flex justify-end gap-2",children:m.jsxs(Yt,{onClick:l,size:"sm",variant:"outline",children:[m.jsx(tc,{className:"mr-2 size-4"}),"Accept"]})})]})]})}function fae({value:e,updateFilterOperation:t}){return m.jsxs(Ho,{defaultValue:"in",value:e,onValueChange:n=>t(n),children:[m.jsx(no,{className:"h-8 w-[180px] focus:ring-0 focus:ring-offset-0",children:m.jsx(Wo,{placeholder:"Operation"})}),m.jsxs(ro,{children:[m.jsx(At,{value:"=",children:"Equals"}),m.jsx(At,{value:"in",children:"Contains"}),m.jsx(At,{value:"like",children:"Like"})]})]})}function R5({filter:e}){const t=se(a=>a.isDashboardEditing),n=se(a=>a.filterValues),r=n==null?void 0:n.some(a=>a.filterId===e.id),{removeFilterValues:o,removeFilter:i,updateFilter:s}=zt();return m.jsx(bo,{className:"my-1",text:e.title||e.column,onSave:a=>s({...e,title:a}),children:m.jsxs("div",{className:"group mb-1 flex grow items-center justify-between",children:[m.jsxs("div",{className:"flex grow items-center gap-2",children:[m.jsx(Et,{className:"inline-block text-sm",children:e.title}),r&&m.jsx("button",{onClick:()=>o(e.id),className:"text-foreground/70",children:m.jsx(tO,{className:"size-3.5"})}),t&&m.jsx("button",{className:"invisible group-hover:visible",onClick:()=>{s({...e,hide:!e.hide})},children:e.hide?m.jsx(eO,{className:"size-3.5 text-foreground/50 hover:text-foreground/70"}):m.jsx(Fz,{className:"size-3.5 text-foreground/50 hover:text-foreground/70"})}),t&&m.jsx(dae,{filter:e})]}),m.jsx("div",{className:"flex items-center gap-2",children:t&&m.jsx(ya,{onClick:()=>{o(e.id),i(e.id)},className:"size-3.5 cursor-pointer text-foreground/30 hover:cursor-pointer hover:text-foreground/50"})})]})})}const hae=t_.WidthProvider(t_.Responsive);function pae({sheet:e}){var v,x;const t=se(y=>y.isDashboardEditing),n=se(y=>y.currentBreakpoint),r=se(y=>y.themeStyle),o=se(y=>y.selectedSheetId),i=e.layouts,s=se(y=>y.dashboard.filters),a=e.frames,{setSheetLayouts:l,setCurrentBreakpoint:c}=se(y=>y.actions);E.useEffect(()=>{document.documentElement.style.setProperty("--placeholder-border-radius",`${r==null?void 0:r.cardBorderRadius}px`)},[r==null?void 0:r.cardBorderRadius]);function u(y){c(y)}function d(y,_){o===e.id&&l(o,_)}if(!o)return null;const h=(y,_)=>m.jsx(P5,{className:"after:content-none",ref:_,handleAxis:y}),f=y=>y&&(y==null?void 0:y.h)===1&&(y==null?void 0:y.w)===1?{...y,h:8,minH:7,w:7}:null;function p(){const y=s==null?void 0:s.filter(_=>(_.sheetId===o||!_.sheetId)&&!_.hide);return y==null?void 0:y.map(_=>{var R;const w=(R=i==null?void 0:i[n])==null?void 0:R.find(k=>k.i===_.id);if(_.location==="frame")return null;const C=f(w);return m.jsxs("div",{style:{borderRadius:r==null?void 0:r.cardBorderRadius},className:ie("z-50 flex flex-col rounded-md border bg-background px-3 py-2"),...C?{"data-grid":C}:{},children:[m.jsx(R5,{filter:_}),m.jsx(V1,{filter:_})]},_.id)})}function g(){return a==null?void 0:a.map(y=>m.jsx("div",{role:"dashboard-frame-container",className:ie("group isolate overflow-hidden",r==null?void 0:r.dashboardCardContainer),children:m.jsx(vd,{FallbackComponent:({error:_,resetErrorBoundary:w})=>m.jsx(xB,{error:_,resetErrorBoundary:w,frame:y}),children:m.jsx(cae,{frame:y})})},y.id))}const b=((v=r==null?void 0:r.gridLayout)==null?void 0:v.margin)||[10,10];return m.jsx(m.Fragment,{children:m.jsxs(hae,{margin:b,isDraggable:t,resizeHandles:t?["sw","nw","ne","se","e","w"]:[],className:ie((x=r==null?void 0:r.gridLayout)==null?void 0:x.className),layouts:i,cols:{lg:48,md:36,sm:24,xs:12,xxs:6},rowHeight:1,onBreakpointChange:u,onLayoutChange:d,resizeHandle:h,children:[p(),g()]})})}const P5=E.forwardRef(({className:e,handleAxis:t,...n},r)=>{const o=se(s=>s.themeStyle),i=(o==null?void 0:o.cardBorderRadius)||0;return m.jsx("div",{ref:r,className:ie(`react-resizable-handle z-10 react-resizable-handle-${t} absolute border-foreground/40`,{"border-foreground/40 group-hover:border-2 group-hover:border-b-0 group-hover:border-r-0":t==="nw"&&i<11,"border-foreground/40 group-hover:border-2 group-hover:border-b-0 group-hover:border-l-0":t==="ne"&&i<11,"border-foreground/40 group-hover:border-2 group-hover:border-r-0 group-hover:border-t-0":t==="sw"&&i<11,"border-foreground/40 group-hover:border-2 group-hover:border-l-0 group-hover:border-t-0":t==="se"&&i<11,"border-foreground/40 group-hover:border-2 group-hover:border-b-0 group-hover:border-l-0 group-hover:border-t-0":t==="e","border-foreground/40 group-hover:border-2 group-hover:border-b-0 group-hover:border-r-0 group-hover:border-t-0":t==="w"},e),...n})});P5.displayName="ResizeHandle";const{createElement:Kl,createContext:gae,forwardRef:M5,useCallback:Fn,useContext:k5,useEffect:Xs,useImperativeHandle:O5,useLayoutEffect:mae,useMemo:bae,useRef:Hn,useState:cl}=S,mP=S[`useId${Math.random()}`.slice(0,5)],vae=mae,om=gae(null);om.displayName="PanelGroupContext";const Qs=vae,yae=typeof mP=="function"?mP:()=>null;let xae=0;function W1(e=null){const t=yae(),n=Hn(e||t||null);return n.current===null&&(n.current=""+xae++),e??n.current}function D5({children:e,className:t="",collapsedSize:n,collapsible:r,defaultSize:o,forwardedRef:i,id:s,maxSize:a,minSize:l,onCollapse:c,onExpand:u,onResize:d,order:h,style:f,tagName:p="div",...g}){const b=k5(om);if(b===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:v,expandPanel:x,getPanelSize:y,getPanelStyle:_,groupId:w,isPanelCollapsed:C,reevaluatePanelConstraints:R,registerPanel:k,resizePanel:D,unregisterPanel:I}=b,T=W1(s),N=Hn({callbacks:{onCollapse:c,onExpand:u,onResize:d},constraints:{collapsedSize:n,collapsible:r,defaultSize:o,maxSize:a,minSize:l},id:T,idIsFromProps:s!==void 0,order:h});Hn({didLogMissingDefaultSizeWarning:!1}),Qs(()=>{const{callbacks:z,constraints:O}=N.current,A={...O};N.current.id=T,N.current.idIsFromProps=s!==void 0,N.current.order=h,z.onCollapse=c,z.onExpand=u,z.onResize=d,O.collapsedSize=n,O.collapsible=r,O.defaultSize=o,O.maxSize=a,O.minSize=l,(A.collapsedSize!==O.collapsedSize||A.collapsible!==O.collapsible||A.maxSize!==O.maxSize||A.minSize!==O.minSize)&&R(N.current,A)}),Qs(()=>{const z=N.current;return k(z),()=>{I(z)}},[h,T,k,I]),O5(i,()=>({collapse:()=>{v(N.current)},expand:z=>{x(N.current,z)},getId(){return T},getSize(){return y(N.current)},isCollapsed(){return C(N.current)},isExpanded(){return!C(N.current)},resize:z=>{D(N.current,z)}}),[v,x,y,C,T,D]);const G=_(N.current,o);return Kl(p,{...g,children:e,className:t,id:s,style:{...G,...f},"data-panel":"","data-panel-collapsible":r||void 0,"data-panel-group-id":w,"data-panel-id":T,"data-panel-size":parseFloat(""+G.flexGrow).toFixed(1)})}const T5=M5((e,t)=>Kl(D5,{...e,forwardedRef:t}));D5.displayName="Panel";T5.displayName="forwardRef(Panel)";let Py=null,Ds=null;function wae(e,t){if(t){const n=(t&F5)!==0,r=(t&L5)!==0,o=(t&$5)!==0,i=(t&z5)!==0;if(n)return o?"se-resize":i?"ne-resize":"e-resize";if(r)return o?"sw-resize":i?"nw-resize":"w-resize";if(o)return"s-resize";if(i)return"n-resize"}switch(e){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}function Sae(){Ds!==null&&(document.head.removeChild(Ds),Py=null,Ds=null)}function t0(e,t){const n=wae(e,t);Py!==n&&(Py=n,Ds===null&&(Ds=document.createElement("style"),document.head.appendChild(Ds)),Ds.innerHTML=`*{cursor: ${n}!important;}`)}function I5(e){return e.type==="keydown"}function A5(e){return e.type.startsWith("pointer")}function N5(e){return e.type.startsWith("mouse")}function im(e){if(A5(e)){if(e.isPrimary)return{x:e.clientX,y:e.clientY}}else if(N5(e))return{x:e.clientX,y:e.clientY};return{x:1/0,y:1/0}}function Cae(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function _ae(e,t,n){return e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y}function Eae(e,t){if(e===t)throw new Error("Cannot compare node with itself");const n={a:yP(e),b:yP(t)};let r;for(;n.a.at(-1)===n.b.at(-1);)e=n.a.pop(),t=n.b.pop(),r=e;Be(r,"Stacking order can only be calculated for elements with a common ancestor");const o={a:vP(bP(n.a)),b:vP(bP(n.b))};if(o.a===o.b){const i=r.childNodes,s={a:n.a.at(-1),b:n.b.at(-1)};let a=i.length;for(;a--;){const l=i[a];if(l===s.a)return 1;if(l===s.b)return-1}}return Math.sign(o.a-o.b)}const Rae=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function Pae(e){var t;const n=getComputedStyle((t=j5(e))!==null&&t!==void 0?t:e).display;return n==="flex"||n==="inline-flex"}function Mae(e){const t=getComputedStyle(e);return!!(t.position==="fixed"||t.zIndex!=="auto"&&(t.position!=="static"||Pae(e))||+t.opacity<1||"transform"in t&&t.transform!=="none"||"webkitTransform"in t&&t.webkitTransform!=="none"||"mixBlendMode"in t&&t.mixBlendMode!=="normal"||"filter"in t&&t.filter!=="none"||"webkitFilter"in t&&t.webkitFilter!=="none"||"isolation"in t&&t.isolation==="isolate"||Rae.test(t.willChange)||t.webkitOverflowScrolling==="touch")}function bP(e){let t=e.length;for(;t--;){const n=e[t];if(Be(n,"Missing node"),Mae(n))return n}return null}function vP(e){return e&&Number(getComputedStyle(e).zIndex)||0}function yP(e){const t=[];for(;e;)t.push(e),e=j5(e);return t}function j5(e){const{parentNode:t}=e;return t&&t instanceof ShadowRoot?t.host:t}const F5=1,L5=2,$5=4,z5=8,kae=Cae()==="coarse";let Wr=[],ul=!1,xi=new Map,sm=new Map;const Yu=new Set;function Oae(e,t,n,r,o){var i;const{ownerDocument:s}=t,a={direction:n,element:t,hitAreaMargins:r,setResizeHandlerState:o},l=(i=xi.get(s))!==null&&i!==void 0?i:0;return xi.set(s,l+1),Yu.add(a),Mp(),function(){var u;sm.delete(e),Yu.delete(a);const d=(u=xi.get(s))!==null&&u!==void 0?u:1;if(xi.set(s,d-1),Mp(),d===1&&xi.delete(s),Wr.includes(a)){const h=Wr.indexOf(a);h>=0&&Wr.splice(h,1),q1(),o("up",!0,null)}}}function xP(e){const{target:t}=e,{x:n,y:r}=im(e);ul=!0,U1({target:t,x:n,y:r}),Mp(),Wr.length>0&&(kp("down",e),e.preventDefault(),e.stopPropagation())}function Ac(e){const{x:t,y:n}=im(e);if(ul&&e.buttons===0&&(ul=!1,kp("up",e)),!ul){const{target:r}=e;U1({target:r,x:t,y:n})}kp("move",e),q1(),Wr.length>0&&e.preventDefault()}function Fa(e){const{target:t}=e,{x:n,y:r}=im(e);sm.clear(),ul=!1,Wr.length>0&&e.preventDefault(),kp("up",e),U1({target:t,x:n,y:r}),q1(),Mp()}function U1({target:e,x:t,y:n}){Wr.splice(0);let r=null;(e instanceof HTMLElement||e instanceof SVGElement)&&(r=e),Yu.forEach(o=>{const{element:i,hitAreaMargins:s}=o,a=i.getBoundingClientRect(),{bottom:l,left:c,right:u,top:d}=a,h=kae?s.coarse:s.fine;if(t>=c-h&&t<=u+h&&n>=d-h&&n<=l+h){if(r!==null&&document.contains(r)&&i!==r&&!i.contains(r)&&!r.contains(i)&&Eae(r,i)>0){let p=r,g=!1;for(;p&&!p.contains(i);){if(_ae(p.getBoundingClientRect(),a)){g=!0;break}p=p.parentElement}if(g)return}Wr.push(o)}})}function n0(e,t){sm.set(e,t)}function q1(){let e=!1,t=!1;Wr.forEach(r=>{const{direction:o}=r;o==="horizontal"?e=!0:t=!0});let n=0;sm.forEach(r=>{n|=r}),e&&t?t0("intersection",n):e?t0("horizontal",n):t?t0("vertical",n):Sae()}function Mp(){xi.forEach((e,t)=>{const{body:n}=t;n.removeEventListener("contextmenu",Fa),n.removeEventListener("pointerdown",xP),n.removeEventListener("pointerleave",Ac),n.removeEventListener("pointermove",Ac)}),window.removeEventListener("pointerup",Fa),window.removeEventListener("pointercancel",Fa),Yu.size>0&&(ul?(Wr.length>0&&xi.forEach((e,t)=>{const{body:n}=t;e>0&&(n.addEventListener("contextmenu",Fa),n.addEventListener("pointerleave",Ac),n.addEventListener("pointermove",Ac))}),window.addEventListener("pointerup",Fa),window.addEventListener("pointercancel",Fa)):xi.forEach((e,t)=>{const{body:n}=t;e>0&&(n.addEventListener("pointerdown",xP,{capture:!0}),n.addEventListener("pointermove",Ac))}))}function kp(e,t){Yu.forEach(n=>{const{setResizeHandlerState:r}=n,o=Wr.includes(n);r(e,o,t)})}function Dae(){const[e,t]=cl(0);return Fn(()=>t(n=>n+1),[])}function Be(e,t){if(!e)throw console.error(t),Error(t)}const G1=10;function da(e,t,n=G1){return e.toFixed(n)===t.toFixed(n)?0:e>t?1:-1}function Ko(e,t,n=G1){return da(e,t,n)===0}function lr(e,t,n){return da(e,t,n)===0}function Tae(e,t,n){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++){const o=e[r],i=t[r];if(!lr(o,i,n))return!1}return!0}function Ya({panelConstraints:e,panelIndex:t,size:n}){const r=e[t];Be(r!=null,`Panel constraints not found for index ${t}`);let{collapsedSize:o=0,collapsible:i,maxSize:s=100,minSize:a=0}=r;if(da(n,a)<0)if(i){const l=(o+a)/2;da(n,l)<0?n=o:n=a}else n=a;return n=Math.min(s,n),n=parseFloat(n.toFixed(G1)),n}function Jc({delta:e,initialLayout:t,panelConstraints:n,pivotIndices:r,prevLayout:o,trigger:i}){if(lr(e,0))return t;const s=[...t],[a,l]=r;Be(a!=null,"Invalid first pivot index"),Be(l!=null,"Invalid second pivot index");let c=0;if(i==="keyboard"){{const d=e<0?l:a,h=n[d];Be(h,`Panel constraints not found for index ${d}`);const{collapsedSize:f=0,collapsible:p,minSize:g=0}=h;if(p){const b=t[d];if(Be(b!=null,`Previous layout not found for panel index ${d}`),lr(b,f)){const v=g-b;da(v,Math.abs(e))>0&&(e=e<0?0-v:v)}}}{const d=e<0?a:l,h=n[d];Be(h,`No panel constraints found for index ${d}`);const{collapsedSize:f=0,collapsible:p,minSize:g=0}=h;if(p){const b=t[d];if(Be(b!=null,`Previous layout not found for panel index ${d}`),lr(b,g)){const v=b-f;da(v,Math.abs(e))>0&&(e=e<0?0-v:v)}}}}{const d=e<0?1:-1;let h=e<0?l:a,f=0;for(;;){const g=t[h];Be(g!=null,`Previous layout not found for panel index ${h}`);const v=Ya({panelConstraints:n,panelIndex:h,size:100})-g;if(f+=v,h+=d,h<0||h>=n.length)break}const p=Math.min(Math.abs(e),Math.abs(f));e=e<0?0-p:p}{let h=e<0?a:l;for(;h>=0&&h<n.length;){const f=Math.abs(e)-Math.abs(c),p=t[h];Be(p!=null,`Previous layout not found for panel index ${h}`);const g=p-f,b=Ya({panelConstraints:n,panelIndex:h,size:g});if(!lr(p,b)&&(c+=p-b,s[h]=b,c.toPrecision(3).localeCompare(Math.abs(e).toPrecision(3),void 0,{numeric:!0})>=0))break;e<0?h--:h++}}if(Tae(o,s))return o;{const d=e<0?l:a,h=t[d];Be(h!=null,`Previous layout not found for panel index ${d}`);const f=h+c,p=Ya({panelConstraints:n,panelIndex:d,size:f});if(s[d]=p,!lr(p,f)){let g=f-p,v=e<0?l:a;for(;v>=0&&v<n.length;){const x=s[v];Be(x!=null,`Previous layout not found for panel index ${v}`);const y=x+g,_=Ya({panelConstraints:n,panelIndex:v,size:y});if(lr(x,_)||(g-=_-x,s[v]=_),lr(g,0))break;e>0?v--:v++}}}const u=s.reduce((d,h)=>h+d,0);return lr(u,100)?s:o}function Iae({layout:e,panelsArray:t,pivotIndices:n}){let r=0,o=100,i=0,s=0;const a=n[0];Be(a!=null,"No pivot index found"),t.forEach((d,h)=>{const{constraints:f}=d,{maxSize:p=100,minSize:g=0}=f;h===a?(r=g,o=p):(i+=g,s+=p)});const l=Math.min(o,100-i),c=Math.max(r,100-s),u=e[a];return{valueMax:l,valueMin:c,valueNow:u}}function Ku(e,t=document){return Array.from(t.querySelectorAll(`[data-panel-resize-handle-id][data-panel-group-id="${e}"]`))}function B5(e,t,n=document){const o=Ku(e,n).findIndex(i=>i.getAttribute("data-panel-resize-handle-id")===t);return o??null}function V5(e,t,n){const r=B5(e,t,n);return r!=null?[r,r+1]:[-1,-1]}function H5(e,t=document){var n;if(t instanceof HTMLElement&&(t==null||(n=t.dataset)===null||n===void 0?void 0:n.panelGroupId)==e)return t;const r=t.querySelector(`[data-panel-group][data-panel-group-id="${e}"]`);return r||null}function am(e,t=document){const n=t.querySelector(`[data-panel-resize-handle-id="${e}"]`);return n||null}function Aae(e,t,n,r=document){var o,i,s,a;const l=am(t,r),c=Ku(e,r),u=l?c.indexOf(l):-1,d=(o=(i=n[u])===null||i===void 0?void 0:i.id)!==null&&o!==void 0?o:null,h=(s=(a=n[u+1])===null||a===void 0?void 0:a.id)!==null&&s!==void 0?s:null;return[d,h]}function Nae({committedValuesRef:e,eagerValuesRef:t,groupId:n,layout:r,panelDataArray:o,panelGroupElement:i,setLayout:s}){Hn({didWarnAboutMissingResizeHandle:!1}),Qs(()=>{if(!i)return;const a=Ku(n,i);for(let l=0;l<o.length-1;l++){const{valueMax:c,valueMin:u,valueNow:d}=Iae({layout:r,panelsArray:o,pivotIndices:[l,l+1]}),h=a[l];if(h!=null){const f=o[l];Be(f,`No panel data found for index "${l}"`),h.setAttribute("aria-controls",f.id),h.setAttribute("aria-valuemax",""+Math.round(c)),h.setAttribute("aria-valuemin",""+Math.round(u)),h.setAttribute("aria-valuenow",d!=null?""+Math.round(d):"")}}return()=>{a.forEach((l,c)=>{l.removeAttribute("aria-controls"),l.removeAttribute("aria-valuemax"),l.removeAttribute("aria-valuemin"),l.removeAttribute("aria-valuenow")})}},[n,r,o,i]),Xs(()=>{if(!i)return;const a=t.current;Be(a,"Eager values not found");const{panelDataArray:l}=a,c=H5(n,i);Be(c!=null,`No group found for id "${n}"`);const u=Ku(n,i);Be(u,`No resize handles found for group id "${n}"`);const d=u.map(h=>{const f=h.getAttribute("data-panel-resize-handle-id");Be(f,"Resize handle element has no handle id attribute");const[p,g]=Aae(n,f,l,i);if(p==null||g==null)return()=>{};const b=v=>{if(!v.defaultPrevented)switch(v.key){case"Enter":{v.preventDefault();const x=l.findIndex(y=>y.id===p);if(x>=0){const y=l[x];Be(y,`No panel data found for index ${x}`);const _=r[x],{collapsedSize:w=0,collapsible:C,minSize:R=0}=y.constraints;if(_!=null&&C){const k=Jc({delta:lr(_,w)?R-w:w-_,initialLayout:r,panelConstraints:l.map(D=>D.constraints),pivotIndices:V5(n,f,i),prevLayout:r,trigger:"keyboard"});r!==k&&s(k)}}break}}};return h.addEventListener("keydown",b),()=>{h.removeEventListener("keydown",b)}});return()=>{d.forEach(h=>h())}},[i,e,t,n,r,o,s])}function wP(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function W5(e,t){const n=e==="horizontal",{x:r,y:o}=im(t);return n?r:o}function jae(e,t,n,r,o){const i=n==="horizontal",s=am(t,o);Be(s,`No resize handle element found for id "${t}"`);const a=s.getAttribute("data-panel-group-id");Be(a,"Resize handle element has no group id attribute");let{initialCursorPosition:l}=r;const c=W5(n,e),u=H5(a,o);Be(u,`No group element found for id "${a}"`);const d=u.getBoundingClientRect(),h=i?d.width:d.height;return(c-l)/h*100}function Fae(e,t,n,r,o,i){if(I5(e)){const s=n==="horizontal";let a=0;e.shiftKey?a=100:o!=null?a=o:a=10;let l=0;switch(e.key){case"ArrowDown":l=s?0:a;break;case"ArrowLeft":l=s?-a:0;break;case"ArrowRight":l=s?a:0;break;case"ArrowUp":l=s?0:-a;break;case"End":l=100;break;case"Home":l=-100;break}return l}else return r==null?0:jae(e,t,n,r,i)}function Lae({panelDataArray:e}){const t=Array(e.length),n=e.map(i=>i.constraints);let r=0,o=100;for(let i=0;i<e.length;i++){const s=n[i];Be(s,`Panel constraints not found for index ${i}`);const{defaultSize:a}=s;a!=null&&(r++,t[i]=a,o-=a)}for(let i=0;i<e.length;i++){const s=n[i];Be(s,`Panel constraints not found for index ${i}`);const{defaultSize:a}=s;if(a!=null)continue;const l=e.length-r,c=o/l;r++,t[i]=c,o-=c}return t}function La(e,t,n){t.forEach((r,o)=>{const i=e[o];Be(i,`Panel data not found for index ${o}`);const{callbacks:s,constraints:a,id:l}=i,{collapsedSize:c=0,collapsible:u}=a,d=n[l];if(d==null||r!==d){n[l]=r;const{onCollapse:h,onExpand:f,onResize:p}=s;p&&p(r,d),u&&(h||f)&&(f&&(d==null||Ko(d,c))&&!Ko(r,c)&&f(),h&&(d==null||!Ko(d,c))&&Ko(r,c)&&h())}})}function Qf(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}function $ae({defaultSize:e,dragState:t,layout:n,panelData:r,panelIndex:o,precision:i=3}){const s=n[o];let a;return s==null?a=e!=null?e.toPrecision(i):"1":r.length===1?a="1":a=s.toPrecision(i),{flexBasis:0,flexGrow:a,flexShrink:1,overflow:"hidden",pointerEvents:t!==null?"none":void 0}}function zae(e,t=10){let n=null;return(...o)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{e(...o)},t)}}function SP(e){try{if(typeof localStorage<"u")e.getItem=t=>localStorage.getItem(t),e.setItem=(t,n)=>{localStorage.setItem(t,n)};else throw new Error("localStorage not supported in this environment")}catch(t){console.error(t),e.getItem=()=>null,e.setItem=()=>{}}}function U5(e){return`react-resizable-panels:${e}`}function q5(e){return e.map(t=>{const{constraints:n,id:r,idIsFromProps:o,order:i}=t;return o?r:i?`${i}:${JSON.stringify(n)}`:JSON.stringify(n)}).sort((t,n)=>t.localeCompare(n)).join(",")}function G5(e,t){try{const n=U5(e),r=t.getItem(n);if(r){const o=JSON.parse(r);if(typeof o=="object"&&o!=null)return o}}catch{}return null}function Bae(e,t,n){var r,o;const i=(r=G5(e,n))!==null&&r!==void 0?r:{},s=q5(t);return(o=i[s])!==null&&o!==void 0?o:null}function Vae(e,t,n,r,o){var i;const s=U5(e),a=q5(t),l=(i=G5(e,o))!==null&&i!==void 0?i:{};l[a]={expandToSizes:Object.fromEntries(n.entries()),layout:r};try{o.setItem(s,JSON.stringify(l))}catch(c){console.error(c)}}function CP({layout:e,panelConstraints:t}){const n=[...e],r=n.reduce((i,s)=>i+s,0);if(n.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${n.map(i=>`${i}%`).join(", ")}`);if(!lr(r,100)&&n.length>0)for(let i=0;i<t.length;i++){const s=n[i];Be(s!=null,`No layout data found for index ${i}`);const a=100/r*s;n[i]=a}let o=0;for(let i=0;i<t.length;i++){const s=n[i];Be(s!=null,`No layout data found for index ${i}`);const a=Ya({panelConstraints:t,panelIndex:i,size:s});s!=a&&(o+=s-a,n[i]=a)}if(!lr(o,0))for(let i=0;i<t.length;i++){const s=n[i];Be(s!=null,`No layout data found for index ${i}`);const a=s+o,l=Ya({panelConstraints:t,panelIndex:i,size:a});if(s!==l&&(o-=l-s,n[i]=l,lr(o,0)))break}return n}const Hae=100,Zc={getItem:e=>(SP(Zc),Zc.getItem(e)),setItem:(e,t)=>{SP(Zc),Zc.setItem(e,t)}},_P={};function Y5({autoSaveId:e=null,children:t,className:n="",direction:r,forwardedRef:o,id:i=null,onLayout:s=null,keyboardResizeBy:a=null,storage:l=Zc,style:c,tagName:u="div",...d}){const h=W1(i),f=Hn(null),[p,g]=cl(null),[b,v]=cl([]),x=Dae(),y=Hn({}),_=Hn(new Map),w=Hn(0),C=Hn({autoSaveId:e,direction:r,dragState:p,id:h,keyboardResizeBy:a,onLayout:s,storage:l}),R=Hn({layout:b,panelDataArray:[],panelDataArrayChanged:!1});Hn({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),O5(o,()=>({getId:()=>C.current.id,getLayout:()=>{const{layout:P}=R.current;return P},setLayout:P=>{const{onLayout:U}=C.current,{layout:q,panelDataArray:K}=R.current,H=CP({layout:P,panelConstraints:K.map(V=>V.constraints)});wP(q,H)||(v(H),R.current.layout=H,U&&U(H),La(K,H,y.current))}}),[]),Qs(()=>{C.current.autoSaveId=e,C.current.direction=r,C.current.dragState=p,C.current.id=h,C.current.onLayout=s,C.current.storage=l}),Nae({committedValuesRef:C,eagerValuesRef:R,groupId:h,layout:b,panelDataArray:R.current.panelDataArray,setLayout:v,panelGroupElement:f.current}),Xs(()=>{const{panelDataArray:P}=R.current;if(e){if(b.length===0||b.length!==P.length)return;let U=_P[e];U==null&&(U=zae(Vae,Hae),_P[e]=U);const q=[...P],K=new Map(_.current);U(e,q,K,b,l)}},[e,b,l]),Xs(()=>{});const k=Fn(P=>{const{onLayout:U}=C.current,{layout:q,panelDataArray:K}=R.current;if(P.constraints.collapsible){const H=K.map(ne=>ne.constraints),{collapsedSize:V=0,panelSize:Q,pivotIndices:Z}=hs(K,P,q);if(Be(Q!=null,`Panel size not found for panel "${P.id}"`),!Ko(Q,V)){_.current.set(P.id,Q);const J=Ba(K,P)===K.length-1?Q-V:V-Q,oe=Jc({delta:J,initialLayout:q,panelConstraints:H,pivotIndices:Z,prevLayout:q,trigger:"imperative-api"});Qf(q,oe)||(v(oe),R.current.layout=oe,U&&U(oe),La(K,oe,y.current))}}},[]),D=Fn((P,U)=>{const{onLayout:q}=C.current,{layout:K,panelDataArray:H}=R.current;if(P.constraints.collapsible){const V=H.map(ee=>ee.constraints),{collapsedSize:Q=0,panelSize:Z=0,minSize:ne=0,pivotIndices:J}=hs(H,P,K),oe=U??ne;if(Ko(Z,Q)){const ee=_.current.get(P.id),ue=ee!=null&&ee>=oe?ee:oe,ye=Ba(H,P)===H.length-1?Z-ue:ue-Z,he=Jc({delta:ye,initialLayout:K,panelConstraints:V,pivotIndices:J,prevLayout:K,trigger:"imperative-api"});Qf(K,he)||(v(he),R.current.layout=he,q&&q(he),La(H,he,y.current))}}},[]),I=Fn(P=>{const{layout:U,panelDataArray:q}=R.current,{panelSize:K}=hs(q,P,U);return Be(K!=null,`Panel size not found for panel "${P.id}"`),K},[]),T=Fn((P,U)=>{const{panelDataArray:q}=R.current,K=Ba(q,P);return $ae({defaultSize:U,dragState:p,layout:b,panelData:q,panelIndex:K})},[p,b]),N=Fn(P=>{const{layout:U,panelDataArray:q}=R.current,{collapsedSize:K=0,collapsible:H,panelSize:V}=hs(q,P,U);return Be(V!=null,`Panel size not found for panel "${P.id}"`),H===!0&&Ko(V,K)},[]),G=Fn(P=>{const{layout:U,panelDataArray:q}=R.current,{collapsedSize:K=0,collapsible:H,panelSize:V}=hs(q,P,U);return Be(V!=null,`Panel size not found for panel "${P.id}"`),!H||da(V,K)>0},[]),z=Fn(P=>{const{panelDataArray:U}=R.current;U.push(P),U.sort((q,K)=>{const H=q.order,V=K.order;return H==null&&V==null?0:H==null?-1:V==null?1:H-V}),R.current.panelDataArrayChanged=!0,x()},[x]);Qs(()=>{if(R.current.panelDataArrayChanged){R.current.panelDataArrayChanged=!1;const{autoSaveId:P,onLayout:U,storage:q}=C.current,{layout:K,panelDataArray:H}=R.current;let V=null;if(P){const Z=Bae(P,H,q);Z&&(_.current=new Map(Object.entries(Z.expandToSizes)),V=Z.layout)}V==null&&(V=Lae({panelDataArray:H}));const Q=CP({layout:V,panelConstraints:H.map(Z=>Z.constraints)});wP(K,Q)||(v(Q),R.current.layout=Q,U&&U(Q),La(H,Q,y.current))}}),Qs(()=>{const P=R.current;return()=>{P.layout=[]}},[]);const O=Fn(P=>{let U=!1;const q=f.current;return q&&window.getComputedStyle(q,null).getPropertyValue("direction")==="rtl"&&(U=!0),function(H){H.preventDefault();const V=f.current;if(!V)return()=>null;const{direction:Q,dragState:Z,id:ne,keyboardResizeBy:J,onLayout:oe}=C.current,{layout:ee,panelDataArray:ue}=R.current,{initialLayout:de}=Z??{},ye=V5(ne,P,V);let he=Fae(H,P,Q,Z,J,V);const me=Q==="horizontal";me&&U&&(he=-he);const je=ue.map(Ue=>Ue.constraints),et=Jc({delta:he,initialLayout:de??ee,panelConstraints:je,pivotIndices:ye,prevLayout:ee,trigger:I5(H)?"keyboard":"mouse-or-touch"}),Bt=!Qf(ee,et);(A5(H)||N5(H))&&w.current!=he&&(w.current=he,!Bt&&he!==0?me?n0(P,he<0?F5:L5):n0(P,he<0?$5:z5):n0(P,0)),Bt&&(v(et),R.current.layout=et,oe&&oe(et),La(ue,et,y.current))}},[]),A=Fn((P,U)=>{const{onLayout:q}=C.current,{layout:K,panelDataArray:H}=R.current,V=H.map(ee=>ee.constraints),{panelSize:Q,pivotIndices:Z}=hs(H,P,K);Be(Q!=null,`Panel size not found for panel "${P.id}"`);const J=Ba(H,P)===H.length-1?Q-U:U-Q,oe=Jc({delta:J,initialLayout:K,panelConstraints:V,pivotIndices:Z,prevLayout:K,trigger:"imperative-api"});Qf(K,oe)||(v(oe),R.current.layout=oe,q&&q(oe),La(H,oe,y.current))},[]),L=Fn((P,U)=>{const{layout:q,panelDataArray:K}=R.current,{collapsedSize:H=0,collapsible:V}=U,{collapsedSize:Q=0,collapsible:Z,maxSize:ne=100,minSize:J=0}=P.constraints,{panelSize:oe}=hs(K,P,q);oe!=null&&(V&&Z&&Ko(oe,H)?Ko(H,Q)||A(P,Q):oe<J?A(P,J):oe>ne&&A(P,ne))},[A]),j=Fn((P,U)=>{const{direction:q}=C.current,{layout:K}=R.current;if(!f.current)return;const H=am(P,f.current);Be(H,`Drag handle element not found for id "${P}"`);const V=W5(q,U);g({dragHandleId:P,dragHandleRect:H.getBoundingClientRect(),initialCursorPosition:V,initialLayout:K})},[]),B=Fn(()=>{g(null)},[]),M=Fn(P=>{const{panelDataArray:U}=R.current,q=Ba(U,P);q>=0&&(U.splice(q,1),delete y.current[P.id],R.current.panelDataArrayChanged=!0,x())},[x]),W=bae(()=>({collapsePanel:k,direction:r,dragState:p,expandPanel:D,getPanelSize:I,getPanelStyle:T,groupId:h,isPanelCollapsed:N,isPanelExpanded:G,reevaluatePanelConstraints:L,registerPanel:z,registerResizeHandle:O,resizePanel:A,startDragging:j,stopDragging:B,unregisterPanel:M,panelGroupElement:f.current}),[k,p,r,D,I,T,h,N,G,L,z,O,A,j,B,M]),F={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return Kl(om.Provider,{value:W},Kl(u,{...d,children:t,className:n,id:i,ref:f,style:{...F,...c},"data-panel-group":"","data-panel-group-direction":r,"data-panel-group-id":h}))}const K5=M5((e,t)=>Kl(Y5,{...e,forwardedRef:t}));Y5.displayName="PanelGroup";K5.displayName="forwardRef(PanelGroup)";function Ba(e,t){return e.findIndex(n=>n===t||n.id===t.id)}function hs(e,t,n){const r=Ba(e,t),i=r===e.length-1?[r-1,r]:[r,r+1],s=n[r];return{...t.constraints,panelSize:s,pivotIndices:i}}function Wae({disabled:e,handleId:t,resizeHandler:n,panelGroupElement:r}){Xs(()=>{if(e||n==null||r==null)return;const o=am(t,r);if(o==null)return;const i=s=>{if(!s.defaultPrevented)switch(s.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{s.preventDefault(),n(s);break}case"F6":{s.preventDefault();const a=o.getAttribute("data-panel-group-id");Be(a,`No group element found for id "${a}"`);const l=Ku(a,r),c=B5(a,t,r);Be(c!==null,`No resize element found for id "${t}"`);const u=s.shiftKey?c>0?c-1:l.length-1:c+1<l.length?c+1:0;l[u].focus();break}}};return o.addEventListener("keydown",i),()=>{o.removeEventListener("keydown",i)}},[r,e,t,n])}function Y1({children:e=null,className:t="",disabled:n=!1,hitAreaMargins:r,id:o,onBlur:i,onDragging:s,onFocus:a,style:l={},tabIndex:c=0,tagName:u="div",...d}){var h,f;const p=Hn(null),g=Hn({onDragging:s});Xs(()=>{g.current.onDragging=s});const b=k5(om);if(b===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:v,groupId:x,registerResizeHandle:y,startDragging:_,stopDragging:w,panelGroupElement:C}=b,R=W1(o),[k,D]=cl("inactive"),[I,T]=cl(!1),[N,G]=cl(null),z=Hn({state:k});Qs(()=>{z.current.state=k}),Xs(()=>{if(n)G(null);else{const j=y(R);G(()=>j)}},[n,R,y]);const O=(h=r==null?void 0:r.coarse)!==null&&h!==void 0?h:15,A=(f=r==null?void 0:r.fine)!==null&&f!==void 0?f:5;return Xs(()=>{if(n||N==null)return;const j=p.current;return Be(j,"Element ref not attached"),Oae(R,j,v,{coarse:O,fine:A},(M,W,F)=>{if(W)switch(M){case"down":{D("drag"),Be(F,'Expected event to be defined for "down" action'),_(R,F);const{onDragging:P}=g.current;P&&P(!0);break}case"move":{const{state:P}=z.current;P!=="drag"&&D("hover"),Be(F,'Expected event to be defined for "move" action'),N(F);break}case"up":{D("hover"),w();const{onDragging:P}=g.current;P&&P(!1);break}}else D("inactive")})},[O,v,n,A,y,R,N,_,w]),Wae({disabled:n,handleId:R,resizeHandler:N,panelGroupElement:C}),Kl(u,{...d,children:e,className:t,id:o,onBlur:()=>{T(!1),i==null||i()},onFocus:()=>{T(!0),a==null||a()},ref:p,role:"separator",style:{...{touchAction:"none",userSelect:"none"},...l},tabIndex:c,"data-panel-group-direction":v,"data-panel-group-id":x,"data-resize-handle":"","data-resize-handle-active":k==="drag"?"pointer":I?"keyboard":void 0,"data-resize-handle-state":k,"data-panel-resize-handle-enabled":!n,"data-panel-resize-handle-id":R})}Y1.displayName="PanelResizeHandle";const X5=({className:e,...t})=>m.jsx(K5,{className:ie("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",e),...t}),My=T5,Uae=({withHandle:e,className:t,...n})=>m.jsx(Y1,{className:ie("relative flex w-px items-center justify-center bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90",t),...n,children:e&&m.jsx("div",{className:"z-10 flex h-4 w-3 items-center justify-center rounded-sm border bg-border",children:m.jsx(Lz,{className:"h-2.5 w-2.5"})})}),qae=({withHandle:e,className:t,onTabClick:n,open:r,...o})=>m.jsx(Y1,{className:ie("relative flex w-px items-start justify-end bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90",{"justify-start":r},t),...o,children:e&&!r&&m.jsx("div",{className:ie("z-50 flex items-center justify-start",{"border-l":r}),children:m.jsx(Yt,{variant:"secondary",className:ie("h-7 p-0.5",{"rounded-bl-none rounded-br-md rounded-tl-none rounded-tr-md":r,"mt-0 rounded-bl-md rounded-br-none rounded-tl-md rounded-tr-none":!r}),onClick:()=>n(!r),children:r?m.jsx(tw,{className:"size-4"}):m.jsx(Kk,{className:"size-4"})})})});var K1="Dialog",[Q5,J5]=Kt(K1),[Gae,Kr]=Q5(K1),Z5=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:s=!0}=e,a=S.useRef(null),l=S.useRef(null),[c=!1,u]=yn({prop:r,defaultProp:o,onChange:i});return m.jsx(Gae,{scope:t,triggerRef:a,contentRef:l,contentId:Ut(),titleId:Ut(),descriptionId:Ut(),open:c,onOpenChange:u,onOpenToggle:S.useCallback(()=>u(d=>!d),[u]),modal:s,children:n})};Z5.displayName=K1;var ej="DialogTrigger",tj=S.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Kr(ej,n),i=Oe(t,o.triggerRef);return m.jsx(pe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":J1(o.open),...r,ref:i,onClick:ae(e.onClick,o.onOpenToggle)})});tj.displayName=ej;var X1="DialogPortal",[Yae,nj]=Q5(X1,{forceMount:void 0}),rj=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,i=Kr(X1,t);return m.jsx(Yae,{scope:t,forceMount:n,children:S.Children.map(r,s=>m.jsx(qt,{present:n||i.open,children:m.jsx(Rd,{asChild:!0,container:o,children:s})}))})};rj.displayName=X1;var Op="DialogOverlay",oj=S.forwardRef((e,t)=>{const n=nj(Op,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=Kr(Op,e.__scopeDialog);return i.modal?m.jsx(qt,{present:r||i.open,children:m.jsx(Kae,{...o,ref:t})}):null});oj.displayName=Op;var Kae=S.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Kr(Op,n);return m.jsx(kd,{as:ri,allowPinchZoom:!0,shards:[o.contentRef],children:m.jsx(pe.div,{"data-state":J1(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),fa="DialogContent",ij=S.forwardRef((e,t)=>{const n=nj(fa,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=Kr(fa,e.__scopeDialog);return m.jsx(qt,{present:r||i.open,children:i.modal?m.jsx(Xae,{...o,ref:t}):m.jsx(Qae,{...o,ref:t})})});ij.displayName=fa;var Xae=S.forwardRef((e,t)=>{const n=Kr(fa,e.__scopeDialog),r=S.useRef(null),o=Oe(t,n.contentRef,r);return S.useEffect(()=>{const i=r.current;if(i)return Lg(i)},[]),m.jsx(sj,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ae(e.onCloseAutoFocus,i=>{var s;i.preventDefault(),(s=n.triggerRef.current)==null||s.focus()}),onPointerDownOutside:ae(e.onPointerDownOutside,i=>{const s=i.detail.originalEvent,a=s.button===0&&s.ctrlKey===!0;(s.button===2||a)&&i.preventDefault()}),onFocusOutside:ae(e.onFocusOutside,i=>i.preventDefault())})}),Qae=S.forwardRef((e,t)=>{const n=Kr(fa,e.__scopeDialog),r=S.useRef(!1),o=S.useRef(!1);return m.jsx(sj,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var s,a;(s=e.onCloseAutoFocus)==null||s.call(e,i),i.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),i.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:i=>{var l,c;(l=e.onInteractOutside)==null||l.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const s=i.target;((c=n.triggerRef.current)==null?void 0:c.contains(s))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}})}),sj=S.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,...s}=e,a=Kr(fa,n),l=S.useRef(null),c=Oe(t,l);return jg(),m.jsxs(m.Fragment,{children:[m.jsx(Md,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i,children:m.jsx(wa,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":J1(a.open),...s,ref:c,onDismiss:()=>a.onOpenChange(!1)})}),m.jsxs(m.Fragment,{children:[m.jsx(Zae,{titleId:a.titleId}),m.jsx(tle,{contentRef:l,descriptionId:a.descriptionId})]})]})}),Q1="DialogTitle",aj=S.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Kr(Q1,n);return m.jsx(pe.h2,{id:o.titleId,...r,ref:t})});aj.displayName=Q1;var lj="DialogDescription",cj=S.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Kr(lj,n);return m.jsx(pe.p,{id:o.descriptionId,...r,ref:t})});cj.displayName=lj;var uj="DialogClose",dj=S.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Kr(uj,n);return m.jsx(pe.button,{type:"button",...r,ref:t,onClick:ae(e.onClick,()=>o.onOpenChange(!1))})});dj.displayName=uj;function J1(e){return e?"open":"closed"}var fj="DialogTitleWarning",[Jae,hj]=p$(fj,{contentName:fa,titleName:Q1,docsSlug:"dialog"}),Zae=({titleId:e})=>{const t=hj(fj),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
320
-
321
- If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
322
-
323
- For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return S.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},ele="DialogDescriptionWarning",tle=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${hj(ele).contentName}}.`;return S.useEffect(()=>{var i;const o=(i=e.current)==null?void 0:i.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},Z1=Z5,pj=tj,eS=rj,lm=oj,cm=ij,tS=aj,nS=cj,rS=dj,gj="AlertDialog",[nle,yve]=Kt(gj,[J5]),ci=J5(),mj=e=>{const{__scopeAlertDialog:t,...n}=e,r=ci(t);return m.jsx(Z1,{...r,...n,modal:!0})};mj.displayName=gj;var rle="AlertDialogTrigger",ole=S.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=ci(n);return m.jsx(pj,{...o,...r,ref:t})});ole.displayName=rle;var ile="AlertDialogPortal",bj=e=>{const{__scopeAlertDialog:t,...n}=e,r=ci(t);return m.jsx(eS,{...r,...n})};bj.displayName=ile;var sle="AlertDialogOverlay",vj=S.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=ci(n);return m.jsx(lm,{...o,...r,ref:t})});vj.displayName=sle;var dl="AlertDialogContent",[ale,lle]=nle(dl),yj=S.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...o}=e,i=ci(n),s=S.useRef(null),a=Oe(t,s),l=S.useRef(null);return m.jsx(Jae,{contentName:dl,titleName:xj,docsSlug:"alert-dialog",children:m.jsx(ale,{scope:n,cancelRef:l,children:m.jsxs(cm,{role:"alertdialog",...i,...o,ref:a,onOpenAutoFocus:ae(o.onOpenAutoFocus,c=>{var u;c.preventDefault(),(u=l.current)==null||u.focus({preventScroll:!0})}),onPointerDownOutside:c=>c.preventDefault(),onInteractOutside:c=>c.preventDefault(),children:[m.jsx(Cx,{children:r}),m.jsx(ule,{contentRef:s})]})})})});yj.displayName=dl;var xj="AlertDialogTitle",wj=S.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=ci(n);return m.jsx(tS,{...o,...r,ref:t})});wj.displayName=xj;var Sj="AlertDialogDescription",Cj=S.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=ci(n);return m.jsx(nS,{...o,...r,ref:t})});Cj.displayName=Sj;var cle="AlertDialogAction",_j=S.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=ci(n);return m.jsx(rS,{...o,...r,ref:t})});_j.displayName=cle;var Ej="AlertDialogCancel",Rj=S.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:o}=lle(Ej,n),i=ci(n),s=Oe(t,o);return m.jsx(rS,{...i,...r,ref:s})});Rj.displayName=Ej;var ule=({contentRef:e})=>{const t=`\`${dl}\` requires a description for the component to be accessible for screen reader users.
324
-
325
- You can add a description to the \`${dl}\` by passing a \`${Sj}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
326
-
327
- Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${dl}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
328
-
329
- For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return S.useEffect(()=>{var r;document.getElementById((r=e.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},dle=mj,fle=bj,Pj=vj,Mj=yj,kj=_j,Oj=Rj,Dj=wj,Tj=Cj;const hle=dle,ple=fle,Ij=S.forwardRef(({className:e,...t},n)=>m.jsx(Pj,{className:ie("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:n}));Ij.displayName=Pj.displayName;const Aj=S.forwardRef(({className:e,...t},n)=>m.jsx(ple,{children:m.jsxs(Ki,{children:[m.jsx(Ij,{}),m.jsx(Mj,{ref:n,className:ie("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...t})]})}));Aj.displayName=Mj.displayName;const Nj=({className:e,...t})=>m.jsx("div",{className:ie("flex flex-col space-y-2 text-center sm:text-left",e),...t});Nj.displayName="AlertDialogHeader";const jj=({className:e,...t})=>m.jsx("div",{className:ie("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});jj.displayName="AlertDialogFooter";const Fj=S.forwardRef(({className:e,...t},n)=>m.jsx(Dj,{ref:n,className:ie("text-lg font-semibold",e),...t}));Fj.displayName=Dj.displayName;const Lj=S.forwardRef(({className:e,...t},n)=>m.jsx(Tj,{ref:n,className:ie("text-sm text-muted-foreground",e),...t}));Lj.displayName=Tj.displayName;const $j=S.forwardRef(({className:e,...t},n)=>m.jsx(kj,{ref:n,className:ie(Hu(),e),...t}));$j.displayName=kj.displayName;const zj=S.forwardRef(({className:e,...t},n)=>m.jsx(Oj,{ref:n,className:ie(Hu({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));zj.displayName=Oj.displayName;function gle({open:e,setOpen:t}){const n=se(i=>i.selectedSheetId),{deleteSheet:r}=zt();function o(){n&&(r(n),t(!1))}return m.jsx(hle,{open:e,onOpenChange:t,children:m.jsxs(Aj,{children:[m.jsxs(Nj,{children:[m.jsx(Fj,{children:"Delete Sheet"}),m.jsx(Lj,{children:"Are you sure you want to delete this sheet along with all its cards? This action cannot be undone."})]}),m.jsxs(jj,{children:[m.jsx(zj,{children:"Cancel"}),m.jsx($j,{onClick:o,children:"Delete"})]})]})})}var oS="Collapsible",[mle,Bj]=Kt(oS),[ble,iS]=mle(oS),Vj=S.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:o,disabled:i,onOpenChange:s,...a}=e,[l=!1,c]=yn({prop:r,defaultProp:o,onChange:s});return m.jsx(ble,{scope:n,disabled:i,contentId:Ut(),open:l,onOpenToggle:S.useCallback(()=>c(u=>!u),[c]),children:m.jsx(pe.div,{"data-state":cS(l),"data-disabled":i?"":void 0,...a,ref:t})})});Vj.displayName=oS;var Hj="CollapsibleTrigger",sS=S.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,o=iS(Hj,n);return m.jsx(pe.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":cS(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...r,ref:t,onClick:ae(e.onClick,o.onOpenToggle)})});sS.displayName=Hj;var aS="CollapsibleContent",lS=S.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=iS(aS,e.__scopeCollapsible);return m.jsx(qt,{present:n||o.open,children:({present:i})=>m.jsx(vle,{...r,ref:t,present:i})})});lS.displayName=aS;var vle=S.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:o,...i}=e,s=iS(aS,n),[a,l]=S.useState(r),c=S.useRef(null),u=Oe(t,c),d=S.useRef(0),h=d.current,f=S.useRef(0),p=f.current,g=s.open||a,b=S.useRef(g),v=S.useRef(void 0);return S.useEffect(()=>{const x=requestAnimationFrame(()=>b.current=!1);return()=>cancelAnimationFrame(x)},[]),rn(()=>{const x=c.current;if(x){v.current=v.current||{transitionDuration:x.style.transitionDuration,animationName:x.style.animationName},x.style.transitionDuration="0s",x.style.animationName="none";const y=x.getBoundingClientRect();d.current=y.height,f.current=y.width,b.current||(x.style.transitionDuration=v.current.transitionDuration,x.style.animationName=v.current.animationName),l(r)}},[s.open,r]),m.jsx(pe.div,{"data-state":cS(s.open),"data-disabled":s.disabled?"":void 0,id:s.contentId,hidden:!g,...i,ref:u,style:{"--radix-collapsible-content-height":h?`${h}px`:void 0,"--radix-collapsible-content-width":p?`${p}px`:void 0,...e.style},children:g&&o})});function cS(e){return e?"open":"closed"}var Wj=Vj,yle=sS,xle=lS;const wle=Wj,Sle=sS,Cle=lS;function _le(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Ele=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Rle=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Ple={};function EP(e,t){return(Ple.jsx?Rle:Ele).test(e)}const Mle=/[ \t\n\f\r]/g;function kle(e){return typeof e=="object"?e.type==="text"?RP(e.value):!1:RP(e)}function RP(e){return e.replace(Mle,"")===""}class Vd{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Vd.prototype.normal={};Vd.prototype.property={};Vd.prototype.space=void 0;function Uj(e,t){const n={},r={};for(const o of e)Object.assign(n,o.property),Object.assign(r,o.normal);return new Vd(n,r,t)}function ky(e){return e.toLowerCase()}class Qn{constructor(t,n){this.attribute=n,this.property=t}}Qn.prototype.attribute="";Qn.prototype.booleanish=!1;Qn.prototype.boolean=!1;Qn.prototype.commaOrSpaceSeparated=!1;Qn.prototype.commaSeparated=!1;Qn.prototype.defined=!1;Qn.prototype.mustUseProperty=!1;Qn.prototype.number=!1;Qn.prototype.overloadedBoolean=!1;Qn.prototype.property="";Qn.prototype.spaceSeparated=!1;Qn.prototype.space=void 0;let Ole=0;const Ie=Sa(),Vt=Sa(),qj=Sa(),ce=Sa(),vt=Sa(),fl=Sa(),ir=Sa();function Sa(){return 2**++Ole}const Oy=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ie,booleanish:Vt,commaOrSpaceSeparated:ir,commaSeparated:fl,number:ce,overloadedBoolean:qj,spaceSeparated:vt},Symbol.toStringTag,{value:"Module"})),r0=Object.keys(Oy);class uS extends Qn{constructor(t,n,r,o){let i=-1;if(super(t,n),PP(this,"space",o),typeof r=="number")for(;++i<r0.length;){const s=r0[i];PP(this,r0[i],(r&Oy[s])===Oy[s])}}}uS.prototype.defined=!0;function PP(e,t,n){n&&(e[t]=n)}function hc(e){const t={},n={};for(const[r,o]of Object.entries(e.properties)){const i=new uS(r,e.transform(e.attributes||{},r),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),t[r]=i,n[ky(r)]=r,n[ky(i.attribute)]=r}return new Vd(t,n,e.space)}const Gj=hc({properties:{ariaActiveDescendant:null,ariaAtomic:Vt,ariaAutoComplete:null,ariaBusy:Vt,ariaChecked:Vt,ariaColCount:ce,ariaColIndex:ce,ariaColSpan:ce,ariaControls:vt,ariaCurrent:null,ariaDescribedBy:vt,ariaDetails:null,ariaDisabled:Vt,ariaDropEffect:vt,ariaErrorMessage:null,ariaExpanded:Vt,ariaFlowTo:vt,ariaGrabbed:Vt,ariaHasPopup:null,ariaHidden:Vt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:vt,ariaLevel:ce,ariaLive:null,ariaModal:Vt,ariaMultiLine:Vt,ariaMultiSelectable:Vt,ariaOrientation:null,ariaOwns:vt,ariaPlaceholder:null,ariaPosInSet:ce,ariaPressed:Vt,ariaReadOnly:Vt,ariaRelevant:null,ariaRequired:Vt,ariaRoleDescription:vt,ariaRowCount:ce,ariaRowIndex:ce,ariaRowSpan:ce,ariaSelected:Vt,ariaSetSize:ce,ariaSort:null,ariaValueMax:ce,ariaValueMin:ce,ariaValueNow:ce,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Yj(e,t){return t in e?e[t]:t}function Kj(e,t){return Yj(e,t.toLowerCase())}const Dle=hc({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:fl,acceptCharset:vt,accessKey:vt,action:null,allow:null,allowFullScreen:Ie,allowPaymentRequest:Ie,allowUserMedia:Ie,alt:null,as:null,async:Ie,autoCapitalize:null,autoComplete:vt,autoFocus:Ie,autoPlay:Ie,blocking:vt,capture:null,charSet:null,checked:Ie,cite:null,className:vt,cols:ce,colSpan:null,content:null,contentEditable:Vt,controls:Ie,controlsList:vt,coords:ce|fl,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ie,defer:Ie,dir:null,dirName:null,disabled:Ie,download:qj,draggable:Vt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ie,formTarget:null,headers:vt,height:ce,hidden:Ie,high:ce,href:null,hrefLang:null,htmlFor:vt,httpEquiv:vt,id:null,imageSizes:null,imageSrcSet:null,inert:Ie,inputMode:null,integrity:null,is:null,isMap:Ie,itemId:null,itemProp:vt,itemRef:vt,itemScope:Ie,itemType:vt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ie,low:ce,manifest:null,max:null,maxLength:ce,media:null,method:null,min:null,minLength:ce,multiple:Ie,muted:Ie,name:null,nonce:null,noModule:Ie,noValidate:Ie,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Ie,optimum:ce,pattern:null,ping:vt,placeholder:null,playsInline:Ie,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ie,referrerPolicy:null,rel:vt,required:Ie,reversed:Ie,rows:ce,rowSpan:ce,sandbox:vt,scope:null,scoped:Ie,seamless:Ie,selected:Ie,shadowRootClonable:Ie,shadowRootDelegatesFocus:Ie,shadowRootMode:null,shape:null,size:ce,sizes:null,slot:null,span:ce,spellCheck:Vt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ce,step:null,style:null,tabIndex:ce,target:null,title:null,translate:null,type:null,typeMustMatch:Ie,useMap:null,value:Vt,width:ce,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:vt,axis:null,background:null,bgColor:null,border:ce,borderColor:null,bottomMargin:ce,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ie,declare:Ie,event:null,face:null,frame:null,frameBorder:null,hSpace:ce,leftMargin:ce,link:null,longDesc:null,lowSrc:null,marginHeight:ce,marginWidth:ce,noResize:Ie,noHref:Ie,noShade:Ie,noWrap:Ie,object:null,profile:null,prompt:null,rev:null,rightMargin:ce,rules:null,scheme:null,scrolling:Vt,standby:null,summary:null,text:null,topMargin:ce,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ce,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Ie,disableRemotePlayback:Ie,prefix:null,property:null,results:ce,security:null,unselectable:null},space:"html",transform:Kj}),Tle=hc({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:ir,accentHeight:ce,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ce,amplitude:ce,arabicForm:null,ascent:ce,attributeName:null,attributeType:null,azimuth:ce,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ce,by:null,calcMode:null,capHeight:ce,className:vt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:ce,diffuseConstant:ce,direction:null,display:null,dur:null,divisor:ce,dominantBaseline:null,download:Ie,dx:null,dy:null,edgeMode:null,editable:null,elevation:ce,enableBackground:null,end:null,event:null,exponent:ce,externalResourcesRequired:null,fill:null,fillOpacity:ce,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:fl,g2:fl,glyphName:fl,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ce,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ce,horizOriginX:ce,horizOriginY:ce,id:null,ideographic:ce,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ce,k:ce,k1:ce,k2:ce,k3:ce,k4:ce,kernelMatrix:ir,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ce,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:ce,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:ce,overlineThickness:ce,paintOrder:null,panose1:null,path:null,pathLength:ce,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:vt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ce,pointsAtY:ce,pointsAtZ:ce,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ir,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ir,rev:ir,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ir,requiredFeatures:ir,requiredFonts:ir,requiredFormats:ir,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:ce,specularExponent:ce,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ce,strikethroughThickness:ce,string:null,stroke:null,strokeDashArray:ir,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ce,strokeOpacity:ce,strokeWidth:null,style:null,surfaceScale:ce,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ir,tabIndex:ce,tableValues:null,target:null,targetX:ce,targetY:ce,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ir,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ce,underlineThickness:ce,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ce,values:null,vAlphabetic:ce,vMathematical:ce,vectorEffect:null,vHanging:ce,vIdeographic:ce,version:null,vertAdvY:ce,vertOriginX:ce,vertOriginY:ce,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ce,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Yj}),Xj=hc({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),Qj=hc({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Kj}),Jj=hc({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),Ile={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},Ale=/[A-Z]/g,MP=/-[a-z]/g,Nle=/^data[-\w.:]+$/i;function jle(e,t){const n=ky(t);let r=t,o=Qn;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Nle.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(MP,Lle);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!MP.test(i)){let s=i.replace(Ale,Fle);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}o=uS}return new o(r,t)}function Fle(e){return"-"+e.toLowerCase()}function Lle(e){return e.charAt(1).toUpperCase()}const $le=Uj([Gj,Dle,Xj,Qj,Jj],"html"),dS=Uj([Gj,Tle,Xj,Qj,Jj],"svg");function zle(e){return e.join(" ").trim()}var fS={},kP=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,Ble=/\n/g,Vle=/^\s*/,Hle=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,Wle=/^:\s*/,Ule=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,qle=/^[;\s]*/,Gle=/^\s+|\s+$/g,Yle=`
330
- `,OP="/",DP="*",Ss="",Kle="comment",Xle="declaration",Qle=function(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function o(p){var g=p.match(Ble);g&&(n+=g.length);var b=p.lastIndexOf(Yle);r=~b?p.length-b:r+p.length}function i(){var p={line:n,column:r};return function(g){return g.position=new s(p),c(),g}}function s(p){this.start=p,this.end={line:n,column:r},this.source=t.source}s.prototype.content=e;function a(p){var g=new Error(t.source+":"+n+":"+r+": "+p);if(g.reason=p,g.filename=t.source,g.line=n,g.column=r,g.source=e,!t.silent)throw g}function l(p){var g=p.exec(e);if(g){var b=g[0];return o(b),e=e.slice(b.length),g}}function c(){l(Vle)}function u(p){var g;for(p=p||[];g=d();)g!==!1&&p.push(g);return p}function d(){var p=i();if(!(OP!=e.charAt(0)||DP!=e.charAt(1))){for(var g=2;Ss!=e.charAt(g)&&(DP!=e.charAt(g)||OP!=e.charAt(g+1));)++g;if(g+=2,Ss===e.charAt(g-1))return a("End of comment missing");var b=e.slice(2,g-2);return r+=2,o(b),e=e.slice(g),r+=2,p({type:Kle,comment:b})}}function h(){var p=i(),g=l(Hle);if(g){if(d(),!l(Wle))return a("property missing ':'");var b=l(Ule),v=p({type:Xle,property:TP(g[0].replace(kP,Ss)),value:b?TP(b[0].replace(kP,Ss)):Ss});return l(qle),v}}function f(){var p=[];u(p);for(var g;g=h();)g!==!1&&(p.push(g),u(p));return p}return c(),f()};function TP(e){return e?e.replace(Gle,Ss):Ss}var Jle=Qo&&Qo.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(fS,"__esModule",{value:!0});fS.default=ece;var Zle=Jle(Qle);function ece(e,t){var n=null;if(!e||typeof e!="string")return n;var r=(0,Zle.default)(e),o=typeof t=="function";return r.forEach(function(i){if(i.type==="declaration"){var s=i.property,a=i.value;o?t(s,a,i):a&&(n=n||{},n[s]=a)}}),n}var um={};Object.defineProperty(um,"__esModule",{value:!0});um.camelCase=void 0;var tce=/^--[a-zA-Z0-9_-]+$/,nce=/-([a-z])/g,rce=/^[^-]+$/,oce=/^-(webkit|moz|ms|o|khtml)-/,ice=/^-(ms)-/,sce=function(e){return!e||rce.test(e)||tce.test(e)},ace=function(e,t){return t.toUpperCase()},IP=function(e,t){return"".concat(t,"-")},lce=function(e,t){return t===void 0&&(t={}),sce(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(ice,IP):e=e.replace(oce,IP),e.replace(nce,ace))};um.camelCase=lce;var cce=Qo&&Qo.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},uce=cce(fS),dce=um;function Dy(e,t){var n={};return!e||typeof e!="string"||(0,uce.default)(e,function(r,o){r&&o&&(n[(0,dce.camelCase)(r,t)]=o)}),n}Dy.default=Dy;var fce=Dy;const hce=Yi(fce),Zj=e4("end"),hS=e4("start");function e4(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function pce(e){const t=hS(e),n=Zj(e);if(t&&n)return{start:t,end:n}}function yu(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?AP(e.position):"start"in e||"end"in e?AP(e):"line"in e||"column"in e?Ty(e):""}function Ty(e){return NP(e&&e.line)+":"+NP(e&&e.column)}function AP(e){return Ty(e&&e.start)+"-"+Ty(e&&e.end)}function NP(e){return e&&typeof e=="number"?e:1}class xn extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let o="",i={},s=!1;if(n&&("line"in n&&"column"in n?i={place:n}:"start"in n&&"end"in n?i={place:n}:"type"in n?i={ancestors:[n],place:n.position}:i={...n}),typeof t=="string"?o=t:!i.cause&&t&&(s=!0,o=t.message,i.cause=t),!i.ruleId&&!i.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?i.ruleId=r:(i.source=r.slice(0,l),i.ruleId=r.slice(l+1))}if(!i.place&&i.ancestors&&i.ancestors){const l=i.ancestors[i.ancestors.length-1];l&&(i.place=l.position)}const a=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file,this.message=o,this.line=a?a.line:void 0,this.name=yu(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=s&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual,this.expected,this.note,this.url}}xn.prototype.file="";xn.prototype.name="";xn.prototype.reason="";xn.prototype.message="";xn.prototype.stack="";xn.prototype.column=void 0;xn.prototype.line=void 0;xn.prototype.ancestors=void 0;xn.prototype.cause=void 0;xn.prototype.fatal=void 0;xn.prototype.place=void 0;xn.prototype.ruleId=void 0;xn.prototype.source=void 0;const pS={}.hasOwnProperty,gce=new Map,mce=/[A-Z]/g,bce=new Set(["table","tbody","thead","tfoot","tr"]),vce=new Set(["td","th"]),t4="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function yce(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=Pce(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=Rce(n,t.jsx,t.jsxs)}const o={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?dS:$le,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},i=n4(o,e,void 0);return i&&typeof i!="string"?i:o.create(e,o.Fragment,{children:i||void 0},void 0)}function n4(e,t,n){if(t.type==="element")return xce(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return wce(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Cce(e,t,n);if(t.type==="mdxjsEsm")return Sce(e,t);if(t.type==="root")return _ce(e,t,n);if(t.type==="text")return Ece(e,t)}function xce(e,t,n){const r=e.schema;let o=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(o=dS,e.schema=o),e.ancestors.push(t);const i=o4(e,t.tagName,!1),s=Mce(e,t);let a=mS(e,t);return bce.has(t.tagName)&&(a=a.filter(function(l){return typeof l=="string"?!kle(l):!0})),r4(e,s,i,t),gS(s,a),e.ancestors.pop(),e.schema=r,e.create(t,i,s,n)}function wce(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Xu(e,t.position)}function Sce(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Xu(e,t.position)}function Cce(e,t,n){const r=e.schema;let o=r;t.name==="svg"&&r.space==="html"&&(o=dS,e.schema=o),e.ancestors.push(t);const i=t.name===null?e.Fragment:o4(e,t.name,!0),s=kce(e,t),a=mS(e,t);return r4(e,s,i,t),gS(s,a),e.ancestors.pop(),e.schema=r,e.create(t,i,s,n)}function _ce(e,t,n){const r={};return gS(r,mS(e,t)),e.create(t,e.Fragment,r,n)}function Ece(e,t){return t.value}function r4(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function gS(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Rce(e,t,n){return r;function r(o,i,s,a){const c=Array.isArray(s.children)?n:t;return a?c(i,s,a):c(i,s)}}function Pce(e,t){return n;function n(r,o,i,s){const a=Array.isArray(i.children),l=hS(r);return t(o,i,s,a,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function Mce(e,t){const n={};let r,o;for(o in t.properties)if(o!=="children"&&pS.call(t.properties,o)){const i=Oce(e,o,t.properties[o]);if(i){const[s,a]=i;e.tableCellAlignToStyle&&s==="align"&&typeof a=="string"&&vce.has(t.tagName)?r=a:n[s]=a}}if(r){const i=n.style||(n.style={});i[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function kce(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const i=r.data.estree.body[0];i.type;const s=i.expression;s.type;const a=s.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else Xu(e,t.position);else{const o=r.name;let i;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const a=r.value.data.estree.body[0];a.type,i=e.evaluater.evaluateExpression(a.expression)}else Xu(e,t.position);else i=r.value===null?!0:r.value;n[o]=i}return n}function mS(e,t){const n=[];let r=-1;const o=e.passKeys?new Map:gce;for(;++r<t.children.length;){const i=t.children[r];let s;if(e.passKeys){const l=i.type==="element"?i.tagName:i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement"?i.name:void 0;if(l){const c=o.get(l)||0;s=l+"-"+c,o.set(l,c+1)}}const a=n4(e,i,s);a!==void 0&&n.push(a)}return n}function Oce(e,t,n){const r=jle(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?_le(n):zle(n)),r.property==="style"){let o=typeof n=="object"?n:Dce(e,String(n));return e.stylePropertyNameCase==="css"&&(o=Tce(o)),["style",o]}return[e.elementAttributeNameCase==="react"&&r.space?Ile[r.property]||r.property:r.attribute,n]}}function Dce(e,t){try{return hce(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,o=new xn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw o.file=e.filePath||void 0,o.url=t4+"#cannot-parse-style-attribute",o}}function o4(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const o=t.split(".");let i=-1,s;for(;++i<o.length;){const a=EP(o[i])?{type:"Identifier",name:o[i]}:{type:"Literal",value:o[i]};s=s?{type:"MemberExpression",object:s,property:a,computed:!!(i&&a.type==="Literal"),optional:!1}:a}r=s}else r=EP(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const o=r.value;return pS.call(e.components,o)?e.components[o]:o}if(e.evaluater)return e.evaluater.evaluateExpression(r);Xu(e)}function Xu(e,t){const n=new xn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=t4+"#cannot-handle-mdx-estrees-without-createevaluater",n}function Tce(e){const t={};let n;for(n in e)pS.call(e,n)&&(t[Ice(n)]=e[n]);return t}function Ice(e){let t=e.replace(mce,Ace);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function Ace(e){return"-"+e.toLowerCase()}const o0={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},Nce={};function jce(e,t){const n=Nce,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,o=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return i4(e,r,o)}function i4(e,t,n){if(Fce(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return jP(e.children,t,n)}return Array.isArray(e)?jP(e,t,n):""}function jP(e,t,n){const r=[];let o=-1;for(;++o<e.length;)r[o]=i4(e[o],t,n);return r.join("")}function Fce(e){return!!(e&&typeof e=="object")}const FP=document.createElement("i");function bS(e){const t="&"+e+";";FP.innerHTML=t;const n=FP.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Ro(e,t,n,r){const o=e.length;let i=0,s;if(t<0?t=-t>o?0:o+t:t=t>o?o:t,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(t,n),e.splice(...s);else for(n&&e.splice(t,n);i<r.length;)s=r.slice(i,i+1e4),s.unshift(t,0),e.splice(...s),i+=1e4,t+=1e4}function _r(e,t){return e.length>0?(Ro(e,e.length,0,t),e):t}const LP={}.hasOwnProperty;function Lce(e){const t={};let n=-1;for(;++n<e.length;)$ce(t,e[n]);return t}function $ce(e,t){let n;for(n in t){const o=(LP.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n];let s;if(i)for(s in i){LP.call(o,s)||(o[s]=[]);const a=i[s];zce(o[s],Array.isArray(a)?a:a?[a]:[])}}}function zce(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Ro(e,0,0,r)}function s4(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function hl(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const fo=rs(/[A-Za-z]/),dr=rs(/[\dA-Za-z]/),Bce=rs(/[#-'*+\--9=?A-Z^-~]/);function Iy(e){return e!==null&&(e<32||e===127)}const Ay=rs(/\d/),Vce=rs(/[\dA-Fa-f]/),Hce=rs(/[!-/:-@[-`{-~]/);function Pe(e){return e!==null&&e<-2}function Yn(e){return e!==null&&(e<0||e===32)}function rt(e){return e===-2||e===-1||e===32}const Wce=rs(new RegExp("\\p{P}|\\p{S}","u")),Uce=rs(/\s/);function rs(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function pc(e){const t=[];let n=-1,r=0,o=0;for(;++n<e.length;){const i=e.charCodeAt(n);let s="";if(i===37&&dr(e.charCodeAt(n+1))&&dr(e.charCodeAt(n+2)))o=2;else if(i<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(i))||(s=String.fromCharCode(i));else if(i>55295&&i<57344){const a=e.charCodeAt(n+1);i<56320&&a>56319&&a<57344?(s=String.fromCharCode(i,a),o=1):s="�"}else s=String.fromCharCode(i);s&&(t.push(e.slice(r,n),encodeURIComponent(s)),r=n+o+1,s=""),o&&(n+=o,o=0)}return t.join("")+e.slice(r)}function yt(e,t,n,r){const o=r?r-1:Number.POSITIVE_INFINITY;let i=0;return s;function s(l){return rt(l)?(e.enter(n),a(l)):t(l)}function a(l){return rt(l)&&i++<o?(e.consume(l),a):(e.exit(n),t(l))}}const qce={tokenize:Gce};function Gce(e){const t=e.attempt(this.parser.constructs.contentInitial,r,o);let n;return t;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),yt(e,t,"linePrefix")}function o(a){return e.enter("paragraph"),i(a)}function i(a){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,s(a)}function s(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return Pe(a)?(e.consume(a),e.exit("chunkText"),i):(e.consume(a),s)}}const Yce={tokenize:Kce},$P={tokenize:Xce};function Kce(e){const t=this,n=[];let r=0,o,i,s;return a;function a(y){if(r<n.length){const _=n[r];return t.containerState=_[1],e.attempt(_[0].continuation,l,c)(y)}return c(y)}function l(y){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,o&&x();const _=t.events.length;let w=_,C;for(;w--;)if(t.events[w][0]==="exit"&&t.events[w][1].type==="chunkFlow"){C=t.events[w][1].end;break}v(r);let R=_;for(;R<t.events.length;)t.events[R][1].end={...C},R++;return Ro(t.events,w+1,0,t.events.slice(_)),t.events.length=R,c(y)}return a(y)}function c(y){if(r===n.length){if(!o)return h(y);if(o.currentConstruct&&o.currentConstruct.concrete)return p(y);t.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return t.containerState={},e.check($P,u,d)(y)}function u(y){return o&&x(),v(r),h(y)}function d(y){return t.parser.lazy[t.now().line]=r!==n.length,s=t.now().offset,p(y)}function h(y){return t.containerState={},e.attempt($P,f,p)(y)}function f(y){return r++,n.push([t.currentConstruct,t.containerState]),h(y)}function p(y){if(y===null){o&&x(),v(0),e.consume(y);return}return o=o||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:o,contentType:"flow",previous:i}),g(y)}function g(y){if(y===null){b(e.exit("chunkFlow"),!0),v(0),e.consume(y);return}return Pe(y)?(e.consume(y),b(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(y),g)}function b(y,_){const w=t.sliceStream(y);if(_&&w.push(null),y.previous=i,i&&(i.next=y),i=y,o.defineSkip(y.start),o.write(w),t.parser.lazy[y.start.line]){let C=o.events.length;for(;C--;)if(o.events[C][1].start.offset<s&&(!o.events[C][1].end||o.events[C][1].end.offset>s))return;const R=t.events.length;let k=R,D,I;for(;k--;)if(t.events[k][0]==="exit"&&t.events[k][1].type==="chunkFlow"){if(D){I=t.events[k][1].end;break}D=!0}for(v(r),C=R;C<t.events.length;)t.events[C][1].end={...I},C++;Ro(t.events,k+1,0,t.events.slice(R)),t.events.length=C}}function v(y){let _=n.length;for(;_-- >y;){const w=n[_];t.containerState=w[1],w[0].exit.call(t,e)}n.length=y}function x(){o.write([null]),i=void 0,o=void 0,t.containerState._closeFlow=void 0}}function Xce(e,t,n){return yt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function zP(e){if(e===null||Yn(e)||Uce(e))return 1;if(Wce(e))return 2}function vS(e,t,n){const r=[];let o=-1;for(;++o<e.length;){const i=e[o].resolveAll;i&&!r.includes(i)&&(t=i(t,n),r.push(i))}return t}const Ny={name:"attention",resolveAll:Qce,tokenize:Jce};function Qce(e,t){let n=-1,r,o,i,s,a,l,c,u;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;l=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const d={...e[r][1].end},h={...e[n][1].start};BP(d,-l),BP(h,l),s={type:l>1?"strongSequence":"emphasisSequence",start:d,end:{...e[r][1].end}},a={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:h},i={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},o={type:l>1?"strong":"emphasis",start:{...s.start},end:{...a.end}},e[r][1].end={...s.start},e[n][1].start={...a.end},c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=_r(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=_r(c,[["enter",o,t],["enter",s,t],["exit",s,t],["enter",i,t]]),c=_r(c,vS(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=_r(c,[["exit",i,t],["enter",a,t],["exit",a,t],["exit",o,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,c=_r(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):u=0,Ro(e,r-1,n-r+3,c),n=r+c.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function Jce(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,o=zP(r);let i;return s;function s(l){return i=l,e.enter("attentionSequence"),a(l)}function a(l){if(l===i)return e.consume(l),a;const c=e.exit("attentionSequence"),u=zP(l),d=!u||u===2&&o||n.includes(l),h=!o||o===2&&u||n.includes(r);return c._open=!!(i===42?d:d&&(o||!h)),c._close=!!(i===42?h:h&&(u||!d)),t(l)}}function BP(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const Zce={name:"autolink",tokenize:eue};function eue(e,t,n){let r=0;return o;function o(f){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),i}function i(f){return fo(f)?(e.consume(f),s):f===64?n(f):c(f)}function s(f){return f===43||f===45||f===46||dr(f)?(r=1,a(f)):c(f)}function a(f){return f===58?(e.consume(f),r=0,l):(f===43||f===45||f===46||dr(f))&&r++<32?(e.consume(f),a):(r=0,c(f))}function l(f){return f===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.exit("autolink"),t):f===null||f===32||f===60||Iy(f)?n(f):(e.consume(f),l)}function c(f){return f===64?(e.consume(f),u):Bce(f)?(e.consume(f),c):n(f)}function u(f){return dr(f)?d(f):n(f)}function d(f){return f===46?(e.consume(f),r=0,u):f===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.exit("autolink"),t):h(f)}function h(f){if((f===45||dr(f))&&r++<63){const p=f===45?h:d;return e.consume(f),p}return n(f)}}const dm={partial:!0,tokenize:tue};function tue(e,t,n){return r;function r(i){return rt(i)?yt(e,o,"linePrefix")(i):o(i)}function o(i){return i===null||Pe(i)?t(i):n(i)}}const a4={continuation:{tokenize:rue},exit:oue,name:"blockQuote",tokenize:nue};function nue(e,t,n){const r=this;return o;function o(s){if(s===62){const a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(s),e.exit("blockQuoteMarker"),i}return n(s)}function i(s){return rt(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function rue(e,t,n){const r=this;return o;function o(s){return rt(s)?yt(e,i,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):i(s)}function i(s){return e.attempt(a4,t,n)(s)}}function oue(e){e.exit("blockQuote")}const l4={name:"characterEscape",tokenize:iue};function iue(e,t,n){return r;function r(i){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(i),e.exit("escapeMarker"),o}function o(i){return Hce(i)?(e.enter("characterEscapeValue"),e.consume(i),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(i)}}const c4={name:"characterReference",tokenize:sue};function sue(e,t,n){const r=this;let o=0,i,s;return a;function a(d){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),l}function l(d){return d===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(d),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),i=31,s=dr,u(d))}function c(d){return d===88||d===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(d),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),i=6,s=Vce,u):(e.enter("characterReferenceValue"),i=7,s=Ay,u(d))}function u(d){if(d===59&&o){const h=e.exit("characterReferenceValue");return s===dr&&!bS(r.sliceSerialize(h))?n(d):(e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return s(d)&&o++<i?(e.consume(d),u):n(d)}}const VP={partial:!0,tokenize:lue},HP={concrete:!0,name:"codeFenced",tokenize:aue};function aue(e,t,n){const r=this,o={partial:!0,tokenize:w};let i=0,s=0,a;return l;function l(C){return c(C)}function c(C){const R=r.events[r.events.length-1];return i=R&&R[1].type==="linePrefix"?R[2].sliceSerialize(R[1],!0).length:0,a=C,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),u(C)}function u(C){return C===a?(s++,e.consume(C),u):s<3?n(C):(e.exit("codeFencedFenceSequence"),rt(C)?yt(e,d,"whitespace")(C):d(C))}function d(C){return C===null||Pe(C)?(e.exit("codeFencedFence"),r.interrupt?t(C):e.check(VP,g,_)(C)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),h(C))}function h(C){return C===null||Pe(C)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),d(C)):rt(C)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),yt(e,f,"whitespace")(C)):C===96&&C===a?n(C):(e.consume(C),h)}function f(C){return C===null||Pe(C)?d(C):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),p(C))}function p(C){return C===null||Pe(C)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),d(C)):C===96&&C===a?n(C):(e.consume(C),p)}function g(C){return e.attempt(o,_,b)(C)}function b(C){return e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),v}function v(C){return i>0&&rt(C)?yt(e,x,"linePrefix",i+1)(C):x(C)}function x(C){return C===null||Pe(C)?e.check(VP,g,_)(C):(e.enter("codeFlowValue"),y(C))}function y(C){return C===null||Pe(C)?(e.exit("codeFlowValue"),x(C)):(e.consume(C),y)}function _(C){return e.exit("codeFenced"),t(C)}function w(C,R,k){let D=0;return I;function I(O){return C.enter("lineEnding"),C.consume(O),C.exit("lineEnding"),T}function T(O){return C.enter("codeFencedFence"),rt(O)?yt(C,N,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):N(O)}function N(O){return O===a?(C.enter("codeFencedFenceSequence"),G(O)):k(O)}function G(O){return O===a?(D++,C.consume(O),G):D>=s?(C.exit("codeFencedFenceSequence"),rt(O)?yt(C,z,"whitespace")(O):z(O)):k(O)}function z(O){return O===null||Pe(O)?(C.exit("codeFencedFence"),R(O)):k(O)}}}function lue(e,t,n){const r=this;return o;function o(s){return s===null?n(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i)}function i(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}const i0={name:"codeIndented",tokenize:uue},cue={partial:!0,tokenize:due};function uue(e,t,n){const r=this;return o;function o(c){return e.enter("codeIndented"),yt(e,i,"linePrefix",5)(c)}function i(c){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?s(c):n(c)}function s(c){return c===null?l(c):Pe(c)?e.attempt(cue,s,l)(c):(e.enter("codeFlowValue"),a(c))}function a(c){return c===null||Pe(c)?(e.exit("codeFlowValue"),s(c)):(e.consume(c),a)}function l(c){return e.exit("codeIndented"),t(c)}}function due(e,t,n){const r=this;return o;function o(s){return r.parser.lazy[r.now().line]?n(s):Pe(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o):yt(e,i,"linePrefix",5)(s)}function i(s){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(s):Pe(s)?o(s):n(s)}}const fue={name:"codeText",previous:pue,resolve:hue,tokenize:gue};function hue(e){let t=e.length-4,n=3,r,o;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)o===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(o=r):(r===t||e[r][1].type==="lineEnding")&&(e[o][1].type="codeTextData",r!==o+2&&(e[o][1].end=e[r-1][1].end,e.splice(o+2,r-o-2),t-=r-o-2,r=o+2),o=void 0);return e}function pue(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function gue(e,t,n){let r=0,o,i;return s;function s(d){return e.enter("codeText"),e.enter("codeTextSequence"),a(d)}function a(d){return d===96?(e.consume(d),r++,a):(e.exit("codeTextSequence"),l(d))}function l(d){return d===null?n(d):d===32?(e.enter("space"),e.consume(d),e.exit("space"),l):d===96?(i=e.enter("codeTextSequence"),o=0,u(d)):Pe(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),l):(e.enter("codeTextData"),c(d))}function c(d){return d===null||d===32||d===96||Pe(d)?(e.exit("codeTextData"),l(d)):(e.consume(d),c)}function u(d){return d===96?(e.consume(d),o++,u):o===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(d)):(i.type="codeTextData",c(d))}}class mue{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const o=n||0;this.setCursor(Math.trunc(t));const i=this.right.splice(this.right.length-o,Number.POSITIVE_INFINITY);return r&&Nc(this.left,r),i.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Nc(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Nc(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);Nc(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Nc(this.left,n.reverse())}}}function Nc(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function u4(e){const t={};let n=-1,r,o,i,s,a,l,c;const u=new mue(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type==="chunkFlow"&&u.get(n-1)[1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,i=0,i<l.length&&l[i][1].type==="lineEndingBlank"&&(i+=2),i<l.length&&l[i][1].type==="content"))for(;++i<l.length&&l[i][1].type!=="content";)l[i][1].type==="chunkText"&&(l[i][1]._isInFirstContentOfListItem=!0,i++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,bue(u,n)),n=t[n],c=!0);else if(r[1]._container){for(i=n,o=void 0;i--;)if(s=u.get(i),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank")s[0]==="enter"&&(o&&(u.get(o)[1].type="lineEndingBlank"),s[1].type="lineEnding",o=i);else if(!(s[1].type==="linePrefix"||s[1].type==="listItemIndent"))break;o&&(r[1].end={...u.get(o)[1].start},a=u.slice(o,n),a.unshift(r),u.splice(o,n-o+1,a))}}return Ro(e,0,Number.POSITIVE_INFINITY,u.slice(0)),!c}function bue(e,t){const n=e.get(t)[1],r=e.get(t)[2];let o=t-1;const i=[];let s=n._tokenizer;s||(s=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(s._contentTypeTextTrailing=!0));const a=s.events,l=[],c={};let u,d,h=-1,f=n,p=0,g=0;const b=[g];for(;f;){for(;e.get(++o)[1]!==f;);i.push(o),f._tokenizer||(u=r.sliceStream(f),f.next||u.push(null),d&&s.defineSkip(f.start),f._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(u),f._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),d=f,f=f.next}for(f=n;++h<a.length;)a[h][0]==="exit"&&a[h-1][0]==="enter"&&a[h][1].type===a[h-1][1].type&&a[h][1].start.line!==a[h][1].end.line&&(g=h+1,b.push(g),f._tokenizer=void 0,f.previous=void 0,f=f.next);for(s.events=[],f?(f._tokenizer=void 0,f.previous=void 0):b.pop(),h=b.length;h--;){const v=a.slice(b[h],b[h+1]),x=i.pop();l.push([x,x+v.length-1]),e.splice(x,2,v)}for(l.reverse(),h=-1;++h<l.length;)c[p+l[h][0]]=p+l[h][1],p+=l[h][1]-l[h][0]-1;return c}const vue={resolve:xue,tokenize:wue},yue={partial:!0,tokenize:Sue};function xue(e){return u4(e),e}function wue(e,t){let n;return r;function r(a){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),o(a)}function o(a){return a===null?i(a):Pe(a)?e.check(yue,s,i)(a):(e.consume(a),o)}function i(a){return e.exit("chunkContent"),e.exit("content"),t(a)}function s(a){return e.consume(a),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,o}}function Sue(e,t,n){const r=this;return o;function o(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),yt(e,i,"linePrefix")}function i(s){if(s===null||Pe(s))return n(s);const a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(s):e.interrupt(r.parser.constructs.flow,n,t)(s)}}function d4(e,t,n,r,o,i,s,a,l){const c=l||Number.POSITIVE_INFINITY;let u=0;return d;function d(v){return v===60?(e.enter(r),e.enter(o),e.enter(i),e.consume(v),e.exit(i),h):v===null||v===32||v===41||Iy(v)?n(v):(e.enter(r),e.enter(s),e.enter(a),e.enter("chunkString",{contentType:"string"}),g(v))}function h(v){return v===62?(e.enter(i),e.consume(v),e.exit(i),e.exit(o),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),f(v))}function f(v){return v===62?(e.exit("chunkString"),e.exit(a),h(v)):v===null||v===60||Pe(v)?n(v):(e.consume(v),v===92?p:f)}function p(v){return v===60||v===62||v===92?(e.consume(v),f):f(v)}function g(v){return!u&&(v===null||v===41||Yn(v))?(e.exit("chunkString"),e.exit(a),e.exit(s),e.exit(r),t(v)):u<c&&v===40?(e.consume(v),u++,g):v===41?(e.consume(v),u--,g):v===null||v===32||v===40||Iy(v)?n(v):(e.consume(v),v===92?b:g)}function b(v){return v===40||v===41||v===92?(e.consume(v),g):g(v)}}function f4(e,t,n,r,o,i){const s=this;let a=0,l;return c;function c(f){return e.enter(r),e.enter(o),e.consume(f),e.exit(o),e.enter(i),u}function u(f){return a>999||f===null||f===91||f===93&&!l||f===94&&!a&&"_hiddenFootnoteSupport"in s.parser.constructs?n(f):f===93?(e.exit(i),e.enter(o),e.consume(f),e.exit(o),e.exit(r),t):Pe(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),u):(e.enter("chunkString",{contentType:"string"}),d(f))}function d(f){return f===null||f===91||f===93||Pe(f)||a++>999?(e.exit("chunkString"),u(f)):(e.consume(f),l||(l=!rt(f)),f===92?h:d)}function h(f){return f===91||f===92||f===93?(e.consume(f),a++,d):d(f)}}function h4(e,t,n,r,o,i){let s;return a;function a(h){return h===34||h===39||h===40?(e.enter(r),e.enter(o),e.consume(h),e.exit(o),s=h===40?41:h,l):n(h)}function l(h){return h===s?(e.enter(o),e.consume(h),e.exit(o),e.exit(r),t):(e.enter(i),c(h))}function c(h){return h===s?(e.exit(i),l(s)):h===null?n(h):Pe(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),yt(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),u(h))}function u(h){return h===s||h===null||Pe(h)?(e.exit("chunkString"),c(h)):(e.consume(h),h===92?d:u)}function d(h){return h===s||h===92?(e.consume(h),u):u(h)}}function xu(e,t){let n;return r;function r(o){return Pe(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n=!0,r):rt(o)?yt(e,r,n?"linePrefix":"lineSuffix")(o):t(o)}}const Cue={name:"definition",tokenize:Eue},_ue={partial:!0,tokenize:Rue};function Eue(e,t,n){const r=this;let o;return i;function i(f){return e.enter("definition"),s(f)}function s(f){return f4.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(f)}function a(f){return o=hl(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),f===58?(e.enter("definitionMarker"),e.consume(f),e.exit("definitionMarker"),l):n(f)}function l(f){return Yn(f)?xu(e,c)(f):c(f)}function c(f){return d4(e,u,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(f)}function u(f){return e.attempt(_ue,d,d)(f)}function d(f){return rt(f)?yt(e,h,"whitespace")(f):h(f)}function h(f){return f===null||Pe(f)?(e.exit("definition"),r.parser.defined.push(o),t(f)):n(f)}}function Rue(e,t,n){return r;function r(a){return Yn(a)?xu(e,o)(a):n(a)}function o(a){return h4(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function i(a){return rt(a)?yt(e,s,"whitespace")(a):s(a)}function s(a){return a===null||Pe(a)?t(a):n(a)}}const Pue={name:"hardBreakEscape",tokenize:Mue};function Mue(e,t,n){return r;function r(i){return e.enter("hardBreakEscape"),e.consume(i),o}function o(i){return Pe(i)?(e.exit("hardBreakEscape"),t(i)):n(i)}}const kue={name:"headingAtx",resolve:Oue,tokenize:Due};function Oue(e,t){let n=e.length-2,r=3,o,i;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(o={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},i={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Ro(e,r,n-r+1,[["enter",o,t],["enter",i,t],["exit",i,t],["exit",o,t]])),e}function Due(e,t,n){let r=0;return o;function o(u){return e.enter("atxHeading"),i(u)}function i(u){return e.enter("atxHeadingSequence"),s(u)}function s(u){return u===35&&r++<6?(e.consume(u),s):u===null||Yn(u)?(e.exit("atxHeadingSequence"),a(u)):n(u)}function a(u){return u===35?(e.enter("atxHeadingSequence"),l(u)):u===null||Pe(u)?(e.exit("atxHeading"),t(u)):rt(u)?yt(e,a,"whitespace")(u):(e.enter("atxHeadingText"),c(u))}function l(u){return u===35?(e.consume(u),l):(e.exit("atxHeadingSequence"),a(u))}function c(u){return u===null||u===35||Yn(u)?(e.exit("atxHeadingText"),a(u)):(e.consume(u),c)}}const Tue=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],WP=["pre","script","style","textarea"],Iue={concrete:!0,name:"htmlFlow",resolveTo:jue,tokenize:Fue},Aue={partial:!0,tokenize:$ue},Nue={partial:!0,tokenize:Lue};function jue(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Fue(e,t,n){const r=this;let o,i,s,a,l;return c;function c(P){return u(P)}function u(P){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(P),d}function d(P){return P===33?(e.consume(P),h):P===47?(e.consume(P),i=!0,g):P===63?(e.consume(P),o=3,r.interrupt?t:M):fo(P)?(e.consume(P),s=String.fromCharCode(P),b):n(P)}function h(P){return P===45?(e.consume(P),o=2,f):P===91?(e.consume(P),o=5,a=0,p):fo(P)?(e.consume(P),o=4,r.interrupt?t:M):n(P)}function f(P){return P===45?(e.consume(P),r.interrupt?t:M):n(P)}function p(P){const U="CDATA[";return P===U.charCodeAt(a++)?(e.consume(P),a===U.length?r.interrupt?t:N:p):n(P)}function g(P){return fo(P)?(e.consume(P),s=String.fromCharCode(P),b):n(P)}function b(P){if(P===null||P===47||P===62||Yn(P)){const U=P===47,q=s.toLowerCase();return!U&&!i&&WP.includes(q)?(o=1,r.interrupt?t(P):N(P)):Tue.includes(s.toLowerCase())?(o=6,U?(e.consume(P),v):r.interrupt?t(P):N(P)):(o=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(P):i?x(P):y(P))}return P===45||dr(P)?(e.consume(P),s+=String.fromCharCode(P),b):n(P)}function v(P){return P===62?(e.consume(P),r.interrupt?t:N):n(P)}function x(P){return rt(P)?(e.consume(P),x):I(P)}function y(P){return P===47?(e.consume(P),I):P===58||P===95||fo(P)?(e.consume(P),_):rt(P)?(e.consume(P),y):I(P)}function _(P){return P===45||P===46||P===58||P===95||dr(P)?(e.consume(P),_):w(P)}function w(P){return P===61?(e.consume(P),C):rt(P)?(e.consume(P),w):y(P)}function C(P){return P===null||P===60||P===61||P===62||P===96?n(P):P===34||P===39?(e.consume(P),l=P,R):rt(P)?(e.consume(P),C):k(P)}function R(P){return P===l?(e.consume(P),l=null,D):P===null||Pe(P)?n(P):(e.consume(P),R)}function k(P){return P===null||P===34||P===39||P===47||P===60||P===61||P===62||P===96||Yn(P)?w(P):(e.consume(P),k)}function D(P){return P===47||P===62||rt(P)?y(P):n(P)}function I(P){return P===62?(e.consume(P),T):n(P)}function T(P){return P===null||Pe(P)?N(P):rt(P)?(e.consume(P),T):n(P)}function N(P){return P===45&&o===2?(e.consume(P),A):P===60&&o===1?(e.consume(P),L):P===62&&o===4?(e.consume(P),W):P===63&&o===3?(e.consume(P),M):P===93&&o===5?(e.consume(P),B):Pe(P)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(Aue,F,G)(P)):P===null||Pe(P)?(e.exit("htmlFlowData"),G(P)):(e.consume(P),N)}function G(P){return e.check(Nue,z,F)(P)}function z(P){return e.enter("lineEnding"),e.consume(P),e.exit("lineEnding"),O}function O(P){return P===null||Pe(P)?G(P):(e.enter("htmlFlowData"),N(P))}function A(P){return P===45?(e.consume(P),M):N(P)}function L(P){return P===47?(e.consume(P),s="",j):N(P)}function j(P){if(P===62){const U=s.toLowerCase();return WP.includes(U)?(e.consume(P),W):N(P)}return fo(P)&&s.length<8?(e.consume(P),s+=String.fromCharCode(P),j):N(P)}function B(P){return P===93?(e.consume(P),M):N(P)}function M(P){return P===62?(e.consume(P),W):P===45&&o===2?(e.consume(P),M):N(P)}function W(P){return P===null||Pe(P)?(e.exit("htmlFlowData"),F(P)):(e.consume(P),W)}function F(P){return e.exit("htmlFlow"),t(P)}}function Lue(e,t,n){const r=this;return o;function o(s){return Pe(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):n(s)}function i(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}function $ue(e,t,n){return r;function r(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(dm,t,n)}}const zue={name:"htmlText",tokenize:Bue};function Bue(e,t,n){const r=this;let o,i,s;return a;function a(M){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(M),l}function l(M){return M===33?(e.consume(M),c):M===47?(e.consume(M),w):M===63?(e.consume(M),y):fo(M)?(e.consume(M),k):n(M)}function c(M){return M===45?(e.consume(M),u):M===91?(e.consume(M),i=0,p):fo(M)?(e.consume(M),x):n(M)}function u(M){return M===45?(e.consume(M),f):n(M)}function d(M){return M===null?n(M):M===45?(e.consume(M),h):Pe(M)?(s=d,L(M)):(e.consume(M),d)}function h(M){return M===45?(e.consume(M),f):d(M)}function f(M){return M===62?A(M):M===45?h(M):d(M)}function p(M){const W="CDATA[";return M===W.charCodeAt(i++)?(e.consume(M),i===W.length?g:p):n(M)}function g(M){return M===null?n(M):M===93?(e.consume(M),b):Pe(M)?(s=g,L(M)):(e.consume(M),g)}function b(M){return M===93?(e.consume(M),v):g(M)}function v(M){return M===62?A(M):M===93?(e.consume(M),v):g(M)}function x(M){return M===null||M===62?A(M):Pe(M)?(s=x,L(M)):(e.consume(M),x)}function y(M){return M===null?n(M):M===63?(e.consume(M),_):Pe(M)?(s=y,L(M)):(e.consume(M),y)}function _(M){return M===62?A(M):y(M)}function w(M){return fo(M)?(e.consume(M),C):n(M)}function C(M){return M===45||dr(M)?(e.consume(M),C):R(M)}function R(M){return Pe(M)?(s=R,L(M)):rt(M)?(e.consume(M),R):A(M)}function k(M){return M===45||dr(M)?(e.consume(M),k):M===47||M===62||Yn(M)?D(M):n(M)}function D(M){return M===47?(e.consume(M),A):M===58||M===95||fo(M)?(e.consume(M),I):Pe(M)?(s=D,L(M)):rt(M)?(e.consume(M),D):A(M)}function I(M){return M===45||M===46||M===58||M===95||dr(M)?(e.consume(M),I):T(M)}function T(M){return M===61?(e.consume(M),N):Pe(M)?(s=T,L(M)):rt(M)?(e.consume(M),T):D(M)}function N(M){return M===null||M===60||M===61||M===62||M===96?n(M):M===34||M===39?(e.consume(M),o=M,G):Pe(M)?(s=N,L(M)):rt(M)?(e.consume(M),N):(e.consume(M),z)}function G(M){return M===o?(e.consume(M),o=void 0,O):M===null?n(M):Pe(M)?(s=G,L(M)):(e.consume(M),G)}function z(M){return M===null||M===34||M===39||M===60||M===61||M===96?n(M):M===47||M===62||Yn(M)?D(M):(e.consume(M),z)}function O(M){return M===47||M===62||Yn(M)?D(M):n(M)}function A(M){return M===62?(e.consume(M),e.exit("htmlTextData"),e.exit("htmlText"),t):n(M)}function L(M){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),j}function j(M){return rt(M)?yt(e,B,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(M):B(M)}function B(M){return e.enter("htmlTextData"),s(M)}}const yS={name:"labelEnd",resolveAll:Uue,resolveTo:que,tokenize:Gue},Vue={tokenize:Yue},Hue={tokenize:Kue},Wue={tokenize:Xue};function Uue(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const o=r.type==="labelImage"?4:2;r.type="data",t+=o}}return e.length!==n.length&&Ro(e,0,e.length,n),e}function que(e,t){let n=e.length,r=0,o,i,s,a;for(;n--;)if(o=e[n][1],i){if(o.type==="link"||o.type==="labelLink"&&o._inactive)break;e[n][0]==="enter"&&o.type==="labelLink"&&(o._inactive=!0)}else if(s){if(e[n][0]==="enter"&&(o.type==="labelImage"||o.type==="labelLink")&&!o._balanced&&(i=n,o.type!=="labelLink")){r=2;break}}else o.type==="labelEnd"&&(s=n);const l={type:e[i][1].type==="labelLink"?"link":"image",start:{...e[i][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[i][1].start},end:{...e[s][1].end}},u={type:"labelText",start:{...e[i+r+2][1].end},end:{...e[s-2][1].start}};return a=[["enter",l,t],["enter",c,t]],a=_r(a,e.slice(i+1,i+r+3)),a=_r(a,[["enter",u,t]]),a=_r(a,vS(t.parser.constructs.insideSpan.null,e.slice(i+r+4,s-3),t)),a=_r(a,[["exit",u,t],e[s-2],e[s-1],["exit",c,t]]),a=_r(a,e.slice(s+1)),a=_r(a,[["exit",l,t]]),Ro(e,i,e.length,a),e}function Gue(e,t,n){const r=this;let o=r.events.length,i,s;for(;o--;)if((r.events[o][1].type==="labelImage"||r.events[o][1].type==="labelLink")&&!r.events[o][1]._balanced){i=r.events[o][1];break}return a;function a(h){return i?i._inactive?d(h):(s=r.parser.defined.includes(hl(r.sliceSerialize({start:i.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(h),e.exit("labelMarker"),e.exit("labelEnd"),l):n(h)}function l(h){return h===40?e.attempt(Vue,u,s?u:d)(h):h===91?e.attempt(Hue,u,s?c:d)(h):s?u(h):d(h)}function c(h){return e.attempt(Wue,u,d)(h)}function u(h){return t(h)}function d(h){return i._balanced=!0,n(h)}}function Yue(e,t,n){return r;function r(d){return e.enter("resource"),e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),o}function o(d){return Yn(d)?xu(e,i)(d):i(d)}function i(d){return d===41?u(d):d4(e,s,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function s(d){return Yn(d)?xu(e,l)(d):u(d)}function a(d){return n(d)}function l(d){return d===34||d===39||d===40?h4(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):u(d)}function c(d){return Yn(d)?xu(e,u)(d):u(d)}function u(d){return d===41?(e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),e.exit("resource"),t):n(d)}}function Kue(e,t,n){const r=this;return o;function o(a){return f4.call(r,e,i,s,"reference","referenceMarker","referenceString")(a)}function i(a){return r.parser.defined.includes(hl(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function s(a){return n(a)}}function Xue(e,t,n){return r;function r(i){return e.enter("reference"),e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),o}function o(i){return i===93?(e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),e.exit("reference"),t):n(i)}}const Que={name:"labelStartImage",resolveAll:yS.resolveAll,tokenize:Jue};function Jue(e,t,n){const r=this;return o;function o(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),i}function i(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),s):n(a)}function s(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const Zue={name:"labelStartLink",resolveAll:yS.resolveAll,tokenize:ede};function ede(e,t,n){const r=this;return o;function o(s){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelLink"),i}function i(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}const s0={name:"lineEnding",tokenize:tde};function tde(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),yt(e,t,"linePrefix")}}const Eh={name:"thematicBreak",tokenize:nde};function nde(e,t,n){let r=0,o;return i;function i(c){return e.enter("thematicBreak"),s(c)}function s(c){return o=c,a(c)}function a(c){return c===o?(e.enter("thematicBreakSequence"),l(c)):r>=3&&(c===null||Pe(c))?(e.exit("thematicBreak"),t(c)):n(c)}function l(c){return c===o?(e.consume(c),r++,l):(e.exit("thematicBreakSequence"),rt(c)?yt(e,a,"whitespace")(c):a(c))}}const Ln={continuation:{tokenize:sde},exit:lde,name:"list",tokenize:ide},rde={partial:!0,tokenize:cde},ode={partial:!0,tokenize:ade};function ide(e,t,n){const r=this,o=r.events[r.events.length-1];let i=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,s=0;return a;function a(f){const p=r.containerState.type||(f===42||f===43||f===45?"listUnordered":"listOrdered");if(p==="listUnordered"?!r.containerState.marker||f===r.containerState.marker:Ay(f)){if(r.containerState.type||(r.containerState.type=p,e.enter(p,{_container:!0})),p==="listUnordered")return e.enter("listItemPrefix"),f===42||f===45?e.check(Eh,n,c)(f):c(f);if(!r.interrupt||f===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(f)}return n(f)}function l(f){return Ay(f)&&++s<10?(e.consume(f),l):(!r.interrupt||s<2)&&(r.containerState.marker?f===r.containerState.marker:f===41||f===46)?(e.exit("listItemValue"),c(f)):n(f)}function c(f){return e.enter("listItemMarker"),e.consume(f),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||f,e.check(dm,r.interrupt?n:u,e.attempt(rde,h,d))}function u(f){return r.containerState.initialBlankLine=!0,i++,h(f)}function d(f){return rt(f)?(e.enter("listItemPrefixWhitespace"),e.consume(f),e.exit("listItemPrefixWhitespace"),h):n(f)}function h(f){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(f)}}function sde(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(dm,o,i);function o(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,yt(e,t,"listItemIndent",r.containerState.size+1)(a)}function i(a){return r.containerState.furtherBlankLines||!rt(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(ode,t,s)(a))}function s(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,yt(e,e.attempt(Ln,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function ade(e,t,n){const r=this;return yt(e,o,"listItemIndent",r.containerState.size+1);function o(i){const s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?t(i):n(i)}}function lde(e){e.exit(this.containerState.type)}function cde(e,t,n){const r=this;return yt(e,o,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(i){const s=r.events[r.events.length-1];return!rt(i)&&s&&s[1].type==="listItemPrefixWhitespace"?t(i):n(i)}}const UP={name:"setextUnderline",resolveTo:ude,tokenize:dde};function ude(e,t){let n=e.length,r,o,i;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(o=n)}else e[n][1].type==="content"&&e.splice(n,1),!i&&e[n][1].type==="definition"&&(i=n);const s={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[o][1].type="setextHeadingText",i?(e.splice(o,0,["enter",s,t]),e.splice(i+1,0,["exit",e[r][1],t]),e[r][1].end={...e[i][1].end}):e[r][1]=s,e.push(["exit",s,t]),e}function dde(e,t,n){const r=this;let o;return i;function i(c){let u=r.events.length,d;for(;u--;)if(r.events[u][1].type!=="lineEnding"&&r.events[u][1].type!=="linePrefix"&&r.events[u][1].type!=="content"){d=r.events[u][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||d)?(e.enter("setextHeadingLine"),o=c,s(c)):n(c)}function s(c){return e.enter("setextHeadingLineSequence"),a(c)}function a(c){return c===o?(e.consume(c),a):(e.exit("setextHeadingLineSequence"),rt(c)?yt(e,l,"lineSuffix")(c):l(c))}function l(c){return c===null||Pe(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const fde={tokenize:hde};function hde(e){const t=this,n=e.attempt(dm,r,e.attempt(this.parser.constructs.flowInitial,o,yt(e,e.attempt(this.parser.constructs.flow,o,e.attempt(vue,o)),"linePrefix")));return n;function r(i){if(i===null){e.consume(i);return}return e.enter("lineEndingBlank"),e.consume(i),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function o(i){if(i===null){e.consume(i);return}return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const pde={resolveAll:g4()},gde=p4("string"),mde=p4("text");function p4(e){return{resolveAll:g4(e==="text"?bde:void 0),tokenize:t};function t(n){const r=this,o=this.parser.constructs[e],i=n.attempt(o,s,a);return s;function s(u){return c(u)?i(u):a(u)}function a(u){if(u===null){n.consume(u);return}return n.enter("data"),n.consume(u),l}function l(u){return c(u)?(n.exit("data"),i(u)):(n.consume(u),l)}function c(u){if(u===null)return!0;const d=o[u];let h=-1;if(d)for(;++h<d.length;){const f=d[h];if(!f.previous||f.previous.call(r,r.previous))return!0}return!1}}}function g4(e){return t;function t(n,r){let o=-1,i;for(;++o<=n.length;)i===void 0?n[o]&&n[o][1].type==="data"&&(i=o,o++):(!n[o]||n[o][1].type!=="data")&&(o!==i+2&&(n[i][1].end=n[o-1][1].end,n.splice(i+2,o-i-2),o=i+2),i=void 0);return e?e(n,r):n}}function bde(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],o=t.sliceStream(r);let i=o.length,s=-1,a=0,l;for(;i--;){const c=o[i];if(typeof c=="string"){for(s=c.length;c.charCodeAt(s-1)===32;)a++,s--;if(s)break;s=-1}else if(c===-2)l=!0,a++;else if(c!==-1){i++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(a=0),a){const c={type:n===e.length||l||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:i?s:r.start._bufferIndex+s,_index:r.start._index+i,line:r.end.line,column:r.end.column-a,offset:r.end.offset-a},end:{...r.end}};r.end={...c.start},r.start.offset===r.end.offset?Object.assign(r,c):(e.splice(n,0,["enter",c,t],["exit",c,t]),n+=2)}n++}return e}const vde={42:Ln,43:Ln,45:Ln,48:Ln,49:Ln,50:Ln,51:Ln,52:Ln,53:Ln,54:Ln,55:Ln,56:Ln,57:Ln,62:a4},yde={91:Cue},xde={[-2]:i0,[-1]:i0,32:i0},wde={35:kue,42:Eh,45:[UP,Eh],60:Iue,61:UP,95:Eh,96:HP,126:HP},Sde={38:c4,92:l4},Cde={[-5]:s0,[-4]:s0,[-3]:s0,33:Que,38:c4,42:Ny,60:[Zce,zue],91:Zue,92:[Pue,l4],93:yS,95:Ny,96:fue},_de={null:[Ny,pde]},Ede={null:[42,95]},Rde={null:[]},Pde=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Ede,contentInitial:yde,disable:Rde,document:vde,flow:wde,flowInitial:xde,insideSpan:_de,string:Sde,text:Cde},Symbol.toStringTag,{value:"Module"}));function Mde(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const o={},i=[];let s=[],a=[];const l={attempt:R(w),check:R(C),consume:x,enter:y,exit:_,interrupt:R(C,{interrupt:!0})},c={code:null,containerState:{},defineSkip:g,events:[],now:p,parser:e,previous:null,sliceSerialize:h,sliceStream:f,write:d};let u=t.tokenize.call(c,l);return t.resolveAll&&i.push(t),c;function d(T){return s=_r(s,T),b(),s[s.length-1]!==null?[]:(k(t,0),c.events=vS(i,c.events,c),c.events)}function h(T,N){return Ode(f(T),N)}function f(T){return kde(s,T)}function p(){const{_bufferIndex:T,_index:N,line:G,column:z,offset:O}=r;return{_bufferIndex:T,_index:N,line:G,column:z,offset:O}}function g(T){o[T.line]=T.column,I()}function b(){let T;for(;r._index<s.length;){const N=s[r._index];if(typeof N=="string")for(T=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===T&&r._bufferIndex<N.length;)v(N.charCodeAt(r._bufferIndex));else v(N)}}function v(T){u=u(T)}function x(T){Pe(T)?(r.line++,r.column=1,r.offset+=T===-3?2:1,I()):T!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===s[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=T}function y(T,N){const G=N||{};return G.type=T,G.start=p(),c.events.push(["enter",G,c]),a.push(G),G}function _(T){const N=a.pop();return N.end=p(),c.events.push(["exit",N,c]),N}function w(T,N){k(T,N.from)}function C(T,N){N.restore()}function R(T,N){return G;function G(z,O,A){let L,j,B,M;return Array.isArray(z)?F(z):"tokenize"in z?F([z]):W(z);function W(K){return H;function H(V){const Q=V!==null&&K[V],Z=V!==null&&K.null,ne=[...Array.isArray(Q)?Q:Q?[Q]:[],...Array.isArray(Z)?Z:Z?[Z]:[]];return F(ne)(V)}}function F(K){return L=K,j=0,K.length===0?A:P(K[j])}function P(K){return H;function H(V){return M=D(),B=K,K.partial||(c.currentConstruct=K),K.name&&c.parser.constructs.disable.null.includes(K.name)?q():K.tokenize.call(N?Object.assign(Object.create(c),N):c,l,U,q)(V)}}function U(K){return T(B,M),O}function q(K){return M.restore(),++j<L.length?P(L[j]):A}}}function k(T,N){T.resolveAll&&!i.includes(T)&&i.push(T),T.resolve&&Ro(c.events,N,c.events.length-N,T.resolve(c.events.slice(N),c)),T.resolveTo&&(c.events=T.resolveTo(c.events,c))}function D(){const T=p(),N=c.previous,G=c.currentConstruct,z=c.events.length,O=Array.from(a);return{from:z,restore:A};function A(){r=T,c.previous=N,c.currentConstruct=G,c.events.length=z,a=O,I()}}function I(){r.line in o&&r.column<2&&(r.column=o[r.line],r.offset+=o[r.line]-1)}}function kde(e,t){const n=t.start._index,r=t.start._bufferIndex,o=t.end._index,i=t.end._bufferIndex;let s;if(n===o)s=[e[n].slice(r,i)];else{if(s=e.slice(n,o),r>-1){const a=s[0];typeof a=="string"?s[0]=a.slice(r):s.shift()}i>0&&s.push(e[o].slice(0,i))}return s}function Ode(e,t){let n=-1;const r=[];let o;for(;++n<e.length;){const i=e[n];let s;if(typeof i=="string")s=i;else switch(i){case-5:{s="\r";break}case-4:{s=`
331
- `;break}case-3:{s=`\r
332
- `;break}case-2:{s=t?" ":" ";break}case-1:{if(!t&&o)continue;s=" ";break}default:s=String.fromCharCode(i)}o=i===-2,r.push(s)}return r.join("")}function Dde(e){const r={constructs:Lce([Pde,...(e||{}).extensions||[]]),content:o(qce),defined:[],document:o(Yce),flow:o(fde),lazy:{},string:o(gde),text:o(mde)};return r;function o(i){return s;function s(a){return Mde(r,i,a)}}}function Tde(e){for(;!u4(e););return e}const qP=/[\0\t\n\r]/g;function Ide(){let e=1,t="",n=!0,r;return o;function o(i,s,a){const l=[];let c,u,d,h,f;for(i=t+(typeof i=="string"?i.toString():new TextDecoder(s||void 0).decode(i)),d=0,t="",n&&(i.charCodeAt(0)===65279&&d++,n=void 0);d<i.length;){if(qP.lastIndex=d,c=qP.exec(i),h=c&&c.index!==void 0?c.index:i.length,f=i.charCodeAt(h),!c){t=i.slice(d);break}if(f===10&&d===h&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),d<h&&(l.push(i.slice(d,h)),e+=h-d),f){case 0:{l.push(65533),e++;break}case 9:{for(u=Math.ceil(e/4)*4,l.push(-2);e++<u;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}d=h+1}return a&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const Ade=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Nde(e){return e.replace(Ade,jde)}function jde(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const o=n.charCodeAt(1),i=o===120||o===88;return s4(n.slice(i?2:1),i?16:10)}return bS(n)||e}const m4={}.hasOwnProperty;function Fde(e,t,n){return typeof t!="string"&&(n=t,t=void 0),Lde(n)(Tde(Dde(n).document().write(Ide()(e,t,!0))))}function Lde(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(me),autolinkProtocol:D,autolinkEmail:D,atxHeading:i(ue),blockQuote:i(Z),characterEscape:D,characterReference:D,codeFenced:i(ne),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:i(ne,s),codeText:i(J,s),codeTextData:D,data:D,codeFlowValue:D,definition:i(oe),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:i(ee),hardBreakEscape:i(de),hardBreakTrailing:i(de),htmlFlow:i(ye,s),htmlFlowData:D,htmlText:i(ye,s),htmlTextData:D,image:i(he),label:s,link:i(me),listItem:i(et),listItemValue:h,listOrdered:i(je,d),listUnordered:i(je),paragraph:i(Bt),reference:P,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:i(ue),strong:i(Ue),thematicBreak:i(wt)},exit:{atxHeading:l(),atxHeadingSequence:w,autolink:l(),autolinkEmail:Q,autolinkProtocol:V,blockQuote:l(),characterEscapeValue:I,characterReferenceMarkerHexadecimal:q,characterReferenceMarkerNumeric:q,characterReferenceValue:K,characterReference:H,codeFenced:l(b),codeFencedFence:g,codeFencedFenceInfo:f,codeFencedFenceMeta:p,codeFlowValue:I,codeIndented:l(v),codeText:l(O),codeTextData:I,data:I,definition:l(),definitionDestinationString:_,definitionLabelString:x,definitionTitleString:y,emphasis:l(),hardBreakEscape:l(N),hardBreakTrailing:l(N),htmlFlow:l(G),htmlFlowData:I,htmlText:l(z),htmlTextData:I,image:l(L),label:B,labelText:j,lineEnding:T,link:l(A),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:U,resourceDestinationString:M,resourceTitleString:W,resource:F,setextHeading:l(k),setextHeadingLineSequence:R,setextHeadingText:C,strong:l(),thematicBreak:l()}};b4(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(te){let le={type:"root",children:[]};const ve={stack:[le],tokenStack:[],config:t,enter:a,exit:c,buffer:s,resume:u,data:n},Re=[];let Ve=-1;for(;++Ve<te.length;)if(te[Ve][1].type==="listOrdered"||te[Ve][1].type==="listUnordered")if(te[Ve][0]==="enter")Re.push(Ve);else{const sn=Re.pop();Ve=o(te,sn,Ve)}for(Ve=-1;++Ve<te.length;){const sn=t[te[Ve][0]];m4.call(sn,te[Ve][1].type)&&sn[te[Ve][1].type].call(Object.assign({sliceSerialize:te[Ve][2].sliceSerialize},ve),te[Ve][1])}if(ve.tokenStack.length>0){const sn=ve.tokenStack[ve.tokenStack.length-1];(sn[1]||GP).call(ve,void 0,sn[0])}for(le.position={start:mi(te.length>0?te[0][1].start:{line:1,column:1,offset:0}),end:mi(te.length>0?te[te.length-2][1].end:{line:1,column:1,offset:0})},Ve=-1;++Ve<t.transforms.length;)le=t.transforms[Ve](le)||le;return le}function o(te,le,ve){let Re=le-1,Ve=-1,sn=!1,er,wn,Tn,an;for(;++Re<=ve;){const St=te[Re];switch(St[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{St[0]==="enter"?Ve++:Ve--,an=void 0;break}case"lineEndingBlank":{St[0]==="enter"&&(er&&!an&&!Ve&&!Tn&&(Tn=Re),an=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:an=void 0}if(!Ve&&St[0]==="enter"&&St[1].type==="listItemPrefix"||Ve===-1&&St[0]==="exit"&&(St[1].type==="listUnordered"||St[1].type==="listOrdered")){if(er){let Xr=Re;for(wn=void 0;Xr--;){const In=te[Xr];if(In[1].type==="lineEnding"||In[1].type==="lineEndingBlank"){if(In[0]==="exit")continue;wn&&(te[wn][1].type="lineEndingBlank",sn=!0),In[1].type="lineEnding",wn=Xr}else if(!(In[1].type==="linePrefix"||In[1].type==="blockQuotePrefix"||In[1].type==="blockQuotePrefixWhitespace"||In[1].type==="blockQuoteMarker"||In[1].type==="listItemIndent"))break}Tn&&(!wn||Tn<wn)&&(er._spread=!0),er.end=Object.assign({},wn?te[wn][1].start:St[1].end),te.splice(wn||Re,0,["exit",er,St[2]]),Re++,ve++}if(St[1].type==="listItemPrefix"){const Xr={type:"listItem",_spread:!1,start:Object.assign({},St[1].start),end:void 0};er=Xr,te.splice(Re,0,["enter",Xr,St[2]]),Re++,ve++,Tn=void 0,an=!0}}}return te[le][1]._spread=sn,ve}function i(te,le){return ve;function ve(Re){a.call(this,te(Re),Re),le&&le.call(this,Re)}}function s(){this.stack.push({type:"fragment",children:[]})}function a(te,le,ve){this.stack[this.stack.length-1].children.push(te),this.stack.push(te),this.tokenStack.push([le,ve||void 0]),te.position={start:mi(le.start),end:void 0}}function l(te){return le;function le(ve){te&&te.call(this,ve),c.call(this,ve)}}function c(te,le){const ve=this.stack.pop(),Re=this.tokenStack.pop();if(Re)Re[0].type!==te.type&&(le?le.call(this,te,Re[0]):(Re[1]||GP).call(this,te,Re[0]));else throw new Error("Cannot close `"+te.type+"` ("+yu({start:te.start,end:te.end})+"): it’s not open");ve.position.end=mi(te.end)}function u(){return jce(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function h(te){if(this.data.expectingFirstListItemValue){const le=this.stack[this.stack.length-2];le.start=Number.parseInt(this.sliceSerialize(te),10),this.data.expectingFirstListItemValue=void 0}}function f(){const te=this.resume(),le=this.stack[this.stack.length-1];le.lang=te}function p(){const te=this.resume(),le=this.stack[this.stack.length-1];le.meta=te}function g(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function b(){const te=this.resume(),le=this.stack[this.stack.length-1];le.value=te.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function v(){const te=this.resume(),le=this.stack[this.stack.length-1];le.value=te.replace(/(\r?\n|\r)$/g,"")}function x(te){const le=this.resume(),ve=this.stack[this.stack.length-1];ve.label=le,ve.identifier=hl(this.sliceSerialize(te)).toLowerCase()}function y(){const te=this.resume(),le=this.stack[this.stack.length-1];le.title=te}function _(){const te=this.resume(),le=this.stack[this.stack.length-1];le.url=te}function w(te){const le=this.stack[this.stack.length-1];if(!le.depth){const ve=this.sliceSerialize(te).length;le.depth=ve}}function C(){this.data.setextHeadingSlurpLineEnding=!0}function R(te){const le=this.stack[this.stack.length-1];le.depth=this.sliceSerialize(te).codePointAt(0)===61?1:2}function k(){this.data.setextHeadingSlurpLineEnding=void 0}function D(te){const ve=this.stack[this.stack.length-1].children;let Re=ve[ve.length-1];(!Re||Re.type!=="text")&&(Re=Zn(),Re.position={start:mi(te.start),end:void 0},ve.push(Re)),this.stack.push(Re)}function I(te){const le=this.stack.pop();le.value+=this.sliceSerialize(te),le.position.end=mi(te.end)}function T(te){const le=this.stack[this.stack.length-1];if(this.data.atHardBreak){const ve=le.children[le.children.length-1];ve.position.end=mi(te.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(le.type)&&(D.call(this,te),I.call(this,te))}function N(){this.data.atHardBreak=!0}function G(){const te=this.resume(),le=this.stack[this.stack.length-1];le.value=te}function z(){const te=this.resume(),le=this.stack[this.stack.length-1];le.value=te}function O(){const te=this.resume(),le=this.stack[this.stack.length-1];le.value=te}function A(){const te=this.stack[this.stack.length-1];if(this.data.inReference){const le=this.data.referenceType||"shortcut";te.type+="Reference",te.referenceType=le,delete te.url,delete te.title}else delete te.identifier,delete te.label;this.data.referenceType=void 0}function L(){const te=this.stack[this.stack.length-1];if(this.data.inReference){const le=this.data.referenceType||"shortcut";te.type+="Reference",te.referenceType=le,delete te.url,delete te.title}else delete te.identifier,delete te.label;this.data.referenceType=void 0}function j(te){const le=this.sliceSerialize(te),ve=this.stack[this.stack.length-2];ve.label=Nde(le),ve.identifier=hl(le).toLowerCase()}function B(){const te=this.stack[this.stack.length-1],le=this.resume(),ve=this.stack[this.stack.length-1];if(this.data.inReference=!0,ve.type==="link"){const Re=te.children;ve.children=Re}else ve.alt=le}function M(){const te=this.resume(),le=this.stack[this.stack.length-1];le.url=te}function W(){const te=this.resume(),le=this.stack[this.stack.length-1];le.title=te}function F(){this.data.inReference=void 0}function P(){this.data.referenceType="collapsed"}function U(te){const le=this.resume(),ve=this.stack[this.stack.length-1];ve.label=le,ve.identifier=hl(this.sliceSerialize(te)).toLowerCase(),this.data.referenceType="full"}function q(te){this.data.characterReferenceType=te.type}function K(te){const le=this.sliceSerialize(te),ve=this.data.characterReferenceType;let Re;ve?(Re=s4(le,ve==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Re=bS(le);const Ve=this.stack[this.stack.length-1];Ve.value+=Re}function H(te){const le=this.stack.pop();le.position.end=mi(te.end)}function V(te){I.call(this,te);const le=this.stack[this.stack.length-1];le.url=this.sliceSerialize(te)}function Q(te){I.call(this,te);const le=this.stack[this.stack.length-1];le.url="mailto:"+this.sliceSerialize(te)}function Z(){return{type:"blockquote",children:[]}}function ne(){return{type:"code",lang:null,meta:null,value:""}}function J(){return{type:"inlineCode",value:""}}function oe(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function ee(){return{type:"emphasis",children:[]}}function ue(){return{type:"heading",depth:0,children:[]}}function de(){return{type:"break"}}function ye(){return{type:"html",value:""}}function he(){return{type:"image",title:null,url:"",alt:null}}function me(){return{type:"link",title:null,url:"",children:[]}}function je(te){return{type:"list",ordered:te.type==="listOrdered",start:null,spread:te._spread,children:[]}}function et(te){return{type:"listItem",spread:te._spread,checked:null,children:[]}}function Bt(){return{type:"paragraph",children:[]}}function Ue(){return{type:"strong",children:[]}}function Zn(){return{type:"text",value:""}}function wt(){return{type:"thematicBreak"}}}function mi(e){return{line:e.line,column:e.column,offset:e.offset}}function b4(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?b4(e,r):$de(e,r)}}function $de(e,t){let n;for(n in t)if(m4.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function GP(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+yu({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+yu({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+yu({start:t.start,end:t.end})+") is still open")}function zde(e){const t=this;t.parser=n;function n(r){return Fde(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function Bde(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function Vde(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
333
- `}]}function Hde(e,t){const n=t.value?t.value+`
334
- `:"",r={};t.lang&&(r.className=["language-"+t.lang]);let o={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(o.data={meta:t.meta}),e.patch(t,o),o=e.applyData(t,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(t,o),o}function Wde(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Ude(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function qde(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),o=pc(r.toLowerCase()),i=e.footnoteOrder.indexOf(r);let s,a=e.footnoteCounts.get(r);a===void 0?(a=0,e.footnoteOrder.push(r),s=e.footnoteOrder.length):s=i+1,a+=1,e.footnoteCounts.set(r,a);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+o,id:n+"fnref-"+o+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(s)}]};e.patch(t,l);const c={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,c),e.applyData(t,c)}function Gde(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Yde(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function v4(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const o=e.all(t),i=o[0];i&&i.type==="text"?i.value="["+i.value:o.unshift({type:"text",value:"["});const s=o[o.length-1];return s&&s.type==="text"?s.value+=r:o.push({type:"text",value:r}),o}function Kde(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return v4(e,t);const o={src:pc(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(o.title=r.title);const i={type:"element",tagName:"img",properties:o,children:[]};return e.patch(t,i),e.applyData(t,i)}function Xde(e,t){const n={src:pc(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function Qde(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function Jde(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return v4(e,t);const o={href:pc(r.url||"")};r.title!==null&&r.title!==void 0&&(o.title=r.title);const i={type:"element",tagName:"a",properties:o,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function Zde(e,t){const n={href:pc(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function efe(e,t,n){const r=e.all(t),o=n?tfe(n):y4(t),i={},s=[];if(typeof t.checked=="boolean"){const u=r[0];let d;u&&u.type==="element"&&u.tagName==="p"?d=u:(d={type:"element",tagName:"p",properties:{},children:[]},r.unshift(d)),d.children.length>0&&d.children.unshift({type:"text",value:" "}),d.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),i.className=["task-list-item"]}let a=-1;for(;++a<r.length;){const u=r[a];(o||a!==0||u.type!=="element"||u.tagName!=="p")&&s.push({type:"text",value:`
335
- `}),u.type==="element"&&u.tagName==="p"&&!o?s.push(...u.children):s.push(u)}const l=r[r.length-1];l&&(o||l.type!=="element"||l.tagName!=="p")&&s.push({type:"text",value:`
336
- `});const c={type:"element",tagName:"li",properties:i,children:s};return e.patch(t,c),e.applyData(t,c)}function tfe(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=y4(n[r])}return t}function y4(e){const t=e.spread;return t??e.children.length>1}function nfe(e,t){const n={},r=e.all(t);let o=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++o<r.length;){const s=r[o];if(s.type==="element"&&s.tagName==="li"&&s.properties&&Array.isArray(s.properties.className)&&s.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const i={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,i),e.applyData(t,i)}function rfe(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function ofe(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function ife(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function sfe(e,t){const n=e.all(t),r=n.shift(),o=[];if(r){const s={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],s),o.push(s)}if(n.length>0){const s={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},a=hS(t.children[1]),l=Zj(t.children[t.children.length-1]);a&&l&&(s.position={start:a,end:l}),o.push(s)}const i={type:"element",tagName:"table",properties:{},children:e.wrap(o,!0)};return e.patch(t,i),e.applyData(t,i)}function afe(e,t,n){const r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?"th":"td",s=n&&n.type==="table"?n.align:void 0,a=s?s.length:t.children.length;let l=-1;const c=[];for(;++l<a;){const d=t.children[l],h={},f=s?s[l]:void 0;f&&(h.align=f);let p={type:"element",tagName:i,properties:h,children:[]};d&&(p.children=e.all(d),e.patch(d,p),p=e.applyData(d,p)),c.push(p)}const u={type:"element",tagName:"tr",properties:{},children:e.wrap(c,!0)};return e.patch(t,u),e.applyData(t,u)}function lfe(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const YP=9,KP=32;function cfe(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),o=0;const i=[];for(;r;)i.push(XP(t.slice(o,r.index),o>0,!0),r[0]),o=r.index+r[0].length,r=n.exec(t);return i.push(XP(t.slice(o),o>0,!1)),i.join("")}function XP(e,t,n){let r=0,o=e.length;if(t){let i=e.codePointAt(r);for(;i===YP||i===KP;)r++,i=e.codePointAt(r)}if(n){let i=e.codePointAt(o-1);for(;i===YP||i===KP;)o--,i=e.codePointAt(o-1)}return o>r?e.slice(r,o):""}function ufe(e,t){const n={type:"text",value:cfe(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function dfe(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const ffe={blockquote:Bde,break:Vde,code:Hde,delete:Wde,emphasis:Ude,footnoteReference:qde,heading:Gde,html:Yde,imageReference:Kde,image:Xde,inlineCode:Qde,linkReference:Jde,link:Zde,listItem:efe,list:nfe,paragraph:rfe,root:ofe,strong:ife,table:sfe,tableCell:lfe,tableRow:afe,text:ufe,thematicBreak:dfe,toml:Jf,yaml:Jf,definition:Jf,footnoteDefinition:Jf};function Jf(){}const x4=-1,fm=0,wu=1,Dp=2,xS=3,wS=4,SS=5,CS=6,w4=7,S4=8,QP=typeof self=="object"?self:globalThis,hfe=(e,t)=>{const n=(o,i)=>(e.set(i,o),o),r=o=>{if(e.has(o))return e.get(o);const[i,s]=t[o];switch(i){case fm:case x4:return n(s,o);case wu:{const a=n([],o);for(const l of s)a.push(r(l));return a}case Dp:{const a=n({},o);for(const[l,c]of s)a[r(l)]=r(c);return a}case xS:return n(new Date(s),o);case wS:{const{source:a,flags:l}=s;return n(new RegExp(a,l),o)}case SS:{const a=n(new Map,o);for(const[l,c]of s)a.set(r(l),r(c));return a}case CS:{const a=n(new Set,o);for(const l of s)a.add(r(l));return a}case w4:{const{name:a,message:l}=s;return n(new QP[a](l),o)}case S4:return n(BigInt(s),o);case"BigInt":return n(Object(BigInt(s)),o);case"ArrayBuffer":return n(new Uint8Array(s).buffer,s);case"DataView":{const{buffer:a}=new Uint8Array(s);return n(new DataView(a),s)}}return n(new QP[i](s),o)};return r},JP=e=>hfe(new Map,e)(0),$a="",{toString:pfe}={},{keys:gfe}=Object,jc=e=>{const t=typeof e;if(t!=="object"||!e)return[fm,t];const n=pfe.call(e).slice(8,-1);switch(n){case"Array":return[wu,$a];case"Object":return[Dp,$a];case"Date":return[xS,$a];case"RegExp":return[wS,$a];case"Map":return[SS,$a];case"Set":return[CS,$a];case"DataView":return[wu,n]}return n.includes("Array")?[wu,n]:n.includes("Error")?[w4,n]:[Dp,n]},Zf=([e,t])=>e===fm&&(t==="function"||t==="symbol"),mfe=(e,t,n,r)=>{const o=(s,a)=>{const l=r.push(s)-1;return n.set(a,l),l},i=s=>{if(n.has(s))return n.get(s);let[a,l]=jc(s);switch(a){case fm:{let u=s;switch(l){case"bigint":a=S4,u=s.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);u=null;break;case"undefined":return o([x4],s)}return o([a,u],s)}case wu:{if(l){let h=s;return l==="DataView"?h=new Uint8Array(s.buffer):l==="ArrayBuffer"&&(h=new Uint8Array(s)),o([l,[...h]],s)}const u=[],d=o([a,u],s);for(const h of s)u.push(i(h));return d}case Dp:{if(l)switch(l){case"BigInt":return o([l,s.toString()],s);case"Boolean":case"Number":case"String":return o([l,s.valueOf()],s)}if(t&&"toJSON"in s)return i(s.toJSON());const u=[],d=o([a,u],s);for(const h of gfe(s))(e||!Zf(jc(s[h])))&&u.push([i(h),i(s[h])]);return d}case xS:return o([a,s.toISOString()],s);case wS:{const{source:u,flags:d}=s;return o([a,{source:u,flags:d}],s)}case SS:{const u=[],d=o([a,u],s);for(const[h,f]of s)(e||!(Zf(jc(h))||Zf(jc(f))))&&u.push([i(h),i(f)]);return d}case CS:{const u=[],d=o([a,u],s);for(const h of s)(e||!Zf(jc(h)))&&u.push(i(h));return d}}const{message:c}=s;return o([a,{name:l,message:c}],s)};return i},ZP=(e,{json:t,lossy:n}={})=>{const r=[];return mfe(!(t||n),!!t,new Map,r)(e),r},Tp=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?JP(ZP(e,t)):structuredClone(e):(e,t)=>JP(ZP(e,t));function bfe(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function vfe(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function yfe(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||bfe,r=e.options.footnoteBackLabel||vfe,o=e.options.footnoteLabel||"Footnotes",i=e.options.footnoteLabelTagName||"h2",s=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let l=-1;for(;++l<e.footnoteOrder.length;){const c=e.footnoteById.get(e.footnoteOrder[l]);if(!c)continue;const u=e.all(c),d=String(c.identifier).toUpperCase(),h=pc(d.toLowerCase());let f=0;const p=[],g=e.footnoteCounts.get(d);for(;g!==void 0&&++f<=g;){p.length>0&&p.push({type:"text",value:" "});let x=typeof n=="string"?n:n(l,f);typeof x=="string"&&(x={type:"text",value:x}),p.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+h+(f>1?"-"+f:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,f),className:["data-footnote-backref"]},children:Array.isArray(x)?x:[x]})}const b=u[u.length-1];if(b&&b.type==="element"&&b.tagName==="p"){const x=b.children[b.children.length-1];x&&x.type==="text"?x.value+=" ":b.children.push({type:"text",value:" "}),b.children.push(...p)}else u.push(...p);const v={type:"element",tagName:"li",properties:{id:t+"fn-"+h},children:e.wrap(u,!0)};e.patch(c,v),a.push(v)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...Tp(s),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:`
337
- `},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)},{type:"text",value:`
338
- `}]}}const C4=function(e){if(e==null)return Cfe;if(typeof e=="function")return hm(e);if(typeof e=="object")return Array.isArray(e)?xfe(e):wfe(e);if(typeof e=="string")return Sfe(e);throw new Error("Expected function, string, or object as test")};function xfe(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=C4(e[n]);return hm(r);function r(...o){let i=-1;for(;++i<t.length;)if(t[i].apply(this,o))return!0;return!1}}function wfe(e){const t=e;return hm(n);function n(r){const o=r;let i;for(i in e)if(o[i]!==t[i])return!1;return!0}}function Sfe(e){return hm(t);function t(n){return n&&n.type===e}}function hm(e){return t;function t(n,r,o){return!!(_fe(n)&&e.call(this,n,typeof r=="number"?r:void 0,o||void 0))}}function Cfe(){return!0}function _fe(e){return e!==null&&typeof e=="object"&&"type"in e}const _4=[],Efe=!0,e2=!1,Rfe="skip";function Pfe(e,t,n,r){let o;typeof t=="function"&&typeof n!="function"?(r=n,n=t):o=t;const i=C4(o),s=r?-1:1;a(e,void 0,[])();function a(l,c,u){const d=l&&typeof l=="object"?l:{};if(typeof d.type=="string"){const f=typeof d.tagName=="string"?d.tagName:typeof d.name=="string"?d.name:void 0;Object.defineProperty(h,"name",{value:"node ("+(l.type+(f?"<"+f+">":""))+")"})}return h;function h(){let f=_4,p,g,b;if((!t||i(l,c,u[u.length-1]||void 0))&&(f=Mfe(n(l,u)),f[0]===e2))return f;if("children"in l&&l.children){const v=l;if(v.children&&f[0]!==Rfe)for(g=(r?v.children.length:-1)+s,b=u.concat(v);g>-1&&g<v.children.length;){const x=v.children[g];if(p=a(x,g,b)(),p[0]===e2)return p;g=typeof p[1]=="number"?p[1]:g+s}}return f}}}function Mfe(e){return Array.isArray(e)?e:typeof e=="number"?[Efe,e]:e==null?_4:[e]}function E4(e,t,n,r){let o,i,s;typeof t=="function"?(i=void 0,s=t,o=n):(i=t,s=n,o=r),Pfe(e,i,a,o);function a(l,c){const u=c[c.length-1],d=u?u.children.indexOf(l):void 0;return s(l,d,u)}}const jy={}.hasOwnProperty,kfe={};function Ofe(e,t){const n=t||kfe,r=new Map,o=new Map,i=new Map,s={...ffe,...n.handlers},a={all:c,applyData:Tfe,definitionById:r,footnoteById:o,footnoteCounts:i,footnoteOrder:[],handlers:s,one:l,options:n,patch:Dfe,wrap:Afe};return E4(e,function(u){if(u.type==="definition"||u.type==="footnoteDefinition"){const d=u.type==="definition"?r:o,h=String(u.identifier).toUpperCase();d.has(h)||d.set(h,u)}}),a;function l(u,d){const h=u.type,f=a.handlers[h];if(jy.call(a.handlers,h)&&f)return f(a,u,d);if(a.options.passThrough&&a.options.passThrough.includes(h)){if("children"in u){const{children:g,...b}=u,v=Tp(b);return v.children=a.all(u),v}return Tp(u)}return(a.options.unknownHandler||Ife)(a,u,d)}function c(u){const d=[];if("children"in u){const h=u.children;let f=-1;for(;++f<h.length;){const p=a.one(h[f],u);if(p){if(f&&h[f-1].type==="break"&&(!Array.isArray(p)&&p.type==="text"&&(p.value=t2(p.value)),!Array.isArray(p)&&p.type==="element")){const g=p.children[0];g&&g.type==="text"&&(g.value=t2(g.value))}Array.isArray(p)?d.push(...p):d.push(p)}}}return d}}function Dfe(e,t){e.position&&(t.position=pce(e))}function Tfe(e,t){let n=t;if(e&&e.data){const r=e.data.hName,o=e.data.hChildren,i=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const s="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:s}}n.type==="element"&&i&&Object.assign(n.properties,Tp(i)),"children"in n&&n.children&&o!==null&&o!==void 0&&(n.children=o)}return n}function Ife(e,t){const n=t.data||{},r="value"in t&&!(jy.call(n,"hProperties")||jy.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Afe(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
339
- `});++r<e.length;)r&&n.push({type:"text",value:`
340
- `}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
341
- `}),n}function t2(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function n2(e,t){const n=Ofe(e,t),r=n.one(e,void 0),o=yfe(n),i=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return o&&i.children.push({type:"text",value:`
342
- `},o),i}function Nfe(e,t){return e&&"run"in e?async function(n,r){const o=n2(n,{file:r,...t});await e.run(o,r)}:function(n,r){return n2(n,{file:r,...e||t})}}function r2(e){if(e)throw e}var Rh=Object.prototype.hasOwnProperty,R4=Object.prototype.toString,o2=Object.defineProperty,i2=Object.getOwnPropertyDescriptor,s2=function(t){return typeof Array.isArray=="function"?Array.isArray(t):R4.call(t)==="[object Array]"},a2=function(t){if(!t||R4.call(t)!=="[object Object]")return!1;var n=Rh.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&Rh.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var o;for(o in t);return typeof o>"u"||Rh.call(t,o)},l2=function(t,n){o2&&n.name==="__proto__"?o2(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},c2=function(t,n){if(n==="__proto__")if(Rh.call(t,n)){if(i2)return i2(t,n).value}else return;return t[n]},jfe=function e(){var t,n,r,o,i,s,a=arguments[0],l=1,c=arguments.length,u=!1;for(typeof a=="boolean"&&(u=a,a=arguments[1]||{},l=2),(a==null||typeof a!="object"&&typeof a!="function")&&(a={});l<c;++l)if(t=arguments[l],t!=null)for(n in t)r=c2(a,n),o=c2(t,n),a!==o&&(u&&o&&(a2(o)||(i=s2(o)))?(i?(i=!1,s=r&&s2(r)?r:[]):s=r&&a2(r)?r:{},l2(a,{name:n,newValue:e(u,s,o)})):typeof o<"u"&&l2(a,{name:n,newValue:o}));return a};const a0=Yi(jfe);function Fy(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Ffe(){const e=[],t={run:n,use:r};return t;function n(...o){let i=-1;const s=o.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);a(null,...o);function a(l,...c){const u=e[++i];let d=-1;if(l){s(l);return}for(;++d<o.length;)(c[d]===null||c[d]===void 0)&&(c[d]=o[d]);o=c,u?Lfe(u,a)(...c):s(null,...c)}}function r(o){if(typeof o!="function")throw new TypeError("Expected `middelware` to be a function, not "+o);return e.push(o),t}}function Lfe(e,t){let n;return r;function r(...s){const a=e.length>s.length;let l;a&&s.push(o);try{l=e.apply(this,s)}catch(c){const u=c;if(a&&n)throw u;return o(u)}a||(l&&l.then&&typeof l.then=="function"?l.then(i,o):l instanceof Error?o(l):i(l))}function o(s,...a){n||(n=!0,t(s,...a))}function i(s){o(null,s)}}const to={basename:$fe,dirname:zfe,extname:Bfe,join:Vfe,sep:"/"};function $fe(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Hd(e);let n=0,r=-1,o=e.length,i;if(t===void 0||t.length===0||t.length>e.length){for(;o--;)if(e.codePointAt(o)===47){if(i){n=o+1;break}}else r<0&&(i=!0,r=o+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let s=-1,a=t.length-1;for(;o--;)if(e.codePointAt(o)===47){if(i){n=o+1;break}}else s<0&&(i=!0,s=o+1),a>-1&&(e.codePointAt(o)===t.codePointAt(a--)?a<0&&(r=o):(a=-1,r=s));return n===r?r=s:r<0&&(r=e.length),e.slice(n,r)}function zfe(e){if(Hd(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function Bfe(e){Hd(e);let t=e.length,n=-1,r=0,o=-1,i=0,s;for(;t--;){const a=e.codePointAt(t);if(a===47){if(s){r=t+1;break}continue}n<0&&(s=!0,n=t+1),a===46?o<0?o=t:i!==1&&(i=1):o>-1&&(i=-1)}return o<0||n<0||i===0||i===1&&o===n-1&&o===r+1?"":e.slice(o,n)}function Vfe(...e){let t=-1,n;for(;++t<e.length;)Hd(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":Hfe(n)}function Hfe(e){Hd(e);const t=e.codePointAt(0)===47;let n=Wfe(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function Wfe(e,t){let n="",r=0,o=-1,i=0,s=-1,a,l;for(;++s<=e.length;){if(s<e.length)a=e.codePointAt(s);else{if(a===47)break;a=47}if(a===47){if(!(o===s-1||i===1))if(o!==s-1&&i===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),o=s,i=0;continue}}else if(n.length>0){n="",r=0,o=s,i=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(o+1,s):n=e.slice(o+1,s),r=s-o-1;o=s,i=0}else a===46&&i>-1?i++:i=-1}return n}function Hd(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Ufe={cwd:qfe};function qfe(){return"/"}function Ly(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Gfe(e){if(typeof e=="string")e=new URL(e);else if(!Ly(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return Yfe(e)}function Yfe(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const o=new TypeError("File URL path must not include encoded / characters");throw o.code="ERR_INVALID_FILE_URL_PATH",o}}return decodeURIComponent(t)}const l0=["history","path","basename","stem","extname","dirname"];class P4{constructor(t){let n;t?Ly(t)?n={path:t}:typeof t=="string"||Kfe(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":Ufe.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<l0.length;){const i=l0[r];i in n&&n[i]!==void 0&&n[i]!==null&&(this[i]=i==="history"?[...n[i]]:n[i])}let o;for(o in n)l0.includes(o)||(this[o]=n[o])}get basename(){return typeof this.path=="string"?to.basename(this.path):void 0}set basename(t){u0(t,"basename"),c0(t,"basename"),this.path=to.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?to.dirname(this.path):void 0}set dirname(t){u2(this.basename,"dirname"),this.path=to.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?to.extname(this.path):void 0}set extname(t){if(c0(t,"extname"),u2(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=to.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Ly(t)&&(t=Gfe(t)),u0(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?to.basename(this.path,this.extname):void 0}set stem(t){u0(t,"stem"),c0(t,"stem"),this.path=to.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const o=this.message(t,n,r);throw o.fatal=!0,o}info(t,n,r){const o=this.message(t,n,r);return o.fatal=void 0,o}message(t,n,r){const o=new xn(t,n,r);return this.path&&(o.name=this.path+":"+o.name,o.file=this.path),o.fatal=!1,this.messages.push(o),o}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function c0(e,t){if(e&&e.includes(to.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+to.sep+"`")}function u0(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function u2(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function Kfe(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Xfe=function(e){const r=this.constructor.prototype,o=r[e],i=function(){return o.apply(i,arguments)};return Object.setPrototypeOf(i,r),i},Qfe={}.hasOwnProperty;class _S extends Xfe{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=Ffe()}copy(){const t=new _S;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(a0(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(h0("data",this.frozen),this.namespace[t]=n,this):Qfe.call(this.namespace,t)&&this.namespace[t]||void 0:t?(h0("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const o=n.call(t,...r);typeof o=="function"&&this.transformers.use(o)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=eh(t),r=this.parser||this.Parser;return d0("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),d0("process",this.parser||this.Parser),f0("process",this.compiler||this.Compiler),n?o(void 0,n):new Promise(o);function o(i,s){const a=eh(t),l=r.parse(a);r.run(l,a,function(u,d,h){if(u||!d||!h)return c(u);const f=d,p=r.stringify(f,h);ehe(p)?h.value=p:h.result=p,c(u,h)});function c(u,d){u||!d?s(u):i?i(d):n(void 0,d)}}}processSync(t){let n=!1,r;return this.freeze(),d0("processSync",this.parser||this.Parser),f0("processSync",this.compiler||this.Compiler),this.process(t,o),f2("processSync","process",n),r;function o(i,s){n=!0,r2(i),r=s}}run(t,n,r){d2(t),this.freeze();const o=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?i(void 0,r):new Promise(i);function i(s,a){const l=eh(n);o.run(t,l,c);function c(u,d,h){const f=d||t;u?a(u):s?s(f):r(void 0,f,h)}}}runSync(t,n){let r=!1,o;return this.run(t,n,i),f2("runSync","run",r),o;function i(s,a){r2(s),o=a,r=!0}}stringify(t,n){this.freeze();const r=eh(n),o=this.compiler||this.Compiler;return f0("stringify",o),d2(t),o(t,r)}use(t,...n){const r=this.attachers,o=this.namespace;if(h0("use",this.frozen),t!=null)if(typeof t=="function")l(t,n);else if(typeof t=="object")Array.isArray(t)?a(t):s(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function i(c){if(typeof c=="function")l(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[u,...d]=c;l(u,d)}else s(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function s(c){if(!("plugins"in c)&&!("settings"in c))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(c.plugins),c.settings&&(o.settings=a0(!0,o.settings,c.settings))}function a(c){let u=-1;if(c!=null)if(Array.isArray(c))for(;++u<c.length;){const d=c[u];i(d)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function l(c,u){let d=-1,h=-1;for(;++d<r.length;)if(r[d][0]===c){h=d;break}if(h===-1)r.push([c,...u]);else if(u.length>0){let[f,...p]=u;const g=r[h][1];Fy(g)&&Fy(f)&&(f=a0(!0,g,f)),r[h]=[c,f,...p]}}}}const Jfe=new _S().freeze();function d0(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function f0(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function h0(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function d2(e){if(!Fy(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function f2(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function eh(e){return Zfe(e)?e:new P4(e)}function Zfe(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function ehe(e){return typeof e=="string"||the(e)}function the(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const nhe="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",h2=[],p2={allowDangerousHtml:!0},rhe=/^(https?|ircs?|mailto|xmpp)$/i,ohe=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function ihe(e){const t=she(e),n=ahe(e);return lhe(t.runSync(t.parse(n),n),e)}function she(e){const t=e.rehypePlugins||h2,n=e.remarkPlugins||h2,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...p2}:p2;return Jfe().use(zde).use(n).use(Nfe,r).use(t)}function ahe(e){const t=e.children||"",n=new P4;return typeof t=="string"&&(n.value=t),n}function lhe(e,t){const n=t.allowedElements,r=t.allowElement,o=t.components,i=t.disallowedElements,s=t.skipHtml,a=t.unwrapDisallowed,l=t.urlTransform||che;for(const u of ohe)Object.hasOwn(t,u.from)&&(""+u.from+(u.to?"use `"+u.to+"` instead":"remove it")+nhe+u.id,void 0);return t.className&&(e={type:"element",tagName:"div",properties:{className:t.className},children:e.type==="root"?e.children:[e]}),E4(e,c),yce(e,{Fragment:m.Fragment,components:o,ignoreInvalidStyle:!0,jsx:m.jsx,jsxs:m.jsxs,passKeys:!0,passNode:!0});function c(u,d,h){if(u.type==="raw"&&h&&typeof d=="number")return s?h.children.splice(d,1):h.children[d]={type:"text",value:u.value},d;if(u.type==="element"){let f;for(f in o0)if(Object.hasOwn(o0,f)&&Object.hasOwn(u.properties,f)){const p=u.properties[f],g=o0[f];(g===null||g.includes(u.tagName))&&(u.properties[f]=l(String(p||""),f,u))}}if(u.type==="element"){let f=n?!n.includes(u.tagName):i?i.includes(u.tagName):!1;if(!f&&r&&typeof d=="number"&&(f=!r(u,d,h)),f&&h&&typeof d=="number")return a&&u.children?h.children.splice(d,1,...u.children):h.children.splice(d,1),d}}}function che(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),o=e.indexOf("/");return t===-1||o!==-1&&t>o||n!==-1&&t>n||r!==-1&&t>r||rhe.test(e.slice(0,t))?e:""}const uhe=E.memo(({cfg:e,onDatapointClick:t})=>m.jsx(c1,{cfg:e,onDatapointClick:t}),(e,t)=>JSON.stringify(e.cfg)===JSON.stringify(t.cfg)&&e.onDatapointClick===t.onDatapointClick);function dhe({message:e,onAddToDashboard:t}){var i;const n=(i=e==null?void 0:e.parts)==null?void 0:i.filter(s=>s.type==="tool-invocation"&&s.toolInvocation.toolName==="getDataAndChartType"&&s.toolInvocation.state==="result");if(!n)return null;const o=n.map(s=>s.toolInvocation).map(s=>{var d,h,f,p;const a=s.result;if(a.status==="error"||a.error)return null;const l=a.data.records,c=a.data.sql;return{chartCfg:Aw({cardType:(d=s.args)==null?void 0:d.chartType,data:l}),chartTitle:((h=s.args)==null?void 0:h.chartTitle)||"",chartType:((f=s.args)==null?void 0:f.chartType)||"",sql:c,data:l,connectionId:((p=s.args)==null?void 0:p.connectionId)||""}}).filter(s=>s!==null);return!o||o.length===0?null:m.jsx("div",{className:"space-y-4",children:o.map((s,a)=>m.jsx("div",{className:"group relative isolate flex h-[400px] w-[99%] grow flex-col",children:m.jsxs("div",{className:"flex grow flex-col gap-4 rounded-md border border-muted p-4",children:[m.jsxs("div",{className:"flex items-center justify-between",children:[m.jsx("div",{className:"text-sm font-semibold",children:s.chartTitle}),m.jsxs(Yt,{className:"h-8 p-2",onClick:()=>{t==null||t({sql:s.sql,data:s.data,cardCfg:s.chartCfg,cardTitle:s.chartTitle,connectionId:s.connectionId,cardType:s.chartType})},size:"sm",variant:"secondary",children:[m.jsx(dg,{className:"mr-1 size-4"}),"Add"]})]}),m.jsx(uhe,{cfg:s.chartCfg})]})},a))})}function Ip({children:e}){return m.jsx("pre",{className:"border-1 whitespace-pre-wrap rounded-md border border-muted p-3 text-xs",children:e})}function fhe({message:e,showTools:t}){var r;if(!t)return null;const n=(r=e==null?void 0:e.parts)==null?void 0:r.filter(o=>o.type==="tool-invocation");return m.jsx("div",{className:"space-y-3",children:n==null?void 0:n.map((o,i)=>{const s=o.toolInvocation;return m.jsxs(wle,{children:[m.jsxs(Sle,{className:"rounded-md bg-green-200 p-1 px-2 font-mono text-xs text-black",children:[m.jsx("span",{className:"font-bold",children:"Tool:"})," ",s.toolName]}),m.jsx(Cle,{className:"mt-2 font-mono text-xs",children:m.jsxs("div",{className:"space-y-2 px-2",children:[m.jsxs("div",{className:"space-y-1",children:[m.jsx("span",{children:"Args:"}),m.jsx(Ip,{children:JSON.stringify(s.args,null,2)})]}),m.jsxs("div",{className:"space-y-1",children:[m.jsx("span",{children:"Result:"}),m.jsx(Ip,{children:JSON.stringify(s.result,null,2)})]})]})})]},i)})})}function hhe({message:e}){return e.role!=="user"?null:m.jsxs("div",{className:"rounded-md bg-muted/50 p-3 text-sm",children:[m.jsx(qz,{className:"float-left mr-2 size-4"}),m.jsx("div",{className:"whitespace-pre-line",children:e.content})]})}function phe({message:e}){if(e.role!=="system")return null;const t=e.content.split("|"),n=t[0],r=t[1]||"{}",o=JSON.parse(r);return m.jsxs("div",{className:"space-y-1",children:[m.jsxs("div",{children:[m.jsx("span",{className:"font-bold",children:"System Message:"})," ",n]}),m.jsxs("div",{className:"space-y-1",children:[m.jsx("span",{className:"font-mono text-xs",children:"Scope:"}),m.jsx(Ip,{children:JSON.stringify(o,null,2)})]})]})}function ghe({message:e,handleRun:t}){if(e.role!=="assistant")return null;const n={p:({node:r,...o})=>m.jsx("p",{className:"text-sm",...o}),code:({node:r,...o})=>{var s,a;const i=(a=(s=r==null?void 0:r.children)==null?void 0:s[0])==null?void 0:a.value;return i&&/^#([0-9a-fA-F]{6})$/.test(i)?m.jsx("code",{className:"rounded-md bg-muted px-2 py-1 text-xs",style:{backgroundColor:i},...o}):m.jsx("code",{className:"rounded-md text-xs text-yellow-700",...o})},pre:r=>m.jsx(mhe,{...r,handleRun:t}),ul:({node:r,...o})=>m.jsx("ul",{className:"ml-2 list-disc py-2 pl-2 text-sm",...o}),ol:({node:r,...o})=>m.jsx("ol",{className:"ml-2 list-decimal py-2 pl-2 text-sm",...o}),li:({node:r,...o})=>m.jsx("li",{className:"mt-2 pl-2 text-sm",...o}),a:({node:r,...o})=>m.jsx("a",{target:"_blank",rel:"noopener noreferrer",className:"text-blue-700 underline",...o}),h1:({node:r,...o})=>m.jsx("h1",{className:"text-lg font-bold",...o}),h2:({node:r,...o})=>m.jsx("h2",{className:"text-md font-bold",...o}),h3:({node:r,...o})=>m.jsx("h3",{className:"text-sm font-bold",...o}),h4:({node:r,...o})=>m.jsx("h4",{className:"text-xs font-bold",...o})};return m.jsx(ihe,{components:n,children:e.content})}function M4({status:e,isLoading:t}){return t?m.jsx("div",{className:"flex items-center text-xs text-muted-foreground",children:e}):null}function k4({messages:e,showTools:t=!1,showSystemMessage:n=!1,handleRun:r,onAddToDashboard:o}){return e==null?void 0:e.map(i=>m.jsxs("div",{className:ie("relative my-4 space-y-4 text-sm text-foreground/80"),children:[m.jsx(hhe,{message:i}),n&&m.jsx(phe,{message:i}),m.jsx(fhe,{message:i,showTools:t}),m.jsx(vd,{FallbackComponent:yB,children:m.jsx(dhe,{onAddToDashboard:o,message:i})}),m.jsx(ghe,{message:i,handleRun:r})]},i.id))}function mhe({children:e,handleRun:t}){const n=se(a=>a.isVisualEditing),[r,o]=E.useState(!1);E.useRef(null);const i=()=>{navigator.clipboard.writeText(s).then(()=>{o(!0),setTimeout(()=>o(!1),2e3)})},s=$y(e);return m.jsxs("div",{className:"relative my-2 space-y-2 rounded-md",children:[m.jsxs("div",{className:"float-right m-1.5",children:[m.jsx(Yt,{className:"h-8 p-2 text-xs text-muted-foreground hover:text-foreground",onClick:i,size:"sm",variant:"ghost",children:r?m.jsx(tc,{className:"size-3"}):m.jsx(Jk,{className:"size-3"})}),n&&m.jsx(Yt,{className:"h-8 p-2 text-muted-foreground hover:text-foreground",onClick:()=>t==null?void 0:t(s),size:"sm",variant:"ghost",children:m.jsx(oO,{className:"size-3"})})]}),m.jsx(Ip,{children:s})]})}function $y(e){return typeof e=="string"?e:Array.isArray(e)?e.map($y).join(""):E.isValidElement(e)?$y(e.props.children):""}function O4(e,t){return t||(e==="ready"?"":e==="error"?"Error":e==="streaming"?"":"Thinking...")}function bhe(e,t){return e.some(n=>n.tableName&&n.tableName===t.tableName||n.datamodelName&&n.datamodelName===t.datamodelName)}function vhe(e){return e.filter((n,r,o)=>r===o.findIndex(i=>i.tableName===n.tableName&&i.datamodelName===n.datamodelName))}function yhe(e,t){return e.filter(n=>!(n.connectionId===t.connectionId&&n.tableName===t.tableName&&n.datamodelName===t.datamodelName))}function xhe(e){return e.map(n=>{const r=n.connectionType==="API"||n.connectionType==="S3"?"DuckDb":n.connectionType;return n.datamodelName!==""?{...n,databaseName:"",schemaName:"",tableName:"",connectionType:r}:{...n,connectionType:r}}).filter(n=>n.connectionId&&(n.tableName||n.datamodelId)&&n.connectionType)}const D4=E.forwardRef(({input:e,setInput:t,handleInputChange:n,handleSubmit:r,isLoading:o,stop:i,onFocus:s,...a},l)=>{const[u,d]=E.useState(1),h=5,f=g=>{const v=g.target.rows;g.target.rows=1;const x=Math.floor(g.target.scrollHeight/24);x===v&&(g.target.rows=x),x>=h&&(g.target.rows=h,g.target.scrollTop=g.target.scrollHeight),d(Math.min(x,h)),n(g)},p=g=>{if(g.key==="Enter"){if(g.shiftKey)return;g.preventDefault(),r&&e.trim()!==""&&(r(g),t(""),d(1))}};return m.jsxs("form",{onSubmit:r,className:"flex w-full items-end gap-2 rounded-md border pb-3 pl-1 pr-2 pt-2 ring-offset-background focus-within:ring-1 focus-within:ring-ring",children:[m.jsx(H1,{autoFocus:!0,...a,ref:l,onFocus:s,placeholder:"Type your question...",className:ie("mb-6 min-h-7 resize-none border-none focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0"),disabled:o,value:e,rows:u,onKeyDown:p,onChange:f}),m.jsxs("div",{className:"mr-2 flex items-center gap-2",children:[o===!0&&m.jsx(Yt,{size:"sm",className:"h-9 rounded-full p-2.5",onClick:()=>i(),children:m.jsx(Vz,{className:"size-3.5 bg-background"})}),o===!1&&m.jsx(Yt,{disabled:o===!1&&!e,size:"sm",className:"h-9 rounded-full p-2.5",onClick:()=>i(),children:m.jsx(Gk,{strokeWidth:3,className:"size-4 font-bold"})})]})]})});function T4({placeholders:e,onClick:t}){return m.jsx("div",{className:"grid grid-cols-2 gap-2 text-foreground/80",children:e==null?void 0:e.map(n=>m.jsxs("div",{onClick:()=>t(n),className:"cursor-pointer rounded-md border border-border p-4 hover:bg-muted/50",children:[m.jsx("p",{className:"text-sm font-semibold",children:n.title}),m.jsx("p",{className:"text-sm text-muted-foreground/70 dark:text-muted-foreground/50",children:n.subtitle})]},n.title))})}const pm=S.forwardRef(({className:e,children:t,...n},r)=>m.jsxs(Kg,{className:ie("relative overflow-hidden",e),children:[m.jsx(qA,{ref:r,...n,className:"h-full w-full rounded-[inherit]",children:t}),m.jsx(uc,{}),m.jsx(GA,{})]}));pm.displayName=Kg.displayName;var I4="vercel.ai.error",whe=Symbol.for(I4),A4,She=class N4 extends Error{constructor({name:t,message:n,cause:r}){super(n),this[A4]=!0,this.name=t,this.cause=r}static isInstance(t){return N4.hasMarker(t,I4)}static hasMarker(t,n){const r=Symbol.for(n);return t!=null&&typeof t=="object"&&r in t&&typeof t[r]=="boolean"&&t[r]===!0}};A4=whe;var Xl=She;function j4(e){return e==null?"unknown error":typeof e=="string"?e:e instanceof Error?e.message:JSON.stringify(e)}var F4="AI_InvalidArgumentError",L4=`vercel.ai.error.${F4}`,Che=Symbol.for(L4),$4,_he=class extends Xl{constructor({message:e,cause:t,argument:n}){super({name:F4,message:e,cause:t}),this[$4]=!0,this.argument=n}static isInstance(e){return Xl.hasMarker(e,L4)}};$4=Che;var z4="AI_JSONParseError",B4=`vercel.ai.error.${z4}`,Ehe=Symbol.for(B4),V4,g2=class extends Xl{constructor({text:e,cause:t}){super({name:z4,message:`JSON parsing failed: Text: ${e}.
343
- Error message: ${j4(t)}`,cause:t}),this[V4]=!0,this.text=e}static isInstance(e){return Xl.hasMarker(e,B4)}};V4=Ehe;var H4="AI_TypeValidationError",W4=`vercel.ai.error.${H4}`,Rhe=Symbol.for(W4),U4,Phe=class zy extends Xl{constructor({value:t,cause:n}){super({name:H4,message:`Type validation failed: Value: ${JSON.stringify(t)}.
344
- Error message: ${j4(n)}`,cause:n}),this[U4]=!0,this.value=t}static isInstance(t){return Xl.hasMarker(t,W4)}static wrap({value:t,cause:n}){return zy.isInstance(n)&&n.value===t?n:new zy({value:t,cause:n})}};U4=Rhe;var m2=Phe;let Mhe=(e,t=21)=>(n=t)=>{let r="",o=n|0;for(;o--;)r+=e[Math.random()*e.length|0];return r};var gc={exports:{}};const khe=typeof Buffer<"u",b2=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,v2=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;function q4(e,t,n){n==null&&t!==null&&typeof t=="object"&&(n=t,t=void 0),khe&&Buffer.isBuffer(e)&&(e=e.toString()),e&&e.charCodeAt(0)===65279&&(e=e.slice(1));const r=JSON.parse(e,t);if(r===null||typeof r!="object")return r;const o=n&&n.protoAction||"error",i=n&&n.constructorAction||"error";if(o==="ignore"&&i==="ignore")return r;if(o!=="ignore"&&i!=="ignore"){if(b2.test(e)===!1&&v2.test(e)===!1)return r}else if(o!=="ignore"&&i==="ignore"){if(b2.test(e)===!1)return r}else if(v2.test(e)===!1)return r;return G4(r,{protoAction:o,constructorAction:i,safe:n&&n.safe})}function G4(e,{protoAction:t="error",constructorAction:n="error",safe:r}={}){let o=[e];for(;o.length;){const i=o;o=[];for(const s of i){if(t!=="ignore"&&Object.prototype.hasOwnProperty.call(s,"__proto__")){if(r===!0)return null;if(t==="error")throw new SyntaxError("Object contains forbidden prototype property");delete s.__proto__}if(n!=="ignore"&&Object.prototype.hasOwnProperty.call(s,"constructor")&&Object.prototype.hasOwnProperty.call(s.constructor,"prototype")){if(r===!0)return null;if(n==="error")throw new SyntaxError("Object contains forbidden prototype property");delete s.constructor}for(const a in s){const l=s[a];l&&typeof l=="object"&&o.push(l)}}}return e}function ES(e,t,n){const r=Error.stackTraceLimit;Error.stackTraceLimit=0;try{return q4(e,t,n)}finally{Error.stackTraceLimit=r}}function Ohe(e,t){const n=Error.stackTraceLimit;Error.stackTraceLimit=0;try{return q4(e,t,{safe:!0})}catch{return null}finally{Error.stackTraceLimit=n}}gc.exports=ES;gc.exports.default=ES;gc.exports.parse=ES;gc.exports.safeParse=Ohe;gc.exports.scan=G4;var Dhe=gc.exports;const The=Yi(Dhe);var Ihe=({prefix:e,size:t=16,alphabet:n="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",separator:r="-"}={})=>{const o=Mhe(n,t);if(e==null)return o;if(n.includes(r))throw new _he({argument:"separator",message:`The separator "${r}" must not be part of the alphabet "${n}".`});return i=>`${e}${r}${o(i)}`},RS=Ihe(),By=Symbol.for("vercel.ai.validator");function Ahe(e){return{[By]:!0,validate:e}}function Nhe(e){return typeof e=="object"&&e!==null&&By in e&&e[By]===!0&&"validate"in e}function jhe(e){return Nhe(e)?e:Fhe(e)}function Fhe(e){return Ahe(t=>{const n=e.safeParse(t);return n.success?{success:!0,value:n.data}:{success:!1,error:n.error}})}function Lhe({value:e,schema:t}){const n=jhe(t);try{if(n.validate==null)return{success:!0,value:e};const r=n.validate(e);return r.success?r:{success:!1,error:m2.wrap({value:e,cause:r.error})}}catch(r){return{success:!1,error:m2.wrap({value:e,cause:r})}}}function y2({text:e,schema:t}){try{const n=The.parse(e);if(t==null)return{success:!0,value:n,rawValue:n};const r=Lhe({value:n,schema:t});return r.success?{...r,rawValue:n}:r}catch(n){return{success:!1,error:g2.isInstance(n)?n:new g2({text:e,cause:n})}}}new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");var Qu={code:"0",name:"text",parse:e=>{if(typeof e!="string")throw new Error('"text" parts expect a string value.');return{type:"text",value:e}}},Ju={code:"3",name:"error",parse:e=>{if(typeof e!="string")throw new Error('"error" parts expect a string value.');return{type:"error",value:e}}},Zu={code:"4",name:"assistant_message",parse:e=>{if(e==null||typeof e!="object"||!("id"in e)||!("role"in e)||!("content"in e)||typeof e.id!="string"||typeof e.role!="string"||e.role!=="assistant"||!Array.isArray(e.content)||!e.content.every(t=>t!=null&&typeof t=="object"&&"type"in t&&t.type==="text"&&"text"in t&&t.text!=null&&typeof t.text=="object"&&"value"in t.text&&typeof t.text.value=="string"))throw new Error('"assistant_message" parts expect an object with an "id", "role", and "content" property.');return{type:"assistant_message",value:e}}},ed={code:"5",name:"assistant_control_data",parse:e=>{if(e==null||typeof e!="object"||!("threadId"in e)||!("messageId"in e)||typeof e.threadId!="string"||typeof e.messageId!="string")throw new Error('"assistant_control_data" parts expect an object with a "threadId" and "messageId" property.');return{type:"assistant_control_data",value:{threadId:e.threadId,messageId:e.messageId}}}},td={code:"6",name:"data_message",parse:e=>{if(e==null||typeof e!="object"||!("role"in e)||!("data"in e)||typeof e.role!="string"||e.role!=="data")throw new Error('"data_message" parts expect an object with a "role" and "data" property.');return{type:"data_message",value:e}}},$he=[Qu,Ju,Zu,ed,td];Qu.code+"",Ju.code+"",Zu.code+"",ed.code+"",td.code+"";Qu.name+"",Qu.code,Ju.name+"",Ju.code,Zu.name+"",Zu.code,ed.name+"",ed.code,td.name+"",td.code;$he.map(e=>e.code);function zhe({promptTokens:e,completionTokens:t}){return{promptTokens:e,completionTokens:t,totalTokens:e+t}}function Bhe(e){const t=["ROOT"];let n=-1,r=null;function o(l,c,u){switch(l){case'"':{n=c,t.pop(),t.push(u),t.push("INSIDE_STRING");break}case"f":case"t":case"n":{n=c,r=c,t.pop(),t.push(u),t.push("INSIDE_LITERAL");break}case"-":{t.pop(),t.push(u),t.push("INSIDE_NUMBER");break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{n=c,t.pop(),t.push(u),t.push("INSIDE_NUMBER");break}case"{":{n=c,t.pop(),t.push(u),t.push("INSIDE_OBJECT_START");break}case"[":{n=c,t.pop(),t.push(u),t.push("INSIDE_ARRAY_START");break}}}function i(l,c){switch(l){case",":{t.pop(),t.push("INSIDE_OBJECT_AFTER_COMMA");break}case"}":{n=c,t.pop();break}}}function s(l,c){switch(l){case",":{t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{n=c,t.pop();break}}}for(let l=0;l<e.length;l++){const c=e[l];switch(t[t.length-1]){case"ROOT":o(c,l,"FINISH");break;case"INSIDE_OBJECT_START":{switch(c){case'"':{t.pop(),t.push("INSIDE_OBJECT_KEY");break}case"}":{n=l,t.pop();break}}break}case"INSIDE_OBJECT_AFTER_COMMA":{switch(c){case'"':{t.pop(),t.push("INSIDE_OBJECT_KEY");break}}break}case"INSIDE_OBJECT_KEY":{switch(c){case'"':{t.pop(),t.push("INSIDE_OBJECT_AFTER_KEY");break}}break}case"INSIDE_OBJECT_AFTER_KEY":{switch(c){case":":{t.pop(),t.push("INSIDE_OBJECT_BEFORE_VALUE");break}}break}case"INSIDE_OBJECT_BEFORE_VALUE":{o(c,l,"INSIDE_OBJECT_AFTER_VALUE");break}case"INSIDE_OBJECT_AFTER_VALUE":{i(c,l);break}case"INSIDE_STRING":{switch(c){case'"':{t.pop(),n=l;break}case"\\":{t.push("INSIDE_STRING_ESCAPE");break}default:n=l}break}case"INSIDE_ARRAY_START":{switch(c){case"]":{n=l,t.pop();break}default:{n=l,o(c,l,"INSIDE_ARRAY_AFTER_VALUE");break}}break}case"INSIDE_ARRAY_AFTER_VALUE":{switch(c){case",":{t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{n=l,t.pop();break}default:{n=l;break}}break}case"INSIDE_ARRAY_AFTER_COMMA":{o(c,l,"INSIDE_ARRAY_AFTER_VALUE");break}case"INSIDE_STRING_ESCAPE":{t.pop(),n=l;break}case"INSIDE_NUMBER":{switch(c){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{n=l;break}case"e":case"E":case"-":case".":break;case",":{t.pop(),t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&s(c,l),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&i(c,l);break}case"}":{t.pop(),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&i(c,l);break}case"]":{t.pop(),t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&s(c,l);break}default:{t.pop();break}}break}case"INSIDE_LITERAL":{const d=e.substring(r,l+1);!"false".startsWith(d)&&!"true".startsWith(d)&&!"null".startsWith(d)?(t.pop(),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"?i(c,l):t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&s(c,l)):n=l;break}}}let a=e.slice(0,n+1);for(let l=t.length-1;l>=0;l--)switch(t[l]){case"INSIDE_STRING":{a+='"';break}case"INSIDE_OBJECT_KEY":case"INSIDE_OBJECT_AFTER_KEY":case"INSIDE_OBJECT_AFTER_COMMA":case"INSIDE_OBJECT_START":case"INSIDE_OBJECT_BEFORE_VALUE":case"INSIDE_OBJECT_AFTER_VALUE":{a+="}";break}case"INSIDE_ARRAY_START":case"INSIDE_ARRAY_AFTER_COMMA":case"INSIDE_ARRAY_AFTER_VALUE":{a+="]";break}case"INSIDE_LITERAL":{const u=e.substring(r,e.length);"true".startsWith(u)?a+="true".slice(u.length):"false".startsWith(u)?a+="false".slice(u.length):"null".startsWith(u)&&(a+="null".slice(u.length))}}return a}function Vhe(e){if(e===void 0)return{value:void 0,state:"undefined-input"};let t=y2({text:e});return t.success?{value:t.value,state:"successful-parse"}:(t=y2({text:Bhe(e)}),t.success?{value:t.value,state:"repaired-parse"}:{value:void 0,state:"failed-parse"})}var Hhe={code:"0",name:"text",parse:e=>{if(typeof e!="string")throw new Error('"text" parts expect a string value.');return{type:"text",value:e}}},Whe={code:"2",name:"data",parse:e=>{if(!Array.isArray(e))throw new Error('"data" parts expect an array value.');return{type:"data",value:e}}},Uhe={code:"3",name:"error",parse:e=>{if(typeof e!="string")throw new Error('"error" parts expect a string value.');return{type:"error",value:e}}},qhe={code:"8",name:"message_annotations",parse:e=>{if(!Array.isArray(e))throw new Error('"message_annotations" parts expect an array value.');return{type:"message_annotations",value:e}}},Ghe={code:"9",name:"tool_call",parse:e=>{if(e==null||typeof e!="object"||!("toolCallId"in e)||typeof e.toolCallId!="string"||!("toolName"in e)||typeof e.toolName!="string"||!("args"in e)||typeof e.args!="object")throw new Error('"tool_call" parts expect an object with a "toolCallId", "toolName", and "args" property.');return{type:"tool_call",value:e}}},Yhe={code:"a",name:"tool_result",parse:e=>{if(e==null||typeof e!="object"||!("toolCallId"in e)||typeof e.toolCallId!="string"||!("result"in e))throw new Error('"tool_result" parts expect an object with a "toolCallId" and a "result" property.');return{type:"tool_result",value:e}}},Khe={code:"b",name:"tool_call_streaming_start",parse:e=>{if(e==null||typeof e!="object"||!("toolCallId"in e)||typeof e.toolCallId!="string"||!("toolName"in e)||typeof e.toolName!="string")throw new Error('"tool_call_streaming_start" parts expect an object with a "toolCallId" and "toolName" property.');return{type:"tool_call_streaming_start",value:e}}},Xhe={code:"c",name:"tool_call_delta",parse:e=>{if(e==null||typeof e!="object"||!("toolCallId"in e)||typeof e.toolCallId!="string"||!("argsTextDelta"in e)||typeof e.argsTextDelta!="string")throw new Error('"tool_call_delta" parts expect an object with a "toolCallId" and "argsTextDelta" property.');return{type:"tool_call_delta",value:e}}},Qhe={code:"d",name:"finish_message",parse:e=>{if(e==null||typeof e!="object"||!("finishReason"in e)||typeof e.finishReason!="string")throw new Error('"finish_message" parts expect an object with a "finishReason" property.');const t={finishReason:e.finishReason};return"usage"in e&&e.usage!=null&&typeof e.usage=="object"&&"promptTokens"in e.usage&&"completionTokens"in e.usage&&(t.usage={promptTokens:typeof e.usage.promptTokens=="number"?e.usage.promptTokens:Number.NaN,completionTokens:typeof e.usage.completionTokens=="number"?e.usage.completionTokens:Number.NaN}),{type:"finish_message",value:t}}},Jhe={code:"e",name:"finish_step",parse:e=>{if(e==null||typeof e!="object"||!("finishReason"in e)||typeof e.finishReason!="string")throw new Error('"finish_step" parts expect an object with a "finishReason" property.');const t={finishReason:e.finishReason,isContinued:!1};return"usage"in e&&e.usage!=null&&typeof e.usage=="object"&&"promptTokens"in e.usage&&"completionTokens"in e.usage&&(t.usage={promptTokens:typeof e.usage.promptTokens=="number"?e.usage.promptTokens:Number.NaN,completionTokens:typeof e.usage.completionTokens=="number"?e.usage.completionTokens:Number.NaN}),"isContinued"in e&&typeof e.isContinued=="boolean"&&(t.isContinued=e.isContinued),{type:"finish_step",value:t}}},Zhe={code:"f",name:"start_step",parse:e=>{if(e==null||typeof e!="object"||!("messageId"in e)||typeof e.messageId!="string")throw new Error('"start_step" parts expect an object with an "id" property.');return{type:"start_step",value:{messageId:e.messageId}}}},epe={code:"g",name:"reasoning",parse:e=>{if(typeof e!="string")throw new Error('"reasoning" parts expect a string value.');return{type:"reasoning",value:e}}},tpe={code:"h",name:"source",parse:e=>{if(e==null||typeof e!="object")throw new Error('"source" parts expect a Source object.');return{type:"source",value:e}}},npe={code:"i",name:"redacted_reasoning",parse:e=>{if(e==null||typeof e!="object"||!("data"in e)||typeof e.data!="string")throw new Error('"redacted_reasoning" parts expect an object with a "data" property.');return{type:"redacted_reasoning",value:{data:e.data}}}},rpe={code:"j",name:"reasoning_signature",parse:e=>{if(e==null||typeof e!="object"||!("signature"in e)||typeof e.signature!="string")throw new Error('"reasoning_signature" parts expect an object with a "signature" property.');return{type:"reasoning_signature",value:{signature:e.signature}}}},PS=[Hhe,Whe,Uhe,qhe,Ghe,Yhe,Khe,Xhe,Qhe,Jhe,Zhe,epe,tpe,npe,rpe],ope=Object.fromEntries(PS.map(e=>[e.code,e]));Object.fromEntries(PS.map(e=>[e.name,e.code]));var ipe=PS.map(e=>e.code),spe=e=>{const t=e.indexOf(":");if(t===-1)throw new Error("Failed to parse stream string. No separator found.");const n=e.slice(0,t);if(!ipe.includes(n))throw new Error(`Failed to parse stream string. Invalid code ${n}.`);const r=n,o=e.slice(t+1),i=JSON.parse(o);return ope[r].parse(i)},ape=10;function lpe(e,t){const n=new Uint8Array(t);let r=0;for(const o of e)n.set(o,r),r+=o.length;return e.length=0,n}async function cpe({stream:e,onTextPart:t,onReasoningPart:n,onReasoningSignaturePart:r,onRedactedReasoningPart:o,onSourcePart:i,onDataPart:s,onErrorPart:a,onToolCallStreamingStartPart:l,onToolCallDeltaPart:c,onToolCallPart:u,onToolResultPart:d,onMessageAnnotationsPart:h,onFinishMessagePart:f,onFinishStepPart:p,onStartStepPart:g}){const b=e.getReader(),v=new TextDecoder,x=[];let y=0;for(;;){const{value:_}=await b.read();if(_&&(x.push(_),y+=_.length,_[_.length-1]!==ape))continue;if(x.length===0)break;const w=lpe(x,y);y=0;const C=v.decode(w,{stream:!0}).split(`
345
- `).filter(R=>R!=="").map(spe);for(const{type:R,value:k}of C)switch(R){case"text":await(t==null?void 0:t(k));break;case"reasoning":await(n==null?void 0:n(k));break;case"reasoning_signature":await(r==null?void 0:r(k));break;case"redacted_reasoning":await(o==null?void 0:o(k));break;case"source":await(i==null?void 0:i(k));break;case"data":await(s==null?void 0:s(k));break;case"error":await(a==null?void 0:a(k));break;case"message_annotations":await(h==null?void 0:h(k));break;case"tool_call_streaming_start":await(l==null?void 0:l(k));break;case"tool_call_delta":await(c==null?void 0:c(k));break;case"tool_call":await(u==null?void 0:u(k));break;case"tool_result":await(d==null?void 0:d(k));break;case"finish_message":await(f==null?void 0:f(k));break;case"finish_step":await(p==null?void 0:p(k));break;case"start_step":await(g==null?void 0:g(k));break;default:{const D=R;throw new Error(`Unknown stream part type: ${D}`)}}}}async function upe({stream:e,update:t,onToolCall:n,onFinish:r,generateId:o=RS,getCurrentDate:i=()=>new Date,lastMessage:s}){var a,l;const c=(s==null?void 0:s.role)==="assistant";let u=c?1+((l=(a=s.toolInvocations)==null?void 0:a.reduce((C,R)=>{var k;return Math.max(C,(k=R.step)!=null?k:0)},0))!=null?l:0):0;const d=c?structuredClone(s):{id:o(),createdAt:i(),role:"assistant",content:"",parts:[]};let h,f,p;function g(C,R){const k=d.parts.find(D=>D.type==="tool-invocation"&&D.toolInvocation.toolCallId===C);k!=null?k.toolInvocation=R:d.parts.push({type:"tool-invocation",toolInvocation:R})}const b=[];let v=c?s==null?void 0:s.annotations:void 0;const x={};let y={completionTokens:NaN,promptTokens:NaN,totalTokens:NaN},_="unknown";function w(){const C=[...b];v!=null&&v.length&&(d.annotations=v);const R={...structuredClone(d),revisionId:o()};t({message:R,data:C,replaceLastMessage:c})}await cpe({stream:e,onTextPart(C){h==null?(h={type:"text",text:C},d.parts.push(h)):h.text+=C,d.content+=C,w()},onReasoningPart(C){var R;p==null?(p={type:"text",text:C},f!=null&&f.details.push(p)):p.text+=C,f==null?(f={type:"reasoning",reasoning:C,details:[p]},d.parts.push(f)):f.reasoning+=C,d.reasoning=((R=d.reasoning)!=null?R:"")+C,w()},onReasoningSignaturePart(C){p!=null&&(p.signature=C.signature)},onRedactedReasoningPart(C){f==null&&(f={type:"reasoning",reasoning:"",details:[]},d.parts.push(f)),f.details.push({type:"redacted",data:C.data}),p=void 0,w()},onSourcePart(C){d.parts.push({type:"source",source:C}),w()},onToolCallStreamingStartPart(C){d.toolInvocations==null&&(d.toolInvocations=[]),x[C.toolCallId]={text:"",step:u,toolName:C.toolName,index:d.toolInvocations.length};const R={state:"partial-call",step:u,toolCallId:C.toolCallId,toolName:C.toolName,args:void 0};d.toolInvocations.push(R),g(C.toolCallId,R),w()},onToolCallDeltaPart(C){const R=x[C.toolCallId];R.text+=C.argsTextDelta;const{value:k}=Vhe(R.text),D={state:"partial-call",step:R.step,toolCallId:C.toolCallId,toolName:R.toolName,args:k};d.toolInvocations[R.index]=D,g(C.toolCallId,D),w()},async onToolCallPart(C){const R={state:"call",step:u,...C};if(x[C.toolCallId]!=null?d.toolInvocations[x[C.toolCallId].index]=R:(d.toolInvocations==null&&(d.toolInvocations=[]),d.toolInvocations.push(R)),g(C.toolCallId,R),w(),n){const k=await n({toolCall:C});if(k!=null){const D={state:"result",step:u,...C,result:k};d.toolInvocations[d.toolInvocations.length-1]=D,g(C.toolCallId,D),w()}}},onToolResultPart(C){const R=d.toolInvocations;if(R==null)throw new Error("tool_result must be preceded by a tool_call");const k=R.findIndex(I=>I.toolCallId===C.toolCallId);if(k===-1)throw new Error("tool_result must be preceded by a tool_call with the same toolCallId");const D={...R[k],state:"result",...C};R[k]=D,g(C.toolCallId,D),w()},onDataPart(C){b.push(...C),w()},onMessageAnnotationsPart(C){v==null?v=[...C]:v.push(...C),w()},onFinishStepPart(C){u+=1,h=C.isContinued?h:void 0,f=void 0,p=void 0},onStartStepPart(C){c||(d.id=C.messageId)},onFinishMessagePart(C){_=C.finishReason,C.usage!=null&&(y=zhe(C.usage))},onErrorPart(C){throw new Error(C)}}),r==null||r({message:d,finishReason:_,usage:y})}async function dpe({stream:e,onTextPart:t}){const n=e.pipeThrough(new TextDecoderStream).getReader();for(;;){const{done:r,value:o}=await n.read();if(r)break;await t(o)}}async function fpe({stream:e,update:t,onFinish:n,getCurrentDate:r=()=>new Date,generateId:o=RS}){const i={type:"text",text:""},s={id:o(),createdAt:r(),role:"assistant",content:"",parts:[i]};await dpe({stream:e,onTextPart:a=>{s.content+=a,i.text+=a,t({message:{...s},data:[],replaceLastMessage:!1})}}),n==null||n(s,{usage:{completionTokens:NaN,promptTokens:NaN,totalTokens:NaN},finishReason:"unknown"})}var hpe=()=>fetch;async function ppe({api:e,body:t,streamProtocol:n="data",credentials:r,headers:o,abortController:i,restoreMessagesOnFailure:s,onResponse:a,onUpdate:l,onFinish:c,onToolCall:u,generateId:d,fetch:h=hpe(),lastMessage:f}){var p,g;const b=await h(e,{method:"POST",body:JSON.stringify(t),headers:{"Content-Type":"application/json",...o},signal:(p=i==null?void 0:i())==null?void 0:p.signal,credentials:r}).catch(v=>{throw s(),v});if(a)try{await a(b)}catch(v){throw v}if(!b.ok)throw s(),new Error((g=await b.text())!=null?g:"Failed to fetch the chat response.");if(!b.body)throw new Error("The response body is empty.");switch(n){case"text":{await fpe({stream:b.body,update:l,onFinish:c,generateId:d});return}case"data":{await upe({stream:b.body,update:l,lastMessage:f,onToolCall:u,onFinish({message:v,finishReason:x,usage:y}){c&&v!=null&&c(v,{usage:y,finishReason:x})},generateId:d});return}default:{const v=n;throw new Error(`Unknown stream protocol: ${v}`)}}}function Vy(e){return e==null?void 0:e.reduce((t,n)=>{var r;return Math.max(t,(r=n.step)!=null?r:0)},0)}function Y4(e){var t;return(t=e.parts)!=null?t:[...e.toolInvocations?e.toolInvocations.map(n=>({type:"tool-invocation",toolInvocation:n})):[],...e.reasoning?[{type:"reasoning",reasoning:e.reasoning,details:[{type:"text",text:e.reasoning}]}]:[],...e.content?[{type:"text",text:e.content}]:[]]}function p0(e){return e.map(t=>({...t,parts:Y4(t)}))}function Hy(e,t){if(e===t)return!0;if(e==null||t==null)return!1;if(typeof e!="object"&&typeof t!="object")return e===t;if(e.constructor!==t.constructor)return!1;if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();if(Array.isArray(e)){if(e.length!==t.length)return!1;for(let o=0;o<e.length;o++)if(!Hy(e[o],t[o]))return!1;return!0}const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const o of n)if(!r.includes(o)||!Hy(e[o],t[o]))return!1;return!0}async function x2(e){if(!e)return[];if(e instanceof FileList)return Promise.all(Array.from(e).map(async t=>{const{name:n,type:r}=t,o=await new Promise((i,s)=>{const a=new FileReader;a.onload=l=>{var c;i((c=l.target)==null?void 0:c.result)},a.onerror=l=>s(l),a.readAsDataURL(t)});return{name:n,contentType:r,url:o}}));if(Array.isArray(e))return e;throw new Error("Invalid attachments type")}function gpe({originalMaxToolInvocationStep:e,originalMessageCount:t,maxSteps:n,messages:r}){var o;const i=r[r.length-1];return n>1&&i!=null&&(r.length>t||Vy(i.toolInvocations)!==e)&&K4(i)&&!mpe(i)&&((o=Vy(i.toolInvocations))!=null?o:0)<n}function mpe(e){let t=!1;return e.parts.forEach(n=>{n.type==="text"&&(t=!0),n.type==="tool-invocation"&&(t=!1)}),t}function K4(e){return e.role==="assistant"&&e.parts.filter(t=>t.type==="tool-invocation").every(t=>"result"in t.toolInvocation)}function bpe({messages:e,toolCallId:t,toolResult:n}){var r;const o=e[e.length-1],i=o.parts.find(a=>a.type==="tool-invocation"&&a.toolInvocation.toolCallId===t);if(i==null)return;const s={...i.toolInvocation,state:"result",result:n};i.toolInvocation=s,o.toolInvocations=(r=o.toolInvocations)==null?void 0:r.map(a=>a.toolCallId===t?s:a)}var X4=ax();const Q4=0,J4=1,Z4=2,w2=3;var S2=Object.prototype.hasOwnProperty;function Wy(e,t){var n,r;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((r=e.length)===t.length)for(;r--&&Wy(e[r],t[r]););return r===-1}if(!n||typeof e=="object"){r=0;for(n in e)if(S2.call(e,n)&&++r&&!S2.call(t,n)||!(n in t)||!Wy(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}const Xo=new WeakMap,Ai=()=>{},kn=Ai(),Uy=Object,Je=e=>e===kn,ho=e=>typeof e=="function",Gi=(e,t)=>({...e,...t}),eF=e=>ho(e.then),g0={},th={},MS="undefined",Wd=typeof window!=MS,qy=typeof document!=MS,vpe=Wd&&"Deno"in window,ype=()=>Wd&&typeof window.requestAnimationFrame!=MS,tF=(e,t)=>{const n=Xo.get(e);return[()=>!Je(t)&&e.get(t)||g0,r=>{if(!Je(t)){const o=e.get(t);t in th||(th[t]=o),n[5](t,Gi(o,r),o||g0)}},n[6],()=>!Je(t)&&t in th?th[t]:!Je(t)&&e.get(t)||g0]};let Gy=!0;const xpe=()=>Gy,[Yy,Ky]=Wd&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[Ai,Ai],wpe=()=>{const e=qy&&document.visibilityState;return Je(e)||e!=="hidden"},Spe=e=>(qy&&document.addEventListener("visibilitychange",e),Yy("focus",e),()=>{qy&&document.removeEventListener("visibilitychange",e),Ky("focus",e)}),Cpe=e=>{const t=()=>{Gy=!0,e()},n=()=>{Gy=!1};return Yy("online",t),Yy("offline",n),()=>{Ky("online",t),Ky("offline",n)}},_pe={isOnline:xpe,isVisible:wpe},Epe={initFocus:Spe,initReconnect:Cpe},C2=!E.useId,nd=!Wd||vpe,Rpe=e=>ype()?window.requestAnimationFrame(e):setTimeout(e,1),m0=nd?E.useEffect:E.useLayoutEffect,b0=typeof navigator<"u"&&navigator.connection,_2=!nd&&b0&&(["slow-2g","2g"].includes(b0.effectiveType)||b0.saveData),nh=new WeakMap,v0=(e,t)=>Uy.prototype.toString.call(e)===`[object ${t}]`;let Ppe=0;const Xy=e=>{const t=typeof e,n=v0(e,"Date"),r=v0(e,"RegExp"),o=v0(e,"Object");let i,s;if(Uy(e)===e&&!n&&!r){if(i=nh.get(e),i)return i;if(i=++Ppe+"~",nh.set(e,i),Array.isArray(e)){for(i="@",s=0;s<e.length;s++)i+=Xy(e[s])+",";nh.set(e,i)}if(o){i="#";const a=Uy.keys(e).sort();for(;!Je(s=a.pop());)Je(e[s])||(i+=s+":"+Xy(e[s])+",");nh.set(e,i)}}else i=n?e.toJSON():t=="symbol"?e.toString():t=="string"?JSON.stringify(e):""+e;return i},kS=e=>{if(ho(e))try{e=e()}catch{e=""}const t=e;return e=typeof e=="string"?e:(Array.isArray(e)?e.length:e)?Xy(e):"",[e,t]};let Mpe=0;const Qy=()=>++Mpe;async function nF(...e){const[t,n,r,o]=e,i=Gi({populateCache:!0,throwOnError:!0},typeof o=="boolean"?{revalidate:o}:o||{});let s=i.populateCache;const a=i.rollbackOnError;let l=i.optimisticData;const c=h=>typeof a=="function"?a(h):a!==!1,u=i.throwOnError;if(ho(n)){const h=n,f=[],p=t.keys();for(const g of p)!/^\$(inf|sub)\$/.test(g)&&h(t.get(g)._k)&&f.push(g);return Promise.all(f.map(d))}return d(n);async function d(h){const[f]=kS(h);if(!f)return;const[p,g]=tF(t,f),[b,v,x,y]=Xo.get(t),_=()=>{const G=b[f];return(ho(i.revalidate)?i.revalidate(p().data,h):i.revalidate!==!1)&&(delete x[f],delete y[f],G&&G[0])?G[0](Z4).then(()=>p().data):p().data};if(e.length<3)return _();let w=r,C;const R=Qy();v[f]=[R,0];const k=!Je(l),D=p(),I=D.data,T=D._c,N=Je(T)?I:T;if(k&&(l=ho(l)?l(N,I):l,g({data:l,_c:N})),ho(w))try{w=w(N)}catch(G){C=G}if(w&&eF(w))if(w=await w.catch(G=>{C=G}),R!==v[f][0]){if(C)throw C;return w}else C&&k&&c(C)&&(s=!0,g({data:N,_c:kn}));if(s&&!C)if(ho(s)){const G=s(w,N);g({data:G,error:kn,_c:kn})}else g({data:w,error:kn,_c:kn});if(v[f][1]=Qy(),Promise.resolve(_()).then(()=>{g({_c:kn})}),C){if(u)throw C;return}return w}}const E2=(e,t)=>{for(const n in e)e[n][0]&&e[n][0](t)},kpe=(e,t)=>{if(!Xo.has(e)){const n=Gi(Epe,t),r={},o=nF.bind(kn,e);let i=Ai;const s={},a=(u,d)=>{const h=s[u]||[];return s[u]=h,h.push(d),()=>h.splice(h.indexOf(d),1)},l=(u,d,h)=>{e.set(u,d);const f=s[u];if(f)for(const p of f)p(d,h)},c=()=>{if(!Xo.has(e)&&(Xo.set(e,[r,{},{},{},o,l,a]),!nd)){const u=n.initFocus(setTimeout.bind(kn,E2.bind(kn,r,Q4))),d=n.initReconnect(setTimeout.bind(kn,E2.bind(kn,r,J4)));i=()=>{u&&u(),d&&d(),Xo.delete(e)}}};return c(),[e,o,c,i]}return[e,Xo.get(e)[4]]},Ope=(e,t,n,r,o)=>{const i=n.errorRetryCount,s=o.retryCount,a=~~((Math.random()+.5)*(1<<(s<8?s:8)))*n.errorRetryInterval;!Je(i)&&s>i||setTimeout(r,a,o)},Dpe=Wy,[rF,Tpe]=kpe(new Map),Ipe=Gi({onLoadingSlow:Ai,onSuccess:Ai,onError:Ai,onErrorRetry:Ope,onDiscarded:Ai,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:_2?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:_2?5e3:3e3,compare:Dpe,isPaused:()=>!1,cache:rF,mutate:Tpe,fallback:{}},_pe),Ape=(e,t)=>{const n=Gi(e,t);if(t){const{use:r,fallback:o}=e,{use:i,fallback:s}=t;r&&i&&(n.use=r.concat(i)),o&&s&&(n.fallback=Gi(o,s))}return n},Npe=E.createContext({}),jpe="$inf$",oF=Wd&&window.__SWR_DEVTOOLS_USE__,Fpe=oF?window.__SWR_DEVTOOLS_USE__:[],Lpe=()=>{oF&&(window.__SWR_DEVTOOLS_REACT__=E)},$pe=e=>ho(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(e[1]===null?e[2]:e[1])||{}],zpe=()=>Gi(Ipe,E.useContext(Npe)),Bpe=e=>(t,n,r)=>e(t,n&&((...i)=>{const[s]=kS(t),[,,,a]=Xo.get(rF);if(s.startsWith(jpe))return n(...i);const l=a[s];return Je(l)?n(...i):(delete a[s],l)}),r),Vpe=Fpe.concat(Bpe),Hpe=e=>function(...n){const r=zpe(),[o,i,s]=$pe(n),a=Ape(r,s);let l=e;const{use:c}=a,u=(c||[]).concat(Vpe);for(let d=u.length;d--;)l=u[d](l);return l(o,i||a.fetcher||null,a)},Wpe=(e,t,n)=>{const r=t[e]||(t[e]=[]);return r.push(n),()=>{const o=r.indexOf(n);o>=0&&(r[o]=r[r.length-1],r.pop())}};Lpe();const y0=E.use||(e=>{switch(e.status){case"pending":throw e;case"fulfilled":return e.value;case"rejected":throw e.reason;default:throw e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e}}),x0={dedupe:!0},Upe=(e,t,n)=>{const{cache:r,compare:o,suspense:i,fallbackData:s,revalidateOnMount:a,revalidateIfStale:l,refreshInterval:c,refreshWhenHidden:u,refreshWhenOffline:d,keepPreviousData:h}=n,[f,p,g,b]=Xo.get(r),[v,x]=kS(e),y=E.useRef(!1),_=E.useRef(!1),w=E.useRef(v),C=E.useRef(t),R=E.useRef(n),k=()=>R.current,D=()=>k().isVisible()&&k().isOnline(),[I,T,N,G]=tF(r,v),z=E.useRef({}).current,O=Je(s)?Je(n.fallback)?kn:n.fallback[v]:s,A=(oe,ee)=>{for(const ue in z){const de=ue;if(de==="data"){if(!o(oe[de],ee[de])&&(!Je(oe[de])||!o(q,ee[de])))return!1}else if(ee[de]!==oe[de])return!1}return!0},L=E.useMemo(()=>{const oe=!v||!t?!1:Je(a)?k().isPaused()||i?!1:l!==!1:a,ee=je=>{const et=Gi(je);return delete et._k,oe?{isValidating:!0,isLoading:!0,...et}:et},ue=I(),de=G(),ye=ee(ue),he=ue===de?ye:ee(de);let me=ye;return[()=>{const je=ee(I());return A(je,me)?(me.data=je.data,me.isLoading=je.isLoading,me.isValidating=je.isValidating,me.error=je.error,me):(me=je,je)},()=>he]},[r,v]),j=X4.useSyncExternalStore(E.useCallback(oe=>N(v,(ee,ue)=>{A(ue,ee)||oe()}),[r,v]),L[0],L[1]),B=!y.current,M=f[v]&&f[v].length>0,W=j.data,F=Je(W)?O&&eF(O)?y0(O):O:W,P=j.error,U=E.useRef(F),q=h?Je(W)?Je(U.current)?F:U.current:W:F,K=M&&!Je(P)?!1:B&&!Je(a)?a:k().isPaused()?!1:i?Je(F)?!1:l:Je(F)||l,H=!!(v&&t&&B&&K),V=Je(j.isValidating)?H:j.isValidating,Q=Je(j.isLoading)?H:j.isLoading,Z=E.useCallback(async oe=>{const ee=C.current;if(!v||!ee||_.current||k().isPaused())return!1;let ue,de,ye=!0;const he=oe||{},me=!g[v]||!he.dedupe,je=()=>C2?!_.current&&v===w.current&&y.current:v===w.current,et={isValidating:!1,isLoading:!1},Bt=()=>{T(et)},Ue=()=>{const wt=g[v];wt&&wt[1]===de&&delete g[v]},Zn={isValidating:!0};Je(I().data)&&(Zn.isLoading=!0);try{if(me&&(T(Zn),n.loadingTimeout&&Je(I().data)&&setTimeout(()=>{ye&&je()&&k().onLoadingSlow(v,n)},n.loadingTimeout),g[v]=[ee(x),Qy()]),[ue,de]=g[v],ue=await ue,me&&setTimeout(Ue,n.dedupingInterval),!g[v]||g[v][1]!==de)return me&&je()&&k().onDiscarded(v),!1;et.error=kn;const wt=p[v];if(!Je(wt)&&(de<=wt[0]||de<=wt[1]||wt[1]===0))return Bt(),me&&je()&&k().onDiscarded(v),!1;const te=I().data;et.data=o(te,ue)?te:ue,me&&je()&&k().onSuccess(ue,v,n)}catch(wt){Ue();const te=k(),{shouldRetryOnError:le}=te;te.isPaused()||(et.error=wt,me&&je()&&(te.onError(wt,v,te),(le===!0||ho(le)&&le(wt))&&(!k().revalidateOnFocus||!k().revalidateOnReconnect||D())&&te.onErrorRetry(wt,v,te,ve=>{const Re=f[v];Re&&Re[0]&&Re[0](w2,ve)},{retryCount:(he.retryCount||0)+1,dedupe:!0})))}return ye=!1,Bt(),!0},[v,r]),ne=E.useCallback((...oe)=>nF(r,w.current,...oe),[]);if(m0(()=>{C.current=t,R.current=n,Je(W)||(U.current=W)}),m0(()=>{if(!v)return;const oe=Z.bind(kn,x0);let ee=0;const de=Wpe(v,f,(ye,he={})=>{if(ye==Q4){const me=Date.now();k().revalidateOnFocus&&me>ee&&D()&&(ee=me+k().focusThrottleInterval,oe())}else if(ye==J4)k().revalidateOnReconnect&&D()&&oe();else{if(ye==Z4)return Z();if(ye==w2)return Z(he)}});return _.current=!1,w.current=v,y.current=!0,T({_k:x}),K&&(Je(F)||nd?oe():Rpe(oe)),()=>{_.current=!0,de()}},[v]),m0(()=>{let oe;function ee(){const de=ho(c)?c(I().data):c;de&&oe!==-1&&(oe=setTimeout(ue,de))}function ue(){!I().error&&(u||k().isVisible())&&(d||k().isOnline())?Z(x0).then(ee):ee()}return ee(),()=>{oe&&(clearTimeout(oe),oe=-1)}},[c,u,d,v]),E.useDebugValue(q),i&&Je(F)&&v){if(!C2&&nd)throw new Error("Fallback data is required when using Suspense in SSR.");C.current=t,R.current=n,_.current=!1;const oe=b[v];if(!Je(oe)){const ee=ne(oe);y0(ee)}if(Je(P)){const ee=Z(x0);Je(q)||(ee.status="fulfilled",ee.value=!0),y0(ee)}else throw P}return{mutate:ne,get data(){return z.data=!0,q},get error(){return z.error=!0,P},get isValidating(){return z.isValidating=!0,V},get isLoading(){return z.isLoading=!0,Q}}},rh=Hpe(Upe);function qpe(e,t){if(typeof e!="function")throw new TypeError(`Expected the first argument to be a \`function\`, got \`${typeof e}\`.`);let n,r=0;return function(...i){clearTimeout(n);const s=Date.now(),a=s-r,l=t-a;l<=0?(r=s,e.apply(this,i)):n=setTimeout(()=>{r=Date.now(),e.apply(this,i)},l)}}var Gpe=qpe;const Ype=Yi(Gpe);function R2(e,t){return t!=null?Ype(e,t):e}function Kpe(e){const[t,n]=E.useState(e);return E.useEffect(()=>{Hy(e,t)||n(e)},[e,t]),t}function iF({api:e="/api/chat",id:t,initialMessages:n,initialInput:r="",sendExtraMessageFields:o,onToolCall:i,experimental_prepareRequestBody:s,maxSteps:a=1,streamProtocol:l="data",onResponse:c,onFinish:u,onError:d,credentials:h,headers:f,body:p,generateId:g=RS,fetch:b,keepLastMessageOnError:v=!0,experimental_throttle:x}={}){const[y]=E.useState(g),_=t??y,w=typeof e=="string"?[e,_]:_,C=Kpe(n??[]),R=E.useMemo(()=>p0(C),[C]),{data:k,mutate:D}=rh([w,"messages"],null,{fallbackData:R}),I=E.useRef(k||[]);E.useEffect(()=>{I.current=k||[]},[k]);const{data:T,mutate:N}=rh([w,"streamData"],null),G=E.useRef(T);E.useEffect(()=>{G.current=T},[T]);const{data:z="ready",mutate:O}=rh([w,"status"],null),{data:A=void 0,mutate:L}=rh([w,"error"],null),j=E.useRef(null),B=E.useRef({credentials:h,headers:f,body:p});E.useEffect(()=>{B.current={credentials:h,headers:f,body:p}},[h,f,p]);const M=E.useCallback(async ne=>{var J,oe;O("submitted"),L(void 0);const ee=p0(ne.messages),ue=ee.length,de=Vy((J=ee[ee.length-1])==null?void 0:J.toolInvocations);try{const he=new AbortController;j.current=he;const me=R2(D,x),je=R2(N,x),et=I.current;me(ee,!1);const Bt=o?ee:ee.map(({role:Zn,content:wt,experimental_attachments:te,data:le,annotations:ve,toolInvocations:Re,parts:Ve})=>({role:Zn,content:wt,...te!==void 0&&{experimental_attachments:te},...le!==void 0&&{data:le},...ve!==void 0&&{annotations:ve},...Re!==void 0&&{toolInvocations:Re},...Ve!==void 0&&{parts:Ve}})),Ue=G.current;await ppe({api:e,body:(oe=s==null?void 0:s({id:_,messages:ee,requestData:ne.data,requestBody:ne.body}))!=null?oe:{id:_,messages:Bt,data:ne.data,...B.current.body,...ne.body},streamProtocol:l,credentials:B.current.credentials,headers:{...B.current.headers,...ne.headers},abortController:()=>j.current,restoreMessagesOnFailure(){v||me(et,!1)},onResponse:c,onUpdate({message:Zn,data:wt,replaceLastMessage:te}){O("streaming"),me([...te?ee.slice(0,ee.length-1):ee,Zn],!1),wt!=null&&wt.length&&je([...Ue??[],...wt],!1)},onToolCall:i,onFinish:u,generateId:g,fetch:b,lastMessage:ee[ee.length-1]}),j.current=null,O("ready")}catch(he){if(he.name==="AbortError")return j.current=null,O("ready"),null;d&&he instanceof Error&&d(he),L(he),O("error")}const ye=I.current;gpe({originalMaxToolInvocationStep:de,originalMessageCount:ue,maxSteps:a,messages:ye})&&await M({messages:ye})},[D,O,e,B,c,u,d,L,N,G,l,o,s,i,a,I,j,g,b,v,x,_]),W=E.useCallback(async(ne,{data:J,headers:oe,body:ee,experimental_attachments:ue}={})=>{var de,ye;const he=await x2(ue),me=I.current.concat({...ne,id:(de=ne.id)!=null?de:g(),createdAt:(ye=ne.createdAt)!=null?ye:new Date,experimental_attachments:he.length>0?he:void 0,parts:Y4(ne)});return M({messages:me,headers:oe,body:ee,data:J})},[M,g]),F=E.useCallback(async({data:ne,headers:J,body:oe}={})=>{const ee=I.current;if(ee.length===0)return null;const ue=ee[ee.length-1];return M({messages:ue.role==="assistant"?ee.slice(0,-1):ee,headers:J,body:oe,data:ne})},[M]),P=E.useCallback(()=>{j.current&&(j.current.abort(),j.current=null)},[]),U=E.useCallback(ne=>{typeof ne=="function"&&(ne=ne(I.current));const J=p0(ne);D(J,!1),I.current=J},[D]),q=E.useCallback(ne=>{typeof ne=="function"&&(ne=ne(G.current)),N(ne,!1),G.current=ne},[N]),[K,H]=E.useState(r),V=E.useCallback(async(ne,J={},oe)=>{var ee;if((ee=ne==null?void 0:ne.preventDefault)==null||ee.call(ne),!K&&!J.allowEmptySubmit)return;oe&&(B.current={...B.current,...oe});const ue=await x2(J.experimental_attachments),ye={messages:I.current.concat({id:g(),createdAt:new Date,role:"user",content:K,experimental_attachments:ue.length>0?ue:void 0,parts:[{type:"text",text:K}]}),headers:J.headers,body:J.body,data:J.data};M(ye),H("")},[K,g,M]),Q=ne=>{H(ne.target.value)},Z=E.useCallback(({toolCallId:ne,result:J})=>{const oe=I.current;bpe({messages:oe,toolCallId:ne,toolResult:J}),D(oe,!1);const ee=oe[oe.length-1];K4(ee)&&M({messages:oe})},[D,M]);return{messages:k??[],id:_,setMessages:U,data:T,setData:q,error:A,append:W,reload:F,stop:P,input:K,setInput:H,handleInputChange:Q,handleSubmit:V,isLoading:z==="submitted"||z==="streaming",status:z,addToolResult:Z}}function Xpe(){const{authToken:e}=vr();wx();const[t,n]=E.useState(""),r=se(w=>w.selectedSheetId),o=se(w=>w.dashboard.aiScopeTables),{addFrame:i,setSelectedFrameId:s,setIsDashboardEditing:a}=zt(),{append:l,messages:c,setMessages:u,reload:d,input:h,setInput:f,status:p,handleInputChange:g,handleSubmit:b,stop:v}=iF({api:"https://semaphor.cloud/api/v1/chat",headers:{Authorization:`Bearer ${e==null?void 0:e.accessToken}`},maxSteps:10,onToolCall:x,onFinish(w,C){C.finishReason==="stop"&&n("")}});async function x({toolCall:w}){if(w.toolName==="getCurrentTableScope")return n("Initializing..."),{tables:o||[]};w.toolName==="getData"?n("Fetching data..."):w.toolName==="getDataAndChartType"?n("Fetching data for the chart..."):w.toolName==="getTableColumns"?n("Fetching table columns..."):console.log("Invalid tool call",w)}function y({sql:w,data:C,cardTitle:R,connectionId:k,cardType:D}){if(!r)return;const I={id:Li(),title:R||"Title",description:"Description",preferences:{onClickFilter:[{columnIndex:0,expression:""}],chartOptions:{indexAxis:D==="horizontalBar"?"y":"x"}},type:D,sql:w,data:C,connectionId:k},T={id:Li(),cards:[I],activeCardId:I.id};a(!0),i(r,T,"end"),s(T.id)}const _=!["ready","error"].includes(p);return{append:l,handleAddNewFrame:y,isLoading:_,handleSubmit:b,handleInputChange:g,input:h,setInput:f,messages:c,setMessages:u,reload:d,status:p,toolStatus:t,stop:v}}function sF({scrollContainerRef:e,inputRef:t,messages:n}){E.useEffect(()=>{const r=setTimeout(()=>{var o;e.current&&(e.current.scroll({top:e.current.scrollHeight,behavior:"smooth"}),(o=t.current)==null||o.focus())},50);return()=>clearTimeout(r)},[n,e,t])}var Jy=["Enter"," "],Qpe=["ArrowDown","PageUp","Home"],aF=["ArrowUp","PageDown","End"],Jpe=[...Qpe,...aF],Zpe={ltr:[...Jy,"ArrowRight"],rtl:[...Jy,"ArrowLeft"]},ege={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Ud="Menu",[rd,tge,nge]=Kp(Ud),[Ca,lF]=Kt(Ud,[nge,To,ec]),gm=To(),cF=ec(),[rge,_a]=Ca(Ud),[oge,qd]=Ca(Ud),uF=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:i,modal:s=!0}=e,a=gm(t),[l,c]=S.useState(null),u=S.useRef(!1),d=Gt(i),h=ga(o);return S.useEffect(()=>{const f=()=>{u.current=!0,document.addEventListener("pointerdown",p,{capture:!0,once:!0}),document.addEventListener("pointermove",p,{capture:!0,once:!0})},p=()=>u.current=!1;return document.addEventListener("keydown",f,{capture:!0}),()=>{document.removeEventListener("keydown",f,{capture:!0}),document.removeEventListener("pointerdown",p,{capture:!0}),document.removeEventListener("pointermove",p,{capture:!0})}},[]),m.jsx(Cd,{...a,children:m.jsx(rge,{scope:t,open:n,onOpenChange:d,content:l,onContentChange:c,children:m.jsx(oge,{scope:t,onClose:S.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:h,modal:s,children:r})})})};uF.displayName=Ud;var ige="MenuAnchor",OS=S.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=gm(n);return m.jsx(lc,{...o,...r,ref:t})});OS.displayName=ige;var DS="MenuPortal",[sge,dF]=Ca(DS,{forceMount:void 0}),fF=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,i=_a(DS,t);return m.jsx(sge,{scope:t,forceMount:n,children:m.jsx(qt,{present:n||i.open,children:m.jsx(Rd,{asChild:!0,container:o,children:r})})})};fF.displayName=DS;var kr="MenuContent",[age,TS]=Ca(kr),hF=S.forwardRef((e,t)=>{const n=dF(kr,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=_a(kr,e.__scopeMenu),s=qd(kr,e.__scopeMenu);return m.jsx(rd.Provider,{scope:e.__scopeMenu,children:m.jsx(qt,{present:r||i.open,children:m.jsx(rd.Slot,{scope:e.__scopeMenu,children:s.modal?m.jsx(lge,{...o,ref:t}):m.jsx(cge,{...o,ref:t})})})})}),lge=S.forwardRef((e,t)=>{const n=_a(kr,e.__scopeMenu),r=S.useRef(null),o=Oe(t,r);return S.useEffect(()=>{const i=r.current;if(i)return Lg(i)},[]),m.jsx(IS,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:ae(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),cge=S.forwardRef((e,t)=>{const n=_a(kr,e.__scopeMenu);return m.jsx(IS,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),IS=S.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEntryFocus:l,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:h,onDismiss:f,disableOutsideScroll:p,...g}=e,b=_a(kr,n),v=qd(kr,n),x=gm(n),y=cF(n),_=tge(n),[w,C]=S.useState(null),R=S.useRef(null),k=Oe(t,R,b.onContentChange),D=S.useRef(0),I=S.useRef(""),T=S.useRef(0),N=S.useRef(null),G=S.useRef("right"),z=S.useRef(0),O=p?kd:S.Fragment,A=p?{as:ri,allowPinchZoom:!0}:void 0,L=B=>{var H,V;const M=I.current+B,W=_().filter(Q=>!Q.disabled),F=document.activeElement,P=(H=W.find(Q=>Q.ref.current===F))==null?void 0:H.textValue,U=W.map(Q=>Q.textValue),q=wge(U,M,P),K=(V=W.find(Q=>Q.textValue===q))==null?void 0:V.ref.current;(function Q(Z){I.current=Z,window.clearTimeout(D.current),Z!==""&&(D.current=window.setTimeout(()=>Q(""),1e3))})(M),K&&setTimeout(()=>K.focus())};S.useEffect(()=>()=>window.clearTimeout(D.current),[]),jg();const j=S.useCallback(B=>{var W,F;return G.current===((W=N.current)==null?void 0:W.side)&&Cge(B,(F=N.current)==null?void 0:F.area)},[]);return m.jsx(age,{scope:n,searchRef:I,onItemEnter:S.useCallback(B=>{j(B)&&B.preventDefault()},[j]),onItemLeave:S.useCallback(B=>{var M;j(B)||((M=R.current)==null||M.focus(),C(null))},[j]),onTriggerLeave:S.useCallback(B=>{j(B)&&B.preventDefault()},[j]),pointerGraceTimerRef:T,onPointerGraceIntentChange:S.useCallback(B=>{N.current=B},[]),children:m.jsx(O,{...A,children:m.jsx(Md,{asChild:!0,trapped:o,onMountAutoFocus:ae(i,B=>{var M;B.preventDefault(),(M=R.current)==null||M.focus({preventScroll:!0})}),onUnmountAutoFocus:s,children:m.jsx(wa,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:h,onDismiss:f,children:m.jsx(_x,{asChild:!0,...y,dir:v.dir,orientation:"vertical",loop:r,currentTabStopId:w,onCurrentTabStopIdChange:C,onEntryFocus:ae(l,B=>{v.isUsingKeyboardRef.current||B.preventDefault()}),preventScrollOnEntryFocus:!0,children:m.jsx(_d,{role:"menu","aria-orientation":"vertical","data-state":kF(b.open),"data-radix-menu-content":"",dir:v.dir,...x,...g,ref:k,style:{outline:"none",...g.style},onKeyDown:ae(g.onKeyDown,B=>{const W=B.target.closest("[data-radix-menu-content]")===B.currentTarget,F=B.ctrlKey||B.altKey||B.metaKey,P=B.key.length===1;W&&(B.key==="Tab"&&B.preventDefault(),!F&&P&&L(B.key));const U=R.current;if(B.target!==U||!Jpe.includes(B.key))return;B.preventDefault();const K=_().filter(H=>!H.disabled).map(H=>H.ref.current);aF.includes(B.key)&&K.reverse(),yge(K)}),onBlur:ae(e.onBlur,B=>{B.currentTarget.contains(B.target)||(window.clearTimeout(D.current),I.current="")}),onPointerMove:ae(e.onPointerMove,od(B=>{const M=B.target,W=z.current!==B.clientX;if(B.currentTarget.contains(M)&&W){const F=B.clientX>z.current?"right":"left";G.current=F,z.current=B.clientX}}))})})})})})})});hF.displayName=kr;var uge="MenuGroup",AS=S.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return m.jsx(pe.div,{role:"group",...r,ref:t})});AS.displayName=uge;var dge="MenuLabel",pF=S.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return m.jsx(pe.div,{...r,ref:t})});pF.displayName=dge;var Ap="MenuItem",P2="menu.itemSelect",mm=S.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,i=S.useRef(null),s=qd(Ap,e.__scopeMenu),a=TS(Ap,e.__scopeMenu),l=Oe(t,i),c=S.useRef(!1),u=()=>{const d=i.current;if(!n&&d){const h=new CustomEvent(P2,{bubbles:!0,cancelable:!0});d.addEventListener(P2,f=>r==null?void 0:r(f),{once:!0}),FM(d,h),h.defaultPrevented?c.current=!1:s.onClose()}};return m.jsx(gF,{...o,ref:l,disabled:n,onClick:ae(e.onClick,u),onPointerDown:d=>{var h;(h=e.onPointerDown)==null||h.call(e,d),c.current=!0},onPointerUp:ae(e.onPointerUp,d=>{var h;c.current||(h=d.currentTarget)==null||h.click()}),onKeyDown:ae(e.onKeyDown,d=>{const h=a.searchRef.current!=="";n||h&&d.key===" "||Jy.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});mm.displayName=Ap;var gF=S.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...i}=e,s=TS(Ap,n),a=cF(n),l=S.useRef(null),c=Oe(t,l),[u,d]=S.useState(!1),[h,f]=S.useState("");return S.useEffect(()=>{const p=l.current;p&&f((p.textContent??"").trim())},[i.children]),m.jsx(rd.ItemSlot,{scope:n,disabled:r,textValue:o??h,children:m.jsx(Ex,{asChild:!0,...a,focusable:!r,children:m.jsx(pe.div,{role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...i,ref:c,onPointerMove:ae(e.onPointerMove,od(p=>{r?s.onItemLeave(p):(s.onItemEnter(p),p.defaultPrevented||p.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:ae(e.onPointerLeave,od(p=>s.onItemLeave(p))),onFocus:ae(e.onFocus,()=>d(!0)),onBlur:ae(e.onBlur,()=>d(!1))})})})}),fge="MenuCheckboxItem",mF=S.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return m.jsx(wF,{scope:e.__scopeMenu,checked:n,children:m.jsx(mm,{role:"menuitemcheckbox","aria-checked":Np(n)?"mixed":n,...o,ref:t,"data-state":jS(n),onSelect:ae(o.onSelect,()=>r==null?void 0:r(Np(n)?!0:!n),{checkForDefaultPrevented:!1})})})});mF.displayName=fge;var bF="MenuRadioGroup",[hge,pge]=Ca(bF,{value:void 0,onValueChange:()=>{}}),vF=S.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,i=Gt(r);return m.jsx(hge,{scope:e.__scopeMenu,value:n,onValueChange:i,children:m.jsx(AS,{...o,ref:t})})});vF.displayName=bF;var yF="MenuRadioItem",xF=S.forwardRef((e,t)=>{const{value:n,...r}=e,o=pge(yF,e.__scopeMenu),i=n===o.value;return m.jsx(wF,{scope:e.__scopeMenu,checked:i,children:m.jsx(mm,{role:"menuitemradio","aria-checked":i,...r,ref:t,"data-state":jS(i),onSelect:ae(r.onSelect,()=>{var s;return(s=o.onValueChange)==null?void 0:s.call(o,n)},{checkForDefaultPrevented:!1})})})});xF.displayName=yF;var NS="MenuItemIndicator",[wF,gge]=Ca(NS,{checked:!1}),SF=S.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,i=gge(NS,n);return m.jsx(qt,{present:r||Np(i.checked)||i.checked===!0,children:m.jsx(pe.span,{...o,ref:t,"data-state":jS(i.checked)})})});SF.displayName=NS;var mge="MenuSeparator",CF=S.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return m.jsx(pe.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});CF.displayName=mge;var bge="MenuArrow",_F=S.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=gm(n);return m.jsx(Ed,{...o,...r,ref:t})});_F.displayName=bge;var vge="MenuSub",[xve,EF]=Ca(vge),eu="MenuSubTrigger",RF=S.forwardRef((e,t)=>{const n=_a(eu,e.__scopeMenu),r=qd(eu,e.__scopeMenu),o=EF(eu,e.__scopeMenu),i=TS(eu,e.__scopeMenu),s=S.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:l}=i,c={__scopeMenu:e.__scopeMenu},u=S.useCallback(()=>{s.current&&window.clearTimeout(s.current),s.current=null},[]);return S.useEffect(()=>u,[u]),S.useEffect(()=>{const d=a.current;return()=>{window.clearTimeout(d),l(null)}},[a,l]),m.jsx(OS,{asChild:!0,...c,children:m.jsx(gF,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":kF(n.open),...e,ref:Yp(t,o.onTriggerChange),onClick:d=>{var h;(h=e.onClick)==null||h.call(e,d),!(e.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:ae(e.onPointerMove,od(d=>{i.onItemEnter(d),!d.defaultPrevented&&!e.disabled&&!n.open&&!s.current&&(i.onPointerGraceIntentChange(null),s.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:ae(e.onPointerLeave,od(d=>{var f,p;u();const h=(f=n.content)==null?void 0:f.getBoundingClientRect();if(h){const g=(p=n.content)==null?void 0:p.dataset.side,b=g==="right",v=b?-5:5,x=h[b?"left":"right"],y=h[b?"right":"left"];i.onPointerGraceIntentChange({area:[{x:d.clientX+v,y:d.clientY},{x,y:h.top},{x:y,y:h.top},{x:y,y:h.bottom},{x,y:h.bottom}],side:g}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(d),d.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:ae(e.onKeyDown,d=>{var f;const h=i.searchRef.current!=="";e.disabled||h&&d.key===" "||Zpe[r.dir].includes(d.key)&&(n.onOpenChange(!0),(f=n.content)==null||f.focus(),d.preventDefault())})})})});RF.displayName=eu;var PF="MenuSubContent",MF=S.forwardRef((e,t)=>{const n=dF(kr,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=_a(kr,e.__scopeMenu),s=qd(kr,e.__scopeMenu),a=EF(PF,e.__scopeMenu),l=S.useRef(null),c=Oe(t,l);return m.jsx(rd.Provider,{scope:e.__scopeMenu,children:m.jsx(qt,{present:r||i.open,children:m.jsx(rd.Slot,{scope:e.__scopeMenu,children:m.jsx(IS,{id:a.contentId,"aria-labelledby":a.triggerId,...o,ref:c,align:"start",side:s.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:u=>{var d;s.isUsingKeyboardRef.current&&((d=l.current)==null||d.focus()),u.preventDefault()},onCloseAutoFocus:u=>u.preventDefault(),onFocusOutside:ae(e.onFocusOutside,u=>{u.target!==a.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:ae(e.onEscapeKeyDown,u=>{s.onClose(),u.preventDefault()}),onKeyDown:ae(e.onKeyDown,u=>{var f;const d=u.currentTarget.contains(u.target),h=ege[s.dir].includes(u.key);d&&h&&(i.onOpenChange(!1),(f=a.trigger)==null||f.focus(),u.preventDefault())})})})})})});MF.displayName=PF;function kF(e){return e?"open":"closed"}function Np(e){return e==="indeterminate"}function jS(e){return Np(e)?"indeterminate":e?"checked":"unchecked"}function yge(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function xge(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function wge(e,t,n){const o=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let s=xge(e,Math.max(i,0));o.length===1&&(s=s.filter(c=>c!==n));const l=s.find(c=>c.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function Sge(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,s=t.length-1;i<t.length;s=i++){const a=t[i].x,l=t[i].y,c=t[s].x,u=t[s].y;l>r!=u>r&&n<(c-a)*(r-l)/(u-l)+a&&(o=!o)}return o}function Cge(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return Sge(n,t)}function od(e){return t=>t.pointerType==="mouse"?e(t):void 0}var _ge=uF,Ege=OS,Rge=fF,Pge=hF,Mge=AS,kge=pF,Oge=mm,Dge=mF,Tge=vF,Ige=xF,Age=SF,Nge=CF,jge=_F,Fge=RF,Lge=MF,FS="DropdownMenu",[$ge,wve]=Kt(FS,[lF]),Dn=lF(),[zge,OF]=$ge(FS),DF=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:i,onOpenChange:s,modal:a=!0}=e,l=Dn(t),c=S.useRef(null),[u=!1,d]=yn({prop:o,defaultProp:i,onChange:s});return m.jsx(zge,{scope:t,triggerId:Ut(),triggerRef:c,contentId:Ut(),open:u,onOpenChange:d,onOpenToggle:S.useCallback(()=>d(h=>!h),[d]),modal:a,children:m.jsx(_ge,{...l,open:u,onOpenChange:d,dir:r,modal:a,children:n})})};DF.displayName=FS;var TF="DropdownMenuTrigger",IF=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,i=OF(TF,n),s=Dn(n);return m.jsx(Ege,{asChild:!0,...s,children:m.jsx(pe.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...o,ref:Yp(t,i.triggerRef),onPointerDown:ae(e.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(i.onOpenToggle(),i.open||a.preventDefault())}),onKeyDown:ae(e.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&i.onOpenToggle(),a.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});IF.displayName=TF;var Bge="DropdownMenuPortal",AF=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Dn(t);return m.jsx(Rge,{...r,...n})};AF.displayName=Bge;var NF="DropdownMenuContent",jF=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=OF(NF,n),i=Dn(n),s=S.useRef(!1);return m.jsx(Pge,{id:o.contentId,"aria-labelledby":o.triggerId,...i,...r,ref:t,onCloseAutoFocus:ae(e.onCloseAutoFocus,a=>{var l;s.current||(l=o.triggerRef.current)==null||l.focus(),s.current=!1,a.preventDefault()}),onInteractOutside:ae(e.onInteractOutside,a=>{const l=a.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,u=l.button===2||c;(!o.modal||u)&&(s.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});jF.displayName=NF;var Vge="DropdownMenuGroup",Hge=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Dn(n);return m.jsx(Mge,{...o,...r,ref:t})});Hge.displayName=Vge;var Wge="DropdownMenuLabel",FF=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Dn(n);return m.jsx(kge,{...o,...r,ref:t})});FF.displayName=Wge;var Uge="DropdownMenuItem",LF=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Dn(n);return m.jsx(Oge,{...o,...r,ref:t})});LF.displayName=Uge;var qge="DropdownMenuCheckboxItem",$F=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Dn(n);return m.jsx(Dge,{...o,...r,ref:t})});$F.displayName=qge;var Gge="DropdownMenuRadioGroup",zF=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Dn(n);return m.jsx(Tge,{...o,...r,ref:t})});zF.displayName=Gge;var Yge="DropdownMenuRadioItem",BF=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Dn(n);return m.jsx(Ige,{...o,...r,ref:t})});BF.displayName=Yge;var Kge="DropdownMenuItemIndicator",VF=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Dn(n);return m.jsx(Age,{...o,...r,ref:t})});VF.displayName=Kge;var Xge="DropdownMenuSeparator",HF=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Dn(n);return m.jsx(Nge,{...o,...r,ref:t})});HF.displayName=Xge;var Qge="DropdownMenuArrow",Jge=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Dn(n);return m.jsx(jge,{...o,...r,ref:t})});Jge.displayName=Qge;var Zge="DropdownMenuSubTrigger",WF=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Dn(n);return m.jsx(Fge,{...o,...r,ref:t})});WF.displayName=Zge;var eme="DropdownMenuSubContent",UF=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Dn(n);return m.jsx(Lge,{...o,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});UF.displayName=eme;var tme=DF,nme=IF,rme=AF,qF=jF,GF=FF,YF=LF,KF=$F,ome=zF,XF=BF,QF=VF,JF=HF,ZF=WF,eL=UF;const ime=tme,sme=nme,ame=ome,lme=S.forwardRef(({className:e,inset:t,children:n,...r},o)=>m.jsxs(ZF,{ref:o,className:ie("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",t&&"pl-8",e),...r,children:[n,m.jsx(tw,{className:"ml-auto h-4 w-4"})]}));lme.displayName=ZF.displayName;const cme=S.forwardRef(({className:e,...t},n)=>m.jsx(Ki,{children:m.jsx(eL,{ref:n,className:ie("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t})}));cme.displayName=eL.displayName;const tL=S.forwardRef(({className:e,sideOffset:t=4,...n},r)=>m.jsx(rme,{children:m.jsx(Ki,{children:m.jsx(qF,{ref:r,sideOffset:t,className:ie("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})})}));tL.displayName=qF.displayName;const ume=S.forwardRef(({className:e,inset:t,...n},r)=>m.jsx(YF,{ref:r,className:ie("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...n}));ume.displayName=YF.displayName;const nL=S.forwardRef(({className:e,children:t,checked:n,...r},o)=>m.jsxs(KF,{ref:o,className:ie("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...r,children:[m.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:m.jsx(QF,{children:m.jsx(tc,{className:"h-4 w-4"})})}),t]}));nL.displayName=KF.displayName;const rL=S.forwardRef(({className:e,children:t,...n},r)=>m.jsxs(XF,{ref:r,className:ie("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[m.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:m.jsx(QF,{children:m.jsx(Qk,{className:"h-2 w-2 fill-current"})})}),t]}));rL.displayName=XF.displayName;const oL=S.forwardRef(({className:e,inset:t,...n},r)=>m.jsx(GF,{ref:r,className:ie("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));oL.displayName=GF.displayName;const iL=S.forwardRef(({className:e,...t},n)=>m.jsx(JF,{ref:n,className:ie("-mx-1 my-1 h-px bg-muted",e),...t}));iL.displayName=JF.displayName;const jp=E.forwardRef(({children:e,className:t,tooltip:n,onClick:r,...o},i)=>m.jsxs(Qw,{children:[m.jsx(Jw,{asChild:!0,children:m.jsx(Yt,{ref:i,size:"sm",variant:"ghost",onClick:r,...o,className:ie(Ja,t),children:e})}),n&&m.jsx(Ig,{side:"bottom",sideOffset:10,children:n})]}));jp.displayName="IconButton";const dme=[{title:"Show top 3 insights",subtitle:"from this dataset"},{title:"Create a bar chart for",subtitle:"sales by product category"}];function fme({open:e,setOpen:t}){const[n,r]=E.useState(!1),[o,i]=E.useState(Dh),[s,a]=E.useState(!1),l=E.useRef(null),c=E.useRef(null),u=se(T=>T.dashboard.aiScopeTables),{append:d,handleAddNewFrame:h,isLoading:f,handleSubmit:p,handleInputChange:g,input:b,setInput:v,messages:x,setMessages:y,reload:_,status:w,toolStatus:C,stop:R}=Xpe();sF({scrollContainerRef:c,inputRef:l,messages:x}),E.useEffect(()=>{var T;e&&((T=l.current)==null||T.focus())},[e]);function k(T){const N={role:"user",content:T.title+" "+T.subtitle};d(N)}const D=(b==null?void 0:b.length)===0&&(x==null?void 0:x.filter(T=>T.role==="user").length)===0;function I(){return m.jsxs("div",{"data-role":"header",children:[m.jsx("div",{className:"text-lg font-semibold",children:"Assistant"}),u&&u.length>0&&m.jsx("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:u==null?void 0:u.map((T,N)=>m.jsx("div",{className:"flex items-center gap-2 rounded-md border border-border bg-muted px-2 py-1 text-xs",children:hM({schemaName:T.schemaName||"",tableName:T.tableName||"",modelName:T.datamodelName||"",connectionType:T.connectionType||""})},N))}),(u==null?void 0:u.length)===0&&m.jsx("div",{className:"mt-2 flex items-center gap-2",children:m.jsx("span",{className:"text-xs text-muted-foreground",children:"Context: None"})})]})}return m.jsxs("div",{"data-role":"dashboard-assistant",className:"flex h-full grow flex-col justify-between gap-2 break-words px-6 py-4",children:[m.jsxs("div",{"data-role":"header-section",className:"flex items-start justify-between gap-2",children:[I(),m.jsxs("div",{"data-role":"header-actions",className:"flex items-center",children:[Dh,m.jsx(jp,{className:"h-7 p-2",onClick:()=>{y([]),_()},children:m.jsx(iO,{className:"size-3.5 text-muted-foreground"})}),m.jsx(jp,{className:"h-7 p-2",onClick:()=>{t(!1)},children:m.jsx(ya,{className:"size-4"})})]})]}),m.jsxs(pm,{"data-role":"dashboard-assistant-scroll-area",ref:c,className:"flex flex-1 basis-0 flex-col flex-wrap justify-end pr-2",children:[m.jsxs("div",{className:"pb-4",children:[m.jsx(k4,{showTools:o,showSystemMessage:s,messages:x,onAddToDashboard:h}),m.jsx(M4,{status:O4(w,C),isLoading:f})]}),m.jsx(uc,{orientation:"horizontal"})]}),m.jsxs("div",{className:"space-y-2",children:[D&&m.jsx(T4,{onClick:k,placeholders:dme}),m.jsx(D4,{ref:l,setInput:v,stop:R,input:b,handleInputChange:g,handleSubmit:p,isLoading:f})]})]})}var hme=e=>{switch(e){case"success":return mme;case"info":return vme;case"warning":return bme;case"error":return yme;default:return null}},pme=Array(12).fill(0),gme=({visible:e,className:t})=>E.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},E.createElement("div",{className:"sonner-spinner"},pme.map((n,r)=>E.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),mme=E.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},E.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),bme=E.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},E.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),vme=E.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},E.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),yme=E.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},E.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),xme=E.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},E.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),E.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),wme=()=>{let[e,t]=E.useState(document.hidden);return E.useEffect(()=>{let n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},Zy=1,Sme=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:n,...r}=e,o=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:Zy++,i=this.toasts.find(a=>a.id===o),s=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(o)&&this.dismissedToasts.delete(o),i?this.toasts=this.toasts.map(a=>a.id===o?(this.publish({...a,...e,id:o,title:n}),{...a,...e,id:o,dismissible:s,title:n}):a):this.addToast({title:n,...r,dismissible:s,id:o}),o},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(t=>{this.subscribers.forEach(n=>n({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let r=e instanceof Promise?e:e(),o=n!==void 0,i,s=r.then(async l=>{if(i=["resolve",l],E.isValidElement(l))o=!1,this.create({id:n,type:"default",message:l});else if(_me(l)&&!l.ok){o=!1;let c=typeof t.error=="function"?await t.error(`HTTP error! status: ${l.status}`):t.error,u=typeof t.description=="function"?await t.description(`HTTP error! status: ${l.status}`):t.description;this.create({id:n,type:"error",message:c,description:u})}else if(t.success!==void 0){o=!1;let c=typeof t.success=="function"?await t.success(l):t.success,u=typeof t.description=="function"?await t.description(l):t.description;this.create({id:n,type:"success",message:c,description:u})}}).catch(async l=>{if(i=["reject",l],t.error!==void 0){o=!1;let c=typeof t.error=="function"?await t.error(l):t.error,u=typeof t.description=="function"?await t.description(l):t.description;this.create({id:n,type:"error",message:c,description:u})}}).finally(()=>{var l;o&&(this.dismiss(n),n=void 0),(l=t.finally)==null||l.call(t)}),a=()=>new Promise((l,c)=>s.then(()=>i[0]==="reject"?c(i[1]):l(i[1])).catch(c));return typeof n!="string"&&typeof n!="number"?{unwrap:a}:Object.assign(n,{unwrap:a})},this.custom=(e,t)=>{let n=(t==null?void 0:t.id)||Zy++;return this.create({jsx:e(n),id:n,...t}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},Bn=new Sme,Cme=(e,t)=>{let n=(t==null?void 0:t.id)||Zy++;return Bn.addToast({title:e,...t,id:n}),n},_me=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",Eme=Cme,Rme=()=>Bn.toasts,Pme=()=>Bn.getActiveToasts(),sL=Object.assign(Eme,{success:Bn.success,info:Bn.info,warning:Bn.warning,error:Bn.error,custom:Bn.custom,message:Bn.message,promise:Bn.promise,dismiss:Bn.dismiss,loading:Bn.loading},{getHistory:Rme,getToasts:Pme});function Mme(e,{insertAt:t}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}Mme(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
346
- `);function oh(e){return e.label!==void 0}var kme=3,Ome="32px",Dme="16px",M2=4e3,Tme=356,Ime=14,Ame=20,Nme=200;function Ir(...e){return e.filter(Boolean).join(" ")}function jme(e){let[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}var Fme=e=>{var t,n,r,o,i,s,a,l,c,u,d;let{invert:h,toast:f,unstyled:p,interacting:g,setHeights:b,visibleToasts:v,heights:x,index:y,toasts:_,expanded:w,removeToast:C,defaultRichColors:R,closeButton:k,style:D,cancelButtonStyle:I,actionButtonStyle:T,className:N="",descriptionClassName:G="",duration:z,position:O,gap:A,loadingIcon:L,expandByDefault:j,classNames:B,icons:M,closeButtonAriaLabel:W="Close toast",pauseWhenPageIsHidden:F}=e,[P,U]=E.useState(null),[q,K]=E.useState(null),[H,V]=E.useState(!1),[Q,Z]=E.useState(!1),[ne,J]=E.useState(!1),[oe,ee]=E.useState(!1),[ue,de]=E.useState(!1),[ye,he]=E.useState(0),[me,je]=E.useState(0),et=E.useRef(f.duration||z||M2),Bt=E.useRef(null),Ue=E.useRef(null),Zn=y===0,wt=y+1<=v,te=f.type,le=f.dismissible!==!1,ve=f.className||"",Re=f.descriptionClassName||"",Ve=E.useMemo(()=>x.findIndex(De=>De.toastId===f.id)||0,[x,f.id]),sn=E.useMemo(()=>{var De;return(De=f.closeButton)!=null?De:k},[f.closeButton,k]),er=E.useMemo(()=>f.duration||z||M2,[f.duration,z]),wn=E.useRef(0),Tn=E.useRef(0),an=E.useRef(0),St=E.useRef(null),[Xr,In]=O.split("-"),Kd=E.useMemo(()=>x.reduce((De,st,bt)=>bt>=Ve?De:De+st.height,0),[x,Ve]),mc=wme(),os=f.invert||h,bc=te==="loading";Tn.current=E.useMemo(()=>Ve*A+Kd,[Ve,Kd]),E.useEffect(()=>{et.current=er},[er]),E.useEffect(()=>{V(!0)},[]),E.useEffect(()=>{let De=Ue.current;if(De){let st=De.getBoundingClientRect().height;return je(st),b(bt=>[{toastId:f.id,height:st,position:f.position},...bt]),()=>b(bt=>bt.filter(tr=>tr.toastId!==f.id))}},[b,f.id]),E.useLayoutEffect(()=>{if(!H)return;let De=Ue.current,st=De.style.height;De.style.height="auto";let bt=De.getBoundingClientRect().height;De.style.height=st,je(bt),b(tr=>tr.find(Lt=>Lt.toastId===f.id)?tr.map(Lt=>Lt.toastId===f.id?{...Lt,height:bt}:Lt):[{toastId:f.id,height:bt,position:f.position},...tr])},[H,f.title,f.description,b,f.id]);let ln=E.useCallback(()=>{Z(!0),he(Tn.current),b(De=>De.filter(st=>st.toastId!==f.id)),setTimeout(()=>{C(f)},Nme)},[f,C,b,Tn]);E.useEffect(()=>{if(f.promise&&te==="loading"||f.duration===1/0||f.type==="loading")return;let De;return w||g||F&&mc?(()=>{if(an.current<wn.current){let st=new Date().getTime()-wn.current;et.current=et.current-st}an.current=new Date().getTime()})():et.current!==1/0&&(wn.current=new Date().getTime(),De=setTimeout(()=>{var st;(st=f.onAutoClose)==null||st.call(f,f),ln()},et.current)),()=>clearTimeout(De)},[w,g,f,te,F,mc,ln]),E.useEffect(()=>{f.delete&&ln()},[ln,f.delete]);function wm(){var De,st,bt;return M!=null&&M.loading?E.createElement("div",{className:Ir(B==null?void 0:B.loader,(De=f==null?void 0:f.classNames)==null?void 0:De.loader,"sonner-loader"),"data-visible":te==="loading"},M.loading):L?E.createElement("div",{className:Ir(B==null?void 0:B.loader,(st=f==null?void 0:f.classNames)==null?void 0:st.loader,"sonner-loader"),"data-visible":te==="loading"},L):E.createElement(gme,{className:Ir(B==null?void 0:B.loader,(bt=f==null?void 0:f.classNames)==null?void 0:bt.loader),visible:te==="loading"})}return E.createElement("li",{tabIndex:0,ref:Ue,className:Ir(N,ve,B==null?void 0:B.toast,(t=f==null?void 0:f.classNames)==null?void 0:t.toast,B==null?void 0:B.default,B==null?void 0:B[te],(n=f==null?void 0:f.classNames)==null?void 0:n[te]),"data-sonner-toast":"","data-rich-colors":(r=f.richColors)!=null?r:R,"data-styled":!(f.jsx||f.unstyled||p),"data-mounted":H,"data-promise":!!f.promise,"data-swiped":ue,"data-removed":Q,"data-visible":wt,"data-y-position":Xr,"data-x-position":In,"data-index":y,"data-front":Zn,"data-swiping":ne,"data-dismissible":le,"data-type":te,"data-invert":os,"data-swipe-out":oe,"data-swipe-direction":q,"data-expanded":!!(w||j&&H),style:{"--index":y,"--toasts-before":y,"--z-index":_.length-y,"--offset":`${Q?ye:Tn.current}px`,"--initial-height":j?"auto":`${me}px`,...D,...f.style},onDragEnd:()=>{J(!1),U(null),St.current=null},onPointerDown:De=>{bc||!le||(Bt.current=new Date,he(Tn.current),De.target.setPointerCapture(De.pointerId),De.target.tagName!=="BUTTON"&&(J(!0),St.current={x:De.clientX,y:De.clientY}))},onPointerUp:()=>{var De,st,bt,tr;if(oe||!le)return;St.current=null;let Lt=Number(((De=Ue.current)==null?void 0:De.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Qr=Number(((st=Ue.current)==null?void 0:st.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Ao=new Date().getTime()-((bt=Bt.current)==null?void 0:bt.getTime()),nr=P==="x"?Lt:Qr,Jr=Math.abs(nr)/Ao;if(Math.abs(nr)>=Ame||Jr>.11){he(Tn.current),(tr=f.onDismiss)==null||tr.call(f,f),K(P==="x"?Lt>0?"right":"left":Qr>0?"down":"up"),ln(),ee(!0),de(!1);return}J(!1),U(null)},onPointerMove:De=>{var st,bt,tr,Lt;if(!St.current||!le||((st=window.getSelection())==null?void 0:st.toString().length)>0)return;let Qr=De.clientY-St.current.y,Ao=De.clientX-St.current.x,nr=(bt=e.swipeDirections)!=null?bt:jme(O);!P&&(Math.abs(Ao)>1||Math.abs(Qr)>1)&&U(Math.abs(Ao)>Math.abs(Qr)?"x":"y");let Jr={x:0,y:0};P==="y"?(nr.includes("top")||nr.includes("bottom"))&&(nr.includes("top")&&Qr<0||nr.includes("bottom")&&Qr>0)&&(Jr.y=Qr):P==="x"&&(nr.includes("left")||nr.includes("right"))&&(nr.includes("left")&&Ao<0||nr.includes("right")&&Ao>0)&&(Jr.x=Ao),(Math.abs(Jr.x)>0||Math.abs(Jr.y)>0)&&de(!0),(tr=Ue.current)==null||tr.style.setProperty("--swipe-amount-x",`${Jr.x}px`),(Lt=Ue.current)==null||Lt.style.setProperty("--swipe-amount-y",`${Jr.y}px`)}},sn&&!f.jsx?E.createElement("button",{"aria-label":W,"data-disabled":bc,"data-close-button":!0,onClick:bc||!le?()=>{}:()=>{var De;ln(),(De=f.onDismiss)==null||De.call(f,f)},className:Ir(B==null?void 0:B.closeButton,(o=f==null?void 0:f.classNames)==null?void 0:o.closeButton)},(i=M==null?void 0:M.close)!=null?i:xme):null,f.jsx||E.isValidElement(f.title)?f.jsx?f.jsx:typeof f.title=="function"?f.title():f.title:E.createElement(E.Fragment,null,te||f.icon||f.promise?E.createElement("div",{"data-icon":"",className:Ir(B==null?void 0:B.icon,(s=f==null?void 0:f.classNames)==null?void 0:s.icon)},f.promise||f.type==="loading"&&!f.icon?f.icon||wm():null,f.type!=="loading"?f.icon||(M==null?void 0:M[te])||hme(te):null):null,E.createElement("div",{"data-content":"",className:Ir(B==null?void 0:B.content,(a=f==null?void 0:f.classNames)==null?void 0:a.content)},E.createElement("div",{"data-title":"",className:Ir(B==null?void 0:B.title,(l=f==null?void 0:f.classNames)==null?void 0:l.title)},typeof f.title=="function"?f.title():f.title),f.description?E.createElement("div",{"data-description":"",className:Ir(G,Re,B==null?void 0:B.description,(c=f==null?void 0:f.classNames)==null?void 0:c.description)},typeof f.description=="function"?f.description():f.description):null),E.isValidElement(f.cancel)?f.cancel:f.cancel&&oh(f.cancel)?E.createElement("button",{"data-button":!0,"data-cancel":!0,style:f.cancelButtonStyle||I,onClick:De=>{var st,bt;oh(f.cancel)&&le&&((bt=(st=f.cancel).onClick)==null||bt.call(st,De),ln())},className:Ir(B==null?void 0:B.cancelButton,(u=f==null?void 0:f.classNames)==null?void 0:u.cancelButton)},f.cancel.label):null,E.isValidElement(f.action)?f.action:f.action&&oh(f.action)?E.createElement("button",{"data-button":!0,"data-action":!0,style:f.actionButtonStyle||T,onClick:De=>{var st,bt;oh(f.action)&&((bt=(st=f.action).onClick)==null||bt.call(st,De),!De.defaultPrevented&&ln())},className:Ir(B==null?void 0:B.actionButton,(d=f==null?void 0:f.classNames)==null?void 0:d.actionButton)},f.action.label):null))};function k2(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function Lme(e,t){let n={};return[e,t].forEach((r,o)=>{let i=o===1,s=i?"--mobile-offset":"--offset",a=i?Dme:Ome;function l(c){["top","right","bottom","left"].forEach(u=>{n[`${s}-${u}`]=typeof c=="number"?`${c}px`:c})}typeof r=="number"||typeof r=="string"?l(r):typeof r=="object"?["top","right","bottom","left"].forEach(c=>{r[c]===void 0?n[`${s}-${c}`]=a:n[`${s}-${c}`]=typeof r[c]=="number"?`${r[c]}px`:r[c]}):l(a)}),n}var $me=E.forwardRef(function(e,t){let{invert:n,position:r="bottom-right",hotkey:o=["altKey","KeyT"],expand:i,closeButton:s,className:a,offset:l,mobileOffset:c,theme:u="light",richColors:d,duration:h,style:f,visibleToasts:p=kme,toastOptions:g,dir:b=k2(),gap:v=Ime,loadingIcon:x,icons:y,containerAriaLabel:_="Notifications",pauseWhenPageIsHidden:w}=e,[C,R]=E.useState([]),k=E.useMemo(()=>Array.from(new Set([r].concat(C.filter(F=>F.position).map(F=>F.position)))),[C,r]),[D,I]=E.useState([]),[T,N]=E.useState(!1),[G,z]=E.useState(!1),[O,A]=E.useState(u!=="system"?u:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),L=E.useRef(null),j=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),B=E.useRef(null),M=E.useRef(!1),W=E.useCallback(F=>{R(P=>{var U;return(U=P.find(q=>q.id===F.id))!=null&&U.delete||Bn.dismiss(F.id),P.filter(({id:q})=>q!==F.id)})},[]);return E.useEffect(()=>Bn.subscribe(F=>{if(F.dismiss){R(P=>P.map(U=>U.id===F.id?{...U,delete:!0}:U));return}setTimeout(()=>{gn.flushSync(()=>{R(P=>{let U=P.findIndex(q=>q.id===F.id);return U!==-1?[...P.slice(0,U),{...P[U],...F},...P.slice(U+1)]:[F,...P]})})})}),[]),E.useEffect(()=>{if(u!=="system"){A(u);return}if(u==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?A("dark"):A("light")),typeof window>"u")return;let F=window.matchMedia("(prefers-color-scheme: dark)");try{F.addEventListener("change",({matches:P})=>{A(P?"dark":"light")})}catch{F.addListener(({matches:U})=>{try{A(U?"dark":"light")}catch(q){console.error(q)}})}},[u]),E.useEffect(()=>{C.length<=1&&N(!1)},[C]),E.useEffect(()=>{let F=P=>{var U,q;o.every(K=>P[K]||P.code===K)&&(N(!0),(U=L.current)==null||U.focus()),P.code==="Escape"&&(document.activeElement===L.current||(q=L.current)!=null&&q.contains(document.activeElement))&&N(!1)};return document.addEventListener("keydown",F),()=>document.removeEventListener("keydown",F)},[o]),E.useEffect(()=>{if(L.current)return()=>{B.current&&(B.current.focus({preventScroll:!0}),B.current=null,M.current=!1)}},[L.current]),E.createElement("section",{ref:t,"aria-label":`${_} ${j}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},k.map((F,P)=>{var U;let[q,K]=F.split("-");return C.length?E.createElement("ol",{key:F,dir:b==="auto"?k2():b,tabIndex:-1,ref:L,className:a,"data-sonner-toaster":!0,"data-theme":O,"data-y-position":q,"data-lifted":T&&C.length>1&&!i,"data-x-position":K,style:{"--front-toast-height":`${((U=D[0])==null?void 0:U.height)||0}px`,"--width":`${Tme}px`,"--gap":`${v}px`,...f,...Lme(l,c)},onBlur:H=>{M.current&&!H.currentTarget.contains(H.relatedTarget)&&(M.current=!1,B.current&&(B.current.focus({preventScroll:!0}),B.current=null))},onFocus:H=>{H.target instanceof HTMLElement&&H.target.dataset.dismissible==="false"||M.current||(M.current=!0,B.current=H.relatedTarget)},onMouseEnter:()=>N(!0),onMouseMove:()=>N(!0),onMouseLeave:()=>{G||N(!1)},onDragEnd:()=>N(!1),onPointerDown:H=>{H.target instanceof HTMLElement&&H.target.dataset.dismissible==="false"||z(!0)},onPointerUp:()=>z(!1)},C.filter(H=>!H.position&&P===0||H.position===F).map((H,V)=>{var Q,Z;return E.createElement(Fme,{key:H.id,icons:y,index:V,toast:H,defaultRichColors:d,duration:(Q=g==null?void 0:g.duration)!=null?Q:h,className:g==null?void 0:g.className,descriptionClassName:g==null?void 0:g.descriptionClassName,invert:n,visibleToasts:p,closeButton:(Z=g==null?void 0:g.closeButton)!=null?Z:s,interacting:G,position:F,style:g==null?void 0:g.style,unstyled:g==null?void 0:g.unstyled,classNames:g==null?void 0:g.classNames,cancelButtonStyle:g==null?void 0:g.cancelButtonStyle,actionButtonStyle:g==null?void 0:g.actionButtonStyle,removeToast:W,toasts:C.filter(ne=>ne.position==H.position),heights:D.filter(ne=>ne.position==H.position),setHeights:I,expandByDefault:i,gap:v,loadingIcon:x,expanded:T,pauseWhenPageIsHidden:w,swipeDirections:e.swipeDirections})})):null}))});function zme(e){const t=e.current,{getSelectedFrame:n,addFrame:r,setSelectedFrameId:o}=zt(),i=se(u=>u.dashboard.sheets),a=se(u=>u.selectedSheetId)??(i==null?void 0:i[0].id),l=se(u=>u.isDashboardEditing),c=se(u=>u.isVisualEditing);E.useEffect(()=>{if(!l||c)return;async function u(f){const p=f.ctrlKey||f.metaKey;p&&f.key==="c"?(await d(),sL.success("Card copied to clipboard"),f.preventDefault()):p&&f.key==="v"&&(await h(),f.preventDefault())}async function d(){try{const f=n();f&&await navigator.clipboard.writeText(JSON.stringify(f))}catch(f){console.error("Failed to copy text:",f)}}async function h(){if(!a)return null;try{const f=await navigator.clipboard.readText();try{const p=JSON.parse(f);if(p&&p.id){p.id=Li();const g=p.activeCardId;p.cards.forEach(b=>{const v=b.id;b.id=Li(),v===g&&(p.activeCardId=b.id,b.title=`${b.title} (Copy)`)}),r(a,p),o(p.id)}}catch(p){console.error("Failed to parse clipboard contents: ",p)}return f}catch(f){return console.error("Failed to paste text:",f),null}}return t==null||t.addEventListener("keydown",u),()=>t==null?void 0:t.removeEventListener("keydown",u)},[r,n,o,a,l,c,t])}function aL(){const{showAssistant:e}=vr(),t=E.useRef(null),n=E.useRef(null),[r,o]=E.useState(!1),[i,s]=E.useState(!1),a=se(w=>w.themeStyle),l=se(w=>{var C;return(C=w.dashboard)==null?void 0:C.sheets}),c=se(w=>w.isDashboardEditing),u=se(w=>w.selectedSheetId),{setSelectedSheetId:d,setSheetTitle:h,addSheet:f}=zt();zme(n);function p(w){var C,R;w?((C=t.current)==null||C.resize(35),s(!0)):(s(!1),(R=t.current)==null||R.resize(0))}function g(){const w={id:Li(),title:"New Sheet"};f(w)}function b(w){w<1?s(!1):s(!0)}function v(){return(a==null?void 0:a.canvasTheme)==="muted"||!(a!=null&&a.canvasTheme)?"hsl(var(--semaphor-muted))":(a==null?void 0:a.canvasTheme)==="clear"?"":a==null?void 0:a.canvasTheme}function x(){var w,C;if(l&&l.length>1||c)return m.jsxs(Qp,{role:"tab-list",className:"flex h-11 items-center justify-start gap-2 rounded-none border-b border-b-muted bg-transparent px-2.5 py-3",children:[l==null?void 0:l.map(R=>{var k,D;return m.jsx(bo,{text:R.title,onSave:I=>h(R.id,I),children:m.jsxs(Jp,{style:{borderRadius:(D=(k=a==null?void 0:a.chart)==null?void 0:k.options)==null?void 0:D.borderRadius},onClick:()=>d(R.id),className:"flex items-center gap-1 rounded-none border px-2 py-1",value:R.id,children:[R.title,c&&u===R.id&&l.length>1&&m.jsx(ya,{className:"ml-1 size-3",onClick:()=>o(!0)})]})},R.id)}),c&&m.jsx("div",{style:{borderRadius:(C=(w=a==null?void 0:a.chart)==null?void 0:w.options)==null?void 0:C.borderRadius},className:"flex h-7 items-center justify-center border-none bg-muted p-2 hover:cursor-pointer dark:border-l-background",onClick:g,children:m.jsx(dg,{className:"size-3"})})]})}function y(){return m.jsx(pm,{ref:n,style:{},className:"h-full overflow-y-auto",children:l==null?void 0:l.map(w=>m.jsx(kx,{style:{backgroundColor:v()},className:ie("mt-0",{}),value:w.id,children:m.jsx(pae,{sheet:w})},w.id))})}function _(){var w;return m.jsxs(Mx,{"data-role":"dashboard-tabs-container",className:ie("relative flex h-full flex-col",a==null?void 0:a.dashboardTabsContainer),onValueChange:C=>{d(C)},value:u||((w=l==null?void 0:l[0])==null?void 0:w.id),children:[x(),y(),m.jsx(gle,{open:r,setOpen:o})]})}return l?m.jsxs(X5,{className:"grow",direction:"horizontal",children:[m.jsx(My,{children:_()}),e===!0&&m.jsxs(m.Fragment,{children:[m.jsx(qae,{open:i,onTabClick:p,withHandle:!0}),m.jsx(My,{"data-role":"dashboard-assistant-panel",onResize:b,defaultSize:0,ref:t,children:m.jsx(fme,{open:i,setOpen:p})})]})]}):null}function lL({children:e}){return m.jsx(O8,{defaultTheme:"system",storageKey:"vite-ui-theme",children:m.jsx(JT,{delayDuration:0,children:e})})}function cL(e){return m.jsx(vd,{FallbackComponent:nw,children:m.jsx(DM,{dashboardProps:e,children:m.jsx(lL,{children:m.jsx(jM,{...e,children:m.jsx(aL,{})})})})})}const Bme=Z1,Vme=pj,Hme=eS,uL=S.forwardRef(({className:e,...t},n)=>m.jsx(lm,{ref:n,className:ie("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));uL.displayName=lm.displayName;const dL=S.forwardRef(({className:e,children:t,...n},r)=>m.jsx(Hme,{children:m.jsxs(Ki,{children:[m.jsx(uL,{}),m.jsxs(cm,{ref:r,className:ie("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...n,children:[t,m.jsxs(rS,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[m.jsx(ya,{className:"h-4 w-4"}),m.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}));dL.displayName=cm.displayName;const fL=({className:e,...t})=>m.jsx("div",{className:ie("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});fL.displayName="DialogHeader";const hL=({className:e,...t})=>m.jsx("div",{className:ie("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});hL.displayName="DialogFooter";const pL=S.forwardRef(({className:e,...t},n)=>m.jsx(tS,{ref:n,className:ie("text-lg font-semibold leading-none tracking-tight",e),...t}));pL.displayName=tS.displayName;const gL=S.forwardRef(({className:e,...t},n)=>m.jsx(nS,{ref:n,className:ie("text-sm text-muted-foreground",e),...t}));gL.displayName=nS.displayName;var O2=1,Wme=.9,Ume=.8,qme=.17,w0=.1,S0=.999,Gme=.9999,Yme=.99,Kme=/[\\\/_+.#"@\[\(\{&]/,Xme=/[\\\/_+.#"@\[\(\{&]/g,Qme=/[\s-]/,mL=/[\s-]/g;function ex(e,t,n,r,o,i,s){if(i===t.length)return o===e.length?O2:Yme;var a=`${o},${i}`;if(s[a]!==void 0)return s[a];for(var l=r.charAt(i),c=n.indexOf(l,o),u=0,d,h,f,p;c>=0;)d=ex(e,t,n,r,c+1,i+1,s),d>u&&(c===o?d*=O2:Kme.test(e.charAt(c-1))?(d*=Ume,f=e.slice(o,c-1).match(Xme),f&&o>0&&(d*=Math.pow(S0,f.length))):Qme.test(e.charAt(c-1))?(d*=Wme,p=e.slice(o,c-1).match(mL),p&&o>0&&(d*=Math.pow(S0,p.length))):(d*=qme,o>0&&(d*=Math.pow(S0,c-o))),e.charAt(c)!==t.charAt(i)&&(d*=Gme)),(d<w0&&n.charAt(c-1)===r.charAt(i+1)||r.charAt(i+1)===r.charAt(i)&&n.charAt(c-1)!==r.charAt(i))&&(h=ex(e,t,n,r,c+1,i+2,s),h*w0>d&&(d=h*w0)),d>u&&(u=d),c=n.indexOf(l,c+1);return s[a]=u,u}function D2(e){return e.toLowerCase().replace(mL," ")}function Jme(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,ex(e,t,D2(e),D2(t),0,0,{})}var Fc='[cmdk-group=""]',C0='[cmdk-group-items=""]',Zme='[cmdk-group-heading=""]',LS='[cmdk-item=""]',T2=`${LS}:not([aria-disabled="true"])`,tx="cmdk-item-select",Cs="data-value",ebe=(e,t,n)=>Jme(e,t,n),bL=S.createContext(void 0),Gd=()=>S.useContext(bL),vL=S.createContext(void 0),$S=()=>S.useContext(vL),yL=S.createContext(void 0),xL=S.forwardRef((e,t)=>{let n=Va(()=>{var F,P;return{search:"",value:(P=(F=e.value)!=null?F:e.defaultValue)!=null?P:"",filtered:{count:0,items:new Map,groups:new Set}}}),r=Va(()=>new Set),o=Va(()=>new Map),i=Va(()=>new Map),s=Va(()=>new Set),a=wL(e),{label:l,children:c,value:u,onValueChange:d,filter:h,shouldFilter:f,loop:p,disablePointerSelection:g=!1,vimBindings:b=!0,...v}=e,x=Ut(),y=Ut(),_=Ut(),w=S.useRef(null),C=dbe();ha(()=>{if(u!==void 0){let F=u.trim();n.current.value=F,R.emit()}},[u]),ha(()=>{C(6,G)},[]);let R=S.useMemo(()=>({subscribe:F=>(s.current.add(F),()=>s.current.delete(F)),snapshot:()=>n.current,setState:(F,P,U)=>{var q,K,H;if(!Object.is(n.current[F],P)){if(n.current[F]=P,F==="search")N(),I(),C(1,T);else if(F==="value"&&(U||C(5,G),((q=a.current)==null?void 0:q.value)!==void 0)){let V=P??"";(H=(K=a.current).onValueChange)==null||H.call(K,V);return}R.emit()}},emit:()=>{s.current.forEach(F=>F())}}),[]),k=S.useMemo(()=>({value:(F,P,U)=>{var q;P!==((q=i.current.get(F))==null?void 0:q.value)&&(i.current.set(F,{value:P,keywords:U}),n.current.filtered.items.set(F,D(P,U)),C(2,()=>{I(),R.emit()}))},item:(F,P)=>(r.current.add(F),P&&(o.current.has(P)?o.current.get(P).add(F):o.current.set(P,new Set([F]))),C(3,()=>{N(),I(),n.current.value||T(),R.emit()}),()=>{i.current.delete(F),r.current.delete(F),n.current.filtered.items.delete(F);let U=z();C(4,()=>{N(),(U==null?void 0:U.getAttribute("id"))===F&&T(),R.emit()})}),group:F=>(o.current.has(F)||o.current.set(F,new Set),()=>{i.current.delete(F),o.current.delete(F)}),filter:()=>a.current.shouldFilter,label:l||e["aria-label"],getDisablePointerSelection:()=>a.current.disablePointerSelection,listId:x,inputId:_,labelId:y,listInnerRef:w}),[]);function D(F,P){var U,q;let K=(q=(U=a.current)==null?void 0:U.filter)!=null?q:ebe;return F?K(F,n.current.search,P):0}function I(){if(!n.current.search||a.current.shouldFilter===!1)return;let F=n.current.filtered.items,P=[];n.current.filtered.groups.forEach(q=>{let K=o.current.get(q),H=0;K.forEach(V=>{let Q=F.get(V);H=Math.max(Q,H)}),P.push([q,H])});let U=w.current;O().sort((q,K)=>{var H,V;let Q=q.getAttribute("id"),Z=K.getAttribute("id");return((H=F.get(Z))!=null?H:0)-((V=F.get(Q))!=null?V:0)}).forEach(q=>{let K=q.closest(C0);K?K.appendChild(q.parentElement===K?q:q.closest(`${C0} > *`)):U.appendChild(q.parentElement===U?q:q.closest(`${C0} > *`))}),P.sort((q,K)=>K[1]-q[1]).forEach(q=>{var K;let H=(K=w.current)==null?void 0:K.querySelector(`${Fc}[${Cs}="${encodeURIComponent(q[0])}"]`);H==null||H.parentElement.appendChild(H)})}function T(){let F=O().find(U=>U.getAttribute("aria-disabled")!=="true"),P=F==null?void 0:F.getAttribute(Cs);R.setState("value",P||void 0)}function N(){var F,P,U,q;if(!n.current.search||a.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let K=0;for(let H of r.current){let V=(P=(F=i.current.get(H))==null?void 0:F.value)!=null?P:"",Q=(q=(U=i.current.get(H))==null?void 0:U.keywords)!=null?q:[],Z=D(V,Q);n.current.filtered.items.set(H,Z),Z>0&&K++}for(let[H,V]of o.current)for(let Q of V)if(n.current.filtered.items.get(Q)>0){n.current.filtered.groups.add(H);break}n.current.filtered.count=K}function G(){var F,P,U;let q=z();q&&(((F=q.parentElement)==null?void 0:F.firstChild)===q&&((U=(P=q.closest(Fc))==null?void 0:P.querySelector(Zme))==null||U.scrollIntoView({block:"nearest"})),q.scrollIntoView({block:"nearest"}))}function z(){var F;return(F=w.current)==null?void 0:F.querySelector(`${LS}[aria-selected="true"]`)}function O(){var F;return Array.from(((F=w.current)==null?void 0:F.querySelectorAll(T2))||[])}function A(F){let P=O()[F];P&&R.setState("value",P.getAttribute(Cs))}function L(F){var P;let U=z(),q=O(),K=q.findIndex(V=>V===U),H=q[K+F];(P=a.current)!=null&&P.loop&&(H=K+F<0?q[q.length-1]:K+F===q.length?q[0]:q[K+F]),H&&R.setState("value",H.getAttribute(Cs))}function j(F){let P=z(),U=P==null?void 0:P.closest(Fc),q;for(;U&&!q;)U=F>0?cbe(U,Fc):ube(U,Fc),q=U==null?void 0:U.querySelector(T2);q?R.setState("value",q.getAttribute(Cs)):L(F)}let B=()=>A(O().length-1),M=F=>{F.preventDefault(),F.metaKey?B():F.altKey?j(1):L(1)},W=F=>{F.preventDefault(),F.metaKey?A(0):F.altKey?j(-1):L(-1)};return S.createElement(pe.div,{ref:t,tabIndex:-1,...v,"cmdk-root":"",onKeyDown:F=>{var P;if((P=v.onKeyDown)==null||P.call(v,F),!F.defaultPrevented)switch(F.key){case"n":case"j":{b&&F.ctrlKey&&M(F);break}case"ArrowDown":{M(F);break}case"p":case"k":{b&&F.ctrlKey&&W(F);break}case"ArrowUp":{W(F);break}case"Home":{F.preventDefault(),A(0);break}case"End":{F.preventDefault(),B();break}case"Enter":if(!F.nativeEvent.isComposing&&F.keyCode!==229){F.preventDefault();let U=z();if(U){let q=new Event(tx);U.dispatchEvent(q)}}}}},S.createElement("label",{"cmdk-label":"",htmlFor:k.inputId,id:k.labelId,style:hbe},l),bm(e,F=>S.createElement(vL.Provider,{value:R},S.createElement(bL.Provider,{value:k},F))))}),tbe=S.forwardRef((e,t)=>{var n,r;let o=Ut(),i=S.useRef(null),s=S.useContext(yL),a=Gd(),l=wL(e),c=(r=(n=l.current)==null?void 0:n.forceMount)!=null?r:s==null?void 0:s.forceMount;ha(()=>{if(!c)return a.item(o,s==null?void 0:s.id)},[c]);let u=SL(o,i,[e.value,e.children,i],e.keywords),d=$S(),h=pa(C=>C.value&&C.value===u.current),f=pa(C=>c||a.filter()===!1?!0:C.search?C.filtered.items.get(o)>0:!0);S.useEffect(()=>{let C=i.current;if(!(!C||e.disabled))return C.addEventListener(tx,p),()=>C.removeEventListener(tx,p)},[f,e.onSelect,e.disabled]);function p(){var C,R;g(),(R=(C=l.current).onSelect)==null||R.call(C,u.current)}function g(){d.setState("value",u.current,!0)}if(!f)return null;let{disabled:b,value:v,onSelect:x,forceMount:y,keywords:_,...w}=e;return S.createElement(pe.div,{ref:id([i,t]),...w,id:o,"cmdk-item":"",role:"option","aria-disabled":!!b,"aria-selected":!!h,"data-disabled":!!b,"data-selected":!!h,onPointerMove:b||a.getDisablePointerSelection()?void 0:g,onClick:b?void 0:p},e.children)}),nbe=S.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:o,...i}=e,s=Ut(),a=S.useRef(null),l=S.useRef(null),c=Ut(),u=Gd(),d=pa(f=>o||u.filter()===!1?!0:f.search?f.filtered.groups.has(s):!0);ha(()=>u.group(s),[]),SL(s,a,[e.value,e.heading,l]);let h=S.useMemo(()=>({id:s,forceMount:o}),[o]);return S.createElement(pe.div,{ref:id([a,t]),...i,"cmdk-group":"",role:"presentation",hidden:d?void 0:!0},n&&S.createElement("div",{ref:l,"cmdk-group-heading":"","aria-hidden":!0,id:c},n),bm(e,f=>S.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?c:void 0},S.createElement(yL.Provider,{value:h},f))))}),rbe=S.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,o=S.useRef(null),i=pa(s=>!s.search);return!n&&!i?null:S.createElement(pe.div,{ref:id([o,t]),...r,"cmdk-separator":"",role:"separator"})}),obe=S.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,o=e.value!=null,i=$S(),s=pa(u=>u.search),a=pa(u=>u.value),l=Gd(),c=S.useMemo(()=>{var u;let d=(u=l.listInnerRef.current)==null?void 0:u.querySelector(`${LS}[${Cs}="${encodeURIComponent(a)}"]`);return d==null?void 0:d.getAttribute("id")},[]);return S.useEffect(()=>{e.value!=null&&i.setState("search",e.value)},[e.value]),S.createElement(pe.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":l.listId,"aria-labelledby":l.labelId,"aria-activedescendant":c,id:l.inputId,type:"text",value:o?e.value:s,onChange:u=>{o||i.setState("search",u.target.value),n==null||n(u.target.value)}})}),ibe=S.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...o}=e,i=S.useRef(null),s=S.useRef(null),a=Gd();return S.useEffect(()=>{if(s.current&&i.current){let l=s.current,c=i.current,u,d=new ResizeObserver(()=>{u=requestAnimationFrame(()=>{let h=l.offsetHeight;c.style.setProperty("--cmdk-list-height",h.toFixed(1)+"px")})});return d.observe(l),()=>{cancelAnimationFrame(u),d.unobserve(l)}}},[]),S.createElement(pe.div,{ref:id([i,t]),...o,"cmdk-list":"",role:"listbox","aria-label":r,id:a.listId},bm(e,l=>S.createElement("div",{ref:id([s,a.listInnerRef]),"cmdk-list-sizer":""},l)))}),sbe=S.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:o,contentClassName:i,container:s,...a}=e;return S.createElement(Z1,{open:n,onOpenChange:r},S.createElement(eS,{container:s},S.createElement(lm,{"cmdk-overlay":"",className:o}),S.createElement(cm,{"aria-label":e.label,"cmdk-dialog":"",className:i},S.createElement(xL,{ref:t,...a}))))}),abe=S.forwardRef((e,t)=>pa(n=>n.filtered.count===0)?S.createElement(pe.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),lbe=S.forwardRef((e,t)=>{let{progress:n,children:r,label:o="Loading...",...i}=e;return S.createElement(pe.div,{ref:t,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":o},bm(e,s=>S.createElement("div",{"aria-hidden":!0},s)))}),Jn=Object.assign(xL,{List:ibe,Item:tbe,Input:obe,Group:nbe,Separator:rbe,Dialog:sbe,Empty:abe,Loading:lbe});function cbe(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function ube(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function wL(e){let t=S.useRef(e);return ha(()=>{t.current=e}),t}var ha=typeof window>"u"?S.useEffect:S.useLayoutEffect;function Va(e){let t=S.useRef();return t.current===void 0&&(t.current=e()),t}function id(e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}function pa(e){let t=$S(),n=()=>e(t.snapshot());return X4.useSyncExternalStore(t.subscribe,n,n)}function SL(e,t,n,r=[]){let o=S.useRef(),i=Gd();return ha(()=>{var s;let a=(()=>{var c;for(let u of n){if(typeof u=="string")return u.trim();if(typeof u=="object"&&"current"in u)return u.current?(c=u.current.textContent)==null?void 0:c.trim():o.current}})(),l=r.map(c=>c.trim());i.value(e,a,l),(s=t.current)==null||s.setAttribute(Cs,a),o.current=a}),o}var dbe=()=>{let[e,t]=S.useState(),n=Va(()=>new Map);return ha(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,o)=>{n.current.set(r,o),t({})}};function fbe(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function bm({asChild:e,children:t},n){return e&&S.isValidElement(t)?S.cloneElement(fbe(t),{ref:t.ref},n(t.props.children)):n(t)}var hbe={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const CL=S.forwardRef(({className:e,...t},n)=>m.jsx(Jn,{ref:n,className:ie("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));CL.displayName=Jn.displayName;const _L=S.forwardRef(({className:e,...t},n)=>m.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[m.jsx(Uz,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),m.jsx(Jn.Input,{ref:n,className:ie("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));_L.displayName=Jn.Input.displayName;const EL=S.forwardRef(({className:e,...t},n)=>m.jsx(Jn.List,{ref:n,className:ie("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));EL.displayName=Jn.List.displayName;const RL=S.forwardRef((e,t)=>m.jsx(Jn.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));RL.displayName=Jn.Empty.displayName;const PL=S.forwardRef(({className:e,...t},n)=>m.jsx(Jn.Group,{ref:n,className:ie("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...t}));PL.displayName=Jn.Group.displayName;const pbe=S.forwardRef(({className:e,...t},n)=>m.jsx(Jn.Separator,{ref:n,className:ie("-mx-1 h-px bg-border",e),...t}));pbe.displayName=Jn.Separator.displayName;const ML=S.forwardRef(({className:e,...t},n)=>m.jsx(Jn.Item,{ref:n,className:ie("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50",e),...t}));ML.displayName=Jn.Item.displayName;function gbe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function I2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function A2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?I2(Object(n),!0).forEach(function(r){gbe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):I2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function mbe(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}function bbe(e,t){if(e==null)return{};var n=mbe(e,t),r,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)r=i[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function vbe(e,t){return ybe(e)||xbe(e,t)||wbe(e,t)||Sbe()}function ybe(e){if(Array.isArray(e))return e}function xbe(e,t){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(e)))){var n=[],r=!0,o=!1,i=void 0;try{for(var s=e[Symbol.iterator](),a;!(r=(a=s.next()).done)&&(n.push(a.value),!(t&&n.length===t));r=!0);}catch(l){o=!0,i=l}finally{try{!r&&s.return!=null&&s.return()}finally{if(o)throw i}}return n}}function wbe(e,t){if(e){if(typeof e=="string")return N2(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return N2(e,t)}}function N2(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Sbe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
347
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Cbe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function j2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function F2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?j2(Object(n),!0).forEach(function(r){Cbe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):j2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function _be(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){return t.reduceRight(function(o,i){return i(o)},r)}}function tu(e){return function t(){for(var n=this,r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return o.length>=e.length?e.apply(this,o):function(){for(var s=arguments.length,a=new Array(s),l=0;l<s;l++)a[l]=arguments[l];return t.apply(n,[].concat(o,a))}}}function Fp(e){return{}.toString.call(e).includes("Object")}function Ebe(e){return!Object.keys(e).length}function sd(e){return typeof e=="function"}function Rbe(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Pbe(e,t){return Fp(t)||Fi("changeType"),Object.keys(t).some(function(n){return!Rbe(e,n)})&&Fi("changeField"),t}function Mbe(e){sd(e)||Fi("selectorType")}function kbe(e){sd(e)||Fp(e)||Fi("handlerType"),Fp(e)&&Object.values(e).some(function(t){return!sd(t)})&&Fi("handlersType")}function Obe(e){e||Fi("initialIsRequired"),Fp(e)||Fi("initialType"),Ebe(e)&&Fi("initialContent")}function Dbe(e,t){throw new Error(e[t]||e.default)}var Tbe={initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"},Fi=tu(Dbe)(Tbe),ih={changes:Pbe,selector:Mbe,handler:kbe,initial:Obe};function Ibe(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};ih.initial(e),ih.handler(t);var n={current:e},r=tu(jbe)(n,t),o=tu(Nbe)(n),i=tu(ih.changes)(e),s=tu(Abe)(n);function a(){var c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(u){return u};return ih.selector(c),c(n.current)}function l(c){_be(r,o,i,s)(c)}return[a,l]}function Abe(e,t){return sd(t)?t(e.current):t}function Nbe(e,t){return e.current=F2(F2({},e.current),t),t}function jbe(e,t,n){return sd(t)?t(e.current):Object.keys(n).forEach(function(r){var o;return(o=t[r])===null||o===void 0?void 0:o.call(t,e.current[r])}),n}var Fbe={create:Ibe},Lbe={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.52.2/min/vs"}};function $be(e){return function t(){for(var n=this,r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return o.length>=e.length?e.apply(this,o):function(){for(var s=arguments.length,a=new Array(s),l=0;l<s;l++)a[l]=arguments[l];return t.apply(n,[].concat(o,a))}}}function zbe(e){return{}.toString.call(e).includes("Object")}function Bbe(e){return e||L2("configIsRequired"),zbe(e)||L2("configType"),e.urls?(Vbe(),{paths:{vs:e.urls.monacoBase}}):e}function Vbe(){console.warn(kL.deprecation)}function Hbe(e,t){throw new Error(e[t]||e.default)}var kL={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:`Deprecation warning!
348
- You are using deprecated way of configuration.
349
-
350
- Instead of using
351
- monaco.config({ urls: { monacoBase: '...' } })
352
- use
353
- monaco.config({ paths: { vs: '...' } })
354
-
355
- For more please check the link https://github.com/suren-atoyan/monaco-loader#config
356
- `},L2=$be(Hbe)(kL),Wbe={config:Bbe},Ube=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(o){return n.reduceRight(function(i,s){return s(i)},o)}};function OL(e,t){return Object.keys(t).forEach(function(n){t[n]instanceof Object&&e[n]&&Object.assign(t[n],OL(e[n],t[n]))}),A2(A2({},e),t)}var qbe={type:"cancelation",msg:"operation is manually canceled"};function _0(e){var t=!1,n=new Promise(function(r,o){e.then(function(i){return t?o(qbe):r(i)}),e.catch(o)});return n.cancel=function(){return t=!0},n}var Gbe=Fbe.create({config:Lbe,isInitialized:!1,resolve:null,reject:null,monaco:null}),DL=vbe(Gbe,2),Yd=DL[0],vm=DL[1];function Ybe(e){var t=Wbe.config(e),n=t.monaco,r=bbe(t,["monaco"]);vm(function(o){return{config:OL(o.config,r),monaco:n}})}function Kbe(){var e=Yd(function(t){var n=t.monaco,r=t.isInitialized,o=t.resolve;return{monaco:n,isInitialized:r,resolve:o}});if(!e.isInitialized){if(vm({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),_0(E0);if(window.monaco&&window.monaco.editor)return TL(window.monaco),e.resolve(window.monaco),_0(E0);Ube(Xbe,Jbe)(Zbe)}return _0(E0)}function Xbe(e){return document.body.appendChild(e)}function Qbe(e){var t=document.createElement("script");return e&&(t.src=e),t}function Jbe(e){var t=Yd(function(r){var o=r.config,i=r.reject;return{config:o,reject:i}}),n=Qbe("".concat(t.config.paths.vs,"/loader.js"));return n.onload=function(){return e()},n.onerror=t.reject,n}function Zbe(){var e=Yd(function(n){var r=n.config,o=n.resolve,i=n.reject;return{config:r,resolve:o,reject:i}}),t=window.require;t.config(e.config),t(["vs/editor/editor.main"],function(n){TL(n),e.resolve(n)},function(n){e.reject(n)})}function TL(e){Yd().monaco||vm({monaco:e})}function e0e(){return Yd(function(e){var t=e.monaco;return t})}var E0=new Promise(function(e,t){return vm({resolve:e,reject:t})}),Lp={config:Ybe,init:Kbe,__getMonacoInstance:e0e},t0e={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},R0=t0e,n0e={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},r0e=n0e;function o0e({children:e}){return E.createElement("div",{style:r0e.container},e)}var i0e=o0e,s0e=i0e;function a0e({width:e,height:t,isEditorReady:n,loading:r,_ref:o,className:i,wrapperProps:s}){return E.createElement("section",{style:{...R0.wrapper,width:e,height:t},...s},!n&&E.createElement(s0e,null,r),E.createElement("div",{ref:o,style:{...R0.fullWidth,...!n&&R0.hide},className:i}))}var l0e=a0e,IL=E.memo(l0e);function c0e(e){E.useEffect(e,[])}var zS=c0e;function u0e(e,t,n=!0){let r=E.useRef(!0);E.useEffect(r.current||!n?()=>{r.current=!1}:e,t)}var ur=u0e;function Su(){}function Ka(e,t,n,r){return d0e(e,r)||f0e(e,t,n,r)}function d0e(e,t){return e.editor.getModel(AL(e,t))}function f0e(e,t,n,r){return e.editor.createModel(t,n,r?AL(e,r):void 0)}function AL(e,t){return e.Uri.parse(t)}function h0e({original:e,modified:t,language:n,originalLanguage:r,modifiedLanguage:o,originalModelPath:i,modifiedModelPath:s,keepCurrentOriginalModel:a=!1,keepCurrentModifiedModel:l=!1,theme:c="light",loading:u="Loading...",options:d={},height:h="100%",width:f="100%",className:p,wrapperProps:g={},beforeMount:b=Su,onMount:v=Su}){let[x,y]=E.useState(!1),[_,w]=E.useState(!0),C=E.useRef(null),R=E.useRef(null),k=E.useRef(null),D=E.useRef(v),I=E.useRef(b),T=E.useRef(!1);zS(()=>{let O=Lp.init();return O.then(A=>(R.current=A)&&w(!1)).catch(A=>(A==null?void 0:A.type)!=="cancelation"&&console.error("Monaco initialization: error:",A)),()=>C.current?z():O.cancel()}),ur(()=>{if(C.current&&R.current){let O=C.current.getOriginalEditor(),A=Ka(R.current,e||"",r||n||"text",i||"");A!==O.getModel()&&O.setModel(A)}},[i],x),ur(()=>{if(C.current&&R.current){let O=C.current.getModifiedEditor(),A=Ka(R.current,t||"",o||n||"text",s||"");A!==O.getModel()&&O.setModel(A)}},[s],x),ur(()=>{let O=C.current.getModifiedEditor();O.getOption(R.current.editor.EditorOption.readOnly)?O.setValue(t||""):t!==O.getValue()&&(O.executeEdits("",[{range:O.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),O.pushUndoStop())},[t],x),ur(()=>{var O,A;(A=(O=C.current)==null?void 0:O.getModel())==null||A.original.setValue(e||"")},[e],x),ur(()=>{let{original:O,modified:A}=C.current.getModel();R.current.editor.setModelLanguage(O,r||n||"text"),R.current.editor.setModelLanguage(A,o||n||"text")},[n,r,o],x),ur(()=>{var O;(O=R.current)==null||O.editor.setTheme(c)},[c],x),ur(()=>{var O;(O=C.current)==null||O.updateOptions(d)},[d],x);let N=E.useCallback(()=>{var L;if(!R.current)return;I.current(R.current);let O=Ka(R.current,e||"",r||n||"text",i||""),A=Ka(R.current,t||"",o||n||"text",s||"");(L=C.current)==null||L.setModel({original:O,modified:A})},[n,t,o,e,r,i,s]),G=E.useCallback(()=>{var O;!T.current&&k.current&&(C.current=R.current.editor.createDiffEditor(k.current,{automaticLayout:!0,...d}),N(),(O=R.current)==null||O.editor.setTheme(c),y(!0),T.current=!0)},[d,c,N]);E.useEffect(()=>{x&&D.current(C.current,R.current)},[x]),E.useEffect(()=>{!_&&!x&&G()},[_,x,G]);function z(){var A,L,j,B;let O=(A=C.current)==null?void 0:A.getModel();a||((L=O==null?void 0:O.original)==null||L.dispose()),l||((j=O==null?void 0:O.modified)==null||j.dispose()),(B=C.current)==null||B.dispose()}return E.createElement(IL,{width:f,height:h,isEditorReady:x,loading:u,_ref:k,className:p,wrapperProps:g})}var p0e=h0e;E.memo(p0e);function g0e(){let[e,t]=E.useState(Lp.__getMonacoInstance());return zS(()=>{let n;return e||(n=Lp.init(),n.then(r=>{t(r)})),()=>n==null?void 0:n.cancel()}),e}var m0e=g0e;function b0e(e){let t=E.useRef();return E.useEffect(()=>{t.current=e},[e]),t.current}var v0e=b0e,sh=new Map;function y0e({defaultValue:e,defaultLanguage:t,defaultPath:n,value:r,language:o,path:i,theme:s="light",line:a,loading:l="Loading...",options:c={},overrideServices:u={},saveViewState:d=!0,keepCurrentModel:h=!1,width:f="100%",height:p="100%",className:g,wrapperProps:b={},beforeMount:v=Su,onMount:x=Su,onChange:y,onValidate:_=Su}){let[w,C]=E.useState(!1),[R,k]=E.useState(!0),D=E.useRef(null),I=E.useRef(null),T=E.useRef(null),N=E.useRef(x),G=E.useRef(v),z=E.useRef(),O=E.useRef(r),A=v0e(i),L=E.useRef(!1),j=E.useRef(!1);zS(()=>{let W=Lp.init();return W.then(F=>(D.current=F)&&k(!1)).catch(F=>(F==null?void 0:F.type)!=="cancelation"&&console.error("Monaco initialization: error:",F)),()=>I.current?M():W.cancel()}),ur(()=>{var F,P,U,q;let W=Ka(D.current,e||r||"",t||o||"",i||n||"");W!==((F=I.current)==null?void 0:F.getModel())&&(d&&sh.set(A,(P=I.current)==null?void 0:P.saveViewState()),(U=I.current)==null||U.setModel(W),d&&((q=I.current)==null||q.restoreViewState(sh.get(i))))},[i],w),ur(()=>{var W;(W=I.current)==null||W.updateOptions(c)},[c],w),ur(()=>{!I.current||r===void 0||(I.current.getOption(D.current.editor.EditorOption.readOnly)?I.current.setValue(r):r!==I.current.getValue()&&(j.current=!0,I.current.executeEdits("",[{range:I.current.getModel().getFullModelRange(),text:r,forceMoveMarkers:!0}]),I.current.pushUndoStop(),j.current=!1))},[r],w),ur(()=>{var F,P;let W=(F=I.current)==null?void 0:F.getModel();W&&o&&((P=D.current)==null||P.editor.setModelLanguage(W,o))},[o],w),ur(()=>{var W;a!==void 0&&((W=I.current)==null||W.revealLine(a))},[a],w),ur(()=>{var W;(W=D.current)==null||W.editor.setTheme(s)},[s],w);let B=E.useCallback(()=>{var W;if(!(!T.current||!D.current)&&!L.current){G.current(D.current);let F=i||n,P=Ka(D.current,r||e||"",t||o||"",F||"");I.current=(W=D.current)==null?void 0:W.editor.create(T.current,{model:P,automaticLayout:!0,...c},u),d&&I.current.restoreViewState(sh.get(F)),D.current.editor.setTheme(s),a!==void 0&&I.current.revealLine(a),C(!0),L.current=!0}},[e,t,n,r,o,i,c,u,d,s,a]);E.useEffect(()=>{w&&N.current(I.current,D.current)},[w]),E.useEffect(()=>{!R&&!w&&B()},[R,w,B]),O.current=r,E.useEffect(()=>{var W,F;w&&y&&((W=z.current)==null||W.dispose(),z.current=(F=I.current)==null?void 0:F.onDidChangeModelContent(P=>{j.current||y(I.current.getValue(),P)}))},[w,y]),E.useEffect(()=>{if(w){let W=D.current.editor.onDidChangeMarkers(F=>{var U;let P=(U=I.current.getModel())==null?void 0:U.uri;if(P&&F.find(q=>q.path===P.path)){let q=D.current.editor.getModelMarkers({resource:P});_==null||_(q)}});return()=>{W==null||W.dispose()}}return()=>{}},[w,_]);function M(){var W,F;(W=z.current)==null||W.dispose(),h?d&&sh.set(i,I.current.saveViewState()):(F=I.current.getModel())==null||F.dispose(),I.current.dispose()}return E.createElement(IL,{width:f,height:p,isEditorReady:w,loading:l,_ref:T,className:g,wrapperProps:b})}var x0e=y0e,NL=E.memo(x0e),w0e=NL;const jL=E.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},o)=>m.jsx(Ki,{children:m.jsx(Hg,{ref:o,align:t,sideOffset:n,className:ie("w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r})}));jL.displayName=Hg.displayName;var BS="Switch",[S0e,Sve]=Kt(BS),[C0e,_0e]=S0e(BS),FL=S.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:o,defaultChecked:i,required:s,disabled:a,value:l="on",onCheckedChange:c,form:u,...d}=e,[h,f]=S.useState(null),p=Oe(t,y=>f(y)),g=S.useRef(!1),b=h?u||!!h.closest("form"):!0,[v=!1,x]=yn({prop:o,defaultProp:i,onChange:c});return m.jsxs(C0e,{scope:n,checked:v,disabled:a,children:[m.jsx(pe.button,{type:"button",role:"switch","aria-checked":v,"aria-required":s,"data-state":zL(v),"data-disabled":a?"":void 0,disabled:a,value:l,...d,ref:p,onClick:ae(e.onClick,y=>{x(_=>!_),b&&(g.current=y.isPropagationStopped(),g.current||y.stopPropagation())})}),b&&m.jsx(E0e,{control:h,bubbles:!g.current,name:r,value:l,checked:v,required:s,disabled:a,form:u,style:{transform:"translateX(-100%)"}})]})});FL.displayName=BS;var LL="SwitchThumb",$L=S.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,o=_0e(LL,n);return m.jsx(pe.span,{"data-state":zL(o.checked),"data-disabled":o.disabled?"":void 0,...r,ref:t})});$L.displayName=LL;var E0e=e=>{const{control:t,checked:n,bubbles:r=!0,...o}=e,i=S.useRef(null),s=Fg(n),a=Eg(t);return S.useEffect(()=>{const l=i.current,c=window.HTMLInputElement.prototype,d=Object.getOwnPropertyDescriptor(c,"checked").set;if(s!==n&&d){const h=new Event("click",{bubbles:r});d.call(l,n),l.dispatchEvent(h)}},[s,n,r]),m.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...o,tabIndex:-1,ref:i,style:{...e.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function zL(e){return e?"checked":"unchecked"}var BL=FL,R0e=$L;const VL=S.forwardRef(({className:e,...t},n)=>m.jsx(BL,{className:ie("peer inline-flex h-[22px] w-[36px] shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:n,children:m.jsx(R0e,{className:ie("pointer-events-none block size-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));VL.displayName=BL.displayName;var ui="Accordion",P0e=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[VS,M0e,k0e]=Kp(ui),[ym,Cve]=Kt(ui,[k0e,Bj]),HS=Bj(),HL=E.forwardRef((e,t)=>{const{type:n,...r}=e,o=r,i=r;return m.jsx(VS.Provider,{scope:e.__scopeAccordion,children:n==="multiple"?m.jsx(I0e,{...i,ref:t}):m.jsx(T0e,{...o,ref:t})})});HL.displayName=ui;var[WL,O0e]=ym(ui),[UL,D0e]=ym(ui,{collapsible:!1}),T0e=E.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},collapsible:i=!1,...s}=e,[a,l]=yn({prop:n,defaultProp:r,onChange:o});return m.jsx(WL,{scope:e.__scopeAccordion,value:a?[a]:[],onItemOpen:l,onItemClose:E.useCallback(()=>i&&l(""),[i,l]),children:m.jsx(UL,{scope:e.__scopeAccordion,collapsible:i,children:m.jsx(qL,{...s,ref:t})})})}),I0e=E.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},...i}=e,[s=[],a]=yn({prop:n,defaultProp:r,onChange:o}),l=E.useCallback(u=>a((d=[])=>[...d,u]),[a]),c=E.useCallback(u=>a((d=[])=>d.filter(h=>h!==u)),[a]);return m.jsx(WL,{scope:e.__scopeAccordion,value:s,onItemOpen:l,onItemClose:c,children:m.jsx(UL,{scope:e.__scopeAccordion,collapsible:!0,children:m.jsx(qL,{...i,ref:t})})})}),[A0e,xm]=ym(ui),qL=E.forwardRef((e,t)=>{const{__scopeAccordion:n,disabled:r,dir:o,orientation:i="vertical",...s}=e,a=E.useRef(null),l=Oe(a,t),c=M0e(n),d=ga(o)==="ltr",h=ae(e.onKeyDown,f=>{var k;if(!P0e.includes(f.key))return;const p=f.target,g=c().filter(D=>{var I;return!((I=D.ref.current)!=null&&I.disabled)}),b=g.findIndex(D=>D.ref.current===p),v=g.length;if(b===-1)return;f.preventDefault();let x=b;const y=0,_=v-1,w=()=>{x=b+1,x>_&&(x=y)},C=()=>{x=b-1,x<y&&(x=_)};switch(f.key){case"Home":x=y;break;case"End":x=_;break;case"ArrowRight":i==="horizontal"&&(d?w():C());break;case"ArrowDown":i==="vertical"&&w();break;case"ArrowLeft":i==="horizontal"&&(d?C():w());break;case"ArrowUp":i==="vertical"&&C();break}const R=x%v;(k=g[R].ref.current)==null||k.focus()});return m.jsx(A0e,{scope:n,disabled:r,direction:o,orientation:i,children:m.jsx(VS.Slot,{scope:n,children:m.jsx(pe.div,{...s,"data-orientation":i,ref:l,onKeyDown:r?void 0:h})})})}),$p="AccordionItem",[N0e,WS]=ym($p),GL=E.forwardRef((e,t)=>{const{__scopeAccordion:n,value:r,...o}=e,i=xm($p,n),s=O0e($p,n),a=HS(n),l=Ut(),c=r&&s.value.includes(r)||!1,u=i.disabled||e.disabled;return m.jsx(N0e,{scope:n,open:c,disabled:u,triggerId:l,children:m.jsx(Wj,{"data-orientation":i.orientation,"data-state":ZL(c),...a,...o,ref:t,disabled:u,open:c,onOpenChange:d=>{d?s.onItemOpen(r):s.onItemClose(r)}})})});GL.displayName=$p;var YL="AccordionHeader",KL=E.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=xm(ui,n),i=WS(YL,n);return m.jsx(pe.h3,{"data-orientation":o.orientation,"data-state":ZL(i.open),"data-disabled":i.disabled?"":void 0,...r,ref:t})});KL.displayName=YL;var nx="AccordionTrigger",XL=E.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=xm(ui,n),i=WS(nx,n),s=D0e(nx,n),a=HS(n);return m.jsx(VS.ItemSlot,{scope:n,children:m.jsx(yle,{"aria-disabled":i.open&&!s.collapsible||void 0,"data-orientation":o.orientation,id:i.triggerId,...a,...r,ref:t})})});XL.displayName=nx;var QL="AccordionContent",JL=E.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=xm(ui,n),i=WS(QL,n),s=HS(n);return m.jsx(xle,{role:"region","aria-labelledby":i.triggerId,"data-orientation":o.orientation,...s,...r,ref:t,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})});JL.displayName=QL;function ZL(e){return e?"open":"closed"}var j0e=HL,F0e=GL,L0e=KL,e3=XL,t3=JL;const $0e=j0e,n3=S.forwardRef(({className:e,...t},n)=>m.jsx(F0e,{ref:n,className:ie("border-b",e),...t}));n3.displayName="AccordionItem";const r3=S.forwardRef(({className:e,children:t,...n},r)=>m.jsx(L0e,{className:"flex",children:m.jsxs(e3,{ref:r,className:ie("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",e),...n,children:[t,m.jsx(bd,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));r3.displayName=e3.displayName;const o3=S.forwardRef(({className:e,children:t,...n},r)=>m.jsx(t3,{ref:r,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...n,children:m.jsx("div",{className:ie("pb-4 pt-0",e),children:t})}));o3.displayName=t3.displayName;var z0e=Object.defineProperty,B0e=(e,t,n)=>t in e?z0e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ah=(e,t,n)=>B0e(e,typeof t!="symbol"?t+"":t,n);const V0e={stringify:e=>e?"true":"false",parse:e=>/^[ty1-9]/i.test(e)},H0e={stringify:e=>e.name,parse:(e,t,n)=>{const r=(()=>{if(typeof window<"u"&&e in window)return window[e];if(typeof global<"u"&&e in global)return global[e]})();return typeof r=="function"?r.bind(n):void 0}},W0e={stringify:e=>JSON.stringify(e),parse:e=>JSON.parse(e)},U0e={stringify:e=>`${e}`,parse:e=>parseFloat(e)},q0e={stringify:e=>e,parse:e=>e},P0={string:q0e,number:U0e,boolean:V0e,function:H0e,json:W0e};function G0e(e){return e.replace(/([a-z0-9])([A-Z])/g,(t,n,r)=>`${n}-${r.toLowerCase()}`)}const lh=Symbol.for("r2wc.render"),ch=Symbol.for("r2wc.connected"),ps=Symbol.for("r2wc.context"),Lo=Symbol.for("r2wc.props");function Y0e(e,t,n){var r,o,i;t.props||(t.props=e.propTypes?Object.keys(e.propTypes):[]),t.events||(t.events=[]);const s=Array.isArray(t.props)?t.props.slice():Object.keys(t.props),a=Array.isArray(t.events)?t.events.slice():Object.keys(t.events),l={},c={},u={},d={};for(const f of s){l[f]=Array.isArray(t.props)?"string":t.props[f];const p=G0e(f);u[f]=p,d[p]=f}for(const f of a)c[f]=Array.isArray(t.events)?{}:t.events[f];class h extends HTMLElement{constructor(){super(),ah(this,i,!0),ah(this,o),ah(this,r,{}),ah(this,"container"),t.shadow?this.container=this.attachShadow({mode:t.shadow}):this.container=this,this[Lo].container=this.container;for(const p of s){const g=u[p],b=this.getAttribute(g),v=l[p],x=v?P0[v]:null;x!=null&&x.parse&&b&&(this[Lo][p]=x.parse(b,g,this))}for(const p of a)this[Lo][p]=g=>{const b=p.replace(/^on/,"").toLowerCase();this.dispatchEvent(new CustomEvent(b,{detail:g,...c[p]}))}}static get observedAttributes(){return Object.keys(d)}connectedCallback(){this[ch]=!0,this[lh]()}disconnectedCallback(){this[ch]=!1,this[ps]&&n.unmount(this[ps]),delete this[ps]}attributeChangedCallback(p,g,b){const v=d[p],x=l[v],y=x?P0[x]:null;v in l&&y!=null&&y.parse&&b&&(this[Lo][v]=y.parse(b,p,this),this[lh]())}[(i=ch,o=ps,r=Lo,lh)](){this[ch]&&(this[ps]?n.update(this[ps],this[Lo]):this[ps]=n.mount(this.container,e,this[Lo]))}}for(const f of s){const p=u[f],g=l[f];Object.defineProperty(h.prototype,f,{enumerable:!0,configurable:!0,get(){return this[Lo][f]},set(b){this[Lo][f]=b;const v=g?P0[g]:null;if(v!=null&&v.stringify){const x=v.stringify(b,p,this);this.getAttribute(p)!==x&&this.setAttribute(p,x)}else this[lh]()}})}return h}function K0e(e,t,n){const r=F0(e),o=E.createElement(t,n);return r.render(o),{root:r,ReactComponent:t}}function X0e({root:e,ReactComponent:t},n){const r=E.createElement(t,n);e.render(r)}function Q0e({root:e}){e.unmount()}function J0e(e,t={}){return Y0e(e,t,{mount:K0e,update:X0e,unmount:Q0e})}const Z0e={id:"string",version:"string",authToken:"json",placeholders:"json",defaultFilterValues:"json",currentTheme:"string",customCards:"json",customStyle:"json",onChartElementClicked:"function",onFilterValuesChange:"function",onEvent:"function",onSave:"function",LoadingComponent:"function",ErrorComponent:"function",showAssistant:"boolean",selectedSheetId:"string"},eve=J0e(cL,{props:Z0e});exports.$e=$me;exports.Accordion=$0e;exports.AccordionContent=o3;exports.AccordionItem=n3;exports.AccordionTrigger=r3;exports.ArrowUp=Gk;exports.Button=Yt;exports.Calendar=Yk;exports.Card=AM;exports.CardContent=Gp;exports.CardDescription=Sx;exports.CardHeader=qp;exports.CardTitle=Zl;exports.CaretSortIcon=Ez;exports.ChartJsVisual=c1;exports.ChatInput=D4;exports.ChatStatus=M4;exports.Check=tc;exports.CheckIcon=ew;exports.Checkbox=rm;exports.ChevronDown=bd;exports.ChevronUp=Xk;exports.ColorFormat=yA;exports.Command=CL;exports.CommandEmpty=RL;exports.CommandGroup=PL;exports.CommandInput=_L;exports.CommandItem=ML;exports.CommandList=EL;exports.CopyButton=E5;exports.Cross2Icon=Hk;exports.CustomScrollArea=pm;exports.DATAMODEL_NAMESPCACE=Th;exports.Dashboard=cL;exports.DashboardPanel=jM;exports.DashboardTabs=aL;exports.DashboardWC=eve;exports.Dialog=Bme;exports.DialogContent=dL;exports.DialogDescription=gL;exports.DialogFooter=hL;exports.DialogHeader=fL;exports.DialogTitle=pL;exports.DialogTrigger=Vme;exports.Download=Zk;exports.DropdownMenu=ime;exports.DropdownMenuCheckboxItem=nL;exports.DropdownMenuContent=tL;exports.DropdownMenuLabel=oL;exports.DropdownMenuRadioGroup=ame;exports.DropdownMenuRadioItem=rL;exports.DropdownMenuSeparator=iL;exports.DropdownMenuTrigger=sme;exports.Editable=bo;exports.ErrorBoundary=vd;exports.Eye=eO;exports.Fallback=nw;exports.FallbackEditorCard=wB;exports.FilterComponent=V1;exports.FilterHeader=R5;exports.Ft=w0e;exports.HoverCard=Pg;exports.HoverCardContent=Pd;exports.HoverCardTrigger=Mg;exports.IconButton=jp;exports.Info=nO;exports.Input=al;exports.KPICard=fp;exports.LOCALE_CURRENCY_PAIRS=L0;exports.Label=Et;exports.Le=m0e;exports.MultiInputEmptyRenderer=EA;exports.PYTHON_DEFAULT_CODE=dx;exports.Pencil=rO;exports.Placeholders=T4;exports.Play=oO;exports.Plus=dg;exports.Popover=Wg;exports.PopoverContent=Td;exports.PopoverContentCustom=jL;exports.PopoverTrigger=Ug;exports.PrintMessages=k4;exports.RadioGroup=Gu;exports.RadioGroupItem=Os;exports.RefreshCcw=iO;exports.ResizableHandle=Uae;exports.ResizablePanel=My;exports.ResizablePanelGroup=X5;exports.ScrollArea=ll;exports.ScrollBar=uc;exports.Select=Ho;exports.SelectContent=ro;exports.SelectGroup=za;exports.SelectItem=At;exports.SelectLabel=xs;exports.SelectSeparator=pu;exports.SelectTrigger=no;exports.SelectValue=Wo;exports.SemaphorContextProvider=DM;exports.SemaphorQueryClient=kM;exports.Separator=Ag;exports.Settings=sO;exports.SmallSwitch=VL;exports.TableBody=t1;exports.TableCell=yp;exports.TableHead=n1;exports.TableHeader=e1;exports.TableRow=fu;exports.TableVisual=SA;exports.Tabs=Mx;exports.TabsContent=kx;exports.TabsList=Qp;exports.TabsTrigger=Jp;exports.TextCard=vp;exports.Toggle=qg;exports.Tooltip=Qw;exports.TooltipContent=Ig;exports.TooltipProvider=Kw;exports.TooltipProvider$1=JT;exports.TooltipTrigger=Jw;exports.TooltipTrigger$1=Xw;exports.TreePalm=aO;exports.TriangleDownIcon=Wk;exports.TriangleUpIcon=Uk;exports.UXProvider=lL;exports.X=ya;exports.cn=ie;exports.createChartConfig=Aw;exports.createLucideIcon=ot;exports.createSqlGenConfig=f8;exports.de=NL;exports.dedup=vhe;exports.flexRender=sy;exports.fmt=hx;exports.getCanvasBackgroundColor=Eu;exports.getChartGridStyle=SB;exports.getColumnDataType=h8;exports.getContrastColor=kl;exports.getCoreRowModel=fI;exports.getDefaultFilterSql=Gse;exports.getFilterValueType=Qa;exports.getFormattedTableNameForQuery=hM;exports.getKeys=Xt;exports.getNumberAxis=ow;exports.getObjectDiff=TM;exports.getPaginationRowModel=hI;exports.getPlugins=P8;exports.getQualifiedTableName=gx;exports.getRequest=x8;exports.getSortedRowModel=pI;exports.getSql=d8;exports.getStatus=O4;exports.getTenantAndEndUserId=S8;exports.getTokenParams=mM;exports.hslStringToHex=uO;exports.invalidateToken=E8;exports.isBooleanDataType=px;exports.isColumnInSqlGen=p8;exports.isDateDataType=Jl;exports.isDev=Dh;exports.isInAiScopeArray=bhe;exports.isNumberDataType=dd;exports.isObjectEmpty=y8;exports.isTextDataType=Wp;exports.loadManifest=CA;exports.merge=Ru;exports.pivotData=Bh;exports.postRequest=mx;exports.postRequestRegular=w8;exports.removeFromScopeArray=yhe;exports.removeRing=Ja;exports.resolveDataType=Up;exports.resolveDatamodelName=fM;exports.sanitizeAIScope=xhe;exports.titleCase=_8;exports.ue=sL;exports.useAssistantScroll=sF;exports.useCard=FK;exports.useChat=iF;exports.useCustomVisual=_A;exports.useDashboardActions=zt;exports.useDashboardCardQuery=oi;exports.useDashboardStore=se;exports.useDateFilterHook=Fre;exports.useEditorActions=fg;exports.useEditorStore=Vn;exports.useQuery=hd;exports.useQueryClient=wx;exports.useReactTable=gI;exports.useSemaphorContext=vr;exports.useSheetFilterValues=lO;exports.useTextFilterHook=Yse;exports.useTheme=vM;exports.useTopoJson=lT;exports.v4=Li;