@yoast/ai-insights-client 1.4.64 → 1.4.66
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.
|
@@ -49,7 +49,7 @@ object-assign
|
|
|
49
49
|
Valid keys: `+JSON.stringify(Object.keys(q),null," "));var se=je(he,ye,N,ne,J+"."+ye,n);if(se)return se}return null}return p(U)}function R(q){switch(typeof q){case"number":case"string":case"undefined":return!0;case"boolean":return!q;case"object":if(Array.isArray(q))return q.every(R);if(q===null||a(q))return!0;var U=d(q);if(U){var z=U.call(q),V;if(U!==q.entries){for(;!(V=z.next()).done;)if(!R(V.value))return!1}else for(;!(V=z.next()).done;){var N=V.value;if(N&&!R(N[1]))return!1}}else return!1;return!0;default:return!1}}function P(q,U){return q==="symbol"?!0:U?U["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&U instanceof Symbol:!1}function M(q){var U=typeof q;return Array.isArray(q)?"array":q instanceof RegExp?"object":P(U,q)?"symbol":U}function I(q){if(typeof q=="undefined"||q===null)return""+q;var U=M(q);if(U==="object"){if(q instanceof Date)return"date";if(q instanceof RegExp)return"regexp"}return U}function G(q){var U=I(q);switch(U){case"array":case"object":return"an "+U;case"boolean":case"date":case"regexp":return"a "+U;default:return U}}function Y(q){return!q.constructor||!q.constructor.name?f:q.constructor.name}return h.checkPropTypes=i,h.resetWarningCache=i.resetWarningCache,h.PropTypes=h,h},Mc}var $c,cg;function d8(){if(cg)return $c;cg=1;var e=Uf();function t(){}function n(){}return n.resetWarningCache=t,$c=function(){function r(o,a,l,u,c,d){if(d!==e){var f=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 f.name="Invariant Violation",f}}r.isRequired=r;function i(){return r}var s={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:i,element:r,elementType:r,instanceOf:i,node:r,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:n,resetWarningCache:t};return s.PropTypes=s,s},$c}var dg;function f8(){if(dg)return fl.exports;if(dg=1,process.env.NODE_ENV!=="production"){var e=T2(),t=!0;fl.exports=c8()(e.isElement,t)}else fl.exports=d8()();return fl.exports}var h8=f8();const zd=Tp(h8);var Xa=function(t){var n=t.className,r=n===void 0?"":n;return g.jsx("hr",{className:ke("yst-my-6",r)})};Xa.propTypes={className:zd.string};const j2=6048e5,g8=864e5,fg=Symbol.for("constructDateFrom");function bn(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&fg in e?e[fg](t):e instanceof Date?new e.constructor(t):new Date(t)}function Xt(e,t){return bn(t||e,e)}function M2(e,t,n){const r=Xt(e,n==null?void 0:n.in);if(isNaN(t))return bn(e,NaN);if(!t)return r;const i=r.getDate(),s=bn(e,r.getTime());s.setMonth(r.getMonth()+t+1,0);const o=s.getDate();return i>=o?s:(r.setFullYear(s.getFullYear(),s.getMonth(),i),r)}let y8={};function Wu(){return y8}function ha(e,t){var a,l,u,c,d,f,h,y;const n=Wu(),r=(y=(h=(c=(u=t==null?void 0:t.weekStartsOn)!=null?u:(l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)!=null?c:n.weekStartsOn)!=null?h:(f=(d=n.locale)==null?void 0:d.options)==null?void 0:f.weekStartsOn)!=null?y:0,i=Xt(e,t==null?void 0:t.in),s=i.getDay(),o=(s<r?7:0)+s-r;return i.setDate(i.getDate()-o),i.setHours(0,0,0,0),i}function au(e,t){return ha(e,{...t,weekStartsOn:1})}function $2(e,t){const n=Xt(e,t==null?void 0:t.in),r=n.getFullYear(),i=bn(n,0);i.setFullYear(r+1,0,4),i.setHours(0,0,0,0);const s=au(i),o=bn(n,0);o.setFullYear(r,0,4),o.setHours(0,0,0,0);const a=au(o);return n.getTime()>=s.getTime()?r+1:n.getTime()>=a.getTime()?r:r-1}function hg(e){const t=Xt(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 Qu(e,...t){const n=bn.bind(null,t.find(r=>typeof r=="object"));return t.map(n)}function lu(e,t){const n=Xt(e,t==null?void 0:t.in);return n.setHours(0,0,0,0),n}function m8(e,t,n){const[r,i]=Qu(n==null?void 0:n.in,e,t),s=lu(r),o=lu(i),a=+s-hg(s),l=+o-hg(o);return Math.round((a-l)/g8)}function p8(e,t){const n=$2(e,t),r=bn(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),au(r)}function v8(e){return bn(e,Date.now())}function b8(e,t,n){const[r,i]=Qu(n==null?void 0:n.in,e,t);return+lu(r)==+lu(i)}function x8(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function w8(e){return!(!x8(e)&&typeof e!="number"||isNaN(+Xt(e)))}function S8(e,t){const n=Xt(e,t==null?void 0:t.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function C8(e,t){const[n,r]=Qu(e,t.start,t.end);return{start:n,end:r}}function _8(e,t){const{start:n,end:r}=C8(t==null?void 0:t.in,e);let i=+n>+r;const s=i?+n:+r,o=i?r:n;o.setHours(0,0,0,0);let a=1;const l=[];for(;+o<=s;)l.push(bn(n,o)),o.setDate(o.getDate()+a),o.setHours(0,0,0,0);return i?l.reverse():l}function k8(e,t){const n=Xt(e,t==null?void 0:t.in);return n.setDate(1),n.setHours(0,0,0,0),n}function O8(e,t){const n=Xt(e,t==null?void 0:t.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}const E8={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"}},A8=(e,t,n)=>{let r;const i=E8[e];return typeof i=="string"?r=i:t===1?r=i.one:r=i.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function Lc(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const T8={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},P8={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},j8={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},M8={date:Lc({formats:T8,defaultWidth:"full"}),time:Lc({formats:P8,defaultWidth:"full"}),dateTime:Lc({formats:j8,defaultWidth:"full"})},$8={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},L8=(e,t,n,r)=>$8[e];function So(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let i;if(r==="formatting"&&e.formattingValues){const o=e.defaultFormattingWidth||e.defaultWidth,a=n!=null&&n.width?String(n.width):o;i=e.formattingValues[a]||e.formattingValues[o]}else{const o=e.defaultWidth,a=n!=null&&n.width?String(n.width):e.defaultWidth;i=e.values[a]||e.values[o]}const s=e.argumentCallback?e.argumentCallback(t):t;return i[s]}}const D8={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},I8={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},R8={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"]},N8={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"]},F8={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"}},B8={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"}},q8=(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"},z8={ordinalNumber:q8,era:So({values:D8,defaultWidth:"wide"}),quarter:So({values:I8,defaultWidth:"wide",argumentCallback:e=>e-1}),month:So({values:R8,defaultWidth:"wide"}),day:So({values:N8,defaultWidth:"wide"}),dayPeriod:So({values:F8,defaultWidth:"wide",formattingValues:B8,defaultFormattingWidth:"wide"})};function Co(e){return(t,n={})=>{const r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],s=t.match(i);if(!s)return null;const o=s[0],a=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(a)?U8(a,d=>d.test(o)):H8(a,d=>d.test(o));let u;u=e.valueCallback?e.valueCallback(l):l,u=n.valueCallback?n.valueCallback(u):u;const c=t.slice(o.length);return{value:u,rest:c}}}function H8(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function U8(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function G8(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const i=r[0],s=t.match(e.parsePattern);if(!s)return null;let o=e.valueCallback?e.valueCallback(s[0]):s[0];o=n.valueCallback?n.valueCallback(o):o;const a=t.slice(i.length);return{value:o,rest:a}}}const K8=/^(\d+)(th|st|nd|rd)?/i,V8=/\d+/i,W8={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},Q8={any:[/^b/i,/^(a|c)/i]},Y8={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},X8={any:[/1/i,/2/i,/3/i,/4/i]},Z8={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},J8={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]},e7={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},t7={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]},n7={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},r7={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}},i7={ordinalNumber:G8({matchPattern:K8,parsePattern:V8,valueCallback:e=>parseInt(e,10)}),era:Co({matchPatterns:W8,defaultMatchWidth:"wide",parsePatterns:Q8,defaultParseWidth:"any"}),quarter:Co({matchPatterns:Y8,defaultMatchWidth:"wide",parsePatterns:X8,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Co({matchPatterns:Z8,defaultMatchWidth:"wide",parsePatterns:J8,defaultParseWidth:"any"}),day:Co({matchPatterns:e7,defaultMatchWidth:"wide",parsePatterns:t7,defaultParseWidth:"any"}),dayPeriod:Co({matchPatterns:n7,defaultMatchWidth:"any",parsePatterns:r7,defaultParseWidth:"any"})},s7={code:"en-US",formatDistance:A8,formatLong:M8,formatRelative:L8,localize:z8,match:i7,options:{weekStartsOn:0,firstWeekContainsDate:1}};function o7(e,t){const n=Xt(e,t==null?void 0:t.in);return m8(n,O8(n))+1}function a7(e,t){const n=Xt(e,t==null?void 0:t.in),r=+au(n)-+p8(n);return Math.round(r/j2)+1}function L2(e,t){var c,d,f,h,y,m,p,v;const n=Xt(e,t==null?void 0:t.in),r=n.getFullYear(),i=Wu(),s=(v=(p=(h=(f=t==null?void 0:t.firstWeekContainsDate)!=null?f:(d=(c=t==null?void 0:t.locale)==null?void 0:c.options)==null?void 0:d.firstWeekContainsDate)!=null?h:i.firstWeekContainsDate)!=null?p:(m=(y=i.locale)==null?void 0:y.options)==null?void 0:m.firstWeekContainsDate)!=null?v:1,o=bn((t==null?void 0:t.in)||e,0);o.setFullYear(r+1,0,s),o.setHours(0,0,0,0);const a=ha(o,t),l=bn((t==null?void 0:t.in)||e,0);l.setFullYear(r,0,s),l.setHours(0,0,0,0);const u=ha(l,t);return+n>=+a?r+1:+n>=+u?r:r-1}function l7(e,t){var a,l,u,c,d,f,h,y;const n=Wu(),r=(y=(h=(c=(u=t==null?void 0:t.firstWeekContainsDate)!=null?u:(l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.firstWeekContainsDate)!=null?c:n.firstWeekContainsDate)!=null?h:(f=(d=n.locale)==null?void 0:d.options)==null?void 0:f.firstWeekContainsDate)!=null?y:1,i=L2(e,t),s=bn((t==null?void 0:t.in)||e,0);return s.setFullYear(i,0,r),s.setHours(0,0,0,0),ha(s,t)}function u7(e,t){const n=Xt(e,t==null?void 0:t.in),r=+ha(n,t)-+l7(n,t);return Math.round(r/j2)+1}function Je(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const Ir={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return Je(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):Je(n+1,2)},d(e,t){return Je(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 Je(e.getHours()%12||12,t.length)},H(e,t){return Je(e.getHours(),t.length)},m(e,t){return Je(e.getMinutes(),t.length)},s(e,t){return Je(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),i=Math.trunc(r*Math.pow(10,n-3));return Je(i,t.length)}},ss={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},gg={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(),i=r>0?r:1-r;return n.ordinalNumber(i,{unit:"year"})}return Ir.y(e,t)},Y:function(e,t,n,r){const i=L2(e,r),s=i>0?i:1-i;if(t==="YY"){const o=s%100;return Je(o,2)}return t==="Yo"?n.ordinalNumber(s,{unit:"year"}):Je(s,t.length)},R:function(e,t){const n=$2(e);return Je(n,t.length)},u:function(e,t){const n=e.getFullYear();return Je(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 Je(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 Je(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 Ir.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 Je(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 i=u7(e,r);return t==="wo"?n.ordinalNumber(i,{unit:"week"}):Je(i,t.length)},I:function(e,t,n){const r=a7(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):Je(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):Ir.d(e,t)},D:function(e,t,n){const r=o7(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):Je(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 i=e.getDay(),s=(i-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return Je(s,2);case"eo":return n.ordinalNumber(s,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});case"eeee":default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const i=e.getDay(),s=(i-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return Je(s,t.length);case"co":return n.ordinalNumber(s,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});case"cccc":default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),i=r===0?7:r;switch(t){case"i":return String(i);case"ii":return Je(i,t.length);case"io":return n.ordinalNumber(i,{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 i=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let i;switch(r===12?i=ss.noon:r===0?i=ss.midnight:i=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let i;switch(r>=17?i=ss.evening:r>=12?i=ss.afternoon:r>=4?i=ss.morning:i=ss.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(i,{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 Ir.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Ir.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):Je(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):Je(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Ir.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Ir.s(e,t)},S:function(e,t){return Ir.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return mg(r);case"XXXX":case"XX":return xi(r);case"XXXXX":case"XXX":default:return xi(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return mg(r);case"xxxx":case"xx":return xi(r);case"xxxxx":case"xxx":default:return xi(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+yg(r,":");case"OOOO":default:return"GMT"+xi(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+yg(r,":");case"zzzz":default:return"GMT"+xi(r,":")}},t:function(e,t,n){const r=Math.trunc(+e/1e3);return Je(r,t.length)},T:function(e,t,n){return Je(+e,t.length)}};function yg(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=Math.trunc(r/60),s=r%60;return s===0?n+String(i):n+String(i)+t+Je(s,2)}function mg(e,t){return e%60===0?(e>0?"-":"+")+Je(Math.abs(e)/60,2):xi(e,t)}function xi(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=Je(Math.trunc(r/60),2),s=Je(r%60,2);return n+i+t+s}const pg=(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"})}},D2=(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"})}},c7=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return pg(e,t);let s;switch(r){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;case"PPPP":default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",pg(r,t)).replace("{{time}}",D2(i,t))},d7={p:D2,P:c7},f7=/^D+$/,h7=/^Y+$/,g7=["D","DD","YY","YYYY"];function y7(e){return f7.test(e)}function m7(e){return h7.test(e)}function p7(e,t,n){const r=v7(e,t,n);if(console.warn(r),g7.includes(e))throw new RangeError(r)}function v7(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 b7=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,x7=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,w7=/^'([^]*?)'?$/,S7=/''/g,C7=/[a-zA-Z]/;function Ro(e,t,n){var c,d,f,h,y,m,p,v,b;const r=Wu(),i=(c=r.locale)!=null?c:s7,s=(y=(h=r.firstWeekContainsDate)!=null?h:(f=(d=r.locale)==null?void 0:d.options)==null?void 0:f.firstWeekContainsDate)!=null?y:1,o=(b=(v=r.weekStartsOn)!=null?v:(p=(m=r.locale)==null?void 0:m.options)==null?void 0:p.weekStartsOn)!=null?b:0,a=Xt(e,n==null?void 0:n.in);if(!w8(a))throw new RangeError("Invalid time value");let l=t.match(x7).map(S=>{const C=S[0];if(C==="p"||C==="P"){const x=d7[C];return x(S,i.formatLong)}return S}).join("").match(b7).map(S=>{if(S==="''")return{isToken:!1,value:"'"};const C=S[0];if(C==="'")return{isToken:!1,value:_7(S)};if(gg[C])return{isToken:!0,value:S};if(C.match(C7))throw new RangeError("Format string contains an unescaped latin alphabet character `"+C+"`");return{isToken:!1,value:S}});i.localize.preprocessor&&(l=i.localize.preprocessor(a,l));const u={firstWeekContainsDate:s,weekStartsOn:o,locale:i};return l.map(S=>{if(!S.isToken)return S.value;const C=S.value;(m7(C)||y7(C))&&p7(C,t,String(e));const x=gg[C[0]];return x(a,C,i.localize,u)}).join("")}function _7(e){const t=e.match(w7);return t?t[1].replace(S7,"'"):e}function vg(e,t,n){const[r,i]=Qu(n==null?void 0:n.in,e,t);return r.getFullYear()===i.getFullYear()&&r.getMonth()===i.getMonth()}function k7(e,t){return b8(bn(e,e),v8(e))}function O7(e,t,n){return M2(e,-1,n)}function ga(e){"@babel/helpers - typeof";return ga=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ga(e)}function Dc(e,t,n){return(t=E7(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function E7(e){var t=A7(e,"string");return ga(t)=="symbol"?t:t+""}function A7(e,t){if(ga(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ga(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function bg(e,t){return M7(e)||j7(e,t)||P7(e,t)||T7()}function T7(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
50
50
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function P7(e,t){if(e){if(typeof e=="string")return xg(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?xg(e,t):void 0}}function xg(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function j7(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,o,a=[],l=!0,u=!1;try{if(s=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return a}}function M7(e){if(Array.isArray(e))return e}var Wn={selected:{background:"yst-bg-primary-500",text:"yst-text-white",hover:"hover:yst-bg-primary-600"},hasAnalysis:{border:"yst-border-2 yst-border-primary-500",text:"yst-text-slate-900",hover:"hover:yst-bg-primary-50"},today:{underline:"yst-border-b-2 yst-border-slate-400"},indicator:{default:"yst-bg-blue-500"}},$7=function(t){var n=t.analyses,r=t.selectedAnalysisId,i=t.onAnalysisSelect,s=t.isLoading,o=s===void 0?!1:s,a=t.isOpen,l=a===void 0?!1:a,u=t.onClose,c=F.useState(new Date),d=bg(c,2),f=d[0],h=d[1],y=function(_){if(!_)return null;var O=_.slice(0,10),A=O.split("-"),T=bg(A,3),j=T[0],B=T[1],R=T[2],P=Number(j),M=Number(B),I=Number(R);return Number.isNaN(P)||Number.isNaN(M)||Number.isNaN(I)||M<1||M>12||I<1||I>31?null:new Date(P,M-1,I)},m=F.useMemo(function(){var w=new Map;return n.forEach(function(_){var O=y(_.createdAt),A=O?Ro(O,"yyyy-MM-dd"):"";A&&(w.has(A)||w.set(A,[]),w.get(A).push(_))}),w},[n]);F.useEffect(function(){if(l&&r){var w=n.find(function(T){return T.id===r});if(w){var _=y(w.createdAt);_&&h(_)}}else if(l&&n.length>0){var O=n.reduce(function(T,j){return new Date(j.createdAt)>new Date(T.createdAt)?j:T}),A=y(O.createdAt);A&&h(A)}},[l,r,n]);var p=F.useMemo(function(){return n.length===0?null:n.reduce(function(w,_){return new Date(_.createdAt)>new Date(w.createdAt)?_:w})},[n]),v=function(){if(p){var _=y(p.createdAt);_&&h(_)}},b=F.useMemo(function(){if(!p)return!1;var w=y(p.createdAt);return w?vg(w,f):!1},[p,f]),S=F.useMemo(function(){var w=k8(f),_=S8(f),O=new Date(w),A=O.getDay(),T=A===0?6:A-1;O.setDate(O.getDate()-T);var j=new Date(_),B=j.getDay(),R=B===0?0:7-B;return j.setDate(j.getDate()+R),_8({start:O,end:j}).map(function(P){var M=Ro(P,"yyyy-MM-dd"),I=m.get(M)||[],G=I.find(function(Y){return String(Y.id)===String(r)});return{date:M,dateObj:P,isCurrentMonth:vg(P,f),isToday:k7(P),isSelected:!!G,hasAnalyses:I.length>0,analyses:I}})},[f,m,r]),C=function(){h(function(_){return O7(_)})},x=function(){h(function(_){return M2(_,1)})},k=function(_){if(_.hasAnalyses){if(_.analyses.length===1)i(_.analyses[0].id);else{var O=_.analyses.reduce(function(A,T){return new Date(T.createdAt)>new Date(A.createdAt)?T:A});i(O.id)}u==null||u()}};return l?o?g.jsx("div",{className:"yst-absolute yst-left-0 yst-right-0 yst-top-full yst-z-50 yst-mt-1 yst-rounded-md yst-border yst-border-slate-200 yst-bg-white yst-p-4 yst-shadow-lg",children:g.jsxs("div",{className:"yst-animate-pulse yst-space-y-4",children:[g.jsx("div",{className:"yst-h-6 yst-rounded yst-bg-slate-200"}),g.jsx("div",{className:"yst-h-48 yst-rounded yst-bg-slate-200"})]})}):g.jsxs("div",{className:"yst-absolute yst-left-0 yst-right-0 yst-top-full yst-z-50 yst-mt-1 yst-min-w-80 yst-max-w-sm yst-rounded-md yst-border yst-border-slate-200 yst-bg-white yst-p-4 yst-shadow-lg",children:[g.jsxs("div",{className:"yst-mb-6 yst-flex yst-items-center yst-justify-between",children:[g.jsxs("button",{type:"button",onClick:C,className:"yst-rounded-md yst-p-1.5 yst-text-slate-400 hover:yst-bg-slate-100 hover:yst-text-slate-500",children:[g.jsx("span",{className:"yst-sr-only",children:"Previous month"}),g.jsx(Y4,{className:"yst-h-5 yst-w-5"})]}),g.jsx("h2",{className:"yst-text-sm yst-font-semibold yst-text-slate-900",children:Ro(f,"MMMM yyyy")}),g.jsxs("button",{type:"button",onClick:x,className:"yst-rounded-md yst-p-1.5 yst-text-slate-400 hover:yst-bg-slate-100 hover:yst-text-slate-500",children:[g.jsx("span",{className:"yst-sr-only",children:"Next month"}),g.jsx(Z4,{className:"yst-h-5 yst-w-5"})]})]}),g.jsx("div",{className:"yst-mb-0 yst-grid yst-grid-cols-7 yst-gap-x-1",children:["M","T","W","T","F","S","S"].map(function(w,_){return g.jsx("div",{className:"yst-py-2 yst-text-center yst-text-xs yst-font-medium yst-text-slate-500",children:w},"".concat(w,"-").concat(_))})}),g.jsx("div",{className:"yst-grid yst-grid-cols-7 yst-gap-x-1",children:S.map(function(w){return g.jsx("div",{className:"yst-flex yst-items-center yst-justify-center yst-py-1",children:g.jsxs("button",{type:"button",onClick:function(){return k(w)},disabled:!w.hasAnalyses,className:ke("yst-relative yst-rounded-full yst-text-sm yst-transition-colors","yst-flex yst-h-10 yst-w-10 yst-items-center yst-justify-center","yst-p-0",{"yst-text-slate-900":w.isCurrentMonth,"yst-text-slate-400":!w.isCurrentMonth},{"focus:yst-outline-none focus:yst-ring-2 focus:yst-ring-blue-500":w.hasAnalyses,"yst-cursor-not-allowed":!w.hasAnalyses,"yst-cursor-pointer":w.hasAnalyses},Dc({},"".concat(Wn.selected.background," ").concat(Wn.selected.text," ").concat(Wn.selected.hover),w.isSelected),Dc({},"".concat(Wn.hasAnalysis.border," ").concat(Wn.hasAnalysis.text," ").concat(Wn.hasAnalysis.hover),w.hasAnalyses&&!w.isSelected)),children:[g.jsx("span",{className:ke("yst-relative yst-z-10 yst-w-4",Dc({},Wn.today.underline,w.isToday&&!w.isSelected)),children:Ro(w.dateObj,"d")}),w.hasAnalyses&&w.analyses.length>1&&!w.isSelected&&g.jsx("span",{className:ke("yst-absolute yst-right-1 yst-top-1 yst-h-2 yst-w-2 yst-rounded-full",Wn.indicator.default)})]})},w.date)})}),g.jsxs("div",{className:"yst-mt-4 yst-flex yst-items-center yst-gap-4 yst-text-xs yst-text-slate-600",children:[g.jsxs("div",{className:"yst-flex yst-items-center yst-gap-1",children:[g.jsx("div",{className:"yst-h-3 yst-w-3 yst-rounded-full ".concat(Wn.hasAnalysis.border)}),g.jsx("span",{children:"Has analysis"})]}),g.jsxs("div",{className:"yst-flex yst-items-center yst-gap-1",children:[g.jsx("div",{className:"yst-h-3 yst-w-3 yst-rounded-full ".concat(Wn.selected.background)}),g.jsx("span",{children:"Selected"})]}),g.jsxs("div",{className:"yst-flex yst-items-center yst-gap-1",children:[g.jsx("div",{className:"yst-h-0.5 yst-w-4 yst-bg-slate-400"}),g.jsx("span",{children:"Today"})]})]}),p&&g.jsx("div",{className:"yst-mt-6",children:g.jsx(E.Button,{onClick:v,className:"yst-w-full",disabled:b,children:"Show latest analysis"})})]}):null};function Ic(e,t){return R7(e)||I7(e,t)||D7(e,t)||L7()}function L7(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
51
51
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function D7(e,t){if(e){if(typeof e=="string")return wg(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?wg(e,t):void 0}}function wg(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function I7(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,o,a=[],l=!0,u=!1;try{if(s=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return a}}function R7(e){if(Array.isArray(e))return e}var N7=function(t){var n=t.analyses,r=t.selectedAnalysisId,i=t.onAnalysisSelect,s=t.isLoading,o=s===void 0?!1:s,a=t.disabled,l=a===void 0?!1:a,u=t.id,c=u===void 0?"analysis-date-select":u,d=F.useState(!1),f=Ic(d,2),h=f[0],y=f[1],m=F.useState("latest"),p=Ic(m,2),v=p[0],b=p[1],S=F.useRef(null),C=function(P){if(!P)return null;var M=P.slice(0,10),I=M.split("-"),G=Ic(I,3),Y=G[0],q=G[1],U=G[2],z=Number(Y),V=Number(q),N=Number(U);return Number.isNaN(z)||Number.isNaN(V)||Number.isNaN(N)||V<1||V>12||N<1||N>31?null:new Date(z,V-1,N)},x=function(P){var M=C(P.createdAt);return M?M.getTime():-1/0};F.useEffect(function(){if((r==="latest"||!r)&&n.length>0&&!o){var R=n.reduce(function(P,M){return x(M)>x(P)?M:P});i(R.id)}},[n,r,i,o]);var k=F.useMemo(function(){if(r==="latest"||!r){if(n.length>0){var R=n.reduce(function(P,M){return x(M)>x(P)?M:P});return R.id}return"latest"}return r},[r,n,x]);F.useEffect(function(){b(k)},[k]);var w=n.find(function(R){return String(R.id)===String(v)}),_=n.length>0?String(n.reduce(function(R,P){return x(P)>x(R)?P:R}).id):"",O=function(){if(w){var R=C(w.createdAt),P=R?Ro(R,"MMMM d, yyyy"):w.createdAt?w.createdAt.slice(0,10):"Unknown date",M=String(w.id)===_?"(latest)":"(older)";return"".concat(P," ").concat(M)}return n.length>0?"Select date...":"No analyses available"}();F.useEffect(function(){var R=function(M){S.current&&!S.current.contains(M.target)&&y(!1)};return h&&document.addEventListener("mousedown",R),function(){document.removeEventListener("mousedown",R)}},[h]);var A=function(){!l&&!o&&y(!h)},T=function(P){b(P),i(P),y(!1)},j=function(){y(!1)},B=function(P){P.key==="Enter"||P.key===" "?(P.preventDefault(),A()):P.key==="Escape"&&y(!1)};return g.jsxs("div",{ref:S,className:"yst-relative",children:[g.jsxs("div",{className:"yst-relative",children:[g.jsx(E.TextInput,{id:c,onClick:A,onKeyDown:B,onChange:function(){},disabled:l||o,value:O,"aria-expanded":h,"aria-haspopup":"true","aria-label":"Select analysis date",className:ke("yst-pr-10",{"yst-cursor-default":!l&&!o})}),g.jsx(K4,{className:ke("yst-pointer-events-none yst-absolute yst-right-3 yst-top-1/2 yst--translate-y-1/2 yst-transform",{"yst-text-gray-400":l||o})})]}),g.jsx($7,{analyses:n,selectedAnalysisId:v,onAnalysisSelect:T,isLoading:o,isOpen:h,onClose:j})]})};function I2(e){if(e!=null){if(typeof e=="number"){var t=1e12;return e>t?e-Date.now():e}var n=Date.parse(e);if(!Number.isNaN(n))return n-Date.now()}}function F7(e,t){var n=I2(e);return n!==void 0&&n>t*60*1e3}var B7=2;function R2(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:B7,n=I2(e);return n!==void 0&&n<=t*60*1e3}function Hd(e){if(e==null)return"a future date";var t;if(typeof e=="number"){var n=1e12;e>n?t=e:t=Date.now()+e}else{var r=Date.parse(e);Number.isNaN(r)||(t=r)}if(t===void 0)return"a future date";var i=new Date(t),s={month:"long",day:"numeric"},o={hour:"numeric",minute:"2-digit",hour12:!0},a=i.toLocaleDateString("en-US",s),l=i.toLocaleTimeString("en-US",o);return"".concat(a," at ").concat(l)}function ya(e){"@babel/helpers - typeof";return ya=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ya(e)}var Sg;function gl(e,t,n){return(t=q7(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function q7(e){var t=z7(e,"string");return ya(t)=="symbol"?t:t+""}function z7(e,t){if(ya(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ya(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Cg(e,t){return K7(e)||G7(e,t)||U7(e,t)||H7()}function H7(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
52
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function U7(e,t){if(e){if(typeof e=="string")return _g(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_g(e,t):void 0}}function _g(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function G7(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,o,a=[],l=!0,u=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(l=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return a}}function K7(e){if(Array.isArray(e))return e}function Ud(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,n=typeof Symbol=="function"?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function s(h,y,m,p){var v=y&&y.prototype instanceof a?y:a,b=Object.create(v.prototype);return on(b,"_invoke",function(S,C,x){var k,w,_,O=0,A=x||[],T=!1,j={p:0,n:0,v:e,a:B,f:B.bind(e,4),d:function(P,M){return k=P,w=0,_=e,j.n=M,o}};function B(R,P){for(w=R,_=P,t=0;!T&&O&&!M&&t<A.length;t++){var M,I=A[t],G=j.p,Y=I[2];R>3?(M=Y===P)&&(_=I[(w=I[4])?5:(w=3,3)],I[4]=I[5]=e):I[0]<=G&&((M=R<2&&G<I[1])?(w=0,j.v=P,j.n=I[1]):G<Y&&(M=R<3||I[0]>P||P>Y)&&(I[4]=R,I[5]=P,j.n=Y,w=0))}if(M||R>1)return o;throw T=!0,P}return function(R,P,M){if(O>1)throw TypeError("Generator is already running");for(T&&P===1&&B(P,M),w=P,_=M;(t=w<2?e:_)||!T;){k||(w?w<3?(w>1&&(j.n=-1),B(w,_)):j.n=_:j.v=_);try{if(O=2,k){if(w||(R="next"),t=k[R]){if(!(t=t.call(k,_)))throw TypeError("iterator result is not an object");if(!t.done)return t;_=t.value,w<2&&(w=0)}else w===1&&(t=k.return)&&t.call(k),w<2&&(_=TypeError("The iterator does not provide a '"+R+"' method"),w=1);k=e}else if((t=(T=j.n<0)?_:S.call(C,j))!==o)break}catch(I){k=e,w=1,_=I}finally{O=1}}return{value:t,done:T}}}(h,m,p),!0),b}var o={};function a(){}function l(){}function u(){}t=Object.getPrototypeOf;var c=[][r]?t(t([][r]())):(on(t={},r,function(){return this}),t),d=u.prototype=a.prototype=Object.create(c);function f(h){return Object.setPrototypeOf?Object.setPrototypeOf(h,u):(h.__proto__=u,on(h,i,"GeneratorFunction")),h.prototype=Object.create(d),h}return l.prototype=u,on(d,"constructor",u),on(u,"constructor",l),l.displayName="GeneratorFunction",on(u,i,"GeneratorFunction"),on(d),on(d,i,"Generator"),on(d,r,function(){return this}),on(d,"toString",function(){return"[object Generator]"}),(Ud=function(){return{w:s,m:f}})()}function on(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(s){i=0}on=function(o,a,l,u){if(a)i?i(o,a,{value:l,enumerable:!u,configurable:!u,writable:!u}):o[a]=l;else{var c=function(f,h){on(o,f,function(y){return this._invoke(f,h,y)})};c("next",0),c("throw",1),c("return",2)}},on(e,t,n,r)}function kg(e,t,n,r,i,s,o){try{var a=e[s](o),l=a.value}catch(u){return void n(u)}a.done?t(l):Promise.resolve(l).then(r,i)}function V7(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var s=e.apply(t,n);function o(l){kg(s,r,i,o,a,"next",l)}function a(l){kg(s,r,i,o,a,"throw",l)}o(void 0)})}}function W7(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var Rc=Ya(Sg||(Sg=W7(["yst-flex-1 yst-space-y-2"]))),Q7=function(t){var n,r,i,s,o,a=t.className,l=Gn(),u=l.brandId,c=l.analysisId,d=l.model,f=Va(),h=f.setModel,y=f.setAnalysisId,m=Yt(),p=xn(),v=hi(),b=v.data,S=Uu({query:{select:function(Ke){var oe=Ke.data;return oe==null?void 0:oe.data}}}),C=S.data,x=S.isLoading,k=C==null?void 0:C.displayName,w=es({query:{select:function(Ke){var oe=Ke.data;return oe==null?void 0:oe.brands}}}),_=w.data,O=w.isLoading,A=g2(u,{query:{enabled:!!u,select:function(Ke){var oe=Ke.data;return oe==null?void 0:oe.analyses}}}),T=A.data,j=A.isLoading,B=qu(u,c,{query:{enabled:!!u&&!!c,select:function(Ke){var oe=Ke.data;return oe}}}),R=B.data,P=B.isLoading,M=ou(u,{query:{enabled:!!u,select:function(Ke){var oe=Ke.data;return oe}}}),I=M.data,G=Y5({mutation:{onSuccess:function(){var Ae=V7(Ud().m(function oe(){var pe,Oe;return Ud().w(function(Ee){for(;;)switch(Ee.n){case 0:return Ee.n=1,Promise.all([m.invalidateQueries({queryKey:Nf(u)}),m.invalidateQueries({queryKey:ir(u,c)}),m.invalidateQueries({queryKey:zu(u)})]);case 1:pe=(T==null?void 0:T.filter(function(He){return String(He.id)!==String(c)}))||[],pe.length>0?(Oe=pe.reduce(function(He,Et){var tn=He.createdAt?new Date(He.createdAt).getTime():0,mi=Et.createdAt?new Date(Et.createdAt).getTime():0;return mi>tn?Et:He}),y(Oe.id),p("/brands/".concat(u,"/analysis/").concat(Oe.id))):(y("latest"),p("/brands/".concat(u))),N(!1);case 2:return Ee.a(2)}},oe)}));function Ke(){return Ae.apply(this,arguments)}return Ke}()}}),Y=G.mutate,q=G.isPending,U=F.useState(!1),z=Cg(U,2),V=z[0],N=z[1],ne=function(){N(!1)},J=_==null?void 0:_.find(function(Ae){return String(Ae.id)===String(u)}),he=function(Ke){switch(Ke){case"openai":return"OpenAI";case"perplexity":return"Perplexity";case"anthropic":return"Anthropic";default:return Ke||"Unknown"}},X=(R==null||(n=R.analysis)===null||n===void 0||(n=n.scans)===null||n===void 0?void 0:n.map(function(Ae){return{value:Ae.aiProvider,label:he(Ae.aiProvider)}}))||[{value:"",label:"Default model"}],ge=T!=null&&T.some(function(Ae){return String(Ae.id)===String(c)})?c:T&&T.length>0?T[0].id:"latest",ye=ou(u,{query:{enabled:!!u,select:function(Ke){var oe=Ke.data;return oe}}}),je=ye.data,se=(je==null?void 0:je.name)||"your brand",nt=Hd(je==null?void 0:je.nextScheduledAnalysis),Ie=R==null||(r=R.analysis)===null||r===void 0?void 0:r.status,st=R==null||(i=R.analysis)===null||i===void 0?void 0:i.id,ze=u!=null&&typeof st=="number"&&!isNaN(st),Ve=F.useState(!1),ee=Cg(Ve,2),$e=ee[0],ot=ee[1];F.useEffect(function(){if(!ze||Ie!==qr.completed){ot(!1);return}var Ae="yst_legal_alert_dismissed_".concat(u,"_").concat(st);ot(window.localStorage.getItem(Ae)===null)},[u,st,ze,Ie]);var Ne=function(Ke){if(Ke.preventDefault(),!!ze){var oe="yst_legal_alert_dismissed_".concat(u,"_").concat(st);window.localStorage.setItem(oe,"true"),ot(!1)}},Le=g.jsxs("div",{className:"yst-max-w-xl yst-space-y-2",children:[g.jsx("p",{className:"yst-font-medium",children:"Your analysis is scheduled"}),g.jsxs("p",{children:["You've completed the setup for"," ",g.jsx("b",{className:"yst-font-medium",children:se}),". The analysis is scheduled to run on"," ",g.jsx("b",{className:"yst-font-medium",children:nt}),". You'll see the results here once it's ready. We'll also notify you by email."]})]}),de=gl(gl(gl(gl({scheduledFirstAnalysis:{alertContent:Le,alertVariant:"info"}},qr.pending,{alertContent:Le,alertVariant:"info"}),qr.processing,{alertContent:g.jsxs(g.Fragment,{children:["You've completed the setup for ",se,". The analysis is now processing. You'll see the results here once it's ready. We'll also notify you by email."]}),alertVariant:"info"}),qr.failed,{alertContent:g.jsx(g.Fragment,{children:"Analysis failed. Try restarting the analysis or contact support if the issue persists."}),alertVariant:"danger"}),qr.cancelled,{alertContent:g.jsx(g.Fragment,{children:"Analysis was cancelled. You can restart the analysis when ready."}),alertVariant:"warning"}),me=!Ie&&(I==null?void 0:I.setupStatus)==="scheduledFirstAnalysis"?"scheduledFirstAnalysis":Ie,fe=(s=de[me])!==null&&s!==void 0?s:{alertContent:null,alertVariant:"info"},Fe=fe.alertContent,Zt=fe.alertVariant,It=!j&&(I==null?void 0:I.setupStatus)!=="pendingQuerySelection"&&(T==null?void 0:T.length)===0&&(I==null?void 0:I.nextScheduledAnalysis)===null,Jt=Ie===qr.completed&&b&&["updating","completed"].includes(b.status)&&!b.isUpToDateWithBrandGroups,en=(b==null?void 0:b.status)===Z6.updating&&Jt===!0;return g.jsxs(g.Fragment,{children:[g.jsx(Vu,{isOpen:V,onClose:ne,onConfirm:function(){u&&c&&Y({brandId:u,analysisId:c})},isLoading:q,title:"Delete analysis?",description:g.jsxs(g.Fragment,{children:[g.jsx("p",{children:"This will permanently delete all data associated with this analysis."}),g.jsx("p",{children:"This action cannot be undone."})]}),confirmText:"Yes, delete analysis",cancelText:"No, go back"}),g.jsx(E.Card,{className:ke("yst-relative yst-overflow-visible",a),children:g.jsxs(E.Card.Content,{className:"yst-mt-0",children:[g.jsxs("div",{className:"yst-flex yst-flex-1 yst-flex-col yst-flex-wrap yst-items-start yst-justify-between yst-gap-4 md:yst-flex-row xl:yst-items-center",children:[g.jsx("div",{className:"xl:yst-max-w-1/4",children:g.jsxs("div",{className:"yst-flex yst-flex-col xl:yst-flex-row xl:yst-items-baseline xl:yst-gap-2",children:[g.jsx(E.Title,{children:g.jsxs(g.Fragment,{children:[x?g.jsx(E.SkeletonLoader,{className:"yst-inline-block yst-h-8 yst-w-64"}):g.jsxs(g.Fragment,{children:["Hi",k&&" ".concat(k),","]})," "]})}),g.jsx("p",{className:"yst-text-sm yst-font-normal yst-text-slate-600",children:"welcome to your brand analysis!"})]})}),g.jsxs("div",{className:"yst-flex yst-flex-row yst-flex-wrap yst-items-center yst-justify-end yst-gap-4 yst-self-end md:yst-self-start",children:[g.jsxs(E.Button,{variant:"primary",className:"yst-gap-1.5",onClick:function(){return p("/setup")},disabled:j||O,children:[g.jsx(x2,{})," Analyze a different brand"]}),g.jsx("div",{className:"yst-relative",children:g.jsxs(E.DropdownMenu,{children:[g.jsx(E.DropdownMenu.IconTrigger,{screenReaderTriggerLabel:"Open brand list options",disabled:j||O||_&&(_==null?void 0:_.length)<1,children:g.jsx(i6,{})}),g.jsx(E.DropdownMenu.List,{className:"yst-absolute yst-right-0 yst-top-full yst-z-40 yst-mt-2 yst-flex yst-w-64 yst-flex-col yst-justify-start",children:g.jsxs(E.DropdownMenu.ButtonItem,{onClick:function(){return N(!0)},disabled:j||O||(R==null||(o=R.analysis)===null||o===void 0?void 0:o.status)!=="completed"||!T||T.length===0,className:"yst-flex yst-justify-start yst-gap-1.5 yst-text-red-600 hover:yst-bg-red-50",children:[g.jsx(Ff,{className:"yst-h-4 yst-w-4"}),"Delete analysis"]})})]})})]})]}),g.jsx(Xa,{}),g.jsxs("form",{className:"yst-flex yst-flex-col yst-items-stretch yst-gap-4 md:yst-flex-row md:yst-items-center",children:[g.jsxs(Rc,{children:[g.jsx(E.Label,{htmlFor:"brand-name",children:"Brand"}),g.jsx(E.Select,{onChange:function(Ae){p("/brands/".concat(Ae.toString()))},id:"brand-name",value:u?Number(u):"loading",options:_&&_.length>0?_.map(function(Ae){return{value:Ae.id,label:Ae.name}}):[{value:"loading",label:"Loading..."}],disabled:O||!_||_.length<2||!u})]}),g.jsxs(Rc,{children:[g.jsx(E.Label,{htmlFor:"analysis-date",children:"Analysis date"}),g.jsx(N7,{analyses:T||[],selectedAnalysisId:ge,onAnalysisSelect:function(Ae){p("/brands/".concat(u,"/analysis/").concat(String(Ae)))},isLoading:j,disabled:j||!T||T.length<1,id:"analysis-date"})]}),g.jsxs(Rc,{children:[g.jsx(E.Label,{htmlFor:"ai-tool",children:"AI model"}),g.jsx(E.Select,{onChange:function(Ae){Object.values(X6).includes(Ae)?h(Ae):console.error("Invalid AI provider selected:",Ae)},id:"ai-tool",value:d,options:P||j?[{value:d,label:"Loading..."}]:X,disabled:P||j||[{}].length<2})]})]})]})}),g.jsxs("div",{className:"ystaii-alerts yst-space-y-4",children:[$e&&g.jsx(E.Alert,{children:g.jsxs("div",{className:"yst-flex yst-w-full",children:[g.jsx("div",{className:"yst-max-w-xl yst-space-y-4",children:g.jsx("p",{className:"yst-mb-0",children:"Note: This content was generated by an AI model (see dropdown above) and may contain errors. Please review before acting on it."})}),g.jsx("div",{className:"yst-ml-auto",children:g.jsx(E.Link,{onClick:Ne,variant:"default",children:g.jsx(O2,{})})})]})}),Ie!==qr.completed&&Fe&&g.jsx(E.Alert,{className:"md:yst-col-span-2",variant:Zt,children:Fe}),Jt&&g.jsxs(E.Alert,{variant:"warning",children:["Note: This scan is not up to date with your current brand groups.",en?g.jsxs(g.Fragment,{children:[" ","We're updating your sentiment analysis to reflect your new brand groups. This may take a few minutes."]}):g.jsx(g.Fragment,{children:" Newer scans will use your newly selected brand groupings."})]})]}),It&&g.jsx(E.Alert,{variant:"info",className:"yst-mb-6",children:g.jsx("div",{className:"yst-flex yst-items-start yst-gap-3",children:g.jsxs("div",{className:"yst-flex-1",children:[g.jsx("h3",{className:"yst-mb-2 yst-font-medium yst-text-blue-800",children:"No analyses scheduled"}),g.jsxs("p",{className:"yst-text-bluer-700 yst-mb-0",children:[g.jsx("span",{className:"yst-font-medium yst-text-blue-900",children:J==null?void 0:J.name})," ","has not been analyzed yet, and no analyses are scheduled because this brand is set to inactive in your"," ",g.jsx("span",{className:"yst-cursor-pointer yst-font-medium yst-text-blue-900 yst-underline",onClick:function(){return p("/settings")},role:"button",tabIndex:0,onKeyPress:function(Ae){(Ae.key==="Enter"||Ae.key===" ")&&p("/settings")},children:"Settings"}),"."]})]})})}),J&&g.jsx(s8,{brand:J},J.id)]})},Y7=function(){var t,n,r,i=hi(),s=i.data,o=i.isLoading,a=i.isRefetching,l=s==null?void 0:s.mentions;return g.jsx(E.Card,{className:"yst-overflow-visible",children:g.jsxs(E.Card.Content,{className:"yst-space-y-4",children:[g.jsxs("div",{className:"yst-space-y-2",children:[g.jsx(Qa,{title:"Mentions",tooltip:"The queries where your brand was mentioned."}),g.jsx(Wa,{score:l==null||(t=l.mentionedInNumberOfQueries)===null||t===void 0?void 0:t.value,total:l==null||(n=l.queriesWithMentions)===null||n===void 0?void 0:n.length,suffix:"queries",isLoading:o||a})]}),!o&&l?g.jsx("ul",{children:l==null||(r=l.queriesWithMentions)===null||r===void 0?void 0:r.map(function(u,c){var d=c===0,f=l.queriesWithMentions&&c===l.queriesWithMentions.length-1;return g.jsxs("li",{className:ke("yst-flex yst-flex-row yst-items-center yst-gap-2 yst-border-l yst-border-r yst-border-slate-300 yst-p-4 yst-font-medium yst-text-slate-800",{"yst-rounded-t-lg yst-border-t":d,"yst-rounded-b-lg yst-border-b":f,"yst-border-b":!f}),children:[g.jsx("div",{className:"yst-h-4 yst-w-4",children:u!=null&&u.mentioned?g.jsx(W4,{className:"yst-text-green-500"}):g.jsx(v6,{className:"yst-text-red-500"})}),g.jsx("span",{className:"yst-justify-start",children:u.query}),g.jsx("span",{className:"yst-ml-auto yst-flex yst-items-end",children:u!=null&&u.mentioned?g.jsx(E.Badge,{className:"yst-bg-green-100 yst-text-green-800",children:"Found"}):g.jsx(E.Badge,{className:"yst-bg-red-100 yst-text-red-800",children:"Not found"})})]},u.query)})}):g.jsx(E.SkeletonLoader,{className:"yst-h-56 yst-w-full"})]})})};/*!
|
|
52
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function U7(e,t){if(e){if(typeof e=="string")return _g(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_g(e,t):void 0}}function _g(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function G7(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,o,a=[],l=!0,u=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(l=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return a}}function K7(e){if(Array.isArray(e))return e}function Ud(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,n=typeof Symbol=="function"?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function s(h,y,m,p){var v=y&&y.prototype instanceof a?y:a,b=Object.create(v.prototype);return on(b,"_invoke",function(S,C,x){var k,w,_,O=0,A=x||[],T=!1,j={p:0,n:0,v:e,a:B,f:B.bind(e,4),d:function(P,M){return k=P,w=0,_=e,j.n=M,o}};function B(R,P){for(w=R,_=P,t=0;!T&&O&&!M&&t<A.length;t++){var M,I=A[t],G=j.p,Y=I[2];R>3?(M=Y===P)&&(_=I[(w=I[4])?5:(w=3,3)],I[4]=I[5]=e):I[0]<=G&&((M=R<2&&G<I[1])?(w=0,j.v=P,j.n=I[1]):G<Y&&(M=R<3||I[0]>P||P>Y)&&(I[4]=R,I[5]=P,j.n=Y,w=0))}if(M||R>1)return o;throw T=!0,P}return function(R,P,M){if(O>1)throw TypeError("Generator is already running");for(T&&P===1&&B(P,M),w=P,_=M;(t=w<2?e:_)||!T;){k||(w?w<3?(w>1&&(j.n=-1),B(w,_)):j.n=_:j.v=_);try{if(O=2,k){if(w||(R="next"),t=k[R]){if(!(t=t.call(k,_)))throw TypeError("iterator result is not an object");if(!t.done)return t;_=t.value,w<2&&(w=0)}else w===1&&(t=k.return)&&t.call(k),w<2&&(_=TypeError("The iterator does not provide a '"+R+"' method"),w=1);k=e}else if((t=(T=j.n<0)?_:S.call(C,j))!==o)break}catch(I){k=e,w=1,_=I}finally{O=1}}return{value:t,done:T}}}(h,m,p),!0),b}var o={};function a(){}function l(){}function u(){}t=Object.getPrototypeOf;var c=[][r]?t(t([][r]())):(on(t={},r,function(){return this}),t),d=u.prototype=a.prototype=Object.create(c);function f(h){return Object.setPrototypeOf?Object.setPrototypeOf(h,u):(h.__proto__=u,on(h,i,"GeneratorFunction")),h.prototype=Object.create(d),h}return l.prototype=u,on(d,"constructor",u),on(u,"constructor",l),l.displayName="GeneratorFunction",on(u,i,"GeneratorFunction"),on(d),on(d,i,"Generator"),on(d,r,function(){return this}),on(d,"toString",function(){return"[object Generator]"}),(Ud=function(){return{w:s,m:f}})()}function on(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(s){i=0}on=function(o,a,l,u){if(a)i?i(o,a,{value:l,enumerable:!u,configurable:!u,writable:!u}):o[a]=l;else{var c=function(f,h){on(o,f,function(y){return this._invoke(f,h,y)})};c("next",0),c("throw",1),c("return",2)}},on(e,t,n,r)}function kg(e,t,n,r,i,s,o){try{var a=e[s](o),l=a.value}catch(u){return void n(u)}a.done?t(l):Promise.resolve(l).then(r,i)}function V7(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var s=e.apply(t,n);function o(l){kg(s,r,i,o,a,"next",l)}function a(l){kg(s,r,i,o,a,"throw",l)}o(void 0)})}}function W7(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var Rc=Ya(Sg||(Sg=W7(["yst-flex-1 yst-space-y-2"]))),Q7=function(t){var n,r,i,s,o,a=t.className,l=Gn(),u=l.brandId,c=l.analysisId,d=l.model,f=Va(),h=f.setModel,y=f.setAnalysisId,m=Yt(),p=xn(),v=hi(),b=v.data,S=Uu({query:{select:function(Ve){var oe=Ve.data;return oe==null?void 0:oe.data}}}),C=S.data,x=S.isLoading,k=C==null?void 0:C.displayName,w=es({query:{select:function(Ve){var oe=Ve.data;return oe==null?void 0:oe.brands}}}),_=w.data,O=w.isLoading,A=g2(u,{query:{enabled:!!u,select:function(Ve){var oe=Ve.data;return oe==null?void 0:oe.analyses}}}),T=A.data,j=A.isLoading,B=qu(u,c,{query:{enabled:!!u&&!!c,select:function(Ve){var oe=Ve.data;return oe}}}),R=B.data,P=B.isLoading,M=ou(u,{query:{enabled:!!u,select:function(Ve){var oe=Ve.data;return oe}}}),I=M.data,G=Y5({mutation:{onSuccess:function(){var Ae=V7(Ud().m(function oe(){var pe,Oe;return Ud().w(function(Ee){for(;;)switch(Ee.n){case 0:return Ee.n=1,Promise.all([m.invalidateQueries({queryKey:Nf(u)}),m.invalidateQueries({queryKey:ir(u,c)}),m.invalidateQueries({queryKey:zu(u)})]);case 1:pe=(T==null?void 0:T.filter(function(He){return String(He.id)!==String(c)}))||[],pe.length>0?(Oe=pe.reduce(function(He,Et){var tn=He.createdAt?new Date(He.createdAt).getTime():0,mi=Et.createdAt?new Date(Et.createdAt).getTime():0;return mi>tn?Et:He}),y(Oe.id),p("/brands/".concat(u,"/analysis/").concat(Oe.id))):(y("latest"),p("/brands/".concat(u))),N(!1);case 2:return Ee.a(2)}},oe)}));function Ve(){return Ae.apply(this,arguments)}return Ve}()}}),Y=G.mutate,q=G.isPending,U=F.useState(!1),z=Cg(U,2),V=z[0],N=z[1],ne=function(){N(!1)},J=_==null?void 0:_.find(function(Ae){return String(Ae.id)===String(u)}),he=function(Ve){switch(Ve){case"openai":return"OpenAI";case"perplexity":return"Perplexity";case"anthropic":return"Anthropic";default:return Ve||"Unknown"}},X=(R==null||(n=R.analysis)===null||n===void 0||(n=n.scans)===null||n===void 0?void 0:n.map(function(Ae){return{value:Ae.aiProvider,label:he(Ae.aiProvider)}}))||[{value:"",label:"Default model"}],ge=T!=null&&T.some(function(Ae){return String(Ae.id)===String(c)})?c:T&&T.length>0?T[0].id:"latest",ye=ou(u,{query:{enabled:!!u,select:function(Ve){var oe=Ve.data;return oe}}}),je=ye.data,se=(je==null?void 0:je.name)||"your brand",nt=Hd(je==null?void 0:je.nextScheduledAnalysis),Ie=R==null||(r=R.analysis)===null||r===void 0?void 0:r.status,st=R==null||(i=R.analysis)===null||i===void 0?void 0:i.id,ze=u!=null&&typeof st=="number"&&!isNaN(st),Ke=F.useState(!1),ee=Cg(Ke,2),$e=ee[0],ot=ee[1];F.useEffect(function(){if(!ze||Ie!==qr.completed){ot(!1);return}var Ae="yst_legal_alert_dismissed_".concat(u,"_").concat(st);ot(window.localStorage.getItem(Ae)===null)},[u,st,ze,Ie]);var Ne=function(Ve){if(Ve.preventDefault(),!!ze){var oe="yst_legal_alert_dismissed_".concat(u,"_").concat(st);window.localStorage.setItem(oe,"true"),ot(!1)}},Le=g.jsxs("div",{className:"yst-max-w-xl yst-space-y-2",children:[g.jsx("p",{className:"yst-font-medium",children:"Your analysis is scheduled"}),g.jsxs("p",{children:["You've completed the setup for"," ",g.jsx("b",{className:"yst-font-medium",children:se}),". The analysis is scheduled to run on"," ",g.jsx("b",{className:"yst-font-medium",children:nt}),". You'll see the results here once it's ready. We'll also notify you by email."]})]}),de=gl(gl(gl(gl({scheduledFirstAnalysis:{alertContent:Le,alertVariant:"info"}},qr.pending,{alertContent:Le,alertVariant:"info"}),qr.processing,{alertContent:g.jsxs(g.Fragment,{children:["You've completed the setup for ",se,". The analysis is now processing. You'll see the results here once it's ready. We'll also notify you by email."]}),alertVariant:"info"}),qr.failed,{alertContent:g.jsx(g.Fragment,{children:"Analysis failed. Try restarting the analysis or contact support if the issue persists."}),alertVariant:"danger"}),qr.cancelled,{alertContent:g.jsx(g.Fragment,{children:"Analysis was cancelled. You can restart the analysis when ready."}),alertVariant:"warning"}),me=!Ie&&(I==null?void 0:I.setupStatus)==="scheduledFirstAnalysis"?"scheduledFirstAnalysis":Ie,fe=(s=de[me])!==null&&s!==void 0?s:{alertContent:null,alertVariant:"info"},Fe=fe.alertContent,Zt=fe.alertVariant,It=!j&&(I==null?void 0:I.setupStatus)!=="pendingQuerySelection"&&(T==null?void 0:T.length)===0&&(I==null?void 0:I.nextScheduledAnalysis)===null,Jt=Ie===qr.completed&&b&&["updating","completed"].includes(b.status)&&!b.isUpToDateWithBrandGroups,en=(b==null?void 0:b.status)===Z6.updating&&Jt===!0;return g.jsxs(g.Fragment,{children:[g.jsx(Vu,{isOpen:V,onClose:ne,onConfirm:function(){u&&c&&Y({brandId:u,analysisId:c})},isLoading:q,title:"Delete analysis?",description:g.jsxs(g.Fragment,{children:[g.jsx("p",{children:"This will permanently delete all data associated with this analysis."}),g.jsx("p",{children:"This action cannot be undone."})]}),confirmText:"Yes, delete analysis",cancelText:"No, go back"}),g.jsx(E.Card,{className:ke("yst-relative yst-overflow-visible",a),children:g.jsxs(E.Card.Content,{className:"yst-mt-0",children:[g.jsxs("div",{className:"yst-flex yst-flex-1 yst-flex-col yst-flex-wrap yst-items-start yst-justify-between yst-gap-4 md:yst-flex-row xl:yst-items-center",children:[g.jsx("div",{className:"xl:yst-max-w-1/4",children:g.jsxs("div",{className:"yst-flex yst-flex-col xl:yst-flex-row xl:yst-items-baseline xl:yst-gap-2",children:[g.jsx(E.Title,{children:g.jsxs(g.Fragment,{children:[x?g.jsx(E.SkeletonLoader,{className:"yst-inline-block yst-h-8 yst-w-64"}):g.jsxs(g.Fragment,{children:["Hi",k&&" ".concat(k),","]})," "]})}),g.jsx("p",{className:"yst-text-sm yst-font-normal yst-text-slate-600",children:"welcome to your brand analysis!"})]})}),g.jsxs("div",{className:"yst-flex yst-flex-row yst-flex-wrap yst-items-center yst-justify-end yst-gap-4 yst-self-end md:yst-self-start",children:[g.jsxs(E.Button,{variant:"primary",className:"yst-gap-1.5",onClick:function(){return p("/setup")},disabled:j||O,children:[g.jsx(x2,{})," Analyze a different brand"]}),g.jsx("div",{className:"yst-relative",children:g.jsxs(E.DropdownMenu,{children:[g.jsx(E.DropdownMenu.IconTrigger,{screenReaderTriggerLabel:"Open brand list options",disabled:j||O||_&&(_==null?void 0:_.length)<1,children:g.jsx(i6,{})}),g.jsx(E.DropdownMenu.List,{className:"yst-absolute yst-right-0 yst-top-full yst-z-40 yst-mt-2 yst-flex yst-w-64 yst-flex-col yst-justify-start",children:g.jsxs(E.DropdownMenu.ButtonItem,{onClick:function(){return N(!0)},disabled:j||O||(R==null||(o=R.analysis)===null||o===void 0?void 0:o.status)!=="completed"||!T||T.length===0,className:"yst-flex yst-justify-start yst-gap-1.5 yst-text-red-600 hover:yst-bg-red-50",children:[g.jsx(Ff,{className:"yst-h-4 yst-w-4"}),"Delete analysis"]})})]})})]})]}),g.jsx(Xa,{}),g.jsxs("form",{className:"yst-flex yst-flex-col yst-items-stretch yst-gap-4 md:yst-flex-row md:yst-items-center",children:[g.jsxs(Rc,{children:[g.jsx(E.Label,{htmlFor:"brand-name",children:"Brand"}),g.jsx(E.Select,{onChange:function(Ae){p("/brands/".concat(Ae.toString()))},id:"brand-name",value:u?Number(u):"loading",options:_&&_.length>0?_.map(function(Ae){return{value:Ae.id,label:Ae.name}}):[{value:"loading",label:"Loading..."}],disabled:O||!_||_.length<2||!u})]}),g.jsxs(Rc,{children:[g.jsx(E.Label,{htmlFor:"analysis-date",children:"Analysis date"}),g.jsx(N7,{analyses:T||[],selectedAnalysisId:ge,onAnalysisSelect:function(Ae){p("/brands/".concat(u,"/analysis/").concat(String(Ae)))},isLoading:j,disabled:j||!T||T.length<1,id:"analysis-date"})]}),g.jsxs(Rc,{children:[g.jsx(E.Label,{htmlFor:"ai-tool",children:"AI model"}),g.jsx(E.Select,{onChange:function(Ae){Object.values(X6).includes(Ae)?h(Ae):console.error("Invalid AI provider selected:",Ae)},id:"ai-tool",value:d,options:P||j?[{value:d,label:"Loading..."}]:X,disabled:P||j||[{}].length<2})]})]})]})}),g.jsxs("div",{className:"ystaii-alerts yst-space-y-4",children:[$e&&g.jsx(E.Alert,{children:g.jsxs("div",{className:"yst-flex yst-w-full",children:[g.jsx("div",{className:"yst-max-w-xl yst-space-y-4",children:g.jsx("p",{className:"yst-mb-0",children:"Note: This content was generated by an AI model (see dropdown above) and may contain errors. Please review before acting on it."})}),g.jsx("div",{className:"yst-ml-auto",children:g.jsx(E.Link,{onClick:Ne,variant:"default",children:g.jsx(O2,{})})})]})}),Ie!==qr.completed&&Fe&&g.jsx(E.Alert,{className:"md:yst-col-span-2",variant:Zt,children:Fe}),Jt&&g.jsxs(E.Alert,{variant:"warning",children:["Note: This scan is not up to date with your current brand groups.",en?g.jsxs(g.Fragment,{children:[" ","We're updating your sentiment analysis to reflect your new brand groups. This may take a few minutes."]}):g.jsx(g.Fragment,{children:" Newer scans will use your newly selected brand groupings."})]})]}),It&&g.jsx(E.Alert,{variant:"info",className:"yst-mb-6",children:g.jsx("div",{className:"yst-flex yst-items-start yst-gap-3",children:g.jsxs("div",{className:"yst-flex-1",children:[g.jsx("h3",{className:"yst-mb-2 yst-font-medium yst-text-blue-800",children:"No analyses scheduled"}),g.jsxs("p",{className:"yst-text-bluer-700 yst-mb-0",children:[g.jsx("span",{className:"yst-font-medium yst-text-blue-900",children:J==null?void 0:J.name})," ","has not been analyzed yet, and no analyses are scheduled because this brand is set to inactive in your"," ",g.jsx("span",{className:"yst-cursor-pointer yst-font-medium yst-text-blue-900 yst-underline",onClick:function(){return p("/settings")},role:"button",tabIndex:0,onKeyPress:function(Ae){(Ae.key==="Enter"||Ae.key===" ")&&p("/settings")},children:"Settings"}),"."]})]})})}),J&&g.jsx(s8,{brand:J},J.id)]})},Y7=function(){var t,n,r,i=hi(),s=i.data,o=i.isLoading,a=i.isRefetching,l=s==null?void 0:s.mentions;return g.jsx(E.Card,{className:"yst-overflow-visible",children:g.jsxs(E.Card.Content,{className:"yst-space-y-4",children:[g.jsxs("div",{className:"yst-space-y-2",children:[g.jsx(Qa,{title:"Mentions",tooltip:"The queries where your brand was mentioned."}),g.jsx(Wa,{score:l==null||(t=l.mentionedInNumberOfQueries)===null||t===void 0?void 0:t.value,total:l==null||(n=l.queriesWithMentions)===null||n===void 0?void 0:n.length,suffix:"queries",isLoading:o||a})]}),!o&&l?g.jsx("ul",{children:l==null||(r=l.queriesWithMentions)===null||r===void 0?void 0:r.map(function(u,c){var d=c===0,f=l.queriesWithMentions&&c===l.queriesWithMentions.length-1;return g.jsxs("li",{className:ke("yst-flex yst-flex-row yst-items-center yst-gap-2 yst-border-l yst-border-r yst-border-slate-300 yst-p-4 yst-font-medium yst-text-slate-800",{"yst-rounded-t-lg yst-border-t":d,"yst-rounded-b-lg yst-border-b":f,"yst-border-b":!f}),children:[g.jsx("div",{className:"yst-h-4 yst-w-4",children:u!=null&&u.mentioned?g.jsx(W4,{className:"yst-text-green-500"}):g.jsx(v6,{className:"yst-text-red-500"})}),g.jsx("span",{className:"yst-justify-start",children:u.query}),g.jsx("span",{className:"yst-ml-auto yst-flex yst-items-end",children:u!=null&&u.mentioned?g.jsx(E.Badge,{className:"yst-bg-green-100 yst-text-green-800",children:"Found"}):g.jsx(E.Badge,{className:"yst-bg-red-100 yst-text-red-800",children:"Not found"})})]},u.query)})}):g.jsx(E.SkeletonLoader,{className:"yst-h-56 yst-w-full"})]})})};/*!
|
|
53
53
|
* @kurkle/color v0.3.4
|
|
54
54
|
* https://github.com/kurkle/color#readme
|
|
55
55
|
* (c) 2024 Jukka Kurkela
|
|
@@ -67,9 +67,9 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
67
67
|
*/class Kk{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,n,r,i){const s=n.listeners[i],o=n.duration;s.forEach(a=>a({chart:t,initial:n.initial,numSteps:o,currentStep:Math.min(r-n.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=G2.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let n=0;this._charts.forEach((r,i)=>{if(!r.running||!r.items.length)return;const s=r.items;let o=s.length-1,a=!1,l;for(;o>=0;--o)l=s[o],l._active?(l._total>r.duration&&(r.duration=l._total),l.tick(t),a=!0):(s[o]=s[s.length-1],s.pop());a&&(i.draw(),this._notify(i,r,t,"progress")),s.length||(r.running=!1,this._notify(i,r,t,"complete"),r.initial=!1),n+=s.length}),this._lastDate=t,n===0&&(this._running=!1)}_getAnims(t){const n=this._charts;let r=n.get(t);return r||(r={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(t,r)),r}listen(t,n,r){this._getAnims(t).listeners[n].push(r)}add(t,n){!n||!n.length||this._getAnims(t).items.push(...n)}has(t){return this._getAnims(t).items.length>0}start(t){const n=this._charts.get(t);n&&(n.running=!0,n.start=Date.now(),n.duration=n.items.reduce((r,i)=>Math.max(r,i._duration),0),this._refresh())}running(t){if(!this._running)return!1;const n=this._charts.get(t);return!(!n||!n.running||!n.items.length)}stop(t){const n=this._charts.get(t);if(!n||!n.items.length)return;const r=n.items;let i=r.length-1;for(;i>=0;--i)r[i].cancel();n.items=[],this._notify(t,n,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var yr=new Kk;const Wg="transparent",Vk={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const r=Ng(e||Wg),i=r.valid&&Ng(t||Wg);return i&&i.valid?i.mix(r,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class Wk{constructor(t,n,r,i){const s=n[r];i=bl([t.to,i,s,t.from]);const o=bl([t.from,s,i]);this._active=!0,this._fn=t.fn||Vk[t.type||typeof o],this._easing=Xo[t.easing]||Xo.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=n,this._prop=r,this._from=o,this._to=i,this._promises=void 0}active(){return this._active}update(t,n,r){if(this._active){this._notify(!1);const i=this._target[this._prop],s=r-this._start,o=this._duration-s;this._start=r,this._duration=Math.floor(Math.max(o,t.duration)),this._total+=s,this._loop=!!t.loop,this._to=bl([t.to,n,i,t.from]),this._from=bl([t.from,i,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const n=t-this._start,r=this._duration,i=this._prop,s=this._from,o=this._loop,a=this._to;let l;if(this._active=s!==a&&(o||n<r),!this._active){this._target[i]=a,this._notify(!0);return}if(n<0){this._target[i]=s;return}l=n/r%2,l=o&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[i]=this._fn(s,a,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((n,r)=>{t.push({res:n,rej:r})})}_notify(t){const n=t?"res":"rej",r=this._promises||[];for(let i=0;i<r.length;i++)r[i][n]()}}class ab{constructor(t,n){this._chart=t,this._properties=new Map,this.configure(n)}configure(t){if(!Ue(t))return;const n=Object.keys(yt.animation),r=this._properties;Object.getOwnPropertyNames(t).forEach(i=>{const s=t[i];if(!Ue(s))return;const o={};for(const a of n)o[a]=s[a];(ft(s.properties)&&s.properties||[i]).forEach(a=>{(a===i||!r.has(a))&&r.set(a,o)})})}_animateOptions(t,n){const r=n.options,i=Yk(t,r);if(!i)return[];const s=this._createAnimations(i,r);return r.$shared&&Qk(t.options.$animations,r).then(()=>{t.options=r},()=>{}),s}_createAnimations(t,n){const r=this._properties,i=[],s=t.$animations||(t.$animations={}),o=Object.keys(n),a=Date.now();let l;for(l=o.length-1;l>=0;--l){const u=o[l];if(u.charAt(0)==="$")continue;if(u==="options"){i.push(...this._animateOptions(t,n));continue}const c=n[u];let d=s[u];const f=r.get(u);if(d)if(f&&d.active()){d.update(f,c,a);continue}else d.cancel();if(!f||!f.duration){t[u]=c;continue}s[u]=d=new Wk(f,t,u,c),i.push(d)}return i}update(t,n){if(this._properties.size===0){Object.assign(t,n);return}const r=this._createAnimations(t,n);if(r.length)return yr.add(this._chart,r),!0}}function Qk(e,t){const n=[],r=Object.keys(t);for(let i=0;i<r.length;i++){const s=e[r[i]];s&&s.active()&&n.push(s.wait())}return Promise.all(n)}function Yk(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 Qg(e,t){const n=e&&e.options||{},r=n.reverse,i=n.min===void 0?t:0,s=n.max===void 0?t:0;return{start:r?s:i,end:r?i:s}}function Xk(e,t,n){if(n===!1)return!1;const r=Qg(e,n),i=Qg(t,n);return{top:i.end,right:r.end,bottom:i.start,left:r.start}}function Zk(e){let t,n,r,i;return Ue(e)?(t=e.top,n=e.right,r=e.bottom,i=e.left):t=n=r=i=e,{top:t,right:n,bottom:r,left:i,disabled:e===!1}}function lb(e,t){const n=[],r=e._getSortedDatasetMetas(t);let i,s;for(i=0,s=r.length;i<s;++i)n.push(r[i].index);return n}function Yg(e,t,n,r={}){const i=e.keys,s=r.mode==="single";let o,a,l,u;if(t===null)return;let c=!1;for(o=0,a=i.length;o<a;++o){if(l=+i[o],l===n){if(c=!0,r.all)continue;break}u=e.values[l],St(u)&&(s||t===0||Xs(t)===Xs(u))&&(t+=u)}return!c&&!r.all?0:t}function Jk(e,t){const{iScale:n,vScale:r}=t,i=n.axis==="x"?"x":"y",s=r.axis==="x"?"x":"y",o=Object.keys(e),a=new Array(o.length);let l,u,c;for(l=0,u=o.length;l<u;++l)c=o[l],a[l]={[i]:c,[s]:e[c]};return a}function qc(e,t){const n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function eO(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}function tO(e){const{min:t,max:n,minDefined:r,maxDefined:i}=e.getUserBounds();return{min:r?t:Number.NEGATIVE_INFINITY,max:i?n:Number.POSITIVE_INFINITY}}function nO(e,t,n){const r=e[t]||(e[t]={});return r[n]||(r[n]={})}function Xg(e,t,n,r){for(const i of t.getMatchingVisibleMetas(r).reverse()){const s=e[i.index];if(n&&s>0||!n&&s<0)return i.index}return null}function Zg(e,t){const{chart:n,_cachedMeta:r}=e,i=n._stacks||(n._stacks={}),{iScale:s,vScale:o,index:a}=r,l=s.axis,u=o.axis,c=eO(s,o,r),d=t.length;let f;for(let h=0;h<d;++h){const y=t[h],{[l]:m,[u]:p}=y,v=y._stacks||(y._stacks={});f=v[u]=nO(i,c,m),f[a]=p,f._top=Xg(f,o,!0,r.type),f._bottom=Xg(f,o,!1,r.type);const b=f._visualValues||(f._visualValues={});b[a]=p}}function zc(e,t){const n=e.scales;return Object.keys(n).filter(r=>n[r].axis===t).shift()}function rO(e,t){return gi(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function iO(e,t,n){return gi(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function _o(e,t){const n=e.controller.index,r=e.vScale&&e.vScale.axis;if(r){t=t||e._parsed;for(const i of t){const s=i._stacks;if(!s||s[r]===void 0||s[r][n]===void 0)return;delete s[r][n],s[r]._visualValues!==void 0&&s[r]._visualValues[n]!==void 0&&delete s[r]._visualValues[n]}}}const Hc=e=>e==="reset"||e==="none",Jg=(e,t)=>t?e:Object.assign({},e),sO=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:lb(n,!0),values:null};class vs{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=qc(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&&_o(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,r=this.getDataset(),i=(d,f,h,y)=>d==="x"?f:d==="r"?y:h,s=n.xAxisID=Be(r.xAxisID,zc(t,"x")),o=n.yAxisID=Be(r.yAxisID,zc(t,"y")),a=n.rAxisID=Be(r.rAxisID,zc(t,"r")),l=n.indexAxis,u=n.iAxisID=i(l,s,o,a),c=n.vAxisID=i(l,o,s,a);n.xScale=this.getScaleForId(s),n.yScale=this.getScaleForId(o),n.rScale=this.getScaleForId(a),n.iScale=this.getScaleForId(u),n.vScale=this.getScaleForId(c)}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&&Dg(this._data,this),t._stacked&&_o(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),r=this._data;if(Ue(n)){const i=this._cachedMeta;this._data=Jk(n,i)}else if(r!==n){if(r){Dg(r,this);const i=this._cachedMeta;_o(i),i._parsed=[]}n&&Object.isExtensible(n)&&R9(n,this),this._syncList=[],this._data=n}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const n=this._cachedMeta,r=this.getDataset();let i=!1;this._dataCheck();const s=n._stacked;n._stacked=qc(n.vScale,n),n.stack!==r.stack&&(i=!0,_o(n),n.stack=r.stack),this._resyncElements(t),(i||s!==n._stacked)&&(Zg(this,n._parsed),n._stacked=qc(n.vScale,n))}configure(){const t=this.chart.config,n=t.datasetScopeKeys(this._type),r=t.getOptionScopes(this.getDataset(),n,!0);this.options=t.createResolver(r,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,n){const{_cachedMeta:r,_data:i}=this,{iScale:s,_stacked:o}=r,a=s.axis;let l=t===0&&n===i.length?!0:r._sorted,u=t>0&&r._parsed[t-1],c,d,f;if(this._parsing===!1)r._parsed=i,r._sorted=!0,f=i;else{ft(i[t])?f=this.parseArrayData(r,i,t,n):Ue(i[t])?f=this.parseObjectData(r,i,t,n):f=this.parsePrimitiveData(r,i,t,n);const h=()=>d[a]===null||u&&d[a]<u[a];for(c=0;c<n;++c)r._parsed[c+t]=d=f[c],l&&(h()&&(l=!1),u=d);r._sorted=l}o&&Zg(this,f)}parsePrimitiveData(t,n,r,i){const{iScale:s,vScale:o}=t,a=s.axis,l=o.axis,u=s.getLabels(),c=s===o,d=new Array(i);let f,h,y;for(f=0,h=i;f<h;++f)y=f+r,d[f]={[a]:c||s.parse(u[y],y),[l]:o.parse(n[y],y)};return d}parseArrayData(t,n,r,i){const{xScale:s,yScale:o}=t,a=new Array(i);let l,u,c,d;for(l=0,u=i;l<u;++l)c=l+r,d=n[c],a[l]={x:s.parse(d[0],c),y:o.parse(d[1],c)};return a}parseObjectData(t,n,r,i){const{xScale:s,yScale:o}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,u=new Array(i);let c,d,f,h;for(c=0,d=i;c<d;++c)f=c+r,h=n[f],u[c]={x:s.parse(va(h,a),f),y:o.parse(va(h,l),f)};return u}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,n,r){const i=this.chart,s=this._cachedMeta,o=n[t.axis],a={keys:lb(i,!0),values:n._stacks[t.axis]._visualValues};return Yg(a,o,s.index,{mode:r})}updateRangeFromParsed(t,n,r,i){const s=r[n.axis];let o=s===null?NaN:s;const a=i&&r._stacks[n.axis];i&&a&&(i.values=a,o=Yg(i,s,this._cachedMeta.index)),t.min=Math.min(t.min,o),t.max=Math.max(t.max,o)}getMinMax(t,n){const r=this._cachedMeta,i=r._parsed,s=r._sorted&&t===r.iScale,o=i.length,a=this._getOtherScale(t),l=sO(n,r,this.chart),u={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:c,max:d}=tO(a);let f,h;function y(){h=i[f];const m=h[a.axis];return!St(h[t.axis])||c>m||d<m}for(f=0;f<o&&!(!y()&&(this.updateRangeFromParsed(u,t,h,l),s));++f);if(s){for(f=o-1;f>=0;--f)if(!y()){this.updateRangeFromParsed(u,t,h,l);break}}return u}getAllParsedValues(t){const n=this._cachedMeta._parsed,r=[];let i,s,o;for(i=0,s=n.length;i<s;++i)o=n[i][t.axis],St(o)&&r.push(o);return r}getMaxOverflow(){return!1}getLabelAndValue(t){const n=this._cachedMeta,r=n.iScale,i=n.vScale,s=this.getParsed(t);return{label:r?""+r.getLabelForValue(s[r.axis]):"",value:i?""+i.getLabelForValue(s[i.axis]):""}}_update(t){const n=this._cachedMeta;this.update(t||"default"),n._clip=Zk(Be(this.options.clip,Xk(n.xScale,n.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,n=this.chart,r=this._cachedMeta,i=r.data||[],s=n.chartArea,o=[],a=this._drawStart||0,l=this._drawCount||i.length-a,u=this.options.drawActiveElementsOnTop;let c;for(r.dataset&&r.dataset.draw(t,s,a,l),c=a;c<a+l;++c){const d=i[c];d.hidden||(d.active&&u?o.push(d):d.draw(t,s))}for(c=0;c<o.length;++c)o[c].draw(t,s)}getStyle(t,n){const r=n?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(r):this.resolveDataElementOptions(t||0,r)}getContext(t,n,r){const i=this.getDataset();let s;if(t>=0&&t<this._cachedMeta.data.length){const o=this._cachedMeta.data[t];s=o.$context||(o.$context=iO(this.getContext(),t,o)),s.parsed=this.getParsed(t),s.raw=i.data[t],s.index=s.dataIndex=t}else s=this.$context||(this.$context=rO(this.chart.getContext(),this.index)),s.dataset=i,s.index=s.datasetIndex=this.index;return s.active=!!n,s.mode=r,s}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,n){return this._resolveElementOptions(this.dataElementType.id,n,t)}_resolveElementOptions(t,n="default",r){const i=n==="active",s=this._cachedDataOpts,o=t+"-"+n,a=s[o],l=this.enableOptionSharing&&du(r);if(a)return Jg(a,l);const u=this.chart.config,c=u.datasetElementScopeKeys(this._type,t),d=i?[`${t}Hover`,"hover",t,""]:[t,""],f=u.getOptionScopes(this.getDataset(),c),h=Object.keys(yt.elements[t]),y=()=>this.getContext(r,i,n),m=u.resolveNamedOptions(f,h,y,d);return m.$shared&&(m.$shared=l,s[o]=Object.freeze(Jg(m,l))),m}_resolveAnimations(t,n,r){const i=this.chart,s=this._cachedDataOpts,o=`animation-${n}`,a=s[o];if(a)return a;let l;if(i.options.animation!==!1){const c=this.chart.config,d=c.datasetAnimationScopeKeys(this._type,n),f=c.getOptionScopes(this.getDataset(),d);l=c.createResolver(f,this.getContext(t,r,n))}const u=new ab(i,l&&l.animations);return l&&l._cacheable&&(s[o]=Object.freeze(u)),u}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,n){return!n||Hc(t)||this.chart._animationsDisabled}_getSharedOptions(t,n){const r=this.resolveDataElementOptions(t,n),i=this._sharedOptions,s=this.getSharedOptions(r),o=this.includeOptions(n,s)||s!==i;return this.updateSharedOptions(s,n,r),{sharedOptions:s,includeOptions:o}}updateElement(t,n,r,i){Hc(i)?Object.assign(t,r):this._resolveAnimations(n,i).update(t,r)}updateSharedOptions(t,n,r){t&&!Hc(n)&&this._resolveAnimations(void 0,n).update(t,r)}_setStyle(t,n,r,i){t.active=i;const s=this.getStyle(n,i);this._resolveAnimations(n,r,i).update(t,{options:!i&&this.getSharedOptions(s)||s})}removeHoverStyle(t,n,r){this._setStyle(t,r,"active",!1)}setHoverStyle(t,n,r){this._setStyle(t,r,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const n=this._data,r=this._cachedMeta.data;for(const[a,l,u]of this._syncList)this[a](l,u);this._syncList=[];const i=r.length,s=n.length,o=Math.min(s,i);o&&this.parse(0,o),s>i?this._insertElements(i,s-i,t):s<i&&this._removeElements(s,i-s)}_insertElements(t,n,r=!0){const i=this._cachedMeta,s=i.data,o=t+n;let a;const l=u=>{for(u.length+=n,a=u.length-1;a>=o;a--)u[a]=u[a-n]};for(l(s),a=t;a<o;++a)s[a]=new this.dataElementType;this._parsing&&l(i._parsed),this.parse(t,n),r&&this.updateElements(s,t,n,"reset")}updateElements(t,n,r,i){}_removeElements(t,n){const r=this._cachedMeta;if(this._parsing){const i=r._parsed.splice(t,n);r._stacked&&_o(r,i)}r.data.splice(t,n)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[n,r,i]=t;this[n](r,i)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,n){n&&this._sync(["_removeElements",t,n]);const r=arguments.length-2;r&&this._sync(["_insertElements",t,r])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}be(vs,"defaults",{}),be(vs,"datasetElementType",null),be(vs,"dataElementType",null);class zl extends vs{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const n=this._cachedMeta,{dataset:r,data:i=[],_dataset:s}=n,o=this.chart._animationsDisabled;let{start:a,count:l}=q9(n,i,o);this._drawStart=a,this._drawCount=l,z9(n)&&(a=0,l=i.length),r._chart=this.chart,r._datasetIndex=this.index,r._decimated=!!s._decimated,r.points=i;const u=this.resolveDatasetElementOptions(t);this.options.showLine||(u.borderWidth=0),u.segment=this.options.segment,this.updateElement(r,void 0,{animated:!o,options:u},t),this.updateElements(i,a,l,t)}updateElements(t,n,r,i){const s=i==="reset",{iScale:o,vScale:a,_stacked:l,_dataset:u}=this._cachedMeta,{sharedOptions:c,includeOptions:d}=this._getSharedOptions(n,i),f=o.axis,h=a.axis,{spanGaps:y,segment:m}=this.options,p=ba(y)?y:Number.POSITIVE_INFINITY,v=this.chart._animationsDisabled||s||i==="none",b=n+r,S=t.length;let C=n>0&&this.getParsed(n-1);for(let x=0;x<S;++x){const k=t[x],w=v?k:{};if(x<n||x>=b){w.skip=!0;continue}const _=this.getParsed(x),O=tt(_[h]),A=w[f]=o.getPixelForValue(_[f],x),T=w[h]=s||O?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,_,l):_[h],x);w.skip=isNaN(A)||isNaN(T)||O,w.stop=x>0&&Math.abs(_[f]-C[f])>p,m&&(w.parsed=_,w.raw=u.data[x]),d&&(w.options=c||this.resolveDataElementOptions(x,k.active?"active":i)),v||this.updateElement(k,x,w,i),C=_}}getMaxOverflow(){const t=this._cachedMeta,n=t.dataset,r=n.options&&n.options.borderWidth||0,i=t.data||[];if(!i.length)return r;const s=i[0].size(this.resolveDataElementOptions(0)),o=i[i.length-1].size(this.resolveDataElementOptions(i.length-1));return Math.max(r,s,o)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}be(zl,"id","line"),be(zl,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),be(zl,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class Hl extends vs{getLabelAndValue(t){const n=this._cachedMeta.vScale,r=this.getParsed(t);return{label:n.getLabels()[t],value:""+n.getLabelForValue(r[n.axis])}}parseObjectData(t,n,r,i){return xk.bind(this)(t,n,r,i)}update(t){const n=this._cachedMeta,r=n.dataset,i=n.data||[],s=n.iScale.getLabels();if(r.points=i,t!=="resize"){const o=this.resolveDatasetElementOptions(t);this.options.showLine||(o.borderWidth=0);const a={_loop:!0,_fullLoop:s.length===i.length,options:o};this.updateElement(r,void 0,a,t)}this.updateElements(i,0,i.length,t)}updateElements(t,n,r,i){const s=this._cachedMeta.rScale,o=i==="reset";for(let a=n;a<n+r;a++){const l=t[a],u=this.resolveDataElementOptions(a,l.active?"active":i),c=s.getPointPositionForValue(a,this.getParsed(a).r),d=o?s.xCenter:c.x,f=o?s.yCenter:c.y,h={x:d,y:f,angle:c.angle,skip:isNaN(d)||isNaN(f),options:u};this.updateElement(l,a,h,i)}}}be(Hl,"id","radar"),be(Hl,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),be(Hl,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});function bi(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class sh{constructor(t){be(this,"options");this.options=t||{}}static override(t){Object.assign(sh.prototype,t)}init(){}formats(){return bi()}parse(){return bi()}format(){return bi()}add(){return bi()}diff(){return bi()}startOf(){return bi()}endOf(){return bi()}}var oO={_date:sh};function aO(e,t,n,r){const{controller:i,data:s,_sorted:o}=e,a=i._cachedMeta.iScale,l=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null;if(a&&t===a.axis&&t!=="r"&&o&&s.length){const u=a._reversePixels?D9:Ei;if(r){if(i._sharedOptions){const c=s[0],d=typeof c.getRange=="function"&&c.getRange(t);if(d){const f=u(s,t,n-d),h=u(s,t,n+d);return{lo:f.lo,hi:h.hi}}}}else{const c=u(s,t,n);if(l){const{vScale:d}=i._cachedMeta,{_parsed:f}=e,h=f.slice(0,c.lo+1).reverse().findIndex(m=>!tt(m[d.axis]));c.lo-=Math.max(0,h);const y=f.slice(c.hi).findIndex(m=>!tt(m[d.axis]));c.hi+=Math.max(0,y)}return c}}return{lo:0,hi:s.length-1}}function Ju(e,t,n,r,i){const s=e.getSortedVisibleDatasetMetas(),o=n[t];for(let a=0,l=s.length;a<l;++a){const{index:u,data:c}=s[a],{lo:d,hi:f}=aO(s[a],t,o,i);for(let h=d;h<=f;++h){const y=c[h];y.skip||r(y,u,h)}}}function lO(e){const t=e.indexOf("x")!==-1,n=e.indexOf("y")!==-1;return function(r,i){const s=t?Math.abs(r.x-i.x):0,o=n?Math.abs(r.y-i.y):0;return Math.sqrt(Math.pow(s,2)+Math.pow(o,2))}}function Uc(e,t,n,r,i){const s=[];return!i&&!e.isPointInArea(t)||Ju(e,n,t,function(a,l,u){!i&&!Cr(a,e.chartArea,0)||a.inRange(t.x,t.y,r)&&s.push({element:a,datasetIndex:l,index:u})},!0),s}function uO(e,t,n,r){let i=[];function s(o,a,l){const{startAngle:u,endAngle:c}=o.getProps(["startAngle","endAngle"],r),{angle:d}=M9(o,{x:t.x,y:t.y});H2(d,u,c)&&i.push({element:o,datasetIndex:a,index:l})}return Ju(e,n,t,s),i}function cO(e,t,n,r,i,s){let o=[];const a=lO(n);let l=Number.POSITIVE_INFINITY;function u(c,d,f){const h=c.inRange(t.x,t.y,i);if(r&&!h)return;const y=c.getCenterPoint(i);if(!(!!s||e.isPointInArea(y))&&!h)return;const p=a(t,y);p<l?(o=[{element:c,datasetIndex:d,index:f}],l=p):p===l&&o.push({element:c,datasetIndex:d,index:f})}return Ju(e,n,t,u),o}function Gc(e,t,n,r,i,s){return!s&&!e.isPointInArea(t)?[]:n==="r"&&!r?uO(e,t,n,i):cO(e,t,n,r,i,s)}function ey(e,t,n,r,i){const s=[],o=n==="x"?"inXRange":"inYRange";let a=!1;return Ju(e,n,t,(l,u,c)=>{l[o]&&l[o](t[n],i)&&(s.push({element:l,datasetIndex:u,index:c}),a=a||l.inRange(t.x,t.y,i))}),r&&!a?[]:s}var dO={modes:{index(e,t,n,r){const i=wi(t,e),s=n.axis||"x",o=n.includeInvisible||!1,a=n.intersect?Uc(e,i,s,r,o):Gc(e,i,s,!1,r,o),l=[];return a.length?(e.getSortedVisibleDatasetMetas().forEach(u=>{const c=a[0].index,d=u.data[c];d&&!d.skip&&l.push({element:d,datasetIndex:u.index,index:c})}),l):[]},dataset(e,t,n,r){const i=wi(t,e),s=n.axis||"xy",o=n.includeInvisible||!1;let a=n.intersect?Uc(e,i,s,r,o):Gc(e,i,s,!1,r,o);if(a.length>0){const l=a[0].datasetIndex,u=e.getDatasetMeta(l).data;a=[];for(let c=0;c<u.length;++c)a.push({element:u[c],datasetIndex:l,index:c})}return a},point(e,t,n,r){const i=wi(t,e),s=n.axis||"xy",o=n.includeInvisible||!1;return Uc(e,i,s,r,o)},nearest(e,t,n,r){const i=wi(t,e),s=n.axis||"xy",o=n.includeInvisible||!1;return Gc(e,i,s,n.intersect,r,o)},x(e,t,n,r){const i=wi(t,e);return ey(e,i,"x",n.intersect,r)},y(e,t,n,r){const i=wi(t,e);return ey(e,i,"y",n.intersect,r)}}};const ub=["left","top","right","bottom"];function ko(e,t){return e.filter(n=>n.pos===t)}function ty(e,t){return e.filter(n=>ub.indexOf(n.pos)===-1&&n.box.axis===t)}function Oo(e,t){return e.sort((n,r)=>{const i=t?r:n,s=t?n:r;return i.weight===s.weight?i.index-s.index:i.weight-s.weight})}function fO(e){const t=[];let n,r,i,s,o,a;for(n=0,r=(e||[]).length;n<r;++n)i=e[n],{position:s,options:{stack:o,stackWeight:a=1}}=i,t.push({index:n,box:i,pos:s,horizontal:i.isHorizontal(),weight:i.weight,stack:o&&s+o,stackWeight:a});return t}function hO(e){const t={};for(const n of e){const{stack:r,pos:i,stackWeight:s}=n;if(!r||!ub.includes(i))continue;const o=t[r]||(t[r]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=s}return t}function gO(e,t){const n=hO(e),{vBoxMaxWidth:r,hBoxMaxHeight:i}=t;let s,o,a;for(s=0,o=e.length;s<o;++s){a=e[s];const{fullSize:l}=a.box,u=n[a.stack],c=u&&a.stackWeight/u.weight;a.horizontal?(a.width=c?c*r:l&&t.availableWidth,a.height=i):(a.width=r,a.height=c?c*i:l&&t.availableHeight)}return n}function yO(e){const t=fO(e),n=Oo(t.filter(u=>u.box.fullSize),!0),r=Oo(ko(t,"left"),!0),i=Oo(ko(t,"right")),s=Oo(ko(t,"top"),!0),o=Oo(ko(t,"bottom")),a=ty(t,"x"),l=ty(t,"y");return{fullSize:n,leftAndTop:r.concat(s),rightAndBottom:i.concat(l).concat(o).concat(a),chartArea:ko(t,"chartArea"),vertical:r.concat(i).concat(l),horizontal:s.concat(o).concat(a)}}function ny(e,t,n,r){return Math.max(e[n],t[n])+Math.max(e[r],t[r])}function cb(e,t){e.top=Math.max(e.top,t.top),e.left=Math.max(e.left,t.left),e.bottom=Math.max(e.bottom,t.bottom),e.right=Math.max(e.right,t.right)}function mO(e,t,n,r){const{pos:i,box:s}=n,o=e.maxPadding;if(!Ue(i)){n.size&&(e[i]-=n.size);const d=r[n.stack]||{size:0,count:1};d.size=Math.max(d.size,n.horizontal?s.height:s.width),n.size=d.size/d.count,e[i]+=n.size}s.getPadding&&cb(o,s.getPadding());const a=Math.max(0,t.outerWidth-ny(o,e,"left","right")),l=Math.max(0,t.outerHeight-ny(o,e,"top","bottom")),u=a!==e.w,c=l!==e.h;return e.w=a,e.h=l,n.horizontal?{same:u,other:c}:{same:c,other:u}}function pO(e){const t=e.maxPadding;function n(r){const i=Math.max(t[r]-e[r],0);return e[r]+=i,i}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}function vO(e,t){const n=t.maxPadding;function r(i){const s={left:0,top:0,right:0,bottom:0};return i.forEach(o=>{s[o]=Math.max(t[o],n[o])}),s}return r(e?["left","right"]:["top","bottom"])}function Fo(e,t,n,r){const i=[];let s,o,a,l,u,c;for(s=0,o=e.length,u=0;s<o;++s){a=e[s],l=a.box,l.update(a.width||t.w,a.height||t.h,vO(a.horizontal,t));const{same:d,other:f}=mO(t,n,a,r);u|=d&&i.length,c=c||f,l.fullSize||i.push(a)}return u&&Fo(i,t,n,r)||c}function Cl(e,t,n,r,i){e.top=n,e.left=t,e.right=t+r,e.bottom=n+i,e.width=r,e.height=i}function ry(e,t,n,r){const i=n.padding;let{x:s,y:o}=t;for(const a of e){const l=a.box,u=r[a.stack]||{placed:0,weight:1},c=a.stackWeight/u.weight||1;if(a.horizontal){const d=t.w*c,f=u.size||l.height;du(u.start)&&(o=u.start),l.fullSize?Cl(l,i.left,o,n.outerWidth-i.right-i.left,f):Cl(l,t.left+u.placed,o,d,f),u.start=o,u.placed+=d,o=l.bottom}else{const d=t.h*c,f=u.size||l.width;du(u.start)&&(s=u.start),l.fullSize?Cl(l,s,i.top,f,n.outerHeight-i.bottom-i.top):Cl(l,s,t.top+u.placed,f,d),u.start=s,u.placed+=d,s=l.right}}t.x=s,t.y=o}var Tn={addBox(e,t){e.boxes||(e.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(n){t.draw(n)}}]},e.boxes.push(t)},removeBox(e,t){const n=e.boxes?e.boxes.indexOf(t):-1;n!==-1&&e.boxes.splice(n,1)},configure(e,t,n){t.fullSize=n.fullSize,t.position=n.position,t.weight=n.weight},update(e,t,n,r){if(!e)return;const i=Dt(e.options.layout.padding),s=Math.max(t-i.width,0),o=Math.max(n-i.height,0),a=yO(e.boxes),l=a.vertical,u=a.horizontal;et(e.boxes,m=>{typeof m.beforeLayout=="function"&&m.beforeLayout()});const c=l.reduce((m,p)=>p.box.options&&p.box.options.display===!1?m:m+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:n,padding:i,availableWidth:s,availableHeight:o,vBoxMaxWidth:s/2/c,hBoxMaxHeight:o/2}),f=Object.assign({},i);cb(f,Dt(r));const h=Object.assign({maxPadding:f,w:s,h:o,x:i.left,y:i.top},i),y=gO(l.concat(u),d);Fo(a.fullSize,h,d,y),Fo(l,h,d,y),Fo(u,h,d,y)&&Fo(l,h,d,y),pO(h),ry(a.leftAndTop,h,d,y),h.x+=h.w,h.y+=h.h,ry(a.rightAndBottom,h,d,y),e.chartArea={left:h.left,top:h.top,right:h.left+h.w,bottom:h.top+h.h,height:h.h,width:h.w},et(a.chartArea,m=>{const p=m.box;Object.assign(p,e.chartArea),p.update(h.w,h.h,{left:0,top:0,right:0,bottom:0})})}};class db{acquireContext(t,n){}releaseContext(t){return!1}addEventListener(t,n,r){}removeEventListener(t,n,r){}getDevicePixelRatio(){return 1}getMaximumSize(t,n,r,i){return n=Math.max(0,n||t.width),r=r||t.height,{width:n,height:Math.max(0,i?Math.floor(n/i):r)}}isAttached(t){return!0}updateConfig(t){}}class bO extends db{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Ul="$chartjs",xO={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},iy=e=>e===null||e==="";function wO(e,t){const n=e.style,r=e.getAttribute("height"),i=e.getAttribute("width");if(e[Ul]={initial:{height:r,width:i,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",iy(i)){const s=Ug(e,"width");s!==void 0&&(e.width=s)}if(iy(r))if(e.style.height==="")e.height=e.width/(t||2);else{const s=Ug(e,"height");s!==void 0&&(e.height=s)}return e}const fb=Lk?{passive:!0}:!1;function SO(e,t,n){e&&e.addEventListener(t,n,fb)}function CO(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,fb)}function _O(e,t){const n=xO[e.type]||e.type,{x:r,y:i}=wi(e,t);return{type:n,chart:t,native:e,x:r!==void 0?r:null,y:i!==void 0?i:null}}function mu(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function kO(e,t,n){const r=e.canvas,i=new MutationObserver(s=>{let o=!1;for(const a of s)o=o||mu(a.addedNodes,r),o=o&&!mu(a.removedNodes,r);o&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}function OO(e,t,n){const r=e.canvas,i=new MutationObserver(s=>{let o=!1;for(const a of s)o=o||mu(a.removedNodes,r),o=o&&!mu(a.addedNodes,r);o&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}const xa=new Map;let sy=0;function hb(){const e=window.devicePixelRatio;e!==sy&&(sy=e,xa.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function EO(e,t){xa.size||window.addEventListener("resize",hb),xa.set(e,t)}function AO(e){xa.delete(e),xa.size||window.removeEventListener("resize",hb)}function TO(e,t,n){const r=e.canvas,i=r&&ih(r);if(!i)return;const s=K2((a,l)=>{const u=i.clientWidth;n(a,l),u<i.clientWidth&&n()},window),o=new ResizeObserver(a=>{const l=a[0],u=l.contentRect.width,c=l.contentRect.height;u===0&&c===0||s(u,c)});return o.observe(i),EO(e,s),o}function Kc(e,t,n){n&&n.disconnect(),t==="resize"&&AO(e)}function PO(e,t,n){const r=e.canvas,i=K2(s=>{e.ctx!==null&&n(_O(s,e))},e);return SO(r,t,i),i}class jO extends db{acquireContext(t,n){const r=t&&t.getContext&&t.getContext("2d");return r&&r.canvas===t?(wO(t,n),r):null}releaseContext(t){const n=t.canvas;if(!n[Ul])return!1;const r=n[Ul].initial;["height","width"].forEach(s=>{const o=r[s];tt(o)?n.removeAttribute(s):n.setAttribute(s,o)});const i=r.style||{};return Object.keys(i).forEach(s=>{n.style[s]=i[s]}),n.width=n.width,delete n[Ul],!0}addEventListener(t,n,r){this.removeEventListener(t,n);const i=t.$proxies||(t.$proxies={}),o={attach:kO,detach:OO,resize:TO}[n]||PO;i[n]=o(t,n,r)}removeEventListener(t,n){const r=t.$proxies||(t.$proxies={}),i=r[n];if(!i)return;({attach:Kc,detach:Kc,resize:Kc}[n]||CO)(t,n,i),r[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,r,i){return $k(t,n,r,i)}isAttached(t){const n=t&&ih(t);return!!(n&&n.isConnected)}}function MO(e){return!rh()||typeof OffscreenCanvas!="undefined"&&e instanceof OffscreenCanvas?bO:jO}var Ll;let ts=(Ll=class{constructor(){be(this,"x");be(this,"y");be(this,"active",!1);be(this,"options");be(this,"$animations")}tooltipPosition(t){const{x:n,y:r}=this.getProps(["x","y"],t);return{x:n,y:r}}hasValue(){return ba(this.x)&&ba(this.y)}getProps(t,n){const r=this.$animations;if(!n||!r)return this;const i={};return t.forEach(s=>{i[s]=r[s]&&r[s].active()?r[s]._to:this[s]}),i}},be(Ll,"defaults",{}),be(Ll,"defaultRoutes"),Ll);function $O(e,t){const n=e.options.ticks,r=LO(e),i=Math.min(n.maxTicksLimit||r,r),s=n.major.enabled?IO(t):[],o=s.length,a=s[0],l=s[o-1],u=[];if(o>i)return RO(t,u,s,o/i),u;const c=DO(s,t,i);if(o>0){let d,f;const h=o>1?Math.round((l-a)/(o-1)):null;for(_l(t,u,c,tt(h)?0:a-h,a),d=0,f=o-1;d<f;d++)_l(t,u,c,s[d],s[d+1]);return _l(t,u,c,l,tt(h)?t.length:l+h),u}return _l(t,u,c),u}function LO(e){const t=e.options.offset,n=e._tickSize(),r=e._length/n+(t?0:1),i=e._maxLength/n;return Math.floor(Math.min(r,i))}function DO(e,t,n){const r=NO(e),i=t.length/n;if(!r)return Math.max(i,1);const s=A9(r);for(let o=0,a=s.length-1;o<a;o++){const l=s[o];if(l>i)return l}return Math.max(i,1)}function IO(e){const t=[];let n,r;for(n=0,r=e.length;n<r;n++)e[n].major&&t.push(n);return t}function RO(e,t,n,r){let i=0,s=n[0],o;for(r=Math.ceil(r),o=0;o<e.length;o++)o===s&&(t.push(e[o]),i++,s=n[i*r])}function _l(e,t,n,r,i){const s=Be(r,0),o=Math.min(Be(i,e.length),e.length);let a=0,l,u,c;for(n=Math.ceil(n),i&&(l=i-r,n=l/Math.floor(l/n)),c=s;c<0;)a++,c=Math.round(s+a*n);for(u=Math.max(s,0);u<o;u++)u===c&&(t.push(e[u]),a++,c=Math.round(s+a*n))}function NO(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 FO=e=>e==="left"?"right":e==="right"?"left":e,oy=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,ay=(e,t)=>Math.min(t||e,e);function ly(e,t){const n=[],r=e.length/t,i=e.length;let s=0;for(;s<i;s+=r)n.push(e[Math.floor(s)]);return n}function BO(e,t,n){const r=e.ticks.length,i=Math.min(t,r-1),s=e._startPixel,o=e._endPixel,a=1e-6;let l=e.getPixelForTick(i),u;if(!(n&&(r===1?u=Math.max(l-s,o-l):t===0?u=(e.getPixelForTick(1)-l)/2:u=(l-e.getPixelForTick(i-1))/2,l+=i<t?u:-u,l<s-a||l>o+a)))return l}function qO(e,t){et(e,n=>{const r=n.gc,i=r.length/2;let s;if(i>t){for(s=0;s<i;++s)delete n.data[r[s]];r.splice(0,i)}})}function Eo(e){return e.drawTicks?e.tickLength:0}function uy(e,t){if(!e.display)return 0;const n=bt(e.font,t),r=Dt(e.padding);return(ft(e.text)?e.text.length:1)*n.lineHeight+r.height}function zO(e,t){return gi(e,{scale:t,type:"scale"})}function HO(e,t,n){return gi(e,{tick:n,index:t,type:"tick"})}function UO(e,t,n){let r=Xf(e);return(n&&t!=="right"||!n&&t==="right")&&(r=FO(r)),r}function GO(e,t,n,r){const{top:i,left:s,bottom:o,right:a,chart:l}=e,{chartArea:u,scales:c}=l;let d=0,f,h,y;const m=o-i,p=a-s;if(e.isHorizontal()){if(h=Pt(r,s,a),Ue(n)){const v=Object.keys(n)[0],b=n[v];y=c[v].getPixelForValue(b)+m-t}else n==="center"?y=(u.bottom+u.top)/2+m-t:y=oy(e,n,t);f=a-s}else{if(Ue(n)){const v=Object.keys(n)[0],b=n[v];h=c[v].getPixelForValue(b)-p+t}else n==="center"?h=(u.left+u.right)/2-p+t:h=oy(e,n,t);y=Pt(r,o,i),d=n==="left"?-mn:mn}return{titleX:h,titleY:y,maxWidth:f,rotation:d}}class uo extends ts{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,n){return t}getUserBounds(){let{_userMin:t,_userMax:n,_suggestedMin:r,_suggestedMax:i}=this;return t=Qn(t,Number.POSITIVE_INFINITY),n=Qn(n,Number.NEGATIVE_INFINITY),r=Qn(r,Number.POSITIVE_INFINITY),i=Qn(i,Number.NEGATIVE_INFINITY),{min:Qn(t,r),max:Qn(n,i),minDefined:St(t),maxDefined:St(n)}}getMinMax(t){let{min:n,max:r,minDefined:i,maxDefined:s}=this.getUserBounds(),o;if(i&&s)return{min:n,max:r};const a=this.getMatchingVisibleMetas();for(let l=0,u=a.length;l<u;++l)o=a[l].controller.getMinMax(this,t),i||(n=Math.min(n,o.min)),s||(r=Math.max(r,o.max));return n=s&&n>r?r:n,r=i&&n>r?n:r,{min:Qn(n,Qn(r,n)),max:Qn(r,Qn(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(){at(this.options.beforeUpdate,[this])}update(t,n,r){const{beginAtZero:i,grace:s,ticks:o}=this.options,a=o.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=n,this._margins=r=Object.assign({left:0,right:0,top:0,bottom:0},r),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+r.left+r.right:this.height+r.top+r.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=ck(this,s,i),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?ly(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),o.display&&(o.autoSkip||o.source==="auto")&&(this.ticks=$O(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(){at(this.options.afterUpdate,[this])}beforeSetDimensions(){at(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(){at(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),at(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){at(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const n=this.options.ticks;let r,i,s;for(r=0,i=t.length;r<i;r++)s=t[r],s.label=at(n.callback,[s.value,r,t],this)}afterTickToLabelConversion(){at(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){at(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,n=t.ticks,r=ay(this.ticks.length,t.ticks.maxTicksLimit),i=n.minRotation||0,s=n.maxRotation;let o=i,a,l,u;if(!this._isVisible()||!n.display||i>=s||r<=1||!this.isHorizontal()){this.labelRotation=i;return}const c=this._getLabelSizes(),d=c.widest.width,f=c.highest.height,h=An(this.chart.width-d,0,this.maxWidth);a=t.offset?this.maxWidth/r:h/(r-1),d+6>a&&(a=h/(r-(t.offset?.5:1)),l=this.maxHeight-Eo(t.grid)-n.padding-uy(t.title,this.chart.options.font),u=Math.sqrt(d*d+f*f),o=Qf(Math.min(Math.asin(An((c.highest.height+6)/a,-1,1)),Math.asin(An(l/u,-1,1))-Math.asin(An(f/u,-1,1)))),o=Math.max(i,Math.min(s,o))),this.labelRotation=o}afterCalculateLabelRotation(){at(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){at(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:n,options:{ticks:r,title:i,grid:s}}=this,o=this._isVisible(),a=this.isHorizontal();if(o){const l=uy(i,n.options.font);if(a?(t.width=this.maxWidth,t.height=Eo(s)+l):(t.height=this.maxHeight,t.width=Eo(s)+l),r.display&&this.ticks.length){const{first:u,last:c,widest:d,highest:f}=this._getLabelSizes(),h=r.padding*2,y=Jr(this.labelRotation),m=Math.cos(y),p=Math.sin(y);if(a){const v=r.mirror?0:p*d.width+m*f.height;t.height=Math.min(this.maxHeight,t.height+v+h)}else{const v=r.mirror?0:m*d.width+p*f.height;t.width=Math.min(this.maxWidth,t.width+v+h)}this._calculatePadding(u,c,p,m)}}this._handleMargins(),a?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,n,r,i){const{ticks:{align:s,padding:o},position:a}=this.options,l=this.labelRotation!==0,u=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const c=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let f=0,h=0;l?u?(f=i*t.width,h=r*n.height):(f=r*t.height,h=i*n.width):s==="start"?h=n.width:s==="end"?f=t.width:s!=="inner"&&(f=t.width/2,h=n.width/2),this.paddingLeft=Math.max((f-c+o)*this.width/(this.width-c),0),this.paddingRight=Math.max((h-d+o)*this.width/(this.width-d),0)}else{let c=n.height/2,d=t.height/2;s==="start"?(c=0,d=t.height):s==="end"&&(c=n.height,d=0),this.paddingTop=c+o,this.paddingBottom=d+o}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){at(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++)tt(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=ly(r,n)),this._labelSizes=t=this._computeLabelSizes(r,r.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,n,r){const{ctx:i,_longestTextCache:s}=this,o=[],a=[],l=Math.floor(n/ay(n,r));let u=0,c=0,d,f,h,y,m,p,v,b,S,C,x;for(d=0;d<n;d+=l){if(y=t[d].label,m=this._resolveTickFontOptions(d),i.font=p=m.string,v=s[p]=s[p]||{data:{},gc:[]},b=m.lineHeight,S=C=0,!tt(y)&&!ft(y))S=hu(i,v.data,v.gc,S,y),C=b;else if(ft(y))for(f=0,h=y.length;f<h;++f)x=y[f],!tt(x)&&!ft(x)&&(S=hu(i,v.data,v.gc,S,x),C+=b);o.push(S),a.push(C),u=Math.max(S,u),c=Math.max(C,c)}qO(s,n);const k=o.indexOf(u),w=a.indexOf(c),_=O=>({width:o[O]||0,height:a[O]||0});return{first:_(0),last:_(n-1),widest:_(k),highest:_(w),widths:o,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,n){return NaN}getValueForPixel(t){}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const n=this._startPixel+t*this._length;return L9(this._alignToPixels?vi(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=HO(this.getContext(),t,r))}return this.$context||(this.$context=zO(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,n=Jr(this.labelRotation),r=Math.abs(Math.cos(n)),i=Math.abs(Math.sin(n)),s=this._getLabelSizes(),o=t.autoSkipPadding||0,a=s?s.widest.width+o:0,l=s?s.highest.height+o:0;return this.isHorizontal()?l*r>a*i?a/r:l/i:l*i<a*r?l/r:a/i}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const n=this.axis,r=this.chart,i=this.options,{grid:s,position:o,border:a}=i,l=s.offset,u=this.isHorizontal(),d=this.ticks.length+(l?1:0),f=Eo(s),h=[],y=a.setContext(this.getContext()),m=y.display?y.width:0,p=m/2,v=function(M){return vi(r,M,m)};let b,S,C,x,k,w,_,O,A,T,j,B;if(o==="top")b=v(this.bottom),w=this.bottom-f,O=b-p,T=v(t.top)+p,B=t.bottom;else if(o==="bottom")b=v(this.top),T=t.top,B=v(t.bottom)-p,w=b+p,O=this.top+f;else if(o==="left")b=v(this.right),k=this.right-f,_=b-p,A=v(t.left)+p,j=t.right;else if(o==="right")b=v(this.left),A=t.left,j=v(t.right)-p,k=b+p,_=this.left+f;else if(n==="x"){if(o==="center")b=v((t.top+t.bottom)/2+.5);else if(Ue(o)){const M=Object.keys(o)[0],I=o[M];b=v(this.chart.scales[M].getPixelForValue(I))}T=t.top,B=t.bottom,w=b+p,O=w+f}else if(n==="y"){if(o==="center")b=v((t.left+t.right)/2);else if(Ue(o)){const M=Object.keys(o)[0],I=o[M];b=v(this.chart.scales[M].getPixelForValue(I))}k=b-p,_=k-f,A=t.left,j=t.right}const R=Be(i.ticks.maxTicksLimit,d),P=Math.max(1,Math.ceil(d/R));for(S=0;S<d;S+=P){const M=this.getContext(S),I=s.setContext(M),G=a.setContext(M),Y=I.lineWidth,q=I.color,U=G.dash||[],z=G.dashOffset,V=I.tickWidth,N=I.tickColor,ne=I.tickBorderDash||[],J=I.tickBorderDashOffset;C=BO(this,S,l),C!==void 0&&(x=vi(r,C,Y),u?k=_=A=j=x:w=O=T=B=x,h.push({tx1:k,ty1:w,tx2:_,ty2:O,x1:A,y1:T,x2:j,y2:B,width:Y,color:q,borderDash:U,borderDashOffset:z,tickWidth:V,tickColor:N,tickBorderDash:ne,tickBorderDashOffset:J}))}return this._ticksLength=d,this._borderValue=b,h}_computeLabelItems(t){const n=this.axis,r=this.options,{position:i,ticks:s}=r,o=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:u,padding:c,mirror:d}=s,f=Eo(r.grid),h=f+c,y=d?-c:h,m=-Jr(this.labelRotation),p=[];let v,b,S,C,x,k,w,_,O,A,T,j,B="middle";if(i==="top")k=this.bottom-y,w=this._getXAxisLabelAlignment();else if(i==="bottom")k=this.top+y,w=this._getXAxisLabelAlignment();else if(i==="left"){const P=this._getYAxisLabelAlignment(f);w=P.textAlign,x=P.x}else if(i==="right"){const P=this._getYAxisLabelAlignment(f);w=P.textAlign,x=P.x}else if(n==="x"){if(i==="center")k=(t.top+t.bottom)/2+h;else if(Ue(i)){const P=Object.keys(i)[0],M=i[P];k=this.chart.scales[P].getPixelForValue(M)+h}w=this._getXAxisLabelAlignment()}else if(n==="y"){if(i==="center")x=(t.left+t.right)/2-h;else if(Ue(i)){const P=Object.keys(i)[0],M=i[P];x=this.chart.scales[P].getPixelForValue(M)}w=this._getYAxisLabelAlignment(f).textAlign}n==="y"&&(l==="start"?B="top":l==="end"&&(B="bottom"));const R=this._getLabelSizes();for(v=0,b=a.length;v<b;++v){S=a[v],C=S.label;const P=s.setContext(this.getContext(v));_=this.getPixelForTick(v)+s.labelOffset,O=this._resolveTickFontOptions(v),A=O.lineHeight,T=ft(C)?C.length:1;const M=T/2,I=P.color,G=P.textStrokeColor,Y=P.textStrokeWidth;let q=w;o?(x=_,w==="inner"&&(v===b-1?q=this.options.reverse?"left":"right":v===0?q=this.options.reverse?"right":"left":q="center"),i==="top"?u==="near"||m!==0?j=-T*A+A/2:u==="center"?j=-R.highest.height/2-M*A+A:j=-R.highest.height+A/2:u==="near"||m!==0?j=A/2:u==="center"?j=R.highest.height/2-M*A:j=R.highest.height-T*A,d&&(j*=-1),m!==0&&!P.showLabelBackdrop&&(x+=A/2*Math.sin(m))):(k=_,j=(1-T)*A/2);let U;if(P.showLabelBackdrop){const z=Dt(P.backdropPadding),V=R.heights[v],N=R.widths[v];let ne=j-z.top,J=0-z.left;switch(B){case"middle":ne-=V/2;break;case"bottom":ne-=V;break}switch(w){case"center":J-=N/2;break;case"right":J-=N;break;case"inner":v===b-1?J-=N:v>0&&(J-=N/2);break}U={left:J,top:ne,width:N+z.width,height:V+z.height,color:P.backdropColor}}p.push({label:C,font:O,textOffset:j,options:{rotation:m,color:I,strokeColor:G,strokeWidth:Y,textAlign:q,textBaseline:B,translation:[x,k],backdrop:U}})}return p}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-Jr(this.labelRotation))return t==="top"?"left":"right";let i="center";return n.align==="start"?i="left":n.align==="end"?i="right":n.align==="inner"&&(i="inner"),i}_getYAxisLabelAlignment(t){const{position:n,ticks:{crossAlign:r,mirror:i,padding:s}}=this.options,o=this._getLabelSizes(),a=t+s,l=o.widest.width;let u,c;return n==="left"?i?(c=this.right+s,r==="near"?u="left":r==="center"?(u="center",c+=l/2):(u="right",c+=l)):(c=this.right-a,r==="near"?u="right":r==="center"?(u="center",c-=l/2):(u="left",c=this.left)):n==="right"?i?(c=this.left+s,r==="near"?u="right":r==="center"?(u="center",c-=l/2):(u="left",c-=l)):(c=this.left+a,r==="near"?u="left":r==="center"?(u="center",c+=l/2):(u="right",c=this.right)):u="right",{textAlign:u,x:c}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,n=this.options.position;if(n==="left"||n==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(n==="top"||n==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:n},left:r,top:i,width:s,height:o}=this;n&&(t.save(),t.fillStyle=n,t.fillRect(r,i,s,o),t.restore())}getLineWidthForValue(t){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const i=this.ticks.findIndex(s=>s.value===t);return i>=0?n.setContext(this.getContext(i)).lineWidth:0}drawGrid(t){const n=this.options.grid,r=this.ctx,i=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let s,o;const a=(l,u,c)=>{!c.width||!c.color||(r.save(),r.lineWidth=c.width,r.strokeStyle=c.color,r.setLineDash(c.borderDash||[]),r.lineDashOffset=c.borderDashOffset,r.beginPath(),r.moveTo(l.x,l.y),r.lineTo(u.x,u.y),r.stroke(),r.restore())};if(n.display)for(s=0,o=i.length;s<o;++s){const l=i[s];n.drawOnChartArea&&a({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),n.drawTicks&&a({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:n,options:{border:r,grid:i}}=this,s=r.setContext(this.getContext()),o=r.display?s.width:0;if(!o)return;const a=i.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let u,c,d,f;this.isHorizontal()?(u=vi(t,this.left,o)-o/2,c=vi(t,this.right,a)+a/2,d=f=l):(d=vi(t,this.top,o)-o/2,f=vi(t,this.bottom,a)+a/2,u=c=l),n.save(),n.lineWidth=s.width,n.strokeStyle=s.color,n.beginPath(),n.moveTo(u,d),n.lineTo(c,f),n.stroke(),n.restore()}drawLabels(t){if(!this.options.ticks.display)return;const r=this.ctx,i=this._computeLabelArea();i&&Yu(r,i);const s=this.getLabelItems(t);for(const o of s){const a=o.options,l=o.font,u=o.label,c=o.textOffset;Vi(r,u,0,c,l,a)}i&&Xu(r)}drawTitle(){const{ctx:t,options:{position:n,title:r,reverse:i}}=this;if(!r.display)return;const s=bt(r.font),o=Dt(r.padding),a=r.align;let l=s.lineHeight/2;n==="bottom"||n==="center"||Ue(n)?(l+=o.bottom,ft(r.text)&&(l+=s.lineHeight*(r.text.length-1))):l+=o.top;const{titleX:u,titleY:c,maxWidth:d,rotation:f}=GO(this,l,n,a);Vi(t,r.text,0,0,s,{color:r.color,maxWidth:d,rotation:f,textAlign:UO(a,n,i),textBaseline:"middle",translation:[u,c]})}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=Be(t.grid&&t.grid.z,-1),i=Be(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==uo.prototype.draw?[{z:n,draw:s=>{this.draw(s)}}]:[{z:r,draw:s=>{this.drawBackground(),this.drawGrid(s),this.drawTitle()}},{z:i,draw:()=>{this.drawBorder()}},{z:n,draw:s=>{this.drawLabels(s)}}]}getMatchingVisibleMetas(t){const n=this.chart.getSortedVisibleDatasetMetas(),r=this.axis+"AxisID",i=[];let s,o;for(s=0,o=n.length;s<o;++s){const a=n[s];a[r]===this.id&&(!t||a.type===t)&&i.push(a)}return i}_resolveTickFontOptions(t){const n=this.options.ticks.setContext(this.getContext(t));return bt(n.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class kl{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;WO(n)&&(r=this.register(n));const i=this.items,s=t.id,o=this.scope+"."+s;if(!s)throw new Error("class does not have id: "+t);return s in i||(i[s]=t,KO(t,o,r),this.override&&yt.override(t.id,t.overrides)),o}get(t){return this.items[t]}unregister(t){const n=this.items,r=t.id,i=this.scope;r in n&&delete n[r],i&&r in yt[i]&&(delete yt[i][r],this.override&&delete Ki[r])}}function KO(e,t,n){const r=pa(Object.create(null),[n?yt.get(n):{},yt.get(t),e.defaults]);yt.set(t,r),e.defaultRoutes&&VO(t,e.defaultRoutes),e.descriptors&&yt.describe(t,e.descriptors)}function VO(e,t){Object.keys(t).forEach(n=>{const r=n.split("."),i=r.pop(),s=[e].concat(r).join("."),o=t[n].split("."),a=o.pop(),l=o.join(".");yt.route(s,i,l,a)})}function WO(e){return"id"in e&&"defaults"in e}class QO{constructor(){this.controllers=new kl(vs,"datasets",!0),this.elements=new kl(ts,"elements"),this.plugins=new kl(Object,"plugins"),this.scales=new kl(uo,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,n,r){[...n].forEach(i=>{const s=r||this._getRegistryForType(i);r||s.isForType(i)||s===this.plugins&&i.id?this._exec(t,s,i):et(i,o=>{const a=r||this._getRegistryForType(o);this._exec(t,a,o)})})}_exec(t,n,r){const i=Wf(t);at(r["before"+i],[],r),n[t](r),at(r["after"+i],[],r)}_getRegistryForType(t){for(let n=0;n<this._typedRegistries.length;n++){const r=this._typedRegistries[n];if(r.isForType(t))return r}return this.plugins}_get(t,n,r){const i=n.get(t);if(i===void 0)throw new Error('"'+t+'" is not a registered '+r+".");return i}}var Zn=new QO;class YO{constructor(){this._init=[]}notify(t,n,r,i){n==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const s=i?this._descriptors(t).filter(i):this._descriptors(t),o=this._notify(s,t,n,r);return n==="afterDestroy"&&(this._notify(s,t,"stop"),this._notify(this._init,t,"uninstall")),o}_notify(t,n,r,i){i=i||{};for(const s of t){const o=s.plugin,a=o[r],l=[n,i,s.options];if(at(a,l,o)===!1&&i.cancelable)return!1}return!0}invalidate(){tt(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const n=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),n}_createDescriptors(t,n){const r=t&&t.config,i=Be(r.options&&r.options.plugins,{}),s=XO(r);return i===!1&&!n?[]:JO(t,s,i,n)}_notifyStateChanges(t){const n=this._oldCache||[],r=this._cache,i=(s,o)=>s.filter(a=>!o.some(l=>a.plugin.id===l.plugin.id));this._notify(i(n,r),t,"stop"),this._notify(i(r,n),t,"start")}}function XO(e){const t={},n=[],r=Object.keys(Zn.plugins.items);for(let s=0;s<r.length;s++)n.push(Zn.getPlugin(r[s]));const i=e.plugins||[];for(let s=0;s<i.length;s++){const o=i[s];n.indexOf(o)===-1&&(n.push(o),t[o.id]=!0)}return{plugins:n,localIds:t}}function ZO(e,t){return!t&&e===!1?null:e===!0?{}:e}function JO(e,{plugins:t,localIds:n},r,i){const s=[],o=e.getContext();for(const a of t){const l=a.id,u=ZO(r[l],i);u!==null&&s.push({plugin:a,options:eE(e.config,{plugin:a,local:n[l]},u,o)})}return s}function eE(e,{plugin:t,local:n},r,i){const s=e.pluginScopeKeys(t),o=e.getOptionScopes(r,s);return n&&t.defaults&&o.push(t.defaults),e.createResolver(o,i,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Qd(e,t){const n=yt.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function tE(e,t){let n=e;return e==="_index_"?n=t:e==="_value_"&&(n=t==="x"?"y":"x"),n}function nE(e,t){return e===t?"_index_":"_value_"}function cy(e){if(e==="x"||e==="y"||e==="r")return e}function rE(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function Yd(e,...t){if(cy(e))return e;for(const n of t){const r=n.axis||rE(n.position)||e.length>1&&cy(e[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function dy(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function iE(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 dy(e,"x",n[0])||dy(e,"y",n[0])}return{}}function sE(e,t){const n=Ki[e.type]||{scales:{}},r=t.scales||{},i=Qd(e.type,t),s=Object.create(null);return Object.keys(r).forEach(o=>{const a=r[o];if(!Ue(a))return console.error(`Invalid scale configuration for scale: ${o}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${o}`);const l=Yd(o,a,iE(o,e),yt.scales[a.type]),u=nE(l,i),c=n.scales||{};s[o]=Qo(Object.create(null),[{axis:l},a,c[l],c[u]])}),e.data.datasets.forEach(o=>{const a=o.type||e.type,l=o.indexAxis||Qd(a,t),c=(Ki[a]||{}).scales||{};Object.keys(c).forEach(d=>{const f=tE(d,l),h=o[f+"AxisID"]||f;s[h]=s[h]||Object.create(null),Qo(s[h],[{axis:f},r[h],c[d]])})}),Object.keys(s).forEach(o=>{const a=s[o];Qo(a,[yt.scales[a.type],yt.scale])}),s}function gb(e){const t=e.options||(e.options={});t.plugins=Be(t.plugins,{}),t.scales=sE(e,t)}function yb(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function oE(e){return e=e||{},e.data=yb(e.data),gb(e),e}const fy=new Map,mb=new Set;function Ol(e,t){let n=fy.get(e);return n||(n=t(),fy.set(e,n),mb.add(n)),n}const Ao=(e,t,n)=>{const r=va(t,n);r!==void 0&&e.add(r)};class aE{constructor(t){this._config=oE(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=yb(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(),gb(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Ol(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return Ol(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return Ol(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,r=this.type;return Ol(`${r}-plugin-${n}`,()=>[[`plugins.${n}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,n){const r=this._scopeCache;let i=r.get(t);return(!i||n)&&(i=new Map,r.set(t,i)),i}getOptionScopes(t,n,r){const{options:i,type:s}=this,o=this._cachedScopes(t,r),a=o.get(n);if(a)return a;const l=new Set;n.forEach(c=>{t&&(l.add(t),c.forEach(d=>Ao(l,t,d))),c.forEach(d=>Ao(l,i,d)),c.forEach(d=>Ao(l,Ki[s]||{},d)),c.forEach(d=>Ao(l,yt,d)),c.forEach(d=>Ao(l,Vd,d))});const u=Array.from(l);return u.length===0&&u.push(Object.create(null)),mb.has(n)&&o.set(n,u),u}chartOptionScopes(){const{options:t,type:n}=this;return[t,Ki[n]||{},yt.datasets[n]||{},{type:n},yt,Vd]}resolveNamedOptions(t,n,r,i=[""]){const s={$shared:!0},{resolver:o,subPrefixes:a}=hy(this._resolverCache,t,i);let l=o;if(uE(o,n)){s.$shared=!1,r=ai(r)?r():r;const u=this.createResolver(t,r,a);l=Zs(o,r,u)}for(const u of n)s[u]=l[u];return s}createResolver(t,n,r=[""],i){const{resolver:s}=hy(this._resolverCache,t,r);return Ue(n)?Zs(s,n,void 0,i):s}}function hy(e,t,n){let r=e.get(t);r||(r=new Map,e.set(t,r));const i=n.join();let s=r.get(i);return s||(s={resolver:eh(t,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},r.set(i,s)),s}const lE=e=>Ue(e)&&Object.getOwnPropertyNames(e).some(t=>ai(e[t]));function uE(e,t){const{isScriptable:n,isIndexable:r}=Y2(e);for(const i of t){const s=n(i),o=r(i),a=(o||s)&&e[i];if(s&&(ai(a)||lE(a))||o&&ft(a))return!0}return!1}var cE="4.5.0";const dE=["top","bottom","left","right","chartArea"];function gy(e,t){return e==="top"||e==="bottom"||dE.indexOf(e)===-1&&t==="x"}function yy(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}function my(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),at(n&&n.onComplete,[e],t)}function fE(e){const t=e.chart,n=t.options.animation;at(n&&n.onProgress,[e],t)}function pb(e){return rh()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const Gl={},py=e=>{const t=pb(e);return Object.values(Gl).filter(n=>n.canvas===t).pop()};function hE(e,t,n){const r=Object.keys(e);for(const i of r){const s=+i;if(s>=t){const o=e[i];delete e[i],(n>0||s>t)&&(e[s+n]=o)}}}function gE(e,t,n,r){return!n||e.type==="mouseout"?null:r?t:e}var Fr;let ec=(Fr=class{static register(...t){Zn.add(...t),vy()}static unregister(...t){Zn.remove(...t),vy()}constructor(t,n){const r=this.config=new aE(n),i=pb(t),s=py(i);if(s)throw new Error("Canvas is already in use. Chart with ID '"+s.id+"' must be destroyed before the canvas with ID '"+s.canvas.id+"' can be reused.");const o=r.createResolver(r.chartOptionScopes(),this.getContext());this.platform=new(r.platform||MO(i)),this.platform.updateConfig(r);const a=this.platform.acquireContext(i,o.aspectRatio),l=a&&a.canvas,u=l&&l.height,c=l&&l.width;if(this.id=b9(),this.ctx=a,this.canvas=l,this.width=c,this.height=u,this._options=o,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new YO,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=F9(d=>this.update(d),o.resizeDelay||0),this._dataChanges=[],Gl[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}yr.listen(this,"complete",my),yr.listen(this,"progress",fE),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:r,height:i,_aspectRatio:s}=this;return tt(t)?n&&s?s:i?r/i:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return Zn}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Hg(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Bg(this.canvas,this.ctx),this}stop(){return yr.stop(this),this}resize(t,n){yr.running(this)?this._resizeBeforeDraw={width:t,height:n}:this._resize(t,n)}_resize(t,n){const r=this.options,i=this.canvas,s=r.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(i,t,n,s),a=r.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,Hg(this,a,!0)&&(this.notifyPlugins("resize",{size:o}),at(r.onResize,[this,o],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};et(n,(r,i)=>{r.id=i})}buildOrUpdateScales(){const t=this.options,n=t.scales,r=this.scales,i=Object.keys(r).reduce((o,a)=>(o[a]=!1,o),{});let s=[];n&&(s=s.concat(Object.keys(n).map(o=>{const a=n[o],l=Yd(o,a),u=l==="r",c=l==="x";return{options:a,dposition:u?"chartArea":c?"bottom":"left",dtype:u?"radialLinear":c?"category":"linear"}}))),et(s,o=>{const a=o.options,l=a.id,u=Yd(l,a),c=Be(a.type,o.dtype);(a.position===void 0||gy(a.position,u)!==gy(o.dposition))&&(a.position=o.dposition),i[l]=!0;let d=null;if(l in r&&r[l].type===c)d=r[l];else{const f=Zn.getScale(c);d=new f({id:l,type:c,ctx:this.ctx,chart:this}),r[d.id]=d}d.init(a,t)}),et(i,(o,a)=>{o||delete r[a]}),et(r,o=>{Tn.configure(this,o,o.options),Tn.addBox(this,o)})}_updateMetasets(){const t=this._metasets,n=this.data.datasets.length,r=t.length;if(t.sort((i,s)=>i.index-s.index),r>n){for(let i=n;i<r;++i)this._destroyDatasetMeta(i);t.splice(n,r-n)}this._sortedMetasets=t.slice(0).sort(yy("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:n}}=this;t.length>n.length&&delete this._stacks,t.forEach((r,i)=>{n.filter(s=>s===r._dataset).length===0&&this._destroyDatasetMeta(i)})}buildOrUpdateControllers(){const t=[],n=this.data.datasets;let r,i;for(this._removeUnreferencedMetasets(),r=0,i=n.length;r<i;r++){const s=n[r];let o=this.getDatasetMeta(r);const a=s.type||this.config.type;if(o.type&&o.type!==a&&(this._destroyDatasetMeta(r),o=this.getDatasetMeta(r)),o.type=a,o.indexAxis=s.indexAxis||Qd(a,this.options),o.order=s.order||0,o.index=r,o.label=""+s.label,o.visible=this.isDatasetVisible(r),o.controller)o.controller.updateIndex(r),o.controller.linkScales();else{const l=Zn.getController(a),{datasetElementType:u,dataElementType:c}=yt.datasets[a];Object.assign(l,{dataElementType:Zn.getElement(c),datasetElementType:u&&Zn.getElement(u)}),o.controller=new l(this,r),t.push(o.controller)}}return this._updateMetasets(),t}_resetElements(){et(this.data.datasets,(t,n)=>{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const n=this.config;n.update();const r=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),i=this._animationsDisabled=!r.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const s=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let u=0,c=this.data.datasets.length;u<c;u++){const{controller:d}=this.getDatasetMeta(u),f=!i&&s.indexOf(d)===-1;d.buildOrUpdateElements(f),o=Math.max(+d.getMaxOverflow(),o)}o=this._minPadding=r.layout.autoPadding?o:0,this._updateLayout(o),i||et(s,u=>{u.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(yy("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){et(this.scales,t=>{Tn.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),r=new Set(t.events);(!jg(n,r)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,n=this._getUniformDataChanges()||[];for(const{method:r,start:i,count:s}of n){const o=r==="_removeElements"?-s:s;hE(t,i,o)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const n=this.data.datasets.length,r=s=>new Set(t.filter(o=>o[0]===s).map((o,a)=>a+","+o.splice(1).join(","))),i=r(0);for(let s=1;s<n;s++)if(!jg(i,r(s)))return;return Array.from(i).map(s=>s.split(",")).map(s=>({method:s[1],start:+s[2],count:+s[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;Tn.update(this,this.width,this.height,t);const n=this.chartArea,r=n.width<=0||n.height<=0;this._layers=[],et(this.boxes,i=>{r&&i.position==="chartArea"||(i.configure&&i.configure(),this._layers.push(...i._layers()))},this),this._layers.forEach((i,s)=>{i._idx=s}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let n=0,r=this.data.datasets.length;n<r;++n)this.getDatasetMeta(n).controller.configure();for(let n=0,r=this.data.datasets.length;n<r;++n)this._updateDataset(n,ai(t)?t({datasetIndex:n}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,n){const r=this.getDatasetMeta(t),i={meta:r,index:t,mode:n,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",i)!==!1&&(r.controller._update(n),i.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",i))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(yr.has(this)?this.attached&&!yr.running(this)&&yr.start(this):(this.draw(),my({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:r,height:i}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(r,i)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const n=this._layers;for(t=0;t<n.length&&n[t].z<=0;++t)n[t].draw(this.chartArea);for(this._drawDatasets();t<n.length;++t)n[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const n=this._sortedMetasets,r=[];let i,s;for(i=0,s=n.length;i<s;++i){const o=n[i];(!t||o.visible)&&r.push(o)}return r}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let n=t.length-1;n>=0;--n)this._drawDataset(t[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const n=this.ctx,r={meta:t,index:t.index,cancelable:!0},i=ob(this,t);this.notifyPlugins("beforeDatasetDraw",r)!==!1&&(i&&Yu(n,i),t.controller.draw(),i&&Xu(n),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(t){return Cr(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,r,i){const s=dO.modes[n];return typeof s=="function"?s(this,t,r,i):[]}getDatasetMeta(t){const n=this.data.datasets[t],r=this._metasets;let i=r.filter(s=>s&&s._dataset===n).pop();return i||(i={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n&&n.order||0,index:t,_dataset:n,_parsed:[],_sorted:!1},r.push(i)),i}getContext(){return this.$context||(this.$context=gi(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const n=this.data.datasets[t];if(!n)return!1;const r=this.getDatasetMeta(t);return typeof r.hidden=="boolean"?!r.hidden:!n.hidden}setDatasetVisibility(t,n){const r=this.getDatasetMeta(t);r.hidden=!n}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,n,r){const i=r?"show":"hide",s=this.getDatasetMeta(t),o=s.controller._resolveAnimations(void 0,i);du(n)?(s.data[n].hidden=!r,this.update()):(this.setDatasetVisibility(t,r),o.update(s,{visible:r}),this.update(a=>a.datasetIndex===t?i:void 0))}hide(t,n){this._updateVisibility(t,n,!1)}show(t,n){this._updateVisibility(t,n,!0)}_destroyDatasetMeta(t){const n=this._metasets[t];n&&n.controller&&n.controller._destroy(),delete this._metasets[t]}_stop(){let t,n;for(this.stop(),yr.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(),Bg(t,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete Gl[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,n=this.platform,r=(s,o)=>{n.addEventListener(this,s,o),t[s]=o},i=(s,o,a)=>{s.offsetX=o,s.offsetY=a,this._eventHandler(s)};et(this.options.events,s=>r(s,i))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,n=this.platform,r=(l,u)=>{n.addEventListener(this,l,u),t[l]=u},i=(l,u)=>{t[l]&&(n.removeEventListener(this,l,u),delete t[l])},s=(l,u)=>{this.canvas&&this.resize(l,u)};let o;const a=()=>{i("attach",a),this.attached=!0,this.resize(),r("resize",s),r("detach",o)};o=()=>{this.attached=!1,i("resize",s),this._stop(),this._resize(0,0),r("attach",a)},n.isAttached(this.canvas)?a():o()}unbindEvents(){et(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},et(this._responsiveListeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,n,r){const i=r?"set":"remove";let s,o,a,l;for(n==="dataset"&&(s=this.getDatasetMeta(t[0].datasetIndex),s.controller["_"+i+"DatasetHoverStyle"]()),a=0,l=t.length;a<l;++a){o=t[a];const u=o&&this.getDatasetMeta(o.datasetIndex).controller;u&&u[i+"HoverStyle"](o.element,o.datasetIndex,o.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const n=this._active||[],r=t.map(({datasetIndex:s,index:o})=>{const a=this.getDatasetMeta(s);if(!a)throw new Error("No dataset found at index "+s);return{datasetIndex:s,element:a.data[o],index:o}});!uu(r,n)&&(this._active=r,this._lastEvent=null,this._updateHoverStyles(r,n))}notifyPlugins(t,n,r){return this._plugins.notify(this,t,n,r)}isPluginEnabled(t){return this._plugins._cache.filter(n=>n.plugin.id===t).length===1}_updateHoverStyles(t,n,r){const i=this.options.hover,s=(l,u)=>l.filter(c=>!u.some(d=>c.datasetIndex===d.datasetIndex&&c.index===d.index)),o=s(n,t),a=r?t:s(t,n);o.length&&this.updateHoverStyle(o,i.mode,!1),a.length&&i.mode&&this.updateHoverStyle(a,i.mode,!0)}_eventHandler(t,n){const r={event:t,replay:n,cancelable:!0,inChartArea:this.isPointInArea(t)},i=o=>(o.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",r,i)===!1)return;const s=this._handleEvent(t,n,r.inChartArea);return r.cancelable=!1,this.notifyPlugins("afterEvent",r,i),(s||r.changed)&&this.render(),this}_handleEvent(t,n,r){const{_active:i=[],options:s}=this,o=n,a=this._getActiveElements(t,i,r,o),l=k9(t),u=gE(t,this._lastEvent,r,l);r&&(this._lastEvent=null,at(s.onHover,[t,a,this],this),l&&at(s.onClick,[t,a,this],this));const c=!uu(a,i);return(c||n)&&(this._active=a,this._updateHoverStyles(a,i,n)),this._lastEvent=u,c}_getActiveElements(t,n,r,i){if(t.type==="mouseout")return[];if(!r)return n;const s=this.options.hover;return this.getElementsAtEventForMode(t,s.mode,s,i)}},be(Fr,"defaults",yt),be(Fr,"instances",Gl),be(Fr,"overrides",Ki),be(Fr,"registry",Zn),be(Fr,"version",cE),be(Fr,"getChart",py),Fr);function vy(){return et(ec.instances,e=>e._plugins.invalidate())}function vb(e,t,n=t){e.lineCap=Be(n.borderCapStyle,t.borderCapStyle),e.setLineDash(Be(n.borderDash,t.borderDash)),e.lineDashOffset=Be(n.borderDashOffset,t.borderDashOffset),e.lineJoin=Be(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=Be(n.borderWidth,t.borderWidth),e.strokeStyle=Be(n.borderColor,t.borderColor)}function yE(e,t,n){e.lineTo(n.x,n.y)}function mE(e){return e.stepped?ek:e.tension||e.cubicInterpolationMode==="monotone"?tk:yE}function bb(e,t,n={}){const r=e.length,{start:i=0,end:s=r-1}=n,{start:o,end:a}=t,l=Math.max(i,o),u=Math.min(s,a),c=i<o&&s<o||i>a&&s>a;return{count:r,start:l,loop:t.loop,ilen:u<l&&!c?r+u-l:u-l}}function pE(e,t,n,r){const{points:i,options:s}=t,{count:o,start:a,loop:l,ilen:u}=bb(i,n,r),c=mE(s);let{move:d=!0,reverse:f}=r||{},h,y,m;for(h=0;h<=u;++h)y=i[(a+(f?u-h:h))%o],!y.skip&&(d?(e.moveTo(y.x,y.y),d=!1):c(e,m,y,f,s.stepped),m=y);return l&&(y=i[(a+(f?u:0))%o],c(e,m,y,f,s.stepped)),!!l}function vE(e,t,n,r){const i=t.points,{count:s,start:o,ilen:a}=bb(i,n,r),{move:l=!0,reverse:u}=r||{};let c=0,d=0,f,h,y,m,p,v;const b=C=>(o+(u?a-C:C))%s,S=()=>{m!==p&&(e.lineTo(c,p),e.lineTo(c,m),e.lineTo(c,v))};for(l&&(h=i[b(0)],e.moveTo(h.x,h.y)),f=0;f<=a;++f){if(h=i[b(f)],h.skip)continue;const C=h.x,x=h.y,k=C|0;k===y?(x<m?m=x:x>p&&(p=x),c=(d*c+C)/++d):(S(),e.lineTo(C,x),y=k,d=0,m=p=x),v=x}S()}function Xd(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?vE:pE}function bE(e){return e.stepped?Dk:e.tension||e.cubicInterpolationMode==="monotone"?Ik:Si}function xE(e,t,n,r){let i=t._path;i||(i=t._path=new Path2D,t.path(i,n,r)&&i.closePath()),vb(e,t.options),e.stroke(i)}function wE(e,t,n,r){const{segments:i,options:s}=t,o=Xd(t);for(const a of i)vb(e,s,a.style),e.beginPath(),o(e,t,a,{start:n,end:n+r-1})&&e.closePath(),e.stroke()}const SE=typeof Path2D=="function";function CE(e,t,n,r){SE&&!t.options.segment?xE(e,t,n,r):wE(e,t,n,r)}class ei extends ts{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,n){const r=this.options;if((r.tension||r.cubicInterpolationMode==="monotone")&&!r.stepped&&!this._pointsUpdated){const i=r.spanGaps?this._loop:this._fullLoop;Ek(this._points,r,t,i,n),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=zk(this,this.options.segment))}first(){const t=this.segments,n=this.points;return t.length&&n[t[0].start]}last(){const t=this.segments,n=this.points,r=t.length;return r&&n[t[r-1].end]}interpolate(t,n){const r=this.options,i=t[n],s=this.points,o=sb(this,{property:n,start:i,end:i});if(!o.length)return;const a=[],l=bE(r);let u,c;for(u=0,c=o.length;u<c;++u){const{start:d,end:f}=o[u],h=s[d],y=s[f];if(h===y){a.push(h);continue}const m=Math.abs((i-h[n])/(y[n]-h[n])),p=l(h,y,m,r.stepped);p[n]=t[n],a.push(p)}return a.length===1?a[0]:a}pathSegment(t,n,r){return Xd(this)(t,this,n,r)}path(t,n,r){const i=this.segments,s=Xd(this);let o=this._loop;n=n||0,r=r||this.points.length-n;for(const a of i)o&=s(t,this,a,{start:n,end:n+r-1});return!!o}draw(t,n,r,i){const s=this.options||{};(this.points||[]).length&&s.borderWidth&&(t.save(),CE(t,this,r,i),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}be(ei,"id","line"),be(ei,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),be(ei,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),be(ei,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function by(e,t,n,r){const i=e.options,{[n]:s}=e.getProps([n],r);return Math.abs(t-s)<i.radius+i.hitRadius}class Kl extends ts{constructor(n){super();be(this,"parsed");be(this,"skip");be(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,n&&Object.assign(this,n)}inRange(n,r,i){const s=this.options,{x:o,y:a}=this.getProps(["x","y"],i);return Math.pow(n-o,2)+Math.pow(r-a,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(n,r){return by(this,n,"x",r)}inYRange(n,r){return by(this,n,"y",r)}getCenterPoint(n){const{x:r,y:i}=this.getProps(["x","y"],n);return{x:r,y:i}}size(n){n=n||this.options||{};let r=n.radius||0;r=Math.max(r,r&&n.hoverRadius||0);const i=r&&n.borderWidth||0;return(r+i)*2}draw(n,r){const i=this.options;this.skip||i.radius<.1||!Cr(this,r,this.size(i)/2)||(n.strokeStyle=i.borderColor,n.lineWidth=i.borderWidth,n.fillStyle=i.backgroundColor,Wd(n,i,this.x,this.y))}getRange(){const n=this.options||{};return n.radius+n.hitRadius}}be(Kl,"id","point"),be(Kl,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),be(Kl,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function _E(e,t,n){const r=e.segments,i=e.points,s=t.points,o=[];for(const a of r){let{start:l,end:u}=a;u=tc(l,u,i);const c=Zd(n,i[l],i[u],a.loop);if(!t.segments){o.push({source:a,target:c,start:i[l],end:i[u]});continue}const d=sb(t,c);for(const f of d){const h=Zd(n,s[f.start],s[f.end],f.loop),y=ib(a,i,h);for(const m of y)o.push({source:m,target:f,start:{[n]:xy(c,h,"start",Math.max)},end:{[n]:xy(c,h,"end",Math.min)}})}}return o}function Zd(e,t,n,r){if(r)return;let i=t[e],s=n[e];return e==="angle"&&(i=hn(i),s=hn(s)),{property:e,start:i,end:s}}function kE(e,t){const{x:n=null,y:r=null}=e||{},i=t.points,s=[];return t.segments.forEach(({start:o,end:a})=>{a=tc(o,a,i);const l=i[o],u=i[a];r!==null?(s.push({x:l.x,y:r}),s.push({x:u.x,y:r})):n!==null&&(s.push({x:n,y:l.y}),s.push({x:n,y:u.y}))}),s}function tc(e,t,n){for(;t>e;t--){const r=n[t];if(!isNaN(r.x)&&!isNaN(r.y))break}return t}function xy(e,t,n,r){return e&&t?r(e[n],t[n]):e?e[n]:t?t[n]:0}function xb(e,t){let n=[],r=!1;return ft(e)?(r=!0,n=e):n=kE(e,t),n.length?new ei({points:n,options:{tension:0},_loop:r,_fullLoop:r}):null}function wy(e){return e&&e.fill!==!1}function OE(e,t,n){let i=e[t].fill;const s=[t];let o;if(!n)return i;for(;i!==!1&&s.indexOf(i)===-1;){if(!St(i))return i;if(o=e[i],!o)return!1;if(o.visible)return i;s.push(i),i=o.fill}return!1}function EE(e,t,n){const r=jE(e);if(Ue(r))return isNaN(r.value)?!1:r;let i=parseFloat(r);return St(i)&&Math.floor(i)===i?AE(r[0],t,i,n):["origin","start","end","stack","shape"].indexOf(r)>=0&&r}function AE(e,t,n,r){return(e==="-"||e==="+")&&(n=t+n),n===t||n<0||n>=r?!1:n}function TE(e,t){let n=null;return e==="start"?n=t.bottom:e==="end"?n=t.top:Ue(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}function PE(e,t,n){let r;return e==="start"?r=n:e==="end"?r=t.options.reverse?t.min:t.max:Ue(e)?r=e.value:r=t.getBaseValue(),r}function jE(e){const t=e.options,n=t.fill;let r=Be(n&&n.target,n);return r===void 0&&(r=!!t.backgroundColor),r===!1||r===null?!1:r===!0?"origin":r}function ME(e){const{scale:t,index:n,line:r}=e,i=[],s=r.segments,o=r.points,a=$E(t,n);a.push(xb({x:null,y:t.bottom},r));for(let l=0;l<s.length;l++){const u=s[l];for(let c=u.start;c<=u.end;c++)LE(i,o[c],a)}return new ei({points:i,options:{}})}function $E(e,t){const n=[],r=e.getMatchingVisibleMetas("line");for(let i=0;i<r.length;i++){const s=r[i];if(s.index===t)break;s.hidden||n.unshift(s.dataset)}return n}function LE(e,t,n){const r=[];for(let i=0;i<n.length;i++){const s=n[i],{first:o,last:a,point:l}=DE(s,t,"x");if(!(!l||o&&a)){if(o)r.unshift(l);else if(e.push(l),!a)break}}e.push(...r)}function DE(e,t,n){const r=e.interpolate(t,n);if(!r)return{};const i=r[n],s=e.segments,o=e.points;let a=!1,l=!1;for(let u=0;u<s.length;u++){const c=s[u],d=o[c.start][n],f=o[c.end][n];if(ys(i,d,f)){a=i===d,l=i===f;break}}return{first:a,last:l,point:r}}class wb{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,n,r){const{x:i,y:s,radius:o}=this;return n=n||{start:0,end:pn},t.arc(i,s,o,n.end,n.start,!0),!r.bounds}interpolate(t){const{x:n,y:r,radius:i}=this,s=t.angle;return{x:n+Math.cos(s)*i,y:r+Math.sin(s)*i,angle:s}}}function IE(e){const{chart:t,fill:n,line:r}=e;if(St(n))return RE(t,n);if(n==="stack")return ME(e);if(n==="shape")return!0;const i=NE(e);return i instanceof wb?i:xb(i,r)}function RE(e,t){const n=e.getDatasetMeta(t);return n&&e.isDatasetVisible(t)?n.dataset:null}function NE(e){return(e.scale||{}).getPointPositionForValue?BE(e):FE(e)}function FE(e){const{scale:t={},fill:n}=e,r=TE(n,t);if(St(r)){const i=t.isHorizontal();return{x:i?r:null,y:i?null:r}}return null}function BE(e){const{scale:t,fill:n}=e,r=t.options,i=t.getLabels().length,s=r.reverse?t.max:t.min,o=PE(n,t,s),a=[];if(r.grid.circular){const l=t.getPointPositionForValue(0,s);return new wb({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(o)})}for(let l=0;l<i;++l)a.push(t.getPointPositionForValue(l,o));return a}function Vc(e,t,n){const r=IE(t),{chart:i,index:s,line:o,scale:a,axis:l}=t,u=o.options,c=u.fill,d=u.backgroundColor,{above:f=d,below:h=d}=c||{},y=i.getDatasetMeta(s),m=ob(i,y);r&&o.points.length&&(Yu(e,n),qE(e,{line:o,target:r,above:f,below:h,area:n,scale:a,axis:l,clip:m}),Xu(e))}function qE(e,t){const{line:n,target:r,above:i,below:s,area:o,scale:a,clip:l}=t,u=n._loop?"angle":t.axis;e.save();let c=s;s!==i&&(u==="x"?(Sy(e,r,o.top),Wc(e,{line:n,target:r,color:i,scale:a,property:u,clip:l}),e.restore(),e.save(),Sy(e,r,o.bottom)):u==="y"&&(Cy(e,r,o.left),Wc(e,{line:n,target:r,color:s,scale:a,property:u,clip:l}),e.restore(),e.save(),Cy(e,r,o.right),c=i)),Wc(e,{line:n,target:r,color:c,scale:a,property:u,clip:l}),e.restore()}function Sy(e,t,n){const{segments:r,points:i}=t;let s=!0,o=!1;e.beginPath();for(const a of r){const{start:l,end:u}=a,c=i[l],d=i[tc(l,u,i)];s?(e.moveTo(c.x,c.y),s=!1):(e.lineTo(c.x,n),e.lineTo(c.x,c.y)),o=!!t.pathSegment(e,a,{move:o}),o?e.closePath():e.lineTo(d.x,n)}e.lineTo(t.first().x,n),e.closePath(),e.clip()}function Cy(e,t,n){const{segments:r,points:i}=t;let s=!0,o=!1;e.beginPath();for(const a of r){const{start:l,end:u}=a,c=i[l],d=i[tc(l,u,i)];s?(e.moveTo(c.x,c.y),s=!1):(e.lineTo(n,c.y),e.lineTo(c.x,c.y)),o=!!t.pathSegment(e,a,{move:o}),o?e.closePath():e.lineTo(n,d.y)}e.lineTo(n,t.first().y),e.closePath(),e.clip()}function Wc(e,t){const{line:n,target:r,property:i,color:s,scale:o,clip:a}=t,l=_E(n,r,i);for(const{source:u,target:c,start:d,end:f}of l){const{style:{backgroundColor:h=s}={}}=u,y=r!==!0;e.save(),e.fillStyle=h,zE(e,o,a,y&&Zd(i,d,f)),e.beginPath();const m=!!n.pathSegment(e,u);let p;if(y){m?e.closePath():_y(e,r,f,i);const v=!!r.pathSegment(e,c,{move:m,reverse:!0});p=m&&v,p||_y(e,r,d,i)}e.closePath(),e.fill(p?"evenodd":"nonzero"),e.restore()}}function zE(e,t,n,r){const i=t.chart.chartArea,{property:s,start:o,end:a}=r||{};if(s==="x"||s==="y"){let l,u,c,d;s==="x"?(l=o,u=i.top,c=a,d=i.bottom):(l=i.left,u=o,c=i.right,d=a),e.beginPath(),n&&(l=Math.max(l,n.left),c=Math.min(c,n.right),u=Math.max(u,n.top),d=Math.min(d,n.bottom)),e.rect(l,u,c-l,d-u),e.clip()}}function _y(e,t,n,r){const i=t.interpolate(n,r);i&&e.lineTo(i.x,i.y)}var HE={id:"filler",afterDatasetsUpdate(e,t,n){const r=(e.data.datasets||[]).length,i=[];let s,o,a,l;for(o=0;o<r;++o)s=e.getDatasetMeta(o),a=s.dataset,l=null,a&&a.options&&a instanceof ei&&(l={visible:e.isDatasetVisible(o),index:o,fill:EE(a,o,r),chart:e,axis:s.controller.options.indexAxis,scale:s.vScale,line:a}),s.$filler=l,i.push(l);for(o=0;o<r;++o)l=i[o],!(!l||l.fill===!1)&&(l.fill=OE(i,o,n.propagate))},beforeDraw(e,t,n){const r=n.drawTime==="beforeDraw",i=e.getSortedVisibleDatasetMetas(),s=e.chartArea;for(let o=i.length-1;o>=0;--o){const a=i[o].$filler;a&&(a.line.updateControlPoints(s,a.axis),r&&a.fill&&Vc(e.ctx,a,s))}},beforeDatasetsDraw(e,t,n){if(n.drawTime!=="beforeDatasetsDraw")return;const r=e.getSortedVisibleDatasetMetas();for(let i=r.length-1;i>=0;--i){const s=r[i].$filler;wy(s)&&Vc(e.ctx,s,e.chartArea)}},beforeDatasetDraw(e,t,n){const r=t.meta.$filler;!wy(r)||n.drawTime!=="beforeDatasetDraw"||Vc(e.ctx,r,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const ky=(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)}},UE=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class Oy extends ts{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=at(t.generateLabels,[this.chart],this)||[];t.filter&&(n=n.filter(r=>t.filter(r,this.chart.data))),t.sort&&(n=n.sort((r,i)=>t.sort(r,i,this.chart.data))),this.options.reverse&&n.reverse(),this.legendItems=n}fit(){const{options:t,ctx:n}=this;if(!t.display){this.width=this.height=0;return}const r=t.labels,i=bt(r.font),s=i.size,o=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=ky(r,s);let u,c;n.font=i.string,this.isHorizontal()?(u=this.maxWidth,c=this._fitRows(o,s,a,l)+10):(c=this.maxHeight,u=this._fitCols(o,i,a,l)+10),this.width=Math.min(u,t.maxWidth||this.maxWidth),this.height=Math.min(c,t.maxHeight||this.maxHeight)}_fitRows(t,n,r,i){const{ctx:s,maxWidth:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],u=this.lineWidths=[0],c=i+a;let d=t;s.textAlign="left",s.textBaseline="middle";let f=-1,h=-c;return this.legendItems.forEach((y,m)=>{const p=r+n/2+s.measureText(y.text).width;(m===0||u[u.length-1]+p+2*a>o)&&(d+=c,u[u.length-(m>0?0:1)]=0,h+=c,f++),l[m]={left:0,top:h,row:f,width:p,height:i},u[u.length-1]+=p+a}),d}_fitCols(t,n,r,i){const{ctx:s,maxHeight:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],u=this.columnSizes=[],c=o-t;let d=a,f=0,h=0,y=0,m=0;return this.legendItems.forEach((p,v)=>{const{itemWidth:b,itemHeight:S}=GE(r,n,s,p,i);v>0&&h+S+2*a>c&&(d+=f+a,u.push({width:f,height:h}),y+=f+a,m++,f=h=0),l[v]={left:y,top:h,col:m,width:b,height:S},f=Math.max(f,b),h+=S+a}),d+=f,u.push({width:f,height:h}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:r,labels:{padding:i},rtl:s}}=this,o=ps(s,this.left,this.width);if(this.isHorizontal()){let a=0,l=Pt(r,this.left+i,this.right-this.lineWidths[a]);for(const u of n)a!==u.row&&(a=u.row,l=Pt(r,this.left+i,this.right-this.lineWidths[a])),u.top+=this.top+t+i,u.left=o.leftForLtr(o.x(l),u.width),l+=u.width+i}else{let a=0,l=Pt(r,this.top+t+i,this.bottom-this.columnSizes[a].height);for(const u of n)u.col!==a&&(a=u.col,l=Pt(r,this.top+t+i,this.bottom-this.columnSizes[a].height)),u.top=l,u.left+=this.left+i,u.left=o.leftForLtr(o.x(u.left),u.width),l+=u.height+i}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;Yu(t,this),this._draw(),Xu(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:r,ctx:i}=this,{align:s,labels:o}=t,a=yt.color,l=ps(t.rtl,this.left,this.width),u=bt(o.font),{padding:c}=o,d=u.size,f=d/2;let h;this.drawTitle(),i.textAlign=l.textAlign("left"),i.textBaseline="middle",i.lineWidth=.5,i.font=u.string;const{boxWidth:y,boxHeight:m,itemHeight:p}=ky(o,d),v=function(k,w,_){if(isNaN(y)||y<=0||isNaN(m)||m<0)return;i.save();const O=Be(_.lineWidth,1);if(i.fillStyle=Be(_.fillStyle,a),i.lineCap=Be(_.lineCap,"butt"),i.lineDashOffset=Be(_.lineDashOffset,0),i.lineJoin=Be(_.lineJoin,"miter"),i.lineWidth=O,i.strokeStyle=Be(_.strokeStyle,a),i.setLineDash(Be(_.lineDash,[])),o.usePointStyle){const A={radius:m*Math.SQRT2/2,pointStyle:_.pointStyle,rotation:_.rotation,borderWidth:O},T=l.xPlus(k,y/2),j=w+f;W2(i,A,T,j,o.pointStyleWidth&&y)}else{const A=w+Math.max((d-m)/2,0),T=l.leftForLtr(k,y),j=ms(_.borderRadius);i.beginPath(),Object.values(j).some(B=>B!==0)?gu(i,{x:T,y:A,w:y,h:m,radius:j}):i.rect(T,A,y,m),i.fill(),O!==0&&i.stroke()}i.restore()},b=function(k,w,_){Vi(i,_.text,k,w+p/2,u,{strikethrough:_.hidden,textAlign:l.textAlign(_.textAlign)})},S=this.isHorizontal(),C=this._computeTitleHeight();S?h={x:Pt(s,this.left+c,this.right-r[0]),y:this.top+c+C,line:0}:h={x:this.left+c,y:Pt(s,this.top+C+c,this.bottom-n[0].height),line:0},tb(this.ctx,t.textDirection);const x=p+c;this.legendItems.forEach((k,w)=>{i.strokeStyle=k.fontColor,i.fillStyle=k.fontColor;const _=i.measureText(k.text).width,O=l.textAlign(k.textAlign||(k.textAlign=o.textAlign)),A=y+f+_;let T=h.x,j=h.y;l.setWidth(this.width),S?w>0&&T+A+c>this.right&&(j=h.y+=x,h.line++,T=h.x=Pt(s,this.left+c,this.right-r[h.line])):w>0&&j+x>this.bottom&&(T=h.x=T+n[h.line].width+c,h.line++,j=h.y=Pt(s,this.top+C+c,this.bottom-n[h.line].height));const B=l.x(T);if(v(B,j,k),T=B9(O,T+y+f,S?T+A:this.right,t.rtl),b(l.x(T),j,k),S)h.x+=A+c;else if(typeof k.text!="string"){const R=u.lineHeight;h.y+=Sb(k,R)+c}else h.y+=x}),nb(this.ctx,t.textDirection)}drawTitle(){const t=this.options,n=t.title,r=bt(n.font),i=Dt(n.padding);if(!n.display)return;const s=ps(t.rtl,this.left,this.width),o=this.ctx,a=n.position,l=r.size/2,u=i.top+l;let c,d=this.left,f=this.width;if(this.isHorizontal())f=Math.max(...this.lineWidths),c=this.top+u,d=Pt(t.align,d,this.right-f);else{const y=this.columnSizes.reduce((m,p)=>Math.max(m,p.height),0);c=u+Pt(t.align,this.top,this.bottom-y-t.labels.padding-this._computeTitleHeight())}const h=Pt(a,d,d+f);o.textAlign=s.textAlign(Xf(a)),o.textBaseline="middle",o.strokeStyle=n.color,o.fillStyle=n.color,o.font=r.string,Vi(o,n.text,h,c,r)}_computeTitleHeight(){const t=this.options.title,n=bt(t.font),r=Dt(t.padding);return t.display?n.lineHeight+r.height:0}_getLegendItemAt(t,n){let r,i,s;if(ys(t,this.left,this.right)&&ys(n,this.top,this.bottom)){for(s=this.legendHitBoxes,r=0;r<s.length;++r)if(i=s[r],ys(t,i.left,i.left+i.width)&&ys(n,i.top,i.top+i.height))return this.legendItems[r]}return null}handleEvent(t){const n=this.options;if(!WE(t.type,n))return;const r=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const i=this._hoveredItem,s=UE(i,r);i&&!s&&at(n.onLeave,[t,i,this],this),this._hoveredItem=r,r&&!s&&at(n.onHover,[t,r,this],this)}else r&&at(n.onClick,[t,r,this],this)}}function GE(e,t,n,r,i){const s=KE(r,e,t,n),o=VE(i,r,t.lineHeight);return{itemWidth:s,itemHeight:o}}function KE(e,t,n,r){let i=e.text;return i&&typeof i!="string"&&(i=i.reduce((s,o)=>s.length>o.length?s:o)),t+n.size/2+r.measureText(i).width}function VE(e,t,n){let r=e;return typeof t.text!="string"&&(r=Sb(t,n)),r}function Sb(e,t){const n=e.text?e.text.length:0;return t*n}function WE(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var QE={id:"legend",_element:Oy,start(e,t,n){const r=e.legend=new Oy({ctx:e.ctx,options:n,chart:e});Tn.configure(e,r,n),Tn.addBox(e,r)},stop(e){Tn.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const r=e.legend;Tn.configure(e,r,n),r.options=n},afterUpdate(e){const t=e.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(e,t){t.replay||e.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(e,t,n){const r=t.datasetIndex,i=n.chart;i.isDatasetVisible(r)?(i.hide(r),t.hidden=!0):(i.show(r),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){const t=e.data.datasets,{labels:{usePointStyle:n,pointStyle:r,textAlign:i,color:s,useBorderRadius:o,borderRadius:a}}=e.legend.options;return e._getSortedDatasetMetas().map(l=>{const u=l.controller.getStyle(n?0:void 0),c=Dt(u.borderWidth);return{text:t[l.index].label,fillStyle:u.backgroundColor,fontColor:s,hidden:!l.visible,lineCap:u.borderCapStyle,lineDash:u.borderDash,lineDashOffset:u.borderDashOffset,lineJoin:u.borderJoinStyle,lineWidth:(c.width+c.height)/4,strokeStyle:u.borderColor,pointStyle:r||u.pointStyle,rotation:u.rotation,textAlign:i||u.textAlign,borderRadius:o&&(a||u.borderRadius),datasetIndex:l.index}},this)}},title:{color:e=>e.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:e=>!e.startsWith("on"),labels:{_scriptable:e=>!["generateLabels","filter","sort"].includes(e)}}};class Cb extends ts{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,n){const r=this.options;if(this.left=0,this.top=0,!r.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=n;const i=ft(r.text)?r.text.length:1;this._padding=Dt(r.padding);const s=i*bt(r.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=s:this.width=s}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:n,left:r,bottom:i,right:s,options:o}=this,a=o.align;let l=0,u,c,d;return this.isHorizontal()?(c=Pt(a,r,s),d=n+t,u=s-r):(o.position==="left"?(c=r+t,d=Pt(a,i,n),l=pt*-.5):(c=s-t,d=Pt(a,n,i),l=pt*.5),u=i-n),{titleX:c,titleY:d,maxWidth:u,rotation:l}}draw(){const t=this.ctx,n=this.options;if(!n.display)return;const r=bt(n.font),s=r.lineHeight/2+this._padding.top,{titleX:o,titleY:a,maxWidth:l,rotation:u}=this._drawArgs(s);Vi(t,n.text,0,0,r,{color:n.color,maxWidth:l,rotation:u,textAlign:Xf(n.align),textBaseline:"middle",translation:[o,a]})}}function YE(e,t){const n=new Cb({ctx:e.ctx,options:t,chart:e});Tn.configure(e,n,t),Tn.addBox(e,n),e.titleBlock=n}var XE={id:"title",_element:Cb,start(e,t,n){YE(e,n)},stop(e){const t=e.titleBlock;Tn.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){const r=e.titleBlock;Tn.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 Bo={average(e){if(!e.length)return!1;let t,n,r=new Set,i=0,s=0;for(t=0,n=e.length;t<n;++t){const a=e[t].element;if(a&&a.hasValue()){const l=a.tooltipPosition();r.add(l.x),i+=l.y,++s}}return s===0||r.size===0?!1:{x:[...r].reduce((a,l)=>a+l)/r.size,y:i/s}},nearest(e,t){if(!e.length)return!1;let n=t.x,r=t.y,i=Number.POSITIVE_INFINITY,s,o,a;for(s=0,o=e.length;s<o;++s){const l=e[s].element;if(l&&l.hasValue()){const u=l.getCenterPoint(),c=Kd(t,u);c<i&&(i=c,a=l)}}if(a){const l=a.tooltipPosition();n=l.x,r=l.y}return{x:n,y:r}}};function Xn(e,t){return t&&(ft(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function mr(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(`
|
|
68
68
|
`)>-1?e.split(`
|
|
69
69
|
`):e}function ZE(e,t){const{element:n,datasetIndex:r,index:i}=t,s=e.getDatasetMeta(r).controller,{label:o,value:a}=s.getLabelAndValue(i);return{chart:e,label:o,parsed:s.getParsed(i),raw:e.data.datasets[r].data[i],formattedValue:a,dataset:s.getDataset(),dataIndex:i,datasetIndex:r,element:n}}function Ey(e,t){const n=e.chart.ctx,{body:r,footer:i,title:s}=e,{boxWidth:o,boxHeight:a}=t,l=bt(t.bodyFont),u=bt(t.titleFont),c=bt(t.footerFont),d=s.length,f=i.length,h=r.length,y=Dt(t.padding);let m=y.height,p=0,v=r.reduce((C,x)=>C+x.before.length+x.lines.length+x.after.length,0);if(v+=e.beforeBody.length+e.afterBody.length,d&&(m+=d*u.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),v){const C=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;m+=h*C+(v-h)*l.lineHeight+(v-1)*t.bodySpacing}f&&(m+=t.footerMarginTop+f*c.lineHeight+(f-1)*t.footerSpacing);let b=0;const S=function(C){p=Math.max(p,n.measureText(C).width+b)};return n.save(),n.font=u.string,et(e.title,S),n.font=l.string,et(e.beforeBody.concat(e.afterBody),S),b=t.displayColors?o+2+t.boxPadding:0,et(r,C=>{et(C.before,S),et(C.lines,S),et(C.after,S)}),b=0,n.font=c.string,et(e.footer,S),n.restore(),p+=y.width,{width:p,height:m}}function JE(e,t){const{y:n,height:r}=t;return n<r/2?"top":n>e.height-r/2?"bottom":"center"}function eA(e,t,n,r){const{x:i,width:s}=r,o=n.caretSize+n.caretPadding;if(e==="left"&&i+s+o>t.width||e==="right"&&i-s-o<0)return!0}function tA(e,t,n,r){const{x:i,width:s}=n,{width:o,chartArea:{left:a,right:l}}=e;let u="center";return r==="center"?u=i<=(a+l)/2?"left":"right":i<=s/2?u="left":i>=o-s/2&&(u="right"),eA(u,e,t,n)&&(u="center"),u}function Ay(e,t,n){const r=n.yAlign||t.yAlign||JE(e,n);return{xAlign:n.xAlign||t.xAlign||tA(e,t,n,r),yAlign:r}}function nA(e,t){let{x:n,width:r}=e;return t==="right"?n-=r:t==="center"&&(n-=r/2),n}function rA(e,t,n){let{y:r,height:i}=e;return t==="top"?r+=n:t==="bottom"?r-=i+n:r-=i/2,r}function Ty(e,t,n,r){const{caretSize:i,caretPadding:s,cornerRadius:o}=e,{xAlign:a,yAlign:l}=n,u=i+s,{topLeft:c,topRight:d,bottomLeft:f,bottomRight:h}=ms(o);let y=nA(t,a);const m=rA(t,l,u);return l==="center"?a==="left"?y+=u:a==="right"&&(y-=u):a==="left"?y-=Math.max(c,f)+i:a==="right"&&(y+=Math.max(d,h)+i),{x:An(y,0,r.width-t.width),y:An(m,0,r.height-t.height)}}function El(e,t,n){const r=Dt(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-r.right:e.x+r.left}function Py(e){return Xn([],mr(e))}function iA(e,t,n){return gi(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function jy(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const _b={beforeTitle:dr,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:dr,beforeBody:dr,beforeLabel:dr,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 tt(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:dr,afterBody:dr,beforeFooter:dr,footer:dr,afterFooter:dr};function Ht(e,t,n,r){const i=e[t].call(n,r);return typeof i=="undefined"?_b[t].call(n,r):i}class Jd extends ts{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const n=this.chart,r=this.options.setContext(this.getContext()),i=r.enabled&&n.options.animation&&r.animations,s=new ab(this.chart,i);return i._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=iA(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:r}=n,i=Ht(r,"beforeTitle",this,t),s=Ht(r,"title",this,t),o=Ht(r,"afterTitle",this,t);let a=[];return a=Xn(a,mr(i)),a=Xn(a,mr(s)),a=Xn(a,mr(o)),a}getBeforeBody(t,n){return Py(Ht(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:r}=n,i=[];return et(t,s=>{const o={before:[],lines:[],after:[]},a=jy(r,s);Xn(o.before,mr(Ht(a,"beforeLabel",this,s))),Xn(o.lines,Ht(a,"label",this,s)),Xn(o.after,mr(Ht(a,"afterLabel",this,s))),i.push(o)}),i}getAfterBody(t,n){return Py(Ht(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:r}=n,i=Ht(r,"beforeFooter",this,t),s=Ht(r,"footer",this,t),o=Ht(r,"afterFooter",this,t);let a=[];return a=Xn(a,mr(i)),a=Xn(a,mr(s)),a=Xn(a,mr(o)),a}_createItems(t){const n=this._active,r=this.chart.data,i=[],s=[],o=[];let a=[],l,u;for(l=0,u=n.length;l<u;++l)a.push(ZE(this.chart,n[l]));return t.filter&&(a=a.filter((c,d,f)=>t.filter(c,d,f,r))),t.itemSort&&(a=a.sort((c,d)=>t.itemSort(c,d,r))),et(a,c=>{const d=jy(t.callbacks,c);i.push(Ht(d,"labelColor",this,c)),s.push(Ht(d,"labelPointStyle",this,c)),o.push(Ht(d,"labelTextColor",this,c))}),this.labelColors=i,this.labelPointStyles=s,this.labelTextColors=o,this.dataPoints=a,a}update(t,n){const r=this.options.setContext(this.getContext()),i=this._active;let s,o=[];if(!i.length)this.opacity!==0&&(s={opacity:0});else{const a=Bo[r.position].call(this,i,this._eventPosition);o=this._createItems(r),this.title=this.getTitle(o,r),this.beforeBody=this.getBeforeBody(o,r),this.body=this.getBody(o,r),this.afterBody=this.getAfterBody(o,r),this.footer=this.getFooter(o,r);const l=this._size=Ey(this,r),u=Object.assign({},a,l),c=Ay(this.chart,r,u),d=Ty(r,u,c,this.chart);this.xAlign=c.xAlign,this.yAlign=c.yAlign,s={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=o,this.$context=void 0,s&&this._resolveAnimations().update(this,s),t&&r.external&&r.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(t,n,r,i){const s=this.getCaretPosition(t,r,i);n.lineTo(s.x1,s.y1),n.lineTo(s.x2,s.y2),n.lineTo(s.x3,s.y3)}getCaretPosition(t,n,r){const{xAlign:i,yAlign:s}=this,{caretSize:o,cornerRadius:a}=r,{topLeft:l,topRight:u,bottomLeft:c,bottomRight:d}=ms(a),{x:f,y:h}=t,{width:y,height:m}=n;let p,v,b,S,C,x;return s==="center"?(C=h+m/2,i==="left"?(p=f,v=p-o,S=C+o,x=C-o):(p=f+y,v=p+o,S=C-o,x=C+o),b=p):(i==="left"?v=f+Math.max(l,c)+o:i==="right"?v=f+y-Math.max(u,d)-o:v=this.caretX,s==="top"?(S=h,C=S-o,p=v-o,b=v+o):(S=h+m,C=S+o,p=v+o,b=v-o),x=S),{x1:p,x2:v,x3:b,y1:S,y2:C,y3:x}}drawTitle(t,n,r){const i=this.title,s=i.length;let o,a,l;if(s){const u=ps(r.rtl,this.x,this.width);for(t.x=El(this,r.titleAlign,r),n.textAlign=u.textAlign(r.titleAlign),n.textBaseline="middle",o=bt(r.titleFont),a=r.titleSpacing,n.fillStyle=r.titleColor,n.font=o.string,l=0;l<s;++l)n.fillText(i[l],u.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+a,l+1===s&&(t.y+=r.titleMarginBottom-a)}}_drawColorBox(t,n,r,i,s){const o=this.labelColors[r],a=this.labelPointStyles[r],{boxHeight:l,boxWidth:u}=s,c=bt(s.bodyFont),d=El(this,"left",s),f=i.x(d),h=l<c.lineHeight?(c.lineHeight-l)/2:0,y=n.y+h;if(s.usePointStyle){const m={radius:Math.min(u,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},p=i.leftForLtr(f,u)+u/2,v=y+l/2;t.strokeStyle=s.multiKeyBackground,t.fillStyle=s.multiKeyBackground,Wd(t,m,p,v),t.strokeStyle=o.borderColor,t.fillStyle=o.backgroundColor,Wd(t,m,p,v)}else{t.lineWidth=Ue(o.borderWidth)?Math.max(...Object.values(o.borderWidth)):o.borderWidth||1,t.strokeStyle=o.borderColor,t.setLineDash(o.borderDash||[]),t.lineDashOffset=o.borderDashOffset||0;const m=i.leftForLtr(f,u),p=i.leftForLtr(i.xPlus(f,1),u-2),v=ms(o.borderRadius);Object.values(v).some(b=>b!==0)?(t.beginPath(),t.fillStyle=s.multiKeyBackground,gu(t,{x:m,y,w:u,h:l,radius:v}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),gu(t,{x:p,y:y+1,w:u-2,h:l-2,radius:v}),t.fill()):(t.fillStyle=s.multiKeyBackground,t.fillRect(m,y,u,l),t.strokeRect(m,y,u,l),t.fillStyle=o.backgroundColor,t.fillRect(p,y+1,u-2,l-2))}t.fillStyle=this.labelTextColors[r]}drawBody(t,n,r){const{body:i}=this,{bodySpacing:s,bodyAlign:o,displayColors:a,boxHeight:l,boxWidth:u,boxPadding:c}=r,d=bt(r.bodyFont);let f=d.lineHeight,h=0;const y=ps(r.rtl,this.x,this.width),m=function(_){n.fillText(_,y.x(t.x+h),t.y+f/2),t.y+=f+s},p=y.textAlign(o);let v,b,S,C,x,k,w;for(n.textAlign=o,n.textBaseline="middle",n.font=d.string,t.x=El(this,p,r),n.fillStyle=r.bodyColor,et(this.beforeBody,m),h=a&&p!=="right"?o==="center"?u/2+c:u+2+c:0,C=0,k=i.length;C<k;++C){for(v=i[C],b=this.labelTextColors[C],n.fillStyle=b,et(v.before,m),S=v.lines,a&&S.length&&(this._drawColorBox(n,t,C,y,r),f=Math.max(d.lineHeight,l)),x=0,w=S.length;x<w;++x)m(S[x]),f=d.lineHeight;et(v.after,m)}h=0,f=d.lineHeight,et(this.afterBody,m),t.y-=s}drawFooter(t,n,r){const i=this.footer,s=i.length;let o,a;if(s){const l=ps(r.rtl,this.x,this.width);for(t.x=El(this,r.footerAlign,r),t.y+=r.footerMarginTop,n.textAlign=l.textAlign(r.footerAlign),n.textBaseline="middle",o=bt(r.footerFont),n.fillStyle=r.footerColor,n.font=o.string,a=0;a<s;++a)n.fillText(i[a],l.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+r.footerSpacing}}drawBackground(t,n,r,i){const{xAlign:s,yAlign:o}=this,{x:a,y:l}=t,{width:u,height:c}=r,{topLeft:d,topRight:f,bottomLeft:h,bottomRight:y}=ms(i.cornerRadius);n.fillStyle=i.backgroundColor,n.strokeStyle=i.borderColor,n.lineWidth=i.borderWidth,n.beginPath(),n.moveTo(a+d,l),o==="top"&&this.drawCaret(t,n,r,i),n.lineTo(a+u-f,l),n.quadraticCurveTo(a+u,l,a+u,l+f),o==="center"&&s==="right"&&this.drawCaret(t,n,r,i),n.lineTo(a+u,l+c-y),n.quadraticCurveTo(a+u,l+c,a+u-y,l+c),o==="bottom"&&this.drawCaret(t,n,r,i),n.lineTo(a+h,l+c),n.quadraticCurveTo(a,l+c,a,l+c-h),o==="center"&&s==="left"&&this.drawCaret(t,n,r,i),n.lineTo(a,l+d),n.quadraticCurveTo(a,l,a+d,l),n.closePath(),n.fill(),i.borderWidth>0&&n.stroke()}_updateAnimationTarget(t){const n=this.chart,r=this.$animations,i=r&&r.x,s=r&&r.y;if(i||s){const o=Bo[t.position].call(this,this._active,this._eventPosition);if(!o)return;const a=this._size=Ey(this,t),l=Object.assign({},o,this._size),u=Ay(n,t,l),c=Ty(t,l,u,n);(i._to!==c.x||s._to!==c.y)&&(this.xAlign=u.xAlign,this.yAlign=u.yAlign,this.width=a.width,this.height=a.height,this.caretX=o.x,this.caretY=o.y,this._resolveAnimations().update(this,c))}}_willRender(){return!!this.opacity}draw(t){const n=this.options.setContext(this.getContext());let r=this.opacity;if(!r)return;this._updateAnimationTarget(n);const i={width:this.width,height:this.height},s={x:this.x,y:this.y};r=Math.abs(r)<.001?0:r;const o=Dt(n.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&a&&(t.save(),t.globalAlpha=r,this.drawBackground(s,t,i,n),tb(t,n.textDirection),s.y+=o.top,this.drawTitle(s,t,n),this.drawBody(s,t,n),this.drawFooter(s,t,n),nb(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){const r=this._active,i=t.map(({datasetIndex:a,index:l})=>{const u=this.chart.getDatasetMeta(a);if(!u)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:u.data[l],index:l}}),s=!uu(r,i),o=this._positionChanged(i,n);(s||o)&&(this._active=i,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,n,r=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const i=this.options,s=this._active||[],o=this._getActiveElements(t,s,n,r),a=this._positionChanged(o,t),l=n||!uu(o,s)||a;return l&&(this._active=o,(i.enabled||i.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,n))),l}_getActiveElements(t,n,r,i){const s=this.options;if(t.type==="mouseout")return[];if(!i)return n.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);const o=this.chart.getElementsAtEventForMode(t,s.mode,s,r);return s.reverse&&o.reverse(),o}_positionChanged(t,n){const{caretX:r,caretY:i,options:s}=this,o=Bo[s.position].call(this,t,n);return o!==!1&&(r!==o.x||i!==o.y)}}be(Jd,"positioners",Bo);var sA={id:"tooltip",_element:Jd,positioners:Bo,afterInit(e,t,n){n&&(e.tooltip=new Jd({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:_b},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:e=>e!=="filter"&&e!=="itemSort"&&e!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const oA=(e,t,n,r)=>(typeof t=="string"?(n=e.push(t)-1,r.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function aA(e,t,n,r){const i=e.indexOf(t);if(i===-1)return oA(e,t,n,r);const s=e.lastIndexOf(t);return i!==s?n:i}const lA=(e,t)=>e===null?null:An(Math.round(e),0,t);function My(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class ef extends uo{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const n=this._addedLabels;if(n.length){const r=this.getLabels();for(const{index:i,label:s}of n)r[i]===s&&r.splice(i,1);this._addedLabels=[]}super.init(t)}parse(t,n){if(tt(t))return null;const r=this.getLabels();return n=isFinite(n)&&r[n]===t?n:aA(r,t,Be(n,t),this._addedLabels),lA(n,r.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let{min:r,max:i}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(r=0),n||(i=this.getLabels().length-1)),this.min=r,this.max=i}buildTicks(){const t=this.min,n=this.max,r=this.options.offset,i=[];let s=this.getLabels();s=t===0&&n===s.length-1?s:s.slice(t,n+1),this._valueRange=Math.max(s.length-(r?0:1),1),this._startValue=this.min-(r?.5:0);for(let o=t;o<=n;o++)i.push({value:o});return i}getLabelForValue(t){return My.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}}be(ef,"id","category"),be(ef,"defaults",{ticks:{callback:My}});function uA(e,t){const n=[],{bounds:i,step:s,min:o,max:a,precision:l,count:u,maxTicks:c,maxDigits:d,includeBounds:f}=e,h=s||1,y=c-1,{min:m,max:p}=t,v=!tt(o),b=!tt(a),S=!tt(u),C=(p-m)/(d+1);let x=$g((p-m)/y/h)*h,k,w,_,O;if(x<1e-14&&!v&&!b)return[{value:m},{value:p}];O=Math.ceil(p/x)-Math.floor(m/x),O>y&&(x=$g(O*x/y/h)*h),tt(l)||(k=Math.pow(10,l),x=Math.ceil(x*k)/k),i==="ticks"?(w=Math.floor(m/x)*x,_=Math.ceil(p/x)*x):(w=m,_=p),v&&b&&s&&P9((a-o)/s,x/1e3)?(O=Math.round(Math.min((a-o)/x,c)),x=(a-o)/O,w=o,_=a):S?(w=v?o:w,_=b?a:_,O=u-1,x=(_-w)/O):(O=(_-w)/x,Yo(O,Math.round(O),x/1e3)?O=Math.round(O):O=Math.ceil(O));const A=Math.max(Lg(x),Lg(w));k=Math.pow(10,tt(l)?A:l),w=Math.round(w*k)/k,_=Math.round(_*k)/k;let T=0;for(v&&(f&&w!==o?(n.push({value:o}),w<o&&T++,Yo(Math.round((w+T*x)*k)/k,o,$y(o,C,e))&&T++):w<o&&T++);T<O;++T){const j=Math.round((w+T*x)*k)/k;if(b&&j>a)break;n.push({value:j})}return b&&f&&_!==a?n.length&&Yo(n[n.length-1].value,a,$y(a,C,e))?n[n.length-1].value=a:n.push({value:a}):(!b||_===a)&&n.push({value:_}),n}function $y(e,t,{horizontal:n,minRotation:r}){const i=Jr(r),s=(n?Math.sin(i):Math.cos(i))||.001,o=.75*t*(""+e).length;return Math.min(t/s,o)}class tf extends uo{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 tt(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:n,maxDefined:r}=this.getUserBounds();let{min:i,max:s}=this;const o=l=>i=n?i:l,a=l=>s=r?s:l;if(t){const l=Xs(i),u=Xs(s);l<0&&u<0?a(0):l>0&&u>0&&o(0)}if(i===s){let l=s===0?1:Math.abs(s*.05);a(s+l),t||o(i-l)}this.min=i,this.max=s}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:n,stepSize:r}=t,i;return r?(i=Math.ceil(this.max/r)-Math.floor(this.min/r)+1,i>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${r} would result generating up to ${i} ticks. Limiting to 1000.`),i=1e3)):(i=this.computeTickLimit(),n=n||11),n&&(i=Math.min(n,i)),i}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,n=t.ticks;let r=this.getTickLimit();r=Math.max(2,r);const i={maxTicks:r,bounds:t.bounds,min:t.min,max:t.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},s=this._range||this,o=uA(i,s);return t.bounds==="ticks"&&j9(o,this,"value"),t.reverse?(o.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),o}configure(){const t=this.ticks;let n=this.min,r=this.max;if(super.configure(),this.options.offset&&t.length){const i=(r-n)/Math.max(t.length-1,1)/2;n-=i,r+=i}this._startValue=n,this._endValue=r,this._valueRange=r-n}getLabelForValue(t){return V2(t,this.chart.options.locale,this.options.ticks.format)}}class nf extends tf{determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=St(t)?t:0,this.max=St(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,r=Jr(this.options.ticks.minRotation),i=(t?Math.sin(r):Math.cos(r))||.001,s=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,s.lineHeight/i))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}be(nf,"id","linear"),be(nf,"defaults",{ticks:{callback:Jf.formatters.numeric}});function rf(e){const t=e.ticks;if(t.display&&e.display){const n=Dt(t.backdropPadding);return Be(t.font&&t.font.size,yt.font.size)+n.height}return 0}function cA(e,t,n){return n=ft(n)?n:[n],{w:J9(e,t.string,n),h:n.length*t.lineHeight}}function Ly(e,t,n,r,i){return e===r||e===i?{start:t-n/2,end:t+n/2}:e<r||e>i?{start:t-n,end:t}:{start:t,end:t+n}}function dA(e){const t={l:e.left+e._padding.left,r:e.right-e._padding.right,t:e.top+e._padding.top,b:e.bottom-e._padding.bottom},n=Object.assign({},t),r=[],i=[],s=e._pointLabels.length,o=e.options.pointLabels,a=o.centerPointLabels?pt/s:0;for(let l=0;l<s;l++){const u=o.setContext(e.getPointLabelContext(l));i[l]=u.padding;const c=e.getPointPosition(l,e.drawingArea+i[l],a),d=bt(u.font),f=cA(e.ctx,d,e._pointLabels[l]);r[l]=f;const h=hn(e.getIndexAngle(l)+a),y=Math.round(Qf(h)),m=Ly(y,c.x,f.w,0,180),p=Ly(y,c.y,f.h,90,270);fA(n,t,h,m,p)}e.setCenterPoint(t.l-n.l,n.r-t.r,t.t-n.t,n.b-t.b),e._pointLabelItems=yA(e,r,i)}function fA(e,t,n,r,i){const s=Math.abs(Math.sin(n)),o=Math.abs(Math.cos(n));let a=0,l=0;r.start<t.l?(a=(t.l-r.start)/s,e.l=Math.min(e.l,t.l-a)):r.end>t.r&&(a=(r.end-t.r)/s,e.r=Math.max(e.r,t.r+a)),i.start<t.t?(l=(t.t-i.start)/o,e.t=Math.min(e.t,t.t-l)):i.end>t.b&&(l=(i.end-t.b)/o,e.b=Math.max(e.b,t.b+l))}function hA(e,t,n){const r=e.drawingArea,{extra:i,additionalAngle:s,padding:o,size:a}=n,l=e.getPointPosition(t,r+i+o,s),u=Math.round(Qf(hn(l.angle+mn))),c=vA(l.y,a.h,u),d=mA(u),f=pA(l.x,a.w,d);return{visible:!0,x:l.x,y:c,textAlign:d,left:f,top:c,right:f+a.w,bottom:c+a.h}}function gA(e,t){if(!t)return!0;const{left:n,top:r,right:i,bottom:s}=e;return!(Cr({x:n,y:r},t)||Cr({x:n,y:s},t)||Cr({x:i,y:r},t)||Cr({x:i,y:s},t))}function yA(e,t,n){const r=[],i=e._pointLabels.length,s=e.options,{centerPointLabels:o,display:a}=s.pointLabels,l={extra:rf(s)/2,additionalAngle:o?pt/i:0};let u;for(let c=0;c<i;c++){l.padding=n[c],l.size=t[c];const d=hA(e,c,l);r.push(d),a==="auto"&&(d.visible=gA(d,u),d.visible&&(u=d))}return r}function mA(e){return e===0||e===180?"center":e<180?"left":"right"}function pA(e,t,n){return n==="right"?e-=t:n==="center"&&(e-=t/2),e}function vA(e,t,n){return n===90||n===270?e-=t/2:(n>270||n<90)&&(e-=t),e}function bA(e,t,n){const{left:r,top:i,right:s,bottom:o}=n,{backdropColor:a}=t;if(!tt(a)){const l=ms(t.borderRadius),u=Dt(t.backdropPadding);e.fillStyle=a;const c=r-u.left,d=i-u.top,f=s-r+u.width,h=o-i+u.height;Object.values(l).some(y=>y!==0)?(e.beginPath(),gu(e,{x:c,y:d,w:f,h,radius:l}),e.fill()):e.fillRect(c,d,f,h)}}function xA(e,t){const{ctx:n,options:{pointLabels:r}}=e;for(let i=t-1;i>=0;i--){const s=e._pointLabelItems[i];if(!s.visible)continue;const o=r.setContext(e.getPointLabelContext(i));bA(n,o,s);const a=bt(o.font),{x:l,y:u,textAlign:c}=s;Vi(n,e._pointLabels[i],l,u+a.lineHeight/2,a,{color:o.color,textAlign:c,textBaseline:"middle"})}}function kb(e,t,n,r){const{ctx:i}=e;if(n)i.arc(e.xCenter,e.yCenter,t,0,pn);else{let s=e.getPointPosition(0,t);i.moveTo(s.x,s.y);for(let o=1;o<r;o++)s=e.getPointPosition(o,t),i.lineTo(s.x,s.y)}}function wA(e,t,n,r,i){const s=e.ctx,o=t.circular,{color:a,lineWidth:l}=t;!o&&!r||!a||!l||n<0||(s.save(),s.strokeStyle=a,s.lineWidth=l,s.setLineDash(i.dash||[]),s.lineDashOffset=i.dashOffset,s.beginPath(),kb(e,n,o,r),s.closePath(),s.stroke(),s.restore())}function SA(e,t,n){return gi(e,{label:n,index:t,type:"pointLabel"})}class qo extends tf{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=Dt(rf(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=St(t)&&!isNaN(t)?t:0,this.max=St(n)&&!isNaN(n)?n:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/rf(this.options))}generateTickLabels(t){tf.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((n,r)=>{const i=at(this.options.pointLabels.callback,[n,r],this);return i||i===0?i:""}).filter((n,r)=>this.chart.getDataVisibility(r))}fit(){const t=this.options;t.display&&t.pointLabels.display?dA(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,n,r,i){this.xCenter+=Math.floor((t-n)/2),this.yCenter+=Math.floor((r-i)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,n,r,i))}getIndexAngle(t){const n=pn/(this._pointLabels.length||1),r=this.options.startAngle||0;return hn(t*n+Jr(r))}getDistanceFromCenterForValue(t){if(tt(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(tt(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 SA(this.getContext(),t,r)}}getPointPosition(t,n,r=0){const i=this.getIndexAngle(t)-mn+r;return{x:Math.cos(i)*n+this.xCenter,y:Math.sin(i)*n+this.yCenter,angle:i}}getPointPositionForValue(t,n){return this.getPointPosition(t,this.getDistanceFromCenterForValue(n))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:n,top:r,right:i,bottom:s}=this._pointLabelItems[t];return{left:n,top:r,right:i,bottom:s}}drawBackground(){const{backgroundColor:t,grid:{circular:n}}=this.options;if(t){const r=this.ctx;r.save(),r.beginPath(),kb(this,this.getDistanceFromCenterForValue(this._endValue),n,this._pointLabels.length),r.closePath(),r.fillStyle=t,r.fill(),r.restore()}}drawGrid(){const t=this.ctx,n=this.options,{angleLines:r,grid:i,border:s}=n,o=this._pointLabels.length;let a,l,u;if(n.pointLabels.display&&xA(this,o),i.display&&this.ticks.forEach((c,d)=>{if(d!==0||d===0&&this.min<0){l=this.getDistanceFromCenterForValue(c.value);const f=this.getContext(d),h=i.setContext(f),y=s.setContext(f);wA(this,h,l,o,y)}}),r.display){for(t.save(),a=o-1;a>=0;a--){const c=r.setContext(this.getPointLabelContext(a)),{color:d,lineWidth:f}=c;!f||!d||(t.lineWidth=f,t.strokeStyle=d,t.setLineDash(c.borderDash),t.lineDashOffset=c.borderDashOffset,l=this.getDistanceFromCenterForValue(n.reverse?this.min:this.max),u=this.getPointPosition(a,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(u.x,u.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,n=this.options,r=n.ticks;if(!r.display)return;const i=this.getIndexAngle(0);let s,o;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(i),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&this.min>=0&&!n.reverse)return;const u=r.setContext(this.getContext(l)),c=bt(u.font);if(s=this.getDistanceFromCenterForValue(this.ticks[l].value),u.showLabelBackdrop){t.font=c.string,o=t.measureText(a.label).width,t.fillStyle=u.backdropColor;const d=Dt(u.backdropPadding);t.fillRect(-o/2-d.left,-s-c.size/2-d.top,o+d.width,c.size+d.height)}Vi(t,a.label,0,-s,c,{color:u.color,strokeColor:u.textStrokeColor,strokeWidth:u.textStrokeWidth})}),t.restore()}drawTitle(){}}be(qo,"id","radialLinear"),be(qo,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Jf.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),be(qo,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),be(qo,"descriptors",{angleLines:{_fallback:"grid"}});const nc={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}},Vt=Object.keys(nc);function Dy(e,t){return e-t}function Iy(e,t){if(tt(t))return null;const n=e._adapter,{parser:r,round:i,isoWeekday:s}=e._parseOpts;let o=t;return typeof r=="function"&&(o=r(o)),St(o)||(o=typeof r=="string"?n.parse(o,r):n.parse(o)),o===null?null:(i&&(o=i==="week"&&(ba(s)||s===!0)?n.startOf(o,"isoWeek",s):n.startOf(o,i)),+o)}function Ry(e,t,n,r){const i=Vt.length;for(let s=Vt.indexOf(e);s<i-1;++s){const o=nc[Vt[s]],a=o.steps?o.steps:Number.MAX_SAFE_INTEGER;if(o.common&&Math.ceil((n-t)/(a*o.size))<=r)return Vt[s]}return Vt[i-1]}function CA(e,t,n,r,i){for(let s=Vt.length-1;s>=Vt.indexOf(n);s--){const o=Vt[s];if(nc[o].common&&e._adapter.diff(i,r,o)>=t-1)return o}return Vt[n?Vt.indexOf(n):0]}function _A(e){for(let t=Vt.indexOf(e)+1,n=Vt.length;t<n;++t)if(nc[Vt[t]].common)return Vt[t]}function Ny(e,t,n){if(!n)e[t]=!0;else if(n.length){const{lo:r,hi:i}=Yf(n,t),s=n[r]>=t?n[r]:n[i];e[s]=!0}}function kA(e,t,n,r){const i=e._adapter,s=+i.startOf(t[0].value,r),o=t[t.length-1].value;let a,l;for(a=s;a<=o;a=+i.add(a,1,r))l=n[a],l>=0&&(t[l].major=!0);return t}function Fy(e,t,n){const r=[],i={},s=t.length;let o,a;for(o=0;o<s;++o)a=t[o],i[a]=o,r.push({value:a,major:!1});return s===0||!n?r:kA(e,r,i,n)}class pu extends uo{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,n={}){const r=t.time||(t.time={}),i=this._adapter=new oO._date(t.adapters.date);i.init(n),Qo(r.displayFormats,i.formats()),this._parseOpts={parser:r.parser,round:r.round,isoWeekday:r.isoWeekday},super.init(t),this._normalized=n.normalized}parse(t,n){return t===void 0?null:Iy(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,n=this._adapter,r=t.time.unit||"day";let{min:i,max:s,minDefined:o,maxDefined:a}=this.getUserBounds();function l(u){!o&&!isNaN(u.min)&&(i=Math.min(i,u.min)),!a&&!isNaN(u.max)&&(s=Math.max(s,u.max))}(!o||!a)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),i=St(i)&&!isNaN(i)?i:+n.startOf(Date.now(),r),s=St(s)&&!isNaN(s)?s:+n.endOf(Date.now(),r)+1,this.min=Math.min(i,s-1),this.max=Math.max(i+1,s)}_getLabelBounds(){const t=this.getLabelTimestamps();let n=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY;return t.length&&(n=t[0],r=t[t.length-1]),{min:n,max:r}}buildTicks(){const t=this.options,n=t.time,r=t.ticks,i=r.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&i.length&&(this.min=this._userMin||i[0],this.max=this._userMax||i[i.length-1]);const s=this.min,o=this.max,a=I9(i,s,o);return this._unit=n.unit||(r.autoSkip?Ry(n.minUnit,this.min,this.max,this._getLabelCapacity(s)):CA(this,a.length,n.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:_A(this._unit),this.initOffsets(i),t.reverse&&a.reverse(),Fy(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let n=0,r=0,i,s;this.options.offset&&t.length&&(i=this.getDecimalForValue(t[0]),t.length===1?n=1-i:n=(this.getDecimalForValue(t[1])-i)/2,s=this.getDecimalForValue(t[t.length-1]),t.length===1?r=s:r=(s-this.getDecimalForValue(t[t.length-2]))/2);const o=t.length<3?.5:.25;n=An(n,0,o),r=An(r,0,o),this._offsets={start:n,end:r,factor:1/(n+1+r)}}_generate(){const t=this._adapter,n=this.min,r=this.max,i=this.options,s=i.time,o=s.unit||Ry(s.minUnit,n,r,this._getLabelCapacity(n)),a=Be(i.ticks.stepSize,1),l=o==="week"?s.isoWeekday:!1,u=ba(l)||l===!0,c={};let d=n,f,h;if(u&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,u?"day":o),t.diff(r,n,o)>1e5*a)throw new Error(n+" and "+r+" are too far apart with stepSize of "+a+" "+o);const y=i.ticks.source==="data"&&this.getDataTimestamps();for(f=d,h=0;f<r;f=+t.add(f,a,o),h++)Ny(c,f,y);return(f===r||i.bounds==="ticks"||h===1)&&Ny(c,f,y),Object.keys(c).sort(Dy).map(m=>+m)}getLabelForValue(t){const n=this._adapter,r=this.options.time;return r.tooltipFormat?n.format(t,r.tooltipFormat):n.format(t,r.displayFormats.datetime)}format(t,n){const i=this.options.time.displayFormats,s=this._unit,o=n||i[s];return this._adapter.format(t,o)}_tickFormatFunction(t,n,r,i){const s=this.options,o=s.ticks.callback;if(o)return at(o,[t,n,r],this);const a=s.time.displayFormats,l=this._unit,u=this._majorUnit,c=l&&a[l],d=u&&a[u],f=r[n],h=u&&d&&f&&f.major;return this._adapter.format(t,i||(h?d:c))}generateTickLabels(t){let n,r,i;for(n=0,r=t.length;n<r;++n)i=t[n],i.label=this._tickFormatFunction(i.value,n,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const n=this._offsets,r=this.getDecimalForValue(t);return this.getPixelForDecimal((n.start+r)*n.factor)}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return this.min+r*(this.max-this.min)}_getLabelSize(t){const n=this.options.ticks,r=this.ctx.measureText(t).width,i=Jr(this.isHorizontal()?n.maxRotation:n.minRotation),s=Math.cos(i),o=Math.sin(i),a=this._resolveTickFontOptions(0).size;return{w:r*s+a*o,h:r*o+a*s}}_getLabelCapacity(t){const n=this.options.time,r=n.displayFormats,i=r[n.unit]||r.millisecond,s=this._tickFormatFunction(t,0,Fy(this,[t],this._majorUnit),i),o=this._getLabelSize(s),a=Math.floor(this.isHorizontal()?this.width/o.w:this.height/o.h)-1;return a>0?a:1}getDataTimestamps(){let t=this._cache.data||[],n,r;if(t.length)return t;const i=this.getMatchingVisibleMetas();if(this._normalized&&i.length)return this._cache.data=i[0].controller.getAllParsedValues(this);for(n=0,r=i.length;n<r;++n)t=t.concat(i[n].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let n,r;if(t.length)return t;const i=this.getLabels();for(n=0,r=i.length;n<r;++n)t.push(Iy(this,i[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return N9(t.sort(Dy))}}be(pu,"id","time"),be(pu,"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 Al(e,t,n){let r=0,i=e.length-1,s,o,a,l;n?(t>=e[r].pos&&t<=e[i].pos&&({lo:r,hi:i}=Ei(e,"pos",t)),{pos:s,time:a}=e[r],{pos:o,time:l}=e[i]):(t>=e[r].time&&t<=e[i].time&&({lo:r,hi:i}=Ei(e,"time",t)),{time:s,pos:a}=e[r],{time:o,pos:l}=e[i]);const u=o-s;return u?a+(l-a)*(t-s)/u:a}class By extends pu{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=Al(n,this.min),this._tableRange=Al(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:n,max:r}=this,i=[],s=[];let o,a,l,u,c;for(o=0,a=t.length;o<a;++o)u=t[o],u>=n&&u<=r&&i.push(u);if(i.length<2)return[{time:n,pos:0},{time:r,pos:1}];for(o=0,a=i.length;o<a;++o)c=i[o+1],l=i[o-1],u=i[o],Math.round((c+l)/2)!==u&&s.push({time:u,pos:o/(a-1)});return s}_generate(){const t=this.min,n=this.max;let r=super.getDataTimestamps();return(!r.includes(t)||!r.length)&&r.splice(0,0,t),(!r.includes(n)||r.length===1)&&r.push(n),r.sort((i,s)=>i-s)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const n=this.getDataTimestamps(),r=this.getLabelTimestamps();return n.length&&r.length?t=this.normalize(n.concat(r)):t=n.length?n:r,t=this._cache.all=t,t}getDecimalForValue(t){return(Al(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return Al(this._table,r*this._tableRange+this._minPos,!0)}}be(By,"id","timeseries"),be(By,"defaults",pu.defaults);const Ob="label";function qy(e,t){typeof e=="function"?e(t):e&&(e.current=t)}function OA(e,t){const n=e.options;n&&t&&Object.assign(n,t)}function Eb(e,t){e.labels=t}function Ab(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Ob;const r=[];e.datasets=t.map(i=>{const s=e.datasets.find(o=>o[n]===i[n]);return!s||!i.data||r.includes(s)?{...i}:(r.push(s),Object.assign(s,i),s)})}function EA(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ob;const n={labels:[],datasets:[]};return Eb(n,e.labels),Ab(n,e.datasets,t),n}function AA(e,t){const{height:n=150,width:r=300,redraw:i=!1,datasetIdKey:s,type:o,data:a,options:l,plugins:u=[],fallbackContent:c,updateMode:d,...f}=e,h=F.useRef(null),y=F.useRef(null),m=()=>{h.current&&(y.current=new ec(h.current,{type:o,data:EA(a,s),options:l&&{...l},plugins:u}),qy(t,y.current))},p=()=>{qy(t,null),y.current&&(y.current.destroy(),y.current=null)};return F.useEffect(()=>{!i&&y.current&&l&&OA(y.current,l)},[i,l]),F.useEffect(()=>{!i&&y.current&&Eb(y.current.config.data,a.labels)},[i,a.labels]),F.useEffect(()=>{!i&&y.current&&a.datasets&&Ab(y.current.config.data,a.datasets,s)},[i,a.datasets]),F.useEffect(()=>{y.current&&(i?(p(),setTimeout(m)):y.current.update(d))},[i,l,a.labels,a.datasets,d]),F.useEffect(()=>{y.current&&(p(),setTimeout(m))},[o]),F.useEffect(()=>(m(),()=>p()),[]),F.createElement("canvas",{ref:h,role:"img",height:n,width:r,...f},c)}const TA=F.forwardRef(AA);function Tb(e,t){return ec.register(t),F.forwardRef((n,r)=>F.createElement(TA,{...n,ref:r,type:e}))}const PA=Tb("line",zl),jA=Tb("radar",Hl);ec.register(ef,nf,qo,ei,Kl,HE,XE,sA,QE);var sf={elements:{line:{backgroundColor:"rgba(166, 30, 105, 0.2)",borderColor:"rgba(166, 30, 105, 1)",borderWidth:4},point:{backgroundColor:"rgba(166, 30, 105, 1)",borderColor:"rgba(255,255,255, .9)",borderWidth:2,radius:5,hoverRadius:6,hoverBorderWidth:3}},responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!1},tooltip:{mode:"index",intersect:!1}},interaction:{mode:"nearest",axis:"x",intersect:!1}},MA=function(t){var n=t.chart.ctx,r=t.chart.chartArea;if(!r)return"rgba(166, 30, 105, 0.1)";var i=(r.left+r.right)/2,s=(r.top+r.bottom)/2,o=Math.min((r.right-r.left)/2,(r.bottom-r.top)/2),a=n.createRadialGradient(i,s,0,i,s,o);return a.addColorStop(0,"rgba(255, 255, 255, 0.4)"),a.addColorStop(.3,"rgba(255, 255, 255, 0.4)"),a.addColorStop(1,"rgba(166, 30, 105, 0.2)"),a};function zy(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Hy(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?zy(Object(n),!0).forEach(function(r){$A(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zy(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function $A(e,t,n){return(t=LA(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function LA(e){var t=DA(e,"string");return eo(t)=="symbol"?t:t+""}function DA(e,t){if(eo(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(eo(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function eo(e){"@babel/helpers - typeof";return eo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},eo(e)}function IA(e){var t=new Date(e);return isNaN(t.getTime())?String(e):t.toLocaleString("en-US",{month:"short",day:"numeric"})}var RA=function(){var t,n,r,i,s=hi(),o=s.data,a=s.isLoading,l=s.isRefetching,u=o==null?void 0:o.mentions,c=u==null||(t=u.mentionedInNumberOfQueries)===null||t===void 0||(t=t.previous)===null||t===void 0?void 0:t.difference,d=u==null?void 0:u.chart,f=Array.isArray(d==null?void 0:d.labels)?d.labels:d!=null&&d.labels&&eo(d.labels)==="object"?Object.values(d.labels):[],h=f.map(function(v){return IA(String(v))}),y=o==null?void 0:o.numberOfQueries;if(!y){var m=0;Array.isArray(d==null?void 0:d.datasets)&&d.datasets.forEach(function(v){Array.isArray(v==null?void 0:v.data)&&v.data.forEach(function(b){typeof b=="number"&&b>m&&(m=b)})}),y=m+2}var p=Hy(Hy({},sf),{},{responsive:!0,maintainAspectRatio:!1,scales:{x:{display:!0,title:{display:!1,text:"Date"},grid:{display:!1}},y:{display:!0,title:{display:!1,text:"Number of Mentions"},beginAtZero:!0,max:y,ticks:{stepSize:1}}}});return g.jsx(E.Card,{className:"yst-overflow-visible",children:g.jsxs(E.Card.Content,{className:"yst-space-y-4",children:[g.jsxs("div",{className:"yst-space-y-2",children:[g.jsx(Qa,{title:"Mentions progress",tooltip:"Tracks how your brand mentions have changed over time across the same query set."}),g.jsx(Wa,{score:u==null||(n=u.mentionedInNumberOfQueries)===null||n===void 0?void 0:n.value,total:o==null?void 0:o.numberOfQueries,delta:c,deltaSuffix:"since last analysis",suffix:"queries",isLoading:a||l})]}),Array.isArray(d==null||(r=d.datasets)===null||r===void 0?void 0:r.data)&&(d==null||(i=d.datasets)===null||i===void 0?void 0:i.data.length)<2?g.jsx(E.Alert,{variant:"info",children:"One more analysis needed to show more insights."}):g.jsx("div",{className:"yst-h-72",children:g.jsx(PA,{data:function(){var v={labels:h,datasets:[d==null?void 0:d.datasets]};return v}(),options:p})})]})})};function Tl(e){var t=e.value,n=t===void 0?"—":t,r=e.label,i=e.tooltip,s=e.className,o=e.borderBottom,a=o===void 0?!1:o,l=e.borderRight,u=l===void 0?!1:l,c=e.delta,d=e.tooltipPosition,f=d===void 0?"left":d;return g.jsxs("div",{className:ke("yst-relative yst-flex yst-flex-col yst-items-center yst-gap-1 yst-p-4 yst-text-center",a&&"yst-border-b yst-border-slate-200",u&&"yst-border-r yst-border-slate-200",s),children:[g.jsx("p",{className:"yst-text-2xl yst-font-bold yst-text-slate-900",children:n}),g.jsx("p",{className:"yst-text-tiny yst-text-slate-600",children:r}),typeof c=="number"&&g.jsxs("p",{className:ke("yst-flex yst-items-center yst-gap-1 yst-text-tiny yst-font-bold",ca(c)),children:[c>0?g.jsx(C2,{}):c<0?g.jsx(S2,{}):null,c>-1e-6&&"+",c]}),i&&g.jsx(Hf,{id:"tooltip-".concat(r.replace(/\s+/g,"-").toLowerCase()),className:"yst-absolute yst-right-2 yst-top-2",position:f,children:i})]})}function NA(e){var t=e.children,n=e.className;return g.jsx("div",{className:ke("yst-grid yst-w-full yst-grid-cols-2 yst-gap-0 yst-rounded-lg",n),children:t})}function FA(e){return e>0?"yst-text-green-600":e<0?"yst-text-red-600":"yst-text-slate-500"}function BA(e){var t=e.current,n=e.previous,r=e.className;if(typeof n!="number")return null;var i=t-n,s=i>0,o=i<0,a="".concat(i>0?"+":"").concat(i.toFixed(1),"%");return g.jsxs("div",{className:ke("yst-flex yst-items-center yst-gap-1 yst-text-tiny yst-font-bold",FA(i),r),"aria-label":s?"Visibility increased by ".concat(a):o?"Visibility decreased by ".concat(a):"No change in visibility",children:[s&&g.jsx(C2,{className:"yst-w-4 yst-h-4"}),o&&g.jsx(S2,{className:"yst-w-4 yst-h-4"}),a]})}function wa(e){"@babel/helpers - typeof";return wa=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wa(e)}function qA(e,t){return GA(e)||UA(e,t)||HA(e,t)||zA()}function zA(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
70
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function HA(e,t){if(e){if(typeof e=="string")return Uy(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Uy(e,t):void 0}}function Uy(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function UA(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,o,a=[],l=!0,u=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(l=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return a}}function GA(e){if(Array.isArray(e))return e}function Gy(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Pl(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Gy(Object(n),!0).forEach(function(r){KA(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Gy(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function KA(e,t,n){return(t=VA(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function VA(e){var t=WA(e,"string");return wa(t)=="symbol"?t:t+""}function WA(e,t){if(wa(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(wa(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function QA(){var e,t,n,r,i,s,o,a,l,u,c,d,f,h,y,m,p,v,b,S,C,x,k,w,_=Gn(),O=_.brandId,A=_.analysisId,T=qu(O,A,{query:{select:function(Ve){var ee=Ve.data;return ee},enabled:!!O&&!!A}}),j=T.data,B=T.isLoading,R=j==null||(e=j.analysis)===null||e===void 0?void 0:e.scans,P=Array.isArray(R)&&R.length>0?R.reduce(function(ze,Ve){if(!ze)return Ve;if(!(Ve!=null&&Ve.finishedAt)||!(ze!=null&&ze.finishedAt))return ze;var ee=new Date(Ve.finishedAt),$e=new Date(ze.finishedAt);return ee>$e?Ve:ze},R[0]):void 0,M=P==null||(t=P.scores)===null||t===void 0?void 0:t.standardized,I=(n=P==null||(r=P.mentions)===null||r===void 0||(r=r.mentionedInNumberOfQueries)===null||r===void 0?void 0:r.value)!==null&&n!==void 0?n:0,G=P==null||(i=P.mentions)===null||i===void 0||(i=i.mentionedInNumberOfQueries)===null||i===void 0||(i=i.previous)===null||i===void 0?void 0:i.difference,Y=(s=P==null||(o=P.scores)===null||o===void 0||(o=o.standardized)===null||o===void 0||(o=o.citations)===null||o===void 0?void 0:o.value)!==null&&s!==void 0?s:0,q=(a=P==null||(l=P.citations)===null||l===void 0||(l=l.total)===null||l===void 0?void 0:l.value)!==null&&a!==void 0?a:0,U=P==null||(u=P.citations)===null||u===void 0||(u=u.total)===null||u===void 0||(u=u.previous)===null||u===void 0?void 0:u.difference,z=P==null||(c=P.rankings)===null||c===void 0||(c=c.list)===null||c===void 0?void 0:c.find(function(ze){var Ve;return((Ve=ze.brand)===null||Ve===void 0?void 0:Ve.isSelf)===!0}),V=(d=z==null||(f=z.rank)===null||f===void 0?void 0:f.value)!==null&&d!==void 0?d:"—",N=z==null||(h=z.rank)===null||h===void 0||(h=h.previous)===null||h===void 0?void 0:h.difference;N&&(N=N*-1);var ne=(y=M==null||(m=M.visibility)===null||m===void 0?void 0:m.value)!==null&&y!==void 0?y:0,J=M==null||(p=M.visibility)===null||p===void 0||(p=p.previous)===null||p===void 0?void 0:p.value,he=(v=M==null||(b=M.ranking)===null||b===void 0?void 0:b.value)!==null&&v!==void 0?v:0,X=(S=M==null||(C=M.sentiment)===null||C===void 0?void 0:C.value)!==null&&S!==void 0?S:0,ge=(x=M==null||(k=M.mentions)===null||k===void 0?void 0:k.value)!==null&&x!==void 0?x:0,ye={labels:["Mentions","Ranking","Citations","Sentiment"],datasets:[{data:[ge,he,Y,X],backgroundColor:MA,pointBackgroundColor:"rgba(166, 30, 105, 1)"}]},je=Pl(Pl({},sf),{},{plugins:Pl(Pl({},sf.plugins),{},{tooltip:{mode:"point",intersect:!0,callbacks:{label:function(Ve){var ee=Ve.label||"",$e=Ve.parsed.r||0;return"".concat(ee,": ").concat($e,"%")}}}}),interaction:{mode:"point",intersect:!0},scales:{r:{beginAtZero:!0,min:0,max:100,ticks:{stepSize:20}}}}),se=F.useState(typeof window!="undefined"&&window.innerWidth<800?"top":"left"),nt=qA(se,2),Ie=nt[0],st=nt[1];return F.useEffect(function(){function ze(){st(window.innerWidth<800?"top":"left")}return window.addEventListener("resize",ze),function(){return window.removeEventListener("resize",ze)}},[]),g.jsx(E.Card,{className:"yst-overflow-visible md:yst-col-span-2",children:g.jsxs(E.Card.Content,{children:[g.jsx(E.Title,{size:"3",className:"yst-mb-2",children:"AI Visibility Index (AIVI)"}),g.jsx(Wa,{score:ne,total:100,isLoading:B}),g.jsx(BA,{current:ne,previous:J,className:"yst-mb-4"}),g.jsxs("div",{className:"yst-flex yst-flex-col yst-items-center yst-justify-around yst-justify-items-center yst-gap-8 md:yst-flex-row",children:[g.jsxs("div",{className:"yst-radar-chart-container yst-relative yst-aspect-square yst-h-full yst-w-full md:yst-flex md:yst-w-1/2 md:yst-items-center md:yst-justify-center",children:[g.jsx(jA,{data:ye,options:je}),g.jsx(Hf,{id:"tooltip-radar-chart",className:"yst-absolute yst-right-2 yst-top-2",position:"left",children:"The AI Visibility Index (AIVI) shows how visible your brand is across major AI platforms like ChatGPT, based on mentions, citations, sentiment, and rankings."})]}),g.jsx("div",{className:"yst-mt-6 yst-w-full md:yst-mt-0 md:yst-flex md:yst-w-1/2 md:yst-items-center",children:g.jsxs(NA,{children:[g.jsx(Tl,{value:I,label:"Mentions",tooltip:"Mentions show how often your brand appears in AI-generated answers to the questions we send to LLMs.",borderBottom:!0,borderRight:!0,delta:G,tooltipPosition:Ie}),g.jsx(Tl,{value:typeof V=="number"&&Number.isFinite(V)&&V>0?g.jsxs(g.Fragment,{children:["#",V,V===1&&" 🏆"]}):"—",label:"Competitor ranking",tooltip:"Ranking shows the position your brand is mentioned in AI-generated answers—whether in a numbered list or the order of appearance in full-text responses.",borderBottom:!0,delta:N}),g.jsx(Tl,{value:q,label:"Citations",tooltip:"Citations are the source links found in AI-generated answers. They form the basis for mentions, sentiment, and ranking insights.",borderRight:!0,delta:U,tooltipPosition:Ie}),g.jsx(Tl,{value:X?"".concat(X,"%"):"—",label:"Positive sentiment",tooltip:"Sentiment reflects how positively, neutrally, or negatively your brand is mentioned in AI-generated answers, based on the cited sources.",delta:P==null||(w=P.scores)===null||w===void 0||(w=w.standardized)===null||w===void 0||(w=w.sentiment)===null||w===void 0||(w=w.previous)===null||w===void 0?void 0:w.difference})]})})]})]})})}const YA="data:image/svg+xml,%3csvg%20width='17'%20height='17'%20viewBox='0%200%2017%2017'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M3.652%2015.0488C2.3816%2015.0488%201.348%2014.0152%201.348%2012.7448V5.22476C1.348%203.95436%202.3816%202.92075%203.652%202.92075H9.5912L9.9304%202.07275H3.652C1.9144%202.07275%200.5%203.48716%200.5%205.22476V12.7448C0.5%2014.4824%201.9144%2015.8968%203.652%2015.8968H3.6776V15.0488H3.652Z'%20fill='%23A61E69'/%3e%3cpath%20d='M16.5%205.22468C16.5%203.74948%2015.4824%202.51428%2014.1096%202.17188L13.812%202.97188C14.8584%203.18628%2015.6488%204.11748%2015.6488%205.22788V15.0519H9.16236C9.00236%2015.3527%208.83276%2015.6375%208.65356%2015.8999H16.4968V5.22468H16.5Z'%20fill='%23A61E69'/%3e%3cpath%20d='M11.5815%200.140137L8.03267%209.99614L6.28867%204.53374H4.15747L6.82307%2011.3785C7.06947%2012.0121%207.06947%2012.7129%206.82307%2013.3497C6.56387%2014.0121%206.10627%2014.8025%204.82947%2015.0361L4.77187%2015.0457V16.8633H4.84547C5.91107%2016.8185%206.73667%2016.4665%207.44387%2015.7561C8.16387%2015.0329%208.78147%2013.9065%209.38947%2012.2137L13.8919%200.140137H11.5815Z'%20fill='%23A61E69'/%3e%3c/svg%3e";var XA=function(){var t,n=hi(),r=n.data,i=n.isLoading,s=n.isRefetching;return i&&!s||(r==null||(t=r.mentions)===null||t===void 0||(t=t.mentionedInNumberOfQueries)===null||t===void 0?void 0:t.value)!==0?null:g.jsx(E.Card,{className:"yst-overflow-visible md:yst-col-span-2 yst-text-slate-800",children:g.jsxs(E.Card.Content,{className:"yst-space-y-4 yst-max-w-2xl",children:[g.jsx(E.Title,{size:"3",children:"We couldn’t find your brand in this brand analysis..."}),g.jsx("p",{children:"This means LLMs may not yet be surfacing your site in answers. Don’t worry, here are some steps you can take today to boost your AI visibility:"}),g.jsxs("ol",{className:"yst-list-decimal yst-ml-5 [&>li::marker]:yst-font-semibold ",children:[g.jsxs("li",{children:[g.jsx("strong",{children:"Activate llms.txt →"})," ",g.jsx("a",{href:"https://yoast.com/features/llms-txt/",target:"_blank",rel:"noopener noreferrer",children:"Set up llms.txt in Yoast SEO"}),"."," ","Make sure AI systems know where to look and which pages matter most."]}),g.jsxs("li",{children:[g.jsx("strong",{children:"Adopt an LLM-friendly content structure →"})," ",g.jsx("a",{href:"https://yoast.com/yoast-seo-premium-september-9-2025/",target:"_blank",rel:"noopener noreferrer",children:"See how in our latest update"}),". Start with clear definitions or TL;DRs, use subheadings, and format answers so LLMs can lift them directly."]}),g.jsxs("li",{children:[g.jsx("strong",{children:"Simplify writing and readability →"})," ","Use shorter sentences, plain language, and one idea per paragraph. This makes it easier for AI systems to recognize and quote your content."]})]}),g.jsxs("p",{children:["Want to go deeper? →"," ",g.jsx("a",{href:"https://yoast.com/how-to-optimize-content-for-llms/",target:"_blank",rel:"noopener noreferrer",children:"Read our full guide on optimizing content for LLMs"}),"."]})]})})};function ZA(e,t){return nT(e)||tT(e,t)||eT(e,t)||JA()}function JA(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
70
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function HA(e,t){if(e){if(typeof e=="string")return Uy(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Uy(e,t):void 0}}function Uy(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function UA(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,o,a=[],l=!0,u=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(l=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return a}}function GA(e){if(Array.isArray(e))return e}function Gy(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Pl(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Gy(Object(n),!0).forEach(function(r){KA(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Gy(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function KA(e,t,n){return(t=VA(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function VA(e){var t=WA(e,"string");return wa(t)=="symbol"?t:t+""}function WA(e,t){if(wa(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(wa(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function QA(){var e,t,n,r,i,s,o,a,l,u,c,d,f,h,y,m,p,v,b,S,C,x,k,w,_=Gn(),O=_.brandId,A=_.analysisId,T=qu(O,A,{query:{select:function(Ke){var ee=Ke.data;return ee},enabled:!!O&&!!A}}),j=T.data,B=T.isLoading,R=j==null||(e=j.analysis)===null||e===void 0?void 0:e.scans,P=Array.isArray(R)&&R.length>0?R.reduce(function(ze,Ke){if(!ze)return Ke;if(!(Ke!=null&&Ke.finishedAt)||!(ze!=null&&ze.finishedAt))return ze;var ee=new Date(Ke.finishedAt),$e=new Date(ze.finishedAt);return ee>$e?Ke:ze},R[0]):void 0,M=P==null||(t=P.scores)===null||t===void 0?void 0:t.standardized,I=(n=P==null||(r=P.mentions)===null||r===void 0||(r=r.mentionedInNumberOfQueries)===null||r===void 0?void 0:r.value)!==null&&n!==void 0?n:0,G=P==null||(i=P.mentions)===null||i===void 0||(i=i.mentionedInNumberOfQueries)===null||i===void 0||(i=i.previous)===null||i===void 0?void 0:i.difference,Y=(s=P==null||(o=P.scores)===null||o===void 0||(o=o.standardized)===null||o===void 0||(o=o.citations)===null||o===void 0?void 0:o.value)!==null&&s!==void 0?s:0,q=(a=P==null||(l=P.citations)===null||l===void 0||(l=l.total)===null||l===void 0?void 0:l.value)!==null&&a!==void 0?a:0,U=P==null||(u=P.citations)===null||u===void 0||(u=u.total)===null||u===void 0||(u=u.previous)===null||u===void 0?void 0:u.difference,z=P==null||(c=P.rankings)===null||c===void 0||(c=c.list)===null||c===void 0?void 0:c.find(function(ze){var Ke;return((Ke=ze.brand)===null||Ke===void 0?void 0:Ke.isSelf)===!0}),V=(d=z==null||(f=z.rank)===null||f===void 0?void 0:f.value)!==null&&d!==void 0?d:"—",N=z==null||(h=z.rank)===null||h===void 0||(h=h.previous)===null||h===void 0?void 0:h.difference;N&&(N=N*-1);var ne=(y=M==null||(m=M.visibility)===null||m===void 0?void 0:m.value)!==null&&y!==void 0?y:0,J=M==null||(p=M.visibility)===null||p===void 0||(p=p.previous)===null||p===void 0?void 0:p.value,he=(v=M==null||(b=M.ranking)===null||b===void 0?void 0:b.value)!==null&&v!==void 0?v:0,X=(S=M==null||(C=M.sentiment)===null||C===void 0?void 0:C.value)!==null&&S!==void 0?S:0,ge=(x=M==null||(k=M.mentions)===null||k===void 0?void 0:k.value)!==null&&x!==void 0?x:0,ye={labels:["Mentions","Ranking","Citations","Sentiment"],datasets:[{data:[ge,he,Y,X],backgroundColor:MA,pointBackgroundColor:"rgba(166, 30, 105, 1)"}]},je=Pl(Pl({},sf),{},{plugins:Pl(Pl({},sf.plugins),{},{tooltip:{mode:"point",intersect:!0,callbacks:{label:function(Ke){var ee=Ke.label||"",$e=Ke.parsed.r||0;return"".concat(ee,": ").concat($e,"%")}}}}),interaction:{mode:"point",intersect:!0},scales:{r:{beginAtZero:!0,min:0,max:100,ticks:{stepSize:20}}}}),se=F.useState(typeof window!="undefined"&&window.innerWidth<800?"top":"left"),nt=qA(se,2),Ie=nt[0],st=nt[1];return F.useEffect(function(){function ze(){st(window.innerWidth<800?"top":"left")}return window.addEventListener("resize",ze),function(){return window.removeEventListener("resize",ze)}},[]),g.jsx(E.Card,{className:"yst-overflow-visible md:yst-col-span-2",children:g.jsxs(E.Card.Content,{children:[g.jsx(E.Title,{size:"3",className:"yst-mb-2",children:"AI Visibility Index (AIVI)"}),g.jsx(Wa,{score:ne,total:100,isLoading:B}),g.jsx(BA,{current:ne,previous:J,className:"yst-mb-4"}),g.jsxs("div",{className:"yst-flex yst-flex-col yst-items-center yst-justify-around yst-justify-items-center yst-gap-8 md:yst-flex-row",children:[g.jsxs("div",{className:"yst-radar-chart-container yst-relative yst-aspect-square yst-h-full yst-w-full md:yst-flex md:yst-w-1/2 md:yst-items-center md:yst-justify-center",children:[g.jsx(jA,{data:ye,options:je}),g.jsx(Hf,{id:"tooltip-radar-chart",className:"yst-absolute yst-right-2 yst-top-2",position:"left",children:"The AI Visibility Index (AIVI) shows how visible your brand is across major AI platforms like ChatGPT, based on mentions, citations, sentiment, and rankings."})]}),g.jsx("div",{className:"yst-mt-6 yst-w-full md:yst-mt-0 md:yst-flex md:yst-w-1/2 md:yst-items-center",children:g.jsxs(NA,{children:[g.jsx(Tl,{value:I,label:"Mentions",tooltip:"Mentions show how often your brand appears in AI-generated answers to the questions we send to LLMs.",borderBottom:!0,borderRight:!0,delta:G,tooltipPosition:Ie}),g.jsx(Tl,{value:typeof V=="number"&&Number.isFinite(V)&&V>0?g.jsxs(g.Fragment,{children:["#",V,V===1&&" 🏆"]}):"—",label:"Competitor ranking",tooltip:"Ranking shows the position your brand is mentioned in AI-generated answers—whether in a numbered list or the order of appearance in full-text responses.",borderBottom:!0,delta:N}),g.jsx(Tl,{value:q,label:"Citations",tooltip:"Citations are the source links found in AI-generated answers. They form the basis for mentions, sentiment, and ranking insights.",borderRight:!0,delta:U,tooltipPosition:Ie}),g.jsx(Tl,{value:X?"".concat(X,"%"):"—",label:"Positive sentiment",tooltip:"Sentiment reflects how positively, neutrally, or negatively your brand is mentioned in AI-generated answers, based on the cited sources.",delta:P==null||(w=P.scores)===null||w===void 0||(w=w.standardized)===null||w===void 0||(w=w.sentiment)===null||w===void 0||(w=w.previous)===null||w===void 0?void 0:w.difference})]})})]})]})})}const YA="data:image/svg+xml,%3csvg%20width='17'%20height='17'%20viewBox='0%200%2017%2017'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M3.652%2015.0488C2.3816%2015.0488%201.348%2014.0152%201.348%2012.7448V5.22476C1.348%203.95436%202.3816%202.92075%203.652%202.92075H9.5912L9.9304%202.07275H3.652C1.9144%202.07275%200.5%203.48716%200.5%205.22476V12.7448C0.5%2014.4824%201.9144%2015.8968%203.652%2015.8968H3.6776V15.0488H3.652Z'%20fill='%23A61E69'/%3e%3cpath%20d='M16.5%205.22468C16.5%203.74948%2015.4824%202.51428%2014.1096%202.17188L13.812%202.97188C14.8584%203.18628%2015.6488%204.11748%2015.6488%205.22788V15.0519H9.16236C9.00236%2015.3527%208.83276%2015.6375%208.65356%2015.8999H16.4968V5.22468H16.5Z'%20fill='%23A61E69'/%3e%3cpath%20d='M11.5815%200.140137L8.03267%209.99614L6.28867%204.53374H4.15747L6.82307%2011.3785C7.06947%2012.0121%207.06947%2012.7129%206.82307%2013.3497C6.56387%2014.0121%206.10627%2014.8025%204.82947%2015.0361L4.77187%2015.0457V16.8633H4.84547C5.91107%2016.8185%206.73667%2016.4665%207.44387%2015.7561C8.16387%2015.0329%208.78147%2013.9065%209.38947%2012.2137L13.8919%200.140137H11.5815Z'%20fill='%23A61E69'/%3e%3c/svg%3e";var XA=function(){var t,n=hi(),r=n.data,i=n.isLoading,s=n.isRefetching;return i&&!s||(r==null||(t=r.mentions)===null||t===void 0||(t=t.mentionedInNumberOfQueries)===null||t===void 0?void 0:t.value)!==0?null:g.jsx(E.Card,{className:"yst-overflow-visible md:yst-col-span-2 yst-text-slate-800",children:g.jsxs(E.Card.Content,{className:"yst-space-y-4 yst-max-w-2xl",children:[g.jsx(E.Title,{size:"3",children:"We couldn’t find your brand in this brand analysis..."}),g.jsx("p",{children:"This means LLMs may not yet be surfacing your site in answers. Don’t worry, here are some steps you can take today to boost your AI visibility:"}),g.jsxs("ol",{className:"yst-list-decimal yst-ml-5 [&>li::marker]:yst-font-semibold ",children:[g.jsxs("li",{children:[g.jsx("strong",{children:"Activate llms.txt →"})," ",g.jsx("a",{href:"https://yoast.com/features/llms-txt/",target:"_blank",rel:"noopener noreferrer",children:"Set up llms.txt in Yoast SEO"}),"."," ","Make sure AI systems know where to look and which pages matter most."]}),g.jsxs("li",{children:[g.jsx("strong",{children:"Adopt an LLM-friendly content structure →"})," ",g.jsx("a",{href:"https://yoast.com/yoast-seo-premium-september-9-2025/",target:"_blank",rel:"noopener noreferrer",children:"See how in our latest update"}),". Start with clear definitions or TL;DRs, use subheadings, and format answers so LLMs can lift them directly."]}),g.jsxs("li",{children:[g.jsx("strong",{children:"Simplify writing and readability →"})," ","Use shorter sentences, plain language, and one idea per paragraph. This makes it easier for AI systems to recognize and quote your content."]})]}),g.jsxs("p",{children:["Want to go deeper? →"," ",g.jsx("a",{href:"https://yoast.com/how-to-optimize-content-for-llms/",target:"_blank",rel:"noopener noreferrer",children:"Read our full guide on optimizing content for LLMs"}),"."]})]})})};function ZA(e,t){return nT(e)||tT(e,t)||eT(e,t)||JA()}function JA(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
71
71
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function eT(e,t){if(e){if(typeof e=="string")return Ky(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ky(e,t):void 0}}function Ky(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function tT(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,o,a=[],l=!0,u=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(l=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return a}}function nT(e){if(Array.isArray(e))return e}var Qc=function(){var t=Gn(),n=t.brandId,r=t.analysisId,i=es({query:{select:function(_){var O=_.data;return O==null?void 0:O.brands}}}),s=i.data,o=i.isLoading,a=qu(n,r,{query:{enabled:!!n&&J6(r),select:function(_){var O=_.data;return O==null?void 0:O.analysis}}}),l=a.data,u=a.isLoading,c=l==null?void 0:l.status,d=o||u,f=s&&(s==null?void 0:s.length)>0,h=!d&&l&&c===qr.completed,y=F.useState(!1),m=ZA(y,2),p=m[0],v=m[1],b=F.useRef(null),S=F.useRef(void 0),C=localStorage.getItem("yst_congratulations_toast_seen")==="true";F.useEffect(function(){return h&&!S.current&&!C&&(b.current=setTimeout(function(){v(!0),localStorage.setItem("yst_congratulations_toast_seen","true")},1e4)),!h&&S.current&&(v(!1),b.current&&(clearTimeout(b.current),b.current=null)),S.current=h,function(){b.current&&(clearTimeout(b.current),b.current=null)}},[h,C]);function x(w){var _=w.children;if(typeof window=="undefined")return null;var O=document.getElementById("tsx-toasts");return O?Ap.createPortal(_,O):null}var k=function(_){var O=_.isVisible,A=_.setIsVisible,T=function(){A(!1)};return g.jsxs(E.Toast,{id:"toast",isVisible:O,setIsVisible:function(j){j||A(!1)},children:[g.jsxs("div",{className:"yst-mb-3 yst-flex yst-items-start yst-gap-3",children:[g.jsx("img",{src:YA}),g.jsxs("div",{className:"yst-grow",children:[g.jsx(E.Title,{size:"3",className:"yst-mb-1",children:"Congratulations on your first analysis!"}),"You’ve completed your brand analysis. We’d love to hear what you think."]}),g.jsx(E.Button,{variant:"tertiary",onClick:T,children:g.jsx(O2,{})})]}),g.jsxs("div",{className:"yst-flex yst-justify-end yst-gap-4",children:[g.jsx(E.Button,{variant:"tertiary",onClick:T,children:"Dismiss"}),g.jsxs(E.Button,{as:"a",href:"https://www.surveymonkey.com/r/HGSB8DL",target:"_blank",children:["Give feedback",g.jsx(k2,{className:"yst-ml-2"})]})]})]})};return o?g.jsx(Gu,{}):f?g.jsxs("div",{className:"yst-space-y-4",children:[g.jsx(Q7,{}),h&&g.jsxs("div",{className:"yst-space-y-4",children:[g.jsxs("div",{className:"yst-flex yst-items-center yst-justify-between",children:[g.jsx(E.Title,{size:"2",children:"Your brand analysis"}),g.jsxs(E.Button,{as:di,variant:"secondary",to:"/brands/".concat(n,"/brand-list"),className:ke("yst-gap-1.5"),disabled:!n,children:[g.jsx(b2,{})," Edit brand list"]})]}),g.jsxs("div",{className:"yst-grid yst-grid-cols-1 yst-gap-4 md:yst-grid-cols-2",children:[g.jsx(XA,{}),g.jsx(QA,{}),g.jsx(Y7,{}),g.jsx(RA,{}),g.jsx(r8,{}),g.jsx(X_,{}),g.jsx(I_,{}),g.jsx(i8,{})]}),g.jsx(x,{children:g.jsx(k,{isVisible:p,setIsVisible:v})})]})]}):g.jsx(x_,{})};function Pb(e){var t=e.children,n=e.description,r=e.title;return g.jsxs(E.Card.Header,{className:"yst-h-auto yst-flex-col yst-items-start yst-gap-0 yst-border-b-[1px] yst-border-b-slate-200 yst-bg-white yst-py-8",children:[r&&g.jsx(E.Title,{className:ke({"yst-mb-3":n||t}),children:r}),n&&g.jsx("p",{children:n}),t]})}var rT=function(){return g.jsx(E.Card,{className:"yst-mb-4",children:g.jsxs(E.Card.Content,{className:"yst-flex yst-flex-col yst-gap-8",children:[g.jsx(E.Title,{size:"2",children:"Query - Best fish restaurant in Nijmegen"}),g.jsxs("div",{children:[g.jsx("p",{children:"AI Response:"}),g.jsx(E.Link,{href:"#todo",children:"Show more"})]}),g.jsxs("div",{children:[g.jsx("p",{children:"Extracted brands:"}),g.jsx(E.Badge,{children:"Example"}),g.jsx(E.Badge,{children:"Example"}),g.jsx(E.Badge,{children:"Example"}),g.jsx(E.Badge,{children:"Example"}),g.jsx(E.Badge,{children:"Example"})]}),g.jsxs(E.Table,{children:[g.jsx(E.Table.Head,{children:g.jsxs(E.Table.Row,{children:[g.jsx(E.Table.Header,{children:"URL"}),g.jsx(E.Table.Header,{children:"Associated brand"})]})}),g.jsxs(E.Table.Body,{children:[g.jsxs(E.Table.Row,{children:[g.jsx(E.Table.Cell,{children:g.jsx(E.Link,{href:"https://example.com",target:"_blank",children:"https://example.com"})}),g.jsx(E.Table.Cell,{children:"Example Brand"})]}),g.jsxs(E.Table.Row,{children:[g.jsx(E.Table.Cell,{children:g.jsx(E.Link,{href:"https://example2.com",target:"_blank",children:"https://example2.com"})}),g.jsx(E.Table.Cell,{children:"Example Brand 2"})]})]})]})]})})},iT=function(){return g.jsxs(E.Card,{children:[g.jsx(Pb,{title:"Query history"}),g.jsx(E.Card,{className:"yst-mb-4",children:g.jsxs(E.Card.Content,{children:[g.jsxs("p",{className:"yst-mb-8",children:["Manna Fish Restaurant - Analysis performed on:"," ",g.jsx(E.Badge,{children:"2025-04-08 12:31:21"})]}),[0,1,2,3,4].map(function(t){return g.jsx(rT,{},t)})]})})]})},sT=F.lazy(function(){return Promise.resolve().then(()=>yD)}),oT=F.lazy(function(){return Promise.resolve().then(()=>HD)}),aT=F.lazy(function(){return Promise.resolve().then(()=>KD)}),lT=F.lazy(function(){return Promise.resolve().then(()=>oI)}),uT=F.lazy(function(){return Promise.resolve().then(()=>_I)}),cT=F.lazy(function(){return Promise.resolve().then(()=>PI)}),dT=new u3({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:!1,staleTime:1e3*60*5},mutations:{retry:!1}}}),fr=function(){return g.jsx("div",{className:"yst-flex yst-min-h-[200px] yst-items-center yst-justify-center",children:g.jsxs("div",{className:"yst-w-full yst-max-w-md yst-space-y-3",children:[g.jsx(E.SkeletonLoader,{className:"yst-h-8 yst-w-3/4"}),g.jsx(E.SkeletonLoader,{className:"yst-h-6 yst-w-full"}),g.jsx(E.SkeletonLoader,{className:"yst-h-6 yst-w-2/3"})]})})},fT=function(t){var n=t.hideNav,r=n===void 0?!1:n,i=t.disableLayout,s=i===void 0?!1:i,o=t.DebugInfo;return g.jsx(yw,{children:g.jsxs(At,{element:g.jsx(F6,{hideNav:r,disableLayout:s,DebugInfo:o}),children:[g.jsxs(At,{path:"/",element:g.jsx(Ws,{}),children:[g.jsx(At,{index:!0,element:g.jsxs(F.Suspense,{fallback:g.jsx(fr,{}),children:[g.jsx(cr,{title:"AI Brand Insights"}),g.jsx(Qc,{})]})}),g.jsxs(At,{path:"brands/:brandId",element:g.jsx(q0,{}),children:[g.jsx(At,{index:!0,element:g.jsx(Qc,{})}),g.jsx(At,{path:"brand-list",element:g.jsxs(F.Suspense,{fallback:g.jsx(fr,{}),children:[g.jsx(cr,{title:"Brands - AI Brand Insights"}),g.jsx(sT,{})]})}),g.jsx(At,{path:"analysis/:analysisId",element:g.jsx(B6,{}),children:g.jsx(At,{index:!0,element:g.jsxs(F.Suspense,{fallback:g.jsx(fr,{}),children:[g.jsx(cr,{title:"Analysis - AI Brand Insights"}),g.jsx(Qc,{})]})})})]}),g.jsxs(At,{path:"/setup",element:g.jsxs(F.Suspense,{fallback:g.jsx(fr,{}),children:[g.jsx(cr,{title:"Setup brand - AI Brand Insights"}),g.jsx(aT,{})]}),children:[g.jsx(At,{index:!0,element:g.jsxs(F.Suspense,{fallback:g.jsx(fr,{}),children:[g.jsx(cr,{title:"AI Brand Insights"}),g.jsx(lT,{})]})}),g.jsxs(At,{path:":brandId",element:g.jsx(q0,{}),children:[g.jsx(At,{path:"queries",element:g.jsxs(F.Suspense,{fallback:g.jsx(fr,{}),children:[g.jsx(cr,{title:"Setup queries - AI Brand Insights"}),g.jsx(uT,{})]})}),g.jsx(At,{path:"analysis",element:g.jsxs(F.Suspense,{fallback:g.jsx(fr,{}),children:[g.jsx(cr,{title:"Analysis - AI Brand Insights"}),g.jsx(cT,{})]})})]})]})]}),g.jsx(At,{path:"/settings",element:g.jsxs(F.Suspense,{fallback:g.jsx(fr,{}),children:[g.jsx(cr,{title:"Settings - AI Brand Insights"}),g.jsx(oT,{})]})}),g.jsx(At,{path:"/query-history",element:g.jsxs(F.Suspense,{fallback:g.jsx(fr,{}),children:[g.jsx(cr,{title:"Query history - AI Brand Insights"}),g.jsx(iT,{})]})}),!1]})})},hT=function(t){var n=t.DebugInfo,r=t.hostAppProps;return g.jsxs(g3,{client:dT,children:[g.jsx(Q6,{children:g.jsxs(q4,{hostAppProps:r,children:[g.jsx(fT,{DebugInfo:n}),g.jsx(Y6,{})]})}),g.jsx(tC,{initialIsOpen:!1})]})};function gT(e){var t=e.subpath,n=t===void 0?"/":t,r=e.onNavigate,i=xn(),s=qt(),o=F.useRef(n),a=F.useRef(null),l=F.useRef(!1),u="".concat(s.pathname).concat(s.search).concat(s.hash),c=F.useCallback(r,[r]);return F.useEffect(function(){if(n===u){o.current=n;return}l.current||n!==o.current&&(o.current=n,a.current=n,l.current=!0,i(n,{replace:!0}),setTimeout(function(){l.current=!1},10))},[n,u,i]),F.useEffect(function(){l.current||u!==n&&u!==a.current&&(a.current=u,c(u))},[u,n,c]),null}function yT(e,t){return bT(e)||vT(e,t)||pT(e,t)||mT()}function mT(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
72
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function pT(e,t){if(e){if(typeof e=="string")return Vy(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Vy(e,t):void 0}}function Vy(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function vT(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,o,a=[],l=!0,u=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(l=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return a}}function bT(e){if(Array.isArray(e))return e}var xT=function(t){var n=t.isRtl,r=n===void 0?!1:n,i=t.className,s=t.style,o=t.token,a=o===void 0?"":o,l=t.apiUrl,u=t.DebugInfo,c=t.basename,d=c===void 0?"/":c,f=t.subpath,h=f===void 0?"/":f,y=t.onNavigate,m=y===void 0?function(){}:y,p=t.onLogout,v=p===void 0?function(){}:p,b=t.onAddSubscription,S=b===void 0?function(){}:b,C=function(T,j){var B=T.endsWith("/")?T.slice(0,-1):T,R=j.startsWith("/")?j:"/".concat(j);return B+R||"/"},x=F.useState(!!(a||l)),k=yT(x,2),w=k[0],_=k[1],O={onAddSubscription:S,onLogout:v,onNavigate:m,DebugInfo:u,basename:d,subpath:h};return F.useEffect(function(){l&&f2(l),N5(typeof a!="function"?function(){return a}:a),_(!1)},[l,a]),w?g.jsx("div",{className:i,style:s,children:g.jsx(E.Spinner,{})}):g.jsx("div",{className:i,style:s,children:g.jsxs(hw,{initialEntries:[C(d,h)],basename:d||"/",children:[g.jsx(gT,{subpath:h,onNavigate:m}),g.jsx(E.Root,{context:{isRtl:r},children:g.jsx(hT,{DebugInfo:u,hostAppProps:O})})]})})},wT=e=>e!=null,ST=e=>e.filter(wT);function CT(e){return(...t)=>{for(const n of e)n&&n(...t)}}var Z=e=>typeof e=="function"&&!e.length?e():e,of=e=>Array.isArray(e)?e:e?[e]:[];function _T(e,...t){return typeof e=="function"?e(...t):e}var kT=Ce;function OT(e,t,n,r){const i=e.length,s=t.length;let o=0;if(!s){for(;o<i;o++)n(e[o]);return}if(!i){for(;o<s;o++)r(t[o]);return}for(;o<s&&t[o]===e[o];o++);let a,l;t=t.slice(o),e=e.slice(o);for(a of t)e.includes(a)||r(a);for(l of e)t.includes(l)||n(l)}function ET(e){const[t,n]=ae(),r=e!=null&&e.throw?(f,h)=>{throw n(f instanceof Error?f:new Error(h)),f}:(f,h)=>{n(f instanceof Error?f:new Error(h))},i=e!=null&&e.api?Array.isArray(e.api)?e.api:[e.api]:[globalThis.localStorage].filter(Boolean),s=e!=null&&e.prefix?`${e.prefix}.`:"",o=new Map,a=new Proxy({},{get(f,h){let y=o.get(h);y||(y=ae(void 0,{equals:!1}),o.set(h,y)),y[0]();const m=i.reduce((p,v)=>{if(p!==null||!v)return p;try{return v.getItem(`${s}${h}`)}catch(b){return r(b,`Error reading ${s}${h} from ${v.name}`),null}},null);return m!==null&&(e!=null&&e.deserializer)?e.deserializer(m,h,e.options):m}}),l=(f,h,y)=>{const m=e!=null&&e.serializer?e.serializer(h,f,y!=null?y:e.options):h,p=`${s}${f}`;i.forEach(b=>{try{b.getItem(p)!==m&&b.setItem(p,m)}catch(S){r(S,`Error setting ${s}${f} to ${m} in ${b.name}`)}});const v=o.get(f);v&&v[1]()},u=f=>i.forEach(h=>{try{h.removeItem(`${s}${f}`)}catch(y){r(y,`Error removing ${s}${f} from ${h.name}`)}}),c=()=>i.forEach(f=>{try{f.clear()}catch(h){r(h,`Error clearing ${f.name}`)}}),d=()=>{const f={},h=(y,m)=>{if(!f.hasOwnProperty(y)){const p=m&&(e!=null&&e.deserializer)?e.deserializer(m,y,e.options):m;p&&(f[y]=p)}};return i.forEach(y=>{if(typeof y.getAll=="function"){let m;try{m=y.getAll()}catch(p){r(p,`Error getting all values from in ${y.name}`)}for(const p of m)h(p,m[p])}else{let m=0,p;try{for(;p=y.key(m++);)f.hasOwnProperty(p)||h(p,y.getItem(p))}catch(v){r(v,`Error getting all values from ${y.name}`)}}}),f};return(e==null?void 0:e.sync)!==!1&&Pr(()=>{const f=h=>{var m;let y=!1;i.forEach(p=>{try{p!==h.storageArea&&h.key&&h.newValue!==p.getItem(h.key)&&(h.newValue?p.setItem(h.key,h.newValue):p.removeItem(h.key),y=!0)}catch(v){r(v,`Error synching api ${p.name} from storage event (${h.key}=${h.newValue})`)}}),y&&h.key&&((m=o.get(h.key))==null||m[1]())};"addEventListener"in globalThis?(globalThis.addEventListener("storage",f),Ce(()=>globalThis.removeEventListener("storage",f))):(i.forEach(h=>{var y;return(y=h.addEventListener)==null?void 0:y.call(h,"storage",f)}),Ce(()=>i.forEach(h=>{var y;return(y=h.removeEventListener)==null?void 0:y.call(h,"storage",f)})))}),[a,l,{clear:c,error:t,remove:u,toJSON:d}]}var jb=ET,AT=e=>(typeof e.clear=="function"||(e.clear=()=>{let t;for(;t=e.key(0);)e.removeItem(t)}),e),Wy=e=>{if(!e)return"";let t="";for(const n in e){if(!e.hasOwnProperty(n))continue;const r=e[n];t+=r instanceof Date?`; ${n}=${r.toUTCString()}`:typeof r=="boolean"?`; ${n}`:`; ${n}=${r}`}return t},Sn=AT({_cookies:[globalThis.document,"cookie"],getItem:e=>{var t,n;return(n=(t=Sn._cookies[0][Sn._cookies[1]].match("(^|;)\\s*"+e+"\\s*=\\s*([^;]+)"))==null?void 0:t.pop())!=null?n:null},setItem:(e,t,n)=>{const r=Sn.getItem(e);Sn._cookies[0][Sn._cookies[1]]=`${e}=${t}${Wy(n)}`;const i=Object.assign(new Event("storage"),{key:e,oldValue:r,newValue:t,url:globalThis.document.URL,storageArea:Sn});window.dispatchEvent(i)},removeItem:e=>{Sn._cookies[0][Sn._cookies[1]]=`${e}=deleted${Wy({expires:new Date(0)})}`},key:e=>{let t=null,n=0;return Sn._cookies[0][Sn._cookies[1]].replace(/(?:^|;)\s*(.+?)\s*=\s*[^;]+/g,(r,i)=>(!t&&i&&n++===e&&(t=i),"")),t},get length(){let e=0;return Sn._cookies[0][Sn._cookies[1]].replace(/(?:^|;)\s*.+?\s*=\s*[^;]+/g,t=>(e+=t?1:0,"")),e}}),TT=1024,Wi=796,oh=700,PT="bottom-right",af="bottom",Mb="system",jT=!1,$b=500,MT=500,Lb=500,$T=Object.keys(Ad)[0],Qy=1,LT=Object.keys(Td)[0],ah=_t({client:void 0,onlineManager:void 0,queryFlavor:"",version:"",shadowDOMTarget:void 0});function ve(){return kt(ah)}var Db=_t(void 0),Ib=e=>{const[t,n]=ae(null),r=()=>{const o=t();o!=null&&(o.close(),n(null))},i=(o,a)=>{if(t()!=null)return;const l=window.open("","TSQD-Devtools-Panel",`width=${o},height=${a},popup`);if(!l)throw new Error("Failed to open popup. Please allow popups for this site to view the devtools in picture-in-picture mode.");l.document.head.innerHTML="",l.document.body.innerHTML="",rS(l.document),l.document.title="TanStack Query Devtools",l.document.body.style.margin="0",l.addEventListener("pagehide",()=>{e.setLocalStore("pip_open","false"),n(null)}),[...(ve().shadowDOMTarget||document).styleSheets].forEach(u=>{try{const c=[...u.cssRules].map(y=>y.cssText).join(""),d=document.createElement("style"),f=u.ownerNode;let h="";f&&"id"in f&&(h=f.id),h&&d.setAttribute("id",h),d.textContent=c,l.document.head.appendChild(d)}catch(c){const d=document.createElement("link");if(u.href==null)return;d.rel="stylesheet",d.type=u.type,d.media=u.media.toString(),d.href=u.href,l.document.head.appendChild(d)}}),Mu(["focusin","focusout","pointermove","keydown","pointerdown","pointerup","click","mousedown","input"],l.document),e.setLocalStore("pip_open","true"),n(l)};Se(()=>{var a;((a=e.localStore.pip_open)!=null?a:"false")==="true"&&!e.disabled&&i(Number(window.innerWidth),Number(e.localStore.height||MT))}),Se(()=>{const o=(ve().shadowDOMTarget||document).querySelector("#_goober"),a=t();if(o&&a){const l=new MutationObserver(()=>{const u=(ve().shadowDOMTarget||a.document).querySelector("#_goober");u&&(u.textContent=o.textContent)});l.observe(o,{childList:!0,subtree:!0,characterDataOldValue:!0}),Ce(()=>{l.disconnect()})}});const s=K(()=>{var o;return{pipWindow:t(),requestPipWindow:i,closePipWindow:r,disabled:(o=e.disabled)!=null?o:!1}});return L(Db.Provider,{value:s,get children(){return e.children}})},lh=()=>K(()=>{const t=kt(Db);if(!t)throw new Error("usePiPWindow must be used within a PiPProvider");return t()}),uh=_t(()=>"dark");function Ct(){return kt(uh)}var Rb={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",Ấ:"A",Ắ:"A",Ẳ:"A",Ẵ:"A",Ặ:"A",Æ:"AE",Ầ:"A",Ằ:"A",Ȃ:"A",Ç:"C",Ḉ:"C",È:"E",É:"E",Ê:"E",Ë:"E",Ế:"E",Ḗ:"E",Ề:"E",Ḕ:"E",Ḝ:"E",Ȇ:"E",Ì:"I",Í:"I",Î:"I",Ï:"I",Ḯ:"I",Ȋ:"I",Ð:"D",Ñ:"N",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",Ố:"O",Ṍ:"O",Ṓ:"O",Ȏ:"O",Ù:"U",Ú:"U",Û:"U",Ü:"U",Ý:"Y",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",ấ:"a",ắ:"a",ẳ:"a",ẵ:"a",ặ:"a",æ:"ae",ầ:"a",ằ:"a",ȃ:"a",ç:"c",ḉ:"c",è:"e",é:"e",ê:"e",ë:"e",ế:"e",ḗ:"e",ề:"e",ḕ:"e",ḝ:"e",ȇ:"e",ì:"i",í:"i",î:"i",ï:"i",ḯ:"i",ȋ:"i",ð:"d",ñ:"n",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",ố:"o",ṍ:"o",ṓ:"o",ȏ:"o",ù:"u",ú:"u",û:"u",ü:"u",ý:"y",ÿ:"y",Ā:"A",ā:"a",Ă:"A",ă:"a",Ą:"A",ą:"a",Ć:"C",ć:"c",Ĉ:"C",ĉ:"c",Ċ:"C",ċ:"c",Č:"C",č:"c",C̆:"C",c̆:"c",Ď:"D",ď:"d",Đ:"D",đ:"d",Ē:"E",ē:"e",Ĕ:"E",ĕ:"e",Ė:"E",ė:"e",Ę:"E",ę:"e",Ě:"E",ě:"e",Ĝ:"G",Ǵ:"G",ĝ:"g",ǵ:"g",Ğ:"G",ğ:"g",Ġ:"G",ġ:"g",Ģ:"G",ģ:"g",Ĥ:"H",ĥ:"h",Ħ:"H",ħ:"h",Ḫ:"H",ḫ:"h",Ĩ:"I",ĩ:"i",Ī:"I",ī:"i",Ĭ:"I",ĭ:"i",Į:"I",į:"i",İ:"I",ı:"i",IJ:"IJ",ij:"ij",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",Ḱ:"K",ḱ:"k",K̆:"K",k̆:"k",Ĺ:"L",ĺ:"l",Ļ:"L",ļ:"l",Ľ:"L",ľ:"l",Ŀ:"L",ŀ:"l",Ł:"l",ł:"l",Ḿ:"M",ḿ:"m",M̆:"M",m̆:"m",Ń:"N",ń:"n",Ņ:"N",ņ:"n",Ň:"N",ň:"n",ʼn:"n",N̆:"N",n̆:"n",Ō:"O",ō:"o",Ŏ:"O",ŏ:"o",Ő:"O",ő:"o",Œ:"OE",œ:"oe",P̆:"P",p̆:"p",Ŕ:"R",ŕ:"r",Ŗ:"R",ŗ:"r",Ř:"R",ř:"r",R̆:"R",r̆:"r",Ȓ:"R",ȓ:"r",Ś:"S",ś:"s",Ŝ:"S",ŝ:"s",Ş:"S",Ș:"S",ș:"s",ş:"s",Š:"S",š:"s",Ţ:"T",ţ:"t",ț:"t",Ț:"T",Ť:"T",ť:"t",Ŧ:"T",ŧ:"t",T̆:"T",t̆:"t",Ũ:"U",ũ:"u",Ū:"U",ū:"u",Ŭ:"U",ŭ:"u",Ů:"U",ů:"u",Ű:"U",ű:"u",Ų:"U",ų:"u",Ȗ:"U",ȗ:"u",V̆:"V",v̆:"v",Ŵ:"W",ŵ:"w",Ẃ:"W",ẃ:"w",X̆:"X",x̆:"x",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Y̆:"Y",y̆:"y",Ź:"Z",ź:"z",Ż:"Z",ż:"z",Ž:"Z",ž:"z",ſ:"s",ƒ:"f",Ơ:"O",ơ:"o",Ư:"U",ư:"u",Ǎ:"A",ǎ:"a",Ǐ:"I",ǐ:"i",Ǒ:"O",ǒ:"o",Ǔ:"U",ǔ:"u",Ǖ:"U",ǖ:"u",Ǘ:"U",ǘ:"u",Ǚ:"U",ǚ:"u",Ǜ:"U",ǜ:"u",Ứ:"U",ứ:"u",Ṹ:"U",ṹ:"u",Ǻ:"A",ǻ:"a",Ǽ:"AE",ǽ:"ae",Ǿ:"O",ǿ:"o",Þ:"TH",þ:"th",Ṕ:"P",ṕ:"p",Ṥ:"S",ṥ:"s",X́:"X",x́:"x",Ѓ:"Г",ѓ:"г",Ќ:"К",ќ:"к",A̋:"A",a̋:"a",E̋:"E",e̋:"e",I̋:"I",i̋:"i",Ǹ:"N",ǹ:"n",Ồ:"O",ồ:"o",Ṑ:"O",ṑ:"o",Ừ:"U",ừ:"u",Ẁ:"W",ẁ:"w",Ỳ:"Y",ỳ:"y",Ȁ:"A",ȁ:"a",Ȅ:"E",ȅ:"e",Ȉ:"I",ȉ:"i",Ȍ:"O",ȍ:"o",Ȑ:"R",ȑ:"r",Ȕ:"U",ȕ:"u",B̌:"B",b̌:"b",Č̣:"C",č̣:"c",Ê̌:"E",ê̌:"e",F̌:"F",f̌:"f",Ǧ:"G",ǧ:"g",Ȟ:"H",ȟ:"h",J̌:"J",ǰ:"j",Ǩ:"K",ǩ:"k",M̌:"M",m̌:"m",P̌:"P",p̌:"p",Q̌:"Q",q̌:"q",Ř̩:"R",ř̩:"r",Ṧ:"S",ṧ:"s",V̌:"V",v̌:"v",W̌:"W",w̌:"w",X̌:"X",x̌:"x",Y̌:"Y",y̌:"y",A̧:"A",a̧:"a",B̧:"B",b̧:"b",Ḑ:"D",ḑ:"d",Ȩ:"E",ȩ:"e",Ɛ̧:"E",ɛ̧:"e",Ḩ:"H",ḩ:"h",I̧:"I",i̧:"i",Ɨ̧:"I",ɨ̧:"i",M̧:"M",m̧:"m",O̧:"O",o̧:"o",Q̧:"Q",q̧:"q",U̧:"U",u̧:"u",X̧:"X",x̧:"x",Z̧:"Z",z̧:"z"},DT=Object.keys(Rb).join("|"),IT=new RegExp(DT,"g");function RT(e){return e.replace(IT,t=>Rb[t])}var Kt={CASE_SENSITIVE_EQUAL:7,EQUAL:6,STARTS_WITH:5,WORD_STARTS_WITH:4,CONTAINS:3,ACRONYM:2,MATCHES:1,NO_MATCH:0};function Yy(e,t,n){var r;if(n=n||{},n.threshold=(r=n.threshold)!=null?r:Kt.MATCHES,!n.accessors){const o=Xy(e,t,n);return{rankedValue:e,rank:o,accessorIndex:-1,accessorThreshold:n.threshold,passed:o>=n.threshold}}const i=qT(e,n.accessors),s={rankedValue:e,rank:Kt.NO_MATCH,accessorIndex:-1,accessorThreshold:n.threshold,passed:!1};for(let o=0;o<i.length;o++){const a=i[o];let l=Xy(a.itemValue,t,n);const{minRanking:u,maxRanking:c,threshold:d=n.threshold}=a.attributes;l<u&&l>=Kt.MATCHES?l=u:l>c&&(l=c),l=Math.min(l,c),l>=d&&l>s.rank&&(s.rank=l,s.passed=!0,s.accessorIndex=o,s.accessorThreshold=d,s.rankedValue=a.itemValue)}return s}function Xy(e,t,n){return e=Zy(e,n),t=Zy(t,n),t.length>e.length?Kt.NO_MATCH:e===t?Kt.CASE_SENSITIVE_EQUAL:(e=e.toLowerCase(),t=t.toLowerCase(),e===t?Kt.EQUAL:e.startsWith(t)?Kt.STARTS_WITH:e.includes(` ${t}`)?Kt.WORD_STARTS_WITH:e.includes(t)?Kt.CONTAINS:t.length===1?Kt.NO_MATCH:NT(e).includes(t)?Kt.ACRONYM:FT(e,t))}function NT(e){let t="";return e.split(" ").forEach(r=>{r.split("-").forEach(s=>{t+=s.substr(0,1)})}),t}function FT(e,t){let n=0,r=0;function i(l,u,c){for(let d=c,f=u.length;d<f;d++)if(u[d]===l)return n+=1,d+1;return-1}function s(l){const u=1/l,c=n/t.length;return Kt.MATCHES+c*u}const o=i(t[0],e,0);if(o<0)return Kt.NO_MATCH;r=o;for(let l=1,u=t.length;l<u;l++){const c=t[l];if(r=i(c,e,r),!(r>-1))return Kt.NO_MATCH}const a=r-o;return s(a)}function Zy(e,t){let{keepDiacritics:n}=t;return e=`${e}`,n||(e=RT(e)),e}function BT(e,t){let n=t;typeof t=="object"&&(n=t.accessor);const r=n(e);return r==null?[]:Array.isArray(r)?r:[String(r)]}function qT(e,t){const n=[];for(let r=0,i=t.length;r<i;r++){const s=t[r],o=zT(s),a=BT(e,s);for(let l=0,u=a.length;l<u;l++)n.push({itemValue:a[l],attributes:o})}return n}var Jy={maxRanking:1/0,minRanking:-1/0};function zT(e){return typeof e=="function"?Jy:{...Jy,...e}}var HT={data:""},UT=e=>typeof window=="object"?((e?e.querySelector("#_goober"):window._goober)||Object.assign((e||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:e||HT,GT=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,KT=/\/\*[^]*?\*\/| +/g,em=/\n+/g,Ci=(e,t)=>{let n="",r="",i="";for(let s in e){let o=e[s];s[0]=="@"?s[1]=="i"?n=s+" "+o+";":r+=s[1]=="f"?Ci(o,s):s+"{"+Ci(o,s[1]=="k"?"":t)+"}":typeof o=="object"?r+=Ci(o,t?t.replace(/([^,])+/g,a=>s.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,l=>/&/.test(l)?l.replace(/&/g,a):a?a+" "+l:l)):s):o!=null&&(s=/^--/.test(s)?s:s.replace(/[A-Z]/g,"-$&").toLowerCase(),i+=Ci.p?Ci.p(s,o):s+":"+o+";")}return n+(t&&i?t+"{"+i+"}":i)+r},hr={},Nb=e=>{if(typeof e=="object"){let t="";for(let n in e)t+=n+Nb(e[n]);return t}return e},VT=(e,t,n,r,i)=>{let s=Nb(e),o=hr[s]||(hr[s]=(l=>{let u=0,c=11;for(;u<l.length;)c=101*c+l.charCodeAt(u++)>>>0;return"go"+c})(s));if(!hr[o]){let l=s!==e?e:(u=>{let c,d,f=[{}];for(;c=GT.exec(u.replace(KT,""));)c[4]?f.shift():c[3]?(d=c[3].replace(em," ").trim(),f.unshift(f[0][d]=f[0][d]||{})):f[0][c[1]]=c[2].replace(em," ").trim();return f[0]})(e);hr[o]=Ci(i?{["@keyframes "+o]:l}:l,n?"":"."+o)}let a=n&&hr.g?hr.g:null;return n&&(hr.g=hr[o]),((l,u,c,d)=>{d?u.data=u.data.replace(d,l):u.data.indexOf(l)===-1&&(u.data=c?l+u.data:u.data+l)})(hr[o],t,r,a),o},WT=(e,t,n)=>e.reduce((r,i,s)=>{let o=t[s];if(o&&o.call){let a=o(n),l=a&&a.props&&a.props.className||/^go/.test(a)&&a;o=l?"."+l:a&&typeof a=="object"?a.props?"":Ci(a,""):a===!1?"":a}return r+i+(o==null?"":o)},"");function Re(e){let t=this||{},n=e.call?e(t.p):e;return VT(n.unshift?n.raw?WT(n,[].slice.call(arguments,1),t.p):n.reduce((r,i)=>Object.assign(r,i&&i.call?i(t.p):i),{}):n,UT(t.target),t.g,t.o,t.k)}Re.bind({g:1});Re.bind({k:1});function Fb(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Fb(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function ue(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Fb(e))&&(r&&(r+=" "),r+=t);return r}function QT(e,t){const n=ht(e),{onChange:r}=t;let i=new Set(t.appear?void 0:n);const s=new WeakSet,[o,a]=ae([],{equals:!1}),[l]=L3(),u=d=>{a(f=>(f.push.apply(f,d),f));for(const f of d)s.delete(f)},c=(d,f,h)=>d.splice(h,0,f);return K(d=>{const f=o(),h=e();if(h[Tu],ht(l))return l(),d;if(f.length){const y=d.filter(m=>!f.includes(m));return f.length=0,r({list:y,added:[],removed:[],unchanged:y,finishRemoved:u}),y}return ht(()=>{const y=new Set(h),m=h.slice(),p=[],v=[],b=[];for(const C of h)(i.has(C)?b:p).push(C);let S=!p.length;for(let C=0;C<d.length;C++){const x=d[C];y.has(x)||(s.has(x)||(v.push(x),s.add(x)),c(m,x,C)),S&&x!==m[C]&&(S=!1)}return!v.length&&S?d:(r({list:m,added:p,removed:v,unchanged:b,finishRemoved:u}),i=y,m)})},t.appear?[]:n.slice())}function zt(...e){return CT(e)}var tm=e=>e instanceof Element;function lf(e,t){if(t(e))return e;if(typeof e=="function"&&!e.length)return lf(e(),t);if(Array.isArray(e)){const n=[];for(const r of e){const i=lf(r,t);i&&(Array.isArray(i)?n.push.apply(n,i):n.push(i))}return n.length?n:null}return null}function YT(e,t=tm,n=tm){const r=K(e),i=K(()=>lf(r(),t));return i.toArray=()=>{const s=i();return Array.isArray(s)?s:s?[s]:[]},i}function XT(e){return K(()=>{const t=e.name||"s";return{enterActive:(e.enterActiveClass||t+"-enter-active").split(" "),enter:(e.enterClass||t+"-enter").split(" "),enterTo:(e.enterToClass||t+"-enter-to").split(" "),exitActive:(e.exitActiveClass||t+"-exit-active").split(" "),exit:(e.exitClass||t+"-exit").split(" "),exitTo:(e.exitToClass||t+"-exit-to").split(" "),move:(e.moveClass||t+"-move").split(" ")}})}function Bb(e){requestAnimationFrame(()=>requestAnimationFrame(e))}function ZT(e,t,n,r){const{onBeforeEnter:i,onEnter:s,onAfterEnter:o}=t;i==null||i(n),n.classList.add(...e.enter),n.classList.add(...e.enterActive),queueMicrotask(()=>{if(!n.parentNode)return r==null?void 0:r();s==null||s(n,()=>a())}),Bb(()=>{n.classList.remove(...e.enter),n.classList.add(...e.enterTo),(!s||s.length<2)&&(n.addEventListener("transitionend",a),n.addEventListener("animationend",a))});function a(l){(!l||l.target===n)&&(n.removeEventListener("transitionend",a),n.removeEventListener("animationend",a),n.classList.remove(...e.enterActive),n.classList.remove(...e.enterTo),o==null||o(n))}}function JT(e,t,n,r){const{onBeforeExit:i,onExit:s,onAfterExit:o}=t;if(!n.parentNode)return r==null?void 0:r();i==null||i(n),n.classList.add(...e.exit),n.classList.add(...e.exitActive),s==null||s(n,()=>a()),Bb(()=>{n.classList.remove(...e.exit),n.classList.add(...e.exitTo),(!s||s.length<2)&&(n.addEventListener("transitionend",a),n.addEventListener("animationend",a))});function a(l){(!l||l.target===n)&&(r==null||r(),n.removeEventListener("transitionend",a),n.removeEventListener("animationend",a),n.classList.remove(...e.exitActive),n.classList.remove(...e.exitTo),o==null||o(n))}}var nm=e=>{const t=XT(e);return QT(YT(()=>e.children).toArray,{appear:e.appear,onChange({added:n,removed:r,finishRemoved:i,list:s}){const o=t();for(const l of n)ZT(o,e,l);const a=[];for(const l of s)l.isConnected&&(l instanceof HTMLElement||l instanceof SVGElement)&&a.push({el:l,rect:l.getBoundingClientRect()});queueMicrotask(()=>{const l=[];for(const{el:u,rect:c}of a)if(u.isConnected){const d=u.getBoundingClientRect(),f=c.left-d.left,h=c.top-d.top;(f||h)&&(u.style.transform=`translate(${f}px, ${h}px)`,u.style.transitionDuration="0s",l.push(u))}document.body.offsetHeight;for(const u of l){let c=function(d){(d.target===u||/transform$/.test(d.propertyName))&&(u.removeEventListener("transitionend",c),u.classList.remove(...o.move))};u.classList.add(...o.move),u.style.transform=u.style.transitionDuration="",u.addEventListener("transitionend",c)}});for(const l of r)JT(o,e,l,()=>i([l]))}})},Yc=Symbol("fallback");function rm(e){for(const t of e)t.dispose()}function eP(e,t,n,r={}){const i=new Map;return Ce(()=>rm(i.values())),()=>{const o=e()||[];return o[Tu],ht(()=>{var c,d;if(!o.length)return rm(i.values()),i.clear(),r.fallback?[Or(h=>(i.set(Yc,{dispose:h}),r.fallback()))]:[];const a=new Array(o.length),l=i.get(Yc);if(!i.size||l){l==null||l.dispose(),i.delete(Yc);for(let f=0;f<o.length;f++){const h=o[f],y=t(h,f);s(a,h,f,y)}return a}const u=new Set(i.keys());for(let f=0;f<o.length;f++){const h=o[f],y=t(h,f);u.delete(y);const m=i.get(y);m?(a[f]=m.mapped,(c=m.setIndex)==null||c.call(m,f),m.setItem(()=>h)):s(a,h,f,y)}for(const f of u)(d=i.get(f))==null||d.dispose(),i.delete(f);return a})};function s(o,a,l,u){Or(c=>{const[d,f]=ae(a),h={setItem:f,dispose:c};if(n.length>1){const[y,m]=ae(l);h.setIndex=m,h.mapped=n(d,y)}else h.mapped=n(d);i.set(u,h),o[l]=h.mapped})}}function vu(e){const{by:t}=e;return K(eP(()=>e.each,typeof t=="function"?t:n=>n[t],e.children,"fallback"in e?{fallback:()=>e.fallback}:void 0))}function tP(e,t,n,r){return e.addEventListener(t,n,r),kT(e.removeEventListener.bind(e,t,n,r))}function nP(e,t,n,r){const i=()=>{of(Z(e)).forEach(s=>{s&&of(Z(t)).forEach(o=>tP(s,o,n,r))})};typeof e=="function"?Se(i):we(i)}function rP(e,t){const n=new ResizeObserver(e);return Ce(n.disconnect.bind(n)),{observe:r=>n.observe(r,t),unobserve:n.unobserve.bind(n)}}function qb(e,t,n){const r=new WeakMap,{observe:i,unobserve:s}=rP(o=>{for(const a of o){const{contentRect:l,target:u}=a,c=Math.round(l.width),d=Math.round(l.height),f=r.get(u);(!f||f.width!==c||f.height!==d)&&(t(l,u,a),r.set(u,{width:c,height:d}))}},n);Se(o=>{const a=ST(of(Z(e)));return OT(a,o,i,s),a},[])}var iP=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g;function im(e){const t={};let n;for(;n=iP.exec(e);)t[n[1]]=n[2];return t}function rc(e,t){if(typeof e=="string"){if(typeof t=="string")return`${e};${t}`;e=im(e)}else typeof t=="string"&&(t=im(t));return{...e,...t}}function sP(e,t,n=-1){return n in e?[...e.slice(0,n),t,...e.slice(n)]:[...e,t]}function uf(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function oP(e){return typeof e=="number"}function cs(e){return Object.prototype.toString.call(e)==="[object String]"}function aP(e){return typeof e=="function"}function Ja(e){return t=>`${e()}-${t}`}function Pn(e,t){return e?e===t||e.contains(t):!1}function zo(e,t=!1){const{activeElement:n}=ar(e);if(!(n!=null&&n.nodeName))return null;if(zb(n)&&n.contentDocument)return zo(n.contentDocument.body,t);if(t){const r=n.getAttribute("aria-activedescendant");if(r){const i=ar(n).getElementById(r);if(i)return i}}return n}function lP(e){return ar(e).defaultView||window}function ar(e){return e?e.ownerDocument||e:document}function zb(e){return e.tagName==="IFRAME"}var ch=(e=>(e.Escape="Escape",e.Enter="Enter",e.Tab="Tab",e.Space=" ",e.ArrowDown="ArrowDown",e.ArrowLeft="ArrowLeft",e.ArrowRight="ArrowRight",e.ArrowUp="ArrowUp",e.End="End",e.Home="Home",e.PageDown="PageDown",e.PageUp="PageUp",e))(ch||{});function dh(e){var t;return typeof window!="undefined"&&window.navigator!=null?e.test(((t=window.navigator.userAgentData)==null?void 0:t.platform)||window.navigator.platform):!1}function ic(){return dh(/^Mac/i)}function uP(){return dh(/^iPhone/i)}function cP(){return dh(/^iPad/i)||ic()&&navigator.maxTouchPoints>1}function dP(){return uP()||cP()}function fP(){return ic()||dP()}function lt(e,t){return t&&(aP(t)?t(e):t[0](t[1],e)),e==null?void 0:e.defaultPrevented}function wt(e){return t=>{for(const n of e)lt(t,n)}}function hP(e){return ic()?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey}function Mt(e){if(e)if(gP())e.focus({preventScroll:!0});else{const t=yP(e);e.focus(),mP(t)}}var jl=null;function gP(){if(jl==null){jl=!1;try{document.createElement("div").focus({get preventScroll(){return jl=!0,!0}})}catch(e){}}return jl}function yP(e){let t=e.parentNode;const n=[],r=document.scrollingElement||document.documentElement;for(;t instanceof HTMLElement&&t!==r;)(t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth)&&n.push({element:t,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}),t=t.parentNode;return r instanceof HTMLElement&&n.push({element:r,scrollTop:r.scrollTop,scrollLeft:r.scrollLeft}),n}function mP(e){for(const{element:t,scrollTop:n,scrollLeft:r}of e)t.scrollTop=n,t.scrollLeft=r}var Hb=["input:not([type='hidden']):not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","a[href]","area[href]","[tabindex]","iframe","object","embed","audio[controls]","video[controls]","[contenteditable]:not([contenteditable='false'])"],pP=[...Hb,'[tabindex]:not([tabindex="-1"]):not([disabled])'],fh=Hb.join(":not([hidden]),")+",[tabindex]:not([disabled]):not([hidden])",vP=pP.join(':not([hidden]):not([tabindex="-1"]),');function Ub(e,t){const r=Array.from(e.querySelectorAll(fh)).filter(sm);return t&&sm(e)&&r.unshift(e),r.forEach((i,s)=>{if(zb(i)&&i.contentDocument){const o=i.contentDocument.body,a=Ub(o,!1);r.splice(s,1,...a)}}),r}function sm(e){return Gb(e)&&!bP(e)}function Gb(e){return e.matches(fh)&&hh(e)}function bP(e){return parseInt(e.getAttribute("tabindex")||"0",10)<0}function hh(e,t){return e.nodeName!=="#comment"&&xP(e)&&wP(e,t)&&(!e.parentElement||hh(e.parentElement,e))}function xP(e){if(!(e instanceof HTMLElement)&&!(e instanceof SVGElement))return!1;const{display:t,visibility:n}=e.style;let r=t!=="none"&&n!=="hidden"&&n!=="collapse";if(r){if(!e.ownerDocument.defaultView)return r;const{getComputedStyle:i}=e.ownerDocument.defaultView,{display:s,visibility:o}=i(e);r=s!=="none"&&o!=="hidden"&&o!=="collapse"}return r}function wP(e,t){return!e.hasAttribute("hidden")&&(e.nodeName==="DETAILS"&&t&&t.nodeName!=="SUMMARY"?e.hasAttribute("open"):!0)}function SP(e,t,n){const r=t!=null&&t.tabbable?vP:fh,i=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode(s){var o;return(o=t==null?void 0:t.from)!=null&&o.contains(s)?NodeFilter.FILTER_REJECT:s.matches(r)&&hh(s)&&(!(t!=null&&t.accept)||t.accept(s))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});return t!=null&&t.from&&(i.currentNode=t.from),i}function om(e){for(;e&&!CP(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}function CP(e){const t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function _P(){}function kP(e,t){const[n,r]=e;let i=!1;const s=t.length;for(let o=s,a=0,l=o-1;a<o;l=a++){const[u,c]=t[a],[d,f]=t[l],[,h]=t[l===0?o-1:l-1]||[0,0],y=(c-f)*(n-u)-(u-d)*(r-c);if(f<c){if(r>=f&&r<c){if(y===0)return!0;y>0&&(r===f?r>h&&(i=!i):i=!i)}}else if(c<f){if(r>c&&r<=f){if(y===0)return!0;y<0&&(r===f?r<h&&(i=!i):i=!i)}}else if(r==c&&(n>=d&&n<=u||n>=u&&n<=d))return!0}return i}function Ge(e,t){return Pe(e,t)}var To=new Map,am=new Set;function lm(){if(typeof window=="undefined")return;const e=n=>{if(!n.target)return;let r=To.get(n.target);r||(r=new Set,To.set(n.target,r),n.target.addEventListener("transitioncancel",t)),r.add(n.propertyName)},t=n=>{if(!n.target)return;const r=To.get(n.target);if(r&&(r.delete(n.propertyName),r.size===0&&(n.target.removeEventListener("transitioncancel",t),To.delete(n.target)),To.size===0)){for(const i of am)i();am.clear()}};document.body.addEventListener("transitionrun",e),document.body.addEventListener("transitionend",t)}typeof document!="undefined"&&(document.readyState!=="loading"?lm():document.addEventListener("DOMContentLoaded",lm));function cf(e,t){const n=um(e,t,"left"),r=um(e,t,"top"),i=t.offsetWidth,s=t.offsetHeight;let o=e.scrollLeft,a=e.scrollTop;const l=o+e.offsetWidth,u=a+e.offsetHeight;n<=o?o=n:n+i>l&&(o+=n+i-l),r<=a?a=r:r+s>u&&(a+=r+s-u),e.scrollLeft=o,e.scrollTop=a}function um(e,t,n){const r=n==="left"?"offsetLeft":"offsetTop";let i=0;for(;t.offsetParent&&(i+=t[r],t.offsetParent!==e);){if(t.offsetParent.contains(e)){i-=e[r];break}t=t.offsetParent}return i}function OP(e,t){var n,r;if(document.contains(e)){const i=document.scrollingElement||document.documentElement;if(window.getComputedStyle(i).overflow==="hidden"){let o=om(e);for(;e&&o&&e!==i&&o!==i;)cf(o,e),e=o,o=om(e)}else{const{left:o,top:a}=e.getBoundingClientRect();(n=e==null?void 0:e.scrollIntoView)==null||n.call(e,{block:"nearest"});const{left:l,top:u}=e.getBoundingClientRect();(Math.abs(o-l)>1||Math.abs(a-u)>1)&&((r=e.scrollIntoView)==null||r.call(e,{block:"nearest"}))}}}var Kb={border:"0",clip:"rect(0 0 0 0)","clip-path":"inset(50%)",height:"1px",margin:"0 -1px -1px 0",overflow:"hidden",padding:"0",position:"absolute",width:"1px","white-space":"nowrap"};function jn(e){return t=>(e(t),()=>e(void 0))}function sc(e,t){const[n,r]=ae(cm(t==null?void 0:t()));return Se(()=>{var i;r(((i=e())==null?void 0:i.tagName.toLowerCase())||cm(t==null?void 0:t()))}),n}function cm(e){return cs(e)?e:void 0}function dt(e){const[t,n]=Ze(e,["as"]);if(!t.as)throw new Error("[kobalte]: Polymorphic is missing the required `as` prop.");return L(gS,Pe(n,{get component(){return t.as}}))}var EP=["id","name","validationState","required","disabled","readOnly"];function AP(e){const t=`form-control-${Ln()}`,n=Ge({id:t},e),[r,i]=ae(),[s,o]=ae(),[a,l]=ae(),[u,c]=ae(),d=(m,p,v)=>{const b=v!=null||r()!=null;return[v,r(),b&&p!=null?m:void 0].filter(Boolean).join(" ")||void 0},f=m=>[a(),u(),m].filter(Boolean).join(" ")||void 0,h=K(()=>({"data-valid":Z(n.validationState)==="valid"?"":void 0,"data-invalid":Z(n.validationState)==="invalid"?"":void 0,"data-required":Z(n.required)?"":void 0,"data-disabled":Z(n.disabled)?"":void 0,"data-readonly":Z(n.readOnly)?"":void 0}));return{formControlContext:{name:()=>{var m;return(m=Z(n.name))!=null?m:Z(n.id)},dataset:h,validationState:()=>Z(n.validationState),isRequired:()=>Z(n.required),isDisabled:()=>Z(n.disabled),isReadOnly:()=>Z(n.readOnly),labelId:r,fieldId:s,descriptionId:a,errorMessageId:u,getAriaLabelledBy:d,getAriaDescribedBy:f,generateId:Ja(()=>Z(n.id)),registerLabel:jn(i),registerField:jn(o),registerDescription:jn(l),registerErrorMessage:jn(c)}}}var Vb=_t();function el(){const e=kt(Vb);if(e===void 0)throw new Error("[kobalte]: `useFormControlContext` must be used within a `FormControlContext.Provider` component");return e}function Wb(e){const t=el(),n=Ge({id:t.generateId("description")},e);return Se(()=>Ce(t.registerDescription(n.id))),L(dt,Pe({as:"div"},()=>t.dataset(),n))}function Qb(e){const t=el(),n=Ge({id:t.generateId("error-message")},e),[r,i]=Ze(n,["forceMount"]),s=()=>t.validationState()==="invalid";return Se(()=>{s()&&Ce(t.registerErrorMessage(i.id))}),L(xe,{get when(){return r.forceMount||s()},get children(){return L(dt,Pe({as:"div"},()=>t.dataset(),i))}})}function TP(e){let t;const n=el(),r=Ge({id:n.generateId("label")},e),[i,s]=Ze(r,["ref"]),o=sc(()=>t,()=>"label");return Se(()=>Ce(n.registerLabel(s.id))),L(dt,Pe({as:"label",ref(a){const l=zt(u=>t=u,i.ref);typeof l=="function"&&l(a)},get for(){return K(()=>o()==="label")()?n.fieldId():void 0}},()=>n.dataset(),s))}function PP(e,t){Se(Tr(e,n=>{if(n==null)return;const r=jP(n);r!=null&&(r.addEventListener("reset",t,{passive:!0}),Ce(()=>{r.removeEventListener("reset",t)}))}))}function jP(e){return MP(e)?e.form:e.closest("form")}function MP(e){return e.matches("textarea, input, select, button")}function tl(e){var o;const[t,n]=ae((o=e.defaultValue)==null?void 0:o.call(e)),r=K(()=>{var a;return((a=e.value)==null?void 0:a.call(e))!==void 0}),i=K(()=>{var a;return r()?(a=e.value)==null?void 0:a.call(e):t()});return[i,a=>{ht(()=>{var u;const l=_T(a,i());return Object.is(l,i())||(r()||n(l),(u=e.onChange)==null||u.call(e,l)),l})}]}function Yb(e){const[t,n]=tl(e);return[()=>{var i;return(i=t())!=null?i:!1},n]}function $P(e){const[t,n]=tl(e);return[()=>{var i;return(i=t())!=null?i:[]},n]}function LP(e={}){const[t,n]=Yb({value:()=>Z(e.isSelected),defaultValue:()=>!!Z(e.defaultIsSelected),onChange:s=>{var o;return(o=e.onSelectedChange)==null?void 0:o.call(e,s)}});return{isSelected:t,setIsSelected:s=>{!Z(e.isReadOnly)&&!Z(e.isDisabled)&&n(s)},toggle:()=>{!Z(e.isReadOnly)&&!Z(e.isDisabled)&&n(!t())}}}var DP=Object.defineProperty,oc=(e,t)=>{for(var n in t)DP(e,n,{get:t[n],enumerable:!0})},Xb=_t();function Zb(){return kt(Xb)}function IP(){const e=Zb();if(e===void 0)throw new Error("[kobalte]: `useDomCollectionContext` must be used within a `DomCollectionProvider` component");return e}function Jb(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}function RP(e,t){var i;const n=t.ref();if(!n)return-1;let r=e.length;if(!r)return-1;for(;r--;){const s=(i=e[r])==null?void 0:i.ref();if(s&&Jb(s,n))return r+1}return 0}function NP(e){const t=e.map((r,i)=>[i,r]);let n=!1;return t.sort(([r,i],[s,o])=>{const a=i.ref(),l=o.ref();return a===l||!a||!l?0:Jb(a,l)?(r>s&&(n=!0),-1):(r<s&&(n=!0),1)}),n?t.map(([r,i])=>i):e}function e1(e,t){const n=NP(e);e!==n&&t(n)}function FP(e){var i,s;const t=e[0],n=(i=e[e.length-1])==null?void 0:i.ref();let r=(s=t==null?void 0:t.ref())==null?void 0:s.parentElement;for(;r;){if(n&&r.contains(n))return r;r=r.parentElement}return ar(r).body}function BP(e,t){Se(()=>{const n=setTimeout(()=>{e1(e(),t)});Ce(()=>clearTimeout(n))})}function qP(e,t){if(typeof IntersectionObserver!="function"){BP(e,t);return}let n=[];Se(()=>{const r=()=>{const o=!!n.length;n=e(),o&&e1(e(),t)},i=FP(e()),s=new IntersectionObserver(r,{root:i});for(const o of e()){const a=o.ref();a&&s.observe(a)}Ce(()=>s.disconnect())})}function zP(e={}){const[t,n]=$P({value:()=>Z(e.items),onChange:s=>{var o;return(o=e.onItemsChange)==null?void 0:o.call(e,s)}});qP(t,n);const r=s=>(n(o=>{const a=RP(o,s);return sP(o,s,a)}),()=>{n(o=>{const a=o.filter(l=>l.ref()!==s.ref());return o.length===a.length?o:a})});return{DomCollectionProvider:s=>L(Xb.Provider,{value:{registerItem:r},get children(){return s.children}})}}function HP(e){const t=IP(),n=Ge({shouldRegisterItem:!0},e);Se(()=>{if(!n.shouldRegisterItem)return;const r=t.registerItem(n.getItem());Ce(r)})}function t1(e){var l,u,c;let t=(l=e.startIndex)!=null?l:0;const n=(u=e.startLevel)!=null?u:0,r=[],i=d=>{var y;if(d==null)return"";const f=(y=e.getKey)!=null?y:"key",h=cs(f)?d[f]:f(d);return h!=null?String(h):""},s=d=>{var y;if(d==null)return"";const f=(y=e.getTextValue)!=null?y:"textValue",h=cs(f)?d[f]:f(d);return h!=null?String(h):""},o=d=>{var h,y;if(d==null)return!1;const f=(h=e.getDisabled)!=null?h:"disabled";return(y=cs(f)?d[f]:f(d))!=null?y:!1},a=d=>{var f;if(d!=null)return cs(e.getSectionChildren)?d[e.getSectionChildren]:(f=e.getSectionChildren)==null?void 0:f.call(e,d)};for(const d of e.dataSource){if(cs(d)||oP(d)){r.push({type:"item",rawValue:d,key:String(d),textValue:String(d),disabled:o(d),level:n,index:t}),t++;continue}if(a(d)!=null){r.push({type:"section",rawValue:d,key:"",textValue:"",disabled:!1,level:n,index:t}),t++;const f=(c=a(d))!=null?c:[];if(f.length>0){const h=t1({dataSource:f,getKey:e.getKey,getTextValue:e.getTextValue,getDisabled:e.getDisabled,getSectionChildren:e.getSectionChildren,startIndex:t,startLevel:n+1});r.push(...h),t+=h.length}}else r.push({type:"item",rawValue:d,key:i(d),textValue:s(d),disabled:o(d),level:n,index:t}),t++}return r}function UP(e,t=[]){return K(()=>{const n=t1({dataSource:Z(e.dataSource),getKey:Z(e.getKey),getTextValue:Z(e.getTextValue),getDisabled:Z(e.getDisabled),getSectionChildren:Z(e.getSectionChildren)});for(let r=0;r<t.length;r++)t[r]();return e.factory(n)})}var GP=new Set(["Avst","Arab","Armi","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),KP=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]);function VP(e){var n;if(Intl.Locale){const r=(n=new Intl.Locale(e).maximize().script)!=null?n:"";return GP.has(r)}const t=e.split("-")[0];return KP.has(t)}function WP(e){return VP(e)?"rtl":"ltr"}function n1(){let e=typeof navigator!="undefined"&&(navigator.language||navigator.userLanguage)||"en-US";return{locale:e,direction:WP(e)}}var df=n1(),Ho=new Set;function dm(){df=n1();for(const e of Ho)e(df)}function QP(){const[e,t]=ae(df),n=K(()=>e());return Pr(()=>{Ho.size===0&&window.addEventListener("languagechange",dm),Ho.add(t),Ce(()=>{Ho.delete(t),Ho.size===0&&window.removeEventListener("languagechange",dm)})}),{locale:()=>n().locale,direction:()=>n().direction}}var YP=_t();function yi(){const e=QP();return kt(YP)||e}var Xc=new Map;function XP(e){const{locale:t}=yi(),n=K(()=>t()+(e?Object.entries(e).sort((r,i)=>r[0]<i[0]?-1:1).join():""));return K(()=>{const r=n();let i;return Xc.has(r)&&(i=Xc.get(r)),i||(i=new Intl.Collator(t(),e),Xc.set(r,i)),i})}var vr=class r1 extends Set{constructor(n,r,i){super(n);be(this,"anchorKey");be(this,"currentKey");n instanceof r1?(this.anchorKey=r||n.anchorKey,this.currentKey=i||n.currentKey):(this.anchorKey=r,this.currentKey=i)}};function ZP(e){const[t,n]=tl(e);return[()=>{var i;return(i=t())!=null?i:new vr},n]}function i1(e){return fP()?e.altKey:e.ctrlKey}function ds(e){return ic()?e.metaKey:e.ctrlKey}function fm(e){return new vr(e)}function JP(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function ej(e){const t=Ge({selectionMode:"none",selectionBehavior:"toggle"},e),[n,r]=ae(!1),[i,s]=ae(),o=K(()=>{const m=Z(t.selectedKeys);return m!=null?fm(m):m}),a=K(()=>{const m=Z(t.defaultSelectedKeys);return m!=null?fm(m):new vr}),[l,u]=ZP({value:o,defaultValue:a,onChange:m=>{var p;return(p=t.onSelectionChange)==null?void 0:p.call(t,m)}}),[c,d]=ae(Z(t.selectionBehavior)),f=()=>Z(t.selectionMode),h=()=>{var m;return(m=Z(t.disallowEmptySelection))!=null?m:!1},y=m=>{(Z(t.allowDuplicateSelectionEvents)||!JP(m,l()))&&u(m)};return Se(()=>{const m=l();Z(t.selectionBehavior)==="replace"&&c()==="toggle"&&typeof m=="object"&&m.size===0&&d("replace")}),Se(()=>{var m;d((m=Z(t.selectionBehavior))!=null?m:"toggle")}),{selectionMode:f,disallowEmptySelection:h,selectionBehavior:c,setSelectionBehavior:d,isFocused:n,setFocused:r,focusedKey:i,setFocusedKey:s,selectedKeys:l,setSelectedKeys:y}}function tj(e){const[t,n]=ae(""),[r,i]=ae(-1);return{typeSelectHandlers:{onKeyDown:o=>{var f,h,y;if(Z(e.isDisabled))return;const a=Z(e.keyboardDelegate),l=Z(e.selectionManager);if(!a.getKeyForSearch)return;const u=nj(o.key);if(!u||o.ctrlKey||o.metaKey)return;u===" "&&t().trim().length>0&&(o.preventDefault(),o.stopPropagation());let c=n(m=>m+u),d=(f=a.getKeyForSearch(c,l.focusedKey()))!=null?f:a.getKeyForSearch(c);d==null&&rj(c)&&(c=c[0],d=(h=a.getKeyForSearch(c,l.focusedKey()))!=null?h:a.getKeyForSearch(c)),d!=null&&(l.setFocusedKey(d),(y=e.onTypeSelect)==null||y.call(e,d)),clearTimeout(r()),i(window.setTimeout(()=>n(""),500))}}}}function nj(e){return e.length===1||!/^[A-Z]/i.test(e)?e:""}function rj(e){return e.split("").every(t=>t===e[0])}function ij(e,t,n){const i=Pe({selectOnFocus:()=>Z(e.selectionManager).selectionBehavior()==="replace"},e),s=()=>t(),{direction:o}=yi();let a={top:0,left:0};nP(()=>Z(i.isVirtualized)?void 0:s(),"scroll",()=>{const p=s();p&&(a={top:p.scrollTop,left:p.scrollLeft})});const{typeSelectHandlers:l}=tj({isDisabled:()=>Z(i.disallowTypeAhead),keyboardDelegate:()=>Z(i.keyboardDelegate),selectionManager:()=>Z(i.selectionManager)}),u=()=>{var p;return(p=Z(i.orientation))!=null?p:"vertical"},c=p=>{var _,O,A,T,j,B,R,P;lt(p,l.onKeyDown),p.altKey&&p.key==="Tab"&&p.preventDefault();const v=t();if(!(v!=null&&v.contains(p.target)))return;const b=Z(i.selectionManager),S=Z(i.selectOnFocus),C=M=>{M!=null&&(b.setFocusedKey(M),p.shiftKey&&b.selectionMode()==="multiple"?b.extendSelection(M):S&&!i1(p)&&b.replaceSelection(M))},x=Z(i.keyboardDelegate),k=Z(i.shouldFocusWrap),w=b.focusedKey();switch(p.key){case(u()==="vertical"?"ArrowDown":"ArrowRight"):{if(x.getKeyBelow){p.preventDefault();let M;w!=null?M=x.getKeyBelow(w):M=(_=x.getFirstKey)==null?void 0:_.call(x),M==null&&k&&(M=(O=x.getFirstKey)==null?void 0:O.call(x,w)),C(M)}break}case(u()==="vertical"?"ArrowUp":"ArrowLeft"):{if(x.getKeyAbove){p.preventDefault();let M;w!=null?M=x.getKeyAbove(w):M=(A=x.getLastKey)==null?void 0:A.call(x),M==null&&k&&(M=(T=x.getLastKey)==null?void 0:T.call(x,w)),C(M)}break}case(u()==="vertical"?"ArrowLeft":"ArrowUp"):{if(x.getKeyLeftOf){p.preventDefault();const M=o()==="rtl";let I;w!=null?I=x.getKeyLeftOf(w):I=M?(j=x.getFirstKey)==null?void 0:j.call(x):(B=x.getLastKey)==null?void 0:B.call(x),C(I)}break}case(u()==="vertical"?"ArrowRight":"ArrowDown"):{if(x.getKeyRightOf){p.preventDefault();const M=o()==="rtl";let I;w!=null?I=x.getKeyRightOf(w):I=M?(R=x.getLastKey)==null?void 0:R.call(x):(P=x.getFirstKey)==null?void 0:P.call(x),C(I)}break}case"Home":if(x.getFirstKey){p.preventDefault();const M=x.getFirstKey(w,ds(p));M!=null&&(b.setFocusedKey(M),ds(p)&&p.shiftKey&&b.selectionMode()==="multiple"?b.extendSelection(M):S&&b.replaceSelection(M))}break;case"End":if(x.getLastKey){p.preventDefault();const M=x.getLastKey(w,ds(p));M!=null&&(b.setFocusedKey(M),ds(p)&&p.shiftKey&&b.selectionMode()==="multiple"?b.extendSelection(M):S&&b.replaceSelection(M))}break;case"PageDown":if(x.getKeyPageBelow&&w!=null){p.preventDefault();const M=x.getKeyPageBelow(w);C(M)}break;case"PageUp":if(x.getKeyPageAbove&&w!=null){p.preventDefault();const M=x.getKeyPageAbove(w);C(M)}break;case"a":ds(p)&&b.selectionMode()==="multiple"&&Z(i.disallowSelectAll)!==!0&&(p.preventDefault(),b.selectAll());break;case"Escape":p.defaultPrevented||(p.preventDefault(),Z(i.disallowEmptySelection)||b.clearSelection());break;case"Tab":if(!Z(i.allowsTabNavigation)){if(p.shiftKey)v.focus();else{const M=SP(v,{tabbable:!0});let I,G;do G=M.lastChild(),G&&(I=G);while(G);I&&!I.contains(document.activeElement)&&Mt(I)}break}}},d=p=>{var C,x,k,w;const v=Z(i.selectionManager),b=Z(i.keyboardDelegate),S=Z(i.selectOnFocus);if(v.isFocused()){p.currentTarget.contains(p.target)||v.setFocused(!1);return}if(p.currentTarget.contains(p.target)){if(v.setFocused(!0),v.focusedKey()==null){const _=A=>{A!=null&&(v.setFocusedKey(A),S&&v.replaceSelection(A))},O=p.relatedTarget;O&&p.currentTarget.compareDocumentPosition(O)&Node.DOCUMENT_POSITION_FOLLOWING?_((x=v.lastSelectedKey())!=null?x:(C=b.getLastKey)==null?void 0:C.call(b)):_((w=v.firstSelectedKey())!=null?w:(k=b.getFirstKey)==null?void 0:k.call(b))}else if(!Z(i.isVirtualized)){const _=s();if(_){_.scrollTop=a.top,_.scrollLeft=a.left;const O=_.querySelector(`[data-key="${v.focusedKey()}"]`);O&&(Mt(O),cf(_,O))}}}},f=p=>{const v=Z(i.selectionManager);p.currentTarget.contains(p.relatedTarget)||v.setFocused(!1)},h=p=>{s()===p.target&&p.preventDefault()},y=()=>{var k,w;const p=Z(i.autoFocus);if(!p)return;const v=Z(i.selectionManager),b=Z(i.keyboardDelegate);let S;p==="first"&&(S=(k=b.getFirstKey)==null?void 0:k.call(b)),p==="last"&&(S=(w=b.getLastKey)==null?void 0:w.call(b));const C=v.selectedKeys();C.size&&(S=C.values().next().value),v.setFocused(!0),v.setFocusedKey(S);const x=t();x&&S==null&&!Z(i.shouldUseVirtualFocus)&&Mt(x)};return Pr(()=>{i.deferAutoFocus?setTimeout(y,0):y()}),Se(Tr([s,()=>Z(i.isVirtualized),()=>Z(i.selectionManager).focusedKey()],p=>{var C;const[v,b,S]=p;if(b)S&&((C=i.scrollToKey)==null||C.call(i,S));else if(S&&v){const x=v.querySelector(`[data-key="${S}"]`);x&&cf(v,x)}})),{tabIndex:K(()=>{if(!Z(i.shouldUseVirtualFocus))return Z(i.selectionManager).focusedKey()==null?0:-1}),onKeyDown:c,onMouseDown:h,onFocusIn:d,onFocusOut:f}}function s1(e,t){const n=()=>Z(e.selectionManager),r=()=>Z(e.key),i=()=>Z(e.shouldUseVirtualFocus),s=b=>{n().selectionMode()!=="none"&&(n().selectionMode()==="single"?n().isSelected(r())&&!n().disallowEmptySelection()?n().toggleSelection(r()):n().replaceSelection(r()):b!=null&&b.shiftKey?n().extendSelection(r()):n().selectionBehavior()==="toggle"||ds(b)||"pointerType"in b&&b.pointerType==="touch"?n().toggleSelection(r()):n().replaceSelection(r()))},o=()=>n().isSelected(r()),a=()=>Z(e.disabled)||n().isDisabled(r()),l=()=>!a()&&n().canSelectItem(r());let u=null;const c=b=>{l()&&(u=b.pointerType,b.pointerType==="mouse"&&b.button===0&&!Z(e.shouldSelectOnPressUp)&&s(b))},d=b=>{l()&&b.pointerType==="mouse"&&b.button===0&&Z(e.shouldSelectOnPressUp)&&Z(e.allowsDifferentPressOrigin)&&s(b)},f=b=>{l()&&(Z(e.shouldSelectOnPressUp)&&!Z(e.allowsDifferentPressOrigin)||u!=="mouse")&&s(b)},h=b=>{!l()||!["Enter"," "].includes(b.key)||(i1(b)?n().toggleSelection(r()):s(b))},y=b=>{a()&&b.preventDefault()},m=b=>{const S=t();i()||a()||!S||b.target===S&&n().setFocusedKey(r())},p=K(()=>{if(!(i()||a()))return r()===n().focusedKey()?0:-1}),v=K(()=>Z(e.virtualized)?void 0:r());return Se(Tr([t,r,i,()=>n().focusedKey(),()=>n().isFocused()],([b,S,C,x,k])=>{b&&S===x&&k&&!C&&document.activeElement!==b&&(e.focus?e.focus():Mt(b))})),{isSelected:o,isDisabled:a,allowsSelection:l,tabIndex:p,dataKey:v,onPointerDown:c,onPointerUp:d,onClick:f,onKeyDown:h,onMouseDown:y,onFocus:m}}var sj=class{constructor(e,t){be(this,"collection");be(this,"state");this.collection=e,this.state=t}selectionMode(){return this.state.selectionMode()}disallowEmptySelection(){return this.state.disallowEmptySelection()}selectionBehavior(){return this.state.selectionBehavior()}setSelectionBehavior(e){this.state.setSelectionBehavior(e)}isFocused(){return this.state.isFocused()}setFocused(e){this.state.setFocused(e)}focusedKey(){return this.state.focusedKey()}setFocusedKey(e){(e==null||this.collection().getItem(e))&&this.state.setFocusedKey(e)}selectedKeys(){return this.state.selectedKeys()}isSelected(e){if(this.state.selectionMode()==="none")return!1;const t=this.getKey(e);return t==null?!1:this.state.selectedKeys().has(t)}isEmpty(){return this.state.selectedKeys().size===0}isSelectAll(){if(this.isEmpty())return!1;const e=this.state.selectedKeys();return this.getAllSelectableKeys().every(t=>e.has(t))}firstSelectedKey(){let e;for(const t of this.state.selectedKeys()){const n=this.collection().getItem(t),r=(n==null?void 0:n.index)!=null&&(e==null?void 0:e.index)!=null&&n.index<e.index;(!e||r)&&(e=n)}return e==null?void 0:e.key}lastSelectedKey(){let e;for(const t of this.state.selectedKeys()){const n=this.collection().getItem(t),r=(n==null?void 0:n.index)!=null&&(e==null?void 0:e.index)!=null&&n.index>e.index;(!e||r)&&(e=n)}return e==null?void 0:e.key}extendSelection(e){if(this.selectionMode()==="none")return;if(this.selectionMode()==="single"){this.replaceSelection(e);return}const t=this.getKey(e);if(t==null)return;const n=this.state.selectedKeys(),r=n.anchorKey||t,i=new vr(n,r,t);for(const s of this.getKeyRange(r,n.currentKey||t))i.delete(s);for(const s of this.getKeyRange(t,r))this.canSelectItem(s)&&i.add(s);this.state.setSelectedKeys(i)}getKeyRange(e,t){const n=this.collection().getItem(e),r=this.collection().getItem(t);return n&&r?n.index!=null&&r.index!=null&&n.index<=r.index?this.getKeyRangeInternal(e,t):this.getKeyRangeInternal(t,e):[]}getKeyRangeInternal(e,t){const n=[];let r=e;for(;r!=null;){const i=this.collection().getItem(r);if(i&&i.type==="item"&&n.push(r),r===t)return n;r=this.collection().getKeyAfter(r)}return[]}getKey(e){const t=this.collection().getItem(e);return t?!t||t.type!=="item"?null:t.key:e}toggleSelection(e){if(this.selectionMode()==="none")return;if(this.selectionMode()==="single"&&!this.isSelected(e)){this.replaceSelection(e);return}const t=this.getKey(e);if(t==null)return;const n=new vr(this.state.selectedKeys());n.has(t)?n.delete(t):this.canSelectItem(t)&&(n.add(t),n.anchorKey=t,n.currentKey=t),!(this.disallowEmptySelection()&&n.size===0)&&this.state.setSelectedKeys(n)}replaceSelection(e){if(this.selectionMode()==="none")return;const t=this.getKey(e);if(t==null)return;const n=this.canSelectItem(t)?new vr([t],t,t):new vr;this.state.setSelectedKeys(n)}setSelectedKeys(e){if(this.selectionMode()==="none")return;const t=new vr;for(const n of e){const r=this.getKey(n);if(r!=null&&(t.add(r),this.selectionMode()==="single"))break}this.state.setSelectedKeys(t)}selectAll(){this.selectionMode()==="multiple"&&this.state.setSelectedKeys(new Set(this.getAllSelectableKeys()))}clearSelection(){const e=this.state.selectedKeys();!this.disallowEmptySelection()&&e.size>0&&this.state.setSelectedKeys(new vr)}toggleSelectAll(){this.isSelectAll()?this.clearSelection():this.selectAll()}select(e,t){this.selectionMode()!=="none"&&(this.selectionMode()==="single"?this.isSelected(e)&&!this.disallowEmptySelection()?this.toggleSelection(e):this.replaceSelection(e):this.selectionBehavior()==="toggle"||t&&t.pointerType==="touch"?this.toggleSelection(e):this.replaceSelection(e))}isSelectionEqual(e){if(e===this.state.selectedKeys())return!0;const t=this.selectedKeys();if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;for(const n of t)if(!e.has(n))return!1;return!0}canSelectItem(e){if(this.state.selectionMode()==="none")return!1;const t=this.collection().getItem(e);return t!=null&&!t.disabled}isDisabled(e){const t=this.collection().getItem(e);return!t||t.disabled}getAllSelectableKeys(){const e=[];return(n=>{for(;n!=null;){if(this.canSelectItem(n)){const r=this.collection().getItem(n);if(!r)continue;r.type==="item"&&e.push(n)}n=this.collection().getKeyAfter(n)}})(this.collection().getFirstKey()),e}},hm=class{constructor(e){be(this,"keyMap",new Map);be(this,"iterable");be(this,"firstKey");be(this,"lastKey");this.iterable=e;for(const r of e)this.keyMap.set(r.key,r);if(this.keyMap.size===0)return;let t,n=0;for(const[r,i]of this.keyMap)t?(t.nextKey=r,i.prevKey=t.key):(this.firstKey=r,i.prevKey=void 0),i.type==="item"&&(i.index=n++),t=i,t.nextKey=void 0;this.lastKey=t.key}*[Symbol.iterator](){yield*this.iterable}getSize(){return this.keyMap.size}getKeys(){return this.keyMap.keys()}getKeyBefore(e){var t;return(t=this.keyMap.get(e))==null?void 0:t.prevKey}getKeyAfter(e){var t;return(t=this.keyMap.get(e))==null?void 0:t.nextKey}getFirstKey(){return this.firstKey}getLastKey(){return this.lastKey}getItem(e){return this.keyMap.get(e)}at(e){const t=[...this.getKeys()];return this.getItem(t[e])}};function oj(e){const t=ej(e),r=UP({dataSource:()=>Z(e.dataSource),getKey:()=>Z(e.getKey),getTextValue:()=>Z(e.getTextValue),getDisabled:()=>Z(e.getDisabled),getSectionChildren:()=>Z(e.getSectionChildren),factory:s=>e.filter?new hm(e.filter(s)):new hm(s)},[()=>e.filter]),i=new sj(r,t);return av(()=>{const s=t.focusedKey();s!=null&&!r().getItem(s)&&t.setFocusedKey(void 0)}),{collection:r,selectionManager:()=>i}}var jt=e=>typeof e=="function"?e():e,aj=e=>{const t=K(()=>{const o=jt(e.element);if(o)return getComputedStyle(o)}),n=()=>{var o,a;return(a=(o=t())==null?void 0:o.animationName)!=null?a:"none"},[r,i]=ae(jt(e.show)?"present":"hidden");let s="none";return Se(o=>{const a=jt(e.show);return ht(()=>{var c;if(o===a)return a;const l=s,u=n();a?i("present"):u==="none"||((c=t())==null?void 0:c.display)==="none"?i("hidden"):i(o===!0&&l!==u?"hiding":"hidden")}),a}),Se(()=>{const o=jt(e.element);if(!o)return;const a=u=>{u.target===o&&(s=n())},l=u=>{const d=n().includes(u.animationName);u.target===o&&d&&r()==="hiding"&&i("hidden")};o.addEventListener("animationstart",a),o.addEventListener("animationcancel",l),o.addEventListener("animationend",l),Ce(()=>{o.removeEventListener("animationstart",a),o.removeEventListener("animationcancel",l),o.removeEventListener("animationend",l)})}),{present:()=>r()==="present"||r()==="hiding",state:r}},lj=aj,o1=lj,bu="data-kb-top-layer",a1,ff=!1,jr=[];function Sa(e){return jr.findIndex(t=>t.node===e)}function uj(e){return jr[Sa(e)]}function cj(e){return jr[jr.length-1].node===e}function l1(){return jr.filter(e=>e.isPointerBlocking)}function dj(){return[...l1()].slice(-1)[0]}function gh(){return l1().length>0}function u1(e){var n;const t=Sa((n=dj())==null?void 0:n.node);return Sa(e)<t}function fj(e){jr.push(e)}function hj(e){const t=Sa(e);t<0||jr.splice(t,1)}function gj(){for(const{node:e}of jr)e.style.pointerEvents=u1(e)?"none":"auto"}function yj(e){if(gh()&&!ff){const t=ar(e);a1=document.body.style.pointerEvents,t.body.style.pointerEvents="none",ff=!0}}function mj(e){if(gh())return;const t=ar(e);t.body.style.pointerEvents=a1,t.body.style.length===0&&t.body.removeAttribute("style"),ff=!1}var nn={layers:jr,isTopMostLayer:cj,hasPointerBlockingLayer:gh,isBelowPointerBlockingLayer:u1,addLayer:fj,removeLayer:hj,indexOf:Sa,find:uj,assignPointerEventToLayers:gj,disableBodyPointerEvents:yj,restoreBodyPointerEvents:mj},pj={};oc(pj,{Button:()=>xj,Root:()=>yh});var vj=["button","color","file","image","reset","submit"];function bj(e){const t=e.tagName.toLowerCase();return t==="button"?!0:t==="input"&&e.type?vj.indexOf(e.type)!==-1:!1}function yh(e){let t;const n=Ge({type:"button"},e),[r,i]=Ze(n,["ref","type","disabled"]),s=sc(()=>t,()=>"button"),o=K(()=>{const u=s();return u==null?!1:bj({tagName:u,type:r.type})}),a=K(()=>s()==="input"),l=K(()=>s()==="a"&&(t==null?void 0:t.getAttribute("href"))!=null);return L(dt,Pe({as:"button",ref(u){const c=zt(d=>t=d,r.ref);typeof c=="function"&&c(u)},get type(){return o()||a()?r.type:void 0},get role(){return!o()&&!l()?"button":void 0},get tabIndex(){return!o()&&!l()&&!r.disabled?0:void 0},get disabled(){return o()||a()?r.disabled:void 0},get"aria-disabled"(){return!o()&&!a()&&r.disabled?!0:void 0},get"data-disabled"(){return r.disabled?"":void 0}},i))}var xj=yh,wj=["top","right","bottom","left"],sr=Math.min,yn=Math.max,xu=Math.round,Ml=Math.floor,li=e=>({x:e,y:e}),Sj={left:"right",right:"left",bottom:"top",top:"bottom"},Cj={start:"end",end:"start"};function hf(e,t,n){return yn(e,sr(t,n))}function ns(e,t){return typeof e=="function"?e(t):e}function ui(e){return e.split("-")[0]}function co(e){return e.split("-")[1]}function c1(e){return e==="x"?"y":"x"}function mh(e){return e==="y"?"height":"width"}function Qi(e){return["top","bottom"].includes(ui(e))?"y":"x"}function ph(e){return c1(Qi(e))}function _j(e,t,n){n===void 0&&(n=!1);const r=co(e),i=ph(e),s=mh(i);let o=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(o=wu(o)),[o,wu(o)]}function kj(e){const t=wu(e);return[gf(e),t,gf(t)]}function gf(e){return e.replace(/start|end/g,t=>Cj[t])}function Oj(e,t,n){const r=["left","right"],i=["right","left"],s=["top","bottom"],o=["bottom","top"];switch(e){case"top":case"bottom":return n?t?i:r:t?r:i;case"left":case"right":return t?s:o;default:return[]}}function Ej(e,t,n,r){const i=co(e);let s=Oj(ui(e),n==="start",r);return i&&(s=s.map(o=>o+"-"+i),t&&(s=s.concat(s.map(gf)))),s}function wu(e){return e.replace(/left|right|bottom|top/g,t=>Sj[t])}function Aj(e){return{top:0,right:0,bottom:0,left:0,...e}}function d1(e){return typeof e!="number"?Aj(e):{top:e,right:e,bottom:e,left:e}}function Su(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function gm(e,t,n){let{reference:r,floating:i}=e;const s=Qi(t),o=ph(t),a=mh(o),l=ui(t),u=s==="y",c=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[a]/2-i[a]/2;let h;switch(l){case"top":h={x:c,y:r.y-i.height};break;case"bottom":h={x:c,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:d};break;case"left":h={x:r.x-i.width,y:d};break;default:h={x:r.x,y:r.y}}switch(co(t)){case"start":h[o]-=f*(n&&u?-1:1);break;case"end":h[o]+=f*(n&&u?-1:1);break}return h}var Tj=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:s=[],platform:o}=n,a=s.filter(Boolean),l=await(o.isRTL==null?void 0:o.isRTL(t));let u=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:c,y:d}=gm(u,r,l),f=r,h={},y=0;for(let m=0;m<a.length;m++){const{name:p,fn:v}=a[m],{x:b,y:S,data:C,reset:x}=await v({x:c,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:h,rects:u,platform:o,elements:{reference:e,floating:t}});c=b!=null?b:c,d=S!=null?S:d,h={...h,[p]:{...h[p],...C}},x&&y<=50&&(y++,typeof x=="object"&&(x.placement&&(f=x.placement),x.rects&&(u=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:c,y:d}=gm(u,f,l)),m=-1)}return{x:c,y:d,placement:f,strategy:i,middlewareData:h}};async function Ca(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:s,rects:o,elements:a,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:f=!1,padding:h=0}=ns(t,e),y=d1(h),p=a[f?d==="floating"?"reference":"floating":d],v=Su(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(p)))==null||n?p:p.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:u,rootBoundary:c,strategy:l})),b=d==="floating"?{x:r,y:i,width:o.floating.width,height:o.floating.height}:o.reference,S=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),C=await(s.isElement==null?void 0:s.isElement(S))?await(s.getScale==null?void 0:s.getScale(S))||{x:1,y:1}:{x:1,y:1},x=Su(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:b,offsetParent:S,strategy:l}):b);return{top:(v.top-x.top+y.top)/C.y,bottom:(x.bottom-v.bottom+y.bottom)/C.y,left:(v.left-x.left+y.left)/C.x,right:(x.right-v.right+y.right)/C.x}}var Pj=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:s,platform:o,elements:a,middlewareData:l}=t,{element:u,padding:c=0}=ns(e,t)||{};if(u==null)return{};const d=d1(c),f={x:n,y:r},h=ph(i),y=mh(h),m=await o.getDimensions(u),p=h==="y",v=p?"top":"left",b=p?"bottom":"right",S=p?"clientHeight":"clientWidth",C=s.reference[y]+s.reference[h]-f[h]-s.floating[y],x=f[h]-s.reference[h],k=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u));let w=k?k[S]:0;(!w||!await(o.isElement==null?void 0:o.isElement(k)))&&(w=a.floating[S]||s.floating[y]);const _=C/2-x/2,O=w/2-m[y]/2-1,A=sr(d[v],O),T=sr(d[b],O),j=A,B=w-m[y]-T,R=w/2-m[y]/2+_,P=hf(j,R,B),M=!l.arrow&&co(i)!=null&&R!==P&&s.reference[y]/2-(R<j?A:T)-m[y]/2<0,I=M?R<j?R-j:R-B:0;return{[h]:f[h]+I,data:{[h]:P,centerOffset:R-P-I,...M&&{alignmentOffset:I}},reset:M}}}),jj=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:s,rects:o,initialPlacement:a,platform:l,elements:u}=t,{mainAxis:c=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:m=!0,...p}=ns(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const v=ui(i),b=Qi(a),S=ui(a)===a,C=await(l.isRTL==null?void 0:l.isRTL(u.floating)),x=f||(S||!m?[wu(a)]:kj(a)),k=y!=="none";!f&&k&&x.push(...Ej(a,m,y,C));const w=[a,...x],_=await Ca(t,p),O=[];let A=((r=s.flip)==null?void 0:r.overflows)||[];if(c&&O.push(_[v]),d){const R=_j(i,o,C);O.push(_[R[0]],_[R[1]])}if(A=[...A,{placement:i,overflows:O}],!O.every(R=>R<=0)){var T,j;const R=(((T=s.flip)==null?void 0:T.index)||0)+1,P=w[R];if(P)return{data:{index:R,overflows:A},reset:{placement:P}};let M=(j=A.filter(I=>I.overflows[0]<=0).sort((I,G)=>I.overflows[1]-G.overflows[1])[0])==null?void 0:j.placement;if(!M)switch(h){case"bestFit":{var B;const I=(B=A.filter(G=>{if(k){const Y=Qi(G.placement);return Y===b||Y==="y"}return!0}).map(G=>[G.placement,G.overflows.filter(Y=>Y>0).reduce((Y,q)=>Y+q,0)]).sort((G,Y)=>G[1]-Y[1])[0])==null?void 0:B[0];I&&(M=I);break}case"initialPlacement":M=a;break}if(i!==M)return{reset:{placement:M}}}return{}}}};function ym(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function mm(e){return wj.some(t=>e[t]>=0)}var Mj=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...i}=ns(e,t);switch(r){case"referenceHidden":{const s=await Ca(t,{...i,elementContext:"reference"}),o=ym(s,n.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:mm(o)}}}case"escaped":{const s=await Ca(t,{...i,altBoundary:!0}),o=ym(s,n.floating);return{data:{escapedOffsets:o,escaped:mm(o)}}}default:return{}}}}};async function $j(e,t){const{placement:n,platform:r,elements:i}=e,s=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=ui(n),a=co(n),l=Qi(n)==="y",u=["left","top"].includes(o)?-1:1,c=s&&l?-1:1,d=ns(t,e);let{mainAxis:f,crossAxis:h,alignmentAxis:y}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return a&&typeof y=="number"&&(h=a==="end"?y*-1:y),l?{x:h*c,y:f*u}:{x:f*u,y:h*c}}var Lj=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:s,placement:o,middlewareData:a}=t,l=await $j(t,e);return o===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:s+l.y,data:{...l,placement:o}}}}},Dj=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:s=!0,crossAxis:o=!1,limiter:a={fn:p=>{let{x:v,y:b}=p;return{x:v,y:b}}},...l}=ns(e,t),u={x:n,y:r},c=await Ca(t,l),d=Qi(ui(i)),f=c1(d);let h=u[f],y=u[d];if(s){const p=f==="y"?"top":"left",v=f==="y"?"bottom":"right",b=h+c[p],S=h-c[v];h=hf(b,h,S)}if(o){const p=d==="y"?"top":"left",v=d==="y"?"bottom":"right",b=y+c[p],S=y-c[v];y=hf(b,y,S)}const m=a.fn({...t,[f]:h,[d]:y});return{...m,data:{x:m.x-n,y:m.y-r}}}}},Ij=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:i,elements:s}=t,{apply:o=()=>{},...a}=ns(e,t),l=await Ca(t,a),u=ui(n),c=co(n),d=Qi(n)==="y",{width:f,height:h}=r.floating;let y,m;u==="top"||u==="bottom"?(y=u,m=c===(await(i.isRTL==null?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(m=u,y=c==="end"?"top":"bottom");const p=h-l.top-l.bottom,v=f-l.left-l.right,b=sr(h-l[y],p),S=sr(f-l[m],v),C=!t.middlewareData.shift;let x=b,k=S;if(d?k=c||C?sr(S,v):v:x=c||C?sr(b,p):p,C&&!c){const _=yn(l.left,0),O=yn(l.right,0),A=yn(l.top,0),T=yn(l.bottom,0);d?k=f-2*(_!==0||O!==0?_+O:yn(l.left,l.right)):x=h-2*(A!==0||T!==0?A+T:yn(l.top,l.bottom))}await o({...t,availableWidth:k,availableHeight:x});const w=await i.getDimensions(s.floating);return f!==w.width||h!==w.height?{reset:{rects:!0}}:{}}}};function fo(e){return f1(e)?(e.nodeName||"").toLowerCase():"#document"}function vn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Lr(e){var t;return(t=(f1(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function f1(e){return e instanceof Node||e instanceof vn(e).Node}function qn(e){return e instanceof Element||e instanceof vn(e).Element}function lr(e){return e instanceof HTMLElement||e instanceof vn(e).HTMLElement}function pm(e){return typeof ShadowRoot=="undefined"?!1:e instanceof ShadowRoot||e instanceof vn(e).ShadowRoot}function nl(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=zn(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function Rj(e){return["table","td","th"].includes(fo(e))}function ac(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch(n){return!1}})}function vh(e){const t=bh(),n=qn(e)?zn(e):e;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function Nj(e){let t=ci(e);for(;lr(t)&&!to(t);){if(vh(t))return t;if(ac(t))return null;t=ci(t)}return null}function bh(){return typeof CSS=="undefined"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function to(e){return["html","body","#document"].includes(fo(e))}function zn(e){return vn(e).getComputedStyle(e)}function lc(e){return qn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ci(e){if(fo(e)==="html")return e;const t=e.assignedSlot||e.parentNode||pm(e)&&e.host||Lr(e);return pm(t)?t.host:t}function h1(e){const t=ci(e);return to(t)?e.ownerDocument?e.ownerDocument.body:e.body:lr(t)&&nl(t)?t:h1(t)}function _a(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=h1(e),s=i===((r=e.ownerDocument)==null?void 0:r.body),o=vn(i);return s?t.concat(o,o.visualViewport||[],nl(i)?i:[],o.frameElement&&n?_a(o.frameElement):[]):t.concat(i,_a(i,[],n))}function g1(e){const t=zn(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=lr(e),s=i?e.offsetWidth:n,o=i?e.offsetHeight:r,a=xu(n)!==s||xu(r)!==o;return a&&(n=s,r=o),{width:n,height:r,$:a}}function xh(e){return qn(e)?e:e.contextElement}function bs(e){const t=xh(e);if(!lr(t))return li(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:s}=g1(t);let o=(s?xu(n.width):n.width)/r,a=(s?xu(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}var Fj=li(0);function y1(e){const t=vn(e);return!bh()||!t.visualViewport?Fj:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Bj(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==vn(e)?!1:t}function Yi(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),s=xh(e);let o=li(1);t&&(r?qn(r)&&(o=bs(r)):o=bs(e));const a=Bj(s,n,r)?y1(s):li(0);let l=(i.left+a.x)/o.x,u=(i.top+a.y)/o.y,c=i.width/o.x,d=i.height/o.y;if(s){const f=vn(s),h=r&&qn(r)?vn(r):r;let y=f,m=y.frameElement;for(;m&&r&&h!==y;){const p=bs(m),v=m.getBoundingClientRect(),b=zn(m),S=v.left+(m.clientLeft+parseFloat(b.paddingLeft))*p.x,C=v.top+(m.clientTop+parseFloat(b.paddingTop))*p.y;l*=p.x,u*=p.y,c*=p.x,d*=p.y,l+=S,u+=C,y=vn(m),m=y.frameElement}}return Su({width:c,height:d,x:l,y:u})}function qj(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const s=i==="fixed",o=Lr(r),a=t?ac(t.floating):!1;if(r===o||a&&s)return n;let l={scrollLeft:0,scrollTop:0},u=li(1);const c=li(0),d=lr(r);if((d||!d&&!s)&&((fo(r)!=="body"||nl(o))&&(l=lc(r)),lr(r))){const f=Yi(r);u=bs(r),c.x=f.x+r.clientLeft,c.y=f.y+r.clientTop}return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+c.x,y:n.y*u.y-l.scrollTop*u.y+c.y}}function zj(e){return Array.from(e.getClientRects())}function m1(e){return Yi(Lr(e)).left+lc(e).scrollLeft}function Hj(e){const t=Lr(e),n=lc(e),r=e.ownerDocument.body,i=yn(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=yn(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+m1(e);const a=-n.scrollTop;return zn(r).direction==="rtl"&&(o+=yn(t.clientWidth,r.clientWidth)-i),{width:i,height:s,x:o,y:a}}function Uj(e,t){const n=vn(e),r=Lr(e),i=n.visualViewport;let s=r.clientWidth,o=r.clientHeight,a=0,l=0;if(i){s=i.width,o=i.height;const u=bh();(!u||u&&t==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}return{width:s,height:o,x:a,y:l}}function Gj(e,t){const n=Yi(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,s=lr(e)?bs(e):li(1),o=e.clientWidth*s.x,a=e.clientHeight*s.y,l=i*s.x,u=r*s.y;return{width:o,height:a,x:l,y:u}}function vm(e,t,n){let r;if(t==="viewport")r=Uj(e,n);else if(t==="document")r=Hj(Lr(e));else if(qn(t))r=Gj(t,n);else{const i=y1(e);r={...t,x:t.x-i.x,y:t.y-i.y}}return Su(r)}function p1(e,t){const n=ci(e);return n===t||!qn(n)||to(n)?!1:zn(n).position==="fixed"||p1(n,t)}function Kj(e,t){const n=t.get(e);if(n)return n;let r=_a(e,[],!1).filter(a=>qn(a)&&fo(a)!=="body"),i=null;const s=zn(e).position==="fixed";let o=s?ci(e):e;for(;qn(o)&&!to(o);){const a=zn(o),l=vh(o);!l&&a.position==="fixed"&&(i=null),(s?!l&&!i:!l&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||nl(o)&&!l&&p1(e,o))?r=r.filter(c=>c!==o):i=a,o=ci(o)}return t.set(e,r),r}function Vj(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o=[...n==="clippingAncestors"?ac(t)?[]:Kj(t,this._c):[].concat(n),r],a=o[0],l=o.reduce((u,c)=>{const d=vm(t,c,i);return u.top=yn(d.top,u.top),u.right=sr(d.right,u.right),u.bottom=sr(d.bottom,u.bottom),u.left=yn(d.left,u.left),u},vm(t,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Wj(e){const{width:t,height:n}=g1(e);return{width:t,height:n}}function Qj(e,t,n){const r=lr(t),i=Lr(t),s=n==="fixed",o=Yi(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const l=li(0);if(r||!r&&!s)if((fo(t)!=="body"||nl(i))&&(a=lc(t)),r){const d=Yi(t,!0,s,t);l.x=d.x+t.clientLeft,l.y=d.y+t.clientTop}else i&&(l.x=m1(i));const u=o.left+a.scrollLeft-l.x,c=o.top+a.scrollTop-l.y;return{x:u,y:c,width:o.width,height:o.height}}function Zc(e){return zn(e).position==="static"}function bm(e,t){return!lr(e)||zn(e).position==="fixed"?null:t?t(e):e.offsetParent}function v1(e,t){const n=vn(e);if(ac(e))return n;if(!lr(e)){let i=ci(e);for(;i&&!to(i);){if(qn(i)&&!Zc(i))return i;i=ci(i)}return n}let r=bm(e,t);for(;r&&Rj(r)&&Zc(r);)r=bm(r,t);return r&&to(r)&&Zc(r)&&!vh(r)?n:r||Nj(e)||n}var Yj=async function(e){const t=this.getOffsetParent||v1,n=this.getDimensions,r=await n(e.floating);return{reference:Qj(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Xj(e){return zn(e).direction==="rtl"}var b1={convertOffsetParentRelativeRectToViewportRelativeRect:qj,getDocumentElement:Lr,getClippingRect:Vj,getOffsetParent:v1,getElementRects:Yj,getClientRects:zj,getDimensions:Wj,getScale:bs,isElement:qn,isRTL:Xj};function Zj(e,t){let n=null,r;const i=Lr(e);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function o(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),s();const{left:u,top:c,width:d,height:f}=e.getBoundingClientRect();if(a||t(),!d||!f)return;const h=Ml(c),y=Ml(i.clientWidth-(u+d)),m=Ml(i.clientHeight-(c+f)),p=Ml(u),b={rootMargin:-h+"px "+-y+"px "+-m+"px "+-p+"px",threshold:yn(0,sr(1,l))||1};let S=!0;function C(x){const k=x[0].intersectionRatio;if(k!==l){if(!S)return o();k?o(!1,k):r=setTimeout(()=>{o(!1,1e-7)},1e3)}S=!1}try{n=new IntersectionObserver(C,{...b,root:i.ownerDocument})}catch(x){n=new IntersectionObserver(C,b)}n.observe(e)}return o(!0),s}function Jj(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=xh(e),c=i||s?[...u?_a(u):[],..._a(t)]:[];c.forEach(v=>{i&&v.addEventListener("scroll",n,{passive:!0}),s&&v.addEventListener("resize",n)});const d=u&&a?Zj(u,n):null;let f=-1,h=null;o&&(h=new ResizeObserver(v=>{let[b]=v;b&&b.target===u&&h&&(h.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var S;(S=h)==null||S.observe(t)})),n()}),u&&!l&&h.observe(u),h.observe(t));let y,m=l?Yi(e):null;l&&p();function p(){const v=Yi(e);m&&(v.x!==m.x||v.y!==m.y||v.width!==m.width||v.height!==m.height)&&n(),m=v,y=requestAnimationFrame(p)}return n(),()=>{var v;c.forEach(b=>{i&&b.removeEventListener("scroll",n),s&&b.removeEventListener("resize",n)}),d==null||d(),(v=h)==null||v.disconnect(),h=null,l&&cancelAnimationFrame(y)}}var eM=Lj,tM=Dj,nM=jj,rM=Ij,iM=Mj,sM=Pj,oM=(e,t,n)=>{const r=new Map,i={platform:b1,...n},s={...i.platform,_c:r};return Tj(e,t,{...i,platform:s})},wh=_t();function Sh(){const e=kt(wh);if(e===void 0)throw new Error("[kobalte]: `usePopperContext` must be used within a `Popper` component");return e}var aM=ce('<svg display="block" viewBox="0 0 30 30" style="transform:scale(1.02)"><g><path fill="none" d="M23,27.8c1.1,1.2,3.4,2.2,5,2.2h2H0h2c1.7,0,3.9-1,5-2.2l6.6-7.2c0.7-0.8,2-0.8,2.7,0L23,27.8L23,27.8z"></path><path stroke="none" d="M23,27.8c1.1,1.2,3.4,2.2,5,2.2h2H0h2c1.7,0,3.9-1,5-2.2l6.6-7.2c0.7-0.8,2-0.8,2.7,0L23,27.8L23,27.8z">'),yf=30,xm=yf/2,lM={top:180,right:-90,bottom:0,left:90};function Ch(e){const t=Sh(),n=Ge({size:yf},e),[r,i]=Ze(n,["ref","style","size"]),s=()=>t.currentPlacement().split("-")[0],o=uM(t.contentRef),a=()=>{var f;return((f=o())==null?void 0:f.getPropertyValue("background-color"))||"none"},l=()=>{var f;return((f=o())==null?void 0:f.getPropertyValue(`border-${s()}-color`))||"none"},u=()=>{var f;return((f=o())==null?void 0:f.getPropertyValue(`border-${s()}-width`))||"0px"},c=()=>Number.parseInt(u())*2*(yf/r.size),d=()=>`rotate(${lM[s()]} ${xm} ${xm}) translate(0 2)`;return L(dt,Pe({as:"div",ref(f){const h=zt(t.setArrowRef,r.ref);typeof h=="function"&&h(f)},"aria-hidden":"true",get style(){return rc({position:"absolute","font-size":`${r.size}px`,width:"1em",height:"1em","pointer-events":"none",fill:a(),stroke:l(),"stroke-width":c()},r.style)}},i,{get children(){const f=aM(),h=f.firstChild;return we(()=>re(h,"transform",d())),f}}))}function uM(e){const[t,n]=ae();return Se(()=>{const r=e();r&&n(lP(r).getComputedStyle(r))}),t}function cM(e){const t=Sh(),[n,r]=Ze(e,["ref","style"]);return L(dt,Pe({as:"div",ref(i){const s=zt(t.setPositionerRef,n.ref);typeof s=="function"&&s(i)},"data-popper-positioner":"",get style(){return rc({position:"absolute",top:0,left:0,"min-width":"max-content"},n.style)}},r))}function wm(e){const{x:t=0,y:n=0,width:r=0,height:i=0}=e!=null?e:{};if(typeof DOMRect=="function")return new DOMRect(t,n,r,i);const s={x:t,y:n,width:r,height:i,top:n,right:t+r,bottom:n+i,left:t};return{...s,toJSON:()=>s}}function dM(e,t){return{contextElement:e,getBoundingClientRect:()=>{const r=t(e);return r?wm(r):e?e.getBoundingClientRect():wm()}}}function fM(e){return/^(?:top|bottom|left|right)(?:-(?:start|end))?$/.test(e)}var hM={top:"bottom",right:"left",bottom:"top",left:"right"};function gM(e,t){const[n,r]=e.split("-"),i=hM[n];return r?n==="left"||n==="right"?`${i} ${r==="start"?"top":"bottom"}`:r==="start"?`${i} ${t==="rtl"?"right":"left"}`:`${i} ${t==="rtl"?"left":"right"}`:`${i} center`}function yM(e){const t=Ge({getAnchorRect:f=>f==null?void 0:f.getBoundingClientRect(),placement:"bottom",gutter:0,shift:0,flip:!0,slide:!0,overlap:!1,sameWidth:!1,fitViewport:!1,hideWhenDetached:!1,detachedPadding:0,arrowPadding:4,overflowPadding:8},e),[n,r]=ae(),[i,s]=ae(),[o,a]=ae(t.placement),l=()=>{var f;return dM((f=t.anchorRef)==null?void 0:f.call(t),t.getAnchorRect)},{direction:u}=yi();async function c(){var k,w,_;const f=l(),h=n(),y=i();if(!f||!h)return;const m=((y==null?void 0:y.clientHeight)||0)/2,p=typeof t.gutter=="number"?t.gutter+m:(k=t.gutter)!=null?k:m;h.style.setProperty("--kb-popper-content-overflow-padding",`${t.overflowPadding}px`),f.getBoundingClientRect();const v=[eM(({placement:O})=>{const A=!!O.split("-")[1];return{mainAxis:p,crossAxis:A?void 0:t.shift,alignmentAxis:t.shift}})];if(t.flip!==!1){const O=typeof t.flip=="string"?t.flip.split(" "):void 0;if(O!==void 0&&!O.every(fM))throw new Error("`flip` expects a spaced-delimited list of placements");v.push(nM({padding:t.overflowPadding,fallbackPlacements:O}))}(t.slide||t.overlap)&&v.push(tM({mainAxis:t.slide,crossAxis:t.overlap,padding:t.overflowPadding})),v.push(rM({padding:t.overflowPadding,apply({availableWidth:O,availableHeight:A,rects:T}){const j=Math.round(T.reference.width);O=Math.floor(O),A=Math.floor(A),h.style.setProperty("--kb-popper-anchor-width",`${j}px`),h.style.setProperty("--kb-popper-content-available-width",`${O}px`),h.style.setProperty("--kb-popper-content-available-height",`${A}px`),t.sameWidth&&(h.style.width=`${j}px`),t.fitViewport&&(h.style.maxWidth=`${O}px`,h.style.maxHeight=`${A}px`)}})),t.hideWhenDetached&&v.push(iM({padding:t.detachedPadding})),y&&v.push(sM({element:y,padding:t.arrowPadding}));const b=await oM(f,h,{placement:t.placement,strategy:"absolute",middleware:v,platform:{...b1,isRTL:()=>u()==="rtl"}});if(a(b.placement),(w=t.onCurrentPlacementChange)==null||w.call(t,b.placement),!h)return;h.style.setProperty("--kb-popper-content-transform-origin",gM(b.placement,u()));const S=Math.round(b.x),C=Math.round(b.y);let x;if(t.hideWhenDetached&&(x=(_=b.middlewareData.hide)!=null&&_.referenceHidden?"hidden":"visible"),Object.assign(h.style,{top:"0",left:"0",transform:`translate3d(${S}px, ${C}px, 0)`,visibility:x}),y&&b.middlewareData.arrow){const{x:O,y:A}=b.middlewareData.arrow,T=b.placement.split("-")[0];Object.assign(y.style,{left:O!=null?`${O}px`:"",top:A!=null?`${A}px`:"",[T]:"100%"})}}Se(()=>{const f=l(),h=n();if(!f||!h)return;const y=Jj(f,h,c,{elementResize:typeof ResizeObserver=="function"});Ce(y)}),Se(()=>{var y;const f=n(),h=(y=t.contentRef)==null?void 0:y.call(t);!f||!h||queueMicrotask(()=>{f.style.zIndex=getComputedStyle(h).zIndex})});const d={currentPlacement:o,contentRef:()=>{var f;return(f=t.contentRef)==null?void 0:f.call(t)},setPositionerRef:r,setArrowRef:s};return L(wh.Provider,{value:d,get children(){return t.children}})}var x1=Object.assign(yM,{Arrow:Ch,Context:wh,usePopperContext:Sh,Positioner:cM});function mM(e){const t=n=>{var r;n.key===ch.Escape&&((r=e.onEscapeKeyDown)==null||r.call(e,n))};Se(()=>{var r,i;if(Z(e.isDisabled))return;const n=(i=(r=e.ownerDocument)==null?void 0:r.call(e))!=null?i:ar();n.addEventListener("keydown",t),Ce(()=>{n.removeEventListener("keydown",t)})})}var Sm="interactOutside.pointerDownOutside",Cm="interactOutside.focusOutside";function pM(e,t){let n,r=_P;const i=()=>ar(t()),s=d=>{var f;return(f=e.onPointerDownOutside)==null?void 0:f.call(e,d)},o=d=>{var f;return(f=e.onFocusOutside)==null?void 0:f.call(e,d)},a=d=>{var f;return(f=e.onInteractOutside)==null?void 0:f.call(e,d)},l=d=>{var h;const f=d.target;return!(f instanceof HTMLElement)||f.closest(`[${bu}]`)||!Pn(i(),f)||Pn(t(),f)?!1:!((h=e.shouldExcludeElement)!=null&&h.call(e,f))},u=d=>{function f(){const h=t(),y=d.target;if(!h||!y||!l(d))return;const m=wt([s,a]);y.addEventListener(Sm,m,{once:!0});const p=new CustomEvent(Sm,{bubbles:!1,cancelable:!0,detail:{originalEvent:d,isContextMenu:d.button===2||hP(d)&&d.button===0}});y.dispatchEvent(p)}d.pointerType==="touch"?(i().removeEventListener("click",f),r=f,i().addEventListener("click",f,{once:!0})):f()},c=d=>{const f=t(),h=d.target;if(!f||!h||!l(d))return;const y=wt([o,a]);h.addEventListener(Cm,y,{once:!0});const m=new CustomEvent(Cm,{bubbles:!1,cancelable:!0,detail:{originalEvent:d,isContextMenu:!1}});h.dispatchEvent(m)};Se(()=>{Z(e.isDisabled)||(n=window.setTimeout(()=>{i().addEventListener("pointerdown",u,!0)},0),i().addEventListener("focusin",c,!0),Ce(()=>{window.clearTimeout(n),i().removeEventListener("click",r),i().removeEventListener("pointerdown",u,!0),i().removeEventListener("focusin",c,!0)}))})}var w1=_t();function vM(){return kt(w1)}function bM(e){let t;const n=vM(),[r,i]=Ze(e,["ref","disableOutsidePointerEvents","excludedElements","onEscapeKeyDown","onPointerDownOutside","onFocusOutside","onInteractOutside","onDismiss","bypassTopMostLayerCheck"]),s=new Set([]),o=d=>{s.add(d);const f=n==null?void 0:n.registerNestedLayer(d);return()=>{s.delete(d),f==null||f()}};pM({shouldExcludeElement:d=>{var f;return t?((f=r.excludedElements)==null?void 0:f.some(h=>Pn(h(),d)))||[...s].some(h=>Pn(h,d)):!1},onPointerDownOutside:d=>{var f,h,y;!t||nn.isBelowPointerBlockingLayer(t)||!r.bypassTopMostLayerCheck&&!nn.isTopMostLayer(t)||((f=r.onPointerDownOutside)==null||f.call(r,d),(h=r.onInteractOutside)==null||h.call(r,d),d.defaultPrevented||(y=r.onDismiss)==null||y.call(r))},onFocusOutside:d=>{var f,h,y;(f=r.onFocusOutside)==null||f.call(r,d),(h=r.onInteractOutside)==null||h.call(r,d),d.defaultPrevented||(y=r.onDismiss)==null||y.call(r)}},()=>t),mM({ownerDocument:()=>ar(t),onEscapeKeyDown:d=>{var f;!t||!nn.isTopMostLayer(t)||((f=r.onEscapeKeyDown)==null||f.call(r,d),!d.defaultPrevented&&r.onDismiss&&(d.preventDefault(),r.onDismiss()))}}),Pr(()=>{if(!t)return;nn.addLayer({node:t,isPointerBlocking:r.disableOutsidePointerEvents,dismiss:r.onDismiss});const d=n==null?void 0:n.registerNestedLayer(t);nn.assignPointerEventToLayers(),nn.disableBodyPointerEvents(t),Ce(()=>{t&&(nn.removeLayer(t),d==null||d(),nn.assignPointerEventToLayers(),nn.restoreBodyPointerEvents(t))})}),Se(Tr([()=>t,()=>r.disableOutsidePointerEvents],([d,f])=>{if(!d)return;const h=nn.find(d);h&&h.isPointerBlocking!==f&&(h.isPointerBlocking=f,nn.assignPointerEventToLayers()),f&&nn.disableBodyPointerEvents(d),Ce(()=>{nn.restoreBodyPointerEvents(d)})},{defer:!0}));const c={registerNestedLayer:o};return L(w1.Provider,{value:c,get children(){return L(dt,Pe({as:"div",ref(d){const f=zt(h=>t=h,r.ref);typeof f=="function"&&f(d)}},i))}})}function S1(e={}){const[t,n]=Yb({value:()=>Z(e.open),defaultValue:()=>!!Z(e.defaultOpen),onChange:o=>{var a;return(a=e.onOpenChange)==null?void 0:a.call(e,o)}}),r=()=>{n(!0)},i=()=>{n(!1)};return{isOpen:t,setIsOpen:n,open:r,close:i,toggle:()=>{t()?i():r()}}}var kn={};oc(kn,{Description:()=>Wb,ErrorMessage:()=>Qb,Item:()=>O1,ItemControl:()=>E1,ItemDescription:()=>A1,ItemIndicator:()=>T1,ItemInput:()=>P1,ItemLabel:()=>j1,Label:()=>M1,RadioGroup:()=>xM,Root:()=>$1});var C1=_t();function _1(){const e=kt(C1);if(e===void 0)throw new Error("[kobalte]: `useRadioGroupContext` must be used within a `RadioGroup` component");return e}var k1=_t();function rl(){const e=kt(k1);if(e===void 0)throw new Error("[kobalte]: `useRadioGroupItemContext` must be used within a `RadioGroup.Item` component");return e}function O1(e){const t=el(),n=_1(),r=`${t.generateId("item")}-${Ln()}`,i=Ge({id:r},e),[s,o]=Ze(i,["value","disabled","onPointerDown"]),[a,l]=ae(),[u,c]=ae(),[d,f]=ae(),[h,y]=ae(),[m,p]=ae(!1),v=K(()=>n.isSelectedValue(s.value)),b=K(()=>s.disabled||t.isDisabled()||!1),S=k=>{lt(k,s.onPointerDown),m()&&k.preventDefault()},C=K(()=>({...t.dataset(),"data-disabled":b()?"":void 0,"data-checked":v()?"":void 0})),x={value:()=>s.value,dataset:C,isSelected:v,isDisabled:b,inputId:a,labelId:u,descriptionId:d,inputRef:h,select:()=>n.setSelectedValue(s.value),generateId:Ja(()=>o.id),registerInput:jn(l),registerLabel:jn(c),registerDescription:jn(f),setIsFocused:p,setInputRef:y};return L(k1.Provider,{value:x,get children(){return L(dt,Pe({as:"div",role:"group",onPointerDown:S},C,o))}})}function E1(e){const t=rl(),n=Ge({id:t.generateId("control")},e),[r,i]=Ze(n,["onClick","onKeyDown"]);return L(dt,Pe({as:"div",onClick:a=>{var l;lt(a,r.onClick),t.select(),(l=t.inputRef())==null||l.focus()},onKeyDown:a=>{var l;lt(a,r.onKeyDown),a.key===ch.Space&&(t.select(),(l=t.inputRef())==null||l.focus())}},()=>t.dataset(),i))}function A1(e){const t=rl(),n=Ge({id:t.generateId("description")},e);return Se(()=>Ce(t.registerDescription(n.id))),L(dt,Pe({as:"div"},()=>t.dataset(),n))}function T1(e){const t=rl(),n=Ge({id:t.generateId("indicator")},e),[r,i]=Ze(n,["ref","forceMount"]),[s,o]=ae(),{present:a}=o1({show:()=>r.forceMount||t.isSelected(),element:()=>{var l;return(l=s())!=null?l:null}});return L(xe,{get when(){return a()},get children(){return L(dt,Pe({as:"div",ref(l){const u=zt(o,r.ref);typeof u=="function"&&u(l)}},()=>t.dataset(),i))}})}function P1(e){const t=el(),n=_1(),r=rl(),i=Ge({id:r.generateId("input")},e),[s,o]=Ze(i,["ref","style","aria-labelledby","aria-describedby","onChange","onFocus","onBlur"]),a=()=>[s["aria-labelledby"],r.labelId(),s["aria-labelledby"]!=null&&o["aria-label"]!=null?o.id:void 0].filter(Boolean).join(" ")||void 0,l=()=>[s["aria-describedby"],r.descriptionId(),n.ariaDescribedBy()].filter(Boolean).join(" ")||void 0,[u,c]=ae(!1),d=y=>{if(lt(y,s.onChange),y.stopPropagation(),!u()){n.setSelectedValue(r.value());const m=y.target;m.checked=r.isSelected()}c(!1)},f=y=>{lt(y,s.onFocus),r.setIsFocused(!0)},h=y=>{lt(y,s.onBlur),r.setIsFocused(!1)};return Se(Tr([()=>r.isSelected(),()=>r.value()],y=>{if(!y[0]&&y[1]===r.value())return;c(!0);const m=r.inputRef();m==null||m.dispatchEvent(new Event("input",{bubbles:!0,cancelable:!0})),m==null||m.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0}))},{defer:!0})),Se(()=>Ce(r.registerInput(o.id))),L(dt,Pe({as:"input",ref(y){const m=zt(r.setInputRef,s.ref);typeof m=="function"&&m(y)},type:"radio",get name(){return t.name()},get value(){return r.value()},get checked(){return r.isSelected()},get required(){return t.isRequired()},get disabled(){return r.isDisabled()},get readonly(){return t.isReadOnly()},get style(){return rc({...Kb},s.style)},get"aria-labelledby"(){return a()},get"aria-describedby"(){return l()},onChange:d,onFocus:f,onBlur:h},()=>r.dataset(),o))}function j1(e){const t=rl(),n=Ge({id:t.generateId("label")},e);return Se(()=>Ce(t.registerLabel(n.id))),L(dt,Pe({as:"label",get for(){return t.inputId()}},()=>t.dataset(),n))}function M1(e){return L(TP,Pe({as:"span"},e))}function $1(e){let t;const n=`radiogroup-${Ln()}`,r=Ge({id:n,orientation:"vertical"},e),[i,s,o]=Ze(r,["ref","value","defaultValue","onChange","orientation","aria-labelledby","aria-describedby"],EP),[a,l]=tl({value:()=>i.value,defaultValue:()=>i.defaultValue,onChange:y=>{var m;return(m=i.onChange)==null?void 0:m.call(i,y)}}),{formControlContext:u}=AP(s);PP(()=>t,()=>{var y;return l((y=i.defaultValue)!=null?y:"")});const c=()=>u.getAriaLabelledBy(Z(s.id),o["aria-label"],i["aria-labelledby"]),d=()=>u.getAriaDescribedBy(i["aria-describedby"]),f=y=>y===a(),h={ariaDescribedBy:d,isSelectedValue:f,setSelectedValue:y=>{if(!(u.isReadOnly()||u.isDisabled())&&(l(y),t))for(const m of t.querySelectorAll("[type='radio']")){const p=m;p.checked=f(p.value)}}};return L(Vb.Provider,{value:u,get children(){return L(C1.Provider,{value:h,get children(){return L(dt,Pe({as:"div",ref(y){const m=zt(p=>t=p,i.ref);typeof m=="function"&&m(y)},role:"radiogroup",get id(){return Z(s.id)},get"aria-invalid"(){return u.validationState()==="invalid"||void 0},get"aria-required"(){return u.isRequired()||void 0},get"aria-disabled"(){return u.isDisabled()||void 0},get"aria-readonly"(){return u.isReadOnly()||void 0},get"aria-orientation"(){return i.orientation},get"aria-labelledby"(){return c()},get"aria-describedby"(){return d()}},()=>u.dataset(),o))}})}})}var xM=Object.assign($1,{Description:Wb,ErrorMessage:Qb,Item:O1,ItemControl:E1,ItemDescription:A1,ItemIndicator:T1,ItemInput:P1,ItemLabel:j1,Label:M1}),wM=class{constructor(e,t,n){be(this,"collection");be(this,"ref");be(this,"collator");this.collection=e,this.ref=t,this.collator=n}getKeyBelow(e){let t=this.collection().getKeyAfter(e);for(;t!=null;){const n=this.collection().getItem(t);if(n&&n.type==="item"&&!n.disabled)return t;t=this.collection().getKeyAfter(t)}}getKeyAbove(e){let t=this.collection().getKeyBefore(e);for(;t!=null;){const n=this.collection().getItem(t);if(n&&n.type==="item"&&!n.disabled)return t;t=this.collection().getKeyBefore(t)}}getFirstKey(){let e=this.collection().getFirstKey();for(;e!=null;){const t=this.collection().getItem(e);if(t&&t.type==="item"&&!t.disabled)return e;e=this.collection().getKeyAfter(e)}}getLastKey(){let e=this.collection().getLastKey();for(;e!=null;){const t=this.collection().getItem(e);if(t&&t.type==="item"&&!t.disabled)return e;e=this.collection().getKeyBefore(e)}}getItem(e){var t,n,r;return(r=(n=(t=this.ref)==null?void 0:t.call(this))==null?void 0:n.querySelector(`[data-key="${e}"]`))!=null?r:null}getKeyPageAbove(e){var s;const t=(s=this.ref)==null?void 0:s.call(this);let n=this.getItem(e);if(!t||!n)return;const r=Math.max(0,n.offsetTop+n.offsetHeight-t.offsetHeight);let i=e;for(;i&&n&&n.offsetTop>r;)i=this.getKeyAbove(i),n=i!=null?this.getItem(i):null;return i}getKeyPageBelow(e){var s;const t=(s=this.ref)==null?void 0:s.call(this);let n=this.getItem(e);if(!t||!n)return;const r=Math.min(t.scrollHeight,n.offsetTop-n.offsetHeight+t.offsetHeight);let i=e;for(;i&&n&&n.offsetTop<r;)i=this.getKeyBelow(i),n=i!=null?this.getItem(i):null;return i}getKeyForSearch(e,t){var i;const n=(i=this.collator)==null?void 0:i.call(this);if(!n)return;let r=t!=null?this.getKeyBelow(t):this.getFirstKey();for(;r!=null;){const s=this.collection().getItem(r);if(s){const o=s.textValue.slice(0,e.length);if(s.textValue&&n.compare(o,e)===0)return r}r=this.getKeyBelow(r)}}};function SM(e,t,n){const r=XP({usage:"search",sensitivity:"base"}),i=K(()=>{const s=Z(e.keyboardDelegate);return s||new wM(e.collection,t,r)});return ij({selectionManager:()=>Z(e.selectionManager),keyboardDelegate:i,autoFocus:()=>Z(e.autoFocus),deferAutoFocus:()=>Z(e.deferAutoFocus),shouldFocusWrap:()=>Z(e.shouldFocusWrap),disallowEmptySelection:()=>Z(e.disallowEmptySelection),selectOnFocus:()=>Z(e.selectOnFocus),disallowTypeAhead:()=>Z(e.disallowTypeAhead),shouldUseVirtualFocus:()=>Z(e.shouldUseVirtualFocus),allowsTabNavigation:()=>Z(e.allowsTabNavigation),isVirtualized:()=>Z(e.isVirtualized),scrollToKey:s=>{var o;return(o=Z(e.scrollToKey))==null?void 0:o(s)},orientation:()=>Z(e.orientation)},t)}var Jc="focusScope.autoFocusOnMount",ed="focusScope.autoFocusOnUnmount",_m={bubbles:!1,cancelable:!0},km={stack:[],active(){return this.stack[0]},add(e){var t;e!==this.active()&&((t=this.active())==null||t.pause()),this.stack=uf(this.stack,e),this.stack.unshift(e)},remove(e){var t;this.stack=uf(this.stack,e),(t=this.active())==null||t.resume()}};function CM(e,t){const[n,r]=ae(!1),i={pause(){r(!0)},resume(){r(!1)}};let s=null;const o=y=>{var m;return(m=e.onMountAutoFocus)==null?void 0:m.call(e,y)},a=y=>{var m;return(m=e.onUnmountAutoFocus)==null?void 0:m.call(e,y)},l=()=>ar(t()),u=()=>{const y=l().createElement("span");return y.setAttribute("data-focus-trap",""),y.tabIndex=0,Object.assign(y.style,Kb),y},c=()=>{const y=t();return y?Ub(y,!0).filter(m=>!m.hasAttribute("data-focus-trap")):[]},d=()=>{const y=c();return y.length>0?y[0]:null},f=()=>{const y=c();return y.length>0?y[y.length-1]:null},h=()=>{const y=t();if(!y)return!1;const m=zo(y);return!m||Pn(y,m)?!1:Gb(m)};Se(()=>{const y=t();if(!y)return;km.add(i);const m=zo(y);if(!Pn(y,m)){const v=new CustomEvent(Jc,_m);y.addEventListener(Jc,o),y.dispatchEvent(v),v.defaultPrevented||setTimeout(()=>{Mt(d()),zo(y)===m&&Mt(y)},0)}Ce(()=>{y.removeEventListener(Jc,o),setTimeout(()=>{const v=new CustomEvent(ed,_m);h()&&v.preventDefault(),y.addEventListener(ed,a),y.dispatchEvent(v),v.defaultPrevented||Mt(m!=null?m:l().body),y.removeEventListener(ed,a),km.remove(i)},0)})}),Se(()=>{const y=t();if(!y||!Z(e.trapFocus)||n())return;const m=v=>{const b=v.target;b!=null&&b.closest(`[${bu}]`)||(Pn(y,b)?s=b:Mt(s))},p=v=>{const b=v.relatedTarget,S=b!=null?b:zo(y);S!=null&&S.closest(`[${bu}]`)||Pn(y,S)||Mt(s)};l().addEventListener("focusin",m),l().addEventListener("focusout",p),Ce(()=>{l().removeEventListener("focusin",m),l().removeEventListener("focusout",p)})}),Se(()=>{const y=t();if(!y||!Z(e.trapFocus)||n())return;const m=u();y.insertAdjacentElement("afterbegin",m);const p=u();y.insertAdjacentElement("beforeend",p);function v(S){const C=d(),x=f();S.relatedTarget===C?Mt(x):Mt(C)}m.addEventListener("focusin",v),p.addEventListener("focusin",v);const b=new MutationObserver(S=>{for(const C of S)C.previousSibling===p&&(p.remove(),y.insertAdjacentElement("beforeend",p)),C.nextSibling===m&&(m.remove(),y.insertAdjacentElement("afterbegin",m))});b.observe(y,{childList:!0,subtree:!1}),Ce(()=>{m.removeEventListener("focusin",v),p.removeEventListener("focusin",v),m.remove(),p.remove(),b.disconnect()})})}var _M="data-live-announcer";function kM(e){Se(()=>{Z(e.isDisabled)||Ce(OM(Z(e.targets),Z(e.root)))})}var Po=new WeakMap,Cn=[];function OM(e,t=document.body){const n=new Set(e),r=new Set,i=l=>{for(const f of l.querySelectorAll(`[${_M}], [${bu}]`))n.add(f);const u=f=>{if(n.has(f)||f.parentElement&&r.has(f.parentElement)&&f.parentElement.getAttribute("role")!=="row")return NodeFilter.FILTER_REJECT;for(const h of n)if(f.contains(h))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_ACCEPT},c=document.createTreeWalker(l,NodeFilter.SHOW_ELEMENT,{acceptNode:u}),d=u(l);if(d===NodeFilter.FILTER_ACCEPT&&s(l),d!==NodeFilter.FILTER_REJECT){let f=c.nextNode();for(;f!=null;)s(f),f=c.nextNode()}},s=l=>{var c;const u=(c=Po.get(l))!=null?c:0;l.getAttribute("aria-hidden")==="true"&&u===0||(u===0&&l.setAttribute("aria-hidden","true"),r.add(l),Po.set(l,u+1))};Cn.length&&Cn[Cn.length-1].disconnect(),i(t);const o=new MutationObserver(l=>{for(const u of l)if(!(u.type!=="childList"||u.addedNodes.length===0)&&![...n,...r].some(c=>c.contains(u.target))){for(const c of u.removedNodes)c instanceof Element&&(n.delete(c),r.delete(c));for(const c of u.addedNodes)(c instanceof HTMLElement||c instanceof SVGElement)&&(c.dataset.liveAnnouncer==="true"||c.dataset.reactAriaTopLayer==="true")?n.add(c):c instanceof Element&&i(c)}});o.observe(t,{childList:!0,subtree:!0});const a={observe(){o.observe(t,{childList:!0,subtree:!0})},disconnect(){o.disconnect()}};return Cn.push(a),()=>{o.disconnect();for(const l of r){const u=Po.get(l);if(u==null)return;u===1?(l.removeAttribute("aria-hidden"),Po.delete(l)):Po.set(l,u-1)}a===Cn[Cn.length-1]?(Cn.pop(),Cn.length&&Cn[Cn.length-1].observe()):Cn.splice(Cn.indexOf(a),1)}}var $l=new Map,EM=e=>{Se(()=>{var s,o;const t=(s=jt(e.style))!=null?s:{},n=(o=jt(e.properties))!=null?o:[],r={};for(const a in t)r[a]=e.element.style[a];const i=$l.get(e.key);i?i.activeCount++:$l.set(e.key,{activeCount:1,originalStyles:r,properties:n.map(a=>a.key)}),Object.assign(e.element.style,e.style);for(const a of n)e.element.style.setProperty(a.key,a.value);Ce(()=>{var l;const a=$l.get(e.key);if(a){if(a.activeCount!==1){a.activeCount--;return}$l.delete(e.key);for(const[u,c]of Object.entries(a.originalStyles))e.element.style[u]=c;for(const u of a.properties)e.element.style.removeProperty(u);e.element.style.length===0&&e.element.removeAttribute("style"),(l=e.cleanup)==null||l.call(e)}})})},Om=EM,AM=(e,t)=>{switch(t){case"x":return[e.clientWidth,e.scrollLeft,e.scrollWidth];case"y":return[e.clientHeight,e.scrollTop,e.scrollHeight]}},TM=(e,t)=>{const n=getComputedStyle(e),r=t==="x"?n.overflowX:n.overflowY;return r==="auto"||r==="scroll"||e.tagName==="HTML"&&r==="visible"},PM=(e,t,n)=>{var l;const r=t==="x"&&window.getComputedStyle(e).direction==="rtl"?-1:1;let i=e,s=0,o=0,a=!1;do{const[u,c,d]=AM(i,t),f=d-u-r*c;(c!==0||f!==0)&&TM(i,t)&&(s+=f,o+=c),i===(n!=null?n:document.documentElement)?a=!0:i=(l=i._$host)!=null?l:i.parentElement}while(i&&!a);return[s,o]},[Em,Am]=ae([]),jM=e=>Em().indexOf(e)===Em().length-1,MM=e=>{const t=Pe({element:null,enabled:!0,hideScrollbar:!0,preventScrollbarShift:!0,preventScrollbarShiftMode:"padding",restoreScrollPosition:!0,allowPinchZoom:!1},e),n=Ln();let r=[0,0],i=null,s=null;Se(()=>{jt(t.enabled)&&(Am(u=>[...u,n]),Ce(()=>{Am(u=>u.filter(c=>c!==n))}))}),Se(()=>{if(!jt(t.enabled)||!jt(t.hideScrollbar))return;const{body:u}=document,c=window.innerWidth-u.offsetWidth;if(jt(t.preventScrollbarShift)){const d={overflow:"hidden"},f=[];c>0&&(jt(t.preventScrollbarShiftMode)==="padding"?d.paddingRight=`calc(${window.getComputedStyle(u).paddingRight} + ${c}px)`:d.marginRight=`calc(${window.getComputedStyle(u).marginRight} + ${c}px)`,f.push({key:"--scrollbar-width",value:`${c}px`}));const h=window.scrollY,y=window.scrollX;Om({key:"prevent-scroll",element:u,style:d,properties:f,cleanup:()=>{jt(t.restoreScrollPosition)&&c>0&&window.scrollTo(y,h)}})}else Om({key:"prevent-scroll",element:u,style:{overflow:"hidden"}})}),Se(()=>{!jM(n)||!jt(t.enabled)||(document.addEventListener("wheel",a,{passive:!1}),document.addEventListener("touchstart",o,{passive:!1}),document.addEventListener("touchmove",l,{passive:!1}),Ce(()=>{document.removeEventListener("wheel",a),document.removeEventListener("touchstart",o),document.removeEventListener("touchmove",l)}))});const o=u=>{r=Tm(u),i=null,s=null},a=u=>{const c=u.target,d=jt(t.element),f=$M(u),h=Math.abs(f[0])>Math.abs(f[1])?"x":"y",y=h==="x"?f[0]:f[1],m=Pm(c,h,y,d);let p;d&&mf(d,c)?p=!m:p=!0,p&&u.cancelable&&u.preventDefault()},l=u=>{const c=jt(t.element),d=u.target;let f;if(u.touches.length===2)f=!jt(t.allowPinchZoom);else{if(i==null||s===null){const h=Tm(u).map((m,p)=>r[p]-m),y=Math.abs(h[0])>Math.abs(h[1])?"x":"y";i=y,s=y==="x"?h[0]:h[1]}if(d.type==="range")f=!1;else{const h=Pm(d,i,s,c);c&&mf(c,d)?f=!h:f=!0}}f&&u.cancelable&&u.preventDefault()}},$M=e=>[e.deltaX,e.deltaY],Tm=e=>e.changedTouches[0]?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0],Pm=(e,t,n,r)=>{const i=r!==null&&mf(r,e),[s,o]=PM(e,t,i?r:void 0);return!(n>0&&Math.abs(s)<=1||n<0&&Math.abs(o)<1)},mf=(e,t)=>{var r;if(e.contains(t))return!0;let n=t;for(;n;){if(n===e)return!0;n=(r=n._$host)!=null?r:n.parentElement}return!1},LM=MM,DM=LM,L1=_t();function D1(){return kt(L1)}function Dr(){const e=D1();if(e===void 0)throw new Error("[kobalte]: `useMenuContext` must be used within a `Menu` component");return e}var I1=_t();function _h(){const e=kt(I1);if(e===void 0)throw new Error("[kobalte]: `useMenuItemContext` must be used within a `Menu.Item` component");return e}var R1=_t();function ur(){const e=kt(R1);if(e===void 0)throw new Error("[kobalte]: `useMenuRootContext` must be used within a `MenuRoot` component");return e}function kh(e){let t;const n=ur(),r=Dr(),i=Ge({id:n.generateId(`item-${Ln()}`)},e),[s,o]=Ze(i,["ref","textValue","disabled","closeOnSelect","checked","indeterminate","onSelect","onPointerMove","onPointerLeave","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]),[a,l]=ae(),[u,c]=ae(),[d,f]=ae(),h=()=>r.listState().selectionManager(),y=()=>o.id,m=()=>h().focusedKey()===y(),p=()=>{var O;(O=s.onSelect)==null||O.call(s),s.closeOnSelect&&setTimeout(()=>{r.close(!0)})};HP({getItem:()=>{var O,A,T,j,B;return{ref:()=>t,type:"item",key:y(),textValue:(j=(T=(A=s.textValue)!=null?A:(O=d())==null?void 0:O.textContent)!=null?T:t==null?void 0:t.textContent)!=null?j:"",disabled:(B=s.disabled)!=null?B:!1}}});const v=s1({key:y,selectionManager:h,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>s.disabled},()=>t),b=O=>{lt(O,s.onPointerMove),O.pointerType==="mouse"&&(s.disabled?r.onItemLeave(O):(r.onItemEnter(O),O.defaultPrevented||(Mt(O.currentTarget),r.listState().selectionManager().setFocused(!0),r.listState().selectionManager().setFocusedKey(y()))))},S=O=>{lt(O,s.onPointerLeave),O.pointerType==="mouse"&&r.onItemLeave(O)},C=O=>{lt(O,s.onPointerUp),!s.disabled&&O.button===0&&p()},x=O=>{if(lt(O,s.onKeyDown),!O.repeat&&!s.disabled)switch(O.key){case"Enter":case" ":p();break}},k=K(()=>{if(s.indeterminate)return"mixed";if(s.checked!=null)return s.checked}),w=K(()=>({"data-indeterminate":s.indeterminate?"":void 0,"data-checked":s.checked&&!s.indeterminate?"":void 0,"data-disabled":s.disabled?"":void 0,"data-highlighted":m()?"":void 0})),_={isChecked:()=>s.checked,dataset:w,setLabelRef:f,generateId:Ja(()=>o.id),registerLabel:jn(l),registerDescription:jn(c)};return L(I1.Provider,{value:_,get children(){return L(dt,Pe({as:"div",ref(O){const A=zt(T=>t=T,s.ref);typeof A=="function"&&A(O)},get tabIndex(){return v.tabIndex()},get"aria-checked"(){return k()},get"aria-disabled"(){return s.disabled},get"aria-labelledby"(){return a()},get"aria-describedby"(){return u()},get"data-key"(){return v.dataKey()},get onPointerDown(){return wt([s.onPointerDown,v.onPointerDown])},get onPointerUp(){return wt([C,v.onPointerUp])},get onClick(){return wt([s.onClick,v.onClick])},get onKeyDown(){return wt([x,v.onKeyDown])},get onMouseDown(){return wt([s.onMouseDown,v.onMouseDown])},get onFocus(){return wt([s.onFocus,v.onFocus])},onPointerMove:b,onPointerLeave:S},w,o))}})}function N1(e){const t=Ge({closeOnSelect:!1},e),[n,r]=Ze(t,["checked","defaultChecked","onChange","onSelect"]),i=LP({isSelected:()=>n.checked,defaultIsSelected:()=>n.defaultChecked,onSelectedChange:o=>{var a;return(a=n.onChange)==null?void 0:a.call(n,o)},isDisabled:()=>r.disabled});return L(kh,Pe({role:"menuitemcheckbox",get checked(){return i.isSelected()},onSelect:()=>{var o;(o=n.onSelect)==null||o.call(n),i.toggle()}},r))}var IM=_t();function uc(){return kt(IM)}var ka={next:(e,t)=>e==="ltr"?t==="horizontal"?"ArrowRight":"ArrowDown":t==="horizontal"?"ArrowLeft":"ArrowUp",previous:(e,t)=>ka.next(e==="ltr"?"rtl":"ltr",t)},jm={first:e=>e==="horizontal"?"ArrowDown":"ArrowRight",last:e=>e==="horizontal"?"ArrowUp":"ArrowLeft"};function F1(e){const t=ur(),n=Dr(),r=uc(),{direction:i}=yi(),s=Ge({id:t.generateId("trigger")},e),[o,a]=Ze(s,["ref","id","disabled","onPointerDown","onClick","onKeyDown","onMouseOver","onFocus"]);let l=()=>t.value();r!==void 0&&(l=()=>{var v;return(v=t.value())!=null?v:o.id},r.lastValue()===void 0&&r.setLastValue(l));const u=sc(()=>n.triggerRef(),()=>"button"),c=K(()=>{var v;return u()==="a"&&((v=n.triggerRef())==null?void 0:v.getAttribute("href"))!=null});Se(Tr(()=>r==null?void 0:r.value(),v=>{var b;c()&&v===l()&&((b=n.triggerRef())==null||b.focus())}));const d=()=>{r!==void 0?n.isOpen()?r.value()===l()&&r.closeMenu():(r.autoFocusMenu()||r.setAutoFocusMenu(!0),n.open(!1)):n.toggle(!0)},f=v=>{lt(v,o.onPointerDown),v.currentTarget.dataset.pointerType=v.pointerType,!o.disabled&&v.pointerType!=="touch"&&v.button===0&&d()},h=v=>{lt(v,o.onClick),o.disabled||v.currentTarget.dataset.pointerType==="touch"&&d()},y=v=>{if(lt(v,o.onKeyDown),!o.disabled){if(c())switch(v.key){case"Enter":case" ":return}switch(v.key){case"Enter":case" ":case jm.first(t.orientation()):v.stopPropagation(),v.preventDefault(),OP(v.currentTarget),n.open("first"),r==null||r.setAutoFocusMenu(!0),r==null||r.setValue(l);break;case jm.last(t.orientation()):v.stopPropagation(),v.preventDefault(),n.open("last");break;case ka.next(i(),t.orientation()):if(r===void 0)break;v.stopPropagation(),v.preventDefault(),r.nextMenu();break;case ka.previous(i(),t.orientation()):if(r===void 0)break;v.stopPropagation(),v.preventDefault(),r.previousMenu();break}}},m=v=>{var b;lt(v,o.onMouseOver),((b=n.triggerRef())==null?void 0:b.dataset.pointerType)!=="touch"&&!o.disabled&&r!==void 0&&r.value()!==void 0&&r.setValue(l)},p=v=>{lt(v,o.onFocus),r!==void 0&&v.currentTarget.dataset.pointerType!=="touch"&&r.setValue(l)};return Se(()=>Ce(n.registerTriggerId(o.id))),L(yh,Pe({ref(v){const b=zt(n.setTriggerRef,o.ref);typeof b=="function"&&b(v)},get"data-kb-menu-value-trigger"(){return t.value()},get id(){return o.id},get disabled(){return o.disabled},"aria-haspopup":"true",get"aria-expanded"(){return n.isOpen()},get"aria-controls"(){return K(()=>!!n.isOpen())()?n.contentId():void 0},get"data-highlighted"(){return l()!==void 0&&(r==null?void 0:r.value())===l()?!0:void 0},get tabIndex(){return r!==void 0?r.value()===l()||r.lastValue()===l()?0:-1:void 0},onPointerDown:f,onMouseOver:m,onClick:h,onKeyDown:y,onFocus:p,role:r!==void 0?"menuitem":void 0},()=>n.dataset(),a))}var RM=_t();function B1(){return kt(RM)}function q1(e){let t;const n=ur(),r=Dr(),i=uc(),s=B1(),{direction:o}=yi(),a=Ge({id:n.generateId(`content-${Ln()}`)},e),[l,u]=Ze(a,["ref","id","style","onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onPointerEnter","onPointerMove","onKeyDown","onMouseDown","onFocusIn","onFocusOut"]);let c=0;const d=()=>r.parentMenuContext()==null&&i===void 0&&n.isModal(),f=SM({selectionManager:r.listState().selectionManager,collection:r.listState().collection,autoFocus:r.autoFocus,deferAutoFocus:!0,shouldFocusWrap:!0,disallowTypeAhead:()=>!r.listState().selectionManager().isFocused(),orientation:()=>n.orientation()==="horizontal"?"vertical":"horizontal"},()=>t);CM({trapFocus:()=>d()&&r.isOpen(),onMountAutoFocus:S=>{var C;i===void 0&&((C=l.onOpenAutoFocus)==null||C.call(l,S))},onUnmountAutoFocus:l.onCloseAutoFocus},()=>t);const h=S=>{if(Pn(S.currentTarget,S.target)&&(S.key==="Tab"&&r.isOpen()&&S.preventDefault(),i!==void 0&&S.currentTarget.getAttribute("aria-haspopup")!=="true"))switch(S.key){case ka.next(o(),n.orientation()):S.stopPropagation(),S.preventDefault(),r.close(!0),i.setAutoFocusMenu(!0),i.nextMenu();break;case ka.previous(o(),n.orientation()):if(S.currentTarget.hasAttribute("data-closed"))break;S.stopPropagation(),S.preventDefault(),r.close(!0),i.setAutoFocusMenu(!0),i.previousMenu();break}},y=S=>{var C;(C=l.onEscapeKeyDown)==null||C.call(l,S),i==null||i.setAutoFocusMenu(!1),r.close(!0)},m=S=>{var C;(C=l.onFocusOutside)==null||C.call(l,S),n.isModal()&&S.preventDefault()},p=S=>{var C,x;lt(S,l.onPointerEnter),r.isOpen()&&((C=r.parentMenuContext())==null||C.listState().selectionManager().setFocused(!1),(x=r.parentMenuContext())==null||x.listState().selectionManager().setFocusedKey(void 0))},v=S=>{if(lt(S,l.onPointerMove),S.pointerType!=="mouse")return;const C=S.target,x=c!==S.clientX;Pn(S.currentTarget,C)&&x&&(r.setPointerDir(S.clientX>c?"right":"left"),c=S.clientX)};Se(()=>Ce(r.registerContentId(l.id)));const b={ref:zt(S=>{r.setContentRef(S),t=S},l.ref),role:"menu",get id(){return l.id},get tabIndex(){return f.tabIndex()},get"aria-labelledby"(){return r.triggerId()},onKeyDown:wt([l.onKeyDown,f.onKeyDown,h]),onMouseDown:wt([l.onMouseDown,f.onMouseDown]),onFocusIn:wt([l.onFocusIn,f.onFocusIn]),onFocusOut:wt([l.onFocusOut,f.onFocusOut]),onPointerEnter:p,onPointerMove:v,get"data-orientation"(){return n.orientation()}};return L(xe,{get when(){return r.contentPresent()},get children(){return L(xe,{get when(){return s===void 0||r.parentMenuContext()!=null},get fallback(){return L(dt,Pe({as:"div"},()=>r.dataset(),b,u))},get children(){return L(x1.Positioner,{get children(){return L(bM,Pe({get disableOutsidePointerEvents(){return K(()=>!!d())()&&r.isOpen()},get excludedElements(){return[r.triggerRef]},bypassTopMostLayerCheck:!0,get style(){return rc({"--kb-menu-content-transform-origin":"var(--kb-popper-content-transform-origin)",position:"relative"},l.style)},onEscapeKeyDown:y,onFocusOutside:m,get onDismiss(){return r.close}},()=>r.dataset(),b,u))}})}})}})}function NM(e){let t;const n=ur(),r=Dr(),[i,s]=Ze(e,["ref"]);return DM({element:()=>t!=null?t:null,enabled:()=>r.contentPresent()&&n.preventScroll()}),L(q1,Pe({ref(o){const a=zt(l=>{t=l},i.ref);typeof a=="function"&&a(o)}},s))}var z1=_t();function FM(){const e=kt(z1);if(e===void 0)throw new Error("[kobalte]: `useMenuGroupContext` must be used within a `Menu.Group` component");return e}function Oh(e){const t=ur(),n=Ge({id:t.generateId(`group-${Ln()}`)},e),[r,i]=ae(),s={generateId:Ja(()=>n.id),registerLabelId:jn(i)};return L(z1.Provider,{value:s,get children(){return L(dt,Pe({as:"div",role:"group",get"aria-labelledby"(){return r()}},n))}})}function H1(e){const t=FM(),n=Ge({id:t.generateId("label")},e),[r,i]=Ze(n,["id"]);return Se(()=>Ce(t.registerLabelId(r.id))),L(dt,Pe({as:"span",get id(){return r.id},"aria-hidden":"true"},i))}function U1(e){const t=Dr(),n=Ge({children:"▼"},e);return L(dt,Pe({as:"span","aria-hidden":"true"},()=>t.dataset(),n))}function G1(e){return L(kh,Pe({role:"menuitem",closeOnSelect:!0},e))}function K1(e){const t=_h(),n=Ge({id:t.generateId("description")},e),[r,i]=Ze(n,["id"]);return Se(()=>Ce(t.registerDescription(r.id))),L(dt,Pe({as:"div",get id(){return r.id}},()=>t.dataset(),i))}function V1(e){const t=_h(),n=Ge({id:t.generateId("indicator")},e),[r,i]=Ze(n,["forceMount"]);return L(xe,{get when(){return r.forceMount||t.isChecked()},get children(){return L(dt,Pe({as:"div"},()=>t.dataset(),i))}})}function W1(e){const t=_h(),n=Ge({id:t.generateId("label")},e),[r,i]=Ze(n,["ref","id"]);return Se(()=>Ce(t.registerLabel(r.id))),L(dt,Pe({as:"div",ref(s){const o=zt(t.setLabelRef,r.ref);typeof o=="function"&&o(s)},get id(){return r.id}},()=>t.dataset(),i))}function Q1(e){const t=Dr();return L(xe,{get when(){return t.contentPresent()},get children(){return L(xv,e)}})}var Y1=_t();function BM(){const e=kt(Y1);if(e===void 0)throw new Error("[kobalte]: `useMenuRadioGroupContext` must be used within a `Menu.RadioGroup` component");return e}function X1(e){const n=ur().generateId(`radiogroup-${Ln()}`),r=Ge({id:n},e),[i,s]=Ze(r,["value","defaultValue","onChange","disabled"]),[o,a]=tl({value:()=>i.value,defaultValue:()=>i.defaultValue,onChange:u=>{var c;return(c=i.onChange)==null?void 0:c.call(i,u)}}),l={isDisabled:()=>i.disabled,isSelectedValue:u=>u===o(),setSelectedValue:a};return L(Y1.Provider,{value:l,get children(){return L(Oh,s)}})}function Z1(e){const t=BM(),n=Ge({closeOnSelect:!1},e),[r,i]=Ze(n,["value","onSelect"]);return L(kh,Pe({role:"menuitemradio",get checked(){return t.isSelectedValue(r.value)},onSelect:()=>{var o;(o=r.onSelect)==null||o.call(r),t.setSelectedValue(r.value)}},i))}function qM(e,t,n){const r=e.split("-")[0],i=n.getBoundingClientRect(),s=[],o=t.clientX,a=t.clientY;switch(r){case"top":s.push([o,a+5]),s.push([i.left,i.bottom]),s.push([i.left,i.top]),s.push([i.right,i.top]),s.push([i.right,i.bottom]);break;case"right":s.push([o-5,a]),s.push([i.left,i.top]),s.push([i.right,i.top]),s.push([i.right,i.bottom]),s.push([i.left,i.bottom]);break;case"bottom":s.push([o,a-5]),s.push([i.right,i.top]),s.push([i.right,i.bottom]),s.push([i.left,i.bottom]),s.push([i.left,i.top]);break;case"left":s.push([o+5,a]),s.push([i.right,i.bottom]),s.push([i.left,i.bottom]),s.push([i.left,i.top]),s.push([i.right,i.top]);break}return s}function zM(e,t){return t?kP([e.clientX,e.clientY],t):!1}function J1(e){const t=ur(),n=Zb(),r=D1(),i=uc(),s=B1(),o=Ge({placement:t.orientation()==="horizontal"?"bottom-start":"right-start"},e),[a,l]=Ze(o,["open","defaultOpen","onOpenChange"]);let u=0,c=null,d="right";const[f,h]=ae(),[y,m]=ae(),[p,v]=ae(),[b,S]=ae(),[C,x]=ae(!0),[k,w]=ae(l.placement),[_,O]=ae([]),[A,T]=ae([]),{DomCollectionProvider:j}=zP({items:A,onItemsChange:T}),B=S1({open:()=>a.open,defaultOpen:()=>a.defaultOpen,onOpenChange:X=>{var ge;return(ge=a.onOpenChange)==null?void 0:ge.call(a,X)}}),{present:R}=o1({show:()=>t.forceMount()||B.isOpen(),element:()=>{var X;return(X=b())!=null?X:null}}),P=oj({selectionMode:"none",dataSource:A}),M=X=>{x(X),B.open()},I=(X=!1)=>{B.close(),X&&r&&r.close(!0)},G=X=>{x(X),B.toggle()},Y=()=>{const X=b();X&&(Mt(X),P.selectionManager().setFocused(!0),P.selectionManager().setFocusedKey(void 0))},q=()=>{s!=null?setTimeout(()=>Y()):Y()},U=X=>{O(ye=>[...ye,X]);const ge=r==null?void 0:r.registerNestedMenu(X);return()=>{O(ye=>uf(ye,X)),ge==null||ge()}},z=X=>d===(c==null?void 0:c.side)&&zM(X,c==null?void 0:c.area),V=X=>{z(X)&&X.preventDefault()},N=X=>{z(X)||q()},ne=X=>{z(X)&&X.preventDefault()};kM({isDisabled:()=>!(r==null&&B.isOpen()&&t.isModal()),targets:()=>[b(),..._()].filter(Boolean)}),Se(()=>{const X=b();if(!X||!r)return;const ge=r.registerNestedMenu(X);Ce(()=>{ge()})}),Se(()=>{r===void 0&&(i==null||i.registerMenu(t.value(),[b(),..._()]))}),Se(()=>{var X;r!==void 0||i===void 0||(i.value()===t.value()?((X=p())==null||X.focus(),i.autoFocusMenu()&&M(!0)):I())}),Se(()=>{r!==void 0||i===void 0||B.isOpen()&&i.setValue(t.value())}),Ce(()=>{r===void 0&&(i==null||i.unregisterMenu(t.value()))});const he={dataset:K(()=>({"data-expanded":B.isOpen()?"":void 0,"data-closed":B.isOpen()?void 0:""})),isOpen:B.isOpen,contentPresent:R,nestedMenus:_,currentPlacement:k,pointerGraceTimeoutId:()=>u,autoFocus:C,listState:()=>P,parentMenuContext:()=>r,triggerRef:p,contentRef:b,triggerId:f,contentId:y,setTriggerRef:v,setContentRef:S,open:M,close:I,toggle:G,focusContent:q,onItemEnter:V,onItemLeave:N,onTriggerLeave:ne,setPointerDir:X=>d=X,setPointerGraceTimeoutId:X=>u=X,setPointerGraceIntent:X=>c=X,registerNestedMenu:U,registerItemToParentDomCollection:n==null?void 0:n.registerItem,registerTriggerId:jn(h),registerContentId:jn(m)};return L(j,{get children(){return L(L1.Provider,{value:he,get children(){return L(xe,{when:s===void 0,get fallback(){return l.children},get children(){return L(x1,Pe({anchorRef:p,contentRef:b,onCurrentPlacementChange:w},l))}})}})}})}function ex(e){const{direction:t}=yi();return L(J1,Pe({get placement(){return t()==="rtl"?"left-start":"right-start"},flip:!0},e))}var HM={close:(e,t)=>e==="ltr"?[t==="horizontal"?"ArrowLeft":"ArrowUp"]:[t==="horizontal"?"ArrowRight":"ArrowDown"]};function tx(e){const t=Dr(),n=ur(),[r,i]=Ze(e,["onFocusOutside","onKeyDown"]),{direction:s}=yi();return L(q1,Pe({onOpenAutoFocus:c=>{c.preventDefault()},onCloseAutoFocus:c=>{c.preventDefault()},onFocusOutside:c=>{var f;(f=r.onFocusOutside)==null||f.call(r,c);const d=c.target;Pn(t.triggerRef(),d)||t.close()},onKeyDown:c=>{lt(c,r.onKeyDown);const d=Pn(c.currentTarget,c.target),f=HM.close(s(),n.orientation()).includes(c.key),h=t.parentMenuContext()!=null;d&&f&&h&&(t.close(),Mt(t.triggerRef()))}},i))}var Mm=["Enter"," "],UM={open:(e,t)=>e==="ltr"?[...Mm,t==="horizontal"?"ArrowRight":"ArrowDown"]:[...Mm,t==="horizontal"?"ArrowLeft":"ArrowUp"]};function nx(e){let t;const n=ur(),r=Dr(),i=Ge({id:n.generateId(`sub-trigger-${Ln()}`)},e),[s,o]=Ze(i,["ref","id","textValue","disabled","onPointerMove","onPointerLeave","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]);let a=null;const l=()=>{a&&window.clearTimeout(a),a=null},{direction:u}=yi(),c=()=>s.id,d=()=>{const S=r.parentMenuContext();if(S==null)throw new Error("[kobalte]: `Menu.SubTrigger` must be used within a `Menu.Sub` component");return S.listState().selectionManager()},f=()=>r.listState().collection(),h=()=>d().focusedKey()===c(),y=s1({key:c,selectionManager:d,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>s.disabled},()=>t),m=S=>{lt(S,s.onClick),!r.isOpen()&&!s.disabled&&r.open(!0)},p=S=>{var x;if(lt(S,s.onPointerMove),S.pointerType!=="mouse")return;const C=r.parentMenuContext();if(C==null||C.onItemEnter(S),!S.defaultPrevented){if(s.disabled){C==null||C.onItemLeave(S);return}!r.isOpen()&&!a&&((x=r.parentMenuContext())==null||x.setPointerGraceIntent(null),a=window.setTimeout(()=>{r.open(!1),l()},100)),C==null||C.onItemEnter(S),S.defaultPrevented||(r.listState().selectionManager().isFocused()&&(r.listState().selectionManager().setFocused(!1),r.listState().selectionManager().setFocusedKey(void 0)),Mt(S.currentTarget),C==null||C.listState().selectionManager().setFocused(!0),C==null||C.listState().selectionManager().setFocusedKey(c()))}},v=S=>{if(lt(S,s.onPointerLeave),S.pointerType!=="mouse")return;l();const C=r.parentMenuContext(),x=r.contentRef();if(x){C==null||C.setPointerGraceIntent({area:qM(r.currentPlacement(),S,x),side:r.currentPlacement().split("-")[0]}),window.clearTimeout(C==null?void 0:C.pointerGraceTimeoutId());const k=window.setTimeout(()=>{C==null||C.setPointerGraceIntent(null)},300);C==null||C.setPointerGraceTimeoutId(k)}else{if(C==null||C.onTriggerLeave(S),S.defaultPrevented)return;C==null||C.setPointerGraceIntent(null)}C==null||C.onItemLeave(S)},b=S=>{lt(S,s.onKeyDown),!S.repeat&&(s.disabled||UM.open(u(),n.orientation()).includes(S.key)&&(S.stopPropagation(),S.preventDefault(),d().setFocused(!1),d().setFocusedKey(void 0),r.isOpen()||r.open("first"),r.focusContent(),r.listState().selectionManager().setFocused(!0),r.listState().selectionManager().setFocusedKey(f().getFirstKey())))};return Se(()=>{var C,x,k;if(r.registerItemToParentDomCollection==null)throw new Error("[kobalte]: `Menu.SubTrigger` must be used within a `Menu.Sub` component");const S=r.registerItemToParentDomCollection({ref:()=>t,type:"item",key:c(),textValue:(x=(C=s.textValue)!=null?C:t==null?void 0:t.textContent)!=null?x:"",disabled:(k=s.disabled)!=null?k:!1});Ce(S)}),Se(Tr(()=>{var S;return(S=r.parentMenuContext())==null?void 0:S.pointerGraceTimeoutId()},S=>{Ce(()=>{var C;window.clearTimeout(S),(C=r.parentMenuContext())==null||C.setPointerGraceIntent(null)})})),Se(()=>Ce(r.registerTriggerId(s.id))),Ce(()=>{l()}),L(dt,Pe({as:"div",ref(S){const C=zt(x=>{r.setTriggerRef(x),t=x},s.ref);typeof C=="function"&&C(S)},get id(){return s.id},role:"menuitem",get tabIndex(){return y.tabIndex()},"aria-haspopup":"true",get"aria-expanded"(){return r.isOpen()},get"aria-controls"(){return K(()=>!!r.isOpen())()?r.contentId():void 0},get"aria-disabled"(){return s.disabled},get"data-key"(){return y.dataKey()},get"data-highlighted"(){return h()?"":void 0},get"data-disabled"(){return s.disabled?"":void 0},get onPointerDown(){return wt([s.onPointerDown,y.onPointerDown])},get onPointerUp(){return wt([s.onPointerUp,y.onPointerUp])},get onClick(){return wt([m,y.onClick])},get onKeyDown(){return wt([b,y.onKeyDown])},get onMouseDown(){return wt([s.onMouseDown,y.onMouseDown])},get onFocus(){return wt([s.onFocus,y.onFocus])},onPointerMove:p,onPointerLeave:v},()=>r.dataset(),o))}function GM(e){const t=uc(),n=`menu-${Ln()}`,r=Ge({id:n,modal:!0},e),[i,s]=Ze(r,["id","modal","preventScroll","forceMount","open","defaultOpen","onOpenChange","value","orientation"]),o=S1({open:()=>i.open,defaultOpen:()=>i.defaultOpen,onOpenChange:l=>{var u;return(u=i.onOpenChange)==null?void 0:u.call(i,l)}}),a={isModal:()=>{var l;return(l=i.modal)!=null?l:!0},preventScroll:()=>{var l;return(l=i.preventScroll)!=null?l:a.isModal()},forceMount:()=>{var l;return(l=i.forceMount)!=null?l:!1},generateId:Ja(()=>i.id),value:()=>i.value,orientation:()=>{var l,u;return(u=(l=i.orientation)!=null?l:t==null?void 0:t.orientation())!=null?u:"horizontal"}};return L(R1.Provider,{value:a,get children(){return L(J1,Pe({get open(){return o.isOpen()},get onOpenChange(){return o.setIsOpen}},s))}})}var KM={};oc(KM,{Root:()=>cc,Separator:()=>VM});function cc(e){let t;const n=Ge({orientation:"horizontal"},e),[r,i]=Ze(n,["ref","orientation"]),s=sc(()=>t,()=>"hr");return L(dt,Pe({as:"hr",ref(o){const a=zt(l=>t=l,r.ref);typeof a=="function"&&a(o)},get role(){return s()!=="hr"?"separator":void 0},get"aria-orientation"(){return r.orientation==="vertical"?"vertical":void 0},get"data-orientation"(){return r.orientation}},i))}var VM=cc,mt={};oc(mt,{Arrow:()=>Ch,CheckboxItem:()=>N1,Content:()=>rx,DropdownMenu:()=>WM,Group:()=>Oh,GroupLabel:()=>H1,Icon:()=>U1,Item:()=>G1,ItemDescription:()=>K1,ItemIndicator:()=>V1,ItemLabel:()=>W1,Portal:()=>Q1,RadioGroup:()=>X1,RadioItem:()=>Z1,Root:()=>ix,Separator:()=>cc,Sub:()=>ex,SubContent:()=>tx,SubTrigger:()=>nx,Trigger:()=>F1});function rx(e){const t=ur(),n=Dr(),[r,i]=Ze(e,["onCloseAutoFocus","onInteractOutside"]);let s=!1;return L(NM,Pe({onCloseAutoFocus:l=>{var u;(u=r.onCloseAutoFocus)==null||u.call(r,l),s||Mt(n.triggerRef()),s=!1,l.preventDefault()},onInteractOutside:l=>{var u;(u=r.onInteractOutside)==null||u.call(r,l),(!t.isModal()||l.detail.isContextMenu)&&(s=!0)}},i))}function ix(e){const t=`dropdownmenu-${Ln()}`,n=Ge({id:t},e);return L(GM,n)}var WM=Object.assign(ix,{Arrow:Ch,CheckboxItem:N1,Content:rx,Group:Oh,GroupLabel:H1,Icon:U1,Item:G1,ItemDescription:K1,ItemIndicator:V1,ItemLabel:W1,Portal:Q1,RadioGroup:X1,RadioItem:Z1,Separator:cc,Sub:ex,SubContent:tx,SubTrigger:nx,Trigger:F1}),W={colors:{inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000000",white:"#ffffff",neutral:{50:"#f9fafb",100:"#f2f4f7",200:"#eaecf0",300:"#d0d5dd",400:"#98a2b3",500:"#667085",600:"#475467",700:"#344054",800:"#1d2939",900:"#101828"},darkGray:{50:"#525c7a",100:"#49536e",200:"#414962",300:"#394056",400:"#313749",500:"#292e3d",600:"#212530",700:"#191c24",800:"#111318",900:"#0b0d10"},gray:{50:"#f9fafb",100:"#f2f4f7",200:"#eaecf0",300:"#d0d5dd",400:"#98a2b3",500:"#667085",600:"#475467",700:"#344054",800:"#1d2939",900:"#101828"},blue:{25:"#F5FAFF",50:"#EFF8FF",100:"#D1E9FF",200:"#B2DDFF",300:"#84CAFF",400:"#53B1FD",500:"#2E90FA",600:"#1570EF",700:"#175CD3",800:"#1849A9",900:"#194185"},green:{25:"#F6FEF9",50:"#ECFDF3",100:"#D1FADF",200:"#A6F4C5",300:"#6CE9A6",400:"#32D583",500:"#12B76A",600:"#039855",700:"#027A48",800:"#05603A",900:"#054F31"},red:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d",950:"#450a0a"},yellow:{25:"#FFFCF5",50:"#FFFAEB",100:"#FEF0C7",200:"#FEDF89",300:"#FEC84B",400:"#FDB022",500:"#F79009",600:"#DC6803",700:"#B54708",800:"#93370D",900:"#7A2E0E"},purple:{25:"#FAFAFF",50:"#F4F3FF",100:"#EBE9FE",200:"#D9D6FE",300:"#BDB4FE",400:"#9B8AFB",500:"#7A5AF8",600:"#6938EF",700:"#5925DC",800:"#4A1FB8",900:"#3E1C96"},teal:{25:"#F6FEFC",50:"#F0FDF9",100:"#CCFBEF",200:"#99F6E0",300:"#5FE9D0",400:"#2ED3B7",500:"#15B79E",600:"#0E9384",700:"#107569",800:"#125D56",900:"#134E48"},pink:{25:"#fdf2f8",50:"#fce7f3",100:"#fbcfe8",200:"#f9a8d4",300:"#f472b6",400:"#ec4899",500:"#db2777",600:"#be185d",700:"#9d174d",800:"#831843",900:"#500724"},cyan:{25:"#ecfeff",50:"#cffafe",100:"#a5f3fc",200:"#67e8f9",300:"#22d3ee",400:"#06b6d4",500:"#0891b2",600:"#0e7490",700:"#155e75",800:"#164e63",900:"#083344"}},alpha:{90:"e5",80:"cc"},font:{size:{xs:"calc(var(--tsqd-font-size) * 0.75)",sm:"calc(var(--tsqd-font-size) * 0.875)",md:"var(--tsqd-font-size)"},lineHeight:{xs:"calc(var(--tsqd-font-size) * 1)",sm:"calc(var(--tsqd-font-size) * 1.25)",md:"calc(var(--tsqd-font-size) * 1.5)"},weight:{medium:"500",semibold:"600",bold:"700"}},border:{radius:{xs:"calc(var(--tsqd-font-size) * 0.125)",sm:"calc(var(--tsqd-font-size) * 0.25)",full:"9999px"}},size:{.25:"calc(var(--tsqd-font-size) * 0.0625)",.5:"calc(var(--tsqd-font-size) * 0.125)",1:"calc(var(--tsqd-font-size) * 0.25)",1.5:"calc(var(--tsqd-font-size) * 0.375)",2:"calc(var(--tsqd-font-size) * 0.5)",2.5:"calc(var(--tsqd-font-size) * 0.625)",3:"calc(var(--tsqd-font-size) * 0.75)",3.5:"calc(var(--tsqd-font-size) * 0.875)",4:"calc(var(--tsqd-font-size) * 1)",4.5:"calc(var(--tsqd-font-size) * 1.125)",5:"calc(var(--tsqd-font-size) * 1.25)",6:"calc(var(--tsqd-font-size) * 1.5)",6.5:"calc(var(--tsqd-font-size) * 1.625)",14:"calc(var(--tsqd-font-size) * 3.5)"},shadow:{xs:(e="rgb(0 0 0 / 0.1)")=>"0 1px 2px 0 rgb(0 0 0 / 0.05)",sm:(e="rgb(0 0 0 / 0.1)")=>`0 1px 3px 0 ${e}, 0 1px 2px -1px ${e}`,md:(e="rgb(0 0 0 / 0.1)")=>`0 4px 6px -1px ${e}, 0 2px 4px -2px ${e}`,lg:(e="rgb(0 0 0 / 0.1)")=>`0 10px 15px -3px ${e}, 0 4px 6px -4px ${e}`,xl:(e="rgb(0 0 0 / 0.1)")=>`0 20px 25px -5px ${e}, 0 8px 10px -6px ${e}`,"2xl":(e="rgb(0 0 0 / 0.25)")=>`0 25px 50px -12px ${e}`,inner:(e="rgb(0 0 0 / 0.05)")=>`inset 0 2px 4px 0 ${e}`,none:()=>"none"}},QM=ce('<svg width=14 height=14 viewBox="0 0 14 14"fill=none xmlns=http://www.w3.org/2000/svg><path d="M13 13L9.00007 9M10.3333 5.66667C10.3333 8.244 8.244 10.3333 5.66667 10.3333C3.08934 10.3333 1 8.244 1 5.66667C1 3.08934 3.08934 1 5.66667 1C8.244 1 10.3333 3.08934 10.3333 5.66667Z"stroke=currentColor stroke-width=1.66667 stroke-linecap=round stroke-linejoin=round>'),YM=ce('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M9 3H15M3 6H21M19 6L18.2987 16.5193C18.1935 18.0975 18.1409 18.8867 17.8 19.485C17.4999 20.0118 17.0472 20.4353 16.5017 20.6997C15.882 21 15.0911 21 13.5093 21H10.4907C8.90891 21 8.11803 21 7.49834 20.6997C6.95276 20.4353 6.50009 20.0118 6.19998 19.485C5.85911 18.8867 5.8065 18.0975 5.70129 16.5193L5 6M10 10.5V15.5M14 10.5V15.5"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),XM=ce('<svg width=10 height=6 viewBox="0 0 10 6"fill=none xmlns=http://www.w3.org/2000/svg><path d="M1 1L5 5L9 1"stroke=currentColor stroke-width=1.66667 stroke-linecap=round stroke-linejoin=round>'),ZM=ce('<svg width=12 height=12 viewBox="0 0 16 16"fill=none xmlns=http://www.w3.org/2000/svg><path d="M8 13.3333V2.66667M8 2.66667L4 6.66667M8 2.66667L12 6.66667"stroke=currentColor stroke-width=1.66667 stroke-linecap=round stroke-linejoin=round>'),Eh=ce('<svg width=12 height=12 viewBox="0 0 16 16"fill=none xmlns=http://www.w3.org/2000/svg><path d="M8 2.66667V13.3333M8 13.3333L4 9.33333M8 13.3333L12 9.33333"stroke=currentColor stroke-width=1.66667 stroke-linecap=round stroke-linejoin=round>'),JM=ce('<svg viewBox="0 0 24 24"height=12 width=12 fill=none xmlns=http://www.w3.org/2000/svg><path d="M12 2v2m0 16v2M4 12H2m4.314-5.686L4.9 4.9m12.786 1.414L19.1 4.9M6.314 17.69 4.9 19.104m12.786-1.414 1.414 1.414M22 12h-2m-3 0a5 5 0 1 1-10 0 5 5 0 0 1 10 0Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),e$=ce('<svg viewBox="0 0 24 24"height=12 width=12 fill=none xmlns=http://www.w3.org/2000/svg><path d="M22 15.844a10.424 10.424 0 0 1-4.306.925c-5.779 0-10.463-4.684-10.463-10.462 0-1.536.33-2.994.925-4.307A10.464 10.464 0 0 0 2 11.538C2 17.316 6.684 22 12.462 22c4.243 0 7.896-2.526 9.538-6.156Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),t$=ce('<svg viewBox="0 0 24 24"height=12 width=12 fill=none xmlns=http://www.w3.org/2000/svg><path d="M8 21h8m-4-4v4m-5.2-4h10.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C22 14.72 22 13.88 22 12.2V7.8c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C19.72 3 18.88 3 17.2 3H6.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C2 5.28 2 6.12 2 7.8v4.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C4.28 17 5.12 17 6.8 17Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),n$=ce('<svg stroke=currentColor fill=currentColor stroke-width=0 viewBox="0 0 24 24"height=1em width=1em xmlns=http://www.w3.org/2000/svg><path fill=none d="M0 0h24v24H0z"></path><path d="M1 9l2 2c4.97-4.97 13.03-4.97 18 0l2-2C16.93 2.93 7.08 2.93 1 9zm8 8l3 3 3-3a4.237 4.237 0 00-6 0zm-4-4l2 2a7.074 7.074 0 0110 0l2-2C15.14 9.14 8.87 9.14 5 13z">'),r$=ce('<svg stroke-width=0 viewBox="0 0 24 24"height=1em width=1em xmlns=http://www.w3.org/2000/svg><path fill=none d="M24 .01c0-.01 0-.01 0 0L0 0v24h24V.01zM0 0h24v24H0V0zm0 0h24v24H0V0z"></path><path d="M22.99 9C19.15 5.16 13.8 3.76 8.84 4.78l2.52 2.52c3.47-.17 6.99 1.05 9.63 3.7l2-2zm-4 4a9.793 9.793 0 00-4.49-2.56l3.53 3.53.96-.97zM2 3.05L5.07 6.1C3.6 6.82 2.22 7.78 1 9l1.99 2c1.24-1.24 2.67-2.16 4.2-2.77l2.24 2.24A9.684 9.684 0 005 13v.01L6.99 15a7.042 7.042 0 014.92-2.06L18.98 20l1.27-1.26L3.29 1.79 2 3.05zM9 17l3 3 3-3a4.237 4.237 0 00-6 0z">'),i$=ce('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M9.3951 19.3711L9.97955 20.6856C10.1533 21.0768 10.4368 21.4093 10.7958 21.6426C11.1547 21.8759 11.5737 22.0001 12.0018 22C12.4299 22.0001 12.8488 21.8759 13.2078 21.6426C13.5667 21.4093 13.8503 21.0768 14.024 20.6856L14.6084 19.3711C14.8165 18.9047 15.1664 18.5159 15.6084 18.26C16.0532 18.0034 16.5678 17.8941 17.0784 17.9478L18.5084 18.1C18.9341 18.145 19.3637 18.0656 19.7451 17.8713C20.1265 17.6771 20.4434 17.3763 20.6573 17.0056C20.8715 16.635 20.9735 16.2103 20.9511 15.7829C20.9286 15.3555 20.7825 14.9438 20.5307 14.5978L19.684 13.4344C19.3825 13.0171 19.2214 12.5148 19.224 12C19.2239 11.4866 19.3865 10.9864 19.6884 10.5711L20.5351 9.40778C20.787 9.06175 20.933 8.65007 20.9555 8.22267C20.978 7.79528 20.8759 7.37054 20.6618 7C20.4479 6.62923 20.131 6.32849 19.7496 6.13423C19.3681 5.93997 18.9386 5.86053 18.5129 5.90556L17.0829 6.05778C16.5722 6.11141 16.0577 6.00212 15.6129 5.74556C15.17 5.48825 14.82 5.09736 14.6129 4.62889L14.024 3.31444C13.8503 2.92317 13.5667 2.59072 13.2078 2.3574C12.8488 2.12408 12.4299 1.99993 12.0018 2C11.5737 1.99993 11.1547 2.12408 10.7958 2.3574C10.4368 2.59072 10.1533 2.92317 9.97955 3.31444L9.3951 4.62889C9.18803 5.09736 8.83798 5.48825 8.3951 5.74556C7.95032 6.00212 7.43577 6.11141 6.9251 6.05778L5.49066 5.90556C5.06499 5.86053 4.6354 5.93997 4.25397 6.13423C3.87255 6.32849 3.55567 6.62923 3.34177 7C3.12759 7.37054 3.02555 7.79528 3.04804 8.22267C3.07052 8.65007 3.21656 9.06175 3.46844 9.40778L4.3151 10.5711C4.61704 10.9864 4.77964 11.4866 4.77955 12C4.77964 12.5134 4.61704 13.0137 4.3151 13.4289L3.46844 14.5922C3.21656 14.9382 3.07052 15.3499 3.04804 15.7773C3.02555 16.2047 3.12759 16.6295 3.34177 17C3.55589 17.3706 3.8728 17.6712 4.25417 17.8654C4.63554 18.0596 5.06502 18.1392 5.49066 18.0944L6.92066 17.9422C7.43133 17.8886 7.94587 17.9979 8.39066 18.2544C8.83519 18.511 9.18687 18.902 9.3951 19.3711Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round></path><path d="M12 15C13.6568 15 15 13.6569 15 12C15 10.3431 13.6568 9 12 9C10.3431 9 8.99998 10.3431 8.99998 12C8.99998 13.6569 10.3431 15 12 15Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),s$=ce('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M16 21H16.2C17.8802 21 18.7202 21 19.362 20.673C19.9265 20.3854 20.3854 19.9265 20.673 19.362C21 18.7202 21 17.8802 21 16.2V7.8C21 6.11984 21 5.27976 20.673 4.63803C20.3854 4.07354 19.9265 3.6146 19.362 3.32698C18.7202 3 17.8802 3 16.2 3H7.8C6.11984 3 5.27976 3 4.63803 3.32698C4.07354 3.6146 3.6146 4.07354 3.32698 4.63803C3 5.27976 3 6.11984 3 7.8V8M11.5 12.5L17 7M17 7H12M17 7V12M6.2 21H8.8C9.9201 21 10.4802 21 10.908 20.782C11.2843 20.5903 11.5903 20.2843 11.782 19.908C12 19.4802 12 18.9201 12 17.8V15.2C12 14.0799 12 13.5198 11.782 13.092C11.5903 12.7157 11.2843 12.4097 10.908 12.218C10.4802 12 9.92011 12 8.8 12H6.2C5.0799 12 4.51984 12 4.09202 12.218C3.71569 12.4097 3.40973 12.7157 3.21799 13.092C3 13.5198 3 14.0799 3 15.2V17.8C3 18.9201 3 19.4802 3.21799 19.908C3.40973 20.2843 3.71569 20.5903 4.09202 20.782C4.51984 21 5.07989 21 6.2 21Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),o$=ce('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path class=copier d="M8 8V5.2C8 4.0799 8 3.51984 8.21799 3.09202C8.40973 2.71569 8.71569 2.40973 9.09202 2.21799C9.51984 2 10.0799 2 11.2 2H18.8C19.9201 2 20.4802 2 20.908 2.21799C21.2843 2.40973 21.5903 2.71569 21.782 3.09202C22 3.51984 22 4.0799 22 5.2V12.8C22 13.9201 22 14.4802 21.782 14.908C21.5903 15.2843 21.2843 15.5903 20.908 15.782C20.4802 16 19.9201 16 18.8 16H16M5.2 22H12.8C13.9201 22 14.4802 22 14.908 21.782C15.2843 21.5903 15.5903 21.2843 15.782 20.908C16 20.4802 16 19.9201 16 18.8V11.2C16 10.0799 16 9.51984 15.782 9.09202C15.5903 8.71569 15.2843 8.40973 14.908 8.21799C14.4802 8 13.9201 8 12.8 8H5.2C4.0799 8 3.51984 8 3.09202 8.21799C2.71569 8.40973 2.40973 8.71569 2.21799 9.09202C2 9.51984 2 10.0799 2 11.2V18.8C2 19.9201 2 20.4802 2.21799 20.908C2.40973 21.2843 2.71569 21.5903 3.09202 21.782C3.51984 22 4.07989 22 5.2 22Z"stroke-width=2 stroke-linecap=round stroke-linejoin=round stroke=currentColor>'),a$=ce('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M2.5 21.4998L8.04927 19.3655C8.40421 19.229 8.58168 19.1607 8.74772 19.0716C8.8952 18.9924 9.0358 18.901 9.16804 18.7984C9.31692 18.6829 9.45137 18.5484 9.72028 18.2795L21 6.99982C22.1046 5.89525 22.1046 4.10438 21 2.99981C19.8955 1.89525 18.1046 1.89524 17 2.99981L5.72028 14.2795C5.45138 14.5484 5.31692 14.6829 5.20139 14.8318C5.09877 14.964 5.0074 15.1046 4.92823 15.2521C4.83911 15.4181 4.77085 15.5956 4.63433 15.9506L2.5 21.4998ZM2.5 21.4998L4.55812 16.1488C4.7054 15.7659 4.77903 15.5744 4.90534 15.4867C5.01572 15.4101 5.1523 15.3811 5.2843 15.4063C5.43533 15.4351 5.58038 15.5802 5.87048 15.8703L8.12957 18.1294C8.41967 18.4195 8.56472 18.5645 8.59356 18.7155C8.61877 18.8475 8.58979 18.9841 8.51314 19.0945C8.42545 19.2208 8.23399 19.2944 7.85107 19.4417L2.5 21.4998Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),sx=ce('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M7.5 12L10.5 15L16.5 9M7.8 21H16.2C17.8802 21 18.7202 21 19.362 20.673C19.9265 20.3854 20.3854 19.9265 20.673 19.362C21 18.7202 21 17.8802 21 16.2V7.8C21 6.11984 21 5.27976 20.673 4.63803C20.3854 4.07354 19.9265 3.6146 19.362 3.32698C18.7202 3 17.8802 3 16.2 3H7.8C6.11984 3 5.27976 3 4.63803 3.32698C4.07354 3.6146 3.6146 4.07354 3.32698 4.63803C3 5.27976 3 6.11984 3 7.8V16.2C3 17.8802 3 18.7202 3.32698 19.362C3.6146 19.9265 4.07354 20.3854 4.63803 20.673C5.27976 21 6.11984 21 7.8 21Z"stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),l$=ce('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M9 9L15 15M15 9L9 15M7.8 21H16.2C17.8802 21 18.7202 21 19.362 20.673C19.9265 20.3854 20.3854 19.9265 20.673 19.362C21 18.7202 21 17.8802 21 16.2V7.8C21 6.11984 21 5.27976 20.673 4.63803C20.3854 4.07354 19.9265 3.6146 19.362 3.32698C18.7202 3 17.8802 3 16.2 3H7.8C6.11984 3 5.27976 3 4.63803 3.32698C4.07354 3.6146 3.6146 4.07354 3.32698 4.63803C3 5.27976 3 6.11984 3 7.8V16.2C3 17.8802 3 18.7202 3.32698 19.362C3.6146 19.9265 4.07354 20.3854 4.63803 20.673C5.27976 21 6.11984 21 7.8 21Z"stroke=#F04438 stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),u$=ce('<svg width=24 height=24 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 xmlns=http://www.w3.org/2000/svg><rect class=list width=20 height=20 y=2 x=2 rx=2></rect><line class=list-item y1=7 y2=7 x1=6 x2=18></line><line class=list-item y2=12 y1=12 x1=6 x2=18></line><line class=list-item y1=17 y2=17 x1=6 x2=18>'),c$=ce('<svg viewBox="0 0 24 24"height=20 width=20 fill=none xmlns=http://www.w3.org/2000/svg><path d="M3 7.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3h8.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C21 5.28 21 6.12 21 7.8v8.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.72 21 17.88 21 16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V7.8Z"stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),d$=ce('<svg width=14 height=14 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M7.5 12L10.5 15L16.5 9M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),f$=ce('<svg width=14 height=14 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M12 2V6M12 18V22M6 12H2M22 12H18M19.0784 19.0784L16.25 16.25M19.0784 4.99994L16.25 7.82837M4.92157 19.0784L7.75 16.25M4.92157 4.99994L7.75 7.82837"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round></path><animateTransform attributeName=transform attributeType=XML type=rotate from=0 to=360 dur=2s repeatCount=indefinite>'),h$=ce('<svg width=14 height=14 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M15 9L9 15M9 9L15 15M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),g$=ce('<svg width=14 height=14 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M9.5 15V9M14.5 15V9M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),y$=ce('<svg version=1.0 viewBox="0 0 633 633"><linearGradient x1=-666.45 x2=-666.45 y1=163.28 y2=163.99 gradientTransform="matrix(633 0 0 633 422177 -103358)"gradientUnits=userSpaceOnUse><stop stop-color=#6BDAFF offset=0></stop><stop stop-color=#F9FFB5 offset=.32></stop><stop stop-color=#FFA770 offset=.71></stop><stop stop-color=#FF7373 offset=1></stop></linearGradient><circle cx=316.5 cy=316.5 r=316.5></circle><defs><filter x=-137.5 y=412 width=454 height=396.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=-137.5 y=412 width=454 height=396.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><ellipse cx=89.5 cy=610.5 rx=214.5 ry=186 fill=#015064 stroke=#00CFE2 stroke-width=25></ellipse></g><defs><filter x=316.5 y=412 width=454 height=396.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=316.5 y=412 width=454 height=396.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><ellipse cx=543.5 cy=610.5 rx=214.5 ry=186 fill=#015064 stroke=#00CFE2 stroke-width=25></ellipse></g><defs><filter x=-137.5 y=450 width=454 height=396.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=-137.5 y=450 width=454 height=396.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><ellipse cx=89.5 cy=648.5 rx=214.5 ry=186 fill=#015064 stroke=#00A8B8 stroke-width=25></ellipse></g><defs><filter x=316.5 y=450 width=454 height=396.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=316.5 y=450 width=454 height=396.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><ellipse cx=543.5 cy=648.5 rx=214.5 ry=186 fill=#015064 stroke=#00A8B8 stroke-width=25></ellipse></g><defs><filter x=-137.5 y=486 width=454 height=396.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=-137.5 y=486 width=454 height=396.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><ellipse cx=89.5 cy=684.5 rx=214.5 ry=186 fill=#015064 stroke=#007782 stroke-width=25></ellipse></g><defs><filter x=316.5 y=486 width=454 height=396.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=316.5 y=486 width=454 height=396.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><ellipse cx=543.5 cy=684.5 rx=214.5 ry=186 fill=#015064 stroke=#007782 stroke-width=25></ellipse></g><defs><filter x=272.2 y=308 width=176.9 height=129.3 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=272.2 y=308 width=176.9 height=129.3 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><line x1=436 x2=431 y1=403.2 y2=431.8 fill=none stroke=#000 stroke-linecap=round stroke-linejoin=bevel stroke-width=11></line><line x1=291 x2=280 y1=341.5 y2=403.5 fill=none stroke=#000 stroke-linecap=round stroke-linejoin=bevel stroke-width=11></line><line x1=332.9 x2=328.6 y1=384.1 y2=411.2 fill=none stroke=#000 stroke-linecap=round stroke-linejoin=bevel stroke-width=11></line><linearGradient x1=-670.75 x2=-671.59 y1=164.4 y2=164.49 gradientTransform="matrix(-184.16 -32.472 -11.461 64.997 -121359 -32126)"gradientUnits=userSpaceOnUse><stop stop-color=#EE2700 offset=0></stop><stop stop-color=#FF008E offset=1></stop></linearGradient><path d="m344.1 363 97.7 17.2c5.8 2.1 8.2 6.1 7.1 12.1s-4.7 9.2-11 9.9l-106-18.7-57.5-59.2c-3.2-4.8-2.9-9.1 0.8-12.8s8.3-4.4 13.7-2.1l55.2 53.6z"clip-rule=evenodd fill-rule=evenodd></path><line x1=428.2 x2=429.1 y1=384.5 y2=378 fill=none stroke=#fff stroke-linecap=round stroke-linejoin=bevel stroke-width=7></line><line x1=395.2 x2=396.1 y1=379.5 y2=373 fill=none stroke=#fff stroke-linecap=round stroke-linejoin=bevel stroke-width=7></line><line x1=362.2 x2=363.1 y1=373.5 y2=367.4 fill=none stroke=#fff stroke-linecap=round stroke-linejoin=bevel stroke-width=7></line><line x1=324.2 x2=328.4 y1=351.3 y2=347.4 fill=none stroke=#fff stroke-linecap=round stroke-linejoin=bevel stroke-width=7></line><line x1=303.2 x2=307.4 y1=331.3 y2=327.4 fill=none stroke=#fff stroke-linecap=round stroke-linejoin=bevel stroke-width=7></line></g><defs><filter x=73.2 y=113.8 width=280.6 height=317.4 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=73.2 y=113.8 width=280.6 height=317.4 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><linearGradient x1=-672.16 x2=-672.16 y1=165.03 y2=166.03 gradientTransform="matrix(-100.18 48.861 97.976 200.88 -83342 -93.059)"gradientUnits=userSpaceOnUse><stop stop-color=#A17500 offset=0></stop><stop stop-color=#5D2100 offset=1></stop></linearGradient><path d="m192.3 203c8.1 37.3 14 73.6 17.8 109.1 3.8 35.4 2.8 75.1-3 119.2l61.2-16.7c-15.6-59-25.2-97.9-28.6-116.6s-10.8-51.9-22.1-99.6l-25.3 4.6"clip-rule=evenodd fill-rule=evenodd></path><g stroke=#2F8A00><linearGradient x1=-660.23 x2=-660.23 y1=166.72 y2=167.72 gradientTransform="matrix(92.683 4.8573 -2.0259 38.657 61680 -3088.6)"gradientUnits=userSpaceOnUse><stop stop-color=#2F8A00 offset=0></stop><stop stop-color=#90FF57 offset=1></stop></linearGradient><path d="m195 183.9s-12.6-22.1-36.5-29.9c-15.9-5.2-34.4-1.5-55.5 11.1 15.9 14.3 29.5 22.6 40.7 24.9 16.8 3.6 51.3-6.1 51.3-6.1z"clip-rule=evenodd fill-rule=evenodd stroke-width=13></path><linearGradient x1=-661.36 x2=-661.36 y1=164.18 y2=165.18 gradientTransform="matrix(110 5.7648 -6.3599 121.35 73933 -15933)"gradientUnits=userSpaceOnUse><stop stop-color=#2F8A00 offset=0></stop><stop stop-color=#90FF57 offset=1></stop></linearGradient><path d="m194.9 184.5s-47.5-8.5-83.2 15.7c-23.8 16.2-34.3 49.3-31.6 99.4 30.3-27.8 52.1-48.5 65.2-61.9 19.8-20.2 49.6-53.2 49.6-53.2z"clip-rule=evenodd fill-rule=evenodd stroke-width=13></path><linearGradient x1=-656.79 x2=-656.79 y1=165.15 y2=166.15 gradientTransform="matrix(62.954 3.2993 -3.5023 66.828 42156 -8754.1)"gradientUnits=userSpaceOnUse><stop stop-color=#2F8A00 offset=0></stop><stop stop-color=#90FF57 offset=1></stop></linearGradient><path d="m195 183.9c-0.8-21.9 6-38 20.6-48.2s29.8-15.4 45.5-15.3c-6.1 21.4-14.5 35.8-25.2 43.4s-24.4 14.2-40.9 20.1z"clip-rule=evenodd fill-rule=evenodd stroke-width=13></path><linearGradient x1=-663.07 x2=-663.07 y1=165.44 y2=166.44 gradientTransform="matrix(152.47 7.9907 -3.0936 59.029 101884 -4318.7)"gradientUnits=userSpaceOnUse><stop stop-color=#2F8A00 offset=0></stop><stop stop-color=#90FF57 offset=1></stop></linearGradient><path d="m194.9 184.5c31.9-30 64.1-39.7 96.7-29s50.8 30.4 54.6 59.1c-35.2-5.5-60.4-9.6-75.8-12.1-15.3-2.6-40.5-8.6-75.5-18z"clip-rule=evenodd fill-rule=evenodd stroke-width=13></path><linearGradient x1=-662.57 x2=-662.57 y1=164.44 y2=165.44 gradientTransform="matrix(136.46 7.1517 -5.2163 99.533 91536 -11442)"gradientUnits=userSpaceOnUse><stop stop-color=#2F8A00 offset=0></stop><stop stop-color=#90FF57 offset=1></stop></linearGradient><path d="m194.9 184.5c35.8-7.6 65.6-0.2 89.2 22s37.7 49 42.3 80.3c-39.8-9.7-68.3-23.8-85.5-42.4s-32.5-38.5-46-59.9z"clip-rule=evenodd fill-rule=evenodd stroke-width=13></path><linearGradient x1=-656.43 x2=-656.43 y1=163.86 y2=164.86 gradientTransform="matrix(60.866 3.1899 -8.7773 167.48 41560 -25168)"gradientUnits=userSpaceOnUse><stop stop-color=#2F8A00 offset=0></stop><stop stop-color=#90FF57 offset=1></stop></linearGradient><path d="m194.9 184.5c-33.6 13.8-53.6 35.7-60.1 65.6s-3.6 63.1 8.7 99.6c27.4-40.3 43.2-69.6 47.4-88s5.6-44.1 4-77.2z"clip-rule=evenodd fill-rule=evenodd stroke-width=13></path><path d="m196.5 182.3c-14.8 21.6-25.1 41.4-30.8 59.4s-9.5 33-11.1 45.1"fill=none stroke-linecap=round stroke-width=8></path><path d="m194.9 185.7c-24.4 1.7-43.8 9-58.1 21.8s-24.7 25.4-31.3 37.8"fill=none stroke-linecap=round stroke-width=8></path><path d="m204.5 176.4c29.7-6.7 52-8.4 67-5.1s26.9 8.6 35.8 15.9"fill=none stroke-linecap=round stroke-width=8></path><path d="m196.5 181.4c20.3 9.9 38.2 20.5 53.9 31.9s27.4 22.1 35.1 32"fill=none stroke-linecap=round stroke-width=8></path></g></g><defs><filter x=50.5 y=399 width=532 height=633 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=50.5 y=399 width=532 height=633 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><linearGradient x1=-666.06 x2=-666.23 y1=163.36 y2=163.75 gradientTransform="matrix(532 0 0 633 354760 -102959)"gradientUnits=userSpaceOnUse><stop stop-color=#FFF400 offset=0></stop><stop stop-color=#3C8700 offset=1></stop></linearGradient><ellipse cx=316.5 cy=715.5 rx=266 ry=316.5></ellipse></g><defs><filter x=391 y=-24 width=288 height=283 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=391 y=-24 width=288 height=283 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><linearGradient x1=-664.56 x2=-664.56 y1=163.79 y2=164.79 gradientTransform="matrix(227 0 0 227 151421 -37204)"gradientUnits=userSpaceOnUse><stop stop-color=#FFDF00 offset=0></stop><stop stop-color=#FF9D00 offset=1></stop></linearGradient><circle cx=565.5 cy=89.5 r=113.5></circle><linearGradient x1=-644.5 x2=-645.77 y1=342 y2=342 gradientTransform="matrix(30 0 0 1 19770 -253)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=427 x2=397 y1=89 y2=89 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=-641.56 x2=-642.83 y1=196.02 y2=196.07 gradientTransform="matrix(26.5 0 0 5.5 17439 -1025.5)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=430.5 x2=404 y1=55.5 y2=50 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=-643.73 x2=-645 y1=185.83 y2=185.9 gradientTransform="matrix(29 0 0 8 19107 -1361)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=431 x2=402 y1=122 y2=130 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=-638.94 x2=-640.22 y1=177.09 y2=177.39 gradientTransform="matrix(24 0 0 13 15783 -2145)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=442 x2=418 y1=153 y2=166 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=-633.42 x2=-634.7 y1=172.41 y2=173.31 gradientTransform="matrix(20 0 0 19 13137 -3096)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=464 x2=444 y1=180 y2=199 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=-619.05 x2=-619.52 y1=170.82 y2=171.82 gradientTransform="matrix(13.83 0 0 22.85 9050 -3703.4)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=491.4 x2=477.5 y1=203 y2=225.9 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=-578.5 x2=-578.63 y1=170.31 y2=171.31 gradientTransform="matrix(7.5 0 0 24.5 4860 -3953)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=524.5 x2=517 y1=219.5 y2=244 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=666.5 x2=666.5 y1=170.31 y2=171.31 gradientTransform="matrix(.5 0 0 24.5 231.5 -3944)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=564.5 x2=565 y1=228.5 y2=253 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12>');function m$(){return QM()}function ox(){return YM()}function Jo(){return XM()}function $m(){return ZM()}function Lm(){return Eh()}function p$(){return(()=>{var e=Eh();return e.style.setProperty("transform","rotate(90deg)"),e})()}function v$(){return(()=>{var e=Eh();return e.style.setProperty("transform","rotate(-90deg)"),e})()}function b$(){return JM()}function x$(){return e$()}function w$(){return t$()}function S$(){return n$()}function C$(){return r$()}function _$(){return i$()}function k$(){return s$()}function O$(){return o$()}function E$(){return a$()}function A$(e){return(()=>{var t=sx(),n=t.firstChild;return we(()=>re(n,"stroke",e.theme==="dark"?"#12B76A":"#027A48")),t})()}function T$(){return l$()}function P$(){return u$()}function j$(e){return[L(xe,{get when(){return e.checked},get children(){var t=sx(),n=t.firstChild;return we(()=>re(n,"stroke",e.theme==="dark"?"#9B8AFB":"#6938EF")),t}}),L(xe,{get when(){return!e.checked},get children(){var t=c$(),n=t.firstChild;return we(()=>re(n,"stroke",e.theme==="dark"?"#9B8AFB":"#6938EF")),t}})]}function M$(){return d$()}function $$(){return f$()}function L$(){return h$()}function D$(){return g$()}function Dm(){const e=Ln();return(()=>{var t=y$(),n=t.firstChild,r=n.nextSibling,i=r.nextSibling,s=i.firstChild,o=i.nextSibling,a=o.firstChild,l=o.nextSibling,u=l.nextSibling,c=u.firstChild,d=u.nextSibling,f=d.firstChild,h=d.nextSibling,y=h.nextSibling,m=y.firstChild,p=y.nextSibling,v=p.firstChild,b=p.nextSibling,S=b.nextSibling,C=S.firstChild,x=S.nextSibling,k=x.firstChild,w=x.nextSibling,_=w.nextSibling,O=_.firstChild,A=_.nextSibling,T=A.firstChild,j=A.nextSibling,B=j.nextSibling,R=B.firstChild,P=B.nextSibling,M=P.firstChild,I=P.nextSibling,G=I.nextSibling,Y=G.firstChild,q=G.nextSibling,U=q.firstChild,z=q.nextSibling,V=z.firstChild,N=V.nextSibling,ne=N.nextSibling,J=ne.nextSibling,he=J.nextSibling,X=z.nextSibling,ge=X.firstChild,ye=X.nextSibling,je=ye.firstChild,se=ye.nextSibling,nt=se.firstChild,Ie=nt.nextSibling,st=Ie.nextSibling,ze=st.firstChild,Ve=ze.nextSibling,ee=Ve.nextSibling,$e=ee.nextSibling,ot=$e.nextSibling,Ne=ot.nextSibling,Le=Ne.nextSibling,de=Le.nextSibling,me=de.nextSibling,fe=me.nextSibling,Fe=fe.nextSibling,Zt=Fe.nextSibling,It=se.nextSibling,Jt=It.firstChild,en=It.nextSibling,Ae=en.firstChild,Ke=en.nextSibling,oe=Ke.firstChild,pe=oe.nextSibling,Oe=Ke.nextSibling,Ee=Oe.firstChild,He=Oe.nextSibling,Et=He.firstChild,tn=He.nextSibling,mi=tn.firstChild,yo=mi.nextSibling,rs=yo.nextSibling,jh=rs.nextSibling,Mh=jh.nextSibling,$h=Mh.nextSibling,Lh=$h.nextSibling,Dh=Lh.nextSibling,Ih=Dh.nextSibling,Rh=Ih.nextSibling,Nh=Rh.nextSibling,Fh=Nh.nextSibling,Bh=Fh.nextSibling,qh=Bh.nextSibling,zh=qh.nextSibling,Hh=zh.nextSibling,Uh=Hh.nextSibling,xx=Uh.nextSibling;return re(n,"id",`a-${e}`),re(r,"fill",`url(#a-${e})`),re(s,"id",`am-${e}`),re(o,"id",`b-${e}`),re(a,"filter",`url(#am-${e})`),re(l,"mask",`url(#b-${e})`),re(c,"id",`ah-${e}`),re(d,"id",`k-${e}`),re(f,"filter",`url(#ah-${e})`),re(h,"mask",`url(#k-${e})`),re(m,"id",`ae-${e}`),re(p,"id",`j-${e}`),re(v,"filter",`url(#ae-${e})`),re(b,"mask",`url(#j-${e})`),re(C,"id",`ai-${e}`),re(x,"id",`i-${e}`),re(k,"filter",`url(#ai-${e})`),re(w,"mask",`url(#i-${e})`),re(O,"id",`aj-${e}`),re(A,"id",`h-${e}`),re(T,"filter",`url(#aj-${e})`),re(j,"mask",`url(#h-${e})`),re(R,"id",`ag-${e}`),re(P,"id",`g-${e}`),re(M,"filter",`url(#ag-${e})`),re(I,"mask",`url(#g-${e})`),re(Y,"id",`af-${e}`),re(q,"id",`f-${e}`),re(U,"filter",`url(#af-${e})`),re(z,"mask",`url(#f-${e})`),re(J,"id",`m-${e}`),re(he,"fill",`url(#m-${e})`),re(ge,"id",`ak-${e}`),re(ye,"id",`e-${e}`),re(je,"filter",`url(#ak-${e})`),re(se,"mask",`url(#e-${e})`),re(nt,"id",`n-${e}`),re(Ie,"fill",`url(#n-${e})`),re(ze,"id",`r-${e}`),re(Ve,"fill",`url(#r-${e})`),re(ee,"id",`s-${e}`),re($e,"fill",`url(#s-${e})`),re(ot,"id",`q-${e}`),re(Ne,"fill",`url(#q-${e})`),re(Le,"id",`p-${e}`),re(de,"fill",`url(#p-${e})`),re(me,"id",`o-${e}`),re(fe,"fill",`url(#o-${e})`),re(Fe,"id",`l-${e}`),re(Zt,"fill",`url(#l-${e})`),re(Jt,"id",`al-${e}`),re(en,"id",`d-${e}`),re(Ae,"filter",`url(#al-${e})`),re(Ke,"mask",`url(#d-${e})`),re(oe,"id",`u-${e}`),re(pe,"fill",`url(#u-${e})`),re(Ee,"id",`ad-${e}`),re(He,"id",`c-${e}`),re(Et,"filter",`url(#ad-${e})`),re(tn,"mask",`url(#c-${e})`),re(mi,"id",`t-${e}`),re(yo,"fill",`url(#t-${e})`),re(rs,"id",`v-${e}`),re(jh,"stroke",`url(#v-${e})`),re(Mh,"id",`aa-${e}`),re($h,"stroke",`url(#aa-${e})`),re(Lh,"id",`w-${e}`),re(Dh,"stroke",`url(#w-${e})`),re(Ih,"id",`ac-${e}`),re(Rh,"stroke",`url(#ac-${e})`),re(Nh,"id",`ab-${e}`),re(Fh,"stroke",`url(#ab-${e})`),re(Bh,"id",`y-${e}`),re(qh,"stroke",`url(#y-${e})`),re(zh,"id",`x-${e}`),re(Hh,"stroke",`url(#x-${e})`),re(Uh,"id",`z-${e}`),re(xx,"stroke",`url(#z-${e})`),t})()}var I$=ce('<span><svg width=16 height=16 viewBox="0 0 16 16"fill=none xmlns=http://www.w3.org/2000/svg><path d="M6 12L10 8L6 4"stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),R$=ce('<button title="Copy object to clipboard">'),N$=ce('<button title="Remove all items"aria-label="Remove all items">'),F$=ce('<button title="Delete item"aria-label="Delete item">'),B$=ce('<button title="Toggle value"aria-label="Toggle value">'),q$=ce('<button title="Bulk Edit Data"aria-label="Bulk Edit Data">'),jo=ce("<div>"),z$=ce("<div><button> <span></span> <span> "),H$=ce("<input>"),Im=ce("<span>"),U$=ce("<div><span>:"),G$=ce("<div><div><button> [<!>...<!>]");function K$(e,t){let n=0;const r=[];for(;n<e.length;)r.push(e.slice(n,n+t)),n=n+t;return r}var Rm=e=>{const t=Ct(),n=ve().shadowDOMTarget?Re.bind({target:ve().shadowDOMTarget}):Re,r=K(()=>t()==="dark"?go(n):ho(n));return(()=>{var i=I$();return we(()=>ie(i,ue(r().expander,n`
|
|
72
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function pT(e,t){if(e){if(typeof e=="string")return Vy(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Vy(e,t):void 0}}function Vy(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function vT(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,o,a=[],l=!0,u=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(l=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return a}}function bT(e){if(Array.isArray(e))return e}var xT=function(t){var n=t.isRtl,r=n===void 0?!1:n,i=t.className,s=t.style,o=t.token,a=o===void 0?"":o,l=t.apiUrl,u=t.DebugInfo,c=t.basename,d=c===void 0?"/":c,f=t.subpath,h=f===void 0?"/":f,y=t.onNavigate,m=y===void 0?function(){}:y,p=t.onLogout,v=p===void 0?function(){}:p,b=t.onAddSubscription,S=b===void 0?function(){}:b,C=function(T,j){var B=T.endsWith("/")?T.slice(0,-1):T,R=j.startsWith("/")?j:"/".concat(j);return B+R||"/"},x=F.useState(!!(a||l)),k=yT(x,2),w=k[0],_=k[1],O={onAddSubscription:S,onLogout:v,onNavigate:m,DebugInfo:u,basename:d,subpath:h};return F.useEffect(function(){l&&f2(l),N5(typeof a!="function"?function(){return a}:a),_(!1)},[l,a]),w?g.jsx("div",{className:i,style:s,children:g.jsx(E.Spinner,{})}):g.jsx("div",{className:i,style:s,children:g.jsxs(hw,{initialEntries:[C(d,h)],basename:d||"/",children:[g.jsx(gT,{subpath:h,onNavigate:m}),g.jsx(E.Root,{context:{isRtl:r},children:g.jsx(hT,{DebugInfo:u,hostAppProps:O})})]})})},wT=e=>e!=null,ST=e=>e.filter(wT);function CT(e){return(...t)=>{for(const n of e)n&&n(...t)}}var Z=e=>typeof e=="function"&&!e.length?e():e,of=e=>Array.isArray(e)?e:e?[e]:[];function _T(e,...t){return typeof e=="function"?e(...t):e}var kT=Ce;function OT(e,t,n,r){const i=e.length,s=t.length;let o=0;if(!s){for(;o<i;o++)n(e[o]);return}if(!i){for(;o<s;o++)r(t[o]);return}for(;o<s&&t[o]===e[o];o++);let a,l;t=t.slice(o),e=e.slice(o);for(a of t)e.includes(a)||r(a);for(l of e)t.includes(l)||n(l)}function ET(e){const[t,n]=ae(),r=e!=null&&e.throw?(f,h)=>{throw n(f instanceof Error?f:new Error(h)),f}:(f,h)=>{n(f instanceof Error?f:new Error(h))},i=e!=null&&e.api?Array.isArray(e.api)?e.api:[e.api]:[globalThis.localStorage].filter(Boolean),s=e!=null&&e.prefix?`${e.prefix}.`:"",o=new Map,a=new Proxy({},{get(f,h){let y=o.get(h);y||(y=ae(void 0,{equals:!1}),o.set(h,y)),y[0]();const m=i.reduce((p,v)=>{if(p!==null||!v)return p;try{return v.getItem(`${s}${h}`)}catch(b){return r(b,`Error reading ${s}${h} from ${v.name}`),null}},null);return m!==null&&(e!=null&&e.deserializer)?e.deserializer(m,h,e.options):m}}),l=(f,h,y)=>{const m=e!=null&&e.serializer?e.serializer(h,f,y!=null?y:e.options):h,p=`${s}${f}`;i.forEach(b=>{try{b.getItem(p)!==m&&b.setItem(p,m)}catch(S){r(S,`Error setting ${s}${f} to ${m} in ${b.name}`)}});const v=o.get(f);v&&v[1]()},u=f=>i.forEach(h=>{try{h.removeItem(`${s}${f}`)}catch(y){r(y,`Error removing ${s}${f} from ${h.name}`)}}),c=()=>i.forEach(f=>{try{f.clear()}catch(h){r(h,`Error clearing ${f.name}`)}}),d=()=>{const f={},h=(y,m)=>{if(!f.hasOwnProperty(y)){const p=m&&(e!=null&&e.deserializer)?e.deserializer(m,y,e.options):m;p&&(f[y]=p)}};return i.forEach(y=>{if(typeof y.getAll=="function"){let m;try{m=y.getAll()}catch(p){r(p,`Error getting all values from in ${y.name}`)}for(const p of m)h(p,m[p])}else{let m=0,p;try{for(;p=y.key(m++);)f.hasOwnProperty(p)||h(p,y.getItem(p))}catch(v){r(v,`Error getting all values from ${y.name}`)}}}),f};return(e==null?void 0:e.sync)!==!1&&Pr(()=>{const f=h=>{var m;let y=!1;i.forEach(p=>{try{p!==h.storageArea&&h.key&&h.newValue!==p.getItem(h.key)&&(h.newValue?p.setItem(h.key,h.newValue):p.removeItem(h.key),y=!0)}catch(v){r(v,`Error synching api ${p.name} from storage event (${h.key}=${h.newValue})`)}}),y&&h.key&&((m=o.get(h.key))==null||m[1]())};"addEventListener"in globalThis?(globalThis.addEventListener("storage",f),Ce(()=>globalThis.removeEventListener("storage",f))):(i.forEach(h=>{var y;return(y=h.addEventListener)==null?void 0:y.call(h,"storage",f)}),Ce(()=>i.forEach(h=>{var y;return(y=h.removeEventListener)==null?void 0:y.call(h,"storage",f)})))}),[a,l,{clear:c,error:t,remove:u,toJSON:d}]}var jb=ET,AT=e=>(typeof e.clear=="function"||(e.clear=()=>{let t;for(;t=e.key(0);)e.removeItem(t)}),e),Wy=e=>{if(!e)return"";let t="";for(const n in e){if(!e.hasOwnProperty(n))continue;const r=e[n];t+=r instanceof Date?`; ${n}=${r.toUTCString()}`:typeof r=="boolean"?`; ${n}`:`; ${n}=${r}`}return t},Sn=AT({_cookies:[globalThis.document,"cookie"],getItem:e=>{var t,n;return(n=(t=Sn._cookies[0][Sn._cookies[1]].match("(^|;)\\s*"+e+"\\s*=\\s*([^;]+)"))==null?void 0:t.pop())!=null?n:null},setItem:(e,t,n)=>{const r=Sn.getItem(e);Sn._cookies[0][Sn._cookies[1]]=`${e}=${t}${Wy(n)}`;const i=Object.assign(new Event("storage"),{key:e,oldValue:r,newValue:t,url:globalThis.document.URL,storageArea:Sn});window.dispatchEvent(i)},removeItem:e=>{Sn._cookies[0][Sn._cookies[1]]=`${e}=deleted${Wy({expires:new Date(0)})}`},key:e=>{let t=null,n=0;return Sn._cookies[0][Sn._cookies[1]].replace(/(?:^|;)\s*(.+?)\s*=\s*[^;]+/g,(r,i)=>(!t&&i&&n++===e&&(t=i),"")),t},get length(){let e=0;return Sn._cookies[0][Sn._cookies[1]].replace(/(?:^|;)\s*.+?\s*=\s*[^;]+/g,t=>(e+=t?1:0,"")),e}}),TT=1024,Wi=796,oh=700,PT="bottom-right",af="bottom",Mb="system",jT=!1,$b=500,MT=500,Lb=500,$T=Object.keys(Ad)[0],Qy=1,LT=Object.keys(Td)[0],ah=_t({client:void 0,onlineManager:void 0,queryFlavor:"",version:"",shadowDOMTarget:void 0});function ve(){return kt(ah)}var Db=_t(void 0),Ib=e=>{const[t,n]=ae(null),r=()=>{const o=t();o!=null&&(o.close(),n(null))},i=(o,a)=>{if(t()!=null)return;const l=window.open("","TSQD-Devtools-Panel",`width=${o},height=${a},popup`);if(!l)throw new Error("Failed to open popup. Please allow popups for this site to view the devtools in picture-in-picture mode.");l.document.head.innerHTML="",l.document.body.innerHTML="",rS(l.document),l.document.title="TanStack Query Devtools",l.document.body.style.margin="0",l.addEventListener("pagehide",()=>{e.setLocalStore("pip_open","false"),n(null)}),[...(ve().shadowDOMTarget||document).styleSheets].forEach(u=>{try{const c=[...u.cssRules].map(y=>y.cssText).join(""),d=document.createElement("style"),f=u.ownerNode;let h="";f&&"id"in f&&(h=f.id),h&&d.setAttribute("id",h),d.textContent=c,l.document.head.appendChild(d)}catch(c){const d=document.createElement("link");if(u.href==null)return;d.rel="stylesheet",d.type=u.type,d.media=u.media.toString(),d.href=u.href,l.document.head.appendChild(d)}}),Mu(["focusin","focusout","pointermove","keydown","pointerdown","pointerup","click","mousedown","input"],l.document),e.setLocalStore("pip_open","true"),n(l)};Se(()=>{var a;((a=e.localStore.pip_open)!=null?a:"false")==="true"&&!e.disabled&&i(Number(window.innerWidth),Number(e.localStore.height||MT))}),Se(()=>{const o=(ve().shadowDOMTarget||document).querySelector("#_goober"),a=t();if(o&&a){const l=new MutationObserver(()=>{const u=(ve().shadowDOMTarget||a.document).querySelector("#_goober");u&&(u.textContent=o.textContent)});l.observe(o,{childList:!0,subtree:!0,characterDataOldValue:!0}),Ce(()=>{l.disconnect()})}});const s=K(()=>{var o;return{pipWindow:t(),requestPipWindow:i,closePipWindow:r,disabled:(o=e.disabled)!=null?o:!1}});return L(Db.Provider,{value:s,get children(){return e.children}})},lh=()=>K(()=>{const t=kt(Db);if(!t)throw new Error("usePiPWindow must be used within a PiPProvider");return t()}),uh=_t(()=>"dark");function Ct(){return kt(uh)}var Rb={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",Ấ:"A",Ắ:"A",Ẳ:"A",Ẵ:"A",Ặ:"A",Æ:"AE",Ầ:"A",Ằ:"A",Ȃ:"A",Ç:"C",Ḉ:"C",È:"E",É:"E",Ê:"E",Ë:"E",Ế:"E",Ḗ:"E",Ề:"E",Ḕ:"E",Ḝ:"E",Ȇ:"E",Ì:"I",Í:"I",Î:"I",Ï:"I",Ḯ:"I",Ȋ:"I",Ð:"D",Ñ:"N",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",Ố:"O",Ṍ:"O",Ṓ:"O",Ȏ:"O",Ù:"U",Ú:"U",Û:"U",Ü:"U",Ý:"Y",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",ấ:"a",ắ:"a",ẳ:"a",ẵ:"a",ặ:"a",æ:"ae",ầ:"a",ằ:"a",ȃ:"a",ç:"c",ḉ:"c",è:"e",é:"e",ê:"e",ë:"e",ế:"e",ḗ:"e",ề:"e",ḕ:"e",ḝ:"e",ȇ:"e",ì:"i",í:"i",î:"i",ï:"i",ḯ:"i",ȋ:"i",ð:"d",ñ:"n",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",ố:"o",ṍ:"o",ṓ:"o",ȏ:"o",ù:"u",ú:"u",û:"u",ü:"u",ý:"y",ÿ:"y",Ā:"A",ā:"a",Ă:"A",ă:"a",Ą:"A",ą:"a",Ć:"C",ć:"c",Ĉ:"C",ĉ:"c",Ċ:"C",ċ:"c",Č:"C",č:"c",C̆:"C",c̆:"c",Ď:"D",ď:"d",Đ:"D",đ:"d",Ē:"E",ē:"e",Ĕ:"E",ĕ:"e",Ė:"E",ė:"e",Ę:"E",ę:"e",Ě:"E",ě:"e",Ĝ:"G",Ǵ:"G",ĝ:"g",ǵ:"g",Ğ:"G",ğ:"g",Ġ:"G",ġ:"g",Ģ:"G",ģ:"g",Ĥ:"H",ĥ:"h",Ħ:"H",ħ:"h",Ḫ:"H",ḫ:"h",Ĩ:"I",ĩ:"i",Ī:"I",ī:"i",Ĭ:"I",ĭ:"i",Į:"I",į:"i",İ:"I",ı:"i",IJ:"IJ",ij:"ij",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",Ḱ:"K",ḱ:"k",K̆:"K",k̆:"k",Ĺ:"L",ĺ:"l",Ļ:"L",ļ:"l",Ľ:"L",ľ:"l",Ŀ:"L",ŀ:"l",Ł:"l",ł:"l",Ḿ:"M",ḿ:"m",M̆:"M",m̆:"m",Ń:"N",ń:"n",Ņ:"N",ņ:"n",Ň:"N",ň:"n",ʼn:"n",N̆:"N",n̆:"n",Ō:"O",ō:"o",Ŏ:"O",ŏ:"o",Ő:"O",ő:"o",Œ:"OE",œ:"oe",P̆:"P",p̆:"p",Ŕ:"R",ŕ:"r",Ŗ:"R",ŗ:"r",Ř:"R",ř:"r",R̆:"R",r̆:"r",Ȓ:"R",ȓ:"r",Ś:"S",ś:"s",Ŝ:"S",ŝ:"s",Ş:"S",Ș:"S",ș:"s",ş:"s",Š:"S",š:"s",Ţ:"T",ţ:"t",ț:"t",Ț:"T",Ť:"T",ť:"t",Ŧ:"T",ŧ:"t",T̆:"T",t̆:"t",Ũ:"U",ũ:"u",Ū:"U",ū:"u",Ŭ:"U",ŭ:"u",Ů:"U",ů:"u",Ű:"U",ű:"u",Ų:"U",ų:"u",Ȗ:"U",ȗ:"u",V̆:"V",v̆:"v",Ŵ:"W",ŵ:"w",Ẃ:"W",ẃ:"w",X̆:"X",x̆:"x",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Y̆:"Y",y̆:"y",Ź:"Z",ź:"z",Ż:"Z",ż:"z",Ž:"Z",ž:"z",ſ:"s",ƒ:"f",Ơ:"O",ơ:"o",Ư:"U",ư:"u",Ǎ:"A",ǎ:"a",Ǐ:"I",ǐ:"i",Ǒ:"O",ǒ:"o",Ǔ:"U",ǔ:"u",Ǖ:"U",ǖ:"u",Ǘ:"U",ǘ:"u",Ǚ:"U",ǚ:"u",Ǜ:"U",ǜ:"u",Ứ:"U",ứ:"u",Ṹ:"U",ṹ:"u",Ǻ:"A",ǻ:"a",Ǽ:"AE",ǽ:"ae",Ǿ:"O",ǿ:"o",Þ:"TH",þ:"th",Ṕ:"P",ṕ:"p",Ṥ:"S",ṥ:"s",X́:"X",x́:"x",Ѓ:"Г",ѓ:"г",Ќ:"К",ќ:"к",A̋:"A",a̋:"a",E̋:"E",e̋:"e",I̋:"I",i̋:"i",Ǹ:"N",ǹ:"n",Ồ:"O",ồ:"o",Ṑ:"O",ṑ:"o",Ừ:"U",ừ:"u",Ẁ:"W",ẁ:"w",Ỳ:"Y",ỳ:"y",Ȁ:"A",ȁ:"a",Ȅ:"E",ȅ:"e",Ȉ:"I",ȉ:"i",Ȍ:"O",ȍ:"o",Ȑ:"R",ȑ:"r",Ȕ:"U",ȕ:"u",B̌:"B",b̌:"b",Č̣:"C",č̣:"c",Ê̌:"E",ê̌:"e",F̌:"F",f̌:"f",Ǧ:"G",ǧ:"g",Ȟ:"H",ȟ:"h",J̌:"J",ǰ:"j",Ǩ:"K",ǩ:"k",M̌:"M",m̌:"m",P̌:"P",p̌:"p",Q̌:"Q",q̌:"q",Ř̩:"R",ř̩:"r",Ṧ:"S",ṧ:"s",V̌:"V",v̌:"v",W̌:"W",w̌:"w",X̌:"X",x̌:"x",Y̌:"Y",y̌:"y",A̧:"A",a̧:"a",B̧:"B",b̧:"b",Ḑ:"D",ḑ:"d",Ȩ:"E",ȩ:"e",Ɛ̧:"E",ɛ̧:"e",Ḩ:"H",ḩ:"h",I̧:"I",i̧:"i",Ɨ̧:"I",ɨ̧:"i",M̧:"M",m̧:"m",O̧:"O",o̧:"o",Q̧:"Q",q̧:"q",U̧:"U",u̧:"u",X̧:"X",x̧:"x",Z̧:"Z",z̧:"z"},DT=Object.keys(Rb).join("|"),IT=new RegExp(DT,"g");function RT(e){return e.replace(IT,t=>Rb[t])}var Kt={CASE_SENSITIVE_EQUAL:7,EQUAL:6,STARTS_WITH:5,WORD_STARTS_WITH:4,CONTAINS:3,ACRONYM:2,MATCHES:1,NO_MATCH:0};function Yy(e,t,n){var r;if(n=n||{},n.threshold=(r=n.threshold)!=null?r:Kt.MATCHES,!n.accessors){const o=Xy(e,t,n);return{rankedValue:e,rank:o,accessorIndex:-1,accessorThreshold:n.threshold,passed:o>=n.threshold}}const i=qT(e,n.accessors),s={rankedValue:e,rank:Kt.NO_MATCH,accessorIndex:-1,accessorThreshold:n.threshold,passed:!1};for(let o=0;o<i.length;o++){const a=i[o];let l=Xy(a.itemValue,t,n);const{minRanking:u,maxRanking:c,threshold:d=n.threshold}=a.attributes;l<u&&l>=Kt.MATCHES?l=u:l>c&&(l=c),l=Math.min(l,c),l>=d&&l>s.rank&&(s.rank=l,s.passed=!0,s.accessorIndex=o,s.accessorThreshold=d,s.rankedValue=a.itemValue)}return s}function Xy(e,t,n){return e=Zy(e,n),t=Zy(t,n),t.length>e.length?Kt.NO_MATCH:e===t?Kt.CASE_SENSITIVE_EQUAL:(e=e.toLowerCase(),t=t.toLowerCase(),e===t?Kt.EQUAL:e.startsWith(t)?Kt.STARTS_WITH:e.includes(` ${t}`)?Kt.WORD_STARTS_WITH:e.includes(t)?Kt.CONTAINS:t.length===1?Kt.NO_MATCH:NT(e).includes(t)?Kt.ACRONYM:FT(e,t))}function NT(e){let t="";return e.split(" ").forEach(r=>{r.split("-").forEach(s=>{t+=s.substr(0,1)})}),t}function FT(e,t){let n=0,r=0;function i(l,u,c){for(let d=c,f=u.length;d<f;d++)if(u[d]===l)return n+=1,d+1;return-1}function s(l){const u=1/l,c=n/t.length;return Kt.MATCHES+c*u}const o=i(t[0],e,0);if(o<0)return Kt.NO_MATCH;r=o;for(let l=1,u=t.length;l<u;l++){const c=t[l];if(r=i(c,e,r),!(r>-1))return Kt.NO_MATCH}const a=r-o;return s(a)}function Zy(e,t){let{keepDiacritics:n}=t;return e=`${e}`,n||(e=RT(e)),e}function BT(e,t){let n=t;typeof t=="object"&&(n=t.accessor);const r=n(e);return r==null?[]:Array.isArray(r)?r:[String(r)]}function qT(e,t){const n=[];for(let r=0,i=t.length;r<i;r++){const s=t[r],o=zT(s),a=BT(e,s);for(let l=0,u=a.length;l<u;l++)n.push({itemValue:a[l],attributes:o})}return n}var Jy={maxRanking:1/0,minRanking:-1/0};function zT(e){return typeof e=="function"?Jy:{...Jy,...e}}var HT={data:""},UT=e=>typeof window=="object"?((e?e.querySelector("#_goober"):window._goober)||Object.assign((e||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:e||HT,GT=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,KT=/\/\*[^]*?\*\/| +/g,em=/\n+/g,Ci=(e,t)=>{let n="",r="",i="";for(let s in e){let o=e[s];s[0]=="@"?s[1]=="i"?n=s+" "+o+";":r+=s[1]=="f"?Ci(o,s):s+"{"+Ci(o,s[1]=="k"?"":t)+"}":typeof o=="object"?r+=Ci(o,t?t.replace(/([^,])+/g,a=>s.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,l=>/&/.test(l)?l.replace(/&/g,a):a?a+" "+l:l)):s):o!=null&&(s=/^--/.test(s)?s:s.replace(/[A-Z]/g,"-$&").toLowerCase(),i+=Ci.p?Ci.p(s,o):s+":"+o+";")}return n+(t&&i?t+"{"+i+"}":i)+r},hr={},Nb=e=>{if(typeof e=="object"){let t="";for(let n in e)t+=n+Nb(e[n]);return t}return e},VT=(e,t,n,r,i)=>{let s=Nb(e),o=hr[s]||(hr[s]=(l=>{let u=0,c=11;for(;u<l.length;)c=101*c+l.charCodeAt(u++)>>>0;return"go"+c})(s));if(!hr[o]){let l=s!==e?e:(u=>{let c,d,f=[{}];for(;c=GT.exec(u.replace(KT,""));)c[4]?f.shift():c[3]?(d=c[3].replace(em," ").trim(),f.unshift(f[0][d]=f[0][d]||{})):f[0][c[1]]=c[2].replace(em," ").trim();return f[0]})(e);hr[o]=Ci(i?{["@keyframes "+o]:l}:l,n?"":"."+o)}let a=n&&hr.g?hr.g:null;return n&&(hr.g=hr[o]),((l,u,c,d)=>{d?u.data=u.data.replace(d,l):u.data.indexOf(l)===-1&&(u.data=c?l+u.data:u.data+l)})(hr[o],t,r,a),o},WT=(e,t,n)=>e.reduce((r,i,s)=>{let o=t[s];if(o&&o.call){let a=o(n),l=a&&a.props&&a.props.className||/^go/.test(a)&&a;o=l?"."+l:a&&typeof a=="object"?a.props?"":Ci(a,""):a===!1?"":a}return r+i+(o==null?"":o)},"");function Re(e){let t=this||{},n=e.call?e(t.p):e;return VT(n.unshift?n.raw?WT(n,[].slice.call(arguments,1),t.p):n.reduce((r,i)=>Object.assign(r,i&&i.call?i(t.p):i),{}):n,UT(t.target),t.g,t.o,t.k)}Re.bind({g:1});Re.bind({k:1});function Fb(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Fb(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function ue(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Fb(e))&&(r&&(r+=" "),r+=t);return r}function QT(e,t){const n=ht(e),{onChange:r}=t;let i=new Set(t.appear?void 0:n);const s=new WeakSet,[o,a]=ae([],{equals:!1}),[l]=L3(),u=d=>{a(f=>(f.push.apply(f,d),f));for(const f of d)s.delete(f)},c=(d,f,h)=>d.splice(h,0,f);return K(d=>{const f=o(),h=e();if(h[Tu],ht(l))return l(),d;if(f.length){const y=d.filter(m=>!f.includes(m));return f.length=0,r({list:y,added:[],removed:[],unchanged:y,finishRemoved:u}),y}return ht(()=>{const y=new Set(h),m=h.slice(),p=[],v=[],b=[];for(const C of h)(i.has(C)?b:p).push(C);let S=!p.length;for(let C=0;C<d.length;C++){const x=d[C];y.has(x)||(s.has(x)||(v.push(x),s.add(x)),c(m,x,C)),S&&x!==m[C]&&(S=!1)}return!v.length&&S?d:(r({list:m,added:p,removed:v,unchanged:b,finishRemoved:u}),i=y,m)})},t.appear?[]:n.slice())}function zt(...e){return CT(e)}var tm=e=>e instanceof Element;function lf(e,t){if(t(e))return e;if(typeof e=="function"&&!e.length)return lf(e(),t);if(Array.isArray(e)){const n=[];for(const r of e){const i=lf(r,t);i&&(Array.isArray(i)?n.push.apply(n,i):n.push(i))}return n.length?n:null}return null}function YT(e,t=tm,n=tm){const r=K(e),i=K(()=>lf(r(),t));return i.toArray=()=>{const s=i();return Array.isArray(s)?s:s?[s]:[]},i}function XT(e){return K(()=>{const t=e.name||"s";return{enterActive:(e.enterActiveClass||t+"-enter-active").split(" "),enter:(e.enterClass||t+"-enter").split(" "),enterTo:(e.enterToClass||t+"-enter-to").split(" "),exitActive:(e.exitActiveClass||t+"-exit-active").split(" "),exit:(e.exitClass||t+"-exit").split(" "),exitTo:(e.exitToClass||t+"-exit-to").split(" "),move:(e.moveClass||t+"-move").split(" ")}})}function Bb(e){requestAnimationFrame(()=>requestAnimationFrame(e))}function ZT(e,t,n,r){const{onBeforeEnter:i,onEnter:s,onAfterEnter:o}=t;i==null||i(n),n.classList.add(...e.enter),n.classList.add(...e.enterActive),queueMicrotask(()=>{if(!n.parentNode)return r==null?void 0:r();s==null||s(n,()=>a())}),Bb(()=>{n.classList.remove(...e.enter),n.classList.add(...e.enterTo),(!s||s.length<2)&&(n.addEventListener("transitionend",a),n.addEventListener("animationend",a))});function a(l){(!l||l.target===n)&&(n.removeEventListener("transitionend",a),n.removeEventListener("animationend",a),n.classList.remove(...e.enterActive),n.classList.remove(...e.enterTo),o==null||o(n))}}function JT(e,t,n,r){const{onBeforeExit:i,onExit:s,onAfterExit:o}=t;if(!n.parentNode)return r==null?void 0:r();i==null||i(n),n.classList.add(...e.exit),n.classList.add(...e.exitActive),s==null||s(n,()=>a()),Bb(()=>{n.classList.remove(...e.exit),n.classList.add(...e.exitTo),(!s||s.length<2)&&(n.addEventListener("transitionend",a),n.addEventListener("animationend",a))});function a(l){(!l||l.target===n)&&(r==null||r(),n.removeEventListener("transitionend",a),n.removeEventListener("animationend",a),n.classList.remove(...e.exitActive),n.classList.remove(...e.exitTo),o==null||o(n))}}var nm=e=>{const t=XT(e);return QT(YT(()=>e.children).toArray,{appear:e.appear,onChange({added:n,removed:r,finishRemoved:i,list:s}){const o=t();for(const l of n)ZT(o,e,l);const a=[];for(const l of s)l.isConnected&&(l instanceof HTMLElement||l instanceof SVGElement)&&a.push({el:l,rect:l.getBoundingClientRect()});queueMicrotask(()=>{const l=[];for(const{el:u,rect:c}of a)if(u.isConnected){const d=u.getBoundingClientRect(),f=c.left-d.left,h=c.top-d.top;(f||h)&&(u.style.transform=`translate(${f}px, ${h}px)`,u.style.transitionDuration="0s",l.push(u))}document.body.offsetHeight;for(const u of l){let c=function(d){(d.target===u||/transform$/.test(d.propertyName))&&(u.removeEventListener("transitionend",c),u.classList.remove(...o.move))};u.classList.add(...o.move),u.style.transform=u.style.transitionDuration="",u.addEventListener("transitionend",c)}});for(const l of r)JT(o,e,l,()=>i([l]))}})},Yc=Symbol("fallback");function rm(e){for(const t of e)t.dispose()}function eP(e,t,n,r={}){const i=new Map;return Ce(()=>rm(i.values())),()=>{const o=e()||[];return o[Tu],ht(()=>{var c,d;if(!o.length)return rm(i.values()),i.clear(),r.fallback?[Or(h=>(i.set(Yc,{dispose:h}),r.fallback()))]:[];const a=new Array(o.length),l=i.get(Yc);if(!i.size||l){l==null||l.dispose(),i.delete(Yc);for(let f=0;f<o.length;f++){const h=o[f],y=t(h,f);s(a,h,f,y)}return a}const u=new Set(i.keys());for(let f=0;f<o.length;f++){const h=o[f],y=t(h,f);u.delete(y);const m=i.get(y);m?(a[f]=m.mapped,(c=m.setIndex)==null||c.call(m,f),m.setItem(()=>h)):s(a,h,f,y)}for(const f of u)(d=i.get(f))==null||d.dispose(),i.delete(f);return a})};function s(o,a,l,u){Or(c=>{const[d,f]=ae(a),h={setItem:f,dispose:c};if(n.length>1){const[y,m]=ae(l);h.setIndex=m,h.mapped=n(d,y)}else h.mapped=n(d);i.set(u,h),o[l]=h.mapped})}}function vu(e){const{by:t}=e;return K(eP(()=>e.each,typeof t=="function"?t:n=>n[t],e.children,"fallback"in e?{fallback:()=>e.fallback}:void 0))}function tP(e,t,n,r){return e.addEventListener(t,n,r),kT(e.removeEventListener.bind(e,t,n,r))}function nP(e,t,n,r){const i=()=>{of(Z(e)).forEach(s=>{s&&of(Z(t)).forEach(o=>tP(s,o,n,r))})};typeof e=="function"?Se(i):we(i)}function rP(e,t){const n=new ResizeObserver(e);return Ce(n.disconnect.bind(n)),{observe:r=>n.observe(r,t),unobserve:n.unobserve.bind(n)}}function qb(e,t,n){const r=new WeakMap,{observe:i,unobserve:s}=rP(o=>{for(const a of o){const{contentRect:l,target:u}=a,c=Math.round(l.width),d=Math.round(l.height),f=r.get(u);(!f||f.width!==c||f.height!==d)&&(t(l,u,a),r.set(u,{width:c,height:d}))}},n);Se(o=>{const a=ST(of(Z(e)));return OT(a,o,i,s),a},[])}var iP=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g;function im(e){const t={};let n;for(;n=iP.exec(e);)t[n[1]]=n[2];return t}function rc(e,t){if(typeof e=="string"){if(typeof t=="string")return`${e};${t}`;e=im(e)}else typeof t=="string"&&(t=im(t));return{...e,...t}}function sP(e,t,n=-1){return n in e?[...e.slice(0,n),t,...e.slice(n)]:[...e,t]}function uf(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function oP(e){return typeof e=="number"}function cs(e){return Object.prototype.toString.call(e)==="[object String]"}function aP(e){return typeof e=="function"}function Ja(e){return t=>`${e()}-${t}`}function Pn(e,t){return e?e===t||e.contains(t):!1}function zo(e,t=!1){const{activeElement:n}=ar(e);if(!(n!=null&&n.nodeName))return null;if(zb(n)&&n.contentDocument)return zo(n.contentDocument.body,t);if(t){const r=n.getAttribute("aria-activedescendant");if(r){const i=ar(n).getElementById(r);if(i)return i}}return n}function lP(e){return ar(e).defaultView||window}function ar(e){return e?e.ownerDocument||e:document}function zb(e){return e.tagName==="IFRAME"}var ch=(e=>(e.Escape="Escape",e.Enter="Enter",e.Tab="Tab",e.Space=" ",e.ArrowDown="ArrowDown",e.ArrowLeft="ArrowLeft",e.ArrowRight="ArrowRight",e.ArrowUp="ArrowUp",e.End="End",e.Home="Home",e.PageDown="PageDown",e.PageUp="PageUp",e))(ch||{});function dh(e){var t;return typeof window!="undefined"&&window.navigator!=null?e.test(((t=window.navigator.userAgentData)==null?void 0:t.platform)||window.navigator.platform):!1}function ic(){return dh(/^Mac/i)}function uP(){return dh(/^iPhone/i)}function cP(){return dh(/^iPad/i)||ic()&&navigator.maxTouchPoints>1}function dP(){return uP()||cP()}function fP(){return ic()||dP()}function lt(e,t){return t&&(aP(t)?t(e):t[0](t[1],e)),e==null?void 0:e.defaultPrevented}function wt(e){return t=>{for(const n of e)lt(t,n)}}function hP(e){return ic()?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey}function Mt(e){if(e)if(gP())e.focus({preventScroll:!0});else{const t=yP(e);e.focus(),mP(t)}}var jl=null;function gP(){if(jl==null){jl=!1;try{document.createElement("div").focus({get preventScroll(){return jl=!0,!0}})}catch(e){}}return jl}function yP(e){let t=e.parentNode;const n=[],r=document.scrollingElement||document.documentElement;for(;t instanceof HTMLElement&&t!==r;)(t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth)&&n.push({element:t,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}),t=t.parentNode;return r instanceof HTMLElement&&n.push({element:r,scrollTop:r.scrollTop,scrollLeft:r.scrollLeft}),n}function mP(e){for(const{element:t,scrollTop:n,scrollLeft:r}of e)t.scrollTop=n,t.scrollLeft=r}var Hb=["input:not([type='hidden']):not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","a[href]","area[href]","[tabindex]","iframe","object","embed","audio[controls]","video[controls]","[contenteditable]:not([contenteditable='false'])"],pP=[...Hb,'[tabindex]:not([tabindex="-1"]):not([disabled])'],fh=Hb.join(":not([hidden]),")+",[tabindex]:not([disabled]):not([hidden])",vP=pP.join(':not([hidden]):not([tabindex="-1"]),');function Ub(e,t){const r=Array.from(e.querySelectorAll(fh)).filter(sm);return t&&sm(e)&&r.unshift(e),r.forEach((i,s)=>{if(zb(i)&&i.contentDocument){const o=i.contentDocument.body,a=Ub(o,!1);r.splice(s,1,...a)}}),r}function sm(e){return Gb(e)&&!bP(e)}function Gb(e){return e.matches(fh)&&hh(e)}function bP(e){return parseInt(e.getAttribute("tabindex")||"0",10)<0}function hh(e,t){return e.nodeName!=="#comment"&&xP(e)&&wP(e,t)&&(!e.parentElement||hh(e.parentElement,e))}function xP(e){if(!(e instanceof HTMLElement)&&!(e instanceof SVGElement))return!1;const{display:t,visibility:n}=e.style;let r=t!=="none"&&n!=="hidden"&&n!=="collapse";if(r){if(!e.ownerDocument.defaultView)return r;const{getComputedStyle:i}=e.ownerDocument.defaultView,{display:s,visibility:o}=i(e);r=s!=="none"&&o!=="hidden"&&o!=="collapse"}return r}function wP(e,t){return!e.hasAttribute("hidden")&&(e.nodeName==="DETAILS"&&t&&t.nodeName!=="SUMMARY"?e.hasAttribute("open"):!0)}function SP(e,t,n){const r=t!=null&&t.tabbable?vP:fh,i=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode(s){var o;return(o=t==null?void 0:t.from)!=null&&o.contains(s)?NodeFilter.FILTER_REJECT:s.matches(r)&&hh(s)&&(!(t!=null&&t.accept)||t.accept(s))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});return t!=null&&t.from&&(i.currentNode=t.from),i}function om(e){for(;e&&!CP(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}function CP(e){const t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function _P(){}function kP(e,t){const[n,r]=e;let i=!1;const s=t.length;for(let o=s,a=0,l=o-1;a<o;l=a++){const[u,c]=t[a],[d,f]=t[l],[,h]=t[l===0?o-1:l-1]||[0,0],y=(c-f)*(n-u)-(u-d)*(r-c);if(f<c){if(r>=f&&r<c){if(y===0)return!0;y>0&&(r===f?r>h&&(i=!i):i=!i)}}else if(c<f){if(r>c&&r<=f){if(y===0)return!0;y<0&&(r===f?r<h&&(i=!i):i=!i)}}else if(r==c&&(n>=d&&n<=u||n>=u&&n<=d))return!0}return i}function Ge(e,t){return Pe(e,t)}var To=new Map,am=new Set;function lm(){if(typeof window=="undefined")return;const e=n=>{if(!n.target)return;let r=To.get(n.target);r||(r=new Set,To.set(n.target,r),n.target.addEventListener("transitioncancel",t)),r.add(n.propertyName)},t=n=>{if(!n.target)return;const r=To.get(n.target);if(r&&(r.delete(n.propertyName),r.size===0&&(n.target.removeEventListener("transitioncancel",t),To.delete(n.target)),To.size===0)){for(const i of am)i();am.clear()}};document.body.addEventListener("transitionrun",e),document.body.addEventListener("transitionend",t)}typeof document!="undefined"&&(document.readyState!=="loading"?lm():document.addEventListener("DOMContentLoaded",lm));function cf(e,t){const n=um(e,t,"left"),r=um(e,t,"top"),i=t.offsetWidth,s=t.offsetHeight;let o=e.scrollLeft,a=e.scrollTop;const l=o+e.offsetWidth,u=a+e.offsetHeight;n<=o?o=n:n+i>l&&(o+=n+i-l),r<=a?a=r:r+s>u&&(a+=r+s-u),e.scrollLeft=o,e.scrollTop=a}function um(e,t,n){const r=n==="left"?"offsetLeft":"offsetTop";let i=0;for(;t.offsetParent&&(i+=t[r],t.offsetParent!==e);){if(t.offsetParent.contains(e)){i-=e[r];break}t=t.offsetParent}return i}function OP(e,t){var n,r;if(document.contains(e)){const i=document.scrollingElement||document.documentElement;if(window.getComputedStyle(i).overflow==="hidden"){let o=om(e);for(;e&&o&&e!==i&&o!==i;)cf(o,e),e=o,o=om(e)}else{const{left:o,top:a}=e.getBoundingClientRect();(n=e==null?void 0:e.scrollIntoView)==null||n.call(e,{block:"nearest"});const{left:l,top:u}=e.getBoundingClientRect();(Math.abs(o-l)>1||Math.abs(a-u)>1)&&((r=e.scrollIntoView)==null||r.call(e,{block:"nearest"}))}}}var Kb={border:"0",clip:"rect(0 0 0 0)","clip-path":"inset(50%)",height:"1px",margin:"0 -1px -1px 0",overflow:"hidden",padding:"0",position:"absolute",width:"1px","white-space":"nowrap"};function jn(e){return t=>(e(t),()=>e(void 0))}function sc(e,t){const[n,r]=ae(cm(t==null?void 0:t()));return Se(()=>{var i;r(((i=e())==null?void 0:i.tagName.toLowerCase())||cm(t==null?void 0:t()))}),n}function cm(e){return cs(e)?e:void 0}function dt(e){const[t,n]=Ze(e,["as"]);if(!t.as)throw new Error("[kobalte]: Polymorphic is missing the required `as` prop.");return L(gS,Pe(n,{get component(){return t.as}}))}var EP=["id","name","validationState","required","disabled","readOnly"];function AP(e){const t=`form-control-${Ln()}`,n=Ge({id:t},e),[r,i]=ae(),[s,o]=ae(),[a,l]=ae(),[u,c]=ae(),d=(m,p,v)=>{const b=v!=null||r()!=null;return[v,r(),b&&p!=null?m:void 0].filter(Boolean).join(" ")||void 0},f=m=>[a(),u(),m].filter(Boolean).join(" ")||void 0,h=K(()=>({"data-valid":Z(n.validationState)==="valid"?"":void 0,"data-invalid":Z(n.validationState)==="invalid"?"":void 0,"data-required":Z(n.required)?"":void 0,"data-disabled":Z(n.disabled)?"":void 0,"data-readonly":Z(n.readOnly)?"":void 0}));return{formControlContext:{name:()=>{var m;return(m=Z(n.name))!=null?m:Z(n.id)},dataset:h,validationState:()=>Z(n.validationState),isRequired:()=>Z(n.required),isDisabled:()=>Z(n.disabled),isReadOnly:()=>Z(n.readOnly),labelId:r,fieldId:s,descriptionId:a,errorMessageId:u,getAriaLabelledBy:d,getAriaDescribedBy:f,generateId:Ja(()=>Z(n.id)),registerLabel:jn(i),registerField:jn(o),registerDescription:jn(l),registerErrorMessage:jn(c)}}}var Vb=_t();function el(){const e=kt(Vb);if(e===void 0)throw new Error("[kobalte]: `useFormControlContext` must be used within a `FormControlContext.Provider` component");return e}function Wb(e){const t=el(),n=Ge({id:t.generateId("description")},e);return Se(()=>Ce(t.registerDescription(n.id))),L(dt,Pe({as:"div"},()=>t.dataset(),n))}function Qb(e){const t=el(),n=Ge({id:t.generateId("error-message")},e),[r,i]=Ze(n,["forceMount"]),s=()=>t.validationState()==="invalid";return Se(()=>{s()&&Ce(t.registerErrorMessage(i.id))}),L(xe,{get when(){return r.forceMount||s()},get children(){return L(dt,Pe({as:"div"},()=>t.dataset(),i))}})}function TP(e){let t;const n=el(),r=Ge({id:n.generateId("label")},e),[i,s]=Ze(r,["ref"]),o=sc(()=>t,()=>"label");return Se(()=>Ce(n.registerLabel(s.id))),L(dt,Pe({as:"label",ref(a){const l=zt(u=>t=u,i.ref);typeof l=="function"&&l(a)},get for(){return K(()=>o()==="label")()?n.fieldId():void 0}},()=>n.dataset(),s))}function PP(e,t){Se(Tr(e,n=>{if(n==null)return;const r=jP(n);r!=null&&(r.addEventListener("reset",t,{passive:!0}),Ce(()=>{r.removeEventListener("reset",t)}))}))}function jP(e){return MP(e)?e.form:e.closest("form")}function MP(e){return e.matches("textarea, input, select, button")}function tl(e){var o;const[t,n]=ae((o=e.defaultValue)==null?void 0:o.call(e)),r=K(()=>{var a;return((a=e.value)==null?void 0:a.call(e))!==void 0}),i=K(()=>{var a;return r()?(a=e.value)==null?void 0:a.call(e):t()});return[i,a=>{ht(()=>{var u;const l=_T(a,i());return Object.is(l,i())||(r()||n(l),(u=e.onChange)==null||u.call(e,l)),l})}]}function Yb(e){const[t,n]=tl(e);return[()=>{var i;return(i=t())!=null?i:!1},n]}function $P(e){const[t,n]=tl(e);return[()=>{var i;return(i=t())!=null?i:[]},n]}function LP(e={}){const[t,n]=Yb({value:()=>Z(e.isSelected),defaultValue:()=>!!Z(e.defaultIsSelected),onChange:s=>{var o;return(o=e.onSelectedChange)==null?void 0:o.call(e,s)}});return{isSelected:t,setIsSelected:s=>{!Z(e.isReadOnly)&&!Z(e.isDisabled)&&n(s)},toggle:()=>{!Z(e.isReadOnly)&&!Z(e.isDisabled)&&n(!t())}}}var DP=Object.defineProperty,oc=(e,t)=>{for(var n in t)DP(e,n,{get:t[n],enumerable:!0})},Xb=_t();function Zb(){return kt(Xb)}function IP(){const e=Zb();if(e===void 0)throw new Error("[kobalte]: `useDomCollectionContext` must be used within a `DomCollectionProvider` component");return e}function Jb(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}function RP(e,t){var i;const n=t.ref();if(!n)return-1;let r=e.length;if(!r)return-1;for(;r--;){const s=(i=e[r])==null?void 0:i.ref();if(s&&Jb(s,n))return r+1}return 0}function NP(e){const t=e.map((r,i)=>[i,r]);let n=!1;return t.sort(([r,i],[s,o])=>{const a=i.ref(),l=o.ref();return a===l||!a||!l?0:Jb(a,l)?(r>s&&(n=!0),-1):(r<s&&(n=!0),1)}),n?t.map(([r,i])=>i):e}function e1(e,t){const n=NP(e);e!==n&&t(n)}function FP(e){var i,s;const t=e[0],n=(i=e[e.length-1])==null?void 0:i.ref();let r=(s=t==null?void 0:t.ref())==null?void 0:s.parentElement;for(;r;){if(n&&r.contains(n))return r;r=r.parentElement}return ar(r).body}function BP(e,t){Se(()=>{const n=setTimeout(()=>{e1(e(),t)});Ce(()=>clearTimeout(n))})}function qP(e,t){if(typeof IntersectionObserver!="function"){BP(e,t);return}let n=[];Se(()=>{const r=()=>{const o=!!n.length;n=e(),o&&e1(e(),t)},i=FP(e()),s=new IntersectionObserver(r,{root:i});for(const o of e()){const a=o.ref();a&&s.observe(a)}Ce(()=>s.disconnect())})}function zP(e={}){const[t,n]=$P({value:()=>Z(e.items),onChange:s=>{var o;return(o=e.onItemsChange)==null?void 0:o.call(e,s)}});qP(t,n);const r=s=>(n(o=>{const a=RP(o,s);return sP(o,s,a)}),()=>{n(o=>{const a=o.filter(l=>l.ref()!==s.ref());return o.length===a.length?o:a})});return{DomCollectionProvider:s=>L(Xb.Provider,{value:{registerItem:r},get children(){return s.children}})}}function HP(e){const t=IP(),n=Ge({shouldRegisterItem:!0},e);Se(()=>{if(!n.shouldRegisterItem)return;const r=t.registerItem(n.getItem());Ce(r)})}function t1(e){var l,u,c;let t=(l=e.startIndex)!=null?l:0;const n=(u=e.startLevel)!=null?u:0,r=[],i=d=>{var y;if(d==null)return"";const f=(y=e.getKey)!=null?y:"key",h=cs(f)?d[f]:f(d);return h!=null?String(h):""},s=d=>{var y;if(d==null)return"";const f=(y=e.getTextValue)!=null?y:"textValue",h=cs(f)?d[f]:f(d);return h!=null?String(h):""},o=d=>{var h,y;if(d==null)return!1;const f=(h=e.getDisabled)!=null?h:"disabled";return(y=cs(f)?d[f]:f(d))!=null?y:!1},a=d=>{var f;if(d!=null)return cs(e.getSectionChildren)?d[e.getSectionChildren]:(f=e.getSectionChildren)==null?void 0:f.call(e,d)};for(const d of e.dataSource){if(cs(d)||oP(d)){r.push({type:"item",rawValue:d,key:String(d),textValue:String(d),disabled:o(d),level:n,index:t}),t++;continue}if(a(d)!=null){r.push({type:"section",rawValue:d,key:"",textValue:"",disabled:!1,level:n,index:t}),t++;const f=(c=a(d))!=null?c:[];if(f.length>0){const h=t1({dataSource:f,getKey:e.getKey,getTextValue:e.getTextValue,getDisabled:e.getDisabled,getSectionChildren:e.getSectionChildren,startIndex:t,startLevel:n+1});r.push(...h),t+=h.length}}else r.push({type:"item",rawValue:d,key:i(d),textValue:s(d),disabled:o(d),level:n,index:t}),t++}return r}function UP(e,t=[]){return K(()=>{const n=t1({dataSource:Z(e.dataSource),getKey:Z(e.getKey),getTextValue:Z(e.getTextValue),getDisabled:Z(e.getDisabled),getSectionChildren:Z(e.getSectionChildren)});for(let r=0;r<t.length;r++)t[r]();return e.factory(n)})}var GP=new Set(["Avst","Arab","Armi","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),KP=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]);function VP(e){var n;if(Intl.Locale){const r=(n=new Intl.Locale(e).maximize().script)!=null?n:"";return GP.has(r)}const t=e.split("-")[0];return KP.has(t)}function WP(e){return VP(e)?"rtl":"ltr"}function n1(){let e=typeof navigator!="undefined"&&(navigator.language||navigator.userLanguage)||"en-US";return{locale:e,direction:WP(e)}}var df=n1(),Ho=new Set;function dm(){df=n1();for(const e of Ho)e(df)}function QP(){const[e,t]=ae(df),n=K(()=>e());return Pr(()=>{Ho.size===0&&window.addEventListener("languagechange",dm),Ho.add(t),Ce(()=>{Ho.delete(t),Ho.size===0&&window.removeEventListener("languagechange",dm)})}),{locale:()=>n().locale,direction:()=>n().direction}}var YP=_t();function yi(){const e=QP();return kt(YP)||e}var Xc=new Map;function XP(e){const{locale:t}=yi(),n=K(()=>t()+(e?Object.entries(e).sort((r,i)=>r[0]<i[0]?-1:1).join():""));return K(()=>{const r=n();let i;return Xc.has(r)&&(i=Xc.get(r)),i||(i=new Intl.Collator(t(),e),Xc.set(r,i)),i})}var vr=class r1 extends Set{constructor(n,r,i){super(n);be(this,"anchorKey");be(this,"currentKey");n instanceof r1?(this.anchorKey=r||n.anchorKey,this.currentKey=i||n.currentKey):(this.anchorKey=r,this.currentKey=i)}};function ZP(e){const[t,n]=tl(e);return[()=>{var i;return(i=t())!=null?i:new vr},n]}function i1(e){return fP()?e.altKey:e.ctrlKey}function ds(e){return ic()?e.metaKey:e.ctrlKey}function fm(e){return new vr(e)}function JP(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function ej(e){const t=Ge({selectionMode:"none",selectionBehavior:"toggle"},e),[n,r]=ae(!1),[i,s]=ae(),o=K(()=>{const m=Z(t.selectedKeys);return m!=null?fm(m):m}),a=K(()=>{const m=Z(t.defaultSelectedKeys);return m!=null?fm(m):new vr}),[l,u]=ZP({value:o,defaultValue:a,onChange:m=>{var p;return(p=t.onSelectionChange)==null?void 0:p.call(t,m)}}),[c,d]=ae(Z(t.selectionBehavior)),f=()=>Z(t.selectionMode),h=()=>{var m;return(m=Z(t.disallowEmptySelection))!=null?m:!1},y=m=>{(Z(t.allowDuplicateSelectionEvents)||!JP(m,l()))&&u(m)};return Se(()=>{const m=l();Z(t.selectionBehavior)==="replace"&&c()==="toggle"&&typeof m=="object"&&m.size===0&&d("replace")}),Se(()=>{var m;d((m=Z(t.selectionBehavior))!=null?m:"toggle")}),{selectionMode:f,disallowEmptySelection:h,selectionBehavior:c,setSelectionBehavior:d,isFocused:n,setFocused:r,focusedKey:i,setFocusedKey:s,selectedKeys:l,setSelectedKeys:y}}function tj(e){const[t,n]=ae(""),[r,i]=ae(-1);return{typeSelectHandlers:{onKeyDown:o=>{var f,h,y;if(Z(e.isDisabled))return;const a=Z(e.keyboardDelegate),l=Z(e.selectionManager);if(!a.getKeyForSearch)return;const u=nj(o.key);if(!u||o.ctrlKey||o.metaKey)return;u===" "&&t().trim().length>0&&(o.preventDefault(),o.stopPropagation());let c=n(m=>m+u),d=(f=a.getKeyForSearch(c,l.focusedKey()))!=null?f:a.getKeyForSearch(c);d==null&&rj(c)&&(c=c[0],d=(h=a.getKeyForSearch(c,l.focusedKey()))!=null?h:a.getKeyForSearch(c)),d!=null&&(l.setFocusedKey(d),(y=e.onTypeSelect)==null||y.call(e,d)),clearTimeout(r()),i(window.setTimeout(()=>n(""),500))}}}}function nj(e){return e.length===1||!/^[A-Z]/i.test(e)?e:""}function rj(e){return e.split("").every(t=>t===e[0])}function ij(e,t,n){const i=Pe({selectOnFocus:()=>Z(e.selectionManager).selectionBehavior()==="replace"},e),s=()=>t(),{direction:o}=yi();let a={top:0,left:0};nP(()=>Z(i.isVirtualized)?void 0:s(),"scroll",()=>{const p=s();p&&(a={top:p.scrollTop,left:p.scrollLeft})});const{typeSelectHandlers:l}=tj({isDisabled:()=>Z(i.disallowTypeAhead),keyboardDelegate:()=>Z(i.keyboardDelegate),selectionManager:()=>Z(i.selectionManager)}),u=()=>{var p;return(p=Z(i.orientation))!=null?p:"vertical"},c=p=>{var _,O,A,T,j,B,R,P;lt(p,l.onKeyDown),p.altKey&&p.key==="Tab"&&p.preventDefault();const v=t();if(!(v!=null&&v.contains(p.target)))return;const b=Z(i.selectionManager),S=Z(i.selectOnFocus),C=M=>{M!=null&&(b.setFocusedKey(M),p.shiftKey&&b.selectionMode()==="multiple"?b.extendSelection(M):S&&!i1(p)&&b.replaceSelection(M))},x=Z(i.keyboardDelegate),k=Z(i.shouldFocusWrap),w=b.focusedKey();switch(p.key){case(u()==="vertical"?"ArrowDown":"ArrowRight"):{if(x.getKeyBelow){p.preventDefault();let M;w!=null?M=x.getKeyBelow(w):M=(_=x.getFirstKey)==null?void 0:_.call(x),M==null&&k&&(M=(O=x.getFirstKey)==null?void 0:O.call(x,w)),C(M)}break}case(u()==="vertical"?"ArrowUp":"ArrowLeft"):{if(x.getKeyAbove){p.preventDefault();let M;w!=null?M=x.getKeyAbove(w):M=(A=x.getLastKey)==null?void 0:A.call(x),M==null&&k&&(M=(T=x.getLastKey)==null?void 0:T.call(x,w)),C(M)}break}case(u()==="vertical"?"ArrowLeft":"ArrowUp"):{if(x.getKeyLeftOf){p.preventDefault();const M=o()==="rtl";let I;w!=null?I=x.getKeyLeftOf(w):I=M?(j=x.getFirstKey)==null?void 0:j.call(x):(B=x.getLastKey)==null?void 0:B.call(x),C(I)}break}case(u()==="vertical"?"ArrowRight":"ArrowDown"):{if(x.getKeyRightOf){p.preventDefault();const M=o()==="rtl";let I;w!=null?I=x.getKeyRightOf(w):I=M?(R=x.getLastKey)==null?void 0:R.call(x):(P=x.getFirstKey)==null?void 0:P.call(x),C(I)}break}case"Home":if(x.getFirstKey){p.preventDefault();const M=x.getFirstKey(w,ds(p));M!=null&&(b.setFocusedKey(M),ds(p)&&p.shiftKey&&b.selectionMode()==="multiple"?b.extendSelection(M):S&&b.replaceSelection(M))}break;case"End":if(x.getLastKey){p.preventDefault();const M=x.getLastKey(w,ds(p));M!=null&&(b.setFocusedKey(M),ds(p)&&p.shiftKey&&b.selectionMode()==="multiple"?b.extendSelection(M):S&&b.replaceSelection(M))}break;case"PageDown":if(x.getKeyPageBelow&&w!=null){p.preventDefault();const M=x.getKeyPageBelow(w);C(M)}break;case"PageUp":if(x.getKeyPageAbove&&w!=null){p.preventDefault();const M=x.getKeyPageAbove(w);C(M)}break;case"a":ds(p)&&b.selectionMode()==="multiple"&&Z(i.disallowSelectAll)!==!0&&(p.preventDefault(),b.selectAll());break;case"Escape":p.defaultPrevented||(p.preventDefault(),Z(i.disallowEmptySelection)||b.clearSelection());break;case"Tab":if(!Z(i.allowsTabNavigation)){if(p.shiftKey)v.focus();else{const M=SP(v,{tabbable:!0});let I,G;do G=M.lastChild(),G&&(I=G);while(G);I&&!I.contains(document.activeElement)&&Mt(I)}break}}},d=p=>{var C,x,k,w;const v=Z(i.selectionManager),b=Z(i.keyboardDelegate),S=Z(i.selectOnFocus);if(v.isFocused()){p.currentTarget.contains(p.target)||v.setFocused(!1);return}if(p.currentTarget.contains(p.target)){if(v.setFocused(!0),v.focusedKey()==null){const _=A=>{A!=null&&(v.setFocusedKey(A),S&&v.replaceSelection(A))},O=p.relatedTarget;O&&p.currentTarget.compareDocumentPosition(O)&Node.DOCUMENT_POSITION_FOLLOWING?_((x=v.lastSelectedKey())!=null?x:(C=b.getLastKey)==null?void 0:C.call(b)):_((w=v.firstSelectedKey())!=null?w:(k=b.getFirstKey)==null?void 0:k.call(b))}else if(!Z(i.isVirtualized)){const _=s();if(_){_.scrollTop=a.top,_.scrollLeft=a.left;const O=_.querySelector(`[data-key="${v.focusedKey()}"]`);O&&(Mt(O),cf(_,O))}}}},f=p=>{const v=Z(i.selectionManager);p.currentTarget.contains(p.relatedTarget)||v.setFocused(!1)},h=p=>{s()===p.target&&p.preventDefault()},y=()=>{var k,w;const p=Z(i.autoFocus);if(!p)return;const v=Z(i.selectionManager),b=Z(i.keyboardDelegate);let S;p==="first"&&(S=(k=b.getFirstKey)==null?void 0:k.call(b)),p==="last"&&(S=(w=b.getLastKey)==null?void 0:w.call(b));const C=v.selectedKeys();C.size&&(S=C.values().next().value),v.setFocused(!0),v.setFocusedKey(S);const x=t();x&&S==null&&!Z(i.shouldUseVirtualFocus)&&Mt(x)};return Pr(()=>{i.deferAutoFocus?setTimeout(y,0):y()}),Se(Tr([s,()=>Z(i.isVirtualized),()=>Z(i.selectionManager).focusedKey()],p=>{var C;const[v,b,S]=p;if(b)S&&((C=i.scrollToKey)==null||C.call(i,S));else if(S&&v){const x=v.querySelector(`[data-key="${S}"]`);x&&cf(v,x)}})),{tabIndex:K(()=>{if(!Z(i.shouldUseVirtualFocus))return Z(i.selectionManager).focusedKey()==null?0:-1}),onKeyDown:c,onMouseDown:h,onFocusIn:d,onFocusOut:f}}function s1(e,t){const n=()=>Z(e.selectionManager),r=()=>Z(e.key),i=()=>Z(e.shouldUseVirtualFocus),s=b=>{n().selectionMode()!=="none"&&(n().selectionMode()==="single"?n().isSelected(r())&&!n().disallowEmptySelection()?n().toggleSelection(r()):n().replaceSelection(r()):b!=null&&b.shiftKey?n().extendSelection(r()):n().selectionBehavior()==="toggle"||ds(b)||"pointerType"in b&&b.pointerType==="touch"?n().toggleSelection(r()):n().replaceSelection(r()))},o=()=>n().isSelected(r()),a=()=>Z(e.disabled)||n().isDisabled(r()),l=()=>!a()&&n().canSelectItem(r());let u=null;const c=b=>{l()&&(u=b.pointerType,b.pointerType==="mouse"&&b.button===0&&!Z(e.shouldSelectOnPressUp)&&s(b))},d=b=>{l()&&b.pointerType==="mouse"&&b.button===0&&Z(e.shouldSelectOnPressUp)&&Z(e.allowsDifferentPressOrigin)&&s(b)},f=b=>{l()&&(Z(e.shouldSelectOnPressUp)&&!Z(e.allowsDifferentPressOrigin)||u!=="mouse")&&s(b)},h=b=>{!l()||!["Enter"," "].includes(b.key)||(i1(b)?n().toggleSelection(r()):s(b))},y=b=>{a()&&b.preventDefault()},m=b=>{const S=t();i()||a()||!S||b.target===S&&n().setFocusedKey(r())},p=K(()=>{if(!(i()||a()))return r()===n().focusedKey()?0:-1}),v=K(()=>Z(e.virtualized)?void 0:r());return Se(Tr([t,r,i,()=>n().focusedKey(),()=>n().isFocused()],([b,S,C,x,k])=>{b&&S===x&&k&&!C&&document.activeElement!==b&&(e.focus?e.focus():Mt(b))})),{isSelected:o,isDisabled:a,allowsSelection:l,tabIndex:p,dataKey:v,onPointerDown:c,onPointerUp:d,onClick:f,onKeyDown:h,onMouseDown:y,onFocus:m}}var sj=class{constructor(e,t){be(this,"collection");be(this,"state");this.collection=e,this.state=t}selectionMode(){return this.state.selectionMode()}disallowEmptySelection(){return this.state.disallowEmptySelection()}selectionBehavior(){return this.state.selectionBehavior()}setSelectionBehavior(e){this.state.setSelectionBehavior(e)}isFocused(){return this.state.isFocused()}setFocused(e){this.state.setFocused(e)}focusedKey(){return this.state.focusedKey()}setFocusedKey(e){(e==null||this.collection().getItem(e))&&this.state.setFocusedKey(e)}selectedKeys(){return this.state.selectedKeys()}isSelected(e){if(this.state.selectionMode()==="none")return!1;const t=this.getKey(e);return t==null?!1:this.state.selectedKeys().has(t)}isEmpty(){return this.state.selectedKeys().size===0}isSelectAll(){if(this.isEmpty())return!1;const e=this.state.selectedKeys();return this.getAllSelectableKeys().every(t=>e.has(t))}firstSelectedKey(){let e;for(const t of this.state.selectedKeys()){const n=this.collection().getItem(t),r=(n==null?void 0:n.index)!=null&&(e==null?void 0:e.index)!=null&&n.index<e.index;(!e||r)&&(e=n)}return e==null?void 0:e.key}lastSelectedKey(){let e;for(const t of this.state.selectedKeys()){const n=this.collection().getItem(t),r=(n==null?void 0:n.index)!=null&&(e==null?void 0:e.index)!=null&&n.index>e.index;(!e||r)&&(e=n)}return e==null?void 0:e.key}extendSelection(e){if(this.selectionMode()==="none")return;if(this.selectionMode()==="single"){this.replaceSelection(e);return}const t=this.getKey(e);if(t==null)return;const n=this.state.selectedKeys(),r=n.anchorKey||t,i=new vr(n,r,t);for(const s of this.getKeyRange(r,n.currentKey||t))i.delete(s);for(const s of this.getKeyRange(t,r))this.canSelectItem(s)&&i.add(s);this.state.setSelectedKeys(i)}getKeyRange(e,t){const n=this.collection().getItem(e),r=this.collection().getItem(t);return n&&r?n.index!=null&&r.index!=null&&n.index<=r.index?this.getKeyRangeInternal(e,t):this.getKeyRangeInternal(t,e):[]}getKeyRangeInternal(e,t){const n=[];let r=e;for(;r!=null;){const i=this.collection().getItem(r);if(i&&i.type==="item"&&n.push(r),r===t)return n;r=this.collection().getKeyAfter(r)}return[]}getKey(e){const t=this.collection().getItem(e);return t?!t||t.type!=="item"?null:t.key:e}toggleSelection(e){if(this.selectionMode()==="none")return;if(this.selectionMode()==="single"&&!this.isSelected(e)){this.replaceSelection(e);return}const t=this.getKey(e);if(t==null)return;const n=new vr(this.state.selectedKeys());n.has(t)?n.delete(t):this.canSelectItem(t)&&(n.add(t),n.anchorKey=t,n.currentKey=t),!(this.disallowEmptySelection()&&n.size===0)&&this.state.setSelectedKeys(n)}replaceSelection(e){if(this.selectionMode()==="none")return;const t=this.getKey(e);if(t==null)return;const n=this.canSelectItem(t)?new vr([t],t,t):new vr;this.state.setSelectedKeys(n)}setSelectedKeys(e){if(this.selectionMode()==="none")return;const t=new vr;for(const n of e){const r=this.getKey(n);if(r!=null&&(t.add(r),this.selectionMode()==="single"))break}this.state.setSelectedKeys(t)}selectAll(){this.selectionMode()==="multiple"&&this.state.setSelectedKeys(new Set(this.getAllSelectableKeys()))}clearSelection(){const e=this.state.selectedKeys();!this.disallowEmptySelection()&&e.size>0&&this.state.setSelectedKeys(new vr)}toggleSelectAll(){this.isSelectAll()?this.clearSelection():this.selectAll()}select(e,t){this.selectionMode()!=="none"&&(this.selectionMode()==="single"?this.isSelected(e)&&!this.disallowEmptySelection()?this.toggleSelection(e):this.replaceSelection(e):this.selectionBehavior()==="toggle"||t&&t.pointerType==="touch"?this.toggleSelection(e):this.replaceSelection(e))}isSelectionEqual(e){if(e===this.state.selectedKeys())return!0;const t=this.selectedKeys();if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;for(const n of t)if(!e.has(n))return!1;return!0}canSelectItem(e){if(this.state.selectionMode()==="none")return!1;const t=this.collection().getItem(e);return t!=null&&!t.disabled}isDisabled(e){const t=this.collection().getItem(e);return!t||t.disabled}getAllSelectableKeys(){const e=[];return(n=>{for(;n!=null;){if(this.canSelectItem(n)){const r=this.collection().getItem(n);if(!r)continue;r.type==="item"&&e.push(n)}n=this.collection().getKeyAfter(n)}})(this.collection().getFirstKey()),e}},hm=class{constructor(e){be(this,"keyMap",new Map);be(this,"iterable");be(this,"firstKey");be(this,"lastKey");this.iterable=e;for(const r of e)this.keyMap.set(r.key,r);if(this.keyMap.size===0)return;let t,n=0;for(const[r,i]of this.keyMap)t?(t.nextKey=r,i.prevKey=t.key):(this.firstKey=r,i.prevKey=void 0),i.type==="item"&&(i.index=n++),t=i,t.nextKey=void 0;this.lastKey=t.key}*[Symbol.iterator](){yield*this.iterable}getSize(){return this.keyMap.size}getKeys(){return this.keyMap.keys()}getKeyBefore(e){var t;return(t=this.keyMap.get(e))==null?void 0:t.prevKey}getKeyAfter(e){var t;return(t=this.keyMap.get(e))==null?void 0:t.nextKey}getFirstKey(){return this.firstKey}getLastKey(){return this.lastKey}getItem(e){return this.keyMap.get(e)}at(e){const t=[...this.getKeys()];return this.getItem(t[e])}};function oj(e){const t=ej(e),r=UP({dataSource:()=>Z(e.dataSource),getKey:()=>Z(e.getKey),getTextValue:()=>Z(e.getTextValue),getDisabled:()=>Z(e.getDisabled),getSectionChildren:()=>Z(e.getSectionChildren),factory:s=>e.filter?new hm(e.filter(s)):new hm(s)},[()=>e.filter]),i=new sj(r,t);return av(()=>{const s=t.focusedKey();s!=null&&!r().getItem(s)&&t.setFocusedKey(void 0)}),{collection:r,selectionManager:()=>i}}var jt=e=>typeof e=="function"?e():e,aj=e=>{const t=K(()=>{const o=jt(e.element);if(o)return getComputedStyle(o)}),n=()=>{var o,a;return(a=(o=t())==null?void 0:o.animationName)!=null?a:"none"},[r,i]=ae(jt(e.show)?"present":"hidden");let s="none";return Se(o=>{const a=jt(e.show);return ht(()=>{var c;if(o===a)return a;const l=s,u=n();a?i("present"):u==="none"||((c=t())==null?void 0:c.display)==="none"?i("hidden"):i(o===!0&&l!==u?"hiding":"hidden")}),a}),Se(()=>{const o=jt(e.element);if(!o)return;const a=u=>{u.target===o&&(s=n())},l=u=>{const d=n().includes(u.animationName);u.target===o&&d&&r()==="hiding"&&i("hidden")};o.addEventListener("animationstart",a),o.addEventListener("animationcancel",l),o.addEventListener("animationend",l),Ce(()=>{o.removeEventListener("animationstart",a),o.removeEventListener("animationcancel",l),o.removeEventListener("animationend",l)})}),{present:()=>r()==="present"||r()==="hiding",state:r}},lj=aj,o1=lj,bu="data-kb-top-layer",a1,ff=!1,jr=[];function Sa(e){return jr.findIndex(t=>t.node===e)}function uj(e){return jr[Sa(e)]}function cj(e){return jr[jr.length-1].node===e}function l1(){return jr.filter(e=>e.isPointerBlocking)}function dj(){return[...l1()].slice(-1)[0]}function gh(){return l1().length>0}function u1(e){var n;const t=Sa((n=dj())==null?void 0:n.node);return Sa(e)<t}function fj(e){jr.push(e)}function hj(e){const t=Sa(e);t<0||jr.splice(t,1)}function gj(){for(const{node:e}of jr)e.style.pointerEvents=u1(e)?"none":"auto"}function yj(e){if(gh()&&!ff){const t=ar(e);a1=document.body.style.pointerEvents,t.body.style.pointerEvents="none",ff=!0}}function mj(e){if(gh())return;const t=ar(e);t.body.style.pointerEvents=a1,t.body.style.length===0&&t.body.removeAttribute("style"),ff=!1}var nn={layers:jr,isTopMostLayer:cj,hasPointerBlockingLayer:gh,isBelowPointerBlockingLayer:u1,addLayer:fj,removeLayer:hj,indexOf:Sa,find:uj,assignPointerEventToLayers:gj,disableBodyPointerEvents:yj,restoreBodyPointerEvents:mj},pj={};oc(pj,{Button:()=>xj,Root:()=>yh});var vj=["button","color","file","image","reset","submit"];function bj(e){const t=e.tagName.toLowerCase();return t==="button"?!0:t==="input"&&e.type?vj.indexOf(e.type)!==-1:!1}function yh(e){let t;const n=Ge({type:"button"},e),[r,i]=Ze(n,["ref","type","disabled"]),s=sc(()=>t,()=>"button"),o=K(()=>{const u=s();return u==null?!1:bj({tagName:u,type:r.type})}),a=K(()=>s()==="input"),l=K(()=>s()==="a"&&(t==null?void 0:t.getAttribute("href"))!=null);return L(dt,Pe({as:"button",ref(u){const c=zt(d=>t=d,r.ref);typeof c=="function"&&c(u)},get type(){return o()||a()?r.type:void 0},get role(){return!o()&&!l()?"button":void 0},get tabIndex(){return!o()&&!l()&&!r.disabled?0:void 0},get disabled(){return o()||a()?r.disabled:void 0},get"aria-disabled"(){return!o()&&!a()&&r.disabled?!0:void 0},get"data-disabled"(){return r.disabled?"":void 0}},i))}var xj=yh,wj=["top","right","bottom","left"],sr=Math.min,yn=Math.max,xu=Math.round,Ml=Math.floor,li=e=>({x:e,y:e}),Sj={left:"right",right:"left",bottom:"top",top:"bottom"},Cj={start:"end",end:"start"};function hf(e,t,n){return yn(e,sr(t,n))}function ns(e,t){return typeof e=="function"?e(t):e}function ui(e){return e.split("-")[0]}function co(e){return e.split("-")[1]}function c1(e){return e==="x"?"y":"x"}function mh(e){return e==="y"?"height":"width"}function Qi(e){return["top","bottom"].includes(ui(e))?"y":"x"}function ph(e){return c1(Qi(e))}function _j(e,t,n){n===void 0&&(n=!1);const r=co(e),i=ph(e),s=mh(i);let o=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(o=wu(o)),[o,wu(o)]}function kj(e){const t=wu(e);return[gf(e),t,gf(t)]}function gf(e){return e.replace(/start|end/g,t=>Cj[t])}function Oj(e,t,n){const r=["left","right"],i=["right","left"],s=["top","bottom"],o=["bottom","top"];switch(e){case"top":case"bottom":return n?t?i:r:t?r:i;case"left":case"right":return t?s:o;default:return[]}}function Ej(e,t,n,r){const i=co(e);let s=Oj(ui(e),n==="start",r);return i&&(s=s.map(o=>o+"-"+i),t&&(s=s.concat(s.map(gf)))),s}function wu(e){return e.replace(/left|right|bottom|top/g,t=>Sj[t])}function Aj(e){return{top:0,right:0,bottom:0,left:0,...e}}function d1(e){return typeof e!="number"?Aj(e):{top:e,right:e,bottom:e,left:e}}function Su(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function gm(e,t,n){let{reference:r,floating:i}=e;const s=Qi(t),o=ph(t),a=mh(o),l=ui(t),u=s==="y",c=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[a]/2-i[a]/2;let h;switch(l){case"top":h={x:c,y:r.y-i.height};break;case"bottom":h={x:c,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:d};break;case"left":h={x:r.x-i.width,y:d};break;default:h={x:r.x,y:r.y}}switch(co(t)){case"start":h[o]-=f*(n&&u?-1:1);break;case"end":h[o]+=f*(n&&u?-1:1);break}return h}var Tj=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:s=[],platform:o}=n,a=s.filter(Boolean),l=await(o.isRTL==null?void 0:o.isRTL(t));let u=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:c,y:d}=gm(u,r,l),f=r,h={},y=0;for(let m=0;m<a.length;m++){const{name:p,fn:v}=a[m],{x:b,y:S,data:C,reset:x}=await v({x:c,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:h,rects:u,platform:o,elements:{reference:e,floating:t}});c=b!=null?b:c,d=S!=null?S:d,h={...h,[p]:{...h[p],...C}},x&&y<=50&&(y++,typeof x=="object"&&(x.placement&&(f=x.placement),x.rects&&(u=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:c,y:d}=gm(u,f,l)),m=-1)}return{x:c,y:d,placement:f,strategy:i,middlewareData:h}};async function Ca(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:s,rects:o,elements:a,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:f=!1,padding:h=0}=ns(t,e),y=d1(h),p=a[f?d==="floating"?"reference":"floating":d],v=Su(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(p)))==null||n?p:p.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:u,rootBoundary:c,strategy:l})),b=d==="floating"?{x:r,y:i,width:o.floating.width,height:o.floating.height}:o.reference,S=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),C=await(s.isElement==null?void 0:s.isElement(S))?await(s.getScale==null?void 0:s.getScale(S))||{x:1,y:1}:{x:1,y:1},x=Su(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:b,offsetParent:S,strategy:l}):b);return{top:(v.top-x.top+y.top)/C.y,bottom:(x.bottom-v.bottom+y.bottom)/C.y,left:(v.left-x.left+y.left)/C.x,right:(x.right-v.right+y.right)/C.x}}var Pj=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:s,platform:o,elements:a,middlewareData:l}=t,{element:u,padding:c=0}=ns(e,t)||{};if(u==null)return{};const d=d1(c),f={x:n,y:r},h=ph(i),y=mh(h),m=await o.getDimensions(u),p=h==="y",v=p?"top":"left",b=p?"bottom":"right",S=p?"clientHeight":"clientWidth",C=s.reference[y]+s.reference[h]-f[h]-s.floating[y],x=f[h]-s.reference[h],k=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u));let w=k?k[S]:0;(!w||!await(o.isElement==null?void 0:o.isElement(k)))&&(w=a.floating[S]||s.floating[y]);const _=C/2-x/2,O=w/2-m[y]/2-1,A=sr(d[v],O),T=sr(d[b],O),j=A,B=w-m[y]-T,R=w/2-m[y]/2+_,P=hf(j,R,B),M=!l.arrow&&co(i)!=null&&R!==P&&s.reference[y]/2-(R<j?A:T)-m[y]/2<0,I=M?R<j?R-j:R-B:0;return{[h]:f[h]+I,data:{[h]:P,centerOffset:R-P-I,...M&&{alignmentOffset:I}},reset:M}}}),jj=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:s,rects:o,initialPlacement:a,platform:l,elements:u}=t,{mainAxis:c=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:m=!0,...p}=ns(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const v=ui(i),b=Qi(a),S=ui(a)===a,C=await(l.isRTL==null?void 0:l.isRTL(u.floating)),x=f||(S||!m?[wu(a)]:kj(a)),k=y!=="none";!f&&k&&x.push(...Ej(a,m,y,C));const w=[a,...x],_=await Ca(t,p),O=[];let A=((r=s.flip)==null?void 0:r.overflows)||[];if(c&&O.push(_[v]),d){const R=_j(i,o,C);O.push(_[R[0]],_[R[1]])}if(A=[...A,{placement:i,overflows:O}],!O.every(R=>R<=0)){var T,j;const R=(((T=s.flip)==null?void 0:T.index)||0)+1,P=w[R];if(P)return{data:{index:R,overflows:A},reset:{placement:P}};let M=(j=A.filter(I=>I.overflows[0]<=0).sort((I,G)=>I.overflows[1]-G.overflows[1])[0])==null?void 0:j.placement;if(!M)switch(h){case"bestFit":{var B;const I=(B=A.filter(G=>{if(k){const Y=Qi(G.placement);return Y===b||Y==="y"}return!0}).map(G=>[G.placement,G.overflows.filter(Y=>Y>0).reduce((Y,q)=>Y+q,0)]).sort((G,Y)=>G[1]-Y[1])[0])==null?void 0:B[0];I&&(M=I);break}case"initialPlacement":M=a;break}if(i!==M)return{reset:{placement:M}}}return{}}}};function ym(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function mm(e){return wj.some(t=>e[t]>=0)}var Mj=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...i}=ns(e,t);switch(r){case"referenceHidden":{const s=await Ca(t,{...i,elementContext:"reference"}),o=ym(s,n.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:mm(o)}}}case"escaped":{const s=await Ca(t,{...i,altBoundary:!0}),o=ym(s,n.floating);return{data:{escapedOffsets:o,escaped:mm(o)}}}default:return{}}}}};async function $j(e,t){const{placement:n,platform:r,elements:i}=e,s=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=ui(n),a=co(n),l=Qi(n)==="y",u=["left","top"].includes(o)?-1:1,c=s&&l?-1:1,d=ns(t,e);let{mainAxis:f,crossAxis:h,alignmentAxis:y}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return a&&typeof y=="number"&&(h=a==="end"?y*-1:y),l?{x:h*c,y:f*u}:{x:f*u,y:h*c}}var Lj=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:s,placement:o,middlewareData:a}=t,l=await $j(t,e);return o===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:s+l.y,data:{...l,placement:o}}}}},Dj=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:s=!0,crossAxis:o=!1,limiter:a={fn:p=>{let{x:v,y:b}=p;return{x:v,y:b}}},...l}=ns(e,t),u={x:n,y:r},c=await Ca(t,l),d=Qi(ui(i)),f=c1(d);let h=u[f],y=u[d];if(s){const p=f==="y"?"top":"left",v=f==="y"?"bottom":"right",b=h+c[p],S=h-c[v];h=hf(b,h,S)}if(o){const p=d==="y"?"top":"left",v=d==="y"?"bottom":"right",b=y+c[p],S=y-c[v];y=hf(b,y,S)}const m=a.fn({...t,[f]:h,[d]:y});return{...m,data:{x:m.x-n,y:m.y-r}}}}},Ij=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:i,elements:s}=t,{apply:o=()=>{},...a}=ns(e,t),l=await Ca(t,a),u=ui(n),c=co(n),d=Qi(n)==="y",{width:f,height:h}=r.floating;let y,m;u==="top"||u==="bottom"?(y=u,m=c===(await(i.isRTL==null?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(m=u,y=c==="end"?"top":"bottom");const p=h-l.top-l.bottom,v=f-l.left-l.right,b=sr(h-l[y],p),S=sr(f-l[m],v),C=!t.middlewareData.shift;let x=b,k=S;if(d?k=c||C?sr(S,v):v:x=c||C?sr(b,p):p,C&&!c){const _=yn(l.left,0),O=yn(l.right,0),A=yn(l.top,0),T=yn(l.bottom,0);d?k=f-2*(_!==0||O!==0?_+O:yn(l.left,l.right)):x=h-2*(A!==0||T!==0?A+T:yn(l.top,l.bottom))}await o({...t,availableWidth:k,availableHeight:x});const w=await i.getDimensions(s.floating);return f!==w.width||h!==w.height?{reset:{rects:!0}}:{}}}};function fo(e){return f1(e)?(e.nodeName||"").toLowerCase():"#document"}function vn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Lr(e){var t;return(t=(f1(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function f1(e){return e instanceof Node||e instanceof vn(e).Node}function qn(e){return e instanceof Element||e instanceof vn(e).Element}function lr(e){return e instanceof HTMLElement||e instanceof vn(e).HTMLElement}function pm(e){return typeof ShadowRoot=="undefined"?!1:e instanceof ShadowRoot||e instanceof vn(e).ShadowRoot}function nl(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=zn(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function Rj(e){return["table","td","th"].includes(fo(e))}function ac(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch(n){return!1}})}function vh(e){const t=bh(),n=qn(e)?zn(e):e;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function Nj(e){let t=ci(e);for(;lr(t)&&!to(t);){if(vh(t))return t;if(ac(t))return null;t=ci(t)}return null}function bh(){return typeof CSS=="undefined"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function to(e){return["html","body","#document"].includes(fo(e))}function zn(e){return vn(e).getComputedStyle(e)}function lc(e){return qn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ci(e){if(fo(e)==="html")return e;const t=e.assignedSlot||e.parentNode||pm(e)&&e.host||Lr(e);return pm(t)?t.host:t}function h1(e){const t=ci(e);return to(t)?e.ownerDocument?e.ownerDocument.body:e.body:lr(t)&&nl(t)?t:h1(t)}function _a(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=h1(e),s=i===((r=e.ownerDocument)==null?void 0:r.body),o=vn(i);return s?t.concat(o,o.visualViewport||[],nl(i)?i:[],o.frameElement&&n?_a(o.frameElement):[]):t.concat(i,_a(i,[],n))}function g1(e){const t=zn(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=lr(e),s=i?e.offsetWidth:n,o=i?e.offsetHeight:r,a=xu(n)!==s||xu(r)!==o;return a&&(n=s,r=o),{width:n,height:r,$:a}}function xh(e){return qn(e)?e:e.contextElement}function bs(e){const t=xh(e);if(!lr(t))return li(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:s}=g1(t);let o=(s?xu(n.width):n.width)/r,a=(s?xu(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}var Fj=li(0);function y1(e){const t=vn(e);return!bh()||!t.visualViewport?Fj:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Bj(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==vn(e)?!1:t}function Yi(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),s=xh(e);let o=li(1);t&&(r?qn(r)&&(o=bs(r)):o=bs(e));const a=Bj(s,n,r)?y1(s):li(0);let l=(i.left+a.x)/o.x,u=(i.top+a.y)/o.y,c=i.width/o.x,d=i.height/o.y;if(s){const f=vn(s),h=r&&qn(r)?vn(r):r;let y=f,m=y.frameElement;for(;m&&r&&h!==y;){const p=bs(m),v=m.getBoundingClientRect(),b=zn(m),S=v.left+(m.clientLeft+parseFloat(b.paddingLeft))*p.x,C=v.top+(m.clientTop+parseFloat(b.paddingTop))*p.y;l*=p.x,u*=p.y,c*=p.x,d*=p.y,l+=S,u+=C,y=vn(m),m=y.frameElement}}return Su({width:c,height:d,x:l,y:u})}function qj(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const s=i==="fixed",o=Lr(r),a=t?ac(t.floating):!1;if(r===o||a&&s)return n;let l={scrollLeft:0,scrollTop:0},u=li(1);const c=li(0),d=lr(r);if((d||!d&&!s)&&((fo(r)!=="body"||nl(o))&&(l=lc(r)),lr(r))){const f=Yi(r);u=bs(r),c.x=f.x+r.clientLeft,c.y=f.y+r.clientTop}return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+c.x,y:n.y*u.y-l.scrollTop*u.y+c.y}}function zj(e){return Array.from(e.getClientRects())}function m1(e){return Yi(Lr(e)).left+lc(e).scrollLeft}function Hj(e){const t=Lr(e),n=lc(e),r=e.ownerDocument.body,i=yn(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=yn(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+m1(e);const a=-n.scrollTop;return zn(r).direction==="rtl"&&(o+=yn(t.clientWidth,r.clientWidth)-i),{width:i,height:s,x:o,y:a}}function Uj(e,t){const n=vn(e),r=Lr(e),i=n.visualViewport;let s=r.clientWidth,o=r.clientHeight,a=0,l=0;if(i){s=i.width,o=i.height;const u=bh();(!u||u&&t==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}return{width:s,height:o,x:a,y:l}}function Gj(e,t){const n=Yi(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,s=lr(e)?bs(e):li(1),o=e.clientWidth*s.x,a=e.clientHeight*s.y,l=i*s.x,u=r*s.y;return{width:o,height:a,x:l,y:u}}function vm(e,t,n){let r;if(t==="viewport")r=Uj(e,n);else if(t==="document")r=Hj(Lr(e));else if(qn(t))r=Gj(t,n);else{const i=y1(e);r={...t,x:t.x-i.x,y:t.y-i.y}}return Su(r)}function p1(e,t){const n=ci(e);return n===t||!qn(n)||to(n)?!1:zn(n).position==="fixed"||p1(n,t)}function Kj(e,t){const n=t.get(e);if(n)return n;let r=_a(e,[],!1).filter(a=>qn(a)&&fo(a)!=="body"),i=null;const s=zn(e).position==="fixed";let o=s?ci(e):e;for(;qn(o)&&!to(o);){const a=zn(o),l=vh(o);!l&&a.position==="fixed"&&(i=null),(s?!l&&!i:!l&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||nl(o)&&!l&&p1(e,o))?r=r.filter(c=>c!==o):i=a,o=ci(o)}return t.set(e,r),r}function Vj(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o=[...n==="clippingAncestors"?ac(t)?[]:Kj(t,this._c):[].concat(n),r],a=o[0],l=o.reduce((u,c)=>{const d=vm(t,c,i);return u.top=yn(d.top,u.top),u.right=sr(d.right,u.right),u.bottom=sr(d.bottom,u.bottom),u.left=yn(d.left,u.left),u},vm(t,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Wj(e){const{width:t,height:n}=g1(e);return{width:t,height:n}}function Qj(e,t,n){const r=lr(t),i=Lr(t),s=n==="fixed",o=Yi(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const l=li(0);if(r||!r&&!s)if((fo(t)!=="body"||nl(i))&&(a=lc(t)),r){const d=Yi(t,!0,s,t);l.x=d.x+t.clientLeft,l.y=d.y+t.clientTop}else i&&(l.x=m1(i));const u=o.left+a.scrollLeft-l.x,c=o.top+a.scrollTop-l.y;return{x:u,y:c,width:o.width,height:o.height}}function Zc(e){return zn(e).position==="static"}function bm(e,t){return!lr(e)||zn(e).position==="fixed"?null:t?t(e):e.offsetParent}function v1(e,t){const n=vn(e);if(ac(e))return n;if(!lr(e)){let i=ci(e);for(;i&&!to(i);){if(qn(i)&&!Zc(i))return i;i=ci(i)}return n}let r=bm(e,t);for(;r&&Rj(r)&&Zc(r);)r=bm(r,t);return r&&to(r)&&Zc(r)&&!vh(r)?n:r||Nj(e)||n}var Yj=async function(e){const t=this.getOffsetParent||v1,n=this.getDimensions,r=await n(e.floating);return{reference:Qj(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Xj(e){return zn(e).direction==="rtl"}var b1={convertOffsetParentRelativeRectToViewportRelativeRect:qj,getDocumentElement:Lr,getClippingRect:Vj,getOffsetParent:v1,getElementRects:Yj,getClientRects:zj,getDimensions:Wj,getScale:bs,isElement:qn,isRTL:Xj};function Zj(e,t){let n=null,r;const i=Lr(e);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function o(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),s();const{left:u,top:c,width:d,height:f}=e.getBoundingClientRect();if(a||t(),!d||!f)return;const h=Ml(c),y=Ml(i.clientWidth-(u+d)),m=Ml(i.clientHeight-(c+f)),p=Ml(u),b={rootMargin:-h+"px "+-y+"px "+-m+"px "+-p+"px",threshold:yn(0,sr(1,l))||1};let S=!0;function C(x){const k=x[0].intersectionRatio;if(k!==l){if(!S)return o();k?o(!1,k):r=setTimeout(()=>{o(!1,1e-7)},1e3)}S=!1}try{n=new IntersectionObserver(C,{...b,root:i.ownerDocument})}catch(x){n=new IntersectionObserver(C,b)}n.observe(e)}return o(!0),s}function Jj(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=xh(e),c=i||s?[...u?_a(u):[],..._a(t)]:[];c.forEach(v=>{i&&v.addEventListener("scroll",n,{passive:!0}),s&&v.addEventListener("resize",n)});const d=u&&a?Zj(u,n):null;let f=-1,h=null;o&&(h=new ResizeObserver(v=>{let[b]=v;b&&b.target===u&&h&&(h.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var S;(S=h)==null||S.observe(t)})),n()}),u&&!l&&h.observe(u),h.observe(t));let y,m=l?Yi(e):null;l&&p();function p(){const v=Yi(e);m&&(v.x!==m.x||v.y!==m.y||v.width!==m.width||v.height!==m.height)&&n(),m=v,y=requestAnimationFrame(p)}return n(),()=>{var v;c.forEach(b=>{i&&b.removeEventListener("scroll",n),s&&b.removeEventListener("resize",n)}),d==null||d(),(v=h)==null||v.disconnect(),h=null,l&&cancelAnimationFrame(y)}}var eM=Lj,tM=Dj,nM=jj,rM=Ij,iM=Mj,sM=Pj,oM=(e,t,n)=>{const r=new Map,i={platform:b1,...n},s={...i.platform,_c:r};return Tj(e,t,{...i,platform:s})},wh=_t();function Sh(){const e=kt(wh);if(e===void 0)throw new Error("[kobalte]: `usePopperContext` must be used within a `Popper` component");return e}var aM=ce('<svg display="block" viewBox="0 0 30 30" style="transform:scale(1.02)"><g><path fill="none" d="M23,27.8c1.1,1.2,3.4,2.2,5,2.2h2H0h2c1.7,0,3.9-1,5-2.2l6.6-7.2c0.7-0.8,2-0.8,2.7,0L23,27.8L23,27.8z"></path><path stroke="none" d="M23,27.8c1.1,1.2,3.4,2.2,5,2.2h2H0h2c1.7,0,3.9-1,5-2.2l6.6-7.2c0.7-0.8,2-0.8,2.7,0L23,27.8L23,27.8z">'),yf=30,xm=yf/2,lM={top:180,right:-90,bottom:0,left:90};function Ch(e){const t=Sh(),n=Ge({size:yf},e),[r,i]=Ze(n,["ref","style","size"]),s=()=>t.currentPlacement().split("-")[0],o=uM(t.contentRef),a=()=>{var f;return((f=o())==null?void 0:f.getPropertyValue("background-color"))||"none"},l=()=>{var f;return((f=o())==null?void 0:f.getPropertyValue(`border-${s()}-color`))||"none"},u=()=>{var f;return((f=o())==null?void 0:f.getPropertyValue(`border-${s()}-width`))||"0px"},c=()=>Number.parseInt(u())*2*(yf/r.size),d=()=>`rotate(${lM[s()]} ${xm} ${xm}) translate(0 2)`;return L(dt,Pe({as:"div",ref(f){const h=zt(t.setArrowRef,r.ref);typeof h=="function"&&h(f)},"aria-hidden":"true",get style(){return rc({position:"absolute","font-size":`${r.size}px`,width:"1em",height:"1em","pointer-events":"none",fill:a(),stroke:l(),"stroke-width":c()},r.style)}},i,{get children(){const f=aM(),h=f.firstChild;return we(()=>re(h,"transform",d())),f}}))}function uM(e){const[t,n]=ae();return Se(()=>{const r=e();r&&n(lP(r).getComputedStyle(r))}),t}function cM(e){const t=Sh(),[n,r]=Ze(e,["ref","style"]);return L(dt,Pe({as:"div",ref(i){const s=zt(t.setPositionerRef,n.ref);typeof s=="function"&&s(i)},"data-popper-positioner":"",get style(){return rc({position:"absolute",top:0,left:0,"min-width":"max-content"},n.style)}},r))}function wm(e){const{x:t=0,y:n=0,width:r=0,height:i=0}=e!=null?e:{};if(typeof DOMRect=="function")return new DOMRect(t,n,r,i);const s={x:t,y:n,width:r,height:i,top:n,right:t+r,bottom:n+i,left:t};return{...s,toJSON:()=>s}}function dM(e,t){return{contextElement:e,getBoundingClientRect:()=>{const r=t(e);return r?wm(r):e?e.getBoundingClientRect():wm()}}}function fM(e){return/^(?:top|bottom|left|right)(?:-(?:start|end))?$/.test(e)}var hM={top:"bottom",right:"left",bottom:"top",left:"right"};function gM(e,t){const[n,r]=e.split("-"),i=hM[n];return r?n==="left"||n==="right"?`${i} ${r==="start"?"top":"bottom"}`:r==="start"?`${i} ${t==="rtl"?"right":"left"}`:`${i} ${t==="rtl"?"left":"right"}`:`${i} center`}function yM(e){const t=Ge({getAnchorRect:f=>f==null?void 0:f.getBoundingClientRect(),placement:"bottom",gutter:0,shift:0,flip:!0,slide:!0,overlap:!1,sameWidth:!1,fitViewport:!1,hideWhenDetached:!1,detachedPadding:0,arrowPadding:4,overflowPadding:8},e),[n,r]=ae(),[i,s]=ae(),[o,a]=ae(t.placement),l=()=>{var f;return dM((f=t.anchorRef)==null?void 0:f.call(t),t.getAnchorRect)},{direction:u}=yi();async function c(){var k,w,_;const f=l(),h=n(),y=i();if(!f||!h)return;const m=((y==null?void 0:y.clientHeight)||0)/2,p=typeof t.gutter=="number"?t.gutter+m:(k=t.gutter)!=null?k:m;h.style.setProperty("--kb-popper-content-overflow-padding",`${t.overflowPadding}px`),f.getBoundingClientRect();const v=[eM(({placement:O})=>{const A=!!O.split("-")[1];return{mainAxis:p,crossAxis:A?void 0:t.shift,alignmentAxis:t.shift}})];if(t.flip!==!1){const O=typeof t.flip=="string"?t.flip.split(" "):void 0;if(O!==void 0&&!O.every(fM))throw new Error("`flip` expects a spaced-delimited list of placements");v.push(nM({padding:t.overflowPadding,fallbackPlacements:O}))}(t.slide||t.overlap)&&v.push(tM({mainAxis:t.slide,crossAxis:t.overlap,padding:t.overflowPadding})),v.push(rM({padding:t.overflowPadding,apply({availableWidth:O,availableHeight:A,rects:T}){const j=Math.round(T.reference.width);O=Math.floor(O),A=Math.floor(A),h.style.setProperty("--kb-popper-anchor-width",`${j}px`),h.style.setProperty("--kb-popper-content-available-width",`${O}px`),h.style.setProperty("--kb-popper-content-available-height",`${A}px`),t.sameWidth&&(h.style.width=`${j}px`),t.fitViewport&&(h.style.maxWidth=`${O}px`,h.style.maxHeight=`${A}px`)}})),t.hideWhenDetached&&v.push(iM({padding:t.detachedPadding})),y&&v.push(sM({element:y,padding:t.arrowPadding}));const b=await oM(f,h,{placement:t.placement,strategy:"absolute",middleware:v,platform:{...b1,isRTL:()=>u()==="rtl"}});if(a(b.placement),(w=t.onCurrentPlacementChange)==null||w.call(t,b.placement),!h)return;h.style.setProperty("--kb-popper-content-transform-origin",gM(b.placement,u()));const S=Math.round(b.x),C=Math.round(b.y);let x;if(t.hideWhenDetached&&(x=(_=b.middlewareData.hide)!=null&&_.referenceHidden?"hidden":"visible"),Object.assign(h.style,{top:"0",left:"0",transform:`translate3d(${S}px, ${C}px, 0)`,visibility:x}),y&&b.middlewareData.arrow){const{x:O,y:A}=b.middlewareData.arrow,T=b.placement.split("-")[0];Object.assign(y.style,{left:O!=null?`${O}px`:"",top:A!=null?`${A}px`:"",[T]:"100%"})}}Se(()=>{const f=l(),h=n();if(!f||!h)return;const y=Jj(f,h,c,{elementResize:typeof ResizeObserver=="function"});Ce(y)}),Se(()=>{var y;const f=n(),h=(y=t.contentRef)==null?void 0:y.call(t);!f||!h||queueMicrotask(()=>{f.style.zIndex=getComputedStyle(h).zIndex})});const d={currentPlacement:o,contentRef:()=>{var f;return(f=t.contentRef)==null?void 0:f.call(t)},setPositionerRef:r,setArrowRef:s};return L(wh.Provider,{value:d,get children(){return t.children}})}var x1=Object.assign(yM,{Arrow:Ch,Context:wh,usePopperContext:Sh,Positioner:cM});function mM(e){const t=n=>{var r;n.key===ch.Escape&&((r=e.onEscapeKeyDown)==null||r.call(e,n))};Se(()=>{var r,i;if(Z(e.isDisabled))return;const n=(i=(r=e.ownerDocument)==null?void 0:r.call(e))!=null?i:ar();n.addEventListener("keydown",t),Ce(()=>{n.removeEventListener("keydown",t)})})}var Sm="interactOutside.pointerDownOutside",Cm="interactOutside.focusOutside";function pM(e,t){let n,r=_P;const i=()=>ar(t()),s=d=>{var f;return(f=e.onPointerDownOutside)==null?void 0:f.call(e,d)},o=d=>{var f;return(f=e.onFocusOutside)==null?void 0:f.call(e,d)},a=d=>{var f;return(f=e.onInteractOutside)==null?void 0:f.call(e,d)},l=d=>{var h;const f=d.target;return!(f instanceof HTMLElement)||f.closest(`[${bu}]`)||!Pn(i(),f)||Pn(t(),f)?!1:!((h=e.shouldExcludeElement)!=null&&h.call(e,f))},u=d=>{function f(){const h=t(),y=d.target;if(!h||!y||!l(d))return;const m=wt([s,a]);y.addEventListener(Sm,m,{once:!0});const p=new CustomEvent(Sm,{bubbles:!1,cancelable:!0,detail:{originalEvent:d,isContextMenu:d.button===2||hP(d)&&d.button===0}});y.dispatchEvent(p)}d.pointerType==="touch"?(i().removeEventListener("click",f),r=f,i().addEventListener("click",f,{once:!0})):f()},c=d=>{const f=t(),h=d.target;if(!f||!h||!l(d))return;const y=wt([o,a]);h.addEventListener(Cm,y,{once:!0});const m=new CustomEvent(Cm,{bubbles:!1,cancelable:!0,detail:{originalEvent:d,isContextMenu:!1}});h.dispatchEvent(m)};Se(()=>{Z(e.isDisabled)||(n=window.setTimeout(()=>{i().addEventListener("pointerdown",u,!0)},0),i().addEventListener("focusin",c,!0),Ce(()=>{window.clearTimeout(n),i().removeEventListener("click",r),i().removeEventListener("pointerdown",u,!0),i().removeEventListener("focusin",c,!0)}))})}var w1=_t();function vM(){return kt(w1)}function bM(e){let t;const n=vM(),[r,i]=Ze(e,["ref","disableOutsidePointerEvents","excludedElements","onEscapeKeyDown","onPointerDownOutside","onFocusOutside","onInteractOutside","onDismiss","bypassTopMostLayerCheck"]),s=new Set([]),o=d=>{s.add(d);const f=n==null?void 0:n.registerNestedLayer(d);return()=>{s.delete(d),f==null||f()}};pM({shouldExcludeElement:d=>{var f;return t?((f=r.excludedElements)==null?void 0:f.some(h=>Pn(h(),d)))||[...s].some(h=>Pn(h,d)):!1},onPointerDownOutside:d=>{var f,h,y;!t||nn.isBelowPointerBlockingLayer(t)||!r.bypassTopMostLayerCheck&&!nn.isTopMostLayer(t)||((f=r.onPointerDownOutside)==null||f.call(r,d),(h=r.onInteractOutside)==null||h.call(r,d),d.defaultPrevented||(y=r.onDismiss)==null||y.call(r))},onFocusOutside:d=>{var f,h,y;(f=r.onFocusOutside)==null||f.call(r,d),(h=r.onInteractOutside)==null||h.call(r,d),d.defaultPrevented||(y=r.onDismiss)==null||y.call(r)}},()=>t),mM({ownerDocument:()=>ar(t),onEscapeKeyDown:d=>{var f;!t||!nn.isTopMostLayer(t)||((f=r.onEscapeKeyDown)==null||f.call(r,d),!d.defaultPrevented&&r.onDismiss&&(d.preventDefault(),r.onDismiss()))}}),Pr(()=>{if(!t)return;nn.addLayer({node:t,isPointerBlocking:r.disableOutsidePointerEvents,dismiss:r.onDismiss});const d=n==null?void 0:n.registerNestedLayer(t);nn.assignPointerEventToLayers(),nn.disableBodyPointerEvents(t),Ce(()=>{t&&(nn.removeLayer(t),d==null||d(),nn.assignPointerEventToLayers(),nn.restoreBodyPointerEvents(t))})}),Se(Tr([()=>t,()=>r.disableOutsidePointerEvents],([d,f])=>{if(!d)return;const h=nn.find(d);h&&h.isPointerBlocking!==f&&(h.isPointerBlocking=f,nn.assignPointerEventToLayers()),f&&nn.disableBodyPointerEvents(d),Ce(()=>{nn.restoreBodyPointerEvents(d)})},{defer:!0}));const c={registerNestedLayer:o};return L(w1.Provider,{value:c,get children(){return L(dt,Pe({as:"div",ref(d){const f=zt(h=>t=h,r.ref);typeof f=="function"&&f(d)}},i))}})}function S1(e={}){const[t,n]=Yb({value:()=>Z(e.open),defaultValue:()=>!!Z(e.defaultOpen),onChange:o=>{var a;return(a=e.onOpenChange)==null?void 0:a.call(e,o)}}),r=()=>{n(!0)},i=()=>{n(!1)};return{isOpen:t,setIsOpen:n,open:r,close:i,toggle:()=>{t()?i():r()}}}var kn={};oc(kn,{Description:()=>Wb,ErrorMessage:()=>Qb,Item:()=>O1,ItemControl:()=>E1,ItemDescription:()=>A1,ItemIndicator:()=>T1,ItemInput:()=>P1,ItemLabel:()=>j1,Label:()=>M1,RadioGroup:()=>xM,Root:()=>$1});var C1=_t();function _1(){const e=kt(C1);if(e===void 0)throw new Error("[kobalte]: `useRadioGroupContext` must be used within a `RadioGroup` component");return e}var k1=_t();function rl(){const e=kt(k1);if(e===void 0)throw new Error("[kobalte]: `useRadioGroupItemContext` must be used within a `RadioGroup.Item` component");return e}function O1(e){const t=el(),n=_1(),r=`${t.generateId("item")}-${Ln()}`,i=Ge({id:r},e),[s,o]=Ze(i,["value","disabled","onPointerDown"]),[a,l]=ae(),[u,c]=ae(),[d,f]=ae(),[h,y]=ae(),[m,p]=ae(!1),v=K(()=>n.isSelectedValue(s.value)),b=K(()=>s.disabled||t.isDisabled()||!1),S=k=>{lt(k,s.onPointerDown),m()&&k.preventDefault()},C=K(()=>({...t.dataset(),"data-disabled":b()?"":void 0,"data-checked":v()?"":void 0})),x={value:()=>s.value,dataset:C,isSelected:v,isDisabled:b,inputId:a,labelId:u,descriptionId:d,inputRef:h,select:()=>n.setSelectedValue(s.value),generateId:Ja(()=>o.id),registerInput:jn(l),registerLabel:jn(c),registerDescription:jn(f),setIsFocused:p,setInputRef:y};return L(k1.Provider,{value:x,get children(){return L(dt,Pe({as:"div",role:"group",onPointerDown:S},C,o))}})}function E1(e){const t=rl(),n=Ge({id:t.generateId("control")},e),[r,i]=Ze(n,["onClick","onKeyDown"]);return L(dt,Pe({as:"div",onClick:a=>{var l;lt(a,r.onClick),t.select(),(l=t.inputRef())==null||l.focus()},onKeyDown:a=>{var l;lt(a,r.onKeyDown),a.key===ch.Space&&(t.select(),(l=t.inputRef())==null||l.focus())}},()=>t.dataset(),i))}function A1(e){const t=rl(),n=Ge({id:t.generateId("description")},e);return Se(()=>Ce(t.registerDescription(n.id))),L(dt,Pe({as:"div"},()=>t.dataset(),n))}function T1(e){const t=rl(),n=Ge({id:t.generateId("indicator")},e),[r,i]=Ze(n,["ref","forceMount"]),[s,o]=ae(),{present:a}=o1({show:()=>r.forceMount||t.isSelected(),element:()=>{var l;return(l=s())!=null?l:null}});return L(xe,{get when(){return a()},get children(){return L(dt,Pe({as:"div",ref(l){const u=zt(o,r.ref);typeof u=="function"&&u(l)}},()=>t.dataset(),i))}})}function P1(e){const t=el(),n=_1(),r=rl(),i=Ge({id:r.generateId("input")},e),[s,o]=Ze(i,["ref","style","aria-labelledby","aria-describedby","onChange","onFocus","onBlur"]),a=()=>[s["aria-labelledby"],r.labelId(),s["aria-labelledby"]!=null&&o["aria-label"]!=null?o.id:void 0].filter(Boolean).join(" ")||void 0,l=()=>[s["aria-describedby"],r.descriptionId(),n.ariaDescribedBy()].filter(Boolean).join(" ")||void 0,[u,c]=ae(!1),d=y=>{if(lt(y,s.onChange),y.stopPropagation(),!u()){n.setSelectedValue(r.value());const m=y.target;m.checked=r.isSelected()}c(!1)},f=y=>{lt(y,s.onFocus),r.setIsFocused(!0)},h=y=>{lt(y,s.onBlur),r.setIsFocused(!1)};return Se(Tr([()=>r.isSelected(),()=>r.value()],y=>{if(!y[0]&&y[1]===r.value())return;c(!0);const m=r.inputRef();m==null||m.dispatchEvent(new Event("input",{bubbles:!0,cancelable:!0})),m==null||m.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0}))},{defer:!0})),Se(()=>Ce(r.registerInput(o.id))),L(dt,Pe({as:"input",ref(y){const m=zt(r.setInputRef,s.ref);typeof m=="function"&&m(y)},type:"radio",get name(){return t.name()},get value(){return r.value()},get checked(){return r.isSelected()},get required(){return t.isRequired()},get disabled(){return r.isDisabled()},get readonly(){return t.isReadOnly()},get style(){return rc({...Kb},s.style)},get"aria-labelledby"(){return a()},get"aria-describedby"(){return l()},onChange:d,onFocus:f,onBlur:h},()=>r.dataset(),o))}function j1(e){const t=rl(),n=Ge({id:t.generateId("label")},e);return Se(()=>Ce(t.registerLabel(n.id))),L(dt,Pe({as:"label",get for(){return t.inputId()}},()=>t.dataset(),n))}function M1(e){return L(TP,Pe({as:"span"},e))}function $1(e){let t;const n=`radiogroup-${Ln()}`,r=Ge({id:n,orientation:"vertical"},e),[i,s,o]=Ze(r,["ref","value","defaultValue","onChange","orientation","aria-labelledby","aria-describedby"],EP),[a,l]=tl({value:()=>i.value,defaultValue:()=>i.defaultValue,onChange:y=>{var m;return(m=i.onChange)==null?void 0:m.call(i,y)}}),{formControlContext:u}=AP(s);PP(()=>t,()=>{var y;return l((y=i.defaultValue)!=null?y:"")});const c=()=>u.getAriaLabelledBy(Z(s.id),o["aria-label"],i["aria-labelledby"]),d=()=>u.getAriaDescribedBy(i["aria-describedby"]),f=y=>y===a(),h={ariaDescribedBy:d,isSelectedValue:f,setSelectedValue:y=>{if(!(u.isReadOnly()||u.isDisabled())&&(l(y),t))for(const m of t.querySelectorAll("[type='radio']")){const p=m;p.checked=f(p.value)}}};return L(Vb.Provider,{value:u,get children(){return L(C1.Provider,{value:h,get children(){return L(dt,Pe({as:"div",ref(y){const m=zt(p=>t=p,i.ref);typeof m=="function"&&m(y)},role:"radiogroup",get id(){return Z(s.id)},get"aria-invalid"(){return u.validationState()==="invalid"||void 0},get"aria-required"(){return u.isRequired()||void 0},get"aria-disabled"(){return u.isDisabled()||void 0},get"aria-readonly"(){return u.isReadOnly()||void 0},get"aria-orientation"(){return i.orientation},get"aria-labelledby"(){return c()},get"aria-describedby"(){return d()}},()=>u.dataset(),o))}})}})}var xM=Object.assign($1,{Description:Wb,ErrorMessage:Qb,Item:O1,ItemControl:E1,ItemDescription:A1,ItemIndicator:T1,ItemInput:P1,ItemLabel:j1,Label:M1}),wM=class{constructor(e,t,n){be(this,"collection");be(this,"ref");be(this,"collator");this.collection=e,this.ref=t,this.collator=n}getKeyBelow(e){let t=this.collection().getKeyAfter(e);for(;t!=null;){const n=this.collection().getItem(t);if(n&&n.type==="item"&&!n.disabled)return t;t=this.collection().getKeyAfter(t)}}getKeyAbove(e){let t=this.collection().getKeyBefore(e);for(;t!=null;){const n=this.collection().getItem(t);if(n&&n.type==="item"&&!n.disabled)return t;t=this.collection().getKeyBefore(t)}}getFirstKey(){let e=this.collection().getFirstKey();for(;e!=null;){const t=this.collection().getItem(e);if(t&&t.type==="item"&&!t.disabled)return e;e=this.collection().getKeyAfter(e)}}getLastKey(){let e=this.collection().getLastKey();for(;e!=null;){const t=this.collection().getItem(e);if(t&&t.type==="item"&&!t.disabled)return e;e=this.collection().getKeyBefore(e)}}getItem(e){var t,n,r;return(r=(n=(t=this.ref)==null?void 0:t.call(this))==null?void 0:n.querySelector(`[data-key="${e}"]`))!=null?r:null}getKeyPageAbove(e){var s;const t=(s=this.ref)==null?void 0:s.call(this);let n=this.getItem(e);if(!t||!n)return;const r=Math.max(0,n.offsetTop+n.offsetHeight-t.offsetHeight);let i=e;for(;i&&n&&n.offsetTop>r;)i=this.getKeyAbove(i),n=i!=null?this.getItem(i):null;return i}getKeyPageBelow(e){var s;const t=(s=this.ref)==null?void 0:s.call(this);let n=this.getItem(e);if(!t||!n)return;const r=Math.min(t.scrollHeight,n.offsetTop-n.offsetHeight+t.offsetHeight);let i=e;for(;i&&n&&n.offsetTop<r;)i=this.getKeyBelow(i),n=i!=null?this.getItem(i):null;return i}getKeyForSearch(e,t){var i;const n=(i=this.collator)==null?void 0:i.call(this);if(!n)return;let r=t!=null?this.getKeyBelow(t):this.getFirstKey();for(;r!=null;){const s=this.collection().getItem(r);if(s){const o=s.textValue.slice(0,e.length);if(s.textValue&&n.compare(o,e)===0)return r}r=this.getKeyBelow(r)}}};function SM(e,t,n){const r=XP({usage:"search",sensitivity:"base"}),i=K(()=>{const s=Z(e.keyboardDelegate);return s||new wM(e.collection,t,r)});return ij({selectionManager:()=>Z(e.selectionManager),keyboardDelegate:i,autoFocus:()=>Z(e.autoFocus),deferAutoFocus:()=>Z(e.deferAutoFocus),shouldFocusWrap:()=>Z(e.shouldFocusWrap),disallowEmptySelection:()=>Z(e.disallowEmptySelection),selectOnFocus:()=>Z(e.selectOnFocus),disallowTypeAhead:()=>Z(e.disallowTypeAhead),shouldUseVirtualFocus:()=>Z(e.shouldUseVirtualFocus),allowsTabNavigation:()=>Z(e.allowsTabNavigation),isVirtualized:()=>Z(e.isVirtualized),scrollToKey:s=>{var o;return(o=Z(e.scrollToKey))==null?void 0:o(s)},orientation:()=>Z(e.orientation)},t)}var Jc="focusScope.autoFocusOnMount",ed="focusScope.autoFocusOnUnmount",_m={bubbles:!1,cancelable:!0},km={stack:[],active(){return this.stack[0]},add(e){var t;e!==this.active()&&((t=this.active())==null||t.pause()),this.stack=uf(this.stack,e),this.stack.unshift(e)},remove(e){var t;this.stack=uf(this.stack,e),(t=this.active())==null||t.resume()}};function CM(e,t){const[n,r]=ae(!1),i={pause(){r(!0)},resume(){r(!1)}};let s=null;const o=y=>{var m;return(m=e.onMountAutoFocus)==null?void 0:m.call(e,y)},a=y=>{var m;return(m=e.onUnmountAutoFocus)==null?void 0:m.call(e,y)},l=()=>ar(t()),u=()=>{const y=l().createElement("span");return y.setAttribute("data-focus-trap",""),y.tabIndex=0,Object.assign(y.style,Kb),y},c=()=>{const y=t();return y?Ub(y,!0).filter(m=>!m.hasAttribute("data-focus-trap")):[]},d=()=>{const y=c();return y.length>0?y[0]:null},f=()=>{const y=c();return y.length>0?y[y.length-1]:null},h=()=>{const y=t();if(!y)return!1;const m=zo(y);return!m||Pn(y,m)?!1:Gb(m)};Se(()=>{const y=t();if(!y)return;km.add(i);const m=zo(y);if(!Pn(y,m)){const v=new CustomEvent(Jc,_m);y.addEventListener(Jc,o),y.dispatchEvent(v),v.defaultPrevented||setTimeout(()=>{Mt(d()),zo(y)===m&&Mt(y)},0)}Ce(()=>{y.removeEventListener(Jc,o),setTimeout(()=>{const v=new CustomEvent(ed,_m);h()&&v.preventDefault(),y.addEventListener(ed,a),y.dispatchEvent(v),v.defaultPrevented||Mt(m!=null?m:l().body),y.removeEventListener(ed,a),km.remove(i)},0)})}),Se(()=>{const y=t();if(!y||!Z(e.trapFocus)||n())return;const m=v=>{const b=v.target;b!=null&&b.closest(`[${bu}]`)||(Pn(y,b)?s=b:Mt(s))},p=v=>{const b=v.relatedTarget,S=b!=null?b:zo(y);S!=null&&S.closest(`[${bu}]`)||Pn(y,S)||Mt(s)};l().addEventListener("focusin",m),l().addEventListener("focusout",p),Ce(()=>{l().removeEventListener("focusin",m),l().removeEventListener("focusout",p)})}),Se(()=>{const y=t();if(!y||!Z(e.trapFocus)||n())return;const m=u();y.insertAdjacentElement("afterbegin",m);const p=u();y.insertAdjacentElement("beforeend",p);function v(S){const C=d(),x=f();S.relatedTarget===C?Mt(x):Mt(C)}m.addEventListener("focusin",v),p.addEventListener("focusin",v);const b=new MutationObserver(S=>{for(const C of S)C.previousSibling===p&&(p.remove(),y.insertAdjacentElement("beforeend",p)),C.nextSibling===m&&(m.remove(),y.insertAdjacentElement("afterbegin",m))});b.observe(y,{childList:!0,subtree:!1}),Ce(()=>{m.removeEventListener("focusin",v),p.removeEventListener("focusin",v),m.remove(),p.remove(),b.disconnect()})})}var _M="data-live-announcer";function kM(e){Se(()=>{Z(e.isDisabled)||Ce(OM(Z(e.targets),Z(e.root)))})}var Po=new WeakMap,Cn=[];function OM(e,t=document.body){const n=new Set(e),r=new Set,i=l=>{for(const f of l.querySelectorAll(`[${_M}], [${bu}]`))n.add(f);const u=f=>{if(n.has(f)||f.parentElement&&r.has(f.parentElement)&&f.parentElement.getAttribute("role")!=="row")return NodeFilter.FILTER_REJECT;for(const h of n)if(f.contains(h))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_ACCEPT},c=document.createTreeWalker(l,NodeFilter.SHOW_ELEMENT,{acceptNode:u}),d=u(l);if(d===NodeFilter.FILTER_ACCEPT&&s(l),d!==NodeFilter.FILTER_REJECT){let f=c.nextNode();for(;f!=null;)s(f),f=c.nextNode()}},s=l=>{var c;const u=(c=Po.get(l))!=null?c:0;l.getAttribute("aria-hidden")==="true"&&u===0||(u===0&&l.setAttribute("aria-hidden","true"),r.add(l),Po.set(l,u+1))};Cn.length&&Cn[Cn.length-1].disconnect(),i(t);const o=new MutationObserver(l=>{for(const u of l)if(!(u.type!=="childList"||u.addedNodes.length===0)&&![...n,...r].some(c=>c.contains(u.target))){for(const c of u.removedNodes)c instanceof Element&&(n.delete(c),r.delete(c));for(const c of u.addedNodes)(c instanceof HTMLElement||c instanceof SVGElement)&&(c.dataset.liveAnnouncer==="true"||c.dataset.reactAriaTopLayer==="true")?n.add(c):c instanceof Element&&i(c)}});o.observe(t,{childList:!0,subtree:!0});const a={observe(){o.observe(t,{childList:!0,subtree:!0})},disconnect(){o.disconnect()}};return Cn.push(a),()=>{o.disconnect();for(const l of r){const u=Po.get(l);if(u==null)return;u===1?(l.removeAttribute("aria-hidden"),Po.delete(l)):Po.set(l,u-1)}a===Cn[Cn.length-1]?(Cn.pop(),Cn.length&&Cn[Cn.length-1].observe()):Cn.splice(Cn.indexOf(a),1)}}var $l=new Map,EM=e=>{Se(()=>{var s,o;const t=(s=jt(e.style))!=null?s:{},n=(o=jt(e.properties))!=null?o:[],r={};for(const a in t)r[a]=e.element.style[a];const i=$l.get(e.key);i?i.activeCount++:$l.set(e.key,{activeCount:1,originalStyles:r,properties:n.map(a=>a.key)}),Object.assign(e.element.style,e.style);for(const a of n)e.element.style.setProperty(a.key,a.value);Ce(()=>{var l;const a=$l.get(e.key);if(a){if(a.activeCount!==1){a.activeCount--;return}$l.delete(e.key);for(const[u,c]of Object.entries(a.originalStyles))e.element.style[u]=c;for(const u of a.properties)e.element.style.removeProperty(u);e.element.style.length===0&&e.element.removeAttribute("style"),(l=e.cleanup)==null||l.call(e)}})})},Om=EM,AM=(e,t)=>{switch(t){case"x":return[e.clientWidth,e.scrollLeft,e.scrollWidth];case"y":return[e.clientHeight,e.scrollTop,e.scrollHeight]}},TM=(e,t)=>{const n=getComputedStyle(e),r=t==="x"?n.overflowX:n.overflowY;return r==="auto"||r==="scroll"||e.tagName==="HTML"&&r==="visible"},PM=(e,t,n)=>{var l;const r=t==="x"&&window.getComputedStyle(e).direction==="rtl"?-1:1;let i=e,s=0,o=0,a=!1;do{const[u,c,d]=AM(i,t),f=d-u-r*c;(c!==0||f!==0)&&TM(i,t)&&(s+=f,o+=c),i===(n!=null?n:document.documentElement)?a=!0:i=(l=i._$host)!=null?l:i.parentElement}while(i&&!a);return[s,o]},[Em,Am]=ae([]),jM=e=>Em().indexOf(e)===Em().length-1,MM=e=>{const t=Pe({element:null,enabled:!0,hideScrollbar:!0,preventScrollbarShift:!0,preventScrollbarShiftMode:"padding",restoreScrollPosition:!0,allowPinchZoom:!1},e),n=Ln();let r=[0,0],i=null,s=null;Se(()=>{jt(t.enabled)&&(Am(u=>[...u,n]),Ce(()=>{Am(u=>u.filter(c=>c!==n))}))}),Se(()=>{if(!jt(t.enabled)||!jt(t.hideScrollbar))return;const{body:u}=document,c=window.innerWidth-u.offsetWidth;if(jt(t.preventScrollbarShift)){const d={overflow:"hidden"},f=[];c>0&&(jt(t.preventScrollbarShiftMode)==="padding"?d.paddingRight=`calc(${window.getComputedStyle(u).paddingRight} + ${c}px)`:d.marginRight=`calc(${window.getComputedStyle(u).marginRight} + ${c}px)`,f.push({key:"--scrollbar-width",value:`${c}px`}));const h=window.scrollY,y=window.scrollX;Om({key:"prevent-scroll",element:u,style:d,properties:f,cleanup:()=>{jt(t.restoreScrollPosition)&&c>0&&window.scrollTo(y,h)}})}else Om({key:"prevent-scroll",element:u,style:{overflow:"hidden"}})}),Se(()=>{!jM(n)||!jt(t.enabled)||(document.addEventListener("wheel",a,{passive:!1}),document.addEventListener("touchstart",o,{passive:!1}),document.addEventListener("touchmove",l,{passive:!1}),Ce(()=>{document.removeEventListener("wheel",a),document.removeEventListener("touchstart",o),document.removeEventListener("touchmove",l)}))});const o=u=>{r=Tm(u),i=null,s=null},a=u=>{const c=u.target,d=jt(t.element),f=$M(u),h=Math.abs(f[0])>Math.abs(f[1])?"x":"y",y=h==="x"?f[0]:f[1],m=Pm(c,h,y,d);let p;d&&mf(d,c)?p=!m:p=!0,p&&u.cancelable&&u.preventDefault()},l=u=>{const c=jt(t.element),d=u.target;let f;if(u.touches.length===2)f=!jt(t.allowPinchZoom);else{if(i==null||s===null){const h=Tm(u).map((m,p)=>r[p]-m),y=Math.abs(h[0])>Math.abs(h[1])?"x":"y";i=y,s=y==="x"?h[0]:h[1]}if(d.type==="range")f=!1;else{const h=Pm(d,i,s,c);c&&mf(c,d)?f=!h:f=!0}}f&&u.cancelable&&u.preventDefault()}},$M=e=>[e.deltaX,e.deltaY],Tm=e=>e.changedTouches[0]?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0],Pm=(e,t,n,r)=>{const i=r!==null&&mf(r,e),[s,o]=PM(e,t,i?r:void 0);return!(n>0&&Math.abs(s)<=1||n<0&&Math.abs(o)<1)},mf=(e,t)=>{var r;if(e.contains(t))return!0;let n=t;for(;n;){if(n===e)return!0;n=(r=n._$host)!=null?r:n.parentElement}return!1},LM=MM,DM=LM,L1=_t();function D1(){return kt(L1)}function Dr(){const e=D1();if(e===void 0)throw new Error("[kobalte]: `useMenuContext` must be used within a `Menu` component");return e}var I1=_t();function _h(){const e=kt(I1);if(e===void 0)throw new Error("[kobalte]: `useMenuItemContext` must be used within a `Menu.Item` component");return e}var R1=_t();function ur(){const e=kt(R1);if(e===void 0)throw new Error("[kobalte]: `useMenuRootContext` must be used within a `MenuRoot` component");return e}function kh(e){let t;const n=ur(),r=Dr(),i=Ge({id:n.generateId(`item-${Ln()}`)},e),[s,o]=Ze(i,["ref","textValue","disabled","closeOnSelect","checked","indeterminate","onSelect","onPointerMove","onPointerLeave","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]),[a,l]=ae(),[u,c]=ae(),[d,f]=ae(),h=()=>r.listState().selectionManager(),y=()=>o.id,m=()=>h().focusedKey()===y(),p=()=>{var O;(O=s.onSelect)==null||O.call(s),s.closeOnSelect&&setTimeout(()=>{r.close(!0)})};HP({getItem:()=>{var O,A,T,j,B;return{ref:()=>t,type:"item",key:y(),textValue:(j=(T=(A=s.textValue)!=null?A:(O=d())==null?void 0:O.textContent)!=null?T:t==null?void 0:t.textContent)!=null?j:"",disabled:(B=s.disabled)!=null?B:!1}}});const v=s1({key:y,selectionManager:h,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>s.disabled},()=>t),b=O=>{lt(O,s.onPointerMove),O.pointerType==="mouse"&&(s.disabled?r.onItemLeave(O):(r.onItemEnter(O),O.defaultPrevented||(Mt(O.currentTarget),r.listState().selectionManager().setFocused(!0),r.listState().selectionManager().setFocusedKey(y()))))},S=O=>{lt(O,s.onPointerLeave),O.pointerType==="mouse"&&r.onItemLeave(O)},C=O=>{lt(O,s.onPointerUp),!s.disabled&&O.button===0&&p()},x=O=>{if(lt(O,s.onKeyDown),!O.repeat&&!s.disabled)switch(O.key){case"Enter":case" ":p();break}},k=K(()=>{if(s.indeterminate)return"mixed";if(s.checked!=null)return s.checked}),w=K(()=>({"data-indeterminate":s.indeterminate?"":void 0,"data-checked":s.checked&&!s.indeterminate?"":void 0,"data-disabled":s.disabled?"":void 0,"data-highlighted":m()?"":void 0})),_={isChecked:()=>s.checked,dataset:w,setLabelRef:f,generateId:Ja(()=>o.id),registerLabel:jn(l),registerDescription:jn(c)};return L(I1.Provider,{value:_,get children(){return L(dt,Pe({as:"div",ref(O){const A=zt(T=>t=T,s.ref);typeof A=="function"&&A(O)},get tabIndex(){return v.tabIndex()},get"aria-checked"(){return k()},get"aria-disabled"(){return s.disabled},get"aria-labelledby"(){return a()},get"aria-describedby"(){return u()},get"data-key"(){return v.dataKey()},get onPointerDown(){return wt([s.onPointerDown,v.onPointerDown])},get onPointerUp(){return wt([C,v.onPointerUp])},get onClick(){return wt([s.onClick,v.onClick])},get onKeyDown(){return wt([x,v.onKeyDown])},get onMouseDown(){return wt([s.onMouseDown,v.onMouseDown])},get onFocus(){return wt([s.onFocus,v.onFocus])},onPointerMove:b,onPointerLeave:S},w,o))}})}function N1(e){const t=Ge({closeOnSelect:!1},e),[n,r]=Ze(t,["checked","defaultChecked","onChange","onSelect"]),i=LP({isSelected:()=>n.checked,defaultIsSelected:()=>n.defaultChecked,onSelectedChange:o=>{var a;return(a=n.onChange)==null?void 0:a.call(n,o)},isDisabled:()=>r.disabled});return L(kh,Pe({role:"menuitemcheckbox",get checked(){return i.isSelected()},onSelect:()=>{var o;(o=n.onSelect)==null||o.call(n),i.toggle()}},r))}var IM=_t();function uc(){return kt(IM)}var ka={next:(e,t)=>e==="ltr"?t==="horizontal"?"ArrowRight":"ArrowDown":t==="horizontal"?"ArrowLeft":"ArrowUp",previous:(e,t)=>ka.next(e==="ltr"?"rtl":"ltr",t)},jm={first:e=>e==="horizontal"?"ArrowDown":"ArrowRight",last:e=>e==="horizontal"?"ArrowUp":"ArrowLeft"};function F1(e){const t=ur(),n=Dr(),r=uc(),{direction:i}=yi(),s=Ge({id:t.generateId("trigger")},e),[o,a]=Ze(s,["ref","id","disabled","onPointerDown","onClick","onKeyDown","onMouseOver","onFocus"]);let l=()=>t.value();r!==void 0&&(l=()=>{var v;return(v=t.value())!=null?v:o.id},r.lastValue()===void 0&&r.setLastValue(l));const u=sc(()=>n.triggerRef(),()=>"button"),c=K(()=>{var v;return u()==="a"&&((v=n.triggerRef())==null?void 0:v.getAttribute("href"))!=null});Se(Tr(()=>r==null?void 0:r.value(),v=>{var b;c()&&v===l()&&((b=n.triggerRef())==null||b.focus())}));const d=()=>{r!==void 0?n.isOpen()?r.value()===l()&&r.closeMenu():(r.autoFocusMenu()||r.setAutoFocusMenu(!0),n.open(!1)):n.toggle(!0)},f=v=>{lt(v,o.onPointerDown),v.currentTarget.dataset.pointerType=v.pointerType,!o.disabled&&v.pointerType!=="touch"&&v.button===0&&d()},h=v=>{lt(v,o.onClick),o.disabled||v.currentTarget.dataset.pointerType==="touch"&&d()},y=v=>{if(lt(v,o.onKeyDown),!o.disabled){if(c())switch(v.key){case"Enter":case" ":return}switch(v.key){case"Enter":case" ":case jm.first(t.orientation()):v.stopPropagation(),v.preventDefault(),OP(v.currentTarget),n.open("first"),r==null||r.setAutoFocusMenu(!0),r==null||r.setValue(l);break;case jm.last(t.orientation()):v.stopPropagation(),v.preventDefault(),n.open("last");break;case ka.next(i(),t.orientation()):if(r===void 0)break;v.stopPropagation(),v.preventDefault(),r.nextMenu();break;case ka.previous(i(),t.orientation()):if(r===void 0)break;v.stopPropagation(),v.preventDefault(),r.previousMenu();break}}},m=v=>{var b;lt(v,o.onMouseOver),((b=n.triggerRef())==null?void 0:b.dataset.pointerType)!=="touch"&&!o.disabled&&r!==void 0&&r.value()!==void 0&&r.setValue(l)},p=v=>{lt(v,o.onFocus),r!==void 0&&v.currentTarget.dataset.pointerType!=="touch"&&r.setValue(l)};return Se(()=>Ce(n.registerTriggerId(o.id))),L(yh,Pe({ref(v){const b=zt(n.setTriggerRef,o.ref);typeof b=="function"&&b(v)},get"data-kb-menu-value-trigger"(){return t.value()},get id(){return o.id},get disabled(){return o.disabled},"aria-haspopup":"true",get"aria-expanded"(){return n.isOpen()},get"aria-controls"(){return K(()=>!!n.isOpen())()?n.contentId():void 0},get"data-highlighted"(){return l()!==void 0&&(r==null?void 0:r.value())===l()?!0:void 0},get tabIndex(){return r!==void 0?r.value()===l()||r.lastValue()===l()?0:-1:void 0},onPointerDown:f,onMouseOver:m,onClick:h,onKeyDown:y,onFocus:p,role:r!==void 0?"menuitem":void 0},()=>n.dataset(),a))}var RM=_t();function B1(){return kt(RM)}function q1(e){let t;const n=ur(),r=Dr(),i=uc(),s=B1(),{direction:o}=yi(),a=Ge({id:n.generateId(`content-${Ln()}`)},e),[l,u]=Ze(a,["ref","id","style","onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onPointerEnter","onPointerMove","onKeyDown","onMouseDown","onFocusIn","onFocusOut"]);let c=0;const d=()=>r.parentMenuContext()==null&&i===void 0&&n.isModal(),f=SM({selectionManager:r.listState().selectionManager,collection:r.listState().collection,autoFocus:r.autoFocus,deferAutoFocus:!0,shouldFocusWrap:!0,disallowTypeAhead:()=>!r.listState().selectionManager().isFocused(),orientation:()=>n.orientation()==="horizontal"?"vertical":"horizontal"},()=>t);CM({trapFocus:()=>d()&&r.isOpen(),onMountAutoFocus:S=>{var C;i===void 0&&((C=l.onOpenAutoFocus)==null||C.call(l,S))},onUnmountAutoFocus:l.onCloseAutoFocus},()=>t);const h=S=>{if(Pn(S.currentTarget,S.target)&&(S.key==="Tab"&&r.isOpen()&&S.preventDefault(),i!==void 0&&S.currentTarget.getAttribute("aria-haspopup")!=="true"))switch(S.key){case ka.next(o(),n.orientation()):S.stopPropagation(),S.preventDefault(),r.close(!0),i.setAutoFocusMenu(!0),i.nextMenu();break;case ka.previous(o(),n.orientation()):if(S.currentTarget.hasAttribute("data-closed"))break;S.stopPropagation(),S.preventDefault(),r.close(!0),i.setAutoFocusMenu(!0),i.previousMenu();break}},y=S=>{var C;(C=l.onEscapeKeyDown)==null||C.call(l,S),i==null||i.setAutoFocusMenu(!1),r.close(!0)},m=S=>{var C;(C=l.onFocusOutside)==null||C.call(l,S),n.isModal()&&S.preventDefault()},p=S=>{var C,x;lt(S,l.onPointerEnter),r.isOpen()&&((C=r.parentMenuContext())==null||C.listState().selectionManager().setFocused(!1),(x=r.parentMenuContext())==null||x.listState().selectionManager().setFocusedKey(void 0))},v=S=>{if(lt(S,l.onPointerMove),S.pointerType!=="mouse")return;const C=S.target,x=c!==S.clientX;Pn(S.currentTarget,C)&&x&&(r.setPointerDir(S.clientX>c?"right":"left"),c=S.clientX)};Se(()=>Ce(r.registerContentId(l.id)));const b={ref:zt(S=>{r.setContentRef(S),t=S},l.ref),role:"menu",get id(){return l.id},get tabIndex(){return f.tabIndex()},get"aria-labelledby"(){return r.triggerId()},onKeyDown:wt([l.onKeyDown,f.onKeyDown,h]),onMouseDown:wt([l.onMouseDown,f.onMouseDown]),onFocusIn:wt([l.onFocusIn,f.onFocusIn]),onFocusOut:wt([l.onFocusOut,f.onFocusOut]),onPointerEnter:p,onPointerMove:v,get"data-orientation"(){return n.orientation()}};return L(xe,{get when(){return r.contentPresent()},get children(){return L(xe,{get when(){return s===void 0||r.parentMenuContext()!=null},get fallback(){return L(dt,Pe({as:"div"},()=>r.dataset(),b,u))},get children(){return L(x1.Positioner,{get children(){return L(bM,Pe({get disableOutsidePointerEvents(){return K(()=>!!d())()&&r.isOpen()},get excludedElements(){return[r.triggerRef]},bypassTopMostLayerCheck:!0,get style(){return rc({"--kb-menu-content-transform-origin":"var(--kb-popper-content-transform-origin)",position:"relative"},l.style)},onEscapeKeyDown:y,onFocusOutside:m,get onDismiss(){return r.close}},()=>r.dataset(),b,u))}})}})}})}function NM(e){let t;const n=ur(),r=Dr(),[i,s]=Ze(e,["ref"]);return DM({element:()=>t!=null?t:null,enabled:()=>r.contentPresent()&&n.preventScroll()}),L(q1,Pe({ref(o){const a=zt(l=>{t=l},i.ref);typeof a=="function"&&a(o)}},s))}var z1=_t();function FM(){const e=kt(z1);if(e===void 0)throw new Error("[kobalte]: `useMenuGroupContext` must be used within a `Menu.Group` component");return e}function Oh(e){const t=ur(),n=Ge({id:t.generateId(`group-${Ln()}`)},e),[r,i]=ae(),s={generateId:Ja(()=>n.id),registerLabelId:jn(i)};return L(z1.Provider,{value:s,get children(){return L(dt,Pe({as:"div",role:"group",get"aria-labelledby"(){return r()}},n))}})}function H1(e){const t=FM(),n=Ge({id:t.generateId("label")},e),[r,i]=Ze(n,["id"]);return Se(()=>Ce(t.registerLabelId(r.id))),L(dt,Pe({as:"span",get id(){return r.id},"aria-hidden":"true"},i))}function U1(e){const t=Dr(),n=Ge({children:"▼"},e);return L(dt,Pe({as:"span","aria-hidden":"true"},()=>t.dataset(),n))}function G1(e){return L(kh,Pe({role:"menuitem",closeOnSelect:!0},e))}function K1(e){const t=_h(),n=Ge({id:t.generateId("description")},e),[r,i]=Ze(n,["id"]);return Se(()=>Ce(t.registerDescription(r.id))),L(dt,Pe({as:"div",get id(){return r.id}},()=>t.dataset(),i))}function V1(e){const t=_h(),n=Ge({id:t.generateId("indicator")},e),[r,i]=Ze(n,["forceMount"]);return L(xe,{get when(){return r.forceMount||t.isChecked()},get children(){return L(dt,Pe({as:"div"},()=>t.dataset(),i))}})}function W1(e){const t=_h(),n=Ge({id:t.generateId("label")},e),[r,i]=Ze(n,["ref","id"]);return Se(()=>Ce(t.registerLabel(r.id))),L(dt,Pe({as:"div",ref(s){const o=zt(t.setLabelRef,r.ref);typeof o=="function"&&o(s)},get id(){return r.id}},()=>t.dataset(),i))}function Q1(e){const t=Dr();return L(xe,{get when(){return t.contentPresent()},get children(){return L(xv,e)}})}var Y1=_t();function BM(){const e=kt(Y1);if(e===void 0)throw new Error("[kobalte]: `useMenuRadioGroupContext` must be used within a `Menu.RadioGroup` component");return e}function X1(e){const n=ur().generateId(`radiogroup-${Ln()}`),r=Ge({id:n},e),[i,s]=Ze(r,["value","defaultValue","onChange","disabled"]),[o,a]=tl({value:()=>i.value,defaultValue:()=>i.defaultValue,onChange:u=>{var c;return(c=i.onChange)==null?void 0:c.call(i,u)}}),l={isDisabled:()=>i.disabled,isSelectedValue:u=>u===o(),setSelectedValue:a};return L(Y1.Provider,{value:l,get children(){return L(Oh,s)}})}function Z1(e){const t=BM(),n=Ge({closeOnSelect:!1},e),[r,i]=Ze(n,["value","onSelect"]);return L(kh,Pe({role:"menuitemradio",get checked(){return t.isSelectedValue(r.value)},onSelect:()=>{var o;(o=r.onSelect)==null||o.call(r),t.setSelectedValue(r.value)}},i))}function qM(e,t,n){const r=e.split("-")[0],i=n.getBoundingClientRect(),s=[],o=t.clientX,a=t.clientY;switch(r){case"top":s.push([o,a+5]),s.push([i.left,i.bottom]),s.push([i.left,i.top]),s.push([i.right,i.top]),s.push([i.right,i.bottom]);break;case"right":s.push([o-5,a]),s.push([i.left,i.top]),s.push([i.right,i.top]),s.push([i.right,i.bottom]),s.push([i.left,i.bottom]);break;case"bottom":s.push([o,a-5]),s.push([i.right,i.top]),s.push([i.right,i.bottom]),s.push([i.left,i.bottom]),s.push([i.left,i.top]);break;case"left":s.push([o+5,a]),s.push([i.right,i.bottom]),s.push([i.left,i.bottom]),s.push([i.left,i.top]),s.push([i.right,i.top]);break}return s}function zM(e,t){return t?kP([e.clientX,e.clientY],t):!1}function J1(e){const t=ur(),n=Zb(),r=D1(),i=uc(),s=B1(),o=Ge({placement:t.orientation()==="horizontal"?"bottom-start":"right-start"},e),[a,l]=Ze(o,["open","defaultOpen","onOpenChange"]);let u=0,c=null,d="right";const[f,h]=ae(),[y,m]=ae(),[p,v]=ae(),[b,S]=ae(),[C,x]=ae(!0),[k,w]=ae(l.placement),[_,O]=ae([]),[A,T]=ae([]),{DomCollectionProvider:j}=zP({items:A,onItemsChange:T}),B=S1({open:()=>a.open,defaultOpen:()=>a.defaultOpen,onOpenChange:X=>{var ge;return(ge=a.onOpenChange)==null?void 0:ge.call(a,X)}}),{present:R}=o1({show:()=>t.forceMount()||B.isOpen(),element:()=>{var X;return(X=b())!=null?X:null}}),P=oj({selectionMode:"none",dataSource:A}),M=X=>{x(X),B.open()},I=(X=!1)=>{B.close(),X&&r&&r.close(!0)},G=X=>{x(X),B.toggle()},Y=()=>{const X=b();X&&(Mt(X),P.selectionManager().setFocused(!0),P.selectionManager().setFocusedKey(void 0))},q=()=>{s!=null?setTimeout(()=>Y()):Y()},U=X=>{O(ye=>[...ye,X]);const ge=r==null?void 0:r.registerNestedMenu(X);return()=>{O(ye=>uf(ye,X)),ge==null||ge()}},z=X=>d===(c==null?void 0:c.side)&&zM(X,c==null?void 0:c.area),V=X=>{z(X)&&X.preventDefault()},N=X=>{z(X)||q()},ne=X=>{z(X)&&X.preventDefault()};kM({isDisabled:()=>!(r==null&&B.isOpen()&&t.isModal()),targets:()=>[b(),..._()].filter(Boolean)}),Se(()=>{const X=b();if(!X||!r)return;const ge=r.registerNestedMenu(X);Ce(()=>{ge()})}),Se(()=>{r===void 0&&(i==null||i.registerMenu(t.value(),[b(),..._()]))}),Se(()=>{var X;r!==void 0||i===void 0||(i.value()===t.value()?((X=p())==null||X.focus(),i.autoFocusMenu()&&M(!0)):I())}),Se(()=>{r!==void 0||i===void 0||B.isOpen()&&i.setValue(t.value())}),Ce(()=>{r===void 0&&(i==null||i.unregisterMenu(t.value()))});const he={dataset:K(()=>({"data-expanded":B.isOpen()?"":void 0,"data-closed":B.isOpen()?void 0:""})),isOpen:B.isOpen,contentPresent:R,nestedMenus:_,currentPlacement:k,pointerGraceTimeoutId:()=>u,autoFocus:C,listState:()=>P,parentMenuContext:()=>r,triggerRef:p,contentRef:b,triggerId:f,contentId:y,setTriggerRef:v,setContentRef:S,open:M,close:I,toggle:G,focusContent:q,onItemEnter:V,onItemLeave:N,onTriggerLeave:ne,setPointerDir:X=>d=X,setPointerGraceTimeoutId:X=>u=X,setPointerGraceIntent:X=>c=X,registerNestedMenu:U,registerItemToParentDomCollection:n==null?void 0:n.registerItem,registerTriggerId:jn(h),registerContentId:jn(m)};return L(j,{get children(){return L(L1.Provider,{value:he,get children(){return L(xe,{when:s===void 0,get fallback(){return l.children},get children(){return L(x1,Pe({anchorRef:p,contentRef:b,onCurrentPlacementChange:w},l))}})}})}})}function ex(e){const{direction:t}=yi();return L(J1,Pe({get placement(){return t()==="rtl"?"left-start":"right-start"},flip:!0},e))}var HM={close:(e,t)=>e==="ltr"?[t==="horizontal"?"ArrowLeft":"ArrowUp"]:[t==="horizontal"?"ArrowRight":"ArrowDown"]};function tx(e){const t=Dr(),n=ur(),[r,i]=Ze(e,["onFocusOutside","onKeyDown"]),{direction:s}=yi();return L(q1,Pe({onOpenAutoFocus:c=>{c.preventDefault()},onCloseAutoFocus:c=>{c.preventDefault()},onFocusOutside:c=>{var f;(f=r.onFocusOutside)==null||f.call(r,c);const d=c.target;Pn(t.triggerRef(),d)||t.close()},onKeyDown:c=>{lt(c,r.onKeyDown);const d=Pn(c.currentTarget,c.target),f=HM.close(s(),n.orientation()).includes(c.key),h=t.parentMenuContext()!=null;d&&f&&h&&(t.close(),Mt(t.triggerRef()))}},i))}var Mm=["Enter"," "],UM={open:(e,t)=>e==="ltr"?[...Mm,t==="horizontal"?"ArrowRight":"ArrowDown"]:[...Mm,t==="horizontal"?"ArrowLeft":"ArrowUp"]};function nx(e){let t;const n=ur(),r=Dr(),i=Ge({id:n.generateId(`sub-trigger-${Ln()}`)},e),[s,o]=Ze(i,["ref","id","textValue","disabled","onPointerMove","onPointerLeave","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]);let a=null;const l=()=>{a&&window.clearTimeout(a),a=null},{direction:u}=yi(),c=()=>s.id,d=()=>{const S=r.parentMenuContext();if(S==null)throw new Error("[kobalte]: `Menu.SubTrigger` must be used within a `Menu.Sub` component");return S.listState().selectionManager()},f=()=>r.listState().collection(),h=()=>d().focusedKey()===c(),y=s1({key:c,selectionManager:d,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>s.disabled},()=>t),m=S=>{lt(S,s.onClick),!r.isOpen()&&!s.disabled&&r.open(!0)},p=S=>{var x;if(lt(S,s.onPointerMove),S.pointerType!=="mouse")return;const C=r.parentMenuContext();if(C==null||C.onItemEnter(S),!S.defaultPrevented){if(s.disabled){C==null||C.onItemLeave(S);return}!r.isOpen()&&!a&&((x=r.parentMenuContext())==null||x.setPointerGraceIntent(null),a=window.setTimeout(()=>{r.open(!1),l()},100)),C==null||C.onItemEnter(S),S.defaultPrevented||(r.listState().selectionManager().isFocused()&&(r.listState().selectionManager().setFocused(!1),r.listState().selectionManager().setFocusedKey(void 0)),Mt(S.currentTarget),C==null||C.listState().selectionManager().setFocused(!0),C==null||C.listState().selectionManager().setFocusedKey(c()))}},v=S=>{if(lt(S,s.onPointerLeave),S.pointerType!=="mouse")return;l();const C=r.parentMenuContext(),x=r.contentRef();if(x){C==null||C.setPointerGraceIntent({area:qM(r.currentPlacement(),S,x),side:r.currentPlacement().split("-")[0]}),window.clearTimeout(C==null?void 0:C.pointerGraceTimeoutId());const k=window.setTimeout(()=>{C==null||C.setPointerGraceIntent(null)},300);C==null||C.setPointerGraceTimeoutId(k)}else{if(C==null||C.onTriggerLeave(S),S.defaultPrevented)return;C==null||C.setPointerGraceIntent(null)}C==null||C.onItemLeave(S)},b=S=>{lt(S,s.onKeyDown),!S.repeat&&(s.disabled||UM.open(u(),n.orientation()).includes(S.key)&&(S.stopPropagation(),S.preventDefault(),d().setFocused(!1),d().setFocusedKey(void 0),r.isOpen()||r.open("first"),r.focusContent(),r.listState().selectionManager().setFocused(!0),r.listState().selectionManager().setFocusedKey(f().getFirstKey())))};return Se(()=>{var C,x,k;if(r.registerItemToParentDomCollection==null)throw new Error("[kobalte]: `Menu.SubTrigger` must be used within a `Menu.Sub` component");const S=r.registerItemToParentDomCollection({ref:()=>t,type:"item",key:c(),textValue:(x=(C=s.textValue)!=null?C:t==null?void 0:t.textContent)!=null?x:"",disabled:(k=s.disabled)!=null?k:!1});Ce(S)}),Se(Tr(()=>{var S;return(S=r.parentMenuContext())==null?void 0:S.pointerGraceTimeoutId()},S=>{Ce(()=>{var C;window.clearTimeout(S),(C=r.parentMenuContext())==null||C.setPointerGraceIntent(null)})})),Se(()=>Ce(r.registerTriggerId(s.id))),Ce(()=>{l()}),L(dt,Pe({as:"div",ref(S){const C=zt(x=>{r.setTriggerRef(x),t=x},s.ref);typeof C=="function"&&C(S)},get id(){return s.id},role:"menuitem",get tabIndex(){return y.tabIndex()},"aria-haspopup":"true",get"aria-expanded"(){return r.isOpen()},get"aria-controls"(){return K(()=>!!r.isOpen())()?r.contentId():void 0},get"aria-disabled"(){return s.disabled},get"data-key"(){return y.dataKey()},get"data-highlighted"(){return h()?"":void 0},get"data-disabled"(){return s.disabled?"":void 0},get onPointerDown(){return wt([s.onPointerDown,y.onPointerDown])},get onPointerUp(){return wt([s.onPointerUp,y.onPointerUp])},get onClick(){return wt([m,y.onClick])},get onKeyDown(){return wt([b,y.onKeyDown])},get onMouseDown(){return wt([s.onMouseDown,y.onMouseDown])},get onFocus(){return wt([s.onFocus,y.onFocus])},onPointerMove:p,onPointerLeave:v},()=>r.dataset(),o))}function GM(e){const t=uc(),n=`menu-${Ln()}`,r=Ge({id:n,modal:!0},e),[i,s]=Ze(r,["id","modal","preventScroll","forceMount","open","defaultOpen","onOpenChange","value","orientation"]),o=S1({open:()=>i.open,defaultOpen:()=>i.defaultOpen,onOpenChange:l=>{var u;return(u=i.onOpenChange)==null?void 0:u.call(i,l)}}),a={isModal:()=>{var l;return(l=i.modal)!=null?l:!0},preventScroll:()=>{var l;return(l=i.preventScroll)!=null?l:a.isModal()},forceMount:()=>{var l;return(l=i.forceMount)!=null?l:!1},generateId:Ja(()=>i.id),value:()=>i.value,orientation:()=>{var l,u;return(u=(l=i.orientation)!=null?l:t==null?void 0:t.orientation())!=null?u:"horizontal"}};return L(R1.Provider,{value:a,get children(){return L(J1,Pe({get open(){return o.isOpen()},get onOpenChange(){return o.setIsOpen}},s))}})}var KM={};oc(KM,{Root:()=>cc,Separator:()=>VM});function cc(e){let t;const n=Ge({orientation:"horizontal"},e),[r,i]=Ze(n,["ref","orientation"]),s=sc(()=>t,()=>"hr");return L(dt,Pe({as:"hr",ref(o){const a=zt(l=>t=l,r.ref);typeof a=="function"&&a(o)},get role(){return s()!=="hr"?"separator":void 0},get"aria-orientation"(){return r.orientation==="vertical"?"vertical":void 0},get"data-orientation"(){return r.orientation}},i))}var VM=cc,mt={};oc(mt,{Arrow:()=>Ch,CheckboxItem:()=>N1,Content:()=>rx,DropdownMenu:()=>WM,Group:()=>Oh,GroupLabel:()=>H1,Icon:()=>U1,Item:()=>G1,ItemDescription:()=>K1,ItemIndicator:()=>V1,ItemLabel:()=>W1,Portal:()=>Q1,RadioGroup:()=>X1,RadioItem:()=>Z1,Root:()=>ix,Separator:()=>cc,Sub:()=>ex,SubContent:()=>tx,SubTrigger:()=>nx,Trigger:()=>F1});function rx(e){const t=ur(),n=Dr(),[r,i]=Ze(e,["onCloseAutoFocus","onInteractOutside"]);let s=!1;return L(NM,Pe({onCloseAutoFocus:l=>{var u;(u=r.onCloseAutoFocus)==null||u.call(r,l),s||Mt(n.triggerRef()),s=!1,l.preventDefault()},onInteractOutside:l=>{var u;(u=r.onInteractOutside)==null||u.call(r,l),(!t.isModal()||l.detail.isContextMenu)&&(s=!0)}},i))}function ix(e){const t=`dropdownmenu-${Ln()}`,n=Ge({id:t},e);return L(GM,n)}var WM=Object.assign(ix,{Arrow:Ch,CheckboxItem:N1,Content:rx,Group:Oh,GroupLabel:H1,Icon:U1,Item:G1,ItemDescription:K1,ItemIndicator:V1,ItemLabel:W1,Portal:Q1,RadioGroup:X1,RadioItem:Z1,Separator:cc,Sub:ex,SubContent:tx,SubTrigger:nx,Trigger:F1}),W={colors:{inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000000",white:"#ffffff",neutral:{50:"#f9fafb",100:"#f2f4f7",200:"#eaecf0",300:"#d0d5dd",400:"#98a2b3",500:"#667085",600:"#475467",700:"#344054",800:"#1d2939",900:"#101828"},darkGray:{50:"#525c7a",100:"#49536e",200:"#414962",300:"#394056",400:"#313749",500:"#292e3d",600:"#212530",700:"#191c24",800:"#111318",900:"#0b0d10"},gray:{50:"#f9fafb",100:"#f2f4f7",200:"#eaecf0",300:"#d0d5dd",400:"#98a2b3",500:"#667085",600:"#475467",700:"#344054",800:"#1d2939",900:"#101828"},blue:{25:"#F5FAFF",50:"#EFF8FF",100:"#D1E9FF",200:"#B2DDFF",300:"#84CAFF",400:"#53B1FD",500:"#2E90FA",600:"#1570EF",700:"#175CD3",800:"#1849A9",900:"#194185"},green:{25:"#F6FEF9",50:"#ECFDF3",100:"#D1FADF",200:"#A6F4C5",300:"#6CE9A6",400:"#32D583",500:"#12B76A",600:"#039855",700:"#027A48",800:"#05603A",900:"#054F31"},red:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d",950:"#450a0a"},yellow:{25:"#FFFCF5",50:"#FFFAEB",100:"#FEF0C7",200:"#FEDF89",300:"#FEC84B",400:"#FDB022",500:"#F79009",600:"#DC6803",700:"#B54708",800:"#93370D",900:"#7A2E0E"},purple:{25:"#FAFAFF",50:"#F4F3FF",100:"#EBE9FE",200:"#D9D6FE",300:"#BDB4FE",400:"#9B8AFB",500:"#7A5AF8",600:"#6938EF",700:"#5925DC",800:"#4A1FB8",900:"#3E1C96"},teal:{25:"#F6FEFC",50:"#F0FDF9",100:"#CCFBEF",200:"#99F6E0",300:"#5FE9D0",400:"#2ED3B7",500:"#15B79E",600:"#0E9384",700:"#107569",800:"#125D56",900:"#134E48"},pink:{25:"#fdf2f8",50:"#fce7f3",100:"#fbcfe8",200:"#f9a8d4",300:"#f472b6",400:"#ec4899",500:"#db2777",600:"#be185d",700:"#9d174d",800:"#831843",900:"#500724"},cyan:{25:"#ecfeff",50:"#cffafe",100:"#a5f3fc",200:"#67e8f9",300:"#22d3ee",400:"#06b6d4",500:"#0891b2",600:"#0e7490",700:"#155e75",800:"#164e63",900:"#083344"}},alpha:{90:"e5",80:"cc"},font:{size:{xs:"calc(var(--tsqd-font-size) * 0.75)",sm:"calc(var(--tsqd-font-size) * 0.875)",md:"var(--tsqd-font-size)"},lineHeight:{xs:"calc(var(--tsqd-font-size) * 1)",sm:"calc(var(--tsqd-font-size) * 1.25)",md:"calc(var(--tsqd-font-size) * 1.5)"},weight:{medium:"500",semibold:"600",bold:"700"}},border:{radius:{xs:"calc(var(--tsqd-font-size) * 0.125)",sm:"calc(var(--tsqd-font-size) * 0.25)",full:"9999px"}},size:{.25:"calc(var(--tsqd-font-size) * 0.0625)",.5:"calc(var(--tsqd-font-size) * 0.125)",1:"calc(var(--tsqd-font-size) * 0.25)",1.5:"calc(var(--tsqd-font-size) * 0.375)",2:"calc(var(--tsqd-font-size) * 0.5)",2.5:"calc(var(--tsqd-font-size) * 0.625)",3:"calc(var(--tsqd-font-size) * 0.75)",3.5:"calc(var(--tsqd-font-size) * 0.875)",4:"calc(var(--tsqd-font-size) * 1)",4.5:"calc(var(--tsqd-font-size) * 1.125)",5:"calc(var(--tsqd-font-size) * 1.25)",6:"calc(var(--tsqd-font-size) * 1.5)",6.5:"calc(var(--tsqd-font-size) * 1.625)",14:"calc(var(--tsqd-font-size) * 3.5)"},shadow:{xs:(e="rgb(0 0 0 / 0.1)")=>"0 1px 2px 0 rgb(0 0 0 / 0.05)",sm:(e="rgb(0 0 0 / 0.1)")=>`0 1px 3px 0 ${e}, 0 1px 2px -1px ${e}`,md:(e="rgb(0 0 0 / 0.1)")=>`0 4px 6px -1px ${e}, 0 2px 4px -2px ${e}`,lg:(e="rgb(0 0 0 / 0.1)")=>`0 10px 15px -3px ${e}, 0 4px 6px -4px ${e}`,xl:(e="rgb(0 0 0 / 0.1)")=>`0 20px 25px -5px ${e}, 0 8px 10px -6px ${e}`,"2xl":(e="rgb(0 0 0 / 0.25)")=>`0 25px 50px -12px ${e}`,inner:(e="rgb(0 0 0 / 0.05)")=>`inset 0 2px 4px 0 ${e}`,none:()=>"none"}},QM=ce('<svg width=14 height=14 viewBox="0 0 14 14"fill=none xmlns=http://www.w3.org/2000/svg><path d="M13 13L9.00007 9M10.3333 5.66667C10.3333 8.244 8.244 10.3333 5.66667 10.3333C3.08934 10.3333 1 8.244 1 5.66667C1 3.08934 3.08934 1 5.66667 1C8.244 1 10.3333 3.08934 10.3333 5.66667Z"stroke=currentColor stroke-width=1.66667 stroke-linecap=round stroke-linejoin=round>'),YM=ce('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M9 3H15M3 6H21M19 6L18.2987 16.5193C18.1935 18.0975 18.1409 18.8867 17.8 19.485C17.4999 20.0118 17.0472 20.4353 16.5017 20.6997C15.882 21 15.0911 21 13.5093 21H10.4907C8.90891 21 8.11803 21 7.49834 20.6997C6.95276 20.4353 6.50009 20.0118 6.19998 19.485C5.85911 18.8867 5.8065 18.0975 5.70129 16.5193L5 6M10 10.5V15.5M14 10.5V15.5"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),XM=ce('<svg width=10 height=6 viewBox="0 0 10 6"fill=none xmlns=http://www.w3.org/2000/svg><path d="M1 1L5 5L9 1"stroke=currentColor stroke-width=1.66667 stroke-linecap=round stroke-linejoin=round>'),ZM=ce('<svg width=12 height=12 viewBox="0 0 16 16"fill=none xmlns=http://www.w3.org/2000/svg><path d="M8 13.3333V2.66667M8 2.66667L4 6.66667M8 2.66667L12 6.66667"stroke=currentColor stroke-width=1.66667 stroke-linecap=round stroke-linejoin=round>'),Eh=ce('<svg width=12 height=12 viewBox="0 0 16 16"fill=none xmlns=http://www.w3.org/2000/svg><path d="M8 2.66667V13.3333M8 13.3333L4 9.33333M8 13.3333L12 9.33333"stroke=currentColor stroke-width=1.66667 stroke-linecap=round stroke-linejoin=round>'),JM=ce('<svg viewBox="0 0 24 24"height=12 width=12 fill=none xmlns=http://www.w3.org/2000/svg><path d="M12 2v2m0 16v2M4 12H2m4.314-5.686L4.9 4.9m12.786 1.414L19.1 4.9M6.314 17.69 4.9 19.104m12.786-1.414 1.414 1.414M22 12h-2m-3 0a5 5 0 1 1-10 0 5 5 0 0 1 10 0Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),e$=ce('<svg viewBox="0 0 24 24"height=12 width=12 fill=none xmlns=http://www.w3.org/2000/svg><path d="M22 15.844a10.424 10.424 0 0 1-4.306.925c-5.779 0-10.463-4.684-10.463-10.462 0-1.536.33-2.994.925-4.307A10.464 10.464 0 0 0 2 11.538C2 17.316 6.684 22 12.462 22c4.243 0 7.896-2.526 9.538-6.156Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),t$=ce('<svg viewBox="0 0 24 24"height=12 width=12 fill=none xmlns=http://www.w3.org/2000/svg><path d="M8 21h8m-4-4v4m-5.2-4h10.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C22 14.72 22 13.88 22 12.2V7.8c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C19.72 3 18.88 3 17.2 3H6.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C2 5.28 2 6.12 2 7.8v4.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C4.28 17 5.12 17 6.8 17Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),n$=ce('<svg stroke=currentColor fill=currentColor stroke-width=0 viewBox="0 0 24 24"height=1em width=1em xmlns=http://www.w3.org/2000/svg><path fill=none d="M0 0h24v24H0z"></path><path d="M1 9l2 2c4.97-4.97 13.03-4.97 18 0l2-2C16.93 2.93 7.08 2.93 1 9zm8 8l3 3 3-3a4.237 4.237 0 00-6 0zm-4-4l2 2a7.074 7.074 0 0110 0l2-2C15.14 9.14 8.87 9.14 5 13z">'),r$=ce('<svg stroke-width=0 viewBox="0 0 24 24"height=1em width=1em xmlns=http://www.w3.org/2000/svg><path fill=none d="M24 .01c0-.01 0-.01 0 0L0 0v24h24V.01zM0 0h24v24H0V0zm0 0h24v24H0V0z"></path><path d="M22.99 9C19.15 5.16 13.8 3.76 8.84 4.78l2.52 2.52c3.47-.17 6.99 1.05 9.63 3.7l2-2zm-4 4a9.793 9.793 0 00-4.49-2.56l3.53 3.53.96-.97zM2 3.05L5.07 6.1C3.6 6.82 2.22 7.78 1 9l1.99 2c1.24-1.24 2.67-2.16 4.2-2.77l2.24 2.24A9.684 9.684 0 005 13v.01L6.99 15a7.042 7.042 0 014.92-2.06L18.98 20l1.27-1.26L3.29 1.79 2 3.05zM9 17l3 3 3-3a4.237 4.237 0 00-6 0z">'),i$=ce('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M9.3951 19.3711L9.97955 20.6856C10.1533 21.0768 10.4368 21.4093 10.7958 21.6426C11.1547 21.8759 11.5737 22.0001 12.0018 22C12.4299 22.0001 12.8488 21.8759 13.2078 21.6426C13.5667 21.4093 13.8503 21.0768 14.024 20.6856L14.6084 19.3711C14.8165 18.9047 15.1664 18.5159 15.6084 18.26C16.0532 18.0034 16.5678 17.8941 17.0784 17.9478L18.5084 18.1C18.9341 18.145 19.3637 18.0656 19.7451 17.8713C20.1265 17.6771 20.4434 17.3763 20.6573 17.0056C20.8715 16.635 20.9735 16.2103 20.9511 15.7829C20.9286 15.3555 20.7825 14.9438 20.5307 14.5978L19.684 13.4344C19.3825 13.0171 19.2214 12.5148 19.224 12C19.2239 11.4866 19.3865 10.9864 19.6884 10.5711L20.5351 9.40778C20.787 9.06175 20.933 8.65007 20.9555 8.22267C20.978 7.79528 20.8759 7.37054 20.6618 7C20.4479 6.62923 20.131 6.32849 19.7496 6.13423C19.3681 5.93997 18.9386 5.86053 18.5129 5.90556L17.0829 6.05778C16.5722 6.11141 16.0577 6.00212 15.6129 5.74556C15.17 5.48825 14.82 5.09736 14.6129 4.62889L14.024 3.31444C13.8503 2.92317 13.5667 2.59072 13.2078 2.3574C12.8488 2.12408 12.4299 1.99993 12.0018 2C11.5737 1.99993 11.1547 2.12408 10.7958 2.3574C10.4368 2.59072 10.1533 2.92317 9.97955 3.31444L9.3951 4.62889C9.18803 5.09736 8.83798 5.48825 8.3951 5.74556C7.95032 6.00212 7.43577 6.11141 6.9251 6.05778L5.49066 5.90556C5.06499 5.86053 4.6354 5.93997 4.25397 6.13423C3.87255 6.32849 3.55567 6.62923 3.34177 7C3.12759 7.37054 3.02555 7.79528 3.04804 8.22267C3.07052 8.65007 3.21656 9.06175 3.46844 9.40778L4.3151 10.5711C4.61704 10.9864 4.77964 11.4866 4.77955 12C4.77964 12.5134 4.61704 13.0137 4.3151 13.4289L3.46844 14.5922C3.21656 14.9382 3.07052 15.3499 3.04804 15.7773C3.02555 16.2047 3.12759 16.6295 3.34177 17C3.55589 17.3706 3.8728 17.6712 4.25417 17.8654C4.63554 18.0596 5.06502 18.1392 5.49066 18.0944L6.92066 17.9422C7.43133 17.8886 7.94587 17.9979 8.39066 18.2544C8.83519 18.511 9.18687 18.902 9.3951 19.3711Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round></path><path d="M12 15C13.6568 15 15 13.6569 15 12C15 10.3431 13.6568 9 12 9C10.3431 9 8.99998 10.3431 8.99998 12C8.99998 13.6569 10.3431 15 12 15Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),s$=ce('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M16 21H16.2C17.8802 21 18.7202 21 19.362 20.673C19.9265 20.3854 20.3854 19.9265 20.673 19.362C21 18.7202 21 17.8802 21 16.2V7.8C21 6.11984 21 5.27976 20.673 4.63803C20.3854 4.07354 19.9265 3.6146 19.362 3.32698C18.7202 3 17.8802 3 16.2 3H7.8C6.11984 3 5.27976 3 4.63803 3.32698C4.07354 3.6146 3.6146 4.07354 3.32698 4.63803C3 5.27976 3 6.11984 3 7.8V8M11.5 12.5L17 7M17 7H12M17 7V12M6.2 21H8.8C9.9201 21 10.4802 21 10.908 20.782C11.2843 20.5903 11.5903 20.2843 11.782 19.908C12 19.4802 12 18.9201 12 17.8V15.2C12 14.0799 12 13.5198 11.782 13.092C11.5903 12.7157 11.2843 12.4097 10.908 12.218C10.4802 12 9.92011 12 8.8 12H6.2C5.0799 12 4.51984 12 4.09202 12.218C3.71569 12.4097 3.40973 12.7157 3.21799 13.092C3 13.5198 3 14.0799 3 15.2V17.8C3 18.9201 3 19.4802 3.21799 19.908C3.40973 20.2843 3.71569 20.5903 4.09202 20.782C4.51984 21 5.07989 21 6.2 21Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),o$=ce('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path class=copier d="M8 8V5.2C8 4.0799 8 3.51984 8.21799 3.09202C8.40973 2.71569 8.71569 2.40973 9.09202 2.21799C9.51984 2 10.0799 2 11.2 2H18.8C19.9201 2 20.4802 2 20.908 2.21799C21.2843 2.40973 21.5903 2.71569 21.782 3.09202C22 3.51984 22 4.0799 22 5.2V12.8C22 13.9201 22 14.4802 21.782 14.908C21.5903 15.2843 21.2843 15.5903 20.908 15.782C20.4802 16 19.9201 16 18.8 16H16M5.2 22H12.8C13.9201 22 14.4802 22 14.908 21.782C15.2843 21.5903 15.5903 21.2843 15.782 20.908C16 20.4802 16 19.9201 16 18.8V11.2C16 10.0799 16 9.51984 15.782 9.09202C15.5903 8.71569 15.2843 8.40973 14.908 8.21799C14.4802 8 13.9201 8 12.8 8H5.2C4.0799 8 3.51984 8 3.09202 8.21799C2.71569 8.40973 2.40973 8.71569 2.21799 9.09202C2 9.51984 2 10.0799 2 11.2V18.8C2 19.9201 2 20.4802 2.21799 20.908C2.40973 21.2843 2.71569 21.5903 3.09202 21.782C3.51984 22 4.07989 22 5.2 22Z"stroke-width=2 stroke-linecap=round stroke-linejoin=round stroke=currentColor>'),a$=ce('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M2.5 21.4998L8.04927 19.3655C8.40421 19.229 8.58168 19.1607 8.74772 19.0716C8.8952 18.9924 9.0358 18.901 9.16804 18.7984C9.31692 18.6829 9.45137 18.5484 9.72028 18.2795L21 6.99982C22.1046 5.89525 22.1046 4.10438 21 2.99981C19.8955 1.89525 18.1046 1.89524 17 2.99981L5.72028 14.2795C5.45138 14.5484 5.31692 14.6829 5.20139 14.8318C5.09877 14.964 5.0074 15.1046 4.92823 15.2521C4.83911 15.4181 4.77085 15.5956 4.63433 15.9506L2.5 21.4998ZM2.5 21.4998L4.55812 16.1488C4.7054 15.7659 4.77903 15.5744 4.90534 15.4867C5.01572 15.4101 5.1523 15.3811 5.2843 15.4063C5.43533 15.4351 5.58038 15.5802 5.87048 15.8703L8.12957 18.1294C8.41967 18.4195 8.56472 18.5645 8.59356 18.7155C8.61877 18.8475 8.58979 18.9841 8.51314 19.0945C8.42545 19.2208 8.23399 19.2944 7.85107 19.4417L2.5 21.4998Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),sx=ce('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M7.5 12L10.5 15L16.5 9M7.8 21H16.2C17.8802 21 18.7202 21 19.362 20.673C19.9265 20.3854 20.3854 19.9265 20.673 19.362C21 18.7202 21 17.8802 21 16.2V7.8C21 6.11984 21 5.27976 20.673 4.63803C20.3854 4.07354 19.9265 3.6146 19.362 3.32698C18.7202 3 17.8802 3 16.2 3H7.8C6.11984 3 5.27976 3 4.63803 3.32698C4.07354 3.6146 3.6146 4.07354 3.32698 4.63803C3 5.27976 3 6.11984 3 7.8V16.2C3 17.8802 3 18.7202 3.32698 19.362C3.6146 19.9265 4.07354 20.3854 4.63803 20.673C5.27976 21 6.11984 21 7.8 21Z"stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),l$=ce('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M9 9L15 15M15 9L9 15M7.8 21H16.2C17.8802 21 18.7202 21 19.362 20.673C19.9265 20.3854 20.3854 19.9265 20.673 19.362C21 18.7202 21 17.8802 21 16.2V7.8C21 6.11984 21 5.27976 20.673 4.63803C20.3854 4.07354 19.9265 3.6146 19.362 3.32698C18.7202 3 17.8802 3 16.2 3H7.8C6.11984 3 5.27976 3 4.63803 3.32698C4.07354 3.6146 3.6146 4.07354 3.32698 4.63803C3 5.27976 3 6.11984 3 7.8V16.2C3 17.8802 3 18.7202 3.32698 19.362C3.6146 19.9265 4.07354 20.3854 4.63803 20.673C5.27976 21 6.11984 21 7.8 21Z"stroke=#F04438 stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),u$=ce('<svg width=24 height=24 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 xmlns=http://www.w3.org/2000/svg><rect class=list width=20 height=20 y=2 x=2 rx=2></rect><line class=list-item y1=7 y2=7 x1=6 x2=18></line><line class=list-item y2=12 y1=12 x1=6 x2=18></line><line class=list-item y1=17 y2=17 x1=6 x2=18>'),c$=ce('<svg viewBox="0 0 24 24"height=20 width=20 fill=none xmlns=http://www.w3.org/2000/svg><path d="M3 7.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3h8.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C21 5.28 21 6.12 21 7.8v8.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.72 21 17.88 21 16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V7.8Z"stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),d$=ce('<svg width=14 height=14 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M7.5 12L10.5 15L16.5 9M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),f$=ce('<svg width=14 height=14 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M12 2V6M12 18V22M6 12H2M22 12H18M19.0784 19.0784L16.25 16.25M19.0784 4.99994L16.25 7.82837M4.92157 19.0784L7.75 16.25M4.92157 4.99994L7.75 7.82837"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round></path><animateTransform attributeName=transform attributeType=XML type=rotate from=0 to=360 dur=2s repeatCount=indefinite>'),h$=ce('<svg width=14 height=14 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M15 9L9 15M9 9L15 15M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),g$=ce('<svg width=14 height=14 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M9.5 15V9M14.5 15V9M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),y$=ce('<svg version=1.0 viewBox="0 0 633 633"><linearGradient x1=-666.45 x2=-666.45 y1=163.28 y2=163.99 gradientTransform="matrix(633 0 0 633 422177 -103358)"gradientUnits=userSpaceOnUse><stop stop-color=#6BDAFF offset=0></stop><stop stop-color=#F9FFB5 offset=.32></stop><stop stop-color=#FFA770 offset=.71></stop><stop stop-color=#FF7373 offset=1></stop></linearGradient><circle cx=316.5 cy=316.5 r=316.5></circle><defs><filter x=-137.5 y=412 width=454 height=396.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=-137.5 y=412 width=454 height=396.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><ellipse cx=89.5 cy=610.5 rx=214.5 ry=186 fill=#015064 stroke=#00CFE2 stroke-width=25></ellipse></g><defs><filter x=316.5 y=412 width=454 height=396.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=316.5 y=412 width=454 height=396.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><ellipse cx=543.5 cy=610.5 rx=214.5 ry=186 fill=#015064 stroke=#00CFE2 stroke-width=25></ellipse></g><defs><filter x=-137.5 y=450 width=454 height=396.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=-137.5 y=450 width=454 height=396.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><ellipse cx=89.5 cy=648.5 rx=214.5 ry=186 fill=#015064 stroke=#00A8B8 stroke-width=25></ellipse></g><defs><filter x=316.5 y=450 width=454 height=396.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=316.5 y=450 width=454 height=396.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><ellipse cx=543.5 cy=648.5 rx=214.5 ry=186 fill=#015064 stroke=#00A8B8 stroke-width=25></ellipse></g><defs><filter x=-137.5 y=486 width=454 height=396.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=-137.5 y=486 width=454 height=396.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><ellipse cx=89.5 cy=684.5 rx=214.5 ry=186 fill=#015064 stroke=#007782 stroke-width=25></ellipse></g><defs><filter x=316.5 y=486 width=454 height=396.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=316.5 y=486 width=454 height=396.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><ellipse cx=543.5 cy=684.5 rx=214.5 ry=186 fill=#015064 stroke=#007782 stroke-width=25></ellipse></g><defs><filter x=272.2 y=308 width=176.9 height=129.3 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=272.2 y=308 width=176.9 height=129.3 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><line x1=436 x2=431 y1=403.2 y2=431.8 fill=none stroke=#000 stroke-linecap=round stroke-linejoin=bevel stroke-width=11></line><line x1=291 x2=280 y1=341.5 y2=403.5 fill=none stroke=#000 stroke-linecap=round stroke-linejoin=bevel stroke-width=11></line><line x1=332.9 x2=328.6 y1=384.1 y2=411.2 fill=none stroke=#000 stroke-linecap=round stroke-linejoin=bevel stroke-width=11></line><linearGradient x1=-670.75 x2=-671.59 y1=164.4 y2=164.49 gradientTransform="matrix(-184.16 -32.472 -11.461 64.997 -121359 -32126)"gradientUnits=userSpaceOnUse><stop stop-color=#EE2700 offset=0></stop><stop stop-color=#FF008E offset=1></stop></linearGradient><path d="m344.1 363 97.7 17.2c5.8 2.1 8.2 6.1 7.1 12.1s-4.7 9.2-11 9.9l-106-18.7-57.5-59.2c-3.2-4.8-2.9-9.1 0.8-12.8s8.3-4.4 13.7-2.1l55.2 53.6z"clip-rule=evenodd fill-rule=evenodd></path><line x1=428.2 x2=429.1 y1=384.5 y2=378 fill=none stroke=#fff stroke-linecap=round stroke-linejoin=bevel stroke-width=7></line><line x1=395.2 x2=396.1 y1=379.5 y2=373 fill=none stroke=#fff stroke-linecap=round stroke-linejoin=bevel stroke-width=7></line><line x1=362.2 x2=363.1 y1=373.5 y2=367.4 fill=none stroke=#fff stroke-linecap=round stroke-linejoin=bevel stroke-width=7></line><line x1=324.2 x2=328.4 y1=351.3 y2=347.4 fill=none stroke=#fff stroke-linecap=round stroke-linejoin=bevel stroke-width=7></line><line x1=303.2 x2=307.4 y1=331.3 y2=327.4 fill=none stroke=#fff stroke-linecap=round stroke-linejoin=bevel stroke-width=7></line></g><defs><filter x=73.2 y=113.8 width=280.6 height=317.4 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=73.2 y=113.8 width=280.6 height=317.4 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><linearGradient x1=-672.16 x2=-672.16 y1=165.03 y2=166.03 gradientTransform="matrix(-100.18 48.861 97.976 200.88 -83342 -93.059)"gradientUnits=userSpaceOnUse><stop stop-color=#A17500 offset=0></stop><stop stop-color=#5D2100 offset=1></stop></linearGradient><path d="m192.3 203c8.1 37.3 14 73.6 17.8 109.1 3.8 35.4 2.8 75.1-3 119.2l61.2-16.7c-15.6-59-25.2-97.9-28.6-116.6s-10.8-51.9-22.1-99.6l-25.3 4.6"clip-rule=evenodd fill-rule=evenodd></path><g stroke=#2F8A00><linearGradient x1=-660.23 x2=-660.23 y1=166.72 y2=167.72 gradientTransform="matrix(92.683 4.8573 -2.0259 38.657 61680 -3088.6)"gradientUnits=userSpaceOnUse><stop stop-color=#2F8A00 offset=0></stop><stop stop-color=#90FF57 offset=1></stop></linearGradient><path d="m195 183.9s-12.6-22.1-36.5-29.9c-15.9-5.2-34.4-1.5-55.5 11.1 15.9 14.3 29.5 22.6 40.7 24.9 16.8 3.6 51.3-6.1 51.3-6.1z"clip-rule=evenodd fill-rule=evenodd stroke-width=13></path><linearGradient x1=-661.36 x2=-661.36 y1=164.18 y2=165.18 gradientTransform="matrix(110 5.7648 -6.3599 121.35 73933 -15933)"gradientUnits=userSpaceOnUse><stop stop-color=#2F8A00 offset=0></stop><stop stop-color=#90FF57 offset=1></stop></linearGradient><path d="m194.9 184.5s-47.5-8.5-83.2 15.7c-23.8 16.2-34.3 49.3-31.6 99.4 30.3-27.8 52.1-48.5 65.2-61.9 19.8-20.2 49.6-53.2 49.6-53.2z"clip-rule=evenodd fill-rule=evenodd stroke-width=13></path><linearGradient x1=-656.79 x2=-656.79 y1=165.15 y2=166.15 gradientTransform="matrix(62.954 3.2993 -3.5023 66.828 42156 -8754.1)"gradientUnits=userSpaceOnUse><stop stop-color=#2F8A00 offset=0></stop><stop stop-color=#90FF57 offset=1></stop></linearGradient><path d="m195 183.9c-0.8-21.9 6-38 20.6-48.2s29.8-15.4 45.5-15.3c-6.1 21.4-14.5 35.8-25.2 43.4s-24.4 14.2-40.9 20.1z"clip-rule=evenodd fill-rule=evenodd stroke-width=13></path><linearGradient x1=-663.07 x2=-663.07 y1=165.44 y2=166.44 gradientTransform="matrix(152.47 7.9907 -3.0936 59.029 101884 -4318.7)"gradientUnits=userSpaceOnUse><stop stop-color=#2F8A00 offset=0></stop><stop stop-color=#90FF57 offset=1></stop></linearGradient><path d="m194.9 184.5c31.9-30 64.1-39.7 96.7-29s50.8 30.4 54.6 59.1c-35.2-5.5-60.4-9.6-75.8-12.1-15.3-2.6-40.5-8.6-75.5-18z"clip-rule=evenodd fill-rule=evenodd stroke-width=13></path><linearGradient x1=-662.57 x2=-662.57 y1=164.44 y2=165.44 gradientTransform="matrix(136.46 7.1517 -5.2163 99.533 91536 -11442)"gradientUnits=userSpaceOnUse><stop stop-color=#2F8A00 offset=0></stop><stop stop-color=#90FF57 offset=1></stop></linearGradient><path d="m194.9 184.5c35.8-7.6 65.6-0.2 89.2 22s37.7 49 42.3 80.3c-39.8-9.7-68.3-23.8-85.5-42.4s-32.5-38.5-46-59.9z"clip-rule=evenodd fill-rule=evenodd stroke-width=13></path><linearGradient x1=-656.43 x2=-656.43 y1=163.86 y2=164.86 gradientTransform="matrix(60.866 3.1899 -8.7773 167.48 41560 -25168)"gradientUnits=userSpaceOnUse><stop stop-color=#2F8A00 offset=0></stop><stop stop-color=#90FF57 offset=1></stop></linearGradient><path d="m194.9 184.5c-33.6 13.8-53.6 35.7-60.1 65.6s-3.6 63.1 8.7 99.6c27.4-40.3 43.2-69.6 47.4-88s5.6-44.1 4-77.2z"clip-rule=evenodd fill-rule=evenodd stroke-width=13></path><path d="m196.5 182.3c-14.8 21.6-25.1 41.4-30.8 59.4s-9.5 33-11.1 45.1"fill=none stroke-linecap=round stroke-width=8></path><path d="m194.9 185.7c-24.4 1.7-43.8 9-58.1 21.8s-24.7 25.4-31.3 37.8"fill=none stroke-linecap=round stroke-width=8></path><path d="m204.5 176.4c29.7-6.7 52-8.4 67-5.1s26.9 8.6 35.8 15.9"fill=none stroke-linecap=round stroke-width=8></path><path d="m196.5 181.4c20.3 9.9 38.2 20.5 53.9 31.9s27.4 22.1 35.1 32"fill=none stroke-linecap=round stroke-width=8></path></g></g><defs><filter x=50.5 y=399 width=532 height=633 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=50.5 y=399 width=532 height=633 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><linearGradient x1=-666.06 x2=-666.23 y1=163.36 y2=163.75 gradientTransform="matrix(532 0 0 633 354760 -102959)"gradientUnits=userSpaceOnUse><stop stop-color=#FFF400 offset=0></stop><stop stop-color=#3C8700 offset=1></stop></linearGradient><ellipse cx=316.5 cy=715.5 rx=266 ry=316.5></ellipse></g><defs><filter x=391 y=-24 width=288 height=283 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=391 y=-24 width=288 height=283 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><linearGradient x1=-664.56 x2=-664.56 y1=163.79 y2=164.79 gradientTransform="matrix(227 0 0 227 151421 -37204)"gradientUnits=userSpaceOnUse><stop stop-color=#FFDF00 offset=0></stop><stop stop-color=#FF9D00 offset=1></stop></linearGradient><circle cx=565.5 cy=89.5 r=113.5></circle><linearGradient x1=-644.5 x2=-645.77 y1=342 y2=342 gradientTransform="matrix(30 0 0 1 19770 -253)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=427 x2=397 y1=89 y2=89 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=-641.56 x2=-642.83 y1=196.02 y2=196.07 gradientTransform="matrix(26.5 0 0 5.5 17439 -1025.5)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=430.5 x2=404 y1=55.5 y2=50 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=-643.73 x2=-645 y1=185.83 y2=185.9 gradientTransform="matrix(29 0 0 8 19107 -1361)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=431 x2=402 y1=122 y2=130 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=-638.94 x2=-640.22 y1=177.09 y2=177.39 gradientTransform="matrix(24 0 0 13 15783 -2145)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=442 x2=418 y1=153 y2=166 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=-633.42 x2=-634.7 y1=172.41 y2=173.31 gradientTransform="matrix(20 0 0 19 13137 -3096)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=464 x2=444 y1=180 y2=199 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=-619.05 x2=-619.52 y1=170.82 y2=171.82 gradientTransform="matrix(13.83 0 0 22.85 9050 -3703.4)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=491.4 x2=477.5 y1=203 y2=225.9 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=-578.5 x2=-578.63 y1=170.31 y2=171.31 gradientTransform="matrix(7.5 0 0 24.5 4860 -3953)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=524.5 x2=517 y1=219.5 y2=244 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=666.5 x2=666.5 y1=170.31 y2=171.31 gradientTransform="matrix(.5 0 0 24.5 231.5 -3944)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=564.5 x2=565 y1=228.5 y2=253 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12>');function m$(){return QM()}function ox(){return YM()}function Jo(){return XM()}function $m(){return ZM()}function Lm(){return Eh()}function p$(){return(()=>{var e=Eh();return e.style.setProperty("transform","rotate(90deg)"),e})()}function v$(){return(()=>{var e=Eh();return e.style.setProperty("transform","rotate(-90deg)"),e})()}function b$(){return JM()}function x$(){return e$()}function w$(){return t$()}function S$(){return n$()}function C$(){return r$()}function _$(){return i$()}function k$(){return s$()}function O$(){return o$()}function E$(){return a$()}function A$(e){return(()=>{var t=sx(),n=t.firstChild;return we(()=>re(n,"stroke",e.theme==="dark"?"#12B76A":"#027A48")),t})()}function T$(){return l$()}function P$(){return u$()}function j$(e){return[L(xe,{get when(){return e.checked},get children(){var t=sx(),n=t.firstChild;return we(()=>re(n,"stroke",e.theme==="dark"?"#9B8AFB":"#6938EF")),t}}),L(xe,{get when(){return!e.checked},get children(){var t=c$(),n=t.firstChild;return we(()=>re(n,"stroke",e.theme==="dark"?"#9B8AFB":"#6938EF")),t}})]}function M$(){return d$()}function $$(){return f$()}function L$(){return h$()}function D$(){return g$()}function Dm(){const e=Ln();return(()=>{var t=y$(),n=t.firstChild,r=n.nextSibling,i=r.nextSibling,s=i.firstChild,o=i.nextSibling,a=o.firstChild,l=o.nextSibling,u=l.nextSibling,c=u.firstChild,d=u.nextSibling,f=d.firstChild,h=d.nextSibling,y=h.nextSibling,m=y.firstChild,p=y.nextSibling,v=p.firstChild,b=p.nextSibling,S=b.nextSibling,C=S.firstChild,x=S.nextSibling,k=x.firstChild,w=x.nextSibling,_=w.nextSibling,O=_.firstChild,A=_.nextSibling,T=A.firstChild,j=A.nextSibling,B=j.nextSibling,R=B.firstChild,P=B.nextSibling,M=P.firstChild,I=P.nextSibling,G=I.nextSibling,Y=G.firstChild,q=G.nextSibling,U=q.firstChild,z=q.nextSibling,V=z.firstChild,N=V.nextSibling,ne=N.nextSibling,J=ne.nextSibling,he=J.nextSibling,X=z.nextSibling,ge=X.firstChild,ye=X.nextSibling,je=ye.firstChild,se=ye.nextSibling,nt=se.firstChild,Ie=nt.nextSibling,st=Ie.nextSibling,ze=st.firstChild,Ke=ze.nextSibling,ee=Ke.nextSibling,$e=ee.nextSibling,ot=$e.nextSibling,Ne=ot.nextSibling,Le=Ne.nextSibling,de=Le.nextSibling,me=de.nextSibling,fe=me.nextSibling,Fe=fe.nextSibling,Zt=Fe.nextSibling,It=se.nextSibling,Jt=It.firstChild,en=It.nextSibling,Ae=en.firstChild,Ve=en.nextSibling,oe=Ve.firstChild,pe=oe.nextSibling,Oe=Ve.nextSibling,Ee=Oe.firstChild,He=Oe.nextSibling,Et=He.firstChild,tn=He.nextSibling,mi=tn.firstChild,yo=mi.nextSibling,rs=yo.nextSibling,jh=rs.nextSibling,Mh=jh.nextSibling,$h=Mh.nextSibling,Lh=$h.nextSibling,Dh=Lh.nextSibling,Ih=Dh.nextSibling,Rh=Ih.nextSibling,Nh=Rh.nextSibling,Fh=Nh.nextSibling,Bh=Fh.nextSibling,qh=Bh.nextSibling,zh=qh.nextSibling,Hh=zh.nextSibling,Uh=Hh.nextSibling,xx=Uh.nextSibling;return re(n,"id",`a-${e}`),re(r,"fill",`url(#a-${e})`),re(s,"id",`am-${e}`),re(o,"id",`b-${e}`),re(a,"filter",`url(#am-${e})`),re(l,"mask",`url(#b-${e})`),re(c,"id",`ah-${e}`),re(d,"id",`k-${e}`),re(f,"filter",`url(#ah-${e})`),re(h,"mask",`url(#k-${e})`),re(m,"id",`ae-${e}`),re(p,"id",`j-${e}`),re(v,"filter",`url(#ae-${e})`),re(b,"mask",`url(#j-${e})`),re(C,"id",`ai-${e}`),re(x,"id",`i-${e}`),re(k,"filter",`url(#ai-${e})`),re(w,"mask",`url(#i-${e})`),re(O,"id",`aj-${e}`),re(A,"id",`h-${e}`),re(T,"filter",`url(#aj-${e})`),re(j,"mask",`url(#h-${e})`),re(R,"id",`ag-${e}`),re(P,"id",`g-${e}`),re(M,"filter",`url(#ag-${e})`),re(I,"mask",`url(#g-${e})`),re(Y,"id",`af-${e}`),re(q,"id",`f-${e}`),re(U,"filter",`url(#af-${e})`),re(z,"mask",`url(#f-${e})`),re(J,"id",`m-${e}`),re(he,"fill",`url(#m-${e})`),re(ge,"id",`ak-${e}`),re(ye,"id",`e-${e}`),re(je,"filter",`url(#ak-${e})`),re(se,"mask",`url(#e-${e})`),re(nt,"id",`n-${e}`),re(Ie,"fill",`url(#n-${e})`),re(ze,"id",`r-${e}`),re(Ke,"fill",`url(#r-${e})`),re(ee,"id",`s-${e}`),re($e,"fill",`url(#s-${e})`),re(ot,"id",`q-${e}`),re(Ne,"fill",`url(#q-${e})`),re(Le,"id",`p-${e}`),re(de,"fill",`url(#p-${e})`),re(me,"id",`o-${e}`),re(fe,"fill",`url(#o-${e})`),re(Fe,"id",`l-${e}`),re(Zt,"fill",`url(#l-${e})`),re(Jt,"id",`al-${e}`),re(en,"id",`d-${e}`),re(Ae,"filter",`url(#al-${e})`),re(Ve,"mask",`url(#d-${e})`),re(oe,"id",`u-${e}`),re(pe,"fill",`url(#u-${e})`),re(Ee,"id",`ad-${e}`),re(He,"id",`c-${e}`),re(Et,"filter",`url(#ad-${e})`),re(tn,"mask",`url(#c-${e})`),re(mi,"id",`t-${e}`),re(yo,"fill",`url(#t-${e})`),re(rs,"id",`v-${e}`),re(jh,"stroke",`url(#v-${e})`),re(Mh,"id",`aa-${e}`),re($h,"stroke",`url(#aa-${e})`),re(Lh,"id",`w-${e}`),re(Dh,"stroke",`url(#w-${e})`),re(Ih,"id",`ac-${e}`),re(Rh,"stroke",`url(#ac-${e})`),re(Nh,"id",`ab-${e}`),re(Fh,"stroke",`url(#ab-${e})`),re(Bh,"id",`y-${e}`),re(qh,"stroke",`url(#y-${e})`),re(zh,"id",`x-${e}`),re(Hh,"stroke",`url(#x-${e})`),re(Uh,"id",`z-${e}`),re(xx,"stroke",`url(#z-${e})`),t})()}var I$=ce('<span><svg width=16 height=16 viewBox="0 0 16 16"fill=none xmlns=http://www.w3.org/2000/svg><path d="M6 12L10 8L6 4"stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),R$=ce('<button title="Copy object to clipboard">'),N$=ce('<button title="Remove all items"aria-label="Remove all items">'),F$=ce('<button title="Delete item"aria-label="Delete item">'),B$=ce('<button title="Toggle value"aria-label="Toggle value">'),q$=ce('<button title="Bulk Edit Data"aria-label="Bulk Edit Data">'),jo=ce("<div>"),z$=ce("<div><button> <span></span> <span> "),H$=ce("<input>"),Im=ce("<span>"),U$=ce("<div><span>:"),G$=ce("<div><div><button> [<!>...<!>]");function K$(e,t){let n=0;const r=[];for(;n<e.length;)r.push(e.slice(n,n+t)),n=n+t;return r}var Rm=e=>{const t=Ct(),n=ve().shadowDOMTarget?Re.bind({target:ve().shadowDOMTarget}):Re,r=K(()=>t()==="dark"?go(n):ho(n));return(()=>{var i=I$();return we(()=>ie(i,ue(r().expander,n`
|
|
73
73
|
transform: rotate(${e.expanded?90:0}deg);
|
|
74
74
|
`,e.expanded&&n`
|
|
75
75
|
& svg {
|
|
@@ -246,7 +246,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
246
246
|
`,Bn()<Wi&&!(gn()||ii())&&r`
|
|
247
247
|
height: 100%;
|
|
248
248
|
max-height: 100%;
|
|
249
|
-
`,"tsqd-queries-container"),J=ue(i().row,"tsqd-header"),he=i().logoAndToggleContainer,X=ue(i().logo,"tsqd-text-logo-container"),ge=ue(i().tanstackLogo,"tsqd-text-logo-tanstack"),ye=ue(i().queryFlavorLogo,"tsqd-text-logo-query-flavor"),je=ue(i().row,"tsqd-filters-actions-container"),se=ue(i().filtersContainer,"tsqd-filters-container"),nt=ue(i().filterInput,"tsqd-query-filter-textfield-container"),Ie=ue("tsqd-query-filter-textfield"),st=ue(i().filterSelect,"tsqd-query-filter-sort-container"),ze=`Sort order ${(o()==="queries"?u():d())===-1?"descending":"ascending"}`,
|
|
249
|
+
`,"tsqd-queries-container"),J=ue(i().row,"tsqd-header"),he=i().logoAndToggleContainer,X=ue(i().logo,"tsqd-text-logo-container"),ge=ue(i().tanstackLogo,"tsqd-text-logo-tanstack"),ye=ue(i().queryFlavorLogo,"tsqd-text-logo-query-flavor"),je=ue(i().row,"tsqd-filters-actions-container"),se=ue(i().filtersContainer,"tsqd-filters-container"),nt=ue(i().filterInput,"tsqd-query-filter-textfield-container"),Ie=ue("tsqd-query-filter-textfield"),st=ue(i().filterSelect,"tsqd-query-filter-sort-container"),ze=`Sort order ${(o()==="queries"?u():d())===-1?"descending":"ascending"}`,Ke=(o()==="queries"?u():d())===-1,ee=ue(i().actionsContainer,"tsqd-actions-container"),$e=ue(i().actionsBtn,"tsqd-actions-btn","tsqd-action-clear-cache"),ot=`Clear ${o()} cache`,Ne=ue(i().actionsBtn,Mo()&&i().actionsBtnOffline,"tsqd-actions-btn","tsqd-action-mock-offline-behavior"),Le=`${Mo()?"Unset offline mocking behavior":"Mock offline behavior"}`,de=Mo(),me=`${Mo()?"Unset offline mocking behavior":"Mock offline behavior"}`;return ne!==N.e&&ie(w,N.e=ne),J!==N.t&&ie(_,N.t=J),he!==N.a&&ie(O,N.a=he),X!==N.o&&ie(A,N.o=X),ge!==N.i&&ie(T,N.i=ge),ye!==N.n&&ie(j,N.n=ye),je!==N.s&&ie(R,N.s=je),se!==N.h&&ie(P,N.h=se),nt!==N.r&&ie(M,N.r=nt),Ie!==N.d&&ie(I,N.d=Ie),st!==N.l&&ie(G,N.l=st),ze!==N.u&&re(Y,"aria-label",N.u=ze),Ke!==N.c&&re(Y,"aria-pressed",N.c=Ke),ee!==N.w&&ie(q,N.w=ee),$e!==N.m&&ie(U,N.m=$e),ot!==N.f&&re(U,"title",N.f=ot),Ne!==N.y&&ie(z,N.y=Ne),Le!==N.g&&re(z,"aria-label",N.g=Le),de!==N.p&&re(z,"aria-pressed",N.p=de),me!==N.b&&re(z,"title",N.b=me),N},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0,l:void 0,u:void 0,c:void 0,w:void 0,m:void 0,f:void 0,y:void 0,g:void 0,p:void 0,b:void 0}),we(()=>I.value=o()==="queries"?e.localStore.filter||"":e.localStore.mutationFilter||""),w})(),L(xe,{get when(){return K(()=>o()==="queries")()&&gn()},get children(){return L(RL,{})}}),L(xe,{get when(){return K(()=>o()==="mutations")()&&ii()},get children(){return L(NL,{})}})]},$L=e=>{const t=Ct(),n=ve().shadowDOMTarget?Re.bind({target:ve().shadowDOMTarget}):Re,r=K(()=>t()==="dark"?In(n):Dn(n)),{colors:i,alpha:s}=W,o=(y,m)=>t()==="dark"?m:y,a=xt(y=>{var m;return(m=y().find({queryKey:e.query.queryKey}))==null?void 0:m.state},!0,y=>y.query.queryHash===e.query.queryHash),l=xt(y=>{var m,p;return(p=(m=y().find({queryKey:e.query.queryKey}))==null?void 0:m.isDisabled())!=null?p:!1},!0,y=>y.query.queryHash===e.query.queryHash),u=xt(y=>{var m,p;return(p=(m=y().find({queryKey:e.query.queryKey}))==null?void 0:m.isStatic())!=null?p:!1},!0,y=>y.query.queryHash===e.query.queryHash),c=xt(y=>{var m,p;return(p=(m=y().find({queryKey:e.query.queryKey}))==null?void 0:m.isStale())!=null?p:!1},!0,y=>y.query.queryHash===e.query.queryHash),d=xt(y=>{var m,p;return(p=(m=y().find({queryKey:e.query.queryKey}))==null?void 0:m.getObserversCount())!=null?p:0},!0,y=>y.query.queryHash===e.query.queryHash),f=K(()=>KS({queryState:a(),observerCount:d(),isStale:c()})),h=()=>f()==="gray"?n`
|
|
250
250
|
background-color: ${o(i[f()][200],i[f()][700])};
|
|
251
251
|
color: ${o(i[f()][700],i[f()][300])};
|
|
252
252
|
`:n`
|
|
@@ -279,17 +279,17 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
279
279
|
background-color: ${i(r[C()][100],r[C()][900])};
|
|
280
280
|
color: ${i(r[C()][700],r[C()][300])};
|
|
281
281
|
border-color: ${i(r[C()][400],r[C()][600])};
|
|
282
|
-
`;return L(xe,{get when(){return K(()=>!!h())()&&m()},get children(){var O=kL(),A=O.firstChild,T=A.nextSibling,j=T.firstChild,B=j.firstChild,R=B.firstChild,P=B.nextSibling,M=j.nextSibling,I=M.firstChild,G=I.nextSibling,Y=M.nextSibling,q=Y.firstChild,U=q.nextSibling,z=T.nextSibling,V=z.nextSibling,N=V.firstChild,ne=N.firstChild,J=N.nextSibling,he=J.firstChild,X=J.nextSibling,ge=X.firstChild,ye=X.nextSibling,je=ye.firstChild,se=ye.nextSibling,nt=se.firstChild,Ie=nt.nextSibling,st=V.nextSibling;st.firstChild;var ze=st.nextSibling,
|
|
282
|
+
`;return L(xe,{get when(){return K(()=>!!h())()&&m()},get children(){var O=kL(),A=O.firstChild,T=A.nextSibling,j=T.firstChild,B=j.firstChild,R=B.firstChild,P=B.nextSibling,M=j.nextSibling,I=M.firstChild,G=I.nextSibling,Y=M.nextSibling,q=Y.firstChild,U=q.nextSibling,z=T.nextSibling,V=z.nextSibling,N=V.firstChild,ne=N.firstChild,J=N.nextSibling,he=J.firstChild,X=J.nextSibling,ge=X.firstChild,ye=X.nextSibling,je=ye.firstChild,se=ye.nextSibling,nt=se.firstChild,Ie=nt.nextSibling,st=V.nextSibling;st.firstChild;var ze=st.nextSibling,Ke=ze.nextSibling;return Q(R,()=>nu(h().queryKey,!0)),Q(P,v),Q(G,S),Q(U,()=>new Date(m().dataUpdatedAt).toLocaleTimeString()),N.$$click=x,J.$$click=()=>{var ee;Jn({type:"INVALIDATE",queryHash:(ee=h())==null?void 0:ee.queryHash}),s.invalidateQueries(h())},X.$$click=()=>{var ee;Jn({type:"RESET",queryHash:(ee=h())==null?void 0:ee.queryHash}),s.resetQueries(h())},ye.$$click=()=>{var ee;Jn({type:"REMOVE",queryHash:(ee=h())==null?void 0:ee.queryHash}),s.removeQueries(h()),dc(null)},se.$$click=()=>{var ee;if(((ee=h())==null?void 0:ee.state.data)===void 0)a(!0),w();else{const $e=h();if(!$e)return;Jn({type:"TRIGGER_LOADING",queryHash:$e.queryHash});const ot=$e.options;$e.fetch({...ot,queryFn:()=>new Promise(()=>{}),gcTime:-1}),$e.setState({data:void 0,status:"pending",fetchMeta:{...$e.state.fetchMeta,__previousQueryOptions:ot}})}},Q(se,()=>b()==="pending"?"Restore":"Trigger",Ie),Q(V,L(xe,{get when(){return f().length===0||b()==="error"},get children(){var ee=wL(),$e=ee.firstChild,ot=$e.nextSibling;return ee.$$click=()=>{var Ne;h().state.error?(Jn({type:"RESTORE_ERROR",queryHash:(Ne=h())==null?void 0:Ne.queryHash}),s.resetQueries(h())):k()},Q(ee,()=>b()==="error"?"Restore":"Trigger",ot),we(Ne=>{var Le=ue(t`
|
|
283
283
|
color: ${i(r.red[500],r.red[400])};
|
|
284
284
|
`,"tsqd-query-details-actions-btn","tsqd-query-details-action-error"),de=b()==="pending",me=t`
|
|
285
285
|
background-color: ${i(r.red[500],r.red[400])};
|
|
286
286
|
`;return Le!==Ne.e&&ie(ee,Ne.e=Le),de!==Ne.t&&(ee.disabled=Ne.t=de),me!==Ne.a&&ie($e,Ne.a=me),Ne},{e:void 0,t:void 0,a:void 0}),ee}}),null),Q(V,L(xe,{get when(){return!(f().length===0||b()==="error")},get children(){var ee=SL(),$e=ee.firstChild,ot=$e.nextSibling,Ne=ot.nextSibling;return Ne.firstChild,Ne.addEventListener("change",Le=>{const de=f().find(me=>me.name===Le.currentTarget.value);k(de)}),Q(Ne,L(U3,{get each(){return f()},children:Le=>(()=>{var de=OL();return Q(de,()=>Le.name),we(()=>de.value=Le.name),de})()}),null),Q(ee,L(Jo,{}),null),we(Le=>{var de=ue(n().actionsSelect,"tsqd-query-details-actions-btn","tsqd-query-details-action-error-multiple"),me=t`
|
|
287
287
|
background-color: ${W.colors.red[400]};
|
|
288
|
-
`,fe=b()==="pending";return de!==Le.e&&ie(ee,Le.e=de),me!==Le.t&&ie($e,Le.t=me),fe!==Le.a&&(Ne.disabled=Le.a=fe),Le},{e:void 0,t:void 0,a:void 0}),ee}}),null),Q(st,()=>l()==="view"?"Explorer":"Editor",null),Q(O,L(xe,{get when(){return l()==="view"},get children(){var ee=CL();return Q(ee,L(ti,{label:"Data",defaultExpanded:["Data"],get value(){return p()},editable:!0,onEdit:()=>u("edit"),get activeQuery(){return h()}})),we($e=>($e=W.size[2])!=null?ee.style.setProperty("padding",$e):ee.style.removeProperty("padding")),ee}}),ze),Q(O,L(xe,{get when(){return l()==="edit"},get children(){var ee=_L(),$e=ee.firstChild,ot=$e.nextSibling,Ne=ot.firstChild,Le=Ne.nextSibling,de=Le.firstChild,me=de.nextSibling;return ee.addEventListener("submit",fe=>{fe.preventDefault();const Zt=new FormData(fe.currentTarget).get("data");try{const It=JSON.parse(Zt);h().setState({...h().state,data:It}),u("view")}catch(It){d(!0)}}),$e.addEventListener("focus",()=>d(!1)),Q(Ne,()=>c()?"Invalid Value":""),de.$$click=()=>u("view"),we(fe=>{var Fe=ue(n().devtoolsEditForm,"tsqd-query-details-data-editor"),Zt=n().devtoolsEditTextarea,It=c(),Jt=n().devtoolsEditFormActions,en=n().devtoolsEditFormError,Ae=n().devtoolsEditFormActionContainer,
|
|
288
|
+
`,fe=b()==="pending";return de!==Le.e&&ie(ee,Le.e=de),me!==Le.t&&ie($e,Le.t=me),fe!==Le.a&&(Ne.disabled=Le.a=fe),Le},{e:void 0,t:void 0,a:void 0}),ee}}),null),Q(st,()=>l()==="view"?"Explorer":"Editor",null),Q(O,L(xe,{get when(){return l()==="view"},get children(){var ee=CL();return Q(ee,L(ti,{label:"Data",defaultExpanded:["Data"],get value(){return p()},editable:!0,onEdit:()=>u("edit"),get activeQuery(){return h()}})),we($e=>($e=W.size[2])!=null?ee.style.setProperty("padding",$e):ee.style.removeProperty("padding")),ee}}),ze),Q(O,L(xe,{get when(){return l()==="edit"},get children(){var ee=_L(),$e=ee.firstChild,ot=$e.nextSibling,Ne=ot.firstChild,Le=Ne.nextSibling,de=Le.firstChild,me=de.nextSibling;return ee.addEventListener("submit",fe=>{fe.preventDefault();const Zt=new FormData(fe.currentTarget).get("data");try{const It=JSON.parse(Zt);h().setState({...h().state,data:It}),u("view")}catch(It){d(!0)}}),$e.addEventListener("focus",()=>d(!1)),Q(Ne,()=>c()?"Invalid Value":""),de.$$click=()=>u("view"),we(fe=>{var Fe=ue(n().devtoolsEditForm,"tsqd-query-details-data-editor"),Zt=n().devtoolsEditTextarea,It=c(),Jt=n().devtoolsEditFormActions,en=n().devtoolsEditFormError,Ae=n().devtoolsEditFormActionContainer,Ve=ue(n().devtoolsEditFormAction,t`
|
|
289
289
|
color: ${i(r.gray[600],r.gray[300])};
|
|
290
290
|
`),oe=ue(n().devtoolsEditFormAction,t`
|
|
291
291
|
color: ${i(r.blue[600],r.blue[400])};
|
|
292
|
-
`);return Fe!==fe.e&&ie(ee,fe.e=Fe),Zt!==fe.t&&ie($e,fe.t=Zt),It!==fe.a&&re($e,"data-error",fe.a=It),Jt!==fe.o&&ie(ot,fe.o=Jt),en!==fe.i&&ie(Ne,fe.i=en),Ae!==fe.n&&ie(Le,fe.n=Ae),
|
|
292
|
+
`);return Fe!==fe.e&&ie(ee,fe.e=Fe),Zt!==fe.t&&ie($e,fe.t=Zt),It!==fe.a&&re($e,"data-error",fe.a=It),Jt!==fe.o&&ie(ot,fe.o=Jt),en!==fe.i&&ie(Ne,fe.i=en),Ae!==fe.n&&ie(Le,fe.n=Ae),Ve!==fe.s&&ie(de,fe.s=Ve),oe!==fe.h&&ie(me,fe.h=oe),fe},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0}),we(()=>$e.value=JSON.stringify(p(),null,2)),ee}}),ze),Q(Ke,L(ti,{label:"Query",defaultExpanded:["Query","queryKey"],get value(){return y()}})),we(ee=>{var $e=ue(n().detailsContainer,"tsqd-query-details-container"),ot=ue(n().detailsHeader,"tsqd-query-details-header"),Ne=ue(n().detailsBody,"tsqd-query-details-summary-container"),Le=ue(n().queryDetailsStatus,_()),de=ue(n().detailsHeader,"tsqd-query-details-header"),me=ue(n().actionsBody,"tsqd-query-details-actions-container"),fe=ue(t`
|
|
293
293
|
color: ${i(r.blue[600],r.blue[400])};
|
|
294
294
|
`,"tsqd-query-details-actions-btn","tsqd-query-details-action-refetch"),Fe=v()==="fetching",Zt=t`
|
|
295
295
|
background-color: ${i(r.blue[600],r.blue[400])};
|
|
@@ -299,7 +299,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
299
299
|
background-color: ${i(r.yellow[600],r.yellow[400])};
|
|
300
300
|
`,Ae=ue(t`
|
|
301
301
|
color: ${i(r.gray[600],r.gray[300])};
|
|
302
|
-
`,"tsqd-query-details-actions-btn","tsqd-query-details-action-reset"),
|
|
302
|
+
`,"tsqd-query-details-actions-btn","tsqd-query-details-action-reset"),Ve=b()==="pending",oe=t`
|
|
303
303
|
background-color: ${i(r.gray[600],r.gray[400])};
|
|
304
304
|
`,pe=ue(t`
|
|
305
305
|
color: ${i(r.pink[500],r.pink[400])};
|
|
@@ -309,7 +309,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
309
309
|
color: ${i(r.cyan[500],r.cyan[400])};
|
|
310
310
|
`,"tsqd-query-details-actions-btn","tsqd-query-details-action-loading"),Et=o(),tn=t`
|
|
311
311
|
background-color: ${i(r.cyan[500],r.cyan[400])};
|
|
312
|
-
`,mi=ue(n().detailsHeader,"tsqd-query-details-header"),yo=ue(n().detailsHeader,"tsqd-query-details-header"),rs=W.size[2];return $e!==ee.e&&ie(O,ee.e=$e),ot!==ee.t&&ie(A,ee.t=ot),Ne!==ee.a&&ie(T,ee.a=Ne),Le!==ee.o&&ie(P,ee.o=Le),de!==ee.i&&ie(z,ee.i=de),me!==ee.n&&ie(V,ee.n=me),fe!==ee.s&&ie(N,ee.s=fe),Fe!==ee.h&&(N.disabled=ee.h=Fe),Zt!==ee.r&&ie(ne,ee.r=Zt),It!==ee.d&&ie(J,ee.d=It),Jt!==ee.l&&(J.disabled=ee.l=Jt),en!==ee.u&&ie(he,ee.u=en),Ae!==ee.c&&ie(X,ee.c=Ae),
|
|
312
|
+
`,mi=ue(n().detailsHeader,"tsqd-query-details-header"),yo=ue(n().detailsHeader,"tsqd-query-details-header"),rs=W.size[2];return $e!==ee.e&&ie(O,ee.e=$e),ot!==ee.t&&ie(A,ee.t=ot),Ne!==ee.a&&ie(T,ee.a=Ne),Le!==ee.o&&ie(P,ee.o=Le),de!==ee.i&&ie(z,ee.i=de),me!==ee.n&&ie(V,ee.n=me),fe!==ee.s&&ie(N,ee.s=fe),Fe!==ee.h&&(N.disabled=ee.h=Fe),Zt!==ee.r&&ie(ne,ee.r=Zt),It!==ee.d&&ie(J,ee.d=It),Jt!==ee.l&&(J.disabled=ee.l=Jt),en!==ee.u&&ie(he,ee.u=en),Ae!==ee.c&&ie(X,ee.c=Ae),Ve!==ee.w&&(X.disabled=ee.w=Ve),oe!==ee.m&&ie(ge,ee.m=oe),pe!==ee.f&&ie(ye,ee.f=pe),Oe!==ee.y&&(ye.disabled=ee.y=Oe),Ee!==ee.g&&ie(je,ee.g=Ee),He!==ee.p&&ie(se,ee.p=He),Et!==ee.b&&(se.disabled=ee.b=Et),tn!==ee.T&&ie(nt,ee.T=tn),mi!==ee.A&&ie(st,ee.A=mi),yo!==ee.O&&ie(ze,ee.O=yo),rs!==ee.I&&((ee.I=rs)!=null?Ke.style.setProperty("padding",rs):Ke.style.removeProperty("padding")),ee},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0,l:void 0,u:void 0,c:void 0,w:void 0,m:void 0,f:void 0,y:void 0,g:void 0,p:void 0,b:void 0,T:void 0,A:void 0,O:void 0,I:void 0}),O}})},NL=()=>{const e=Ct(),t=ve().shadowDOMTarget?Re.bind({target:ve().shadowDOMTarget}):Re,n=K(()=>e()==="dark"?In(t):Dn(t)),{colors:r}=W,i=(c,d)=>e()==="dark"?d:c,s=Fn(c=>{const f=c().getAll().find(h=>h.mutationId===ii());return f?f.state.isPaused:!1}),o=Fn(c=>{const f=c().getAll().find(h=>h.mutationId===ii());return f?f.state.status:"idle"}),a=K(()=>gs({isPaused:s(),status:o()})),l=Fn(c=>c().getAll().find(d=>d.mutationId===ii()),!1),u=()=>a()==="gray"?t`
|
|
313
313
|
background-color: ${i(r[a()][200],r[a()][700])};
|
|
314
314
|
color: ${i(r[a()][700],r[a()][300])};
|
|
315
315
|
border-color: ${i(r[a()][400],r[a()][600])};
|
|
@@ -1286,7 +1286,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1286
1286
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function QL(e,t){if(e){if(typeof e=="string")return Hm(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Hm(e,t):void 0}}function Hm(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function YL(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,o,a=[],l=!0,u=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(l=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return a}}function XL(e){if(Array.isArray(e))return e}var ZL=function(t){var n=t.isOpen,r=t.onClose,i=t.groupToEdit,s=t.allBrands,o=Gn(),a=o.brandId,l=o.analysisId,u=F.useState(""),c=td(u,2),d=c[0],f=c[1],h=F.useState([]),y=td(h,2),m=y[0],p=y[1],v=F.useState(!1),b=td(v,2),S=b[0],C=b[1],x=Yt();F.useEffect(function(){if(n&&i&&i.type==="group"){var G;f(String(i.name||""));var Y=((G=i.groupedBrands)===null||G===void 0?void 0:G.map(function(q){return String(q.id||"")}))||[];p(Y)}},[n,i]);var k=y2({mutation:{onSuccess:function(){var G=zm(Uo().m(function q(){return Uo().w(function(U){for(;;)switch(U.n){case 0:return U.n=1,Promise.all([x.invalidateQueries({queryKey:su(a)}),x.invalidateQueries({queryKey:Sr(a,"latest")}),x.invalidateQueries({queryKey:ir(a,"latest")}),x.invalidateQueries({queryKey:Sr(a,l)}),x.invalidateQueries({queryKey:ir(a,l)})]);case 1:B();case 2:return U.a(2)}},q)}));function Y(){return G.apply(this,arguments)}return Y}(),onError:function(Y){console.error("Error creating brand group:",Y)}}}),w=k.mutate,_=k.isPending,O=c4({mutation:{onSuccess:function(){var G=zm(Uo().m(function q(){return Uo().w(function(U){for(;;)switch(U.n){case 0:return U.n=1,Promise.all([x.invalidateQueries({queryKey:su(a)}),x.invalidateQueries({queryKey:Sr(a,"latest")}),x.invalidateQueries({queryKey:ir(a,"latest")}),x.invalidateQueries({queryKey:Sr(a,l)}),x.invalidateQueries({queryKey:ir(a,l)})]);case 1:B(),M();case 2:return U.a(2)}},q)}));function Y(){return G.apply(this,arguments)}return Y}(),onError:function(Y){console.error("Error deleting brand group:",Y),window.alert("An error occurred while ungrouping the brands. Please try again later.")}}}),A=O.mutate,T=O.isPending,j=function(){!d.trim()||!(i!=null&&i.id)||w({brandId:a,data:{groupName:d.trim(),brandIds:m.map(function(Y){return Number(Y)})}})},B=function(){f(""),p([]),r()},R=function(){return m.map(function(Y){if(i&&i.type==="group"){var q,U=(q=i.groupedBrands)===null||q===void 0?void 0:q.find(function(V){return String(V.id)===Y});if(U)return U.name||""}var z=s.find(function(V){return String(V.id)===Y});return z?z.type==="group"?"Group: ".concat(z.name):z.name||"":""}).filter(Boolean)},P=function(){C(!0)},M=function(){return C(!1)},I=function(){typeof(i==null?void 0:i.id)=="number"&&A({brandId:a,brandGroupId:i.id})};return!i||i.type!=="group"?null:g.jsxs(g.Fragment,{children:[g.jsx(E.Modal,{isOpen:n,onClose:S?function(){}:B,as:"div",children:g.jsx(E.Modal.Panel,{children:g.jsxs(E.Modal.Container,{children:[g.jsx(E.Modal.Container.Header,{className:"yst-mb-4",children:g.jsx(E.Modal.Title,{as:"h3",className:"yst-text-lg yst-font-medium",children:"Edit brand group"})}),g.jsxs(E.Modal.Container.Content,{className:"yst-mb-8 yst-space-y-4",children:[g.jsx("p",{className:"yst-text-sm yst-text-slate-600",children:"Update the group name or ungroup brands by removing their tags."}),g.jsxs("div",{children:[g.jsx("label",{htmlFor:"editGroupName",className:"yst-mb-2 yst-block yst-text-sm yst-font-medium",children:"Group name"}),g.jsx(E.TextInput,{id:"editGroupName",value:d,onChange:function(G){return f(G.target.value)},placeholder:"Enter group name",className:"yst-w-full"})]}),g.jsxs("div",{children:[g.jsx(E.TagField,{readOnly:!0,id:"editGroupedBrands",label:"Grouped brands",tags:R(),onRemoveTag:function(G){if(m.length<2)return C(!0);p(function(Y){return Y.filter(function(q,U){return U!==G})})},onAddTag:function(){}}),m.length===0?g.jsx("p",{className:"yst-mt-2 yst-text-sm",children:'Click "Ungroup brands" to remove this group.'}):g.jsx("p",{className:"yst-mt-2 yst-text-sm yst-italic yst-text-gray-500",children:"Note: To add brands to this group, save this group, then use the checkboxes to select this group as well as any additional brands to be grouped."})]})]}),g.jsx(E.Modal.Container.Footer,{children:g.jsxs("div",{className:"yst-flex yst-w-full yst-items-center yst-justify-between",children:[g.jsx("div",{className:"yst-flex yst-justify-start",children:g.jsx(E.Button,{variant:"tertiary",onClick:P,disabled:_,className:"yst-text-red-600",children:"Ungroup brands"})}),g.jsxs("div",{className:"yst-flex yst-justify-end yst-gap-2",children:[g.jsx(E.Button,{variant:"secondary",onClick:B,children:"Cancel"}),g.jsx(E.Button,{variant:"primary",onClick:j,disabled:!d.trim()||_,isLoading:_,children:_?"Saving...":"Save changes"})]})]})})]})})}),g.jsx(Vu,{isOpen:S,onClose:M,onConfirm:I,title:"Ungroup this brand group?",description:g.jsxs(g.Fragment,{children:[g.jsx("p",{children:"The group will be removed, but the brands inside will remain in your brand list."}),g.jsx("p",{children:"This action cannot be undone. To create a new group with these brands, simply select them and create a new group."})]}),confirmText:"Yes, ungroup",isLoading:T})]})};function pf(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,n=typeof Symbol=="function"?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function s(h,y,m,p){var v=y&&y.prototype instanceof a?y:a,b=Object.create(v.prototype);return ln(b,"_invoke",function(S,C,x){var k,w,_,O=0,A=x||[],T=!1,j={p:0,n:0,v:e,a:B,f:B.bind(e,4),d:function(P,M){return k=P,w=0,_=e,j.n=M,o}};function B(R,P){for(w=R,_=P,t=0;!T&&O&&!M&&t<A.length;t++){var M,I=A[t],G=j.p,Y=I[2];R>3?(M=Y===P)&&(_=I[(w=I[4])?5:(w=3,3)],I[4]=I[5]=e):I[0]<=G&&((M=R<2&&G<I[1])?(w=0,j.v=P,j.n=I[1]):G<Y&&(M=R<3||I[0]>P||P>Y)&&(I[4]=R,I[5]=P,j.n=Y,w=0))}if(M||R>1)return o;throw T=!0,P}return function(R,P,M){if(O>1)throw TypeError("Generator is already running");for(T&&P===1&&B(P,M),w=P,_=M;(t=w<2?e:_)||!T;){k||(w?w<3?(w>1&&(j.n=-1),B(w,_)):j.n=_:j.v=_);try{if(O=2,k){if(w||(R="next"),t=k[R]){if(!(t=t.call(k,_)))throw TypeError("iterator result is not an object");if(!t.done)return t;_=t.value,w<2&&(w=0)}else w===1&&(t=k.return)&&t.call(k),w<2&&(_=TypeError("The iterator does not provide a '"+R+"' method"),w=1);k=e}else if((t=(T=j.n<0)?_:S.call(C,j))!==o)break}catch(I){k=e,w=1,_=I}finally{O=1}}return{value:t,done:T}}}(h,m,p),!0),b}var o={};function a(){}function l(){}function u(){}t=Object.getPrototypeOf;var c=[][r]?t(t([][r]())):(ln(t={},r,function(){return this}),t),d=u.prototype=a.prototype=Object.create(c);function f(h){return Object.setPrototypeOf?Object.setPrototypeOf(h,u):(h.__proto__=u,ln(h,i,"GeneratorFunction")),h.prototype=Object.create(d),h}return l.prototype=u,ln(d,"constructor",u),ln(u,"constructor",l),l.displayName="GeneratorFunction",ln(u,i,"GeneratorFunction"),ln(d),ln(d,i,"Generator"),ln(d,r,function(){return this}),ln(d,"toString",function(){return"[object Generator]"}),(pf=function(){return{w:s,m:f}})()}function ln(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(s){i=0}ln=function(o,a,l,u){if(a)i?i(o,a,{value:l,enumerable:!u,configurable:!u,writable:!u}):o[a]=l;else{var c=function(f,h){ln(o,f,function(y){return this._invoke(f,h,y)})};c("next",0),c("throw",1),c("return",2)}},ln(e,t,n,r)}function Um(e,t,n,r,i,s,o){try{var a=e[s](o),l=a.value}catch(u){return void n(u)}a.done?t(l):Promise.resolve(l).then(r,i)}function JL(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var s=e.apply(t,n);function o(l){Um(s,r,i,o,a,"next",l)}function a(l){Um(s,r,i,o,a,"throw",l)}o(void 0)})}}function Gm(e,t){return rD(e)||nD(e,t)||tD(e,t)||eD()}function eD(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
1287
1287
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function tD(e,t){if(e){if(typeof e=="string")return Km(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Km(e,t):void 0}}function Km(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function nD(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,o,a=[],l=!0,u=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(l=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return a}}function rD(e){if(Array.isArray(e))return e}var iD=function(t){var n=t.isOpen,r=t.onClose,i=t.brandId,s=t.brandsToGroup,o=t.onGroupCreated,a=Yt(),l=Gn(),u=l.analysisId,c=F.useState(""),d=Gm(c,2),f=d[0],h=d[1],y=F.useState([]),m=Gm(y,2),p=m[0],v=m[1];F.useEffect(function(){if(n&&s.length>0){var _,O=(_=s[0])===null||_===void 0?void 0:_.name;h(String(O||"New Group")),v(s.map(function(A){var T;return String((T=A.id)!==null&&T!==void 0?T:"")}))}},[n,s]);var b=y2({mutation:{onSuccess:function(){var _=JL(pf().m(function A(){return pf().w(function(T){for(;;)switch(T.n){case 0:return T.n=1,Promise.all([a.invalidateQueries({queryKey:su(i)}),a.invalidateQueries({queryKey:Nf(i)}),a.invalidateQueries({queryKey:Sr(i,"latest")}),a.invalidateQueries({queryKey:ir(i,"latest")}),a.invalidateQueries({queryKey:Sr(i,u)}),a.invalidateQueries({queryKey:ir(i,u)})]);case 1:o==null||o(),x();case 2:return T.a(2)}},A)}));function O(){return _.apply(this,arguments)}return O}(),onError:function(O){console.error("Error creating group:",O)}}}),S=b.mutate,C=b.isPending,x=function(){h(""),v([]),r()},k=function(){if(!(!f.trim()||p.length===0)){var O=p.flatMap(function(A){var T=s.find(function(j){return String(j.id)===A});return T&&T.type==="group"&&Array.isArray(T.groupedBrands)?T.groupedBrands.map(function(j){return String(j.id)}):A});S({brandId:i,data:{groupName:f.trim(),brandIds:O.filter(function(A){return A!==""}).map(function(A){return Number(A)})}})}},w=function(O){v(function(A){return A.filter(function(T){return T!==O})})};return g.jsx(E.Modal,{isOpen:n,onClose:x,children:g.jsx(E.Modal.Panel,{children:g.jsxs(E.Modal.Container,{children:[g.jsx(E.Modal.Container.Header,{children:g.jsx(E.Modal.Title,{children:"Edit brand group"})}),g.jsxs(E.Modal.Container.Content,{className:"yst-space-y-4",children:[g.jsxs("div",{children:[g.jsx("label",{htmlFor:"groupName",className:"yst-mb-2 yst-block yst-text-sm yst-font-medium",children:"Group name"}),g.jsx(E.TextInput,{id:"groupName",value:f,onChange:function(_){return h(_.target.value)},placeholder:"Enter group name",className:"yst-w-full"})]}),g.jsxs("div",{children:[g.jsx(E.TagField,{readOnly:!0,id:"groupedBrands",label:"Brands in group (".concat(p.length,")"),tags:p.map(function(_){var O=s.find(function(A){return String(A.id)===_});return O?O.type==="group"?"Group: ".concat(O.name):O.name||"":""}).filter(Boolean),onRemoveTag:function(_){var O=p.find(function(A){var T=s.find(function(B){return String(B.id)===A});if(!T)return!1;var j=T.type==="group"?"Group: ".concat(T.name):T.name||"";return j===_});O&&w(O)},onAddTag:function(){}}),p.length===0&&g.jsx("p",{className:"yst-text-sm yst-italic yst-text-gray-500",children:"No brands selected"})]}),g.jsx("p",{children:"Note: To add brands to this group, save this group, then use the checkboxes to select this group as well as any additional brands to be grouped."})]}),g.jsx(E.Modal.Container.Footer,{className:"yst-pt-4",children:g.jsxs("div",{className:"yst-flex yst-justify-end yst-gap-2",children:[g.jsx(E.Button,{variant:"secondary",onClick:x,disabled:C,children:"Cancel"}),g.jsx(E.Button,{variant:"primary",onClick:k,disabled:!f.trim()||p.length===0||C,children:C?"Saving...":"Save group"})]})})]})})})};function Oa(e){"@babel/helpers - typeof";return Oa=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Oa(e)}function Vm(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Wm(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Vm(Object(n),!0).forEach(function(r){fx(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Vm(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function fx(e,t,n){return(t=sD(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sD(e){var t=oD(e,"string");return Oa(t)=="symbol"?t:t+""}function oD(e,t){if(Oa(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Oa(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function aD(e){return cD(e)||uD(e)||hx(e)||lD()}function lD(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
1288
1288
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function uD(e){if(typeof Symbol!="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function cD(e){if(Array.isArray(e))return vf(e)}function Yn(e,t){return hD(e)||fD(e,t)||hx(e,t)||dD()}function dD(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
1289
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function hx(e,t){if(e){if(typeof e=="string")return vf(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?vf(e,t):void 0}}function vf(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function fD(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,o,a=[],l=!0,u=!1;try{if(s=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return a}}function hD(e){if(Array.isArray(e))return e}var gD=function(){var t,n=xn(),r=F.useState(!1),i=Yn(r,2),s=i[0],o=i[1],a=F.useState({}),l=Yn(a,2),u=l[0],c=l[1],d=F.useState(""),f=Yn(d,2),h=f[0],y=f[1],m=F.useState(1),p=Yn(m,2),v=p[0],b=p[1],S=F.useState({}),C=Yn(S,2),x=C[0],k=C[1],w=F.useState(!1),_=Yn(w,2),O=_[0],A=_[1],T=F.useState(!1),j=Yn(T,2),B=j[0],R=j[1],P=F.useState(null),M=Yn(P,2),I=M[0],G=M[1],Y=Gn(),q=Y.brandId;function U(de){return String(de.id)}var z=s4(q,{query:{enabled:!!q}}),V=z.data,N=z.isLoading,ne=10,J=(V==null||(t=V.data)===null||t===void 0?void 0:t.associatedBrands.filter(function(de){var me,fe;return h?((me=(fe=de.name)===null||fe===void 0?void 0:fe.toLowerCase())!==null&&me!==void 0?me:"").includes(h.toLowerCase()):!0}))||[],he=Math.ceil(J.length/ne),X=(v-1)*ne,ge=aD(J).sort(function(de,me){return de.type==="group"&&me.type!=="group"?-1:de.type!=="group"&&me.type==="group"?1:0}),ye=ge.slice(X,X+ne),je=function(me){var fe=J.find(function(Fe){return U(Fe)===me});fe&&fe.type==="group"&&(G(fe),R(!0))},se=Object.entries(x).filter(function(de){var me=Yn(de,2),fe=me[1];return fe}).map(function(de){var me=Yn(de,1),fe=me[0];return fe}),nt=function(){A(!0)},Ie=function(me){y(me.target.value),b(1)},st=function(me){k(function(fe){return Wm(Wm({},fe),{},fx({},me,!fe[me]))})},ze=function(){n("/")},
|
|
1289
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function hx(e,t){if(e){if(typeof e=="string")return vf(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?vf(e,t):void 0}}function vf(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function fD(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,o,a=[],l=!0,u=!1;try{if(s=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return a}}function hD(e){if(Array.isArray(e))return e}var gD=function(){var t,n=xn(),r=F.useState(!1),i=Yn(r,2),s=i[0],o=i[1],a=F.useState({}),l=Yn(a,2),u=l[0],c=l[1],d=F.useState(""),f=Yn(d,2),h=f[0],y=f[1],m=F.useState(1),p=Yn(m,2),v=p[0],b=p[1],S=F.useState({}),C=Yn(S,2),x=C[0],k=C[1],w=F.useState(!1),_=Yn(w,2),O=_[0],A=_[1],T=F.useState(!1),j=Yn(T,2),B=j[0],R=j[1],P=F.useState(null),M=Yn(P,2),I=M[0],G=M[1],Y=Gn(),q=Y.brandId;function U(de){return String(de.id)}var z=s4(q,{query:{enabled:!!q}}),V=z.data,N=z.isLoading,ne=10,J=(V==null||(t=V.data)===null||t===void 0?void 0:t.associatedBrands.filter(function(de){var me,fe;return h?((me=(fe=de.name)===null||fe===void 0?void 0:fe.toLowerCase())!==null&&me!==void 0?me:"").includes(h.toLowerCase()):!0}))||[],he=Math.ceil(J.length/ne),X=(v-1)*ne,ge=aD(J).sort(function(de,me){return de.type==="group"&&me.type!=="group"?-1:de.type!=="group"&&me.type==="group"?1:0}),ye=ge.slice(X,X+ne),je=function(me){var fe=J.find(function(Fe){return U(Fe)===me});fe&&fe.type==="group"&&(G(fe),R(!0))},se=Object.entries(x).filter(function(de){var me=Yn(de,2),fe=me[1];return fe}).map(function(de){var me=Yn(de,1),fe=me[0];return fe}),nt=function(){A(!0)},Ie=function(me){y(me.target.value),b(1)},st=function(me){k(function(fe){return Wm(Wm({},fe),{},fx({},me,!fe[me]))})},ze=function(){n("/")},Ke=function(){k({}),c({}),o(!1)},ee=function(){A(!1)},$e=function(){k({}),b(1),y("")},ot=function(){R(!1),G(null)},Ne=function(me,fe){return me in u?!!u[me]:!fe.isHidden},Le=[{Header:"Brand name",accessor:"name",Cell:function(me){var fe=me.value,Fe=me.row;return g.jsx("span",{className:"yst-font-medium yst-text-slate-900",children:g.jsxs("div",{className:"yst-flex yst-items-center yst-gap-2",children:[g.jsx(E.Checkbox,{id:"brand-checkbox-".concat(Fe.id),checked:!!x[U(Fe)],onChange:function(){return st(U(Fe))},value:U(Fe),label:Fe.isSelf?g.jsx(Ku,{children:fe}):fe,name:"brand-checkbox-".concat(Fe.id),disabled:!Ne(U(Fe),Fe)}),Fe.type==="group"&&g.jsx(f_,{className:"yst-h-4 yst-w-4 yst-text-slate-400"})]})})},LoadingComponent:function(me){var fe=me.id,Fe=fe===void 0?"":fe;return g.jsxs("div",{className:"yst-flex",children:[g.jsx(E.Checkbox,{id:"loading-row-checkbox-".concat(Fe),value:"loading",label:"",disabled:!0,name:"brand-checkbox-".concat(Fe)})," ",g.jsx(E.SkeletonLoader,{className:"yst-h-6 yst-w-32",id:"loading-row-skeleton-".concat(Fe)})]})}},{Header:"Actions",accessor:"id",Cell:function(me){var fe=me.value,Fe=me.row;return g.jsx(g.Fragment,{children:Fe.type==="group"?g.jsxs(E.Button,{variant:"tertiary",size:"small",onClick:function(){return je(String(fe!=null?fe:""))},className:"yst-gap-1.5 yst-px-0",disabled:!Ne(U(Fe),Fe),children:[g.jsx(b2,{className:"yst-h-4 yst-w-4"}),"Edit group"]}):void 0})},LoadingComponent:function(){return g.jsx(E.SkeletonLoader,{className:"yst-h-6 yst-w-24"})}}];return g.jsxs(E.Paper,{className:"yst-mx-auto yst-max-w-2xl",children:[g.jsx(dx,{title:"Brand list ".concat(""),children:g.jsx("p",{children:"These are the brands found in responses to your example prompts. Group related brands to improve your analysis. You can rename or exclude irrelevant brands, and new brands will be added automatically if they appear in future analysis runs."})}),g.jsxs(E.Paper.Content,{children:[g.jsx("div",{className:"yst-mb-6",children:g.jsx(E.TextInput,{id:"brand-search",label:"Search brands",placeholder:"Search brands",value:h,onChange:Ie})}),g.jsx("div",{className:"yst-mb-6",children:g.jsxs(E.Table,{columns:Le,className:"yst-w-full",variant:"minimal",children:[g.jsx(E.Table.Head,{children:g.jsx(E.Table.Row,{children:Le.map(function(de){return g.jsx(E.Table.Header,{children:de.Header},de.accessor)})})}),g.jsx(E.Table.Body,{children:N?[1,2,3].map(function(de,me){return g.jsx(E.Table.Row,{children:Le.map(function(fe,Fe){return g.jsx(E.Table.Cell,{children:g.jsx(fe.LoadingComponent,{id:"skeleton-".concat(me,"-").concat(Fe)},fe.accessor)},"cell-".concat(Fe))})},me)}):ye.length===0?g.jsx(E.Table.Row,{children:g.jsx(E.Table.Cell,{colSpan:Le.length,children:g.jsxs("div",{className:"yst-py-12 yst-text-center",children:[g.jsx("h3",{className:"yst-mt-4 yst-text-lg yst-font-medium yst-text-slate-900",children:"No brands found"}),g.jsx("p",{className:"yst-mt-2 yst-text-sm yst-text-slate-500",children:h?'No brands match "'.concat(h,'". Try a different search term.'):"No brands have been found yet. Run an analysis to discover brands."}),h&&g.jsx(E.Button,{variant:"secondary",size:"small",onClick:function(){y(""),b(1)},className:"yst-mt-4",children:"Clear search"})]})})}):ye.map(function(de){return g.jsx(E.Table.Row,{children:Le.map(function(me){return g.jsx(E.Table.Cell,{children:me.Cell?me.Cell({value:de[me.accessor],row:de}):de[me.accessor]},me.accessor)})},de.id)})})]})}),g.jsxs("div",{className:"yst-flex yst-items-center yst-justify-between",children:[g.jsxs(E.Button,{variant:"secondary",onClick:nt,className:"yst-mb-0 yst-gap-2",disabled:se.length<2,children:[g.jsx(h6,{})," Group brands"]}),g.jsx(E.Pagination,{variant:"text",current:v,total:he,onNavigate:b,className:"yst-flex-row",screenReaderTextPrevious:"Previous page",screenReaderTextNext:"Next page"})]})]}),g.jsx(zf,{children:g.jsx("div",{className:"yst-flex yst-items-center yst-justify-end yst-gap-4",children:s?g.jsxs(g.Fragment,{children:[g.jsx(E.Button,{variant:"secondary",className:"yst-mb-0",onClick:Ke,children:"Discard changes"}),g.jsx(E.Button,{variant:"primary",className:"yst-mb-0",onClick:ze,children:"Save changes"})]}):g.jsx(E.Button,{as:di,to:"/brands/".concat(q),variant:"tertiary",className:"yst-mb-0",children:"Return to analysis"})})}),g.jsx(iD,{isOpen:O,onClose:ee,brandId:q,brandsToGroup:J.filter(function(de){return se.includes(U(de))}),onGroupCreated:$e}),g.jsx(ZL,{isOpen:B,onClose:ot,groupToEdit:I,allBrands:J})]})};const yD=Object.freeze(Object.defineProperty({__proto__:null,default:gD},Symbol.toStringTag,{value:"Module"}));function mD(e,t){return xD(e)||bD(e,t)||vD(e,t)||pD()}function pD(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
1290
1290
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function vD(e,t){if(e){if(typeof e=="string")return Qm(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Qm(e,t):void 0}}function Qm(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function bD(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,o,a=[],l=!0,u=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(l=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return a}}function xD(e){if(Array.isArray(e))return e}var wD=function(t){var n=t.isOpen,r=t.onClose,i=Yt(),s=qf(),o=F.useState(""),a=mD(o,2),l=a[0],u=a[1],c=L4({mutation:{onSettled:function(){i.clear()},onSuccess:function(){r(),s("Successfully deleted all data.",{variant:"success"})},onError:function(){i.clear(),s("Failed to delete all data. Please try again later.",{variant:"error"})}}}),d=c.mutate,f=c.isPending;return F.useEffect(function(){n&&u("")},[n]),g.jsx(Vu,{isOpen:n,onClose:r,onConfirm:function(){d()},isLoading:f,disabled:l!=="DELETE ALL",title:"Delete all data?",description:g.jsxs(g.Fragment,{children:[g.jsx("p",{children:"This will permanently erase all brands, analysis results, and queries from your account."}),g.jsx("p",{children:"This action cannot be undone."}),g.jsx(E.TextField,{id:"delete-all-confirmation",label:"To confirm, please type DELETE ALL:",value:l,onChange:function(h){return u(h.target.value)}}),g.jsx("p",{children:g.jsx("em",{children:"This is to make sure you understand this action is permanent."})})]}),confirmText:"Yes, delete all data",cancelText:"No, go back"})};function bf(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,n=typeof Symbol=="function"?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function s(h,y,m,p){var v=y&&y.prototype instanceof a?y:a,b=Object.create(v.prototype);return un(b,"_invoke",function(S,C,x){var k,w,_,O=0,A=x||[],T=!1,j={p:0,n:0,v:e,a:B,f:B.bind(e,4),d:function(P,M){return k=P,w=0,_=e,j.n=M,o}};function B(R,P){for(w=R,_=P,t=0;!T&&O&&!M&&t<A.length;t++){var M,I=A[t],G=j.p,Y=I[2];R>3?(M=Y===P)&&(_=I[(w=I[4])?5:(w=3,3)],I[4]=I[5]=e):I[0]<=G&&((M=R<2&&G<I[1])?(w=0,j.v=P,j.n=I[1]):G<Y&&(M=R<3||I[0]>P||P>Y)&&(I[4]=R,I[5]=P,j.n=Y,w=0))}if(M||R>1)return o;throw T=!0,P}return function(R,P,M){if(O>1)throw TypeError("Generator is already running");for(T&&P===1&&B(P,M),w=P,_=M;(t=w<2?e:_)||!T;){k||(w?w<3?(w>1&&(j.n=-1),B(w,_)):j.n=_:j.v=_);try{if(O=2,k){if(w||(R="next"),t=k[R]){if(!(t=t.call(k,_)))throw TypeError("iterator result is not an object");if(!t.done)return t;_=t.value,w<2&&(w=0)}else w===1&&(t=k.return)&&t.call(k),w<2&&(_=TypeError("The iterator does not provide a '"+R+"' method"),w=1);k=e}else if((t=(T=j.n<0)?_:S.call(C,j))!==o)break}catch(I){k=e,w=1,_=I}finally{O=1}}return{value:t,done:T}}}(h,m,p),!0),b}var o={};function a(){}function l(){}function u(){}t=Object.getPrototypeOf;var c=[][r]?t(t([][r]())):(un(t={},r,function(){return this}),t),d=u.prototype=a.prototype=Object.create(c);function f(h){return Object.setPrototypeOf?Object.setPrototypeOf(h,u):(h.__proto__=u,un(h,i,"GeneratorFunction")),h.prototype=Object.create(d),h}return l.prototype=u,un(d,"constructor",u),un(u,"constructor",l),l.displayName="GeneratorFunction",un(u,i,"GeneratorFunction"),un(d),un(d,i,"Generator"),un(d,r,function(){return this}),un(d,"toString",function(){return"[object Generator]"}),(bf=function(){return{w:s,m:f}})()}function un(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(s){i=0}un=function(o,a,l,u){if(a)i?i(o,a,{value:l,enumerable:!u,configurable:!u,writable:!u}):o[a]=l;else{var c=function(f,h){un(o,f,function(y){return this._invoke(f,h,y)})};c("next",0),c("throw",1),c("return",2)}},un(e,t,n,r)}function Ym(e,t,n,r,i,s,o){try{var a=e[s](o),l=a.value}catch(u){return void n(u)}a.done?t(l):Promise.resolve(l).then(r,i)}function SD(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var s=e.apply(t,n);function o(l){Ym(s,r,i,o,a,"next",l)}function a(l){Ym(s,r,i,o,a,"throw",l)}o(void 0)})}}function CD(e,t){return ED(e)||OD(e,t)||kD(e,t)||_D()}function _D(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
1291
1291
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function kD(e,t){if(e){if(typeof e=="string")return Xm(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Xm(e,t):void 0}}function Xm(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function OD(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,o,a=[],l=!0,u=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(l=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return a}}function ED(e){if(Array.isArray(e))return e}var AD=function(t){var n=t.isOpen,r=t.brandId,i=t.onClose,s=t.brandName,o=Yt(),a=qf(),l=F.useState(""),u=CD(l,2),c=u[0],d=u[1],f=x4({mutation:{onSuccess:function(){var m=SD(bf().m(function v(){return bf().w(function(b){for(;;)switch(b.n){case 0:return b.n=1,Promise.all([o.invalidateQueries({queryKey:rr()}),o.invalidateQueries({queryKey:Hu()})]);case 1:a("Brand deleted successfully",{variant:"success"}),i();case 2:return b.a(2)}},v)}));function p(){return m.apply(this,arguments)}return p}(),onError:function(p){var v=p instanceof Error?p.message:"Please try again later.";a("Failed to delete brand. ".concat(v),{variant:"error"})}}}),h=f.mutate,y=f.isPending;return F.useEffect(function(){n&&d("")},[n]),g.jsx(Vu,{isOpen:n,onClose:i,onConfirm:function(){if(!s){console.error("Brand name is required for deletion confirmation");return}h({brandId:r})},isLoading:y,disabled:c.toLowerCase()!==(s==null?void 0:s.toLowerCase()),title:"Delete brand?",description:g.jsxs(g.Fragment,{children:[g.jsx("p",{children:"This will permanently delete all data associated with this brand, including past analyses and query history."}),g.jsx("p",{children:"This action cannot be undone."}),g.jsx(E.TextField,{id:"delete-modal-brand-name-confirmation",label:"To confirm, please type your brand name ".concat(s,":"),value:c,onChange:function(m){return d(m.target.value)}}),g.jsx("p",{children:g.jsx("em",{children:"This is to make sure you understand this action is permanent."})})]}),confirmText:"Yes, delete brand",cancelText:"No, go back"})};function Ea(e){"@babel/helpers - typeof";return Ea=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ea(e)}function Go(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,n=typeof Symbol=="function"?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function s(h,y,m,p){var v=y&&y.prototype instanceof a?y:a,b=Object.create(v.prototype);return cn(b,"_invoke",function(S,C,x){var k,w,_,O=0,A=x||[],T=!1,j={p:0,n:0,v:e,a:B,f:B.bind(e,4),d:function(P,M){return k=P,w=0,_=e,j.n=M,o}};function B(R,P){for(w=R,_=P,t=0;!T&&O&&!M&&t<A.length;t++){var M,I=A[t],G=j.p,Y=I[2];R>3?(M=Y===P)&&(_=I[(w=I[4])?5:(w=3,3)],I[4]=I[5]=e):I[0]<=G&&((M=R<2&&G<I[1])?(w=0,j.v=P,j.n=I[1]):G<Y&&(M=R<3||I[0]>P||P>Y)&&(I[4]=R,I[5]=P,j.n=Y,w=0))}if(M||R>1)return o;throw T=!0,P}return function(R,P,M){if(O>1)throw TypeError("Generator is already running");for(T&&P===1&&B(P,M),w=P,_=M;(t=w<2?e:_)||!T;){k||(w?w<3?(w>1&&(j.n=-1),B(w,_)):j.n=_:j.v=_);try{if(O=2,k){if(w||(R="next"),t=k[R]){if(!(t=t.call(k,_)))throw TypeError("iterator result is not an object");if(!t.done)return t;_=t.value,w<2&&(w=0)}else w===1&&(t=k.return)&&t.call(k),w<2&&(_=TypeError("The iterator does not provide a '"+R+"' method"),w=1);k=e}else if((t=(T=j.n<0)?_:S.call(C,j))!==o)break}catch(I){k=e,w=1,_=I}finally{O=1}}return{value:t,done:T}}}(h,m,p),!0),b}var o={};function a(){}function l(){}function u(){}t=Object.getPrototypeOf;var c=[][r]?t(t([][r]())):(cn(t={},r,function(){return this}),t),d=u.prototype=a.prototype=Object.create(c);function f(h){return Object.setPrototypeOf?Object.setPrototypeOf(h,u):(h.__proto__=u,cn(h,i,"GeneratorFunction")),h.prototype=Object.create(d),h}return l.prototype=u,cn(d,"constructor",u),cn(u,"constructor",l),l.displayName="GeneratorFunction",cn(u,i,"GeneratorFunction"),cn(d),cn(d,i,"Generator"),cn(d,r,function(){return this}),cn(d,"toString",function(){return"[object Generator]"}),(Go=function(){return{w:s,m:f}})()}function cn(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(s){i=0}cn=function(o,a,l,u){if(a)i?i(o,a,{value:l,enumerable:!u,configurable:!u,writable:!u}):o[a]=l;else{var c=function(f,h){cn(o,f,function(y){return this._invoke(f,h,y)})};c("next",0),c("throw",1),c("return",2)}},cn(e,t,n,r)}function Zm(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Rr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Zm(Object(n),!0).forEach(function(r){TD(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Zm(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function TD(e,t,n){return(t=PD(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function PD(e){var t=jD(e,"string");return Ea(t)=="symbol"?t:t+""}function jD(e,t){if(Ea(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ea(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Jm(e,t,n,r,i,s,o){try{var a=e[s](o),l=a.value}catch(u){return void n(u)}a.done?t(l):Promise.resolve(l).then(r,i)}function ep(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var s=e.apply(t,n);function o(l){Jm(s,r,i,o,a,"next",l)}function a(l){Jm(s,r,i,o,a,"throw",l)}o(void 0)})}}function MD(e,t){return ID(e)||DD(e,t)||LD(e,t)||$D()}function $D(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
1292
1292
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function LD(e,t){if(e){if(typeof e=="string")return tp(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?tp(e,t):void 0}}function tp(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function DD(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,o,a=[],l=!0,u=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(l=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return a}}function ID(e){if(Array.isArray(e))return e}var RD=function(t){var n,r,i=t.brand,s=t.isLast,o=t.onDelete,a=i.id,l=Gn(),u=l.hostAppProps,c=l.analysisId,d=u.onAddSubscription,f=xn(),h=Va(),y=h.setBrandId,m=F.useState(!1),p=MD(m,2),v=p[0],b=p[1],S=Yt(),C=Uu({query:{select:function(P){var M=P.data;return M},staleTime:5*1e3,refetchOnWindowFocus:!0,refetchInterval:30*1e3}}),x=C.data,k=m2({mutation:{onMutate:function(){var R=ep(Go().m(function M(I){var G,Y,q;return Go().w(function(U){for(;;)switch(U.n){case 0:return G=I.brandId,Y=I.data,U.n=1,S.cancelQueries({queryKey:rr()});case 1:return q=S.getQueryData(rr()),S.setQueryData(rr(),function(z){var V,N;return z&&Rr(Rr({},z),{},{data:Rr(Rr({},z.data),{},{brands:((V=(N=z.data)===null||N===void 0?void 0:N.brands)!==null&&V!==void 0?V:[]).map(function(ne){return ne.id===G?Rr(Rr({},ne),{},{settings:Rr(Rr({},ne.settings),{},{enableAutomaticAnalysis:Y.enableAutomaticAnalysis})}):ne})})})}),U.a(2,{previous:q})}},M)}));function P(M){return R.apply(this,arguments)}return P}(),onSuccess:function(){if(i&&i.settings&&i.settings.enableAutomaticAnalysis===!1)return b(!1);b(!j)},onError:function(P,M,I){I!=null&&I.previous&&S.setQueryData(rr(),I.previous)},onSettled:function(){var R=ep(Go().m(function M(){return Go().w(function(I){for(;;)switch(I.n){case 0:return I.n=1,Promise.all([S.invalidateQueries({queryKey:rr()}),S.invalidateQueries({queryKey:Hu()}),S.invalidateQueries({queryKey:zu(a)}),S.invalidateQueries({queryKey:Sr(a,"latest")}),S.invalidateQueries({queryKey:ir(a,"latest")}),S.invalidateQueries({queryKey:Sr(a,c)}),S.invalidateQueries({queryKey:ir(a,c)})]);case 1:return I.a(2)}},M)}));function P(){return R.apply(this,arguments)}return P}()}}),w=k.mutate,_=k.isPending,O=function(P){w({brandId:a,data:{enableAutomaticAnalysis:P}})},A=function(P){if(P){if(!T)return b(!0);if(!j)return O(!0);b(!0)}else O(!1)},T=Number(x==null?void 0:x.maxNumberOfActiveBrands)-Number(x==null?void 0:x.numberOfActiveBrands)>0||!!(i!=null&&(n=i.settings)!==null&&n!==void 0&&n.enableAutomaticAnalysis),j=R2(i==null?void 0:i.firstNextAnalysisOpportunity),B=(i==null?void 0:i.setupStatus)==="pendingQuerySelection";return g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:ke("yst-flex yst-max-w-2xl yst-flex-1 yst-flex-row yst-items-center yst-justify-start yst-gap-4 yst-py-4 yst-text-slate-800",{"yst-border-b-[1px] yst-border-b-slate-200":!s}),children:[g.jsx(E.Toggle,{id:"toggle-brand-".concat(i==null?void 0:i.id),checked:i==null||(r=i.settings)===null||r===void 0?void 0:r.enableAutomaticAnalysis,screenReaderLabel:"Enable or disable automatic analysis for this brand",onChange:A,disabled:(i==null?void 0:i.id)==="loading"||_}),g.jsxs("div",{className:"yst-font-medium",children:[(i==null?void 0:i.id)==="loading"?g.jsx(E.SkeletonLoader,{className:"yst-h-6 yst-w-32"}):i==null?void 0:i.name,B&&g.jsx("div",{children:g.jsx(E.Link,{variant:"primary",onClick:function(){i.id?(y(i.id),f("/setup/".concat(i.id,"/queries"))):console.error("Brand ID is missing.")},children:"Finish setup"})}),(i==null?void 0:i.nextScheduledAnalysis)&&g.jsxs("div",{className:"yst-font-normal yst-italic yst-text-slate-500",children:["Next analysis:"," ",Hd(i.nextScheduledAnalysis)]})]}),g.jsx("div",{className:"yst-ml-auto yst-flex yst-flex-row yst-items-center yst-justify-end yst-gap-2 yst-text-slate-800",children:(i==null?void 0:i.id)==="loading"?g.jsx(E.SkeletonLoader,{className:"yst-h-6 yst-w-24"}):g.jsxs(E.Button,{size:"small",variant:"tertiary",className:"yst-gap-1 yst-text-red-600 *:hover:yst-text-red-700",onClick:function(){i!=null&&i.id&&o(i.id)},disabled:(i==null?void 0:i.id)==="loading",children:[g.jsx(Ff,{})," Delete brand"]})})]}),g.jsx(E.Modal,{isOpen:v,onClose:function(){return b(!1)},position:"center",as:"div",className:ke({"yst-mx-auto yst-max-w-xl":T}),children:T?g.jsx(E.Modal.Panel,{children:j?g.jsxs(g.Fragment,{children:[g.jsx(E.Modal.Container.Header,{className:"yst-mb-3 yst-w-full",children:g.jsx(E.Modal.Title,{as:"h3",className:"yst-text-lg yst-font-medium",children:"Start brand analysis now?"})}),g.jsxs(E.Modal.Container.Content,{className:"yst-mb-4 yst-space-y-3",children:[g.jsx("p",{children:"Activating this brand will immediately start a new analysis."}),g.jsx("p",{children:"This will use one of your weekly analyses included in your subscription."})]}),g.jsxs(E.Modal.Container.Footer,{className:"yst-mt-3 yst-flex yst-justify-end yst-gap-2",children:[g.jsx(E.Button,{variant:"secondary",onClick:function(){return b(!1)},children:"Cancel"}),g.jsx(E.Button,{variant:"primary",onClick:function(){O(!0)},isLoading:_,children:"Yes, start analysis"})]})]}):g.jsxs(g.Fragment,{children:[g.jsx(E.Modal.Container.Header,{className:"yst-mb-3 yst-w-full",children:g.jsx(E.Modal.Title,{as:"h3",className:"yst-text-lg yst-font-medium",children:"Automatic analysis enabled"})}),g.jsxs(E.Modal.Container.Content,{className:"yst-mb-4 yst-space-y-3",children:[g.jsx("p",{children:"You've turned on the weekly automatic analysis for this brand."}),g.jsxs("p",{children:["The next analysis will run on"," ",g.jsx("span",{className:"yst-font-medium",children:Hd(i==null?void 0:i.nextScheduledAnalysis)||"the next analysis cycle"}),"."]})]}),g.jsx(E.Modal.Container.Footer,{className:"yst-mt-3 yst-flex yst-justify-end yst-gap-2",children:g.jsx(E.Button,{variant:"primary",onClick:function(){return b(!1)},children:"Got it"})})]})}):g.jsxs(E.Modal.Panel,{children:[g.jsx("div",{className:"yst-flex yst-items-start yst-justify-stretch yst-gap-4",children:g.jsxs("div",{className:"yst-flex-1",children:[g.jsx(E.Modal.Container.Header,{className:"yst-mb-3 yst-w-full",children:g.jsx(E.Modal.Title,{as:"h3",className:"yst-text-center yst-text-lg yst-font-medium",children:"You've reached your active brand limit"})}),g.jsx(E.Modal.Container.Content,{children:g.jsx("p",{className:"yst-text-center",children:"Each subscription lets you activate 1 brand. Add another subscription or deactivate an existing brand to activate this brand."})})]})}),g.jsx(E.Modal.Container.Footer,{children:g.jsxs("div",{className:"yst-flex yst-flex-col yst-justify-stretch yst-gap-2",children:[d&&g.jsxs(E.Button,{variant:"upsell",className:"yst-flex yst-gap-1",onClick:d,children:[g.jsx(x2,{}),"Add a subscription"]}),g.jsx(E.Button,{variant:"tertiary",className:"",onClick:function(){return b(!1)},children:"Manage active brands"})]})})]})})]})},np,rp,ip;function nd(e,t){return qD(e)||BD(e,t)||FD(e,t)||ND()}function ND(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
@@ -1294,5 +1294,5 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1294
1294
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function nI(e,t){if(e){if(typeof e=="string")return fp(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?fp(e,t):void 0}}function fp(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function rI(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,o,a=[],l=!0,u=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(l=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return a}}function iI(e){if(Array.isArray(e))return e}var sI=function(){var t=xn(),n=Va(),r=Yt(),i=F.useState(),s=as(i,2),o=s[0],a=s[1],l=F.useState(!1),u=as(l,2),c=u[0],d=u[1],f=F.useState({name:"",url:"",description:"",language:"en",isLocal:!1,country:void 0,region:""}),h=as(f,2),y=h[0],m=h[1],p=F.useState(null),v=as(p,2),b=v[0],S=v[1],C=F.useState(""),x=as(C,2),k=x[0],w=x[1],_=F.useMemo(function(){var z;if(!y.country)return"";var V=rd.find(function(N){return N.value===y.country});return(z=V==null?void 0:V.label)!==null&&z!==void 0?z:""},[y.country]),O=F.useMemo(function(){var z=k.trim().toLowerCase();return z?rd.filter(function(V){var N=V.label.toLowerCase().includes(z),ne=V.value.toLowerCase().includes(z);return N||ne}):rd},[k]),A=y4({mutation:{onSuccess:function(){var z=eI(wf().m(function N(ne){var J;return wf().w(function(he){for(;;)switch(he.n){case 0:return J=ne.data.id,he.n=1,Promise.all([r.invalidateQueries({queryKey:Hu()}),r.invalidateQueries({queryKey:rr()})]);case 1:J&&n.setBrandId(J),ne!=null&&ne.status&&ne.status>=200&&ne.status<300&&J&&(n.setBrandId(J),a(J));case 2:return he.a(2)}},N)}));function V(N){return z.apply(this,arguments)}return V}(),onError:function(){d(!1)}}}),T=A.mutate,j=A.isPending,B=A.error,R=es({query:{enabled:!!o,select:function(V){var N=V.data;return N==null?void 0:N.brands},refetchInterval:function(V){var N;return((V==null||(N=V.state)===null||N===void 0||(N=N.data)===null||N===void 0||(N=N.data)===null||N===void 0?void 0:N.brands)||[]).find(function(ne){return ne.id===o})?!1:2*1e3}}}),P=R.data;F.useEffect(function(){o&&P!==null&&P!==void 0&&P.find(function(z){return z.id===o})&&t("/setup/".concat(o,"/queries"),{replace:!0})},[o,P,t]);var M=function(V,N){m(function(ne){return cp(cp({},ne),{},mx({},V,N))})},I=function(V){w(V.target.value)},G=function(V){M("country",V!=null?V:void 0),w("")},Y=function(V){if(V.preventDefault(),S(null),y.description.length>250){S("Your brand description is too long. Please keep it within the 250-character limit."),d(!1);return}d(!0);var N=y.url;N&&!/^https?:\/\//i.test(N)&&(N="https://".concat(N)),T({data:{name:y.name,url:N,description:y.description,focusLanguage:y.language,country:y.country,regionOrCity:y.region}})};function q(z){return si(z)==="object"&&z!==null&&"response"in z&&si(z.response)==="object"&&z.response!==void 0&&"data"in z.response}var U=q(B)?B.response.data.errors:void 0;return g.jsxs("form",{onSubmit:Y,children:[g.jsxs("div",{className:"yst-space-y-6",children:[g.jsx(E.Title,{size:"2",children:"Brand info"}),!!B&&g.jsx(E.Alert,{variant:"error",title:"Error",isVisible:!!B,children:g.jsx("ul",{children:U&&si(U)==="object"?Object.entries(U).flatMap(function(z){var V=as(z,2),N=V[0],ne=V[1];return Array.isArray(ne)?ne.map(function(J,he){return g.jsx("li",{children:J},"".concat(N,"-").concat(he))}):null}):"There was an error creating the brand."})}),b&&g.jsx(E.Alert,{variant:"error",title:"Error",isVisible:!!b,children:g.jsx("ul",{children:g.jsx("li",{children:"Your brand description is too long. Please keep it within the 250-character limit."})})}),g.jsx(E.TextField,{id:"name",label:"Brand name",value:y.name,onChange:function(z){return M("name",z.target.value)},maxLength:255}),g.jsx(E.TextField,{id:"url",label:"Website URL (optional)",placeholder:"Example: https://yourwebsite.com",value:y.url,maxLength:247,onChange:function(z){return M("url",z.target.value)}}),g.jsxs("div",{id:"brand-description-textarea",children:[g.jsx(E.TextareaField,{id:"brand-description",label:"Brand description",value:y.description,onChange:function(z){var V=z.target.value;M("description",V)},...y.description.length>250?{validation:{variant:"error",message:"Your brand description is too long. Please keep it within the 250-character limit."}}:{},placeholder:"e.g. We design eco-friendly yoga mats for busy professionals who want sustainable gear that’s durable, stylish and kind to the planet."}),g.jsxs("div",{className:"yst-mt-1 yst-flex",children:[g.jsxs("div",{className:"yst-flex-grow yst-flex-col",children:[y.description.length>250&&g.jsx("div",{className:"yst-mb-2 yst-text-red-500",children:"Your brand description is too long. Please keep it within the 250-character limit."}),"Tell us about your brand: what you do, who it’s for and what makes it special."]}),g.jsxs("div",{className:ke("yst-ml-6 yst-mt-[-4px] yst-text-xs",{"yst-text-slate-500":y.description.length<=250,"yst-text-red-500":y.description.length>250}),children:[y.description.length,"/250"]})]})]}),g.jsxs("div",{className:"yst-space-y-2",children:[g.jsx(E.Select,{className:"yst-max-w-sm",id:"language-select",label:"Target language",value:y.language,onChange:function(z){return M("language",z)},options:XD.map(function(z){return{label:z.label,value:z.value}})}),g.jsx("p",{children:"The main language your brand uses to communicate or create content."})]})]}),g.jsx(Xa,{}),g.jsxs("div",{className:"yst-space-y-6",children:[g.jsx(E.Title,{size:"2",children:"Location info"}),g.jsx("p",{children:"Specify a location to enhance the accuracy of the analysis."}),g.jsx(E.Autocomplete,{className:"yst-max-w-sm",id:"country-select",label:"Target country (optional)",value:y.country||null,nullable:!0,placeholder:"Search countries...",onQueryChange:I,onChange:G,selectedLabel:_,children:O.map(function(z){return g.jsx(E.Autocomplete.Option,{value:z.value,children:z.label},z.value)})}),y.country&&g.jsx(E.TextField,{id:"region",label:"Target city, state, or region (optional)",value:y.region,onChange:function(z){return M("region",z.target.value)},description:`Enter a city, state, or region to narrow down the analysis. For
|
|
1295
1295
|
example: California, Bavaria, or Paris.`,maxLength:255})]}),g.jsx(yx,{onBack:function(){return t(-1)},buttonText:"Generate queries",isButtonDisabled:j||!!o||c,isLoading:j||!!o})]})};const oI=Object.freeze(Object.defineProperty({__proto__:null,default:sI},Symbol.toStringTag,{value:"Module"})),hp=e=>D.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},D.createElement("path",{d:"M3.33284 2V4.66667M1.99951 3.33333H4.66618M3.99951 11.3333V14M2.66618 12.6667H5.33284M8.66618 2L10.19 6.57143L13.9995 8L10.19 9.42857L8.66618 14L7.14237 9.42857L3.33284 8L7.14237 6.57143L8.66618 2Z",stroke:"url(#paint0_linear_3891_2757)",strokeWidth:1.33333,strokeLinecap:"round",strokeLinejoin:"round"}),D.createElement("defs",null,D.createElement("linearGradient",{id:"paint0_linear_3891_2757",x1:1.99951,y1:2,x2:15.3308,y2:3.72773,gradientUnits:"userSpaceOnUse"},D.createElement("stop",{stopColor:"#A61E69"}),D.createElement("stop",{offset:1,stopColor:"#6366F1"}))));function Aa(e){"@babel/helpers - typeof";return Aa=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Aa(e)}function aI(e){return cI(e)||uI(e)||px(e)||lI()}function lI(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
1296
1296
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function uI(e){if(typeof Symbol!="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function cI(e){if(Array.isArray(e))return Cf(e)}function gp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function _n(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?gp(Object(n),!0).forEach(function(r){dI(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gp(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function dI(e,t,n){return(t=fI(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fI(e){var t=hI(e,"string");return Aa(t)=="symbol"?t:t+""}function hI(e,t){if(Aa(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Aa(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Sf(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,n=typeof Symbol=="function"?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function s(h,y,m,p){var v=y&&y.prototype instanceof a?y:a,b=Object.create(v.prototype);return fn(b,"_invoke",function(S,C,x){var k,w,_,O=0,A=x||[],T=!1,j={p:0,n:0,v:e,a:B,f:B.bind(e,4),d:function(P,M){return k=P,w=0,_=e,j.n=M,o}};function B(R,P){for(w=R,_=P,t=0;!T&&O&&!M&&t<A.length;t++){var M,I=A[t],G=j.p,Y=I[2];R>3?(M=Y===P)&&(_=I[(w=I[4])?5:(w=3,3)],I[4]=I[5]=e):I[0]<=G&&((M=R<2&&G<I[1])?(w=0,j.v=P,j.n=I[1]):G<Y&&(M=R<3||I[0]>P||P>Y)&&(I[4]=R,I[5]=P,j.n=Y,w=0))}if(M||R>1)return o;throw T=!0,P}return function(R,P,M){if(O>1)throw TypeError("Generator is already running");for(T&&P===1&&B(P,M),w=P,_=M;(t=w<2?e:_)||!T;){k||(w?w<3?(w>1&&(j.n=-1),B(w,_)):j.n=_:j.v=_);try{if(O=2,k){if(w||(R="next"),t=k[R]){if(!(t=t.call(k,_)))throw TypeError("iterator result is not an object");if(!t.done)return t;_=t.value,w<2&&(w=0)}else w===1&&(t=k.return)&&t.call(k),w<2&&(_=TypeError("The iterator does not provide a '"+R+"' method"),w=1);k=e}else if((t=(T=j.n<0)?_:S.call(C,j))!==o)break}catch(I){k=e,w=1,_=I}finally{O=1}}return{value:t,done:T}}}(h,m,p),!0),b}var o={};function a(){}function l(){}function u(){}t=Object.getPrototypeOf;var c=[][r]?t(t([][r]())):(fn(t={},r,function(){return this}),t),d=u.prototype=a.prototype=Object.create(c);function f(h){return Object.setPrototypeOf?Object.setPrototypeOf(h,u):(h.__proto__=u,fn(h,i,"GeneratorFunction")),h.prototype=Object.create(d),h}return l.prototype=u,fn(d,"constructor",u),fn(u,"constructor",l),l.displayName="GeneratorFunction",fn(u,i,"GeneratorFunction"),fn(d),fn(d,i,"Generator"),fn(d,r,function(){return this}),fn(d,"toString",function(){return"[object Generator]"}),(Sf=function(){return{w:s,m:f}})()}function fn(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(s){i=0}fn=function(o,a,l,u){if(a)i?i(o,a,{value:l,enumerable:!u,configurable:!u,writable:!u}):o[a]=l;else{var c=function(f,h){fn(o,f,function(y){return this._invoke(f,h,y)})};c("next",0),c("throw",1),c("return",2)}},fn(e,t,n,r)}function yp(e,t,n,r,i,s,o){try{var a=e[s](o),l=a.value}catch(u){return void n(u)}a.done?t(l):Promise.resolve(l).then(r,i)}function gI(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var s=e.apply(t,n);function o(l){yp(s,r,i,o,a,"next",l)}function a(l){yp(s,r,i,o,a,"throw",l)}o(void 0)})}}function Nr(e,t){return pI(e)||mI(e,t)||px(e,t)||yI()}function yI(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
1297
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function px(e,t){if(e){if(typeof e=="string")return Cf(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Cf(e,t):void 0}}function Cf(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function mI(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,o,a=[],l=!0,u=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(l=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return a}}function pI(e){if(Array.isArray(e))return e}var fs=5,Ko="Generating...",vI="Re-generating...",bI=100,xI=800,wI=["******************************","***********************","*******************************************************","***********************************************","***************************************************************","*******************************************************","*******************************************************","***********************************************"],SI=Array.from({length:fs},function(e,t){return{id:"query-".concat(t),text:Ko,isRegenerating:!0}}),CI=function(){var t,n,r,i=Eu(),s=i.brandId,o="/setup/".concat(s,"/analysis"),a=xn(),l=Yt(),u=qf(),c=F.useRef(!1),d=F.useState(SI),f=Nr(d,2),h=f[0],y=f[1],m=F.useState(!1),p=Nr(m,2),v=p[0],b=p[1],S=F.useState([]),C=Nr(S,2),x=C[0],k=C[1],w=F.useState([]),_=Nr(w,2),O=_[0],A=_[1],T=F.useState(!1),j=Nr(T,2),B=j[0],R=j[1],P=F.useState(null),M=Nr(P,2),I=M[0],G=M[1],Y=F.useState(!1),q=Nr(Y,2),U=q[0],z=q[1],V=F.useState(!1),N=Nr(V,2),ne=N[0],J=N[1],he=T4(s||"",{query:{enabled:!!s}}),X=he.data,ge=he.isRefetching,ye=he.error,je=he.isError,se=he.refetch,nt=ou(s||"",{query:{enabled:!!s}}),Ie=nt.data,st=F.useCallback(function(oe){var pe;if(!(Ie!=null&&(pe=Ie.data)!==null&&pe!==void 0&&pe.name))return!1;var Oe=Ie.data.name.toLowerCase().trim();return Oe?oe.toLowerCase().includes(Oe):!1},[Ie==null||(t=Ie.data)===null||t===void 0?void 0:t.name]),ze=F.useCallback(function(){return h.some(function(oe){return st(oe.text)})},[h,st]),Ve=function(){z(!1)},ee=function(){z(!1),s&&Ne({brandId:s,data:{queries:h.map(function(pe){return pe.text})}})},$e=function(){z(!1);var pe=h.findIndex(function(Oe){return st(Oe.text)});pe!==-1&&setTimeout(function(){var Oe=document.getElementById("query-text-".concat(pe));Oe&&(Oe.focus(),Oe.select())},bI)},ot=k4({mutation:{onSuccess:function(){var oe=gI(Sf().m(function Oe(Ee){return Sf().w(function(He){for(;;)switch(He.n){case 0:if(G(null),!(Ee!=null&&Ee.status&&Ee.status>=200&&Ee.status<300)){He.n=2;break}return He.n=1,Promise.all([l.invalidateQueries({queryKey:zu(s||"")}),l.invalidateQueries({queryKey:rr()})]);case 1:a(o);case 2:return He.a(2)}},Oe)}));function pe(Oe){return oe.apply(this,arguments)}return pe}(),onError:function(pe){var Oe,Ee;if((pe==null||(Oe=pe.response)===null||Oe===void 0||(Oe=Oe.data)===null||Oe===void 0?void 0:Oe.message)==="Cannot update queries for a brand that has existing analyses."){a(o,{replace:!0});return}var He=(pe==null||(Ee=pe.response)===null||Ee===void 0||(Ee=Ee.data)===null||Ee===void 0?void 0:Ee.message)||(pe==null?void 0:pe.message)||"An unexpected error occurred.";G(He)}}}),Ne=ot.mutate,Le=ot.isPending;F.useEffect(function(){s||a("/setup",{replace:!0})},[s,a,u]),F.useEffect(function(){var oe;!(Ie!=null&&(oe=Ie.data)!==null&&oe!==void 0&&oe.setupStatus)||c.current||(c.current=!0,Ie.data.setupStatus!=="pendingQuerySelection"&&(u("Queries cannot be changed for a brand with a pending analysis.",{variant:"warning"}),a(o,{replace:!0})))},[Ie==null||(n=Ie.data)===null||n===void 0?void 0:n.setupStatus,s,a,o,u]),F.useEffect(function(){var oe;if(X!=null&&(oe=X.data)!==null&&oe!==void 0&&oe.queries&&Array.isArray(X.data.queries)){var pe=X.data.queries.slice(0,fs);y(pe.map(function(Oe,Ee){return{id:"query-".concat(Ee),text:Oe,isRegenerating:!1}})),A(X.data.queries.slice(fs))}else je&&(y(Array.from({length:fs},function(Oe,Ee){return{id:"query-".concat(Ee),text:"",isRegenerating:!1}})),A([]))},[X,je]);var de=F.useCallback(function(oe){var pe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;setTimeout(function(){y(function(Oe){return Oe.map(function(Ee,He){var Et=x.indexOf(He.toString());return Et>=0&&oe[Et]?_n(_n({},Ee),{},{text:oe[Et],isRegenerating:!1}):_n(_n({},Ee),{},{isRegenerating:!1})})}),k([]),R(!1),b(!1),pe&&A(function(Oe){var Ee=new Set(oe);return Oe.filter(function(He){return!Ee.has(He)})})},xI)},[x]);F.useEffect(function(){if(B&&!ge){var oe;if(X!=null&&(oe=X.data)!==null&&oe!==void 0&&oe.queries&&Array.isArray(X.data.queries)){var pe=X.data.queries.slice(0,fs),Oe=x.map(Number);y(function(Ee){return Ee.map(function(He,Et){var tn=Oe.indexOf(Et);return _n(_n({},He),{},{text:tn>=0&&pe[tn]?pe[tn]:He.text,isRegenerating:!1})})}),k([]),R(!1),b(!1)}else je&&(y(function(Ee){return Ee.map(function(He){return _n(_n({},He),{},{isRegenerating:!1})})}),k([]),R(!1),b(!1))}},[X,ge,B,x,je]);var me=F.useCallback(function(oe,pe){var Oe=new Set(pe);return O.filter(function(Ee){return!Oe.has(Ee)}).slice(0,oe)},[O]),fe=F.useMemo(function(){return ge||h.length===0||h.some(function(oe){return oe.isRegenerating||oe.text===Ko&&!je||oe.text.trim()===""})||v},[ge,h,v,je]),Fe=ge||h.some(function(oe){return oe.text===Ko})&&!je,Zt=F.useCallback(function(oe){var pe=oe.toString();k(function(Oe){return Oe.includes(pe)?Oe.filter(function(Ee){return Ee!==pe}):[].concat(aI(Oe),[pe])})},[]),It=F.useCallback(function(oe,pe){y(function(Oe){return Oe.map(function(Ee,He){return He===oe?_n(_n({},Ee),{},{text:pe}):Ee})})},[]),Jt=function(){b(!v),k([])},en=F.useCallback(function(){if(!(ge||x.length===0)){y(function(He){return He.map(function(Et,tn){return _n(_n({},Et),{},{isRegenerating:x.includes(tn.toString())})})});var oe=h.map(function(He){return He.text}),pe=x.length,Oe=me(pe,oe),Ee=Oe.length>=pe;Ee?de(Oe,!0):(R(!0),se())}},[ge,x,se,h,me,de]),Ae=F.useCallback(function(oe){if(oe.preventDefault(),!!s){if(ze()){z(!0);return}Ne({brandId:s,data:{queries:h.map(function(pe){return pe.text})}})}},[s,h,Ne,ze]),Ke=function(){J(!0)};return g.jsxs("div",{children:[I&&g.jsx(E.Alert,{className:"yst-mb-4",variant:"error",children:I}),g.jsxs("form",{onSubmit:Ae,children:[g.jsxs("div",{className:"yst-mb-8",children:[g.jsx(E.Title,{size:"2",className:"yst-mb-2",children:"Your queries"}),g.jsxs("div",{className:"yst-space-y-4",children:[g.jsx("p",{children:"You can edit your queries or regenerate new ones with AI."}),g.jsx("div",{className:ke("yst-flex yst-gap-2",v?"yst-justify-end":"yst-justify-start"),children:v?g.jsxs(g.Fragment,{children:[g.jsx(E.Button,{size:"small",variant:"secondary",onClick:Jt,children:"Done"}),g.jsxs(E.Button,{variant:"secondary",size:"small",onClick:en,className:"yst-gap-1",isLoading:ge||B,disabled:B||ge||x.length===0,children:[g.jsx(hp,{"aria-hidden":"true"}),"Regenerate selected queries"]})]}):g.jsxs(E.Button,{size:"small",variant:"secondary",onClick:Jt,className:"yst-gap-1.5",disabled:Fe||je,children:[g.jsx(n6,{}),"Select queries to regenerate"]})})]})]}),g.jsx("div",{className:"yst-mb-8",children:h.length===0?wI.map(function(oe,pe){return g.jsx("div",{className:ke("yst-mb-4 yst-cursor-pointer yst-rounded yst-border yst-border-slate-300 yst-p-3 yst-transition-colors","yst-bg-white"),children:g.jsx(E.SkeletonLoader,{children:oe||"Example placeholder query for demonstration purposes."})},"placeholder-query-".concat(pe))}):h.slice(0,fs).map(function(oe,pe){var Oe=oe.isRegenerating?oe.text===Ko?Ko:vI:oe.text;return g.jsx("div",{className:ke("yst-mb-4"),children:g.jsxs("div",{className:"yst-flex yst-gap-2",children:[v&&g.jsx("div",{className:"yst-flex yst-items-center",children:g.jsx(E.Checkbox,{id:"query-regenerate-".concat(pe),name:"query-regenerate-".concat(pe),value:pe.toString(),checked:x.includes(pe.toString()),onChange:function(){return Zt(pe)},disabled:ge})}),g.jsx("div",{className:"yst-flex-1",children:g.jsx(E.TextField,{id:"query-text-".concat(pe),label:"Query ".concat(pe+1),type:"text",value:Oe,onChange:function(Ee){oe.isRegenerating||It(pe,Ee.target.value)},placeholder:"Enter your query...",className:"yst-w-full",disabled:oe.isRegenerating,required:!0,minLength:3,maxLength:255,validation:st(oe.text)?{variant:"warning",message:"For more accurate insights, avoid using your brand name in the query."}:void 0})})]})},oe.id)})}),g.jsx(yx,{buttonText:"Run analysis (~ 5 minutes)",isButtonDisabled:fe,isLoading:Le})]}),g.jsx(E.Modal,{isOpen:je&&M5(ye)&&(ye==null||(r=ye.response)===null||r===void 0?void 0:r.status)===429&&!ne,onClose:Ke,position:"center",as:"div",children:g.jsx(E.Modal.Panel,{children:g.jsxs("div",{className:"yst-flex yst-items-start yst-justify-stretch yst-gap-4",children:[g.jsx("div",{children:g.jsx("span",{className:"yst-inline-flex yst-h-10 yst-w-10 yst-items-center yst-justify-center yst-rounded-full yst-bg-red-100",children:g.jsx(Fd,{className:"yst-h-6 yst-w-6 yst-text-red-600"})})}),g.jsxs("div",{className:"yst-flex-1",children:[g.jsx(E.Modal.Container.Header,{className:"yst-mb-3 yst-w-full",children:g.jsx(E.Modal.Title,{as:"h3",className:"yst-text-lg yst-font-medium",children:"Query regeneration limit reached"})}),g.jsx(E.Modal.Container.Content,{className:"yst-mb-6 yst-space-y-3",children:g.jsx("p",{className:"yst-text-sm yst-text-slate-600",children:"You’ve used all your query regenerations for this brand analysis, but you can still edit your queries manually."})}),g.jsxs(E.Modal.Container.Footer,{className:"yst-flex yst-justify-end yst-gap-3",children:[g.jsx(E.Button,{variant:"secondary",onClick:Ke,children:"Cancel"}),g.jsx(E.Button,{variant:"primary",onClick:Ke,children:"Edit queries manually"})]})]})]})})}),g.jsx(E.Modal,{isOpen:U,onClose:Ve,position:"center",as:"div",children:g.jsx(E.Modal.Panel,{children:g.jsxs("div",{className:"yst-flex yst-items-start yst-justify-stretch yst-gap-4",children:[g.jsx("div",{children:g.jsx("span",{className:"yst-inline-flex yst-h-10 yst-w-10 yst-items-center yst-justify-center yst-rounded-full yst-bg-amber-100",children:g.jsx(Fd,{className:"yst-h-6 yst-w-6 yst-text-amber-600"})})}),g.jsxs("div",{className:"yst-flex-1",children:[g.jsx(E.Modal.Container.Header,{className:"yst-mb-3 yst-w-full",children:g.jsx(E.Modal.Title,{as:"h3",className:"yst-text-lg yst-font-medium",children:"Brand name detected in your queries"})}),g.jsxs(E.Modal.Container.Content,{className:"yst-mb-6 yst-space-y-3",children:[g.jsx("p",{className:"yst-text-sm yst-text-slate-600",children:"We found your brand name in one or more of your queries. Using your brand name in queries often show more mentions and more positive sentiment, which can skew your results."}),g.jsx("p",{className:"yst-text-sm yst-text-slate-600",children:"For more balanced results, remove your brand name or make the queries more general."})]}),g.jsxs(E.Modal.Container.Footer,{className:"yst-flex yst-justify-end yst-gap-3",children:[g.jsxs(E.Button,{onClick:ee,variant:"secondary",className:"yst-gap-1.5",disabled:Le,isLoading:Le,children:[g.jsx(hp,{}),"Run analysis anyway"]}),g.jsx(E.Button,{variant:"primary",onClick:$e,children:"Review and edit queries"})]})]})]})})})]})};const _I=Object.freeze(Object.defineProperty({__proto__:null,default:CI},Symbol.toStringTag,{value:"Module"}));var kI=["min","max","progress","className"];function OI(e,t){if(e==null)return{};var n,r,i=EI(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function EI(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var vx=F.forwardRef(function(e,t){var n=e.min,r=e.max,i=e.progress,s=e.className,o=OI(e,kI),a=F.useMemo(function(){var u=Math.max(0,r-n);if(u===0)return 0;var c=(i-n)/u*100;return Math.max(0,Math.min(100,c))},[n,r,i]),l=Math.min(Math.max(i,n),r);return g.jsx("div",{ref:t,role:"progressbar","aria-valuemin":n,"aria-valuemax":r,"aria-valuenow":l,"aria-valuetext":"".concat(Math.round(a),"%"),className:ke(s),...o,children:g.jsx("div",{className:"yst-relative yst-h-2 yst-w-full yst-overflow-hidden yst-rounded-full yst-bg-slate-200/40",children:g.jsx("div",{className:"yst-absolute yst-left-0 yst-top-0 yst-h-full yst-rounded-full yst-bg-[linear-gradient(97.38deg,_#A61E69_0%,_#6366F1_100%)] yst-transition-[width] yst-duration-300 yst-ease-out",style:{width:"".concat(a,"%")}})})})});vx.displayName="ProgressBarGradient";var ls=[{labelAbove:"Running queries...",label:"Running queries",threshold:99},{labelAbove:"Done!",label:"Building analysis",threshold:100}],bx=function(t){var n=t.progress,r=n===void 0?0:n,i=t.className,s=i===void 0?"":i,o=function(){for(var u=0;u<ls.length;u++)if(r<=ls[u].threshold)return ls[u];return ls[ls.length-1]},a=o();return g.jsxs("div",{className:ke("yst-font-medium yst-text-slate-800",s),children:[g.jsxs("div",{className:"yst-flex yst-items-center yst-justify-center yst-gap-2",children:[r<100?g.jsx(E.Spinner,{}):g.jsx(_2,{className:"yst-text-green-400"}),g.jsx("span",{className:"yst-text-sm yst-font-medium yst-italic",children:a.labelAbove})]}),g.jsx(vx,{className:"yst-mt-3",progress:r,min:0,max:100}),g.jsx("div",{className:"yst-mt-3 yst-flex yst-justify-between yst-text-xs",children:ls.map(function(l){return g.jsx("span",{children:g.jsx(Ku,{disabled:a.label!==l.label,children:l.label})},l.label)})})]})};bx.propTypes={progress:zd.number,className:zd.string};var AI=function(t){switch(t){case"pending":case"processing":return 2*1e3;case"completed":return!1;default:return 10*1e3}},TI=function(){var t,n,r,i=xn(),s=Yt(),o=Eu(),a=Gn(),l=a.brandId,u=o.brandId||l,c=ou(u,{query:{enabled:!!u,select:function(C){var x=C.data;return x}}}),d=c.data,f=J5(u,"latest",{query:{enabled:!!u,select:function(C){var x=C.data;return x},refetchInterval:function(C){var x,k=C==null||(x=C.state)===null||x===void 0||(x=x.data)===null||x===void 0?void 0:x.data;return AI(k==null?void 0:k.status)}}}),h=f.data,y=h==null?void 0:h.id,m=y?"/brands/".concat(u,"/analysis/").concat(y):"/brands/".concat(u);F.useEffect(function(){var S=(h==null?void 0:h.status)==="pending"||(h==null?void 0:h.status)==="processing"||(h==null?void 0:h.status)==="completed";d!=null&&d.nextScheduledAnalysis&&h!==null&&h!==void 0&&h.status&&F7(d.nextScheduledAnalysis,5)&&!S&&i("/brands/".concat(u),{replace:!0})},[d==null?void 0:d.nextScheduledAnalysis,u,i,h==null?void 0:h.status]),F.useEffect(function(){((d==null?void 0:d.setupStatus)==="completed"||(d==null?void 0:d.setupStatus)==="scheduledFirstAnalysis"&&d!==null&&d!==void 0&&d.firstNextAnalysisOpportunity&&!R2(d.firstNextAnalysisOpportunity,2))&&i(m,{replace:!0})},[d==null?void 0:d.firstNextAnalysisOpportunity,d==null?void 0:d.setupStatus,m,i]);var p=d==null||(t=d.queries)===null||t===void 0?void 0:t.length,v=(h==null||(n=h.completedQueries)===null||n===void 0?void 0:n.length)||0,b=function(){if(p&&p>0){var S=80/p,C=v*S;return(h==null?void 0:h.status)==="completed"?100:Math.round(Math.min(C,80))}return 0}();return g.jsxs("div",{children:[g.jsxs("div",{className:"yst-space-y-8",children:[g.jsx(bx,{progress:b}),g.jsx(Xa,{}),g.jsx("div",{className:"yst-space-y-8",children:d==null||(r=d.queries)===null||r===void 0?void 0:r.map(function(S){var C,x=S.id,k=S.query,w=x&&(h==null||(C=h.completedQueries)===null||C===void 0?void 0:C.includes(x));return g.jsxs("div",{className:ke("yst-flex yst-items-center yst-justify-between yst-gap-3"),children:[w===!0?g.jsx(_2,{className:"yst-h-5 yst-w-5 yst-text-green-400"}):g.jsx(E.Spinner,{}),g.jsx("span",{className:"yst-flex-1 yst-text-sm",children:k})]},"result-item-".concat(k))})})]}),g.jsx("div",{className:"yst-mb-[-2rem] yst-ml-[-2rem] yst-mr-[-2rem] yst-mt-8 yst-flex yst-justify-end yst-gap-4 yst-rounded-bl-lg yst-rounded-br-lg yst-border-t yst-border-slate-200 yst-bg-slate-50 yst-px-8 yst-py-6",children:g.jsx(E.Button,{as:di,to:m,onClick:function(S){if(b!==100){S.preventDefault();return}s.clear()},disabled:b!==100,children:"Continue →"})})]})};const PI=Object.freeze(Object.defineProperty({__proto__:null,default:TI},Symbol.toStringTag,{value:"Module"}));exports.AIInsightsClient=xT;exports.setApiBaseUrl=f2;
|
|
1297
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function px(e,t){if(e){if(typeof e=="string")return Cf(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Cf(e,t):void 0}}function Cf(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function mI(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,o,a=[],l=!0,u=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(l=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return a}}function pI(e){if(Array.isArray(e))return e}var fs=5,Ko="Generating...",vI="Re-generating...",bI=100,xI=800,wI=["******************************","***********************","*******************************************************","***********************************************","***************************************************************","*******************************************************","*******************************************************","***********************************************"],SI=Array.from({length:fs},function(e,t){return{id:"query-".concat(t),text:Ko,isRegenerating:!0}}),CI=function(){var t,n,r,i=Eu(),s=i.brandId,o="/setup/".concat(s,"/analysis"),a=xn(),l=Yt(),u=qf(),c=F.useRef(!1),d=F.useState(SI),f=Nr(d,2),h=f[0],y=f[1],m=F.useState(!1),p=Nr(m,2),v=p[0],b=p[1],S=F.useState([]),C=Nr(S,2),x=C[0],k=C[1],w=F.useState([]),_=Nr(w,2),O=_[0],A=_[1],T=F.useState(!1),j=Nr(T,2),B=j[0],R=j[1],P=F.useState(null),M=Nr(P,2),I=M[0],G=M[1],Y=F.useState(!1),q=Nr(Y,2),U=q[0],z=q[1],V=F.useState(!1),N=Nr(V,2),ne=N[0],J=N[1],he=T4(s||"",{query:{enabled:!!s}}),X=he.data,ge=he.isRefetching,ye=he.error,je=he.isError,se=he.refetch,nt=ou(s||"",{query:{enabled:!!s}}),Ie=nt.data,st=F.useCallback(function(oe){var pe;if(!(Ie!=null&&(pe=Ie.data)!==null&&pe!==void 0&&pe.name))return!1;var Oe=Ie.data.name.toLowerCase().trim();return Oe?oe.toLowerCase().includes(Oe):!1},[Ie==null||(t=Ie.data)===null||t===void 0?void 0:t.name]),ze=F.useCallback(function(){return h.some(function(oe){return st(oe.text)})},[h,st]),Ke=function(){z(!1)},ee=function(){z(!1),s&&Ne({brandId:s,data:{queries:h.map(function(pe){return pe.text})}})},$e=function(){z(!1);var pe=h.findIndex(function(Oe){return st(Oe.text)});pe!==-1&&setTimeout(function(){var Oe=document.getElementById("query-text-".concat(pe));Oe&&(Oe.focus(),Oe.select())},bI)},ot=k4({mutation:{onSuccess:function(){var oe=gI(Sf().m(function Oe(Ee){return Sf().w(function(He){for(;;)switch(He.n){case 0:if(G(null),!(Ee!=null&&Ee.status&&Ee.status>=200&&Ee.status<300)){He.n=2;break}return He.n=1,Promise.all([l.invalidateQueries({queryKey:zu(s||"")}),l.invalidateQueries({queryKey:rr()})]);case 1:a(o);case 2:return He.a(2)}},Oe)}));function pe(Oe){return oe.apply(this,arguments)}return pe}(),onError:function(pe){var Oe,Ee;if((pe==null||(Oe=pe.response)===null||Oe===void 0||(Oe=Oe.data)===null||Oe===void 0?void 0:Oe.message)==="Cannot update queries for a brand that has existing analyses."){a(o,{replace:!0});return}var He=(pe==null||(Ee=pe.response)===null||Ee===void 0||(Ee=Ee.data)===null||Ee===void 0?void 0:Ee.message)||(pe==null?void 0:pe.message)||"An unexpected error occurred.";G(He)}}}),Ne=ot.mutate,Le=ot.isPending;F.useEffect(function(){s||a("/setup",{replace:!0})},[s,a,u]),F.useEffect(function(){var oe;!(Ie!=null&&(oe=Ie.data)!==null&&oe!==void 0&&oe.setupStatus)||c.current||(c.current=!0,Ie.data.setupStatus!=="pendingQuerySelection"&&(u("Queries cannot be changed for a brand with a pending analysis.",{variant:"warning"}),a(o,{replace:!0})))},[Ie==null||(n=Ie.data)===null||n===void 0?void 0:n.setupStatus,s,a,o,u]),F.useEffect(function(){var oe;if(X!=null&&(oe=X.data)!==null&&oe!==void 0&&oe.queries&&Array.isArray(X.data.queries)){var pe=X.data.queries.slice(0,fs);y(pe.map(function(Oe,Ee){return{id:"query-".concat(Ee),text:Oe,isRegenerating:!1}})),A(X.data.queries.slice(fs))}else je&&(y(Array.from({length:fs},function(Oe,Ee){return{id:"query-".concat(Ee),text:"",isRegenerating:!1}})),A([]))},[X,je]);var de=F.useCallback(function(oe){var pe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;setTimeout(function(){y(function(Oe){return Oe.map(function(Ee,He){var Et=x.indexOf(He.toString());return Et>=0&&oe[Et]?_n(_n({},Ee),{},{text:oe[Et],isRegenerating:!1}):_n(_n({},Ee),{},{isRegenerating:!1})})}),k([]),R(!1),b(!1),pe&&A(function(Oe){var Ee=new Set(oe);return Oe.filter(function(He){return!Ee.has(He)})})},xI)},[x]);F.useEffect(function(){if(B&&!ge){var oe;if(X!=null&&(oe=X.data)!==null&&oe!==void 0&&oe.queries&&Array.isArray(X.data.queries)){var pe=X.data.queries.slice(0,fs),Oe=x.map(Number);y(function(Ee){return Ee.map(function(He,Et){var tn=Oe.indexOf(Et);return _n(_n({},He),{},{text:tn>=0&&pe[tn]?pe[tn]:He.text,isRegenerating:!1})})}),k([]),R(!1),b(!1)}else je&&(y(function(Ee){return Ee.map(function(He){return _n(_n({},He),{},{isRegenerating:!1})})}),k([]),R(!1),b(!1))}},[X,ge,B,x,je]);var me=F.useCallback(function(oe,pe){var Oe=new Set(pe);return O.filter(function(Ee){return!Oe.has(Ee)}).slice(0,oe)},[O]),fe=F.useMemo(function(){return ge||h.length===0||h.some(function(oe){return oe.isRegenerating||oe.text===Ko&&!je||oe.text.trim()===""})||v},[ge,h,v,je]),Fe=ge||h.some(function(oe){return oe.text===Ko})&&!je,Zt=F.useCallback(function(oe){var pe=oe.toString();k(function(Oe){return Oe.includes(pe)?Oe.filter(function(Ee){return Ee!==pe}):[].concat(aI(Oe),[pe])})},[]),It=F.useCallback(function(oe,pe){y(function(Oe){return Oe.map(function(Ee,He){return He===oe?_n(_n({},Ee),{},{text:pe}):Ee})})},[]),Jt=function(){b(!v),k([])},en=F.useCallback(function(){if(!(ge||x.length===0)){y(function(He){return He.map(function(Et,tn){return _n(_n({},Et),{},{isRegenerating:x.includes(tn.toString())})})});var oe=h.map(function(He){return He.text}),pe=x.length,Oe=me(pe,oe),Ee=Oe.length>=pe;Ee?de(Oe,!0):(R(!0),se())}},[ge,x,se,h,me,de]),Ae=F.useCallback(function(oe){if(oe.preventDefault(),!!s){if(ze()){z(!0);return}Ne({brandId:s,data:{queries:h.map(function(pe){return pe.text})}})}},[s,h,Ne,ze]),Ve=function(){J(!0)};return g.jsxs("div",{children:[I&&g.jsx(E.Alert,{className:"yst-mb-4",variant:"error",children:I}),g.jsxs("form",{onSubmit:Ae,children:[g.jsxs("div",{className:"yst-mb-8",children:[g.jsx(E.Title,{size:"2",className:"yst-mb-2",children:"Your queries"}),g.jsxs("div",{className:"yst-space-y-4",children:[g.jsx("p",{children:"You can edit your queries or regenerate new ones with AI."}),g.jsx("div",{className:ke("yst-flex yst-gap-2",v?"yst-justify-end":"yst-justify-start"),children:v?g.jsxs(g.Fragment,{children:[g.jsx(E.Button,{size:"small",variant:"secondary",onClick:Jt,children:"Done"}),g.jsxs(E.Button,{variant:"secondary",size:"small",onClick:en,className:"yst-gap-1",isLoading:ge||B,disabled:B||ge||x.length===0,children:[g.jsx(hp,{"aria-hidden":"true"}),"Regenerate selected queries"]})]}):g.jsxs(E.Button,{size:"small",variant:"secondary",onClick:Jt,className:"yst-gap-1.5",disabled:Fe||je,children:[g.jsx(n6,{}),"Select queries to regenerate"]})})]})]}),g.jsx("div",{className:"yst-mb-8",children:h.length===0?wI.map(function(oe,pe){return g.jsx("div",{className:ke("yst-mb-4 yst-cursor-pointer yst-rounded yst-border yst-border-slate-300 yst-p-3 yst-transition-colors","yst-bg-white"),children:g.jsx(E.SkeletonLoader,{children:oe||"Example placeholder query for demonstration purposes."})},"placeholder-query-".concat(pe))}):h.slice(0,fs).map(function(oe,pe){var Oe=oe.isRegenerating?oe.text===Ko?Ko:vI:oe.text;return g.jsx("div",{className:ke("yst-mb-4"),children:g.jsxs("div",{className:"yst-flex yst-gap-2",children:[v&&g.jsx("div",{className:"yst-flex yst-items-center",children:g.jsx(E.Checkbox,{id:"query-regenerate-".concat(pe),name:"query-regenerate-".concat(pe),value:pe.toString(),checked:x.includes(pe.toString()),onChange:function(){return Zt(pe)},disabled:ge})}),g.jsx("div",{className:"yst-flex-1",children:g.jsx(E.TextField,{id:"query-text-".concat(pe),label:"Query ".concat(pe+1),type:"text",value:Oe,onChange:function(Ee){oe.isRegenerating||It(pe,Ee.target.value)},placeholder:"Enter your query...",className:"yst-w-full",disabled:oe.isRegenerating,required:!0,minLength:3,maxLength:255,validation:st(oe.text)?{variant:"warning",message:"For more accurate insights, avoid using your brand name in the query."}:void 0})})]})},oe.id)})}),g.jsx(yx,{buttonText:"Run analysis (~ 5 minutes)",isButtonDisabled:fe,isLoading:Le})]}),g.jsx(E.Modal,{isOpen:je&&M5(ye)&&(ye==null||(r=ye.response)===null||r===void 0?void 0:r.status)===429&&!ne,onClose:Ve,position:"center",as:"div",children:g.jsx(E.Modal.Panel,{children:g.jsxs("div",{className:"yst-flex yst-items-start yst-justify-stretch yst-gap-4",children:[g.jsx("div",{children:g.jsx("span",{className:"yst-inline-flex yst-h-10 yst-w-10 yst-items-center yst-justify-center yst-rounded-full yst-bg-red-100",children:g.jsx(Fd,{className:"yst-h-6 yst-w-6 yst-text-red-600"})})}),g.jsxs("div",{className:"yst-flex-1",children:[g.jsx(E.Modal.Container.Header,{className:"yst-mb-3 yst-w-full",children:g.jsx(E.Modal.Title,{as:"h3",className:"yst-text-lg yst-font-medium",children:"Query regeneration limit reached"})}),g.jsx(E.Modal.Container.Content,{className:"yst-mb-6 yst-space-y-3",children:g.jsx("p",{className:"yst-text-sm yst-text-slate-600",children:"You’ve used all your query regenerations for this brand analysis, but you can still edit your queries manually."})}),g.jsx(E.Modal.Container.Footer,{className:"yst-flex yst-justify-end yst-gap-3",children:g.jsx(E.Button,{variant:"primary",onClick:Ve,children:"Edit queries manually"})})]})]})})}),g.jsx(E.Modal,{isOpen:U,onClose:Ke,position:"center",as:"div",children:g.jsx(E.Modal.Panel,{children:g.jsxs("div",{className:"yst-flex yst-items-start yst-justify-stretch yst-gap-4",children:[g.jsx("div",{children:g.jsx("span",{className:"yst-inline-flex yst-h-10 yst-w-10 yst-items-center yst-justify-center yst-rounded-full yst-bg-amber-100",children:g.jsx(Fd,{className:"yst-h-6 yst-w-6 yst-text-amber-600"})})}),g.jsxs("div",{className:"yst-flex-1",children:[g.jsx(E.Modal.Container.Header,{className:"yst-mb-3 yst-w-full",children:g.jsx(E.Modal.Title,{as:"h3",className:"yst-text-lg yst-font-medium",children:"Brand name detected in your queries"})}),g.jsxs(E.Modal.Container.Content,{className:"yst-mb-6 yst-space-y-3",children:[g.jsx("p",{className:"yst-text-sm yst-text-slate-600",children:"We found your brand name in one or more of your queries. Using your brand name in queries often show more mentions and more positive sentiment, which can skew your results."}),g.jsx("p",{className:"yst-text-sm yst-text-slate-600",children:"For more balanced results, remove your brand name or make the queries more general."})]}),g.jsxs(E.Modal.Container.Footer,{className:"yst-flex yst-justify-end yst-gap-3",children:[g.jsxs(E.Button,{onClick:ee,variant:"secondary",className:"yst-gap-1.5",disabled:Le,isLoading:Le,children:[g.jsx(hp,{}),"Run analysis anyway"]}),g.jsx(E.Button,{variant:"primary",onClick:$e,children:"Review and edit queries"})]})]})]})})})]})};const _I=Object.freeze(Object.defineProperty({__proto__:null,default:CI},Symbol.toStringTag,{value:"Module"}));var kI=["min","max","progress","className"];function OI(e,t){if(e==null)return{};var n,r,i=EI(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function EI(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var vx=F.forwardRef(function(e,t){var n=e.min,r=e.max,i=e.progress,s=e.className,o=OI(e,kI),a=F.useMemo(function(){var u=Math.max(0,r-n);if(u===0)return 0;var c=(i-n)/u*100;return Math.max(0,Math.min(100,c))},[n,r,i]),l=Math.min(Math.max(i,n),r);return g.jsx("div",{ref:t,role:"progressbar","aria-valuemin":n,"aria-valuemax":r,"aria-valuenow":l,"aria-valuetext":"".concat(Math.round(a),"%"),className:ke(s),...o,children:g.jsx("div",{className:"yst-relative yst-h-2 yst-w-full yst-overflow-hidden yst-rounded-full yst-bg-slate-200/40",children:g.jsx("div",{className:"yst-absolute yst-left-0 yst-top-0 yst-h-full yst-rounded-full yst-bg-[linear-gradient(97.38deg,_#A61E69_0%,_#6366F1_100%)] yst-transition-[width] yst-duration-300 yst-ease-out",style:{width:"".concat(a,"%")}})})})});vx.displayName="ProgressBarGradient";var ls=[{labelAbove:"Running queries...",label:"Running queries",threshold:99},{labelAbove:"Done!",label:"Building analysis",threshold:100}],bx=function(t){var n=t.progress,r=n===void 0?0:n,i=t.className,s=i===void 0?"":i,o=function(){for(var u=0;u<ls.length;u++)if(r<=ls[u].threshold)return ls[u];return ls[ls.length-1]},a=o();return g.jsxs("div",{className:ke("yst-font-medium yst-text-slate-800",s),children:[g.jsxs("div",{className:"yst-flex yst-items-center yst-justify-center yst-gap-2",children:[r<100?g.jsx(E.Spinner,{}):g.jsx(_2,{className:"yst-text-green-400"}),g.jsx("span",{className:"yst-text-sm yst-font-medium yst-italic",children:a.labelAbove})]}),g.jsx(vx,{className:"yst-mt-3",progress:r,min:0,max:100}),g.jsx("div",{className:"yst-mt-3 yst-flex yst-justify-between yst-text-xs",children:ls.map(function(l){return g.jsx("span",{children:g.jsx(Ku,{disabled:a.label!==l.label,children:l.label})},l.label)})})]})};bx.propTypes={progress:zd.number,className:zd.string};var AI=function(t){switch(t){case"pending":case"processing":return 2*1e3;case"completed":return!1;default:return 10*1e3}},TI=function(){var t,n,r,i=xn(),s=Yt(),o=Eu(),a=Gn(),l=a.brandId,u=o.brandId||l,c=ou(u,{query:{enabled:!!u,select:function(C){var x=C.data;return x}}}),d=c.data,f=J5(u,"latest",{query:{enabled:!!u,select:function(C){var x=C.data;return x},refetchInterval:function(C){var x,k=C==null||(x=C.state)===null||x===void 0||(x=x.data)===null||x===void 0?void 0:x.data;return AI(k==null?void 0:k.status)}}}),h=f.data,y=h==null?void 0:h.id,m=y?"/brands/".concat(u,"/analysis/").concat(y):"/brands/".concat(u);F.useEffect(function(){var S=(h==null?void 0:h.status)==="pending"||(h==null?void 0:h.status)==="processing"||(h==null?void 0:h.status)==="completed";d!=null&&d.nextScheduledAnalysis&&h!==null&&h!==void 0&&h.status&&F7(d.nextScheduledAnalysis,5)&&!S&&i("/brands/".concat(u),{replace:!0})},[d==null?void 0:d.nextScheduledAnalysis,u,i,h==null?void 0:h.status]),F.useEffect(function(){((d==null?void 0:d.setupStatus)==="completed"||(d==null?void 0:d.setupStatus)==="scheduledFirstAnalysis"&&d!==null&&d!==void 0&&d.firstNextAnalysisOpportunity&&!R2(d.firstNextAnalysisOpportunity,2))&&i(m,{replace:!0})},[d==null?void 0:d.firstNextAnalysisOpportunity,d==null?void 0:d.setupStatus,m,i]);var p=d==null||(t=d.queries)===null||t===void 0?void 0:t.length,v=(h==null||(n=h.completedQueries)===null||n===void 0?void 0:n.length)||0,b=function(){if(p&&p>0){var S=80/p,C=v*S;return(h==null?void 0:h.status)==="completed"?100:Math.round(Math.min(C,80))}return 0}();return g.jsxs("div",{children:[g.jsxs("div",{className:"yst-space-y-8",children:[g.jsx(bx,{progress:b}),g.jsx(Xa,{}),g.jsx("div",{className:"yst-space-y-8",children:d==null||(r=d.queries)===null||r===void 0?void 0:r.map(function(S){var C,x=S.id,k=S.query,w=x&&(h==null||(C=h.completedQueries)===null||C===void 0?void 0:C.includes(x));return g.jsxs("div",{className:ke("yst-flex yst-items-center yst-justify-between yst-gap-3"),children:[w===!0?g.jsx(_2,{className:"yst-h-5 yst-w-5 yst-text-green-400"}):g.jsx(E.Spinner,{}),g.jsx("span",{className:"yst-flex-1 yst-text-sm",children:k})]},"result-item-".concat(k))})})]}),g.jsx("div",{className:"yst-mb-[-2rem] yst-ml-[-2rem] yst-mr-[-2rem] yst-mt-8 yst-flex yst-justify-end yst-gap-4 yst-rounded-bl-lg yst-rounded-br-lg yst-border-t yst-border-slate-200 yst-bg-slate-50 yst-px-8 yst-py-6",children:g.jsx(E.Button,{as:di,to:m,onClick:function(S){if(b!==100){S.preventDefault();return}s.clear()},disabled:b!==100,children:"Continue →"})})]})};const PI=Object.freeze(Object.defineProperty({__proto__:null,default:TI},Symbol.toStringTag,{value:"Module"}));exports.AIInsightsClient=xT;exports.setApiBaseUrl=f2;
|
|
1298
1298
|
//# sourceMappingURL=ai-insights-client.cjs.js.map
|