diff --git a/pkg/ui/frontend/dist/assets/date-utils-B6syNIuD.js b/pkg/ui/frontend/dist/assets/date-utils-B7GSU5zA.js similarity index 91% rename from pkg/ui/frontend/dist/assets/date-utils-B6syNIuD.js rename to pkg/ui/frontend/dist/assets/date-utils-B7GSU5zA.js index a80c5673dc8f6..aa843a6bb184c 100644 --- a/pkg/ui/frontend/dist/assets/date-utils-B6syNIuD.js +++ b/pkg/ui/frontend/dist/assets/date-utils-B7GSU5zA.js @@ -1,5 +1,5 @@ -var Ir=Object.defineProperty;var Rr=(a,r,t)=>r in a?Ir(a,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[r]=t;var y=(a,r,t)=>Rr(a,typeof r!="symbol"?r+"":r,t);import{c as Z}from"./ui-utils-BNSC_Jv-.js";import{r as v,R as Fr,b as m,d as Lr}from"./react-core-D_V7s-9r.js";import{s as Wr,j as Ge,t as Ar,v as ft,w as Hr,x as $r,y as Qr,z as Br}from"./radix-core-ByqQ8fsu.js";function C(a){const r=Object.prototype.toString.call(a);return a instanceof Date||typeof a=="object"&&r==="[object Date]"?new a.constructor(+a):typeof a=="number"||r==="[object Number]"||typeof a=="string"||r==="[object String]"?new Date(a):new Date(NaN)}function oe(a,r){return a instanceof Date?new a.constructor(r):new Date(r)}function qr(a,r){const t=C(a);return isNaN(r)?oe(a,NaN):(r&&t.setDate(t.getDate()+r),t)}function Kr(a,r){const t=C(a);if(isNaN(r))return oe(a,NaN);if(!r)return t;const e=t.getDate(),n=oe(a,t.getTime());n.setMonth(t.getMonth()+r+1,0);const s=n.getDate();return e>=s?n:(t.setFullYear(n.getFullYear(),n.getMonth(),e),t)}function ze(a,r){const{years:t=0,months:e=0,weeks:n=0,days:s=0,hours:o=0,minutes:i=0,seconds:c=0}=r,u=C(a),l=e||t?Kr(u,e+t*12):u,d=s||n?qr(l,s+n*7):l,f=i+o*60,h=(c+f*60)*1e3;return oe(a,d.getTime()+h)}const Jn=6048e5,Vr=864e5,it=6e4,rn=36e5,mn=525600,Qe=43200,xt=1440;let Ur={};function Le(){return Ur}function ct(a,r){var i,c,u,l;const t=Le(),e=(r==null?void 0:r.weekStartsOn)??((c=(i=r==null?void 0:r.locale)==null?void 0:i.options)==null?void 0:c.weekStartsOn)??t.weekStartsOn??((l=(u=t.locale)==null?void 0:u.options)==null?void 0:l.weekStartsOn)??0,n=C(a),s=n.getDay(),o=(s=n.getTime()?t+1:r.getTime()>=o.getTime()?t:t-1}function gn(a){const r=C(a);return r.setHours(0,0,0,0),r}function qe(a){const r=C(a),t=new Date(Date.UTC(r.getFullYear(),r.getMonth(),r.getDate(),r.getHours(),r.getMinutes(),r.getSeconds(),r.getMilliseconds()));return t.setUTCFullYear(r.getFullYear()),+a-+t}function tr(a,r){const t=gn(a),e=gn(r),n=+t-qe(t),s=+e-qe(e);return Math.round((n-s)/Vr)}function jr(a){const r=er(a),t=oe(a,0);return t.setFullYear(r,0,4),t.setHours(0,0,0,0),St(t)}function Ne(a,r){const t=C(a),e=C(r),n=t.getTime()-e.getTime();return n<0?-1:n>0?1:n}function nr(a){return oe(a,Date.now())}function Xr(a){return a instanceof Date||typeof a=="object"&&Object.prototype.toString.call(a)==="[object Date]"}function Gr(a){if(!Xr(a)&&typeof a!="number")return!1;const r=C(a);return!isNaN(Number(r))}function zr(a,r){const t=C(a),e=C(r),n=t.getFullYear()-e.getFullYear(),s=t.getMonth()-e.getMonth();return n*12+s}function Zr(a,r){const t=C(a),e=C(r);return t.getFullYear()-e.getFullYear()}function Jr(a,r){const t=C(a),e=C(r),n=wn(t,e),s=Math.abs(tr(t,e));t.setDate(t.getDate()-n*s);const o=+(wn(t,e)===-n),i=n*(s-o);return i===0?0:i}function wn(a,r){const t=a.getFullYear()-r.getFullYear()||a.getMonth()-r.getMonth()||a.getDate()-r.getDate()||a.getHours()-r.getHours()||a.getMinutes()-r.getMinutes()||a.getSeconds()-r.getSeconds()||a.getMilliseconds()-r.getMilliseconds();return t<0?-1:t>0?1:t}function Ft(a){return r=>{const e=(a?Math[a]:Math.trunc)(r);return e===0?0:e}}function an(a,r){return+C(a)-+C(r)}function ea(a,r,t){const e=an(a,r)/rn;return Ft(t==null?void 0:t.roundingMethod)(e)}function ta(a,r,t){const e=an(a,r)/it;return Ft(t==null?void 0:t.roundingMethod)(e)}function na(a){const r=C(a);return r.setHours(23,59,59,999),r}function ra(a){const r=C(a),t=r.getMonth();return r.setFullYear(r.getFullYear(),t+1,0),r.setHours(23,59,59,999),r}function aa(a){const r=C(a);return+na(r)==+ra(r)}function rr(a,r){const t=C(a),e=C(r),n=Ne(t,e),s=Math.abs(zr(t,e));let o;if(s<1)o=0;else{t.getMonth()===1&&t.getDate()>27&&t.setDate(30),t.setMonth(t.getMonth()-n*s);let i=Ne(t,e)===-n;aa(C(a))&&s===1&&Ne(a,e)===1&&(i=!1),o=n*(s-Number(i))}return o===0?0:o}function ar(a,r,t){const e=an(a,r)/1e3;return Ft(t==null?void 0:t.roundingMethod)(e)}function sa(a,r){const t=C(a),e=C(r),n=Ne(t,e),s=Math.abs(Zr(t,e));t.setFullYear(1584),e.setFullYear(1584);const o=Ne(t,e)===-n,i=n*(s-+o);return i===0?0:i}function oa(a){const r=C(a),t=oe(a,0);return t.setFullYear(r.getFullYear(),0,1),t.setHours(0,0,0,0),t}const ia={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"}},ca=(a,r,t)=>{let e;const n=ia[a];return typeof n=="string"?e=n:r===1?e=n.one:e=n.other.replace("{{count}}",r.toString()),t!=null&&t.addSuffix?t.comparison&&t.comparison>0?"in "+e:e+" ago":e};function Bt(a){return(r={})=>{const t=r.width?String(r.width):a.defaultWidth;return a.formats[t]||a.formats[a.defaultWidth]}}const ua={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},la={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},da={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},fa={date:Bt({formats:ua,defaultWidth:"full"}),time:Bt({formats:la,defaultWidth:"full"}),dateTime:Bt({formats:da,defaultWidth:"full"})},pa={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},ha=(a,r,t,e)=>pa[a];function Ze(a){return(r,t)=>{const e=t!=null&&t.context?String(t.context):"standalone";let n;if(e==="formatting"&&a.formattingValues){const o=a.defaultFormattingWidth||a.defaultWidth,i=t!=null&&t.width?String(t.width):o;n=a.formattingValues[i]||a.formattingValues[o]}else{const o=a.defaultWidth,i=t!=null&&t.width?String(t.width):a.defaultWidth;n=a.values[i]||a.values[o]}const s=a.argumentCallback?a.argumentCallback(r):r;return n[s]}}const ma={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},ga={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},wa={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"]},Da={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"]},ya={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"}},va={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"}},ba=(a,r)=>{const t=Number(a),e=t%100;if(e>20||e<10)switch(e%10){case 1:return t+"st";case 2:return t+"nd";case 3:return t+"rd"}return t+"th"},ka={ordinalNumber:ba,era:Ze({values:ma,defaultWidth:"wide"}),quarter:Ze({values:ga,defaultWidth:"wide",argumentCallback:a=>a-1}),month:Ze({values:wa,defaultWidth:"wide"}),day:Ze({values:Da,defaultWidth:"wide"}),dayPeriod:Ze({values:ya,defaultWidth:"wide",formattingValues:va,defaultFormattingWidth:"wide"})};function Je(a){return(r,t={})=>{const e=t.width,n=e&&a.matchPatterns[e]||a.matchPatterns[a.defaultMatchWidth],s=r.match(n);if(!s)return null;const o=s[0],i=e&&a.parsePatterns[e]||a.parsePatterns[a.defaultParseWidth],c=Array.isArray(i)?Ma(i,d=>d.test(o)):_a(i,d=>d.test(o));let u;u=a.valueCallback?a.valueCallback(c):c,u=t.valueCallback?t.valueCallback(u):u;const l=r.slice(o.length);return{value:u,rest:l}}}function _a(a,r){for(const t in a)if(Object.prototype.hasOwnProperty.call(a,t)&&r(a[t]))return t}function Ma(a,r){for(let t=0;t{const e=r.match(a.matchPattern);if(!e)return null;const n=e[0],s=r.match(a.parsePattern);if(!s)return null;let o=a.valueCallback?a.valueCallback(s[0]):s[0];o=t.valueCallback?t.valueCallback(o):o;const i=r.slice(n.length);return{value:o,rest:i}}}const Sa=/^(\d+)(th|st|nd|rd)?/i,Ca=/\d+/i,Pa={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},Ta={any:[/^b/i,/^(a|c)/i]},Oa={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Ea={any:[/1/i,/2/i,/3/i,/4/i]},Na={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},Ya={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]},Ia={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},Ra={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]},Fa={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},La={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}},Wa={ordinalNumber:xa({matchPattern:Sa,parsePattern:Ca,valueCallback:a=>parseInt(a,10)}),era:Je({matchPatterns:Pa,defaultMatchWidth:"wide",parsePatterns:Ta,defaultParseWidth:"any"}),quarter:Je({matchPatterns:Oa,defaultMatchWidth:"wide",parsePatterns:Ea,defaultParseWidth:"any",valueCallback:a=>a+1}),month:Je({matchPatterns:Na,defaultMatchWidth:"wide",parsePatterns:Ya,defaultParseWidth:"any"}),day:Je({matchPatterns:Ia,defaultMatchWidth:"wide",parsePatterns:Ra,defaultParseWidth:"any"}),dayPeriod:Je({matchPatterns:Fa,defaultMatchWidth:"any",parsePatterns:La,defaultParseWidth:"any"})},Lt={code:"en-US",formatDistance:ca,formatLong:fa,formatRelative:ha,localize:ka,match:Wa,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Aa(a){const r=C(a);return tr(r,oa(r))+1}function Ha(a){const r=C(a),t=+St(r)-+jr(r);return Math.round(t/Jn)+1}function sr(a,r){var l,d,f,p;const t=C(a),e=t.getFullYear(),n=Le(),s=(r==null?void 0:r.firstWeekContainsDate)??((d=(l=r==null?void 0:r.locale)==null?void 0:l.options)==null?void 0:d.firstWeekContainsDate)??n.firstWeekContainsDate??((p=(f=n.locale)==null?void 0:f.options)==null?void 0:p.firstWeekContainsDate)??1,o=oe(a,0);o.setFullYear(e+1,0,s),o.setHours(0,0,0,0);const i=ct(o,r),c=oe(a,0);c.setFullYear(e,0,s),c.setHours(0,0,0,0);const u=ct(c,r);return t.getTime()>=i.getTime()?e+1:t.getTime()>=u.getTime()?e:e-1}function $a(a,r){var i,c,u,l;const t=Le(),e=(r==null?void 0:r.firstWeekContainsDate)??((c=(i=r==null?void 0:r.locale)==null?void 0:i.options)==null?void 0:c.firstWeekContainsDate)??t.firstWeekContainsDate??((l=(u=t.locale)==null?void 0:u.options)==null?void 0:l.firstWeekContainsDate)??1,n=sr(a,r),s=oe(a,0);return s.setFullYear(n,0,e),s.setHours(0,0,0,0),ct(s,r)}function Qa(a,r){const t=C(a),e=+ct(t,r)-+$a(t,r);return Math.round(e/Jn)+1}function T(a,r){const t=a<0?"-":"",e=Math.abs(a).toString().padStart(r,"0");return t+e}const _e={y(a,r){const t=a.getFullYear(),e=t>0?t:1-t;return T(r==="yy"?e%100:e,r.length)},M(a,r){const t=a.getMonth();return r==="M"?String(t+1):T(t+1,2)},d(a,r){return T(a.getDate(),r.length)},a(a,r){const t=a.getHours()/12>=1?"pm":"am";switch(r){case"a":case"aa":return t.toUpperCase();case"aaa":return t;case"aaaaa":return t[0];case"aaaa":default:return t==="am"?"a.m.":"p.m."}},h(a,r){return T(a.getHours()%12||12,r.length)},H(a,r){return T(a.getHours(),r.length)},m(a,r){return T(a.getMinutes(),r.length)},s(a,r){return T(a.getSeconds(),r.length)},S(a,r){const t=r.length,e=a.getMilliseconds(),n=Math.trunc(e*Math.pow(10,t-3));return T(n,r.length)}},Ae={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Dn={G:function(a,r,t){const e=a.getFullYear()>0?1:0;switch(r){case"G":case"GG":case"GGG":return t.era(e,{width:"abbreviated"});case"GGGGG":return t.era(e,{width:"narrow"});case"GGGG":default:return t.era(e,{width:"wide"})}},y:function(a,r,t){if(r==="yo"){const e=a.getFullYear(),n=e>0?e:1-e;return t.ordinalNumber(n,{unit:"year"})}return _e.y(a,r)},Y:function(a,r,t,e){const n=sr(a,e),s=n>0?n:1-n;if(r==="YY"){const o=s%100;return T(o,2)}return r==="Yo"?t.ordinalNumber(s,{unit:"year"}):T(s,r.length)},R:function(a,r){const t=er(a);return T(t,r.length)},u:function(a,r){const t=a.getFullYear();return T(t,r.length)},Q:function(a,r,t){const e=Math.ceil((a.getMonth()+1)/3);switch(r){case"Q":return String(e);case"QQ":return T(e,2);case"Qo":return t.ordinalNumber(e,{unit:"quarter"});case"QQQ":return t.quarter(e,{width:"abbreviated",context:"formatting"});case"QQQQQ":return t.quarter(e,{width:"narrow",context:"formatting"});case"QQQQ":default:return t.quarter(e,{width:"wide",context:"formatting"})}},q:function(a,r,t){const e=Math.ceil((a.getMonth()+1)/3);switch(r){case"q":return String(e);case"qq":return T(e,2);case"qo":return t.ordinalNumber(e,{unit:"quarter"});case"qqq":return t.quarter(e,{width:"abbreviated",context:"standalone"});case"qqqqq":return t.quarter(e,{width:"narrow",context:"standalone"});case"qqqq":default:return t.quarter(e,{width:"wide",context:"standalone"})}},M:function(a,r,t){const e=a.getMonth();switch(r){case"M":case"MM":return _e.M(a,r);case"Mo":return t.ordinalNumber(e+1,{unit:"month"});case"MMM":return t.month(e,{width:"abbreviated",context:"formatting"});case"MMMMM":return t.month(e,{width:"narrow",context:"formatting"});case"MMMM":default:return t.month(e,{width:"wide",context:"formatting"})}},L:function(a,r,t){const e=a.getMonth();switch(r){case"L":return String(e+1);case"LL":return T(e+1,2);case"Lo":return t.ordinalNumber(e+1,{unit:"month"});case"LLL":return t.month(e,{width:"abbreviated",context:"standalone"});case"LLLLL":return t.month(e,{width:"narrow",context:"standalone"});case"LLLL":default:return t.month(e,{width:"wide",context:"standalone"})}},w:function(a,r,t,e){const n=Qa(a,e);return r==="wo"?t.ordinalNumber(n,{unit:"week"}):T(n,r.length)},I:function(a,r,t){const e=Ha(a);return r==="Io"?t.ordinalNumber(e,{unit:"week"}):T(e,r.length)},d:function(a,r,t){return r==="do"?t.ordinalNumber(a.getDate(),{unit:"date"}):_e.d(a,r)},D:function(a,r,t){const e=Aa(a);return r==="Do"?t.ordinalNumber(e,{unit:"dayOfYear"}):T(e,r.length)},E:function(a,r,t){const e=a.getDay();switch(r){case"E":case"EE":case"EEE":return t.day(e,{width:"abbreviated",context:"formatting"});case"EEEEE":return t.day(e,{width:"narrow",context:"formatting"});case"EEEEEE":return t.day(e,{width:"short",context:"formatting"});case"EEEE":default:return t.day(e,{width:"wide",context:"formatting"})}},e:function(a,r,t,e){const n=a.getDay(),s=(n-e.weekStartsOn+8)%7||7;switch(r){case"e":return String(s);case"ee":return T(s,2);case"eo":return t.ordinalNumber(s,{unit:"day"});case"eee":return t.day(n,{width:"abbreviated",context:"formatting"});case"eeeee":return t.day(n,{width:"narrow",context:"formatting"});case"eeeeee":return t.day(n,{width:"short",context:"formatting"});case"eeee":default:return t.day(n,{width:"wide",context:"formatting"})}},c:function(a,r,t,e){const n=a.getDay(),s=(n-e.weekStartsOn+8)%7||7;switch(r){case"c":return String(s);case"cc":return T(s,r.length);case"co":return t.ordinalNumber(s,{unit:"day"});case"ccc":return t.day(n,{width:"abbreviated",context:"standalone"});case"ccccc":return t.day(n,{width:"narrow",context:"standalone"});case"cccccc":return t.day(n,{width:"short",context:"standalone"});case"cccc":default:return t.day(n,{width:"wide",context:"standalone"})}},i:function(a,r,t){const e=a.getDay(),n=e===0?7:e;switch(r){case"i":return String(n);case"ii":return T(n,r.length);case"io":return t.ordinalNumber(n,{unit:"day"});case"iii":return t.day(e,{width:"abbreviated",context:"formatting"});case"iiiii":return t.day(e,{width:"narrow",context:"formatting"});case"iiiiii":return t.day(e,{width:"short",context:"formatting"});case"iiii":default:return t.day(e,{width:"wide",context:"formatting"})}},a:function(a,r,t){const n=a.getHours()/12>=1?"pm":"am";switch(r){case"a":case"aa":return t.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"aaa":return t.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return t.dayPeriod(n,{width:"narrow",context:"formatting"});case"aaaa":default:return t.dayPeriod(n,{width:"wide",context:"formatting"})}},b:function(a,r,t){const e=a.getHours();let n;switch(e===12?n=Ae.noon:e===0?n=Ae.midnight:n=e/12>=1?"pm":"am",r){case"b":case"bb":return t.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"bbb":return t.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return t.dayPeriod(n,{width:"narrow",context:"formatting"});case"bbbb":default:return t.dayPeriod(n,{width:"wide",context:"formatting"})}},B:function(a,r,t){const e=a.getHours();let n;switch(e>=17?n=Ae.evening:e>=12?n=Ae.afternoon:e>=4?n=Ae.morning:n=Ae.night,r){case"B":case"BB":case"BBB":return t.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"BBBBB":return t.dayPeriod(n,{width:"narrow",context:"formatting"});case"BBBB":default:return t.dayPeriod(n,{width:"wide",context:"formatting"})}},h:function(a,r,t){if(r==="ho"){let e=a.getHours()%12;return e===0&&(e=12),t.ordinalNumber(e,{unit:"hour"})}return _e.h(a,r)},H:function(a,r,t){return r==="Ho"?t.ordinalNumber(a.getHours(),{unit:"hour"}):_e.H(a,r)},K:function(a,r,t){const e=a.getHours()%12;return r==="Ko"?t.ordinalNumber(e,{unit:"hour"}):T(e,r.length)},k:function(a,r,t){let e=a.getHours();return e===0&&(e=24),r==="ko"?t.ordinalNumber(e,{unit:"hour"}):T(e,r.length)},m:function(a,r,t){return r==="mo"?t.ordinalNumber(a.getMinutes(),{unit:"minute"}):_e.m(a,r)},s:function(a,r,t){return r==="so"?t.ordinalNumber(a.getSeconds(),{unit:"second"}):_e.s(a,r)},S:function(a,r){return _e.S(a,r)},X:function(a,r,t){const e=a.getTimezoneOffset();if(e===0)return"Z";switch(r){case"X":return vn(e);case"XXXX":case"XX":return Te(e);case"XXXXX":case"XXX":default:return Te(e,":")}},x:function(a,r,t){const e=a.getTimezoneOffset();switch(r){case"x":return vn(e);case"xxxx":case"xx":return Te(e);case"xxxxx":case"xxx":default:return Te(e,":")}},O:function(a,r,t){const e=a.getTimezoneOffset();switch(r){case"O":case"OO":case"OOO":return"GMT"+yn(e,":");case"OOOO":default:return"GMT"+Te(e,":")}},z:function(a,r,t){const e=a.getTimezoneOffset();switch(r){case"z":case"zz":case"zzz":return"GMT"+yn(e,":");case"zzzz":default:return"GMT"+Te(e,":")}},t:function(a,r,t){const e=Math.trunc(a.getTime()/1e3);return T(e,r.length)},T:function(a,r,t){const e=a.getTime();return T(e,r.length)}};function yn(a,r=""){const t=a>0?"-":"+",e=Math.abs(a),n=Math.trunc(e/60),s=e%60;return s===0?t+String(n):t+String(n)+r+T(s,2)}function vn(a,r){return a%60===0?(a>0?"-":"+")+T(Math.abs(a)/60,2):Te(a,r)}function Te(a,r=""){const t=a>0?"-":"+",e=Math.abs(a),n=T(Math.trunc(e/60),2),s=T(e%60,2);return t+n+r+s}const bn=(a,r)=>{switch(a){case"P":return r.date({width:"short"});case"PP":return r.date({width:"medium"});case"PPP":return r.date({width:"long"});case"PPPP":default:return r.date({width:"full"})}},or=(a,r)=>{switch(a){case"p":return r.time({width:"short"});case"pp":return r.time({width:"medium"});case"ppp":return r.time({width:"long"});case"pppp":default:return r.time({width:"full"})}},Ba=(a,r)=>{const t=a.match(/(P+)(p+)?/)||[],e=t[1],n=t[2];if(!n)return bn(a,r);let s;switch(e){case"P":s=r.dateTime({width:"short"});break;case"PP":s=r.dateTime({width:"medium"});break;case"PPP":s=r.dateTime({width:"long"});break;case"PPPP":default:s=r.dateTime({width:"full"});break}return s.replace("{{date}}",bn(e,r)).replace("{{time}}",or(n,r))},qa={p:or,P:Ba},Ka=/^D+$/,Va=/^Y+$/,Ua=["D","DD","YY","YYYY"];function ja(a){return Ka.test(a)}function Xa(a){return Va.test(a)}function Ga(a,r,t){const e=za(a,r,t);if(console.warn(e),Ua.includes(a))throw new RangeError(e)}function za(a,r,t){const e=a[0]==="Y"?"years":"days of the month";return`Use \`${a.toLowerCase()}\` instead of \`${a}\` (in \`${r}\`) for formatting ${e} to the input \`${t}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Za=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Ja=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,es=/^'([^]*?)'?$/,ts=/''/g,ns=/[a-zA-Z]/;function ou(a,r,t){var l,d,f,p;const e=Le(),n=e.locale??Lt,s=e.firstWeekContainsDate??((d=(l=e.locale)==null?void 0:l.options)==null?void 0:d.firstWeekContainsDate)??1,o=e.weekStartsOn??((p=(f=e.locale)==null?void 0:f.options)==null?void 0:p.weekStartsOn)??0,i=C(a);if(!Gr(i))throw new RangeError("Invalid time value");let c=r.match(Ja).map(h=>{const g=h[0];if(g==="p"||g==="P"){const w=qa[g];return w(h,n.formatLong)}return h}).join("").match(Za).map(h=>{if(h==="''")return{isToken:!1,value:"'"};const g=h[0];if(g==="'")return{isToken:!1,value:rs(h)};if(Dn[g])return{isToken:!0,value:h};if(g.match(ns))throw new RangeError("Format string contains an unescaped latin alphabet character `"+g+"`");return{isToken:!1,value:h}});n.localize.preprocessor&&(c=n.localize.preprocessor(i,c));const u={firstWeekContainsDate:s,weekStartsOn:o,locale:n};return c.map(h=>{if(!h.isToken)return h.value;const g=h.value;(Xa(g)||ja(g))&&Ga(g,r,String(a));const w=Dn[g[0]];return w(i,g,n.localize,u)}).join("")}function rs(a){const r=a.match(es);return r?r[1].replace(ts,"'"):a}function as(a,r,t){const e=Le(),n=(t==null?void 0:t.locale)??e.locale??Lt,s=2520,o=Ne(a,r);if(isNaN(o))throw new RangeError("Invalid time value");const i=Object.assign({},t,{addSuffix:t==null?void 0:t.addSuffix,comparison:o});let c,u;o>0?(c=C(r),u=C(a)):(c=C(a),u=C(r));const l=ar(u,c),d=(qe(u)-qe(c))/1e3,f=Math.round((l-d)/60);let p;if(f<2)return t!=null&&t.includeSeconds?l<5?n.formatDistance("lessThanXSeconds",5,i):l<10?n.formatDistance("lessThanXSeconds",10,i):l<20?n.formatDistance("lessThanXSeconds",20,i):l<40?n.formatDistance("halfAMinute",0,i):l<60?n.formatDistance("lessThanXMinutes",1,i):n.formatDistance("xMinutes",1,i):f===0?n.formatDistance("lessThanXMinutes",1,i):n.formatDistance("xMinutes",f,i);if(f<45)return n.formatDistance("xMinutes",f,i);if(f<90)return n.formatDistance("aboutXHours",1,i);if(f0?(i=C(r),c=C(a)):(i=C(a),c=C(r));const u=Ft((t==null?void 0:t.roundingMethod)??"round"),l=c.getTime()-i.getTime(),d=l/it,f=qe(c)-qe(i),p=(l-f)/it,h=t==null?void 0:t.unit;let g;if(h?g=h:d<1?g="second":d<60?g="minute":d{const l=`x${u.replace(/(^.)/,f=>f.toUpperCase())}`,d=a[u];return d!==void 0&&(s||a[u])?c.concat(e.formatDistance(l,d)):c},[]).join(o):""}function lu(a,r){const t=C(a);if(isNaN(t.getTime()))throw new RangeError("Invalid time value");const e=(r==null?void 0:r.representation)??"complete";let n="",s="";const o="-",i=":";if(e!=="time"){const c=T(t.getDate(),2),u=T(t.getMonth()+1,2);n=`${T(t.getFullYear(),4)}${o}${u}${o}${c}`}if(e!=="date"){const c=t.getTimezoneOffset();if(c!==0){const h=Math.abs(c),g=T(Math.trunc(h/60),2),w=T(h%60,2);s=`${c<0?"+":"-"}${g}:${w}`}else s="Z";const u=T(t.getHours(),2),l=T(t.getMinutes(),2),d=T(t.getSeconds(),2),f=n===""?"":"T",p=[u,l,d].join(i);n=`${n}${f}${p}${s}`}return n}function du(a){return C(a*1e3)}function fu(a){const r=C(a.start),t=C(a.end),e={},n=sa(t,r);n&&(e.years=n);const s=ze(r,{years:e.years}),o=rr(t,s);o&&(e.months=o);const i=ze(s,{months:e.months}),c=Jr(t,i);c&&(e.days=c);const u=ze(i,{days:e.days}),l=ea(t,u);l&&(e.hours=l);const d=ze(u,{hours:e.hours}),f=ta(t,d);f&&(e.minutes=f);const p=ze(d,{minutes:e.minutes}),h=ar(t,p);return h&&(e.seconds=h),e}function pu(a,r){const e=ls(a);let n;if(e.date){const c=ds(e.date,2);n=fs(c.restDateString,c.year)}if(!n||isNaN(n.getTime()))return new Date(NaN);const s=n.getTime();let o=0,i;if(e.time&&(o=ps(e.time),isNaN(o)))return new Date(NaN);if(e.timezone){if(i=hs(e.timezone),isNaN(i))return new Date(NaN)}else{const c=new Date(s+o),u=new Date(0);return u.setFullYear(c.getUTCFullYear(),c.getUTCMonth(),c.getUTCDate()),u.setHours(c.getUTCHours(),c.getUTCMinutes(),c.getUTCSeconds(),c.getUTCMilliseconds()),u}return new Date(s+o+i)}const pt={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},is=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,cs=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,us=/^([+-])(\d{2})(?::?(\d{2}))?$/;function ls(a){const r={},t=a.split(pt.dateTimeDelimiter);let e;if(t.length>2)return r;if(/:/.test(t[0])?e=t[0]:(r.date=t[0],e=t[1],pt.timeZoneDelimiter.test(r.date)&&(r.date=a.split(pt.timeZoneDelimiter)[0],e=a.substr(r.date.length,a.length))),e){const n=pt.timezone.exec(e);n?(r.time=e.replace(n[1],""),r.timezone=n[1]):r.time=e}return r}function ds(a,r){const t=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+r)+"})|(\\d{2}|[+-]\\d{"+(2+r)+"})$)"),e=a.match(t);if(!e)return{year:NaN,restDateString:""};const n=e[1]?parseInt(e[1]):null,s=e[2]?parseInt(e[2]):null;return{year:s===null?n:s*100,restDateString:a.slice((e[1]||e[2]).length)}}function fs(a,r){if(r===null)return new Date(NaN);const t=a.match(is);if(!t)return new Date(NaN);const e=!!t[4],n=et(t[1]),s=et(t[2])-1,o=et(t[3]),i=et(t[4]),c=et(t[5])-1;if(e)return ys(r,i,c)?ms(r,i,c):new Date(NaN);{const u=new Date(0);return!ws(r,s,o)||!Ds(r,n)?new Date(NaN):(u.setUTCFullYear(r,s,Math.max(n,o)),u)}}function et(a){return a?parseInt(a):1}function ps(a){const r=a.match(cs);if(!r)return NaN;const t=qt(r[1]),e=qt(r[2]),n=qt(r[3]);return vs(t,e,n)?t*rn+e*it+n*1e3:NaN}function qt(a){return a&&parseFloat(a.replace(",","."))||0}function hs(a){if(a==="Z")return 0;const r=a.match(us);if(!r)return 0;const t=r[1]==="+"?-1:1,e=parseInt(r[2]),n=r[3]&&parseInt(r[3])||0;return bs(e,n)?t*(e*rn+n*it):NaN}function ms(a,r,t){const e=new Date(0);e.setUTCFullYear(a,0,4);const n=e.getUTCDay()||7,s=(r-1)*7+t+1-n;return e.setUTCDate(e.getUTCDate()+s),e}const gs=[31,null,31,30,31,30,31,31,30,31,30,31];function ir(a){return a%400===0||a%4===0&&a%100!==0}function ws(a,r,t){return r>=0&&r<=11&&t>=1&&t<=(gs[r]||(ir(a)?29:28))}function Ds(a,r){return r>=1&&r<=(ir(a)?366:365)}function ys(a,r,t){return r>=1&&r<=53&&t>=0&&t<=6}function vs(a,r,t){return a===24?r===0&&t===0:t>=0&&t<60&&r>=0&&r<60&&a>=0&&a<25}function bs(a,r){return r>=0&&r<=59}const cr=6048e5,ks=864e5,Wt=6e4,At=36e5,_s=1e3,kn=Symbol.for("constructDateFrom");function W(a,r){return typeof a=="function"?a(r):a&&typeof a=="object"&&kn in a?a[kn](r):a instanceof Date?new a.constructor(r):new Date(r)}function b(a,r){return W(r||a,a)}function ce(a,r,t){const e=b(a,t==null?void 0:t.in);return isNaN(r)?W((t==null?void 0:t.in)||a,NaN):(r&&e.setDate(e.getDate()+r),e)}function ue(a,r,t){const e=b(a,t==null?void 0:t.in);if(isNaN(r))return W(a,NaN);if(!r)return e;const n=e.getDate(),s=W(a,e.getTime());s.setMonth(e.getMonth()+r+1,0);const o=s.getDate();return n>=o?s:(e.setFullYear(s.getFullYear(),s.getMonth(),n),e)}function ur(a,r,t){return W(a,+b(a)+r)}function Ms(a,r,t){return ur(a,r*At)}let xs={};function We(){return xs}function be(a,r){var i,c,u,l;const t=We(),e=(r==null?void 0:r.weekStartsOn)??((c=(i=r==null?void 0:r.locale)==null?void 0:i.options)==null?void 0:c.weekStartsOn)??t.weekStartsOn??((l=(u=t.locale)==null?void 0:u.options)==null?void 0:l.weekStartsOn)??0,n=b(a,r==null?void 0:r.in),s=n.getDay(),o=(s=s.getTime()?e+1:t.getTime()>=i.getTime()?e:e-1}function Ct(a){const r=b(a),t=new Date(Date.UTC(r.getFullYear(),r.getMonth(),r.getDate(),r.getHours(),r.getMinutes(),r.getSeconds(),r.getMilliseconds()));return t.setUTCFullYear(r.getFullYear()),+a-+t}function ke(a,...r){const t=W.bind(null,r.find(e=>typeof e=="object"));return r.map(t)}function Re(a,r){const t=b(a,r==null?void 0:r.in);return t.setHours(0,0,0,0),t}function Ve(a,r,t){const[e,n]=ke(t==null?void 0:t.in,a,r),s=Re(e),o=Re(n),i=+s-Ct(s),c=+o-Ct(o);return Math.round((i-c)/ks)}function Ss(a,r){const t=lr(a,r),e=W(a,0);return e.setFullYear(t,0,4),e.setHours(0,0,0,0),Ke(e)}function Zt(a,r,t){const e=b(a,t==null?void 0:t.in);return e.setTime(e.getTime()+r*Wt),e}function sn(a,r,t){return ue(a,r*3,t)}function Cs(a,r,t){return ur(a,r*1e3)}function Pt(a,r,t){return ce(a,r*7,t)}function ge(a,r,t){return ue(a,r*12,t)}function _n(a,r){let t,e=r==null?void 0:r.in;return a.forEach(n=>{!e&&typeof n=="object"&&(e=W.bind(null,n));const s=b(n,e);(!t||t{!e&&typeof n=="object"&&(e=W.bind(null,n));const s=b(n,e);(!t||t>s||isNaN(+s))&&(t=s)}),W(e,t||NaN)}function Ps(a,r,t){const[e,n]=ke(t==null?void 0:t.in,a,r);return+Re(e)==+Re(n)}function we(a){return a instanceof Date||typeof a=="object"&&Object.prototype.toString.call(a)==="[object Date]"}function Tt(a){return!(!we(a)&&typeof a!="number"||isNaN(+b(a)))}function Ot(a,r,t){const[e,n]=ke(t==null?void 0:t.in,a,r),s=e.getFullYear()-n.getFullYear(),o=e.getMonth()-n.getMonth();return s*12+o}function Ye(a,r){const t=b(a,r==null?void 0:r.in);return Math.trunc(t.getMonth()/3)+1}function Et(a,r,t){const[e,n]=ke(t==null?void 0:t.in,a,r),s=e.getFullYear()-n.getFullYear(),o=Ye(e)-Ye(n);return s*4+o}function Nt(a,r,t){const[e,n]=ke(t==null?void 0:t.in,a,r);return e.getFullYear()-n.getFullYear()}function Ts(a,r,t){const[e,n]=ke(t==null?void 0:t.in,a,r),s=xn(e,n),o=Math.abs(Ve(e,n));e.setDate(e.getDate()-s*o);const i=+(xn(e,n)===-s),c=s*(o-i);return c===0?0:c}function xn(a,r){const t=a.getFullYear()-r.getFullYear()||a.getMonth()-r.getMonth()||a.getDate()-r.getDate()||a.getHours()-r.getHours()||a.getMinutes()-r.getMinutes()||a.getSeconds()-r.getSeconds()||a.getMilliseconds()-r.getMilliseconds();return t<0?-1:t>0?1:t}function dr(a,r){const t=b(a,r==null?void 0:r.in);return t.setHours(23,59,59,999),t}function fr(a,r){const t=b(a,r==null?void 0:r.in),e=t.getMonth();return t.setFullYear(t.getFullYear(),e+1,0),t.setHours(23,59,59,999),t}function Jt(a,r){const t=b(a,r==null?void 0:r.in),e=t.getMonth(),n=e-e%3;return t.setMonth(n,1),t.setHours(0,0,0,0),t}function pr(a,r){const t=b(a,r==null?void 0:r.in);return t.setDate(1),t.setHours(0,0,0,0),t}function hr(a,r){const t=b(a,r==null?void 0:r.in),e=t.getFullYear();return t.setFullYear(e+1,0,0),t.setHours(23,59,59,999),t}function Ht(a,r){const t=b(a,r==null?void 0:r.in);return t.setFullYear(t.getFullYear(),0,1),t.setHours(0,0,0,0),t}function Os(a,r){var i,c;const t=We(),e=t.weekStartsOn??((c=(i=t.locale)==null?void 0:i.options)==null?void 0:c.weekStartsOn)??0,n=b(a,r==null?void 0:r.in),s=n.getDay(),o=(s{let e;const n=Es[a];return typeof n=="string"?e=n:r===1?e=n.one:e=n.other.replace("{{count}}",r.toString()),t!=null&&t.addSuffix?t.comparison&&t.comparison>0?"in "+e:e+" ago":e};function Kt(a){return(r={})=>{const t=r.width?String(r.width):a.defaultWidth;return a.formats[t]||a.formats[a.defaultWidth]}}const Ys={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Is={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Rs={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Fs={date:Kt({formats:Ys,defaultWidth:"full"}),time:Kt({formats:Is,defaultWidth:"full"}),dateTime:Kt({formats:Rs,defaultWidth:"full"})},Ls={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Ws=(a,r,t,e)=>Ls[a];function tt(a){return(r,t)=>{const e=t!=null&&t.context?String(t.context):"standalone";let n;if(e==="formatting"&&a.formattingValues){const o=a.defaultFormattingWidth||a.defaultWidth,i=t!=null&&t.width?String(t.width):o;n=a.formattingValues[i]||a.formattingValues[o]}else{const o=a.defaultWidth,i=t!=null&&t.width?String(t.width):a.defaultWidth;n=a.values[i]||a.values[o]}const s=a.argumentCallback?a.argumentCallback(r):r;return n[s]}}const As={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Hs={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},$s={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"]},Qs={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"]},Bs={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"}},qs={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"}},Ks=(a,r)=>{const t=Number(a),e=t%100;if(e>20||e<10)switch(e%10){case 1:return t+"st";case 2:return t+"nd";case 3:return t+"rd"}return t+"th"},Vs={ordinalNumber:Ks,era:tt({values:As,defaultWidth:"wide"}),quarter:tt({values:Hs,defaultWidth:"wide",argumentCallback:a=>a-1}),month:tt({values:$s,defaultWidth:"wide"}),day:tt({values:Qs,defaultWidth:"wide"}),dayPeriod:tt({values:Bs,defaultWidth:"wide",formattingValues:qs,defaultFormattingWidth:"wide"})};function nt(a){return(r,t={})=>{const e=t.width,n=e&&a.matchPatterns[e]||a.matchPatterns[a.defaultMatchWidth],s=r.match(n);if(!s)return null;const o=s[0],i=e&&a.parsePatterns[e]||a.parsePatterns[a.defaultParseWidth],c=Array.isArray(i)?js(i,d=>d.test(o)):Us(i,d=>d.test(o));let u;u=a.valueCallback?a.valueCallback(c):c,u=t.valueCallback?t.valueCallback(u):u;const l=r.slice(o.length);return{value:u,rest:l}}}function Us(a,r){for(const t in a)if(Object.prototype.hasOwnProperty.call(a,t)&&r(a[t]))return t}function js(a,r){for(let t=0;t{const e=r.match(a.matchPattern);if(!e)return null;const n=e[0],s=r.match(a.parsePattern);if(!s)return null;let o=a.valueCallback?a.valueCallback(s[0]):s[0];o=t.valueCallback?t.valueCallback(o):o;const i=r.slice(n.length);return{value:o,rest:i}}}const Gs=/^(\d+)(th|st|nd|rd)?/i,zs=/\d+/i,Zs={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},Js={any:[/^b/i,/^(a|c)/i]},eo={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},to={any:[/1/i,/2/i,/3/i,/4/i]},no={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},ro={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]},ao={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},so={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]},oo={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},io={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}},co={ordinalNumber:Xs({matchPattern:Gs,parsePattern:zs,valueCallback:a=>parseInt(a,10)}),era:nt({matchPatterns:Zs,defaultMatchWidth:"wide",parsePatterns:Js,defaultParseWidth:"any"}),quarter:nt({matchPatterns:eo,defaultMatchWidth:"wide",parsePatterns:to,defaultParseWidth:"any",valueCallback:a=>a+1}),month:nt({matchPatterns:no,defaultMatchWidth:"wide",parsePatterns:ro,defaultParseWidth:"any"}),day:nt({matchPatterns:ao,defaultMatchWidth:"wide",parsePatterns:so,defaultParseWidth:"any"}),dayPeriod:nt({matchPatterns:oo,defaultMatchWidth:"any",parsePatterns:io,defaultParseWidth:"any"})},mr={code:"en-US",formatDistance:Ns,formatLong:Fs,formatRelative:Ws,localize:Vs,match:co,options:{weekStartsOn:0,firstWeekContainsDate:1}};function uo(a,r){const t=b(a,r==null?void 0:r.in);return Ve(t,Ht(t))+1}function on(a,r){const t=b(a,r==null?void 0:r.in),e=+Ke(t)-+Ss(t);return Math.round(e/cr)+1}function cn(a,r){var l,d,f,p;const t=b(a,r==null?void 0:r.in),e=t.getFullYear(),n=We(),s=(r==null?void 0:r.firstWeekContainsDate)??((d=(l=r==null?void 0:r.locale)==null?void 0:l.options)==null?void 0:d.firstWeekContainsDate)??n.firstWeekContainsDate??((p=(f=n.locale)==null?void 0:f.options)==null?void 0:p.firstWeekContainsDate)??1,o=W((r==null?void 0:r.in)||a,0);o.setFullYear(e+1,0,s),o.setHours(0,0,0,0);const i=be(o,r),c=W((r==null?void 0:r.in)||a,0);c.setFullYear(e,0,s),c.setHours(0,0,0,0);const u=be(c,r);return+t>=+i?e+1:+t>=+u?e:e-1}function lo(a,r){var i,c,u,l;const t=We(),e=(r==null?void 0:r.firstWeekContainsDate)??((c=(i=r==null?void 0:r.locale)==null?void 0:i.options)==null?void 0:c.firstWeekContainsDate)??t.firstWeekContainsDate??((l=(u=t.locale)==null?void 0:u.options)==null?void 0:l.firstWeekContainsDate)??1,n=cn(a,r),s=W((r==null?void 0:r.in)||a,0);return s.setFullYear(n,0,e),s.setHours(0,0,0,0),be(s,r)}function gr(a,r){const t=b(a,r==null?void 0:r.in),e=+be(t,r)-+lo(t,r);return Math.round(e/cr)+1}function L(a,r){const t=a<0?"-":"",e=Math.abs(a).toString().padStart(r,"0");return t+e}const Me={y(a,r){const t=a.getFullYear(),e=t>0?t:1-t;return L(r==="yy"?e%100:e,r.length)},M(a,r){const t=a.getMonth();return r==="M"?String(t+1):L(t+1,2)},d(a,r){return L(a.getDate(),r.length)},a(a,r){const t=a.getHours()/12>=1?"pm":"am";switch(r){case"a":case"aa":return t.toUpperCase();case"aaa":return t;case"aaaaa":return t[0];case"aaaa":default:return t==="am"?"a.m.":"p.m."}},h(a,r){return L(a.getHours()%12||12,r.length)},H(a,r){return L(a.getHours(),r.length)},m(a,r){return L(a.getMinutes(),r.length)},s(a,r){return L(a.getSeconds(),r.length)},S(a,r){const t=r.length,e=a.getMilliseconds(),n=Math.trunc(e*Math.pow(10,t-3));return L(n,r.length)}},He={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Sn={G:function(a,r,t){const e=a.getFullYear()>0?1:0;switch(r){case"G":case"GG":case"GGG":return t.era(e,{width:"abbreviated"});case"GGGGG":return t.era(e,{width:"narrow"});case"GGGG":default:return t.era(e,{width:"wide"})}},y:function(a,r,t){if(r==="yo"){const e=a.getFullYear(),n=e>0?e:1-e;return t.ordinalNumber(n,{unit:"year"})}return Me.y(a,r)},Y:function(a,r,t,e){const n=cn(a,e),s=n>0?n:1-n;if(r==="YY"){const o=s%100;return L(o,2)}return r==="Yo"?t.ordinalNumber(s,{unit:"year"}):L(s,r.length)},R:function(a,r){const t=lr(a);return L(t,r.length)},u:function(a,r){const t=a.getFullYear();return L(t,r.length)},Q:function(a,r,t){const e=Math.ceil((a.getMonth()+1)/3);switch(r){case"Q":return String(e);case"QQ":return L(e,2);case"Qo":return t.ordinalNumber(e,{unit:"quarter"});case"QQQ":return t.quarter(e,{width:"abbreviated",context:"formatting"});case"QQQQQ":return t.quarter(e,{width:"narrow",context:"formatting"});case"QQQQ":default:return t.quarter(e,{width:"wide",context:"formatting"})}},q:function(a,r,t){const e=Math.ceil((a.getMonth()+1)/3);switch(r){case"q":return String(e);case"qq":return L(e,2);case"qo":return t.ordinalNumber(e,{unit:"quarter"});case"qqq":return t.quarter(e,{width:"abbreviated",context:"standalone"});case"qqqqq":return t.quarter(e,{width:"narrow",context:"standalone"});case"qqqq":default:return t.quarter(e,{width:"wide",context:"standalone"})}},M:function(a,r,t){const e=a.getMonth();switch(r){case"M":case"MM":return Me.M(a,r);case"Mo":return t.ordinalNumber(e+1,{unit:"month"});case"MMM":return t.month(e,{width:"abbreviated",context:"formatting"});case"MMMMM":return t.month(e,{width:"narrow",context:"formatting"});case"MMMM":default:return t.month(e,{width:"wide",context:"formatting"})}},L:function(a,r,t){const e=a.getMonth();switch(r){case"L":return String(e+1);case"LL":return L(e+1,2);case"Lo":return t.ordinalNumber(e+1,{unit:"month"});case"LLL":return t.month(e,{width:"abbreviated",context:"standalone"});case"LLLLL":return t.month(e,{width:"narrow",context:"standalone"});case"LLLL":default:return t.month(e,{width:"wide",context:"standalone"})}},w:function(a,r,t,e){const n=gr(a,e);return r==="wo"?t.ordinalNumber(n,{unit:"week"}):L(n,r.length)},I:function(a,r,t){const e=on(a);return r==="Io"?t.ordinalNumber(e,{unit:"week"}):L(e,r.length)},d:function(a,r,t){return r==="do"?t.ordinalNumber(a.getDate(),{unit:"date"}):Me.d(a,r)},D:function(a,r,t){const e=uo(a);return r==="Do"?t.ordinalNumber(e,{unit:"dayOfYear"}):L(e,r.length)},E:function(a,r,t){const e=a.getDay();switch(r){case"E":case"EE":case"EEE":return t.day(e,{width:"abbreviated",context:"formatting"});case"EEEEE":return t.day(e,{width:"narrow",context:"formatting"});case"EEEEEE":return t.day(e,{width:"short",context:"formatting"});case"EEEE":default:return t.day(e,{width:"wide",context:"formatting"})}},e:function(a,r,t,e){const n=a.getDay(),s=(n-e.weekStartsOn+8)%7||7;switch(r){case"e":return String(s);case"ee":return L(s,2);case"eo":return t.ordinalNumber(s,{unit:"day"});case"eee":return t.day(n,{width:"abbreviated",context:"formatting"});case"eeeee":return t.day(n,{width:"narrow",context:"formatting"});case"eeeeee":return t.day(n,{width:"short",context:"formatting"});case"eeee":default:return t.day(n,{width:"wide",context:"formatting"})}},c:function(a,r,t,e){const n=a.getDay(),s=(n-e.weekStartsOn+8)%7||7;switch(r){case"c":return String(s);case"cc":return L(s,r.length);case"co":return t.ordinalNumber(s,{unit:"day"});case"ccc":return t.day(n,{width:"abbreviated",context:"standalone"});case"ccccc":return t.day(n,{width:"narrow",context:"standalone"});case"cccccc":return t.day(n,{width:"short",context:"standalone"});case"cccc":default:return t.day(n,{width:"wide",context:"standalone"})}},i:function(a,r,t){const e=a.getDay(),n=e===0?7:e;switch(r){case"i":return String(n);case"ii":return L(n,r.length);case"io":return t.ordinalNumber(n,{unit:"day"});case"iii":return t.day(e,{width:"abbreviated",context:"formatting"});case"iiiii":return t.day(e,{width:"narrow",context:"formatting"});case"iiiiii":return t.day(e,{width:"short",context:"formatting"});case"iiii":default:return t.day(e,{width:"wide",context:"formatting"})}},a:function(a,r,t){const n=a.getHours()/12>=1?"pm":"am";switch(r){case"a":case"aa":return t.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"aaa":return t.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return t.dayPeriod(n,{width:"narrow",context:"formatting"});case"aaaa":default:return t.dayPeriod(n,{width:"wide",context:"formatting"})}},b:function(a,r,t){const e=a.getHours();let n;switch(e===12?n=He.noon:e===0?n=He.midnight:n=e/12>=1?"pm":"am",r){case"b":case"bb":return t.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"bbb":return t.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return t.dayPeriod(n,{width:"narrow",context:"formatting"});case"bbbb":default:return t.dayPeriod(n,{width:"wide",context:"formatting"})}},B:function(a,r,t){const e=a.getHours();let n;switch(e>=17?n=He.evening:e>=12?n=He.afternoon:e>=4?n=He.morning:n=He.night,r){case"B":case"BB":case"BBB":return t.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"BBBBB":return t.dayPeriod(n,{width:"narrow",context:"formatting"});case"BBBB":default:return t.dayPeriod(n,{width:"wide",context:"formatting"})}},h:function(a,r,t){if(r==="ho"){let e=a.getHours()%12;return e===0&&(e=12),t.ordinalNumber(e,{unit:"hour"})}return Me.h(a,r)},H:function(a,r,t){return r==="Ho"?t.ordinalNumber(a.getHours(),{unit:"hour"}):Me.H(a,r)},K:function(a,r,t){const e=a.getHours()%12;return r==="Ko"?t.ordinalNumber(e,{unit:"hour"}):L(e,r.length)},k:function(a,r,t){let e=a.getHours();return e===0&&(e=24),r==="ko"?t.ordinalNumber(e,{unit:"hour"}):L(e,r.length)},m:function(a,r,t){return r==="mo"?t.ordinalNumber(a.getMinutes(),{unit:"minute"}):Me.m(a,r)},s:function(a,r,t){return r==="so"?t.ordinalNumber(a.getSeconds(),{unit:"second"}):Me.s(a,r)},S:function(a,r){return Me.S(a,r)},X:function(a,r,t){const e=a.getTimezoneOffset();if(e===0)return"Z";switch(r){case"X":return Pn(e);case"XXXX":case"XX":return Oe(e);case"XXXXX":case"XXX":default:return Oe(e,":")}},x:function(a,r,t){const e=a.getTimezoneOffset();switch(r){case"x":return Pn(e);case"xxxx":case"xx":return Oe(e);case"xxxxx":case"xxx":default:return Oe(e,":")}},O:function(a,r,t){const e=a.getTimezoneOffset();switch(r){case"O":case"OO":case"OOO":return"GMT"+Cn(e,":");case"OOOO":default:return"GMT"+Oe(e,":")}},z:function(a,r,t){const e=a.getTimezoneOffset();switch(r){case"z":case"zz":case"zzz":return"GMT"+Cn(e,":");case"zzzz":default:return"GMT"+Oe(e,":")}},t:function(a,r,t){const e=Math.trunc(+a/1e3);return L(e,r.length)},T:function(a,r,t){return L(+a,r.length)}};function Cn(a,r=""){const t=a>0?"-":"+",e=Math.abs(a),n=Math.trunc(e/60),s=e%60;return s===0?t+String(n):t+String(n)+r+L(s,2)}function Pn(a,r){return a%60===0?(a>0?"-":"+")+L(Math.abs(a)/60,2):Oe(a,r)}function Oe(a,r=""){const t=a>0?"-":"+",e=Math.abs(a),n=L(Math.trunc(e/60),2),s=L(e%60,2);return t+n+r+s}const Tn=(a,r)=>{switch(a){case"P":return r.date({width:"short"});case"PP":return r.date({width:"medium"});case"PPP":return r.date({width:"long"});case"PPPP":default:return r.date({width:"full"})}},wr=(a,r)=>{switch(a){case"p":return r.time({width:"short"});case"pp":return r.time({width:"medium"});case"ppp":return r.time({width:"long"});case"pppp":default:return r.time({width:"full"})}},fo=(a,r)=>{const t=a.match(/(P+)(p+)?/)||[],e=t[1],n=t[2];if(!n)return Tn(a,r);let s;switch(e){case"P":s=r.dateTime({width:"short"});break;case"PP":s=r.dateTime({width:"medium"});break;case"PPP":s=r.dateTime({width:"long"});break;case"PPPP":default:s=r.dateTime({width:"full"});break}return s.replace("{{date}}",Tn(e,r)).replace("{{time}}",wr(n,r))},en={p:wr,P:fo},po=/^D+$/,ho=/^Y+$/,mo=["D","DD","YY","YYYY"];function go(a){return po.test(a)}function wo(a){return ho.test(a)}function Do(a,r,t){const e=yo(a,r,t);if(console.warn(e),mo.includes(a))throw new RangeError(e)}function yo(a,r,t){const e=a[0]==="Y"?"years":"days of the month";return`Use \`${a.toLowerCase()}\` instead of \`${a}\` (in \`${r}\`) for formatting ${e} to the input \`${t}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const vo=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,bo=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ko=/^'([^]*?)'?$/,_o=/''/g,Mo=/[a-zA-Z]/;function On(a,r,t){var l,d,f,p,h,g,w,k;const e=We(),n=(t==null?void 0:t.locale)??e.locale??mr,s=(t==null?void 0:t.firstWeekContainsDate)??((d=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:d.firstWeekContainsDate)??e.firstWeekContainsDate??((p=(f=e.locale)==null?void 0:f.options)==null?void 0:p.firstWeekContainsDate)??1,o=(t==null?void 0:t.weekStartsOn)??((g=(h=t==null?void 0:t.locale)==null?void 0:h.options)==null?void 0:g.weekStartsOn)??e.weekStartsOn??((k=(w=e.locale)==null?void 0:w.options)==null?void 0:k.weekStartsOn)??0,i=b(a,t==null?void 0:t.in);if(!Tt(i))throw new RangeError("Invalid time value");let c=r.match(bo).map(S=>{const x=S[0];if(x==="p"||x==="P"){const N=en[x];return N(S,n.formatLong)}return S}).join("").match(vo).map(S=>{if(S==="''")return{isToken:!1,value:"'"};const x=S[0];if(x==="'")return{isToken:!1,value:xo(S)};if(Sn[x])return{isToken:!0,value:S};if(x.match(Mo))throw new RangeError("Format string contains an unescaped latin alphabet character `"+x+"`");return{isToken:!1,value:S}});n.localize.preprocessor&&(c=n.localize.preprocessor(i,c));const u={firstWeekContainsDate:s,weekStartsOn:o,locale:n};return c.map(S=>{if(!S.isToken)return S.value;const x=S.value;(!(t!=null&&t.useAdditionalWeekYearTokens)&&wo(x)||!(t!=null&&t.useAdditionalDayOfYearTokens)&&go(x))&&Do(x,r,String(a));const N=Sn[x[0]];return N(i,x,n.localize,u)}).join("")}function xo(a){const r=a.match(ko);return r?r[1].replace(_o,"'"):a}function En(a,r){return b(a,r==null?void 0:r.in).getDate()}function So(a,r){return b(a,r==null?void 0:r.in).getDay()}function Co(a,r){const t=b(a,r==null?void 0:r.in),e=t.getFullYear(),n=t.getMonth(),s=W(t,0);return s.setFullYear(e,n+1,0),s.setHours(0,0,0,0),s.getDate()}function Po(){return Object.assign({},We())}function De(a,r){return b(a,r==null?void 0:r.in).getHours()}function To(a,r){const t=b(a,r==null?void 0:r.in).getDay();return t===0?7:t}function ye(a,r){return b(a,r==null?void 0:r.in).getMinutes()}function te(a,r){return b(a,r==null?void 0:r.in).getMonth()}function Se(a){return b(a).getSeconds()}function tn(a){return+b(a)}function P(a,r){return b(a,r==null?void 0:r.in).getFullYear()}function Pe(a,r){return+b(a)>+b(r)}function Fe(a,r){return+b(a)<+b(r)}function Oo(a,r){return+b(a)==+b(r)}function Eo(a,r){const t=No(r)?new r(0):W(r,0);return t.setFullYear(a.getFullYear(),a.getMonth(),a.getDate()),t.setHours(a.getHours(),a.getMinutes(),a.getSeconds(),a.getMilliseconds()),t}function No(a){var r;return typeof a=="function"&&((r=a.prototype)==null?void 0:r.constructor)===a}const Yo=10;class Dr{constructor(){y(this,"subPriority",0)}validate(r,t){return!0}}class Io extends Dr{constructor(r,t,e,n,s){super(),this.value=r,this.validateValue=t,this.setValue=e,this.priority=n,s&&(this.subPriority=s)}validate(r,t){return this.validateValue(r,this.value,t)}set(r,t,e){return this.setValue(r,t,this.value,e)}}class Ro extends Dr{constructor(t,e){super();y(this,"priority",Yo);y(this,"subPriority",-1);this.context=t||(n=>W(e,n))}set(t,e){return e.timestampIsSet?t:W(t,Eo(t,this.context))}}class Y{run(r,t,e,n){const s=this.parse(r,t,e,n);return s?{setter:new Io(s.value,this.validate,this.set,this.priority,this.subPriority),rest:s.rest}:null}validate(r,t,e){return!0}}class Fo extends Y{constructor(){super(...arguments);y(this,"priority",140);y(this,"incompatibleTokens",["R","u","t","T"])}parse(t,e,n){switch(e){case"G":case"GG":case"GGG":return n.era(t,{width:"abbreviated"})||n.era(t,{width:"narrow"});case"GGGGG":return n.era(t,{width:"narrow"});case"GGGG":default:return n.era(t,{width:"wide"})||n.era(t,{width:"abbreviated"})||n.era(t,{width:"narrow"})}}set(t,e,n){return e.era=n,t.setFullYear(n,0,1),t.setHours(0,0,0,0),t}}const U={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},pe={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function j(a,r){return a&&{value:r(a.value),rest:a.rest}}function B(a,r){const t=r.match(a);return t?{value:parseInt(t[0],10),rest:r.slice(t[0].length)}:null}function he(a,r){const t=r.match(a);if(!t)return null;if(t[0]==="Z")return{value:0,rest:r.slice(1)};const e=t[1]==="+"?1:-1,n=t[2]?parseInt(t[2],10):0,s=t[3]?parseInt(t[3],10):0,o=t[5]?parseInt(t[5],10):0;return{value:e*(n*At+s*Wt+o*_s),rest:r.slice(t[0].length)}}function yr(a){return B(U.anyDigitsSigned,a)}function V(a,r){switch(a){case 1:return B(U.singleDigit,r);case 2:return B(U.twoDigits,r);case 3:return B(U.threeDigits,r);case 4:return B(U.fourDigits,r);default:return B(new RegExp("^\\d{1,"+a+"}"),r)}}function Yt(a,r){switch(a){case 1:return B(U.singleDigitSigned,r);case 2:return B(U.twoDigitsSigned,r);case 3:return B(U.threeDigitsSigned,r);case 4:return B(U.fourDigitsSigned,r);default:return B(new RegExp("^-?\\d{1,"+a+"}"),r)}}function un(a){switch(a){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;case"am":case"midnight":case"night":default:return 0}}function vr(a,r){const t=r>0,e=t?r:1-r;let n;if(e<=50)n=a||100;else{const s=e+50,o=Math.trunc(s/100)*100,i=a>=s%100;n=a+o-(i?100:0)}return t?n:1-n}function br(a){return a%400===0||a%4===0&&a%100!==0}class Lo extends Y{constructor(){super(...arguments);y(this,"priority",130);y(this,"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"])}parse(t,e,n){const s=o=>({year:o,isTwoDigitYear:e==="yy"});switch(e){case"y":return j(V(4,t),s);case"yo":return j(n.ordinalNumber(t,{unit:"year"}),s);default:return j(V(e.length,t),s)}}validate(t,e){return e.isTwoDigitYear||e.year>0}set(t,e,n){const s=t.getFullYear();if(n.isTwoDigitYear){const i=vr(n.year,s);return t.setFullYear(i,0,1),t.setHours(0,0,0,0),t}const o=!("era"in e)||e.era===1?n.year:1-n.year;return t.setFullYear(o,0,1),t.setHours(0,0,0,0),t}}class Wo extends Y{constructor(){super(...arguments);y(this,"priority",130);y(this,"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"])}parse(t,e,n){const s=o=>({year:o,isTwoDigitYear:e==="YY"});switch(e){case"Y":return j(V(4,t),s);case"Yo":return j(n.ordinalNumber(t,{unit:"year"}),s);default:return j(V(e.length,t),s)}}validate(t,e){return e.isTwoDigitYear||e.year>0}set(t,e,n,s){const o=cn(t,s);if(n.isTwoDigitYear){const c=vr(n.year,o);return t.setFullYear(c,0,s.firstWeekContainsDate),t.setHours(0,0,0,0),be(t,s)}const i=!("era"in e)||e.era===1?n.year:1-n.year;return t.setFullYear(i,0,s.firstWeekContainsDate),t.setHours(0,0,0,0),be(t,s)}}class Ao extends Y{constructor(){super(...arguments);y(this,"priority",130);y(this,"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"])}parse(t,e){return Yt(e==="R"?4:e.length,t)}set(t,e,n){const s=W(t,0);return s.setFullYear(n,0,4),s.setHours(0,0,0,0),Ke(s)}}class Ho extends Y{constructor(){super(...arguments);y(this,"priority",130);y(this,"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"])}parse(t,e){return Yt(e==="u"?4:e.length,t)}set(t,e,n){return t.setFullYear(n,0,1),t.setHours(0,0,0,0),t}}class $o extends Y{constructor(){super(...arguments);y(this,"priority",120);y(this,"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"])}parse(t,e,n){switch(e){case"Q":case"QQ":return V(e.length,t);case"Qo":return n.ordinalNumber(t,{unit:"quarter"});case"QQQ":return n.quarter(t,{width:"abbreviated",context:"formatting"})||n.quarter(t,{width:"narrow",context:"formatting"});case"QQQQQ":return n.quarter(t,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(t,{width:"wide",context:"formatting"})||n.quarter(t,{width:"abbreviated",context:"formatting"})||n.quarter(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=1&&e<=4}set(t,e,n){return t.setMonth((n-1)*3,1),t.setHours(0,0,0,0),t}}class Qo extends Y{constructor(){super(...arguments);y(this,"priority",120);y(this,"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"])}parse(t,e,n){switch(e){case"q":case"qq":return V(e.length,t);case"qo":return n.ordinalNumber(t,{unit:"quarter"});case"qqq":return n.quarter(t,{width:"abbreviated",context:"standalone"})||n.quarter(t,{width:"narrow",context:"standalone"});case"qqqqq":return n.quarter(t,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(t,{width:"wide",context:"standalone"})||n.quarter(t,{width:"abbreviated",context:"standalone"})||n.quarter(t,{width:"narrow",context:"standalone"})}}validate(t,e){return e>=1&&e<=4}set(t,e,n){return t.setMonth((n-1)*3,1),t.setHours(0,0,0,0),t}}class Bo extends Y{constructor(){super(...arguments);y(this,"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]);y(this,"priority",110)}parse(t,e,n){const s=o=>o-1;switch(e){case"M":return j(B(U.month,t),s);case"MM":return j(V(2,t),s);case"Mo":return j(n.ordinalNumber(t,{unit:"month"}),s);case"MMM":return n.month(t,{width:"abbreviated",context:"formatting"})||n.month(t,{width:"narrow",context:"formatting"});case"MMMMM":return n.month(t,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(t,{width:"wide",context:"formatting"})||n.month(t,{width:"abbreviated",context:"formatting"})||n.month(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=0&&e<=11}set(t,e,n){return t.setMonth(n,1),t.setHours(0,0,0,0),t}}class qo extends Y{constructor(){super(...arguments);y(this,"priority",110);y(this,"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"])}parse(t,e,n){const s=o=>o-1;switch(e){case"L":return j(B(U.month,t),s);case"LL":return j(V(2,t),s);case"Lo":return j(n.ordinalNumber(t,{unit:"month"}),s);case"LLL":return n.month(t,{width:"abbreviated",context:"standalone"})||n.month(t,{width:"narrow",context:"standalone"});case"LLLLL":return n.month(t,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(t,{width:"wide",context:"standalone"})||n.month(t,{width:"abbreviated",context:"standalone"})||n.month(t,{width:"narrow",context:"standalone"})}}validate(t,e){return e>=0&&e<=11}set(t,e,n){return t.setMonth(n,1),t.setHours(0,0,0,0),t}}function Ko(a,r,t){const e=b(a,t==null?void 0:t.in),n=gr(e,t)-r;return e.setDate(e.getDate()-n*7),b(e,t==null?void 0:t.in)}class Vo extends Y{constructor(){super(...arguments);y(this,"priority",100);y(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"])}parse(t,e,n){switch(e){case"w":return B(U.week,t);case"wo":return n.ordinalNumber(t,{unit:"week"});default:return V(e.length,t)}}validate(t,e){return e>=1&&e<=53}set(t,e,n,s){return be(Ko(t,n,s),s)}}function Uo(a,r,t){const e=b(a,t==null?void 0:t.in),n=on(e,t)-r;return e.setDate(e.getDate()-n*7),e}class jo extends Y{constructor(){super(...arguments);y(this,"priority",100);y(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"])}parse(t,e,n){switch(e){case"I":return B(U.week,t);case"Io":return n.ordinalNumber(t,{unit:"week"});default:return V(e.length,t)}}validate(t,e){return e>=1&&e<=53}set(t,e,n){return Ke(Uo(t,n))}}const Xo=[31,28,31,30,31,30,31,31,30,31,30,31],Go=[31,29,31,30,31,30,31,31,30,31,30,31];class zo extends Y{constructor(){super(...arguments);y(this,"priority",90);y(this,"subPriority",1);y(this,"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"])}parse(t,e,n){switch(e){case"d":return B(U.date,t);case"do":return n.ordinalNumber(t,{unit:"date"});default:return V(e.length,t)}}validate(t,e){const n=t.getFullYear(),s=br(n),o=t.getMonth();return s?e>=1&&e<=Go[o]:e>=1&&e<=Xo[o]}set(t,e,n){return t.setDate(n),t.setHours(0,0,0,0),t}}class Zo extends Y{constructor(){super(...arguments);y(this,"priority",90);y(this,"subpriority",1);y(this,"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"])}parse(t,e,n){switch(e){case"D":case"DD":return B(U.dayOfYear,t);case"Do":return n.ordinalNumber(t,{unit:"date"});default:return V(e.length,t)}}validate(t,e){const n=t.getFullYear();return br(n)?e>=1&&e<=366:e>=1&&e<=365}set(t,e,n){return t.setMonth(0,n),t.setHours(0,0,0,0),t}}function ln(a,r,t){var d,f,p,h;const e=We(),n=(t==null?void 0:t.weekStartsOn)??((f=(d=t==null?void 0:t.locale)==null?void 0:d.options)==null?void 0:f.weekStartsOn)??e.weekStartsOn??((h=(p=e.locale)==null?void 0:p.options)==null?void 0:h.weekStartsOn)??0,s=b(a,t==null?void 0:t.in),o=s.getDay(),c=(r%7+7)%7,u=7-n,l=r<0||r>6?r-(o+u)%7:(c+u)%7-(o+u)%7;return ce(s,l,t)}class Jo extends Y{constructor(){super(...arguments);y(this,"priority",90);y(this,"incompatibleTokens",["D","i","e","c","t","T"])}parse(t,e,n){switch(e){case"E":case"EE":case"EEE":return n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"});case"EEEEE":return n.day(t,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"});case"EEEE":default:return n.day(t,{width:"wide",context:"formatting"})||n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=0&&e<=6}set(t,e,n,s){return t=ln(t,n,s),t.setHours(0,0,0,0),t}}class ei extends Y{constructor(){super(...arguments);y(this,"priority",90);y(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"])}parse(t,e,n,s){const o=i=>{const c=Math.floor((i-1)/7)*7;return(i+s.weekStartsOn+6)%7+c};switch(e){case"e":case"ee":return j(V(e.length,t),o);case"eo":return j(n.ordinalNumber(t,{unit:"day"}),o);case"eee":return n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"});case"eeeee":return n.day(t,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"});case"eeee":default:return n.day(t,{width:"wide",context:"formatting"})||n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=0&&e<=6}set(t,e,n,s){return t=ln(t,n,s),t.setHours(0,0,0,0),t}}class ti extends Y{constructor(){super(...arguments);y(this,"priority",90);y(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"])}parse(t,e,n,s){const o=i=>{const c=Math.floor((i-1)/7)*7;return(i+s.weekStartsOn+6)%7+c};switch(e){case"c":case"cc":return j(V(e.length,t),o);case"co":return j(n.ordinalNumber(t,{unit:"day"}),o);case"ccc":return n.day(t,{width:"abbreviated",context:"standalone"})||n.day(t,{width:"short",context:"standalone"})||n.day(t,{width:"narrow",context:"standalone"});case"ccccc":return n.day(t,{width:"narrow",context:"standalone"});case"cccccc":return n.day(t,{width:"short",context:"standalone"})||n.day(t,{width:"narrow",context:"standalone"});case"cccc":default:return n.day(t,{width:"wide",context:"standalone"})||n.day(t,{width:"abbreviated",context:"standalone"})||n.day(t,{width:"short",context:"standalone"})||n.day(t,{width:"narrow",context:"standalone"})}}validate(t,e){return e>=0&&e<=6}set(t,e,n,s){return t=ln(t,n,s),t.setHours(0,0,0,0),t}}function ni(a,r,t){const e=b(a,t==null?void 0:t.in),n=To(e,t),s=r-n;return ce(e,s,t)}class ri extends Y{constructor(){super(...arguments);y(this,"priority",90);y(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"])}parse(t,e,n){const s=o=>o===0?7:o;switch(e){case"i":case"ii":return V(e.length,t);case"io":return n.ordinalNumber(t,{unit:"day"});case"iii":return j(n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"}),s);case"iiiii":return j(n.day(t,{width:"narrow",context:"formatting"}),s);case"iiiiii":return j(n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"}),s);case"iiii":default:return j(n.day(t,{width:"wide",context:"formatting"})||n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"}),s)}}validate(t,e){return e>=1&&e<=7}set(t,e,n){return t=ni(t,n),t.setHours(0,0,0,0),t}}class ai extends Y{constructor(){super(...arguments);y(this,"priority",80);y(this,"incompatibleTokens",["b","B","H","k","t","T"])}parse(t,e,n){switch(e){case"a":case"aa":case"aaa":return n.dayPeriod(t,{width:"abbreviated",context:"formatting"})||n.dayPeriod(t,{width:"narrow",context:"formatting"});case"aaaaa":return n.dayPeriod(t,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(t,{width:"wide",context:"formatting"})||n.dayPeriod(t,{width:"abbreviated",context:"formatting"})||n.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,e,n){return t.setHours(un(n),0,0,0),t}}class si extends Y{constructor(){super(...arguments);y(this,"priority",80);y(this,"incompatibleTokens",["a","B","H","k","t","T"])}parse(t,e,n){switch(e){case"b":case"bb":case"bbb":return n.dayPeriod(t,{width:"abbreviated",context:"formatting"})||n.dayPeriod(t,{width:"narrow",context:"formatting"});case"bbbbb":return n.dayPeriod(t,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(t,{width:"wide",context:"formatting"})||n.dayPeriod(t,{width:"abbreviated",context:"formatting"})||n.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,e,n){return t.setHours(un(n),0,0,0),t}}class oi extends Y{constructor(){super(...arguments);y(this,"priority",80);y(this,"incompatibleTokens",["a","b","t","T"])}parse(t,e,n){switch(e){case"B":case"BB":case"BBB":return n.dayPeriod(t,{width:"abbreviated",context:"formatting"})||n.dayPeriod(t,{width:"narrow",context:"formatting"});case"BBBBB":return n.dayPeriod(t,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(t,{width:"wide",context:"formatting"})||n.dayPeriod(t,{width:"abbreviated",context:"formatting"})||n.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,e,n){return t.setHours(un(n),0,0,0),t}}class ii extends Y{constructor(){super(...arguments);y(this,"priority",70);y(this,"incompatibleTokens",["H","K","k","t","T"])}parse(t,e,n){switch(e){case"h":return B(U.hour12h,t);case"ho":return n.ordinalNumber(t,{unit:"hour"});default:return V(e.length,t)}}validate(t,e){return e>=1&&e<=12}set(t,e,n){const s=t.getHours()>=12;return s&&n<12?t.setHours(n+12,0,0,0):!s&&n===12?t.setHours(0,0,0,0):t.setHours(n,0,0,0),t}}class ci extends Y{constructor(){super(...arguments);y(this,"priority",70);y(this,"incompatibleTokens",["a","b","h","K","k","t","T"])}parse(t,e,n){switch(e){case"H":return B(U.hour23h,t);case"Ho":return n.ordinalNumber(t,{unit:"hour"});default:return V(e.length,t)}}validate(t,e){return e>=0&&e<=23}set(t,e,n){return t.setHours(n,0,0,0),t}}class ui extends Y{constructor(){super(...arguments);y(this,"priority",70);y(this,"incompatibleTokens",["h","H","k","t","T"])}parse(t,e,n){switch(e){case"K":return B(U.hour11h,t);case"Ko":return n.ordinalNumber(t,{unit:"hour"});default:return V(e.length,t)}}validate(t,e){return e>=0&&e<=11}set(t,e,n){return t.getHours()>=12&&n<12?t.setHours(n+12,0,0,0):t.setHours(n,0,0,0),t}}class li extends Y{constructor(){super(...arguments);y(this,"priority",70);y(this,"incompatibleTokens",["a","b","h","H","K","t","T"])}parse(t,e,n){switch(e){case"k":return B(U.hour24h,t);case"ko":return n.ordinalNumber(t,{unit:"hour"});default:return V(e.length,t)}}validate(t,e){return e>=1&&e<=24}set(t,e,n){const s=n<=24?n%24:n;return t.setHours(s,0,0,0),t}}class di extends Y{constructor(){super(...arguments);y(this,"priority",60);y(this,"incompatibleTokens",["t","T"])}parse(t,e,n){switch(e){case"m":return B(U.minute,t);case"mo":return n.ordinalNumber(t,{unit:"minute"});default:return V(e.length,t)}}validate(t,e){return e>=0&&e<=59}set(t,e,n){return t.setMinutes(n,0,0),t}}class fi extends Y{constructor(){super(...arguments);y(this,"priority",50);y(this,"incompatibleTokens",["t","T"])}parse(t,e,n){switch(e){case"s":return B(U.second,t);case"so":return n.ordinalNumber(t,{unit:"second"});default:return V(e.length,t)}}validate(t,e){return e>=0&&e<=59}set(t,e,n){return t.setSeconds(n,0),t}}class pi extends Y{constructor(){super(...arguments);y(this,"priority",30);y(this,"incompatibleTokens",["t","T"])}parse(t,e){const n=s=>Math.trunc(s*Math.pow(10,-e.length+3));return j(V(e.length,t),n)}set(t,e,n){return t.setMilliseconds(n),t}}class hi extends Y{constructor(){super(...arguments);y(this,"priority",10);y(this,"incompatibleTokens",["t","T","x"])}parse(t,e){switch(e){case"X":return he(pe.basicOptionalMinutes,t);case"XX":return he(pe.basic,t);case"XXXX":return he(pe.basicOptionalSeconds,t);case"XXXXX":return he(pe.extendedOptionalSeconds,t);case"XXX":default:return he(pe.extended,t)}}set(t,e,n){return e.timestampIsSet?t:W(t,t.getTime()-Ct(t)-n)}}class mi extends Y{constructor(){super(...arguments);y(this,"priority",10);y(this,"incompatibleTokens",["t","T","X"])}parse(t,e){switch(e){case"x":return he(pe.basicOptionalMinutes,t);case"xx":return he(pe.basic,t);case"xxxx":return he(pe.basicOptionalSeconds,t);case"xxxxx":return he(pe.extendedOptionalSeconds,t);case"xxx":default:return he(pe.extended,t)}}set(t,e,n){return e.timestampIsSet?t:W(t,t.getTime()-Ct(t)-n)}}class gi extends Y{constructor(){super(...arguments);y(this,"priority",40);y(this,"incompatibleTokens","*")}parse(t){return yr(t)}set(t,e,n){return[W(t,n*1e3),{timestampIsSet:!0}]}}class wi extends Y{constructor(){super(...arguments);y(this,"priority",20);y(this,"incompatibleTokens","*")}parse(t){return yr(t)}set(t,e,n){return[W(t,n),{timestampIsSet:!0}]}}const Di={G:new Fo,y:new Lo,Y:new Wo,R:new Ao,u:new Ho,Q:new $o,q:new Qo,M:new Bo,L:new qo,w:new Vo,I:new jo,d:new zo,D:new Zo,E:new Jo,e:new ei,c:new ti,i:new ri,a:new ai,b:new si,B:new oi,h:new ii,H:new ci,K:new ui,k:new li,m:new di,s:new fi,S:new pi,X:new hi,x:new mi,t:new gi,T:new wi},yi=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,vi=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,bi=/^'([^]*?)'?$/,ki=/''/g,_i=/\S/,Mi=/[a-zA-Z]/;function xi(a,r,t,e){var w,k,S,x,N,q,$,I;const n=()=>W((e==null?void 0:e.in)||t,NaN),s=Po(),o=(e==null?void 0:e.locale)??s.locale??mr,i=(e==null?void 0:e.firstWeekContainsDate)??((k=(w=e==null?void 0:e.locale)==null?void 0:w.options)==null?void 0:k.firstWeekContainsDate)??s.firstWeekContainsDate??((x=(S=s.locale)==null?void 0:S.options)==null?void 0:x.firstWeekContainsDate)??1,c=(e==null?void 0:e.weekStartsOn)??((q=(N=e==null?void 0:e.locale)==null?void 0:N.options)==null?void 0:q.weekStartsOn)??s.weekStartsOn??((I=($=s.locale)==null?void 0:$.options)==null?void 0:I.weekStartsOn)??0;if(!r)return a?n():b(t,e==null?void 0:e.in);const u={firstWeekContainsDate:i,weekStartsOn:c,locale:o},l=[new Ro(e==null?void 0:e.in,t)],d=r.match(vi).map(_=>{const M=_[0];if(M in en){const F=en[M];return F(_,o.formatLong)}return _}).join("").match(yi),f=[];for(let _ of d){const M=_[0],F=Di[M];if(F){const{incompatibleTokens:X}=F;if(Array.isArray(X)){const J=f.find(le=>X.includes(le.token)||le.token===M);if(J)throw new RangeError(`The format string mustn't contain \`${J.fullToken}\` and \`${_}\` at the same time`)}else if(F.incompatibleTokens==="*"&&f.length>0)throw new RangeError(`The format string mustn't contain \`${_}\` and any other token at the same time`);f.push({token:M,fullToken:_});const K=F.run(a,_,o.match,u);if(!K)return n();l.push(K.setter),a=K.rest}else{if(M.match(Mi))throw new RangeError("Format string contains an unescaped latin alphabet character `"+M+"`");if(_==="''"?_="'":M==="'"&&(_=Si(_)),a.indexOf(_)===0)a=a.slice(_.length);else return n()}}if(a.length>0&&_i.test(a))return n();const p=l.map(_=>_.priority).sort((_,M)=>M-_).filter((_,M,F)=>F.indexOf(_)===M).map(_=>l.filter(M=>M.priority===_).sort((M,F)=>F.subPriority-M.subPriority)).map(_=>_[0]);let h=b(t,e==null?void 0:e.in);if(isNaN(+h))return n();const g={};for(const _ of p){if(!_.validate(h,u))return n();const M=_.set(h,g,u);Array.isArray(M)?(h=M[0],Object.assign(g,M[1])):h=M}return h}function Si(a){return a.match(bi)[1].replace(ki,"'")}function Ci(a,r,t){const[e,n]=ke(t==null?void 0:t.in,a,r);return e.getFullYear()===n.getFullYear()&&e.getMonth()===n.getMonth()}function Pi(a,r,t){const[e,n]=ke(t==null?void 0:t.in,a,r);return+Jt(e)==+Jt(n)}function Ti(a,r,t){const[e,n]=ke(t==null?void 0:t.in,a,r);return e.getFullYear()===n.getFullYear()}function ut(a,r,t){const e=+b(a,t==null?void 0:t.in),[n,s]=[+b(r.start,t==null?void 0:t.in),+b(r.end,t==null?void 0:t.in)].sort((o,i)=>o-i);return e>=n&&e<=s}function Oi(a,r,t){return ce(a,-1,t)}function Ei(a,r){const t=()=>W(r==null?void 0:r.in,NaN),n=Ri(a);let s;if(n.date){const u=Fi(n.date,2);s=Li(u.restDateString,u.year)}if(!s||isNaN(+s))return t();const o=+s;let i=0,c;if(n.time&&(i=Wi(n.time),isNaN(i)))return t();if(n.timezone){if(c=Ai(n.timezone),isNaN(c))return t()}else{const u=new Date(o+i),l=b(0,r==null?void 0:r.in);return l.setFullYear(u.getUTCFullYear(),u.getUTCMonth(),u.getUTCDate()),l.setHours(u.getUTCHours(),u.getUTCMinutes(),u.getUTCSeconds(),u.getUTCMilliseconds()),l}return b(o+i+c,r==null?void 0:r.in)}const ht={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},Ni=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,Yi=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,Ii=/^([+-])(\d{2})(?::?(\d{2}))?$/;function Ri(a){const r={},t=a.split(ht.dateTimeDelimiter);let e;if(t.length>2)return r;if(/:/.test(t[0])?e=t[0]:(r.date=t[0],e=t[1],ht.timeZoneDelimiter.test(r.date)&&(r.date=a.split(ht.timeZoneDelimiter)[0],e=a.substr(r.date.length,a.length))),e){const n=ht.timezone.exec(e);n?(r.time=e.replace(n[1],""),r.timezone=n[1]):r.time=e}return r}function Fi(a,r){const t=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+r)+"})|(\\d{2}|[+-]\\d{"+(2+r)+"})$)"),e=a.match(t);if(!e)return{year:NaN,restDateString:""};const n=e[1]?parseInt(e[1]):null,s=e[2]?parseInt(e[2]):null;return{year:s===null?n:s*100,restDateString:a.slice((e[1]||e[2]).length)}}function Li(a,r){if(r===null)return new Date(NaN);const t=a.match(Ni);if(!t)return new Date(NaN);const e=!!t[4],n=rt(t[1]),s=rt(t[2])-1,o=rt(t[3]),i=rt(t[4]),c=rt(t[5])-1;if(e)return qi(r,i,c)?Hi(r,i,c):new Date(NaN);{const u=new Date(0);return!Qi(r,s,o)||!Bi(r,n)?new Date(NaN):(u.setUTCFullYear(r,s,Math.max(n,o)),u)}}function rt(a){return a?parseInt(a):1}function Wi(a){const r=a.match(Yi);if(!r)return NaN;const t=Vt(r[1]),e=Vt(r[2]),n=Vt(r[3]);return Ki(t,e,n)?t*At+e*Wt+n*1e3:NaN}function Vt(a){return a&&parseFloat(a.replace(",","."))||0}function Ai(a){if(a==="Z")return 0;const r=a.match(Ii);if(!r)return 0;const t=r[1]==="+"?-1:1,e=parseInt(r[2]),n=r[3]&&parseInt(r[3])||0;return Vi(e,n)?t*(e*At+n*Wt):NaN}function Hi(a,r,t){const e=new Date(0);e.setUTCFullYear(a,0,4);const n=e.getUTCDay()||7,s=(r-1)*7+t+1-n;return e.setUTCDate(e.getUTCDate()+s),e}const $i=[31,null,31,30,31,30,31,31,30,31,30,31];function kr(a){return a%400===0||a%4===0&&a%100!==0}function Qi(a,r,t){return r>=0&&r<=11&&t>=1&&t<=($i[r]||(kr(a)?29:28))}function Bi(a,r){return r>=1&&r<=(kr(a)?366:365)}function qi(a,r,t){return r>=1&&r<=53&&t>=0&&t<=6}function Ki(a,r,t){return a===24?r===0&&t===0:t>=0&&t<60&&r>=0&&r<60&&a>=0&&a<25}function Vi(a,r){return r>=0&&r<=59}function ae(a,r,t){const e=b(a,t==null?void 0:t.in),n=e.getFullYear(),s=e.getDate(),o=W(a,0);o.setFullYear(n,r,15),o.setHours(0,0,0,0);const i=Co(o);return e.setMonth(r,Math.min(s,i)),e}function vt(a,r,t){const e=b(a,t==null?void 0:t.in);return e.setHours(r),e}function bt(a,r,t){const e=b(a,t==null?void 0:t.in);return e.setMinutes(r),e}function $e(a,r,t){const e=b(a,t==null?void 0:t.in),n=Math.trunc(e.getMonth()/3)+1,s=r-n;return ae(e,e.getMonth()+s*3)}function kt(a,r,t){const e=b(a,t==null?void 0:t.in);return e.setSeconds(r),e}function de(a,r,t){const e=b(a,t==null?void 0:t.in);return isNaN(+e)?W(a,NaN):(e.setFullYear(r),e)}function Ie(a,r,t){return ue(a,-r,t)}function _r(a,r,t){return sn(a,-1,t)}function Nn(a,r,t){return Pt(a,-1,t)}function Ue(a,r,t){return ge(a,-r,t)}const Mr={...Fr},Ui=Mr.useInsertionEffect,ji=Ui||(a=>a());function Xi(a){const r=v.useRef(()=>{});return ji(()=>{r.current=a}),v.useCallback(function(){for(var t=arguments.length,e=new Array(t),n=0;n"floating-ui-"+Math.random().toString(36).slice(2,6)+Gi++;function zi(){const[a,r]=v.useState(()=>Yn?In():void 0);return It(()=>{a==null&&r(In())},[]),v.useEffect(()=>{Yn=!0},[]),a}const Zi=Mr.useId,xr=Zi||zi,Ji=v.forwardRef(function(r,t){const{context:{placement:e,elements:{floating:n},middlewareData:{arrow:s,shift:o}},width:i=14,height:c=7,tipRadius:u=0,strokeWidth:l=0,staticOffset:d,stroke:f,d:p,style:{transform:h,...g}={},...w}=r,k=xr(),[S,x]=v.useState(!1);if(It(()=>{if(!n)return;Wr(n).direction==="rtl"&&x(!0)},[n]),!n)return null;const[N,q]=e.split("-"),$=N==="top"||N==="bottom";let I=d;($&&o!=null&&o.x||!$&&o!=null&&o.y)&&(I=null);const _=l*2,M=_/2,F=i/2*(u/-8+1),X=c/2*u/4,K=!!p,J=I&&q==="end"?"bottom":"top";let le=I&&q==="end"?"right":"left";I&&S&&(le=q==="end"?"left":"right");const G=(s==null?void 0:s.x)!=null?I||s.x:"",A=(s==null?void 0:s.y)!=null?I||s.y:"",Q=p||"M0,0"+(" H"+i)+(" L"+(i-F)+","+(c-X))+(" Q"+i/2+","+c+" "+F+","+(c-X))+" Z",ne={top:K?"rotate(180deg)":"",left:K?"rotate(90deg)":"rotate(-90deg)",bottom:K?"":"rotate(180deg)",right:K?"rotate(-90deg)":"rotate(90deg)"}[N];return Ge.jsxs("svg",{...w,"aria-hidden":!0,ref:t,width:K?i:i+_,height:i,viewBox:"0 0 "+i+" "+(c>i?c:i),style:{position:"absolute",pointerEvents:"none",[le]:G,[J]:A,[N]:$||K?"100%":"calc(100% - "+_/2+"px)",transform:[ne,h].filter(Xe=>!!Xe).join(" "),...g},children:[_>0&&Ge.jsx("path",{clipPath:"url(#"+k+")",fill:"none",stroke:f,strokeWidth:_+(p?0:1),d:Q}),Ge.jsx("path",{stroke:_&&!p?w.fill:"none",d:Q}),Ge.jsx("clipPath",{id:k,children:Ge.jsx("rect",{x:-M,y:M*(K?-1:1),width:i+_,height:i})})]})});function ec(){const a=new Map;return{emit(r,t){var e;(e=a.get(r))==null||e.forEach(n=>n(t))},on(r,t){a.set(r,[...a.get(r)||[],t])},off(r,t){var e;a.set(r,((e=a.get(r))==null?void 0:e.filter(n=>n!==t))||[])}}}const tc=v.createContext(null),nc=v.createContext(null),rc=()=>{var a;return((a=v.useContext(tc))==null?void 0:a.id)||null},ac=()=>v.useContext(nc);function sc(a){const{open:r=!1,onOpenChange:t,elements:e}=a,n=xr(),s=v.useRef({}),[o]=v.useState(()=>ec()),i=rc()!=null,[c,u]=v.useState(e.reference),l=Xi((p,h,g)=>{s.current.openEvent=p?h:void 0,o.emit("openchange",{open:p,event:h,reason:g,nested:i}),t==null||t(p,h,g)}),d=v.useMemo(()=>({setPositionReference:u}),[]),f=v.useMemo(()=>({reference:c||e.reference||null,floating:e.floating||null,domReference:e.reference}),[c,e.reference,e.floating]);return v.useMemo(()=>({dataRef:s,open:r,onOpenChange:l,elements:f,events:o,floatingId:n,refs:d}),[r,l,f,o,n,d])}function oc(a){a===void 0&&(a={});const{nodeId:r}=a,t=sc({...a,elements:{reference:null,floating:null,...a.elements}}),e=a.rootContext||t,n=e.elements,[s,o]=v.useState(null),[i,c]=v.useState(null),l=(n==null?void 0:n.domReference)||s,d=v.useRef(null),f=ac();It(()=>{l&&(d.current=l)},[l]);const p=Ar({...a,elements:{...n,...i&&{reference:i}}}),h=v.useCallback(x=>{const N=ft(x)?{getBoundingClientRect:()=>x.getBoundingClientRect(),contextElement:x}:x;c(N),p.refs.setReference(N)},[p.refs]),g=v.useCallback(x=>{(ft(x)||x===null)&&(d.current=x,o(x)),(ft(p.refs.reference.current)||p.refs.reference.current===null||x!==null&&!ft(x))&&p.refs.setReference(x)},[p.refs]),w=v.useMemo(()=>({...p.refs,setReference:g,setPositionReference:h,domReference:d}),[p.refs,g,h]),k=v.useMemo(()=>({...p.elements,domReference:l}),[p.elements,l]),S=v.useMemo(()=>({...p,...e,refs:w,elements:k,nodeId:r}),[p,w,k,r,e]);return It(()=>{e.dataRef.current.floatingContext=S;const x=f==null?void 0:f.nodesRef.current.find(N=>N.id===r);x&&(x.context=S)}),v.useMemo(()=>({...p,context:S,refs:w,elements:k}),[p,w,k,S])}/*! - react-datepicker v8.0.0 +var Ir=Object.defineProperty;var Rr=(a,r,t)=>r in a?Ir(a,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[r]=t;var y=(a,r,t)=>Rr(a,typeof r!="symbol"?r+"":r,t);import{c as Z}from"./ui-utils-BNSC_Jv-.js";import{r as v,R as Fr,b as m,d as Lr}from"./react-core-D_V7s-9r.js";import{s as Wr,j as Ge,t as Ar,v as ft,w as Hr,x as $r,y as Qr,z as Br}from"./radix-core-mDeFS0Pz.js";function C(a){const r=Object.prototype.toString.call(a);return a instanceof Date||typeof a=="object"&&r==="[object Date]"?new a.constructor(+a):typeof a=="number"||r==="[object Number]"||typeof a=="string"||r==="[object String]"?new Date(a):new Date(NaN)}function oe(a,r){return a instanceof Date?new a.constructor(r):new Date(r)}function qr(a,r){const t=C(a);return isNaN(r)?oe(a,NaN):(r&&t.setDate(t.getDate()+r),t)}function Kr(a,r){const t=C(a);if(isNaN(r))return oe(a,NaN);if(!r)return t;const e=t.getDate(),n=oe(a,t.getTime());n.setMonth(t.getMonth()+r+1,0);const s=n.getDate();return e>=s?n:(t.setFullYear(n.getFullYear(),n.getMonth(),e),t)}function ze(a,r){const{years:t=0,months:e=0,weeks:n=0,days:s=0,hours:o=0,minutes:i=0,seconds:c=0}=r,u=C(a),l=e||t?Kr(u,e+t*12):u,d=s||n?qr(l,s+n*7):l,f=i+o*60,h=(c+f*60)*1e3;return oe(a,d.getTime()+h)}const Jn=6048e5,Vr=864e5,it=6e4,rn=36e5,mn=525600,Qe=43200,xt=1440;let Ur={};function Le(){return Ur}function ct(a,r){var i,c,u,l;const t=Le(),e=(r==null?void 0:r.weekStartsOn)??((c=(i=r==null?void 0:r.locale)==null?void 0:i.options)==null?void 0:c.weekStartsOn)??t.weekStartsOn??((l=(u=t.locale)==null?void 0:u.options)==null?void 0:l.weekStartsOn)??0,n=C(a),s=n.getDay(),o=(s=n.getTime()?t+1:r.getTime()>=o.getTime()?t:t-1}function gn(a){const r=C(a);return r.setHours(0,0,0,0),r}function qe(a){const r=C(a),t=new Date(Date.UTC(r.getFullYear(),r.getMonth(),r.getDate(),r.getHours(),r.getMinutes(),r.getSeconds(),r.getMilliseconds()));return t.setUTCFullYear(r.getFullYear()),+a-+t}function tr(a,r){const t=gn(a),e=gn(r),n=+t-qe(t),s=+e-qe(e);return Math.round((n-s)/Vr)}function jr(a){const r=er(a),t=oe(a,0);return t.setFullYear(r,0,4),t.setHours(0,0,0,0),St(t)}function Ne(a,r){const t=C(a),e=C(r),n=t.getTime()-e.getTime();return n<0?-1:n>0?1:n}function nr(a){return oe(a,Date.now())}function Xr(a){return a instanceof Date||typeof a=="object"&&Object.prototype.toString.call(a)==="[object Date]"}function Gr(a){if(!Xr(a)&&typeof a!="number")return!1;const r=C(a);return!isNaN(Number(r))}function zr(a,r){const t=C(a),e=C(r),n=t.getFullYear()-e.getFullYear(),s=t.getMonth()-e.getMonth();return n*12+s}function Zr(a,r){const t=C(a),e=C(r);return t.getFullYear()-e.getFullYear()}function Jr(a,r){const t=C(a),e=C(r),n=wn(t,e),s=Math.abs(tr(t,e));t.setDate(t.getDate()-n*s);const o=+(wn(t,e)===-n),i=n*(s-o);return i===0?0:i}function wn(a,r){const t=a.getFullYear()-r.getFullYear()||a.getMonth()-r.getMonth()||a.getDate()-r.getDate()||a.getHours()-r.getHours()||a.getMinutes()-r.getMinutes()||a.getSeconds()-r.getSeconds()||a.getMilliseconds()-r.getMilliseconds();return t<0?-1:t>0?1:t}function Ft(a){return r=>{const e=(a?Math[a]:Math.trunc)(r);return e===0?0:e}}function an(a,r){return+C(a)-+C(r)}function ea(a,r,t){const e=an(a,r)/rn;return Ft(t==null?void 0:t.roundingMethod)(e)}function ta(a,r,t){const e=an(a,r)/it;return Ft(t==null?void 0:t.roundingMethod)(e)}function na(a){const r=C(a);return r.setHours(23,59,59,999),r}function ra(a){const r=C(a),t=r.getMonth();return r.setFullYear(r.getFullYear(),t+1,0),r.setHours(23,59,59,999),r}function aa(a){const r=C(a);return+na(r)==+ra(r)}function rr(a,r){const t=C(a),e=C(r),n=Ne(t,e),s=Math.abs(zr(t,e));let o;if(s<1)o=0;else{t.getMonth()===1&&t.getDate()>27&&t.setDate(30),t.setMonth(t.getMonth()-n*s);let i=Ne(t,e)===-n;aa(C(a))&&s===1&&Ne(a,e)===1&&(i=!1),o=n*(s-Number(i))}return o===0?0:o}function ar(a,r,t){const e=an(a,r)/1e3;return Ft(t==null?void 0:t.roundingMethod)(e)}function sa(a,r){const t=C(a),e=C(r),n=Ne(t,e),s=Math.abs(Zr(t,e));t.setFullYear(1584),e.setFullYear(1584);const o=Ne(t,e)===-n,i=n*(s-+o);return i===0?0:i}function oa(a){const r=C(a),t=oe(a,0);return t.setFullYear(r.getFullYear(),0,1),t.setHours(0,0,0,0),t}const ia={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"}},ca=(a,r,t)=>{let e;const n=ia[a];return typeof n=="string"?e=n:r===1?e=n.one:e=n.other.replace("{{count}}",r.toString()),t!=null&&t.addSuffix?t.comparison&&t.comparison>0?"in "+e:e+" ago":e};function Bt(a){return(r={})=>{const t=r.width?String(r.width):a.defaultWidth;return a.formats[t]||a.formats[a.defaultWidth]}}const ua={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},la={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},da={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},fa={date:Bt({formats:ua,defaultWidth:"full"}),time:Bt({formats:la,defaultWidth:"full"}),dateTime:Bt({formats:da,defaultWidth:"full"})},pa={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},ha=(a,r,t,e)=>pa[a];function Ze(a){return(r,t)=>{const e=t!=null&&t.context?String(t.context):"standalone";let n;if(e==="formatting"&&a.formattingValues){const o=a.defaultFormattingWidth||a.defaultWidth,i=t!=null&&t.width?String(t.width):o;n=a.formattingValues[i]||a.formattingValues[o]}else{const o=a.defaultWidth,i=t!=null&&t.width?String(t.width):a.defaultWidth;n=a.values[i]||a.values[o]}const s=a.argumentCallback?a.argumentCallback(r):r;return n[s]}}const ma={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},ga={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},wa={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"]},Da={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"]},ya={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"}},va={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"}},ba=(a,r)=>{const t=Number(a),e=t%100;if(e>20||e<10)switch(e%10){case 1:return t+"st";case 2:return t+"nd";case 3:return t+"rd"}return t+"th"},ka={ordinalNumber:ba,era:Ze({values:ma,defaultWidth:"wide"}),quarter:Ze({values:ga,defaultWidth:"wide",argumentCallback:a=>a-1}),month:Ze({values:wa,defaultWidth:"wide"}),day:Ze({values:Da,defaultWidth:"wide"}),dayPeriod:Ze({values:ya,defaultWidth:"wide",formattingValues:va,defaultFormattingWidth:"wide"})};function Je(a){return(r,t={})=>{const e=t.width,n=e&&a.matchPatterns[e]||a.matchPatterns[a.defaultMatchWidth],s=r.match(n);if(!s)return null;const o=s[0],i=e&&a.parsePatterns[e]||a.parsePatterns[a.defaultParseWidth],c=Array.isArray(i)?Ma(i,d=>d.test(o)):_a(i,d=>d.test(o));let u;u=a.valueCallback?a.valueCallback(c):c,u=t.valueCallback?t.valueCallback(u):u;const l=r.slice(o.length);return{value:u,rest:l}}}function _a(a,r){for(const t in a)if(Object.prototype.hasOwnProperty.call(a,t)&&r(a[t]))return t}function Ma(a,r){for(let t=0;t{const e=r.match(a.matchPattern);if(!e)return null;const n=e[0],s=r.match(a.parsePattern);if(!s)return null;let o=a.valueCallback?a.valueCallback(s[0]):s[0];o=t.valueCallback?t.valueCallback(o):o;const i=r.slice(n.length);return{value:o,rest:i}}}const Sa=/^(\d+)(th|st|nd|rd)?/i,Ca=/\d+/i,Pa={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},Ta={any:[/^b/i,/^(a|c)/i]},Oa={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Ea={any:[/1/i,/2/i,/3/i,/4/i]},Na={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},Ya={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]},Ia={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},Ra={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]},Fa={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},La={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}},Wa={ordinalNumber:xa({matchPattern:Sa,parsePattern:Ca,valueCallback:a=>parseInt(a,10)}),era:Je({matchPatterns:Pa,defaultMatchWidth:"wide",parsePatterns:Ta,defaultParseWidth:"any"}),quarter:Je({matchPatterns:Oa,defaultMatchWidth:"wide",parsePatterns:Ea,defaultParseWidth:"any",valueCallback:a=>a+1}),month:Je({matchPatterns:Na,defaultMatchWidth:"wide",parsePatterns:Ya,defaultParseWidth:"any"}),day:Je({matchPatterns:Ia,defaultMatchWidth:"wide",parsePatterns:Ra,defaultParseWidth:"any"}),dayPeriod:Je({matchPatterns:Fa,defaultMatchWidth:"any",parsePatterns:La,defaultParseWidth:"any"})},Lt={code:"en-US",formatDistance:ca,formatLong:fa,formatRelative:ha,localize:ka,match:Wa,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Aa(a){const r=C(a);return tr(r,oa(r))+1}function Ha(a){const r=C(a),t=+St(r)-+jr(r);return Math.round(t/Jn)+1}function sr(a,r){var l,d,f,p;const t=C(a),e=t.getFullYear(),n=Le(),s=(r==null?void 0:r.firstWeekContainsDate)??((d=(l=r==null?void 0:r.locale)==null?void 0:l.options)==null?void 0:d.firstWeekContainsDate)??n.firstWeekContainsDate??((p=(f=n.locale)==null?void 0:f.options)==null?void 0:p.firstWeekContainsDate)??1,o=oe(a,0);o.setFullYear(e+1,0,s),o.setHours(0,0,0,0);const i=ct(o,r),c=oe(a,0);c.setFullYear(e,0,s),c.setHours(0,0,0,0);const u=ct(c,r);return t.getTime()>=i.getTime()?e+1:t.getTime()>=u.getTime()?e:e-1}function $a(a,r){var i,c,u,l;const t=Le(),e=(r==null?void 0:r.firstWeekContainsDate)??((c=(i=r==null?void 0:r.locale)==null?void 0:i.options)==null?void 0:c.firstWeekContainsDate)??t.firstWeekContainsDate??((l=(u=t.locale)==null?void 0:u.options)==null?void 0:l.firstWeekContainsDate)??1,n=sr(a,r),s=oe(a,0);return s.setFullYear(n,0,e),s.setHours(0,0,0,0),ct(s,r)}function Qa(a,r){const t=C(a),e=+ct(t,r)-+$a(t,r);return Math.round(e/Jn)+1}function T(a,r){const t=a<0?"-":"",e=Math.abs(a).toString().padStart(r,"0");return t+e}const _e={y(a,r){const t=a.getFullYear(),e=t>0?t:1-t;return T(r==="yy"?e%100:e,r.length)},M(a,r){const t=a.getMonth();return r==="M"?String(t+1):T(t+1,2)},d(a,r){return T(a.getDate(),r.length)},a(a,r){const t=a.getHours()/12>=1?"pm":"am";switch(r){case"a":case"aa":return t.toUpperCase();case"aaa":return t;case"aaaaa":return t[0];case"aaaa":default:return t==="am"?"a.m.":"p.m."}},h(a,r){return T(a.getHours()%12||12,r.length)},H(a,r){return T(a.getHours(),r.length)},m(a,r){return T(a.getMinutes(),r.length)},s(a,r){return T(a.getSeconds(),r.length)},S(a,r){const t=r.length,e=a.getMilliseconds(),n=Math.trunc(e*Math.pow(10,t-3));return T(n,r.length)}},Ae={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Dn={G:function(a,r,t){const e=a.getFullYear()>0?1:0;switch(r){case"G":case"GG":case"GGG":return t.era(e,{width:"abbreviated"});case"GGGGG":return t.era(e,{width:"narrow"});case"GGGG":default:return t.era(e,{width:"wide"})}},y:function(a,r,t){if(r==="yo"){const e=a.getFullYear(),n=e>0?e:1-e;return t.ordinalNumber(n,{unit:"year"})}return _e.y(a,r)},Y:function(a,r,t,e){const n=sr(a,e),s=n>0?n:1-n;if(r==="YY"){const o=s%100;return T(o,2)}return r==="Yo"?t.ordinalNumber(s,{unit:"year"}):T(s,r.length)},R:function(a,r){const t=er(a);return T(t,r.length)},u:function(a,r){const t=a.getFullYear();return T(t,r.length)},Q:function(a,r,t){const e=Math.ceil((a.getMonth()+1)/3);switch(r){case"Q":return String(e);case"QQ":return T(e,2);case"Qo":return t.ordinalNumber(e,{unit:"quarter"});case"QQQ":return t.quarter(e,{width:"abbreviated",context:"formatting"});case"QQQQQ":return t.quarter(e,{width:"narrow",context:"formatting"});case"QQQQ":default:return t.quarter(e,{width:"wide",context:"formatting"})}},q:function(a,r,t){const e=Math.ceil((a.getMonth()+1)/3);switch(r){case"q":return String(e);case"qq":return T(e,2);case"qo":return t.ordinalNumber(e,{unit:"quarter"});case"qqq":return t.quarter(e,{width:"abbreviated",context:"standalone"});case"qqqqq":return t.quarter(e,{width:"narrow",context:"standalone"});case"qqqq":default:return t.quarter(e,{width:"wide",context:"standalone"})}},M:function(a,r,t){const e=a.getMonth();switch(r){case"M":case"MM":return _e.M(a,r);case"Mo":return t.ordinalNumber(e+1,{unit:"month"});case"MMM":return t.month(e,{width:"abbreviated",context:"formatting"});case"MMMMM":return t.month(e,{width:"narrow",context:"formatting"});case"MMMM":default:return t.month(e,{width:"wide",context:"formatting"})}},L:function(a,r,t){const e=a.getMonth();switch(r){case"L":return String(e+1);case"LL":return T(e+1,2);case"Lo":return t.ordinalNumber(e+1,{unit:"month"});case"LLL":return t.month(e,{width:"abbreviated",context:"standalone"});case"LLLLL":return t.month(e,{width:"narrow",context:"standalone"});case"LLLL":default:return t.month(e,{width:"wide",context:"standalone"})}},w:function(a,r,t,e){const n=Qa(a,e);return r==="wo"?t.ordinalNumber(n,{unit:"week"}):T(n,r.length)},I:function(a,r,t){const e=Ha(a);return r==="Io"?t.ordinalNumber(e,{unit:"week"}):T(e,r.length)},d:function(a,r,t){return r==="do"?t.ordinalNumber(a.getDate(),{unit:"date"}):_e.d(a,r)},D:function(a,r,t){const e=Aa(a);return r==="Do"?t.ordinalNumber(e,{unit:"dayOfYear"}):T(e,r.length)},E:function(a,r,t){const e=a.getDay();switch(r){case"E":case"EE":case"EEE":return t.day(e,{width:"abbreviated",context:"formatting"});case"EEEEE":return t.day(e,{width:"narrow",context:"formatting"});case"EEEEEE":return t.day(e,{width:"short",context:"formatting"});case"EEEE":default:return t.day(e,{width:"wide",context:"formatting"})}},e:function(a,r,t,e){const n=a.getDay(),s=(n-e.weekStartsOn+8)%7||7;switch(r){case"e":return String(s);case"ee":return T(s,2);case"eo":return t.ordinalNumber(s,{unit:"day"});case"eee":return t.day(n,{width:"abbreviated",context:"formatting"});case"eeeee":return t.day(n,{width:"narrow",context:"formatting"});case"eeeeee":return t.day(n,{width:"short",context:"formatting"});case"eeee":default:return t.day(n,{width:"wide",context:"formatting"})}},c:function(a,r,t,e){const n=a.getDay(),s=(n-e.weekStartsOn+8)%7||7;switch(r){case"c":return String(s);case"cc":return T(s,r.length);case"co":return t.ordinalNumber(s,{unit:"day"});case"ccc":return t.day(n,{width:"abbreviated",context:"standalone"});case"ccccc":return t.day(n,{width:"narrow",context:"standalone"});case"cccccc":return t.day(n,{width:"short",context:"standalone"});case"cccc":default:return t.day(n,{width:"wide",context:"standalone"})}},i:function(a,r,t){const e=a.getDay(),n=e===0?7:e;switch(r){case"i":return String(n);case"ii":return T(n,r.length);case"io":return t.ordinalNumber(n,{unit:"day"});case"iii":return t.day(e,{width:"abbreviated",context:"formatting"});case"iiiii":return t.day(e,{width:"narrow",context:"formatting"});case"iiiiii":return t.day(e,{width:"short",context:"formatting"});case"iiii":default:return t.day(e,{width:"wide",context:"formatting"})}},a:function(a,r,t){const n=a.getHours()/12>=1?"pm":"am";switch(r){case"a":case"aa":return t.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"aaa":return t.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return t.dayPeriod(n,{width:"narrow",context:"formatting"});case"aaaa":default:return t.dayPeriod(n,{width:"wide",context:"formatting"})}},b:function(a,r,t){const e=a.getHours();let n;switch(e===12?n=Ae.noon:e===0?n=Ae.midnight:n=e/12>=1?"pm":"am",r){case"b":case"bb":return t.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"bbb":return t.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return t.dayPeriod(n,{width:"narrow",context:"formatting"});case"bbbb":default:return t.dayPeriod(n,{width:"wide",context:"formatting"})}},B:function(a,r,t){const e=a.getHours();let n;switch(e>=17?n=Ae.evening:e>=12?n=Ae.afternoon:e>=4?n=Ae.morning:n=Ae.night,r){case"B":case"BB":case"BBB":return t.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"BBBBB":return t.dayPeriod(n,{width:"narrow",context:"formatting"});case"BBBB":default:return t.dayPeriod(n,{width:"wide",context:"formatting"})}},h:function(a,r,t){if(r==="ho"){let e=a.getHours()%12;return e===0&&(e=12),t.ordinalNumber(e,{unit:"hour"})}return _e.h(a,r)},H:function(a,r,t){return r==="Ho"?t.ordinalNumber(a.getHours(),{unit:"hour"}):_e.H(a,r)},K:function(a,r,t){const e=a.getHours()%12;return r==="Ko"?t.ordinalNumber(e,{unit:"hour"}):T(e,r.length)},k:function(a,r,t){let e=a.getHours();return e===0&&(e=24),r==="ko"?t.ordinalNumber(e,{unit:"hour"}):T(e,r.length)},m:function(a,r,t){return r==="mo"?t.ordinalNumber(a.getMinutes(),{unit:"minute"}):_e.m(a,r)},s:function(a,r,t){return r==="so"?t.ordinalNumber(a.getSeconds(),{unit:"second"}):_e.s(a,r)},S:function(a,r){return _e.S(a,r)},X:function(a,r,t){const e=a.getTimezoneOffset();if(e===0)return"Z";switch(r){case"X":return vn(e);case"XXXX":case"XX":return Te(e);case"XXXXX":case"XXX":default:return Te(e,":")}},x:function(a,r,t){const e=a.getTimezoneOffset();switch(r){case"x":return vn(e);case"xxxx":case"xx":return Te(e);case"xxxxx":case"xxx":default:return Te(e,":")}},O:function(a,r,t){const e=a.getTimezoneOffset();switch(r){case"O":case"OO":case"OOO":return"GMT"+yn(e,":");case"OOOO":default:return"GMT"+Te(e,":")}},z:function(a,r,t){const e=a.getTimezoneOffset();switch(r){case"z":case"zz":case"zzz":return"GMT"+yn(e,":");case"zzzz":default:return"GMT"+Te(e,":")}},t:function(a,r,t){const e=Math.trunc(a.getTime()/1e3);return T(e,r.length)},T:function(a,r,t){const e=a.getTime();return T(e,r.length)}};function yn(a,r=""){const t=a>0?"-":"+",e=Math.abs(a),n=Math.trunc(e/60),s=e%60;return s===0?t+String(n):t+String(n)+r+T(s,2)}function vn(a,r){return a%60===0?(a>0?"-":"+")+T(Math.abs(a)/60,2):Te(a,r)}function Te(a,r=""){const t=a>0?"-":"+",e=Math.abs(a),n=T(Math.trunc(e/60),2),s=T(e%60,2);return t+n+r+s}const bn=(a,r)=>{switch(a){case"P":return r.date({width:"short"});case"PP":return r.date({width:"medium"});case"PPP":return r.date({width:"long"});case"PPPP":default:return r.date({width:"full"})}},or=(a,r)=>{switch(a){case"p":return r.time({width:"short"});case"pp":return r.time({width:"medium"});case"ppp":return r.time({width:"long"});case"pppp":default:return r.time({width:"full"})}},Ba=(a,r)=>{const t=a.match(/(P+)(p+)?/)||[],e=t[1],n=t[2];if(!n)return bn(a,r);let s;switch(e){case"P":s=r.dateTime({width:"short"});break;case"PP":s=r.dateTime({width:"medium"});break;case"PPP":s=r.dateTime({width:"long"});break;case"PPPP":default:s=r.dateTime({width:"full"});break}return s.replace("{{date}}",bn(e,r)).replace("{{time}}",or(n,r))},qa={p:or,P:Ba},Ka=/^D+$/,Va=/^Y+$/,Ua=["D","DD","YY","YYYY"];function ja(a){return Ka.test(a)}function Xa(a){return Va.test(a)}function Ga(a,r,t){const e=za(a,r,t);if(console.warn(e),Ua.includes(a))throw new RangeError(e)}function za(a,r,t){const e=a[0]==="Y"?"years":"days of the month";return`Use \`${a.toLowerCase()}\` instead of \`${a}\` (in \`${r}\`) for formatting ${e} to the input \`${t}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Za=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Ja=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,es=/^'([^]*?)'?$/,ts=/''/g,ns=/[a-zA-Z]/;function ou(a,r,t){var l,d,f,p;const e=Le(),n=e.locale??Lt,s=e.firstWeekContainsDate??((d=(l=e.locale)==null?void 0:l.options)==null?void 0:d.firstWeekContainsDate)??1,o=e.weekStartsOn??((p=(f=e.locale)==null?void 0:f.options)==null?void 0:p.weekStartsOn)??0,i=C(a);if(!Gr(i))throw new RangeError("Invalid time value");let c=r.match(Ja).map(h=>{const g=h[0];if(g==="p"||g==="P"){const w=qa[g];return w(h,n.formatLong)}return h}).join("").match(Za).map(h=>{if(h==="''")return{isToken:!1,value:"'"};const g=h[0];if(g==="'")return{isToken:!1,value:rs(h)};if(Dn[g])return{isToken:!0,value:h};if(g.match(ns))throw new RangeError("Format string contains an unescaped latin alphabet character `"+g+"`");return{isToken:!1,value:h}});n.localize.preprocessor&&(c=n.localize.preprocessor(i,c));const u={firstWeekContainsDate:s,weekStartsOn:o,locale:n};return c.map(h=>{if(!h.isToken)return h.value;const g=h.value;(Xa(g)||ja(g))&&Ga(g,r,String(a));const w=Dn[g[0]];return w(i,g,n.localize,u)}).join("")}function rs(a){const r=a.match(es);return r?r[1].replace(ts,"'"):a}function as(a,r,t){const e=Le(),n=(t==null?void 0:t.locale)??e.locale??Lt,s=2520,o=Ne(a,r);if(isNaN(o))throw new RangeError("Invalid time value");const i=Object.assign({},t,{addSuffix:t==null?void 0:t.addSuffix,comparison:o});let c,u;o>0?(c=C(r),u=C(a)):(c=C(a),u=C(r));const l=ar(u,c),d=(qe(u)-qe(c))/1e3,f=Math.round((l-d)/60);let p;if(f<2)return t!=null&&t.includeSeconds?l<5?n.formatDistance("lessThanXSeconds",5,i):l<10?n.formatDistance("lessThanXSeconds",10,i):l<20?n.formatDistance("lessThanXSeconds",20,i):l<40?n.formatDistance("halfAMinute",0,i):l<60?n.formatDistance("lessThanXMinutes",1,i):n.formatDistance("xMinutes",1,i):f===0?n.formatDistance("lessThanXMinutes",1,i):n.formatDistance("xMinutes",f,i);if(f<45)return n.formatDistance("xMinutes",f,i);if(f<90)return n.formatDistance("aboutXHours",1,i);if(f0?(i=C(r),c=C(a)):(i=C(a),c=C(r));const u=Ft((t==null?void 0:t.roundingMethod)??"round"),l=c.getTime()-i.getTime(),d=l/it,f=qe(c)-qe(i),p=(l-f)/it,h=t==null?void 0:t.unit;let g;if(h?g=h:d<1?g="second":d<60?g="minute":d{const l=`x${u.replace(/(^.)/,f=>f.toUpperCase())}`,d=a[u];return d!==void 0&&(s||a[u])?c.concat(e.formatDistance(l,d)):c},[]).join(o):""}function lu(a,r){const t=C(a);if(isNaN(t.getTime()))throw new RangeError("Invalid time value");const e=(r==null?void 0:r.representation)??"complete";let n="",s="";const o="-",i=":";if(e!=="time"){const c=T(t.getDate(),2),u=T(t.getMonth()+1,2);n=`${T(t.getFullYear(),4)}${o}${u}${o}${c}`}if(e!=="date"){const c=t.getTimezoneOffset();if(c!==0){const h=Math.abs(c),g=T(Math.trunc(h/60),2),w=T(h%60,2);s=`${c<0?"+":"-"}${g}:${w}`}else s="Z";const u=T(t.getHours(),2),l=T(t.getMinutes(),2),d=T(t.getSeconds(),2),f=n===""?"":"T",p=[u,l,d].join(i);n=`${n}${f}${p}${s}`}return n}function du(a){return C(a*1e3)}function fu(a){const r=C(a.start),t=C(a.end),e={},n=sa(t,r);n&&(e.years=n);const s=ze(r,{years:e.years}),o=rr(t,s);o&&(e.months=o);const i=ze(s,{months:e.months}),c=Jr(t,i);c&&(e.days=c);const u=ze(i,{days:e.days}),l=ea(t,u);l&&(e.hours=l);const d=ze(u,{hours:e.hours}),f=ta(t,d);f&&(e.minutes=f);const p=ze(d,{minutes:e.minutes}),h=ar(t,p);return h&&(e.seconds=h),e}function pu(a,r){const e=ls(a);let n;if(e.date){const c=ds(e.date,2);n=fs(c.restDateString,c.year)}if(!n||isNaN(n.getTime()))return new Date(NaN);const s=n.getTime();let o=0,i;if(e.time&&(o=ps(e.time),isNaN(o)))return new Date(NaN);if(e.timezone){if(i=hs(e.timezone),isNaN(i))return new Date(NaN)}else{const c=new Date(s+o),u=new Date(0);return u.setFullYear(c.getUTCFullYear(),c.getUTCMonth(),c.getUTCDate()),u.setHours(c.getUTCHours(),c.getUTCMinutes(),c.getUTCSeconds(),c.getUTCMilliseconds()),u}return new Date(s+o+i)}const pt={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},is=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,cs=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,us=/^([+-])(\d{2})(?::?(\d{2}))?$/;function ls(a){const r={},t=a.split(pt.dateTimeDelimiter);let e;if(t.length>2)return r;if(/:/.test(t[0])?e=t[0]:(r.date=t[0],e=t[1],pt.timeZoneDelimiter.test(r.date)&&(r.date=a.split(pt.timeZoneDelimiter)[0],e=a.substr(r.date.length,a.length))),e){const n=pt.timezone.exec(e);n?(r.time=e.replace(n[1],""),r.timezone=n[1]):r.time=e}return r}function ds(a,r){const t=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+r)+"})|(\\d{2}|[+-]\\d{"+(2+r)+"})$)"),e=a.match(t);if(!e)return{year:NaN,restDateString:""};const n=e[1]?parseInt(e[1]):null,s=e[2]?parseInt(e[2]):null;return{year:s===null?n:s*100,restDateString:a.slice((e[1]||e[2]).length)}}function fs(a,r){if(r===null)return new Date(NaN);const t=a.match(is);if(!t)return new Date(NaN);const e=!!t[4],n=et(t[1]),s=et(t[2])-1,o=et(t[3]),i=et(t[4]),c=et(t[5])-1;if(e)return ys(r,i,c)?ms(r,i,c):new Date(NaN);{const u=new Date(0);return!ws(r,s,o)||!Ds(r,n)?new Date(NaN):(u.setUTCFullYear(r,s,Math.max(n,o)),u)}}function et(a){return a?parseInt(a):1}function ps(a){const r=a.match(cs);if(!r)return NaN;const t=qt(r[1]),e=qt(r[2]),n=qt(r[3]);return vs(t,e,n)?t*rn+e*it+n*1e3:NaN}function qt(a){return a&&parseFloat(a.replace(",","."))||0}function hs(a){if(a==="Z")return 0;const r=a.match(us);if(!r)return 0;const t=r[1]==="+"?-1:1,e=parseInt(r[2]),n=r[3]&&parseInt(r[3])||0;return bs(e,n)?t*(e*rn+n*it):NaN}function ms(a,r,t){const e=new Date(0);e.setUTCFullYear(a,0,4);const n=e.getUTCDay()||7,s=(r-1)*7+t+1-n;return e.setUTCDate(e.getUTCDate()+s),e}const gs=[31,null,31,30,31,30,31,31,30,31,30,31];function ir(a){return a%400===0||a%4===0&&a%100!==0}function ws(a,r,t){return r>=0&&r<=11&&t>=1&&t<=(gs[r]||(ir(a)?29:28))}function Ds(a,r){return r>=1&&r<=(ir(a)?366:365)}function ys(a,r,t){return r>=1&&r<=53&&t>=0&&t<=6}function vs(a,r,t){return a===24?r===0&&t===0:t>=0&&t<60&&r>=0&&r<60&&a>=0&&a<25}function bs(a,r){return r>=0&&r<=59}const cr=6048e5,ks=864e5,Wt=6e4,At=36e5,_s=1e3,kn=Symbol.for("constructDateFrom");function W(a,r){return typeof a=="function"?a(r):a&&typeof a=="object"&&kn in a?a[kn](r):a instanceof Date?new a.constructor(r):new Date(r)}function b(a,r){return W(r||a,a)}function ce(a,r,t){const e=b(a,t==null?void 0:t.in);return isNaN(r)?W((t==null?void 0:t.in)||a,NaN):(r&&e.setDate(e.getDate()+r),e)}function ue(a,r,t){const e=b(a,t==null?void 0:t.in);if(isNaN(r))return W(a,NaN);if(!r)return e;const n=e.getDate(),s=W(a,e.getTime());s.setMonth(e.getMonth()+r+1,0);const o=s.getDate();return n>=o?s:(e.setFullYear(s.getFullYear(),s.getMonth(),n),e)}function ur(a,r,t){return W(a,+b(a)+r)}function Ms(a,r,t){return ur(a,r*At)}let xs={};function We(){return xs}function be(a,r){var i,c,u,l;const t=We(),e=(r==null?void 0:r.weekStartsOn)??((c=(i=r==null?void 0:r.locale)==null?void 0:i.options)==null?void 0:c.weekStartsOn)??t.weekStartsOn??((l=(u=t.locale)==null?void 0:u.options)==null?void 0:l.weekStartsOn)??0,n=b(a,r==null?void 0:r.in),s=n.getDay(),o=(s=s.getTime()?e+1:t.getTime()>=i.getTime()?e:e-1}function Ct(a){const r=b(a),t=new Date(Date.UTC(r.getFullYear(),r.getMonth(),r.getDate(),r.getHours(),r.getMinutes(),r.getSeconds(),r.getMilliseconds()));return t.setUTCFullYear(r.getFullYear()),+a-+t}function ke(a,...r){const t=W.bind(null,r.find(e=>typeof e=="object"));return r.map(t)}function Re(a,r){const t=b(a,r==null?void 0:r.in);return t.setHours(0,0,0,0),t}function Ve(a,r,t){const[e,n]=ke(t==null?void 0:t.in,a,r),s=Re(e),o=Re(n),i=+s-Ct(s),c=+o-Ct(o);return Math.round((i-c)/ks)}function Ss(a,r){const t=lr(a,r),e=W(a,0);return e.setFullYear(t,0,4),e.setHours(0,0,0,0),Ke(e)}function Zt(a,r,t){const e=b(a,t==null?void 0:t.in);return e.setTime(e.getTime()+r*Wt),e}function sn(a,r,t){return ue(a,r*3,t)}function Cs(a,r,t){return ur(a,r*1e3)}function Pt(a,r,t){return ce(a,r*7,t)}function ge(a,r,t){return ue(a,r*12,t)}function _n(a,r){let t,e=r==null?void 0:r.in;return a.forEach(n=>{!e&&typeof n=="object"&&(e=W.bind(null,n));const s=b(n,e);(!t||t{!e&&typeof n=="object"&&(e=W.bind(null,n));const s=b(n,e);(!t||t>s||isNaN(+s))&&(t=s)}),W(e,t||NaN)}function Ps(a,r,t){const[e,n]=ke(t==null?void 0:t.in,a,r);return+Re(e)==+Re(n)}function we(a){return a instanceof Date||typeof a=="object"&&Object.prototype.toString.call(a)==="[object Date]"}function Tt(a){return!(!we(a)&&typeof a!="number"||isNaN(+b(a)))}function Ot(a,r,t){const[e,n]=ke(t==null?void 0:t.in,a,r),s=e.getFullYear()-n.getFullYear(),o=e.getMonth()-n.getMonth();return s*12+o}function Ye(a,r){const t=b(a,r==null?void 0:r.in);return Math.trunc(t.getMonth()/3)+1}function Et(a,r,t){const[e,n]=ke(t==null?void 0:t.in,a,r),s=e.getFullYear()-n.getFullYear(),o=Ye(e)-Ye(n);return s*4+o}function Nt(a,r,t){const[e,n]=ke(t==null?void 0:t.in,a,r);return e.getFullYear()-n.getFullYear()}function Ts(a,r,t){const[e,n]=ke(t==null?void 0:t.in,a,r),s=xn(e,n),o=Math.abs(Ve(e,n));e.setDate(e.getDate()-s*o);const i=+(xn(e,n)===-s),c=s*(o-i);return c===0?0:c}function xn(a,r){const t=a.getFullYear()-r.getFullYear()||a.getMonth()-r.getMonth()||a.getDate()-r.getDate()||a.getHours()-r.getHours()||a.getMinutes()-r.getMinutes()||a.getSeconds()-r.getSeconds()||a.getMilliseconds()-r.getMilliseconds();return t<0?-1:t>0?1:t}function dr(a,r){const t=b(a,r==null?void 0:r.in);return t.setHours(23,59,59,999),t}function fr(a,r){const t=b(a,r==null?void 0:r.in),e=t.getMonth();return t.setFullYear(t.getFullYear(),e+1,0),t.setHours(23,59,59,999),t}function Jt(a,r){const t=b(a,r==null?void 0:r.in),e=t.getMonth(),n=e-e%3;return t.setMonth(n,1),t.setHours(0,0,0,0),t}function pr(a,r){const t=b(a,r==null?void 0:r.in);return t.setDate(1),t.setHours(0,0,0,0),t}function hr(a,r){const t=b(a,r==null?void 0:r.in),e=t.getFullYear();return t.setFullYear(e+1,0,0),t.setHours(23,59,59,999),t}function Ht(a,r){const t=b(a,r==null?void 0:r.in);return t.setFullYear(t.getFullYear(),0,1),t.setHours(0,0,0,0),t}function Os(a,r){var i,c;const t=We(),e=t.weekStartsOn??((c=(i=t.locale)==null?void 0:i.options)==null?void 0:c.weekStartsOn)??0,n=b(a,r==null?void 0:r.in),s=n.getDay(),o=(s{let e;const n=Es[a];return typeof n=="string"?e=n:r===1?e=n.one:e=n.other.replace("{{count}}",r.toString()),t!=null&&t.addSuffix?t.comparison&&t.comparison>0?"in "+e:e+" ago":e};function Kt(a){return(r={})=>{const t=r.width?String(r.width):a.defaultWidth;return a.formats[t]||a.formats[a.defaultWidth]}}const Ys={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Is={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Rs={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Fs={date:Kt({formats:Ys,defaultWidth:"full"}),time:Kt({formats:Is,defaultWidth:"full"}),dateTime:Kt({formats:Rs,defaultWidth:"full"})},Ls={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Ws=(a,r,t,e)=>Ls[a];function tt(a){return(r,t)=>{const e=t!=null&&t.context?String(t.context):"standalone";let n;if(e==="formatting"&&a.formattingValues){const o=a.defaultFormattingWidth||a.defaultWidth,i=t!=null&&t.width?String(t.width):o;n=a.formattingValues[i]||a.formattingValues[o]}else{const o=a.defaultWidth,i=t!=null&&t.width?String(t.width):a.defaultWidth;n=a.values[i]||a.values[o]}const s=a.argumentCallback?a.argumentCallback(r):r;return n[s]}}const As={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Hs={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},$s={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"]},Qs={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"]},Bs={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"}},qs={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"}},Ks=(a,r)=>{const t=Number(a),e=t%100;if(e>20||e<10)switch(e%10){case 1:return t+"st";case 2:return t+"nd";case 3:return t+"rd"}return t+"th"},Vs={ordinalNumber:Ks,era:tt({values:As,defaultWidth:"wide"}),quarter:tt({values:Hs,defaultWidth:"wide",argumentCallback:a=>a-1}),month:tt({values:$s,defaultWidth:"wide"}),day:tt({values:Qs,defaultWidth:"wide"}),dayPeriod:tt({values:Bs,defaultWidth:"wide",formattingValues:qs,defaultFormattingWidth:"wide"})};function nt(a){return(r,t={})=>{const e=t.width,n=e&&a.matchPatterns[e]||a.matchPatterns[a.defaultMatchWidth],s=r.match(n);if(!s)return null;const o=s[0],i=e&&a.parsePatterns[e]||a.parsePatterns[a.defaultParseWidth],c=Array.isArray(i)?js(i,d=>d.test(o)):Us(i,d=>d.test(o));let u;u=a.valueCallback?a.valueCallback(c):c,u=t.valueCallback?t.valueCallback(u):u;const l=r.slice(o.length);return{value:u,rest:l}}}function Us(a,r){for(const t in a)if(Object.prototype.hasOwnProperty.call(a,t)&&r(a[t]))return t}function js(a,r){for(let t=0;t{const e=r.match(a.matchPattern);if(!e)return null;const n=e[0],s=r.match(a.parsePattern);if(!s)return null;let o=a.valueCallback?a.valueCallback(s[0]):s[0];o=t.valueCallback?t.valueCallback(o):o;const i=r.slice(n.length);return{value:o,rest:i}}}const Gs=/^(\d+)(th|st|nd|rd)?/i,zs=/\d+/i,Zs={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},Js={any:[/^b/i,/^(a|c)/i]},eo={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},to={any:[/1/i,/2/i,/3/i,/4/i]},no={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},ro={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]},ao={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},so={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]},oo={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},io={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}},co={ordinalNumber:Xs({matchPattern:Gs,parsePattern:zs,valueCallback:a=>parseInt(a,10)}),era:nt({matchPatterns:Zs,defaultMatchWidth:"wide",parsePatterns:Js,defaultParseWidth:"any"}),quarter:nt({matchPatterns:eo,defaultMatchWidth:"wide",parsePatterns:to,defaultParseWidth:"any",valueCallback:a=>a+1}),month:nt({matchPatterns:no,defaultMatchWidth:"wide",parsePatterns:ro,defaultParseWidth:"any"}),day:nt({matchPatterns:ao,defaultMatchWidth:"wide",parsePatterns:so,defaultParseWidth:"any"}),dayPeriod:nt({matchPatterns:oo,defaultMatchWidth:"any",parsePatterns:io,defaultParseWidth:"any"})},mr={code:"en-US",formatDistance:Ns,formatLong:Fs,formatRelative:Ws,localize:Vs,match:co,options:{weekStartsOn:0,firstWeekContainsDate:1}};function uo(a,r){const t=b(a,r==null?void 0:r.in);return Ve(t,Ht(t))+1}function on(a,r){const t=b(a,r==null?void 0:r.in),e=+Ke(t)-+Ss(t);return Math.round(e/cr)+1}function cn(a,r){var l,d,f,p;const t=b(a,r==null?void 0:r.in),e=t.getFullYear(),n=We(),s=(r==null?void 0:r.firstWeekContainsDate)??((d=(l=r==null?void 0:r.locale)==null?void 0:l.options)==null?void 0:d.firstWeekContainsDate)??n.firstWeekContainsDate??((p=(f=n.locale)==null?void 0:f.options)==null?void 0:p.firstWeekContainsDate)??1,o=W((r==null?void 0:r.in)||a,0);o.setFullYear(e+1,0,s),o.setHours(0,0,0,0);const i=be(o,r),c=W((r==null?void 0:r.in)||a,0);c.setFullYear(e,0,s),c.setHours(0,0,0,0);const u=be(c,r);return+t>=+i?e+1:+t>=+u?e:e-1}function lo(a,r){var i,c,u,l;const t=We(),e=(r==null?void 0:r.firstWeekContainsDate)??((c=(i=r==null?void 0:r.locale)==null?void 0:i.options)==null?void 0:c.firstWeekContainsDate)??t.firstWeekContainsDate??((l=(u=t.locale)==null?void 0:u.options)==null?void 0:l.firstWeekContainsDate)??1,n=cn(a,r),s=W((r==null?void 0:r.in)||a,0);return s.setFullYear(n,0,e),s.setHours(0,0,0,0),be(s,r)}function gr(a,r){const t=b(a,r==null?void 0:r.in),e=+be(t,r)-+lo(t,r);return Math.round(e/cr)+1}function L(a,r){const t=a<0?"-":"",e=Math.abs(a).toString().padStart(r,"0");return t+e}const Me={y(a,r){const t=a.getFullYear(),e=t>0?t:1-t;return L(r==="yy"?e%100:e,r.length)},M(a,r){const t=a.getMonth();return r==="M"?String(t+1):L(t+1,2)},d(a,r){return L(a.getDate(),r.length)},a(a,r){const t=a.getHours()/12>=1?"pm":"am";switch(r){case"a":case"aa":return t.toUpperCase();case"aaa":return t;case"aaaaa":return t[0];case"aaaa":default:return t==="am"?"a.m.":"p.m."}},h(a,r){return L(a.getHours()%12||12,r.length)},H(a,r){return L(a.getHours(),r.length)},m(a,r){return L(a.getMinutes(),r.length)},s(a,r){return L(a.getSeconds(),r.length)},S(a,r){const t=r.length,e=a.getMilliseconds(),n=Math.trunc(e*Math.pow(10,t-3));return L(n,r.length)}},He={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Sn={G:function(a,r,t){const e=a.getFullYear()>0?1:0;switch(r){case"G":case"GG":case"GGG":return t.era(e,{width:"abbreviated"});case"GGGGG":return t.era(e,{width:"narrow"});case"GGGG":default:return t.era(e,{width:"wide"})}},y:function(a,r,t){if(r==="yo"){const e=a.getFullYear(),n=e>0?e:1-e;return t.ordinalNumber(n,{unit:"year"})}return Me.y(a,r)},Y:function(a,r,t,e){const n=cn(a,e),s=n>0?n:1-n;if(r==="YY"){const o=s%100;return L(o,2)}return r==="Yo"?t.ordinalNumber(s,{unit:"year"}):L(s,r.length)},R:function(a,r){const t=lr(a);return L(t,r.length)},u:function(a,r){const t=a.getFullYear();return L(t,r.length)},Q:function(a,r,t){const e=Math.ceil((a.getMonth()+1)/3);switch(r){case"Q":return String(e);case"QQ":return L(e,2);case"Qo":return t.ordinalNumber(e,{unit:"quarter"});case"QQQ":return t.quarter(e,{width:"abbreviated",context:"formatting"});case"QQQQQ":return t.quarter(e,{width:"narrow",context:"formatting"});case"QQQQ":default:return t.quarter(e,{width:"wide",context:"formatting"})}},q:function(a,r,t){const e=Math.ceil((a.getMonth()+1)/3);switch(r){case"q":return String(e);case"qq":return L(e,2);case"qo":return t.ordinalNumber(e,{unit:"quarter"});case"qqq":return t.quarter(e,{width:"abbreviated",context:"standalone"});case"qqqqq":return t.quarter(e,{width:"narrow",context:"standalone"});case"qqqq":default:return t.quarter(e,{width:"wide",context:"standalone"})}},M:function(a,r,t){const e=a.getMonth();switch(r){case"M":case"MM":return Me.M(a,r);case"Mo":return t.ordinalNumber(e+1,{unit:"month"});case"MMM":return t.month(e,{width:"abbreviated",context:"formatting"});case"MMMMM":return t.month(e,{width:"narrow",context:"formatting"});case"MMMM":default:return t.month(e,{width:"wide",context:"formatting"})}},L:function(a,r,t){const e=a.getMonth();switch(r){case"L":return String(e+1);case"LL":return L(e+1,2);case"Lo":return t.ordinalNumber(e+1,{unit:"month"});case"LLL":return t.month(e,{width:"abbreviated",context:"standalone"});case"LLLLL":return t.month(e,{width:"narrow",context:"standalone"});case"LLLL":default:return t.month(e,{width:"wide",context:"standalone"})}},w:function(a,r,t,e){const n=gr(a,e);return r==="wo"?t.ordinalNumber(n,{unit:"week"}):L(n,r.length)},I:function(a,r,t){const e=on(a);return r==="Io"?t.ordinalNumber(e,{unit:"week"}):L(e,r.length)},d:function(a,r,t){return r==="do"?t.ordinalNumber(a.getDate(),{unit:"date"}):Me.d(a,r)},D:function(a,r,t){const e=uo(a);return r==="Do"?t.ordinalNumber(e,{unit:"dayOfYear"}):L(e,r.length)},E:function(a,r,t){const e=a.getDay();switch(r){case"E":case"EE":case"EEE":return t.day(e,{width:"abbreviated",context:"formatting"});case"EEEEE":return t.day(e,{width:"narrow",context:"formatting"});case"EEEEEE":return t.day(e,{width:"short",context:"formatting"});case"EEEE":default:return t.day(e,{width:"wide",context:"formatting"})}},e:function(a,r,t,e){const n=a.getDay(),s=(n-e.weekStartsOn+8)%7||7;switch(r){case"e":return String(s);case"ee":return L(s,2);case"eo":return t.ordinalNumber(s,{unit:"day"});case"eee":return t.day(n,{width:"abbreviated",context:"formatting"});case"eeeee":return t.day(n,{width:"narrow",context:"formatting"});case"eeeeee":return t.day(n,{width:"short",context:"formatting"});case"eeee":default:return t.day(n,{width:"wide",context:"formatting"})}},c:function(a,r,t,e){const n=a.getDay(),s=(n-e.weekStartsOn+8)%7||7;switch(r){case"c":return String(s);case"cc":return L(s,r.length);case"co":return t.ordinalNumber(s,{unit:"day"});case"ccc":return t.day(n,{width:"abbreviated",context:"standalone"});case"ccccc":return t.day(n,{width:"narrow",context:"standalone"});case"cccccc":return t.day(n,{width:"short",context:"standalone"});case"cccc":default:return t.day(n,{width:"wide",context:"standalone"})}},i:function(a,r,t){const e=a.getDay(),n=e===0?7:e;switch(r){case"i":return String(n);case"ii":return L(n,r.length);case"io":return t.ordinalNumber(n,{unit:"day"});case"iii":return t.day(e,{width:"abbreviated",context:"formatting"});case"iiiii":return t.day(e,{width:"narrow",context:"formatting"});case"iiiiii":return t.day(e,{width:"short",context:"formatting"});case"iiii":default:return t.day(e,{width:"wide",context:"formatting"})}},a:function(a,r,t){const n=a.getHours()/12>=1?"pm":"am";switch(r){case"a":case"aa":return t.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"aaa":return t.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return t.dayPeriod(n,{width:"narrow",context:"formatting"});case"aaaa":default:return t.dayPeriod(n,{width:"wide",context:"formatting"})}},b:function(a,r,t){const e=a.getHours();let n;switch(e===12?n=He.noon:e===0?n=He.midnight:n=e/12>=1?"pm":"am",r){case"b":case"bb":return t.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"bbb":return t.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return t.dayPeriod(n,{width:"narrow",context:"formatting"});case"bbbb":default:return t.dayPeriod(n,{width:"wide",context:"formatting"})}},B:function(a,r,t){const e=a.getHours();let n;switch(e>=17?n=He.evening:e>=12?n=He.afternoon:e>=4?n=He.morning:n=He.night,r){case"B":case"BB":case"BBB":return t.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"BBBBB":return t.dayPeriod(n,{width:"narrow",context:"formatting"});case"BBBB":default:return t.dayPeriod(n,{width:"wide",context:"formatting"})}},h:function(a,r,t){if(r==="ho"){let e=a.getHours()%12;return e===0&&(e=12),t.ordinalNumber(e,{unit:"hour"})}return Me.h(a,r)},H:function(a,r,t){return r==="Ho"?t.ordinalNumber(a.getHours(),{unit:"hour"}):Me.H(a,r)},K:function(a,r,t){const e=a.getHours()%12;return r==="Ko"?t.ordinalNumber(e,{unit:"hour"}):L(e,r.length)},k:function(a,r,t){let e=a.getHours();return e===0&&(e=24),r==="ko"?t.ordinalNumber(e,{unit:"hour"}):L(e,r.length)},m:function(a,r,t){return r==="mo"?t.ordinalNumber(a.getMinutes(),{unit:"minute"}):Me.m(a,r)},s:function(a,r,t){return r==="so"?t.ordinalNumber(a.getSeconds(),{unit:"second"}):Me.s(a,r)},S:function(a,r){return Me.S(a,r)},X:function(a,r,t){const e=a.getTimezoneOffset();if(e===0)return"Z";switch(r){case"X":return Pn(e);case"XXXX":case"XX":return Oe(e);case"XXXXX":case"XXX":default:return Oe(e,":")}},x:function(a,r,t){const e=a.getTimezoneOffset();switch(r){case"x":return Pn(e);case"xxxx":case"xx":return Oe(e);case"xxxxx":case"xxx":default:return Oe(e,":")}},O:function(a,r,t){const e=a.getTimezoneOffset();switch(r){case"O":case"OO":case"OOO":return"GMT"+Cn(e,":");case"OOOO":default:return"GMT"+Oe(e,":")}},z:function(a,r,t){const e=a.getTimezoneOffset();switch(r){case"z":case"zz":case"zzz":return"GMT"+Cn(e,":");case"zzzz":default:return"GMT"+Oe(e,":")}},t:function(a,r,t){const e=Math.trunc(+a/1e3);return L(e,r.length)},T:function(a,r,t){return L(+a,r.length)}};function Cn(a,r=""){const t=a>0?"-":"+",e=Math.abs(a),n=Math.trunc(e/60),s=e%60;return s===0?t+String(n):t+String(n)+r+L(s,2)}function Pn(a,r){return a%60===0?(a>0?"-":"+")+L(Math.abs(a)/60,2):Oe(a,r)}function Oe(a,r=""){const t=a>0?"-":"+",e=Math.abs(a),n=L(Math.trunc(e/60),2),s=L(e%60,2);return t+n+r+s}const Tn=(a,r)=>{switch(a){case"P":return r.date({width:"short"});case"PP":return r.date({width:"medium"});case"PPP":return r.date({width:"long"});case"PPPP":default:return r.date({width:"full"})}},wr=(a,r)=>{switch(a){case"p":return r.time({width:"short"});case"pp":return r.time({width:"medium"});case"ppp":return r.time({width:"long"});case"pppp":default:return r.time({width:"full"})}},fo=(a,r)=>{const t=a.match(/(P+)(p+)?/)||[],e=t[1],n=t[2];if(!n)return Tn(a,r);let s;switch(e){case"P":s=r.dateTime({width:"short"});break;case"PP":s=r.dateTime({width:"medium"});break;case"PPP":s=r.dateTime({width:"long"});break;case"PPPP":default:s=r.dateTime({width:"full"});break}return s.replace("{{date}}",Tn(e,r)).replace("{{time}}",wr(n,r))},en={p:wr,P:fo},po=/^D+$/,ho=/^Y+$/,mo=["D","DD","YY","YYYY"];function go(a){return po.test(a)}function wo(a){return ho.test(a)}function Do(a,r,t){const e=yo(a,r,t);if(console.warn(e),mo.includes(a))throw new RangeError(e)}function yo(a,r,t){const e=a[0]==="Y"?"years":"days of the month";return`Use \`${a.toLowerCase()}\` instead of \`${a}\` (in \`${r}\`) for formatting ${e} to the input \`${t}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const vo=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,bo=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ko=/^'([^]*?)'?$/,_o=/''/g,Mo=/[a-zA-Z]/;function On(a,r,t){var l,d,f,p,h,g,w,k;const e=We(),n=(t==null?void 0:t.locale)??e.locale??mr,s=(t==null?void 0:t.firstWeekContainsDate)??((d=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:d.firstWeekContainsDate)??e.firstWeekContainsDate??((p=(f=e.locale)==null?void 0:f.options)==null?void 0:p.firstWeekContainsDate)??1,o=(t==null?void 0:t.weekStartsOn)??((g=(h=t==null?void 0:t.locale)==null?void 0:h.options)==null?void 0:g.weekStartsOn)??e.weekStartsOn??((k=(w=e.locale)==null?void 0:w.options)==null?void 0:k.weekStartsOn)??0,i=b(a,t==null?void 0:t.in);if(!Tt(i))throw new RangeError("Invalid time value");let c=r.match(bo).map(S=>{const x=S[0];if(x==="p"||x==="P"){const N=en[x];return N(S,n.formatLong)}return S}).join("").match(vo).map(S=>{if(S==="''")return{isToken:!1,value:"'"};const x=S[0];if(x==="'")return{isToken:!1,value:xo(S)};if(Sn[x])return{isToken:!0,value:S};if(x.match(Mo))throw new RangeError("Format string contains an unescaped latin alphabet character `"+x+"`");return{isToken:!1,value:S}});n.localize.preprocessor&&(c=n.localize.preprocessor(i,c));const u={firstWeekContainsDate:s,weekStartsOn:o,locale:n};return c.map(S=>{if(!S.isToken)return S.value;const x=S.value;(!(t!=null&&t.useAdditionalWeekYearTokens)&&wo(x)||!(t!=null&&t.useAdditionalDayOfYearTokens)&&go(x))&&Do(x,r,String(a));const N=Sn[x[0]];return N(i,x,n.localize,u)}).join("")}function xo(a){const r=a.match(ko);return r?r[1].replace(_o,"'"):a}function En(a,r){return b(a,r==null?void 0:r.in).getDate()}function So(a,r){return b(a,r==null?void 0:r.in).getDay()}function Co(a,r){const t=b(a,r==null?void 0:r.in),e=t.getFullYear(),n=t.getMonth(),s=W(t,0);return s.setFullYear(e,n+1,0),s.setHours(0,0,0,0),s.getDate()}function Po(){return Object.assign({},We())}function De(a,r){return b(a,r==null?void 0:r.in).getHours()}function To(a,r){const t=b(a,r==null?void 0:r.in).getDay();return t===0?7:t}function ye(a,r){return b(a,r==null?void 0:r.in).getMinutes()}function te(a,r){return b(a,r==null?void 0:r.in).getMonth()}function Se(a){return b(a).getSeconds()}function tn(a){return+b(a)}function P(a,r){return b(a,r==null?void 0:r.in).getFullYear()}function Pe(a,r){return+b(a)>+b(r)}function Fe(a,r){return+b(a)<+b(r)}function Oo(a,r){return+b(a)==+b(r)}function Eo(a,r){const t=No(r)?new r(0):W(r,0);return t.setFullYear(a.getFullYear(),a.getMonth(),a.getDate()),t.setHours(a.getHours(),a.getMinutes(),a.getSeconds(),a.getMilliseconds()),t}function No(a){var r;return typeof a=="function"&&((r=a.prototype)==null?void 0:r.constructor)===a}const Yo=10;class Dr{constructor(){y(this,"subPriority",0)}validate(r,t){return!0}}class Io extends Dr{constructor(r,t,e,n,s){super(),this.value=r,this.validateValue=t,this.setValue=e,this.priority=n,s&&(this.subPriority=s)}validate(r,t){return this.validateValue(r,this.value,t)}set(r,t,e){return this.setValue(r,t,this.value,e)}}class Ro extends Dr{constructor(t,e){super();y(this,"priority",Yo);y(this,"subPriority",-1);this.context=t||(n=>W(e,n))}set(t,e){return e.timestampIsSet?t:W(t,Eo(t,this.context))}}class Y{run(r,t,e,n){const s=this.parse(r,t,e,n);return s?{setter:new Io(s.value,this.validate,this.set,this.priority,this.subPriority),rest:s.rest}:null}validate(r,t,e){return!0}}class Fo extends Y{constructor(){super(...arguments);y(this,"priority",140);y(this,"incompatibleTokens",["R","u","t","T"])}parse(t,e,n){switch(e){case"G":case"GG":case"GGG":return n.era(t,{width:"abbreviated"})||n.era(t,{width:"narrow"});case"GGGGG":return n.era(t,{width:"narrow"});case"GGGG":default:return n.era(t,{width:"wide"})||n.era(t,{width:"abbreviated"})||n.era(t,{width:"narrow"})}}set(t,e,n){return e.era=n,t.setFullYear(n,0,1),t.setHours(0,0,0,0),t}}const U={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},pe={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function j(a,r){return a&&{value:r(a.value),rest:a.rest}}function B(a,r){const t=r.match(a);return t?{value:parseInt(t[0],10),rest:r.slice(t[0].length)}:null}function he(a,r){const t=r.match(a);if(!t)return null;if(t[0]==="Z")return{value:0,rest:r.slice(1)};const e=t[1]==="+"?1:-1,n=t[2]?parseInt(t[2],10):0,s=t[3]?parseInt(t[3],10):0,o=t[5]?parseInt(t[5],10):0;return{value:e*(n*At+s*Wt+o*_s),rest:r.slice(t[0].length)}}function yr(a){return B(U.anyDigitsSigned,a)}function V(a,r){switch(a){case 1:return B(U.singleDigit,r);case 2:return B(U.twoDigits,r);case 3:return B(U.threeDigits,r);case 4:return B(U.fourDigits,r);default:return B(new RegExp("^\\d{1,"+a+"}"),r)}}function Yt(a,r){switch(a){case 1:return B(U.singleDigitSigned,r);case 2:return B(U.twoDigitsSigned,r);case 3:return B(U.threeDigitsSigned,r);case 4:return B(U.fourDigitsSigned,r);default:return B(new RegExp("^-?\\d{1,"+a+"}"),r)}}function un(a){switch(a){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;case"am":case"midnight":case"night":default:return 0}}function vr(a,r){const t=r>0,e=t?r:1-r;let n;if(e<=50)n=a||100;else{const s=e+50,o=Math.trunc(s/100)*100,i=a>=s%100;n=a+o-(i?100:0)}return t?n:1-n}function br(a){return a%400===0||a%4===0&&a%100!==0}class Lo extends Y{constructor(){super(...arguments);y(this,"priority",130);y(this,"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"])}parse(t,e,n){const s=o=>({year:o,isTwoDigitYear:e==="yy"});switch(e){case"y":return j(V(4,t),s);case"yo":return j(n.ordinalNumber(t,{unit:"year"}),s);default:return j(V(e.length,t),s)}}validate(t,e){return e.isTwoDigitYear||e.year>0}set(t,e,n){const s=t.getFullYear();if(n.isTwoDigitYear){const i=vr(n.year,s);return t.setFullYear(i,0,1),t.setHours(0,0,0,0),t}const o=!("era"in e)||e.era===1?n.year:1-n.year;return t.setFullYear(o,0,1),t.setHours(0,0,0,0),t}}class Wo extends Y{constructor(){super(...arguments);y(this,"priority",130);y(this,"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"])}parse(t,e,n){const s=o=>({year:o,isTwoDigitYear:e==="YY"});switch(e){case"Y":return j(V(4,t),s);case"Yo":return j(n.ordinalNumber(t,{unit:"year"}),s);default:return j(V(e.length,t),s)}}validate(t,e){return e.isTwoDigitYear||e.year>0}set(t,e,n,s){const o=cn(t,s);if(n.isTwoDigitYear){const c=vr(n.year,o);return t.setFullYear(c,0,s.firstWeekContainsDate),t.setHours(0,0,0,0),be(t,s)}const i=!("era"in e)||e.era===1?n.year:1-n.year;return t.setFullYear(i,0,s.firstWeekContainsDate),t.setHours(0,0,0,0),be(t,s)}}class Ao extends Y{constructor(){super(...arguments);y(this,"priority",130);y(this,"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"])}parse(t,e){return Yt(e==="R"?4:e.length,t)}set(t,e,n){const s=W(t,0);return s.setFullYear(n,0,4),s.setHours(0,0,0,0),Ke(s)}}class Ho extends Y{constructor(){super(...arguments);y(this,"priority",130);y(this,"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"])}parse(t,e){return Yt(e==="u"?4:e.length,t)}set(t,e,n){return t.setFullYear(n,0,1),t.setHours(0,0,0,0),t}}class $o extends Y{constructor(){super(...arguments);y(this,"priority",120);y(this,"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"])}parse(t,e,n){switch(e){case"Q":case"QQ":return V(e.length,t);case"Qo":return n.ordinalNumber(t,{unit:"quarter"});case"QQQ":return n.quarter(t,{width:"abbreviated",context:"formatting"})||n.quarter(t,{width:"narrow",context:"formatting"});case"QQQQQ":return n.quarter(t,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(t,{width:"wide",context:"formatting"})||n.quarter(t,{width:"abbreviated",context:"formatting"})||n.quarter(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=1&&e<=4}set(t,e,n){return t.setMonth((n-1)*3,1),t.setHours(0,0,0,0),t}}class Qo extends Y{constructor(){super(...arguments);y(this,"priority",120);y(this,"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"])}parse(t,e,n){switch(e){case"q":case"qq":return V(e.length,t);case"qo":return n.ordinalNumber(t,{unit:"quarter"});case"qqq":return n.quarter(t,{width:"abbreviated",context:"standalone"})||n.quarter(t,{width:"narrow",context:"standalone"});case"qqqqq":return n.quarter(t,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(t,{width:"wide",context:"standalone"})||n.quarter(t,{width:"abbreviated",context:"standalone"})||n.quarter(t,{width:"narrow",context:"standalone"})}}validate(t,e){return e>=1&&e<=4}set(t,e,n){return t.setMonth((n-1)*3,1),t.setHours(0,0,0,0),t}}class Bo extends Y{constructor(){super(...arguments);y(this,"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]);y(this,"priority",110)}parse(t,e,n){const s=o=>o-1;switch(e){case"M":return j(B(U.month,t),s);case"MM":return j(V(2,t),s);case"Mo":return j(n.ordinalNumber(t,{unit:"month"}),s);case"MMM":return n.month(t,{width:"abbreviated",context:"formatting"})||n.month(t,{width:"narrow",context:"formatting"});case"MMMMM":return n.month(t,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(t,{width:"wide",context:"formatting"})||n.month(t,{width:"abbreviated",context:"formatting"})||n.month(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=0&&e<=11}set(t,e,n){return t.setMonth(n,1),t.setHours(0,0,0,0),t}}class qo extends Y{constructor(){super(...arguments);y(this,"priority",110);y(this,"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"])}parse(t,e,n){const s=o=>o-1;switch(e){case"L":return j(B(U.month,t),s);case"LL":return j(V(2,t),s);case"Lo":return j(n.ordinalNumber(t,{unit:"month"}),s);case"LLL":return n.month(t,{width:"abbreviated",context:"standalone"})||n.month(t,{width:"narrow",context:"standalone"});case"LLLLL":return n.month(t,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(t,{width:"wide",context:"standalone"})||n.month(t,{width:"abbreviated",context:"standalone"})||n.month(t,{width:"narrow",context:"standalone"})}}validate(t,e){return e>=0&&e<=11}set(t,e,n){return t.setMonth(n,1),t.setHours(0,0,0,0),t}}function Ko(a,r,t){const e=b(a,t==null?void 0:t.in),n=gr(e,t)-r;return e.setDate(e.getDate()-n*7),b(e,t==null?void 0:t.in)}class Vo extends Y{constructor(){super(...arguments);y(this,"priority",100);y(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"])}parse(t,e,n){switch(e){case"w":return B(U.week,t);case"wo":return n.ordinalNumber(t,{unit:"week"});default:return V(e.length,t)}}validate(t,e){return e>=1&&e<=53}set(t,e,n,s){return be(Ko(t,n,s),s)}}function Uo(a,r,t){const e=b(a,t==null?void 0:t.in),n=on(e,t)-r;return e.setDate(e.getDate()-n*7),e}class jo extends Y{constructor(){super(...arguments);y(this,"priority",100);y(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"])}parse(t,e,n){switch(e){case"I":return B(U.week,t);case"Io":return n.ordinalNumber(t,{unit:"week"});default:return V(e.length,t)}}validate(t,e){return e>=1&&e<=53}set(t,e,n){return Ke(Uo(t,n))}}const Xo=[31,28,31,30,31,30,31,31,30,31,30,31],Go=[31,29,31,30,31,30,31,31,30,31,30,31];class zo extends Y{constructor(){super(...arguments);y(this,"priority",90);y(this,"subPriority",1);y(this,"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"])}parse(t,e,n){switch(e){case"d":return B(U.date,t);case"do":return n.ordinalNumber(t,{unit:"date"});default:return V(e.length,t)}}validate(t,e){const n=t.getFullYear(),s=br(n),o=t.getMonth();return s?e>=1&&e<=Go[o]:e>=1&&e<=Xo[o]}set(t,e,n){return t.setDate(n),t.setHours(0,0,0,0),t}}class Zo extends Y{constructor(){super(...arguments);y(this,"priority",90);y(this,"subpriority",1);y(this,"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"])}parse(t,e,n){switch(e){case"D":case"DD":return B(U.dayOfYear,t);case"Do":return n.ordinalNumber(t,{unit:"date"});default:return V(e.length,t)}}validate(t,e){const n=t.getFullYear();return br(n)?e>=1&&e<=366:e>=1&&e<=365}set(t,e,n){return t.setMonth(0,n),t.setHours(0,0,0,0),t}}function ln(a,r,t){var d,f,p,h;const e=We(),n=(t==null?void 0:t.weekStartsOn)??((f=(d=t==null?void 0:t.locale)==null?void 0:d.options)==null?void 0:f.weekStartsOn)??e.weekStartsOn??((h=(p=e.locale)==null?void 0:p.options)==null?void 0:h.weekStartsOn)??0,s=b(a,t==null?void 0:t.in),o=s.getDay(),c=(r%7+7)%7,u=7-n,l=r<0||r>6?r-(o+u)%7:(c+u)%7-(o+u)%7;return ce(s,l,t)}class Jo extends Y{constructor(){super(...arguments);y(this,"priority",90);y(this,"incompatibleTokens",["D","i","e","c","t","T"])}parse(t,e,n){switch(e){case"E":case"EE":case"EEE":return n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"});case"EEEEE":return n.day(t,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"});case"EEEE":default:return n.day(t,{width:"wide",context:"formatting"})||n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=0&&e<=6}set(t,e,n,s){return t=ln(t,n,s),t.setHours(0,0,0,0),t}}class ei extends Y{constructor(){super(...arguments);y(this,"priority",90);y(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"])}parse(t,e,n,s){const o=i=>{const c=Math.floor((i-1)/7)*7;return(i+s.weekStartsOn+6)%7+c};switch(e){case"e":case"ee":return j(V(e.length,t),o);case"eo":return j(n.ordinalNumber(t,{unit:"day"}),o);case"eee":return n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"});case"eeeee":return n.day(t,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"});case"eeee":default:return n.day(t,{width:"wide",context:"formatting"})||n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=0&&e<=6}set(t,e,n,s){return t=ln(t,n,s),t.setHours(0,0,0,0),t}}class ti extends Y{constructor(){super(...arguments);y(this,"priority",90);y(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"])}parse(t,e,n,s){const o=i=>{const c=Math.floor((i-1)/7)*7;return(i+s.weekStartsOn+6)%7+c};switch(e){case"c":case"cc":return j(V(e.length,t),o);case"co":return j(n.ordinalNumber(t,{unit:"day"}),o);case"ccc":return n.day(t,{width:"abbreviated",context:"standalone"})||n.day(t,{width:"short",context:"standalone"})||n.day(t,{width:"narrow",context:"standalone"});case"ccccc":return n.day(t,{width:"narrow",context:"standalone"});case"cccccc":return n.day(t,{width:"short",context:"standalone"})||n.day(t,{width:"narrow",context:"standalone"});case"cccc":default:return n.day(t,{width:"wide",context:"standalone"})||n.day(t,{width:"abbreviated",context:"standalone"})||n.day(t,{width:"short",context:"standalone"})||n.day(t,{width:"narrow",context:"standalone"})}}validate(t,e){return e>=0&&e<=6}set(t,e,n,s){return t=ln(t,n,s),t.setHours(0,0,0,0),t}}function ni(a,r,t){const e=b(a,t==null?void 0:t.in),n=To(e,t),s=r-n;return ce(e,s,t)}class ri extends Y{constructor(){super(...arguments);y(this,"priority",90);y(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"])}parse(t,e,n){const s=o=>o===0?7:o;switch(e){case"i":case"ii":return V(e.length,t);case"io":return n.ordinalNumber(t,{unit:"day"});case"iii":return j(n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"}),s);case"iiiii":return j(n.day(t,{width:"narrow",context:"formatting"}),s);case"iiiiii":return j(n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"}),s);case"iiii":default:return j(n.day(t,{width:"wide",context:"formatting"})||n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"}),s)}}validate(t,e){return e>=1&&e<=7}set(t,e,n){return t=ni(t,n),t.setHours(0,0,0,0),t}}class ai extends Y{constructor(){super(...arguments);y(this,"priority",80);y(this,"incompatibleTokens",["b","B","H","k","t","T"])}parse(t,e,n){switch(e){case"a":case"aa":case"aaa":return n.dayPeriod(t,{width:"abbreviated",context:"formatting"})||n.dayPeriod(t,{width:"narrow",context:"formatting"});case"aaaaa":return n.dayPeriod(t,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(t,{width:"wide",context:"formatting"})||n.dayPeriod(t,{width:"abbreviated",context:"formatting"})||n.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,e,n){return t.setHours(un(n),0,0,0),t}}class si extends Y{constructor(){super(...arguments);y(this,"priority",80);y(this,"incompatibleTokens",["a","B","H","k","t","T"])}parse(t,e,n){switch(e){case"b":case"bb":case"bbb":return n.dayPeriod(t,{width:"abbreviated",context:"formatting"})||n.dayPeriod(t,{width:"narrow",context:"formatting"});case"bbbbb":return n.dayPeriod(t,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(t,{width:"wide",context:"formatting"})||n.dayPeriod(t,{width:"abbreviated",context:"formatting"})||n.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,e,n){return t.setHours(un(n),0,0,0),t}}class oi extends Y{constructor(){super(...arguments);y(this,"priority",80);y(this,"incompatibleTokens",["a","b","t","T"])}parse(t,e,n){switch(e){case"B":case"BB":case"BBB":return n.dayPeriod(t,{width:"abbreviated",context:"formatting"})||n.dayPeriod(t,{width:"narrow",context:"formatting"});case"BBBBB":return n.dayPeriod(t,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(t,{width:"wide",context:"formatting"})||n.dayPeriod(t,{width:"abbreviated",context:"formatting"})||n.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,e,n){return t.setHours(un(n),0,0,0),t}}class ii extends Y{constructor(){super(...arguments);y(this,"priority",70);y(this,"incompatibleTokens",["H","K","k","t","T"])}parse(t,e,n){switch(e){case"h":return B(U.hour12h,t);case"ho":return n.ordinalNumber(t,{unit:"hour"});default:return V(e.length,t)}}validate(t,e){return e>=1&&e<=12}set(t,e,n){const s=t.getHours()>=12;return s&&n<12?t.setHours(n+12,0,0,0):!s&&n===12?t.setHours(0,0,0,0):t.setHours(n,0,0,0),t}}class ci extends Y{constructor(){super(...arguments);y(this,"priority",70);y(this,"incompatibleTokens",["a","b","h","K","k","t","T"])}parse(t,e,n){switch(e){case"H":return B(U.hour23h,t);case"Ho":return n.ordinalNumber(t,{unit:"hour"});default:return V(e.length,t)}}validate(t,e){return e>=0&&e<=23}set(t,e,n){return t.setHours(n,0,0,0),t}}class ui extends Y{constructor(){super(...arguments);y(this,"priority",70);y(this,"incompatibleTokens",["h","H","k","t","T"])}parse(t,e,n){switch(e){case"K":return B(U.hour11h,t);case"Ko":return n.ordinalNumber(t,{unit:"hour"});default:return V(e.length,t)}}validate(t,e){return e>=0&&e<=11}set(t,e,n){return t.getHours()>=12&&n<12?t.setHours(n+12,0,0,0):t.setHours(n,0,0,0),t}}class li extends Y{constructor(){super(...arguments);y(this,"priority",70);y(this,"incompatibleTokens",["a","b","h","H","K","t","T"])}parse(t,e,n){switch(e){case"k":return B(U.hour24h,t);case"ko":return n.ordinalNumber(t,{unit:"hour"});default:return V(e.length,t)}}validate(t,e){return e>=1&&e<=24}set(t,e,n){const s=n<=24?n%24:n;return t.setHours(s,0,0,0),t}}class di extends Y{constructor(){super(...arguments);y(this,"priority",60);y(this,"incompatibleTokens",["t","T"])}parse(t,e,n){switch(e){case"m":return B(U.minute,t);case"mo":return n.ordinalNumber(t,{unit:"minute"});default:return V(e.length,t)}}validate(t,e){return e>=0&&e<=59}set(t,e,n){return t.setMinutes(n,0,0),t}}class fi extends Y{constructor(){super(...arguments);y(this,"priority",50);y(this,"incompatibleTokens",["t","T"])}parse(t,e,n){switch(e){case"s":return B(U.second,t);case"so":return n.ordinalNumber(t,{unit:"second"});default:return V(e.length,t)}}validate(t,e){return e>=0&&e<=59}set(t,e,n){return t.setSeconds(n,0),t}}class pi extends Y{constructor(){super(...arguments);y(this,"priority",30);y(this,"incompatibleTokens",["t","T"])}parse(t,e){const n=s=>Math.trunc(s*Math.pow(10,-e.length+3));return j(V(e.length,t),n)}set(t,e,n){return t.setMilliseconds(n),t}}class hi extends Y{constructor(){super(...arguments);y(this,"priority",10);y(this,"incompatibleTokens",["t","T","x"])}parse(t,e){switch(e){case"X":return he(pe.basicOptionalMinutes,t);case"XX":return he(pe.basic,t);case"XXXX":return he(pe.basicOptionalSeconds,t);case"XXXXX":return he(pe.extendedOptionalSeconds,t);case"XXX":default:return he(pe.extended,t)}}set(t,e,n){return e.timestampIsSet?t:W(t,t.getTime()-Ct(t)-n)}}class mi extends Y{constructor(){super(...arguments);y(this,"priority",10);y(this,"incompatibleTokens",["t","T","X"])}parse(t,e){switch(e){case"x":return he(pe.basicOptionalMinutes,t);case"xx":return he(pe.basic,t);case"xxxx":return he(pe.basicOptionalSeconds,t);case"xxxxx":return he(pe.extendedOptionalSeconds,t);case"xxx":default:return he(pe.extended,t)}}set(t,e,n){return e.timestampIsSet?t:W(t,t.getTime()-Ct(t)-n)}}class gi extends Y{constructor(){super(...arguments);y(this,"priority",40);y(this,"incompatibleTokens","*")}parse(t){return yr(t)}set(t,e,n){return[W(t,n*1e3),{timestampIsSet:!0}]}}class wi extends Y{constructor(){super(...arguments);y(this,"priority",20);y(this,"incompatibleTokens","*")}parse(t){return yr(t)}set(t,e,n){return[W(t,n),{timestampIsSet:!0}]}}const Di={G:new Fo,y:new Lo,Y:new Wo,R:new Ao,u:new Ho,Q:new $o,q:new Qo,M:new Bo,L:new qo,w:new Vo,I:new jo,d:new zo,D:new Zo,E:new Jo,e:new ei,c:new ti,i:new ri,a:new ai,b:new si,B:new oi,h:new ii,H:new ci,K:new ui,k:new li,m:new di,s:new fi,S:new pi,X:new hi,x:new mi,t:new gi,T:new wi},yi=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,vi=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,bi=/^'([^]*?)'?$/,ki=/''/g,_i=/\S/,Mi=/[a-zA-Z]/;function xi(a,r,t,e){var w,k,S,x,N,q,$,I;const n=()=>W((e==null?void 0:e.in)||t,NaN),s=Po(),o=(e==null?void 0:e.locale)??s.locale??mr,i=(e==null?void 0:e.firstWeekContainsDate)??((k=(w=e==null?void 0:e.locale)==null?void 0:w.options)==null?void 0:k.firstWeekContainsDate)??s.firstWeekContainsDate??((x=(S=s.locale)==null?void 0:S.options)==null?void 0:x.firstWeekContainsDate)??1,c=(e==null?void 0:e.weekStartsOn)??((q=(N=e==null?void 0:e.locale)==null?void 0:N.options)==null?void 0:q.weekStartsOn)??s.weekStartsOn??((I=($=s.locale)==null?void 0:$.options)==null?void 0:I.weekStartsOn)??0;if(!r)return a?n():b(t,e==null?void 0:e.in);const u={firstWeekContainsDate:i,weekStartsOn:c,locale:o},l=[new Ro(e==null?void 0:e.in,t)],d=r.match(vi).map(_=>{const M=_[0];if(M in en){const F=en[M];return F(_,o.formatLong)}return _}).join("").match(yi),f=[];for(let _ of d){const M=_[0],F=Di[M];if(F){const{incompatibleTokens:X}=F;if(Array.isArray(X)){const J=f.find(le=>X.includes(le.token)||le.token===M);if(J)throw new RangeError(`The format string mustn't contain \`${J.fullToken}\` and \`${_}\` at the same time`)}else if(F.incompatibleTokens==="*"&&f.length>0)throw new RangeError(`The format string mustn't contain \`${_}\` and any other token at the same time`);f.push({token:M,fullToken:_});const K=F.run(a,_,o.match,u);if(!K)return n();l.push(K.setter),a=K.rest}else{if(M.match(Mi))throw new RangeError("Format string contains an unescaped latin alphabet character `"+M+"`");if(_==="''"?_="'":M==="'"&&(_=Si(_)),a.indexOf(_)===0)a=a.slice(_.length);else return n()}}if(a.length>0&&_i.test(a))return n();const p=l.map(_=>_.priority).sort((_,M)=>M-_).filter((_,M,F)=>F.indexOf(_)===M).map(_=>l.filter(M=>M.priority===_).sort((M,F)=>F.subPriority-M.subPriority)).map(_=>_[0]);let h=b(t,e==null?void 0:e.in);if(isNaN(+h))return n();const g={};for(const _ of p){if(!_.validate(h,u))return n();const M=_.set(h,g,u);Array.isArray(M)?(h=M[0],Object.assign(g,M[1])):h=M}return h}function Si(a){return a.match(bi)[1].replace(ki,"'")}function Ci(a,r,t){const[e,n]=ke(t==null?void 0:t.in,a,r);return e.getFullYear()===n.getFullYear()&&e.getMonth()===n.getMonth()}function Pi(a,r,t){const[e,n]=ke(t==null?void 0:t.in,a,r);return+Jt(e)==+Jt(n)}function Ti(a,r,t){const[e,n]=ke(t==null?void 0:t.in,a,r);return e.getFullYear()===n.getFullYear()}function ut(a,r,t){const e=+b(a,t==null?void 0:t.in),[n,s]=[+b(r.start,t==null?void 0:t.in),+b(r.end,t==null?void 0:t.in)].sort((o,i)=>o-i);return e>=n&&e<=s}function Oi(a,r,t){return ce(a,-1,t)}function Ei(a,r){const t=()=>W(r==null?void 0:r.in,NaN),n=Ri(a);let s;if(n.date){const u=Fi(n.date,2);s=Li(u.restDateString,u.year)}if(!s||isNaN(+s))return t();const o=+s;let i=0,c;if(n.time&&(i=Wi(n.time),isNaN(i)))return t();if(n.timezone){if(c=Ai(n.timezone),isNaN(c))return t()}else{const u=new Date(o+i),l=b(0,r==null?void 0:r.in);return l.setFullYear(u.getUTCFullYear(),u.getUTCMonth(),u.getUTCDate()),l.setHours(u.getUTCHours(),u.getUTCMinutes(),u.getUTCSeconds(),u.getUTCMilliseconds()),l}return b(o+i+c,r==null?void 0:r.in)}const ht={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},Ni=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,Yi=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,Ii=/^([+-])(\d{2})(?::?(\d{2}))?$/;function Ri(a){const r={},t=a.split(ht.dateTimeDelimiter);let e;if(t.length>2)return r;if(/:/.test(t[0])?e=t[0]:(r.date=t[0],e=t[1],ht.timeZoneDelimiter.test(r.date)&&(r.date=a.split(ht.timeZoneDelimiter)[0],e=a.substr(r.date.length,a.length))),e){const n=ht.timezone.exec(e);n?(r.time=e.replace(n[1],""),r.timezone=n[1]):r.time=e}return r}function Fi(a,r){const t=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+r)+"})|(\\d{2}|[+-]\\d{"+(2+r)+"})$)"),e=a.match(t);if(!e)return{year:NaN,restDateString:""};const n=e[1]?parseInt(e[1]):null,s=e[2]?parseInt(e[2]):null;return{year:s===null?n:s*100,restDateString:a.slice((e[1]||e[2]).length)}}function Li(a,r){if(r===null)return new Date(NaN);const t=a.match(Ni);if(!t)return new Date(NaN);const e=!!t[4],n=rt(t[1]),s=rt(t[2])-1,o=rt(t[3]),i=rt(t[4]),c=rt(t[5])-1;if(e)return qi(r,i,c)?Hi(r,i,c):new Date(NaN);{const u=new Date(0);return!Qi(r,s,o)||!Bi(r,n)?new Date(NaN):(u.setUTCFullYear(r,s,Math.max(n,o)),u)}}function rt(a){return a?parseInt(a):1}function Wi(a){const r=a.match(Yi);if(!r)return NaN;const t=Vt(r[1]),e=Vt(r[2]),n=Vt(r[3]);return Ki(t,e,n)?t*At+e*Wt+n*1e3:NaN}function Vt(a){return a&&parseFloat(a.replace(",","."))||0}function Ai(a){if(a==="Z")return 0;const r=a.match(Ii);if(!r)return 0;const t=r[1]==="+"?-1:1,e=parseInt(r[2]),n=r[3]&&parseInt(r[3])||0;return Vi(e,n)?t*(e*At+n*Wt):NaN}function Hi(a,r,t){const e=new Date(0);e.setUTCFullYear(a,0,4);const n=e.getUTCDay()||7,s=(r-1)*7+t+1-n;return e.setUTCDate(e.getUTCDate()+s),e}const $i=[31,null,31,30,31,30,31,31,30,31,30,31];function kr(a){return a%400===0||a%4===0&&a%100!==0}function Qi(a,r,t){return r>=0&&r<=11&&t>=1&&t<=($i[r]||(kr(a)?29:28))}function Bi(a,r){return r>=1&&r<=(kr(a)?366:365)}function qi(a,r,t){return r>=1&&r<=53&&t>=0&&t<=6}function Ki(a,r,t){return a===24?r===0&&t===0:t>=0&&t<60&&r>=0&&r<60&&a>=0&&a<25}function Vi(a,r){return r>=0&&r<=59}function ae(a,r,t){const e=b(a,t==null?void 0:t.in),n=e.getFullYear(),s=e.getDate(),o=W(a,0);o.setFullYear(n,r,15),o.setHours(0,0,0,0);const i=Co(o);return e.setMonth(r,Math.min(s,i)),e}function vt(a,r,t){const e=b(a,t==null?void 0:t.in);return e.setHours(r),e}function bt(a,r,t){const e=b(a,t==null?void 0:t.in);return e.setMinutes(r),e}function $e(a,r,t){const e=b(a,t==null?void 0:t.in),n=Math.trunc(e.getMonth()/3)+1,s=r-n;return ae(e,e.getMonth()+s*3)}function kt(a,r,t){const e=b(a,t==null?void 0:t.in);return e.setSeconds(r),e}function de(a,r,t){const e=b(a,t==null?void 0:t.in);return isNaN(+e)?W(a,NaN):(e.setFullYear(r),e)}function Ie(a,r,t){return ue(a,-r,t)}function _r(a,r,t){return sn(a,-1,t)}function Nn(a,r,t){return Pt(a,-1,t)}function Ue(a,r,t){return ge(a,-r,t)}const Mr={...Fr},Ui=Mr.useInsertionEffect,ji=Ui||(a=>a());function Xi(a){const r=v.useRef(()=>{});return ji(()=>{r.current=a}),v.useCallback(function(){for(var t=arguments.length,e=new Array(t),n=0;n"floating-ui-"+Math.random().toString(36).slice(2,6)+Gi++;function zi(){const[a,r]=v.useState(()=>Yn?In():void 0);return It(()=>{a==null&&r(In())},[]),v.useEffect(()=>{Yn=!0},[]),a}const Zi=Mr.useId,xr=Zi||zi,Ji=v.forwardRef(function(r,t){const{context:{placement:e,elements:{floating:n},middlewareData:{arrow:s,shift:o}},width:i=14,height:c=7,tipRadius:u=0,strokeWidth:l=0,staticOffset:d,stroke:f,d:p,style:{transform:h,...g}={},...w}=r,k=xr(),[S,x]=v.useState(!1);if(It(()=>{if(!n)return;Wr(n).direction==="rtl"&&x(!0)},[n]),!n)return null;const[N,q]=e.split("-"),$=N==="top"||N==="bottom";let I=d;($&&o!=null&&o.x||!$&&o!=null&&o.y)&&(I=null);const _=l*2,M=_/2,F=i/2*(u/-8+1),X=c/2*u/4,K=!!p,J=I&&q==="end"?"bottom":"top";let le=I&&q==="end"?"right":"left";I&&S&&(le=q==="end"?"left":"right");const G=(s==null?void 0:s.x)!=null?I||s.x:"",A=(s==null?void 0:s.y)!=null?I||s.y:"",Q=p||"M0,0"+(" H"+i)+(" L"+(i-F)+","+(c-X))+(" Q"+i/2+","+c+" "+F+","+(c-X))+" Z",ne={top:K?"rotate(180deg)":"",left:K?"rotate(90deg)":"rotate(-90deg)",bottom:K?"":"rotate(180deg)",right:K?"rotate(-90deg)":"rotate(90deg)"}[N];return Ge.jsxs("svg",{...w,"aria-hidden":!0,ref:t,width:K?i:i+_,height:i,viewBox:"0 0 "+i+" "+(c>i?c:i),style:{position:"absolute",pointerEvents:"none",[le]:G,[J]:A,[N]:$||K?"100%":"calc(100% - "+_/2+"px)",transform:[ne,h].filter(Xe=>!!Xe).join(" "),...g},children:[_>0&&Ge.jsx("path",{clipPath:"url(#"+k+")",fill:"none",stroke:f,strokeWidth:_+(p?0:1),d:Q}),Ge.jsx("path",{stroke:_&&!p?w.fill:"none",d:Q}),Ge.jsx("clipPath",{id:k,children:Ge.jsx("rect",{x:-M,y:M*(K?-1:1),width:i+_,height:i})})]})});function ec(){const a=new Map;return{emit(r,t){var e;(e=a.get(r))==null||e.forEach(n=>n(t))},on(r,t){a.set(r,[...a.get(r)||[],t])},off(r,t){var e;a.set(r,((e=a.get(r))==null?void 0:e.filter(n=>n!==t))||[])}}}const tc=v.createContext(null),nc=v.createContext(null),rc=()=>{var a;return((a=v.useContext(tc))==null?void 0:a.id)||null},ac=()=>v.useContext(nc);function sc(a){const{open:r=!1,onOpenChange:t,elements:e}=a,n=xr(),s=v.useRef({}),[o]=v.useState(()=>ec()),i=rc()!=null,[c,u]=v.useState(e.reference),l=Xi((p,h,g)=>{s.current.openEvent=p?h:void 0,o.emit("openchange",{open:p,event:h,reason:g,nested:i}),t==null||t(p,h,g)}),d=v.useMemo(()=>({setPositionReference:u}),[]),f=v.useMemo(()=>({reference:c||e.reference||null,floating:e.floating||null,domReference:e.reference}),[c,e.reference,e.floating]);return v.useMemo(()=>({dataRef:s,open:r,onOpenChange:l,elements:f,events:o,floatingId:n,refs:d}),[r,l,f,o,n,d])}function oc(a){a===void 0&&(a={});const{nodeId:r}=a,t=sc({...a,elements:{reference:null,floating:null,...a.elements}}),e=a.rootContext||t,n=e.elements,[s,o]=v.useState(null),[i,c]=v.useState(null),l=(n==null?void 0:n.domReference)||s,d=v.useRef(null),f=ac();It(()=>{l&&(d.current=l)},[l]);const p=Ar({...a,elements:{...n,...i&&{reference:i}}}),h=v.useCallback(x=>{const N=ft(x)?{getBoundingClientRect:()=>x.getBoundingClientRect(),contextElement:x}:x;c(N),p.refs.setReference(N)},[p.refs]),g=v.useCallback(x=>{(ft(x)||x===null)&&(d.current=x,o(x)),(ft(p.refs.reference.current)||p.refs.reference.current===null||x!==null&&!ft(x))&&p.refs.setReference(x)},[p.refs]),w=v.useMemo(()=>({...p.refs,setReference:g,setPositionReference:h,domReference:d}),[p.refs,g,h]),k=v.useMemo(()=>({...p.elements,domReference:l}),[p.elements,l]),S=v.useMemo(()=>({...p,...e,refs:w,elements:k,nodeId:r}),[p,w,k,r,e]);return It(()=>{e.dataRef.current.floatingContext=S;const x=f==null?void 0:f.nodesRef.current.find(N=>N.id===r);x&&(x.context=S)}),v.useMemo(()=>({...p,context:S,refs:w,elements:k}),[p,w,k,S])}/*! + react-datepicker v8.1.0 https://github.com/Hacker0x01/react-datepicker Released under the MIT License. -*/var nn=function(r,t){return nn=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])},nn(r,t)};function z(a,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");nn(a,r);function t(){this.constructor=a}a.prototype=r===null?Object.create(r):(t.prototype=r.prototype,new t)}var E=function(){return E=Object.assign||function(t){for(var e,n=1,s=arguments.length;n0?t[0]:t;return a&&H(a,n,e)||""}function uc(a,r,t){if(!a)return"";var e=re(a,t),n=r?re(r,t):"";return"".concat(e," - ").concat(n)}function lc(a,r){if(!(a!=null&&a.length))return"";var t=a[0]?re(a[0],r):"";if(a.length===1)return t;if(a.length===2&&a[1]){var e=re(a[1],r);return"".concat(t,", ").concat(e)}var n=a.length-1;return"".concat(t," (+").concat(n,")")}function jt(a,r){var t=r.hour,e=t===void 0?0:t,n=r.minute,s=n===void 0?0:n,o=r.second,i=o===void 0?0:o;return vt(bt(kt(a,i),s),e)}function dc(a){return on(a)}function fc(a,r){return H(a,"ddd",r)}function _t(a){return Re(a)}function Ce(a,r,t){var e=je(r||dn());return be(a,{locale:e,weekStartsOn:t})}function ve(a){return pr(a)}function st(a){return Ht(a)}function Rn(a){return Jt(a)}function Fn(){return Re(R())}function Ln(a){return dr(a)}function pc(a){return Os(a)}function hc(a){return fr(a)}function fe(a,r){return a&&r?Ti(a,r):!a&&!r}function ee(a,r){return a&&r?Ci(a,r):!a&&!r}function Rt(a,r){return a&&r?Pi(a,r):!a&&!r}function O(a,r){return a&&r?Ps(a,r):!a&&!r}function Ee(a,r){return a&&r?Oo(a,r):!a&&!r}function ot(a,r,t){var e,n=Re(r),s=dr(t);try{e=ut(a,{start:n,end:s})}catch{e=!1}return e}function dn(){var a=Sr();return a.__localeId__}function je(a){if(typeof a=="string"){var r=Sr();return r.__localeData__?r.__localeData__[a]:void 0}else return a}function mc(a,r,t){return r(H(a,"EEEE",t))}function gc(a,r){return H(a,"EEEEEE",r)}function wc(a,r){return H(a,"EEE",r)}function fn(a,r){return H(ae(R(),a),"LLLL",r)}function Cr(a,r){return H(ae(R(),a),"LLL",r)}function Dc(a,r){return H($e(R(),a),"QQQ",r)}function se(a,r){var t=r===void 0?{}:r,e=t.minDate,n=t.maxDate,s=t.excludeDates,o=t.excludeDateIntervals,i=t.includeDates,c=t.includeDateIntervals,u=t.filterDate;return dt(a,{minDate:e,maxDate:n})||s&&s.some(function(l){return l instanceof Date?O(a,l):O(a,l.date)})||o&&o.some(function(l){var d=l.start,f=l.end;return ut(a,{start:d,end:f})})||i&&!i.some(function(l){return O(a,l)})||c&&!c.some(function(l){var d=l.start,f=l.end;return ut(a,{start:d,end:f})})||u&&!u(R(a))||!1}function pn(a,r){var t=r===void 0?{}:r,e=t.excludeDates,n=t.excludeDateIntervals;return n&&n.length>0?n.some(function(s){var o=s.start,i=s.end;return ut(a,{start:o,end:i})}):e&&e.some(function(s){var o;return s instanceof Date?O(a,s):O(a,(o=s.date)!==null&&o!==void 0?o:new Date)})||!1}function Pr(a,r){var t=r===void 0?{}:r,e=t.minDate,n=t.maxDate,s=t.excludeDates,o=t.includeDates,i=t.filterDate;return dt(a,{minDate:e?pr(e):void 0,maxDate:n?fr(n):void 0})||(s==null?void 0:s.some(function(c){return ee(a,c instanceof Date?c:c.date)}))||o&&!o.some(function(c){return ee(a,c)})||i&&!i(R(a))||!1}function mt(a,r,t,e){var n=P(a),s=te(a),o=P(r),i=te(r),c=P(e);return n===o&&n===c?s<=t&&t<=i:n=t||cn:!1}function yc(a,r){var t=r===void 0?{}:r,e=t.minDate,n=t.maxDate,s=t.excludeDates,o=t.includeDates;return dt(a,{minDate:e,maxDate:n})||s&&s.some(function(i){return ee(i instanceof Date?i:i.date,a)})||o&&!o.some(function(i){return ee(i,a)})||!1}function gt(a,r){var t=r===void 0?{}:r,e=t.minDate,n=t.maxDate,s=t.excludeDates,o=t.includeDates,i=t.filterDate;return dt(a,{minDate:e,maxDate:n})||(s==null?void 0:s.some(function(c){return Rt(a,c instanceof Date?c:c.date)}))||o&&!o.some(function(c){return Rt(a,c)})||i&&!i(R(a))||!1}function wt(a,r,t){if(!r||!t||!Tt(r)||!Tt(t))return!1;var e=P(r),n=P(t);return e<=a&&n>=a}function Mt(a,r){var t=r===void 0?{}:r,e=t.minDate,n=t.maxDate,s=t.excludeDates,o=t.includeDates,i=t.filterDate,c=new Date(a,0,1);return dt(c,{minDate:e?Ht(e):void 0,maxDate:n?hr(n):void 0})||(s==null?void 0:s.some(function(u){return fe(c,u instanceof Date?u:u.date)}))||o&&!o.some(function(u){return fe(c,u)})||i&&!i(R(c))||!1}function Dt(a,r,t,e){var n=P(a),s=Ye(a),o=P(r),i=Ye(r),c=P(e);return n===o&&n===c?s<=t&&t<=i:n=t||cn:!1}function dt(a,r){var t,e=r===void 0?{}:r,n=e.minDate,s=e.maxDate;return(t=n&&Ve(a,n)<0||s&&Ve(a,s)>0)!==null&&t!==void 0?t:!1}function Wn(a,r){return r.some(function(t){return De(t)===De(a)&&ye(t)===ye(a)&&Se(t)===Se(a)})}function An(a,r){var t=r===void 0?{}:r,e=t.excludeTimes,n=t.includeTimes,s=t.filterTime;return e&&Wn(a,e)||n&&!Wn(a,n)||s&&!s(a)||!1}function Hn(a,r){var t=r.minTime,e=r.maxTime;if(!t||!e)throw new Error("Both minTime and maxTime props required");var n=R();n=vt(n,De(a)),n=bt(n,ye(a)),n=kt(n,Se(a));var s=R();s=vt(s,De(t)),s=bt(s,ye(t)),s=kt(s,Se(t));var o=R();o=vt(o,De(e)),o=bt(o,ye(e)),o=kt(o,Se(e));var i;try{i=!ut(n,{start:s,end:o})}catch{i=!1}return i}function $n(a,r){var t=r===void 0?{}:r,e=t.minDate,n=t.includeDates,s=Ie(a,1);return e&&Ot(e,s)>0||n&&n.every(function(o){return Ot(o,s)>0})||!1}function Qn(a,r){var t=r===void 0?{}:r,e=t.maxDate,n=t.includeDates,s=ue(a,1);return e&&Ot(s,e)>0||n&&n.every(function(o){return Ot(s,o)>0})||!1}function vc(a,r){var t=r===void 0?{}:r,e=t.minDate,n=t.includeDates,s=Ht(a),o=_r(s);return e&&Et(e,o)>0||n&&n.every(function(i){return Et(i,o)>0})||!1}function bc(a,r){var t=r===void 0?{}:r,e=t.maxDate,n=t.includeDates,s=hr(a),o=sn(s,1);return e&&Et(o,e)>0||n&&n.every(function(i){return Et(o,i)>0})||!1}function Bn(a,r){var t=r===void 0?{}:r,e=t.minDate,n=t.includeDates,s=Ue(a,1);return e&&Nt(e,s)>0||n&&n.every(function(o){return Nt(o,s)>0})||!1}function kc(a,r){var t=r===void 0?{}:r,e=t.minDate,n=t.yearItemNumber,s=n===void 0?lt:n,o=st(Ue(a,s)),i=xe(o,s).endPeriod,c=e&&P(e);return c&&c>i||!1}function qn(a,r){var t=r===void 0?{}:r,e=t.maxDate,n=t.includeDates,s=ge(a,1);return e&&Nt(s,e)>0||n&&n.every(function(o){return Nt(s,o)>0})||!1}function _c(a,r){var t=r===void 0?{}:r,e=t.maxDate,n=t.yearItemNumber,s=n===void 0?lt:n,o=ge(a,s),i=xe(o,s).startPeriod,c=e&&P(e);return c&&c=0});return Mn(e)}else return t?Mn(t):r}function Or(a){var r=a.maxDate,t=a.includeDates;if(t&&r){var e=t.filter(function(n){return Ve(n,r)<=0});return _n(e)}else return t?_n(t):r}function Kn(a,r){var t;a===void 0&&(a=[]),r===void 0&&(r="react-datepicker__day--highlighted");for(var e=new Map,n=0,s=a.length;n=Yc,p=!n&&!t.isWeekInMonth(i);if(f||p)if(t.props.peekNextMonth)o=!0;else break}return e},t.onMonthClick=function(e,n){var s=t.isMonthDisabledForLabelDate(n),o=s.isDisabled,i=s.labelDate;o||t.handleDayClick(ve(i),e)},t.onMonthMouseEnter=function(e){var n=t.isMonthDisabledForLabelDate(e),s=n.isDisabled,o=n.labelDate;s||t.handleDayMouseEnter(ve(o))},t.handleMonthNavigation=function(e,n){var s,o,i,c;(o=(s=t.props).setPreSelection)===null||o===void 0||o.call(s,n),(c=(i=t.MONTH_REFS[e])===null||i===void 0?void 0:i.current)===null||c===void 0||c.focus()},t.handleKeyboardNavigation=function(e,n,s){var o,i=t.props,c=i.selected,u=i.preSelection,l=i.setPreSelection,d=i.minDate,f=i.maxDate,p=i.showFourColumnMonthYearPicker,h=i.showTwoColumnMonthYearPicker;if(u){var g=Gn(p,h),w=t.getVerticalOffset(g),k=(o=Xt[g])===null||o===void 0?void 0:o.grid,S=function(I,_,M){var F,X,K=_,J=M;switch(I){case D.ArrowRight:K=ue(_,yt),J=M===11?0:M+yt;break;case D.ArrowLeft:K=Ie(_,yt),J=M===0?11:M-yt;break;case D.ArrowUp:K=Ie(_,w),J=!((F=k==null?void 0:k[0])===null||F===void 0)&&F.includes(M)?M+12-w:M-w;break;case D.ArrowDown:K=ue(_,w),J=!((X=k==null?void 0:k[k.length-1])===null||X===void 0)&&X.includes(M)?M-12+w:M+w;break}return{newCalculatedDate:K,newCalculatedMonth:J}},x=function(I,_,M){for(var F=40,X=I,K=!1,J=0,le=S(X,_,M),G=le.newCalculatedDate,A=le.newCalculatedMonth;!K;){if(J>=F){G=_,A=M;break}if(d&&Gf){X=D.ArrowLeft;var Q=S(X,G,A);G=Q.newCalculatedDate,A=Q.newCalculatedMonth}if(yc(G,t.props)){var Q=S(X,G,A);G=Q.newCalculatedDate,A=Q.newCalculatedMonth}else K=!0;J++}return{newCalculatedDate:G,newCalculatedMonth:A}};if(n===D.Enter){t.isMonthDisabled(s)||(t.onMonthClick(e,s),l==null||l(c));return}var N=x(n,u,s),q=N.newCalculatedDate,$=N.newCalculatedMonth;switch(n){case D.ArrowRight:case D.ArrowLeft:case D.ArrowUp:case D.ArrowDown:t.handleMonthNavigation($,q);break}}},t.getVerticalOffset=function(e){var n,s;return(s=(n=Xt[e])===null||n===void 0?void 0:n.verticalNavigationOffset)!==null&&s!==void 0?s:0},t.onMonthKeyDown=function(e,n){var s=t.props,o=s.disabledKeyboardNavigation,i=s.handleOnMonthKeyDown,c=e.key;c!==D.Tab&&e.preventDefault(),o||t.handleKeyboardNavigation(e,c,n),i&&i(e)},t.onQuarterClick=function(e,n){var s=$e(t.props.day,n);gt(s,t.props)||t.handleDayClick(Rn(s),e)},t.onQuarterMouseEnter=function(e){var n=$e(t.props.day,e);gt(n,t.props)||t.handleDayMouseEnter(Rn(n))},t.handleQuarterNavigation=function(e,n){var s,o,i,c;t.isDisabled(n)||t.isExcluded(n)||((o=(s=t.props).setPreSelection)===null||o===void 0||o.call(s,n),(c=(i=t.QUARTER_REFS[e-1])===null||i===void 0?void 0:i.current)===null||c===void 0||c.focus())},t.onQuarterKeyDown=function(e,n){var s,o,i=e.key;if(!t.props.disabledKeyboardNavigation)switch(i){case D.Enter:t.onQuarterClick(e,n),(o=(s=t.props).setPreSelection)===null||o===void 0||o.call(s,t.props.selected);break;case D.ArrowRight:if(!t.props.preSelection)break;t.handleQuarterNavigation(n===4?1:n+1,sn(t.props.preSelection,1));break;case D.ArrowLeft:if(!t.props.preSelection)break;t.handleQuarterNavigation(n===1?4:n-1,_r(t.props.preSelection));break}},t.isMonthDisabledForLabelDate=function(e){var n,s=t.props,o=s.day,i=s.minDate,c=s.maxDate,u=s.excludeDates,l=s.includeDates,d=ae(o,e);return{isDisabled:(n=(i||c||u||l)&&Pr(d,t.props))!==null&&n!==void 0?n:!1,labelDate:d}},t.isMonthDisabled=function(e){var n=t.isMonthDisabledForLabelDate(e).isDisabled;return n},t.getMonthClassNames=function(e){var n=t.props,s=n.day,o=n.startDate,i=n.endDate,c=n.preSelection,u=n.monthClassName,l=u?u(ae(s,e)):void 0,d=t.getSelection();return Z("react-datepicker__month-text","react-datepicker__month-".concat(e),l,{"react-datepicker__month-text--disabled":t.isMonthDisabled(e),"react-datepicker__month-text--selected":d?t.isSelectMonthInList(s,e,d):void 0,"react-datepicker__month-text--keyboard-selected":!t.props.disabledKeyboardNavigation&&c&&t.isSelectedMonth(s,e,c)&&!t.isMonthDisabled(e),"react-datepicker__month-text--in-selecting-range":t.isInSelectingRangeMonth(e),"react-datepicker__month-text--in-range":o&&i?mt(o,i,e,s):void 0,"react-datepicker__month-text--range-start":t.isRangeStartMonth(e),"react-datepicker__month-text--range-end":t.isRangeEndMonth(e),"react-datepicker__month-text--selecting-range-start":t.isSelectingMonthRangeStart(e),"react-datepicker__month-text--selecting-range-end":t.isSelectingMonthRangeEnd(e),"react-datepicker__month-text--today":t.isCurrentMonth(s,e)})},t.getTabIndex=function(e){if(t.props.preSelection==null)return"-1";var n=te(t.props.preSelection),s=t.isMonthDisabledForLabelDate(n).isDisabled,o=e===n&&!(s||t.props.disabledKeyboardNavigation)?"0":"-1";return o},t.getQuarterTabIndex=function(e){if(t.props.preSelection==null)return"-1";var n=Ye(t.props.preSelection),s=gt(t.props.day,t.props),o=e===n&&!(s||t.props.disabledKeyboardNavigation)?"0":"-1";return o},t.getAriaLabel=function(e){var n=t.props,s=n.chooseDayAriaLabelPrefix,o=s===void 0?"Choose":s,i=n.disabledDayAriaLabelPrefix,c=i===void 0?"Not available":i,u=n.day,l=n.locale,d=ae(u,e),f=t.isDisabled(d)||t.isExcluded(d)?c:o;return"".concat(f," ").concat(H(d,"MMMM yyyy",l))},t.getQuarterClassNames=function(e){var n=t.props,s=n.day,o=n.startDate,i=n.endDate,c=n.selected,u=n.minDate,l=n.maxDate,d=n.excludeDates,f=n.includeDates,p=n.filterDate,h=n.preSelection,g=n.disabledKeyboardNavigation,w=(u||l||d||f||p)&>($e(s,e),t.props);return Z("react-datepicker__quarter-text","react-datepicker__quarter-".concat(e),{"react-datepicker__quarter-text--disabled":w,"react-datepicker__quarter-text--selected":c?t.isSelectedQuarter(s,e,c):void 0,"react-datepicker__quarter-text--keyboard-selected":!g&&h&&t.isSelectedQuarter(s,e,h)&&!w,"react-datepicker__quarter-text--in-selecting-range":t.isInSelectingRangeQuarter(e),"react-datepicker__quarter-text--in-range":o&&i?Dt(o,i,e,s):void 0,"react-datepicker__quarter-text--range-start":t.isRangeStartQuarter(e),"react-datepicker__quarter-text--range-end":t.isRangeEndQuarter(e)})},t.getMonthContent=function(e){var n=t.props,s=n.showFullMonthYearPicker,o=n.renderMonthContent,i=n.locale,c=n.day,u=Cr(e,i),l=fn(e,i);return o?o(e,u,l,c):s?l:u},t.getQuarterContent=function(e){var n,s=t.props,o=s.renderQuarterContent,i=s.locale,c=Dc(e,i);return(n=o==null?void 0:o(e,c))!==null&&n!==void 0?n:c},t.renderMonths=function(){var e,n=t.props,s=n.showTwoColumnMonthYearPicker,o=n.showFourColumnMonthYearPicker,i=n.day,c=n.selected,u=(e=Xt[Gn(o,s)])===null||e===void 0?void 0:e.grid;return u==null?void 0:u.map(function(l,d){return m.createElement("div",{className:"react-datepicker__month-wrapper",key:d},l.map(function(f,p){return m.createElement("div",{ref:t.MONTH_REFS[f],key:p,onClick:function(h){t.onMonthClick(h,f)},onKeyDown:function(h){Er(h)&&(h.preventDefault(),h.key=D.Enter),t.onMonthKeyDown(h,f)},onMouseEnter:t.props.usePointerEvent?void 0:function(){return t.onMonthMouseEnter(f)},onPointerEnter:t.props.usePointerEvent?function(){return t.onMonthMouseEnter(f)}:void 0,tabIndex:Number(t.getTabIndex(f)),className:t.getMonthClassNames(f),"aria-disabled":t.isMonthDisabled(f),role:"option","aria-label":t.getAriaLabel(f),"aria-current":t.isCurrentMonth(i,f)?"date":void 0,"aria-selected":c?t.isSelectedMonth(i,f,c):void 0},t.getMonthContent(f))}))})},t.renderQuarters=function(){var e=t.props,n=e.day,s=e.selected,o=[1,2,3,4];return m.createElement("div",{className:"react-datepicker__quarter-wrapper"},o.map(function(i,c){return m.createElement("div",{key:c,ref:t.QUARTER_REFS[c],role:"option",onClick:function(u){t.onQuarterClick(u,i)},onKeyDown:function(u){t.onQuarterKeyDown(u,i)},onMouseEnter:t.props.usePointerEvent?void 0:function(){return t.onQuarterMouseEnter(i)},onPointerEnter:t.props.usePointerEvent?function(){return t.onQuarterMouseEnter(i)}:void 0,className:t.getQuarterClassNames(i),"aria-selected":s?t.isSelectedQuarter(n,i,s):void 0,tabIndex:Number(t.getQuarterTabIndex(i)),"aria-current":t.isCurrentQuarter(n,i)?"date":void 0},t.getQuarterContent(i))}))},t.getClassNames=function(){var e=t.props,n=e.selectingDate,s=e.selectsStart,o=e.selectsEnd,i=e.showMonthYearPicker,c=e.showQuarterYearPicker,u=e.showWeekPicker;return Z("react-datepicker__month",{"react-datepicker__month--selecting-range":n&&(s||o)},{"react-datepicker__monthPicker":i},{"react-datepicker__quarterPicker":c},{"react-datepicker__weekPicker":u})},t}return r.prototype.getSelection=function(){var t=this.props,e=t.selected,n=t.selectedDates,s=t.selectsMultiple;if(s)return n;if(e)return[e]},r.prototype.render=function(){var t=this.props,e=t.showMonthYearPicker,n=t.showQuarterYearPicker,s=t.day,o=t.ariaLabelPrefix,i=o===void 0?"Month ":o,c=i?i.trim()+" ":"";return m.createElement("div",{className:this.getClassNames(),onMouseLeave:this.props.usePointerEvent?void 0:this.handleMouseLeave,onPointerLeave:this.props.usePointerEvent?this.handleMouseLeave:void 0,"aria-label":"".concat(c).concat(H(s,"MMMM, yyyy",this.props.locale)),role:"listbox"},e?this.renderMonths():n?this.renderQuarters():this.renderWeeks())},r}(v.Component),Rc=function(a){z(r,a);function r(){var t=a!==null&&a.apply(this,arguments)||this;return t.isSelectedMonth=function(e){return t.props.month===e},t.renderOptions=function(){return t.props.monthNames.map(function(e,n){return m.createElement("div",{className:t.isSelectedMonth(n)?"react-datepicker__month-option react-datepicker__month-option--selected_month":"react-datepicker__month-option",key:e,onClick:t.onChange.bind(t,n),"aria-selected":t.isSelectedMonth(n)?"true":void 0},t.isSelectedMonth(n)?m.createElement("span",{className:"react-datepicker__month-option--selected"},"✓"):"",e)})},t.onChange=function(e){return t.props.onChange(e)},t.handleClickOutside=function(){return t.props.onCancel()},t}return r.prototype.render=function(){return m.createElement($t,{className:"react-datepicker__month-dropdown",onClickOutside:this.handleClickOutside},this.renderOptions())},r}(v.Component),Fc=function(a){z(r,a);function r(){var t=a!==null&&a.apply(this,arguments)||this;return t.state={dropdownVisible:!1},t.renderSelectOptions=function(e){return e.map(function(n,s){return m.createElement("option",{key:n,value:s},n)})},t.renderSelectMode=function(e){return m.createElement("select",{value:t.props.month,className:"react-datepicker__month-select",onChange:function(n){return t.onChange(parseInt(n.target.value))}},t.renderSelectOptions(e))},t.renderReadView=function(e,n){return m.createElement("div",{key:"read",style:{visibility:e?"visible":"hidden"},className:"react-datepicker__month-read-view",onClick:t.toggleDropdown},m.createElement("span",{className:"react-datepicker__month-read-view--down-arrow"}),m.createElement("span",{className:"react-datepicker__month-read-view--selected-month"},n[t.props.month]))},t.renderDropdown=function(e){return m.createElement(Rc,E({key:"dropdown"},t.props,{monthNames:e,onChange:t.onChange,onCancel:t.toggleDropdown}))},t.renderScrollMode=function(e){var n=t.state.dropdownVisible,s=[t.renderReadView(!n,e)];return n&&s.unshift(t.renderDropdown(e)),s},t.onChange=function(e){t.toggleDropdown(),e!==t.props.month&&t.props.onChange(e)},t.toggleDropdown=function(){return t.setState({dropdownVisible:!t.state.dropdownVisible})},t}return r.prototype.render=function(){var t=this,e=[0,1,2,3,4,5,6,7,8,9,10,11].map(this.props.useShortMonthInDropdown?function(s){return Cr(s,t.props.locale)}:function(s){return fn(s,t.props.locale)}),n;switch(this.props.dropdownMode){case"scroll":n=this.renderScrollMode(e);break;case"select":n=this.renderSelectMode(e);break}return m.createElement("div",{className:"react-datepicker__month-dropdown-container react-datepicker__month-dropdown-container--".concat(this.props.dropdownMode)},n)},r}(v.Component);function Lc(a,r){for(var t=[],e=ve(a),n=ve(r);!Pe(e,n);)t.push(R(e)),e=ue(e,1);return t}var Wc=function(a){z(r,a);function r(t){var e=a.call(this,t)||this;return e.renderOptions=function(){return e.state.monthYearsList.map(function(n){var s=tn(n),o=fe(e.props.date,n)&&ee(e.props.date,n);return m.createElement("div",{className:o?"react-datepicker__month-year-option--selected_month-year":"react-datepicker__month-year-option",key:s,onClick:e.onChange.bind(e,s),"aria-selected":o?"true":void 0},o?m.createElement("span",{className:"react-datepicker__month-year-option--selected"},"✓"):"",H(n,e.props.dateFormat,e.props.locale))})},e.onChange=function(n){return e.props.onChange(n)},e.handleClickOutside=function(){e.props.onCancel()},e.state={monthYearsList:Lc(e.props.minDate,e.props.maxDate)},e}return r.prototype.render=function(){var t=Z({"react-datepicker__month-year-dropdown":!0,"react-datepicker__month-year-dropdown--scrollable":this.props.scrollableMonthYearDropdown});return m.createElement($t,{className:t,onClickOutside:this.handleClickOutside},this.renderOptions())},r}(v.Component),Ac=function(a){z(r,a);function r(){var t=a!==null&&a.apply(this,arguments)||this;return t.state={dropdownVisible:!1},t.renderSelectOptions=function(){for(var e=ve(t.props.minDate),n=ve(t.props.maxDate),s=[];!Pe(e,n);){var o=tn(e);s.push(m.createElement("option",{key:o,value:o},H(e,t.props.dateFormat,t.props.locale))),e=ue(e,1)}return s},t.onSelectChange=function(e){t.onChange(parseInt(e.target.value))},t.renderSelectMode=function(){return m.createElement("select",{value:tn(ve(t.props.date)),className:"react-datepicker__month-year-select",onChange:t.onSelectChange},t.renderSelectOptions())},t.renderReadView=function(e){var n=H(t.props.date,t.props.dateFormat,t.props.locale);return m.createElement("div",{key:"read",style:{visibility:e?"visible":"hidden"},className:"react-datepicker__month-year-read-view",onClick:t.toggleDropdown},m.createElement("span",{className:"react-datepicker__month-year-read-view--down-arrow"}),m.createElement("span",{className:"react-datepicker__month-year-read-view--selected-month-year"},n))},t.renderDropdown=function(){return m.createElement(Wc,E({key:"dropdown"},t.props,{onChange:t.onChange,onCancel:t.toggleDropdown}))},t.renderScrollMode=function(){var e=t.state.dropdownVisible,n=[t.renderReadView(!e)];return e&&n.unshift(t.renderDropdown()),n},t.onChange=function(e){t.toggleDropdown();var n=R(e);fe(t.props.date,n)&&ee(t.props.date,n)||t.props.onChange(n)},t.toggleDropdown=function(){return t.setState({dropdownVisible:!t.state.dropdownVisible})},t}return r.prototype.render=function(){var t;switch(this.props.dropdownMode){case"scroll":t=this.renderScrollMode();break;case"select":t=this.renderSelectMode();break}return m.createElement("div",{className:"react-datepicker__month-year-dropdown-container react-datepicker__month-year-dropdown-container--".concat(this.props.dropdownMode)},t)},r}(v.Component),Hc=function(a){z(r,a);function r(){var t=a!==null&&a.apply(this,arguments)||this;return t.state={height:null},t.scrollToTheSelectedTime=function(){requestAnimationFrame(function(){var e,n,s;t.list&&(t.list.scrollTop=(s=t.centerLi&&r.calcCenterPosition(t.props.monthRef?t.props.monthRef.clientHeight-((n=(e=t.header)===null||e===void 0?void 0:e.clientHeight)!==null&&n!==void 0?n:0):t.list.clientHeight,t.centerLi))!==null&&s!==void 0?s:0)})},t.handleClick=function(e){var n,s;(t.props.minTime||t.props.maxTime)&&Hn(e,t.props)||(t.props.excludeTimes||t.props.includeTimes||t.props.filterTime)&&An(e,t.props)||(s=(n=t.props).onChange)===null||s===void 0||s.call(n,e)},t.isSelectedTime=function(e){return t.props.selected&&Pc(t.props.selected,e)},t.isDisabledTime=function(e){return(t.props.minTime||t.props.maxTime)&&Hn(e,t.props)||(t.props.excludeTimes||t.props.includeTimes||t.props.filterTime)&&An(e,t.props)},t.liClasses=function(e){var n,s=["react-datepicker__time-list-item",t.props.timeClassName?t.props.timeClassName(e):void 0];return t.isSelectedTime(e)&&s.push("react-datepicker__time-list-item--selected"),t.isDisabledTime(e)&&s.push("react-datepicker__time-list-item--disabled"),t.props.injectTimes&&(De(e)*3600+ye(e)*60+Se(e))%(((n=t.props.intervals)!==null&&n!==void 0?n:r.defaultProps.intervals)*60)!==0&&s.push("react-datepicker__time-list-item--injected"),s.join(" ")},t.handleOnKeyDown=function(e,n){var s,o;e.key===D.Space&&(e.preventDefault(),e.key=D.Enter),(e.key===D.ArrowUp||e.key===D.ArrowLeft)&&e.target instanceof HTMLElement&&e.target.previousSibling&&(e.preventDefault(),e.target.previousSibling instanceof HTMLElement&&e.target.previousSibling.focus()),(e.key===D.ArrowDown||e.key===D.ArrowRight)&&e.target instanceof HTMLElement&&e.target.nextSibling&&(e.preventDefault(),e.target.nextSibling instanceof HTMLElement&&e.target.nextSibling.focus()),e.key===D.Enter&&t.handleClick(n),(o=(s=t.props).handleOnKeyDown)===null||o===void 0||o.call(s,e)},t.renderTimes=function(){for(var e,n=[],s=typeof t.props.format=="string"?t.props.format:"p",o=(e=t.props.intervals)!==null&&e!==void 0?e:r.defaultProps.intervals,i=t.props.selected||t.props.openToDate||R(),c=_t(i),u=t.props.injectTimes&&t.props.injectTimes.sort(function(w,k){return w.getTime()-k.getTime()}),l=60*Cc(i),d=l/o,f=0;f=f?e.updateFocusOnPaginate(Math.abs(f-(n-p))):(u=(c=e.YEAR_REFS[n-p])===null||c===void 0?void 0:c.current)===null||u===void 0||u.focus())}},e.isSameDay=function(n,s){return O(n,s)},e.isCurrentYear=function(n){return n===P(R())},e.isRangeStart=function(n){return e.props.startDate&&e.props.endDate&&fe(de(R(),n),e.props.startDate)},e.isRangeEnd=function(n){return e.props.startDate&&e.props.endDate&&fe(de(R(),n),e.props.endDate)},e.isInRange=function(n){return wt(n,e.props.startDate,e.props.endDate)},e.isInSelectingRange=function(n){var s=e.props,o=s.selectsStart,i=s.selectsEnd,c=s.selectsRange,u=s.startDate,l=s.endDate;return!(o||i||c)||!e.selectingDate()?!1:o&&l?wt(n,e.selectingDate(),l):i&&u||c&&u&&!l?wt(n,u,e.selectingDate()):!1},e.isSelectingRangeStart=function(n){var s;if(!e.isInSelectingRange(n))return!1;var o=e.props,i=o.startDate,c=o.selectsStart,u=de(R(),n);return c?fe(u,(s=e.selectingDate())!==null&&s!==void 0?s:null):fe(u,i??null)},e.isSelectingRangeEnd=function(n){var s;if(!e.isInSelectingRange(n))return!1;var o=e.props,i=o.endDate,c=o.selectsEnd,u=o.selectsRange,l=de(R(),n);return c||u?fe(l,(s=e.selectingDate())!==null&&s!==void 0?s:null):fe(l,i??null)},e.isKeyboardSelected=function(n){if(!(e.props.date===void 0||e.props.selected==null||e.props.preSelection==null)){var s=e.props,o=s.minDate,i=s.maxDate,c=s.excludeDates,u=s.includeDates,l=s.filterDate,d=st(de(e.props.date,n)),f=(o||i||c||u||l)&&Mt(n,e.props);return!e.props.disabledKeyboardNavigation&&!e.props.inline&&!O(d,st(e.props.selected))&&O(d,st(e.props.preSelection))&&!f}},e.onYearClick=function(n,s){var o=e.props.date;o!==void 0&&e.handleYearClick(st(de(o,s)),n)},e.onYearKeyDown=function(n,s){var o,i,c=n.key,u=e.props,l=u.date,d=u.yearItemNumber,f=u.handleOnKeyDown;if(c!==D.Tab&&n.preventDefault(),!e.props.disabledKeyboardNavigation)switch(c){case D.Enter:if(e.props.selected==null)break;e.onYearClick(n,s),(i=(o=e.props).setPreSelection)===null||i===void 0||i.call(o,e.props.selected);break;case D.ArrowRight:if(e.props.preSelection==null)break;e.handleYearNavigation(s+1,ge(e.props.preSelection,1));break;case D.ArrowLeft:if(e.props.preSelection==null)break;e.handleYearNavigation(s-1,Ue(e.props.preSelection,1));break;case D.ArrowUp:{if(l===void 0||d===void 0||e.props.preSelection==null)break;var p=xe(l,d).startPeriod,h=zn,g=s-h;if(g=p&&sk){var w=d%h;s<=k&&s>k-w?h=w:h+=w,g=s+h}e.handleYearNavigation(g,ge(e.props.preSelection,h));break}}f&&f(n)},e.getYearClassNames=function(n){var s=e.props,o=s.date,i=s.minDate,c=s.maxDate,u=s.selected,l=s.excludeDates,d=s.includeDates,f=s.filterDate,p=s.yearClassName;return Z("react-datepicker__year-text","react-datepicker__year-".concat(n),o?p==null?void 0:p(de(o,n)):void 0,{"react-datepicker__year-text--selected":u?n===P(u):void 0,"react-datepicker__year-text--disabled":(i||c||l||d||f)&&Mt(n,e.props),"react-datepicker__year-text--keyboard-selected":e.isKeyboardSelected(n),"react-datepicker__year-text--range-start":e.isRangeStart(n),"react-datepicker__year-text--range-end":e.isRangeEnd(n),"react-datepicker__year-text--in-range":e.isInRange(n),"react-datepicker__year-text--in-selecting-range":e.isInSelectingRange(n),"react-datepicker__year-text--selecting-range-start":e.isSelectingRangeStart(n),"react-datepicker__year-text--selecting-range-end":e.isSelectingRangeEnd(n),"react-datepicker__year-text--today":e.isCurrentYear(n)})},e.getYearTabIndex=function(n){if(e.props.disabledKeyboardNavigation||e.props.preSelection==null)return"-1";var s=P(e.props.preSelection),o=Mt(n,e.props);return n===s&&!o?"0":"-1"},e.getYearContent=function(n){return e.props.renderYearContent?e.props.renderYearContent(n):n},e}return r.prototype.render=function(){var t=this,e=[],n=this.props,s=n.date,o=n.yearItemNumber,i=n.onYearMouseEnter,c=n.onYearMouseLeave;if(s===void 0)return null;for(var u=xe(s,o),l=u.startPeriod,d=u.endPeriod,f=function(g){e.push(m.createElement("div",{ref:p.YEAR_REFS[g-l],onClick:function(w){t.onYearClick(w,g)},onKeyDown:function(w){Er(w)&&(w.preventDefault(),w.key=D.Enter),t.onYearKeyDown(w,g)},tabIndex:Number(p.getYearTabIndex(g)),className:p.getYearClassNames(g),onMouseEnter:p.props.usePointerEvent?void 0:function(w){return i(w,g)},onPointerEnter:p.props.usePointerEvent?function(w){return i(w,g)}:void 0,onMouseLeave:p.props.usePointerEvent?void 0:function(w){return c(w,g)},onPointerLeave:p.props.usePointerEvent?function(w){return c(w,g)}:void 0,key:g,"aria-current":p.isCurrentYear(g)?"date":void 0},p.getYearContent(g)))},p=this,h=l;h<=d;h++)f(h);return m.createElement("div",{className:"react-datepicker__year"},m.createElement("div",{className:"react-datepicker__year-wrapper",onMouseLeave:this.props.usePointerEvent?void 0:this.props.clearSelectingDate,onPointerLeave:this.props.usePointerEvent?this.props.clearSelectingDate:void 0},e))},r}(v.Component);function Qc(a,r,t,e){for(var n=[],s=0;s<2*r+1;s++){var o=a+r-s,i=!0;t&&(i=P(t)<=o),e&&i&&(i=P(e)>=o),i&&n.push(o)}return n}var Bc=function(a){z(r,a);function r(t){var e=a.call(this,t)||this;e.renderOptions=function(){var i=e.props.year,c=e.state.yearsList.map(function(d){return m.createElement("div",{className:i===d?"react-datepicker__year-option react-datepicker__year-option--selected_year":"react-datepicker__year-option",key:d,onClick:e.onChange.bind(e,d),"aria-selected":i===d?"true":void 0},i===d?m.createElement("span",{className:"react-datepicker__year-option--selected"},"✓"):"",d)}),u=e.props.minDate?P(e.props.minDate):null,l=e.props.maxDate?P(e.props.maxDate):null;return(!l||!e.state.yearsList.find(function(d){return d===l}))&&c.unshift(m.createElement("div",{className:"react-datepicker__year-option",key:"upcoming",onClick:e.incrementYears},m.createElement("a",{className:"react-datepicker__navigation react-datepicker__navigation--years react-datepicker__navigation--years-upcoming"}))),(!u||!e.state.yearsList.find(function(d){return d===u}))&&c.push(m.createElement("div",{className:"react-datepicker__year-option",key:"previous",onClick:e.decrementYears},m.createElement("a",{className:"react-datepicker__navigation react-datepicker__navigation--years react-datepicker__navigation--years-previous"}))),c},e.onChange=function(i){e.props.onChange(i)},e.handleClickOutside=function(){e.props.onCancel()},e.shiftYears=function(i){var c=e.state.yearsList.map(function(u){return u+i});e.setState({yearsList:c})},e.incrementYears=function(){return e.shiftYears(1)},e.decrementYears=function(){return e.shiftYears(-1)};var n=t.yearDropdownItemNumber,s=t.scrollableYearDropdown,o=n||(s?10:5);return e.state={yearsList:Qc(e.props.year,o,e.props.minDate,e.props.maxDate)},e.dropdownRef=v.createRef(),e}return r.prototype.componentDidMount=function(){var t=this.dropdownRef.current;if(t){var e=t.children?Array.from(t.children):null,n=e?e.find(function(s){return s.ariaSelected}):null;t.scrollTop=n&&n instanceof HTMLElement?n.offsetTop+(n.clientHeight-t.clientHeight)/2:(t.scrollHeight-t.clientHeight)/2}},r.prototype.render=function(){var t=Z({"react-datepicker__year-dropdown":!0,"react-datepicker__year-dropdown--scrollable":this.props.scrollableYearDropdown});return m.createElement($t,{className:t,containerRef:this.dropdownRef,onClickOutside:this.handleClickOutside},this.renderOptions())},r}(v.Component),qc=function(a){z(r,a);function r(){var t=a!==null&&a.apply(this,arguments)||this;return t.state={dropdownVisible:!1},t.renderSelectOptions=function(){for(var e=t.props.minDate?P(t.props.minDate):1900,n=t.props.maxDate?P(t.props.maxDate):2100,s=[],o=e;o<=n;o++)s.push(m.createElement("option",{key:o,value:o},o));return s},t.onSelectChange=function(e){t.onChange(parseInt(e.target.value))},t.renderSelectMode=function(){return m.createElement("select",{value:t.props.year,className:"react-datepicker__year-select",onChange:t.onSelectChange},t.renderSelectOptions())},t.renderReadView=function(e){return m.createElement("div",{key:"read",style:{visibility:e?"visible":"hidden"},className:"react-datepicker__year-read-view",onClick:function(n){return t.toggleDropdown(n)}},m.createElement("span",{className:"react-datepicker__year-read-view--down-arrow"}),m.createElement("span",{className:"react-datepicker__year-read-view--selected-year"},t.props.year))},t.renderDropdown=function(){return m.createElement(Bc,E({key:"dropdown"},t.props,{onChange:t.onChange,onCancel:t.toggleDropdown}))},t.renderScrollMode=function(){var e=t.state.dropdownVisible,n=[t.renderReadView(!e)];return e&&n.unshift(t.renderDropdown()),n},t.onChange=function(e){t.toggleDropdown(),e!==t.props.year&&t.props.onChange(e)},t.toggleDropdown=function(e){t.setState({dropdownVisible:!t.state.dropdownVisible},function(){t.props.adjustDateOnChange&&t.handleYearChange(t.props.date,e)})},t.handleYearChange=function(e,n){var s;(s=t.onSelect)===null||s===void 0||s.call(t,e,n),t.setOpen()},t.onSelect=function(e,n){var s,o;(o=(s=t.props).onSelect)===null||o===void 0||o.call(s,e,n)},t.setOpen=function(){var e,n;(n=(e=t.props).setOpen)===null||n===void 0||n.call(e,!0)},t}return r.prototype.render=function(){var t;switch(this.props.dropdownMode){case"scroll":t=this.renderScrollMode();break;case"select":t=this.renderSelectMode();break}return m.createElement("div",{className:"react-datepicker__year-dropdown-container react-datepicker__year-dropdown-container--".concat(this.props.dropdownMode)},t)},r}(v.Component),Kc=["react-datepicker__year-select","react-datepicker__month-select","react-datepicker__month-year-select"],Vc=function(a){var r=(a.className||"").split(/\s+/);return Kc.some(function(t){return r.indexOf(t)>=0})},Uc=function(a){z(r,a);function r(t){var e=a.call(this,t)||this;return e.monthContainer=void 0,e.handleClickOutside=function(n){e.props.onClickOutside(n)},e.setClickOutsideRef=function(){return e.containerRef.current},e.handleDropdownFocus=function(n){var s,o;Vc(n.target)&&((o=(s=e.props).onDropdownFocus)===null||o===void 0||o.call(s,n))},e.getDateInView=function(){var n=e.props,s=n.preSelection,o=n.selected,i=n.openToDate,c=Tr(e.props),u=Or(e.props),l=R(),d=i||o||s;return d||(c&&Fe(l,c)?c:u&&Pe(l,u)?u:l)},e.increaseMonth=function(){e.setState(function(n){var s=n.date;return{date:ue(s,1)}},function(){return e.handleMonthChange(e.state.date)})},e.decreaseMonth=function(){e.setState(function(n){var s=n.date;return{date:Ie(s,1)}},function(){return e.handleMonthChange(e.state.date)})},e.handleDayClick=function(n,s,o){e.props.onSelect(n,s,o),e.props.setPreSelection&&e.props.setPreSelection(n)},e.handleDayMouseEnter=function(n){e.setState({selectingDate:n}),e.props.onDayMouseEnter&&e.props.onDayMouseEnter(n)},e.handleMonthMouseLeave=function(){e.setState({selectingDate:void 0}),e.props.onMonthMouseLeave&&e.props.onMonthMouseLeave()},e.handleYearMouseEnter=function(n,s){e.setState({selectingDate:de(R(),s)}),e.props.onYearMouseEnter&&e.props.onYearMouseEnter(n,s)},e.handleYearMouseLeave=function(n,s){e.props.onYearMouseLeave&&e.props.onYearMouseLeave(n,s)},e.handleYearChange=function(n){var s,o,i,c;(o=(s=e.props).onYearChange)===null||o===void 0||o.call(s,n),e.setState({isRenderAriaLiveMessage:!0}),e.props.adjustDateOnChange&&(e.props.onSelect(n),(c=(i=e.props).setOpen)===null||c===void 0||c.call(i,!0)),e.props.setPreSelection&&e.props.setPreSelection(n)},e.getEnabledPreSelectionDateForMonth=function(n){if(!se(n,e.props))return n;for(var s=ve(n),o=hc(n),i=Ts(o,s),c=null,u=0;u<=i;u++){var l=ce(s,u);if(!se(l,e.props)){c=l;break}}return c},e.handleMonthChange=function(n){var s,o,i,c=(s=e.getEnabledPreSelectionDateForMonth(n))!==null&&s!==void 0?s:n;e.handleCustomMonthChange(c),e.props.adjustDateOnChange&&(e.props.onSelect(c),(i=(o=e.props).setOpen)===null||i===void 0||i.call(o,!0)),e.props.setPreSelection&&e.props.setPreSelection(c)},e.handleCustomMonthChange=function(n){var s,o;(o=(s=e.props).onMonthChange)===null||o===void 0||o.call(s,n),e.setState({isRenderAriaLiveMessage:!0})},e.handleMonthYearChange=function(n){e.handleYearChange(n),e.handleMonthChange(n)},e.changeYear=function(n){e.setState(function(s){var o=s.date;return{date:de(o,Number(n))}},function(){return e.handleYearChange(e.state.date)})},e.changeMonth=function(n){e.setState(function(s){var o=s.date;return{date:ae(o,Number(n))}},function(){return e.handleMonthChange(e.state.date)})},e.changeMonthYear=function(n){e.setState(function(s){var o=s.date;return{date:de(ae(o,te(n)),P(n))}},function(){return e.handleMonthYearChange(e.state.date)})},e.header=function(n){n===void 0&&(n=e.state.date);var s=Ce(n,e.props.locale,e.props.calendarStartDay),o=[];return e.props.showWeekNumbers&&o.push(m.createElement("div",{key:"W",className:"react-datepicker__day-name"},e.props.weekLabel||"#")),o.concat([0,1,2,3,4,5,6].map(function(i){var c=ce(s,i),u=e.formatWeekday(c,e.props.locale),l=e.props.weekDayClassName?e.props.weekDayClassName(c):void 0;return m.createElement("div",{key:i,"aria-label":H(c,"EEEE",e.props.locale),className:Z("react-datepicker__day-name",l)},u)}))},e.formatWeekday=function(n,s){return e.props.formatWeekDay?mc(n,e.props.formatWeekDay,s):e.props.useWeekdaysShort?wc(n,s):gc(n,s)},e.decreaseYear=function(){e.setState(function(n){var s,o=n.date;return{date:Ue(o,e.props.showYearPicker?(s=e.props.yearItemNumber)!==null&&s!==void 0?s:r.defaultProps.yearItemNumber:1)}},function(){return e.handleYearChange(e.state.date)})},e.clearSelectingDate=function(){e.setState({selectingDate:void 0})},e.renderPreviousButton=function(){var n,s,o;if(!e.props.renderCustomHeader){var i=(n=e.props.monthsShown)!==null&&n!==void 0?n:r.defaultProps.monthsShown,c=e.props.showPreviousMonths?i-1:0,u=(s=e.props.monthSelectedIn)!==null&&s!==void 0?s:c,l=Ie(e.state.date,u),d;switch(!0){case e.props.showMonthYearPicker:d=Bn(e.state.date,e.props);break;case e.props.showYearPicker:d=kc(e.state.date,e.props);break;case e.props.showQuarterYearPicker:d=vc(e.state.date,e.props);break;default:d=$n(l,e.props);break}if(!(!((o=e.props.forceShowMonthNavigation)!==null&&o!==void 0?o:r.defaultProps.forceShowMonthNavigation)&&!e.props.showDisabledMonthNavigation&&d||e.props.showTimeSelectOnly)){var f=["react-datepicker__navigation-icon","react-datepicker__navigation-icon--previous"],p=["react-datepicker__navigation","react-datepicker__navigation--previous"],h=e.decreaseMonth;(e.props.showMonthYearPicker||e.props.showQuarterYearPicker||e.props.showYearPicker)&&(h=e.decreaseYear),d&&e.props.showDisabledMonthNavigation&&(p.push("react-datepicker__navigation--previous--disabled"),h=void 0);var g=e.props.showMonthYearPicker||e.props.showQuarterYearPicker||e.props.showYearPicker,w=e.props,k=w.previousMonthButtonLabel,S=k===void 0?r.defaultProps.previousMonthButtonLabel:k,x=w.previousYearButtonLabel,N=x===void 0?r.defaultProps.previousYearButtonLabel:x,q=e.props,$=q.previousMonthAriaLabel,I=$===void 0?typeof S=="string"?S:"Previous Month":$,_=q.previousYearAriaLabel,M=_===void 0?typeof N=="string"?N:"Previous Year":_;return m.createElement("button",{type:"button",className:p.join(" "),onClick:h,onKeyDown:e.props.handleOnKeyDown,"aria-label":g?M:I},m.createElement("span",{className:f.join(" ")},g?N:S))}}},e.increaseYear=function(){e.setState(function(n){var s,o=n.date;return{date:ge(o,e.props.showYearPicker?(s=e.props.yearItemNumber)!==null&&s!==void 0?s:r.defaultProps.yearItemNumber:1)}},function(){return e.handleYearChange(e.state.date)})},e.renderNextButton=function(){var n;if(!e.props.renderCustomHeader){var s;switch(!0){case e.props.showMonthYearPicker:s=qn(e.state.date,e.props);break;case e.props.showYearPicker:s=_c(e.state.date,e.props);break;case e.props.showQuarterYearPicker:s=bc(e.state.date,e.props);break;default:s=Qn(e.state.date,e.props);break}if(!(!((n=e.props.forceShowMonthNavigation)!==null&&n!==void 0?n:r.defaultProps.forceShowMonthNavigation)&&!e.props.showDisabledMonthNavigation&&s||e.props.showTimeSelectOnly)){var o=["react-datepicker__navigation","react-datepicker__navigation--next"],i=["react-datepicker__navigation-icon","react-datepicker__navigation-icon--next"];e.props.showTimeSelect&&o.push("react-datepicker__navigation--next--with-time"),e.props.todayButton&&o.push("react-datepicker__navigation--next--with-today-button");var c=e.increaseMonth;(e.props.showMonthYearPicker||e.props.showQuarterYearPicker||e.props.showYearPicker)&&(c=e.increaseYear),s&&e.props.showDisabledMonthNavigation&&(o.push("react-datepicker__navigation--next--disabled"),c=void 0);var u=e.props.showMonthYearPicker||e.props.showQuarterYearPicker||e.props.showYearPicker,l=e.props,d=l.nextMonthButtonLabel,f=d===void 0?r.defaultProps.nextMonthButtonLabel:d,p=l.nextYearButtonLabel,h=p===void 0?r.defaultProps.nextYearButtonLabel:p,g=e.props,w=g.nextMonthAriaLabel,k=w===void 0?typeof f=="string"?f:"Next Month":w,S=g.nextYearAriaLabel,x=S===void 0?typeof h=="string"?h:"Next Year":S;return m.createElement("button",{type:"button",className:o.join(" "),onClick:c,onKeyDown:e.props.handleOnKeyDown,"aria-label":u?x:k},m.createElement("span",{className:i.join(" ")},u?h:f))}}},e.renderCurrentMonth=function(n){n===void 0&&(n=e.state.date);var s=["react-datepicker__current-month"];return e.props.showYearDropdown&&s.push("react-datepicker__current-month--hasYearDropdown"),e.props.showMonthDropdown&&s.push("react-datepicker__current-month--hasMonthDropdown"),e.props.showMonthYearDropdown&&s.push("react-datepicker__current-month--hasMonthYearDropdown"),m.createElement("h2",{className:s.join(" ")},H(n,e.props.dateFormat,e.props.locale))},e.renderYearDropdown=function(n){if(n===void 0&&(n=!1),!(!e.props.showYearDropdown||n))return m.createElement(qc,E({},r.defaultProps,e.props,{date:e.state.date,onChange:e.changeYear,year:P(e.state.date)}))},e.renderMonthDropdown=function(n){if(n===void 0&&(n=!1),!(!e.props.showMonthDropdown||n))return m.createElement(Fc,E({},r.defaultProps,e.props,{month:te(e.state.date),onChange:e.changeMonth}))},e.renderMonthYearDropdown=function(n){if(n===void 0&&(n=!1),!(!e.props.showMonthYearDropdown||n))return m.createElement(Ac,E({},r.defaultProps,e.props,{date:e.state.date,onChange:e.changeMonthYear}))},e.handleTodayButtonClick=function(n){e.props.onSelect(Fn(),n),e.props.setPreSelection&&e.props.setPreSelection(Fn())},e.renderTodayButton=function(){if(!(!e.props.todayButton||e.props.showTimeSelectOnly))return m.createElement("div",{className:"react-datepicker__today-button",onClick:e.handleTodayButtonClick},e.props.todayButton)},e.renderDefaultHeader=function(n){var s=n.monthDate,o=n.i;return m.createElement("div",{className:"react-datepicker__header ".concat(e.props.showTimeSelect?"react-datepicker__header--has-time-select":"")},e.renderCurrentMonth(s),m.createElement("div",{className:"react-datepicker__header__dropdown react-datepicker__header__dropdown--".concat(e.props.dropdownMode),onFocus:e.handleDropdownFocus},e.renderMonthDropdown(o!==0),e.renderMonthYearDropdown(o!==0),e.renderYearDropdown(o!==0)),m.createElement("div",{className:"react-datepicker__day-names"},e.header(s)))},e.renderCustomHeader=function(n){var s,o,i=n.monthDate,c=n.i;if(e.props.showTimeSelect&&!e.state.monthContainer||e.props.showTimeSelectOnly)return null;var u=$n(e.state.date,e.props),l=Qn(e.state.date,e.props),d=Bn(e.state.date,e.props),f=qn(e.state.date,e.props),p=!e.props.showMonthYearPicker&&!e.props.showQuarterYearPicker&&!e.props.showYearPicker;return m.createElement("div",{className:"react-datepicker__header react-datepicker__header--custom",onFocus:e.props.onDropdownFocus},(o=(s=e.props).renderCustomHeader)===null||o===void 0?void 0:o.call(s,E(E({},e.state),{customHeaderCount:c,monthDate:i,changeMonth:e.changeMonth,changeYear:e.changeYear,decreaseMonth:e.decreaseMonth,increaseMonth:e.increaseMonth,decreaseYear:e.decreaseYear,increaseYear:e.increaseYear,prevMonthButtonDisabled:u,nextMonthButtonDisabled:l,prevYearButtonDisabled:d,nextYearButtonDisabled:f})),p&&m.createElement("div",{className:"react-datepicker__day-names"},e.header(i)))},e.renderYearHeader=function(n){var s=n.monthDate,o=e.props,i=o.showYearPicker,c=o.yearItemNumber,u=c===void 0?r.defaultProps.yearItemNumber:c,l=xe(s,u),d=l.startPeriod,f=l.endPeriod;return m.createElement("div",{className:"react-datepicker__header react-datepicker-year-header"},i?"".concat(d," - ").concat(f):P(s))},e.renderHeader=function(n){var s=n.monthDate,o=n.i,i=o===void 0?0:o,c={monthDate:s,i};switch(!0){case e.props.renderCustomHeader!==void 0:return e.renderCustomHeader(c);case(e.props.showMonthYearPicker||e.props.showQuarterYearPicker||e.props.showYearPicker):return e.renderYearHeader(c);default:return e.renderDefaultHeader(c)}},e.renderMonths=function(){var n,s;if(!(e.props.showTimeSelectOnly||e.props.showYearPicker)){for(var o=[],i=(n=e.props.monthsShown)!==null&&n!==void 0?n:r.defaultProps.monthsShown,c=e.props.showPreviousMonths?i-1:0,u=e.props.showMonthYearPicker||e.props.showQuarterYearPicker?ge(e.state.date,c):Ie(e.state.date,c),l=(s=e.props.monthSelectedIn)!==null&&s!==void 0?s:c,d=0;d0;o.push(m.createElement("div",{key:h,ref:function(k){e.monthContainer=k??void 0},className:"react-datepicker__month-container"},e.renderHeader({monthDate:p,i:d}),m.createElement(Ic,E({},r.defaultProps,e.props,{ariaLabelPrefix:e.props.monthAriaLabelPrefix,day:p,onDayClick:e.handleDayClick,handleOnKeyDown:e.props.handleOnDayKeyDown,handleOnMonthKeyDown:e.props.handleOnKeyDown,onDayMouseEnter:e.handleDayMouseEnter,onMouseLeave:e.handleMonthMouseLeave,orderInDisplay:d,selectingDate:e.state.selectingDate,monthShowsDuplicateDaysEnd:g,monthShowsDuplicateDaysStart:w}))))}return o}},e.renderYears=function(){if(!e.props.showTimeSelectOnly&&e.props.showYearPicker)return m.createElement("div",{className:"react-datepicker__year--container"},e.renderHeader({monthDate:e.state.date}),m.createElement($c,E({},r.defaultProps,e.props,{selectingDate:e.state.selectingDate,date:e.state.date,onDayClick:e.handleDayClick,clearSelectingDate:e.clearSelectingDate,onYearMouseEnter:e.handleYearMouseEnter,onYearMouseLeave:e.handleYearMouseLeave})))},e.renderTimeSection=function(){if(e.props.showTimeSelect&&(e.state.monthContainer||e.props.showTimeSelectOnly))return m.createElement(Hc,E({},r.defaultProps,e.props,{onChange:e.props.onTimeChange,format:e.props.timeFormat,intervals:e.props.timeIntervals,monthRef:e.state.monthContainer}))},e.renderInputTimeSection=function(){var n=e.props.selected?new Date(e.props.selected):void 0,s=n&&Qt(n)&&!!e.props.selected,o=s?"".concat(Vn(n.getHours()),":").concat(Vn(n.getMinutes())):"";if(e.props.showTimeInput)return m.createElement(Tc,E({},r.defaultProps,e.props,{date:n,timeString:o,onChange:e.props.onTimeChange}))},e.renderAriaLiveRegion=function(){var n,s=xe(e.state.date,(n=e.props.yearItemNumber)!==null&&n!==void 0?n:r.defaultProps.yearItemNumber),o=s.startPeriod,i=s.endPeriod,c;return e.props.showYearPicker?c="".concat(o," - ").concat(i):e.props.showMonthYearPicker||e.props.showQuarterYearPicker?c=P(e.state.date):c="".concat(fn(te(e.state.date),e.props.locale)," ").concat(P(e.state.date)),m.createElement("span",{role:"alert","aria-live":"polite",className:"react-datepicker__aria-live"},e.state.isRenderAriaLiveMessage&&c)},e.renderChildren=function(){if(e.props.children)return m.createElement("div",{className:"react-datepicker__children-container"},e.props.children)},e.containerRef=v.createRef(),e.state={date:e.getDateInView(),selectingDate:void 0,monthContainer:void 0,isRenderAriaLiveMessage:!1},e}return Object.defineProperty(r,"defaultProps",{get:function(){return{monthsShown:1,forceShowMonthNavigation:!1,timeCaption:"Time",previousYearButtonLabel:"Previous Year",nextYearButtonLabel:"Next Year",previousMonthButtonLabel:"Previous Month",nextMonthButtonLabel:"Next Month",yearItemNumber:lt}},enumerable:!1,configurable:!0}),r.prototype.componentDidMount=function(){var t=this;this.props.showTimeSelect&&(this.assignMonthContainer=function(){t.setState({monthContainer:t.monthContainer})}())},r.prototype.componentDidUpdate=function(t){var e=this;if(this.props.preSelection&&(!O(this.props.preSelection,t.preSelection)||this.props.monthSelectedIn!==t.monthSelectedIn)){var n=!ee(this.state.date,this.props.preSelection);this.setState({date:this.props.preSelection},function(){return n&&e.handleCustomMonthChange(e.state.date)})}else this.props.openToDate&&!O(this.props.openToDate,t.openToDate)&&this.setState({date:this.props.openToDate})},r.prototype.render=function(){var t=this.props.container||ic;return m.createElement($t,{onClickOutside:this.handleClickOutside,style:{display:"contents"},containerRef:this.containerRef,ignoreClass:this.props.outsideClickIgnoreClass},m.createElement(t,{className:Z("react-datepicker",this.props.className,{"react-datepicker--time-only":this.props.showTimeSelectOnly}),showTime:this.props.showTimeSelect||this.props.showTimeInput,showTimeSelectOnly:this.props.showTimeSelectOnly},this.renderAriaLiveRegion(),this.renderPreviousButton(),this.renderNextButton(),this.renderMonths(),this.renderYears(),this.renderTodayButton(),this.renderTimeSection(),this.renderInputTimeSection(),this.renderChildren()))},r}(v.Component),jc=function(a){var r=a.icon,t=a.className,e=t===void 0?"":t,n=a.onClick,s="react-datepicker__calendar-icon";if(typeof r=="string")return m.createElement("i",{className:"".concat(s," ").concat(r," ").concat(e),"aria-hidden":"true",onClick:n});if(m.isValidElement(r)){var o=r;return m.cloneElement(o,{className:"".concat(o.props.className||""," ").concat(s," ").concat(e),onClick:function(i){typeof o.props.onClick=="function"&&o.props.onClick(i),typeof n=="function"&&n(i)}})}return m.createElement("svg",{className:"".concat(s," ").concat(e),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512",onClick:n},m.createElement("path",{d:"M96 32V64H48C21.5 64 0 85.5 0 112v48H448V112c0-26.5-21.5-48-48-48H352V32c0-17.7-14.3-32-32-32s-32 14.3-32 32V64H160V32c0-17.7-14.3-32-32-32S96 14.3 96 32zM448 192H0V464c0 26.5 21.5 48 48 48H400c26.5 0 48-21.5 48-48V192z"}))},Nr=function(a){z(r,a);function r(t){var e=a.call(this,t)||this;return e.portalRoot=null,e.el=document.createElement("div"),e}return r.prototype.componentDidMount=function(){this.portalRoot=(this.props.portalHost||document).getElementById(this.props.portalId),this.portalRoot||(this.portalRoot=document.createElement("div"),this.portalRoot.setAttribute("id",this.props.portalId),(this.props.portalHost||document.body).appendChild(this.portalRoot)),this.portalRoot.appendChild(this.el)},r.prototype.componentWillUnmount=function(){this.portalRoot&&this.portalRoot.removeChild(this.el)},r.prototype.render=function(){return Lr.createPortal(this.props.children,this.el)},r}(v.Component),Xc="[tabindex], a, button, input, select, textarea",Gc=function(a){return(a instanceof HTMLAnchorElement||!a.disabled)&&a.tabIndex!==-1},Yr=function(a){z(r,a);function r(t){var e=a.call(this,t)||this;return e.getTabChildren=function(){var n;return Array.prototype.slice.call((n=e.tabLoopRef.current)===null||n===void 0?void 0:n.querySelectorAll(Xc),1,-1).filter(Gc)},e.handleFocusStart=function(){var n=e.getTabChildren();n&&n.length>1&&n[n.length-1].focus()},e.handleFocusEnd=function(){var n=e.getTabChildren();n&&n.length>1&&n[0].focus()},e.tabLoopRef=v.createRef(),e}return r.prototype.render=function(){var t;return((t=this.props.enableTabLoop)!==null&&t!==void 0?t:r.defaultProps.enableTabLoop)?m.createElement("div",{className:"react-datepicker__tab-loop",ref:this.tabLoopRef},m.createElement("div",{className:"react-datepicker__tab-loop__start",tabIndex:0,onFocus:this.handleFocusStart}),this.props.children,m.createElement("div",{className:"react-datepicker__tab-loop__end",tabIndex:0,onFocus:this.handleFocusEnd})):this.props.children},r.defaultProps={enableTabLoop:!0},r}(v.Component);function zc(a){var r=function(t){var e,n=typeof t.hidePopper=="boolean"?t.hidePopper:!0,s=v.useRef(null),o=oc(E({open:!n,whileElementsMounted:Hr,placement:t.popperPlacement,middleware:me([$r({padding:15}),Qr(10),Br({element:s})],(e=t.popperModifiers)!==null&&e!==void 0?e:[],!0)},t.popperProps)),i=E(E({},t),{hidePopper:n,popperProps:E(E({},o),{arrowRef:s})});return m.createElement(a,E({},i))};return r}var Zc=function(a){z(r,a);function r(){return a!==null&&a.apply(this,arguments)||this}return Object.defineProperty(r,"defaultProps",{get:function(){return{hidePopper:!0}},enumerable:!1,configurable:!0}),r.prototype.render=function(){var t=this.props,e=t.className,n=t.wrapperClassName,s=t.hidePopper,o=s===void 0?r.defaultProps.hidePopper:s,i=t.popperComponent,c=t.targetComponent,u=t.enableTabLoop,l=t.popperOnKeyDown,d=t.portalId,f=t.portalHost,p=t.popperProps,h=t.showArrow,g=void 0;if(!o){var w=Z("react-datepicker-popper",e);g=m.createElement(Yr,{enableTabLoop:u},m.createElement("div",{ref:p.refs.setFloating,style:p.floatingStyles,className:w,"data-placement":p.placement,onKeyDown:l},i,h&&m.createElement(Ji,{ref:p.arrowRef,context:p.context,fill:"currentColor",strokeWidth:1,height:8,width:16,style:{transform:"translateY(-1px)"},className:"react-datepicker__triangle"})))}this.props.popperContainer&&(g=v.createElement(this.props.popperContainer,{},g)),d&&!o&&(g=m.createElement(Nr,{portalId:d,portalHost:f},g));var k=Z("react-datepicker-wrapper",n);return m.createElement(m.Fragment,null,m.createElement("div",{ref:p.refs.setReference,className:k},c),g)},r}(v.Component),Jc=zc(Zc),Zn="react-datepicker-ignore-onclickoutside";function eu(a,r){return a&&r?te(a)!==te(r)||P(a)!==P(r):a!==r}var Gt="Date input not valid.",hu=function(a){z(r,a);function r(t){var e=a.call(this,t)||this;return e.calendar=null,e.input=null,e.getPreSelection=function(){return e.props.openToDate?e.props.openToDate:e.props.selectsEnd&&e.props.startDate?e.props.startDate:e.props.selectsStart&&e.props.endDate?e.props.endDate:R()},e.modifyHolidays=function(){var n;return(n=e.props.holidays)===null||n===void 0?void 0:n.reduce(function(s,o){var i=new Date(o.date);return Qt(i)?me(me([],s,!0),[E(E({},o),{date:i})],!1):s},[])},e.calcInitialState=function(){var n,s=e.getPreSelection(),o=Tr(e.props),i=Or(e.props),c=o&&Fe(s,_t(o))?o:i&&Pe(s,Ln(i))?i:s;return{open:e.props.startOpen||!1,preventFocus:!1,inputValue:null,preSelection:(n=e.props.selectsRange?e.props.startDate:e.props.selected)!==null&&n!==void 0?n:c,highlightDates:Kn(e.props.highlightDates),focused:!1,shouldFocusDayInline:!1,isRenderAriaLiveMessage:!1,wasHidden:!1}},e.resetHiddenStatus=function(){e.setState(E(E({},e.state),{wasHidden:!1}))},e.setHiddenStatus=function(){e.setState(E(E({},e.state),{wasHidden:!0}))},e.setHiddenStateOnVisibilityHidden=function(){document.visibilityState==="hidden"&&e.setHiddenStatus()},e.clearPreventFocusTimeout=function(){e.preventFocusTimeout&&clearTimeout(e.preventFocusTimeout)},e.safeFocus=function(){setTimeout(function(){var n,s;(s=(n=e.input)===null||n===void 0?void 0:n.focus)===null||s===void 0||s.call(n,{preventScroll:!0})},0)},e.safeBlur=function(){setTimeout(function(){var n,s;(s=(n=e.input)===null||n===void 0?void 0:n.blur)===null||s===void 0||s.call(n)},0)},e.setFocus=function(){e.safeFocus()},e.setBlur=function(){e.safeBlur(),e.cancelFocusInput()},e.setOpen=function(n,s){s===void 0&&(s=!1),e.setState({open:n,preSelection:n&&e.state.open?e.state.preSelection:e.calcInitialState().preSelection,lastPreSelectChange:zt},function(){n||e.setState(function(o){return{focused:s?o.focused:!1}},function(){!s&&e.setBlur(),e.setState({inputValue:null})})})},e.inputOk=function(){return we(e.state.preSelection)},e.isCalendarOpen=function(){return e.props.open===void 0?e.state.open&&!e.props.disabled&&!e.props.readOnly:e.props.open},e.handleFocus=function(n){var s,o,i=e.state.wasHidden,c=i?e.state.open:!0;i&&e.resetHiddenStatus(),e.state.preventFocus||((o=(s=e.props).onFocus)===null||o===void 0||o.call(s,n),c&&!e.props.preventOpenOnFocus&&!e.props.readOnly&&e.setOpen(!0)),e.setState({focused:!0})},e.sendFocusBackToInput=function(){e.preventFocusTimeout&&e.clearPreventFocusTimeout(),e.setState({preventFocus:!0},function(){e.preventFocusTimeout=setTimeout(function(){e.setFocus(),e.setState({preventFocus:!1})})})},e.cancelFocusInput=function(){clearTimeout(e.inputFocusTimeout),e.inputFocusTimeout=void 0},e.deferFocusInput=function(){e.cancelFocusInput(),e.inputFocusTimeout=setTimeout(function(){return e.setFocus()},1)},e.handleDropdownFocus=function(){e.cancelFocusInput()},e.handleBlur=function(n){var s,o;(!e.state.open||e.props.withPortal||e.props.showTimeInput)&&((o=(s=e.props).onBlur)===null||o===void 0||o.call(s,n)),e.setState({focused:!1})},e.handleCalendarClickOutside=function(n){var s,o;e.props.inline||e.setOpen(!1),(o=(s=e.props).onClickOutside)===null||o===void 0||o.call(s,n),e.props.withPortal&&n.preventDefault()},e.handleChange=function(){for(var n,s,o,i,c,u=[],l=0;l=Q){ie=A;break}f&&iep&&(ne=D.ArrowLeft,ie=se(p,e.props)?_(ne,ie):p),se(ie,e.props)?((ne===D.PageUp||ne===D.Home)&&(ne=D.ArrowRight),(ne===D.PageDown||ne===D.End)&&(ne=D.ArrowLeft),ie=_(ne,ie)):Xe=!0,hn++}return ie};if(q===D.Enter){n.preventDefault(),e.handleSelect(I,n),!w&&e.setPreSelection(I);return}else if(q===D.Escape){n.preventDefault(),e.setOpen(!1),e.inputOk()||(c=(i=e.props).onInputError)===null||c===void 0||c.call(i,{code:1,msg:Gt});return}var F=null;switch(q){case D.ArrowLeft:case D.ArrowRight:case D.ArrowUp:case D.ArrowDown:case D.PageUp:case D.PageDown:case D.Home:case D.End:F=M(q,I);break}if(!F){(l=(u=e.props).onInputError)===null||l===void 0||l.call(u,{code:1,msg:Gt});return}if(n.preventDefault(),e.setState({lastPreSelectChange:zt}),x&&e.setSelected(F),e.setPreSelection(F),N){var X=te(I),K=te(F),J=P(I),le=P(F);X!==K||J!==le?e.setState({shouldFocusDayInline:!0}):e.setState({shouldFocusDayInline:!1})}}},e.onPopperKeyDown=function(n){var s=n.key;s===D.Escape&&(n.preventDefault(),e.sendFocusBackToInput())},e.onClearClick=function(n){n&&n.preventDefault&&n.preventDefault(),e.sendFocusBackToInput();var s=e.props,o=s.selectsRange,i=s.onChange;o?i==null||i([null,null],n):i==null||i(null,n),e.setState({inputValue:null})},e.clear=function(){e.onClearClick()},e.onScroll=function(n){typeof e.props.closeOnScroll=="boolean"&&e.props.closeOnScroll?(n.target===document||n.target===document.documentElement||n.target===document.body)&&e.setOpen(!1):typeof e.props.closeOnScroll=="function"&&e.props.closeOnScroll(n)&&e.setOpen(!1)},e.renderCalendar=function(){var n,s;return!e.props.inline&&!e.isCalendarOpen()?null:m.createElement(Uc,E({showMonthYearDropdown:void 0,ref:function(o){e.calendar=o}},e.props,e.state,{setOpen:e.setOpen,dateFormat:(n=e.props.dateFormatCalendar)!==null&&n!==void 0?n:r.defaultProps.dateFormatCalendar,onSelect:e.handleSelect,onClickOutside:e.handleCalendarClickOutside,holidays:xc(e.modifyHolidays()),outsideClickIgnoreClass:Zn,onDropdownFocus:e.handleDropdownFocus,onTimeChange:e.handleTimeChange,className:e.props.calendarClassName,container:e.props.calendarContainer,handleOnKeyDown:e.props.onKeyDown,handleOnDayKeyDown:e.onDayKeyDown,setPreSelection:e.setPreSelection,dropdownMode:(s=e.props.dropdownMode)!==null&&s!==void 0?s:r.defaultProps.dropdownMode}),e.props.children)},e.renderAriaLiveRegion=function(){var n=e.props,s=n.dateFormat,o=s===void 0?r.defaultProps.dateFormat:s,i=n.locale,c=e.props.showTimeInput||e.props.showTimeSelect,u=c?"PPPPp":"PPPP",l;return e.props.selectsRange?l="Selected start date: ".concat(re(e.props.startDate,{dateFormat:u,locale:i}),". ").concat(e.props.endDate?"End date: "+re(e.props.endDate,{dateFormat:u,locale:i}):""):e.props.showTimeSelectOnly?l="Selected time: ".concat(re(e.props.selected,{dateFormat:o,locale:i})):e.props.showYearPicker?l="Selected year: ".concat(re(e.props.selected,{dateFormat:"yyyy",locale:i})):e.props.showMonthYearPicker?l="Selected month: ".concat(re(e.props.selected,{dateFormat:"MMMM yyyy",locale:i})):e.props.showQuarterYearPicker?l="Selected quarter: ".concat(re(e.props.selected,{dateFormat:"yyyy, QQQ",locale:i})):l="Selected date: ".concat(re(e.props.selected,{dateFormat:u,locale:i})),m.createElement("span",{role:"alert","aria-live":"polite",className:"react-datepicker__aria-live"},l)},e.renderDateInput=function(){var n,s,o,i=Z(e.props.className,(n={},n[Zn]=e.state.open,n)),c=e.props.customInput||m.createElement("input",{type:"text"}),u=e.props.customInputRef||"ref",l=e.props,d=l.dateFormat,f=d===void 0?r.defaultProps.dateFormat:d,p=l.locale,h=typeof e.props.value=="string"?e.props.value:typeof e.state.inputValue=="string"?e.state.inputValue:e.props.selectsRange?uc(e.props.startDate,e.props.endDate,{dateFormat:f,locale:p}):e.props.selectsMultiple?lc((o=e.props.selectedDates)!==null&&o!==void 0?o:[],{dateFormat:f,locale:p}):re(e.props.selected,{dateFormat:f,locale:p});return v.cloneElement(c,(s={},s[u]=function(g){e.input=g},s.value=h,s.onBlur=e.handleBlur,s.onChange=e.handleChange,s.onClick=e.onInputClick,s.onFocus=e.handleFocus,s.onKeyDown=e.onInputKeyDown,s.id=e.props.id,s.name=e.props.name,s.form=e.props.form,s.autoFocus=e.props.autoFocus,s.placeholder=e.props.placeholderText,s.disabled=e.props.disabled,s.autoComplete=e.props.autoComplete,s.className=Z(c.props.className,i),s.title=e.props.title,s.readOnly=e.props.readOnly,s.required=e.props.required,s.tabIndex=e.props.tabIndex,s["aria-describedby"]=e.props.ariaDescribedBy,s["aria-invalid"]=e.props.ariaInvalid,s["aria-labelledby"]=e.props.ariaLabelledBy,s["aria-required"]=e.props.ariaRequired,s))},e.renderClearButton=function(){var n=e.props,s=n.isClearable,o=n.disabled,i=n.selected,c=n.startDate,u=n.endDate,l=n.clearButtonTitle,d=n.clearButtonClassName,f=d===void 0?"":d,p=n.ariaLabelClose,h=p===void 0?"Close":p,g=n.selectedDates;return s&&(i!=null||c!=null||u!=null||g!=null&&g.length)?m.createElement("button",{type:"button",className:Z("react-datepicker__close-icon",f,{"react-datepicker__close-icon--disabled":o}),disabled:o,"aria-label":h,onClick:e.onClearClick,title:l,tabIndex:-1}):null},e.state=e.calcInitialState(),e.preventFocusTimeout=void 0,e}return Object.defineProperty(r,"defaultProps",{get:function(){return{allowSameDay:!1,dateFormat:"MM/dd/yyyy",dateFormatCalendar:"LLLL yyyy",disabled:!1,disabledKeyboardNavigation:!1,dropdownMode:"scroll",preventOpenOnFocus:!1,monthsShown:1,readOnly:!1,withPortal:!1,selectsDisabledDaysInRange:!1,shouldCloseOnSelect:!0,showTimeSelect:!1,showTimeInput:!1,showPreviousMonths:!1,showMonthYearPicker:!1,showFullMonthYearPicker:!1,showTwoColumnMonthYearPicker:!1,showFourColumnMonthYearPicker:!1,showYearPicker:!1,showQuarterYearPicker:!1,showWeekPicker:!1,strictParsing:!1,swapRange:!1,timeIntervals:30,timeCaption:"Time",previousMonthAriaLabel:"Previous Month",previousMonthButtonLabel:"Previous Month",nextMonthAriaLabel:"Next Month",nextMonthButtonLabel:"Next Month",previousYearAriaLabel:"Previous Year",previousYearButtonLabel:"Previous Year",nextYearAriaLabel:"Next Year",nextYearButtonLabel:"Next Year",timeInputLabel:"Time",enableTabLoop:!0,yearItemNumber:lt,focusSelectedMonth:!1,showPopperArrow:!0,excludeScrollbar:!0,customTimeInput:null,calendarStartDay:void 0,toggleCalendarOnIconClick:!1,usePointerEvent:!1}},enumerable:!1,configurable:!0}),r.prototype.componentDidMount=function(){window.addEventListener("scroll",this.onScroll,!0),document.addEventListener("visibilitychange",this.setHiddenStateOnVisibilityHidden)},r.prototype.componentDidUpdate=function(t,e){var n,s,o,i;t.inline&&eu(t.selected,this.props.selected)&&this.setPreSelection(this.props.selected),this.state.monthSelectedIn!==void 0&&t.monthsShown!==this.props.monthsShown&&this.setState({monthSelectedIn:0}),t.highlightDates!==this.props.highlightDates&&this.setState({highlightDates:Kn(this.props.highlightDates)}),!e.focused&&!Ee(t.selected,this.props.selected)&&this.setState({inputValue:null}),e.open!==this.state.open&&(e.open===!1&&this.state.open===!0&&((s=(n=this.props).onCalendarOpen)===null||s===void 0||s.call(n)),e.open===!0&&this.state.open===!1&&((i=(o=this.props).onCalendarClose)===null||i===void 0||i.call(o)))},r.prototype.componentWillUnmount=function(){this.clearPreventFocusTimeout(),window.removeEventListener("scroll",this.onScroll,!0),document.removeEventListener("visibilitychange",this.setHiddenStateOnVisibilityHidden)},r.prototype.renderInputContainer=function(){var t=this.props,e=t.showIcon,n=t.icon,s=t.calendarIconClassname,o=t.calendarIconClassName,i=t.toggleCalendarOnIconClick,c=this.state.open;return s&&console.warn("calendarIconClassname props is deprecated. should use calendarIconClassName props."),m.createElement("div",{className:"react-datepicker__input-container".concat(e?" react-datepicker__view-calendar-icon":"")},e&&m.createElement(jc,E({icon:n,className:Z(o,!o&&s,c&&"react-datepicker-ignore-onclickoutside")},i?{onClick:this.toggleCalendar}:null)),this.state.isRenderAriaLiveMessage&&this.renderAriaLiveRegion(),this.renderDateInput(),this.renderClearButton())},r.prototype.render=function(){var t=this.renderCalendar();if(this.props.inline)return t;if(this.props.withPortal){var e=this.state.open?m.createElement(Yr,{enableTabLoop:this.props.enableTabLoop},m.createElement("div",{className:"react-datepicker__portal",tabIndex:-1,onKeyDown:this.onPortalKeyDown},t)):null;return this.state.open&&this.props.portalId&&(e=m.createElement(Nr,E({portalId:this.props.portalId},this.props),e)),m.createElement("div",null,this.renderInputContainer(),e)}return m.createElement(Jc,E({},this.props,{className:this.props.popperClassName,hidePopper:!this.isCalendarOpen(),targetComponent:this.renderInputContainer(),popperComponent:t,popperOnKeyDown:this.onPopperKeyDown,showArrow:this.props.showPopperArrow}))},r}(v.Component),tu="input",zt="navigate";export{hu as D,lu as a,iu as b,ou as c,as as d,du as e,cu as f,uu as g,fu as h,Gr as i,pu as p}; +*/var nn=function(r,t){return nn=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])},nn(r,t)};function z(a,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");nn(a,r);function t(){this.constructor=a}a.prototype=r===null?Object.create(r):(t.prototype=r.prototype,new t)}var E=function(){return E=Object.assign||function(t){for(var e,n=1,s=arguments.length;n0?t[0]:t;return a&&H(a,n,e)||""}function uc(a,r,t){if(!a)return"";var e=re(a,t),n=r?re(r,t):"";return"".concat(e," - ").concat(n)}function lc(a,r){if(!(a!=null&&a.length))return"";var t=a[0]?re(a[0],r):"";if(a.length===1)return t;if(a.length===2&&a[1]){var e=re(a[1],r);return"".concat(t,", ").concat(e)}var n=a.length-1;return"".concat(t," (+").concat(n,")")}function jt(a,r){var t=r.hour,e=t===void 0?0:t,n=r.minute,s=n===void 0?0:n,o=r.second,i=o===void 0?0:o;return vt(bt(kt(a,i),s),e)}function dc(a){return on(a)}function fc(a,r){return H(a,"ddd",r)}function _t(a){return Re(a)}function Ce(a,r,t){var e=je(r||dn());return be(a,{locale:e,weekStartsOn:t})}function ve(a){return pr(a)}function st(a){return Ht(a)}function Rn(a){return Jt(a)}function Fn(){return Re(R())}function Ln(a){return dr(a)}function pc(a){return Os(a)}function hc(a){return fr(a)}function fe(a,r){return a&&r?Ti(a,r):!a&&!r}function ee(a,r){return a&&r?Ci(a,r):!a&&!r}function Rt(a,r){return a&&r?Pi(a,r):!a&&!r}function O(a,r){return a&&r?Ps(a,r):!a&&!r}function Ee(a,r){return a&&r?Oo(a,r):!a&&!r}function ot(a,r,t){var e,n=Re(r),s=dr(t);try{e=ut(a,{start:n,end:s})}catch{e=!1}return e}function dn(){var a=Sr();return a.__localeId__}function je(a){if(typeof a=="string"){var r=Sr();return r.__localeData__?r.__localeData__[a]:void 0}else return a}function mc(a,r,t){return r(H(a,"EEEE",t))}function gc(a,r){return H(a,"EEEEEE",r)}function wc(a,r){return H(a,"EEE",r)}function fn(a,r){return H(ae(R(),a),"LLLL",r)}function Cr(a,r){return H(ae(R(),a),"LLL",r)}function Dc(a,r){return H($e(R(),a),"QQQ",r)}function se(a,r){var t=r===void 0?{}:r,e=t.minDate,n=t.maxDate,s=t.excludeDates,o=t.excludeDateIntervals,i=t.includeDates,c=t.includeDateIntervals,u=t.filterDate;return dt(a,{minDate:e,maxDate:n})||s&&s.some(function(l){return l instanceof Date?O(a,l):O(a,l.date)})||o&&o.some(function(l){var d=l.start,f=l.end;return ut(a,{start:d,end:f})})||i&&!i.some(function(l){return O(a,l)})||c&&!c.some(function(l){var d=l.start,f=l.end;return ut(a,{start:d,end:f})})||u&&!u(R(a))||!1}function pn(a,r){var t=r===void 0?{}:r,e=t.excludeDates,n=t.excludeDateIntervals;return n&&n.length>0?n.some(function(s){var o=s.start,i=s.end;return ut(a,{start:o,end:i})}):e&&e.some(function(s){var o;return s instanceof Date?O(a,s):O(a,(o=s.date)!==null&&o!==void 0?o:new Date)})||!1}function Pr(a,r){var t=r===void 0?{}:r,e=t.minDate,n=t.maxDate,s=t.excludeDates,o=t.includeDates,i=t.filterDate;return dt(a,{minDate:e?pr(e):void 0,maxDate:n?fr(n):void 0})||(s==null?void 0:s.some(function(c){return ee(a,c instanceof Date?c:c.date)}))||o&&!o.some(function(c){return ee(a,c)})||i&&!i(R(a))||!1}function mt(a,r,t,e){var n=P(a),s=te(a),o=P(r),i=te(r),c=P(e);return n===o&&n===c?s<=t&&t<=i:n=t||cn:!1}function yc(a,r){var t=r===void 0?{}:r,e=t.minDate,n=t.maxDate,s=t.excludeDates,o=t.includeDates;return dt(a,{minDate:e,maxDate:n})||s&&s.some(function(i){return ee(i instanceof Date?i:i.date,a)})||o&&!o.some(function(i){return ee(i,a)})||!1}function gt(a,r){var t=r===void 0?{}:r,e=t.minDate,n=t.maxDate,s=t.excludeDates,o=t.includeDates,i=t.filterDate;return dt(a,{minDate:e,maxDate:n})||(s==null?void 0:s.some(function(c){return Rt(a,c instanceof Date?c:c.date)}))||o&&!o.some(function(c){return Rt(a,c)})||i&&!i(R(a))||!1}function wt(a,r,t){if(!r||!t||!Tt(r)||!Tt(t))return!1;var e=P(r),n=P(t);return e<=a&&n>=a}function Mt(a,r){var t=r===void 0?{}:r,e=t.minDate,n=t.maxDate,s=t.excludeDates,o=t.includeDates,i=t.filterDate,c=new Date(a,0,1);return dt(c,{minDate:e?Ht(e):void 0,maxDate:n?hr(n):void 0})||(s==null?void 0:s.some(function(u){return fe(c,u instanceof Date?u:u.date)}))||o&&!o.some(function(u){return fe(c,u)})||i&&!i(R(c))||!1}function Dt(a,r,t,e){var n=P(a),s=Ye(a),o=P(r),i=Ye(r),c=P(e);return n===o&&n===c?s<=t&&t<=i:n=t||cn:!1}function dt(a,r){var t,e=r===void 0?{}:r,n=e.minDate,s=e.maxDate;return(t=n&&Ve(a,n)<0||s&&Ve(a,s)>0)!==null&&t!==void 0?t:!1}function Wn(a,r){return r.some(function(t){return De(t)===De(a)&&ye(t)===ye(a)&&Se(t)===Se(a)})}function An(a,r){var t=r===void 0?{}:r,e=t.excludeTimes,n=t.includeTimes,s=t.filterTime;return e&&Wn(a,e)||n&&!Wn(a,n)||s&&!s(a)||!1}function Hn(a,r){var t=r.minTime,e=r.maxTime;if(!t||!e)throw new Error("Both minTime and maxTime props required");var n=R();n=vt(n,De(a)),n=bt(n,ye(a)),n=kt(n,Se(a));var s=R();s=vt(s,De(t)),s=bt(s,ye(t)),s=kt(s,Se(t));var o=R();o=vt(o,De(e)),o=bt(o,ye(e)),o=kt(o,Se(e));var i;try{i=!ut(n,{start:s,end:o})}catch{i=!1}return i}function $n(a,r){var t=r===void 0?{}:r,e=t.minDate,n=t.includeDates,s=Ie(a,1);return e&&Ot(e,s)>0||n&&n.every(function(o){return Ot(o,s)>0})||!1}function Qn(a,r){var t=r===void 0?{}:r,e=t.maxDate,n=t.includeDates,s=ue(a,1);return e&&Ot(s,e)>0||n&&n.every(function(o){return Ot(s,o)>0})||!1}function vc(a,r){var t=r===void 0?{}:r,e=t.minDate,n=t.includeDates,s=Ht(a),o=_r(s);return e&&Et(e,o)>0||n&&n.every(function(i){return Et(i,o)>0})||!1}function bc(a,r){var t=r===void 0?{}:r,e=t.maxDate,n=t.includeDates,s=hr(a),o=sn(s,1);return e&&Et(o,e)>0||n&&n.every(function(i){return Et(o,i)>0})||!1}function Bn(a,r){var t=r===void 0?{}:r,e=t.minDate,n=t.includeDates,s=Ue(a,1);return e&&Nt(e,s)>0||n&&n.every(function(o){return Nt(o,s)>0})||!1}function kc(a,r){var t=r===void 0?{}:r,e=t.minDate,n=t.yearItemNumber,s=n===void 0?lt:n,o=st(Ue(a,s)),i=xe(o,s).endPeriod,c=e&&P(e);return c&&c>i||!1}function qn(a,r){var t=r===void 0?{}:r,e=t.maxDate,n=t.includeDates,s=ge(a,1);return e&&Nt(s,e)>0||n&&n.every(function(o){return Nt(s,o)>0})||!1}function _c(a,r){var t=r===void 0?{}:r,e=t.maxDate,n=t.yearItemNumber,s=n===void 0?lt:n,o=ge(a,s),i=xe(o,s).startPeriod,c=e&&P(e);return c&&c=0});return Mn(e)}else return t?Mn(t):r}function Or(a){var r=a.maxDate,t=a.includeDates;if(t&&r){var e=t.filter(function(n){return Ve(n,r)<=0});return _n(e)}else return t?_n(t):r}function Kn(a,r){var t;a===void 0&&(a=[]),r===void 0&&(r="react-datepicker__day--highlighted");for(var e=new Map,n=0,s=a.length;n=Yc,p=!n&&!t.isWeekInMonth(i);if(f||p)if(t.props.peekNextMonth)o=!0;else break}return e},t.onMonthClick=function(e,n){var s=t.isMonthDisabledForLabelDate(n),o=s.isDisabled,i=s.labelDate;o||t.handleDayClick(ve(i),e)},t.onMonthMouseEnter=function(e){var n=t.isMonthDisabledForLabelDate(e),s=n.isDisabled,o=n.labelDate;s||t.handleDayMouseEnter(ve(o))},t.handleMonthNavigation=function(e,n){var s,o,i,c;(o=(s=t.props).setPreSelection)===null||o===void 0||o.call(s,n),(c=(i=t.MONTH_REFS[e])===null||i===void 0?void 0:i.current)===null||c===void 0||c.focus()},t.handleKeyboardNavigation=function(e,n,s){var o,i=t.props,c=i.selected,u=i.preSelection,l=i.setPreSelection,d=i.minDate,f=i.maxDate,p=i.showFourColumnMonthYearPicker,h=i.showTwoColumnMonthYearPicker;if(u){var g=Gn(p,h),w=t.getVerticalOffset(g),k=(o=Xt[g])===null||o===void 0?void 0:o.grid,S=function(I,_,M){var F,X,K=_,J=M;switch(I){case D.ArrowRight:K=ue(_,yt),J=M===11?0:M+yt;break;case D.ArrowLeft:K=Ie(_,yt),J=M===0?11:M-yt;break;case D.ArrowUp:K=Ie(_,w),J=!((F=k==null?void 0:k[0])===null||F===void 0)&&F.includes(M)?M+12-w:M-w;break;case D.ArrowDown:K=ue(_,w),J=!((X=k==null?void 0:k[k.length-1])===null||X===void 0)&&X.includes(M)?M-12+w:M+w;break}return{newCalculatedDate:K,newCalculatedMonth:J}},x=function(I,_,M){for(var F=40,X=I,K=!1,J=0,le=S(X,_,M),G=le.newCalculatedDate,A=le.newCalculatedMonth;!K;){if(J>=F){G=_,A=M;break}if(d&&Gf){X=D.ArrowLeft;var Q=S(X,G,A);G=Q.newCalculatedDate,A=Q.newCalculatedMonth}if(yc(G,t.props)){var Q=S(X,G,A);G=Q.newCalculatedDate,A=Q.newCalculatedMonth}else K=!0;J++}return{newCalculatedDate:G,newCalculatedMonth:A}};if(n===D.Enter){t.isMonthDisabled(s)||(t.onMonthClick(e,s),l==null||l(c));return}var N=x(n,u,s),q=N.newCalculatedDate,$=N.newCalculatedMonth;switch(n){case D.ArrowRight:case D.ArrowLeft:case D.ArrowUp:case D.ArrowDown:t.handleMonthNavigation($,q);break}}},t.getVerticalOffset=function(e){var n,s;return(s=(n=Xt[e])===null||n===void 0?void 0:n.verticalNavigationOffset)!==null&&s!==void 0?s:0},t.onMonthKeyDown=function(e,n){var s=t.props,o=s.disabledKeyboardNavigation,i=s.handleOnMonthKeyDown,c=e.key;c!==D.Tab&&e.preventDefault(),o||t.handleKeyboardNavigation(e,c,n),i&&i(e)},t.onQuarterClick=function(e,n){var s=$e(t.props.day,n);gt(s,t.props)||t.handleDayClick(Rn(s),e)},t.onQuarterMouseEnter=function(e){var n=$e(t.props.day,e);gt(n,t.props)||t.handleDayMouseEnter(Rn(n))},t.handleQuarterNavigation=function(e,n){var s,o,i,c;t.isDisabled(n)||t.isExcluded(n)||((o=(s=t.props).setPreSelection)===null||o===void 0||o.call(s,n),(c=(i=t.QUARTER_REFS[e-1])===null||i===void 0?void 0:i.current)===null||c===void 0||c.focus())},t.onQuarterKeyDown=function(e,n){var s,o,i=e.key;if(!t.props.disabledKeyboardNavigation)switch(i){case D.Enter:t.onQuarterClick(e,n),(o=(s=t.props).setPreSelection)===null||o===void 0||o.call(s,t.props.selected);break;case D.ArrowRight:if(!t.props.preSelection)break;t.handleQuarterNavigation(n===4?1:n+1,sn(t.props.preSelection,1));break;case D.ArrowLeft:if(!t.props.preSelection)break;t.handleQuarterNavigation(n===1?4:n-1,_r(t.props.preSelection));break}},t.isMonthDisabledForLabelDate=function(e){var n,s=t.props,o=s.day,i=s.minDate,c=s.maxDate,u=s.excludeDates,l=s.includeDates,d=ae(o,e);return{isDisabled:(n=(i||c||u||l)&&Pr(d,t.props))!==null&&n!==void 0?n:!1,labelDate:d}},t.isMonthDisabled=function(e){var n=t.isMonthDisabledForLabelDate(e).isDisabled;return n},t.getMonthClassNames=function(e){var n=t.props,s=n.day,o=n.startDate,i=n.endDate,c=n.preSelection,u=n.monthClassName,l=u?u(ae(s,e)):void 0,d=t.getSelection();return Z("react-datepicker__month-text","react-datepicker__month-".concat(e),l,{"react-datepicker__month-text--disabled":t.isMonthDisabled(e),"react-datepicker__month-text--selected":d?t.isSelectMonthInList(s,e,d):void 0,"react-datepicker__month-text--keyboard-selected":!t.props.disabledKeyboardNavigation&&c&&t.isSelectedMonth(s,e,c)&&!t.isMonthDisabled(e),"react-datepicker__month-text--in-selecting-range":t.isInSelectingRangeMonth(e),"react-datepicker__month-text--in-range":o&&i?mt(o,i,e,s):void 0,"react-datepicker__month-text--range-start":t.isRangeStartMonth(e),"react-datepicker__month-text--range-end":t.isRangeEndMonth(e),"react-datepicker__month-text--selecting-range-start":t.isSelectingMonthRangeStart(e),"react-datepicker__month-text--selecting-range-end":t.isSelectingMonthRangeEnd(e),"react-datepicker__month-text--today":t.isCurrentMonth(s,e)})},t.getTabIndex=function(e){if(t.props.preSelection==null)return"-1";var n=te(t.props.preSelection),s=t.isMonthDisabledForLabelDate(n).isDisabled,o=e===n&&!(s||t.props.disabledKeyboardNavigation)?"0":"-1";return o},t.getQuarterTabIndex=function(e){if(t.props.preSelection==null)return"-1";var n=Ye(t.props.preSelection),s=gt(t.props.day,t.props),o=e===n&&!(s||t.props.disabledKeyboardNavigation)?"0":"-1";return o},t.getAriaLabel=function(e){var n=t.props,s=n.chooseDayAriaLabelPrefix,o=s===void 0?"Choose":s,i=n.disabledDayAriaLabelPrefix,c=i===void 0?"Not available":i,u=n.day,l=n.locale,d=ae(u,e),f=t.isDisabled(d)||t.isExcluded(d)?c:o;return"".concat(f," ").concat(H(d,"MMMM yyyy",l))},t.getQuarterClassNames=function(e){var n=t.props,s=n.day,o=n.startDate,i=n.endDate,c=n.selected,u=n.minDate,l=n.maxDate,d=n.excludeDates,f=n.includeDates,p=n.filterDate,h=n.preSelection,g=n.disabledKeyboardNavigation,w=(u||l||d||f||p)&>($e(s,e),t.props);return Z("react-datepicker__quarter-text","react-datepicker__quarter-".concat(e),{"react-datepicker__quarter-text--disabled":w,"react-datepicker__quarter-text--selected":c?t.isSelectedQuarter(s,e,c):void 0,"react-datepicker__quarter-text--keyboard-selected":!g&&h&&t.isSelectedQuarter(s,e,h)&&!w,"react-datepicker__quarter-text--in-selecting-range":t.isInSelectingRangeQuarter(e),"react-datepicker__quarter-text--in-range":o&&i?Dt(o,i,e,s):void 0,"react-datepicker__quarter-text--range-start":t.isRangeStartQuarter(e),"react-datepicker__quarter-text--range-end":t.isRangeEndQuarter(e)})},t.getMonthContent=function(e){var n=t.props,s=n.showFullMonthYearPicker,o=n.renderMonthContent,i=n.locale,c=n.day,u=Cr(e,i),l=fn(e,i);return o?o(e,u,l,c):s?l:u},t.getQuarterContent=function(e){var n,s=t.props,o=s.renderQuarterContent,i=s.locale,c=Dc(e,i);return(n=o==null?void 0:o(e,c))!==null&&n!==void 0?n:c},t.renderMonths=function(){var e,n=t.props,s=n.showTwoColumnMonthYearPicker,o=n.showFourColumnMonthYearPicker,i=n.day,c=n.selected,u=(e=Xt[Gn(o,s)])===null||e===void 0?void 0:e.grid;return u==null?void 0:u.map(function(l,d){return m.createElement("div",{className:"react-datepicker__month-wrapper",key:d},l.map(function(f,p){return m.createElement("div",{ref:t.MONTH_REFS[f],key:p,onClick:function(h){t.onMonthClick(h,f)},onKeyDown:function(h){Er(h)&&(h.preventDefault(),h.key=D.Enter),t.onMonthKeyDown(h,f)},onMouseEnter:t.props.usePointerEvent?void 0:function(){return t.onMonthMouseEnter(f)},onPointerEnter:t.props.usePointerEvent?function(){return t.onMonthMouseEnter(f)}:void 0,tabIndex:Number(t.getTabIndex(f)),className:t.getMonthClassNames(f),"aria-disabled":t.isMonthDisabled(f),role:"option","aria-label":t.getAriaLabel(f),"aria-current":t.isCurrentMonth(i,f)?"date":void 0,"aria-selected":c?t.isSelectedMonth(i,f,c):void 0},t.getMonthContent(f))}))})},t.renderQuarters=function(){var e=t.props,n=e.day,s=e.selected,o=[1,2,3,4];return m.createElement("div",{className:"react-datepicker__quarter-wrapper"},o.map(function(i,c){return m.createElement("div",{key:c,ref:t.QUARTER_REFS[c],role:"option",onClick:function(u){t.onQuarterClick(u,i)},onKeyDown:function(u){t.onQuarterKeyDown(u,i)},onMouseEnter:t.props.usePointerEvent?void 0:function(){return t.onQuarterMouseEnter(i)},onPointerEnter:t.props.usePointerEvent?function(){return t.onQuarterMouseEnter(i)}:void 0,className:t.getQuarterClassNames(i),"aria-selected":s?t.isSelectedQuarter(n,i,s):void 0,tabIndex:Number(t.getQuarterTabIndex(i)),"aria-current":t.isCurrentQuarter(n,i)?"date":void 0},t.getQuarterContent(i))}))},t.getClassNames=function(){var e=t.props,n=e.selectingDate,s=e.selectsStart,o=e.selectsEnd,i=e.showMonthYearPicker,c=e.showQuarterYearPicker,u=e.showWeekPicker;return Z("react-datepicker__month",{"react-datepicker__month--selecting-range":n&&(s||o)},{"react-datepicker__monthPicker":i},{"react-datepicker__quarterPicker":c},{"react-datepicker__weekPicker":u})},t}return r.prototype.getSelection=function(){var t=this.props,e=t.selected,n=t.selectedDates,s=t.selectsMultiple;if(s)return n;if(e)return[e]},r.prototype.render=function(){var t=this.props,e=t.showMonthYearPicker,n=t.showQuarterYearPicker,s=t.day,o=t.ariaLabelPrefix,i=o===void 0?"Month ":o,c=i?i.trim()+" ":"";return m.createElement("div",{className:this.getClassNames(),onMouseLeave:this.props.usePointerEvent?void 0:this.handleMouseLeave,onPointerLeave:this.props.usePointerEvent?this.handleMouseLeave:void 0,"aria-label":"".concat(c).concat(H(s,"MMMM, yyyy",this.props.locale)),role:"listbox"},e?this.renderMonths():n?this.renderQuarters():this.renderWeeks())},r}(v.Component),Rc=function(a){z(r,a);function r(){var t=a!==null&&a.apply(this,arguments)||this;return t.isSelectedMonth=function(e){return t.props.month===e},t.renderOptions=function(){return t.props.monthNames.map(function(e,n){return m.createElement("div",{className:t.isSelectedMonth(n)?"react-datepicker__month-option react-datepicker__month-option--selected_month":"react-datepicker__month-option",key:e,onClick:t.onChange.bind(t,n),"aria-selected":t.isSelectedMonth(n)?"true":void 0},t.isSelectedMonth(n)?m.createElement("span",{className:"react-datepicker__month-option--selected"},"✓"):"",e)})},t.onChange=function(e){return t.props.onChange(e)},t.handleClickOutside=function(){return t.props.onCancel()},t}return r.prototype.render=function(){return m.createElement($t,{className:"react-datepicker__month-dropdown",onClickOutside:this.handleClickOutside},this.renderOptions())},r}(v.Component),Fc=function(a){z(r,a);function r(){var t=a!==null&&a.apply(this,arguments)||this;return t.state={dropdownVisible:!1},t.renderSelectOptions=function(e){return e.map(function(n,s){return m.createElement("option",{key:n,value:s},n)})},t.renderSelectMode=function(e){return m.createElement("select",{value:t.props.month,className:"react-datepicker__month-select",onChange:function(n){return t.onChange(parseInt(n.target.value))}},t.renderSelectOptions(e))},t.renderReadView=function(e,n){return m.createElement("div",{key:"read",style:{visibility:e?"visible":"hidden"},className:"react-datepicker__month-read-view",onClick:t.toggleDropdown},m.createElement("span",{className:"react-datepicker__month-read-view--down-arrow"}),m.createElement("span",{className:"react-datepicker__month-read-view--selected-month"},n[t.props.month]))},t.renderDropdown=function(e){return m.createElement(Rc,E({key:"dropdown"},t.props,{monthNames:e,onChange:t.onChange,onCancel:t.toggleDropdown}))},t.renderScrollMode=function(e){var n=t.state.dropdownVisible,s=[t.renderReadView(!n,e)];return n&&s.unshift(t.renderDropdown(e)),s},t.onChange=function(e){t.toggleDropdown(),e!==t.props.month&&t.props.onChange(e)},t.toggleDropdown=function(){return t.setState({dropdownVisible:!t.state.dropdownVisible})},t}return r.prototype.render=function(){var t=this,e=[0,1,2,3,4,5,6,7,8,9,10,11].map(this.props.useShortMonthInDropdown?function(s){return Cr(s,t.props.locale)}:function(s){return fn(s,t.props.locale)}),n;switch(this.props.dropdownMode){case"scroll":n=this.renderScrollMode(e);break;case"select":n=this.renderSelectMode(e);break}return m.createElement("div",{className:"react-datepicker__month-dropdown-container react-datepicker__month-dropdown-container--".concat(this.props.dropdownMode)},n)},r}(v.Component);function Lc(a,r){for(var t=[],e=ve(a),n=ve(r);!Pe(e,n);)t.push(R(e)),e=ue(e,1);return t}var Wc=function(a){z(r,a);function r(t){var e=a.call(this,t)||this;return e.renderOptions=function(){return e.state.monthYearsList.map(function(n){var s=tn(n),o=fe(e.props.date,n)&&ee(e.props.date,n);return m.createElement("div",{className:o?"react-datepicker__month-year-option--selected_month-year":"react-datepicker__month-year-option",key:s,onClick:e.onChange.bind(e,s),"aria-selected":o?"true":void 0},o?m.createElement("span",{className:"react-datepicker__month-year-option--selected"},"✓"):"",H(n,e.props.dateFormat,e.props.locale))})},e.onChange=function(n){return e.props.onChange(n)},e.handleClickOutside=function(){e.props.onCancel()},e.state={monthYearsList:Lc(e.props.minDate,e.props.maxDate)},e}return r.prototype.render=function(){var t=Z({"react-datepicker__month-year-dropdown":!0,"react-datepicker__month-year-dropdown--scrollable":this.props.scrollableMonthYearDropdown});return m.createElement($t,{className:t,onClickOutside:this.handleClickOutside},this.renderOptions())},r}(v.Component),Ac=function(a){z(r,a);function r(){var t=a!==null&&a.apply(this,arguments)||this;return t.state={dropdownVisible:!1},t.renderSelectOptions=function(){for(var e=ve(t.props.minDate),n=ve(t.props.maxDate),s=[];!Pe(e,n);){var o=tn(e);s.push(m.createElement("option",{key:o,value:o},H(e,t.props.dateFormat,t.props.locale))),e=ue(e,1)}return s},t.onSelectChange=function(e){t.onChange(parseInt(e.target.value))},t.renderSelectMode=function(){return m.createElement("select",{value:tn(ve(t.props.date)),className:"react-datepicker__month-year-select",onChange:t.onSelectChange},t.renderSelectOptions())},t.renderReadView=function(e){var n=H(t.props.date,t.props.dateFormat,t.props.locale);return m.createElement("div",{key:"read",style:{visibility:e?"visible":"hidden"},className:"react-datepicker__month-year-read-view",onClick:t.toggleDropdown},m.createElement("span",{className:"react-datepicker__month-year-read-view--down-arrow"}),m.createElement("span",{className:"react-datepicker__month-year-read-view--selected-month-year"},n))},t.renderDropdown=function(){return m.createElement(Wc,E({key:"dropdown"},t.props,{onChange:t.onChange,onCancel:t.toggleDropdown}))},t.renderScrollMode=function(){var e=t.state.dropdownVisible,n=[t.renderReadView(!e)];return e&&n.unshift(t.renderDropdown()),n},t.onChange=function(e){t.toggleDropdown();var n=R(e);fe(t.props.date,n)&&ee(t.props.date,n)||t.props.onChange(n)},t.toggleDropdown=function(){return t.setState({dropdownVisible:!t.state.dropdownVisible})},t}return r.prototype.render=function(){var t;switch(this.props.dropdownMode){case"scroll":t=this.renderScrollMode();break;case"select":t=this.renderSelectMode();break}return m.createElement("div",{className:"react-datepicker__month-year-dropdown-container react-datepicker__month-year-dropdown-container--".concat(this.props.dropdownMode)},t)},r}(v.Component),Hc=function(a){z(r,a);function r(){var t=a!==null&&a.apply(this,arguments)||this;return t.state={height:null},t.scrollToTheSelectedTime=function(){requestAnimationFrame(function(){var e,n,s;t.list&&(t.list.scrollTop=(s=t.centerLi&&r.calcCenterPosition(t.props.monthRef?t.props.monthRef.clientHeight-((n=(e=t.header)===null||e===void 0?void 0:e.clientHeight)!==null&&n!==void 0?n:0):t.list.clientHeight,t.centerLi))!==null&&s!==void 0?s:0)})},t.handleClick=function(e){var n,s;(t.props.minTime||t.props.maxTime)&&Hn(e,t.props)||(t.props.excludeTimes||t.props.includeTimes||t.props.filterTime)&&An(e,t.props)||(s=(n=t.props).onChange)===null||s===void 0||s.call(n,e)},t.isSelectedTime=function(e){return t.props.selected&&Pc(t.props.selected,e)},t.isDisabledTime=function(e){return(t.props.minTime||t.props.maxTime)&&Hn(e,t.props)||(t.props.excludeTimes||t.props.includeTimes||t.props.filterTime)&&An(e,t.props)},t.liClasses=function(e){var n,s=["react-datepicker__time-list-item",t.props.timeClassName?t.props.timeClassName(e):void 0];return t.isSelectedTime(e)&&s.push("react-datepicker__time-list-item--selected"),t.isDisabledTime(e)&&s.push("react-datepicker__time-list-item--disabled"),t.props.injectTimes&&(De(e)*3600+ye(e)*60+Se(e))%(((n=t.props.intervals)!==null&&n!==void 0?n:r.defaultProps.intervals)*60)!==0&&s.push("react-datepicker__time-list-item--injected"),s.join(" ")},t.handleOnKeyDown=function(e,n){var s,o;e.key===D.Space&&(e.preventDefault(),e.key=D.Enter),(e.key===D.ArrowUp||e.key===D.ArrowLeft)&&e.target instanceof HTMLElement&&e.target.previousSibling&&(e.preventDefault(),e.target.previousSibling instanceof HTMLElement&&e.target.previousSibling.focus()),(e.key===D.ArrowDown||e.key===D.ArrowRight)&&e.target instanceof HTMLElement&&e.target.nextSibling&&(e.preventDefault(),e.target.nextSibling instanceof HTMLElement&&e.target.nextSibling.focus()),e.key===D.Enter&&t.handleClick(n),(o=(s=t.props).handleOnKeyDown)===null||o===void 0||o.call(s,e)},t.renderTimes=function(){for(var e,n=[],s=typeof t.props.format=="string"?t.props.format:"p",o=(e=t.props.intervals)!==null&&e!==void 0?e:r.defaultProps.intervals,i=t.props.selected||t.props.openToDate||R(),c=_t(i),u=t.props.injectTimes&&t.props.injectTimes.sort(function(w,k){return w.getTime()-k.getTime()}),l=60*Cc(i),d=l/o,f=0;f=f?e.updateFocusOnPaginate(Math.abs(f-(n-p))):(u=(c=e.YEAR_REFS[n-p])===null||c===void 0?void 0:c.current)===null||u===void 0||u.focus())}},e.isSameDay=function(n,s){return O(n,s)},e.isCurrentYear=function(n){return n===P(R())},e.isRangeStart=function(n){return e.props.startDate&&e.props.endDate&&fe(de(R(),n),e.props.startDate)},e.isRangeEnd=function(n){return e.props.startDate&&e.props.endDate&&fe(de(R(),n),e.props.endDate)},e.isInRange=function(n){return wt(n,e.props.startDate,e.props.endDate)},e.isInSelectingRange=function(n){var s=e.props,o=s.selectsStart,i=s.selectsEnd,c=s.selectsRange,u=s.startDate,l=s.endDate;return!(o||i||c)||!e.selectingDate()?!1:o&&l?wt(n,e.selectingDate(),l):i&&u||c&&u&&!l?wt(n,u,e.selectingDate()):!1},e.isSelectingRangeStart=function(n){var s;if(!e.isInSelectingRange(n))return!1;var o=e.props,i=o.startDate,c=o.selectsStart,u=de(R(),n);return c?fe(u,(s=e.selectingDate())!==null&&s!==void 0?s:null):fe(u,i??null)},e.isSelectingRangeEnd=function(n){var s;if(!e.isInSelectingRange(n))return!1;var o=e.props,i=o.endDate,c=o.selectsEnd,u=o.selectsRange,l=de(R(),n);return c||u?fe(l,(s=e.selectingDate())!==null&&s!==void 0?s:null):fe(l,i??null)},e.isKeyboardSelected=function(n){if(!(e.props.date===void 0||e.props.selected==null||e.props.preSelection==null)){var s=e.props,o=s.minDate,i=s.maxDate,c=s.excludeDates,u=s.includeDates,l=s.filterDate,d=st(de(e.props.date,n)),f=(o||i||c||u||l)&&Mt(n,e.props);return!e.props.disabledKeyboardNavigation&&!e.props.inline&&!O(d,st(e.props.selected))&&O(d,st(e.props.preSelection))&&!f}},e.onYearClick=function(n,s){var o=e.props.date;o!==void 0&&e.handleYearClick(st(de(o,s)),n)},e.onYearKeyDown=function(n,s){var o,i,c=n.key,u=e.props,l=u.date,d=u.yearItemNumber,f=u.handleOnKeyDown;if(c!==D.Tab&&n.preventDefault(),!e.props.disabledKeyboardNavigation)switch(c){case D.Enter:if(e.props.selected==null)break;e.onYearClick(n,s),(i=(o=e.props).setPreSelection)===null||i===void 0||i.call(o,e.props.selected);break;case D.ArrowRight:if(e.props.preSelection==null)break;e.handleYearNavigation(s+1,ge(e.props.preSelection,1));break;case D.ArrowLeft:if(e.props.preSelection==null)break;e.handleYearNavigation(s-1,Ue(e.props.preSelection,1));break;case D.ArrowUp:{if(l===void 0||d===void 0||e.props.preSelection==null)break;var p=xe(l,d).startPeriod,h=zn,g=s-h;if(g=p&&sk){var w=d%h;s<=k&&s>k-w?h=w:h+=w,g=s+h}e.handleYearNavigation(g,ge(e.props.preSelection,h));break}}f&&f(n)},e.getYearClassNames=function(n){var s=e.props,o=s.date,i=s.minDate,c=s.maxDate,u=s.selected,l=s.excludeDates,d=s.includeDates,f=s.filterDate,p=s.yearClassName;return Z("react-datepicker__year-text","react-datepicker__year-".concat(n),o?p==null?void 0:p(de(o,n)):void 0,{"react-datepicker__year-text--selected":u?n===P(u):void 0,"react-datepicker__year-text--disabled":(i||c||l||d||f)&&Mt(n,e.props),"react-datepicker__year-text--keyboard-selected":e.isKeyboardSelected(n),"react-datepicker__year-text--range-start":e.isRangeStart(n),"react-datepicker__year-text--range-end":e.isRangeEnd(n),"react-datepicker__year-text--in-range":e.isInRange(n),"react-datepicker__year-text--in-selecting-range":e.isInSelectingRange(n),"react-datepicker__year-text--selecting-range-start":e.isSelectingRangeStart(n),"react-datepicker__year-text--selecting-range-end":e.isSelectingRangeEnd(n),"react-datepicker__year-text--today":e.isCurrentYear(n)})},e.getYearTabIndex=function(n){if(e.props.disabledKeyboardNavigation||e.props.preSelection==null)return"-1";var s=P(e.props.preSelection),o=Mt(n,e.props);return n===s&&!o?"0":"-1"},e.getYearContent=function(n){return e.props.renderYearContent?e.props.renderYearContent(n):n},e}return r.prototype.render=function(){var t=this,e=[],n=this.props,s=n.date,o=n.yearItemNumber,i=n.onYearMouseEnter,c=n.onYearMouseLeave;if(s===void 0)return null;for(var u=xe(s,o),l=u.startPeriod,d=u.endPeriod,f=function(g){e.push(m.createElement("div",{ref:p.YEAR_REFS[g-l],onClick:function(w){t.onYearClick(w,g)},onKeyDown:function(w){Er(w)&&(w.preventDefault(),w.key=D.Enter),t.onYearKeyDown(w,g)},tabIndex:Number(p.getYearTabIndex(g)),className:p.getYearClassNames(g),onMouseEnter:p.props.usePointerEvent?void 0:function(w){return i(w,g)},onPointerEnter:p.props.usePointerEvent?function(w){return i(w,g)}:void 0,onMouseLeave:p.props.usePointerEvent?void 0:function(w){return c(w,g)},onPointerLeave:p.props.usePointerEvent?function(w){return c(w,g)}:void 0,key:g,"aria-current":p.isCurrentYear(g)?"date":void 0},p.getYearContent(g)))},p=this,h=l;h<=d;h++)f(h);return m.createElement("div",{className:"react-datepicker__year"},m.createElement("div",{className:"react-datepicker__year-wrapper",onMouseLeave:this.props.usePointerEvent?void 0:this.props.clearSelectingDate,onPointerLeave:this.props.usePointerEvent?this.props.clearSelectingDate:void 0},e))},r}(v.Component);function Qc(a,r,t,e){for(var n=[],s=0;s<2*r+1;s++){var o=a+r-s,i=!0;t&&(i=P(t)<=o),e&&i&&(i=P(e)>=o),i&&n.push(o)}return n}var Bc=function(a){z(r,a);function r(t){var e=a.call(this,t)||this;e.renderOptions=function(){var i=e.props.year,c=e.state.yearsList.map(function(d){return m.createElement("div",{className:i===d?"react-datepicker__year-option react-datepicker__year-option--selected_year":"react-datepicker__year-option",key:d,onClick:e.onChange.bind(e,d),"aria-selected":i===d?"true":void 0},i===d?m.createElement("span",{className:"react-datepicker__year-option--selected"},"✓"):"",d)}),u=e.props.minDate?P(e.props.minDate):null,l=e.props.maxDate?P(e.props.maxDate):null;return(!l||!e.state.yearsList.find(function(d){return d===l}))&&c.unshift(m.createElement("div",{className:"react-datepicker__year-option",key:"upcoming",onClick:e.incrementYears},m.createElement("a",{className:"react-datepicker__navigation react-datepicker__navigation--years react-datepicker__navigation--years-upcoming"}))),(!u||!e.state.yearsList.find(function(d){return d===u}))&&c.push(m.createElement("div",{className:"react-datepicker__year-option",key:"previous",onClick:e.decrementYears},m.createElement("a",{className:"react-datepicker__navigation react-datepicker__navigation--years react-datepicker__navigation--years-previous"}))),c},e.onChange=function(i){e.props.onChange(i)},e.handleClickOutside=function(){e.props.onCancel()},e.shiftYears=function(i){var c=e.state.yearsList.map(function(u){return u+i});e.setState({yearsList:c})},e.incrementYears=function(){return e.shiftYears(1)},e.decrementYears=function(){return e.shiftYears(-1)};var n=t.yearDropdownItemNumber,s=t.scrollableYearDropdown,o=n||(s?10:5);return e.state={yearsList:Qc(e.props.year,o,e.props.minDate,e.props.maxDate)},e.dropdownRef=v.createRef(),e}return r.prototype.componentDidMount=function(){var t=this.dropdownRef.current;if(t){var e=t.children?Array.from(t.children):null,n=e?e.find(function(s){return s.ariaSelected}):null;t.scrollTop=n&&n instanceof HTMLElement?n.offsetTop+(n.clientHeight-t.clientHeight)/2:(t.scrollHeight-t.clientHeight)/2}},r.prototype.render=function(){var t=Z({"react-datepicker__year-dropdown":!0,"react-datepicker__year-dropdown--scrollable":this.props.scrollableYearDropdown});return m.createElement($t,{className:t,containerRef:this.dropdownRef,onClickOutside:this.handleClickOutside},this.renderOptions())},r}(v.Component),qc=function(a){z(r,a);function r(){var t=a!==null&&a.apply(this,arguments)||this;return t.state={dropdownVisible:!1},t.renderSelectOptions=function(){for(var e=t.props.minDate?P(t.props.minDate):1900,n=t.props.maxDate?P(t.props.maxDate):2100,s=[],o=e;o<=n;o++)s.push(m.createElement("option",{key:o,value:o},o));return s},t.onSelectChange=function(e){t.onChange(parseInt(e.target.value))},t.renderSelectMode=function(){return m.createElement("select",{value:t.props.year,className:"react-datepicker__year-select",onChange:t.onSelectChange},t.renderSelectOptions())},t.renderReadView=function(e){return m.createElement("div",{key:"read",style:{visibility:e?"visible":"hidden"},className:"react-datepicker__year-read-view",onClick:function(n){return t.toggleDropdown(n)}},m.createElement("span",{className:"react-datepicker__year-read-view--down-arrow"}),m.createElement("span",{className:"react-datepicker__year-read-view--selected-year"},t.props.year))},t.renderDropdown=function(){return m.createElement(Bc,E({key:"dropdown"},t.props,{onChange:t.onChange,onCancel:t.toggleDropdown}))},t.renderScrollMode=function(){var e=t.state.dropdownVisible,n=[t.renderReadView(!e)];return e&&n.unshift(t.renderDropdown()),n},t.onChange=function(e){t.toggleDropdown(),e!==t.props.year&&t.props.onChange(e)},t.toggleDropdown=function(e){t.setState({dropdownVisible:!t.state.dropdownVisible},function(){t.props.adjustDateOnChange&&t.handleYearChange(t.props.date,e)})},t.handleYearChange=function(e,n){var s;(s=t.onSelect)===null||s===void 0||s.call(t,e,n),t.setOpen()},t.onSelect=function(e,n){var s,o;(o=(s=t.props).onSelect)===null||o===void 0||o.call(s,e,n)},t.setOpen=function(){var e,n;(n=(e=t.props).setOpen)===null||n===void 0||n.call(e,!0)},t}return r.prototype.render=function(){var t;switch(this.props.dropdownMode){case"scroll":t=this.renderScrollMode();break;case"select":t=this.renderSelectMode();break}return m.createElement("div",{className:"react-datepicker__year-dropdown-container react-datepicker__year-dropdown-container--".concat(this.props.dropdownMode)},t)},r}(v.Component),Kc=["react-datepicker__year-select","react-datepicker__month-select","react-datepicker__month-year-select"],Vc=function(a){var r=(a.className||"").split(/\s+/);return Kc.some(function(t){return r.indexOf(t)>=0})},Uc=function(a){z(r,a);function r(t){var e=a.call(this,t)||this;return e.monthContainer=void 0,e.handleClickOutside=function(n){e.props.onClickOutside(n)},e.setClickOutsideRef=function(){return e.containerRef.current},e.handleDropdownFocus=function(n){var s,o;Vc(n.target)&&((o=(s=e.props).onDropdownFocus)===null||o===void 0||o.call(s,n))},e.getDateInView=function(){var n=e.props,s=n.preSelection,o=n.selected,i=n.openToDate,c=Tr(e.props),u=Or(e.props),l=R(),d=i||o||s;return d||(c&&Fe(l,c)?c:u&&Pe(l,u)?u:l)},e.increaseMonth=function(){e.setState(function(n){var s=n.date;return{date:ue(s,1)}},function(){return e.handleMonthChange(e.state.date)})},e.decreaseMonth=function(){e.setState(function(n){var s=n.date;return{date:Ie(s,1)}},function(){return e.handleMonthChange(e.state.date)})},e.handleDayClick=function(n,s,o){e.props.onSelect(n,s,o),e.props.setPreSelection&&e.props.setPreSelection(n)},e.handleDayMouseEnter=function(n){e.setState({selectingDate:n}),e.props.onDayMouseEnter&&e.props.onDayMouseEnter(n)},e.handleMonthMouseLeave=function(){e.setState({selectingDate:void 0}),e.props.onMonthMouseLeave&&e.props.onMonthMouseLeave()},e.handleYearMouseEnter=function(n,s){e.setState({selectingDate:de(R(),s)}),e.props.onYearMouseEnter&&e.props.onYearMouseEnter(n,s)},e.handleYearMouseLeave=function(n,s){e.props.onYearMouseLeave&&e.props.onYearMouseLeave(n,s)},e.handleYearChange=function(n){var s,o,i,c;(o=(s=e.props).onYearChange)===null||o===void 0||o.call(s,n),e.setState({isRenderAriaLiveMessage:!0}),e.props.adjustDateOnChange&&(e.props.onSelect(n),(c=(i=e.props).setOpen)===null||c===void 0||c.call(i,!0)),e.props.setPreSelection&&e.props.setPreSelection(n)},e.getEnabledPreSelectionDateForMonth=function(n){if(!se(n,e.props))return n;for(var s=ve(n),o=hc(n),i=Ts(o,s),c=null,u=0;u<=i;u++){var l=ce(s,u);if(!se(l,e.props)){c=l;break}}return c},e.handleMonthChange=function(n){var s,o,i,c=(s=e.getEnabledPreSelectionDateForMonth(n))!==null&&s!==void 0?s:n;e.handleCustomMonthChange(c),e.props.adjustDateOnChange&&(e.props.onSelect(c),(i=(o=e.props).setOpen)===null||i===void 0||i.call(o,!0)),e.props.setPreSelection&&e.props.setPreSelection(c)},e.handleCustomMonthChange=function(n){var s,o;(o=(s=e.props).onMonthChange)===null||o===void 0||o.call(s,n),e.setState({isRenderAriaLiveMessage:!0})},e.handleMonthYearChange=function(n){e.handleYearChange(n),e.handleMonthChange(n)},e.changeYear=function(n){e.setState(function(s){var o=s.date;return{date:de(o,Number(n))}},function(){return e.handleYearChange(e.state.date)})},e.changeMonth=function(n){e.setState(function(s){var o=s.date;return{date:ae(o,Number(n))}},function(){return e.handleMonthChange(e.state.date)})},e.changeMonthYear=function(n){e.setState(function(s){var o=s.date;return{date:de(ae(o,te(n)),P(n))}},function(){return e.handleMonthYearChange(e.state.date)})},e.header=function(n){n===void 0&&(n=e.state.date);var s=Ce(n,e.props.locale,e.props.calendarStartDay),o=[];return e.props.showWeekNumbers&&o.push(m.createElement("div",{key:"W",className:"react-datepicker__day-name"},e.props.weekLabel||"#")),o.concat([0,1,2,3,4,5,6].map(function(i){var c=ce(s,i),u=e.formatWeekday(c,e.props.locale),l=e.props.weekDayClassName?e.props.weekDayClassName(c):void 0;return m.createElement("div",{key:i,"aria-label":H(c,"EEEE",e.props.locale),className:Z("react-datepicker__day-name",l)},u)}))},e.formatWeekday=function(n,s){return e.props.formatWeekDay?mc(n,e.props.formatWeekDay,s):e.props.useWeekdaysShort?wc(n,s):gc(n,s)},e.decreaseYear=function(){e.setState(function(n){var s,o=n.date;return{date:Ue(o,e.props.showYearPicker?(s=e.props.yearItemNumber)!==null&&s!==void 0?s:r.defaultProps.yearItemNumber:1)}},function(){return e.handleYearChange(e.state.date)})},e.clearSelectingDate=function(){e.setState({selectingDate:void 0})},e.renderPreviousButton=function(){var n,s,o;if(!e.props.renderCustomHeader){var i=(n=e.props.monthsShown)!==null&&n!==void 0?n:r.defaultProps.monthsShown,c=e.props.showPreviousMonths?i-1:0,u=(s=e.props.monthSelectedIn)!==null&&s!==void 0?s:c,l=Ie(e.state.date,u),d;switch(!0){case e.props.showMonthYearPicker:d=Bn(e.state.date,e.props);break;case e.props.showYearPicker:d=kc(e.state.date,e.props);break;case e.props.showQuarterYearPicker:d=vc(e.state.date,e.props);break;default:d=$n(l,e.props);break}if(!(!((o=e.props.forceShowMonthNavigation)!==null&&o!==void 0?o:r.defaultProps.forceShowMonthNavigation)&&!e.props.showDisabledMonthNavigation&&d||e.props.showTimeSelectOnly)){var f=["react-datepicker__navigation-icon","react-datepicker__navigation-icon--previous"],p=["react-datepicker__navigation","react-datepicker__navigation--previous"],h=e.decreaseMonth;(e.props.showMonthYearPicker||e.props.showQuarterYearPicker||e.props.showYearPicker)&&(h=e.decreaseYear),d&&e.props.showDisabledMonthNavigation&&(p.push("react-datepicker__navigation--previous--disabled"),h=void 0);var g=e.props.showMonthYearPicker||e.props.showQuarterYearPicker||e.props.showYearPicker,w=e.props,k=w.previousMonthButtonLabel,S=k===void 0?r.defaultProps.previousMonthButtonLabel:k,x=w.previousYearButtonLabel,N=x===void 0?r.defaultProps.previousYearButtonLabel:x,q=e.props,$=q.previousMonthAriaLabel,I=$===void 0?typeof S=="string"?S:"Previous Month":$,_=q.previousYearAriaLabel,M=_===void 0?typeof N=="string"?N:"Previous Year":_;return m.createElement("button",{type:"button",className:p.join(" "),onClick:h,onKeyDown:e.props.handleOnKeyDown,"aria-label":g?M:I},m.createElement("span",{className:f.join(" ")},g?N:S))}}},e.increaseYear=function(){e.setState(function(n){var s,o=n.date;return{date:ge(o,e.props.showYearPicker?(s=e.props.yearItemNumber)!==null&&s!==void 0?s:r.defaultProps.yearItemNumber:1)}},function(){return e.handleYearChange(e.state.date)})},e.renderNextButton=function(){var n;if(!e.props.renderCustomHeader){var s;switch(!0){case e.props.showMonthYearPicker:s=qn(e.state.date,e.props);break;case e.props.showYearPicker:s=_c(e.state.date,e.props);break;case e.props.showQuarterYearPicker:s=bc(e.state.date,e.props);break;default:s=Qn(e.state.date,e.props);break}if(!(!((n=e.props.forceShowMonthNavigation)!==null&&n!==void 0?n:r.defaultProps.forceShowMonthNavigation)&&!e.props.showDisabledMonthNavigation&&s||e.props.showTimeSelectOnly)){var o=["react-datepicker__navigation","react-datepicker__navigation--next"],i=["react-datepicker__navigation-icon","react-datepicker__navigation-icon--next"];e.props.showTimeSelect&&o.push("react-datepicker__navigation--next--with-time"),e.props.todayButton&&o.push("react-datepicker__navigation--next--with-today-button");var c=e.increaseMonth;(e.props.showMonthYearPicker||e.props.showQuarterYearPicker||e.props.showYearPicker)&&(c=e.increaseYear),s&&e.props.showDisabledMonthNavigation&&(o.push("react-datepicker__navigation--next--disabled"),c=void 0);var u=e.props.showMonthYearPicker||e.props.showQuarterYearPicker||e.props.showYearPicker,l=e.props,d=l.nextMonthButtonLabel,f=d===void 0?r.defaultProps.nextMonthButtonLabel:d,p=l.nextYearButtonLabel,h=p===void 0?r.defaultProps.nextYearButtonLabel:p,g=e.props,w=g.nextMonthAriaLabel,k=w===void 0?typeof f=="string"?f:"Next Month":w,S=g.nextYearAriaLabel,x=S===void 0?typeof h=="string"?h:"Next Year":S;return m.createElement("button",{type:"button",className:o.join(" "),onClick:c,onKeyDown:e.props.handleOnKeyDown,"aria-label":u?x:k},m.createElement("span",{className:i.join(" ")},u?h:f))}}},e.renderCurrentMonth=function(n){n===void 0&&(n=e.state.date);var s=["react-datepicker__current-month"];return e.props.showYearDropdown&&s.push("react-datepicker__current-month--hasYearDropdown"),e.props.showMonthDropdown&&s.push("react-datepicker__current-month--hasMonthDropdown"),e.props.showMonthYearDropdown&&s.push("react-datepicker__current-month--hasMonthYearDropdown"),m.createElement("h2",{className:s.join(" ")},H(n,e.props.dateFormat,e.props.locale))},e.renderYearDropdown=function(n){if(n===void 0&&(n=!1),!(!e.props.showYearDropdown||n))return m.createElement(qc,E({},r.defaultProps,e.props,{date:e.state.date,onChange:e.changeYear,year:P(e.state.date)}))},e.renderMonthDropdown=function(n){if(n===void 0&&(n=!1),!(!e.props.showMonthDropdown||n))return m.createElement(Fc,E({},r.defaultProps,e.props,{month:te(e.state.date),onChange:e.changeMonth}))},e.renderMonthYearDropdown=function(n){if(n===void 0&&(n=!1),!(!e.props.showMonthYearDropdown||n))return m.createElement(Ac,E({},r.defaultProps,e.props,{date:e.state.date,onChange:e.changeMonthYear}))},e.handleTodayButtonClick=function(n){e.props.onSelect(Fn(),n),e.props.setPreSelection&&e.props.setPreSelection(Fn())},e.renderTodayButton=function(){if(!(!e.props.todayButton||e.props.showTimeSelectOnly))return m.createElement("div",{className:"react-datepicker__today-button",onClick:e.handleTodayButtonClick},e.props.todayButton)},e.renderDefaultHeader=function(n){var s=n.monthDate,o=n.i;return m.createElement("div",{className:"react-datepicker__header ".concat(e.props.showTimeSelect?"react-datepicker__header--has-time-select":"")},e.renderCurrentMonth(s),m.createElement("div",{className:"react-datepicker__header__dropdown react-datepicker__header__dropdown--".concat(e.props.dropdownMode),onFocus:e.handleDropdownFocus},e.renderMonthDropdown(o!==0),e.renderMonthYearDropdown(o!==0),e.renderYearDropdown(o!==0)),m.createElement("div",{className:"react-datepicker__day-names"},e.header(s)))},e.renderCustomHeader=function(n){var s,o,i=n.monthDate,c=n.i;if(e.props.showTimeSelect&&!e.state.monthContainer||e.props.showTimeSelectOnly)return null;var u=$n(e.state.date,e.props),l=Qn(e.state.date,e.props),d=Bn(e.state.date,e.props),f=qn(e.state.date,e.props),p=!e.props.showMonthYearPicker&&!e.props.showQuarterYearPicker&&!e.props.showYearPicker;return m.createElement("div",{className:"react-datepicker__header react-datepicker__header--custom",onFocus:e.props.onDropdownFocus},(o=(s=e.props).renderCustomHeader)===null||o===void 0?void 0:o.call(s,E(E({},e.state),{customHeaderCount:c,monthDate:i,changeMonth:e.changeMonth,changeYear:e.changeYear,decreaseMonth:e.decreaseMonth,increaseMonth:e.increaseMonth,decreaseYear:e.decreaseYear,increaseYear:e.increaseYear,prevMonthButtonDisabled:u,nextMonthButtonDisabled:l,prevYearButtonDisabled:d,nextYearButtonDisabled:f})),p&&m.createElement("div",{className:"react-datepicker__day-names"},e.header(i)))},e.renderYearHeader=function(n){var s=n.monthDate,o=e.props,i=o.showYearPicker,c=o.yearItemNumber,u=c===void 0?r.defaultProps.yearItemNumber:c,l=xe(s,u),d=l.startPeriod,f=l.endPeriod;return m.createElement("div",{className:"react-datepicker__header react-datepicker-year-header"},i?"".concat(d," - ").concat(f):P(s))},e.renderHeader=function(n){var s=n.monthDate,o=n.i,i=o===void 0?0:o,c={monthDate:s,i};switch(!0){case e.props.renderCustomHeader!==void 0:return e.renderCustomHeader(c);case(e.props.showMonthYearPicker||e.props.showQuarterYearPicker||e.props.showYearPicker):return e.renderYearHeader(c);default:return e.renderDefaultHeader(c)}},e.renderMonths=function(){var n,s;if(!(e.props.showTimeSelectOnly||e.props.showYearPicker)){for(var o=[],i=(n=e.props.monthsShown)!==null&&n!==void 0?n:r.defaultProps.monthsShown,c=e.props.showPreviousMonths?i-1:0,u=e.props.showMonthYearPicker||e.props.showQuarterYearPicker?ge(e.state.date,c):Ie(e.state.date,c),l=(s=e.props.monthSelectedIn)!==null&&s!==void 0?s:c,d=0;d0;o.push(m.createElement("div",{key:h,ref:function(k){e.monthContainer=k??void 0},className:"react-datepicker__month-container"},e.renderHeader({monthDate:p,i:d}),m.createElement(Ic,E({},r.defaultProps,e.props,{ariaLabelPrefix:e.props.monthAriaLabelPrefix,day:p,onDayClick:e.handleDayClick,handleOnKeyDown:e.props.handleOnDayKeyDown,handleOnMonthKeyDown:e.props.handleOnKeyDown,onDayMouseEnter:e.handleDayMouseEnter,onMouseLeave:e.handleMonthMouseLeave,orderInDisplay:d,selectingDate:e.state.selectingDate,monthShowsDuplicateDaysEnd:g,monthShowsDuplicateDaysStart:w}))))}return o}},e.renderYears=function(){if(!e.props.showTimeSelectOnly&&e.props.showYearPicker)return m.createElement("div",{className:"react-datepicker__year--container"},e.renderHeader({monthDate:e.state.date}),m.createElement($c,E({},r.defaultProps,e.props,{selectingDate:e.state.selectingDate,date:e.state.date,onDayClick:e.handleDayClick,clearSelectingDate:e.clearSelectingDate,onYearMouseEnter:e.handleYearMouseEnter,onYearMouseLeave:e.handleYearMouseLeave})))},e.renderTimeSection=function(){if(e.props.showTimeSelect&&(e.state.monthContainer||e.props.showTimeSelectOnly))return m.createElement(Hc,E({},r.defaultProps,e.props,{onChange:e.props.onTimeChange,format:e.props.timeFormat,intervals:e.props.timeIntervals,monthRef:e.state.monthContainer}))},e.renderInputTimeSection=function(){var n=e.props.selected?new Date(e.props.selected):void 0,s=n&&Qt(n)&&!!e.props.selected,o=s?"".concat(Vn(n.getHours()),":").concat(Vn(n.getMinutes())):"";if(e.props.showTimeInput)return m.createElement(Tc,E({},r.defaultProps,e.props,{date:n,timeString:o,onChange:e.props.onTimeChange}))},e.renderAriaLiveRegion=function(){var n,s=xe(e.state.date,(n=e.props.yearItemNumber)!==null&&n!==void 0?n:r.defaultProps.yearItemNumber),o=s.startPeriod,i=s.endPeriod,c;return e.props.showYearPicker?c="".concat(o," - ").concat(i):e.props.showMonthYearPicker||e.props.showQuarterYearPicker?c=P(e.state.date):c="".concat(fn(te(e.state.date),e.props.locale)," ").concat(P(e.state.date)),m.createElement("span",{role:"alert","aria-live":"polite",className:"react-datepicker__aria-live"},e.state.isRenderAriaLiveMessage&&c)},e.renderChildren=function(){if(e.props.children)return m.createElement("div",{className:"react-datepicker__children-container"},e.props.children)},e.containerRef=v.createRef(),e.state={date:e.getDateInView(),selectingDate:void 0,monthContainer:void 0,isRenderAriaLiveMessage:!1},e}return Object.defineProperty(r,"defaultProps",{get:function(){return{monthsShown:1,forceShowMonthNavigation:!1,timeCaption:"Time",previousYearButtonLabel:"Previous Year",nextYearButtonLabel:"Next Year",previousMonthButtonLabel:"Previous Month",nextMonthButtonLabel:"Next Month",yearItemNumber:lt}},enumerable:!1,configurable:!0}),r.prototype.componentDidMount=function(){var t=this;this.props.showTimeSelect&&(this.assignMonthContainer=function(){t.setState({monthContainer:t.monthContainer})}())},r.prototype.componentDidUpdate=function(t){var e=this;if(this.props.preSelection&&(!O(this.props.preSelection,t.preSelection)||this.props.monthSelectedIn!==t.monthSelectedIn)){var n=!ee(this.state.date,this.props.preSelection);this.setState({date:this.props.preSelection},function(){return n&&e.handleCustomMonthChange(e.state.date)})}else this.props.openToDate&&!O(this.props.openToDate,t.openToDate)&&this.setState({date:this.props.openToDate})},r.prototype.render=function(){var t=this.props.container||ic;return m.createElement($t,{onClickOutside:this.handleClickOutside,style:{display:"contents"},containerRef:this.containerRef,ignoreClass:this.props.outsideClickIgnoreClass},m.createElement(t,{className:Z("react-datepicker",this.props.className,{"react-datepicker--time-only":this.props.showTimeSelectOnly}),showTime:this.props.showTimeSelect||this.props.showTimeInput,showTimeSelectOnly:this.props.showTimeSelectOnly},this.renderAriaLiveRegion(),this.renderPreviousButton(),this.renderNextButton(),this.renderMonths(),this.renderYears(),this.renderTodayButton(),this.renderTimeSection(),this.renderInputTimeSection(),this.renderChildren()))},r}(v.Component),jc=function(a){var r=a.icon,t=a.className,e=t===void 0?"":t,n=a.onClick,s="react-datepicker__calendar-icon";if(typeof r=="string")return m.createElement("i",{className:"".concat(s," ").concat(r," ").concat(e),"aria-hidden":"true",onClick:n});if(m.isValidElement(r)){var o=r;return m.cloneElement(o,{className:"".concat(o.props.className||""," ").concat(s," ").concat(e),onClick:function(i){typeof o.props.onClick=="function"&&o.props.onClick(i),typeof n=="function"&&n(i)}})}return m.createElement("svg",{className:"".concat(s," ").concat(e),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512",onClick:n},m.createElement("path",{d:"M96 32V64H48C21.5 64 0 85.5 0 112v48H448V112c0-26.5-21.5-48-48-48H352V32c0-17.7-14.3-32-32-32s-32 14.3-32 32V64H160V32c0-17.7-14.3-32-32-32S96 14.3 96 32zM448 192H0V464c0 26.5 21.5 48 48 48H400c26.5 0 48-21.5 48-48V192z"}))},Nr=function(a){z(r,a);function r(t){var e=a.call(this,t)||this;return e.portalRoot=null,e.el=document.createElement("div"),e}return r.prototype.componentDidMount=function(){this.portalRoot=(this.props.portalHost||document).getElementById(this.props.portalId),this.portalRoot||(this.portalRoot=document.createElement("div"),this.portalRoot.setAttribute("id",this.props.portalId),(this.props.portalHost||document.body).appendChild(this.portalRoot)),this.portalRoot.appendChild(this.el)},r.prototype.componentWillUnmount=function(){this.portalRoot&&this.portalRoot.removeChild(this.el)},r.prototype.render=function(){return Lr.createPortal(this.props.children,this.el)},r}(v.Component),Xc="[tabindex], a, button, input, select, textarea",Gc=function(a){return(a instanceof HTMLAnchorElement||!a.disabled)&&a.tabIndex!==-1},Yr=function(a){z(r,a);function r(t){var e=a.call(this,t)||this;return e.getTabChildren=function(){var n;return Array.prototype.slice.call((n=e.tabLoopRef.current)===null||n===void 0?void 0:n.querySelectorAll(Xc),1,-1).filter(Gc)},e.handleFocusStart=function(){var n=e.getTabChildren();n&&n.length>1&&n[n.length-1].focus()},e.handleFocusEnd=function(){var n=e.getTabChildren();n&&n.length>1&&n[0].focus()},e.tabLoopRef=v.createRef(),e}return r.prototype.render=function(){var t;return((t=this.props.enableTabLoop)!==null&&t!==void 0?t:r.defaultProps.enableTabLoop)?m.createElement("div",{className:"react-datepicker__tab-loop",ref:this.tabLoopRef},m.createElement("div",{className:"react-datepicker__tab-loop__start",tabIndex:0,onFocus:this.handleFocusStart}),this.props.children,m.createElement("div",{className:"react-datepicker__tab-loop__end",tabIndex:0,onFocus:this.handleFocusEnd})):this.props.children},r.defaultProps={enableTabLoop:!0},r}(v.Component);function zc(a){var r=function(t){var e,n=typeof t.hidePopper=="boolean"?t.hidePopper:!0,s=v.useRef(null),o=oc(E({open:!n,whileElementsMounted:Hr,placement:t.popperPlacement,middleware:me([$r({padding:15}),Qr(10),Br({element:s})],(e=t.popperModifiers)!==null&&e!==void 0?e:[],!0)},t.popperProps)),i=E(E({},t),{hidePopper:n,popperProps:E(E({},o),{arrowRef:s})});return m.createElement(a,E({},i))};return r}var Zc=function(a){z(r,a);function r(){return a!==null&&a.apply(this,arguments)||this}return Object.defineProperty(r,"defaultProps",{get:function(){return{hidePopper:!0}},enumerable:!1,configurable:!0}),r.prototype.render=function(){var t=this.props,e=t.className,n=t.wrapperClassName,s=t.hidePopper,o=s===void 0?r.defaultProps.hidePopper:s,i=t.popperComponent,c=t.targetComponent,u=t.enableTabLoop,l=t.popperOnKeyDown,d=t.portalId,f=t.portalHost,p=t.popperProps,h=t.showArrow,g=void 0;if(!o){var w=Z("react-datepicker-popper",e);g=m.createElement(Yr,{enableTabLoop:u},m.createElement("div",{ref:p.refs.setFloating,style:p.floatingStyles,className:w,"data-placement":p.placement,onKeyDown:l},i,h&&m.createElement(Ji,{ref:p.arrowRef,context:p.context,fill:"currentColor",strokeWidth:1,height:8,width:16,style:{transform:"translateY(-1px)"},className:"react-datepicker__triangle"})))}this.props.popperContainer&&(g=v.createElement(this.props.popperContainer,{},g)),d&&!o&&(g=m.createElement(Nr,{portalId:d,portalHost:f},g));var k=Z("react-datepicker-wrapper",n);return m.createElement(m.Fragment,null,m.createElement("div",{ref:p.refs.setReference,className:k},c),g)},r}(v.Component),Jc=zc(Zc),Zn="react-datepicker-ignore-onclickoutside";function eu(a,r){return a&&r?te(a)!==te(r)||P(a)!==P(r):a!==r}var Gt="Date input not valid.",hu=function(a){z(r,a);function r(t){var e=a.call(this,t)||this;return e.calendar=null,e.input=null,e.getPreSelection=function(){return e.props.openToDate?e.props.openToDate:e.props.selectsEnd&&e.props.startDate?e.props.startDate:e.props.selectsStart&&e.props.endDate?e.props.endDate:R()},e.modifyHolidays=function(){var n;return(n=e.props.holidays)===null||n===void 0?void 0:n.reduce(function(s,o){var i=new Date(o.date);return Qt(i)?me(me([],s,!0),[E(E({},o),{date:i})],!1):s},[])},e.calcInitialState=function(){var n,s=e.getPreSelection(),o=Tr(e.props),i=Or(e.props),c=o&&Fe(s,_t(o))?o:i&&Pe(s,Ln(i))?i:s;return{open:e.props.startOpen||!1,preventFocus:!1,inputValue:null,preSelection:(n=e.props.selectsRange?e.props.startDate:e.props.selected)!==null&&n!==void 0?n:c,highlightDates:Kn(e.props.highlightDates),focused:!1,shouldFocusDayInline:!1,isRenderAriaLiveMessage:!1,wasHidden:!1}},e.resetHiddenStatus=function(){e.setState(E(E({},e.state),{wasHidden:!1}))},e.setHiddenStatus=function(){e.setState(E(E({},e.state),{wasHidden:!0}))},e.setHiddenStateOnVisibilityHidden=function(){document.visibilityState==="hidden"&&e.setHiddenStatus()},e.clearPreventFocusTimeout=function(){e.preventFocusTimeout&&clearTimeout(e.preventFocusTimeout)},e.safeFocus=function(){setTimeout(function(){var n,s;(s=(n=e.input)===null||n===void 0?void 0:n.focus)===null||s===void 0||s.call(n,{preventScroll:!0})},0)},e.safeBlur=function(){setTimeout(function(){var n,s;(s=(n=e.input)===null||n===void 0?void 0:n.blur)===null||s===void 0||s.call(n)},0)},e.setFocus=function(){e.safeFocus()},e.setBlur=function(){e.safeBlur(),e.cancelFocusInput()},e.setOpen=function(n,s){s===void 0&&(s=!1),e.setState({open:n,preSelection:n&&e.state.open?e.state.preSelection:e.calcInitialState().preSelection,lastPreSelectChange:zt},function(){n||e.setState(function(o){return{focused:s?o.focused:!1}},function(){!s&&e.setBlur(),e.setState({inputValue:null})})})},e.inputOk=function(){return we(e.state.preSelection)},e.isCalendarOpen=function(){return e.props.open===void 0?e.state.open&&!e.props.disabled&&!e.props.readOnly:e.props.open},e.handleFocus=function(n){var s,o,i=e.state.wasHidden,c=i?e.state.open:!0;i&&e.resetHiddenStatus(),e.state.preventFocus||((o=(s=e.props).onFocus)===null||o===void 0||o.call(s,n),c&&!e.props.preventOpenOnFocus&&!e.props.readOnly&&e.setOpen(!0)),e.setState({focused:!0})},e.sendFocusBackToInput=function(){e.preventFocusTimeout&&e.clearPreventFocusTimeout(),e.setState({preventFocus:!0},function(){e.preventFocusTimeout=setTimeout(function(){e.setFocus(),e.setState({preventFocus:!1})})})},e.cancelFocusInput=function(){clearTimeout(e.inputFocusTimeout),e.inputFocusTimeout=void 0},e.deferFocusInput=function(){e.cancelFocusInput(),e.inputFocusTimeout=setTimeout(function(){return e.setFocus()},1)},e.handleDropdownFocus=function(){e.cancelFocusInput()},e.handleBlur=function(n){var s,o;(!e.state.open||e.props.withPortal||e.props.showTimeInput)&&((o=(s=e.props).onBlur)===null||o===void 0||o.call(s,n)),e.state.open&&e.props.open===!1&&e.setOpen(!1),e.setState({focused:!1})},e.handleCalendarClickOutside=function(n){var s,o;e.props.inline||e.setOpen(!1),(o=(s=e.props).onClickOutside)===null||o===void 0||o.call(s,n),e.props.withPortal&&n.preventDefault()},e.handleChange=function(){for(var n,s,o,i,c,u=[],l=0;l=Q){ie=A;break}f&&iep&&(ne=D.ArrowLeft,ie=se(p,e.props)?_(ne,ie):p),se(ie,e.props)?((ne===D.PageUp||ne===D.Home)&&(ne=D.ArrowRight),(ne===D.PageDown||ne===D.End)&&(ne=D.ArrowLeft),ie=_(ne,ie)):Xe=!0,hn++}return ie};if(q===D.Enter){n.preventDefault(),e.handleSelect(I,n),!w&&e.setPreSelection(I);return}else if(q===D.Escape){n.preventDefault(),e.setOpen(!1),e.inputOk()||(c=(i=e.props).onInputError)===null||c===void 0||c.call(i,{code:1,msg:Gt});return}var F=null;switch(q){case D.ArrowLeft:case D.ArrowRight:case D.ArrowUp:case D.ArrowDown:case D.PageUp:case D.PageDown:case D.Home:case D.End:F=M(q,I);break}if(!F){(l=(u=e.props).onInputError)===null||l===void 0||l.call(u,{code:1,msg:Gt});return}if(n.preventDefault(),e.setState({lastPreSelectChange:zt}),x&&e.setSelected(F),e.setPreSelection(F),N){var X=te(I),K=te(F),J=P(I),le=P(F);X!==K||J!==le?e.setState({shouldFocusDayInline:!0}):e.setState({shouldFocusDayInline:!1})}}},e.onPopperKeyDown=function(n){var s=n.key;s===D.Escape&&(n.preventDefault(),e.sendFocusBackToInput())},e.onClearClick=function(n){n&&n.preventDefault&&n.preventDefault(),e.sendFocusBackToInput();var s=e.props,o=s.selectsRange,i=s.onChange;o?i==null||i([null,null],n):i==null||i(null,n),e.setState({inputValue:null})},e.clear=function(){e.onClearClick()},e.onScroll=function(n){typeof e.props.closeOnScroll=="boolean"&&e.props.closeOnScroll?(n.target===document||n.target===document.documentElement||n.target===document.body)&&e.setOpen(!1):typeof e.props.closeOnScroll=="function"&&e.props.closeOnScroll(n)&&e.setOpen(!1)},e.renderCalendar=function(){var n,s;return!e.props.inline&&!e.isCalendarOpen()?null:m.createElement(Uc,E({showMonthYearDropdown:void 0,ref:function(o){e.calendar=o}},e.props,e.state,{setOpen:e.setOpen,dateFormat:(n=e.props.dateFormatCalendar)!==null&&n!==void 0?n:r.defaultProps.dateFormatCalendar,onSelect:e.handleSelect,onClickOutside:e.handleCalendarClickOutside,holidays:xc(e.modifyHolidays()),outsideClickIgnoreClass:Zn,onDropdownFocus:e.handleDropdownFocus,onTimeChange:e.handleTimeChange,className:e.props.calendarClassName,container:e.props.calendarContainer,handleOnKeyDown:e.props.onKeyDown,handleOnDayKeyDown:e.onDayKeyDown,setPreSelection:e.setPreSelection,dropdownMode:(s=e.props.dropdownMode)!==null&&s!==void 0?s:r.defaultProps.dropdownMode}),e.props.children)},e.renderAriaLiveRegion=function(){var n=e.props,s=n.dateFormat,o=s===void 0?r.defaultProps.dateFormat:s,i=n.locale,c=e.props.showTimeInput||e.props.showTimeSelect,u=c?"PPPPp":"PPPP",l;return e.props.selectsRange?l="Selected start date: ".concat(re(e.props.startDate,{dateFormat:u,locale:i}),". ").concat(e.props.endDate?"End date: "+re(e.props.endDate,{dateFormat:u,locale:i}):""):e.props.showTimeSelectOnly?l="Selected time: ".concat(re(e.props.selected,{dateFormat:o,locale:i})):e.props.showYearPicker?l="Selected year: ".concat(re(e.props.selected,{dateFormat:"yyyy",locale:i})):e.props.showMonthYearPicker?l="Selected month: ".concat(re(e.props.selected,{dateFormat:"MMMM yyyy",locale:i})):e.props.showQuarterYearPicker?l="Selected quarter: ".concat(re(e.props.selected,{dateFormat:"yyyy, QQQ",locale:i})):l="Selected date: ".concat(re(e.props.selected,{dateFormat:u,locale:i})),m.createElement("span",{role:"alert","aria-live":"polite",className:"react-datepicker__aria-live"},l)},e.renderDateInput=function(){var n,s,o,i=Z(e.props.className,(n={},n[Zn]=e.state.open,n)),c=e.props.customInput||m.createElement("input",{type:"text"}),u=e.props.customInputRef||"ref",l=e.props,d=l.dateFormat,f=d===void 0?r.defaultProps.dateFormat:d,p=l.locale,h=typeof e.props.value=="string"?e.props.value:typeof e.state.inputValue=="string"?e.state.inputValue:e.props.selectsRange?uc(e.props.startDate,e.props.endDate,{dateFormat:f,locale:p}):e.props.selectsMultiple?lc((o=e.props.selectedDates)!==null&&o!==void 0?o:[],{dateFormat:f,locale:p}):re(e.props.selected,{dateFormat:f,locale:p});return v.cloneElement(c,(s={},s[u]=function(g){e.input=g},s.value=h,s.onBlur=e.handleBlur,s.onChange=e.handleChange,s.onClick=e.onInputClick,s.onFocus=e.handleFocus,s.onKeyDown=e.onInputKeyDown,s.id=e.props.id,s.name=e.props.name,s.form=e.props.form,s.autoFocus=e.props.autoFocus,s.placeholder=e.props.placeholderText,s.disabled=e.props.disabled,s.autoComplete=e.props.autoComplete,s.className=Z(c.props.className,i),s.title=e.props.title,s.readOnly=e.props.readOnly,s.required=e.props.required,s.tabIndex=e.props.tabIndex,s["aria-describedby"]=e.props.ariaDescribedBy,s["aria-invalid"]=e.props.ariaInvalid,s["aria-labelledby"]=e.props.ariaLabelledBy,s["aria-required"]=e.props.ariaRequired,s))},e.renderClearButton=function(){var n=e.props,s=n.isClearable,o=n.disabled,i=n.selected,c=n.startDate,u=n.endDate,l=n.clearButtonTitle,d=n.clearButtonClassName,f=d===void 0?"":d,p=n.ariaLabelClose,h=p===void 0?"Close":p,g=n.selectedDates;return s&&(i!=null||c!=null||u!=null||g!=null&&g.length)?m.createElement("button",{type:"button",className:Z("react-datepicker__close-icon",f,{"react-datepicker__close-icon--disabled":o}),disabled:o,"aria-label":h,onClick:e.onClearClick,title:l,tabIndex:-1}):null},e.state=e.calcInitialState(),e.preventFocusTimeout=void 0,e}return Object.defineProperty(r,"defaultProps",{get:function(){return{allowSameDay:!1,dateFormat:"MM/dd/yyyy",dateFormatCalendar:"LLLL yyyy",disabled:!1,disabledKeyboardNavigation:!1,dropdownMode:"scroll",preventOpenOnFocus:!1,monthsShown:1,readOnly:!1,withPortal:!1,selectsDisabledDaysInRange:!1,shouldCloseOnSelect:!0,showTimeSelect:!1,showTimeInput:!1,showPreviousMonths:!1,showMonthYearPicker:!1,showFullMonthYearPicker:!1,showTwoColumnMonthYearPicker:!1,showFourColumnMonthYearPicker:!1,showYearPicker:!1,showQuarterYearPicker:!1,showWeekPicker:!1,strictParsing:!1,swapRange:!1,timeIntervals:30,timeCaption:"Time",previousMonthAriaLabel:"Previous Month",previousMonthButtonLabel:"Previous Month",nextMonthAriaLabel:"Next Month",nextMonthButtonLabel:"Next Month",previousYearAriaLabel:"Previous Year",previousYearButtonLabel:"Previous Year",nextYearAriaLabel:"Next Year",nextYearButtonLabel:"Next Year",timeInputLabel:"Time",enableTabLoop:!0,yearItemNumber:lt,focusSelectedMonth:!1,showPopperArrow:!0,excludeScrollbar:!0,customTimeInput:null,calendarStartDay:void 0,toggleCalendarOnIconClick:!1,usePointerEvent:!1}},enumerable:!1,configurable:!0}),r.prototype.componentDidMount=function(){window.addEventListener("scroll",this.onScroll,!0),document.addEventListener("visibilitychange",this.setHiddenStateOnVisibilityHidden)},r.prototype.componentDidUpdate=function(t,e){var n,s,o,i;t.inline&&eu(t.selected,this.props.selected)&&this.setPreSelection(this.props.selected),this.state.monthSelectedIn!==void 0&&t.monthsShown!==this.props.monthsShown&&this.setState({monthSelectedIn:0}),t.highlightDates!==this.props.highlightDates&&this.setState({highlightDates:Kn(this.props.highlightDates)}),!e.focused&&!Ee(t.selected,this.props.selected)&&this.setState({inputValue:null}),e.open!==this.state.open&&(e.open===!1&&this.state.open===!0&&((s=(n=this.props).onCalendarOpen)===null||s===void 0||s.call(n)),e.open===!0&&this.state.open===!1&&((i=(o=this.props).onCalendarClose)===null||i===void 0||i.call(o)))},r.prototype.componentWillUnmount=function(){this.clearPreventFocusTimeout(),window.removeEventListener("scroll",this.onScroll,!0),document.removeEventListener("visibilitychange",this.setHiddenStateOnVisibilityHidden)},r.prototype.renderInputContainer=function(){var t=this.props,e=t.showIcon,n=t.icon,s=t.calendarIconClassname,o=t.calendarIconClassName,i=t.toggleCalendarOnIconClick,c=this.state.open;return s&&console.warn("calendarIconClassname props is deprecated. should use calendarIconClassName props."),m.createElement("div",{className:"react-datepicker__input-container".concat(e?" react-datepicker__view-calendar-icon":"")},e&&m.createElement(jc,E({icon:n,className:Z(o,!o&&s,c&&"react-datepicker-ignore-onclickoutside")},i?{onClick:this.toggleCalendar}:null)),this.state.isRenderAriaLiveMessage&&this.renderAriaLiveRegion(),this.renderDateInput(),this.renderClearButton())},r.prototype.render=function(){var t=this.renderCalendar();if(this.props.inline)return t;if(this.props.withPortal){var e=this.state.open?m.createElement(Yr,{enableTabLoop:this.props.enableTabLoop},m.createElement("div",{className:"react-datepicker__portal",tabIndex:-1,onKeyDown:this.onPortalKeyDown},t)):null;return this.state.open&&this.props.portalId&&(e=m.createElement(Nr,E({portalId:this.props.portalId},this.props),e)),m.createElement("div",null,this.renderInputContainer(),e)}return m.createElement(Jc,E({},this.props,{className:this.props.popperClassName,hidePopper:!this.isCalendarOpen(),targetComponent:this.renderInputContainer(),popperComponent:t,popperOnKeyDown:this.onPopperKeyDown,showArrow:this.props.showPopperArrow}))},r}(v.Component),tu="input",zt="navigate";export{hu as D,lu as a,iu as b,ou as c,as as d,du as e,cu as f,uu as g,fu as h,Gr as i,pu as p}; diff --git a/pkg/ui/frontend/dist/assets/index-BbvoJYjW.js b/pkg/ui/frontend/dist/assets/index-BbvoJYjW.js new file mode 100644 index 0000000000000..b9ca1eb2e55d9 --- /dev/null +++ b/pkg/ui/frontend/dist/assets/index-BbvoJYjW.js @@ -0,0 +1,63 @@ +import{j as e,S as Ee,c as br,P as ae,e as Be,B as po,E as yr,G as mo,T as fo,H as go,I as vr,J as ho,K as xo,L as bo,M as jr,u as wr,N as yo,V as Nr,a as vo,g as jo,b as wt,d as me,O as wo,n as No,p as ko,m as So}from"./radix-core-mDeFS0Pz.js";import{c as kr,r as i,b as ze}from"./react-core-D_V7s-9r.js";import{u as Ft,a as nt,L as de,b as Sr,c as Eo,d as Co,R as To,e as Ro,f as Ao,g as _o}from"./react-router-CHYnaA34.js";import{t as Io,c as vs,a as Ce}from"./ui-utils-BNSC_Jv-.js";import{S as Fo,M as Lo,C as Er,R as Po,H as Do,a as Ge,b as Oo,A as Ys,c as cs,d as Cr,e as Lt,X as js,f as Tr,P as $o,L as xe,g as ot,h as Rr,i as Mo,j as Bo,k as it,l as Ar,F as zo,m as Vo,D as _r,n as Ir,o as Uo,G as ws,p as qo,q as Go,r as Ho,s as Ko,t as Wo,U as Zo,u as Yo,B as Xo}from"./ui-icons-CjYyohUG.js";import{f as Qo,a as Jo,b as Fr,c as Nt,p as ds,i as Ye,d as ei,e as Xs,g as ti,h as si,D as Qs}from"./date-utils-B7GSU5zA.js";import{R as Lr,I as ri,T as Pr,a as ai,S as Dr,b as Or,P as ni,C as $r,V as oi,L as Mr,c as Br,d as ii,e as li,f as zr,g as ci,h as di,i as Vr,j as ui,k as Ur,l as qr,m as Gr}from"./radix-inputs-CUuf_8as.js";import{S as Hr,d as Kr,P as pi,C as Wr,e as Zr,f as Yr,g as Xr,h as Qr,L as Jr,i as ea,j as mi,T as fi,k as ta,V as gi,l as hi,m as sa,n as xi,o as ra,p as aa,q as na,r as bi,c as yi}from"./radix-navigation-WDVJ59Wc.js";import{R as Ns,P as ks,O as lt,C as ct,a as oa,T as Pt,D as Dt,b as ia,c as vi,d as ji,e as wi,f as Ni,g as ki,h as la}from"./radix-layout-CuQMCqor.js";import{R as dt,P as Ot,a as $t,C as Mt,T as ut,d as Si,B as Ei,b as Ci,Y as Ti,X as Ri,c as Ai}from"./data-viz-BuFFX-vG.js";import{u as Bt,a as _i,Q as Ii,b as Fi}from"./query-management-D8IQJSUy.js";import{z as Li}from"./theme-utils-CNom64Sw.js";import{u as Pi,F as Di,C as Oi,o as $i,r as Mi,a as Bi,b as ca,s as Xe,d as Js,c as da}from"./form-libs-B6JBoFJD.js";(function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))a(n);new MutationObserver(n=>{for(const o of n)if(o.type==="childList")for(const l of o.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&a(l)}).observe(document,{childList:!0,subtree:!0});function r(n){const o={};return n.integrity&&(o.integrity=n.integrity),n.referrerPolicy&&(o.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?o.credentials="include":n.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function a(n){if(n.ep)return;n.ep=!0;const o=r(n);fetch(n.href,o)}})();var ua,er=kr;ua=er.createRoot,er.hydrateRoot;function v(...t){return Io(vs(t))}function fe(t){if(t===0)return"0 B";const s=1024,r=["B","KB","MB","GB","TB","PB"],a=Math.floor(Math.log(t)/Math.log(s));return`${parseFloat((t/Math.pow(s,a)).toFixed(2))} ${r[a]}`}function $e(t,s){return t?Object.keys(t).find(r=>pa(t[r],s)):null}function pa(t,s){var r;return((r=t.services)==null?void 0:r.some(a=>a.service===s))??!1}const zi=Ce("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),q=i.forwardRef(({className:t,variant:s,size:r,asChild:a=!1,...n},o)=>{const l=a?Ee:"button";return e.jsx(l,{className:v(zi({variant:s,size:r,className:t})),ref:o,...n})});q.displayName="Button";function Vi(){return e.jsx(q,{variant:"ghost",size:"icon",className:"bg-muted hover:bg-muted-hover rounded-lg",asChild:!0,children:e.jsxs("a",{href:"https://github.com/grafana/loki",target:"_blank",rel:"noopener noreferrer",children:[e.jsx("svg",{viewBox:"0 0 438.549 438.549",className:"h-[1.2rem] w-[1.2rem]",children:e.jsx("path",{fill:"currentColor",d:"M409.132 114.573c-19.608-33.596-46.205-60.194-79.798-79.8-33.598-19.607-70.277-29.408-110.063-29.408-39.781 0-76.472 9.804-110.063 29.408-33.596 19.605-60.192 46.204-79.8 79.8C9.803 148.168 0 184.854 0 224.63c0 47.78 13.94 90.745 41.827 128.906 27.884 38.164 63.906 64.572 108.063 79.227 5.14.954 8.945.283 11.419-1.996 2.475-2.282 3.711-5.14 3.711-8.562 0-.571-.049-5.708-.144-15.417a2549.81 2549.81 0 01-.144-25.406l-6.567 1.136c-4.187.767-9.469 1.092-15.846 1-6.374-.089-12.991-.757-19.842-1.999-6.854-1.231-13.229-4.086-19.13-8.559-5.898-4.473-10.085-10.328-12.56-17.556l-2.855-6.57c-1.903-4.374-4.899-9.233-8.992-14.559-4.093-5.331-8.232-8.945-12.419-10.848l-1.999-1.431c-1.332-.951-2.568-2.098-3.711-3.429-1.142-1.331-1.997-2.663-2.568-3.997-.572-1.335-.098-2.43 1.427-3.289 1.525-.859 4.281-1.276 8.28-1.276l5.708.853c3.807.763 8.516 3.042 14.133 6.851 5.614 3.806 10.229 8.754 13.846 14.842 4.38 7.806 9.657 13.754 15.846 17.847 6.184 4.093 12.419 6.136 18.699 6.136 6.28 0 11.704-.476 16.274-1.423 4.565-.952 8.848-2.383 12.847-4.285 1.713-12.758 6.377-22.559 13.988-29.41-10.848-1.14-20.601-2.857-29.264-5.14-8.658-2.286-17.605-5.996-26.835-11.14-9.235-5.137-16.896-11.516-22.985-19.126-6.09-7.614-11.088-17.61-14.987-29.979-3.901-12.374-5.852-26.648-5.852-42.826 0-23.035 7.52-42.637 22.557-58.817-7.044-17.318-6.379-36.732 1.997-58.24 5.52-1.715 13.706-.428 24.554 3.853 10.85 4.283 18.794 7.952 23.84 10.994 5.046 3.041 9.089 5.618 12.135 7.708 17.705-4.947 35.976-7.421 54.818-7.421s37.117 2.474 54.823 7.421l10.849-6.849c7.419-4.57 16.18-8.758 26.262-12.565 10.088-3.805 17.802-4.853 23.134-3.138 8.562 21.509 9.325 40.922 2.279 58.24 15.036 16.18 22.559 35.787 22.559 58.817 0 16.178-1.958 30.497-5.853 42.966-3.9 12.471-8.941 22.457-15.125 29.979-6.191 7.521-13.901 13.85-23.131 18.986-9.232 5.14-18.182 8.85-26.84 11.136-8.662 2.286-18.415 4.004-29.263 5.146 9.894 8.562 14.842 22.077 14.842 40.539v60.237c0 3.422 1.19 6.279 3.572 8.562 2.379 2.279 6.136 2.95 11.276 1.995 44.163-14.653 80.185-41.062 108.068-79.226 27.88-38.161 41.825-81.126 41.825-128.906-.01-39.771-9.818-76.454-29.414-110.049z"})}),e.jsx("span",{className:"sr-only",children:"View on GitHub"})]})})}const Ui={theme:"light",setTheme:()=>null},ma=i.createContext(Ui);function qi(){const t=i.useContext(ma);if(t===void 0)throw new Error("useTheme must be used within a ThemeProvider");return t}function Gi({children:t,defaultTheme:s="light",storageKey:r="loki-ui-theme",...a}){const[n,o]=i.useState(()=>{try{const c=localStorage.getItem(r);return c==="dark"||c==="light"?c:s}catch{return s}}),l=c=>{try{localStorage.setItem(r,c),o(c)}catch(d){console.error("Failed to save theme:",d)}};return i.useEffect(()=>{const c=window.document.documentElement;c.classList.remove("light","dark"),c.classList.add(n)},[n]),e.jsx(ma.Provider,{value:{theme:n,setTheme:l},...a,children:t})}function Hi(){const{theme:t,setTheme:s}=qi(),r=()=>{s(t==="light"?"dark":"light")};return e.jsxs(q,{variant:"ghost",size:"icon",className:"bg-muted hover:bg-muted-hover rounded-lg",onClick:r,children:[t==="light"?e.jsx(Fo,{className:"h-[1.2rem] w-[1.2rem]"}):e.jsx(Lo,{className:"h-[1.2rem] w-[1.2rem]"}),e.jsx("span",{className:"sr-only",children:"Toggle theme"})]})}function Ki(){return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Vi,{}),e.jsx(Hi,{})]})}const Ss=i.forwardRef(({...t},s)=>e.jsx("nav",{ref:s,"aria-label":"breadcrumb",...t}));Ss.displayName="Breadcrumb";const Es=i.forwardRef(({className:t,...s},r)=>e.jsx("ol",{ref:r,className:v("flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5",t),...s}));Es.displayName="BreadcrumbList";const kt=i.forwardRef(({className:t,...s},r)=>e.jsx("li",{ref:r,className:v("inline-flex items-center gap-1.5",t),...s}));kt.displayName="BreadcrumbItem";const St=i.forwardRef(({asChild:t,className:s,...r},a)=>{const n=t?Ee:"a";return e.jsx(n,{ref:a,className:v("transition-colors hover:text-foreground",s),...r})});St.displayName="BreadcrumbLink";const fa=i.forwardRef(({className:t,...s},r)=>e.jsx("span",{ref:r,role:"link","aria-disabled":"true","aria-current":"page",className:v("font-normal text-foreground",t),...s}));fa.displayName="BreadcrumbPage";const Et=({children:t,className:s,...r})=>e.jsx("li",{role:"presentation","aria-hidden":"true",className:v("[&>svg]:w-3.5 [&>svg]:h-3.5",s),...r,children:t??e.jsx(Er,{})});Et.displayName="BreadcrumbSeparator";const Wi=({match:t})=>{const s=t.params.nodeName;return e.jsx("span",{children:s})},Zi=({match:t})=>{const s=t.params.ringName;return e.jsx("span",{children:s})},ee=i.forwardRef(({className:t,...s},r)=>e.jsx("div",{ref:r,className:v("rounded-xl border bg-card text-card-foreground shadow",t),...s}));ee.displayName="Card";const se=i.forwardRef(({className:t,...s},r)=>e.jsx("div",{ref:r,className:v("flex flex-col space-y-1.5 p-6",t),...s}));se.displayName="CardHeader";const ne=i.forwardRef(({className:t,...s},r)=>e.jsx("div",{ref:r,className:v("font-semibold leading-none tracking-tight",t),...s}));ne.displayName="CardTitle";const Je=i.forwardRef(({className:t,...s},r)=>e.jsx("div",{ref:r,className:v("text-sm text-muted-foreground",t),...s}));Je.displayName="CardDescription";const te=i.forwardRef(({className:t,...s},r)=>e.jsx("div",{ref:r,className:v("p-6 pt-0",t),...s}));te.displayName="CardContent";const ga=i.forwardRef(({className:t,...s},r)=>e.jsx("div",{ref:r,className:v("flex items-center p-6 pt-0",t),...s}));ga.displayName="CardFooter";function Yi(){const t=Ft(),[s]=nt(),r=s.get("path")||window.location.pathname;return e.jsxs("div",{className:"flex min-h-[calc(100vh-12rem)] items-center justify-center bg-dot-pattern px-4",children:[e.jsxs(ee,{className:"w-full max-w-[450px] overflow-hidden",children:[e.jsxs(se,{className:"text-center pb-0",children:[e.jsxs("div",{className:"relative mb-8",children:[e.jsx("div",{className:"absolute inset-0 flex items-center justify-center"}),e.jsx("div",{className:"relative flex justify-center py-4",children:e.jsx("div",{className:"bg-white dark:bg-transparent p-2 rounded-full",children:e.jsx("img",{src:"https://grafana.com/media/docs/loki/logo-grafana-loki.png",alt:"Loki Logo",className:v("h-16 w-16 sm:h-24 sm:w-24","rotate-180 animate-swing hover:animate-shake cursor-pointer transition-all duration-300")})})})]}),e.jsx(ne,{className:"text-5xl sm:text-7xl font-bold bg-gradient-to-r from-primary to-primary/50 bg-clip-text text-transparent",children:"404"})]}),e.jsxs(te,{className:"text-center space-y-3 pb-8",children:[e.jsx("h2",{className:"text-xl sm:text-2xl font-semibold tracking-tight",children:"Oops! Page Not Found"}),e.jsx("p",{className:"text-sm sm:text-base text-muted-foreground",children:"Even with our powerful log aggregation, we couldn't find this page in any of our streams!"}),e.jsxs("p",{className:"text-xs sm:text-sm text-muted-foreground italic",children:["Error: LogQL query returned 0 results for label"," ",`{path="${r}"}`]})]}),e.jsxs(ga,{className:"flex justify-center gap-4 pb-8",children:[e.jsxs(q,{variant:"outline",onClick:()=>t(-1),className:"gap-2 group",size:"sm",children:[e.jsx(Po,{className:"h-4 w-4 group-hover:animate-spin"}),"Go Back"]}),e.jsxs(q,{onClick:()=>t("/"),className:"gap-2 group",size:"sm",children:[e.jsx(Do,{className:"h-4 w-4 group-hover:animate-bounce"}),"Go Home"]})]})]}),e.jsx("style",{children:` + .bg-dot-pattern { + background-image: radial-gradient(circle at 1px 1px, hsl(var(--muted-foreground) / 0.1) 1px, transparent 0); + background-size: 32px 32px; + } + @keyframes shake { + 0%, 100% { transform: rotate(180deg); } + 25% { transform: rotate(170deg); } + 75% { transform: rotate(190deg); } + } + @keyframes swing { + 0%, 100% { transform: rotate(180deg); } + 50% { transform: rotate(190deg); } + } + .animate-swing { + animation: swing 1s ease-in-out infinite; + } + .animate-shake { + animation: shake 0.3s ease-in-out; + } + `})]})}const J={INGESTER:"ingester",PARTITION_INGESTER:"partition-ingester",DISTRIBUTOR:"distributor",PATTERN_INGESTER:"pattern-ingester",QUERY_SCHEDULER:"query-scheduler",COMPACTOR:"compactor",RULER:"ruler",INDEX_GATEWAY:"index-gateway"},ha={0:"Unknown",1:"Pending",2:"Active",3:"Inactive",4:"Deleted"},Xi={cluster:null,error:null,isLoading:!0,refresh:()=>Promise.resolve()},xa=i.createContext(Xi);function pe(){const t=i.useContext(xa);if(!t)throw new Error("useCluster must be used within a ClusterProvider");return t}function Cs(){const s=window.location.pathname.match(/(.*\/ui\/)/);return(s==null?void 0:s[1])||"/ui/"}function re(t){return`${Cs()}${t.startsWith("/")?t.slice(1):t}`}function ba(t){const s=new Date(t);return`${Qo(s)} ago`}function ya(t){const s=new Date(t);return Jo(s,{format:"extended"})}function Ct(t){switch(typeof t=="string"?parseInt(t,10):t){case 2:return"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200";case 1:return"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200";case 3:return"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200";case 4:return"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200";default:return"bg-gray-100 text-gray-800 dark:bg-gray-900 dark:text-gray-200"}}function va(t){const s=t.split("").reduce((n,o)=>o.charCodeAt(0)+((n<<5)-n),0),r=["bg-rose-100 text-rose-800 dark:bg-rose-900 dark:text-rose-200","bg-orange-100 text-orange-800 dark:bg-orange-900 dark:text-orange-200","bg-amber-100 text-amber-800 dark:bg-amber-900 dark:text-amber-200","bg-lime-100 text-lime-800 dark:bg-lime-900 dark:text-lime-200","bg-teal-100 text-teal-800 dark:bg-teal-900 dark:text-teal-200","bg-cyan-100 text-cyan-800 dark:bg-cyan-900 dark:text-cyan-200","bg-indigo-100 text-indigo-800 dark:bg-indigo-900 dark:text-indigo-200","bg-fuchsia-100 text-fuchsia-800 dark:bg-fuchsia-900 dark:text-fuchsia-200"],a=Math.abs(s)%r.length;return r[a]}function Ts(t){const s=t.split("-");return s.length>=3?s[s.length-2]:""}function Qi(t){const s=["B","KiB","MiB","GiB","TiB"];let r=t,a=0;for(;r>=1024&&aObject.values(t).some(r=>pa(r,s)),ja={ingester:"ingester","partition-ring":"partition-ring",distributor:"distributor","pattern-ingester":"pattern-ingester","query-scheduler":"query-scheduler",compactor:"compactor",ruler:"ruler","index-gateway":"index-gateway"},ke={ingester:{title:"Ingester",ringName:J.INGESTER,ringPath:"/ring",needsTokens:!0},"partition-ring":{title:"Partition Ingester",ringName:J.PARTITION_INGESTER,ringPath:"/partition-ring",needsTokens:!0},distributor:{title:"Distributor",ringName:J.DISTRIBUTOR,ringPath:"/distributor/ring",needsTokens:!1},"pattern-ingester":{title:"Pattern Ingester",ringName:J.PATTERN_INGESTER,ringPath:"/pattern/ring",needsTokens:!0},"query-scheduler":{title:"Scheduler",ringName:J.QUERY_SCHEDULER,ringPath:"/scheduler/ring",needsTokens:!1},compactor:{title:"Compactor",ringName:J.COMPACTOR,ringPath:"/compactor/ring",needsTokens:!1},ruler:{title:"Ruler",ringName:J.RULER,ringPath:"/ruler/ring",needsTokens:!0},"index-gateway":{title:"Index Gateway",ringName:J.INDEX_GATEWAY,ringPath:"/indexgateway/ring",needsTokens:!0}};function wa(t){return Object.keys(ke).find(s=>ke[s].ringName===t)}function el(t){if(!t)return!1;const s=wa(t);return s?ke[s].needsTokens:!1}const tl=t=>{const s=[];if(!t)return s;for(const r in ke)Ji(t,r)&&s.push({title:ke[r].title,url:`/rings/${ke[r].ringName}`});return s};function Na(t,s){if(!t||!s)return"";const r=wa(s);if(!r)return"";const a=$e(t,r);if(!a)return"";const n=re(`/api/v1/proxy/${a}`),o=ke[r].ringPath,l=ke[r].needsTokens?"?tokens=true":"";return`${n}${o}${l}`}const ka=[{id:J.INGESTER,title:"Ingester"},{id:J.PARTITION_INGESTER,title:"Partition Ingester"},{id:J.DISTRIBUTOR,title:"Distributor"},{id:J.PATTERN_INGESTER,title:"Pattern Ingester"},{id:J.QUERY_SCHEDULER,title:"Scheduler"},{id:J.COMPACTOR,title:"Compactor"},{id:J.RULER,title:"Ruler"},{id:J.INDEX_GATEWAY,title:"Index Gateway"}];function sl(t){const s={};try{const r=/]*>([\s\S]*?)<\/tbody>/,a=t.match(r);if(!a)return s;const n=/]*>([\s\S]*?)<\/tr>/g,o=Array.from(a[1].matchAll(n));for(const l of o){const c=/]*>([\s\S]*?)<\/td>/g,d=Array.from(l[1].matchAll(c)).map(u=>u[1].trim().replace(/ /g,""));if(d.length>=10){const u=d[0],m=d[9].endsWith("%")?d[9]:`${d[9]}%`;s[u]=m}}}catch(r){console.error("Error parsing ring HTML:",r)}return s}function rl({ringName:t,isPaused:s=!1}){const{cluster:r}=pe(),[a,n]=i.useState(null),[o,l]=i.useState(""),[c,d]=i.useState(!1),u=i.useRef(),m=i.useMemo(()=>el(t),[t]),g=i.useCallback(()=>Na(r==null?void 0:r.members,t??""),[r,t]),y=i.useCallback(async()=>{if(!t){l("Ring name is required");return}const f=g();if(!f){l("No cluster members available");return}u.current&&u.current.abort(),u.current=new AbortController,d(!0);try{const x=await fetch(f,{headers:{Accept:"application/json"},signal:u.current.signal});if(!x.ok)throw new Error(`Failed to fetch ring: ${x.statusText}`);const b=await x.json();if(!b||!b.shards){n(null);return}const j=await fetch(f,{headers:{Accept:"text/plain"},signal:u.current.signal});if(!j.ok)throw new Error(`Failed to fetch ring ownership: ${j.statusText}`);const w=await j.text(),E=sl(w),C={...b,shards:b.shards.map(A=>({...A,ownership:E[A.id]||"0%"}))};n(C),l("")}catch(x){if(x instanceof Error&&x.name==="AbortError")return;console.error("Error fetching ring:",x),l(x instanceof Error?x.message:"Unknown error"),n(null)}finally{d(!1)}},[t,g]),N=i.useCallback(async f=>{const x=g();if(!x)throw new Error("Ring name and node name are required");let b=0;const j=f.length;for(const w of f)try{const E=new FormData;E.append("forget",w),(await fetch(x,{method:"POST",body:E})).ok&&b++}catch(E){console.error(`Error forgetting instance ${w}:`,E)}return{success:b,total:j}},[g]),{uniqueStates:h,uniqueZones:p}=i.useMemo(()=>{if(!(a!=null&&a.shards))return{uniqueStates:[],uniqueZones:[]};const f=new Set,x=new Set;return a.shards.forEach(b=>{const j=b.state||"unknown";j.trim()&&f.add(j),b.zone&&b.zone.trim()&&x.add(b.zone)}),{uniqueStates:Array.from(f).sort(),uniqueZones:Array.from(x).sort()}},[a==null?void 0:a.shards]);return i.useEffect(()=>()=>{u.current&&u.current.abort()},[]),i.useEffect(()=>{if(y(),!s){const f=setInterval(()=>{y()},5e3);return()=>{clearInterval(f)}}},[y,s]),{ring:a,error:o,isLoading:c,fetchRing:y,forgetInstances:N,uniqueStates:h,uniqueZones:p,isTokenBased:m}}const Pe=i.forwardRef(({className:t,...s},r)=>e.jsx(Lr,{ref:r,className:v("peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",t),...s,children:e.jsx(ri,{className:v("flex items-center justify-center text-current"),children:e.jsx(Ge,{className:"h-4 w-4"})})}));Pe.displayName=Lr.displayName;const Te=i.forwardRef(({className:t,...s},r)=>e.jsx("div",{className:"relative w-full overflow-auto",children:e.jsx("table",{ref:r,className:v("w-full caption-bottom text-sm",t),...s})}));Te.displayName="Table";const Re=i.forwardRef(({className:t,...s},r)=>e.jsx("thead",{ref:r,className:v("[&_tr]:border-b",t),...s}));Re.displayName="TableHeader";const Ae=i.forwardRef(({className:t,...s},r)=>e.jsx("tbody",{ref:r,className:v("[&_tr:last-child]:border-0",t),...s}));Ae.displayName="TableBody";const al=i.forwardRef(({className:t,...s},r)=>e.jsx("tfoot",{ref:r,className:v("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",t),...s}));al.displayName="TableFooter";const X=i.forwardRef(({className:t,...s},r)=>e.jsx("tr",{ref:r,className:v("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",t),...s}));X.displayName="TableRow";const D=i.forwardRef(({className:t,...s},r)=>e.jsx("th",{ref:r,className:v("h-10 px-2 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),...s}));D.displayName="TableHead";const F=i.forwardRef(({className:t,...s},r)=>e.jsx("td",{ref:r,className:v("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),...s}));F.displayName="TableCell";const nl=i.forwardRef(({className:t,...s},r)=>e.jsx("caption",{ref:r,className:v("mt-4 text-sm text-muted-foreground",t),...s}));nl.displayName="TableCaption";const ol=mi,il=fi,ll=i.forwardRef(({className:t,inset:s,children:r,...a},n)=>e.jsxs(Hr,{ref:n,className:v("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",s&&"pl-8",t),...a,children:[r,e.jsx(Er,{className:"ml-auto h-4 w-4"})]}));ll.displayName=Hr.displayName;const cl=i.forwardRef(({className:t,...s},r)=>e.jsx(Kr,{ref:r,className:v("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...s}));cl.displayName=Kr.displayName;const Sa=i.forwardRef(({className:t,sideOffset:s=4,...r},a)=>e.jsx(pi,{children:e.jsx(Wr,{ref:a,sideOffset:s,className:v("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...r})}));Sa.displayName=Wr.displayName;const us=i.forwardRef(({className:t,inset:s,...r},a)=>e.jsx(Zr,{ref:a,className:v("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",s&&"pl-8",t),...r}));us.displayName=Zr.displayName;const dl=i.forwardRef(({className:t,children:s,checked:r,...a},n)=>e.jsxs(Yr,{ref:n,className:v("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),checked:r,...a,children:[e.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(Xr,{children:e.jsx(Ge,{className:"h-4 w-4"})})}),s]}));dl.displayName=Yr.displayName;const ul=i.forwardRef(({className:t,children:s,...r},a)=>e.jsxs(Qr,{ref:a,className:v("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...r,children:[e.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(Xr,{children:e.jsx(Oo,{className:"h-2 w-2 fill-current"})})}),s]}));ul.displayName=Qr.displayName;const pl=i.forwardRef(({className:t,inset:s,...r},a)=>e.jsx(Jr,{ref:a,className:v("px-2 py-1.5 text-sm font-semibold",s&&"pl-8",t),...r}));pl.displayName=Jr.displayName;const ml=i.forwardRef(({className:t,...s},r)=>e.jsx(ea,{ref:r,className:v("-mx-1 my-1 h-px bg-muted",t),...s}));ml.displayName=ea.displayName;function Z({title:t,field:s,sortField:r,sortDirection:a,onSort:n}){const o=r===s,l=c=>{r===s&&a===c||n(s)};return e.jsx("div",{className:"flex items-center space-x-2",children:e.jsxs(ol,{children:[e.jsx(il,{asChild:!0,children:e.jsx(q,{variant:"ghost",size:"sm",className:"-ml-3 h-8 hover:bg-muted/50 data-[state=open]:bg-muted/50",children:e.jsxs("div",{className:"flex items-center",children:[e.jsx("span",{children:t}),o?a==="desc"?e.jsx(Ys,{className:"ml-2 h-4 w-4"}):e.jsx(cs,{className:"ml-2 h-4 w-4"}):e.jsx(Cr,{className:"ml-2 h-4 w-4"})]})})}),e.jsxs(Sa,{align:"start",children:[e.jsxs(us,{onClick:()=>l("asc"),className:v("cursor-pointer",o&&a==="asc"&&"bg-accent"),children:[e.jsx(cs,{className:"mr-2 h-3.5 w-3.5 text-muted-foreground/70"}),"Asc"]}),e.jsxs(us,{onClick:()=>l("desc"),className:v("cursor-pointer",o&&a==="desc"&&"bg-accent"),children:[e.jsx(Ys,{className:"mr-2 h-3.5 w-3.5 text-muted-foreground/70"}),"Desc"]})]})]})})}var Rs="Progress",As=100,[fl,Fm]=br(Rs),[gl,hl]=fl(Rs),Ea=i.forwardRef((t,s)=>{const{__scopeProgress:r,value:a=null,max:n,getValueLabel:o=xl,...l}=t;(n||n===0)&&!tr(n)&&console.error(bl(`${n}`,"Progress"));const c=tr(n)?n:As;a!==null&&!sr(a,c)&&console.error(yl(`${a}`,"Progress"));const d=sr(a,c)?a:null,u=Tt(d)?o(d,c):void 0;return e.jsx(gl,{scope:r,value:d,max:c,children:e.jsx(ae.div,{"aria-valuemax":c,"aria-valuemin":0,"aria-valuenow":Tt(d)?d:void 0,"aria-valuetext":u,role:"progressbar","data-state":Ra(d,c),"data-value":d??void 0,"data-max":c,...l,ref:s})})});Ea.displayName=Rs;var Ca="ProgressIndicator",Ta=i.forwardRef((t,s)=>{const{__scopeProgress:r,...a}=t,n=hl(Ca,r);return e.jsx(ae.div,{"data-state":Ra(n.value,n.max),"data-value":n.value??void 0,"data-max":n.max,...a,ref:s})});Ta.displayName=Ca;function xl(t,s){return`${Math.round(t/s*100)}%`}function Ra(t,s){return t==null?"indeterminate":t===s?"complete":"loading"}function Tt(t){return typeof t=="number"}function tr(t){return Tt(t)&&!isNaN(t)&&t>0}function sr(t,s){return Tt(t)&&!isNaN(t)&&t<=s&&t>=0}function bl(t,s){return`Invalid prop \`max\` of value \`${t}\` supplied to \`${s}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${As}\`.`}function yl(t,s){return`Invalid prop \`value\` of value \`${t}\` supplied to \`${s}\`. The \`value\` prop must be: + - a positive number + - less than the value passed to \`max\` (or ${As} if no \`max\` prop is set) + - \`null\` or \`undefined\` if the progress is indeterminate. + +Defaulting to \`null\`.`}var Aa=Ea,vl=Ta;const _a=i.forwardRef(({className:t,value:s,...r},a)=>e.jsx(Aa,{ref:a,className:v("relative h-2 w-full overflow-hidden rounded-full bg-primary/20",t),...r,children:e.jsx(vl,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(s||0)}%)`}})}));_a.displayName=Aa.displayName;function jl({visibleIds:t,selectedIds:s,onChange:r}){const a=t.every(o=>s.has(o)),n=()=>{const o=new Set(t);r(a?new Set([...s].filter(l=>!o.has(l))):new Set([...s,...t]))};return e.jsx(Pe,{checked:t.length>0&&a,onCheckedChange:n,"aria-label":"Select all visible instances"})}function wl({instances:t,selectedInstances:s,onSelectInstance:r,sortField:a,sortDirection:n,onSort:o,showTokens:l=!1}){return e.jsxs(Te,{children:[e.jsx(Re,{children:e.jsxs(X,{className:"hover:bg-transparent",children:[e.jsx(D,{className:"w-[50px]",children:e.jsx(jl,{visibleIds:t.map(c=>c.id),selectedIds:s,onChange:c=>{t.forEach(d=>{c.has(d.id)!==s.has(d.id)&&r(d.id)})}})}),e.jsx(D,{className:"w-[200px]",children:e.jsx(Z,{title:"ID",field:"id",sortField:a,sortDirection:n,onSort:o})}),e.jsx(D,{className:"w-[150px]",children:e.jsx(Z,{title:"State",field:"state",sortField:a,sortDirection:n,onSort:o})}),e.jsx(D,{children:e.jsx(Z,{title:"Address",field:"address",sortField:a,sortDirection:n,onSort:o})}),l&&e.jsx(D,{className:"w-[200px]",children:e.jsx(Z,{title:"Ownership",field:"ownership",sortField:a,sortDirection:n,onSort:o})}),e.jsx(D,{className:"w-[150px]",children:e.jsx(Z,{title:"Zone",field:"zone",sortField:a,sortDirection:n,onSort:o})}),e.jsx(D,{className:"w-[200px]",children:e.jsx(Z,{title:"Last Heartbeat",field:"timestamp",sortField:a,sortDirection:n,onSort:o})}),e.jsx(D,{className:"w-[50px]"})]})}),e.jsxs(Ae,{children:[t.map(c=>{const d=l?c.ownership:0;return e.jsxs(X,{children:[e.jsx(F,{children:e.jsx(Pe,{checked:s.has(c.id),onCheckedChange:()=>r(c.id),"aria-label":`Select instance ${c.id}`})}),e.jsx(F,{className:"font-medium",children:e.jsx(de,{to:`/nodes/${c.id}`,className:"hover:underline",children:c.id})}),e.jsx(F,{children:e.jsx("span",{className:v("inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium",Ct(c.state)),children:c.state})}),e.jsx(F,{children:c.address}),l&&e.jsx(F,{children:e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex justify-between text-xs",children:[e.jsx("span",{children:d}),e.jsxs("span",{className:"text-muted-foreground",children:[c.tokens.length," tokens"]})]}),e.jsx(_a,{value:typeof d=="number"?d:Number(d.slice(0,-1)),className:"h-2"})]})}),e.jsx(F,{children:c.zone?e.jsx("span",{className:v("inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium",va(c.zone)),children:c.zone}):e.jsx("span",{className:"text-muted-foreground",children:"-"})}),e.jsx(F,{children:e.jsx("span",{title:ya(c.timestamp),className:"text-muted-foreground",children:ba(c.timestamp)})}),e.jsx(F,{children:e.jsx(q,{variant:"ghost",size:"icon",asChild:!0,className:"h-8 w-8",title:"View instance details",children:e.jsx(de,{to:`/nodes/${c.id}`,children:e.jsx(Lt,{className:"h-4 w-4"})})})})]},c.id)}),t.length===0&&e.jsx(X,{children:e.jsx(F,{colSpan:7,className:"h-24 text-center",children:e.jsx("div",{className:"text-muted-foreground",children:"No instances found"})})})]})]})}const be=i.forwardRef(({className:t,type:s,...r},a)=>e.jsx("input",{type:s,className:v("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",t),ref:a,...r}));be.displayName="Input";var rr=1,Nl=.9,kl=.8,Sl=.17,Jt=.1,es=.999,El=.9999,Cl=.99,Tl=/[\\\/_+.#"@\[\(\{&]/,Rl=/[\\\/_+.#"@\[\(\{&]/g,Al=/[\s-]/,Ia=/[\s-]/g;function ps(t,s,r,a,n,o,l){if(o===s.length)return n===t.length?rr:Cl;var c=`${n},${o}`;if(l[c]!==void 0)return l[c];for(var d=a.charAt(o),u=r.indexOf(d,n),m=0,g,y,N,h;u>=0;)g=ps(t,s,r,a,u+1,o+1,l),g>m&&(u===n?g*=rr:Tl.test(t.charAt(u-1))?(g*=kl,N=t.slice(n,u-1).match(Rl),N&&n>0&&(g*=Math.pow(es,N.length))):Al.test(t.charAt(u-1))?(g*=Nl,h=t.slice(n,u-1).match(Ia),h&&n>0&&(g*=Math.pow(es,h.length))):(g*=Sl,n>0&&(g*=Math.pow(es,u-n))),t.charAt(u)!==s.charAt(o)&&(g*=El)),(gg&&(g=y*Jt)),g>m&&(m=g),u=r.indexOf(d,u+1);return l[c]=m,m}function ar(t){return t.toLowerCase().replace(Ia," ")}function _l(t,s,r){return t=r&&r.length>0?`${t+" "+r.join(" ")}`:t,ps(t,s,ar(t),ar(s),0,0,{})}var Fa={exports:{}},La={};/** + * @license React + * use-sync-external-store-shim.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Ue=i;function Il(t,s){return t===s&&(t!==0||1/t===1/s)||t!==t&&s!==s}var Fl=typeof Object.is=="function"?Object.is:Il,Ll=Ue.useState,Pl=Ue.useEffect,Dl=Ue.useLayoutEffect,Ol=Ue.useDebugValue;function $l(t,s){var r=s(),a=Ll({inst:{value:r,getSnapshot:s}}),n=a[0].inst,o=a[1];return Dl(function(){n.value=r,n.getSnapshot=s,ts(n)&&o({inst:n})},[t,r,s]),Pl(function(){return ts(n)&&o({inst:n}),t(function(){ts(n)&&o({inst:n})})},[t]),Ol(r),r}function ts(t){var s=t.getSnapshot;t=t.value;try{var r=s();return!Fl(t,r)}catch{return!0}}function Ml(t,s){return s()}var Bl=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Ml:$l;La.useSyncExternalStore=Ue.useSyncExternalStore!==void 0?Ue.useSyncExternalStore:Bl;Fa.exports=La;var zl=Fa.exports,Ze='[cmdk-group=""]',ss='[cmdk-group-items=""]',Vl='[cmdk-group-heading=""]',_s='[cmdk-item=""]',nr=`${_s}:not([aria-disabled="true"])`,ms="cmdk-item-select",Ie="data-value",Ul=(t,s,r)=>_l(t,s,r),Pa=i.createContext(void 0),pt=()=>i.useContext(Pa),Da=i.createContext(void 0),Is=()=>i.useContext(Da),Oa=i.createContext(void 0),$a=i.forwardRef((t,s)=>{let r=Me(()=>{var S,R;return{search:"",value:(R=(S=t.value)!=null?S:t.defaultValue)!=null?R:"",filtered:{count:0,items:new Map,groups:new Set}}}),a=Me(()=>new Set),n=Me(()=>new Map),o=Me(()=>new Map),l=Me(()=>new Set),c=Ma(t),{label:d,children:u,value:m,onValueChange:g,filter:y,shouldFilter:N,loop:h,disablePointerSelection:p=!1,vimBindings:f=!0,...x}=t,b=Be(),j=Be(),w=Be(),E=i.useRef(null),C=ec();De(()=>{if(m!==void 0){let S=m.trim();r.current.value=S,A.emit()}},[m]),De(()=>{C(6,W)},[]);let A=i.useMemo(()=>({subscribe:S=>(l.current.add(S),()=>l.current.delete(S)),snapshot:()=>r.current,setState:(S,R,$)=>{var L,G,H;if(!Object.is(r.current[S],R)){if(r.current[S]=R,S==="search")M(),Y(),C(1,K);else if(S==="value"&&($||C(5,W),((L=c.current)==null?void 0:L.value)!==void 0)){let oe=R??"";(H=(G=c.current).onValueChange)==null||H.call(G,oe);return}A.emit()}},emit:()=>{l.current.forEach(S=>S())}}),[]),B=i.useMemo(()=>({value:(S,R,$)=>{var L;R!==((L=o.current.get(S))==null?void 0:L.value)&&(o.current.set(S,{value:R,keywords:$}),r.current.filtered.items.set(S,z(R,$)),C(2,()=>{Y(),A.emit()}))},item:(S,R)=>(a.current.add(S),R&&(n.current.has(R)?n.current.get(R).add(S):n.current.set(R,new Set([S]))),C(3,()=>{M(),Y(),r.current.value||K(),A.emit()}),()=>{o.current.delete(S),a.current.delete(S),r.current.filtered.items.delete(S);let $=T();C(4,()=>{M(),($==null?void 0:$.getAttribute("id"))===S&&K(),A.emit()})}),group:S=>(n.current.has(S)||n.current.set(S,new Set),()=>{o.current.delete(S),n.current.delete(S)}),filter:()=>c.current.shouldFilter,label:d||t["aria-label"],getDisablePointerSelection:()=>c.current.disablePointerSelection,listId:b,inputId:w,labelId:j,listInnerRef:E}),[]);function z(S,R){var $,L;let G=(L=($=c.current)==null?void 0:$.filter)!=null?L:Ul;return S?G(S,r.current.search,R):0}function Y(){if(!r.current.search||c.current.shouldFilter===!1)return;let S=r.current.filtered.items,R=[];r.current.filtered.groups.forEach(L=>{let G=n.current.get(L),H=0;G.forEach(oe=>{let ue=S.get(oe);H=Math.max(ue,H)}),R.push([L,H])});let $=E.current;O().sort((L,G)=>{var H,oe;let ue=L.getAttribute("id"),gt=G.getAttribute("id");return((H=S.get(gt))!=null?H:0)-((oe=S.get(ue))!=null?oe:0)}).forEach(L=>{let G=L.closest(ss);G?G.appendChild(L.parentElement===G?L:L.closest(`${ss} > *`)):$.appendChild(L.parentElement===$?L:L.closest(`${ss} > *`))}),R.sort((L,G)=>G[1]-L[1]).forEach(L=>{var G;let H=(G=E.current)==null?void 0:G.querySelector(`${Ze}[${Ie}="${encodeURIComponent(L[0])}"]`);H==null||H.parentElement.appendChild(H)})}function K(){let S=O().find($=>$.getAttribute("aria-disabled")!=="true"),R=S==null?void 0:S.getAttribute(Ie);A.setState("value",R||void 0)}function M(){var S,R,$,L;if(!r.current.search||c.current.shouldFilter===!1){r.current.filtered.count=a.current.size;return}r.current.filtered.groups=new Set;let G=0;for(let H of a.current){let oe=(R=(S=o.current.get(H))==null?void 0:S.value)!=null?R:"",ue=(L=($=o.current.get(H))==null?void 0:$.keywords)!=null?L:[],gt=z(oe,ue);r.current.filtered.items.set(H,gt),gt>0&&G++}for(let[H,oe]of n.current)for(let ue of oe)if(r.current.filtered.items.get(ue)>0){r.current.filtered.groups.add(H);break}r.current.filtered.count=G}function W(){var S,R,$;let L=T();L&&(((S=L.parentElement)==null?void 0:S.firstChild)===L&&(($=(R=L.closest(Ze))==null?void 0:R.querySelector(Vl))==null||$.scrollIntoView({block:"nearest"})),L.scrollIntoView({block:"nearest"}))}function T(){var S;return(S=E.current)==null?void 0:S.querySelector(`${_s}[aria-selected="true"]`)}function O(){var S;return Array.from(((S=E.current)==null?void 0:S.querySelectorAll(nr))||[])}function V(S){let R=O()[S];R&&A.setState("value",R.getAttribute(Ie))}function Q(S){var R;let $=T(),L=O(),G=L.findIndex(oe=>oe===$),H=L[G+S];(R=c.current)!=null&&R.loop&&(H=G+S<0?L[L.length-1]:G+S===L.length?L[0]:L[G+S]),H&&A.setState("value",H.getAttribute(Ie))}function _(S){let R=T(),$=R==null?void 0:R.closest(Ze),L;for(;$&&!L;)$=S>0?Ql($,Ze):Jl($,Ze),L=$==null?void 0:$.querySelector(nr);L?A.setState("value",L.getAttribute(Ie)):Q(S)}let I=()=>V(O().length-1),P=S=>{S.preventDefault(),S.metaKey?I():S.altKey?_(1):Q(1)},U=S=>{S.preventDefault(),S.metaKey?V(0):S.altKey?_(-1):Q(-1)};return i.createElement(ae.div,{ref:s,tabIndex:-1,...x,"cmdk-root":"",onKeyDown:S=>{var R;if((R=x.onKeyDown)==null||R.call(x,S),!S.defaultPrevented)switch(S.key){case"n":case"j":{f&&S.ctrlKey&&P(S);break}case"ArrowDown":{P(S);break}case"p":case"k":{f&&S.ctrlKey&&U(S);break}case"ArrowUp":{U(S);break}case"Home":{S.preventDefault(),V(0);break}case"End":{S.preventDefault(),I();break}case"Enter":if(!S.nativeEvent.isComposing&&S.keyCode!==229){S.preventDefault();let $=T();if($){let L=new Event(ms);$.dispatchEvent(L)}}}}},i.createElement("label",{"cmdk-label":"",htmlFor:B.inputId,id:B.labelId,style:sc},d),zt(t,S=>i.createElement(Da.Provider,{value:A},i.createElement(Pa.Provider,{value:B},S))))}),ql=i.forwardRef((t,s)=>{var r,a;let n=Be(),o=i.useRef(null),l=i.useContext(Oa),c=pt(),d=Ma(t),u=(a=(r=d.current)==null?void 0:r.forceMount)!=null?a:l==null?void 0:l.forceMount;De(()=>{if(!u)return c.item(n,l==null?void 0:l.id)},[u]);let m=Ba(n,o,[t.value,t.children,o],t.keywords),g=Is(),y=Oe(C=>C.value&&C.value===m.current),N=Oe(C=>u||c.filter()===!1?!0:C.search?C.filtered.items.get(n)>0:!0);i.useEffect(()=>{let C=o.current;if(!(!C||t.disabled))return C.addEventListener(ms,h),()=>C.removeEventListener(ms,h)},[N,t.onSelect,t.disabled]);function h(){var C,A;p(),(A=(C=d.current).onSelect)==null||A.call(C,m.current)}function p(){g.setState("value",m.current,!0)}if(!N)return null;let{disabled:f,value:x,onSelect:b,forceMount:j,keywords:w,...E}=t;return i.createElement(ae.div,{ref:et([o,s]),...E,id:n,"cmdk-item":"",role:"option","aria-disabled":!!f,"aria-selected":!!y,"data-disabled":!!f,"data-selected":!!y,onPointerMove:f||c.getDisablePointerSelection()?void 0:p,onClick:f?void 0:h},t.children)}),Gl=i.forwardRef((t,s)=>{let{heading:r,children:a,forceMount:n,...o}=t,l=Be(),c=i.useRef(null),d=i.useRef(null),u=Be(),m=pt(),g=Oe(N=>n||m.filter()===!1?!0:N.search?N.filtered.groups.has(l):!0);De(()=>m.group(l),[]),Ba(l,c,[t.value,t.heading,d]);let y=i.useMemo(()=>({id:l,forceMount:n}),[n]);return i.createElement(ae.div,{ref:et([c,s]),...o,"cmdk-group":"",role:"presentation",hidden:g?void 0:!0},r&&i.createElement("div",{ref:d,"cmdk-group-heading":"","aria-hidden":!0,id:u},r),zt(t,N=>i.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?u:void 0},i.createElement(Oa.Provider,{value:y},N))))}),Hl=i.forwardRef((t,s)=>{let{alwaysRender:r,...a}=t,n=i.useRef(null),o=Oe(l=>!l.search);return!r&&!o?null:i.createElement(ae.div,{ref:et([n,s]),...a,"cmdk-separator":"",role:"separator"})}),Kl=i.forwardRef((t,s)=>{let{onValueChange:r,...a}=t,n=t.value!=null,o=Is(),l=Oe(m=>m.search),c=Oe(m=>m.value),d=pt(),u=i.useMemo(()=>{var m;let g=(m=d.listInnerRef.current)==null?void 0:m.querySelector(`${_s}[${Ie}="${encodeURIComponent(c)}"]`);return g==null?void 0:g.getAttribute("id")},[]);return i.useEffect(()=>{t.value!=null&&o.setState("search",t.value)},[t.value]),i.createElement(ae.input,{ref:s,...a,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":d.listId,"aria-labelledby":d.labelId,"aria-activedescendant":u,id:d.inputId,type:"text",value:n?t.value:l,onChange:m=>{n||o.setState("search",m.target.value),r==null||r(m.target.value)}})}),Wl=i.forwardRef((t,s)=>{let{children:r,label:a="Suggestions",...n}=t,o=i.useRef(null),l=i.useRef(null),c=pt();return i.useEffect(()=>{if(l.current&&o.current){let d=l.current,u=o.current,m,g=new ResizeObserver(()=>{m=requestAnimationFrame(()=>{let y=d.offsetHeight;u.style.setProperty("--cmdk-list-height",y.toFixed(1)+"px")})});return g.observe(d),()=>{cancelAnimationFrame(m),g.unobserve(d)}}},[]),i.createElement(ae.div,{ref:et([o,s]),...n,"cmdk-list":"",role:"listbox","aria-label":a,id:c.listId},zt(t,d=>i.createElement("div",{ref:et([l,c.listInnerRef]),"cmdk-list-sizer":""},d)))}),Zl=i.forwardRef((t,s)=>{let{open:r,onOpenChange:a,overlayClassName:n,contentClassName:o,container:l,...c}=t;return i.createElement(Ns,{open:r,onOpenChange:a},i.createElement(ks,{container:l},i.createElement(lt,{"cmdk-overlay":"",className:n}),i.createElement(ct,{"aria-label":t.label,"cmdk-dialog":"",className:o},i.createElement($a,{ref:s,...c}))))}),Yl=i.forwardRef((t,s)=>Oe(r=>r.filtered.count===0)?i.createElement(ae.div,{ref:s,...t,"cmdk-empty":"",role:"presentation"}):null),Xl=i.forwardRef((t,s)=>{let{progress:r,children:a,label:n="Loading...",...o}=t;return i.createElement(ae.div,{ref:s,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":n},zt(t,l=>i.createElement("div",{"aria-hidden":!0},l)))}),ie=Object.assign($a,{List:Wl,Item:ql,Input:Kl,Group:Gl,Separator:Hl,Dialog:Zl,Empty:Yl,Loading:Xl});function Ql(t,s){let r=t.nextElementSibling;for(;r;){if(r.matches(s))return r;r=r.nextElementSibling}}function Jl(t,s){let r=t.previousElementSibling;for(;r;){if(r.matches(s))return r;r=r.previousElementSibling}}function Ma(t){let s=i.useRef(t);return De(()=>{s.current=t}),s}var De=typeof window>"u"?i.useEffect:i.useLayoutEffect;function Me(t){let s=i.useRef();return s.current===void 0&&(s.current=t()),s}function et(t){return s=>{t.forEach(r=>{typeof r=="function"?r(s):r!=null&&(r.current=s)})}}function Oe(t){let s=Is(),r=()=>t(s.snapshot());return zl.useSyncExternalStore(s.subscribe,r,r)}function Ba(t,s,r,a=[]){let n=i.useRef(),o=pt();return De(()=>{var l;let c=(()=>{var u;for(let m of r){if(typeof m=="string")return m.trim();if(typeof m=="object"&&"current"in m)return m.current?(u=m.current.textContent)==null?void 0:u.trim():n.current}})(),d=a.map(u=>u.trim());o.value(t,c,d),(l=s.current)==null||l.setAttribute(Ie,c),n.current=c}),n}var ec=()=>{let[t,s]=i.useState(),r=Me(()=>new Map);return De(()=>{r.current.forEach(a=>a()),r.current=new Map},[t]),(a,n)=>{r.current.set(a,n),s({})}};function tc(t){let s=t.type;return typeof s=="function"?s(t.props):"render"in s?s.render(t.props):t}function zt({asChild:t,children:s},r){return t&&i.isValidElement(s)?i.cloneElement(tc(s),{ref:s.ref},r(s.props.children)):r(s)}var sc={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const za=Ns,rc=ks,Va=i.forwardRef(({className:t,...s},r)=>e.jsx(lt,{ref:r,className:v("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...s}));Va.displayName=lt.displayName;const Fs=i.forwardRef(({className:t,children:s,...r},a)=>e.jsxs(rc,{children:[e.jsx(Va,{}),e.jsxs(ct,{ref:a,className:v("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",t),...r,children:[s,e.jsxs(oa,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[e.jsx(js,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Fs.displayName=ct.displayName;const Ls=({className:t,...s})=>e.jsx("div",{className:v("flex flex-col space-y-1.5 text-center sm:text-left",t),...s});Ls.displayName="DialogHeader";const Ps=({className:t,...s})=>e.jsx("div",{className:v("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...s});Ps.displayName="DialogFooter";const Ds=i.forwardRef(({className:t,...s},r)=>e.jsx(Pt,{ref:r,className:v("text-lg font-semibold leading-none tracking-tight",t),...s}));Ds.displayName=Pt.displayName;const Os=i.forwardRef(({className:t,...s},r)=>e.jsx(Dt,{ref:r,className:v("text-sm text-muted-foreground",t),...s}));Os.displayName=Dt.displayName;const Ua=i.forwardRef(({className:t,...s},r)=>e.jsx(ie,{ref:r,className:v("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",t),...s}));Ua.displayName=ie.displayName;const qa=i.forwardRef(({className:t,...s},r)=>e.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[e.jsx(Tr,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),e.jsx(ie.Input,{ref:r,className:v("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",t),...s})]}));qa.displayName=ie.Input.displayName;const ac=i.forwardRef(({className:t,...s},r)=>e.jsx(ie.List,{ref:r,className:v("max-h-[300px] overflow-y-auto overflow-x-hidden",t),...s}));ac.displayName=ie.List.displayName;const Ga=i.forwardRef((t,s)=>e.jsx(ie.Empty,{ref:s,className:"py-6 text-center text-sm",...t}));Ga.displayName=ie.Empty.displayName;const Ha=i.forwardRef(({className:t,...s},r)=>e.jsx(ie.Group,{ref:r,className:v("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",t),...s}));Ha.displayName=ie.Group.displayName;const nc=i.forwardRef(({className:t,...s},r)=>e.jsx(ie.Separator,{ref:r,className:v("-mx-1 h-px bg-border",t),...s}));nc.displayName=ie.Separator.displayName;const fs=i.forwardRef(({className:t,...s},r)=>e.jsx(ie.Item,{ref:r,className:v("relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t),...s}));fs.displayName=ie.Item.displayName;const oc=mo,ic=fo,Ka=i.forwardRef(({className:t,align:s="center",sideOffset:r=4,...a},n)=>e.jsx(po,{children:e.jsx(yr,{ref:n,align:s,sideOffset:r,className:v("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...a})}));Ka.displayName=yr.displayName;function Le({options:t=[],selected:s=[],onChange:r,placeholder:a="Select options...",emptyMessage:n="No options found.",className:o}){const[l,c]=i.useState(!1),d=y=>{const N=s.includes(y)?s.filter(h=>h!==y):[...s,y];r(N)},u=()=>{s.length===t.length?r([]):r(t.map(y=>y.value))},m=s.length,g=t.length;return e.jsxs(oc,{open:l,onOpenChange:c,children:[e.jsx(ic,{asChild:!0,children:e.jsxs(q,{variant:"outline",role:"combobox","aria-expanded":l,className:v("justify-between",o),children:[m===0?a:`${m} selected`,e.jsx(Cr,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),e.jsx(Ka,{className:"w-[200px] p-0",children:e.jsxs(Ua,{children:[e.jsx(qa,{placeholder:a}),e.jsx(Ga,{children:n}),e.jsxs(Ha,{children:[g>0&&e.jsx(fs,{onSelect:u,children:e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Pe,{checked:m>0&&m===g,"aria-label":"Select all"}),e.jsx("span",{children:"Select all"})]})}),t.map(y=>e.jsx(fs,{onSelect:()=>d(y.value),children:e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Pe,{checked:s.includes(y.value)}),e.jsx("span",{children:y.label})]})},y.value))]})]})})]})}function lc({idFilter:t,onIdFilterChange:s,stateFilter:r,onStateFilterChange:a,zoneFilter:n,onZoneFilterChange:o,uniqueStates:l,uniqueZones:c}){return e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx(Tr,{className:"absolute left-2 top-2.5 h-4 w-4 text-muted-foreground"}),e.jsx(be,{placeholder:"Filter by ID...",value:t,onChange:d=>s(d.target.value),className:"pl-8"})]}),l.length>0&&e.jsx(Le,{options:l.map(d=>({value:d,label:d})),selected:r,onChange:a,placeholder:"Filter by State",className:"w-[180px]"}),c.length>0&&e.jsx(Le,{options:c.map(d=>({value:d,label:d})),selected:n,onChange:o,placeholder:"Filter by Zone",className:"w-[180px]"})]})}const cc=t=>{switch(t){case"ACTIVE":return"#22c55e";case"LEAVING":return"#eab308";case"PENDING":return"#3b82f6";case"JOINING":return"#a855f7";case"LEFT":return"#ef4444";default:return"#6b7280"}};function dc({instances:t}){const s=i.useMemo(()=>{const a=new Map;return t.forEach(n=>{const o=n.state||"unknown";a.set(o,(a.get(o)||0)+1)}),Array.from(a.entries()).sort((n,o)=>o[1]-n[1]).map(([n,o])=>({name:n,value:o,color:cc(n)}))},[t]),r=i.useMemo(()=>t.length,[t]);return s.length===0?null:e.jsxs("div",{className:"w-full h-[120px] relative",children:[e.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[e.jsx("div",{className:"text-xl font-bold",children:r}),e.jsx("div",{className:"text-xs text-muted-foreground",children:"Instances"})]}),e.jsx(dt,{width:"100%",height:"100%",children:e.jsxs(Ot,{children:[e.jsx($t,{data:s,cx:"50%",cy:"50%",labelLine:!1,outerRadius:60,innerRadius:42,dataKey:"value",paddingAngle:1,strokeWidth:1,children:s.map(a=>e.jsx(Mt,{fill:a.color,stroke:"hsl(var(--background))"},`cell-${a.name}`))}),e.jsx(ut,{content:({active:a,payload:n})=>{if(!a||!n||!n[0])return null;const o=n[0].payload;return e.jsxs("div",{className:"bg-background border rounded-lg shadow-lg px-3 py-2 flex items-center gap-2",children:[e.jsx("div",{className:"w-2.5 h-2.5 rounded-sm",style:{backgroundColor:o.color}}),e.jsx("span",{className:"text-sm font-medium",children:o.name}),e.jsx("span",{className:"text-sm font-semibold",children:o.value})]})}})]})})]})}function Wa({onRefresh:t,isPaused:s=!1,isLoading:r,className:a}){const[n,o]=i.useState(r);return i.useEffect(()=>{let l;return r?o(!0):l=setTimeout(()=>{o(!1)},1e3),()=>{l&&clearTimeout(l)}},[r]),e.jsxs("div",{className:`flex items-center gap-2 text-sm text-muted-foreground ${a}`,children:[e.jsx(q,{variant:"secondary",size:"sm",className:"h-6 px-2 text-xs hover:bg-muted",onClick:t,children:"Refresh now"}),s?e.jsx($o,{className:"h-3 w-3 text-orange-500"}):e.jsx(xe,{className:`h-3 w-3 ${n?"animate-spin text-emerald-500 ":"opacity-0 transition-opacity duration-1000"} `}),e.jsx("span",{className:"transition-opacity duration-1000",children:s?"Auto-refresh paused":n?"Refreshing...":""})]})}const uc=Ce("relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),He=i.forwardRef(({className:t,variant:s,...r},a)=>e.jsx("div",{ref:a,role:"alert",className:v(uc({variant:s}),t),...r}));He.displayName="Alert";const Ke=i.forwardRef(({className:t,...s},r)=>e.jsx("h5",{ref:r,className:v("mb-1 font-medium leading-none tracking-tight",t),...s}));Ke.displayName="AlertTitle";const We=i.forwardRef(({className:t,...s},r)=>e.jsx("div",{ref:r,className:v("text-sm [&_p]:leading-relaxed",t),...s}));We.displayName="AlertDescription";function Se({children:t,className:s,spacing:r=!0,...a}){return e.jsx("div",{className:"container p-6",children:e.jsx("div",{className:v(r&&"space-y-6",s),...a,children:t})})}function $s({error:t,ringName:s}){return t?e.jsx(Se,{children:e.jsxs(He,{variant:"destructive",children:[e.jsx(ot,{className:"h-4 w-4"}),e.jsx(Ke,{children:"Error"}),e.jsx(We,{children:t})]})}):s?null:e.jsx(Se,{children:e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center space-x-4",children:[e.jsx(Rr,{className:"h-6 w-6"}),e.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Rings"})]}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:ka.map(r=>e.jsx(de,{to:`/rings/${r.id}`,children:e.jsxs(ee,{className:"hover:bg-muted/50 transition-colors cursor-pointer",children:[e.jsx(se,{children:e.jsx(ne,{children:r.title})}),e.jsx(te,{children:e.jsxs("p",{className:"text-sm text-muted-foreground",children:["View and manage ",r.title.toLowerCase()," ring members"]})})]})},r.id))})]})})}const pc=5,mc=1e6;let rs=0;function fc(){return rs=(rs+1)%Number.MAX_SAFE_INTEGER,rs.toString()}const as=new Map,or=t=>{if(as.has(t))return;const s=setTimeout(()=>{as.delete(t),Qe({type:"REMOVE_TOAST",toastId:t})},mc);as.set(t,s)},gc=(t,s)=>{switch(s.type){case"ADD_TOAST":return{...t,toasts:[s.toast,...t.toasts].slice(0,pc)};case"UPDATE_TOAST":return{...t,toasts:t.toasts.map(r=>r.id===s.toast.id?{...r,...s.toast}:r)};case"DISMISS_TOAST":{const{toastId:r}=s;return r?or(r):t.toasts.forEach(a=>{or(a.id)}),{...t,toasts:t.toasts.map(a=>a.id===r||r===void 0?{...a,open:!1}:a)}}case"REMOVE_TOAST":return s.toastId===void 0?{...t,toasts:[]}:{...t,toasts:t.toasts.filter(r=>r.id!==s.toastId)}}},bt=[];let yt={toasts:[]};function Qe(t){yt=gc(yt,t),bt.forEach(s=>{s(yt)})}function hc({...t}){const s=fc(),r=n=>Qe({type:"UPDATE_TOAST",toast:{...n,id:s}}),a=()=>Qe({type:"DISMISS_TOAST",toastId:s});return Qe({type:"ADD_TOAST",toast:{...t,id:s,open:!0,onOpenChange:n=>{n||a()}}}),{id:s,dismiss:a,update:r}}function Vt(){const[t,s]=i.useState(yt);return i.useEffect(()=>(bt.push(s),()=>{const r=bt.indexOf(s);r>-1&&bt.splice(r,1)}),[t]),{...t,toast:hc,dismiss:r=>Qe({type:"DISMISS_TOAST",toastId:r})}}function xc({ringName:t}){var Q;const[s,r]=i.useState(new Set),[a,n]=i.useState(!1),[o,l]=i.useState(0),[c,d]=i.useState("id"),[u,m]=i.useState("asc"),[g,y]=i.useState(""),[N,h]=i.useState([]),[p,f]=i.useState([]),[x,b]=i.useState(!1),{ring:j,error:w,isLoading:E,fetchRing:C,forgetInstances:A,uniqueStates:B,uniqueZones:z,isTokenBased:Y}=rl({ringName:t,isPaused:s.size>0}),K=i.useMemo(()=>j!=null&&j.shards?j.shards.filter(_=>s.has(_.id)):[],[j==null?void 0:j.shards,s]),M=i.useCallback(_=>{d(I=>I===_?(m(P=>P==="asc"?"desc":"asc"),_):(m("asc"),_))},[]),W=i.useCallback(_=>{r(I=>{const P=new Set(I);return P.has(_)?P.delete(_):P.add(_),P})},[]),{toast:T}=Vt(),O=i.useCallback(async()=>{if(s.size!==0)try{n(!0),l(0);const{success:_,total:I}=await A(Array.from(s));_>0&&(await C(),r(new Set)),_j!=null&&j.shards?j.shards.filter(_=>{const I=_.id.toLowerCase().includes(g.toLowerCase()),P=N.length===0||N.includes(_.state),U=p.length===0||p.includes(_.zone);return I&&P&&U}).sort((_,I)=>{let P=0;switch(c){case"id":P=_.id.localeCompare(I.id);break;case"state":P=_.state.localeCompare(I.state);break;case"address":P=_.address.localeCompare(I.address);break;case"zone":P=(_.zone||"").localeCompare(I.zone||"");break;case"timestamp":P=new Date(_.timestamp).getTime()-new Date(I.timestamp).getTime();break;case"tokens":P=_.tokens.length-I.tokens.length;break;case"ownership":P=parseFloat(_.ownership)-parseFloat(I.ownership);break}return u==="asc"?P:-P}):[],[j==null?void 0:j.shards,g,N,p,c,u]);return w?e.jsx($s,{error:w,ringName:t}):e.jsxs("div",{className:"container space-y-6 p-6",children:[e.jsxs(ee,{children:[e.jsx(se,{children:e.jsxs("div",{className:"grid grid-cols-[1fr_auto] gap-8",children:[e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsxs(ne,{className:"text-3xl font-semibold tracking-tight",children:[((Q=ka.find(_=>_.id===t))==null?void 0:Q.title)||""," ","Ring Members"]}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"View and manage ring instances with their current status and configuration"})]}),e.jsxs("div",{className:"flex items-center justify-between min-h-[32px]",children:[e.jsx(Wa,{onRefresh:C,isPaused:s.size>0,isLoading:E}),s.size>0&&e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("span",{className:"text-sm text-muted-foreground",children:[s.size," instance",s.size!==1?"s":""," selected"]}),e.jsxs(q,{onClick:()=>b(!0),disabled:a,size:"sm",variant:"outline",className:v("border-red-200 bg-red-50 text-red-900 hover:bg-red-100 hover:text-red-900","dark:border-red-800 dark:bg-red-950 dark:text-red-200 dark:hover:bg-red-900","disabled:hover:bg-red-50 dark:disabled:hover:bg-red-950"),children:[a&&e.jsxs(e.Fragment,{children:[e.jsx(xe,{className:"mr-2 h-4 w-4 animate-spin"}),o>0&&e.jsxs("span",{className:"mr-2",children:[o,"/",s.size]})]}),"Forget Selected"]})]})]})]}),e.jsx("div",{className:"flex items-center",children:e.jsx("div",{className:"w-[250px]",children:(j==null?void 0:j.shards)&&e.jsx(dc,{instances:j.shards})})})]})}),e.jsxs(te,{className:"space-y-6",children:[e.jsx(lc,{idFilter:g,onIdFilterChange:y,stateFilter:N,onStateFilterChange:h,zoneFilter:p,onZoneFilterChange:f,uniqueStates:B,uniqueZones:z}),e.jsx("div",{className:"rounded-md border bg-card",children:e.jsx(wl,{instances:V,selectedInstances:s,onSelectInstance:W,sortField:c,sortDirection:u,onSort:M,showTokens:Y})})]})]}),e.jsx(za,{open:x,onOpenChange:b,children:e.jsxs(Fs,{children:[e.jsxs(Ls,{children:[e.jsx(Ds,{children:"Confirm Forget Instances"}),e.jsx(Os,{children:"Are you sure you want to forget the following instances? This action cannot be undone."})]}),e.jsx("div",{className:"max-h-[300px] overflow-y-auto",children:e.jsx("div",{className:"space-y-2",children:K.map(_=>e.jsxs("div",{className:"flex items-center justify-between p-2 rounded-md bg-muted",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"font-medium",children:_.id}),e.jsx("span",{className:v("inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium",Ct(_.state)),children:_.state})]}),e.jsx("span",{className:"text-sm text-muted-foreground",children:_.address})]},_.id))})}),e.jsxs(Ps,{children:[e.jsx(q,{variant:"outline",onClick:()=>b(!1),disabled:a,children:"Cancel"}),e.jsx(q,{variant:"outline",onClick:O,disabled:a,className:v("border-red-200 bg-red-50 text-red-900 hover:bg-red-100 hover:text-red-900","dark:border-red-800 dark:bg-red-950 dark:text-red-200 dark:hover:bg-red-900","disabled:hover:bg-red-50 dark:disabled:hover:bg-red-950"),children:a?e.jsxs(e.Fragment,{children:[e.jsx(xe,{className:"mr-2 h-4 w-4 animate-spin"}),"Forgetting..."]}):"Forget Instances"})]})]})})]})}const bc=()=>{const t=i.useRef({});return{fetchMetrics:i.useCallback(async({nodeNames:r,metrics:a})=>{if(!r.length)return{};const n={...t.current},o={};return await Promise.all(r.map(async l=>{try{const c=await fetch(re(`/api/v1/proxy/${l}/metrics`));if(!c.ok)throw new Error(`Failed to fetch metrics: ${c.statusText}`);const d=await c.text(),u={timestamp:Date.now(),values:{}};a.forEach(g=>{const y=new RegExp(`${g}\\{[^}]*\\}\\s+([\\d.e+]+)`),N=d.match(y);N&&(u.values[g]=parseFloat(N[1]))});const m=t.current[l];if(n[l]=u,m){const g=(u.timestamp-m.timestamp)/1e3;if(g>0){const y=a.map(N=>{const h=u.values[N],p=m.values[N];if(h!==void 0&&p!==void 0){const f=(h-p)/g;return{name:N,rate:f,currentValue:h}}return{name:N,rate:0,currentValue:h??0}});o[l]=y}}}catch(c){console.error(`Error fetching metrics for node ${l}:`,c)}})),t.current=n,o},[])}},yc={0:"PartitionUnknown",1:"PartitionPending",2:"PartitionActive",3:"PartitionInactive",4:"PartitionDeleted"};function vc({isPaused:t=!1}={}){const{cluster:s,isLoading:r}=pe(),[a,n]=i.useState({partitions:[],error:"",isLoading:!1}),o=i.useRef(),l=i.useCallback(()=>Na(s==null?void 0:s.members,J.PARTITION_INGESTER),[s]),{fetchMetrics:c}=bc(),d=i.useCallback(async()=>{if(!l()){n(g=>({...g,partitions:[],error:"No cluster members available",isLoading:!1}));return}o.current&&o.current.abort(),o.current=new AbortController;try{n(f=>({...f,isLoading:!0,error:""}));const g=await fetch(l(),{signal:o.current.signal,headers:{Accept:"application/json"}});if(!g.ok)throw new Error(`Failed to fetch partitions: ${g.statusText}`);const N=(await g.json()).partitions.flatMap(f=>f.owner_ids.map(x=>({...f,owner_id:x,owner_ids:[x],zone:Ts(x)}))),h=Array.from(new Set(N.map(f=>f.owner_ids).flat().filter(f=>f!==void 0))),p=await c({nodeNames:h,metrics:["loki_ingest_storage_reader_fetch_bytes_total","loki_ingest_storage_reader_fetch_compressed_bytes_total"]});n(f=>({...f,isLoading:!1,partitions:N.map(x=>{var j,w;if(!x.owner_id)return x;const b=p[x.owner_id]||[];return{...x,uncompressedRate:((j=b.find(E=>E.name==="loki_ingest_storage_reader_fetch_bytes_total"))==null?void 0:j.rate)||0,compressedRate:((w=b.find(E=>E.name==="loki_ingest_storage_reader_fetch_compressed_bytes_total"))==null?void 0:w.rate)||0}})}))}catch(g){g instanceof Error&&g.name!=="AbortError"&&n(y=>({...y,error:g instanceof Error?g.message:"Unknown error occurred",isLoading:!1}))}},[l,c]),u=i.useCallback(async(g,y)=>{if(!l())throw new Error("No cluster members available");const N=Array.from(new Set(g)),h=N.length;let p=0;return await Promise.allSettled(N.map(async f=>{const x=new FormData;x.append("action","change_state"),x.append("partition_id",f.toString());const b=yc[y];if(b===void 0)throw new Error(`Invalid partition state: ${y}`);x.append("partition_state",b.toString());const j=await fetch(l(),{method:"POST",body:x});if(!j.ok){const w=await j.text();throw new Error(`Failed to change state for partition ${f}: ${w}`)}return p++,f})),{success:p,total:h}},[l]),m=i.useMemo(()=>{const g=new Set,y=new Set,N={};return a.partitions.forEach(h=>{const p=h.state.toString();N[p]=(N[p]||0)+1,g.add(p),h.owner_ids.forEach(f=>{const x=f.split("-")[2];x&&y.add(x)})}),{partitionsByState:N,uniqueStates:Array.from(g).sort(),uniqueZones:Array.from(y).sort()}},[a.partitions]);return i.useEffect(()=>()=>{o.current&&o.current.abort()},[]),i.useEffect(()=>{if(d(),!t){const g=setInterval(d,5e3);return()=>clearInterval(g)}},[d,t]),{partitions:a.partitions,error:a.error,isLoading:a.isLoading||r,fetchPartitions:d,changePartitionState:u,...m}}function jc(t,s){return t===void 0||s===void 0||Math.abs((t-s)/s)<.1?null:t>s?"up":"down"}function wc({trend:t}){return t?t==="up"?e.jsx(Mo,{className:"inline h-4 w-4 text-green-500 ml-1"}):e.jsx(Bo,{className:"inline h-4 w-4 text-red-500 ml-1"}):null}function ir({currentRate:t,label:s,className:r}){const a=i.useRef(t),n=i.useMemo(()=>jc(t,a.current),[t]);return i.useEffect(()=>{const o=setTimeout(()=>{a.current=t},2e3);return()=>clearTimeout(o)},[t]),e.jsxs("span",{className:r,children:[Qi(t),"/s",s&&` ${s}`,e.jsx(wc,{trend:n})]})}function Nc({allPartitions:t,selectedIds:s,onChange:r}){const a=i.useMemo(()=>Array.from(new Set(t.map(l=>l.id))),[t]),n=a.every(l=>s.has(l)),o=()=>{r(n?new Set:new Set(a))};return e.jsx(Pe,{checked:a.length>0&&n,onCheckedChange:o,"aria-label":"Select all partitions"})}function kc(t){switch(t){case 2:return"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200";case 1:return"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200";case 3:return"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200";case 4:return"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200";default:return"bg-gray-100 text-gray-800 dark:bg-gray-900 dark:text-gray-200"}}const Sc=[{value:1,label:"Pending"},{value:2,label:"Active"},{value:3,label:"Inactive"},{value:4,label:"Deleted"}];function Ec({partitions:t,selectedPartitions:s,onSelectPartition:r,sortField:a,sortDirection:n,onSort:o}){const l=i.useMemo(()=>[...t].sort((c,d)=>{var m;let u=0;switch(a){case"uncompressed_rate":{u=(c.uncompressedRate||0)-(d.uncompressedRate||0);break}case"compressed_rate":{u=(c.compressedRate||0)-(d.compressedRate||0);break}case"id":u=c.id-d.id;break;case"state":u=c.state-d.state;break;case"owner":u=((m=c.owner_id)==null?void 0:m.localeCompare(d.owner_id||""))||0;break;case"zone":u=(c.zone||"").localeCompare(d.zone||"");break;case"timestamp":u=new Date(c.state_timestamp).getTime()-new Date(d.state_timestamp).getTime();break}return n==="asc"?u:-u}),[t,a,n]);return e.jsx(e.Fragment,{children:e.jsxs(Te,{children:[e.jsx(Re,{children:e.jsxs(X,{className:"hover:bg-transparent",children:[e.jsx(D,{className:"w-[50px]",children:e.jsx(Nc,{allPartitions:t,selectedIds:s,onChange:c=>{new Set(t.map(u=>u.id)).forEach(u=>{c.has(u)!==s.has(u)&&r(u)})}})}),e.jsx(D,{className:"w-[200px]",children:e.jsx(Z,{title:"Owner",field:"owner",sortField:a,sortDirection:n,onSort:o})}),e.jsx(D,{className:"w-[150px]",children:e.jsx(Z,{title:"Zone",field:"zone",sortField:a,sortDirection:n,onSort:o})}),e.jsx(D,{className:"w-[100px]",children:e.jsx(Z,{title:"Partition ID",field:"id",sortField:a,sortDirection:n,onSort:o})}),e.jsx(D,{className:"w-[150px]",children:e.jsx(Z,{title:"State",field:"state",sortField:a,sortDirection:n,onSort:o})}),e.jsx(D,{className:"w-[200px]",children:e.jsx(Z,{title:"Last Update",field:"timestamp",sortField:a,sortDirection:n,onSort:o})}),e.jsx(D,{className:"w-[150px]",children:e.jsx(Z,{title:"Uncompressed Rate",field:"uncompressed_rate",sortField:a,sortDirection:n,onSort:o})}),e.jsx(D,{className:"w-[150px]",children:e.jsx(Z,{title:"Compressed Rate",field:"compressed_rate",sortField:a,sortDirection:n,onSort:o})}),e.jsx(D,{className:"w-[100px]"})]})}),e.jsxs(Ae,{children:[l.map(c=>{var d;return e.jsxs(X,{children:[e.jsx(F,{children:e.jsx(Pe,{checked:s.has(c.id),onCheckedChange:()=>r(c.id),"aria-label":`Select partition ${c.id}`})}),e.jsx(F,{className:"font-medium",children:e.jsx(de,{to:`/nodes/${c.owner_id}`,className:"hover:underline",children:c.owner_id})}),e.jsx(F,{children:e.jsx("span",{className:v("inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium",va(c.zone||"")),children:c.zone||"-"})}),e.jsx(F,{children:e.jsx("span",{className:v("inline-flex items-center px-2 py-0.5 rounded-md text-xs font-medium",c.corrupted?"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200":"bg-muted"),title:c.corrupted?"Corrupted":void 0,children:c.id})}),e.jsx(F,{children:e.jsx("span",{className:v("inline-flex items-center px-2 py-0.5 rounded-md text-xs font-medium",kc(c.state)),children:((d=Sc.find(u=>u.value===c.state))==null?void 0:d.label)||"Unknown"})}),e.jsx(F,{children:e.jsx("span",{title:ya(c.state_timestamp),className:"text-muted-foreground",children:ba(c.state_timestamp)})}),e.jsx(F,{children:e.jsx(ir,{currentRate:c.uncompressedRate||0,className:"text-muted-foreground inline-flex items-center"})}),e.jsx(F,{children:e.jsx(ir,{currentRate:c.compressedRate||0,className:"text-muted-foreground inline-flex items-center"})}),e.jsx(F,{children:e.jsx("div",{className:"flex items-center gap-2",children:e.jsx(de,{to:`/nodes/${c.owner_id}`,className:"hover:underline",children:e.jsx(q,{variant:"ghost",size:"icon",className:"h-8 w-8",title:"View instance details",children:e.jsx(Lt,{className:"h-4 w-4"})})})})})]},`${c.owner_id}-${c.id}`)}),l.length===0&&e.jsx(X,{children:e.jsx(F,{colSpan:7,className:"h-24 text-center",children:e.jsx("div",{className:"text-muted-foreground",children:"No partitions found"})})})]})]})})}const Rt=ci,At=di,tt=i.forwardRef(({className:t,children:s,...r},a)=>e.jsxs(Pr,{ref:a,className:v("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",t),...r,children:[s,e.jsx(ai,{asChild:!0,children:e.jsx(it,{className:"h-4 w-4 opacity-50"})})]}));tt.displayName=Pr.displayName;const Za=i.forwardRef(({className:t,...s},r)=>e.jsx(Dr,{ref:r,className:v("flex cursor-default items-center justify-center py-1",t),...s,children:e.jsx(Ar,{className:"h-4 w-4"})}));Za.displayName=Dr.displayName;const Ya=i.forwardRef(({className:t,...s},r)=>e.jsx(Or,{ref:r,className:v("flex cursor-default items-center justify-center py-1",t),...s,children:e.jsx(it,{className:"h-4 w-4"})}));Ya.displayName=Or.displayName;const st=i.forwardRef(({className:t,children:s,position:r="popper",...a},n)=>e.jsx(ni,{children:e.jsxs($r,{ref:n,className:v("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:r,...a,children:[e.jsx(Za,{}),e.jsx(oi,{className:v("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:s}),e.jsx(Ya,{})]})}));st.displayName=$r.displayName;const Cc=i.forwardRef(({className:t,...s},r)=>e.jsx(Mr,{ref:r,className:v("px-2 py-1.5 text-sm font-semibold",t),...s}));Cc.displayName=Mr.displayName;const Ve=i.forwardRef(({className:t,children:s,...r},a)=>e.jsxs(Br,{ref:a,className:v("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...r,children:[e.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(ii,{children:e.jsx(Ge,{className:"h-4 w-4"})})}),e.jsx(li,{children:s})]}));Ve.displayName=Br.displayName;const Tc=i.forwardRef(({className:t,...s},r)=>e.jsx(zr,{ref:r,className:v("-mx-1 my-1 h-px bg-muted",t),...s}));Tc.displayName=zr.displayName;const Rc=t=>{switch(t){case 2:return"#22c55e";case 1:return"#3b82f6";case 3:return"#eab308";case 4:return"#ef4444";default:return"#6b7280"}};function Ac({partitions:t}){const s=i.useMemo(()=>{const a=new Map;return t.forEach(n=>{const o=n.state;a.set(o,(a.get(o)||0)+1)}),Array.from(a.entries()).sort((n,o)=>o[1]-n[1]).map(([n,o])=>({name:ha[n],value:o,color:Rc(n)}))},[t]),r=i.useMemo(()=>t.length,[t]);return s.length===0?null:e.jsxs("div",{className:"w-full h-[120px] relative",children:[e.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[e.jsx("div",{className:"text-xl font-bold",children:r}),e.jsx("div",{className:"text-xs text-muted-foreground",children:"Partitions"})]}),e.jsx(dt,{width:"100%",height:"100%",children:e.jsxs(Ot,{children:[e.jsx($t,{data:s,cx:"50%",cy:"50%",labelLine:!1,outerRadius:60,innerRadius:42,dataKey:"value",paddingAngle:1,strokeWidth:1,children:s.map(a=>e.jsx(Mt,{fill:a.color,stroke:"hsl(var(--background))"},`cell-${a.name}`))}),e.jsx(ut,{content:({active:a,payload:n})=>{if(!a||!n||!n[0])return null;const o=n[0].payload;return e.jsxs("div",{className:"bg-background border rounded-lg shadow-lg px-3 py-2 flex items-center gap-2",children:[e.jsx("div",{className:"w-2.5 h-2.5 rounded-sm",style:{backgroundColor:o.color}}),e.jsx("span",{className:"text-sm font-medium",children:o.name}),e.jsx("span",{className:"text-sm font-semibold",children:o.value})]})}})]})})]})}function _c({idFilter:t,onIdFilterChange:s,stateFilter:r,onStateFilterChange:a,zoneFilter:n,onZoneFilterChange:o,ownerFilter:l,onOwnerFilterChange:c,uniqueStates:d,partitions:u}){const m=d.map(p=>({value:p,label:ha[parseInt(p)]})),g=new Set;u.forEach(p=>{p.owner_ids.forEach(f=>{const x=Ts(f);x&&g.add(x)})});const y=Array.from(g).sort().map(p=>({value:p,label:p})),h=Array.from(new Set(u.map(p=>p.id.toString()))).sort((p,f)=>parseInt(p)-parseInt(f)).map(p=>({value:p,label:`Partition ${p}`}));return e.jsxs("div",{className:"flex flex-wrap gap-4",children:[e.jsx("div",{className:"flex-1 min-w-[200px]",children:e.jsx(be,{placeholder:"Filter by owner name...",value:l,onChange:p=>c(p.target.value),className:"max-w-sm"})}),e.jsx(Le,{options:m,selected:r,onChange:a,placeholder:"Filter by state",className:"w-[200px]"}),e.jsx(Le,{options:y,selected:n,onChange:o,placeholder:"Filter by zone",className:"w-[200px]"}),e.jsx(Le,{options:h,selected:t,onChange:s,placeholder:"Filter by partition ID",className:"w-[200px]"})]})}const ht=[{value:1,label:"Pending"},{value:2,label:"Active"},{value:3,label:"Inactive"},{value:4,label:"Deleted"}];function Ic(){const[t,s]=i.useState(new Set),[r,a]=i.useState("id"),[n,o]=i.useState("asc"),[l,c]=i.useState([]),[d,u]=i.useState([]),[m,g]=i.useState([]),[y,N]=i.useState(""),[h,p]=i.useState(!1),[f,x]=i.useState(),[b,j]=i.useState(!1),{toast:w}=Vt(),{partitions:E,error:C,isLoading:A,fetchPartitions:B,changePartitionState:z,uniqueStates:Y,uniqueZones:K}=vc({isPaused:t.size>0}),M=i.useMemo(()=>E.flatMap(I=>I.owner_ids.map(P=>({...I,owner_id:P,owner_ids:[P],zone:Ts(P)}))),[E]),W=i.useCallback(I=>{a(P=>P===I?(o(U=>U==="asc"?"desc":"asc"),I):(o("asc"),I))},[]),T=i.useCallback(I=>{s(P=>{const U=new Set(P);return U.has(I)?U.delete(I):U.add(I),U})},[]),O=i.useMemo(()=>M.filter(I=>{const P=l.length===0||l.includes(I.id.toString()),U=d.length===0||d.includes(I.state.toString()),S=m.length===0||m.includes(I.zone),R=y?I.owner_id.toLowerCase().includes(y.toLowerCase()):!0;return P&&U&&S&&R}),[M,l,d,m,y]),V=i.useMemo(()=>M.filter(I=>t.has(I.id)),[M,t]),Q=i.useCallback(async()=>{var I;if(!(t.size===0||!f))try{p(!0);const P=parseInt(f,10),{success:U,total:S}=await z(V.map(R=>R.id),f);U>0&&S===U?(w({title:"State Change Success",description:`Successfully changed state for ${U} partition${U!==1?"s":""} to ${(I=ht.find(R=>R.value===P))==null?void 0:I.label}`}),await B()):U0,isLoading:A}),t.size>0&&e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("span",{className:"text-sm text-muted-foreground",children:[t.size," partition",t.size!==1?"s":""," selected"]}),e.jsxs(Rt,{value:f,onValueChange:x,children:[e.jsx(tt,{className:"w-[160px]",children:e.jsx(At,{placeholder:"Select new state"})}),e.jsx(st,{children:ht.map(I=>e.jsx(Ve,{value:I.value.toString(),children:I.label},I.value))})]}),e.jsxs(q,{onClick:()=>j(!0),disabled:h||!f,size:"sm",variant:"outline",children:[h&&e.jsx(xe,{className:"mr-2 h-4 w-4 animate-spin"}),"Change State"]})]})]})]}),e.jsx("div",{className:"flex items-center",children:e.jsx("div",{className:"w-[250px]",children:e.jsx(Ac,{partitions:E})})})]})}),e.jsxs(te,{className:"space-y-6",children:[e.jsx(_c,{idFilter:l,onIdFilterChange:c,stateFilter:d,onStateFilterChange:u,zoneFilter:m,onZoneFilterChange:g,ownerFilter:y,onOwnerFilterChange:N,uniqueStates:Y,uniqueZones:K,partitions:E}),e.jsx("div",{className:"rounded-md border bg-card",children:e.jsx(Ec,{..._})})]})]}),e.jsx(za,{open:b,onOpenChange:j,children:e.jsxs(Fs,{children:[e.jsxs(Ls,{children:[e.jsx(Ds,{children:"Confirm State Change"}),e.jsx(Os,{children:"Are you sure you want to change the state of these partitions?"})]}),e.jsx("div",{className:"max-h-[300px] overflow-y-auto",children:e.jsx("div",{className:"space-y-2",children:Array.from(new Set(V.map(I=>I.id))).map(I=>{var U,S;const P=E.find(R=>R.id===I);return P?e.jsx("div",{className:"flex items-center justify-between p-2 rounded-md bg-muted",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:"font-medium",children:["Partition ",I]}),e.jsx("span",{className:v("inline-flex items-center px-2 py-0.5 rounded-md text-xs font-medium",Ct(P.state)),children:(U=ht.find(R=>R.value===P.state))==null?void 0:U.label}),e.jsx(Lt,{className:"h-4 w-4 text-muted-foreground"}),e.jsx("span",{className:v("inline-flex items-center px-2 py-0.5 rounded-md text-xs font-medium",Ct(parseInt(f||"0",10))),children:(S=ht.find(R=>R.value===parseInt(f,10)))==null?void 0:S.label})]})},I):null})})}),e.jsxs(Ps,{children:[e.jsx(q,{variant:"outline",onClick:()=>j(!1),disabled:h,children:"Cancel"}),e.jsx(q,{onClick:Q,disabled:h,children:h?"Changing States...":"Confirm Changes"})]})]})})]})}function lr(){const{ringName:t}=Sr(),s=Object.values(J).includes(t);return!t||!s?e.jsx($s,{}):t===J.PARTITION_INGESTER?e.jsx(Ic,{}):e.jsx(xc,{ringName:t})}const mt=i.forwardRef(({className:t,children:s,...r},a)=>e.jsxs(ta,{ref:a,className:v("relative overflow-hidden",t),...r,children:[e.jsx(gi,{className:"h-full w-full rounded-[inherit]",children:s}),e.jsx(Xa,{}),e.jsx(hi,{})]}));mt.displayName=ta.displayName;const Xa=i.forwardRef(({className:t,orientation:s="vertical",...r},a)=>e.jsx(sa,{ref:a,orientation:s,className:v("flex touch-none select-none transition-colors",s==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",s==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",t),...r,children:e.jsx(xi,{className:"relative flex-1 rounded-full bg-border"})}));Xa.displayName=sa.displayName;const Ut=vi,qt=ji,ft=i.forwardRef(({className:t,align:s="center",sideOffset:r=4,...a},n)=>e.jsx(ia,{ref:n,align:s,sideOffset:r,className:v("z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...a}));ft.displayName=ia.displayName;const Ms=({date:t,className:s=""})=>{const r=Fr(t,{addSuffix:!0}),a=Nt(t,"yyyy-MM-dd HH:mm:ss"),n=Nt(new Date(t.getTime()+t.getTimezoneOffset()*6e4),"yyyy-MM-dd HH:mm:ss");return e.jsxs(Ut,{children:[e.jsx(qt,{children:e.jsx("div",{className:`inline-block ${s}`,children:r})}),e.jsx(ft,{className:"w-[280px]",children:e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"px-2 py-0.5 text-xs font-medium bg-gray-100 rounded dark:bg-gray-700 w-14 text-center",children:"UTC"}),e.jsx("span",{className:"font-mono",children:n})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"px-2 py-0.5 text-xs font-medium bg-gray-100 rounded dark:bg-gray-700 w-14 text-center",children:"Local"}),e.jsx("span",{className:"font-mono",children:a})]})]})})]})};function Fc({current:t,parent:s,files:r,folders:a}){const n=Ft(),[,o]=nt(),l=d=>{o({path:d})},c=d=>{n(`/storage/dataobj/metadata?path=${encodeURIComponent(t+"/"+d.name)}`)};return e.jsx("div",{className:"space-y-4",children:e.jsxs(Te,{children:[e.jsx(Re,{children:e.jsxs(X,{className:"h-12",children:[e.jsx(D,{children:"Name"}),e.jsx(D,{children:"Modified"}),e.jsx(D,{children:"Size"}),e.jsx(D,{})]})}),e.jsxs(Ae,{children:[s!==t&&e.jsxs(X,{className:"h-12 cursor-pointer hover:bg-muted/50",onClick:()=>l(s||""),children:[e.jsx(F,{className:"font-medium",children:e.jsxs("div",{className:"flex items-center",children:[e.jsx("svg",{className:"w-5 h-5 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M15 19l-7-7 7-7"})}),".."]})}),e.jsx(F,{children:"-"}),e.jsx(F,{children:"-"}),e.jsx(F,{})]},"parent"),a.map(d=>e.jsxs(X,{className:"h-12 cursor-pointer hover:bg-muted/50",onClick:()=>l(t?`${t}/${d}`:d),children:[e.jsx(F,{className:"font-medium",children:e.jsxs("div",{className:"flex items-center",children:[e.jsx(zo,{className:"mr-2 h-4 w-4"}),d]})}),e.jsx(F,{children:"-"}),e.jsx(F,{children:"-"}),e.jsx(F,{})]},d)),r.map(d=>e.jsxs(X,{className:"h-12 cursor-pointer hover:bg-muted/50",onClick:u=>{u.target.closest("a[download]")||c(d)},children:[e.jsx(F,{className:"font-medium",children:e.jsxs("div",{className:"flex items-center",children:[e.jsx(Vo,{className:"mr-2 h-4 w-4"}),d.name]})}),e.jsx(F,{children:e.jsx(Ms,{date:new Date(d.lastModified)})}),e.jsx(F,{children:fe(d.size)}),e.jsx(F,{children:e.jsx(q,{variant:"outline",size:"icon",asChild:!0,className:"h-8 w-8",children:e.jsx(de,{to:d.downloadUrl,target:"_blank",download:!0,onClick:u=>u.stopPropagation(),children:e.jsx(_r,{className:"h-4 w-4"})})})})]},d.name))]})]})})}function Lc(t){const{cluster:s}=pe(),r=i.useMemo(()=>$e(s==null?void 0:s.members,"dataobj-explorer"),[s==null?void 0:s.members]);return Bt({queryKey:["explorer",t,r],queryFn:async()=>{if(!r)throw new Error("Node name not found");const a=await fetch(re(`/api/v1/proxy/${r}/dataobj/api/v1/list?path=${encodeURIComponent(t)}`));if(!a.ok)throw new Error("Failed to fetch explorer data");const n=await a.json();return{...n,files:Pc(n.files).map(o=>({...o,downloadUrl:re(`/api/v1/proxy/${r}/dataobj/api/v1/download?file=${encodeURIComponent(t?`${t}/${o.name}`:o.name)}`)}))}}})}const Pc=t=>[...t].sort((s,r)=>new Date(r.lastModified).getTime()-new Date(s.lastModified).getTime()),Dc=t=>{switch(t){case"S3":return{bg:"bg-orange-100",text:"text-orange-800",darkBg:"dark:bg-orange-900",darkText:"dark:text-orange-300"};case"GCS":return{bg:"bg-blue-100",text:"text-blue-800",darkBg:"dark:bg-blue-900",darkText:"dark:text-blue-300"};case"AZURE":return{bg:"bg-sky-100",text:"text-sky-800",darkBg:"dark:bg-sky-900",darkText:"dark:text-sky-300"};case"SWIFT":return{bg:"bg-red-100",text:"text-red-800",darkBg:"dark:bg-red-900",darkText:"dark:text-red-300"};case"COS":return{bg:"bg-purple-100",text:"text-purple-800",darkBg:"dark:bg-purple-900",darkText:"dark:text-purple-300"};case"ALIYUNOSS":return{bg:"bg-rose-100",text:"text-rose-800",darkBg:"dark:bg-rose-900",darkText:"dark:text-rose-300"};case"OCI":return{bg:"bg-red-100",text:"text-red-800",darkBg:"dark:bg-red-900",darkText:"dark:text-red-300"};case"OBS":return{bg:"bg-cyan-100",text:"text-cyan-800",darkBg:"dark:bg-cyan-900",darkText:"dark:text-cyan-300"};case"FILESYSTEM":return{bg:"bg-green-100",text:"text-green-800",darkBg:"dark:bg-green-900",darkText:"dark:text-green-300"};case"MEMORY":return{bg:"bg-yellow-100",text:"text-yellow-800",darkBg:"dark:bg-yellow-900",darkText:"dark:text-yellow-300"};default:return{bg:"bg-gray-100",text:"text-gray-800",darkBg:"dark:bg-gray-700",darkText:"dark:text-gray-300"}}};function Qa(){const[t,s]=ze.useState(""),{cluster:r}=pe(),a=i.useMemo(()=>$e(r==null?void 0:r.members,"dataobj-explorer"),[r==null?void 0:r.members]);ze.useEffect(()=>{a&&fetch(re(`/api/v1/proxy/${a}/dataobj/api/v1/provider`)).then(d=>d.json()).then(d=>s(d.provider)).catch(console.error)},[a]);const[n]=nt(),l=(n.get("path")||"").split("/").filter(Boolean),c=Dc(t);return e.jsx(Ss,{children:e.jsxs(Es,{children:[e.jsx(kt,{children:e.jsx(St,{asChild:!0,children:e.jsxs(de,{to:"/storage/dataobj",className:`inline-flex items-center h-7 gap-2 px-3 py-1 text-xs font-medium ${c.bg} ${c.text} ${c.darkBg} ${c.darkText} rounded-full hover:ring-1 hover:ring-gray-300 dark:hover:ring-gray-600 transition-all duration-200`,children:[e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 576 512",className:"w-4 h-4",fill:"currentColor",children:e.jsx("path",{d:"M575.8 255.5c0 18-15 32.1-32 32.1h-32l.7 160.2c0 2.7-.2 5.4-.5 8.1V472c0 22.1-17.9 40-40 40H456c-1.1 0-2.2 0-3.3-.1c-1.4 .1-2.8 .1-4.2 .1H416 392c-22.1 0-40-17.9-40-40V448 384c0-17.7-14.3-32-32-32H256c-17.7 0-32 14.3-32 32v64 24c0 22.1-17.9 40-40 40H160 128.1c-1.5 0-3-.1-4.5-.2c-1.2 .1-2.4 .2-3.6 .2H104c-22.1 0-40-17.9-40-40V360c0-.9 0-1.9 .1-2.8V287.6H32c-18 0-32-14-32-32.1c0-9 3-17 10-24L266.4 8c7-7 15-8 22-8s15 2 21 7L564.8 231.5c8 7 12 15 11 24z"})}),t||""]})})}),l.length>0&&e.jsx(Et,{}),l.map((d,u)=>{const m=l.slice(0,u+1).join("/"),g=u===l.length-1;return e.jsxs(ze.Fragment,{children:[e.jsx(kt,{children:e.jsx(St,{asChild:!0,children:g?e.jsx("span",{className:"text-gray-500",children:d}):e.jsx(de,{to:`/storage/dataobj?path=${encodeURIComponent(m)}`,children:d})})}),u{navigator.clipboard.writeText(t).then(()=>{n(!0),r==null||r(),setTimeout(()=>n(!1),2e3)})};return e.jsx(q,{variant:"ghost",size:"sm",onClick:o,className:v("h-8 px-2",s),children:a?e.jsxs(e.Fragment,{children:[e.jsx(Ge,{className:"h-4 w-4 mr-1"}),"Copied"]}):e.jsxs(e.Fragment,{children:[e.jsx(Ir,{className:"h-4 w-4 mr-1"}),"Copy"]})})}const Gt=({compressed:t,uncompressed:s,showVisualization:r=!1})=>{if(t===0||s===0)return e.jsx("span",{className:"dark:text-gray-200",children:"-"});const a=s/t,n=a>1;return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("div",{className:"font-medium whitespace-nowrap dark:text-gray-200",children:[a.toFixed(1),"x"]}),r&&n&&e.jsx("div",{className:"flex-1 h-2.5 bg-gray-100 dark:bg-gray-600 border border-gray-200 dark:border-gray-500 rounded relative",children:e.jsx("div",{className:"absolute inset-y-0 left-0 bg-blue-600 dark:bg-blue-500 rounded",style:{width:`${t/s*100}%`}})})]})},Mc=t=>{switch(t){case"INT64":return"bg-blue-500/20 text-blue-700 dark:bg-blue-500/30 dark:text-blue-300 hover:bg-blue-500/30";case"BYTES":return"bg-red-500/20 text-red-700 dark:bg-red-500/30 dark:text-red-300 hover:bg-red-500/30";case"FLOAT64":return"bg-purple-500/20 text-purple-700 dark:bg-purple-500/30 dark:text-purple-300 hover:bg-purple-500/30";case"BOOL":return"bg-yellow-500/20 text-yellow-700 dark:bg-yellow-500/30 dark:text-yellow-300 hover:bg-yellow-500/30";case"STRING":return"bg-green-500/20 text-green-700 dark:bg-green-500/30 dark:text-green-300 hover:bg-green-500/30";case"TIMESTAMP":return"bg-orange-500/20 text-orange-700 dark:bg-orange-500/30 dark:text-orange-300 hover:bg-orange-500/30";default:return"bg-gray-500/20 text-gray-700 dark:bg-gray-500/30 dark:text-gray-300 hover:bg-gray-500/30"}};function Bc({metadata:t,filename:s,downloadUrl:r}){const[a,n]=i.useState(null),[o,l]=i.useState({}),c=p=>{n(a===p?null:p)},d=(p,f)=>{const x=`${p}-${f}`;l(b=>({...b,[x]:!b[x]}))},u=t.sections.reduce((p,f)=>p+f.totalCompressedSize,0),m=t.sections.reduce((p,f)=>p+f.totalUncompressedSize,0),g=t.sections.filter(p=>p.type==="SECTION_TYPE_STREAMS"),y=t.sections.filter(p=>p.type==="SECTION_TYPE_LOGS"),N=g==null?void 0:g.reduce((p,f)=>p+(f.columns[0].rows_count||0),0),h=y==null?void 0:y.reduce((p,f)=>p+(f.columns[0].rows_count||0),0);return e.jsxs(ee,{className:"w-full",children:[e.jsx(zc,{filename:s,downloadUrl:r,lastModified:t.lastModified}),e.jsxs(te,{className:"space-y-8",children:[e.jsx(Vc,{totalCompressed:u,totalUncompressed:m,sections:t.sections,streamCount:N,logCount:h}),e.jsx(Uc,{sections:t.sections,expandedSectionIndex:a,expandedColumns:o,onToggleSection:c,onToggleColumn:d})]})]})}function zc({filename:t,downloadUrl:s,lastModified:r}){return e.jsxs(se,{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(ne,{className:"text-2xl font-semibold tracking-tight",children:"Thor Dataobj File"}),e.jsx(q,{asChild:!0,variant:"outline",children:e.jsxs(de,{to:s,target:"_blank",download:!0,children:[e.jsx(_r,{className:"h-4 w-4 mr-2"}),"Download"]})})]}),e.jsx(Je,{className:"space-y-2",children:e.jsx("div",{className:"flex items-center justify-between",children:e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"font-mono text-sm text-foreground",children:t}),e.jsx(Bs,{text:t})]}),e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx("span",{children:"Last Modified:"}),e.jsx(Ms,{date:new Date(r)})]})]})})})]})}function Vc({totalCompressed:t,totalUncompressed:s,sections:r,streamCount:a,logCount:n}){return e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6",children:[e.jsxs("div",{className:"rounded-lg bg-muted/50 p-6 shadow-sm",children:[e.jsx("div",{className:"text-sm text-muted-foreground mb-2",children:"Compression"}),e.jsx(Gt,{compressed:t,uncompressed:s,showVisualization:!0}),e.jsxs("div",{className:"text-xs text-muted-foreground mt-2",children:[fe(t)," → ",fe(s)]})]}),e.jsxs("div",{className:"rounded-lg bg-muted/50 p-6 shadow-sm",children:[e.jsx("div",{className:"text-sm text-muted-foreground mb-2",children:"Sections"}),e.jsx("div",{className:"font-medium text-lg",children:r.length}),e.jsx("div",{className:"text-xs text-muted-foreground mt-2",children:r.map(o=>o.type).join(", ")})]}),a&&e.jsxs("div",{className:"rounded-lg bg-muted/50 p-6 shadow-sm",children:[e.jsx("div",{className:"text-sm text-muted-foreground mb-2",children:"Stream Count"}),e.jsx("div",{className:"font-medium text-lg",children:a.toLocaleString()})]}),n&&e.jsxs("div",{className:"rounded-lg bg-muted/50 p-6 shadow-sm",children:[e.jsx("div",{className:"text-sm text-muted-foreground mb-2",children:"Log Count"}),e.jsx("div",{className:"font-medium text-lg",children:n.toLocaleString()})]})]})}function Uc({sections:t,expandedSectionIndex:s,expandedColumns:r,onToggleSection:a,onToggleColumn:n}){return e.jsx("div",{className:"divide-y divide-border",children:t.map((o,l)=>e.jsx(qc,{section:o,sectionIndex:l,isExpanded:s===l,expandedColumns:r,onToggle:()=>a(l),onToggleColumn:c=>n(l,c)},l))})}function qc({section:t,sectionIndex:s,isExpanded:r,expandedColumns:a,onToggle:n,onToggleColumn:o}){return e.jsxs("div",{className:"py-4",children:[e.jsxs("button",{className:"w-full flex justify-between items-center py-4 px-6 rounded-lg hover:bg-accent/50 transition-colors",onClick:n,children:[e.jsxs("h3",{className:"text-lg font-semibold",children:["Section #",s+1,": ",t.type]}),e.jsx("svg",{className:`w-5 h-5 transform transition-transform duration-300 ${r?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M19 9l-7 7-7-7"})})]}),r&&e.jsxs("div",{className:"mt-6 px-6",children:[e.jsx(Gc,{section:t}),e.jsx(Hc,{columns:t.columns,sectionIndex:s,expandedColumns:a,onToggleColumn:o})]})]})}function Gc({section:t}){return e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6 mb-8",children:[e.jsxs("div",{className:"rounded-lg bg-secondary/50 p-6 shadow-sm",children:[e.jsx("div",{className:"text-sm text-muted-foreground mb-2",children:"Compression"}),e.jsx(Gt,{compressed:t.totalCompressedSize,uncompressed:t.totalUncompressedSize,showVisualization:!0}),e.jsxs("div",{className:"text-xs text-muted-foreground mt-2",children:[fe(t.totalCompressedSize)," →"," ",fe(t.totalUncompressedSize)]})]}),e.jsxs("div",{className:"rounded-lg bg-secondary/50 p-6 shadow-sm",children:[e.jsx("div",{className:"text-sm text-muted-foreground mb-2",children:"Column Count"}),e.jsx("div",{className:"font-medium text-lg",children:t.columnCount})]}),e.jsxs("div",{className:"rounded-lg bg-secondary/50 p-6 shadow-sm",children:[e.jsx("div",{className:"text-sm text-muted-foreground mb-2",children:"Type"}),e.jsx("div",{className:"font-medium text-lg flex items-center gap-2",children:e.jsx(ye,{variant:"outline",className:"font-mono",children:t.type})})]})]})}function Hc({columns:t,sectionIndex:s,expandedColumns:r,onToggleColumn:a}){return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("h4",{className:"text-lg font-medium",children:["Columns (",t.length,")"]}),e.jsx("div",{className:"space-y-4",children:t.map((n,o)=>e.jsx(Kc,{column:n,isExpanded:r[`${s}-${o}`],onToggle:()=>a(o)},o))})]})}function Kc({column:t,isExpanded:s,onToggle:r}){return e.jsxs(ee,{className:"bg-card/50",children:[e.jsxs("button",{className:"w-full flex justify-between items-center p-6 hover:bg-accent/50 transition-colors rounded-t-lg",onClick:r,children:[e.jsxs("div",{children:[e.jsx("h5",{className:"font-medium text-lg",children:t.name?`${t.name} (${t.type})`:t.type}),e.jsx("div",{className:"text-sm text-muted-foreground mt-1 flex items-center gap-2",children:e.jsx(ye,{variant:"secondary",className:v("font-mono text-xs",Mc(t.value_type)),children:t.value_type})})]}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("div",{className:"text-sm font-medium flex items-center gap-2",children:["Compression:",e.jsx(ye,{variant:"outline",className:"font-mono",children:t.compression||"NONE"})]}),e.jsx("svg",{className:`w-4 h-4 transform transition-transform ${s?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M19 9l-7 7-7-7"})})]})]}),s&&e.jsxs(te,{className:"pt-6",children:[e.jsx(Wc,{column:t}),t.pages.length>0&&e.jsx(Zc,{pages:t.pages})]})]})}function Wc({column:t}){return e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-6 mb-8",children:[e.jsxs("div",{className:"rounded-lg bg-muted p-6",children:[e.jsx("div",{className:"text-sm text-muted-foreground mb-2 flex items-center gap-2",children:e.jsx(ye,{variant:"outline",className:"font-mono",children:t.compression||"NONE"})}),e.jsx("div",{className:"font-medium",children:e.jsx(Gt,{compressed:t.compressed_size,uncompressed:t.uncompressed_size})}),e.jsxs("div",{className:"text-xs text-muted-foreground mt-2",children:[fe(t.compressed_size)," →"," ",fe(t.uncompressed_size)]})]}),e.jsxs("div",{className:"rounded-lg bg-muted p-6",children:[e.jsx("div",{className:"text-sm text-muted-foreground mb-2",children:"Rows"}),e.jsx("div",{className:"font-medium text-lg",children:t.rows_count.toLocaleString()})]}),e.jsxs("div",{className:"rounded-lg bg-muted p-6",children:[e.jsx("div",{className:"text-sm text-muted-foreground mb-2",children:"Values Count"}),e.jsx("div",{className:"font-medium text-lg",children:t.values_count.toLocaleString()})]}),e.jsxs("div",{className:"rounded-lg bg-muted p-6",children:[e.jsx("div",{className:"text-sm text-muted-foreground mb-2",children:"Offset"}),e.jsx("div",{className:"font-medium text-lg",children:fe(t.metadata_offset)})]})]})}function Zc({pages:t}){return e.jsxs("div",{className:"mt-8",children:[e.jsxs("h6",{className:"text-base font-medium mb-4",children:["Pages (",t.length,")"]}),e.jsx("div",{className:"rounded-lg border border-border overflow-hidden bg-background",children:e.jsxs("table",{className:"w-full",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"bg-secondary/50 border-b border-border",children:[e.jsx("th",{className:"text-left p-4 font-medium text-muted-foreground",children:"#"}),e.jsx("th",{className:"text-left p-4 font-medium text-muted-foreground",children:"Rows"}),e.jsx("th",{className:"text-left p-4 font-medium text-muted-foreground",children:"Values"}),e.jsx("th",{className:"text-left p-4 font-medium text-muted-foreground",children:"Encoding"}),e.jsx("th",{className:"text-left p-4 font-medium text-muted-foreground",children:"Compression"})]})}),e.jsx("tbody",{children:t.map((s,r)=>e.jsxs("tr",{className:"border-t border-border hover:bg-accent/50 transition-colors",children:[e.jsx("td",{className:"p-4",children:r+1}),e.jsx("td",{className:"p-4",children:s.rows_count.toLocaleString()}),e.jsx("td",{className:"p-4",children:s.values_count.toLocaleString()}),e.jsx("td",{className:"p-4",children:e.jsx(ye,{variant:"outline",className:"font-mono",children:s.encoding})}),e.jsx("td",{className:"p-4",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Gt,{compressed:s.compressed_size,uncompressed:s.uncompressed_size}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",fe(s.compressed_size)," →"," ",fe(s.uncompressed_size),")"]})]})})]},r))})]})})]})}function Yc(t){const{cluster:s}=pe(),r=i.useMemo(()=>$e(s==null?void 0:s.members,"dataobj-explorer"),[s==null?void 0:s.members]),a=i.useMemo(()=>`/api/v1/proxy/${r}/dataobj/api/v1/download?file=${encodeURIComponent(t||"")}`,[t,r]);return{...Bt({queryKey:["file-metadata",t,r],queryFn:async()=>{if(!t)throw new Error("No file path provided");if(!r)throw new Error("Node name not found");const o=await fetch(re(`/api/v1/proxy/${r}/dataobj/api/v1/inspect?file=${encodeURIComponent(t)}`));if(!o.ok)throw new Error("Failed to fetch file metadata");return o.json()},enabled:!!t&&!!r}),downloadUrl:a}}function Xc(){const[t]=nt(),s=t.get("path")||"",{data:r,downloadUrl:a,isLoading:n,error:o}=Yc(s);return e.jsx(Se,{children:e.jsxs("div",{className:"flex h-full flex-col space-y-6",children:[e.jsx(Qa,{}),e.jsx(mt,{className:"h-full",children:n?e.jsx("div",{className:"flex items-center justify-center p-8",children:e.jsx(xe,{className:"h-16 w-16 animate-spin"})}):o?e.jsxs(He,{variant:"destructive",children:[e.jsx(Ke,{children:"Error"}),e.jsx(We,{children:o.message})]}):r&&s?e.jsx(Bc,{metadata:r,filename:s,downloadUrl:a}):null})]})})}const Qc=["New","Starting","Running","Stopping","Terminated","Failed"],Jc=({nameFilter:t,targetFilter:s,selectedStates:r,onNameFilterChange:a,onTargetFilterChange:n,onStatesChange:o,onRefresh:l,availableTargets:c})=>{const d=Qc.map(m=>({label:m,value:m})),u=m=>{o(m)};return e.jsxs("div",{className:"grid grid-cols-[auto_1fr_auto] gap-x-4 gap-y-2",children:[e.jsx("div",{className:"space-y-2",children:e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-sm font-medium text-muted-foreground",children:"Node filters"}),e.jsx(be,{value:t,onChange:m=>a(m.target.value),placeholder:"Filter by node name...",className:"w-[300px]"}),e.jsx(Le,{options:c.map(m=>({value:m,label:m})),selected:s,onChange:n,placeholder:"All Targets",className:"w-[300px]"})]})}),e.jsxs("div",{className:"space-y-1.5 self-end",children:[e.jsx("label",{className:"text-sm font-medium text-muted-foreground",children:"Service states"}),e.jsx(Le,{options:d,selected:r,onChange:u,placeholder:"Filter nodes by service states...",className:"w-full min-w-[300px]"})]}),e.jsx("div",{className:"self-end",children:e.jsx(q,{onClick:l,size:"sm",variant:"outline",className:"h-9 w-9",children:e.jsx(Uo,{className:"h-4 w-4"})})})]})},ed=({services:t,error:s})=>{const r=()=>{if(s)return{className:"bg-red-500 dark:bg-red-500/80 hover:bg-red-600 dark:hover:bg-red-500 text-white border-transparent",tooltip:`Error: ${s}`,status:"error"};const o=t.every(c=>c.status==="Running"),l=t.every(c=>c.status==="Starting"||c.status==="Running");return o?{className:"bg-green-500 dark:bg-green-500/80 hover:bg-green-600 dark:hover:bg-green-500 text-white border-transparent",status:"healthy"}:l?{className:"bg-yellow-500 dark:bg-yellow-500/80 hover:bg-yellow-600 dark:hover:bg-yellow-500 text-white border-transparent",status:"pending"}:{className:"bg-red-500 dark:bg-red-500/80 hover:bg-red-600 dark:hover:bg-red-500 text-white border-transparent",status:"unhealthy"}},a=o=>{switch(o){case"Running":return"text-green-600 dark:text-green-400";case"Starting":return"text-yellow-600 dark:text-yellow-400";case"Failed":return"text-red-600 dark:text-red-400";case"Terminated":return"text-gray-600 dark:text-gray-400";case"Stopping":return"text-orange-600 dark:text-orange-400";case"New":return"text-blue-600 dark:text-blue-400";default:return"text-gray-600 dark:text-gray-400"}},{className:n}=r();return e.jsxs(Ut,{children:[e.jsx(qt,{children:e.jsx("button",{type:"button",children:e.jsxs(ye,{className:n,children:[t.length," services"]})})}),e.jsx(ft,{className:"w-80 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",sideOffset:5,children:e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"font-medium border-b border-gray-200 dark:border-gray-700 pb-1",children:"Service Status"}),e.jsx("div",{className:"space-y-1",children:t.map((o,l)=>e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx("span",{className:"mr-4 font-medium",children:o.service}),e.jsx("span",{className:`${a(o.status)}`,children:o.status})]},l))}),s&&e.jsx("div",{className:"mt-2 pt-2 border-t border-gray-200 dark:border-gray-700 text-red-600 dark:text-red-400",children:s})]})})]})},zs=ho,rt=xo,at=bo,qe=i.forwardRef(({className:t,sideOffset:s=4,...r},a)=>e.jsx(go,{children:e.jsx(vr,{ref:a,sideOffset:s,className:v("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...r})}));qe.displayName=vr.displayName;function td({isReady:t,message:s,className:r}){return e.jsx(zs,{children:e.jsxs(rt,{children:[e.jsx(at,{asChild:!0,children:e.jsx("div",{className:v("flex items-center gap-2",r),children:e.jsx("div",{className:v("h-2.5 w-2.5 rounded-full",t?"bg-green-500":"bg-red-500")})})}),e.jsx(qe,{children:e.jsx("p",{className:"text-sm",children:s||(t?"Ready":"Not Ready")})})]})})}const sd=t=>{try{const s=ds(t);return Ye(s)?Fr(s,{addSuffix:!0}):"Invalid date"}catch(s){return console.warn("Error parsing date:",t,s),"Invalid date"}},rd=({name:t,node:s,onNavigate:r})=>{var a,n;return e.jsxs(X,{className:"hover:bg-muted/50 cursor-pointer",onClick:()=>r(t),children:[e.jsx(F,{className:"font-medium",children:t}),e.jsx(F,{children:s.target}),e.jsx(F,{className:"font-mono text-sm",children:s.build.version}),e.jsx(F,{children:sd(s.build.buildDate)}),e.jsx(F,{children:e.jsx(ed,{services:s.services,error:s.error})}),e.jsx(F,{children:e.jsx(td,{isReady:(a=s.ready)==null?void 0:a.isReady,message:(n=s.ready)==null?void 0:n.message})}),e.jsx(F,{children:e.jsxs(q,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:o=>{o.stopPropagation(),r(t)},children:[e.jsx(Lt,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:"View details"})]})})]},t)},ad=({nodes:t,sortField:s,sortDirection:r,onSort:a})=>{const n=Ft(),o=(d,u)=>{const m=ds(d),g=ds(u);return!Ye(m)&&!Ye(g)?0:Ye(m)?Ye(g)?m.getTime()-g.getTime():-1:1},l=Object.entries(t).sort(([d,u],[m,g])=>{let y=0;switch(s){case"name":y=d.localeCompare(m);break;case"target":y=u.target.localeCompare(g.target);break;case"version":y=u.build.version.localeCompare(g.build.version);break;case"buildDate":y=o(u.build.buildDate,g.build.buildDate);break}return r==="asc"?y:-y}),c=d=>{n(`/nodes/${d}`)};return e.jsx("div",{className:"rounded-md border bg-card",children:e.jsxs(Te,{children:[e.jsx(Re,{children:e.jsxs(X,{className:"hover:bg-transparent",children:[e.jsx(D,{className:"w-[300px]",children:e.jsx(Z,{title:"Node Name",field:"name",sortField:s,sortDirection:r,onSort:a})}),e.jsx(D,{className:"w-[200px]",children:e.jsx(Z,{title:"Target",field:"target",sortField:s,sortDirection:r,onSort:a})}),e.jsx(D,{className:"w-[200px]",children:e.jsx(Z,{title:"Version",field:"version",sortField:s,sortDirection:r,onSort:a})}),e.jsx(D,{className:"w-[200px]",children:e.jsx(Z,{title:"Build Date",field:"buildDate",sortField:s,sortDirection:r,onSort:a})}),e.jsx(D,{className:"w-[150px]",children:"Status"}),e.jsx(D,{className:"w-[50px]",children:"Ready"}),e.jsx(D,{className:"w-[100px]",children:"Actions"})]})}),e.jsxs(Ae,{children:[l.map(([d,u])=>e.jsx(rd,{name:d,node:u,onNavigate:c},d)),l.length===0&&e.jsx(X,{children:e.jsx(F,{colSpan:7,className:"h-24 text-center",children:e.jsx("div",{className:"text-muted-foreground",children:"No nodes found"})})})]})]})})},cr=t=>`hsl(var(--chart-${t%6+1}))`;function nd({nodes:t}){const s=i.useMemo(()=>{const a=new Map;return Object.values(t).forEach(n=>{const o=n.target||"unknown";a.set(o,(a.get(o)||0)+1)}),Array.from(a.entries()).sort((n,o)=>o[1]-n[1]).map(([n,o],l)=>({name:n,value:o,color:cr(l)}))},[t]),r=i.useMemo(()=>Object.keys(t).length,[t]);return s.length===0?null:e.jsxs("div",{className:"w-full h-[120px] relative",children:[e.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[e.jsx("div",{className:"text-xl font-bold",children:r}),e.jsx("div",{className:"text-xs text-muted-foreground",children:"Nodes"})]}),e.jsx(dt,{width:"100%",height:"100%",children:e.jsxs(Ot,{children:[e.jsx($t,{data:s,cx:"50%",cy:"50%",labelLine:!1,outerRadius:60,innerRadius:42,fill:"hsl(var(--chart-1))",dataKey:"value",paddingAngle:1,strokeWidth:1,children:s.map((a,n)=>e.jsx(Mt,{fill:cr(n),stroke:"hsl(var(--background))"},`cell-${a.name}`))}),e.jsx(ut,{content:({active:a,payload:n})=>{if(!a||!n||!n[0])return null;const o=n[0].payload;return e.jsxs("div",{className:"bg-background border rounded-lg shadow-lg px-3 py-2 flex items-center gap-2",children:[e.jsx("div",{className:"w-2.5 h-2.5 rounded-sm",style:{backgroundColor:o.color}}),e.jsx("span",{className:"text-sm font-medium",children:o.name}),e.jsx("span",{className:"text-sm font-semibold",children:o.value})]})}})]})})]})}class Ja extends ze.Component{constructor(s){super(s),this.state={hasError:!1}}static getDerivedStateFromError(s){return{hasError:!0,error:s}}render(){var s;return this.state.hasError?e.jsx("div",{className:"min-h-screen flex items-center justify-center p-4",children:e.jsxs("div",{className:"bg-destructive/10 p-6 rounded-lg max-w-2xl w-full",children:[e.jsx("h2",{className:"text-xl font-semibold text-destructive mb-4",children:"Something went wrong"}),e.jsx("div",{className:"bg-background/50 p-4 rounded-md",children:e.jsx("pre",{className:"text-sm overflow-auto",children:(s=this.state.error)==null?void 0:s.message})}),e.jsx("button",{className:"mt-4 px-4 py-2 bg-primary text-primary-foreground rounded-md hover:bg-primary/90",onClick:()=>window.location.reload(),children:"Reload Page"})]})}):this.props.children}}const od=()=>{const{cluster:t,error:s,refresh:r,isLoading:a}=pe(),[n,o]=i.useState(""),[l,c]=i.useState([]),[d,u]=i.useState(["New","Starting","Running","Stopping","Terminated","Failed"]),[m,g]=i.useState("name"),[y,N]=i.useState("asc"),h=x=>{x===m?N(y==="asc"?"desc":"asc"):(g(x),N("asc"))},p=()=>t?Object.entries(t.members).reduce((x,[b,j])=>{const w=b.toLowerCase().includes(n.toLowerCase()),E=!l||l.length===0||l.includes(j.target),C=d.length===0||j.services&&Array.isArray(j.services)&&j.services.some(A=>(A==null?void 0:A.status)&&d.includes(A.status));return w&&E&&C&&(x[b]=j),x},{}):{},f=()=>{if(!t)return[];const x=new Set;return Object.values(t.members).forEach(b=>{b.target&&x.add(b.target)}),Array.from(x).sort()};return e.jsx(Se,{children:e.jsxs(ee,{className:"shadow-sm",children:[e.jsx(se,{children:e.jsxs("div",{className:"grid grid-cols-[1fr_auto] gap-8",children:[e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-3xl font-semibold tracking-tight",children:"Nodes"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"View and manage Loki nodes in your cluster with their current status and configuration"})]}),e.jsx(Jc,{nameFilter:n,targetFilter:l,selectedStates:d,onNameFilterChange:o,onTargetFilterChange:c,onStatesChange:u,onRefresh:r,availableTargets:f(),isLoading:a})]}),e.jsx("div",{className:"flex items-center",children:e.jsx("div",{className:"w-[250px]",children:e.jsx(nd,{nodes:p()})})})]})}),e.jsx(te,{children:e.jsxs("div",{className:"space-y-4",children:[s&&e.jsxs(He,{variant:"destructive",children:[e.jsx(ot,{className:"h-4 w-4"}),e.jsx(Ke,{children:"Error"}),e.jsx(We,{children:s})]}),a&&e.jsxs("div",{className:"flex items-center justify-center py-4",children:[e.jsx("div",{className:"h-6 w-6 animate-spin rounded-full border-2 border-primary border-t-transparent"}),e.jsx("span",{className:"ml-2 text-sm text-muted-foreground",children:"Loading..."})]}),!a&&!s&&e.jsx(ad,{nodes:p(),sortField:m,sortDirection:y,onSort:h})]})})]})})};function dr(){return e.jsx(Ja,{children:e.jsx(od,{})})}const id=bi,en=i.forwardRef(({className:t,...s},r)=>e.jsx(ra,{ref:r,className:v("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",t),...s}));en.displayName=ra.displayName;const vt=i.forwardRef(({className:t,...s},r)=>e.jsx(aa,{ref:r,className:v("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",t),...s}));vt.displayName=aa.displayName;const jt=i.forwardRef(({className:t,...s},r)=>e.jsx(na,{ref:r,className:v("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",t),...s}));jt.displayName=na.displayName;var ld=Object.create,Ht=Object.defineProperty,cd=Object.defineProperties,dd=Object.getOwnPropertyDescriptor,ud=Object.getOwnPropertyDescriptors,tn=Object.getOwnPropertyNames,_t=Object.getOwnPropertySymbols,pd=Object.getPrototypeOf,Vs=Object.prototype.hasOwnProperty,sn=Object.prototype.propertyIsEnumerable,ur=(t,s,r)=>s in t?Ht(t,s,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[s]=r,ge=(t,s)=>{for(var r in s||(s={}))Vs.call(s,r)&&ur(t,r,s[r]);if(_t)for(var r of _t(s))sn.call(s,r)&&ur(t,r,s[r]);return t},Kt=(t,s)=>cd(t,ud(s)),rn=(t,s)=>{var r={};for(var a in t)Vs.call(t,a)&&s.indexOf(a)<0&&(r[a]=t[a]);if(t!=null&&_t)for(var a of _t(t))s.indexOf(a)<0&&sn.call(t,a)&&(r[a]=t[a]);return r},md=(t,s)=>function(){return s||(0,t[tn(t)[0]])((s={exports:{}}).exports,s),s.exports},fd=(t,s)=>{for(var r in s)Ht(t,r,{get:s[r],enumerable:!0})},gd=(t,s,r,a)=>{if(s&&typeof s=="object"||typeof s=="function")for(let n of tn(s))!Vs.call(t,n)&&n!==r&&Ht(t,n,{get:()=>s[n],enumerable:!(a=dd(s,n))||a.enumerable});return t},hd=(t,s,r)=>(r=t!=null?ld(pd(t)):{},gd(!t||!t.__esModule?Ht(r,"default",{value:t,enumerable:!0}):r,t)),xd=md({"../../node_modules/.pnpm/prismjs@1.29.0_patch_hash=vrxx3pzkik6jpmgpayxfjunetu/node_modules/prismjs/prism.js"(t,s){var r=function(){var a=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,n=0,o={},l={util:{encode:function h(p){return p instanceof c?new c(p.type,h(p.content),p.alias):Array.isArray(p)?p.map(h):p.replace(/&/g,"&").replace(/"+b.content+""};function d(h,p,f,x){h.lastIndex=p;var b=h.exec(f);if(b&&x&&b[1]){var j=b[1].length;b.index+=j,b[0]=b[0].slice(j)}return b}function u(h,p,f,x,b,j){for(var w in f)if(!(!f.hasOwnProperty(w)||!f[w])){var E=f[w];E=Array.isArray(E)?E:[E];for(var C=0;C=j.reach);O+=T.value.length,T=T.next){var V=T.value;if(p.length>h.length)return;if(!(V instanceof c)){var Q=1,_;if(Y){if(_=d(W,O,h,z),!_||_.index>=h.length)break;var S=_.index,I=_.index+_[0].length,P=O;for(P+=T.value.length;S>=P;)T=T.next,P+=T.value.length;if(P-=T.value.length,O=P,T.value instanceof c)continue;for(var U=T;U!==p.tail&&(Pj.reach&&(j.reach=G);var H=T.prev;$&&(H=g(p,H,$),O+=$.length),y(p,H,Q);var oe=new c(w,B?l.tokenize(R,B):R,K,R);if(T=g(p,H,oe),L&&g(p,T,L),Q>1){var ue={cause:w+","+C,reach:G};u(h,p,f,T.prev,O,ue),j&&ue.reach>j.reach&&(j.reach=ue.reach)}}}}}}function m(){var h={value:null,prev:null,next:null},p={value:null,prev:h,next:null};h.next=p,this.head=h,this.tail=p,this.length=0}function g(h,p,f){var x=p.next,b={value:f,prev:p,next:x};return p.next=b,x.prev=b,h.length++,b}function y(h,p,f){for(var x=p.next,b=0;b/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern://i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},k.languages.markup.tag.inside["attr-value"].inside.entity=k.languages.markup.entity,k.languages.markup.doctype.inside["internal-subset"].inside=k.languages.markup,k.hooks.add("wrap",function(t){t.type==="entity"&&(t.attributes.title=t.content.replace(/&/,"&"))}),Object.defineProperty(k.languages.markup.tag,"addInlined",{value:function(t,a){var r={},r=(r["language-"+a]={pattern:/(^$)/i,lookbehind:!0,inside:k.languages[a]},r.cdata=/^$/i,{"included-cdata":{pattern://i,inside:r}}),a=(r["language-"+a]={pattern:/[\s\S]+/,inside:k.languages[a]},{});a[t]={pattern:RegExp(/(<__[^>]*>)(?:))*\]\]>|(?!)/.source.replace(/__/g,function(){return t}),"i"),lookbehind:!0,greedy:!0,inside:r},k.languages.insertBefore("markup","cdata",a)}}),Object.defineProperty(k.languages.markup.tag,"addAttribute",{value:function(t,s){k.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+t+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[s,"language-"+s],inside:k.languages[s]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),k.languages.html=k.languages.markup,k.languages.mathml=k.languages.markup,k.languages.svg=k.languages.markup,k.languages.xml=k.languages.extend("markup",{}),k.languages.ssml=k.languages.xml,k.languages.atom=k.languages.xml,k.languages.rss=k.languages.xml,function(t){var s={pattern:/\\[\\(){}[\]^$+*?|.]/,alias:"escape"},r=/\\(?:x[\da-fA-F]{2}|u[\da-fA-F]{4}|u\{[\da-fA-F]+\}|0[0-7]{0,2}|[123][0-7]{2}|c[a-zA-Z]|.)/,a="(?:[^\\\\-]|"+r.source+")",a=RegExp(a+"-"+a),n={pattern:/(<|')[^<>']+(?=[>']$)/,lookbehind:!0,alias:"variable"};t.languages.regex={"char-class":{pattern:/((?:^|[^\\])(?:\\\\)*)\[(?:[^\\\]]|\\[\s\S])*\]/,lookbehind:!0,inside:{"char-class-negation":{pattern:/(^\[)\^/,lookbehind:!0,alias:"operator"},"char-class-punctuation":{pattern:/^\[|\]$/,alias:"punctuation"},range:{pattern:a,inside:{escape:r,"range-punctuation":{pattern:/-/,alias:"operator"}}},"special-escape":s,"char-set":{pattern:/\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},escape:r}},"special-escape":s,"char-set":{pattern:/\.|\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},backreference:[{pattern:/\\(?![123][0-7]{2})[1-9]/,alias:"keyword"},{pattern:/\\k<[^<>']+>/,alias:"keyword",inside:{"group-name":n}}],anchor:{pattern:/[$^]|\\[ABbGZz]/,alias:"function"},escape:r,group:[{pattern:/\((?:\?(?:<[^<>']+>|'[^<>']+'|[>:]|]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},k.languages.javascript=k.languages.extend("clike",{"class-name":[k.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),k.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,k.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:k.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:k.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:k.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:k.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:k.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),k.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:k.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),k.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),k.languages.markup&&(k.languages.markup.tag.addInlined("script","javascript"),k.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),k.languages.js=k.languages.javascript,k.languages.actionscript=k.languages.extend("javascript",{keyword:/\b(?:as|break|case|catch|class|const|default|delete|do|dynamic|each|else|extends|final|finally|for|function|get|if|implements|import|in|include|instanceof|interface|internal|is|namespace|native|new|null|override|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|use|var|void|while|with)\b/,operator:/\+\+|--|(?:[+\-*\/%^]|&&?|\|\|?|<>?>?|[!=]=?)=?|[~?@]/}),k.languages.actionscript["class-name"].alias="function",delete k.languages.actionscript.parameter,delete k.languages.actionscript["literal-property"],k.languages.markup&&k.languages.insertBefore("actionscript","string",{xml:{pattern:/(^|[^.])<\/?\w+(?:\s+[^\s>\/=]+=("|')(?:\\[\s\S]|(?!\2)[^\\])*\2)*\s*\/?>/,lookbehind:!0,inside:k.languages.markup}}),function(t){var s=/#(?!\{).+/,r={pattern:/#\{[^}]+\}/,alias:"variable"};t.languages.coffeescript=t.languages.extend("javascript",{comment:s,string:[{pattern:/'(?:\\[\s\S]|[^\\'])*'/,greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,greedy:!0,inside:{interpolation:r}}],keyword:/\b(?:and|break|by|catch|class|continue|debugger|delete|do|each|else|extend|extends|false|finally|for|if|in|instanceof|is|isnt|let|loop|namespace|new|no|not|null|of|off|on|or|own|return|super|switch|then|this|throw|true|try|typeof|undefined|unless|until|when|while|window|with|yes|yield)\b/,"class-member":{pattern:/@(?!\d)\w+/,alias:"variable"}}),t.languages.insertBefore("coffeescript","comment",{"multiline-comment":{pattern:/###[\s\S]+?###/,alias:"comment"},"block-regex":{pattern:/\/{3}[\s\S]*?\/{3}/,alias:"regex",inside:{comment:s,interpolation:r}}}),t.languages.insertBefore("coffeescript","string",{"inline-javascript":{pattern:/`(?:\\[\s\S]|[^\\`])*`/,inside:{delimiter:{pattern:/^`|`$/,alias:"punctuation"},script:{pattern:/[\s\S]+/,alias:"language-javascript",inside:t.languages.javascript}}},"multiline-string":[{pattern:/'''[\s\S]*?'''/,greedy:!0,alias:"string"},{pattern:/"""[\s\S]*?"""/,greedy:!0,alias:"string",inside:{interpolation:r}}]}),t.languages.insertBefore("coffeescript","keyword",{property:/(?!\d)\w+(?=\s*:(?!:))/}),delete t.languages.coffeescript["template-string"],t.languages.coffee=t.languages.coffeescript}(k),function(t){var s=t.languages.javadoclike={parameter:{pattern:/(^[\t ]*(?:\/{3}|\*|\/\*\*)\s*@(?:arg|arguments|param)\s+)\w+/m,lookbehind:!0},keyword:{pattern:/(^[\t ]*(?:\/{3}|\*|\/\*\*)\s*|\{)@[a-z][a-zA-Z-]+\b/m,lookbehind:!0},punctuation:/[{}]/};Object.defineProperty(s,"addSupport",{value:function(r,a){(r=typeof r=="string"?[r]:r).forEach(function(n){var o=function(g){g.inside||(g.inside={}),g.inside.rest=a},l="doc-comment";if(c=t.languages[n]){var c,d=c[l];if((d=d||(c=t.languages.insertBefore(n,"comment",{"doc-comment":{pattern:/(^|[^\\])\/\*\*[^/][\s\S]*?(?:\*\/|$)/,lookbehind:!0,alias:"comment"}}))[l])instanceof RegExp&&(d=c[l]={pattern:d}),Array.isArray(d))for(var u=0,m=d.length;u|\+|~|\|\|/,punctuation:/[(),]/}},t.languages.css.atrule.inside["selector-function-argument"].inside=s,t.languages.insertBefore("css","property",{variable:{pattern:/(^|[^-\w\xA0-\uFFFF])--(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*/i,lookbehind:!0}}),{pattern:/(\b\d+)(?:%|[a-z]+(?![\w-]))/,lookbehind:!0}),r={pattern:/(^|[^\w.-])-?(?:\d+(?:\.\d+)?|\.\d+)/,lookbehind:!0};t.languages.insertBefore("css","function",{operator:{pattern:/(\s)[+\-*\/](?=\s)/,lookbehind:!0},hexcode:{pattern:/\B#[\da-f]{3,8}\b/i,alias:"color"},color:[{pattern:/(^|[^\w-])(?:AliceBlue|AntiqueWhite|Aqua|Aquamarine|Azure|Beige|Bisque|Black|BlanchedAlmond|Blue|BlueViolet|Brown|BurlyWood|CadetBlue|Chartreuse|Chocolate|Coral|CornflowerBlue|Cornsilk|Crimson|Cyan|DarkBlue|DarkCyan|DarkGoldenRod|DarkGr[ae]y|DarkGreen|DarkKhaki|DarkMagenta|DarkOliveGreen|DarkOrange|DarkOrchid|DarkRed|DarkSalmon|DarkSeaGreen|DarkSlateBlue|DarkSlateGr[ae]y|DarkTurquoise|DarkViolet|DeepPink|DeepSkyBlue|DimGr[ae]y|DodgerBlue|FireBrick|FloralWhite|ForestGreen|Fuchsia|Gainsboro|GhostWhite|Gold|GoldenRod|Gr[ae]y|Green|GreenYellow|HoneyDew|HotPink|IndianRed|Indigo|Ivory|Khaki|Lavender|LavenderBlush|LawnGreen|LemonChiffon|LightBlue|LightCoral|LightCyan|LightGoldenRodYellow|LightGr[ae]y|LightGreen|LightPink|LightSalmon|LightSeaGreen|LightSkyBlue|LightSlateGr[ae]y|LightSteelBlue|LightYellow|Lime|LimeGreen|Linen|Magenta|Maroon|MediumAquaMarine|MediumBlue|MediumOrchid|MediumPurple|MediumSeaGreen|MediumSlateBlue|MediumSpringGreen|MediumTurquoise|MediumVioletRed|MidnightBlue|MintCream|MistyRose|Moccasin|NavajoWhite|Navy|OldLace|Olive|OliveDrab|Orange|OrangeRed|Orchid|PaleGoldenRod|PaleGreen|PaleTurquoise|PaleVioletRed|PapayaWhip|PeachPuff|Peru|Pink|Plum|PowderBlue|Purple|RebeccaPurple|Red|RosyBrown|RoyalBlue|SaddleBrown|Salmon|SandyBrown|SeaGreen|SeaShell|Sienna|Silver|SkyBlue|SlateBlue|SlateGr[ae]y|Snow|SpringGreen|SteelBlue|Tan|Teal|Thistle|Tomato|Transparent|Turquoise|Violet|Wheat|White|WhiteSmoke|Yellow|YellowGreen)(?![\w-])/i,lookbehind:!0},{pattern:/\b(?:hsl|rgb)\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*\)\B|\b(?:hsl|rgb)a\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*,\s*(?:0|0?\.\d+|1)\s*\)\B/i,inside:{unit:s,number:r,function:/[\w-]+(?=\()/,punctuation:/[(),]/}}],entity:/\\[\da-f]{1,8}/i,unit:s,number:r})}(k),function(t){var s=/[*&][^\s[\]{},]+/,r=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,a="(?:"+r.source+"(?:[ ]+"+s.source+")?|"+s.source+"(?:[ ]+"+r.source+")?)",n=/(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-])(?:[ \t]*(?:(?![#:])|:))*/.source.replace(//g,function(){return/[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source}),o=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function l(c,d){d=(d||"").replace(/m/g,"")+"m";var u=/([:\-,[{]\s*(?:\s<>[ \t]+)?)(?:<>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<>/g,function(){return a}).replace(/<>/g,function(){return c});return RegExp(u,d)}t.languages.yaml={scalar:{pattern:RegExp(/([\-:]\s*(?:\s<>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<>/g,function(){return a})),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<>[ \t]+)?)<>(?=\s*:\s)/.source.replace(/<>/g,function(){return a}).replace(/<>/g,function(){return"(?:"+n+"|"+o+")"})),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:l(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),lookbehind:!0,alias:"number"},boolean:{pattern:l(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:l(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:l(o),lookbehind:!0,greedy:!0},number:{pattern:l(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,"i"),lookbehind:!0},tag:r,important:s,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},t.languages.yml=t.languages.yaml}(k),function(t){var s=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function r(u){return u=u.replace(//g,function(){return s}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+u+")")}var a=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,n=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return a}),o=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source,l=(t.languages.markdown=t.languages.extend("markup",{}),t.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:t.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+n+o+"(?:"+n+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+n+o+")(?:"+n+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(a),inside:t.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+n+")"+o+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+n+"$"),inside:{"table-header":{pattern:RegExp(a),alias:"important",inside:t.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:r(/\b__(?:(?!_)|_(?:(?!_))+_)+__\b|\*\*(?:(?!\*)|\*(?:(?!\*))+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:r(/\b_(?:(?!_)|__(?:(?!_))+__)+_\b|\*(?:(?!\*)|\*\*(?:(?!\*))+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:r(/(~~?)(?:(?!~))+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:r(/!?\[(?:(?!\]))+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\]))+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach(function(u){["url","bold","italic","strike","code-snippet"].forEach(function(m){u!==m&&(t.languages.markdown[u].inside.content.inside[m]=t.languages.markdown[m])})}),t.hooks.add("after-tokenize",function(u){u.language!=="markdown"&&u.language!=="md"||function m(g){if(g&&typeof g!="string")for(var y=0,N=g.length;y",quot:'"'},d=String.fromCodePoint||String.fromCharCode;t.languages.md=t.languages.markdown}(k),k.languages.graphql={comment:/#.*/,description:{pattern:/(?:"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*")(?=\s*[a-z_])/i,greedy:!0,alias:"string",inside:{"language-markdown":{pattern:/(^"(?:"")?)(?!\1)[\s\S]+(?=\1$)/,lookbehind:!0,inside:k.languages.markdown}}},string:{pattern:/"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*"/,greedy:!0},number:/(?:\B-|\b)\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,boolean:/\b(?:false|true)\b/,variable:/\$[a-z_]\w*/i,directive:{pattern:/@[a-z_]\w*/i,alias:"function"},"attr-name":{pattern:/\b[a-z_]\w*(?=\s*(?:\((?:[^()"]|"(?:\\.|[^\\"\r\n])*")*\))?:)/i,greedy:!0},"atom-input":{pattern:/\b[A-Z]\w*Input\b/,alias:"class-name"},scalar:/\b(?:Boolean|Float|ID|Int|String)\b/,constant:/\b[A-Z][A-Z_\d]*\b/,"class-name":{pattern:/(\b(?:enum|implements|interface|on|scalar|type|union)\s+|&\s*|:\s*|\[)[A-Z_]\w*/,lookbehind:!0},fragment:{pattern:/(\bfragment\s+|\.{3}\s*(?!on\b))[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-mutation":{pattern:/(\bmutation\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-query":{pattern:/(\bquery\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},keyword:/\b(?:directive|enum|extend|fragment|implements|input|interface|mutation|on|query|repeatable|scalar|schema|subscription|type|union)\b/,operator:/[!=|&]|\.{3}/,"property-query":/\w+(?=\s*\()/,object:/\w+(?=\s*\{)/,punctuation:/[!(){}\[\]:=,]/,property:/\w+/},k.hooks.add("after-tokenize",function(t){if(t.language==="graphql")for(var s=t.tokens.filter(function(h){return typeof h!="string"&&h.type!=="comment"&&h.type!=="scalar"}),r=0;r?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/},function(t){var s=t.languages.javascript["template-string"],r=s.pattern.source,a=s.inside.interpolation,n=a.inside["interpolation-punctuation"],o=a.pattern.source;function l(g,y){if(t.languages[g])return{pattern:RegExp("((?:"+y+")\\s*)"+r),lookbehind:!0,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},"embedded-code":{pattern:/[\s\S]+/,alias:g}}}}function c(g,y,N){return g={code:g,grammar:y,language:N},t.hooks.run("before-tokenize",g),g.tokens=t.tokenize(g.code,g.grammar),t.hooks.run("after-tokenize",g),g.tokens}function d(g,y,N){var f=t.tokenize(g,{interpolation:{pattern:RegExp(o),lookbehind:!0}}),h=0,p={},f=c(f.map(function(b){if(typeof b=="string")return b;for(var j,w,b=b.content;g.indexOf((w=h++,j="___"+N.toUpperCase()+"_"+w+"___"))!==-1;);return p[j]=b,j}).join(""),y,N),x=Object.keys(p);return h=0,function b(j){for(var w=0;w=x.length)return;var E,C,A,B,z,Y,K,M=j[w];typeof M=="string"||typeof M.content=="string"?(E=x[h],(K=(Y=typeof M=="string"?M:M.content).indexOf(E))!==-1&&(++h,C=Y.substring(0,K),z=p[E],A=void 0,(B={})["interpolation-punctuation"]=n,(B=t.tokenize(z,B)).length===3&&((A=[1,1]).push.apply(A,c(B[1],t.languages.javascript,"javascript")),B.splice.apply(B,A)),A=new t.Token("interpolation",B,a.alias,z),B=Y.substring(K+E.length),z=[],C&&z.push(C),z.push(A),B&&(b(Y=[B]),z.push.apply(z,Y)),typeof M=="string"?(j.splice.apply(j,[w,1].concat(z)),w+=z.length-1):M.content=z)):(K=M.content,Array.isArray(K)?b(K):b([K]))}}(f),new t.Token(N,f,"language-"+N,g)}t.languages.javascript["template-string"]=[l("css",/\b(?:styled(?:\([^)]*\))?(?:\s*\.\s*\w+(?:\([^)]*\))*)*|css(?:\s*\.\s*(?:global|resolve))?|createGlobalStyle|keyframes)/.source),l("html",/\bhtml|\.\s*(?:inner|outer)HTML\s*\+?=/.source),l("svg",/\bsvg/.source),l("markdown",/\b(?:markdown|md)/.source),l("graphql",/\b(?:gql|graphql(?:\s*\.\s*experimental)?)/.source),l("sql",/\bsql/.source),s].filter(Boolean);var u={javascript:!0,js:!0,typescript:!0,ts:!0,jsx:!0,tsx:!0};function m(g){return typeof g=="string"?g:Array.isArray(g)?g.map(m).join(""):m(g.content)}t.hooks.add("after-tokenize",function(g){g.language in u&&function y(N){for(var h=0,p=N.length;h]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),t.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete t.languages.typescript.parameter,delete t.languages.typescript["literal-property"];var s=t.languages.extend("typescript",{});delete s["class-name"],t.languages.typescript["class-name"].inside=s,t.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:s}}}}),t.languages.ts=t.languages.typescript}(k),function(t){var s=t.languages.javascript,r=/\{(?:[^{}]|\{(?:[^{}]|\{[^{}]*\})*\})+\}/.source,a="(@(?:arg|argument|param|property)\\s+(?:"+r+"\\s+)?)";t.languages.jsdoc=t.languages.extend("javadoclike",{parameter:{pattern:RegExp(a+/(?:(?!\s)[$\w\xA0-\uFFFF.])+(?=\s|$)/.source),lookbehind:!0,inside:{punctuation:/\./}}}),t.languages.insertBefore("jsdoc","keyword",{"optional-parameter":{pattern:RegExp(a+/\[(?:(?!\s)[$\w\xA0-\uFFFF.])+(?:=[^[\]]+)?\](?=\s|$)/.source),lookbehind:!0,inside:{parameter:{pattern:/(^\[)[$\w\xA0-\uFFFF\.]+/,lookbehind:!0,inside:{punctuation:/\./}},code:{pattern:/(=)[\s\S]*(?=\]$)/,lookbehind:!0,inside:s,alias:"language-javascript"},punctuation:/[=[\]]/}},"class-name":[{pattern:RegExp(/(@(?:augments|class|extends|interface|memberof!?|template|this|typedef)\s+(?:\s+)?)[A-Z]\w*(?:\.[A-Z]\w*)*/.source.replace(//g,function(){return r})),lookbehind:!0,inside:{punctuation:/\./}},{pattern:RegExp("(@[a-z]+\\s+)"+r),lookbehind:!0,inside:{string:s.string,number:s.number,boolean:s.boolean,keyword:t.languages.typescript.keyword,operator:/=>|\.\.\.|[&|?:*]/,punctuation:/[.,;=<>{}()[\]]/}}],example:{pattern:/(@example\s+(?!\s))(?:[^@\s]|\s+(?!\s))+?(?=\s*(?:\*\s*)?(?:@\w|\*\/))/,lookbehind:!0,inside:{code:{pattern:/^([\t ]*(?:\*\s*)?)\S.*$/m,lookbehind:!0,inside:s,alias:"language-javascript"}}}}),t.languages.javadoclike.addSupport("javascript",t.languages.jsdoc)}(k),function(t){t.languages.flow=t.languages.extend("javascript",{}),t.languages.insertBefore("flow","keyword",{type:[{pattern:/\b(?:[Bb]oolean|Function|[Nn]umber|[Ss]tring|[Ss]ymbol|any|mixed|null|void)\b/,alias:"class-name"}]}),t.languages.flow["function-variable"].pattern=/(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=\s*(?:function\b|(?:\([^()]*\)(?:\s*:\s*\w+)?|(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/i,delete t.languages.flow.parameter,t.languages.insertBefore("flow","operator",{"flow-punctuation":{pattern:/\{\||\|\}/,alias:"punctuation"}}),Array.isArray(t.languages.flow.keyword)||(t.languages.flow.keyword=[t.languages.flow.keyword]),t.languages.flow.keyword.unshift({pattern:/(^|[^$]\b)(?:Class|declare|opaque|type)\b(?!\$)/,lookbehind:!0},{pattern:/(^|[^$]\B)\$(?:Diff|Enum|Exact|Keys|ObjMap|PropertyType|Record|Shape|Subtype|Supertype|await)\b(?!\$)/,lookbehind:!0})}(k),k.languages.n4js=k.languages.extend("javascript",{keyword:/\b(?:Array|any|boolean|break|case|catch|class|const|constructor|continue|debugger|declare|default|delete|do|else|enum|export|extends|false|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|module|new|null|number|package|private|protected|public|return|set|static|string|super|switch|this|throw|true|try|typeof|var|void|while|with|yield)\b/}),k.languages.insertBefore("n4js","constant",{annotation:{pattern:/@+\w+/,alias:"operator"}}),k.languages.n4jsd=k.languages.n4js,function(t){function s(l,c){return RegExp(l.replace(//g,function(){return/(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/.source}),c)}t.languages.insertBefore("javascript","function-variable",{"method-variable":{pattern:RegExp("(\\.\\s*)"+t.languages.javascript["function-variable"].pattern.source),lookbehind:!0,alias:["function-variable","method","function","property-access"]}}),t.languages.insertBefore("javascript","function",{method:{pattern:RegExp("(\\.\\s*)"+t.languages.javascript.function.source),lookbehind:!0,alias:["function","property-access"]}}),t.languages.insertBefore("javascript","constant",{"known-class-name":[{pattern:/\b(?:(?:Float(?:32|64)|(?:Int|Uint)(?:8|16|32)|Uint8Clamped)?Array|ArrayBuffer|BigInt|Boolean|DataView|Date|Error|Function|Intl|JSON|(?:Weak)?(?:Map|Set)|Math|Number|Object|Promise|Proxy|Reflect|RegExp|String|Symbol|WebAssembly)\b/,alias:"class-name"},{pattern:/\b(?:[A-Z]\w*)Error\b/,alias:"class-name"}]}),t.languages.insertBefore("javascript","keyword",{imports:{pattern:s(/(\bimport\b\s*)(?:(?:\s*,\s*(?:\*\s*as\s+|\{[^{}]*\}))?|\*\s*as\s+|\{[^{}]*\})(?=\s*\bfrom\b)/.source),lookbehind:!0,inside:t.languages.javascript},exports:{pattern:s(/(\bexport\b\s*)(?:\*(?:\s*as\s+)?(?=\s*\bfrom\b)|\{[^{}]*\})/.source),lookbehind:!0,inside:t.languages.javascript}}),t.languages.javascript.keyword.unshift({pattern:/\b(?:as|default|export|from|import)\b/,alias:"module"},{pattern:/\b(?:await|break|catch|continue|do|else|finally|for|if|return|switch|throw|try|while|yield)\b/,alias:"control-flow"},{pattern:/\bnull\b/,alias:["null","nil"]},{pattern:/\bundefined\b/,alias:"nil"}),t.languages.insertBefore("javascript","operator",{spread:{pattern:/\.{3}/,alias:"operator"},arrow:{pattern:/=>/,alias:"operator"}}),t.languages.insertBefore("javascript","punctuation",{"property-access":{pattern:s(/(\.\s*)#?/.source),lookbehind:!0},"maybe-class-name":{pattern:/(^|[^$\w\xA0-\uFFFF])[A-Z][$\w\xA0-\uFFFF]+/,lookbehind:!0},dom:{pattern:/\b(?:document|(?:local|session)Storage|location|navigator|performance|window)\b/,alias:"variable"},console:{pattern:/\bconsole(?=\s*\.)/,alias:"class-name"}});for(var r=["function","function-variable","method","method-variable","property-access"],a=0;a*\.{3}(?:[^{}]|)*\})/.source;function o(d,u){return d=d.replace(//g,function(){return r}).replace(//g,function(){return a}).replace(//g,function(){return n}),RegExp(d,u)}n=o(n).source,t.languages.jsx=t.languages.extend("markup",s),t.languages.jsx.tag.pattern=o(/<\/?(?:[\w.:-]+(?:+(?:[\w.:$-]+(?:=(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s{'"/>=]+|))?|))**\/?)?>/.source),t.languages.jsx.tag.inside.tag.pattern=/^<\/?[^\s>\/]*/,t.languages.jsx.tag.inside["attr-value"].pattern=/=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/,t.languages.jsx.tag.inside.tag.inside["class-name"]=/^[A-Z]\w*(?:\.[A-Z]\w*)*$/,t.languages.jsx.tag.inside.comment=s.comment,t.languages.insertBefore("inside","attr-name",{spread:{pattern:o(//.source),inside:t.languages.jsx}},t.languages.jsx.tag),t.languages.insertBefore("inside","special-attr",{script:{pattern:o(/=/.source),alias:"language-javascript",inside:{"script-punctuation":{pattern:/^=(?=\{)/,alias:"punctuation"},rest:t.languages.jsx}}},t.languages.jsx.tag);function l(d){for(var u=[],m=0;m"&&u.push({tagName:c(g.content[0].content[1]),openedBraces:0}):0]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:"constant"},"other-directive":{pattern:/#\w+\b/,alias:"property"},attribute:{pattern:/@\w+/,alias:"atrule"},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:"function"},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:"important"},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:"constant"},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:"keyword"},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/},k.languages.swift["string-literal"].forEach(function(t){t.inside.interpolation.inside=k.languages.swift}),function(t){t.languages.kotlin=t.languages.extend("clike",{keyword:{pattern:/(^|[^.])\b(?:abstract|actual|annotation|as|break|by|catch|class|companion|const|constructor|continue|crossinline|data|do|dynamic|else|enum|expect|external|final|finally|for|fun|get|if|import|in|infix|init|inline|inner|interface|internal|is|lateinit|noinline|null|object|open|operator|out|override|package|private|protected|public|reified|return|sealed|set|super|suspend|tailrec|this|throw|to|try|typealias|val|var|vararg|when|where|while)\b/,lookbehind:!0},function:[{pattern:/(?:`[^\r\n`]+`|\b\w+)(?=\s*\()/,greedy:!0},{pattern:/(\.)(?:`[^\r\n`]+`|\w+)(?=\s*\{)/,lookbehind:!0,greedy:!0}],number:/\b(?:0[xX][\da-fA-F]+(?:_[\da-fA-F]+)*|0[bB][01]+(?:_[01]+)*|\d+(?:_\d+)*(?:\.\d+(?:_\d+)*)?(?:[eE][+-]?\d+(?:_\d+)*)?[fFL]?)\b/,operator:/\+[+=]?|-[-=>]?|==?=?|!(?:!|==?)?|[\/*%<>]=?|[?:]:?|\.\.|&&|\|\||\b(?:and|inv|or|shl|shr|ushr|xor)\b/}),delete t.languages.kotlin["class-name"];var s={"interpolation-punctuation":{pattern:/^\$\{?|\}$/,alias:"punctuation"},expression:{pattern:/[\s\S]+/,inside:t.languages.kotlin}};t.languages.insertBefore("kotlin","string",{"string-literal":[{pattern:/"""(?:[^$]|\$(?:(?!\{)|\{[^{}]*\}))*?"""/,alias:"multiline",inside:{interpolation:{pattern:/\$(?:[a-z_]\w*|\{[^{}]*\})/i,inside:s},string:/[\s\S]+/}},{pattern:/"(?:[^"\\\r\n$]|\\.|\$(?:(?!\{)|\{[^{}]*\}))*"/,alias:"singleline",inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:[a-z_]\w*|\{[^{}]*\})/i,lookbehind:!0,inside:s},string:/[\s\S]+/}}],char:{pattern:/'(?:[^'\\\r\n]|\\(?:.|u[a-fA-F0-9]{0,4}))'/,greedy:!0}}),delete t.languages.kotlin.string,t.languages.insertBefore("kotlin","keyword",{annotation:{pattern:/\B@(?:\w+:)?(?:[A-Z]\w*|\[[^\]]+\])/,alias:"builtin"}}),t.languages.insertBefore("kotlin","function",{label:{pattern:/\b\w+@|@\w+\b/,alias:"symbol"}}),t.languages.kt=t.languages.kotlin,t.languages.kts=t.languages.kotlin}(k),k.languages.c=k.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),k.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),k.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},k.languages.c.string],char:k.languages.c.char,comment:k.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:k.languages.c}}}}),k.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete k.languages.c.boolean,k.languages.objectivec=k.languages.extend("c",{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete k.languages.objectivec["class-name"],k.languages.objc=k.languages.objectivec,k.languages.reason=k.languages.extend("clike",{string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^\\\r\n"])*"/,greedy:!0},"class-name":/\b[A-Z]\w*/,keyword:/\b(?:and|as|assert|begin|class|constraint|do|done|downto|else|end|exception|external|for|fun|function|functor|if|in|include|inherit|initializer|lazy|let|method|module|mutable|new|nonrec|object|of|open|or|private|rec|sig|struct|switch|then|to|try|type|val|virtual|when|while|with)\b/,operator:/\.{3}|:[:=]|\|>|->|=(?:==?|>)?|<=?|>=?|[|^?'#!~`]|[+\-*\/]\.?|\b(?:asr|land|lor|lsl|lsr|lxor|mod)\b/}),k.languages.insertBefore("reason","class-name",{char:{pattern:/'(?:\\x[\da-f]{2}|\\o[0-3][0-7][0-7]|\\\d{3}|\\.|[^'\\\r\n])'/,greedy:!0},constructor:/\b[A-Z]\w*\b(?!\s*\.)/,label:{pattern:/\b[a-z]\w*(?=::)/,alias:"symbol"}}),delete k.languages.reason.function,function(t){for(var s=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|)*\*\//.source,r=0;r<2;r++)s=s.replace(//g,function(){return s});s=s.replace(//g,function(){return/[^\s\S]/.source}),t.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+s),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<>?=?|[@?]/},t.languages.rust["closure-params"].inside.rest=t.languages.rust,t.languages.rust.attribute.inside.string=t.languages.rust.string}(k),k.languages.go=k.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/}),k.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete k.languages.go["class-name"],function(t){var s=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,r=/\b(?!)\w+(?:\s*\.\s*\w+)*\b/.source.replace(//g,function(){return s.source});t.languages.cpp=t.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!)\w+/.source.replace(//g,function(){return s.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:s,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),t.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/(?:\s*:\s*)?|:\s*/.source.replace(//g,function(){return r})+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),t.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:t.languages.cpp}}}}),t.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),t.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:t.languages.extend("cpp",{})}}),t.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},t.languages.cpp["base-clause"])}(k),k.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},k.languages.python["string-interpolation"].inside.interpolation.inside.rest=k.languages.python,k.languages.py=k.languages.python,k.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},k.languages.webmanifest=k.languages.json;var bd={};fd(bd,{dracula:()=>vd,duotoneDark:()=>wd,duotoneLight:()=>kd,github:()=>Ed,gruvboxMaterialDark:()=>tu,gruvboxMaterialLight:()=>ru,jettwaveDark:()=>Kd,jettwaveLight:()=>Zd,nightOwl:()=>Td,nightOwlLight:()=>Ad,oceanicNext:()=>Id,okaidia:()=>Ld,oneDark:()=>Xd,oneLight:()=>Jd,palenight:()=>Dd,shadesOfPurple:()=>$d,synthwave84:()=>Bd,ultramin:()=>Vd,vsDark:()=>an,vsLight:()=>Gd});var yd={plain:{color:"#F8F8F2",backgroundColor:"#282A36"},styles:[{types:["prolog","constant","builtin"],style:{color:"rgb(189, 147, 249)"}},{types:["inserted","function"],style:{color:"rgb(80, 250, 123)"}},{types:["deleted"],style:{color:"rgb(255, 85, 85)"}},{types:["changed"],style:{color:"rgb(255, 184, 108)"}},{types:["punctuation","symbol"],style:{color:"rgb(248, 248, 242)"}},{types:["string","char","tag","selector"],style:{color:"rgb(255, 121, 198)"}},{types:["keyword","variable"],style:{color:"rgb(189, 147, 249)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(98, 114, 164)"}},{types:["attr-name"],style:{color:"rgb(241, 250, 140)"}}]},vd=yd,jd={plain:{backgroundColor:"#2a2734",color:"#9a86fd"},styles:[{types:["comment","prolog","doctype","cdata","punctuation"],style:{color:"#6c6783"}},{types:["namespace"],style:{opacity:.7}},{types:["tag","operator","number"],style:{color:"#e09142"}},{types:["property","function"],style:{color:"#9a86fd"}},{types:["tag-id","selector","atrule-id"],style:{color:"#eeebff"}},{types:["attr-name"],style:{color:"#c4b9fe"}},{types:["boolean","string","entity","url","attr-value","keyword","control","directive","unit","statement","regex","atrule","placeholder","variable"],style:{color:"#ffcc99"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"#c4b9fe"}}]},wd=jd,Nd={plain:{backgroundColor:"#faf8f5",color:"#728fcb"},styles:[{types:["comment","prolog","doctype","cdata","punctuation"],style:{color:"#b6ad9a"}},{types:["namespace"],style:{opacity:.7}},{types:["tag","operator","number"],style:{color:"#063289"}},{types:["property","function"],style:{color:"#b29762"}},{types:["tag-id","selector","atrule-id"],style:{color:"#2d2006"}},{types:["attr-name"],style:{color:"#896724"}},{types:["boolean","string","entity","url","attr-value","keyword","control","directive","unit","statement","regex","atrule"],style:{color:"#728fcb"}},{types:["placeholder","variable"],style:{color:"#93abdc"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"#896724"}}]},kd=Nd,Sd={plain:{color:"#393A34",backgroundColor:"#f6f8fa"},styles:[{types:["comment","prolog","doctype","cdata"],style:{color:"#999988",fontStyle:"italic"}},{types:["namespace"],style:{opacity:.7}},{types:["string","attr-value"],style:{color:"#e3116c"}},{types:["punctuation","operator"],style:{color:"#393A34"}},{types:["entity","url","symbol","number","boolean","variable","constant","property","regex","inserted"],style:{color:"#36acaa"}},{types:["atrule","keyword","attr-name","selector"],style:{color:"#00a4db"}},{types:["function","deleted","tag"],style:{color:"#d73a49"}},{types:["function-variable"],style:{color:"#6f42c1"}},{types:["tag","selector","keyword"],style:{color:"#00009f"}}]},Ed=Sd,Cd={plain:{color:"#d6deeb",backgroundColor:"#011627"},styles:[{types:["changed"],style:{color:"rgb(162, 191, 252)",fontStyle:"italic"}},{types:["deleted"],style:{color:"rgba(239, 83, 80, 0.56)",fontStyle:"italic"}},{types:["inserted","attr-name"],style:{color:"rgb(173, 219, 103)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(99, 119, 119)",fontStyle:"italic"}},{types:["string","url"],style:{color:"rgb(173, 219, 103)"}},{types:["variable"],style:{color:"rgb(214, 222, 235)"}},{types:["number"],style:{color:"rgb(247, 140, 108)"}},{types:["builtin","char","constant","function"],style:{color:"rgb(130, 170, 255)"}},{types:["punctuation"],style:{color:"rgb(199, 146, 234)"}},{types:["selector","doctype"],style:{color:"rgb(199, 146, 234)",fontStyle:"italic"}},{types:["class-name"],style:{color:"rgb(255, 203, 139)"}},{types:["tag","operator","keyword"],style:{color:"rgb(127, 219, 202)"}},{types:["boolean"],style:{color:"rgb(255, 88, 116)"}},{types:["property"],style:{color:"rgb(128, 203, 196)"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)"}}]},Td=Cd,Rd={plain:{color:"#403f53",backgroundColor:"#FBFBFB"},styles:[{types:["changed"],style:{color:"rgb(162, 191, 252)",fontStyle:"italic"}},{types:["deleted"],style:{color:"rgba(239, 83, 80, 0.56)",fontStyle:"italic"}},{types:["inserted","attr-name"],style:{color:"rgb(72, 118, 214)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(152, 159, 177)",fontStyle:"italic"}},{types:["string","builtin","char","constant","url"],style:{color:"rgb(72, 118, 214)"}},{types:["variable"],style:{color:"rgb(201, 103, 101)"}},{types:["number"],style:{color:"rgb(170, 9, 130)"}},{types:["punctuation"],style:{color:"rgb(153, 76, 195)"}},{types:["function","selector","doctype"],style:{color:"rgb(153, 76, 195)",fontStyle:"italic"}},{types:["class-name"],style:{color:"rgb(17, 17, 17)"}},{types:["tag"],style:{color:"rgb(153, 76, 195)"}},{types:["operator","property","keyword","namespace"],style:{color:"rgb(12, 150, 155)"}},{types:["boolean"],style:{color:"rgb(188, 84, 84)"}}]},Ad=Rd,le={char:"#D8DEE9",comment:"#999999",keyword:"#c5a5c5",primitive:"#5a9bcf",string:"#8dc891",variable:"#d7deea",boolean:"#ff8b50",punctuation:"#5FB3B3",tag:"#fc929e",function:"#79b6f2",className:"#FAC863",method:"#6699CC",operator:"#fc929e"},_d={plain:{backgroundColor:"#282c34",color:"#ffffff"},styles:[{types:["attr-name"],style:{color:le.keyword}},{types:["attr-value"],style:{color:le.string}},{types:["comment","block-comment","prolog","doctype","cdata","shebang"],style:{color:le.comment}},{types:["property","number","function-name","constant","symbol","deleted"],style:{color:le.primitive}},{types:["boolean"],style:{color:le.boolean}},{types:["tag"],style:{color:le.tag}},{types:["string"],style:{color:le.string}},{types:["punctuation"],style:{color:le.string}},{types:["selector","char","builtin","inserted"],style:{color:le.char}},{types:["function"],style:{color:le.function}},{types:["operator","entity","url","variable"],style:{color:le.variable}},{types:["keyword"],style:{color:le.keyword}},{types:["atrule","class-name"],style:{color:le.className}},{types:["important"],style:{fontWeight:"400"}},{types:["bold"],style:{fontWeight:"bold"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["namespace"],style:{opacity:.7}}]},Id=_d,Fd={plain:{color:"#f8f8f2",backgroundColor:"#272822"},styles:[{types:["changed"],style:{color:"rgb(162, 191, 252)",fontStyle:"italic"}},{types:["deleted"],style:{color:"#f92672",fontStyle:"italic"}},{types:["inserted"],style:{color:"rgb(173, 219, 103)",fontStyle:"italic"}},{types:["comment"],style:{color:"#8292a2",fontStyle:"italic"}},{types:["string","url"],style:{color:"#a6e22e"}},{types:["variable"],style:{color:"#f8f8f2"}},{types:["number"],style:{color:"#ae81ff"}},{types:["builtin","char","constant","function","class-name"],style:{color:"#e6db74"}},{types:["punctuation"],style:{color:"#f8f8f2"}},{types:["selector","doctype"],style:{color:"#a6e22e",fontStyle:"italic"}},{types:["tag","operator","keyword"],style:{color:"#66d9ef"}},{types:["boolean"],style:{color:"#ae81ff"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)",opacity:.7}},{types:["tag","property"],style:{color:"#f92672"}},{types:["attr-name"],style:{color:"#a6e22e !important"}},{types:["doctype"],style:{color:"#8292a2"}},{types:["rule"],style:{color:"#e6db74"}}]},Ld=Fd,Pd={plain:{color:"#bfc7d5",backgroundColor:"#292d3e"},styles:[{types:["comment"],style:{color:"rgb(105, 112, 152)",fontStyle:"italic"}},{types:["string","inserted"],style:{color:"rgb(195, 232, 141)"}},{types:["number"],style:{color:"rgb(247, 140, 108)"}},{types:["builtin","char","constant","function"],style:{color:"rgb(130, 170, 255)"}},{types:["punctuation","selector"],style:{color:"rgb(199, 146, 234)"}},{types:["variable"],style:{color:"rgb(191, 199, 213)"}},{types:["class-name","attr-name"],style:{color:"rgb(255, 203, 107)"}},{types:["tag","deleted"],style:{color:"rgb(255, 85, 114)"}},{types:["operator"],style:{color:"rgb(137, 221, 255)"}},{types:["boolean"],style:{color:"rgb(255, 88, 116)"}},{types:["keyword"],style:{fontStyle:"italic"}},{types:["doctype"],style:{color:"rgb(199, 146, 234)",fontStyle:"italic"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)"}},{types:["url"],style:{color:"rgb(221, 221, 221)"}}]},Dd=Pd,Od={plain:{color:"#9EFEFF",backgroundColor:"#2D2A55"},styles:[{types:["changed"],style:{color:"rgb(255, 238, 128)"}},{types:["deleted"],style:{color:"rgba(239, 83, 80, 0.56)"}},{types:["inserted"],style:{color:"rgb(173, 219, 103)"}},{types:["comment"],style:{color:"rgb(179, 98, 255)",fontStyle:"italic"}},{types:["punctuation"],style:{color:"rgb(255, 255, 255)"}},{types:["constant"],style:{color:"rgb(255, 98, 140)"}},{types:["string","url"],style:{color:"rgb(165, 255, 144)"}},{types:["variable"],style:{color:"rgb(255, 238, 128)"}},{types:["number","boolean"],style:{color:"rgb(255, 98, 140)"}},{types:["attr-name"],style:{color:"rgb(255, 180, 84)"}},{types:["keyword","operator","property","namespace","tag","selector","doctype"],style:{color:"rgb(255, 157, 0)"}},{types:["builtin","char","constant","function","class-name"],style:{color:"rgb(250, 208, 0)"}}]},$d=Od,Md={plain:{backgroundColor:"linear-gradient(to bottom, #2a2139 75%, #34294f)",backgroundImage:"#34294f",color:"#f92aad",textShadow:"0 0 2px #100c0f, 0 0 5px #dc078e33, 0 0 10px #fff3"},styles:[{types:["comment","block-comment","prolog","doctype","cdata"],style:{color:"#495495",fontStyle:"italic"}},{types:["punctuation"],style:{color:"#ccc"}},{types:["tag","attr-name","namespace","number","unit","hexcode","deleted"],style:{color:"#e2777a"}},{types:["property","selector"],style:{color:"#72f1b8",textShadow:"0 0 2px #100c0f, 0 0 10px #257c5575, 0 0 35px #21272475"}},{types:["function-name"],style:{color:"#6196cc"}},{types:["boolean","selector-id","function"],style:{color:"#fdfdfd",textShadow:"0 0 2px #001716, 0 0 3px #03edf975, 0 0 5px #03edf975, 0 0 8px #03edf975"}},{types:["class-name","maybe-class-name","builtin"],style:{color:"#fff5f6",textShadow:"0 0 2px #000, 0 0 10px #fc1f2c75, 0 0 5px #fc1f2c75, 0 0 25px #fc1f2c75"}},{types:["constant","symbol"],style:{color:"#f92aad",textShadow:"0 0 2px #100c0f, 0 0 5px #dc078e33, 0 0 10px #fff3"}},{types:["important","atrule","keyword","selector-class"],style:{color:"#f4eee4",textShadow:"0 0 2px #393a33, 0 0 8px #f39f0575, 0 0 2px #f39f0575"}},{types:["string","char","attr-value","regex","variable"],style:{color:"#f87c32"}},{types:["parameter"],style:{fontStyle:"italic"}},{types:["entity","url"],style:{color:"#67cdcc"}},{types:["operator"],style:{color:"ffffffee"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["entity"],style:{cursor:"help"}},{types:["inserted"],style:{color:"green"}}]},Bd=Md,zd={plain:{color:"#282a2e",backgroundColor:"#ffffff"},styles:[{types:["comment"],style:{color:"rgb(197, 200, 198)"}},{types:["string","number","builtin","variable"],style:{color:"rgb(150, 152, 150)"}},{types:["class-name","function","tag","attr-name"],style:{color:"rgb(40, 42, 46)"}}]},Vd=zd,Ud={plain:{color:"#9CDCFE",backgroundColor:"#1E1E1E"},styles:[{types:["prolog"],style:{color:"rgb(0, 0, 128)"}},{types:["comment"],style:{color:"rgb(106, 153, 85)"}},{types:["builtin","changed","keyword","interpolation-punctuation"],style:{color:"rgb(86, 156, 214)"}},{types:["number","inserted"],style:{color:"rgb(181, 206, 168)"}},{types:["constant"],style:{color:"rgb(100, 102, 149)"}},{types:["attr-name","variable"],style:{color:"rgb(156, 220, 254)"}},{types:["deleted","string","attr-value","template-punctuation"],style:{color:"rgb(206, 145, 120)"}},{types:["selector"],style:{color:"rgb(215, 186, 125)"}},{types:["tag"],style:{color:"rgb(78, 201, 176)"}},{types:["tag"],languages:["markup"],style:{color:"rgb(86, 156, 214)"}},{types:["punctuation","operator"],style:{color:"rgb(212, 212, 212)"}},{types:["punctuation"],languages:["markup"],style:{color:"#808080"}},{types:["function"],style:{color:"rgb(220, 220, 170)"}},{types:["class-name"],style:{color:"rgb(78, 201, 176)"}},{types:["char"],style:{color:"rgb(209, 105, 105)"}}]},an=Ud,qd={plain:{color:"#000000",backgroundColor:"#ffffff"},styles:[{types:["comment"],style:{color:"rgb(0, 128, 0)"}},{types:["builtin"],style:{color:"rgb(0, 112, 193)"}},{types:["number","variable","inserted"],style:{color:"rgb(9, 134, 88)"}},{types:["operator"],style:{color:"rgb(0, 0, 0)"}},{types:["constant","char"],style:{color:"rgb(129, 31, 63)"}},{types:["tag"],style:{color:"rgb(128, 0, 0)"}},{types:["attr-name"],style:{color:"rgb(255, 0, 0)"}},{types:["deleted","string"],style:{color:"rgb(163, 21, 21)"}},{types:["changed","punctuation"],style:{color:"rgb(4, 81, 165)"}},{types:["function","keyword"],style:{color:"rgb(0, 0, 255)"}},{types:["class-name"],style:{color:"rgb(38, 127, 153)"}}]},Gd=qd,Hd={plain:{color:"#f8fafc",backgroundColor:"#011627"},styles:[{types:["prolog"],style:{color:"#000080"}},{types:["comment"],style:{color:"#6A9955"}},{types:["builtin","changed","keyword","interpolation-punctuation"],style:{color:"#569CD6"}},{types:["number","inserted"],style:{color:"#B5CEA8"}},{types:["constant"],style:{color:"#f8fafc"}},{types:["attr-name","variable"],style:{color:"#9CDCFE"}},{types:["deleted","string","attr-value","template-punctuation"],style:{color:"#cbd5e1"}},{types:["selector"],style:{color:"#D7BA7D"}},{types:["tag"],style:{color:"#0ea5e9"}},{types:["tag"],languages:["markup"],style:{color:"#0ea5e9"}},{types:["punctuation","operator"],style:{color:"#D4D4D4"}},{types:["punctuation"],languages:["markup"],style:{color:"#808080"}},{types:["function"],style:{color:"#7dd3fc"}},{types:["class-name"],style:{color:"#0ea5e9"}},{types:["char"],style:{color:"#D16969"}}]},Kd=Hd,Wd={plain:{color:"#0f172a",backgroundColor:"#f1f5f9"},styles:[{types:["prolog"],style:{color:"#000080"}},{types:["comment"],style:{color:"#6A9955"}},{types:["builtin","changed","keyword","interpolation-punctuation"],style:{color:"#0c4a6e"}},{types:["number","inserted"],style:{color:"#B5CEA8"}},{types:["constant"],style:{color:"#0f172a"}},{types:["attr-name","variable"],style:{color:"#0c4a6e"}},{types:["deleted","string","attr-value","template-punctuation"],style:{color:"#64748b"}},{types:["selector"],style:{color:"#D7BA7D"}},{types:["tag"],style:{color:"#0ea5e9"}},{types:["tag"],languages:["markup"],style:{color:"#0ea5e9"}},{types:["punctuation","operator"],style:{color:"#475569"}},{types:["punctuation"],languages:["markup"],style:{color:"#808080"}},{types:["function"],style:{color:"#0e7490"}},{types:["class-name"],style:{color:"#0ea5e9"}},{types:["char"],style:{color:"#D16969"}}]},Zd=Wd,Yd={plain:{backgroundColor:"hsl(220, 13%, 18%)",color:"hsl(220, 14%, 71%)",textShadow:"0 1px rgba(0, 0, 0, 0.3)"},styles:[{types:["comment","prolog","cdata"],style:{color:"hsl(220, 10%, 40%)"}},{types:["doctype","punctuation","entity"],style:{color:"hsl(220, 14%, 71%)"}},{types:["attr-name","class-name","maybe-class-name","boolean","constant","number","atrule"],style:{color:"hsl(29, 54%, 61%)"}},{types:["keyword"],style:{color:"hsl(286, 60%, 67%)"}},{types:["property","tag","symbol","deleted","important"],style:{color:"hsl(355, 65%, 65%)"}},{types:["selector","string","char","builtin","inserted","regex","attr-value"],style:{color:"hsl(95, 38%, 62%)"}},{types:["variable","operator","function"],style:{color:"hsl(207, 82%, 66%)"}},{types:["url"],style:{color:"hsl(187, 47%, 55%)"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"hsl(220, 14%, 71%)"}}]},Xd=Yd,Qd={plain:{backgroundColor:"hsl(230, 1%, 98%)",color:"hsl(230, 8%, 24%)"},styles:[{types:["comment","prolog","cdata"],style:{color:"hsl(230, 4%, 64%)"}},{types:["doctype","punctuation","entity"],style:{color:"hsl(230, 8%, 24%)"}},{types:["attr-name","class-name","boolean","constant","number","atrule"],style:{color:"hsl(35, 99%, 36%)"}},{types:["keyword"],style:{color:"hsl(301, 63%, 40%)"}},{types:["property","tag","symbol","deleted","important"],style:{color:"hsl(5, 74%, 59%)"}},{types:["selector","string","char","builtin","inserted","regex","attr-value","punctuation"],style:{color:"hsl(119, 34%, 47%)"}},{types:["variable","operator","function"],style:{color:"hsl(221, 87%, 60%)"}},{types:["url"],style:{color:"hsl(198, 99%, 37%)"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"hsl(230, 8%, 24%)"}}]},Jd=Qd,eu={plain:{color:"#ebdbb2",backgroundColor:"#292828"},styles:[{types:["imports","class-name","maybe-class-name","constant","doctype","builtin","function"],style:{color:"#d8a657"}},{types:["property-access"],style:{color:"#7daea3"}},{types:["tag"],style:{color:"#e78a4e"}},{types:["attr-name","char","url","regex"],style:{color:"#a9b665"}},{types:["attr-value","string"],style:{color:"#89b482"}},{types:["comment","prolog","cdata","operator","inserted"],style:{color:"#a89984"}},{types:["delimiter","boolean","keyword","selector","important","atrule","property","variable","deleted"],style:{color:"#ea6962"}},{types:["entity","number","symbol"],style:{color:"#d3869b"}}]},tu=eu,su={plain:{color:"#654735",backgroundColor:"#f9f5d7"},styles:[{types:["delimiter","boolean","keyword","selector","important","atrule","property","variable","deleted"],style:{color:"#af2528"}},{types:["imports","class-name","maybe-class-name","constant","doctype","builtin"],style:{color:"#b4730e"}},{types:["string","attr-value"],style:{color:"#477a5b"}},{types:["property-access"],style:{color:"#266b79"}},{types:["function","attr-name","char","url"],style:{color:"#72761e"}},{types:["tag"],style:{color:"#b94c07"}},{types:["comment","prolog","cdata","operator","inserted"],style:{color:"#a89984"}},{types:["entity","number","symbol"],style:{color:"#924f79"}}]},ru=su,au=t=>i.useCallback(s=>{var r=s,{className:a,style:n,line:o}=r,l=rn(r,["className","style","line"]);const c=Kt(ge({},l),{className:vs("token-line",a)});return typeof t=="object"&&"plain"in t&&(c.style=t.plain),typeof n=="object"&&(c.style=ge(ge({},c.style||{}),n)),c},[t]),nu=t=>{const s=i.useCallback(({types:r,empty:a})=>{if(t!=null){{if(r.length===1&&r[0]==="plain")return a!=null?{display:"inline-block"}:void 0;if(r.length===1&&a!=null)return t[r[0]]}return Object.assign(a!=null?{display:"inline-block"}:{},...r.map(n=>t[n]))}},[t]);return i.useCallback(r=>{var a=r,{token:n,className:o,style:l}=a,c=rn(a,["token","className","style"]);const d=Kt(ge({},c),{className:vs("token",...n.types,o),children:n.content,style:s(n)});return l!=null&&(d.style=ge(ge({},d.style||{}),l)),d},[s])},ou=/\r\n|\r|\n/,pr=t=>{t.length===0?t.push({types:["plain"],content:` +`,empty:!0}):t.length===1&&t[0].content===""&&(t[0].content=` +`,t[0].empty=!0)},mr=(t,s)=>{const r=t.length;return r>0&&t[r-1]===s?t:t.concat(s)},iu=t=>{const s=[[]],r=[t],a=[0],n=[t.length];let o=0,l=0,c=[];const d=[c];for(;l>-1;){for(;(o=a[l]++)0?m:["plain"],u=y):(m=mr(m,y.type),y.alias&&(m=mr(m,y.alias)),u=y.content),typeof u!="string"){l++,s.push(m),r.push(u),a.push(0),n.push(u.length);continue}const N=u.split(ou),h=N.length;c.push({types:m,content:N[0]});for(let p=1;pi.useMemo(()=>{if(r==null)return fr([s]);const n={code:s,grammar:r,language:a,tokens:[]};return t.hooks.run("before-tokenize",n),n.tokens=t.tokenize(s,r),t.hooks.run("after-tokenize",n),fr(n.tokens)},[s,r,a,t]),cu=(t,s)=>{const{plain:r}=t,a=t.styles.reduce((n,o)=>{const{languages:l,style:c}=o;return l&&!l.includes(s)||o.types.forEach(d=>{const u=ge(ge({},n[d]),c);n[d]=u}),n},{});return a.root=r,a.plain=Kt(ge({},r),{backgroundColor:void 0}),a},du=cu,uu=({children:t,language:s,code:r,theme:a,prism:n})=>{const o=s.toLowerCase(),l=du(a,o),c=au(l),d=nu(l),u=n.languages[o],m=lu({prism:n,language:o,code:r,grammar:u});return t({tokens:m,className:`prism-code language-${o}`,style:l!=null?l.root:{},getLineProps:c,getTokenProps:d})},pu=t=>i.createElement(uu,Kt(ge({},t),{prism:t.prism||k,theme:t.theme||an,code:t.code,language:t.language}));/*! Bundled license information: + +prismjs/prism.js: + (** + * Prism: Lightweight, robust, elegant syntax highlighting + * + * @license MIT + * @author Lea Verou + * @namespace + * @public + *) +*/const mu=(t,s)=>s.some(r=>{if(typeof r=="number")return t===r;const[a,n]=r.split(":").map(o=>parseInt(o));return a<=t&&t<=n}),fu=(t,s,r)=>r.some(([a,[n,o]])=>a===t&&n<=s&&s<=o),gu=(t,s)=>t.split(new RegExp(`(${s.map(([r])=>r).join("|")})`)).filter(Boolean),hu=t=>t.map(s=>{s=s.startsWith("/")?s:"/"+s;const[,r,a="0:Infinity"]=s.split("/"),[n,o=n]=a.split(":").map(l=>Number(l));return[r,[n,o]]}),nn=(t,s)=>()=>{const r=i.useContext(t);if(r===void 0)throw new Error(s);return r},Wt=t=>Object.assign(i.forwardRef(t),{displayName:t.displayName??t.name}),on=i.createContext(void 0),ln=i.createContext(void 0),cn=nn(on,'Could not find nearest component. Please wrap this component with a component imported from "react-code-block".'),Us=nn(ln,'Could not find nearest component. Please wrap this component with component imported from "react-code-block".'),ve=({code:t,words:s=[],lines:r=[],children:a,...n})=>{const o=i.useMemo(()=>hu(s),[s]);return e.jsx(on.Provider,{value:{code:t.trim(),words:o,lines:r,...n},children:a})},xu=({as:t,children:s,...r},a)=>{const{lines:n,words:o,...l}=cn(),c=t??"pre";return e.jsx(pu,{...l,children:d=>e.jsx(c,{...r,ref:a,children:d.tokens.map((u,m)=>{const g=m+1,y=mu(g,n);return e.jsx(ln.Provider,{value:{highlight:d,line:u,lineNumber:g},children:typeof s=="function"?s({isLineHighlighted:y,lineNumber:g},m):s},m)})})})},bu=({as:t,children:s,className:r,...a},n)=>{const{highlight:o,line:l}=Us(),{getLineProps:c}=o,d=t??"div";return e.jsx(d,{...c({line:l,className:r}),...a,ref:n,children:s})},yu=({as:t,children:s=({children:o})=>e.jsx("span",{children:o}),className:r,...a},n)=>{const{words:o}=cn(),{line:l,highlight:c,lineNumber:d}=Us(),{getTokenProps:u}=c,m=t??"span";return e.jsx(ze.Fragment,{children:l.map((g,y)=>{const{children:N,...h}=u({token:g,className:r}),p=o.length?gu(N,o):[N];return e.jsx(ze.Fragment,{children:p.map((f,x)=>e.jsx(m,{...h,...a,ref:n,children:s({children:f,isTokenHighlighted:fu(f,d,o)})},x))},y)})})},vu=({as:t,...s},r)=>{const{lineNumber:a}=Us(),n=t??"span";return e.jsx(n,{...s,ref:r,children:a})};ve.Code=Wt(xu);ve.LineContent=Wt(bu);ve.Token=Wt(yu);ve.LineNumber=Wt(vu);const ju={plain:{color:"var(--foreground)",backgroundColor:"var(--muted)"},styles:[{types:["comment"],style:{color:"#6e7781",fontStyle:"italic"}},{types:["keyword","selector","changed"],style:{color:"#cf222e"}},{types:["constant","number","builtin"],style:{color:"#0550ae"}},{types:["string","attr-value"],style:{color:"#0a3069"}},{types:["function","attr-name"],style:{color:"#8250df"}},{types:["tag","operator"],style:{color:"#116329"}},{types:["variable","property"],style:{color:"#953800"}},{types:["punctuation"],style:{color:"#24292f"}}]},wu={plain:{color:"var(--foreground)",backgroundColor:"var(--muted)"},styles:[{types:["comment"],style:{color:"#8b949e",fontStyle:"italic"}},{types:["keyword","selector","changed"],style:{color:"#ff7b72"}},{types:["constant","number","builtin"],style:{color:"#79c0ff"}},{types:["string","attr-value"],style:{color:"#a5d6ff"}},{types:["function","attr-name"],style:{color:"#d2a8ff"}},{types:["tag","operator"],style:{color:"#7ee787"}},{types:["variable","property"],style:{color:"#ffa657"}},{types:["punctuation"],style:{color:"#c9d1d9"}}]};function ns({code:t,language:s="typescript",fileName:r,className:a,maxLines:n=200}){const[o,l]=i.useState(!1),[c,d]=i.useState(!1),{theme:u}=Li(),m=async()=>{await navigator.clipboard.writeText(t),l(!0),setTimeout(()=>l(!1),2e3)},g=t.split(` +`),y=g.length>n,N=c?t:g.slice(0,n).join(` +`);return e.jsxs("div",{className:v("relative group rounded-lg overflow-hidden",a),children:[r&&e.jsxs("div",{className:"flex items-center justify-between px-4 py-2 border-b bg-muted/50",children:[e.jsx("div",{className:"text-sm text-muted-foreground",children:r}),e.jsxs(q,{variant:"ghost",size:"icon",className:"h-7 w-7 opacity-0 group-hover:opacity-100 transition-opacity",onClick:m,children:[o?e.jsx(Ge,{className:"h-4 w-4"}):e.jsx(Ir,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:"Copy code"})]})]}),e.jsx(ve,{code:N,language:s,theme:u==="dark"?wu:ju,children:e.jsx(ve.Code,{className:"bg-muted/50 p-4 text-sm whitespace-pre-wrap break-words",children:e.jsx(ve.LineContent,{className:"max-w-full",children:e.jsx(ve.Token,{})})})}),y&&e.jsx("div",{className:"flex justify-center p-2 border-t bg-muted/50",children:e.jsx(q,{variant:"ghost",size:"sm",onClick:()=>d(!c),className:"flex items-center gap-2",children:c?e.jsxs(e.Fragment,{children:["Show Less ",e.jsx(Ar,{className:"h-4 w-4"})]}):e.jsxs(e.Fragment,{children:["Show More (",g.length-n," more lines)"," ",e.jsx(it,{className:"h-4 w-4"})]})})})]})}function Nu(t){const[s,r]=i.useState(null),[a,n]=i.useState(!1),[o,l]=i.useState(null);return i.useEffect(()=>{if(!t){l("Node name is required");return}n(!0),l(null),fetch(re(`/api/v1/proxy/${t}/ui/api/v1/cluster/nodes/self/details`)).then(c=>{if(!c.ok)throw new Error(`Failed to fetch node details: ${c.statusText}`);return c.json()}).then(c=>{var d,u;c.target=((u=(d=c.config.match(/target:\s*([^\n]+)/))==null?void 0:d[1])==null?void 0:u.trim())||"",r(c),n(!1)}).catch(c=>{l(c instanceof Error?c.message:"An error occurred"),n(!1)})},[t]),{nodeDetails:s,isLoading:a,error:o}}function ku(t,s){const[r,a]=i.useState(!1),[n,o]=i.useState(null),[l,c]=i.useState("");return i.useEffect(()=>{if(!s){c("");return}if(!t)return;const d=new AbortController;async function u(){a(!0),o(null);try{const m=await fetch(re(`/api/v1/proxy/${t}/metrics`),{signal:d.signal});if(!m.ok)throw new Error(`Failed to fetch metrics: ${m.statusText}`);const g=await m.text();c(g)}catch(m){m instanceof Error?o(m.message):o("An unknown error occurred")}finally{a(!1)}}return u(),()=>{d.abort()}},[t,s]),{isLoading:r,error:n,metrics:l}}const Su={Running:"#10B981",Starting:"#F59E0B",New:"#3B82F6",Stopping:"#F59E0B",Terminated:"#6B7280",Failed:"#EF4444"};function Eu({services:t}){const s=i.useMemo(()=>{const a=t.reduce((n,{status:o})=>{const l=o;return n.set(l,(n.get(l)||0)+1),n},new Map);return Array.from(a.entries()).sort((n,o)=>o[1]-n[1]).map(([n,o])=>({name:n,value:o,color:Su[n]}))},[t]),r=i.useMemo(()=>t.length,[t]);return s.length===0?null:e.jsxs("div",{className:"h-[180px] w-full flex items-center",children:[e.jsxs("div",{className:"flex-1 relative",children:[e.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none z-10",children:[e.jsx("div",{className:"text-2xl font-bold",children:r}),e.jsx("div",{className:"text-xs text-muted-foreground",children:"Services"})]}),e.jsx(dt,{width:"100%",height:180,children:e.jsxs(Ot,{margin:{top:0,right:0,bottom:0,left:0},children:[e.jsx($t,{data:s,cx:"50%",cy:"50%",labelLine:!1,outerRadius:70,innerRadius:50,dataKey:"value",paddingAngle:2,strokeWidth:2,children:s.map(a=>e.jsx(Mt,{fill:a.color,stroke:"hsl(var(--background))"},`cell-${a.name}`))}),e.jsx(ut,{content:({active:a,payload:n})=>{if(!a||!n||!n[0])return null;const o=n[0].payload;return e.jsxs("div",{className:"bg-background border rounded-lg shadow-lg px-3 py-2 flex items-center gap-2",children:[e.jsx("div",{className:"w-2.5 h-2.5 rounded-sm",style:{backgroundColor:o.color}}),e.jsx("span",{className:"text-sm font-medium",children:o.name}),e.jsx("span",{className:"text-sm font-semibold",children:o.value})]})}})]})})]}),e.jsx("div",{className:"flex flex-col gap-1.5 min-w-[120px] pl-4",children:s.map(a=>e.jsxs("div",{className:"flex items-center justify-between gap-2 text-sm",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-2 h-2 rounded-full shrink-0",style:{backgroundColor:a.color}}),e.jsx("span",{className:"text-muted-foreground",children:a.name})]}),e.jsx("span",{className:"font-medium tabular-nums",children:a.value})]},a.name))})]})}const Cu=t=>{switch(t){case"Running":return"text-green-600 dark:text-green-400";case"Starting":return"text-yellow-600 dark:text-yellow-400";case"Failed":return"text-red-600 dark:text-red-400";case"New":return"text-blue-600 dark:text-blue-400";case"Terminated":return"text-gray-600 dark:text-gray-400";default:return"text-gray-600 dark:text-gray-400"}};function Tu({services:t}){return e.jsx(mt,{className:"h-[180px] rounded-md border",children:e.jsxs(Te,{children:[e.jsx(Re,{children:e.jsxs(X,{children:[e.jsx(D,{children:"Service"}),e.jsx(D,{className:"text-right",children:"Status"})]})}),e.jsx(Ae,{children:t.map(s=>e.jsxs(X,{className:"hover:bg-muted/50",children:[e.jsx(F,{className:"font-medium",children:s.service}),e.jsx(F,{className:`text-right ${Cu(s.status)} font-medium`,children:s.status})]},s.service))})]})})}const Ru={aws:"text-yellow-600 bg-yellow-100 dark:bg-yellow-950 dark:text-yellow-400","aws-dynamo":"text-yellow-600 bg-yellow-100 dark:bg-yellow-950 dark:text-yellow-400",s3:"text-yellow-600 bg-yellow-100 dark:bg-yellow-950 dark:text-yellow-400",azure:"text-blue-600 bg-blue-100 dark:bg-blue-950 dark:text-blue-400",gcp:"text-blue-600 bg-blue-100 dark:bg-blue-950 dark:text-blue-400","gcp-columnkey":"text-blue-600 bg-blue-100 dark:bg-blue-950 dark:text-blue-400",gcs:"text-blue-600 bg-blue-100 dark:bg-blue-950 dark:text-blue-400",alibabacloud:"text-orange-600 bg-orange-100 dark:bg-orange-950 dark:text-orange-400",filesystem:"text-gray-600 bg-gray-100 dark:bg-gray-800 dark:text-gray-400",local:"text-gray-600 bg-gray-100 dark:bg-gray-800 dark:text-gray-400",boltdb:"text-emerald-600 bg-emerald-100 dark:bg-emerald-950 dark:text-emerald-400",cassandra:"text-blue-700 bg-blue-100 dark:bg-blue-950 dark:text-blue-400",bigtable:"text-red-600 bg-red-100 dark:bg-red-950 dark:text-red-400","bigtable-hashed":"text-red-600 bg-red-100 dark:bg-red-950 dark:text-red-400",bos:"text-cyan-600 bg-cyan-100 dark:bg-cyan-950 dark:text-cyan-400",cos:"text-green-600 bg-green-100 dark:bg-green-950 dark:text-green-400",swift:"text-orange-600 bg-orange-100 dark:bg-orange-950 dark:text-orange-400",inmemory:"text-purple-600 bg-purple-100 dark:bg-purple-950 dark:text-purple-400","grpc-store":"text-indigo-600 bg-indigo-100 dark:bg-indigo-950 dark:text-indigo-400"};function Au({type:t,className:s}){const r=t.toLowerCase(),a=Ru[r]||"text-gray-600 bg-gray-100 dark:bg-gray-800 dark:text-gray-400";return e.jsx("span",{className:v("inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium",a,s),children:r})}const _u=Ce("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),ce=i.forwardRef(({className:t,...s},r)=>e.jsx(jr,{ref:r,className:v(_u(),t),...s}));ce.displayName=jr.displayName;function Iu(t){const[s,r]=i.useState("info"),[a,n]=i.useState(!1),[o,l]=i.useState(null),[c,d]=i.useState(!1),u=g=>{const y=g.message.match(/Current log level is (\w+)/);return(y==null?void 0:y[1])||"info"};return i.useEffect(()=>{async function g(){if(t){n(!0),l(null);try{const y=await fetch(re(`/api/v1/proxy/${t}/log_level`));if(!y.ok)throw new Error(`Failed to fetch log level: ${y.statusText}`);const N=await y.json();r(u(N))}catch(y){l(y instanceof Error?y.message:"Failed to fetch log level")}finally{n(!1)}}}g()},[t]),{logLevel:s,isLoading:a,error:o,success:c,setLogLevel:async g=>{if(t){n(!0),l(null),d(!1);try{const y=await fetch(re(`/api/v1/proxy/${t}/log_level?log_level=${g}`),{method:"POST"});if(!y.ok)throw new Error(`Failed to update log level: ${y.statusText}`);const N=await y.json();if(N.status==="success"&&N.message.includes(g))r(g),d(!0),setTimeout(()=>d(!1),3e3);else throw new Error("Failed to update log level: Unexpected response")}catch(y){l(y instanceof Error?y.message:"Failed to update log level")}finally{n(!1)}}}}}const Fu=["debug","info","warn","error"];function Lu({nodeName:t,className:s}){const{logLevel:r,isLoading:a,error:n,success:o,setLogLevel:l}=Iu(t),c=d=>{l(d)};return e.jsxs("div",{className:"relative flex items-center gap-2",children:[e.jsxs(Rt,{value:r,onValueChange:c,disabled:a,children:[e.jsx(tt,{className:v("w-[180px]",s,a&&"opacity-50 cursor-not-allowed"),children:e.jsx(At,{placeholder:"Select log level"})}),e.jsx(st,{children:Fu.map(d=>e.jsx(Ve,{value:d,children:d},d))})]}),e.jsx(zs,{children:e.jsxs(rt,{children:[e.jsx(at,{asChild:!0,children:e.jsxs("div",{className:v("absolute -right-6 transition-all duration-300 ease-in-out",o||n?"opacity-100 translate-x-0":"opacity-0 translate-x-2"),children:[o&&e.jsx(Ge,{className:"h-4 w-4 text-green-500 animate-in zoom-in-50 duration-300"}),n&&e.jsx(ot,{className:"h-4 w-4 text-red-500 animate-in zoom-in-50 duration-300"})]})}),e.jsxs(qe,{side:"right",className:"text-xs",children:[o&&"Log level updated successfully",n&&n]})]})})]})}const dn=i.forwardRef(({className:t,...s},r)=>e.jsx(Vr,{className:v("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",t),...s,ref:r,children:e.jsx(ui,{className:v("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));dn.displayName=Vr.displayName;function Pu(t){return ws({tag:"svg",attr:{viewBox:"0 0 384 512"},child:[{tag:"path",attr:{d:"M318.7 268.7c-.2-36.7 16.4-64.4 50-84.8-18.8-26.9-47.2-41.7-84.7-44.6-35.5-2.8-74.3 20.7-88.5 20.7-15 0-49.4-19.7-76.4-19.7C63.3 141.2 4 184.8 4 273.5q0 39.3 14.4 81.2c12.8 36.7 59 126.7 107.2 125.2 25.2-.6 43-17.9 75.8-17.9 31.8 0 48.3 17.9 76.4 17.9 48.6-.7 90.4-82.5 102.6-119.3-65.2-30.7-61.7-90-61.7-91.9zm-56.6-164.2c27.3-32.4 24.8-61.9 24-72.5-24.1 1.4-52 16.4-67.9 34.9-17.5 19.8-27.8 44.3-25.6 71.9 26.1 2 49.9-11.4 69.5-34.3z"},child:[]}]})(t)}function Du(t){return ws({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M220.8 123.3c1 .5 1.8 1.7 3 1.7 1.1 0 2.8-.4 2.9-1.5.2-1.4-1.9-2.3-3.2-2.9-1.7-.7-3.9-1-5.5-.1-.4.2-.8.7-.6 1.1.3 1.3 2.3 1.1 3.4 1.7zm-21.9 1.7c1.2 0 2-1.2 3-1.7 1.1-.6 3.1-.4 3.5-1.6.2-.4-.2-.9-.6-1.1-1.6-.9-3.8-.6-5.5.1-1.3.6-3.4 1.5-3.2 2.9.1 1 1.8 1.5 2.8 1.4zM420 403.8c-3.6-4-5.3-11.6-7.2-19.7-1.8-8.1-3.9-16.8-10.5-22.4-1.3-1.1-2.6-2.1-4-2.9-1.3-.8-2.7-1.5-4.1-2 9.2-27.3 5.6-54.5-3.7-79.1-11.4-30.1-31.3-56.4-46.5-74.4-17.1-21.5-33.7-41.9-33.4-72C311.1 85.4 315.7.1 234.8 0 132.4-.2 158 103.4 156.9 135.2c-1.7 23.4-6.4 41.8-22.5 64.7-18.9 22.5-45.5 58.8-58.1 96.7-6 17.9-8.8 36.1-6.2 53.3-6.5 5.8-11.4 14.7-16.6 20.2-4.2 4.3-10.3 5.9-17 8.3s-14 6-18.5 14.5c-2.1 3.9-2.8 8.1-2.8 12.4 0 3.9.6 7.9 1.2 11.8 1.2 8.1 2.5 15.7.8 20.8-5.2 14.4-5.9 24.4-2.2 31.7 3.8 7.3 11.4 10.5 20.1 12.3 17.3 3.6 40.8 2.7 59.3 12.5 19.8 10.4 39.9 14.1 55.9 10.4 11.6-2.6 21.1-9.6 25.9-20.2 12.5-.1 26.3-5.4 48.3-6.6 14.9-1.2 33.6 5.3 55.1 4.1.6 2.3 1.4 4.6 2.5 6.7v.1c8.3 16.7 23.8 24.3 40.3 23 16.6-1.3 34.1-11 48.3-27.9 13.6-16.4 36-23.2 50.9-32.2 7.4-4.5 13.4-10.1 13.9-18.3.4-8.2-4.4-17.3-15.5-29.7zM223.7 87.3c9.8-22.2 34.2-21.8 44-.4 6.5 14.2 3.6 30.9-4.3 40.4-1.6-.8-5.9-2.6-12.6-4.9 1.1-1.2 3.1-2.7 3.9-4.6 4.8-11.8-.2-27-9.1-27.3-7.3-.5-13.9 10.8-11.8 23-4.1-2-9.4-3.5-13-4.4-1-6.9-.3-14.6 2.9-21.8zM183 75.8c10.1 0 20.8 14.2 19.1 33.5-3.5 1-7.1 2.5-10.2 4.6 1.2-8.9-3.3-20.1-9.6-19.6-8.4.7-9.8 21.2-1.8 28.1 1 .8 1.9-.2-5.9 5.5-15.6-14.6-10.5-52.1 8.4-52.1zm-13.6 60.7c6.2-4.6 13.6-10 14.1-10.5 4.7-4.4 13.5-14.2 27.9-14.2 7.1 0 15.6 2.3 25.9 8.9 6.3 4.1 11.3 4.4 22.6 9.3 8.4 3.5 13.7 9.7 10.5 18.2-2.6 7.1-11 14.4-22.7 18.1-11.1 3.6-19.8 16-38.2 14.9-3.9-.2-7-1-9.6-2.1-8-3.5-12.2-10.4-20-15-8.6-4.8-13.2-10.4-14.7-15.3-1.4-4.9 0-9 4.2-12.3zm3.3 334c-2.7 35.1-43.9 34.4-75.3 18-29.9-15.8-68.6-6.5-76.5-21.9-2.4-4.7-2.4-12.7 2.6-26.4v-.2c2.4-7.6.6-16-.6-23.9-1.2-7.8-1.8-15 .9-20 3.5-6.7 8.5-9.1 14.8-11.3 10.3-3.7 11.8-3.4 19.6-9.9 5.5-5.7 9.5-12.9 14.3-18 5.1-5.5 10-8.1 17.7-6.9 8.1 1.2 15.1 6.8 21.9 16l19.6 35.6c9.5 19.9 43.1 48.4 41 68.9zm-1.4-25.9c-4.1-6.6-9.6-13.6-14.4-19.6 7.1 0 14.2-2.2 16.7-8.9 2.3-6.2 0-14.9-7.4-24.9-13.5-18.2-38.3-32.5-38.3-32.5-13.5-8.4-21.1-18.7-24.6-29.9s-3-23.3-.3-35.2c5.2-22.9 18.6-45.2 27.2-59.2 2.3-1.7.8 3.2-8.7 20.8-8.5 16.1-24.4 53.3-2.6 82.4.6-20.7 5.5-41.8 13.8-61.5 12-27.4 37.3-74.9 39.3-112.7 1.1.8 4.6 3.2 6.2 4.1 4.6 2.7 8.1 6.7 12.6 10.3 12.4 10 28.5 9.2 42.4 1.2 6.2-3.5 11.2-7.5 15.9-9 9.9-3.1 17.8-8.6 22.3-15 7.7 30.4 25.7 74.3 37.2 95.7 6.1 11.4 18.3 35.5 23.6 64.6 3.3-.1 7 .4 10.9 1.4 13.8-35.7-11.7-74.2-23.3-84.9-4.7-4.6-4.9-6.6-2.6-6.5 12.6 11.2 29.2 33.7 35.2 59 2.8 11.6 3.3 23.7.4 35.7 16.4 6.8 35.9 17.9 30.7 34.8-2.2-.1-3.2 0-4.2 0 3.2-10.1-3.9-17.6-22.8-26.1-19.6-8.6-36-8.6-38.3 12.5-12.1 4.2-18.3 14.7-21.4 27.3-2.8 11.2-3.6 24.7-4.4 39.9-.5 7.7-3.6 18-6.8 29-32.1 22.9-76.7 32.9-114.3 7.2zm257.4-11.5c-.9 16.8-41.2 19.9-63.2 46.5-13.2 15.7-29.4 24.4-43.6 25.5s-26.5-4.8-33.7-19.3c-4.7-11.1-2.4-23.1 1.1-36.3 3.7-14.2 9.2-28.8 9.9-40.6.8-15.2 1.7-28.5 4.2-38.7 2.6-10.3 6.6-17.2 13.7-21.1.3-.2.7-.3 1-.5.8 13.2 7.3 26.6 18.8 29.5 12.6 3.3 30.7-7.5 38.4-16.3 9-.3 15.7-.9 22.6 5.1 9.9 8.5 7.1 30.3 17.1 41.6 10.6 11.6 14 19.5 13.7 24.6zM173.3 148.7c2 1.9 4.7 4.5 8 7.1 6.6 5.2 15.8 10.6 27.3 10.6 11.6 0 22.5-5.9 31.8-10.8 4.9-2.6 10.9-7 14.8-10.4s5.9-6.3 3.1-6.6-2.6 2.6-6 5.1c-4.4 3.2-9.7 7.4-13.9 9.8-7.4 4.2-19.5 10.2-29.9 10.2s-18.7-4.8-24.9-9.7c-3.1-2.5-5.7-5-7.7-6.9-1.5-1.4-1.9-4.6-4.3-4.9-1.4-.1-1.8 3.7 1.7 6.5z"},child:[]}]})(t)}function Ou(t){return ws({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M0 93.7l183.6-25.3v177.4H0V93.7zm0 324.6l183.6 25.3V268.4H0v149.9zm203.8 28L448 480V268.4H203.8v177.9zm0-380.6v180.1H448V32L203.8 65.7z"},child:[]}]})(t)}const $u=t=>{const s=t.toLowerCase();return s.includes("darwin")||s.includes("mac")?e.jsx(Pu,{className:"h-4 w-4"}):s.includes("linux")?e.jsx(Du,{className:"h-4 w-4"}):s.includes("windows")?e.jsx(Ou,{className:"h-4 w-4"}):null},Mu=t=>{const s=t.toLowerCase();return s==="oss"?"bg-blue-500/20 text-blue-700 dark:bg-blue-500/30 dark:text-blue-300 hover:bg-blue-500/30":s==="enterprise"?"bg-yellow-500/20 text-yellow-700 dark:bg-yellow-500/30 dark:text-yellow-300 hover:bg-yellow-500/30":""};function Bu({build:t,edition:s,os:r,arch:a}){const n=$u(r);return e.jsxs(ee,{children:[e.jsx(se,{children:e.jsx(ne,{children:"Version Information"})}),e.jsx(te,{children:e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(ce,{children:"Version"}),e.jsx("p",{className:"text-sm",children:t.version})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ce,{children:"Branch"}),e.jsx("p",{className:"text-sm",children:t.branch})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ce,{children:"Go Version"}),e.jsx("p",{className:"text-sm",children:t.goVersion})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(ce,{children:"Edition"}),e.jsx("div",{children:e.jsx(ye,{className:Mu(s),children:s.toUpperCase()})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ce,{children:"Architecture"}),e.jsx("p",{className:"text-sm",children:a})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ce,{children:"OS"}),e.jsxs("div",{className:"flex items-center gap-2",children:[n,e.jsx("p",{className:"text-sm",children:r})]})]})]})]})})]})}function zu({nodeName:t,className:s}){const[r,a]=i.useState({isReady:!1,message:"Checking status..."}),[n,o]=i.useState(!0);return i.useEffect(()=>{const l=async()=>{try{const u=await fetch(re(`/api/v1/proxy/${t}/ready`)),m=await u.text();a({isReady:u.ok&&m.includes("ready"),message:u.ok?"Ready":m})}catch(u){a({isReady:!1,message:u instanceof Error?u.message:"Failed to check status"})}};l();const c=setInterval(l,3e3),d=setInterval(()=>{o(u=>!u)},1e3);return()=>{clearInterval(c),clearInterval(d)}},[t]),e.jsxs("div",{className:v("flex items-center gap-2",s),children:[e.jsx("span",{className:v("text-sm",r.isReady?"text-muted-foreground":"text-red-500"),children:r.message}),e.jsx("div",{className:v("h-2.5 w-2.5 rounded-full transition-opacity duration-150",r.isReady?"bg-green-500":"bg-red-500",n?"opacity-100":"opacity-30")})]})}const Vu=[{name:"allocs",description:"A sampling of all past memory allocations"},{name:"block",description:"Stack traces that led to blocking on synchronization primitives"},{name:"heap",description:"A sampling of memory allocations of live objects"},{name:"mutex",description:"Stack traces of holders of contended mutexes"},{name:"profile",urlSuffix:"?seconds=15",description:"CPU profile (15 seconds)",displayName:"profile"},{name:"goroutine",description:"Stack traces of all current goroutines (debug=1)",variants:[{suffix:"?debug=0",label:"Basic",description:"Basic goroutine info"},{suffix:"?debug=1",label:"Standard",description:"Standard goroutine stack traces"},{suffix:"?debug=2",label:"Full",description:"Full goroutine stack dump with additional info"}]},{name:"threadcreate",description:"Stack traces that led to the creation of new OS threads",urlSuffix:"?debug=1",displayName:"threadcreate"},{name:"trace",description:"A trace of execution of the current program",urlSuffix:"?debug=1",displayName:"trace"}];function Uu({nodeName:t}){const s=r=>{window.open(re(`/api/v1/proxy/${t}/debug/pprof/${r}`),"_blank")};return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm font-medium",children:"Profiling Tools:"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:Vu.map(r=>r.variants?r.variants.map(a=>e.jsxs(rt,{children:[e.jsx(at,{asChild:!0,children:e.jsx(q,{variant:"outline",size:"sm",onClick:()=>s(`${r.name}${a.suffix}`),children:`${r.name} (${a.label})`})}),e.jsx(qe,{children:e.jsx("p",{children:a.description})})]},`${r.name}${a.suffix}`)):e.jsxs(rt,{children:[e.jsx(at,{asChild:!0,children:e.jsx(q,{variant:"outline",size:"sm",onClick:()=>s(`${r.name}${r.urlSuffix||""}`),children:r.displayName||r.name})}),e.jsx(qe,{children:e.jsx("p",{children:r.description})})]},r.name))})]})}function qu(){const{nodeName:t}=Sr(),[s,r]=i.useState("config"),{nodeDetails:a,isLoading:n,error:o}=Nu(t),{metrics:l,isLoading:c,error:d}=ku(t,s==="raw-metrics"),[u,m]=i.useState(!1);return n?e.jsx("div",{className:"container space-y-6 p-6",children:e.jsxs("div",{className:"flex items-center justify-center",children:[e.jsx("div",{className:"h-6 w-6 animate-spin rounded-full border-2 border-primary border-t-transparent"}),e.jsx("span",{className:"ml-2 text-sm text-muted-foreground",children:"Loading..."})]})}):a?e.jsx(Se,{children:e.jsxs(ee,{children:[e.jsx(se,{children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"flex-1",children:e.jsx(ne,{children:e.jsx("h2",{className:"text-3xl font-semibold tracking-tight",children:e.jsxs("div",{className:"flex items-center gap-2",children:[a.target," - ",t,e.jsx(Bs,{text:t||""})]})})})}),e.jsx(zu,{nodeName:t||""})]})}),e.jsxs(te,{className:"space-y-6",children:[e.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[e.jsx(Bu,{build:a.build,edition:a.edition,os:a.os,arch:a.arch}),e.jsxs(ee,{children:[e.jsx(se,{children:e.jsx(ne,{children:"Cluster Information"})}),e.jsx(te,{children:e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(ce,{children:"Cluster ID"}),e.jsx("p",{className:"text-sm",children:a.clusterID})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ce,{children:"Created"}),e.jsx("p",{className:"text-sm",children:Nt(a.clusterSeededAt,"PPpp")})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ce,{children:"Storage"}),e.jsx("p",{children:e.jsx(Au,{type:(a.metrics.store_object_type||"filesystem").toLowerCase(),className:""})})]})]})})]}),e.jsxs(ee,{children:[e.jsxs(se,{className:"flex flex-row items-center justify-between",children:[e.jsx(ne,{children:"Service Status"}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(ce,{htmlFor:"view-mode",children:"Table View"}),e.jsx(dn,{id:"view-mode",checked:u,onCheckedChange:m})]})]}),e.jsx(te,{children:u?e.jsx(Tu,{services:a.services}):e.jsx(Eu,{services:a.services})})]})]}),e.jsxs("div",{className:"flex items-center gap-6",children:[e.jsxs("div",{className:"flex items-center gap-2 mr-4",children:[e.jsx(ce,{children:"Log Level"}),e.jsx(Lu,{nodeName:t||""})]}),e.jsx(Uu,{nodeName:t||""})]}),e.jsx("div",{children:e.jsxs(id,{defaultValue:"config",onValueChange:r,children:[e.jsxs(en,{children:[e.jsx(vt,{value:"config",children:"Configuration"}),e.jsx(vt,{value:"metrics",children:"Analytics"}),e.jsx(vt,{value:"raw-metrics",children:"Raw Metrics"})]}),e.jsx(jt,{value:"config",className:"mt-6",children:e.jsx(ns,{language:"yaml",code:a.config,fileName:"loki.yaml"})}),e.jsx(jt,{value:"metrics",className:"mt-6",children:a.metrics&&e.jsx(ns,{code:JSON.stringify(a.metrics,null,2),language:"json",fileName:"analytics.json"})}),e.jsx(jt,{value:"raw-metrics",className:"mt-6",children:c?e.jsxs("div",{className:"flex items-center justify-center p-6",children:[e.jsx("div",{className:"h-6 w-6 animate-spin rounded-full border-2 border-primary border-t-transparent"}),e.jsx("span",{className:"ml-2 text-sm text-muted-foreground",children:"Loading metrics..."})]}):d?e.jsx("div",{className:"bg-red-50 dark:bg-red-900 border-l-4 border-red-400 p-4",children:e.jsx("p",{className:"text-sm text-red-700 dark:text-red-200",children:d})}):l?e.jsx(ns,{code:l,language:"yaml",fileName:"metrics"}):null})]})})]})]})}):e.jsx("div",{className:"container space-y-6 p-6",children:e.jsx("div",{className:"bg-red-50 dark:bg-red-900 border-l-4 border-red-400 p-4",children:e.jsx("div",{className:"flex",children:e.jsx("div",{className:"ml-3",children:e.jsx("p",{className:"text-sm text-red-700 dark:text-red-200",children:o||`Node "${t}" not found`})})})})})}function Gu(){return e.jsx(Ja,{children:e.jsx(qu,{})})}function _e(){return e.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[80vh] p-4",children:[e.jsx(qo,{className:"h-16 w-16 text-muted-foreground mb-6"}),e.jsx("h1",{className:"text-4xl font-bold text-center mb-4",children:"Coming Soon"}),e.jsx("p",{className:"text-lg text-muted-foreground text-center max-w-md",children:"We're working hard to bring you this feature. Stay tuned for updates!"})]})}const un=Ce("inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent shadow-sm hover:bg-accent hover:text-accent-foreground"},size:{default:"h-9 px-2 min-w-9",sm:"h-8 px-1.5 min-w-8",lg:"h-10 px-2.5 min-w-10"}},defaultVariants:{variant:"default",size:"default"}}),Hu=i.forwardRef(({className:t,variant:s,size:r,...a},n)=>e.jsx(Ur,{ref:n,className:v(un({variant:s,size:r,className:t})),...a}));Hu.displayName=Ur.displayName;const pn=i.createContext({size:"default",variant:"default"}),mn=i.forwardRef(({className:t,variant:s,size:r,children:a,...n},o)=>e.jsx(qr,{ref:o,className:v("flex items-center justify-center gap-1",t),...n,children:e.jsx(pn.Provider,{value:{variant:s,size:r},children:a})}));mn.displayName=qr.displayName;const fn=i.forwardRef(({className:t,children:s,variant:r,size:a,...n},o)=>{const l=i.useContext(pn);return e.jsx(Gr,{ref:o,className:v(un({variant:l.variant||r,size:l.size||a}),t),...n,children:s})});fn.displayName=Gr.displayName;const It={Received:"received",Processing:"processed"},Ku=t=>{const{cluster:s}=pe(),r=i.useMemo(()=>$e(s==null?void 0:s.members,ja.compactor),[s==null?void 0:s.members]),{data:a,isLoading:n,error:o}=Bt({queryKey:["deletes",t,r],queryFn:async()=>{try{return(await Promise.all(t.map(async c=>{const d=await fetch(re(`/api/v1/proxy/${r}/compactor/ui/api/v1/deletes?status=${c}`));if(!d.ok){const u=await d.text();throw new Error(u||`HTTP error! status: ${d.status}`)}return d.json()}))).flat()}catch(l){throw l instanceof Error?l:new Error("Failed to fetch delete requests")}},enabled:!!r});return{data:a,isLoading:n,error:o}},Wu=({selectedStatus:t,onStatusChange:s,queryFilter:r,onQueryFilterChange:a})=>e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm font-medium",children:"Status"}),e.jsx(mn,{type:"multiple",value:t,onValueChange:n=>{n.length>0&&s(n)},className:"justify-start",children:Object.entries(It).map(([n,o])=>e.jsx(fn,{value:o,"aria-label":`Toggle ${n.toLowerCase()} status`,className:"capitalize",children:n},o))})]}),e.jsx(be,{type:"search",placeholder:"Filter by query...",value:r,onChange:n=>a(n.target.value),className:"w-[300px]"})]}),Zu=({status:t})=>{const s=t===It.Received?"secondary":"default";return e.jsx(ye,{variant:s,className:"capitalize",children:t})},Yu=({start:t,end:s})=>{const r=ei(Xs(t/1e3),Xs(s/1e3)),a=n=>{const o=new Date(n);return Nt(new Date(o.getTime()+o.getTimezoneOffset()*6e4),"yyyy-MM-dd HH:mm:ss")};return e.jsxs(Ut,{children:[e.jsx(qt,{children:e.jsx("span",{className:"cursor-default",children:r})}),e.jsx(ft,{className:"w-fit",children:e.jsx("div",{className:"space-y-2",children:e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"px-2 py-0.5 text-xs font-medium bg-gray-100 rounded dark:bg-gray-700 w-14 text-center",children:"From"}),e.jsx("span",{className:"font-mono",children:a(t)})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"px-2 py-0.5 text-xs font-medium bg-gray-100 rounded dark:bg-gray-700 w-14 text-center",children:"To"}),e.jsx("span",{className:"font-mono",children:a(s)})]})]})})})]})},Xu=({requests:t,sortField:s,sortDirection:r,onSort:a})=>{const n=[...t].sort((o,l)=>{let c=0,d,u;switch(s){case"status":c=o.status.localeCompare(l.status);break;case"user":c=o.user_id.localeCompare(l.user_id);break;case"createdAt":c=o.created_at-l.created_at;break;case"duration":d=o.end_time-o.start_time,u=l.end_time-l.start_time,c=d-u;break}return r==="asc"?c:-c});return e.jsx("div",{className:"rounded-md border bg-card",children:e.jsxs(Te,{children:[e.jsx(Re,{children:e.jsxs(X,{className:"hover:bg-transparent",children:[e.jsx(D,{className:"w-[80px]",children:e.jsx(Z,{title:"Status",field:"status",sortField:s,sortDirection:r,onSort:a})}),e.jsx(D,{className:"w-[100px]",children:e.jsx(Z,{title:"User",field:"user",sortField:s,sortDirection:r,onSort:a})}),e.jsx(D,{className:"w-[200px]",children:e.jsx(Z,{title:"Created At",field:"createdAt",sortField:s,sortDirection:r,onSort:a})}),e.jsx(D,{className:"w-[150px]",children:e.jsx(Z,{title:"Range",field:"duration",sortField:s,sortDirection:r,onSort:a})}),e.jsx(D,{className:"w-[100px]",children:"Deleted Lines"}),e.jsx(D,{children:"Query"})]})}),e.jsxs(Ae,{children:[n.map(o=>e.jsxs(X,{children:[e.jsx(F,{className:"px-4",children:e.jsx(Zu,{status:o.status})}),e.jsx(F,{children:o.user_id}),e.jsx(F,{children:e.jsx(Ms,{date:new Date(o.created_at)})}),e.jsx(F,{children:e.jsx(Yu,{start:o.start_time,end:o.end_time})}),e.jsx(F,{children:o.deleted_lines}),e.jsx(F,{children:e.jsx("code",{className:"font-mono text-sm whitespace-pre-wrap break-all",children:o.query})})]},`${o.request_id}-${o.start_time}-${o.end_time}`)),n.length===0&&e.jsx(X,{children:e.jsx(F,{colSpan:7,className:"h-24 text-center",children:e.jsx("div",{className:"text-muted-foreground",children:"No delete requests found"})})})]})]})})},Qu=()=>{const[t,s]=i.useState([It.Received,It.Processing]),[r,a]=i.useState(""),[n,o]=i.useState("createdAt"),[l,c]=i.useState("desc"),{data:d,isLoading:u,error:m}=Ku(t),g=i.useMemo(()=>!d||!r?d:d.filter(N=>N.query.toLowerCase().includes(r.toLowerCase())),[d,r]),y=N=>{N===n?c(l==="asc"?"desc":"asc"):(o(N),c("desc"))};return e.jsx(Se,{children:e.jsxs(ee,{className:"shadow-sm",children:[e.jsx(se,{children:e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-3xl font-semibold tracking-tight",children:"Delete Requests"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"View and manage delete requests in your cluster"})]}),e.jsx(q,{variant:"default",asChild:!0,children:e.jsxs(de,{to:"/tenants/deletes/new",children:[e.jsx(Go,{className:"mr-2 h-4 w-4"}),"New Delete Request"]})})]}),e.jsx(Wu,{selectedStatus:t,onStatusChange:s,queryFilter:r,onQueryFilterChange:a})]})}),e.jsx(te,{children:e.jsxs("div",{className:"space-y-4",children:[m&&e.jsxs(He,{variant:"destructive",children:[e.jsx(ot,{className:"h-4 w-4"}),e.jsx(Ke,{children:"Error"}),e.jsx(We,{children:m.message})]}),u&&e.jsx("div",{className:"flex items-center justify-center p-8",children:e.jsx(xe,{className:"h-16 w-16 animate-spin"})}),!u&&!m&&g&&e.jsx(Xu,{requests:g,sortField:n,sortDirection:l,onSort:y})]})})]})})},gn=Di,hn=i.createContext({}),Fe=({...t})=>e.jsx(hn.Provider,{value:{name:t.name},children:e.jsx(Oi,{...t})}),Zt=()=>{const t=i.useContext(hn),s=i.useContext(xn),{getFieldState:r,formState:a}=Pi(),n=r(t.name,a);if(!t)throw new Error("useFormField should be used within ");const{id:o}=s;return{id:o,name:t.name,formItemId:`${o}-form-item`,formDescriptionId:`${o}-form-item-description`,formMessageId:`${o}-form-item-message`,...n}},xn=i.createContext({}),je=i.forwardRef(({className:t,...s},r)=>{const a=i.useId();return e.jsx(xn.Provider,{value:{id:a},children:e.jsx("div",{ref:r,className:v("space-y-2",t),...s})})});je.displayName="FormItem";const he=i.forwardRef(({className:t,...s},r)=>{const{error:a,formItemId:n}=Zt();return e.jsx(ce,{ref:r,className:v(a&&"text-destructive",t),htmlFor:n,...s})});he.displayName="FormLabel";const we=i.forwardRef(({...t},s)=>{const{error:r,formItemId:a,formDescriptionId:n,formMessageId:o}=Zt();return e.jsx(Ee,{ref:s,id:a,"aria-describedby":r?`${n} ${o}`:`${n}`,"aria-invalid":!!r,...t})});we.displayName="FormControl";const bn=i.forwardRef(({className:t,...s},r)=>{const{formDescriptionId:a}=Zt();return e.jsx("p",{ref:r,id:a,className:v("text-[0.8rem] text-muted-foreground",t),...s})});bn.displayName="FormDescription";const Ne=i.forwardRef(({className:t,children:s,...r},a)=>{const{error:n,formMessageId:o}=Zt(),l=n?String(n==null?void 0:n.message):s;return l?e.jsx("p",{ref:a,id:o,className:v("text-[0.8rem] font-medium text-destructive",t),...r,children:l}):null});Ne.displayName="FormMessage";const yn=i.forwardRef(({className:t,...s},r)=>e.jsx("textarea",{className:v("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",t),ref:r,...s}));yn.displayName="Textarea";var Ju=function(t,s){for(var r={};t.length;){var a=t[0],n=a.code,o=a.message,l=a.path.join(".");if(!r[l])if("unionErrors"in a){var c=a.unionErrors[0].errors[0];r[l]={message:c.message,type:c.code}}else r[l]={message:o,type:n};if("unionErrors"in a&&a.unionErrors.forEach(function(m){return m.errors.forEach(function(g){return t.push(g)})}),s){var d=r[l].types,u=d&&d[a.code];r[l]=Bi(l,s,r,n,u?[].concat(u,a.message):a.message)}t.shift()}return r},vn=function(t,s,r){return r===void 0&&(r={}),function(a,n,o){try{return Promise.resolve(function(l,c){try{var d=Promise.resolve(t[r.mode==="sync"?"parse":"parseAsync"](a,s)).then(function(u){return o.shouldUseNativeValidation&&$i({},o),{errors:{},values:r.raw?a:u}})}catch(u){return c(u)}return d&&d.then?d.then(void 0,c):d}(0,function(l){if(function(c){return Array.isArray(c==null?void 0:c.errors)}(l))return{values:{},errors:Mi(Ju(l.errors,!o.shouldUseNativeValidation&&o.criteriaMode==="all"),o)};throw l}))}catch(l){return Promise.reject(l)}}};const ep=ca({tenant_id:Xe().min(1,"Tenant ID is required"),query:Xe().min(1,"Query is required"),start_time:Js(),end_time:Js().refine(t=>t>new Date(Date.now()-7*24*60*60*1e3),"End time must be after start time")}),tp=()=>{const t=Ft(),s=_i(),[r,a]=i.useState(null),[n,o]=i.useState(!1),{cluster:l}=pe(),c=i.useMemo(()=>$e(l==null?void 0:l.members,ja.compactor),[l==null?void 0:l.members]),d=da({resolver:vn(ep),defaultValues:{tenant_id:"",query:"",start_time:new Date(Date.now()-7*24*60*60*1e3),end_time:new Date}}),u=i.useCallback(async(N,h=!1)=>{if(N.trim()){o(!0);try{const p=await fetch(re(`/api/v1/proxy/${c}/loki/api/v1/format_query?query=${N}`),{method:"POST"}),f=await p.json();if(!p.ok||f.status==="invalid-query")throw new Error(f.error||"Invalid LogQL query");d.clearErrors("query"),h&&d.setValue("query",f.data)}catch(p){d.setError("query",{message:p instanceof Error?p.message:"Invalid LogQL query"})}finally{o(!1)}}},[d,c]),m=i.useMemo(()=>Si(N=>u(N,!1),1e3),[u]),g=async N=>{const h=new URLSearchParams;h.append("query",N.query),h.append("start",Math.floor(N.start_time.getTime()/1e3).toString()),h.append("end",Math.floor(N.end_time.getTime()/1e3).toString());try{const p=await fetch(re(`/api/v1/proxy/${c}/compactor/ui/api/v1/deletes?${h.toString()}`),{method:"POST",headers:{"X-Scope-OrgID":N.tenant_id}});if(!p.ok){const f=await p.text();throw new Error(f||"Failed to create delete request")}await s.invalidateQueries({queryKey:["deletes"]}),t("/tenants/deletes")}catch(p){console.error("Error creating delete request:",p),a(p instanceof Error?p.message:"Failed to create delete request")}},y=i.useMemo(()=>{const N=d.watch("start_time"),h=d.watch("end_time");return ti(si({start:N,end:h}),{format:["years","months","weeks","days","hours","minutes"],zero:!1})},[d]);return e.jsx(Se,{children:e.jsxs(ee,{children:[e.jsx(se,{children:e.jsx(ne,{children:"New Delete Request"})}),e.jsxs(te,{children:[r&&e.jsxs(He,{variant:"destructive",className:"mb-6",children:[e.jsx(ot,{className:"h-4 w-4"}),e.jsx(Ke,{children:"Error"}),e.jsx(We,{children:r})]}),e.jsx(gn,{...d,children:e.jsxs("form",{onSubmit:d.handleSubmit(g),className:"space-y-8",children:[e.jsx(Fe,{control:d.control,name:"tenant_id",render:({field:N})=>e.jsxs(je,{children:[e.jsx(he,{children:"TENANT ID"}),e.jsx(we,{children:e.jsx(be,{placeholder:"Enter tenant ID",...N})}),e.jsx(Ne,{})]})}),e.jsx(Fe,{control:d.control,name:"query",render:({field:N})=>e.jsxs(je,{children:[e.jsx(he,{children:"LOGQL QUERY"}),e.jsx(we,{children:e.jsxs("div",{className:"relative",children:[e.jsx(yn,{placeholder:'{app="example"}',className:"font-mono",...N,onChange:h=>{N.onChange(h),m(h.target.value)},onBlur:async h=>{N.onBlur(),h.target.value&&await u(h.target.value,!0)}}),n&&e.jsx("div",{className:"absolute right-3 top-3",children:e.jsx(xe,{className:"h-5 w-5 animate-spin"})})]})}),e.jsx(bn,{children:"Enter a LogQL query with labels in curly braces"}),e.jsx(Ne,{})]})}),e.jsxs("div",{className:"grid grid-cols-3 gap-8",children:[e.jsx(Fe,{control:d.control,name:"start_time",render:({field:N})=>e.jsxs(je,{children:[e.jsx(he,{children:"START TIME"}),e.jsx(we,{children:e.jsx(Qs,{selected:N.value,onChange:N.onChange,showTimeSelect:!0,timeFormat:"HH:mm",timeIntervals:15,dateFormat:"yyyy-MM-dd HH:mm",className:"flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50"})}),e.jsx(Ne,{})]})}),e.jsx(Fe,{control:d.control,name:"end_time",render:({field:N})=>e.jsxs(je,{children:[e.jsx(he,{children:"END TIME"}),e.jsx(we,{children:e.jsx(Qs,{selected:N.value,onChange:N.onChange,showTimeSelect:!0,timeFormat:"HH:mm",timeIntervals:15,dateFormat:"yyyy-MM-dd HH:mm",minDate:d.watch("start_time"),className:"flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50"})}),e.jsx(Ne,{})]})}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(he,{children:"DURATION"}),e.jsx("div",{className:"h-10 flex items-center",children:e.jsx("span",{className:"text-sm text-muted-foreground",children:y})})]})]}),e.jsxs("div",{className:"flex justify-end space-x-3 pt-6 border-t",children:[e.jsx(q,{type:"button",variant:"outline",onClick:()=>t("/tenants/deletes"),children:"Cancel"}),e.jsx(q,{type:"submit",disabled:!d.formState.isValid||d.formState.isSubmitting,children:d.formState.isSubmitting?"Creating...":"Create Delete Request"})]})]})})]})]})})},sp={light:"",dark:".dark"},jn=i.createContext(null);function wn(){const t=i.useContext(jn);if(!t)throw new Error("useChart must be used within a ");return t}const Nn=i.forwardRef(({id:t,className:s,children:r,config:a,...n},o)=>{const l=i.useId(),c=`chart-${t||l.replace(/:/g,"")}`;return e.jsx(jn.Provider,{value:{config:a},children:e.jsxs("div",{"data-chart":c,ref:o,className:v("flex aspect-video justify-center text-xs [&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-none [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-sector]:outline-none [&_.recharts-surface]:outline-none",s),...n,children:[e.jsx(rp,{id:c,config:a}),e.jsx(dt,{children:r})]})})});Nn.displayName="Chart";const rp=({id:t,config:s})=>{const r=Object.entries(s).filter(([,a])=>a.theme||a.color);return r.length?e.jsx("style",{dangerouslySetInnerHTML:{__html:Object.entries(sp).map(([a,n])=>` +${n} [data-chart=${t}] { +${r.map(([o,l])=>{var d;const c=((d=l.theme)==null?void 0:d[a])||l.color;return c?` --color-${o}: ${c};`:null}).join(` +`)} +} +`).join(` +`)}}):null},ap=ut,kn=i.forwardRef(({active:t,payload:s,className:r,indicator:a="dot",hideLabel:n=!1,hideIndicator:o=!1,label:l,labelFormatter:c,labelClassName:d,formatter:u,color:m,nameKey:g,labelKey:y},N)=>{const{config:h}=wn(),p=i.useMemo(()=>{var E;if(n||!(s!=null&&s.length))return null;const[x]=s,b=`${y||x.dataKey||x.name||"value"}`,j=gs(h,x,b),w=!y&&typeof l=="string"?((E=h[l])==null?void 0:E.label)||l:j==null?void 0:j.label;return c?e.jsx("div",{className:v("font-medium",d),children:c(w,s)}):w?e.jsx("div",{className:v("font-medium",d),children:w}):null},[l,c,s,n,d,h,y]);if(!t||!(s!=null&&s.length))return null;const f=s.length===1&&a!=="dot";return e.jsxs("div",{ref:N,className:v("grid min-w-[8rem] items-start gap-1.5 rounded-lg border border-border/50 bg-background px-2.5 py-1.5 text-xs shadow-xl",r),children:[f?null:p,e.jsx("div",{className:"grid gap-1.5",children:s.map((x,b)=>{const j=`${g||x.name||x.dataKey||"value"}`,w=gs(h,x,j),E=m||x.payload.fill||x.color;return e.jsx("div",{className:v("flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-muted-foreground",a==="dot"&&"items-center"),children:u&&(x==null?void 0:x.value)!==void 0&&x.name?u(x.value,x.name,x,b,x.payload):e.jsxs(e.Fragment,{children:[w!=null&&w.icon?e.jsx(w.icon,{}):!o&&e.jsx("div",{className:v("shrink-0 rounded-[2px] border-[--color-border] bg-[--color-bg]",{"h-2.5 w-2.5":a==="dot","w-1":a==="line","w-0 border-[1.5px] border-dashed bg-transparent":a==="dashed","my-0.5":f&&a==="dashed"}),style:{"--color-bg":E,"--color-border":E}}),e.jsxs("div",{className:v("flex flex-1 justify-between leading-none",f?"items-end":"items-center"),children:[e.jsxs("div",{className:"grid gap-1.5",children:[f?p:null,e.jsx("span",{className:"text-muted-foreground",children:(w==null?void 0:w.label)||x.name})]}),x.value&&e.jsx("span",{className:"font-mono font-medium tabular-nums text-foreground",children:x.value.toLocaleString()})]})]})},x.dataKey)})})]})});kn.displayName="ChartTooltip";const np=i.forwardRef(({className:t,hideIcon:s=!1,payload:r,verticalAlign:a="bottom",nameKey:n},o)=>{const{config:l}=wn();return r!=null&&r.length?e.jsx("div",{ref:o,className:v("flex items-center justify-center gap-4",a==="top"?"pb-3":"pt-3",t),children:r.map(c=>{const d=`${n||c.dataKey||"value"}`,u=gs(l,c,d);return e.jsxs("div",{className:v("flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-muted-foreground"),children:[u!=null&&u.icon&&!s?e.jsx(u.icon,{}):e.jsx("div",{className:"h-2 w-2 shrink-0 rounded-[2px]",style:{backgroundColor:c.color}}),u==null?void 0:u.label]},c.value)})}):null});np.displayName="ChartLegend";function gs(t,s,r){if(typeof s!="object"||s===null)return;const a="payload"in s&&typeof s.payload=="object"&&s.payload!==null?s.payload:void 0;let n=r;return r in s&&typeof s[r]=="string"?n=s[r]:a&&r in a&&typeof a[r]=="string"&&(n=a[r]),n in t?t[n]:t[r]}const op=wi,ip=Ni,lp=ki,cp=ca({tenant:Xe().min(1,"Tenant ID is required"),since:Xe(),matcher:Xe().default("{}")}),dp=[{value:"1h",label:"Last 1 hour"},{value:"3h",label:"Last 3 hours"},{value:"6h",label:"Last 6 hours"},{value:"12h",label:"Last 12 hours"},{value:"24h",label:"Last 24 hours"}];function up({values:t,totalValues:s}){return e.jsx("div",{className:"space-y-2 py-2",children:t.map(({value:r,count:a})=>e.jsxs("div",{className:"grid grid-cols-[200px_1fr_80px] items-center gap-4",children:[e.jsx(ye,{variant:"outline",className:"font-mono text-xs justify-self-start overflow-hidden",children:r}),e.jsx("div",{className:"h-2 bg-muted rounded-full overflow-hidden",children:e.jsx("div",{className:"h-full bg-primary",style:{width:`${a/s*100}%`}})}),e.jsxs("span",{className:"text-xs text-muted-foreground tabular-nums justify-self-end",children:[(a/s*100).toFixed(1),"%"]})]},r))})}function pp(){const{cluster:t}=pe(),{toast:s}=Vt(),[r,a]=i.useState(null),[n,o]=i.useState("uniqueValues"),[l,c]=i.useState("desc"),[d,u]=i.useState("uniqueValues"),[m,g]=i.useState(new Set),y=da({resolver:vn(cp),defaultValues:{matcher:"{}",since:"1h"}}),N=$e(t==null?void 0:t.members,"query-frontend"),{isLoading:h,refetch:p}=Bt({queryKey:["analyze-labels"],queryFn:async()=>{try{const w=y.getValues(),E=new Date,C=new Date(E.getTime()-mp(w.since)),A=await fetch(re(`/api/v1/proxy/${N}/loki/api/v1/series?match[]=${encodeURIComponent(w.matcher)}&start=${C.getTime()*1e6}&end=${E.getTime()*1e6}`),{headers:{"X-Scope-OrgID":w.tenant}});if(!A.ok){const M=await A.text();throw new Error(M||"Failed to fetch series")}const B=await A.json(),z=new Map,Y=new Map;B.data.forEach(M=>{Object.entries(M).forEach(([W,T])=>{z.has(W)||(z.set(W,{uniqueValues:new Set,inStreams:0}),Y.set(W,new Map));const O=z.get(W),V=Y.get(W);O.uniqueValues.add(T),O.inStreams++,V.set(T,(V.get(T)||0)+1)})});const K=Array.from(z.entries()).map(([M,W])=>{const T=Array.from(Y.get(M).entries()).map(([O,V])=>({value:O,count:V})).sort((O,V)=>V.count-O.count).slice(0,5);return{name:M,uniqueValues:W.uniqueValues.size,inStreams:W.inStreams,sampleValues:T}});return K.sort((M,W)=>W.uniqueValues-M.uniqueValues),a({totalStreams:B.data.length,uniqueLabels:z.size,labels:K}),B}catch(w){throw s({variant:"destructive",title:"Error analyzing labels",description:w instanceof Error?w.message:"An unexpected error occurred"}),w}},enabled:!1});function f(){p()}const x=i.useMemo(()=>{const w=document.createElement("style"),E=(r==null?void 0:r.labels.slice(0,10).map((C,A)=>{const B=A*137.5%360;return`--chart-color-${A}: hsl(${B}, 70%, 50%);`}).join(` +`))||"";return w.textContent=`:root { ${E} }`,document.head.appendChild(w),()=>w.remove()},[r]);i.useEffect(()=>x,[x]);const b={value:{label:d==="uniqueValues"?"Unique Values":"Found In Streams",theme:{light:"var(--chart-color-0)",dark:"var(--chart-color-0)"}}},j=i.useMemo(()=>r?[...r.labels].sort((w,E)=>{let C=0;switch(n){case"name":C=w.name.localeCompare(E.name);break;case"uniqueValues":C=w.uniqueValues-E.uniqueValues;break;case"inStreams":C=w.inStreams-E.inStreams;break;case"cardinality":C=w.uniqueValues/w.inStreams-E.uniqueValues/E.inStreams;break}return l==="asc"?C:-C}):[],[r,n,l]);return e.jsxs("div",{className:"container mx-auto p-4 space-y-6",children:[e.jsxs(ee,{children:[e.jsxs(se,{children:[e.jsx(ne,{children:"Analyze Labels"}),e.jsx(Je,{children:"Analyze label distribution across your log streams"})]}),e.jsx(te,{children:e.jsx(gn,{...y,children:e.jsxs("form",{onSubmit:y.handleSubmit(f),className:"grid grid-cols-1 md:grid-cols-4 gap-4",children:[e.jsx(Fe,{control:y.control,name:"tenant",render:({field:w})=>e.jsxs(je,{className:"flex flex-col space-y-1.5",children:[e.jsx(he,{children:"Tenant ID"}),e.jsx(we,{children:e.jsx(be,{placeholder:"Enter tenant ID...",...w})}),e.jsx(Ne,{className:"text-xs"})]})}),e.jsx(Fe,{control:y.control,name:"since",render:({field:w})=>e.jsxs(je,{className:"flex flex-col space-y-1.5",children:[e.jsx(he,{children:"Time Range"}),e.jsxs(Rt,{onValueChange:w.onChange,defaultValue:w.value,children:[e.jsx(we,{children:e.jsx(tt,{children:e.jsx(At,{placeholder:"Select time range"})})}),e.jsx(st,{children:dp.map(E=>e.jsx(Ve,{value:E.value,children:E.label},E.value))})]}),e.jsx(Ne,{className:"text-xs"})]})}),e.jsx(Fe,{control:y.control,name:"matcher",render:({field:w})=>e.jsxs(je,{className:"flex flex-col space-y-1.5",children:[e.jsx(he,{children:"Matcher"}),e.jsx(we,{children:e.jsx(be,{placeholder:"Enter matcher... (default: {})",...w})}),e.jsx(Ne,{className:"text-xs"})]})}),e.jsx(q,{type:"submit",disabled:h,className:"self-end h-10",children:h?"Analyzing...":"Analyze"})]})})})]}),r&&e.jsxs(e.Fragment,{children:[e.jsxs(ee,{children:[e.jsxs(se,{className:"flex flex-col items-stretch space-y-0 border-b p-0 sm:flex-row",children:[e.jsxs("div",{className:"flex flex-1 flex-col justify-center gap-1 px-6 py-5 sm:py-6",children:[e.jsx(ne,{children:"Label Distribution"}),e.jsx(Je,{children:"Top 20 labels by unique values"})]}),e.jsxs("div",{className:"flex",children:[e.jsxs("div",{className:"relative z-30 flex flex-1 flex-col justify-center gap-1 px-6 py-4 text-left sm:px-8 sm:py-6",children:[e.jsx("span",{className:"text-xs text-muted-foreground",children:"Total Streams"}),e.jsx("span",{className:"text-lg font-bold leading-none sm:text-3xl",children:r.totalStreams.toLocaleString()})]}),e.jsxs("div",{className:"relative z-30 flex flex-1 flex-col justify-center gap-1 border-l px-6 py-4 text-left sm:px-8 sm:py-6",children:[e.jsx("span",{className:"text-xs text-muted-foreground",children:"Unique Labels"}),e.jsx("span",{className:"text-lg font-bold leading-none sm:text-3xl",children:r.uniqueLabels.toLocaleString()})]})]})]}),e.jsxs(te,{className:"px-2 sm:p-6",children:[e.jsx("div",{className:"mb-4",children:e.jsxs(Rt,{value:d,onValueChange:w=>u(w),children:[e.jsx(tt,{className:"w-[200px]",children:e.jsx(At,{placeholder:"Select metric"})}),e.jsxs(st,{children:[e.jsx(Ve,{value:"uniqueValues",children:"Unique Values"}),e.jsx(Ve,{value:"inStreams",children:"Found In Streams"})]})]})}),e.jsx(Nn,{config:b,className:"aspect-auto h-[500px] w-full",children:e.jsxs(Ei,{data:r.labels.slice(0,20).map((w,E)=>({name:w.name,value:d==="uniqueValues"?w.uniqueValues:w.inStreams,fill:`var(--chart-color-${E})`})),layout:"vertical",margin:{right:24},barSize:452/Math.min(20,r.labels.length)*.6,maxBarSize:24,children:[e.jsx(Ci,{horizontal:!1}),e.jsx(Ti,{dataKey:"name",type:"category",tickLine:!1,axisLine:!1,width:90,fontSize:11,interval:0}),e.jsx(Ri,{type:"number",tickLine:!1,axisLine:!1,tickMargin:8}),e.jsx(ap,{content:e.jsx(kn,{className:"w-[200px]"})}),e.jsx(Ai,{dataKey:"value",fillOpacity:.8,radius:[4,4,0,0]})]})})]})]}),e.jsxs(ee,{children:[e.jsx(se,{children:e.jsx(ne,{children:"Label Details"})}),e.jsx(te,{children:e.jsxs(Te,{children:[e.jsx(Re,{children:e.jsxs(X,{children:[e.jsx(D,{children:e.jsx(Z,{title:"Label Name",field:"name",sortField:n,sortDirection:l,onSort:w=>{w===n?c(l==="asc"?"desc":"asc"):(o(w),c("desc"))}})}),e.jsx(D,{children:e.jsx(Z,{title:"Unique Values",field:"uniqueValues",sortField:n,sortDirection:l,onSort:w=>{w===n?c(l==="asc"?"desc":"asc"):(o(w),c("desc"))}})}),e.jsx(D,{children:e.jsx(Z,{title:"Found In Streams",field:"inStreams",sortField:n,sortDirection:l,onSort:w=>{w===n?c(l==="asc"?"desc":"asc"):(o(w),c("desc"))}})}),e.jsx(D,{children:e.jsx(Z,{title:"Cardinality %",field:"cardinality",sortField:n,sortDirection:l,onSort:w=>{w===n?c(l==="asc"?"desc":"asc"):(o(w),c("desc"))}})})]})}),e.jsx(Ae,{children:j.map(w=>e.jsx(op,{asChild:!0,open:m.has(w.name),onOpenChange:E=>{const C=new Set(m);E?C.add(w.name):C.delete(w.name),g(C)},children:e.jsxs(e.Fragment,{children:[e.jsxs(X,{children:[e.jsx(F,{className:"font-medium",children:e.jsxs(ip,{className:"flex items-center gap-2 hover:text-primary",children:[e.jsx(it,{className:v("h-4 w-4 transition-transform",m.has(w.name)&&"rotate-180")}),w.name]})}),e.jsx(F,{children:w.uniqueValues.toLocaleString()}),e.jsx(F,{children:w.inStreams.toLocaleString()}),e.jsxs(F,{children:[(w.uniqueValues/w.inStreams*100).toFixed(2),"%"]})]}),e.jsx(lp,{asChild:!0,children:e.jsx(X,{children:e.jsx(F,{colSpan:4,className:"border-t-0 bg-muted/5",children:e.jsx("div",{className:"px-4",children:e.jsx(up,{values:w.sampleValues,totalValues:w.inStreams})})})})})]})},w.name))})]})})]})]})]})}function mp(t){const s=parseInt(t),a=t.slice(-1)==="h"?36e5:0;return s*a}const Sn=[{path:"/",breadcrumb:"Home",element:e.jsx(dr,{})},{path:"/nodes",breadcrumb:"Nodes",element:e.jsx(dr,{})},{path:"/nodes/:nodeName",breadcrumb:Wi,element:e.jsx(Gu,{})},{path:"/versions",breadcrumb:"Versions",element:e.jsx(_e,{})},{path:"/rings",breadcrumb:"Rings",element:e.jsx(lr,{})},{path:"/rings/:ringName",breadcrumb:Zi,element:e.jsx(lr,{})},{path:"/storage",breadcrumb:"Storage",element:e.jsx(_e,{})},{path:"/storage/object",breadcrumb:"Object Storage",element:e.jsx(_e,{})},{path:"/storage/dataobj",breadcrumb:"Data Objects",element:e.jsx(Oc,{})},{path:"/storage/dataobj/metadata",breadcrumb:"File Metadata",element:e.jsx(Xc,{})},{path:"/tenants",breadcrumb:"Tenants",element:e.jsx(_e,{})},{path:"/tenants/deletes",breadcrumb:"Deletes",element:e.jsx(Qu,{})},{path:"/tenants/deletes/new",element:e.jsx(tp,{}),breadcrumb:"New Delete Request"},{path:"/tenants/analyze-labels",element:e.jsx(pp,{}),breadcrumb:"Analyze Labels"},{path:"/tenants/limits",breadcrumb:"Limits",element:e.jsx(_e,{})},{path:"/tenants/labels",breadcrumb:"Labels",element:e.jsx(_e,{})},{path:"/rules",breadcrumb:"Rules",element:e.jsx(_e,{})},{path:"/404",breadcrumb:"404",element:e.jsx(Yi,{})}];function fp(){const t=Eo(Sn,{disableDefaults:!0});return e.jsx(Ss,{children:e.jsx(Es,{children:t.map(({match:s,breadcrumb:r},a)=>e.jsxs(i.Fragment,{children:[e.jsx(kt,{className:a===0?"hidden md:block":"",children:a===t.length-1?e.jsx(fa,{children:r}):e.jsx(St,{asChild:!0,children:e.jsx(de,{to:s.pathname,children:r})})}),a{let l;return s?a(!0):l=setTimeout(()=>{a(!1)},500),()=>{l&&clearTimeout(l)}},[s]);const n=()=>{if(!(t!=null&&t.members))return"v0.0.0";const l=new Map;Object.values(t.members).forEach(u=>{if(!u.build.version)return;const m=u.build.version;l.set(m,(l.get(m)||0)+1)});let c="v0.0.0",d=0;return l.forEach((u,m)=>{u>d&&(d=u,c=m)}),c},o=()=>{if(!(t!=null&&t.members))return[];const l=new Set,c=new Map;return Object.values(t.members).forEach(d=>{const u=d.build.version;l.add(u),c.set(u,{revision:d.build.revision,branch:d.build.branch,buildUser:d.build.buildUser,buildDate:d.build.buildDate,goVersion:d.build.goVersion})}),Array.from(l).map(d=>({version:d??"v0.0.0",info:c.get(d)??{revision:"v0.0.0",branch:"v0.0.0",buildUser:"v0.0.0",buildDate:"v0.0.0",goVersion:"v0.0.0"}}))};return{mostCommonVersion:n(),versionInfos:o(),isLoading:r}}function hp(){const{mostCommonVersion:t,versionInfos:s,isLoading:r}=gp(),[a,n]=i.useState(!1),o=()=>s.map(({version:l,info:c})=>`Version: ${l} +Revision: ${c.revision} +Branch: ${c.branch} +Build User: ${c.buildUser} +Build Date: ${c.buildDate} +Go Version: ${c.goVersion} +`).join(` +`);return e.jsxs(Ut,{open:a,onOpenChange:n,children:[e.jsx(qt,{asChild:!0,children:e.jsxs("span",{className:"text-sm text-muted-foreground flex items-center gap-1",children:[e.jsx("button",{onClick:()=>n(!a),className:v("transition-opacity duration-200 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 rounded px-1 -mx-1",{"opacity-0":r,"opacity-100":!r}),children:t}),r&&e.jsxs(e.Fragment,{children:[e.jsx(xe,{className:"h-3 w-3 animate-spin"}),"Loading..."]})]})}),e.jsx(ft,{side:"bottom",align:"start",className:"w-[400px]",children:e.jsxs("div",{className:"p-2",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("div",{className:"font-semibold",children:"Build Information"}),!r&&s.length>0&&e.jsx(Bs,{text:o()})]}),e.jsx("div",{className:v("transition-opacity duration-200",{"opacity-0":r,"opacity-100":!r}),children:s.length>0?s.map(({version:l,info:c})=>e.jsxs("div",{className:"mb-2 last:mb-0",children:[e.jsx("div",{className:"font-semibold",children:l}),e.jsxs("div",{className:"text-sm",children:[e.jsxs("div",{children:["Revision: ",c.revision]}),e.jsxs("div",{children:["Branch: ",c.branch]}),e.jsxs("div",{children:["Build User: ",c.buildUser]}),e.jsxs("div",{children:["Build Date: ",c.buildDate]}),e.jsxs("div",{children:["Go Version: ",c.goVersion]})]})]},l)):e.jsx("div",{className:"text-sm text-muted-foreground",children:"No build information available"})}),r&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(xe,{className:"h-4 w-4 animate-spin"}),e.jsx("span",{children:"Loading build information..."})]})]})})]})}const os=768;function xp(){const[t,s]=i.useState(void 0);return i.useEffect(()=>{const r=window.matchMedia(`(max-width: ${os-1}px)`),a=()=>{s(window.innerWidthr.removeEventListener("change",a)},[]),!!t}const qs=i.forwardRef(({className:t,orientation:s="horizontal",decorative:r=!0,...a},n)=>e.jsx(la,{ref:n,decorative:r,orientation:s,className:v("shrink-0 bg-border",s==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",t),...a}));qs.displayName=la.displayName;const bp=Ns,yp=ks,En=i.forwardRef(({className:t,...s},r)=>e.jsx(lt,{className:v("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...s,ref:r}));En.displayName=lt.displayName;const vp=Ce("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),Cn=i.forwardRef(({side:t="right",className:s,children:r,...a},n)=>e.jsxs(yp,{children:[e.jsx(En,{}),e.jsxs(ct,{ref:n,className:v(vp({side:t}),s),...a,children:[e.jsxs(oa,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[e.jsx(js,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]}),r]})]}));Cn.displayName=ct.displayName;const jp=i.forwardRef(({className:t,...s},r)=>e.jsx(Pt,{ref:r,className:v("text-lg font-semibold text-foreground",t),...s}));jp.displayName=Pt.displayName;const wp=i.forwardRef(({className:t,...s},r)=>e.jsx(Dt,{ref:r,className:v("text-sm text-muted-foreground",t),...s}));wp.displayName=Dt.displayName;function gr({className:t,...s}){return e.jsx("div",{className:v("animate-pulse rounded-md bg-primary/10",t),...s})}const Np="sidebar:state",kp=60*60*24*7,Sp="16rem",Ep="18rem",Cp="3rem",Tp="b",Tn=i.createContext(null);function Yt(){const t=i.useContext(Tn);if(!t)throw new Error("useSidebar must be used within a SidebarProvider.");return t}const Rn=i.forwardRef(({defaultOpen:t=!0,open:s,onOpenChange:r,className:a,style:n,children:o,...l},c)=>{const d=xp(),[u,m]=i.useState(!1),[g,y]=i.useState(t),N=s??g,h=i.useCallback(b=>{const j=typeof b=="function"?b(N):b;r?r(j):y(j),document.cookie=`${Np}=${j}; path=/; max-age=${kp}`},[r,N]),p=i.useCallback(()=>d?m(b=>!b):h(b=>!b),[d,h,m]);i.useEffect(()=>{const b=j=>{j.key===Tp&&(j.metaKey||j.ctrlKey)&&(j.preventDefault(),p())};return window.addEventListener("keydown",b),()=>window.removeEventListener("keydown",b)},[p]);const f=N?"expanded":"collapsed",x=i.useMemo(()=>({state:f,open:N,setOpen:h,isMobile:d,openMobile:u,setOpenMobile:m,toggleSidebar:p}),[f,N,h,d,u,m,p]);return e.jsx(Tn.Provider,{value:x,children:e.jsx(zs,{delayDuration:0,children:e.jsx("div",{style:{"--sidebar-width":Sp,"--sidebar-width-icon":Cp,...n},className:v("group/sidebar-wrapper flex min-h-svh w-full has-[[data-variant=inset]]:bg-sidebar",a),ref:c,...l,children:o})})})});Rn.displayName="SidebarProvider";const An=i.forwardRef(({side:t="left",variant:s="sidebar",collapsible:r="offcanvas",className:a,children:n,...o},l)=>{const{isMobile:c,state:d,openMobile:u,setOpenMobile:m}=Yt();return r==="none"?e.jsx("div",{className:v("flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground",a),ref:l,...o,children:n}):c?e.jsx(bp,{open:u,onOpenChange:m,...o,children:e.jsx(Cn,{"data-sidebar":"sidebar","data-mobile":"true",className:"w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":Ep},side:t,children:e.jsx("div",{className:"flex h-full w-full flex-col",children:n})})}):e.jsxs("div",{ref:l,className:"group peer hidden text-sidebar-foreground md:block","data-state":d,"data-collapsible":d==="collapsed"?r:"","data-variant":s,"data-side":t,children:[e.jsx("div",{className:v("relative h-svh w-[--sidebar-width] bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",s==="floating"||s==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon]")}),e.jsx("div",{className:v("fixed inset-y-0 z-10 hidden h-svh w-[--sidebar-width] transition-[left,right,width] duration-200 ease-linear md:flex",t==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",s==="floating"||s==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon] group-data-[side=left]:border-r group-data-[side=right]:border-l",a),...o,children:e.jsx("div",{"data-sidebar":"sidebar",className:"flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow",children:n})})]})});An.displayName="Sidebar";const _n=i.forwardRef(({className:t,onClick:s,...r},a)=>{const{toggleSidebar:n}=Yt();return e.jsxs(q,{ref:a,"data-sidebar":"trigger",variant:"ghost",size:"icon",className:v("h-7 w-7",t),onClick:o=>{s==null||s(o),n()},...r,children:[e.jsx(Ho,{}),e.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})});_n.displayName="SidebarTrigger";const In=i.forwardRef(({className:t,...s},r)=>{const{toggleSidebar:a}=Yt();return e.jsx("button",{ref:r,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:a,title:"Toggle Sidebar",className:v("absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex","[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:hover:bg-sidebar","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",t),...s})});In.displayName="SidebarRail";const Fn=i.forwardRef(({className:t,...s},r)=>e.jsx("main",{ref:r,className:v("relative flex min-h-svh flex-1 flex-col bg-background","peer-data-[variant=inset]:min-h-[calc(100svh-theme(spacing.4))] md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow",t),...s}));Fn.displayName="SidebarInset";const Rp=i.forwardRef(({className:t,...s},r)=>e.jsx(be,{ref:r,"data-sidebar":"input",className:v("h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",t),...s}));Rp.displayName="SidebarInput";const Ln=i.forwardRef(({className:t,...s},r)=>e.jsx("div",{ref:r,"data-sidebar":"header",className:v("flex flex-col gap-2 p-2",t),...s}));Ln.displayName="SidebarHeader";const Ap=i.forwardRef(({className:t,...s},r)=>e.jsx("div",{ref:r,"data-sidebar":"footer",className:v("flex flex-col gap-2 p-2",t),...s}));Ap.displayName="SidebarFooter";const _p=i.forwardRef(({className:t,...s},r)=>e.jsx(qs,{ref:r,"data-sidebar":"separator",className:v("mx-2 w-auto bg-sidebar-border",t),...s}));_p.displayName="SidebarSeparator";const Pn=i.forwardRef(({className:t,...s},r)=>e.jsx("div",{ref:r,"data-sidebar":"content",className:v("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",t),...s}));Pn.displayName="SidebarContent";const Dn=i.forwardRef(({className:t,...s},r)=>e.jsx("div",{ref:r,"data-sidebar":"group",className:v("relative flex w-full min-w-0 flex-col p-2",t),...s}));Dn.displayName="SidebarGroup";const Ip=i.forwardRef(({className:t,asChild:s=!1,...r},a)=>{const n=s?Ee:"div";return e.jsx(n,{ref:a,"data-sidebar":"group-label",className:v("flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 outline-none ring-sidebar-ring transition-[margin,opa] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",t),...r})});Ip.displayName="SidebarGroupLabel";const Fp=i.forwardRef(({className:t,asChild:s=!1,...r},a)=>{const n=s?Ee:"button";return e.jsx(n,{ref:a,"data-sidebar":"group-action",className:v("absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","group-data-[collapsible=icon]:hidden",t),...r})});Fp.displayName="SidebarGroupAction";const Lp=i.forwardRef(({className:t,...s},r)=>e.jsx("div",{ref:r,"data-sidebar":"group-content",className:v("w-full text-sm",t),...s}));Lp.displayName="SidebarGroupContent";const hs=i.forwardRef(({className:t,...s},r)=>e.jsx("ul",{ref:r,"data-sidebar":"menu",className:v("flex w-full min-w-0 flex-col gap-1",t),...s}));hs.displayName="SidebarMenu";const Gs=i.forwardRef(({className:t,...s},r)=>e.jsx("li",{ref:r,"data-sidebar":"menu-item",className:v("group/menu-item relative",t),...s}));Gs.displayName="SidebarMenuItem";const Pp=Ce("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:!p-0"}},defaultVariants:{variant:"default",size:"default"}}),Hs=i.forwardRef(({asChild:t=!1,isActive:s=!1,variant:r="default",size:a="default",tooltip:n,className:o,...l},c)=>{const d=t?Ee:"button",{isMobile:u,state:m}=Yt(),g=e.jsx(d,{ref:c,"data-sidebar":"menu-button","data-size":a,"data-active":s,className:v(Pp({variant:r,size:a}),o),...l});return n?(typeof n=="string"&&(n={children:n}),e.jsxs(rt,{children:[e.jsx(at,{asChild:!0,children:g}),e.jsx(qe,{side:"right",align:"center",hidden:m!=="collapsed"||u,...n})]})):g});Hs.displayName="SidebarMenuButton";const Dp=i.forwardRef(({className:t,asChild:s=!1,showOnHover:r=!1,...a},n)=>{const o=s?Ee:"button";return e.jsx(o,{ref:n,"data-sidebar":"menu-action",className:v("absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 peer-hover/menu-button:text-sidebar-accent-foreground [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",r&&"group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground md:opacity-0",t),...a})});Dp.displayName="SidebarMenuAction";const Op=i.forwardRef(({className:t,...s},r)=>e.jsx("div",{ref:r,"data-sidebar":"menu-badge",className:v("pointer-events-none absolute right-1 flex h-5 min-w-5 select-none items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums text-sidebar-foreground","peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",t),...s}));Op.displayName="SidebarMenuBadge";const $p=i.forwardRef(({className:t,showIcon:s=!1,...r},a)=>{const n=i.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return e.jsxs("div",{ref:a,"data-sidebar":"menu-skeleton",className:v("flex h-8 items-center gap-2 rounded-md px-2",t),...r,children:[s&&e.jsx(gr,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),e.jsx(gr,{className:"h-4 max-w-[--skeleton-width] flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":n}})]})});$p.displayName="SidebarMenuSkeleton";const On=i.forwardRef(({className:t,...s},r)=>e.jsx("ul",{ref:r,"data-sidebar":"menu-sub",className:v("mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",t),...s}));On.displayName="SidebarMenuSub";const $n=i.forwardRef(({...t},s)=>e.jsx("li",{ref:s,...t}));$n.displayName="SidebarMenuSubItem";const Mn=i.forwardRef(({asChild:t=!1,size:s="md",isActive:r,className:a,...n},o)=>{const l=t?Ee:"a";return e.jsx(l,{ref:o,"data-sidebar":"menu-sub-button","data-size":s,"data-active":r,className:v("flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-none ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",s==="sm"&&"text-xs",s==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",a),...n})});Mn.displayName="SidebarMenuSubButton";function Mp(t,s){const[r,a]=i.useState(s);return i.useEffect(()=>{if(!(t!=null&&t.members))return;const n=s.map(o=>o.title==="Rings"&&t.members?{...o,items:tl(t.members)}:o);a(n)},[t==null?void 0:t.members,s]),r}const is=[{title:"Cluster",url:"/nodes",icon:e.jsx(Ko,{className:"h-4 w-4"}),items:[{title:"Nodes",url:"/nodes"},{title:"Rollouts & Versions",url:"/versions"}]},{title:"Rings",url:"/rings",icon:e.jsx(Rr,{className:"h-4 w-4"}),items:[]},{title:"Storage",url:"/storage",icon:e.jsx(Wo,{className:"h-4 w-4"}),items:[{title:"Object Storage",url:"/storage/object"},{title:"Data Objects",url:"/storage/dataobj"}]},{title:"Tenants",url:"/tenants",icon:e.jsx(Zo,{className:"h-4 w-4"}),items:[{title:"Analyze Labels",url:"/tenants/analyze-labels"},{title:"Deletes",url:"/tenants/deletes"},{title:"Limits",url:"/tenants/limits"},{title:"Labels",url:"/tenants/labels"}]},{title:"Rules",url:"/rules",icon:e.jsx(Yo,{className:"h-4 w-4"}),items:[]},{title:"Documentation",url:"https://grafana.com/docs/loki/latest/",icon:e.jsx(Xo,{className:"h-4 w-4"}),items:[]}];function Bp(t){return e.jsx(In,{...t,className:v("after:bg-border/40 hover:after:bg-border","hover:bg-muted/50",t.className)})}const hr="loki-sidebar-open-sections",zp=i.memo(function({item:s,isOpen:r,isActive:a,onToggle:n}){return e.jsxs(Gs,{children:[e.jsx(Hs,{asChild:!0,isActive:a(s.url),onClick:()=>n(s.title),children:e.jsxs("div",{className:"flex items-center justify-between font-medium",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[s.icon,e.jsx(de,{to:`${s.url}`,target:s.url.includes("http")?"_blank":"_self",children:s.title})]}),s.items&&s.items.length>0&&e.jsx(it,{className:v("h-4 w-4 transition-transform duration-200",r?"rotate-0":"-rotate-90")})]})}),s.items&&s.items.length>0&&r&&e.jsx(On,{children:s.items.map(o=>e.jsx($n,{children:e.jsx(Mn,{asChild:!0,isActive:a(o.url),children:e.jsx(de,{to:`${o.url}`,children:o.title})})},o.title))})]})});function Vp({...t}){const s=Cs(),r=Co(),{cluster:a}=pe(),n=r.pathname.replace(s,"/"),[o,l]=i.useState(()=>{const m=localStorage.getItem(hr);if(m)try{return JSON.parse(m)}catch{return is.reduce((g,y)=>({...g,[y.title]:!0}),{})}return is.reduce((g,y)=>({...g,[y.title]:!0}),{})}),c=Mp(a,is),d=i.useCallback(m=>m==="/"?n==="/":n.startsWith(m),[n]),u=i.useCallback(m=>{l(g=>{const y={...g,[m]:!g[m]};return localStorage.setItem(hr,JSON.stringify(y)),y})},[]);return e.jsxs(An,{...t,children:[e.jsx(Ln,{className:"py-4",children:e.jsx(hs,{children:e.jsx(Gs,{children:e.jsx(Hs,{size:"lg",asChild:!0,children:e.jsxs("div",{className:"flex items-center gap-3 px-6 py-4",children:[e.jsx("img",{src:"https://grafana.com/media/docs/loki/logo-grafana-loki.png",alt:"Loki Logo",className:"h-7 w-7"}),e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{className:"text-sm font-semibold leading-none",children:"Grafana Loki"}),e.jsx(hp,{})]})]})})})})}),e.jsx(mt,{className:"flex-1",children:e.jsx(Pn,{children:e.jsx(Dn,{children:e.jsx(hs,{children:c.map(m=>e.jsx(i.Fragment,{children:e.jsx(zp,{item:m,isOpen:o[m.title],isActive:d,onToggle:u})},m.title))})})})}),e.jsx(Bp,{})]})}function Up(){const[t,s]=i.useState(!1);i.useEffect(()=>{const a=()=>{s(window.scrollY>300)};return window.addEventListener("scroll",a),()=>window.removeEventListener("scroll",a)},[]);const r=()=>{window.scrollTo({top:0,behavior:"smooth"})};return t?e.jsx(q,{onClick:r,size:"icon",className:"fixed bottom-8 right-8 rounded-full shadow-lg transition-all duration-300","aria-label":"Back to top",children:e.jsx(cs,{className:"h-4 w-4"})}):null}var Ks="ToastProvider",[Ws,qp,Gp]=yi("Toast"),[Bn,Lm]=br("Toast",[Gp]),[Hp,Xt]=Bn(Ks),zn=t=>{const{__scopeToast:s,label:r="Notification",duration:a=5e3,swipeDirection:n="right",swipeThreshold:o=50,children:l}=t,[c,d]=i.useState(null),[u,m]=i.useState(0),g=i.useRef(!1),y=i.useRef(!1);return r.trim()||console.error(`Invalid prop \`label\` supplied to \`${Ks}\`. Expected non-empty \`string\`.`),e.jsx(Ws.Provider,{scope:s,children:e.jsx(Hp,{scope:s,label:r,duration:a,swipeDirection:n,swipeThreshold:o,toastCount:u,viewport:c,onViewportChange:d,onToastAdd:i.useCallback(()=>m(N=>N+1),[]),onToastRemove:i.useCallback(()=>m(N=>N-1),[]),isFocusedToastEscapeKeyDownRef:g,isClosePausedRef:y,children:l})})};zn.displayName=Ks;var Vn="ToastViewport",Kp=["F8"],xs="toast.viewportPause",bs="toast.viewportResume",Un=i.forwardRef((t,s)=>{const{__scopeToast:r,hotkey:a=Kp,label:n="Notifications ({hotkey})",...o}=t,l=Xt(Vn,r),c=qp(r),d=i.useRef(null),u=i.useRef(null),m=i.useRef(null),g=i.useRef(null),y=wr(s,g,l.onViewportChange),N=a.join("+").replace(/Key/g,"").replace(/Digit/g,""),h=l.toastCount>0;i.useEffect(()=>{const f=x=>{var j;a.length!==0&&a.every(w=>x[w]||x.code===w)&&((j=g.current)==null||j.focus())};return document.addEventListener("keydown",f),()=>document.removeEventListener("keydown",f)},[a]),i.useEffect(()=>{const f=d.current,x=g.current;if(h&&f&&x){const b=()=>{if(!l.isClosePausedRef.current){const C=new CustomEvent(xs);x.dispatchEvent(C),l.isClosePausedRef.current=!0}},j=()=>{if(l.isClosePausedRef.current){const C=new CustomEvent(bs);x.dispatchEvent(C),l.isClosePausedRef.current=!1}},w=C=>{!f.contains(C.relatedTarget)&&j()},E=()=>{f.contains(document.activeElement)||j()};return f.addEventListener("focusin",b),f.addEventListener("focusout",w),f.addEventListener("pointermove",b),f.addEventListener("pointerleave",E),window.addEventListener("blur",b),window.addEventListener("focus",j),()=>{f.removeEventListener("focusin",b),f.removeEventListener("focusout",w),f.removeEventListener("pointermove",b),f.removeEventListener("pointerleave",E),window.removeEventListener("blur",b),window.removeEventListener("focus",j)}}},[h,l.isClosePausedRef]);const p=i.useCallback(({tabbingDirection:f})=>{const b=c().map(j=>{const w=j.ref.current,E=[w,...om(w)];return f==="forwards"?E:E.reverse()});return(f==="forwards"?b.reverse():b).flat()},[c]);return i.useEffect(()=>{const f=g.current;if(f){const x=b=>{var E,C,A;const j=b.altKey||b.ctrlKey||b.metaKey;if(b.key==="Tab"&&!j){const B=document.activeElement,z=b.shiftKey;if(b.target===f&&z){(E=u.current)==null||E.focus();return}const M=p({tabbingDirection:z?"backwards":"forwards"}),W=M.findIndex(T=>T===B);ls(M.slice(W+1))?b.preventDefault():z?(C=u.current)==null||C.focus():(A=m.current)==null||A.focus()}};return f.addEventListener("keydown",x),()=>f.removeEventListener("keydown",x)}},[c,p]),e.jsxs(yo,{ref:d,role:"region","aria-label":n.replace("{hotkey}",N),tabIndex:-1,style:{pointerEvents:h?void 0:"none"},children:[h&&e.jsx(ys,{ref:u,onFocusFromOutsideViewport:()=>{const f=p({tabbingDirection:"forwards"});ls(f)}}),e.jsx(Ws.Slot,{scope:r,children:e.jsx(ae.ol,{tabIndex:-1,...o,ref:y})}),h&&e.jsx(ys,{ref:m,onFocusFromOutsideViewport:()=>{const f=p({tabbingDirection:"backwards"});ls(f)}})]})});Un.displayName=Vn;var qn="ToastFocusProxy",ys=i.forwardRef((t,s)=>{const{__scopeToast:r,onFocusFromOutsideViewport:a,...n}=t,o=Xt(qn,r);return e.jsx(Nr,{"aria-hidden":!0,tabIndex:0,...n,ref:s,style:{position:"fixed"},onFocus:l=>{var u;const c=l.relatedTarget;!((u=o.viewport)!=null&&u.contains(c))&&a()}})});ys.displayName=qn;var Qt="Toast",Wp="toast.swipeStart",Zp="toast.swipeMove",Yp="toast.swipeCancel",Xp="toast.swipeEnd",Gn=i.forwardRef((t,s)=>{const{forceMount:r,open:a,defaultOpen:n,onOpenChange:o,...l}=t,[c=!0,d]=vo({prop:a,defaultProp:n,onChange:o});return e.jsx(jo,{present:r||c,children:e.jsx(em,{open:c,...l,ref:s,onClose:()=>d(!1),onPause:wt(t.onPause),onResume:wt(t.onResume),onSwipeStart:me(t.onSwipeStart,u=>{u.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:me(t.onSwipeMove,u=>{const{x:m,y:g}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","move"),u.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${m}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${g}px`)}),onSwipeCancel:me(t.onSwipeCancel,u=>{u.currentTarget.setAttribute("data-swipe","cancel"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:me(t.onSwipeEnd,u=>{const{x:m,y:g}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","end"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${m}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${g}px`),d(!1)})})})});Gn.displayName=Qt;var[Qp,Jp]=Bn(Qt,{onClose(){}}),em=i.forwardRef((t,s)=>{const{__scopeToast:r,type:a="foreground",duration:n,open:o,onClose:l,onEscapeKeyDown:c,onPause:d,onResume:u,onSwipeStart:m,onSwipeMove:g,onSwipeCancel:y,onSwipeEnd:N,...h}=t,p=Xt(Qt,r),[f,x]=i.useState(null),b=wr(s,T=>x(T)),j=i.useRef(null),w=i.useRef(null),E=n||p.duration,C=i.useRef(0),A=i.useRef(E),B=i.useRef(0),{onToastAdd:z,onToastRemove:Y}=p,K=wt(()=>{var O;(f==null?void 0:f.contains(document.activeElement))&&((O=p.viewport)==null||O.focus()),l()}),M=i.useCallback(T=>{!T||T===1/0||(window.clearTimeout(B.current),C.current=new Date().getTime(),B.current=window.setTimeout(K,T))},[K]);i.useEffect(()=>{const T=p.viewport;if(T){const O=()=>{M(A.current),u==null||u()},V=()=>{const Q=new Date().getTime()-C.current;A.current=A.current-Q,window.clearTimeout(B.current),d==null||d()};return T.addEventListener(xs,V),T.addEventListener(bs,O),()=>{T.removeEventListener(xs,V),T.removeEventListener(bs,O)}}},[p.viewport,E,d,u,M]),i.useEffect(()=>{o&&!p.isClosePausedRef.current&&M(E)},[o,E,p.isClosePausedRef,M]),i.useEffect(()=>(z(),()=>Y()),[z,Y]);const W=i.useMemo(()=>f?Qn(f):null,[f]);return p.viewport?e.jsxs(e.Fragment,{children:[W&&e.jsx(tm,{__scopeToast:r,role:"status","aria-live":a==="foreground"?"assertive":"polite","aria-atomic":!0,children:W}),e.jsx(Qp,{scope:r,onClose:K,children:kr.createPortal(e.jsx(Ws.ItemSlot,{scope:r,children:e.jsx(wo,{asChild:!0,onEscapeKeyDown:me(c,()=>{p.isFocusedToastEscapeKeyDownRef.current||K(),p.isFocusedToastEscapeKeyDownRef.current=!1}),children:e.jsx(ae.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":o?"open":"closed","data-swipe-direction":p.swipeDirection,...h,ref:b,style:{userSelect:"none",touchAction:"none",...t.style},onKeyDown:me(t.onKeyDown,T=>{T.key==="Escape"&&(c==null||c(T.nativeEvent),T.nativeEvent.defaultPrevented||(p.isFocusedToastEscapeKeyDownRef.current=!0,K()))}),onPointerDown:me(t.onPointerDown,T=>{T.button===0&&(j.current={x:T.clientX,y:T.clientY})}),onPointerMove:me(t.onPointerMove,T=>{if(!j.current)return;const O=T.clientX-j.current.x,V=T.clientY-j.current.y,Q=!!w.current,_=["left","right"].includes(p.swipeDirection),I=["left","up"].includes(p.swipeDirection)?Math.min:Math.max,P=_?I(0,O):0,U=_?0:I(0,V),S=T.pointerType==="touch"?10:2,R={x:P,y:U},$={originalEvent:T,delta:R};Q?(w.current=R,xt(Zp,g,$,{discrete:!1})):xr(R,p.swipeDirection,S)?(w.current=R,xt(Wp,m,$,{discrete:!1}),T.target.setPointerCapture(T.pointerId)):(Math.abs(O)>S||Math.abs(V)>S)&&(j.current=null)}),onPointerUp:me(t.onPointerUp,T=>{const O=w.current,V=T.target;if(V.hasPointerCapture(T.pointerId)&&V.releasePointerCapture(T.pointerId),w.current=null,j.current=null,O){const Q=T.currentTarget,_={originalEvent:T,delta:O};xr(O,p.swipeDirection,p.swipeThreshold)?xt(Xp,N,_,{discrete:!0}):xt(Yp,y,_,{discrete:!0}),Q.addEventListener("click",I=>I.preventDefault(),{once:!0})}})})})}),p.viewport)})]}):null}),tm=t=>{const{__scopeToast:s,children:r,...a}=t,n=Xt(Qt,s),[o,l]=i.useState(!1),[c,d]=i.useState(!1);return am(()=>l(!0)),i.useEffect(()=>{const u=window.setTimeout(()=>d(!0),1e3);return()=>window.clearTimeout(u)},[]),c?null:e.jsx(No,{asChild:!0,children:e.jsx(Nr,{...a,children:o&&e.jsxs(e.Fragment,{children:[n.label," ",r]})})})},sm="ToastTitle",Hn=i.forwardRef((t,s)=>{const{__scopeToast:r,...a}=t;return e.jsx(ae.div,{...a,ref:s})});Hn.displayName=sm;var rm="ToastDescription",Kn=i.forwardRef((t,s)=>{const{__scopeToast:r,...a}=t;return e.jsx(ae.div,{...a,ref:s})});Kn.displayName=rm;var Wn="ToastAction",Zn=i.forwardRef((t,s)=>{const{altText:r,...a}=t;return r.trim()?e.jsx(Xn,{altText:r,asChild:!0,children:e.jsx(Zs,{...a,ref:s})}):(console.error(`Invalid prop \`altText\` supplied to \`${Wn}\`. Expected non-empty \`string\`.`),null)});Zn.displayName=Wn;var Yn="ToastClose",Zs=i.forwardRef((t,s)=>{const{__scopeToast:r,...a}=t,n=Jp(Yn,r);return e.jsx(Xn,{asChild:!0,children:e.jsx(ae.button,{type:"button",...a,ref:s,onClick:me(t.onClick,n.onClose)})})});Zs.displayName=Yn;var Xn=i.forwardRef((t,s)=>{const{__scopeToast:r,altText:a,...n}=t;return e.jsx(ae.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":a||void 0,...n,ref:s})});function Qn(t){const s=[];return Array.from(t.childNodes).forEach(a=>{if(a.nodeType===a.TEXT_NODE&&a.textContent&&s.push(a.textContent),nm(a)){const n=a.ariaHidden||a.hidden||a.style.display==="none",o=a.dataset.radixToastAnnounceExclude==="";if(!n)if(o){const l=a.dataset.radixToastAnnounceAlt;l&&s.push(l)}else s.push(...Qn(a))}}),s}function xt(t,s,r,{discrete:a}){const n=r.originalEvent.currentTarget,o=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:r});s&&n.addEventListener(t,s,{once:!0}),a?So(n,o):n.dispatchEvent(o)}var xr=(t,s,r=0)=>{const a=Math.abs(t.x),n=Math.abs(t.y),o=a>n;return s==="left"||s==="right"?o&&a>r:!o&&n>r};function am(t=()=>{}){const s=wt(t);ko(()=>{let r=0,a=0;return r=window.requestAnimationFrame(()=>a=window.requestAnimationFrame(s)),()=>{window.cancelAnimationFrame(r),window.cancelAnimationFrame(a)}},[s])}function nm(t){return t.nodeType===t.ELEMENT_NODE}function om(t){const s=[],r=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:a=>{const n=a.tagName==="INPUT"&&a.type==="hidden";return a.disabled||a.hidden||n?NodeFilter.FILTER_SKIP:a.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)s.push(r.currentNode);return s}function ls(t){const s=document.activeElement;return t.some(r=>r===s?!0:(r.focus(),document.activeElement!==s))}var im=zn,Jn=Un,eo=Gn,to=Hn,so=Kn,ro=Zn,ao=Zs;const lm=im,no=i.forwardRef(({className:t,...s},r)=>e.jsx(Jn,{ref:r,className:v("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",t),...s}));no.displayName=Jn.displayName;const cm=Ce("group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md border p-4 pr-6 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),oo=i.forwardRef(({className:t,variant:s,...r},a)=>e.jsx(eo,{ref:a,className:v(cm({variant:s}),t),...r}));oo.displayName=eo.displayName;const dm=i.forwardRef(({className:t,...s},r)=>e.jsx(ro,{ref:r,className:v("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors hover:bg-secondary focus:outline-none focus:ring-1 focus:ring-ring disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",t),...s}));dm.displayName=ro.displayName;const io=i.forwardRef(({className:t,...s},r)=>e.jsx(ao,{ref:r,className:v("absolute right-1 top-1 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",t),"toast-close":"",...s,children:e.jsx(js,{className:"h-4 w-4"})}));io.displayName=ao.displayName;const lo=i.forwardRef(({className:t,...s},r)=>e.jsx(to,{ref:r,className:v("text-sm font-semibold [&+div]:text-xs",t),...s}));lo.displayName=to.displayName;const co=i.forwardRef(({className:t,...s},r)=>e.jsx(so,{ref:r,className:v("text-sm opacity-90",t),...s}));co.displayName=so.displayName;function um(){const{toasts:t}=Vt();return e.jsxs(lm,{children:[t.map(function({id:s,title:r,description:a,action:n,...o}){return e.jsxs(oo,{...o,children:[e.jsxs("div",{className:"grid gap-1",children:[r&&e.jsx(lo,{children:r}),a&&e.jsx(co,{children:a})]}),n,e.jsx(io,{})]},s)}),e.jsx(no,{})]})}function pm({children:t}){return e.jsx("div",{className:"flex min-h-screen",children:e.jsxs(Rn,{children:[e.jsx(Vp,{}),e.jsxs(Fn,{children:[e.jsxs("header",{className:"flex h-16 shrink-0 items-center gap-2 border-b px-4",children:[e.jsx(_n,{}),e.jsx(qs,{orientation:"vertical",className:"mr-2 h-4"}),e.jsx(fp,{}),e.jsx("div",{className:"ml-auto px-4",children:e.jsx(Ki,{})})]}),e.jsx("main",{className:"flex flex-1 flex-col",children:t}),e.jsx(um,{}),e.jsx(Up,{})]})]})})}var mm=function(){return null};const fm=new Ii({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:!1,staleTime:5*60*1e3}}});function gm({children:t}){return e.jsxs(Fi,{client:fm,children:[t,e.jsx(mm,{initialIsOpen:!1})]})}function hm({children:t}){const[s,r]=i.useState(null),[a,n]=i.useState(null),[o,l]=i.useState(!0),c=i.useRef(!1),d=i.useCallback(async()=>{if(!c.current){c.current=!0,l(!0);try{const m=await fetch(re("/api/v1/cluster/nodes"));if(!m.ok)throw new Error(`Failed to fetch cluster data: ${m.statusText}`);const g=await m.json();r(g),n(null)}catch(m){n(m instanceof Error?m.message:"An unknown error occurred")}finally{l(!1),c.current=!1}}},[]),u=i.useCallback(async()=>{await d()},[d]);return i.useEffect(()=>{d()},[d]),e.jsx(xa.Provider,{value:{cluster:s,error:a,isLoading:o,refresh:u},children:t})}function xm(){return e.jsx(gm,{children:e.jsx(Gi,{defaultTheme:"dark",storageKey:"loki-ui-theme",children:e.jsx(hm,{children:e.jsx(pm,{children:e.jsx(To,{children:Sn.map(t=>e.jsx(Ro,{path:t.path,element:t.element},t.path))})})})})})}const bm=Cs(),ym=Ao([{path:"*",element:e.jsx(xm,{})}],{basename:bm,future:{v7_relativeSplatPath:!0}}),uo=document.getElementById("root");if(!uo)throw new Error("Root element not found");ua(uo).render(e.jsx(i.StrictMode,{children:e.jsx(_o,{router:ym,future:{v7_startTransition:!0}})})); diff --git a/pkg/ui/frontend/dist/assets/index-DqJzRHuy.js b/pkg/ui/frontend/dist/assets/index-DqJzRHuy.js deleted file mode 100644 index 0d9ab4e529c17..0000000000000 --- a/pkg/ui/frontend/dist/assets/index-DqJzRHuy.js +++ /dev/null @@ -1,63 +0,0 @@ -import{j as e,S as Se,c as hr,P as re,e as Me,B as uo,E as xr,G as po,T as mo,H as go,I as br,J as fo,K as ho,L as xo,M as yr,u as vr,N as bo,V as jr,a as yo,g as vo,b as jt,d as pe,O as jo,n as wo,p as No,m as ko}from"./radix-core-ByqQ8fsu.js";import{c as wr,r as i,b as Be}from"./react-core-D_V7s-9r.js";import{u as It,a as at,L as ce,b as Nr,c as So,d as Eo,R as Co,e as To,f as Ro,g as Ao}from"./react-router-Bj-soKrx.js";import{t as _o,c as ys,a as Ee}from"./ui-utils-BNSC_Jv-.js";import{S as Io,M as Fo,C as kr,R as Lo,H as Po,a as qe,b as Do,A as Ws,c as ls,d as Sr,e as Ft,X as vs,f as Er,P as Oo,L as he,g as nt,h as Cr,i as $o,j as Mo,k as ot,l as Tr,F as Bo,m as zo,D as Rr,n as Ar,o as Vo,G as js,p as Uo,q as qo,r as Go,s as Ho,t as Ko,U as Wo,u as Zo,B as Yo}from"./ui-icons-CFVjIJRk.js";import{f as Xo,a as Qo,b as _r,c as wt,p as cs,i as Ze,d as Jo,e as Zs,g as ei,h as ti,D as Ys}from"./date-utils-B6syNIuD.js";import{R as Ir,I as si,T as Fr,a as ri,S as Lr,b as Pr,P as ai,C as Dr,V as ni,L as Or,c as $r,d as oi,e as ii,f as Mr,g as li,h as ci,i as Br,j as di,k as zr,l as Vr,m as Ur}from"./radix-inputs-D4_OLmm6.js";import{S as qr,d as Gr,P as ui,C as Hr,e as Kr,f as Wr,g as Zr,h as Yr,L as Xr,i as Qr,j as pi,T as mi,k as Jr,V as gi,l as fi,m as ea,n as hi,o as ta,p as sa,q as ra,r as xi,c as bi}from"./radix-navigation-DYoR-lWZ.js";import{R as ws,P as Ns,O as it,C as lt,a as aa,T as Lt,D as Pt,b as na,c as yi,d as vi,e as ji,f as wi,g as Ni,h as oa}from"./radix-layout-BqTpm3s4.js";import{R as ct,P as Dt,a as Ot,C as $t,T as dt,d as ki,B as Si,b as Ei,Y as Ci,X as Ti,c as Ri}from"./data-viz-BuFFX-vG.js";import{u as Mt,a as Ai,Q as _i,b as Ii}from"./query-management-DbWM5GrR.js";import{z as Fi}from"./theme-utils-CNom64Sw.js";import{u as Li,F as Pi,C as Di,o as Oi,r as $i,a as Mi,b as ia,s as Ye,d as Xs,c as la}from"./form-libs-B6JBoFJD.js";(function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))a(n);new MutationObserver(n=>{for(const o of n)if(o.type==="childList")for(const l of o.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&a(l)}).observe(document,{childList:!0,subtree:!0});function r(n){const o={};return n.integrity&&(o.integrity=n.integrity),n.referrerPolicy&&(o.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?o.credentials="include":n.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function a(n){if(n.ep)return;n.ep=!0;const o=r(n);fetch(n.href,o)}})();var ca,Qs=wr;ca=Qs.createRoot,Qs.hydrateRoot;function v(...t){return _o(ys(t))}function me(t){if(t===0)return"0 B";const s=1024,r=["B","KB","MB","GB","TB","PB"],a=Math.floor(Math.log(t)/Math.log(s));return`${parseFloat((t/Math.pow(s,a)).toFixed(2))} ${r[a]}`}function Oe(t,s){return t?Object.keys(t).find(r=>da(t[r],s)):null}function da(t,s){var r;return((r=t.services)==null?void 0:r.some(a=>a.service===s))??!1}const Bi=Ee("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),q=i.forwardRef(({className:t,variant:s,size:r,asChild:a=!1,...n},o)=>{const l=a?Se:"button";return e.jsx(l,{className:v(Bi({variant:s,size:r,className:t})),ref:o,...n})});q.displayName="Button";function zi(){return e.jsx(q,{variant:"ghost",size:"icon",className:"bg-muted hover:bg-muted-hover rounded-lg",asChild:!0,children:e.jsxs("a",{href:"https://github.com/grafana/loki",target:"_blank",rel:"noopener noreferrer",children:[e.jsx("svg",{viewBox:"0 0 438.549 438.549",className:"h-[1.2rem] w-[1.2rem]",children:e.jsx("path",{fill:"currentColor",d:"M409.132 114.573c-19.608-33.596-46.205-60.194-79.798-79.8-33.598-19.607-70.277-29.408-110.063-29.408-39.781 0-76.472 9.804-110.063 29.408-33.596 19.605-60.192 46.204-79.8 79.8C9.803 148.168 0 184.854 0 224.63c0 47.78 13.94 90.745 41.827 128.906 27.884 38.164 63.906 64.572 108.063 79.227 5.14.954 8.945.283 11.419-1.996 2.475-2.282 3.711-5.14 3.711-8.562 0-.571-.049-5.708-.144-15.417a2549.81 2549.81 0 01-.144-25.406l-6.567 1.136c-4.187.767-9.469 1.092-15.846 1-6.374-.089-12.991-.757-19.842-1.999-6.854-1.231-13.229-4.086-19.13-8.559-5.898-4.473-10.085-10.328-12.56-17.556l-2.855-6.57c-1.903-4.374-4.899-9.233-8.992-14.559-4.093-5.331-8.232-8.945-12.419-10.848l-1.999-1.431c-1.332-.951-2.568-2.098-3.711-3.429-1.142-1.331-1.997-2.663-2.568-3.997-.572-1.335-.098-2.43 1.427-3.289 1.525-.859 4.281-1.276 8.28-1.276l5.708.853c3.807.763 8.516 3.042 14.133 6.851 5.614 3.806 10.229 8.754 13.846 14.842 4.38 7.806 9.657 13.754 15.846 17.847 6.184 4.093 12.419 6.136 18.699 6.136 6.28 0 11.704-.476 16.274-1.423 4.565-.952 8.848-2.383 12.847-4.285 1.713-12.758 6.377-22.559 13.988-29.41-10.848-1.14-20.601-2.857-29.264-5.14-8.658-2.286-17.605-5.996-26.835-11.14-9.235-5.137-16.896-11.516-22.985-19.126-6.09-7.614-11.088-17.61-14.987-29.979-3.901-12.374-5.852-26.648-5.852-42.826 0-23.035 7.52-42.637 22.557-58.817-7.044-17.318-6.379-36.732 1.997-58.24 5.52-1.715 13.706-.428 24.554 3.853 10.85 4.283 18.794 7.952 23.84 10.994 5.046 3.041 9.089 5.618 12.135 7.708 17.705-4.947 35.976-7.421 54.818-7.421s37.117 2.474 54.823 7.421l10.849-6.849c7.419-4.57 16.18-8.758 26.262-12.565 10.088-3.805 17.802-4.853 23.134-3.138 8.562 21.509 9.325 40.922 2.279 58.24 15.036 16.18 22.559 35.787 22.559 58.817 0 16.178-1.958 30.497-5.853 42.966-3.9 12.471-8.941 22.457-15.125 29.979-6.191 7.521-13.901 13.85-23.131 18.986-9.232 5.14-18.182 8.85-26.84 11.136-8.662 2.286-18.415 4.004-29.263 5.146 9.894 8.562 14.842 22.077 14.842 40.539v60.237c0 3.422 1.19 6.279 3.572 8.562 2.379 2.279 6.136 2.95 11.276 1.995 44.163-14.653 80.185-41.062 108.068-79.226 27.88-38.161 41.825-81.126 41.825-128.906-.01-39.771-9.818-76.454-29.414-110.049z"})}),e.jsx("span",{className:"sr-only",children:"View on GitHub"})]})})}const Vi={theme:"light",setTheme:()=>null},ua=i.createContext(Vi);function Ui(){const t=i.useContext(ua);if(t===void 0)throw new Error("useTheme must be used within a ThemeProvider");return t}function qi({children:t,defaultTheme:s="light",storageKey:r="loki-ui-theme",...a}){const[n,o]=i.useState(()=>{try{const c=localStorage.getItem(r);return c==="dark"||c==="light"?c:s}catch{return s}}),l=c=>{try{localStorage.setItem(r,c),o(c)}catch(d){console.error("Failed to save theme:",d)}};return i.useEffect(()=>{const c=window.document.documentElement;c.classList.remove("light","dark"),c.classList.add(n)},[n]),e.jsx(ua.Provider,{value:{theme:n,setTheme:l},...a,children:t})}function Gi(){const{theme:t,setTheme:s}=Ui(),r=()=>{s(t==="light"?"dark":"light")};return e.jsxs(q,{variant:"ghost",size:"icon",className:"bg-muted hover:bg-muted-hover rounded-lg",onClick:r,children:[t==="light"?e.jsx(Io,{className:"h-[1.2rem] w-[1.2rem]"}):e.jsx(Fo,{className:"h-[1.2rem] w-[1.2rem]"}),e.jsx("span",{className:"sr-only",children:"Toggle theme"})]})}function Hi(){return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(zi,{}),e.jsx(Gi,{})]})}const ks=i.forwardRef(({...t},s)=>e.jsx("nav",{ref:s,"aria-label":"breadcrumb",...t}));ks.displayName="Breadcrumb";const Ss=i.forwardRef(({className:t,...s},r)=>e.jsx("ol",{ref:r,className:v("flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5",t),...s}));Ss.displayName="BreadcrumbList";const Nt=i.forwardRef(({className:t,...s},r)=>e.jsx("li",{ref:r,className:v("inline-flex items-center gap-1.5",t),...s}));Nt.displayName="BreadcrumbItem";const kt=i.forwardRef(({asChild:t,className:s,...r},a)=>{const n=t?Se:"a";return e.jsx(n,{ref:a,className:v("transition-colors hover:text-foreground",s),...r})});kt.displayName="BreadcrumbLink";const pa=i.forwardRef(({className:t,...s},r)=>e.jsx("span",{ref:r,role:"link","aria-disabled":"true","aria-current":"page",className:v("font-normal text-foreground",t),...s}));pa.displayName="BreadcrumbPage";const St=({children:t,className:s,...r})=>e.jsx("li",{role:"presentation","aria-hidden":"true",className:v("[&>svg]:w-3.5 [&>svg]:h-3.5",s),...r,children:t??e.jsx(kr,{})});St.displayName="BreadcrumbSeparator";const Ki=({match:t})=>{const s=t.params.nodeName;return e.jsx("span",{children:s})},Wi=({match:t})=>{const s=t.params.ringName;return e.jsx("span",{children:s})},ee=i.forwardRef(({className:t,...s},r)=>e.jsx("div",{ref:r,className:v("rounded-xl border bg-card text-card-foreground shadow",t),...s}));ee.displayName="Card";const se=i.forwardRef(({className:t,...s},r)=>e.jsx("div",{ref:r,className:v("flex flex-col space-y-1.5 p-6",t),...s}));se.displayName="CardHeader";const ae=i.forwardRef(({className:t,...s},r)=>e.jsx("div",{ref:r,className:v("font-semibold leading-none tracking-tight",t),...s}));ae.displayName="CardTitle";const Qe=i.forwardRef(({className:t,...s},r)=>e.jsx("div",{ref:r,className:v("text-sm text-muted-foreground",t),...s}));Qe.displayName="CardDescription";const te=i.forwardRef(({className:t,...s},r)=>e.jsx("div",{ref:r,className:v("p-6 pt-0",t),...s}));te.displayName="CardContent";const ma=i.forwardRef(({className:t,...s},r)=>e.jsx("div",{ref:r,className:v("flex items-center p-6 pt-0",t),...s}));ma.displayName="CardFooter";function Zi(){const t=It(),[s]=at(),r=s.get("path")||window.location.pathname;return e.jsxs("div",{className:"flex min-h-[calc(100vh-12rem)] items-center justify-center bg-dot-pattern px-4",children:[e.jsxs(ee,{className:"w-full max-w-[450px] overflow-hidden",children:[e.jsxs(se,{className:"text-center pb-0",children:[e.jsxs("div",{className:"relative mb-8",children:[e.jsx("div",{className:"absolute inset-0 flex items-center justify-center"}),e.jsx("div",{className:"relative flex justify-center py-4",children:e.jsx("div",{className:"bg-white dark:bg-transparent p-2 rounded-full",children:e.jsx("img",{src:"https://grafana.com/media/docs/loki/logo-grafana-loki.png",alt:"Loki Logo",className:v("h-16 w-16 sm:h-24 sm:w-24","rotate-180 animate-swing hover:animate-shake cursor-pointer transition-all duration-300")})})})]}),e.jsx(ae,{className:"text-5xl sm:text-7xl font-bold bg-gradient-to-r from-primary to-primary/50 bg-clip-text text-transparent",children:"404"})]}),e.jsxs(te,{className:"text-center space-y-3 pb-8",children:[e.jsx("h2",{className:"text-xl sm:text-2xl font-semibold tracking-tight",children:"Oops! Page Not Found"}),e.jsx("p",{className:"text-sm sm:text-base text-muted-foreground",children:"Even with our powerful log aggregation, we couldn't find this page in any of our streams!"}),e.jsxs("p",{className:"text-xs sm:text-sm text-muted-foreground italic",children:["Error: LogQL query returned 0 results for label"," ",`{path="${r}"}`]})]}),e.jsxs(ma,{className:"flex justify-center gap-4 pb-8",children:[e.jsxs(q,{variant:"outline",onClick:()=>t(-1),className:"gap-2 group",size:"sm",children:[e.jsx(Lo,{className:"h-4 w-4 group-hover:animate-spin"}),"Go Back"]}),e.jsxs(q,{onClick:()=>t("/"),className:"gap-2 group",size:"sm",children:[e.jsx(Po,{className:"h-4 w-4 group-hover:animate-bounce"}),"Go Home"]})]})]}),e.jsx("style",{children:` - .bg-dot-pattern { - background-image: radial-gradient(circle at 1px 1px, hsl(var(--muted-foreground) / 0.1) 1px, transparent 0); - background-size: 32px 32px; - } - @keyframes shake { - 0%, 100% { transform: rotate(180deg); } - 25% { transform: rotate(170deg); } - 75% { transform: rotate(190deg); } - } - @keyframes swing { - 0%, 100% { transform: rotate(180deg); } - 50% { transform: rotate(190deg); } - } - .animate-swing { - animation: swing 1s ease-in-out infinite; - } - .animate-shake { - animation: shake 0.3s ease-in-out; - } - `})]})}const J={INGESTER:"ingester",PARTITION_INGESTER:"partition-ingester",DISTRIBUTOR:"distributor",PATTERN_INGESTER:"pattern-ingester",QUERY_SCHEDULER:"query-scheduler",COMPACTOR:"compactor",RULER:"ruler",INDEX_GATEWAY:"index-gateway"},ga={0:"Unknown",1:"Pending",2:"Active",3:"Inactive",4:"Deleted"},Yi={cluster:null,error:null,isLoading:!0,refresh:()=>Promise.resolve()},fa=i.createContext(Yi);function ue(){const t=i.useContext(fa);if(!t)throw new Error("useCluster must be used within a ClusterProvider");return t}function ha(t){const s=new Date(t);return`${Xo(s)} ago`}function xa(t){const s=new Date(t);return Qo(s,{format:"extended"})}function Et(t){switch(typeof t=="string"?parseInt(t,10):t){case 2:return"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200";case 1:return"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200";case 3:return"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200";case 4:return"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200";default:return"bg-gray-100 text-gray-800 dark:bg-gray-900 dark:text-gray-200"}}function ba(t){const s=t.split("").reduce((n,o)=>o.charCodeAt(0)+((n<<5)-n),0),r=["bg-rose-100 text-rose-800 dark:bg-rose-900 dark:text-rose-200","bg-orange-100 text-orange-800 dark:bg-orange-900 dark:text-orange-200","bg-amber-100 text-amber-800 dark:bg-amber-900 dark:text-amber-200","bg-lime-100 text-lime-800 dark:bg-lime-900 dark:text-lime-200","bg-teal-100 text-teal-800 dark:bg-teal-900 dark:text-teal-200","bg-cyan-100 text-cyan-800 dark:bg-cyan-900 dark:text-cyan-200","bg-indigo-100 text-indigo-800 dark:bg-indigo-900 dark:text-indigo-200","bg-fuchsia-100 text-fuchsia-800 dark:bg-fuchsia-900 dark:text-fuchsia-200"],a=Math.abs(s)%r.length;return r[a]}function Es(t){const s=t.split("-");return s.length>=3?s[s.length-2]:""}function Xi(t){const s=["B","KiB","MiB","GiB","TiB"];let r=t,a=0;for(;r>=1024&&aObject.values(t).some(r=>da(r,s)),ya={ingester:"ingester","partition-ring":"partition-ring",distributor:"distributor","pattern-ingester":"pattern-ingester","query-scheduler":"query-scheduler",compactor:"compactor",ruler:"ruler","index-gateway":"index-gateway"},Ne={ingester:{title:"Ingester",ringName:J.INGESTER,ringPath:"/ring",needsTokens:!0},"partition-ring":{title:"Partition Ingester",ringName:J.PARTITION_INGESTER,ringPath:"/partition-ring",needsTokens:!0},distributor:{title:"Distributor",ringName:J.DISTRIBUTOR,ringPath:"/distributor/ring",needsTokens:!1},"pattern-ingester":{title:"Pattern Ingester",ringName:J.PATTERN_INGESTER,ringPath:"/pattern/ring",needsTokens:!0},"query-scheduler":{title:"Scheduler",ringName:J.QUERY_SCHEDULER,ringPath:"/scheduler/ring",needsTokens:!1},compactor:{title:"Compactor",ringName:J.COMPACTOR,ringPath:"/compactor/ring",needsTokens:!1},ruler:{title:"Ruler",ringName:J.RULER,ringPath:"/ruler/ring",needsTokens:!0},"index-gateway":{title:"Index Gateway",ringName:J.INDEX_GATEWAY,ringPath:"/indexgateway/ring",needsTokens:!0}};function va(t){return Object.keys(Ne).find(s=>Ne[s].ringName===t)}function Ji(t){if(!t)return!1;const s=va(t);return s?Ne[s].needsTokens:!1}const el=t=>{const s=[];if(!t)return s;for(const r in Ne)Qi(t,r)&&s.push({title:Ne[r].title,url:`/rings/${Ne[r].ringName}`});return s};function ja(t,s){if(!t||!s)return"";const r=va(s);if(!r)return"";const a=Oe(t,r);if(!a)return"";const n=`/ui/api/v1/proxy/${a}`,o=Ne[r].ringPath,l=Ne[r].needsTokens?"?tokens=true":"";return`${n}${o}${l}`}const wa=[{id:J.INGESTER,title:"Ingester"},{id:J.PARTITION_INGESTER,title:"Partition Ingester"},{id:J.DISTRIBUTOR,title:"Distributor"},{id:J.PATTERN_INGESTER,title:"Pattern Ingester"},{id:J.QUERY_SCHEDULER,title:"Scheduler"},{id:J.COMPACTOR,title:"Compactor"},{id:J.RULER,title:"Ruler"},{id:J.INDEX_GATEWAY,title:"Index Gateway"}];function tl(t){const s={};try{const r=/]*>([\s\S]*?)<\/tbody>/,a=t.match(r);if(!a)return s;const n=/]*>([\s\S]*?)<\/tr>/g,o=Array.from(a[1].matchAll(n));for(const l of o){const c=/]*>([\s\S]*?)<\/td>/g,d=Array.from(l[1].matchAll(c)).map(u=>u[1].trim().replace(/ /g,""));if(d.length>=10){const u=d[0],m=d[9].endsWith("%")?d[9]:`${d[9]}%`;s[u]=m}}}catch(r){console.error("Error parsing ring HTML:",r)}return s}function sl({ringName:t,isPaused:s=!1}){const{cluster:r}=ue(),[a,n]=i.useState(null),[o,l]=i.useState(""),[c,d]=i.useState(!1),u=i.useRef(),m=i.useMemo(()=>Ji(t),[t]),f=i.useCallback(()=>ja(r==null?void 0:r.members,t??""),[r,t]),y=i.useCallback(async()=>{if(!t){l("Ring name is required");return}const g=f();if(!g){l("No cluster members available");return}u.current&&u.current.abort(),u.current=new AbortController,d(!0);try{const x=await fetch(g,{headers:{Accept:"application/json"},signal:u.current.signal});if(!x.ok)throw new Error(`Failed to fetch ring: ${x.statusText}`);const b=await x.json();if(!b||!b.shards){n(null);return}const j=await fetch(g,{headers:{Accept:"text/plain"},signal:u.current.signal});if(!j.ok)throw new Error(`Failed to fetch ring ownership: ${j.statusText}`);const w=await j.text(),E=tl(w),C={...b,shards:b.shards.map(A=>({...A,ownership:E[A.id]||"0%"}))};n(C),l("")}catch(x){if(x instanceof Error&&x.name==="AbortError")return;console.error("Error fetching ring:",x),l(x instanceof Error?x.message:"Unknown error"),n(null)}finally{d(!1)}},[t,f]),N=i.useCallback(async g=>{const x=f();if(!x)throw new Error("Ring name and node name are required");let b=0;const j=g.length;for(const w of g)try{const E=new FormData;E.append("forget",w),(await fetch(x,{method:"POST",body:E})).ok&&b++}catch(E){console.error(`Error forgetting instance ${w}:`,E)}return{success:b,total:j}},[f]),{uniqueStates:h,uniqueZones:p}=i.useMemo(()=>{if(!(a!=null&&a.shards))return{uniqueStates:[],uniqueZones:[]};const g=new Set,x=new Set;return a.shards.forEach(b=>{const j=b.state||"unknown";j.trim()&&g.add(j),b.zone&&b.zone.trim()&&x.add(b.zone)}),{uniqueStates:Array.from(g).sort(),uniqueZones:Array.from(x).sort()}},[a==null?void 0:a.shards]);return i.useEffect(()=>()=>{u.current&&u.current.abort()},[]),i.useEffect(()=>{if(y(),!s){const g=setInterval(()=>{y()},5e3);return()=>{clearInterval(g)}}},[y,s]),{ring:a,error:o,isLoading:c,fetchRing:y,forgetInstances:N,uniqueStates:h,uniqueZones:p,isTokenBased:m}}const Le=i.forwardRef(({className:t,...s},r)=>e.jsx(Ir,{ref:r,className:v("peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",t),...s,children:e.jsx(si,{className:v("flex items-center justify-center text-current"),children:e.jsx(qe,{className:"h-4 w-4"})})}));Le.displayName=Ir.displayName;const Ce=i.forwardRef(({className:t,...s},r)=>e.jsx("div",{className:"relative w-full overflow-auto",children:e.jsx("table",{ref:r,className:v("w-full caption-bottom text-sm",t),...s})}));Ce.displayName="Table";const Te=i.forwardRef(({className:t,...s},r)=>e.jsx("thead",{ref:r,className:v("[&_tr]:border-b",t),...s}));Te.displayName="TableHeader";const Re=i.forwardRef(({className:t,...s},r)=>e.jsx("tbody",{ref:r,className:v("[&_tr:last-child]:border-0",t),...s}));Re.displayName="TableBody";const rl=i.forwardRef(({className:t,...s},r)=>e.jsx("tfoot",{ref:r,className:v("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",t),...s}));rl.displayName="TableFooter";const X=i.forwardRef(({className:t,...s},r)=>e.jsx("tr",{ref:r,className:v("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",t),...s}));X.displayName="TableRow";const D=i.forwardRef(({className:t,...s},r)=>e.jsx("th",{ref:r,className:v("h-10 px-2 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),...s}));D.displayName="TableHead";const F=i.forwardRef(({className:t,...s},r)=>e.jsx("td",{ref:r,className:v("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),...s}));F.displayName="TableCell";const al=i.forwardRef(({className:t,...s},r)=>e.jsx("caption",{ref:r,className:v("mt-4 text-sm text-muted-foreground",t),...s}));al.displayName="TableCaption";const nl=pi,ol=mi,il=i.forwardRef(({className:t,inset:s,children:r,...a},n)=>e.jsxs(qr,{ref:n,className:v("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",s&&"pl-8",t),...a,children:[r,e.jsx(kr,{className:"ml-auto h-4 w-4"})]}));il.displayName=qr.displayName;const ll=i.forwardRef(({className:t,...s},r)=>e.jsx(Gr,{ref:r,className:v("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...s}));ll.displayName=Gr.displayName;const Na=i.forwardRef(({className:t,sideOffset:s=4,...r},a)=>e.jsx(ui,{children:e.jsx(Hr,{ref:a,sideOffset:s,className:v("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...r})}));Na.displayName=Hr.displayName;const ds=i.forwardRef(({className:t,inset:s,...r},a)=>e.jsx(Kr,{ref:a,className:v("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",s&&"pl-8",t),...r}));ds.displayName=Kr.displayName;const cl=i.forwardRef(({className:t,children:s,checked:r,...a},n)=>e.jsxs(Wr,{ref:n,className:v("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),checked:r,...a,children:[e.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(Zr,{children:e.jsx(qe,{className:"h-4 w-4"})})}),s]}));cl.displayName=Wr.displayName;const dl=i.forwardRef(({className:t,children:s,...r},a)=>e.jsxs(Yr,{ref:a,className:v("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...r,children:[e.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(Zr,{children:e.jsx(Do,{className:"h-2 w-2 fill-current"})})}),s]}));dl.displayName=Yr.displayName;const ul=i.forwardRef(({className:t,inset:s,...r},a)=>e.jsx(Xr,{ref:a,className:v("px-2 py-1.5 text-sm font-semibold",s&&"pl-8",t),...r}));ul.displayName=Xr.displayName;const pl=i.forwardRef(({className:t,...s},r)=>e.jsx(Qr,{ref:r,className:v("-mx-1 my-1 h-px bg-muted",t),...s}));pl.displayName=Qr.displayName;function Z({title:t,field:s,sortField:r,sortDirection:a,onSort:n}){const o=r===s,l=c=>{r===s&&a===c||n(s)};return e.jsx("div",{className:"flex items-center space-x-2",children:e.jsxs(nl,{children:[e.jsx(ol,{asChild:!0,children:e.jsx(q,{variant:"ghost",size:"sm",className:"-ml-3 h-8 hover:bg-muted/50 data-[state=open]:bg-muted/50",children:e.jsxs("div",{className:"flex items-center",children:[e.jsx("span",{children:t}),o?a==="desc"?e.jsx(Ws,{className:"ml-2 h-4 w-4"}):e.jsx(ls,{className:"ml-2 h-4 w-4"}):e.jsx(Sr,{className:"ml-2 h-4 w-4"})]})})}),e.jsxs(Na,{align:"start",children:[e.jsxs(ds,{onClick:()=>l("asc"),className:v("cursor-pointer",o&&a==="asc"&&"bg-accent"),children:[e.jsx(ls,{className:"mr-2 h-3.5 w-3.5 text-muted-foreground/70"}),"Asc"]}),e.jsxs(ds,{onClick:()=>l("desc"),className:v("cursor-pointer",o&&a==="desc"&&"bg-accent"),children:[e.jsx(Ws,{className:"mr-2 h-3.5 w-3.5 text-muted-foreground/70"}),"Desc"]})]})]})})}var Cs="Progress",Ts=100,[ml,Im]=hr(Cs),[gl,fl]=ml(Cs),ka=i.forwardRef((t,s)=>{const{__scopeProgress:r,value:a=null,max:n,getValueLabel:o=hl,...l}=t;(n||n===0)&&!Js(n)&&console.error(xl(`${n}`,"Progress"));const c=Js(n)?n:Ts;a!==null&&!er(a,c)&&console.error(bl(`${a}`,"Progress"));const d=er(a,c)?a:null,u=Ct(d)?o(d,c):void 0;return e.jsx(gl,{scope:r,value:d,max:c,children:e.jsx(re.div,{"aria-valuemax":c,"aria-valuemin":0,"aria-valuenow":Ct(d)?d:void 0,"aria-valuetext":u,role:"progressbar","data-state":Ca(d,c),"data-value":d??void 0,"data-max":c,...l,ref:s})})});ka.displayName=Cs;var Sa="ProgressIndicator",Ea=i.forwardRef((t,s)=>{const{__scopeProgress:r,...a}=t,n=fl(Sa,r);return e.jsx(re.div,{"data-state":Ca(n.value,n.max),"data-value":n.value??void 0,"data-max":n.max,...a,ref:s})});Ea.displayName=Sa;function hl(t,s){return`${Math.round(t/s*100)}%`}function Ca(t,s){return t==null?"indeterminate":t===s?"complete":"loading"}function Ct(t){return typeof t=="number"}function Js(t){return Ct(t)&&!isNaN(t)&&t>0}function er(t,s){return Ct(t)&&!isNaN(t)&&t<=s&&t>=0}function xl(t,s){return`Invalid prop \`max\` of value \`${t}\` supplied to \`${s}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${Ts}\`.`}function bl(t,s){return`Invalid prop \`value\` of value \`${t}\` supplied to \`${s}\`. The \`value\` prop must be: - - a positive number - - less than the value passed to \`max\` (or ${Ts} if no \`max\` prop is set) - - \`null\` or \`undefined\` if the progress is indeterminate. - -Defaulting to \`null\`.`}var Ta=ka,yl=Ea;const Ra=i.forwardRef(({className:t,value:s,...r},a)=>e.jsx(Ta,{ref:a,className:v("relative h-2 w-full overflow-hidden rounded-full bg-primary/20",t),...r,children:e.jsx(yl,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(s||0)}%)`}})}));Ra.displayName=Ta.displayName;function vl({visibleIds:t,selectedIds:s,onChange:r}){const a=t.every(o=>s.has(o)),n=()=>{const o=new Set(t);r(a?new Set([...s].filter(l=>!o.has(l))):new Set([...s,...t]))};return e.jsx(Le,{checked:t.length>0&&a,onCheckedChange:n,"aria-label":"Select all visible instances"})}function jl({instances:t,selectedInstances:s,onSelectInstance:r,sortField:a,sortDirection:n,onSort:o,showTokens:l=!1}){return e.jsxs(Ce,{children:[e.jsx(Te,{children:e.jsxs(X,{className:"hover:bg-transparent",children:[e.jsx(D,{className:"w-[50px]",children:e.jsx(vl,{visibleIds:t.map(c=>c.id),selectedIds:s,onChange:c=>{t.forEach(d=>{c.has(d.id)!==s.has(d.id)&&r(d.id)})}})}),e.jsx(D,{className:"w-[200px]",children:e.jsx(Z,{title:"ID",field:"id",sortField:a,sortDirection:n,onSort:o})}),e.jsx(D,{className:"w-[150px]",children:e.jsx(Z,{title:"State",field:"state",sortField:a,sortDirection:n,onSort:o})}),e.jsx(D,{children:e.jsx(Z,{title:"Address",field:"address",sortField:a,sortDirection:n,onSort:o})}),l&&e.jsx(D,{className:"w-[200px]",children:e.jsx(Z,{title:"Ownership",field:"ownership",sortField:a,sortDirection:n,onSort:o})}),e.jsx(D,{className:"w-[150px]",children:e.jsx(Z,{title:"Zone",field:"zone",sortField:a,sortDirection:n,onSort:o})}),e.jsx(D,{className:"w-[200px]",children:e.jsx(Z,{title:"Last Heartbeat",field:"timestamp",sortField:a,sortDirection:n,onSort:o})}),e.jsx(D,{className:"w-[50px]"})]})}),e.jsxs(Re,{children:[t.map(c=>{const d=l?c.ownership:0;return e.jsxs(X,{children:[e.jsx(F,{children:e.jsx(Le,{checked:s.has(c.id),onCheckedChange:()=>r(c.id),"aria-label":`Select instance ${c.id}`})}),e.jsx(F,{className:"font-medium",children:e.jsx(ce,{to:`/nodes/${c.id}`,className:"hover:underline",children:c.id})}),e.jsx(F,{children:e.jsx("span",{className:v("inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium",Et(c.state)),children:c.state})}),e.jsx(F,{children:c.address}),l&&e.jsx(F,{children:e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex justify-between text-xs",children:[e.jsx("span",{children:d}),e.jsxs("span",{className:"text-muted-foreground",children:[c.tokens.length," tokens"]})]}),e.jsx(Ra,{value:typeof d=="number"?d:Number(d.slice(0,-1)),className:"h-2"})]})}),e.jsx(F,{children:c.zone?e.jsx("span",{className:v("inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium",ba(c.zone)),children:c.zone}):e.jsx("span",{className:"text-muted-foreground",children:"-"})}),e.jsx(F,{children:e.jsx("span",{title:xa(c.timestamp),className:"text-muted-foreground",children:ha(c.timestamp)})}),e.jsx(F,{children:e.jsx(q,{variant:"ghost",size:"icon",asChild:!0,className:"h-8 w-8",title:"View instance details",children:e.jsx(ce,{to:`/nodes/${c.id}`,children:e.jsx(Ft,{className:"h-4 w-4"})})})})]},c.id)}),t.length===0&&e.jsx(X,{children:e.jsx(F,{colSpan:7,className:"h-24 text-center",children:e.jsx("div",{className:"text-muted-foreground",children:"No instances found"})})})]})]})}const xe=i.forwardRef(({className:t,type:s,...r},a)=>e.jsx("input",{type:s,className:v("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",t),ref:a,...r}));xe.displayName="Input";var tr=1,wl=.9,Nl=.8,kl=.17,Qt=.1,Jt=.999,Sl=.9999,El=.99,Cl=/[\\\/_+.#"@\[\(\{&]/,Tl=/[\\\/_+.#"@\[\(\{&]/g,Rl=/[\s-]/,Aa=/[\s-]/g;function us(t,s,r,a,n,o,l){if(o===s.length)return n===t.length?tr:El;var c=`${n},${o}`;if(l[c]!==void 0)return l[c];for(var d=a.charAt(o),u=r.indexOf(d,n),m=0,f,y,N,h;u>=0;)f=us(t,s,r,a,u+1,o+1,l),f>m&&(u===n?f*=tr:Cl.test(t.charAt(u-1))?(f*=Nl,N=t.slice(n,u-1).match(Tl),N&&n>0&&(f*=Math.pow(Jt,N.length))):Rl.test(t.charAt(u-1))?(f*=wl,h=t.slice(n,u-1).match(Aa),h&&n>0&&(f*=Math.pow(Jt,h.length))):(f*=kl,n>0&&(f*=Math.pow(Jt,u-n))),t.charAt(u)!==s.charAt(o)&&(f*=Sl)),(ff&&(f=y*Qt)),f>m&&(m=f),u=r.indexOf(d,u+1);return l[c]=m,m}function sr(t){return t.toLowerCase().replace(Aa," ")}function Al(t,s,r){return t=r&&r.length>0?`${t+" "+r.join(" ")}`:t,us(t,s,sr(t),sr(s),0,0,{})}var _a={exports:{}},Ia={};/** - * @license React - * use-sync-external-store-shim.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var Ve=i;function _l(t,s){return t===s&&(t!==0||1/t===1/s)||t!==t&&s!==s}var Il=typeof Object.is=="function"?Object.is:_l,Fl=Ve.useState,Ll=Ve.useEffect,Pl=Ve.useLayoutEffect,Dl=Ve.useDebugValue;function Ol(t,s){var r=s(),a=Fl({inst:{value:r,getSnapshot:s}}),n=a[0].inst,o=a[1];return Pl(function(){n.value=r,n.getSnapshot=s,es(n)&&o({inst:n})},[t,r,s]),Ll(function(){return es(n)&&o({inst:n}),t(function(){es(n)&&o({inst:n})})},[t]),Dl(r),r}function es(t){var s=t.getSnapshot;t=t.value;try{var r=s();return!Il(t,r)}catch{return!0}}function $l(t,s){return s()}var Ml=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?$l:Ol;Ia.useSyncExternalStore=Ve.useSyncExternalStore!==void 0?Ve.useSyncExternalStore:Ml;_a.exports=Ia;var Bl=_a.exports,We='[cmdk-group=""]',ts='[cmdk-group-items=""]',zl='[cmdk-group-heading=""]',Rs='[cmdk-item=""]',rr=`${Rs}:not([aria-disabled="true"])`,ps="cmdk-item-select",_e="data-value",Vl=(t,s,r)=>Al(t,s,r),Fa=i.createContext(void 0),ut=()=>i.useContext(Fa),La=i.createContext(void 0),As=()=>i.useContext(La),Pa=i.createContext(void 0),Da=i.forwardRef((t,s)=>{let r=$e(()=>{var S,R;return{search:"",value:(R=(S=t.value)!=null?S:t.defaultValue)!=null?R:"",filtered:{count:0,items:new Map,groups:new Set}}}),a=$e(()=>new Set),n=$e(()=>new Map),o=$e(()=>new Map),l=$e(()=>new Set),c=Oa(t),{label:d,children:u,value:m,onValueChange:f,filter:y,shouldFilter:N,loop:h,disablePointerSelection:p=!1,vimBindings:g=!0,...x}=t,b=Me(),j=Me(),w=Me(),E=i.useRef(null),C=Jl();Pe(()=>{if(m!==void 0){let S=m.trim();r.current.value=S,A.emit()}},[m]),Pe(()=>{C(6,W)},[]);let A=i.useMemo(()=>({subscribe:S=>(l.current.add(S),()=>l.current.delete(S)),snapshot:()=>r.current,setState:(S,R,$)=>{var L,G,H;if(!Object.is(r.current[S],R)){if(r.current[S]=R,S==="search")M(),Y(),C(1,K);else if(S==="value"&&($||C(5,W),((L=c.current)==null?void 0:L.value)!==void 0)){let ne=R??"";(H=(G=c.current).onValueChange)==null||H.call(G,ne);return}A.emit()}},emit:()=>{l.current.forEach(S=>S())}}),[]),B=i.useMemo(()=>({value:(S,R,$)=>{var L;R!==((L=o.current.get(S))==null?void 0:L.value)&&(o.current.set(S,{value:R,keywords:$}),r.current.filtered.items.set(S,z(R,$)),C(2,()=>{Y(),A.emit()}))},item:(S,R)=>(a.current.add(S),R&&(n.current.has(R)?n.current.get(R).add(S):n.current.set(R,new Set([S]))),C(3,()=>{M(),Y(),r.current.value||K(),A.emit()}),()=>{o.current.delete(S),a.current.delete(S),r.current.filtered.items.delete(S);let $=T();C(4,()=>{M(),($==null?void 0:$.getAttribute("id"))===S&&K(),A.emit()})}),group:S=>(n.current.has(S)||n.current.set(S,new Set),()=>{o.current.delete(S),n.current.delete(S)}),filter:()=>c.current.shouldFilter,label:d||t["aria-label"],getDisablePointerSelection:()=>c.current.disablePointerSelection,listId:b,inputId:w,labelId:j,listInnerRef:E}),[]);function z(S,R){var $,L;let G=(L=($=c.current)==null?void 0:$.filter)!=null?L:Vl;return S?G(S,r.current.search,R):0}function Y(){if(!r.current.search||c.current.shouldFilter===!1)return;let S=r.current.filtered.items,R=[];r.current.filtered.groups.forEach(L=>{let G=n.current.get(L),H=0;G.forEach(ne=>{let de=S.get(ne);H=Math.max(de,H)}),R.push([L,H])});let $=E.current;O().sort((L,G)=>{var H,ne;let de=L.getAttribute("id"),gt=G.getAttribute("id");return((H=S.get(gt))!=null?H:0)-((ne=S.get(de))!=null?ne:0)}).forEach(L=>{let G=L.closest(ts);G?G.appendChild(L.parentElement===G?L:L.closest(`${ts} > *`)):$.appendChild(L.parentElement===$?L:L.closest(`${ts} > *`))}),R.sort((L,G)=>G[1]-L[1]).forEach(L=>{var G;let H=(G=E.current)==null?void 0:G.querySelector(`${We}[${_e}="${encodeURIComponent(L[0])}"]`);H==null||H.parentElement.appendChild(H)})}function K(){let S=O().find($=>$.getAttribute("aria-disabled")!=="true"),R=S==null?void 0:S.getAttribute(_e);A.setState("value",R||void 0)}function M(){var S,R,$,L;if(!r.current.search||c.current.shouldFilter===!1){r.current.filtered.count=a.current.size;return}r.current.filtered.groups=new Set;let G=0;for(let H of a.current){let ne=(R=(S=o.current.get(H))==null?void 0:S.value)!=null?R:"",de=(L=($=o.current.get(H))==null?void 0:$.keywords)!=null?L:[],gt=z(ne,de);r.current.filtered.items.set(H,gt),gt>0&&G++}for(let[H,ne]of n.current)for(let de of ne)if(r.current.filtered.items.get(de)>0){r.current.filtered.groups.add(H);break}r.current.filtered.count=G}function W(){var S,R,$;let L=T();L&&(((S=L.parentElement)==null?void 0:S.firstChild)===L&&(($=(R=L.closest(We))==null?void 0:R.querySelector(zl))==null||$.scrollIntoView({block:"nearest"})),L.scrollIntoView({block:"nearest"}))}function T(){var S;return(S=E.current)==null?void 0:S.querySelector(`${Rs}[aria-selected="true"]`)}function O(){var S;return Array.from(((S=E.current)==null?void 0:S.querySelectorAll(rr))||[])}function V(S){let R=O()[S];R&&A.setState("value",R.getAttribute(_e))}function Q(S){var R;let $=T(),L=O(),G=L.findIndex(ne=>ne===$),H=L[G+S];(R=c.current)!=null&&R.loop&&(H=G+S<0?L[L.length-1]:G+S===L.length?L[0]:L[G+S]),H&&A.setState("value",H.getAttribute(_e))}function _(S){let R=T(),$=R==null?void 0:R.closest(We),L;for(;$&&!L;)$=S>0?Xl($,We):Ql($,We),L=$==null?void 0:$.querySelector(rr);L?A.setState("value",L.getAttribute(_e)):Q(S)}let I=()=>V(O().length-1),P=S=>{S.preventDefault(),S.metaKey?I():S.altKey?_(1):Q(1)},U=S=>{S.preventDefault(),S.metaKey?V(0):S.altKey?_(-1):Q(-1)};return i.createElement(re.div,{ref:s,tabIndex:-1,...x,"cmdk-root":"",onKeyDown:S=>{var R;if((R=x.onKeyDown)==null||R.call(x,S),!S.defaultPrevented)switch(S.key){case"n":case"j":{g&&S.ctrlKey&&P(S);break}case"ArrowDown":{P(S);break}case"p":case"k":{g&&S.ctrlKey&&U(S);break}case"ArrowUp":{U(S);break}case"Home":{S.preventDefault(),V(0);break}case"End":{S.preventDefault(),I();break}case"Enter":if(!S.nativeEvent.isComposing&&S.keyCode!==229){S.preventDefault();let $=T();if($){let L=new Event(ps);$.dispatchEvent(L)}}}}},i.createElement("label",{"cmdk-label":"",htmlFor:B.inputId,id:B.labelId,style:tc},d),Bt(t,S=>i.createElement(La.Provider,{value:A},i.createElement(Fa.Provider,{value:B},S))))}),Ul=i.forwardRef((t,s)=>{var r,a;let n=Me(),o=i.useRef(null),l=i.useContext(Pa),c=ut(),d=Oa(t),u=(a=(r=d.current)==null?void 0:r.forceMount)!=null?a:l==null?void 0:l.forceMount;Pe(()=>{if(!u)return c.item(n,l==null?void 0:l.id)},[u]);let m=$a(n,o,[t.value,t.children,o],t.keywords),f=As(),y=De(C=>C.value&&C.value===m.current),N=De(C=>u||c.filter()===!1?!0:C.search?C.filtered.items.get(n)>0:!0);i.useEffect(()=>{let C=o.current;if(!(!C||t.disabled))return C.addEventListener(ps,h),()=>C.removeEventListener(ps,h)},[N,t.onSelect,t.disabled]);function h(){var C,A;p(),(A=(C=d.current).onSelect)==null||A.call(C,m.current)}function p(){f.setState("value",m.current,!0)}if(!N)return null;let{disabled:g,value:x,onSelect:b,forceMount:j,keywords:w,...E}=t;return i.createElement(re.div,{ref:Je([o,s]),...E,id:n,"cmdk-item":"",role:"option","aria-disabled":!!g,"aria-selected":!!y,"data-disabled":!!g,"data-selected":!!y,onPointerMove:g||c.getDisablePointerSelection()?void 0:p,onClick:g?void 0:h},t.children)}),ql=i.forwardRef((t,s)=>{let{heading:r,children:a,forceMount:n,...o}=t,l=Me(),c=i.useRef(null),d=i.useRef(null),u=Me(),m=ut(),f=De(N=>n||m.filter()===!1?!0:N.search?N.filtered.groups.has(l):!0);Pe(()=>m.group(l),[]),$a(l,c,[t.value,t.heading,d]);let y=i.useMemo(()=>({id:l,forceMount:n}),[n]);return i.createElement(re.div,{ref:Je([c,s]),...o,"cmdk-group":"",role:"presentation",hidden:f?void 0:!0},r&&i.createElement("div",{ref:d,"cmdk-group-heading":"","aria-hidden":!0,id:u},r),Bt(t,N=>i.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?u:void 0},i.createElement(Pa.Provider,{value:y},N))))}),Gl=i.forwardRef((t,s)=>{let{alwaysRender:r,...a}=t,n=i.useRef(null),o=De(l=>!l.search);return!r&&!o?null:i.createElement(re.div,{ref:Je([n,s]),...a,"cmdk-separator":"",role:"separator"})}),Hl=i.forwardRef((t,s)=>{let{onValueChange:r,...a}=t,n=t.value!=null,o=As(),l=De(m=>m.search),c=De(m=>m.value),d=ut(),u=i.useMemo(()=>{var m;let f=(m=d.listInnerRef.current)==null?void 0:m.querySelector(`${Rs}[${_e}="${encodeURIComponent(c)}"]`);return f==null?void 0:f.getAttribute("id")},[]);return i.useEffect(()=>{t.value!=null&&o.setState("search",t.value)},[t.value]),i.createElement(re.input,{ref:s,...a,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":d.listId,"aria-labelledby":d.labelId,"aria-activedescendant":u,id:d.inputId,type:"text",value:n?t.value:l,onChange:m=>{n||o.setState("search",m.target.value),r==null||r(m.target.value)}})}),Kl=i.forwardRef((t,s)=>{let{children:r,label:a="Suggestions",...n}=t,o=i.useRef(null),l=i.useRef(null),c=ut();return i.useEffect(()=>{if(l.current&&o.current){let d=l.current,u=o.current,m,f=new ResizeObserver(()=>{m=requestAnimationFrame(()=>{let y=d.offsetHeight;u.style.setProperty("--cmdk-list-height",y.toFixed(1)+"px")})});return f.observe(d),()=>{cancelAnimationFrame(m),f.unobserve(d)}}},[]),i.createElement(re.div,{ref:Je([o,s]),...n,"cmdk-list":"",role:"listbox","aria-label":a,id:c.listId},Bt(t,d=>i.createElement("div",{ref:Je([l,c.listInnerRef]),"cmdk-list-sizer":""},d)))}),Wl=i.forwardRef((t,s)=>{let{open:r,onOpenChange:a,overlayClassName:n,contentClassName:o,container:l,...c}=t;return i.createElement(ws,{open:r,onOpenChange:a},i.createElement(Ns,{container:l},i.createElement(it,{"cmdk-overlay":"",className:n}),i.createElement(lt,{"aria-label":t.label,"cmdk-dialog":"",className:o},i.createElement(Da,{ref:s,...c}))))}),Zl=i.forwardRef((t,s)=>De(r=>r.filtered.count===0)?i.createElement(re.div,{ref:s,...t,"cmdk-empty":"",role:"presentation"}):null),Yl=i.forwardRef((t,s)=>{let{progress:r,children:a,label:n="Loading...",...o}=t;return i.createElement(re.div,{ref:s,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":n},Bt(t,l=>i.createElement("div",{"aria-hidden":!0},l)))}),oe=Object.assign(Da,{List:Kl,Item:Ul,Input:Hl,Group:ql,Separator:Gl,Dialog:Wl,Empty:Zl,Loading:Yl});function Xl(t,s){let r=t.nextElementSibling;for(;r;){if(r.matches(s))return r;r=r.nextElementSibling}}function Ql(t,s){let r=t.previousElementSibling;for(;r;){if(r.matches(s))return r;r=r.previousElementSibling}}function Oa(t){let s=i.useRef(t);return Pe(()=>{s.current=t}),s}var Pe=typeof window>"u"?i.useEffect:i.useLayoutEffect;function $e(t){let s=i.useRef();return s.current===void 0&&(s.current=t()),s}function Je(t){return s=>{t.forEach(r=>{typeof r=="function"?r(s):r!=null&&(r.current=s)})}}function De(t){let s=As(),r=()=>t(s.snapshot());return Bl.useSyncExternalStore(s.subscribe,r,r)}function $a(t,s,r,a=[]){let n=i.useRef(),o=ut();return Pe(()=>{var l;let c=(()=>{var u;for(let m of r){if(typeof m=="string")return m.trim();if(typeof m=="object"&&"current"in m)return m.current?(u=m.current.textContent)==null?void 0:u.trim():n.current}})(),d=a.map(u=>u.trim());o.value(t,c,d),(l=s.current)==null||l.setAttribute(_e,c),n.current=c}),n}var Jl=()=>{let[t,s]=i.useState(),r=$e(()=>new Map);return Pe(()=>{r.current.forEach(a=>a()),r.current=new Map},[t]),(a,n)=>{r.current.set(a,n),s({})}};function ec(t){let s=t.type;return typeof s=="function"?s(t.props):"render"in s?s.render(t.props):t}function Bt({asChild:t,children:s},r){return t&&i.isValidElement(s)?i.cloneElement(ec(s),{ref:s.ref},r(s.props.children)):r(s)}var tc={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const Ma=ws,sc=Ns,Ba=i.forwardRef(({className:t,...s},r)=>e.jsx(it,{ref:r,className:v("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...s}));Ba.displayName=it.displayName;const _s=i.forwardRef(({className:t,children:s,...r},a)=>e.jsxs(sc,{children:[e.jsx(Ba,{}),e.jsxs(lt,{ref:a,className:v("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",t),...r,children:[s,e.jsxs(aa,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[e.jsx(vs,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));_s.displayName=lt.displayName;const Is=({className:t,...s})=>e.jsx("div",{className:v("flex flex-col space-y-1.5 text-center sm:text-left",t),...s});Is.displayName="DialogHeader";const Fs=({className:t,...s})=>e.jsx("div",{className:v("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...s});Fs.displayName="DialogFooter";const Ls=i.forwardRef(({className:t,...s},r)=>e.jsx(Lt,{ref:r,className:v("text-lg font-semibold leading-none tracking-tight",t),...s}));Ls.displayName=Lt.displayName;const Ps=i.forwardRef(({className:t,...s},r)=>e.jsx(Pt,{ref:r,className:v("text-sm text-muted-foreground",t),...s}));Ps.displayName=Pt.displayName;const za=i.forwardRef(({className:t,...s},r)=>e.jsx(oe,{ref:r,className:v("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",t),...s}));za.displayName=oe.displayName;const Va=i.forwardRef(({className:t,...s},r)=>e.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[e.jsx(Er,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),e.jsx(oe.Input,{ref:r,className:v("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",t),...s})]}));Va.displayName=oe.Input.displayName;const rc=i.forwardRef(({className:t,...s},r)=>e.jsx(oe.List,{ref:r,className:v("max-h-[300px] overflow-y-auto overflow-x-hidden",t),...s}));rc.displayName=oe.List.displayName;const Ua=i.forwardRef((t,s)=>e.jsx(oe.Empty,{ref:s,className:"py-6 text-center text-sm",...t}));Ua.displayName=oe.Empty.displayName;const qa=i.forwardRef(({className:t,...s},r)=>e.jsx(oe.Group,{ref:r,className:v("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",t),...s}));qa.displayName=oe.Group.displayName;const ac=i.forwardRef(({className:t,...s},r)=>e.jsx(oe.Separator,{ref:r,className:v("-mx-1 h-px bg-border",t),...s}));ac.displayName=oe.Separator.displayName;const ms=i.forwardRef(({className:t,...s},r)=>e.jsx(oe.Item,{ref:r,className:v("relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t),...s}));ms.displayName=oe.Item.displayName;const nc=po,oc=mo,Ga=i.forwardRef(({className:t,align:s="center",sideOffset:r=4,...a},n)=>e.jsx(uo,{children:e.jsx(xr,{ref:n,align:s,sideOffset:r,className:v("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...a})}));Ga.displayName=xr.displayName;function Fe({options:t=[],selected:s=[],onChange:r,placeholder:a="Select options...",emptyMessage:n="No options found.",className:o}){const[l,c]=i.useState(!1),d=y=>{const N=s.includes(y)?s.filter(h=>h!==y):[...s,y];r(N)},u=()=>{s.length===t.length?r([]):r(t.map(y=>y.value))},m=s.length,f=t.length;return e.jsxs(nc,{open:l,onOpenChange:c,children:[e.jsx(oc,{asChild:!0,children:e.jsxs(q,{variant:"outline",role:"combobox","aria-expanded":l,className:v("justify-between",o),children:[m===0?a:`${m} selected`,e.jsx(Sr,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),e.jsx(Ga,{className:"w-[200px] p-0",children:e.jsxs(za,{children:[e.jsx(Va,{placeholder:a}),e.jsx(Ua,{children:n}),e.jsxs(qa,{children:[f>0&&e.jsx(ms,{onSelect:u,children:e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Le,{checked:m>0&&m===f,"aria-label":"Select all"}),e.jsx("span",{children:"Select all"})]})}),t.map(y=>e.jsx(ms,{onSelect:()=>d(y.value),children:e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Le,{checked:s.includes(y.value)}),e.jsx("span",{children:y.label})]})},y.value))]})]})})]})}function ic({idFilter:t,onIdFilterChange:s,stateFilter:r,onStateFilterChange:a,zoneFilter:n,onZoneFilterChange:o,uniqueStates:l,uniqueZones:c}){return e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx(Er,{className:"absolute left-2 top-2.5 h-4 w-4 text-muted-foreground"}),e.jsx(xe,{placeholder:"Filter by ID...",value:t,onChange:d=>s(d.target.value),className:"pl-8"})]}),l.length>0&&e.jsx(Fe,{options:l.map(d=>({value:d,label:d})),selected:r,onChange:a,placeholder:"Filter by State",className:"w-[180px]"}),c.length>0&&e.jsx(Fe,{options:c.map(d=>({value:d,label:d})),selected:n,onChange:o,placeholder:"Filter by Zone",className:"w-[180px]"})]})}const lc=t=>{switch(t){case"ACTIVE":return"#22c55e";case"LEAVING":return"#eab308";case"PENDING":return"#3b82f6";case"JOINING":return"#a855f7";case"LEFT":return"#ef4444";default:return"#6b7280"}};function cc({instances:t}){const s=i.useMemo(()=>{const a=new Map;return t.forEach(n=>{const o=n.state||"unknown";a.set(o,(a.get(o)||0)+1)}),Array.from(a.entries()).sort((n,o)=>o[1]-n[1]).map(([n,o])=>({name:n,value:o,color:lc(n)}))},[t]),r=i.useMemo(()=>t.length,[t]);return s.length===0?null:e.jsxs("div",{className:"w-full h-[120px] relative",children:[e.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[e.jsx("div",{className:"text-xl font-bold",children:r}),e.jsx("div",{className:"text-xs text-muted-foreground",children:"Instances"})]}),e.jsx(ct,{width:"100%",height:"100%",children:e.jsxs(Dt,{children:[e.jsx(Ot,{data:s,cx:"50%",cy:"50%",labelLine:!1,outerRadius:60,innerRadius:42,dataKey:"value",paddingAngle:1,strokeWidth:1,children:s.map(a=>e.jsx($t,{fill:a.color,stroke:"hsl(var(--background))"},`cell-${a.name}`))}),e.jsx(dt,{content:({active:a,payload:n})=>{if(!a||!n||!n[0])return null;const o=n[0].payload;return e.jsxs("div",{className:"bg-background border rounded-lg shadow-lg px-3 py-2 flex items-center gap-2",children:[e.jsx("div",{className:"w-2.5 h-2.5 rounded-sm",style:{backgroundColor:o.color}}),e.jsx("span",{className:"text-sm font-medium",children:o.name}),e.jsx("span",{className:"text-sm font-semibold",children:o.value})]})}})]})})]})}function Ha({onRefresh:t,isPaused:s=!1,isLoading:r,className:a}){const[n,o]=i.useState(r);return i.useEffect(()=>{let l;return r?o(!0):l=setTimeout(()=>{o(!1)},1e3),()=>{l&&clearTimeout(l)}},[r]),e.jsxs("div",{className:`flex items-center gap-2 text-sm text-muted-foreground ${a}`,children:[e.jsx(q,{variant:"secondary",size:"sm",className:"h-6 px-2 text-xs hover:bg-muted",onClick:t,children:"Refresh now"}),s?e.jsx(Oo,{className:"h-3 w-3 text-orange-500"}):e.jsx(he,{className:`h-3 w-3 ${n?"animate-spin text-emerald-500 ":"opacity-0 transition-opacity duration-1000"} `}),e.jsx("span",{className:"transition-opacity duration-1000",children:s?"Auto-refresh paused":n?"Refreshing...":""})]})}const dc=Ee("relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),Ge=i.forwardRef(({className:t,variant:s,...r},a)=>e.jsx("div",{ref:a,role:"alert",className:v(dc({variant:s}),t),...r}));Ge.displayName="Alert";const He=i.forwardRef(({className:t,...s},r)=>e.jsx("h5",{ref:r,className:v("mb-1 font-medium leading-none tracking-tight",t),...s}));He.displayName="AlertTitle";const Ke=i.forwardRef(({className:t,...s},r)=>e.jsx("div",{ref:r,className:v("text-sm [&_p]:leading-relaxed",t),...s}));Ke.displayName="AlertDescription";function ke({children:t,className:s,spacing:r=!0,...a}){return e.jsx("div",{className:"container p-6",children:e.jsx("div",{className:v(r&&"space-y-6",s),...a,children:t})})}function Ds({error:t,ringName:s}){return t?e.jsx(ke,{children:e.jsxs(Ge,{variant:"destructive",children:[e.jsx(nt,{className:"h-4 w-4"}),e.jsx(He,{children:"Error"}),e.jsx(Ke,{children:t})]})}):s?null:e.jsx(ke,{children:e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center space-x-4",children:[e.jsx(Cr,{className:"h-6 w-6"}),e.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Rings"})]}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:wa.map(r=>e.jsx(ce,{to:`/rings/${r.id}`,children:e.jsxs(ee,{className:"hover:bg-muted/50 transition-colors cursor-pointer",children:[e.jsx(se,{children:e.jsx(ae,{children:r.title})}),e.jsx(te,{children:e.jsxs("p",{className:"text-sm text-muted-foreground",children:["View and manage ",r.title.toLowerCase()," ring members"]})})]})},r.id))})]})})}const uc=5,pc=1e6;let ss=0;function mc(){return ss=(ss+1)%Number.MAX_SAFE_INTEGER,ss.toString()}const rs=new Map,ar=t=>{if(rs.has(t))return;const s=setTimeout(()=>{rs.delete(t),Xe({type:"REMOVE_TOAST",toastId:t})},pc);rs.set(t,s)},gc=(t,s)=>{switch(s.type){case"ADD_TOAST":return{...t,toasts:[s.toast,...t.toasts].slice(0,uc)};case"UPDATE_TOAST":return{...t,toasts:t.toasts.map(r=>r.id===s.toast.id?{...r,...s.toast}:r)};case"DISMISS_TOAST":{const{toastId:r}=s;return r?ar(r):t.toasts.forEach(a=>{ar(a.id)}),{...t,toasts:t.toasts.map(a=>a.id===r||r===void 0?{...a,open:!1}:a)}}case"REMOVE_TOAST":return s.toastId===void 0?{...t,toasts:[]}:{...t,toasts:t.toasts.filter(r=>r.id!==s.toastId)}}},xt=[];let bt={toasts:[]};function Xe(t){bt=gc(bt,t),xt.forEach(s=>{s(bt)})}function fc({...t}){const s=mc(),r=n=>Xe({type:"UPDATE_TOAST",toast:{...n,id:s}}),a=()=>Xe({type:"DISMISS_TOAST",toastId:s});return Xe({type:"ADD_TOAST",toast:{...t,id:s,open:!0,onOpenChange:n=>{n||a()}}}),{id:s,dismiss:a,update:r}}function zt(){const[t,s]=i.useState(bt);return i.useEffect(()=>(xt.push(s),()=>{const r=xt.indexOf(s);r>-1&&xt.splice(r,1)}),[t]),{...t,toast:fc,dismiss:r=>Xe({type:"DISMISS_TOAST",toastId:r})}}function hc({ringName:t}){var Q;const[s,r]=i.useState(new Set),[a,n]=i.useState(!1),[o,l]=i.useState(0),[c,d]=i.useState("id"),[u,m]=i.useState("asc"),[f,y]=i.useState(""),[N,h]=i.useState([]),[p,g]=i.useState([]),[x,b]=i.useState(!1),{ring:j,error:w,isLoading:E,fetchRing:C,forgetInstances:A,uniqueStates:B,uniqueZones:z,isTokenBased:Y}=sl({ringName:t,isPaused:s.size>0}),K=i.useMemo(()=>j!=null&&j.shards?j.shards.filter(_=>s.has(_.id)):[],[j==null?void 0:j.shards,s]),M=i.useCallback(_=>{d(I=>I===_?(m(P=>P==="asc"?"desc":"asc"),_):(m("asc"),_))},[]),W=i.useCallback(_=>{r(I=>{const P=new Set(I);return P.has(_)?P.delete(_):P.add(_),P})},[]),{toast:T}=zt(),O=i.useCallback(async()=>{if(s.size!==0)try{n(!0),l(0);const{success:_,total:I}=await A(Array.from(s));_>0&&(await C(),r(new Set)),_j!=null&&j.shards?j.shards.filter(_=>{const I=_.id.toLowerCase().includes(f.toLowerCase()),P=N.length===0||N.includes(_.state),U=p.length===0||p.includes(_.zone);return I&&P&&U}).sort((_,I)=>{let P=0;switch(c){case"id":P=_.id.localeCompare(I.id);break;case"state":P=_.state.localeCompare(I.state);break;case"address":P=_.address.localeCompare(I.address);break;case"zone":P=(_.zone||"").localeCompare(I.zone||"");break;case"timestamp":P=new Date(_.timestamp).getTime()-new Date(I.timestamp).getTime();break;case"tokens":P=_.tokens.length-I.tokens.length;break;case"ownership":P=parseFloat(_.ownership)-parseFloat(I.ownership);break}return u==="asc"?P:-P}):[],[j==null?void 0:j.shards,f,N,p,c,u]);return w?e.jsx(Ds,{error:w,ringName:t}):e.jsxs("div",{className:"container space-y-6 p-6",children:[e.jsxs(ee,{children:[e.jsx(se,{children:e.jsxs("div",{className:"grid grid-cols-[1fr_auto] gap-8",children:[e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsxs(ae,{className:"text-3xl font-semibold tracking-tight",children:[((Q=wa.find(_=>_.id===t))==null?void 0:Q.title)||""," ","Ring Members"]}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"View and manage ring instances with their current status and configuration"})]}),e.jsxs("div",{className:"flex items-center justify-between min-h-[32px]",children:[e.jsx(Ha,{onRefresh:C,isPaused:s.size>0,isLoading:E}),s.size>0&&e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("span",{className:"text-sm text-muted-foreground",children:[s.size," instance",s.size!==1?"s":""," selected"]}),e.jsxs(q,{onClick:()=>b(!0),disabled:a,size:"sm",variant:"outline",className:v("border-red-200 bg-red-50 text-red-900 hover:bg-red-100 hover:text-red-900","dark:border-red-800 dark:bg-red-950 dark:text-red-200 dark:hover:bg-red-900","disabled:hover:bg-red-50 dark:disabled:hover:bg-red-950"),children:[a&&e.jsxs(e.Fragment,{children:[e.jsx(he,{className:"mr-2 h-4 w-4 animate-spin"}),o>0&&e.jsxs("span",{className:"mr-2",children:[o,"/",s.size]})]}),"Forget Selected"]})]})]})]}),e.jsx("div",{className:"flex items-center",children:e.jsx("div",{className:"w-[250px]",children:(j==null?void 0:j.shards)&&e.jsx(cc,{instances:j.shards})})})]})}),e.jsxs(te,{className:"space-y-6",children:[e.jsx(ic,{idFilter:f,onIdFilterChange:y,stateFilter:N,onStateFilterChange:h,zoneFilter:p,onZoneFilterChange:g,uniqueStates:B,uniqueZones:z}),e.jsx("div",{className:"rounded-md border bg-card",children:e.jsx(jl,{instances:V,selectedInstances:s,onSelectInstance:W,sortField:c,sortDirection:u,onSort:M,showTokens:Y})})]})]}),e.jsx(Ma,{open:x,onOpenChange:b,children:e.jsxs(_s,{children:[e.jsxs(Is,{children:[e.jsx(Ls,{children:"Confirm Forget Instances"}),e.jsx(Ps,{children:"Are you sure you want to forget the following instances? This action cannot be undone."})]}),e.jsx("div",{className:"max-h-[300px] overflow-y-auto",children:e.jsx("div",{className:"space-y-2",children:K.map(_=>e.jsxs("div",{className:"flex items-center justify-between p-2 rounded-md bg-muted",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"font-medium",children:_.id}),e.jsx("span",{className:v("inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium",Et(_.state)),children:_.state})]}),e.jsx("span",{className:"text-sm text-muted-foreground",children:_.address})]},_.id))})}),e.jsxs(Fs,{children:[e.jsx(q,{variant:"outline",onClick:()=>b(!1),disabled:a,children:"Cancel"}),e.jsx(q,{variant:"outline",onClick:O,disabled:a,className:v("border-red-200 bg-red-50 text-red-900 hover:bg-red-100 hover:text-red-900","dark:border-red-800 dark:bg-red-950 dark:text-red-200 dark:hover:bg-red-900","disabled:hover:bg-red-50 dark:disabled:hover:bg-red-950"),children:a?e.jsxs(e.Fragment,{children:[e.jsx(he,{className:"mr-2 h-4 w-4 animate-spin"}),"Forgetting..."]}):"Forget Instances"})]})]})})]})}const xc=()=>{const t=i.useRef({});return{fetchMetrics:i.useCallback(async({nodeNames:r,metrics:a})=>{if(!r.length)return{};const n={...t.current},o={};return await Promise.all(r.map(async l=>{try{const c=await fetch(`/ui/api/v1/proxy/${l}/metrics`);if(!c.ok)throw new Error(`Failed to fetch metrics: ${c.statusText}`);const d=await c.text(),u={timestamp:Date.now(),values:{}};a.forEach(f=>{const y=new RegExp(`${f}\\{[^}]*\\}\\s+([\\d.e+]+)`),N=d.match(y);N&&(u.values[f]=parseFloat(N[1]))});const m=t.current[l];if(n[l]=u,m){const f=(u.timestamp-m.timestamp)/1e3;if(f>0){const y=a.map(N=>{const h=u.values[N],p=m.values[N];if(h!==void 0&&p!==void 0){const g=(h-p)/f;return{name:N,rate:g,currentValue:h}}return{name:N,rate:0,currentValue:h??0}});o[l]=y}}}catch(c){console.error(`Error fetching metrics for node ${l}:`,c)}})),t.current=n,o},[])}},bc={0:"PartitionUnknown",1:"PartitionPending",2:"PartitionActive",3:"PartitionInactive",4:"PartitionDeleted"};function yc({isPaused:t=!1}={}){const{cluster:s,isLoading:r}=ue(),[a,n]=i.useState({partitions:[],error:"",isLoading:!1}),o=i.useRef(),l=i.useCallback(()=>ja(s==null?void 0:s.members,J.PARTITION_INGESTER),[s]),{fetchMetrics:c}=xc(),d=i.useCallback(async()=>{if(!l()){n(f=>({...f,partitions:[],error:"No cluster members available",isLoading:!1}));return}o.current&&o.current.abort(),o.current=new AbortController;try{n(g=>({...g,isLoading:!0,error:""}));const f=await fetch(l(),{signal:o.current.signal,headers:{Accept:"application/json"}});if(!f.ok)throw new Error(`Failed to fetch partitions: ${f.statusText}`);const N=(await f.json()).partitions.flatMap(g=>g.owner_ids.map(x=>({...g,owner_id:x,owner_ids:[x],zone:Es(x)}))),h=Array.from(new Set(N.map(g=>g.owner_ids).flat().filter(g=>g!==void 0))),p=await c({nodeNames:h,metrics:["loki_ingest_storage_reader_fetch_bytes_total","loki_ingest_storage_reader_fetch_compressed_bytes_total"]});n(g=>({...g,isLoading:!1,partitions:N.map(x=>{var j,w;if(!x.owner_id)return x;const b=p[x.owner_id]||[];return{...x,uncompressedRate:((j=b.find(E=>E.name==="loki_ingest_storage_reader_fetch_bytes_total"))==null?void 0:j.rate)||0,compressedRate:((w=b.find(E=>E.name==="loki_ingest_storage_reader_fetch_compressed_bytes_total"))==null?void 0:w.rate)||0}})}))}catch(f){f instanceof Error&&f.name!=="AbortError"&&n(y=>({...y,error:f instanceof Error?f.message:"Unknown error occurred",isLoading:!1}))}},[l,c]),u=i.useCallback(async(f,y)=>{if(!l())throw new Error("No cluster members available");const N=Array.from(new Set(f)),h=N.length;let p=0;return await Promise.allSettled(N.map(async g=>{const x=new FormData;x.append("action","change_state"),x.append("partition_id",g.toString());const b=bc[y];if(b===void 0)throw new Error(`Invalid partition state: ${y}`);x.append("partition_state",b.toString());const j=await fetch(l(),{method:"POST",body:x});if(!j.ok){const w=await j.text();throw new Error(`Failed to change state for partition ${g}: ${w}`)}return p++,g})),{success:p,total:h}},[l]),m=i.useMemo(()=>{const f=new Set,y=new Set,N={};return a.partitions.forEach(h=>{const p=h.state.toString();N[p]=(N[p]||0)+1,f.add(p),h.owner_ids.forEach(g=>{const x=g.split("-")[2];x&&y.add(x)})}),{partitionsByState:N,uniqueStates:Array.from(f).sort(),uniqueZones:Array.from(y).sort()}},[a.partitions]);return i.useEffect(()=>()=>{o.current&&o.current.abort()},[]),i.useEffect(()=>{if(d(),!t){const f=setInterval(d,5e3);return()=>clearInterval(f)}},[d,t]),{partitions:a.partitions,error:a.error,isLoading:a.isLoading||r,fetchPartitions:d,changePartitionState:u,...m}}function vc(t,s){return t===void 0||s===void 0||Math.abs((t-s)/s)<.1?null:t>s?"up":"down"}function jc({trend:t}){return t?t==="up"?e.jsx($o,{className:"inline h-4 w-4 text-green-500 ml-1"}):e.jsx(Mo,{className:"inline h-4 w-4 text-red-500 ml-1"}):null}function nr({currentRate:t,label:s,className:r}){const a=i.useRef(t),n=i.useMemo(()=>vc(t,a.current),[t]);return i.useEffect(()=>{const o=setTimeout(()=>{a.current=t},2e3);return()=>clearTimeout(o)},[t]),e.jsxs("span",{className:r,children:[Xi(t),"/s",s&&` ${s}`,e.jsx(jc,{trend:n})]})}function wc({allPartitions:t,selectedIds:s,onChange:r}){const a=i.useMemo(()=>Array.from(new Set(t.map(l=>l.id))),[t]),n=a.every(l=>s.has(l)),o=()=>{r(n?new Set:new Set(a))};return e.jsx(Le,{checked:a.length>0&&n,onCheckedChange:o,"aria-label":"Select all partitions"})}function Nc(t){switch(t){case 2:return"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200";case 1:return"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200";case 3:return"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200";case 4:return"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200";default:return"bg-gray-100 text-gray-800 dark:bg-gray-900 dark:text-gray-200"}}const kc=[{value:1,label:"Pending"},{value:2,label:"Active"},{value:3,label:"Inactive"},{value:4,label:"Deleted"}];function Sc({partitions:t,selectedPartitions:s,onSelectPartition:r,sortField:a,sortDirection:n,onSort:o}){const l=i.useMemo(()=>[...t].sort((c,d)=>{var m;let u=0;switch(a){case"uncompressed_rate":{u=(c.uncompressedRate||0)-(d.uncompressedRate||0);break}case"compressed_rate":{u=(c.compressedRate||0)-(d.compressedRate||0);break}case"id":u=c.id-d.id;break;case"state":u=c.state-d.state;break;case"owner":u=((m=c.owner_id)==null?void 0:m.localeCompare(d.owner_id||""))||0;break;case"zone":u=(c.zone||"").localeCompare(d.zone||"");break;case"timestamp":u=new Date(c.state_timestamp).getTime()-new Date(d.state_timestamp).getTime();break}return n==="asc"?u:-u}),[t,a,n]);return e.jsx(e.Fragment,{children:e.jsxs(Ce,{children:[e.jsx(Te,{children:e.jsxs(X,{className:"hover:bg-transparent",children:[e.jsx(D,{className:"w-[50px]",children:e.jsx(wc,{allPartitions:t,selectedIds:s,onChange:c=>{new Set(t.map(u=>u.id)).forEach(u=>{c.has(u)!==s.has(u)&&r(u)})}})}),e.jsx(D,{className:"w-[200px]",children:e.jsx(Z,{title:"Owner",field:"owner",sortField:a,sortDirection:n,onSort:o})}),e.jsx(D,{className:"w-[150px]",children:e.jsx(Z,{title:"Zone",field:"zone",sortField:a,sortDirection:n,onSort:o})}),e.jsx(D,{className:"w-[100px]",children:e.jsx(Z,{title:"Partition ID",field:"id",sortField:a,sortDirection:n,onSort:o})}),e.jsx(D,{className:"w-[150px]",children:e.jsx(Z,{title:"State",field:"state",sortField:a,sortDirection:n,onSort:o})}),e.jsx(D,{className:"w-[200px]",children:e.jsx(Z,{title:"Last Update",field:"timestamp",sortField:a,sortDirection:n,onSort:o})}),e.jsx(D,{className:"w-[150px]",children:e.jsx(Z,{title:"Uncompressed Rate",field:"uncompressed_rate",sortField:a,sortDirection:n,onSort:o})}),e.jsx(D,{className:"w-[150px]",children:e.jsx(Z,{title:"Compressed Rate",field:"compressed_rate",sortField:a,sortDirection:n,onSort:o})}),e.jsx(D,{className:"w-[100px]"})]})}),e.jsxs(Re,{children:[l.map(c=>{var d;return e.jsxs(X,{children:[e.jsx(F,{children:e.jsx(Le,{checked:s.has(c.id),onCheckedChange:()=>r(c.id),"aria-label":`Select partition ${c.id}`})}),e.jsx(F,{className:"font-medium",children:e.jsx(ce,{to:`/nodes/${c.owner_id}`,className:"hover:underline",children:c.owner_id})}),e.jsx(F,{children:e.jsx("span",{className:v("inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium",ba(c.zone||"")),children:c.zone||"-"})}),e.jsx(F,{children:e.jsx("span",{className:v("inline-flex items-center px-2 py-0.5 rounded-md text-xs font-medium",c.corrupted?"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200":"bg-muted"),title:c.corrupted?"Corrupted":void 0,children:c.id})}),e.jsx(F,{children:e.jsx("span",{className:v("inline-flex items-center px-2 py-0.5 rounded-md text-xs font-medium",Nc(c.state)),children:((d=kc.find(u=>u.value===c.state))==null?void 0:d.label)||"Unknown"})}),e.jsx(F,{children:e.jsx("span",{title:xa(c.state_timestamp),className:"text-muted-foreground",children:ha(c.state_timestamp)})}),e.jsx(F,{children:e.jsx(nr,{currentRate:c.uncompressedRate||0,className:"text-muted-foreground inline-flex items-center"})}),e.jsx(F,{children:e.jsx(nr,{currentRate:c.compressedRate||0,className:"text-muted-foreground inline-flex items-center"})}),e.jsx(F,{children:e.jsx("div",{className:"flex items-center gap-2",children:e.jsx(ce,{to:`/nodes/${c.owner_id}`,className:"hover:underline",children:e.jsx(q,{variant:"ghost",size:"icon",className:"h-8 w-8",title:"View instance details",children:e.jsx(Ft,{className:"h-4 w-4"})})})})})]},`${c.owner_id}-${c.id}`)}),l.length===0&&e.jsx(X,{children:e.jsx(F,{colSpan:7,className:"h-24 text-center",children:e.jsx("div",{className:"text-muted-foreground",children:"No partitions found"})})})]})]})})}const Tt=li,Rt=ci,et=i.forwardRef(({className:t,children:s,...r},a)=>e.jsxs(Fr,{ref:a,className:v("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",t),...r,children:[s,e.jsx(ri,{asChild:!0,children:e.jsx(ot,{className:"h-4 w-4 opacity-50"})})]}));et.displayName=Fr.displayName;const Ka=i.forwardRef(({className:t,...s},r)=>e.jsx(Lr,{ref:r,className:v("flex cursor-default items-center justify-center py-1",t),...s,children:e.jsx(Tr,{className:"h-4 w-4"})}));Ka.displayName=Lr.displayName;const Wa=i.forwardRef(({className:t,...s},r)=>e.jsx(Pr,{ref:r,className:v("flex cursor-default items-center justify-center py-1",t),...s,children:e.jsx(ot,{className:"h-4 w-4"})}));Wa.displayName=Pr.displayName;const tt=i.forwardRef(({className:t,children:s,position:r="popper",...a},n)=>e.jsx(ai,{children:e.jsxs(Dr,{ref:n,className:v("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:r,...a,children:[e.jsx(Ka,{}),e.jsx(ni,{className:v("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:s}),e.jsx(Wa,{})]})}));tt.displayName=Dr.displayName;const Ec=i.forwardRef(({className:t,...s},r)=>e.jsx(Or,{ref:r,className:v("px-2 py-1.5 text-sm font-semibold",t),...s}));Ec.displayName=Or.displayName;const ze=i.forwardRef(({className:t,children:s,...r},a)=>e.jsxs($r,{ref:a,className:v("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...r,children:[e.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(oi,{children:e.jsx(qe,{className:"h-4 w-4"})})}),e.jsx(ii,{children:s})]}));ze.displayName=$r.displayName;const Cc=i.forwardRef(({className:t,...s},r)=>e.jsx(Mr,{ref:r,className:v("-mx-1 my-1 h-px bg-muted",t),...s}));Cc.displayName=Mr.displayName;const Tc=t=>{switch(t){case 2:return"#22c55e";case 1:return"#3b82f6";case 3:return"#eab308";case 4:return"#ef4444";default:return"#6b7280"}};function Rc({partitions:t}){const s=i.useMemo(()=>{const a=new Map;return t.forEach(n=>{const o=n.state;a.set(o,(a.get(o)||0)+1)}),Array.from(a.entries()).sort((n,o)=>o[1]-n[1]).map(([n,o])=>({name:ga[n],value:o,color:Tc(n)}))},[t]),r=i.useMemo(()=>t.length,[t]);return s.length===0?null:e.jsxs("div",{className:"w-full h-[120px] relative",children:[e.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[e.jsx("div",{className:"text-xl font-bold",children:r}),e.jsx("div",{className:"text-xs text-muted-foreground",children:"Partitions"})]}),e.jsx(ct,{width:"100%",height:"100%",children:e.jsxs(Dt,{children:[e.jsx(Ot,{data:s,cx:"50%",cy:"50%",labelLine:!1,outerRadius:60,innerRadius:42,dataKey:"value",paddingAngle:1,strokeWidth:1,children:s.map(a=>e.jsx($t,{fill:a.color,stroke:"hsl(var(--background))"},`cell-${a.name}`))}),e.jsx(dt,{content:({active:a,payload:n})=>{if(!a||!n||!n[0])return null;const o=n[0].payload;return e.jsxs("div",{className:"bg-background border rounded-lg shadow-lg px-3 py-2 flex items-center gap-2",children:[e.jsx("div",{className:"w-2.5 h-2.5 rounded-sm",style:{backgroundColor:o.color}}),e.jsx("span",{className:"text-sm font-medium",children:o.name}),e.jsx("span",{className:"text-sm font-semibold",children:o.value})]})}})]})})]})}function Ac({idFilter:t,onIdFilterChange:s,stateFilter:r,onStateFilterChange:a,zoneFilter:n,onZoneFilterChange:o,ownerFilter:l,onOwnerFilterChange:c,uniqueStates:d,partitions:u}){const m=d.map(p=>({value:p,label:ga[parseInt(p)]})),f=new Set;u.forEach(p=>{p.owner_ids.forEach(g=>{const x=Es(g);x&&f.add(x)})});const y=Array.from(f).sort().map(p=>({value:p,label:p})),h=Array.from(new Set(u.map(p=>p.id.toString()))).sort((p,g)=>parseInt(p)-parseInt(g)).map(p=>({value:p,label:`Partition ${p}`}));return e.jsxs("div",{className:"flex flex-wrap gap-4",children:[e.jsx("div",{className:"flex-1 min-w-[200px]",children:e.jsx(xe,{placeholder:"Filter by owner name...",value:l,onChange:p=>c(p.target.value),className:"max-w-sm"})}),e.jsx(Fe,{options:m,selected:r,onChange:a,placeholder:"Filter by state",className:"w-[200px]"}),e.jsx(Fe,{options:y,selected:n,onChange:o,placeholder:"Filter by zone",className:"w-[200px]"}),e.jsx(Fe,{options:h,selected:t,onChange:s,placeholder:"Filter by partition ID",className:"w-[200px]"})]})}const ft=[{value:1,label:"Pending"},{value:2,label:"Active"},{value:3,label:"Inactive"},{value:4,label:"Deleted"}];function _c(){const[t,s]=i.useState(new Set),[r,a]=i.useState("id"),[n,o]=i.useState("asc"),[l,c]=i.useState([]),[d,u]=i.useState([]),[m,f]=i.useState([]),[y,N]=i.useState(""),[h,p]=i.useState(!1),[g,x]=i.useState(),[b,j]=i.useState(!1),{toast:w}=zt(),{partitions:E,error:C,isLoading:A,fetchPartitions:B,changePartitionState:z,uniqueStates:Y,uniqueZones:K}=yc({isPaused:t.size>0}),M=i.useMemo(()=>E.flatMap(I=>I.owner_ids.map(P=>({...I,owner_id:P,owner_ids:[P],zone:Es(P)}))),[E]),W=i.useCallback(I=>{a(P=>P===I?(o(U=>U==="asc"?"desc":"asc"),I):(o("asc"),I))},[]),T=i.useCallback(I=>{s(P=>{const U=new Set(P);return U.has(I)?U.delete(I):U.add(I),U})},[]),O=i.useMemo(()=>M.filter(I=>{const P=l.length===0||l.includes(I.id.toString()),U=d.length===0||d.includes(I.state.toString()),S=m.length===0||m.includes(I.zone),R=y?I.owner_id.toLowerCase().includes(y.toLowerCase()):!0;return P&&U&&S&&R}),[M,l,d,m,y]),V=i.useMemo(()=>M.filter(I=>t.has(I.id)),[M,t]),Q=i.useCallback(async()=>{var I;if(!(t.size===0||!g))try{p(!0);const P=parseInt(g,10),{success:U,total:S}=await z(V.map(R=>R.id),g);U>0&&S===U?(w({title:"State Change Success",description:`Successfully changed state for ${U} partition${U!==1?"s":""} to ${(I=ft.find(R=>R.value===P))==null?void 0:I.label}`}),await B()):U0,isLoading:A}),t.size>0&&e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("span",{className:"text-sm text-muted-foreground",children:[t.size," partition",t.size!==1?"s":""," selected"]}),e.jsxs(Tt,{value:g,onValueChange:x,children:[e.jsx(et,{className:"w-[160px]",children:e.jsx(Rt,{placeholder:"Select new state"})}),e.jsx(tt,{children:ft.map(I=>e.jsx(ze,{value:I.value.toString(),children:I.label},I.value))})]}),e.jsxs(q,{onClick:()=>j(!0),disabled:h||!g,size:"sm",variant:"outline",children:[h&&e.jsx(he,{className:"mr-2 h-4 w-4 animate-spin"}),"Change State"]})]})]})]}),e.jsx("div",{className:"flex items-center",children:e.jsx("div",{className:"w-[250px]",children:e.jsx(Rc,{partitions:E})})})]})}),e.jsxs(te,{className:"space-y-6",children:[e.jsx(Ac,{idFilter:l,onIdFilterChange:c,stateFilter:d,onStateFilterChange:u,zoneFilter:m,onZoneFilterChange:f,ownerFilter:y,onOwnerFilterChange:N,uniqueStates:Y,uniqueZones:K,partitions:E}),e.jsx("div",{className:"rounded-md border bg-card",children:e.jsx(Sc,{..._})})]})]}),e.jsx(Ma,{open:b,onOpenChange:j,children:e.jsxs(_s,{children:[e.jsxs(Is,{children:[e.jsx(Ls,{children:"Confirm State Change"}),e.jsx(Ps,{children:"Are you sure you want to change the state of these partitions?"})]}),e.jsx("div",{className:"max-h-[300px] overflow-y-auto",children:e.jsx("div",{className:"space-y-2",children:Array.from(new Set(V.map(I=>I.id))).map(I=>{var U,S;const P=E.find(R=>R.id===I);return P?e.jsx("div",{className:"flex items-center justify-between p-2 rounded-md bg-muted",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:"font-medium",children:["Partition ",I]}),e.jsx("span",{className:v("inline-flex items-center px-2 py-0.5 rounded-md text-xs font-medium",Et(P.state)),children:(U=ft.find(R=>R.value===P.state))==null?void 0:U.label}),e.jsx(Ft,{className:"h-4 w-4 text-muted-foreground"}),e.jsx("span",{className:v("inline-flex items-center px-2 py-0.5 rounded-md text-xs font-medium",Et(parseInt(g||"0",10))),children:(S=ft.find(R=>R.value===parseInt(g,10)))==null?void 0:S.label})]})},I):null})})}),e.jsxs(Fs,{children:[e.jsx(q,{variant:"outline",onClick:()=>j(!1),disabled:h,children:"Cancel"}),e.jsx(q,{onClick:Q,disabled:h,children:h?"Changing States...":"Confirm Changes"})]})]})})]})}function or(){const{ringName:t}=Nr(),s=Object.values(J).includes(t);return!t||!s?e.jsx(Ds,{}):t===J.PARTITION_INGESTER?e.jsx(_c,{}):e.jsx(hc,{ringName:t})}const pt=i.forwardRef(({className:t,children:s,...r},a)=>e.jsxs(Jr,{ref:a,className:v("relative overflow-hidden",t),...r,children:[e.jsx(gi,{className:"h-full w-full rounded-[inherit]",children:s}),e.jsx(Za,{}),e.jsx(fi,{})]}));pt.displayName=Jr.displayName;const Za=i.forwardRef(({className:t,orientation:s="vertical",...r},a)=>e.jsx(ea,{ref:a,orientation:s,className:v("flex touch-none select-none transition-colors",s==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",s==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",t),...r,children:e.jsx(hi,{className:"relative flex-1 rounded-full bg-border"})}));Za.displayName=ea.displayName;const Vt=yi,Ut=vi,mt=i.forwardRef(({className:t,align:s="center",sideOffset:r=4,...a},n)=>e.jsx(na,{ref:n,align:s,sideOffset:r,className:v("z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...a}));mt.displayName=na.displayName;const Os=({date:t,className:s=""})=>{const r=_r(t,{addSuffix:!0}),a=wt(t,"yyyy-MM-dd HH:mm:ss"),n=wt(new Date(t.getTime()+t.getTimezoneOffset()*6e4),"yyyy-MM-dd HH:mm:ss");return e.jsxs(Vt,{children:[e.jsx(Ut,{children:e.jsx("div",{className:`inline-block ${s}`,children:r})}),e.jsx(mt,{className:"w-[280px]",children:e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"px-2 py-0.5 text-xs font-medium bg-gray-100 rounded dark:bg-gray-700 w-14 text-center",children:"UTC"}),e.jsx("span",{className:"font-mono",children:n})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"px-2 py-0.5 text-xs font-medium bg-gray-100 rounded dark:bg-gray-700 w-14 text-center",children:"Local"}),e.jsx("span",{className:"font-mono",children:a})]})]})})]})};function Ic({current:t,parent:s,files:r,folders:a}){const n=It(),[,o]=at(),l=d=>{o({path:d})},c=d=>{n(`/storage/dataobj/metadata?path=${encodeURIComponent(t+"/"+d.name)}`)};return e.jsx("div",{className:"space-y-4",children:e.jsxs(Ce,{children:[e.jsx(Te,{children:e.jsxs(X,{className:"h-12",children:[e.jsx(D,{children:"Name"}),e.jsx(D,{children:"Modified"}),e.jsx(D,{children:"Size"}),e.jsx(D,{})]})}),e.jsxs(Re,{children:[s!==t&&e.jsxs(X,{className:"h-12 cursor-pointer hover:bg-muted/50",onClick:()=>l(s||""),children:[e.jsx(F,{className:"font-medium",children:e.jsxs("div",{className:"flex items-center",children:[e.jsx("svg",{className:"w-5 h-5 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M15 19l-7-7 7-7"})}),".."]})}),e.jsx(F,{children:"-"}),e.jsx(F,{children:"-"}),e.jsx(F,{})]},"parent"),a.map(d=>e.jsxs(X,{className:"h-12 cursor-pointer hover:bg-muted/50",onClick:()=>l(t?`${t}/${d}`:d),children:[e.jsx(F,{className:"font-medium",children:e.jsxs("div",{className:"flex items-center",children:[e.jsx(Bo,{className:"mr-2 h-4 w-4"}),d]})}),e.jsx(F,{children:"-"}),e.jsx(F,{children:"-"}),e.jsx(F,{})]},d)),r.map(d=>e.jsxs(X,{className:"h-12 cursor-pointer hover:bg-muted/50",onClick:u=>{u.target.closest("a[download]")||c(d)},children:[e.jsx(F,{className:"font-medium",children:e.jsxs("div",{className:"flex items-center",children:[e.jsx(zo,{className:"mr-2 h-4 w-4"}),d.name]})}),e.jsx(F,{children:e.jsx(Os,{date:new Date(d.lastModified)})}),e.jsx(F,{children:me(d.size)}),e.jsx(F,{children:e.jsx(q,{variant:"outline",size:"icon",asChild:!0,className:"h-8 w-8",children:e.jsx(ce,{to:d.downloadUrl,target:"_blank",download:!0,onClick:u=>u.stopPropagation(),children:e.jsx(Rr,{className:"h-4 w-4"})})})})]},d.name))]})]})})}function Fc(t){const{cluster:s}=ue(),r=i.useMemo(()=>Oe(s==null?void 0:s.members,"dataobj-explorer"),[s==null?void 0:s.members]);return Mt({queryKey:["explorer",t,r],queryFn:async()=>{if(!r)throw new Error("Node name not found");const a=await fetch(`/ui/api/v1/proxy/${r}/dataobj/api/v1/list?path=${encodeURIComponent(t)}`);if(!a.ok)throw new Error("Failed to fetch explorer data");const n=await a.json();return{...n,files:Lc(n.files).map(o=>({...o,downloadUrl:`/api/v1/proxy/${r}/dataobj/api/v1/download?file=${encodeURIComponent(t?`${t}/${o.name}`:o.name)}`}))}}})}const Lc=t=>[...t].sort((s,r)=>new Date(r.lastModified).getTime()-new Date(s.lastModified).getTime()),Pc=t=>{switch(t){case"S3":return{bg:"bg-orange-100",text:"text-orange-800",darkBg:"dark:bg-orange-900",darkText:"dark:text-orange-300"};case"GCS":return{bg:"bg-blue-100",text:"text-blue-800",darkBg:"dark:bg-blue-900",darkText:"dark:text-blue-300"};case"AZURE":return{bg:"bg-sky-100",text:"text-sky-800",darkBg:"dark:bg-sky-900",darkText:"dark:text-sky-300"};case"SWIFT":return{bg:"bg-red-100",text:"text-red-800",darkBg:"dark:bg-red-900",darkText:"dark:text-red-300"};case"COS":return{bg:"bg-purple-100",text:"text-purple-800",darkBg:"dark:bg-purple-900",darkText:"dark:text-purple-300"};case"ALIYUNOSS":return{bg:"bg-rose-100",text:"text-rose-800",darkBg:"dark:bg-rose-900",darkText:"dark:text-rose-300"};case"OCI":return{bg:"bg-red-100",text:"text-red-800",darkBg:"dark:bg-red-900",darkText:"dark:text-red-300"};case"OBS":return{bg:"bg-cyan-100",text:"text-cyan-800",darkBg:"dark:bg-cyan-900",darkText:"dark:text-cyan-300"};case"FILESYSTEM":return{bg:"bg-green-100",text:"text-green-800",darkBg:"dark:bg-green-900",darkText:"dark:text-green-300"};case"MEMORY":return{bg:"bg-yellow-100",text:"text-yellow-800",darkBg:"dark:bg-yellow-900",darkText:"dark:text-yellow-300"};default:return{bg:"bg-gray-100",text:"text-gray-800",darkBg:"dark:bg-gray-700",darkText:"dark:text-gray-300"}}};function Ya(){const[t,s]=Be.useState(""),{cluster:r}=ue(),a=i.useMemo(()=>Oe(r==null?void 0:r.members,"dataobj-explorer"),[r==null?void 0:r.members]);Be.useEffect(()=>{a&&fetch(`/ui/api/v1/proxy/${a}/dataobj/api/v1/provider`).then(d=>d.json()).then(d=>s(d.provider)).catch(console.error)},[a]);const[n]=at(),l=(n.get("path")||"").split("/").filter(Boolean),c=Pc(t);return e.jsx(ks,{children:e.jsxs(Ss,{children:[e.jsx(Nt,{children:e.jsx(kt,{asChild:!0,children:e.jsxs(ce,{to:"/storage/dataobj",className:`inline-flex items-center h-7 gap-2 px-3 py-1 text-xs font-medium ${c.bg} ${c.text} ${c.darkBg} ${c.darkText} rounded-full hover:ring-1 hover:ring-gray-300 dark:hover:ring-gray-600 transition-all duration-200`,children:[e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 576 512",className:"w-4 h-4",fill:"currentColor",children:e.jsx("path",{d:"M575.8 255.5c0 18-15 32.1-32 32.1h-32l.7 160.2c0 2.7-.2 5.4-.5 8.1V472c0 22.1-17.9 40-40 40H456c-1.1 0-2.2 0-3.3-.1c-1.4 .1-2.8 .1-4.2 .1H416 392c-22.1 0-40-17.9-40-40V448 384c0-17.7-14.3-32-32-32H256c-17.7 0-32 14.3-32 32v64 24c0 22.1-17.9 40-40 40H160 128.1c-1.5 0-3-.1-4.5-.2c-1.2 .1-2.4 .2-3.6 .2H104c-22.1 0-40-17.9-40-40V360c0-.9 0-1.9 .1-2.8V287.6H32c-18 0-32-14-32-32.1c0-9 3-17 10-24L266.4 8c7-7 15-8 22-8s15 2 21 7L564.8 231.5c8 7 12 15 11 24z"})}),t||""]})})}),l.length>0&&e.jsx(St,{}),l.map((d,u)=>{const m=l.slice(0,u+1).join("/"),f=u===l.length-1;return e.jsxs(Be.Fragment,{children:[e.jsx(Nt,{children:e.jsx(kt,{asChild:!0,children:f?e.jsx("span",{className:"text-gray-500",children:d}):e.jsx(ce,{to:`/storage/dataobj?path=${encodeURIComponent(m)}`,children:d})})}),u{navigator.clipboard.writeText(t).then(()=>{n(!0),r==null||r(),setTimeout(()=>n(!1),2e3)})};return e.jsx(q,{variant:"ghost",size:"sm",onClick:o,className:v("h-8 px-2",s),children:a?e.jsxs(e.Fragment,{children:[e.jsx(qe,{className:"h-4 w-4 mr-1"}),"Copied"]}):e.jsxs(e.Fragment,{children:[e.jsx(Ar,{className:"h-4 w-4 mr-1"}),"Copy"]})})}const qt=({compressed:t,uncompressed:s,showVisualization:r=!1})=>{if(t===0||s===0)return e.jsx("span",{className:"dark:text-gray-200",children:"-"});const a=s/t,n=a>1;return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("div",{className:"font-medium whitespace-nowrap dark:text-gray-200",children:[a.toFixed(1),"x"]}),r&&n&&e.jsx("div",{className:"flex-1 h-2.5 bg-gray-100 dark:bg-gray-600 border border-gray-200 dark:border-gray-500 rounded relative",children:e.jsx("div",{className:"absolute inset-y-0 left-0 bg-blue-600 dark:bg-blue-500 rounded",style:{width:`${t/s*100}%`}})})]})},$c=t=>{switch(t){case"INT64":return"bg-blue-500/20 text-blue-700 dark:bg-blue-500/30 dark:text-blue-300 hover:bg-blue-500/30";case"BYTES":return"bg-red-500/20 text-red-700 dark:bg-red-500/30 dark:text-red-300 hover:bg-red-500/30";case"FLOAT64":return"bg-purple-500/20 text-purple-700 dark:bg-purple-500/30 dark:text-purple-300 hover:bg-purple-500/30";case"BOOL":return"bg-yellow-500/20 text-yellow-700 dark:bg-yellow-500/30 dark:text-yellow-300 hover:bg-yellow-500/30";case"STRING":return"bg-green-500/20 text-green-700 dark:bg-green-500/30 dark:text-green-300 hover:bg-green-500/30";case"TIMESTAMP":return"bg-orange-500/20 text-orange-700 dark:bg-orange-500/30 dark:text-orange-300 hover:bg-orange-500/30";default:return"bg-gray-500/20 text-gray-700 dark:bg-gray-500/30 dark:text-gray-300 hover:bg-gray-500/30"}};function Mc({metadata:t,filename:s,downloadUrl:r}){const[a,n]=i.useState(null),[o,l]=i.useState({}),c=p=>{n(a===p?null:p)},d=(p,g)=>{const x=`${p}-${g}`;l(b=>({...b,[x]:!b[x]}))},u=t.sections.reduce((p,g)=>p+g.totalCompressedSize,0),m=t.sections.reduce((p,g)=>p+g.totalUncompressedSize,0),f=t.sections.filter(p=>p.type==="SECTION_TYPE_STREAMS"),y=t.sections.filter(p=>p.type==="SECTION_TYPE_LOGS"),N=f==null?void 0:f.reduce((p,g)=>p+(g.columns[0].rows_count||0),0),h=y==null?void 0:y.reduce((p,g)=>p+(g.columns[0].rows_count||0),0);return e.jsxs(ee,{className:"w-full",children:[e.jsx(Bc,{filename:s,downloadUrl:r,lastModified:t.lastModified}),e.jsxs(te,{className:"space-y-8",children:[e.jsx(zc,{totalCompressed:u,totalUncompressed:m,sections:t.sections,streamCount:N,logCount:h}),e.jsx(Vc,{sections:t.sections,expandedSectionIndex:a,expandedColumns:o,onToggleSection:c,onToggleColumn:d})]})]})}function Bc({filename:t,downloadUrl:s,lastModified:r}){return e.jsxs(se,{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(ae,{className:"text-2xl font-semibold tracking-tight",children:"Thor Dataobj File"}),e.jsx(q,{asChild:!0,variant:"outline",children:e.jsxs(ce,{to:s,target:"_blank",download:!0,children:[e.jsx(Rr,{className:"h-4 w-4 mr-2"}),"Download"]})})]}),e.jsx(Qe,{className:"space-y-2",children:e.jsx("div",{className:"flex items-center justify-between",children:e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"font-mono text-sm text-foreground",children:t}),e.jsx($s,{text:t})]}),e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx("span",{children:"Last Modified:"}),e.jsx(Os,{date:new Date(r)})]})]})})})]})}function zc({totalCompressed:t,totalUncompressed:s,sections:r,streamCount:a,logCount:n}){return e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6",children:[e.jsxs("div",{className:"rounded-lg bg-muted/50 p-6 shadow-sm",children:[e.jsx("div",{className:"text-sm text-muted-foreground mb-2",children:"Compression"}),e.jsx(qt,{compressed:t,uncompressed:s,showVisualization:!0}),e.jsxs("div",{className:"text-xs text-muted-foreground mt-2",children:[me(t)," → ",me(s)]})]}),e.jsxs("div",{className:"rounded-lg bg-muted/50 p-6 shadow-sm",children:[e.jsx("div",{className:"text-sm text-muted-foreground mb-2",children:"Sections"}),e.jsx("div",{className:"font-medium text-lg",children:r.length}),e.jsx("div",{className:"text-xs text-muted-foreground mt-2",children:r.map(o=>o.type).join(", ")})]}),a&&e.jsxs("div",{className:"rounded-lg bg-muted/50 p-6 shadow-sm",children:[e.jsx("div",{className:"text-sm text-muted-foreground mb-2",children:"Stream Count"}),e.jsx("div",{className:"font-medium text-lg",children:a.toLocaleString()})]}),n&&e.jsxs("div",{className:"rounded-lg bg-muted/50 p-6 shadow-sm",children:[e.jsx("div",{className:"text-sm text-muted-foreground mb-2",children:"Log Count"}),e.jsx("div",{className:"font-medium text-lg",children:n.toLocaleString()})]})]})}function Vc({sections:t,expandedSectionIndex:s,expandedColumns:r,onToggleSection:a,onToggleColumn:n}){return e.jsx("div",{className:"divide-y divide-border",children:t.map((o,l)=>e.jsx(Uc,{section:o,sectionIndex:l,isExpanded:s===l,expandedColumns:r,onToggle:()=>a(l),onToggleColumn:c=>n(l,c)},l))})}function Uc({section:t,sectionIndex:s,isExpanded:r,expandedColumns:a,onToggle:n,onToggleColumn:o}){return e.jsxs("div",{className:"py-4",children:[e.jsxs("button",{className:"w-full flex justify-between items-center py-4 px-6 rounded-lg hover:bg-accent/50 transition-colors",onClick:n,children:[e.jsxs("h3",{className:"text-lg font-semibold",children:["Section #",s+1,": ",t.type]}),e.jsx("svg",{className:`w-5 h-5 transform transition-transform duration-300 ${r?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M19 9l-7 7-7-7"})})]}),r&&e.jsxs("div",{className:"mt-6 px-6",children:[e.jsx(qc,{section:t}),e.jsx(Gc,{columns:t.columns,sectionIndex:s,expandedColumns:a,onToggleColumn:o})]})]})}function qc({section:t}){return e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6 mb-8",children:[e.jsxs("div",{className:"rounded-lg bg-secondary/50 p-6 shadow-sm",children:[e.jsx("div",{className:"text-sm text-muted-foreground mb-2",children:"Compression"}),e.jsx(qt,{compressed:t.totalCompressedSize,uncompressed:t.totalUncompressedSize,showVisualization:!0}),e.jsxs("div",{className:"text-xs text-muted-foreground mt-2",children:[me(t.totalCompressedSize)," →"," ",me(t.totalUncompressedSize)]})]}),e.jsxs("div",{className:"rounded-lg bg-secondary/50 p-6 shadow-sm",children:[e.jsx("div",{className:"text-sm text-muted-foreground mb-2",children:"Column Count"}),e.jsx("div",{className:"font-medium text-lg",children:t.columnCount})]}),e.jsxs("div",{className:"rounded-lg bg-secondary/50 p-6 shadow-sm",children:[e.jsx("div",{className:"text-sm text-muted-foreground mb-2",children:"Type"}),e.jsx("div",{className:"font-medium text-lg flex items-center gap-2",children:e.jsx(be,{variant:"outline",className:"font-mono",children:t.type})})]})]})}function Gc({columns:t,sectionIndex:s,expandedColumns:r,onToggleColumn:a}){return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("h4",{className:"text-lg font-medium",children:["Columns (",t.length,")"]}),e.jsx("div",{className:"space-y-4",children:t.map((n,o)=>e.jsx(Hc,{column:n,isExpanded:r[`${s}-${o}`],onToggle:()=>a(o)},o))})]})}function Hc({column:t,isExpanded:s,onToggle:r}){return e.jsxs(ee,{className:"bg-card/50",children:[e.jsxs("button",{className:"w-full flex justify-between items-center p-6 hover:bg-accent/50 transition-colors rounded-t-lg",onClick:r,children:[e.jsxs("div",{children:[e.jsx("h5",{className:"font-medium text-lg",children:t.name?`${t.name} (${t.type})`:t.type}),e.jsx("div",{className:"text-sm text-muted-foreground mt-1 flex items-center gap-2",children:e.jsx(be,{variant:"secondary",className:v("font-mono text-xs",$c(t.value_type)),children:t.value_type})})]}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("div",{className:"text-sm font-medium flex items-center gap-2",children:["Compression:",e.jsx(be,{variant:"outline",className:"font-mono",children:t.compression||"NONE"})]}),e.jsx("svg",{className:`w-4 h-4 transform transition-transform ${s?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M19 9l-7 7-7-7"})})]})]}),s&&e.jsxs(te,{className:"pt-6",children:[e.jsx(Kc,{column:t}),t.pages.length>0&&e.jsx(Wc,{pages:t.pages})]})]})}function Kc({column:t}){return e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-6 mb-8",children:[e.jsxs("div",{className:"rounded-lg bg-muted p-6",children:[e.jsx("div",{className:"text-sm text-muted-foreground mb-2 flex items-center gap-2",children:e.jsx(be,{variant:"outline",className:"font-mono",children:t.compression||"NONE"})}),e.jsx("div",{className:"font-medium",children:e.jsx(qt,{compressed:t.compressed_size,uncompressed:t.uncompressed_size})}),e.jsxs("div",{className:"text-xs text-muted-foreground mt-2",children:[me(t.compressed_size)," →"," ",me(t.uncompressed_size)]})]}),e.jsxs("div",{className:"rounded-lg bg-muted p-6",children:[e.jsx("div",{className:"text-sm text-muted-foreground mb-2",children:"Rows"}),e.jsx("div",{className:"font-medium text-lg",children:t.rows_count.toLocaleString()})]}),e.jsxs("div",{className:"rounded-lg bg-muted p-6",children:[e.jsx("div",{className:"text-sm text-muted-foreground mb-2",children:"Values Count"}),e.jsx("div",{className:"font-medium text-lg",children:t.values_count.toLocaleString()})]}),e.jsxs("div",{className:"rounded-lg bg-muted p-6",children:[e.jsx("div",{className:"text-sm text-muted-foreground mb-2",children:"Offset"}),e.jsx("div",{className:"font-medium text-lg",children:me(t.metadata_offset)})]})]})}function Wc({pages:t}){return e.jsxs("div",{className:"mt-8",children:[e.jsxs("h6",{className:"text-base font-medium mb-4",children:["Pages (",t.length,")"]}),e.jsx("div",{className:"rounded-lg border border-border overflow-hidden bg-background",children:e.jsxs("table",{className:"w-full",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"bg-secondary/50 border-b border-border",children:[e.jsx("th",{className:"text-left p-4 font-medium text-muted-foreground",children:"#"}),e.jsx("th",{className:"text-left p-4 font-medium text-muted-foreground",children:"Rows"}),e.jsx("th",{className:"text-left p-4 font-medium text-muted-foreground",children:"Values"}),e.jsx("th",{className:"text-left p-4 font-medium text-muted-foreground",children:"Encoding"}),e.jsx("th",{className:"text-left p-4 font-medium text-muted-foreground",children:"Compression"})]})}),e.jsx("tbody",{children:t.map((s,r)=>e.jsxs("tr",{className:"border-t border-border hover:bg-accent/50 transition-colors",children:[e.jsx("td",{className:"p-4",children:r+1}),e.jsx("td",{className:"p-4",children:s.rows_count.toLocaleString()}),e.jsx("td",{className:"p-4",children:s.values_count.toLocaleString()}),e.jsx("td",{className:"p-4",children:e.jsx(be,{variant:"outline",className:"font-mono",children:s.encoding})}),e.jsx("td",{className:"p-4",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(qt,{compressed:s.compressed_size,uncompressed:s.uncompressed_size}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",me(s.compressed_size)," →"," ",me(s.uncompressed_size),")"]})]})})]},r))})]})})]})}function Zc(t){const{cluster:s}=ue(),r=i.useMemo(()=>Oe(s==null?void 0:s.members,"dataobj-explorer"),[s==null?void 0:s.members]),a=i.useMemo(()=>`/api/v1/proxy/${r}/dataobj/api/v1/download?file=${encodeURIComponent(t||"")}`,[t,r]);return{...Mt({queryKey:["file-metadata",t,r],queryFn:async()=>{if(!t)throw new Error("No file path provided");if(!r)throw new Error("Node name not found");const o=await fetch(`/ui/api/v1/proxy/${r}/dataobj/api/v1/inspect?file=${encodeURIComponent(t)}`);if(!o.ok)throw new Error("Failed to fetch file metadata");return o.json()},enabled:!!t&&!!r}),downloadUrl:a}}function Yc(){const[t]=at(),s=t.get("path")||"",{data:r,downloadUrl:a,isLoading:n,error:o}=Zc(s);return e.jsx(ke,{children:e.jsxs("div",{className:"flex h-full flex-col space-y-6",children:[e.jsx(Ya,{}),e.jsx(pt,{className:"h-full",children:n?e.jsx("div",{className:"flex items-center justify-center p-8",children:e.jsx(he,{className:"h-16 w-16 animate-spin"})}):o?e.jsxs(Ge,{variant:"destructive",children:[e.jsx(He,{children:"Error"}),e.jsx(Ke,{children:o.message})]}):r&&s?e.jsx(Mc,{metadata:r,filename:s,downloadUrl:a}):null})]})})}const Xc=["New","Starting","Running","Stopping","Terminated","Failed"],Qc=({nameFilter:t,targetFilter:s,selectedStates:r,onNameFilterChange:a,onTargetFilterChange:n,onStatesChange:o,onRefresh:l,availableTargets:c})=>{const d=Xc.map(m=>({label:m,value:m})),u=m=>{o(m)};return e.jsxs("div",{className:"grid grid-cols-[auto_1fr_auto] gap-x-4 gap-y-2",children:[e.jsx("div",{className:"space-y-2",children:e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-sm font-medium text-muted-foreground",children:"Node filters"}),e.jsx(xe,{value:t,onChange:m=>a(m.target.value),placeholder:"Filter by node name...",className:"w-[300px]"}),e.jsx(Fe,{options:c.map(m=>({value:m,label:m})),selected:s,onChange:n,placeholder:"All Targets",className:"w-[300px]"})]})}),e.jsxs("div",{className:"space-y-1.5 self-end",children:[e.jsx("label",{className:"text-sm font-medium text-muted-foreground",children:"Service states"}),e.jsx(Fe,{options:d,selected:r,onChange:u,placeholder:"Filter nodes by service states...",className:"w-full min-w-[300px]"})]}),e.jsx("div",{className:"self-end",children:e.jsx(q,{onClick:l,size:"sm",variant:"outline",className:"h-9 w-9",children:e.jsx(Vo,{className:"h-4 w-4"})})})]})},Jc=({services:t,error:s})=>{const r=()=>{if(s)return{className:"bg-red-500 dark:bg-red-500/80 hover:bg-red-600 dark:hover:bg-red-500 text-white border-transparent",tooltip:`Error: ${s}`,status:"error"};const o=t.every(c=>c.status==="Running"),l=t.every(c=>c.status==="Starting"||c.status==="Running");return o?{className:"bg-green-500 dark:bg-green-500/80 hover:bg-green-600 dark:hover:bg-green-500 text-white border-transparent",status:"healthy"}:l?{className:"bg-yellow-500 dark:bg-yellow-500/80 hover:bg-yellow-600 dark:hover:bg-yellow-500 text-white border-transparent",status:"pending"}:{className:"bg-red-500 dark:bg-red-500/80 hover:bg-red-600 dark:hover:bg-red-500 text-white border-transparent",status:"unhealthy"}},a=o=>{switch(o){case"Running":return"text-green-600 dark:text-green-400";case"Starting":return"text-yellow-600 dark:text-yellow-400";case"Failed":return"text-red-600 dark:text-red-400";case"Terminated":return"text-gray-600 dark:text-gray-400";case"Stopping":return"text-orange-600 dark:text-orange-400";case"New":return"text-blue-600 dark:text-blue-400";default:return"text-gray-600 dark:text-gray-400"}},{className:n}=r();return e.jsxs(Vt,{children:[e.jsx(Ut,{children:e.jsx("button",{type:"button",children:e.jsxs(be,{className:n,children:[t.length," services"]})})}),e.jsx(mt,{className:"w-80 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",sideOffset:5,children:e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"font-medium border-b border-gray-200 dark:border-gray-700 pb-1",children:"Service Status"}),e.jsx("div",{className:"space-y-1",children:t.map((o,l)=>e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx("span",{className:"mr-4 font-medium",children:o.service}),e.jsx("span",{className:`${a(o.status)}`,children:o.status})]},l))}),s&&e.jsx("div",{className:"mt-2 pt-2 border-t border-gray-200 dark:border-gray-700 text-red-600 dark:text-red-400",children:s})]})})]})},Ms=fo,st=ho,rt=xo,Ue=i.forwardRef(({className:t,sideOffset:s=4,...r},a)=>e.jsx(go,{children:e.jsx(br,{ref:a,sideOffset:s,className:v("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...r})}));Ue.displayName=br.displayName;function ed({isReady:t,message:s,className:r}){return e.jsx(Ms,{children:e.jsxs(st,{children:[e.jsx(rt,{asChild:!0,children:e.jsx("div",{className:v("flex items-center gap-2",r),children:e.jsx("div",{className:v("h-2.5 w-2.5 rounded-full",t?"bg-green-500":"bg-red-500")})})}),e.jsx(Ue,{children:e.jsx("p",{className:"text-sm",children:s||(t?"Ready":"Not Ready")})})]})})}const td=t=>{try{const s=cs(t);return Ze(s)?_r(s,{addSuffix:!0}):"Invalid date"}catch(s){return console.warn("Error parsing date:",t,s),"Invalid date"}},sd=({name:t,node:s,onNavigate:r})=>{var a,n;return e.jsxs(X,{className:"hover:bg-muted/50 cursor-pointer",onClick:()=>r(t),children:[e.jsx(F,{className:"font-medium",children:t}),e.jsx(F,{children:s.target}),e.jsx(F,{className:"font-mono text-sm",children:s.build.version}),e.jsx(F,{children:td(s.build.buildDate)}),e.jsx(F,{children:e.jsx(Jc,{services:s.services,error:s.error})}),e.jsx(F,{children:e.jsx(ed,{isReady:(a=s.ready)==null?void 0:a.isReady,message:(n=s.ready)==null?void 0:n.message})}),e.jsx(F,{children:e.jsxs(q,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:o=>{o.stopPropagation(),r(t)},children:[e.jsx(Ft,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:"View details"})]})})]},t)},rd=({nodes:t,sortField:s,sortDirection:r,onSort:a})=>{const n=It(),o=(d,u)=>{const m=cs(d),f=cs(u);return!Ze(m)&&!Ze(f)?0:Ze(m)?Ze(f)?m.getTime()-f.getTime():-1:1},l=Object.entries(t).sort(([d,u],[m,f])=>{let y=0;switch(s){case"name":y=d.localeCompare(m);break;case"target":y=u.target.localeCompare(f.target);break;case"version":y=u.build.version.localeCompare(f.build.version);break;case"buildDate":y=o(u.build.buildDate,f.build.buildDate);break}return r==="asc"?y:-y}),c=d=>{n(`/nodes/${d}`)};return e.jsx("div",{className:"rounded-md border bg-card",children:e.jsxs(Ce,{children:[e.jsx(Te,{children:e.jsxs(X,{className:"hover:bg-transparent",children:[e.jsx(D,{className:"w-[300px]",children:e.jsx(Z,{title:"Node Name",field:"name",sortField:s,sortDirection:r,onSort:a})}),e.jsx(D,{className:"w-[200px]",children:e.jsx(Z,{title:"Target",field:"target",sortField:s,sortDirection:r,onSort:a})}),e.jsx(D,{className:"w-[200px]",children:e.jsx(Z,{title:"Version",field:"version",sortField:s,sortDirection:r,onSort:a})}),e.jsx(D,{className:"w-[200px]",children:e.jsx(Z,{title:"Build Date",field:"buildDate",sortField:s,sortDirection:r,onSort:a})}),e.jsx(D,{className:"w-[150px]",children:"Status"}),e.jsx(D,{className:"w-[50px]",children:"Ready"}),e.jsx(D,{className:"w-[100px]",children:"Actions"})]})}),e.jsxs(Re,{children:[l.map(([d,u])=>e.jsx(sd,{name:d,node:u,onNavigate:c},d)),l.length===0&&e.jsx(X,{children:e.jsx(F,{colSpan:7,className:"h-24 text-center",children:e.jsx("div",{className:"text-muted-foreground",children:"No nodes found"})})})]})]})})},ir=t=>`hsl(var(--chart-${t%6+1}))`;function ad({nodes:t}){const s=i.useMemo(()=>{const a=new Map;return Object.values(t).forEach(n=>{const o=n.target||"unknown";a.set(o,(a.get(o)||0)+1)}),Array.from(a.entries()).sort((n,o)=>o[1]-n[1]).map(([n,o],l)=>({name:n,value:o,color:ir(l)}))},[t]),r=i.useMemo(()=>Object.keys(t).length,[t]);return s.length===0?null:e.jsxs("div",{className:"w-full h-[120px] relative",children:[e.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[e.jsx("div",{className:"text-xl font-bold",children:r}),e.jsx("div",{className:"text-xs text-muted-foreground",children:"Nodes"})]}),e.jsx(ct,{width:"100%",height:"100%",children:e.jsxs(Dt,{children:[e.jsx(Ot,{data:s,cx:"50%",cy:"50%",labelLine:!1,outerRadius:60,innerRadius:42,fill:"hsl(var(--chart-1))",dataKey:"value",paddingAngle:1,strokeWidth:1,children:s.map((a,n)=>e.jsx($t,{fill:ir(n),stroke:"hsl(var(--background))"},`cell-${a.name}`))}),e.jsx(dt,{content:({active:a,payload:n})=>{if(!a||!n||!n[0])return null;const o=n[0].payload;return e.jsxs("div",{className:"bg-background border rounded-lg shadow-lg px-3 py-2 flex items-center gap-2",children:[e.jsx("div",{className:"w-2.5 h-2.5 rounded-sm",style:{backgroundColor:o.color}}),e.jsx("span",{className:"text-sm font-medium",children:o.name}),e.jsx("span",{className:"text-sm font-semibold",children:o.value})]})}})]})})]})}class Xa extends Be.Component{constructor(s){super(s),this.state={hasError:!1}}static getDerivedStateFromError(s){return{hasError:!0,error:s}}render(){var s;return this.state.hasError?e.jsx("div",{className:"min-h-screen flex items-center justify-center p-4",children:e.jsxs("div",{className:"bg-destructive/10 p-6 rounded-lg max-w-2xl w-full",children:[e.jsx("h2",{className:"text-xl font-semibold text-destructive mb-4",children:"Something went wrong"}),e.jsx("div",{className:"bg-background/50 p-4 rounded-md",children:e.jsx("pre",{className:"text-sm overflow-auto",children:(s=this.state.error)==null?void 0:s.message})}),e.jsx("button",{className:"mt-4 px-4 py-2 bg-primary text-primary-foreground rounded-md hover:bg-primary/90",onClick:()=>window.location.reload(),children:"Reload Page"})]})}):this.props.children}}const nd=()=>{const{cluster:t,error:s,refresh:r,isLoading:a}=ue(),[n,o]=i.useState(""),[l,c]=i.useState([]),[d,u]=i.useState(["New","Starting","Running","Stopping","Terminated","Failed"]),[m,f]=i.useState("name"),[y,N]=i.useState("asc"),h=x=>{x===m?N(y==="asc"?"desc":"asc"):(f(x),N("asc"))},p=()=>t?Object.entries(t.members).reduce((x,[b,j])=>{const w=b.toLowerCase().includes(n.toLowerCase()),E=!l||l.length===0||l.includes(j.target),C=d.length===0||j.services&&Array.isArray(j.services)&&j.services.some(A=>(A==null?void 0:A.status)&&d.includes(A.status));return w&&E&&C&&(x[b]=j),x},{}):{},g=()=>{if(!t)return[];const x=new Set;return Object.values(t.members).forEach(b=>{b.target&&x.add(b.target)}),Array.from(x).sort()};return e.jsx(ke,{children:e.jsxs(ee,{className:"shadow-sm",children:[e.jsx(se,{children:e.jsxs("div",{className:"grid grid-cols-[1fr_auto] gap-8",children:[e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-3xl font-semibold tracking-tight",children:"Nodes"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"View and manage Loki nodes in your cluster with their current status and configuration"})]}),e.jsx(Qc,{nameFilter:n,targetFilter:l,selectedStates:d,onNameFilterChange:o,onTargetFilterChange:c,onStatesChange:u,onRefresh:r,availableTargets:g(),isLoading:a})]}),e.jsx("div",{className:"flex items-center",children:e.jsx("div",{className:"w-[250px]",children:e.jsx(ad,{nodes:p()})})})]})}),e.jsx(te,{children:e.jsxs("div",{className:"space-y-4",children:[s&&e.jsxs(Ge,{variant:"destructive",children:[e.jsx(nt,{className:"h-4 w-4"}),e.jsx(He,{children:"Error"}),e.jsx(Ke,{children:s})]}),a&&e.jsxs("div",{className:"flex items-center justify-center py-4",children:[e.jsx("div",{className:"h-6 w-6 animate-spin rounded-full border-2 border-primary border-t-transparent"}),e.jsx("span",{className:"ml-2 text-sm text-muted-foreground",children:"Loading..."})]}),!a&&!s&&e.jsx(rd,{nodes:p(),sortField:m,sortDirection:y,onSort:h})]})})]})})};function lr(){return e.jsx(Xa,{children:e.jsx(nd,{})})}const od=xi,Qa=i.forwardRef(({className:t,...s},r)=>e.jsx(ta,{ref:r,className:v("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",t),...s}));Qa.displayName=ta.displayName;const yt=i.forwardRef(({className:t,...s},r)=>e.jsx(sa,{ref:r,className:v("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",t),...s}));yt.displayName=sa.displayName;const vt=i.forwardRef(({className:t,...s},r)=>e.jsx(ra,{ref:r,className:v("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",t),...s}));vt.displayName=ra.displayName;var id=Object.create,Gt=Object.defineProperty,ld=Object.defineProperties,cd=Object.getOwnPropertyDescriptor,dd=Object.getOwnPropertyDescriptors,Ja=Object.getOwnPropertyNames,At=Object.getOwnPropertySymbols,ud=Object.getPrototypeOf,Bs=Object.prototype.hasOwnProperty,en=Object.prototype.propertyIsEnumerable,cr=(t,s,r)=>s in t?Gt(t,s,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[s]=r,ge=(t,s)=>{for(var r in s||(s={}))Bs.call(s,r)&&cr(t,r,s[r]);if(At)for(var r of At(s))en.call(s,r)&&cr(t,r,s[r]);return t},Ht=(t,s)=>ld(t,dd(s)),tn=(t,s)=>{var r={};for(var a in t)Bs.call(t,a)&&s.indexOf(a)<0&&(r[a]=t[a]);if(t!=null&&At)for(var a of At(t))s.indexOf(a)<0&&en.call(t,a)&&(r[a]=t[a]);return r},pd=(t,s)=>function(){return s||(0,t[Ja(t)[0]])((s={exports:{}}).exports,s),s.exports},md=(t,s)=>{for(var r in s)Gt(t,r,{get:s[r],enumerable:!0})},gd=(t,s,r,a)=>{if(s&&typeof s=="object"||typeof s=="function")for(let n of Ja(s))!Bs.call(t,n)&&n!==r&&Gt(t,n,{get:()=>s[n],enumerable:!(a=cd(s,n))||a.enumerable});return t},fd=(t,s,r)=>(r=t!=null?id(ud(t)):{},gd(!t||!t.__esModule?Gt(r,"default",{value:t,enumerable:!0}):r,t)),hd=pd({"../../node_modules/.pnpm/prismjs@1.29.0_patch_hash=vrxx3pzkik6jpmgpayxfjunetu/node_modules/prismjs/prism.js"(t,s){var r=function(){var a=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,n=0,o={},l={util:{encode:function h(p){return p instanceof c?new c(p.type,h(p.content),p.alias):Array.isArray(p)?p.map(h):p.replace(/&/g,"&").replace(/"+b.content+""};function d(h,p,g,x){h.lastIndex=p;var b=h.exec(g);if(b&&x&&b[1]){var j=b[1].length;b.index+=j,b[0]=b[0].slice(j)}return b}function u(h,p,g,x,b,j){for(var w in g)if(!(!g.hasOwnProperty(w)||!g[w])){var E=g[w];E=Array.isArray(E)?E:[E];for(var C=0;C=j.reach);O+=T.value.length,T=T.next){var V=T.value;if(p.length>h.length)return;if(!(V instanceof c)){var Q=1,_;if(Y){if(_=d(W,O,h,z),!_||_.index>=h.length)break;var S=_.index,I=_.index+_[0].length,P=O;for(P+=T.value.length;S>=P;)T=T.next,P+=T.value.length;if(P-=T.value.length,O=P,T.value instanceof c)continue;for(var U=T;U!==p.tail&&(Pj.reach&&(j.reach=G);var H=T.prev;$&&(H=f(p,H,$),O+=$.length),y(p,H,Q);var ne=new c(w,B?l.tokenize(R,B):R,K,R);if(T=f(p,H,ne),L&&f(p,T,L),Q>1){var de={cause:w+","+C,reach:G};u(h,p,g,T.prev,O,de),j&&de.reach>j.reach&&(j.reach=de.reach)}}}}}}function m(){var h={value:null,prev:null,next:null},p={value:null,prev:h,next:null};h.next=p,this.head=h,this.tail=p,this.length=0}function f(h,p,g){var x=p.next,b={value:g,prev:p,next:x};return p.next=b,x.prev=b,h.length++,b}function y(h,p,g){for(var x=p.next,b=0;b/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern://i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},k.languages.markup.tag.inside["attr-value"].inside.entity=k.languages.markup.entity,k.languages.markup.doctype.inside["internal-subset"].inside=k.languages.markup,k.hooks.add("wrap",function(t){t.type==="entity"&&(t.attributes.title=t.content.replace(/&/,"&"))}),Object.defineProperty(k.languages.markup.tag,"addInlined",{value:function(t,a){var r={},r=(r["language-"+a]={pattern:/(^$)/i,lookbehind:!0,inside:k.languages[a]},r.cdata=/^$/i,{"included-cdata":{pattern://i,inside:r}}),a=(r["language-"+a]={pattern:/[\s\S]+/,inside:k.languages[a]},{});a[t]={pattern:RegExp(/(<__[^>]*>)(?:))*\]\]>|(?!)/.source.replace(/__/g,function(){return t}),"i"),lookbehind:!0,greedy:!0,inside:r},k.languages.insertBefore("markup","cdata",a)}}),Object.defineProperty(k.languages.markup.tag,"addAttribute",{value:function(t,s){k.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+t+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[s,"language-"+s],inside:k.languages[s]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),k.languages.html=k.languages.markup,k.languages.mathml=k.languages.markup,k.languages.svg=k.languages.markup,k.languages.xml=k.languages.extend("markup",{}),k.languages.ssml=k.languages.xml,k.languages.atom=k.languages.xml,k.languages.rss=k.languages.xml,function(t){var s={pattern:/\\[\\(){}[\]^$+*?|.]/,alias:"escape"},r=/\\(?:x[\da-fA-F]{2}|u[\da-fA-F]{4}|u\{[\da-fA-F]+\}|0[0-7]{0,2}|[123][0-7]{2}|c[a-zA-Z]|.)/,a="(?:[^\\\\-]|"+r.source+")",a=RegExp(a+"-"+a),n={pattern:/(<|')[^<>']+(?=[>']$)/,lookbehind:!0,alias:"variable"};t.languages.regex={"char-class":{pattern:/((?:^|[^\\])(?:\\\\)*)\[(?:[^\\\]]|\\[\s\S])*\]/,lookbehind:!0,inside:{"char-class-negation":{pattern:/(^\[)\^/,lookbehind:!0,alias:"operator"},"char-class-punctuation":{pattern:/^\[|\]$/,alias:"punctuation"},range:{pattern:a,inside:{escape:r,"range-punctuation":{pattern:/-/,alias:"operator"}}},"special-escape":s,"char-set":{pattern:/\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},escape:r}},"special-escape":s,"char-set":{pattern:/\.|\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},backreference:[{pattern:/\\(?![123][0-7]{2})[1-9]/,alias:"keyword"},{pattern:/\\k<[^<>']+>/,alias:"keyword",inside:{"group-name":n}}],anchor:{pattern:/[$^]|\\[ABbGZz]/,alias:"function"},escape:r,group:[{pattern:/\((?:\?(?:<[^<>']+>|'[^<>']+'|[>:]|]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},k.languages.javascript=k.languages.extend("clike",{"class-name":[k.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),k.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,k.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:k.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:k.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:k.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:k.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:k.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),k.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:k.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),k.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),k.languages.markup&&(k.languages.markup.tag.addInlined("script","javascript"),k.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),k.languages.js=k.languages.javascript,k.languages.actionscript=k.languages.extend("javascript",{keyword:/\b(?:as|break|case|catch|class|const|default|delete|do|dynamic|each|else|extends|final|finally|for|function|get|if|implements|import|in|include|instanceof|interface|internal|is|namespace|native|new|null|override|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|use|var|void|while|with)\b/,operator:/\+\+|--|(?:[+\-*\/%^]|&&?|\|\|?|<>?>?|[!=]=?)=?|[~?@]/}),k.languages.actionscript["class-name"].alias="function",delete k.languages.actionscript.parameter,delete k.languages.actionscript["literal-property"],k.languages.markup&&k.languages.insertBefore("actionscript","string",{xml:{pattern:/(^|[^.])<\/?\w+(?:\s+[^\s>\/=]+=("|')(?:\\[\s\S]|(?!\2)[^\\])*\2)*\s*\/?>/,lookbehind:!0,inside:k.languages.markup}}),function(t){var s=/#(?!\{).+/,r={pattern:/#\{[^}]+\}/,alias:"variable"};t.languages.coffeescript=t.languages.extend("javascript",{comment:s,string:[{pattern:/'(?:\\[\s\S]|[^\\'])*'/,greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,greedy:!0,inside:{interpolation:r}}],keyword:/\b(?:and|break|by|catch|class|continue|debugger|delete|do|each|else|extend|extends|false|finally|for|if|in|instanceof|is|isnt|let|loop|namespace|new|no|not|null|of|off|on|or|own|return|super|switch|then|this|throw|true|try|typeof|undefined|unless|until|when|while|window|with|yes|yield)\b/,"class-member":{pattern:/@(?!\d)\w+/,alias:"variable"}}),t.languages.insertBefore("coffeescript","comment",{"multiline-comment":{pattern:/###[\s\S]+?###/,alias:"comment"},"block-regex":{pattern:/\/{3}[\s\S]*?\/{3}/,alias:"regex",inside:{comment:s,interpolation:r}}}),t.languages.insertBefore("coffeescript","string",{"inline-javascript":{pattern:/`(?:\\[\s\S]|[^\\`])*`/,inside:{delimiter:{pattern:/^`|`$/,alias:"punctuation"},script:{pattern:/[\s\S]+/,alias:"language-javascript",inside:t.languages.javascript}}},"multiline-string":[{pattern:/'''[\s\S]*?'''/,greedy:!0,alias:"string"},{pattern:/"""[\s\S]*?"""/,greedy:!0,alias:"string",inside:{interpolation:r}}]}),t.languages.insertBefore("coffeescript","keyword",{property:/(?!\d)\w+(?=\s*:(?!:))/}),delete t.languages.coffeescript["template-string"],t.languages.coffee=t.languages.coffeescript}(k),function(t){var s=t.languages.javadoclike={parameter:{pattern:/(^[\t ]*(?:\/{3}|\*|\/\*\*)\s*@(?:arg|arguments|param)\s+)\w+/m,lookbehind:!0},keyword:{pattern:/(^[\t ]*(?:\/{3}|\*|\/\*\*)\s*|\{)@[a-z][a-zA-Z-]+\b/m,lookbehind:!0},punctuation:/[{}]/};Object.defineProperty(s,"addSupport",{value:function(r,a){(r=typeof r=="string"?[r]:r).forEach(function(n){var o=function(f){f.inside||(f.inside={}),f.inside.rest=a},l="doc-comment";if(c=t.languages[n]){var c,d=c[l];if((d=d||(c=t.languages.insertBefore(n,"comment",{"doc-comment":{pattern:/(^|[^\\])\/\*\*[^/][\s\S]*?(?:\*\/|$)/,lookbehind:!0,alias:"comment"}}))[l])instanceof RegExp&&(d=c[l]={pattern:d}),Array.isArray(d))for(var u=0,m=d.length;u|\+|~|\|\|/,punctuation:/[(),]/}},t.languages.css.atrule.inside["selector-function-argument"].inside=s,t.languages.insertBefore("css","property",{variable:{pattern:/(^|[^-\w\xA0-\uFFFF])--(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*/i,lookbehind:!0}}),{pattern:/(\b\d+)(?:%|[a-z]+(?![\w-]))/,lookbehind:!0}),r={pattern:/(^|[^\w.-])-?(?:\d+(?:\.\d+)?|\.\d+)/,lookbehind:!0};t.languages.insertBefore("css","function",{operator:{pattern:/(\s)[+\-*\/](?=\s)/,lookbehind:!0},hexcode:{pattern:/\B#[\da-f]{3,8}\b/i,alias:"color"},color:[{pattern:/(^|[^\w-])(?:AliceBlue|AntiqueWhite|Aqua|Aquamarine|Azure|Beige|Bisque|Black|BlanchedAlmond|Blue|BlueViolet|Brown|BurlyWood|CadetBlue|Chartreuse|Chocolate|Coral|CornflowerBlue|Cornsilk|Crimson|Cyan|DarkBlue|DarkCyan|DarkGoldenRod|DarkGr[ae]y|DarkGreen|DarkKhaki|DarkMagenta|DarkOliveGreen|DarkOrange|DarkOrchid|DarkRed|DarkSalmon|DarkSeaGreen|DarkSlateBlue|DarkSlateGr[ae]y|DarkTurquoise|DarkViolet|DeepPink|DeepSkyBlue|DimGr[ae]y|DodgerBlue|FireBrick|FloralWhite|ForestGreen|Fuchsia|Gainsboro|GhostWhite|Gold|GoldenRod|Gr[ae]y|Green|GreenYellow|HoneyDew|HotPink|IndianRed|Indigo|Ivory|Khaki|Lavender|LavenderBlush|LawnGreen|LemonChiffon|LightBlue|LightCoral|LightCyan|LightGoldenRodYellow|LightGr[ae]y|LightGreen|LightPink|LightSalmon|LightSeaGreen|LightSkyBlue|LightSlateGr[ae]y|LightSteelBlue|LightYellow|Lime|LimeGreen|Linen|Magenta|Maroon|MediumAquaMarine|MediumBlue|MediumOrchid|MediumPurple|MediumSeaGreen|MediumSlateBlue|MediumSpringGreen|MediumTurquoise|MediumVioletRed|MidnightBlue|MintCream|MistyRose|Moccasin|NavajoWhite|Navy|OldLace|Olive|OliveDrab|Orange|OrangeRed|Orchid|PaleGoldenRod|PaleGreen|PaleTurquoise|PaleVioletRed|PapayaWhip|PeachPuff|Peru|Pink|Plum|PowderBlue|Purple|RebeccaPurple|Red|RosyBrown|RoyalBlue|SaddleBrown|Salmon|SandyBrown|SeaGreen|SeaShell|Sienna|Silver|SkyBlue|SlateBlue|SlateGr[ae]y|Snow|SpringGreen|SteelBlue|Tan|Teal|Thistle|Tomato|Transparent|Turquoise|Violet|Wheat|White|WhiteSmoke|Yellow|YellowGreen)(?![\w-])/i,lookbehind:!0},{pattern:/\b(?:hsl|rgb)\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*\)\B|\b(?:hsl|rgb)a\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*,\s*(?:0|0?\.\d+|1)\s*\)\B/i,inside:{unit:s,number:r,function:/[\w-]+(?=\()/,punctuation:/[(),]/}}],entity:/\\[\da-f]{1,8}/i,unit:s,number:r})}(k),function(t){var s=/[*&][^\s[\]{},]+/,r=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,a="(?:"+r.source+"(?:[ ]+"+s.source+")?|"+s.source+"(?:[ ]+"+r.source+")?)",n=/(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-])(?:[ \t]*(?:(?![#:])|:))*/.source.replace(//g,function(){return/[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source}),o=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function l(c,d){d=(d||"").replace(/m/g,"")+"m";var u=/([:\-,[{]\s*(?:\s<>[ \t]+)?)(?:<>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<>/g,function(){return a}).replace(/<>/g,function(){return c});return RegExp(u,d)}t.languages.yaml={scalar:{pattern:RegExp(/([\-:]\s*(?:\s<>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<>/g,function(){return a})),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<>[ \t]+)?)<>(?=\s*:\s)/.source.replace(/<>/g,function(){return a}).replace(/<>/g,function(){return"(?:"+n+"|"+o+")"})),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:l(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),lookbehind:!0,alias:"number"},boolean:{pattern:l(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:l(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:l(o),lookbehind:!0,greedy:!0},number:{pattern:l(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,"i"),lookbehind:!0},tag:r,important:s,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},t.languages.yml=t.languages.yaml}(k),function(t){var s=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function r(u){return u=u.replace(//g,function(){return s}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+u+")")}var a=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,n=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return a}),o=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source,l=(t.languages.markdown=t.languages.extend("markup",{}),t.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:t.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+n+o+"(?:"+n+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+n+o+")(?:"+n+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(a),inside:t.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+n+")"+o+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+n+"$"),inside:{"table-header":{pattern:RegExp(a),alias:"important",inside:t.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:r(/\b__(?:(?!_)|_(?:(?!_))+_)+__\b|\*\*(?:(?!\*)|\*(?:(?!\*))+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:r(/\b_(?:(?!_)|__(?:(?!_))+__)+_\b|\*(?:(?!\*)|\*\*(?:(?!\*))+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:r(/(~~?)(?:(?!~))+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:r(/!?\[(?:(?!\]))+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\]))+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach(function(u){["url","bold","italic","strike","code-snippet"].forEach(function(m){u!==m&&(t.languages.markdown[u].inside.content.inside[m]=t.languages.markdown[m])})}),t.hooks.add("after-tokenize",function(u){u.language!=="markdown"&&u.language!=="md"||function m(f){if(f&&typeof f!="string")for(var y=0,N=f.length;y",quot:'"'},d=String.fromCodePoint||String.fromCharCode;t.languages.md=t.languages.markdown}(k),k.languages.graphql={comment:/#.*/,description:{pattern:/(?:"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*")(?=\s*[a-z_])/i,greedy:!0,alias:"string",inside:{"language-markdown":{pattern:/(^"(?:"")?)(?!\1)[\s\S]+(?=\1$)/,lookbehind:!0,inside:k.languages.markdown}}},string:{pattern:/"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*"/,greedy:!0},number:/(?:\B-|\b)\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,boolean:/\b(?:false|true)\b/,variable:/\$[a-z_]\w*/i,directive:{pattern:/@[a-z_]\w*/i,alias:"function"},"attr-name":{pattern:/\b[a-z_]\w*(?=\s*(?:\((?:[^()"]|"(?:\\.|[^\\"\r\n])*")*\))?:)/i,greedy:!0},"atom-input":{pattern:/\b[A-Z]\w*Input\b/,alias:"class-name"},scalar:/\b(?:Boolean|Float|ID|Int|String)\b/,constant:/\b[A-Z][A-Z_\d]*\b/,"class-name":{pattern:/(\b(?:enum|implements|interface|on|scalar|type|union)\s+|&\s*|:\s*|\[)[A-Z_]\w*/,lookbehind:!0},fragment:{pattern:/(\bfragment\s+|\.{3}\s*(?!on\b))[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-mutation":{pattern:/(\bmutation\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-query":{pattern:/(\bquery\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},keyword:/\b(?:directive|enum|extend|fragment|implements|input|interface|mutation|on|query|repeatable|scalar|schema|subscription|type|union)\b/,operator:/[!=|&]|\.{3}/,"property-query":/\w+(?=\s*\()/,object:/\w+(?=\s*\{)/,punctuation:/[!(){}\[\]:=,]/,property:/\w+/},k.hooks.add("after-tokenize",function(t){if(t.language==="graphql")for(var s=t.tokens.filter(function(h){return typeof h!="string"&&h.type!=="comment"&&h.type!=="scalar"}),r=0;r?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/},function(t){var s=t.languages.javascript["template-string"],r=s.pattern.source,a=s.inside.interpolation,n=a.inside["interpolation-punctuation"],o=a.pattern.source;function l(f,y){if(t.languages[f])return{pattern:RegExp("((?:"+y+")\\s*)"+r),lookbehind:!0,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},"embedded-code":{pattern:/[\s\S]+/,alias:f}}}}function c(f,y,N){return f={code:f,grammar:y,language:N},t.hooks.run("before-tokenize",f),f.tokens=t.tokenize(f.code,f.grammar),t.hooks.run("after-tokenize",f),f.tokens}function d(f,y,N){var g=t.tokenize(f,{interpolation:{pattern:RegExp(o),lookbehind:!0}}),h=0,p={},g=c(g.map(function(b){if(typeof b=="string")return b;for(var j,w,b=b.content;f.indexOf((w=h++,j="___"+N.toUpperCase()+"_"+w+"___"))!==-1;);return p[j]=b,j}).join(""),y,N),x=Object.keys(p);return h=0,function b(j){for(var w=0;w=x.length)return;var E,C,A,B,z,Y,K,M=j[w];typeof M=="string"||typeof M.content=="string"?(E=x[h],(K=(Y=typeof M=="string"?M:M.content).indexOf(E))!==-1&&(++h,C=Y.substring(0,K),z=p[E],A=void 0,(B={})["interpolation-punctuation"]=n,(B=t.tokenize(z,B)).length===3&&((A=[1,1]).push.apply(A,c(B[1],t.languages.javascript,"javascript")),B.splice.apply(B,A)),A=new t.Token("interpolation",B,a.alias,z),B=Y.substring(K+E.length),z=[],C&&z.push(C),z.push(A),B&&(b(Y=[B]),z.push.apply(z,Y)),typeof M=="string"?(j.splice.apply(j,[w,1].concat(z)),w+=z.length-1):M.content=z)):(K=M.content,Array.isArray(K)?b(K):b([K]))}}(g),new t.Token(N,g,"language-"+N,f)}t.languages.javascript["template-string"]=[l("css",/\b(?:styled(?:\([^)]*\))?(?:\s*\.\s*\w+(?:\([^)]*\))*)*|css(?:\s*\.\s*(?:global|resolve))?|createGlobalStyle|keyframes)/.source),l("html",/\bhtml|\.\s*(?:inner|outer)HTML\s*\+?=/.source),l("svg",/\bsvg/.source),l("markdown",/\b(?:markdown|md)/.source),l("graphql",/\b(?:gql|graphql(?:\s*\.\s*experimental)?)/.source),l("sql",/\bsql/.source),s].filter(Boolean);var u={javascript:!0,js:!0,typescript:!0,ts:!0,jsx:!0,tsx:!0};function m(f){return typeof f=="string"?f:Array.isArray(f)?f.map(m).join(""):m(f.content)}t.hooks.add("after-tokenize",function(f){f.language in u&&function y(N){for(var h=0,p=N.length;h]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),t.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete t.languages.typescript.parameter,delete t.languages.typescript["literal-property"];var s=t.languages.extend("typescript",{});delete s["class-name"],t.languages.typescript["class-name"].inside=s,t.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:s}}}}),t.languages.ts=t.languages.typescript}(k),function(t){var s=t.languages.javascript,r=/\{(?:[^{}]|\{(?:[^{}]|\{[^{}]*\})*\})+\}/.source,a="(@(?:arg|argument|param|property)\\s+(?:"+r+"\\s+)?)";t.languages.jsdoc=t.languages.extend("javadoclike",{parameter:{pattern:RegExp(a+/(?:(?!\s)[$\w\xA0-\uFFFF.])+(?=\s|$)/.source),lookbehind:!0,inside:{punctuation:/\./}}}),t.languages.insertBefore("jsdoc","keyword",{"optional-parameter":{pattern:RegExp(a+/\[(?:(?!\s)[$\w\xA0-\uFFFF.])+(?:=[^[\]]+)?\](?=\s|$)/.source),lookbehind:!0,inside:{parameter:{pattern:/(^\[)[$\w\xA0-\uFFFF\.]+/,lookbehind:!0,inside:{punctuation:/\./}},code:{pattern:/(=)[\s\S]*(?=\]$)/,lookbehind:!0,inside:s,alias:"language-javascript"},punctuation:/[=[\]]/}},"class-name":[{pattern:RegExp(/(@(?:augments|class|extends|interface|memberof!?|template|this|typedef)\s+(?:\s+)?)[A-Z]\w*(?:\.[A-Z]\w*)*/.source.replace(//g,function(){return r})),lookbehind:!0,inside:{punctuation:/\./}},{pattern:RegExp("(@[a-z]+\\s+)"+r),lookbehind:!0,inside:{string:s.string,number:s.number,boolean:s.boolean,keyword:t.languages.typescript.keyword,operator:/=>|\.\.\.|[&|?:*]/,punctuation:/[.,;=<>{}()[\]]/}}],example:{pattern:/(@example\s+(?!\s))(?:[^@\s]|\s+(?!\s))+?(?=\s*(?:\*\s*)?(?:@\w|\*\/))/,lookbehind:!0,inside:{code:{pattern:/^([\t ]*(?:\*\s*)?)\S.*$/m,lookbehind:!0,inside:s,alias:"language-javascript"}}}}),t.languages.javadoclike.addSupport("javascript",t.languages.jsdoc)}(k),function(t){t.languages.flow=t.languages.extend("javascript",{}),t.languages.insertBefore("flow","keyword",{type:[{pattern:/\b(?:[Bb]oolean|Function|[Nn]umber|[Ss]tring|[Ss]ymbol|any|mixed|null|void)\b/,alias:"class-name"}]}),t.languages.flow["function-variable"].pattern=/(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=\s*(?:function\b|(?:\([^()]*\)(?:\s*:\s*\w+)?|(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/i,delete t.languages.flow.parameter,t.languages.insertBefore("flow","operator",{"flow-punctuation":{pattern:/\{\||\|\}/,alias:"punctuation"}}),Array.isArray(t.languages.flow.keyword)||(t.languages.flow.keyword=[t.languages.flow.keyword]),t.languages.flow.keyword.unshift({pattern:/(^|[^$]\b)(?:Class|declare|opaque|type)\b(?!\$)/,lookbehind:!0},{pattern:/(^|[^$]\B)\$(?:Diff|Enum|Exact|Keys|ObjMap|PropertyType|Record|Shape|Subtype|Supertype|await)\b(?!\$)/,lookbehind:!0})}(k),k.languages.n4js=k.languages.extend("javascript",{keyword:/\b(?:Array|any|boolean|break|case|catch|class|const|constructor|continue|debugger|declare|default|delete|do|else|enum|export|extends|false|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|module|new|null|number|package|private|protected|public|return|set|static|string|super|switch|this|throw|true|try|typeof|var|void|while|with|yield)\b/}),k.languages.insertBefore("n4js","constant",{annotation:{pattern:/@+\w+/,alias:"operator"}}),k.languages.n4jsd=k.languages.n4js,function(t){function s(l,c){return RegExp(l.replace(//g,function(){return/(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/.source}),c)}t.languages.insertBefore("javascript","function-variable",{"method-variable":{pattern:RegExp("(\\.\\s*)"+t.languages.javascript["function-variable"].pattern.source),lookbehind:!0,alias:["function-variable","method","function","property-access"]}}),t.languages.insertBefore("javascript","function",{method:{pattern:RegExp("(\\.\\s*)"+t.languages.javascript.function.source),lookbehind:!0,alias:["function","property-access"]}}),t.languages.insertBefore("javascript","constant",{"known-class-name":[{pattern:/\b(?:(?:Float(?:32|64)|(?:Int|Uint)(?:8|16|32)|Uint8Clamped)?Array|ArrayBuffer|BigInt|Boolean|DataView|Date|Error|Function|Intl|JSON|(?:Weak)?(?:Map|Set)|Math|Number|Object|Promise|Proxy|Reflect|RegExp|String|Symbol|WebAssembly)\b/,alias:"class-name"},{pattern:/\b(?:[A-Z]\w*)Error\b/,alias:"class-name"}]}),t.languages.insertBefore("javascript","keyword",{imports:{pattern:s(/(\bimport\b\s*)(?:(?:\s*,\s*(?:\*\s*as\s+|\{[^{}]*\}))?|\*\s*as\s+|\{[^{}]*\})(?=\s*\bfrom\b)/.source),lookbehind:!0,inside:t.languages.javascript},exports:{pattern:s(/(\bexport\b\s*)(?:\*(?:\s*as\s+)?(?=\s*\bfrom\b)|\{[^{}]*\})/.source),lookbehind:!0,inside:t.languages.javascript}}),t.languages.javascript.keyword.unshift({pattern:/\b(?:as|default|export|from|import)\b/,alias:"module"},{pattern:/\b(?:await|break|catch|continue|do|else|finally|for|if|return|switch|throw|try|while|yield)\b/,alias:"control-flow"},{pattern:/\bnull\b/,alias:["null","nil"]},{pattern:/\bundefined\b/,alias:"nil"}),t.languages.insertBefore("javascript","operator",{spread:{pattern:/\.{3}/,alias:"operator"},arrow:{pattern:/=>/,alias:"operator"}}),t.languages.insertBefore("javascript","punctuation",{"property-access":{pattern:s(/(\.\s*)#?/.source),lookbehind:!0},"maybe-class-name":{pattern:/(^|[^$\w\xA0-\uFFFF])[A-Z][$\w\xA0-\uFFFF]+/,lookbehind:!0},dom:{pattern:/\b(?:document|(?:local|session)Storage|location|navigator|performance|window)\b/,alias:"variable"},console:{pattern:/\bconsole(?=\s*\.)/,alias:"class-name"}});for(var r=["function","function-variable","method","method-variable","property-access"],a=0;a*\.{3}(?:[^{}]|)*\})/.source;function o(d,u){return d=d.replace(//g,function(){return r}).replace(//g,function(){return a}).replace(//g,function(){return n}),RegExp(d,u)}n=o(n).source,t.languages.jsx=t.languages.extend("markup",s),t.languages.jsx.tag.pattern=o(/<\/?(?:[\w.:-]+(?:+(?:[\w.:$-]+(?:=(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s{'"/>=]+|))?|))**\/?)?>/.source),t.languages.jsx.tag.inside.tag.pattern=/^<\/?[^\s>\/]*/,t.languages.jsx.tag.inside["attr-value"].pattern=/=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/,t.languages.jsx.tag.inside.tag.inside["class-name"]=/^[A-Z]\w*(?:\.[A-Z]\w*)*$/,t.languages.jsx.tag.inside.comment=s.comment,t.languages.insertBefore("inside","attr-name",{spread:{pattern:o(//.source),inside:t.languages.jsx}},t.languages.jsx.tag),t.languages.insertBefore("inside","special-attr",{script:{pattern:o(/=/.source),alias:"language-javascript",inside:{"script-punctuation":{pattern:/^=(?=\{)/,alias:"punctuation"},rest:t.languages.jsx}}},t.languages.jsx.tag);function l(d){for(var u=[],m=0;m"&&u.push({tagName:c(f.content[0].content[1]),openedBraces:0}):0]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:"constant"},"other-directive":{pattern:/#\w+\b/,alias:"property"},attribute:{pattern:/@\w+/,alias:"atrule"},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:"function"},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:"important"},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:"constant"},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:"keyword"},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/},k.languages.swift["string-literal"].forEach(function(t){t.inside.interpolation.inside=k.languages.swift}),function(t){t.languages.kotlin=t.languages.extend("clike",{keyword:{pattern:/(^|[^.])\b(?:abstract|actual|annotation|as|break|by|catch|class|companion|const|constructor|continue|crossinline|data|do|dynamic|else|enum|expect|external|final|finally|for|fun|get|if|import|in|infix|init|inline|inner|interface|internal|is|lateinit|noinline|null|object|open|operator|out|override|package|private|protected|public|reified|return|sealed|set|super|suspend|tailrec|this|throw|to|try|typealias|val|var|vararg|when|where|while)\b/,lookbehind:!0},function:[{pattern:/(?:`[^\r\n`]+`|\b\w+)(?=\s*\()/,greedy:!0},{pattern:/(\.)(?:`[^\r\n`]+`|\w+)(?=\s*\{)/,lookbehind:!0,greedy:!0}],number:/\b(?:0[xX][\da-fA-F]+(?:_[\da-fA-F]+)*|0[bB][01]+(?:_[01]+)*|\d+(?:_\d+)*(?:\.\d+(?:_\d+)*)?(?:[eE][+-]?\d+(?:_\d+)*)?[fFL]?)\b/,operator:/\+[+=]?|-[-=>]?|==?=?|!(?:!|==?)?|[\/*%<>]=?|[?:]:?|\.\.|&&|\|\||\b(?:and|inv|or|shl|shr|ushr|xor)\b/}),delete t.languages.kotlin["class-name"];var s={"interpolation-punctuation":{pattern:/^\$\{?|\}$/,alias:"punctuation"},expression:{pattern:/[\s\S]+/,inside:t.languages.kotlin}};t.languages.insertBefore("kotlin","string",{"string-literal":[{pattern:/"""(?:[^$]|\$(?:(?!\{)|\{[^{}]*\}))*?"""/,alias:"multiline",inside:{interpolation:{pattern:/\$(?:[a-z_]\w*|\{[^{}]*\})/i,inside:s},string:/[\s\S]+/}},{pattern:/"(?:[^"\\\r\n$]|\\.|\$(?:(?!\{)|\{[^{}]*\}))*"/,alias:"singleline",inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:[a-z_]\w*|\{[^{}]*\})/i,lookbehind:!0,inside:s},string:/[\s\S]+/}}],char:{pattern:/'(?:[^'\\\r\n]|\\(?:.|u[a-fA-F0-9]{0,4}))'/,greedy:!0}}),delete t.languages.kotlin.string,t.languages.insertBefore("kotlin","keyword",{annotation:{pattern:/\B@(?:\w+:)?(?:[A-Z]\w*|\[[^\]]+\])/,alias:"builtin"}}),t.languages.insertBefore("kotlin","function",{label:{pattern:/\b\w+@|@\w+\b/,alias:"symbol"}}),t.languages.kt=t.languages.kotlin,t.languages.kts=t.languages.kotlin}(k),k.languages.c=k.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),k.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),k.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},k.languages.c.string],char:k.languages.c.char,comment:k.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:k.languages.c}}}}),k.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete k.languages.c.boolean,k.languages.objectivec=k.languages.extend("c",{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete k.languages.objectivec["class-name"],k.languages.objc=k.languages.objectivec,k.languages.reason=k.languages.extend("clike",{string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^\\\r\n"])*"/,greedy:!0},"class-name":/\b[A-Z]\w*/,keyword:/\b(?:and|as|assert|begin|class|constraint|do|done|downto|else|end|exception|external|for|fun|function|functor|if|in|include|inherit|initializer|lazy|let|method|module|mutable|new|nonrec|object|of|open|or|private|rec|sig|struct|switch|then|to|try|type|val|virtual|when|while|with)\b/,operator:/\.{3}|:[:=]|\|>|->|=(?:==?|>)?|<=?|>=?|[|^?'#!~`]|[+\-*\/]\.?|\b(?:asr|land|lor|lsl|lsr|lxor|mod)\b/}),k.languages.insertBefore("reason","class-name",{char:{pattern:/'(?:\\x[\da-f]{2}|\\o[0-3][0-7][0-7]|\\\d{3}|\\.|[^'\\\r\n])'/,greedy:!0},constructor:/\b[A-Z]\w*\b(?!\s*\.)/,label:{pattern:/\b[a-z]\w*(?=::)/,alias:"symbol"}}),delete k.languages.reason.function,function(t){for(var s=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|)*\*\//.source,r=0;r<2;r++)s=s.replace(//g,function(){return s});s=s.replace(//g,function(){return/[^\s\S]/.source}),t.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+s),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<>?=?|[@?]/},t.languages.rust["closure-params"].inside.rest=t.languages.rust,t.languages.rust.attribute.inside.string=t.languages.rust.string}(k),k.languages.go=k.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/}),k.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete k.languages.go["class-name"],function(t){var s=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,r=/\b(?!)\w+(?:\s*\.\s*\w+)*\b/.source.replace(//g,function(){return s.source});t.languages.cpp=t.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!)\w+/.source.replace(//g,function(){return s.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:s,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),t.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/(?:\s*:\s*)?|:\s*/.source.replace(//g,function(){return r})+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),t.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:t.languages.cpp}}}}),t.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),t.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:t.languages.extend("cpp",{})}}),t.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},t.languages.cpp["base-clause"])}(k),k.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},k.languages.python["string-interpolation"].inside.interpolation.inside.rest=k.languages.python,k.languages.py=k.languages.python,k.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},k.languages.webmanifest=k.languages.json;var xd={};md(xd,{dracula:()=>yd,duotoneDark:()=>jd,duotoneLight:()=>Nd,github:()=>Sd,gruvboxMaterialDark:()=>eu,gruvboxMaterialLight:()=>su,jettwaveDark:()=>Hd,jettwaveLight:()=>Wd,nightOwl:()=>Cd,nightOwlLight:()=>Rd,oceanicNext:()=>_d,okaidia:()=>Fd,oneDark:()=>Yd,oneLight:()=>Qd,palenight:()=>Pd,shadesOfPurple:()=>Od,synthwave84:()=>Md,ultramin:()=>zd,vsDark:()=>sn,vsLight:()=>qd});var bd={plain:{color:"#F8F8F2",backgroundColor:"#282A36"},styles:[{types:["prolog","constant","builtin"],style:{color:"rgb(189, 147, 249)"}},{types:["inserted","function"],style:{color:"rgb(80, 250, 123)"}},{types:["deleted"],style:{color:"rgb(255, 85, 85)"}},{types:["changed"],style:{color:"rgb(255, 184, 108)"}},{types:["punctuation","symbol"],style:{color:"rgb(248, 248, 242)"}},{types:["string","char","tag","selector"],style:{color:"rgb(255, 121, 198)"}},{types:["keyword","variable"],style:{color:"rgb(189, 147, 249)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(98, 114, 164)"}},{types:["attr-name"],style:{color:"rgb(241, 250, 140)"}}]},yd=bd,vd={plain:{backgroundColor:"#2a2734",color:"#9a86fd"},styles:[{types:["comment","prolog","doctype","cdata","punctuation"],style:{color:"#6c6783"}},{types:["namespace"],style:{opacity:.7}},{types:["tag","operator","number"],style:{color:"#e09142"}},{types:["property","function"],style:{color:"#9a86fd"}},{types:["tag-id","selector","atrule-id"],style:{color:"#eeebff"}},{types:["attr-name"],style:{color:"#c4b9fe"}},{types:["boolean","string","entity","url","attr-value","keyword","control","directive","unit","statement","regex","atrule","placeholder","variable"],style:{color:"#ffcc99"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"#c4b9fe"}}]},jd=vd,wd={plain:{backgroundColor:"#faf8f5",color:"#728fcb"},styles:[{types:["comment","prolog","doctype","cdata","punctuation"],style:{color:"#b6ad9a"}},{types:["namespace"],style:{opacity:.7}},{types:["tag","operator","number"],style:{color:"#063289"}},{types:["property","function"],style:{color:"#b29762"}},{types:["tag-id","selector","atrule-id"],style:{color:"#2d2006"}},{types:["attr-name"],style:{color:"#896724"}},{types:["boolean","string","entity","url","attr-value","keyword","control","directive","unit","statement","regex","atrule"],style:{color:"#728fcb"}},{types:["placeholder","variable"],style:{color:"#93abdc"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"#896724"}}]},Nd=wd,kd={plain:{color:"#393A34",backgroundColor:"#f6f8fa"},styles:[{types:["comment","prolog","doctype","cdata"],style:{color:"#999988",fontStyle:"italic"}},{types:["namespace"],style:{opacity:.7}},{types:["string","attr-value"],style:{color:"#e3116c"}},{types:["punctuation","operator"],style:{color:"#393A34"}},{types:["entity","url","symbol","number","boolean","variable","constant","property","regex","inserted"],style:{color:"#36acaa"}},{types:["atrule","keyword","attr-name","selector"],style:{color:"#00a4db"}},{types:["function","deleted","tag"],style:{color:"#d73a49"}},{types:["function-variable"],style:{color:"#6f42c1"}},{types:["tag","selector","keyword"],style:{color:"#00009f"}}]},Sd=kd,Ed={plain:{color:"#d6deeb",backgroundColor:"#011627"},styles:[{types:["changed"],style:{color:"rgb(162, 191, 252)",fontStyle:"italic"}},{types:["deleted"],style:{color:"rgba(239, 83, 80, 0.56)",fontStyle:"italic"}},{types:["inserted","attr-name"],style:{color:"rgb(173, 219, 103)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(99, 119, 119)",fontStyle:"italic"}},{types:["string","url"],style:{color:"rgb(173, 219, 103)"}},{types:["variable"],style:{color:"rgb(214, 222, 235)"}},{types:["number"],style:{color:"rgb(247, 140, 108)"}},{types:["builtin","char","constant","function"],style:{color:"rgb(130, 170, 255)"}},{types:["punctuation"],style:{color:"rgb(199, 146, 234)"}},{types:["selector","doctype"],style:{color:"rgb(199, 146, 234)",fontStyle:"italic"}},{types:["class-name"],style:{color:"rgb(255, 203, 139)"}},{types:["tag","operator","keyword"],style:{color:"rgb(127, 219, 202)"}},{types:["boolean"],style:{color:"rgb(255, 88, 116)"}},{types:["property"],style:{color:"rgb(128, 203, 196)"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)"}}]},Cd=Ed,Td={plain:{color:"#403f53",backgroundColor:"#FBFBFB"},styles:[{types:["changed"],style:{color:"rgb(162, 191, 252)",fontStyle:"italic"}},{types:["deleted"],style:{color:"rgba(239, 83, 80, 0.56)",fontStyle:"italic"}},{types:["inserted","attr-name"],style:{color:"rgb(72, 118, 214)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(152, 159, 177)",fontStyle:"italic"}},{types:["string","builtin","char","constant","url"],style:{color:"rgb(72, 118, 214)"}},{types:["variable"],style:{color:"rgb(201, 103, 101)"}},{types:["number"],style:{color:"rgb(170, 9, 130)"}},{types:["punctuation"],style:{color:"rgb(153, 76, 195)"}},{types:["function","selector","doctype"],style:{color:"rgb(153, 76, 195)",fontStyle:"italic"}},{types:["class-name"],style:{color:"rgb(17, 17, 17)"}},{types:["tag"],style:{color:"rgb(153, 76, 195)"}},{types:["operator","property","keyword","namespace"],style:{color:"rgb(12, 150, 155)"}},{types:["boolean"],style:{color:"rgb(188, 84, 84)"}}]},Rd=Td,ie={char:"#D8DEE9",comment:"#999999",keyword:"#c5a5c5",primitive:"#5a9bcf",string:"#8dc891",variable:"#d7deea",boolean:"#ff8b50",punctuation:"#5FB3B3",tag:"#fc929e",function:"#79b6f2",className:"#FAC863",method:"#6699CC",operator:"#fc929e"},Ad={plain:{backgroundColor:"#282c34",color:"#ffffff"},styles:[{types:["attr-name"],style:{color:ie.keyword}},{types:["attr-value"],style:{color:ie.string}},{types:["comment","block-comment","prolog","doctype","cdata","shebang"],style:{color:ie.comment}},{types:["property","number","function-name","constant","symbol","deleted"],style:{color:ie.primitive}},{types:["boolean"],style:{color:ie.boolean}},{types:["tag"],style:{color:ie.tag}},{types:["string"],style:{color:ie.string}},{types:["punctuation"],style:{color:ie.string}},{types:["selector","char","builtin","inserted"],style:{color:ie.char}},{types:["function"],style:{color:ie.function}},{types:["operator","entity","url","variable"],style:{color:ie.variable}},{types:["keyword"],style:{color:ie.keyword}},{types:["atrule","class-name"],style:{color:ie.className}},{types:["important"],style:{fontWeight:"400"}},{types:["bold"],style:{fontWeight:"bold"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["namespace"],style:{opacity:.7}}]},_d=Ad,Id={plain:{color:"#f8f8f2",backgroundColor:"#272822"},styles:[{types:["changed"],style:{color:"rgb(162, 191, 252)",fontStyle:"italic"}},{types:["deleted"],style:{color:"#f92672",fontStyle:"italic"}},{types:["inserted"],style:{color:"rgb(173, 219, 103)",fontStyle:"italic"}},{types:["comment"],style:{color:"#8292a2",fontStyle:"italic"}},{types:["string","url"],style:{color:"#a6e22e"}},{types:["variable"],style:{color:"#f8f8f2"}},{types:["number"],style:{color:"#ae81ff"}},{types:["builtin","char","constant","function","class-name"],style:{color:"#e6db74"}},{types:["punctuation"],style:{color:"#f8f8f2"}},{types:["selector","doctype"],style:{color:"#a6e22e",fontStyle:"italic"}},{types:["tag","operator","keyword"],style:{color:"#66d9ef"}},{types:["boolean"],style:{color:"#ae81ff"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)",opacity:.7}},{types:["tag","property"],style:{color:"#f92672"}},{types:["attr-name"],style:{color:"#a6e22e !important"}},{types:["doctype"],style:{color:"#8292a2"}},{types:["rule"],style:{color:"#e6db74"}}]},Fd=Id,Ld={plain:{color:"#bfc7d5",backgroundColor:"#292d3e"},styles:[{types:["comment"],style:{color:"rgb(105, 112, 152)",fontStyle:"italic"}},{types:["string","inserted"],style:{color:"rgb(195, 232, 141)"}},{types:["number"],style:{color:"rgb(247, 140, 108)"}},{types:["builtin","char","constant","function"],style:{color:"rgb(130, 170, 255)"}},{types:["punctuation","selector"],style:{color:"rgb(199, 146, 234)"}},{types:["variable"],style:{color:"rgb(191, 199, 213)"}},{types:["class-name","attr-name"],style:{color:"rgb(255, 203, 107)"}},{types:["tag","deleted"],style:{color:"rgb(255, 85, 114)"}},{types:["operator"],style:{color:"rgb(137, 221, 255)"}},{types:["boolean"],style:{color:"rgb(255, 88, 116)"}},{types:["keyword"],style:{fontStyle:"italic"}},{types:["doctype"],style:{color:"rgb(199, 146, 234)",fontStyle:"italic"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)"}},{types:["url"],style:{color:"rgb(221, 221, 221)"}}]},Pd=Ld,Dd={plain:{color:"#9EFEFF",backgroundColor:"#2D2A55"},styles:[{types:["changed"],style:{color:"rgb(255, 238, 128)"}},{types:["deleted"],style:{color:"rgba(239, 83, 80, 0.56)"}},{types:["inserted"],style:{color:"rgb(173, 219, 103)"}},{types:["comment"],style:{color:"rgb(179, 98, 255)",fontStyle:"italic"}},{types:["punctuation"],style:{color:"rgb(255, 255, 255)"}},{types:["constant"],style:{color:"rgb(255, 98, 140)"}},{types:["string","url"],style:{color:"rgb(165, 255, 144)"}},{types:["variable"],style:{color:"rgb(255, 238, 128)"}},{types:["number","boolean"],style:{color:"rgb(255, 98, 140)"}},{types:["attr-name"],style:{color:"rgb(255, 180, 84)"}},{types:["keyword","operator","property","namespace","tag","selector","doctype"],style:{color:"rgb(255, 157, 0)"}},{types:["builtin","char","constant","function","class-name"],style:{color:"rgb(250, 208, 0)"}}]},Od=Dd,$d={plain:{backgroundColor:"linear-gradient(to bottom, #2a2139 75%, #34294f)",backgroundImage:"#34294f",color:"#f92aad",textShadow:"0 0 2px #100c0f, 0 0 5px #dc078e33, 0 0 10px #fff3"},styles:[{types:["comment","block-comment","prolog","doctype","cdata"],style:{color:"#495495",fontStyle:"italic"}},{types:["punctuation"],style:{color:"#ccc"}},{types:["tag","attr-name","namespace","number","unit","hexcode","deleted"],style:{color:"#e2777a"}},{types:["property","selector"],style:{color:"#72f1b8",textShadow:"0 0 2px #100c0f, 0 0 10px #257c5575, 0 0 35px #21272475"}},{types:["function-name"],style:{color:"#6196cc"}},{types:["boolean","selector-id","function"],style:{color:"#fdfdfd",textShadow:"0 0 2px #001716, 0 0 3px #03edf975, 0 0 5px #03edf975, 0 0 8px #03edf975"}},{types:["class-name","maybe-class-name","builtin"],style:{color:"#fff5f6",textShadow:"0 0 2px #000, 0 0 10px #fc1f2c75, 0 0 5px #fc1f2c75, 0 0 25px #fc1f2c75"}},{types:["constant","symbol"],style:{color:"#f92aad",textShadow:"0 0 2px #100c0f, 0 0 5px #dc078e33, 0 0 10px #fff3"}},{types:["important","atrule","keyword","selector-class"],style:{color:"#f4eee4",textShadow:"0 0 2px #393a33, 0 0 8px #f39f0575, 0 0 2px #f39f0575"}},{types:["string","char","attr-value","regex","variable"],style:{color:"#f87c32"}},{types:["parameter"],style:{fontStyle:"italic"}},{types:["entity","url"],style:{color:"#67cdcc"}},{types:["operator"],style:{color:"ffffffee"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["entity"],style:{cursor:"help"}},{types:["inserted"],style:{color:"green"}}]},Md=$d,Bd={plain:{color:"#282a2e",backgroundColor:"#ffffff"},styles:[{types:["comment"],style:{color:"rgb(197, 200, 198)"}},{types:["string","number","builtin","variable"],style:{color:"rgb(150, 152, 150)"}},{types:["class-name","function","tag","attr-name"],style:{color:"rgb(40, 42, 46)"}}]},zd=Bd,Vd={plain:{color:"#9CDCFE",backgroundColor:"#1E1E1E"},styles:[{types:["prolog"],style:{color:"rgb(0, 0, 128)"}},{types:["comment"],style:{color:"rgb(106, 153, 85)"}},{types:["builtin","changed","keyword","interpolation-punctuation"],style:{color:"rgb(86, 156, 214)"}},{types:["number","inserted"],style:{color:"rgb(181, 206, 168)"}},{types:["constant"],style:{color:"rgb(100, 102, 149)"}},{types:["attr-name","variable"],style:{color:"rgb(156, 220, 254)"}},{types:["deleted","string","attr-value","template-punctuation"],style:{color:"rgb(206, 145, 120)"}},{types:["selector"],style:{color:"rgb(215, 186, 125)"}},{types:["tag"],style:{color:"rgb(78, 201, 176)"}},{types:["tag"],languages:["markup"],style:{color:"rgb(86, 156, 214)"}},{types:["punctuation","operator"],style:{color:"rgb(212, 212, 212)"}},{types:["punctuation"],languages:["markup"],style:{color:"#808080"}},{types:["function"],style:{color:"rgb(220, 220, 170)"}},{types:["class-name"],style:{color:"rgb(78, 201, 176)"}},{types:["char"],style:{color:"rgb(209, 105, 105)"}}]},sn=Vd,Ud={plain:{color:"#000000",backgroundColor:"#ffffff"},styles:[{types:["comment"],style:{color:"rgb(0, 128, 0)"}},{types:["builtin"],style:{color:"rgb(0, 112, 193)"}},{types:["number","variable","inserted"],style:{color:"rgb(9, 134, 88)"}},{types:["operator"],style:{color:"rgb(0, 0, 0)"}},{types:["constant","char"],style:{color:"rgb(129, 31, 63)"}},{types:["tag"],style:{color:"rgb(128, 0, 0)"}},{types:["attr-name"],style:{color:"rgb(255, 0, 0)"}},{types:["deleted","string"],style:{color:"rgb(163, 21, 21)"}},{types:["changed","punctuation"],style:{color:"rgb(4, 81, 165)"}},{types:["function","keyword"],style:{color:"rgb(0, 0, 255)"}},{types:["class-name"],style:{color:"rgb(38, 127, 153)"}}]},qd=Ud,Gd={plain:{color:"#f8fafc",backgroundColor:"#011627"},styles:[{types:["prolog"],style:{color:"#000080"}},{types:["comment"],style:{color:"#6A9955"}},{types:["builtin","changed","keyword","interpolation-punctuation"],style:{color:"#569CD6"}},{types:["number","inserted"],style:{color:"#B5CEA8"}},{types:["constant"],style:{color:"#f8fafc"}},{types:["attr-name","variable"],style:{color:"#9CDCFE"}},{types:["deleted","string","attr-value","template-punctuation"],style:{color:"#cbd5e1"}},{types:["selector"],style:{color:"#D7BA7D"}},{types:["tag"],style:{color:"#0ea5e9"}},{types:["tag"],languages:["markup"],style:{color:"#0ea5e9"}},{types:["punctuation","operator"],style:{color:"#D4D4D4"}},{types:["punctuation"],languages:["markup"],style:{color:"#808080"}},{types:["function"],style:{color:"#7dd3fc"}},{types:["class-name"],style:{color:"#0ea5e9"}},{types:["char"],style:{color:"#D16969"}}]},Hd=Gd,Kd={plain:{color:"#0f172a",backgroundColor:"#f1f5f9"},styles:[{types:["prolog"],style:{color:"#000080"}},{types:["comment"],style:{color:"#6A9955"}},{types:["builtin","changed","keyword","interpolation-punctuation"],style:{color:"#0c4a6e"}},{types:["number","inserted"],style:{color:"#B5CEA8"}},{types:["constant"],style:{color:"#0f172a"}},{types:["attr-name","variable"],style:{color:"#0c4a6e"}},{types:["deleted","string","attr-value","template-punctuation"],style:{color:"#64748b"}},{types:["selector"],style:{color:"#D7BA7D"}},{types:["tag"],style:{color:"#0ea5e9"}},{types:["tag"],languages:["markup"],style:{color:"#0ea5e9"}},{types:["punctuation","operator"],style:{color:"#475569"}},{types:["punctuation"],languages:["markup"],style:{color:"#808080"}},{types:["function"],style:{color:"#0e7490"}},{types:["class-name"],style:{color:"#0ea5e9"}},{types:["char"],style:{color:"#D16969"}}]},Wd=Kd,Zd={plain:{backgroundColor:"hsl(220, 13%, 18%)",color:"hsl(220, 14%, 71%)",textShadow:"0 1px rgba(0, 0, 0, 0.3)"},styles:[{types:["comment","prolog","cdata"],style:{color:"hsl(220, 10%, 40%)"}},{types:["doctype","punctuation","entity"],style:{color:"hsl(220, 14%, 71%)"}},{types:["attr-name","class-name","maybe-class-name","boolean","constant","number","atrule"],style:{color:"hsl(29, 54%, 61%)"}},{types:["keyword"],style:{color:"hsl(286, 60%, 67%)"}},{types:["property","tag","symbol","deleted","important"],style:{color:"hsl(355, 65%, 65%)"}},{types:["selector","string","char","builtin","inserted","regex","attr-value"],style:{color:"hsl(95, 38%, 62%)"}},{types:["variable","operator","function"],style:{color:"hsl(207, 82%, 66%)"}},{types:["url"],style:{color:"hsl(187, 47%, 55%)"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"hsl(220, 14%, 71%)"}}]},Yd=Zd,Xd={plain:{backgroundColor:"hsl(230, 1%, 98%)",color:"hsl(230, 8%, 24%)"},styles:[{types:["comment","prolog","cdata"],style:{color:"hsl(230, 4%, 64%)"}},{types:["doctype","punctuation","entity"],style:{color:"hsl(230, 8%, 24%)"}},{types:["attr-name","class-name","boolean","constant","number","atrule"],style:{color:"hsl(35, 99%, 36%)"}},{types:["keyword"],style:{color:"hsl(301, 63%, 40%)"}},{types:["property","tag","symbol","deleted","important"],style:{color:"hsl(5, 74%, 59%)"}},{types:["selector","string","char","builtin","inserted","regex","attr-value","punctuation"],style:{color:"hsl(119, 34%, 47%)"}},{types:["variable","operator","function"],style:{color:"hsl(221, 87%, 60%)"}},{types:["url"],style:{color:"hsl(198, 99%, 37%)"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"hsl(230, 8%, 24%)"}}]},Qd=Xd,Jd={plain:{color:"#ebdbb2",backgroundColor:"#292828"},styles:[{types:["imports","class-name","maybe-class-name","constant","doctype","builtin","function"],style:{color:"#d8a657"}},{types:["property-access"],style:{color:"#7daea3"}},{types:["tag"],style:{color:"#e78a4e"}},{types:["attr-name","char","url","regex"],style:{color:"#a9b665"}},{types:["attr-value","string"],style:{color:"#89b482"}},{types:["comment","prolog","cdata","operator","inserted"],style:{color:"#a89984"}},{types:["delimiter","boolean","keyword","selector","important","atrule","property","variable","deleted"],style:{color:"#ea6962"}},{types:["entity","number","symbol"],style:{color:"#d3869b"}}]},eu=Jd,tu={plain:{color:"#654735",backgroundColor:"#f9f5d7"},styles:[{types:["delimiter","boolean","keyword","selector","important","atrule","property","variable","deleted"],style:{color:"#af2528"}},{types:["imports","class-name","maybe-class-name","constant","doctype","builtin"],style:{color:"#b4730e"}},{types:["string","attr-value"],style:{color:"#477a5b"}},{types:["property-access"],style:{color:"#266b79"}},{types:["function","attr-name","char","url"],style:{color:"#72761e"}},{types:["tag"],style:{color:"#b94c07"}},{types:["comment","prolog","cdata","operator","inserted"],style:{color:"#a89984"}},{types:["entity","number","symbol"],style:{color:"#924f79"}}]},su=tu,ru=t=>i.useCallback(s=>{var r=s,{className:a,style:n,line:o}=r,l=tn(r,["className","style","line"]);const c=Ht(ge({},l),{className:ys("token-line",a)});return typeof t=="object"&&"plain"in t&&(c.style=t.plain),typeof n=="object"&&(c.style=ge(ge({},c.style||{}),n)),c},[t]),au=t=>{const s=i.useCallback(({types:r,empty:a})=>{if(t!=null){{if(r.length===1&&r[0]==="plain")return a!=null?{display:"inline-block"}:void 0;if(r.length===1&&a!=null)return t[r[0]]}return Object.assign(a!=null?{display:"inline-block"}:{},...r.map(n=>t[n]))}},[t]);return i.useCallback(r=>{var a=r,{token:n,className:o,style:l}=a,c=tn(a,["token","className","style"]);const d=Ht(ge({},c),{className:ys("token",...n.types,o),children:n.content,style:s(n)});return l!=null&&(d.style=ge(ge({},d.style||{}),l)),d},[s])},nu=/\r\n|\r|\n/,dr=t=>{t.length===0?t.push({types:["plain"],content:` -`,empty:!0}):t.length===1&&t[0].content===""&&(t[0].content=` -`,t[0].empty=!0)},ur=(t,s)=>{const r=t.length;return r>0&&t[r-1]===s?t:t.concat(s)},ou=t=>{const s=[[]],r=[t],a=[0],n=[t.length];let o=0,l=0,c=[];const d=[c];for(;l>-1;){for(;(o=a[l]++)0?m:["plain"],u=y):(m=ur(m,y.type),y.alias&&(m=ur(m,y.alias)),u=y.content),typeof u!="string"){l++,s.push(m),r.push(u),a.push(0),n.push(u.length);continue}const N=u.split(nu),h=N.length;c.push({types:m,content:N[0]});for(let p=1;pi.useMemo(()=>{if(r==null)return pr([s]);const n={code:s,grammar:r,language:a,tokens:[]};return t.hooks.run("before-tokenize",n),n.tokens=t.tokenize(s,r),t.hooks.run("after-tokenize",n),pr(n.tokens)},[s,r,a,t]),lu=(t,s)=>{const{plain:r}=t,a=t.styles.reduce((n,o)=>{const{languages:l,style:c}=o;return l&&!l.includes(s)||o.types.forEach(d=>{const u=ge(ge({},n[d]),c);n[d]=u}),n},{});return a.root=r,a.plain=Ht(ge({},r),{backgroundColor:void 0}),a},cu=lu,du=({children:t,language:s,code:r,theme:a,prism:n})=>{const o=s.toLowerCase(),l=cu(a,o),c=ru(l),d=au(l),u=n.languages[o],m=iu({prism:n,language:o,code:r,grammar:u});return t({tokens:m,className:`prism-code language-${o}`,style:l!=null?l.root:{},getLineProps:c,getTokenProps:d})},uu=t=>i.createElement(du,Ht(ge({},t),{prism:t.prism||k,theme:t.theme||sn,code:t.code,language:t.language}));/*! Bundled license information: - -prismjs/prism.js: - (** - * Prism: Lightweight, robust, elegant syntax highlighting - * - * @license MIT - * @author Lea Verou - * @namespace - * @public - *) -*/const pu=(t,s)=>s.some(r=>{if(typeof r=="number")return t===r;const[a,n]=r.split(":").map(o=>parseInt(o));return a<=t&&t<=n}),mu=(t,s,r)=>r.some(([a,[n,o]])=>a===t&&n<=s&&s<=o),gu=(t,s)=>t.split(new RegExp(`(${s.map(([r])=>r).join("|")})`)).filter(Boolean),fu=t=>t.map(s=>{s=s.startsWith("/")?s:"/"+s;const[,r,a="0:Infinity"]=s.split("/"),[n,o=n]=a.split(":").map(l=>Number(l));return[r,[n,o]]}),rn=(t,s)=>()=>{const r=i.useContext(t);if(r===void 0)throw new Error(s);return r},Kt=t=>Object.assign(i.forwardRef(t),{displayName:t.displayName??t.name}),an=i.createContext(void 0),nn=i.createContext(void 0),on=rn(an,'Could not find nearest component. Please wrap this component with a component imported from "react-code-block".'),zs=rn(nn,'Could not find nearest component. Please wrap this component with component imported from "react-code-block".'),ye=({code:t,words:s=[],lines:r=[],children:a,...n})=>{const o=i.useMemo(()=>fu(s),[s]);return e.jsx(an.Provider,{value:{code:t.trim(),words:o,lines:r,...n},children:a})},hu=({as:t,children:s,...r},a)=>{const{lines:n,words:o,...l}=on(),c=t??"pre";return e.jsx(uu,{...l,children:d=>e.jsx(c,{...r,ref:a,children:d.tokens.map((u,m)=>{const f=m+1,y=pu(f,n);return e.jsx(nn.Provider,{value:{highlight:d,line:u,lineNumber:f},children:typeof s=="function"?s({isLineHighlighted:y,lineNumber:f},m):s},m)})})})},xu=({as:t,children:s,className:r,...a},n)=>{const{highlight:o,line:l}=zs(),{getLineProps:c}=o,d=t??"div";return e.jsx(d,{...c({line:l,className:r}),...a,ref:n,children:s})},bu=({as:t,children:s=({children:o})=>e.jsx("span",{children:o}),className:r,...a},n)=>{const{words:o}=on(),{line:l,highlight:c,lineNumber:d}=zs(),{getTokenProps:u}=c,m=t??"span";return e.jsx(Be.Fragment,{children:l.map((f,y)=>{const{children:N,...h}=u({token:f,className:r}),p=o.length?gu(N,o):[N];return e.jsx(Be.Fragment,{children:p.map((g,x)=>e.jsx(m,{...h,...a,ref:n,children:s({children:g,isTokenHighlighted:mu(g,d,o)})},x))},y)})})},yu=({as:t,...s},r)=>{const{lineNumber:a}=zs(),n=t??"span";return e.jsx(n,{...s,ref:r,children:a})};ye.Code=Kt(hu);ye.LineContent=Kt(xu);ye.Token=Kt(bu);ye.LineNumber=Kt(yu);const vu={plain:{color:"var(--foreground)",backgroundColor:"var(--muted)"},styles:[{types:["comment"],style:{color:"#6e7781",fontStyle:"italic"}},{types:["keyword","selector","changed"],style:{color:"#cf222e"}},{types:["constant","number","builtin"],style:{color:"#0550ae"}},{types:["string","attr-value"],style:{color:"#0a3069"}},{types:["function","attr-name"],style:{color:"#8250df"}},{types:["tag","operator"],style:{color:"#116329"}},{types:["variable","property"],style:{color:"#953800"}},{types:["punctuation"],style:{color:"#24292f"}}]},ju={plain:{color:"var(--foreground)",backgroundColor:"var(--muted)"},styles:[{types:["comment"],style:{color:"#8b949e",fontStyle:"italic"}},{types:["keyword","selector","changed"],style:{color:"#ff7b72"}},{types:["constant","number","builtin"],style:{color:"#79c0ff"}},{types:["string","attr-value"],style:{color:"#a5d6ff"}},{types:["function","attr-name"],style:{color:"#d2a8ff"}},{types:["tag","operator"],style:{color:"#7ee787"}},{types:["variable","property"],style:{color:"#ffa657"}},{types:["punctuation"],style:{color:"#c9d1d9"}}]};function as({code:t,language:s="typescript",fileName:r,className:a,maxLines:n=200}){const[o,l]=i.useState(!1),[c,d]=i.useState(!1),{theme:u}=Fi(),m=async()=>{await navigator.clipboard.writeText(t),l(!0),setTimeout(()=>l(!1),2e3)},f=t.split(` -`),y=f.length>n,N=c?t:f.slice(0,n).join(` -`);return e.jsxs("div",{className:v("relative group rounded-lg overflow-hidden",a),children:[r&&e.jsxs("div",{className:"flex items-center justify-between px-4 py-2 border-b bg-muted/50",children:[e.jsx("div",{className:"text-sm text-muted-foreground",children:r}),e.jsxs(q,{variant:"ghost",size:"icon",className:"h-7 w-7 opacity-0 group-hover:opacity-100 transition-opacity",onClick:m,children:[o?e.jsx(qe,{className:"h-4 w-4"}):e.jsx(Ar,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:"Copy code"})]})]}),e.jsx(ye,{code:N,language:s,theme:u==="dark"?ju:vu,children:e.jsx(ye.Code,{className:"bg-muted/50 p-4 text-sm whitespace-pre-wrap break-words",children:e.jsx(ye.LineContent,{className:"max-w-full",children:e.jsx(ye.Token,{})})})}),y&&e.jsx("div",{className:"flex justify-center p-2 border-t bg-muted/50",children:e.jsx(q,{variant:"ghost",size:"sm",onClick:()=>d(!c),className:"flex items-center gap-2",children:c?e.jsxs(e.Fragment,{children:["Show Less ",e.jsx(Tr,{className:"h-4 w-4"})]}):e.jsxs(e.Fragment,{children:["Show More (",f.length-n," more lines)"," ",e.jsx(ot,{className:"h-4 w-4"})]})})})]})}function wu(t){const[s,r]=i.useState(null),[a,n]=i.useState(!1),[o,l]=i.useState(null);return i.useEffect(()=>{if(!t){l("Node name is required");return}n(!0),l(null),fetch(`/ui/api/v1/proxy/${t}/ui/api/v1/cluster/nodes/self/details`).then(c=>{if(!c.ok)throw new Error(`Failed to fetch node details: ${c.statusText}`);return c.json()}).then(c=>{var d,u;c.target=((u=(d=c.config.match(/target:\s*([^\n]+)/))==null?void 0:d[1])==null?void 0:u.trim())||"",r(c),n(!1)}).catch(c=>{l(c instanceof Error?c.message:"An error occurred"),n(!1)})},[t]),{nodeDetails:s,isLoading:a,error:o}}function Nu(t,s){const[r,a]=i.useState(!1),[n,o]=i.useState(null),[l,c]=i.useState("");return i.useEffect(()=>{if(!s){c("");return}if(!t)return;const d=new AbortController;async function u(){a(!0),o(null);try{const m=await fetch(`/ui/api/v1/proxy/${t}/metrics`,{signal:d.signal});if(!m.ok)throw new Error(`Failed to fetch metrics: ${m.statusText}`);const f=await m.text();c(f)}catch(m){m instanceof Error?o(m.message):o("An unknown error occurred")}finally{a(!1)}}return u(),()=>{d.abort()}},[t,s]),{isLoading:r,error:n,metrics:l}}const ku={Running:"#10B981",Starting:"#F59E0B",New:"#3B82F6",Stopping:"#F59E0B",Terminated:"#6B7280",Failed:"#EF4444"};function Su({services:t}){const s=i.useMemo(()=>{const a=t.reduce((n,{status:o})=>{const l=o;return n.set(l,(n.get(l)||0)+1),n},new Map);return Array.from(a.entries()).sort((n,o)=>o[1]-n[1]).map(([n,o])=>({name:n,value:o,color:ku[n]}))},[t]),r=i.useMemo(()=>t.length,[t]);return s.length===0?null:e.jsxs("div",{className:"h-[180px] w-full flex items-center",children:[e.jsxs("div",{className:"flex-1 relative",children:[e.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none z-10",children:[e.jsx("div",{className:"text-2xl font-bold",children:r}),e.jsx("div",{className:"text-xs text-muted-foreground",children:"Services"})]}),e.jsx(ct,{width:"100%",height:180,children:e.jsxs(Dt,{margin:{top:0,right:0,bottom:0,left:0},children:[e.jsx(Ot,{data:s,cx:"50%",cy:"50%",labelLine:!1,outerRadius:70,innerRadius:50,dataKey:"value",paddingAngle:2,strokeWidth:2,children:s.map(a=>e.jsx($t,{fill:a.color,stroke:"hsl(var(--background))"},`cell-${a.name}`))}),e.jsx(dt,{content:({active:a,payload:n})=>{if(!a||!n||!n[0])return null;const o=n[0].payload;return e.jsxs("div",{className:"bg-background border rounded-lg shadow-lg px-3 py-2 flex items-center gap-2",children:[e.jsx("div",{className:"w-2.5 h-2.5 rounded-sm",style:{backgroundColor:o.color}}),e.jsx("span",{className:"text-sm font-medium",children:o.name}),e.jsx("span",{className:"text-sm font-semibold",children:o.value})]})}})]})})]}),e.jsx("div",{className:"flex flex-col gap-1.5 min-w-[120px] pl-4",children:s.map(a=>e.jsxs("div",{className:"flex items-center justify-between gap-2 text-sm",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-2 h-2 rounded-full shrink-0",style:{backgroundColor:a.color}}),e.jsx("span",{className:"text-muted-foreground",children:a.name})]}),e.jsx("span",{className:"font-medium tabular-nums",children:a.value})]},a.name))})]})}const Eu=t=>{switch(t){case"Running":return"text-green-600 dark:text-green-400";case"Starting":return"text-yellow-600 dark:text-yellow-400";case"Failed":return"text-red-600 dark:text-red-400";case"New":return"text-blue-600 dark:text-blue-400";case"Terminated":return"text-gray-600 dark:text-gray-400";default:return"text-gray-600 dark:text-gray-400"}};function Cu({services:t}){return e.jsx(pt,{className:"h-[180px] rounded-md border",children:e.jsxs(Ce,{children:[e.jsx(Te,{children:e.jsxs(X,{children:[e.jsx(D,{children:"Service"}),e.jsx(D,{className:"text-right",children:"Status"})]})}),e.jsx(Re,{children:t.map(s=>e.jsxs(X,{className:"hover:bg-muted/50",children:[e.jsx(F,{className:"font-medium",children:s.service}),e.jsx(F,{className:`text-right ${Eu(s.status)} font-medium`,children:s.status})]},s.service))})]})})}const Tu={aws:"text-yellow-600 bg-yellow-100 dark:bg-yellow-950 dark:text-yellow-400","aws-dynamo":"text-yellow-600 bg-yellow-100 dark:bg-yellow-950 dark:text-yellow-400",s3:"text-yellow-600 bg-yellow-100 dark:bg-yellow-950 dark:text-yellow-400",azure:"text-blue-600 bg-blue-100 dark:bg-blue-950 dark:text-blue-400",gcp:"text-blue-600 bg-blue-100 dark:bg-blue-950 dark:text-blue-400","gcp-columnkey":"text-blue-600 bg-blue-100 dark:bg-blue-950 dark:text-blue-400",gcs:"text-blue-600 bg-blue-100 dark:bg-blue-950 dark:text-blue-400",alibabacloud:"text-orange-600 bg-orange-100 dark:bg-orange-950 dark:text-orange-400",filesystem:"text-gray-600 bg-gray-100 dark:bg-gray-800 dark:text-gray-400",local:"text-gray-600 bg-gray-100 dark:bg-gray-800 dark:text-gray-400",boltdb:"text-emerald-600 bg-emerald-100 dark:bg-emerald-950 dark:text-emerald-400",cassandra:"text-blue-700 bg-blue-100 dark:bg-blue-950 dark:text-blue-400",bigtable:"text-red-600 bg-red-100 dark:bg-red-950 dark:text-red-400","bigtable-hashed":"text-red-600 bg-red-100 dark:bg-red-950 dark:text-red-400",bos:"text-cyan-600 bg-cyan-100 dark:bg-cyan-950 dark:text-cyan-400",cos:"text-green-600 bg-green-100 dark:bg-green-950 dark:text-green-400",swift:"text-orange-600 bg-orange-100 dark:bg-orange-950 dark:text-orange-400",inmemory:"text-purple-600 bg-purple-100 dark:bg-purple-950 dark:text-purple-400","grpc-store":"text-indigo-600 bg-indigo-100 dark:bg-indigo-950 dark:text-indigo-400"};function Ru({type:t,className:s}){const r=t.toLowerCase(),a=Tu[r]||"text-gray-600 bg-gray-100 dark:bg-gray-800 dark:text-gray-400";return e.jsx("span",{className:v("inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium",a,s),children:r})}const Au=Ee("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),le=i.forwardRef(({className:t,...s},r)=>e.jsx(yr,{ref:r,className:v(Au(),t),...s}));le.displayName=yr.displayName;function _u(t){const[s,r]=i.useState("info"),[a,n]=i.useState(!1),[o,l]=i.useState(null),[c,d]=i.useState(!1),u=f=>{const y=f.message.match(/Current log level is (\w+)/);return(y==null?void 0:y[1])||"info"};return i.useEffect(()=>{async function f(){if(t){n(!0),l(null);try{const y=await fetch(`/ui/api/v1/proxy/${t}/log_level`);if(!y.ok)throw new Error(`Failed to fetch log level: ${y.statusText}`);const N=await y.json();r(u(N))}catch(y){l(y instanceof Error?y.message:"Failed to fetch log level")}finally{n(!1)}}}f()},[t]),{logLevel:s,isLoading:a,error:o,success:c,setLogLevel:async f=>{if(t){n(!0),l(null),d(!1);try{const y=await fetch(`/ui/api/v1/proxy/${t}/log_level?log_level=${f}`,{method:"POST"});if(!y.ok)throw new Error(`Failed to update log level: ${y.statusText}`);const N=await y.json();if(N.status==="success"&&N.message.includes(f))r(f),d(!0),setTimeout(()=>d(!1),3e3);else throw new Error("Failed to update log level: Unexpected response")}catch(y){l(y instanceof Error?y.message:"Failed to update log level")}finally{n(!1)}}}}}const Iu=["debug","info","warn","error"];function Fu({nodeName:t,className:s}){const{logLevel:r,isLoading:a,error:n,success:o,setLogLevel:l}=_u(t),c=d=>{l(d)};return e.jsxs("div",{className:"relative flex items-center gap-2",children:[e.jsxs(Tt,{value:r,onValueChange:c,disabled:a,children:[e.jsx(et,{className:v("w-[180px]",s,a&&"opacity-50 cursor-not-allowed"),children:e.jsx(Rt,{placeholder:"Select log level"})}),e.jsx(tt,{children:Iu.map(d=>e.jsx(ze,{value:d,children:d},d))})]}),e.jsx(Ms,{children:e.jsxs(st,{children:[e.jsx(rt,{asChild:!0,children:e.jsxs("div",{className:v("absolute -right-6 transition-all duration-300 ease-in-out",o||n?"opacity-100 translate-x-0":"opacity-0 translate-x-2"),children:[o&&e.jsx(qe,{className:"h-4 w-4 text-green-500 animate-in zoom-in-50 duration-300"}),n&&e.jsx(nt,{className:"h-4 w-4 text-red-500 animate-in zoom-in-50 duration-300"})]})}),e.jsxs(Ue,{side:"right",className:"text-xs",children:[o&&"Log level updated successfully",n&&n]})]})})]})}const ln=i.forwardRef(({className:t,...s},r)=>e.jsx(Br,{className:v("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",t),...s,ref:r,children:e.jsx(di,{className:v("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));ln.displayName=Br.displayName;function Lu(t){return js({tag:"svg",attr:{viewBox:"0 0 384 512"},child:[{tag:"path",attr:{d:"M318.7 268.7c-.2-36.7 16.4-64.4 50-84.8-18.8-26.9-47.2-41.7-84.7-44.6-35.5-2.8-74.3 20.7-88.5 20.7-15 0-49.4-19.7-76.4-19.7C63.3 141.2 4 184.8 4 273.5q0 39.3 14.4 81.2c12.8 36.7 59 126.7 107.2 125.2 25.2-.6 43-17.9 75.8-17.9 31.8 0 48.3 17.9 76.4 17.9 48.6-.7 90.4-82.5 102.6-119.3-65.2-30.7-61.7-90-61.7-91.9zm-56.6-164.2c27.3-32.4 24.8-61.9 24-72.5-24.1 1.4-52 16.4-67.9 34.9-17.5 19.8-27.8 44.3-25.6 71.9 26.1 2 49.9-11.4 69.5-34.3z"},child:[]}]})(t)}function Pu(t){return js({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M220.8 123.3c1 .5 1.8 1.7 3 1.7 1.1 0 2.8-.4 2.9-1.5.2-1.4-1.9-2.3-3.2-2.9-1.7-.7-3.9-1-5.5-.1-.4.2-.8.7-.6 1.1.3 1.3 2.3 1.1 3.4 1.7zm-21.9 1.7c1.2 0 2-1.2 3-1.7 1.1-.6 3.1-.4 3.5-1.6.2-.4-.2-.9-.6-1.1-1.6-.9-3.8-.6-5.5.1-1.3.6-3.4 1.5-3.2 2.9.1 1 1.8 1.5 2.8 1.4zM420 403.8c-3.6-4-5.3-11.6-7.2-19.7-1.8-8.1-3.9-16.8-10.5-22.4-1.3-1.1-2.6-2.1-4-2.9-1.3-.8-2.7-1.5-4.1-2 9.2-27.3 5.6-54.5-3.7-79.1-11.4-30.1-31.3-56.4-46.5-74.4-17.1-21.5-33.7-41.9-33.4-72C311.1 85.4 315.7.1 234.8 0 132.4-.2 158 103.4 156.9 135.2c-1.7 23.4-6.4 41.8-22.5 64.7-18.9 22.5-45.5 58.8-58.1 96.7-6 17.9-8.8 36.1-6.2 53.3-6.5 5.8-11.4 14.7-16.6 20.2-4.2 4.3-10.3 5.9-17 8.3s-14 6-18.5 14.5c-2.1 3.9-2.8 8.1-2.8 12.4 0 3.9.6 7.9 1.2 11.8 1.2 8.1 2.5 15.7.8 20.8-5.2 14.4-5.9 24.4-2.2 31.7 3.8 7.3 11.4 10.5 20.1 12.3 17.3 3.6 40.8 2.7 59.3 12.5 19.8 10.4 39.9 14.1 55.9 10.4 11.6-2.6 21.1-9.6 25.9-20.2 12.5-.1 26.3-5.4 48.3-6.6 14.9-1.2 33.6 5.3 55.1 4.1.6 2.3 1.4 4.6 2.5 6.7v.1c8.3 16.7 23.8 24.3 40.3 23 16.6-1.3 34.1-11 48.3-27.9 13.6-16.4 36-23.2 50.9-32.2 7.4-4.5 13.4-10.1 13.9-18.3.4-8.2-4.4-17.3-15.5-29.7zM223.7 87.3c9.8-22.2 34.2-21.8 44-.4 6.5 14.2 3.6 30.9-4.3 40.4-1.6-.8-5.9-2.6-12.6-4.9 1.1-1.2 3.1-2.7 3.9-4.6 4.8-11.8-.2-27-9.1-27.3-7.3-.5-13.9 10.8-11.8 23-4.1-2-9.4-3.5-13-4.4-1-6.9-.3-14.6 2.9-21.8zM183 75.8c10.1 0 20.8 14.2 19.1 33.5-3.5 1-7.1 2.5-10.2 4.6 1.2-8.9-3.3-20.1-9.6-19.6-8.4.7-9.8 21.2-1.8 28.1 1 .8 1.9-.2-5.9 5.5-15.6-14.6-10.5-52.1 8.4-52.1zm-13.6 60.7c6.2-4.6 13.6-10 14.1-10.5 4.7-4.4 13.5-14.2 27.9-14.2 7.1 0 15.6 2.3 25.9 8.9 6.3 4.1 11.3 4.4 22.6 9.3 8.4 3.5 13.7 9.7 10.5 18.2-2.6 7.1-11 14.4-22.7 18.1-11.1 3.6-19.8 16-38.2 14.9-3.9-.2-7-1-9.6-2.1-8-3.5-12.2-10.4-20-15-8.6-4.8-13.2-10.4-14.7-15.3-1.4-4.9 0-9 4.2-12.3zm3.3 334c-2.7 35.1-43.9 34.4-75.3 18-29.9-15.8-68.6-6.5-76.5-21.9-2.4-4.7-2.4-12.7 2.6-26.4v-.2c2.4-7.6.6-16-.6-23.9-1.2-7.8-1.8-15 .9-20 3.5-6.7 8.5-9.1 14.8-11.3 10.3-3.7 11.8-3.4 19.6-9.9 5.5-5.7 9.5-12.9 14.3-18 5.1-5.5 10-8.1 17.7-6.9 8.1 1.2 15.1 6.8 21.9 16l19.6 35.6c9.5 19.9 43.1 48.4 41 68.9zm-1.4-25.9c-4.1-6.6-9.6-13.6-14.4-19.6 7.1 0 14.2-2.2 16.7-8.9 2.3-6.2 0-14.9-7.4-24.9-13.5-18.2-38.3-32.5-38.3-32.5-13.5-8.4-21.1-18.7-24.6-29.9s-3-23.3-.3-35.2c5.2-22.9 18.6-45.2 27.2-59.2 2.3-1.7.8 3.2-8.7 20.8-8.5 16.1-24.4 53.3-2.6 82.4.6-20.7 5.5-41.8 13.8-61.5 12-27.4 37.3-74.9 39.3-112.7 1.1.8 4.6 3.2 6.2 4.1 4.6 2.7 8.1 6.7 12.6 10.3 12.4 10 28.5 9.2 42.4 1.2 6.2-3.5 11.2-7.5 15.9-9 9.9-3.1 17.8-8.6 22.3-15 7.7 30.4 25.7 74.3 37.2 95.7 6.1 11.4 18.3 35.5 23.6 64.6 3.3-.1 7 .4 10.9 1.4 13.8-35.7-11.7-74.2-23.3-84.9-4.7-4.6-4.9-6.6-2.6-6.5 12.6 11.2 29.2 33.7 35.2 59 2.8 11.6 3.3 23.7.4 35.7 16.4 6.8 35.9 17.9 30.7 34.8-2.2-.1-3.2 0-4.2 0 3.2-10.1-3.9-17.6-22.8-26.1-19.6-8.6-36-8.6-38.3 12.5-12.1 4.2-18.3 14.7-21.4 27.3-2.8 11.2-3.6 24.7-4.4 39.9-.5 7.7-3.6 18-6.8 29-32.1 22.9-76.7 32.9-114.3 7.2zm257.4-11.5c-.9 16.8-41.2 19.9-63.2 46.5-13.2 15.7-29.4 24.4-43.6 25.5s-26.5-4.8-33.7-19.3c-4.7-11.1-2.4-23.1 1.1-36.3 3.7-14.2 9.2-28.8 9.9-40.6.8-15.2 1.7-28.5 4.2-38.7 2.6-10.3 6.6-17.2 13.7-21.1.3-.2.7-.3 1-.5.8 13.2 7.3 26.6 18.8 29.5 12.6 3.3 30.7-7.5 38.4-16.3 9-.3 15.7-.9 22.6 5.1 9.9 8.5 7.1 30.3 17.1 41.6 10.6 11.6 14 19.5 13.7 24.6zM173.3 148.7c2 1.9 4.7 4.5 8 7.1 6.6 5.2 15.8 10.6 27.3 10.6 11.6 0 22.5-5.9 31.8-10.8 4.9-2.6 10.9-7 14.8-10.4s5.9-6.3 3.1-6.6-2.6 2.6-6 5.1c-4.4 3.2-9.7 7.4-13.9 9.8-7.4 4.2-19.5 10.2-29.9 10.2s-18.7-4.8-24.9-9.7c-3.1-2.5-5.7-5-7.7-6.9-1.5-1.4-1.9-4.6-4.3-4.9-1.4-.1-1.8 3.7 1.7 6.5z"},child:[]}]})(t)}function Du(t){return js({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M0 93.7l183.6-25.3v177.4H0V93.7zm0 324.6l183.6 25.3V268.4H0v149.9zm203.8 28L448 480V268.4H203.8v177.9zm0-380.6v180.1H448V32L203.8 65.7z"},child:[]}]})(t)}const Ou=t=>{const s=t.toLowerCase();return s.includes("darwin")||s.includes("mac")?e.jsx(Lu,{className:"h-4 w-4"}):s.includes("linux")?e.jsx(Pu,{className:"h-4 w-4"}):s.includes("windows")?e.jsx(Du,{className:"h-4 w-4"}):null},$u=t=>{const s=t.toLowerCase();return s==="oss"?"bg-blue-500/20 text-blue-700 dark:bg-blue-500/30 dark:text-blue-300 hover:bg-blue-500/30":s==="enterprise"?"bg-yellow-500/20 text-yellow-700 dark:bg-yellow-500/30 dark:text-yellow-300 hover:bg-yellow-500/30":""};function Mu({build:t,edition:s,os:r,arch:a}){const n=Ou(r);return e.jsxs(ee,{children:[e.jsx(se,{children:e.jsx(ae,{children:"Version Information"})}),e.jsx(te,{children:e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(le,{children:"Version"}),e.jsx("p",{className:"text-sm",children:t.version})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(le,{children:"Branch"}),e.jsx("p",{className:"text-sm",children:t.branch})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(le,{children:"Go Version"}),e.jsx("p",{className:"text-sm",children:t.goVersion})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(le,{children:"Edition"}),e.jsx("div",{children:e.jsx(be,{className:$u(s),children:s.toUpperCase()})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(le,{children:"Architecture"}),e.jsx("p",{className:"text-sm",children:a})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(le,{children:"OS"}),e.jsxs("div",{className:"flex items-center gap-2",children:[n,e.jsx("p",{className:"text-sm",children:r})]})]})]})]})})]})}function Bu({nodeName:t,className:s}){const[r,a]=i.useState({isReady:!1,message:"Checking status..."}),[n,o]=i.useState(!0);return i.useEffect(()=>{const l=async()=>{try{const u=await fetch(`/ui/api/v1/proxy/${t}/ready`),m=await u.text();a({isReady:u.ok&&m.includes("ready"),message:u.ok?"Ready":m})}catch(u){a({isReady:!1,message:u instanceof Error?u.message:"Failed to check status"})}};l();const c=setInterval(l,3e3),d=setInterval(()=>{o(u=>!u)},1e3);return()=>{clearInterval(c),clearInterval(d)}},[t]),e.jsxs("div",{className:v("flex items-center gap-2",s),children:[e.jsx("span",{className:v("text-sm",r.isReady?"text-muted-foreground":"text-red-500"),children:r.message}),e.jsx("div",{className:v("h-2.5 w-2.5 rounded-full transition-opacity duration-150",r.isReady?"bg-green-500":"bg-red-500",n?"opacity-100":"opacity-30")})]})}const zu=[{name:"allocs",description:"A sampling of all past memory allocations"},{name:"block",description:"Stack traces that led to blocking on synchronization primitives"},{name:"heap",description:"A sampling of memory allocations of live objects"},{name:"mutex",description:"Stack traces of holders of contended mutexes"},{name:"profile",urlSuffix:"?seconds=15",description:"CPU profile (15 seconds)",displayName:"profile"},{name:"goroutine",description:"Stack traces of all current goroutines (debug=1)",variants:[{suffix:"?debug=0",label:"Basic",description:"Basic goroutine info"},{suffix:"?debug=1",label:"Standard",description:"Standard goroutine stack traces"},{suffix:"?debug=2",label:"Full",description:"Full goroutine stack dump with additional info"}]},{name:"threadcreate",description:"Stack traces that led to the creation of new OS threads",urlSuffix:"?debug=1",displayName:"threadcreate"},{name:"trace",description:"A trace of execution of the current program",urlSuffix:"?debug=1",displayName:"trace"}];function Vu({nodeName:t}){const s=r=>{window.open(`/ui/api/v1/proxy/${t}/debug/pprof/${r}`,"_blank")};return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm font-medium",children:"Profiling Tools:"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:zu.map(r=>r.variants?r.variants.map(a=>e.jsxs(st,{children:[e.jsx(rt,{asChild:!0,children:e.jsx(q,{variant:"outline",size:"sm",onClick:()=>s(`${r.name}${a.suffix}`),children:`${r.name} (${a.label})`})}),e.jsx(Ue,{children:e.jsx("p",{children:a.description})})]},`${r.name}${a.suffix}`)):e.jsxs(st,{children:[e.jsx(rt,{asChild:!0,children:e.jsx(q,{variant:"outline",size:"sm",onClick:()=>s(`${r.name}${r.urlSuffix||""}`),children:r.displayName||r.name})}),e.jsx(Ue,{children:e.jsx("p",{children:r.description})})]},r.name))})]})}function Uu(){const{nodeName:t}=Nr(),[s,r]=i.useState("config"),{nodeDetails:a,isLoading:n,error:o}=wu(t),{metrics:l,isLoading:c,error:d}=Nu(t,s==="raw-metrics"),[u,m]=i.useState(!1);return n?e.jsx("div",{className:"container space-y-6 p-6",children:e.jsxs("div",{className:"flex items-center justify-center",children:[e.jsx("div",{className:"h-6 w-6 animate-spin rounded-full border-2 border-primary border-t-transparent"}),e.jsx("span",{className:"ml-2 text-sm text-muted-foreground",children:"Loading..."})]})}):a?e.jsx(ke,{children:e.jsxs(ee,{children:[e.jsx(se,{children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"flex-1",children:e.jsx(ae,{children:e.jsx("h2",{className:"text-3xl font-semibold tracking-tight",children:e.jsxs("div",{className:"flex items-center gap-2",children:[a.target," - ",t,e.jsx($s,{text:t||""})]})})})}),e.jsx(Bu,{nodeName:t||""})]})}),e.jsxs(te,{className:"space-y-6",children:[e.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[e.jsx(Mu,{build:a.build,edition:a.edition,os:a.os,arch:a.arch}),e.jsxs(ee,{children:[e.jsx(se,{children:e.jsx(ae,{children:"Cluster Information"})}),e.jsx(te,{children:e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(le,{children:"Cluster ID"}),e.jsx("p",{className:"text-sm",children:a.clusterID})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(le,{children:"Created"}),e.jsx("p",{className:"text-sm",children:wt(a.clusterSeededAt,"PPpp")})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(le,{children:"Storage"}),e.jsx("p",{children:e.jsx(Ru,{type:(a.metrics.store_object_type||"filesystem").toLowerCase(),className:""})})]})]})})]}),e.jsxs(ee,{children:[e.jsxs(se,{className:"flex flex-row items-center justify-between",children:[e.jsx(ae,{children:"Service Status"}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(le,{htmlFor:"view-mode",children:"Table View"}),e.jsx(ln,{id:"view-mode",checked:u,onCheckedChange:m})]})]}),e.jsx(te,{children:u?e.jsx(Cu,{services:a.services}):e.jsx(Su,{services:a.services})})]})]}),e.jsxs("div",{className:"flex items-center gap-6",children:[e.jsxs("div",{className:"flex items-center gap-2 mr-4",children:[e.jsx(le,{children:"Log Level"}),e.jsx(Fu,{nodeName:t||""})]}),e.jsx(Vu,{nodeName:t||""})]}),e.jsx("div",{children:e.jsxs(od,{defaultValue:"config",onValueChange:r,children:[e.jsxs(Qa,{children:[e.jsx(yt,{value:"config",children:"Configuration"}),e.jsx(yt,{value:"metrics",children:"Analytics"}),e.jsx(yt,{value:"raw-metrics",children:"Raw Metrics"})]}),e.jsx(vt,{value:"config",className:"mt-6",children:e.jsx(as,{language:"yaml",code:a.config,fileName:"loki.yaml"})}),e.jsx(vt,{value:"metrics",className:"mt-6",children:a.metrics&&e.jsx(as,{code:JSON.stringify(a.metrics,null,2),language:"json",fileName:"analytics.json"})}),e.jsx(vt,{value:"raw-metrics",className:"mt-6",children:c?e.jsxs("div",{className:"flex items-center justify-center p-6",children:[e.jsx("div",{className:"h-6 w-6 animate-spin rounded-full border-2 border-primary border-t-transparent"}),e.jsx("span",{className:"ml-2 text-sm text-muted-foreground",children:"Loading metrics..."})]}):d?e.jsx("div",{className:"bg-red-50 dark:bg-red-900 border-l-4 border-red-400 p-4",children:e.jsx("p",{className:"text-sm text-red-700 dark:text-red-200",children:d})}):l?e.jsx(as,{code:l,language:"yaml",fileName:"metrics"}):null})]})})]})]})}):e.jsx("div",{className:"container space-y-6 p-6",children:e.jsx("div",{className:"bg-red-50 dark:bg-red-900 border-l-4 border-red-400 p-4",children:e.jsx("div",{className:"flex",children:e.jsx("div",{className:"ml-3",children:e.jsx("p",{className:"text-sm text-red-700 dark:text-red-200",children:o||`Node "${t}" not found`})})})})})}function qu(){return e.jsx(Xa,{children:e.jsx(Uu,{})})}function Ae(){return e.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[80vh] p-4",children:[e.jsx(Uo,{className:"h-16 w-16 text-muted-foreground mb-6"}),e.jsx("h1",{className:"text-4xl font-bold text-center mb-4",children:"Coming Soon"}),e.jsx("p",{className:"text-lg text-muted-foreground text-center max-w-md",children:"We're working hard to bring you this feature. Stay tuned for updates!"})]})}const cn=Ee("inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent shadow-sm hover:bg-accent hover:text-accent-foreground"},size:{default:"h-9 px-2 min-w-9",sm:"h-8 px-1.5 min-w-8",lg:"h-10 px-2.5 min-w-10"}},defaultVariants:{variant:"default",size:"default"}}),Gu=i.forwardRef(({className:t,variant:s,size:r,...a},n)=>e.jsx(zr,{ref:n,className:v(cn({variant:s,size:r,className:t})),...a}));Gu.displayName=zr.displayName;const dn=i.createContext({size:"default",variant:"default"}),un=i.forwardRef(({className:t,variant:s,size:r,children:a,...n},o)=>e.jsx(Vr,{ref:o,className:v("flex items-center justify-center gap-1",t),...n,children:e.jsx(dn.Provider,{value:{variant:s,size:r},children:a})}));un.displayName=Vr.displayName;const pn=i.forwardRef(({className:t,children:s,variant:r,size:a,...n},o)=>{const l=i.useContext(dn);return e.jsx(Ur,{ref:o,className:v(cn({variant:l.variant||r,size:l.size||a}),t),...n,children:s})});pn.displayName=Ur.displayName;const _t={Received:"received",Processing:"processed"},Hu=t=>{const{cluster:s}=ue(),r=i.useMemo(()=>Oe(s==null?void 0:s.members,ya.compactor),[s==null?void 0:s.members]),{data:a,isLoading:n,error:o}=Mt({queryKey:["deletes",t,r],queryFn:async()=>{try{return(await Promise.all(t.map(async c=>{const d=await fetch(`/ui/api/v1/proxy/${r}/compactor/ui/api/v1/deletes?status=${c}`);if(!d.ok){const u=await d.text();throw new Error(u||`HTTP error! status: ${d.status}`)}return d.json()}))).flat()}catch(l){throw l instanceof Error?l:new Error("Failed to fetch delete requests")}},enabled:!!r});return{data:a,isLoading:n,error:o}},Ku=({selectedStatus:t,onStatusChange:s,queryFilter:r,onQueryFilterChange:a})=>e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm font-medium",children:"Status"}),e.jsx(un,{type:"multiple",value:t,onValueChange:n=>{n.length>0&&s(n)},className:"justify-start",children:Object.entries(_t).map(([n,o])=>e.jsx(pn,{value:o,"aria-label":`Toggle ${n.toLowerCase()} status`,className:"capitalize",children:n},o))})]}),e.jsx(xe,{type:"search",placeholder:"Filter by query...",value:r,onChange:n=>a(n.target.value),className:"w-[300px]"})]}),Wu=({status:t})=>{const s=t===_t.Received?"secondary":"default";return e.jsx(be,{variant:s,className:"capitalize",children:t})},Zu=({start:t,end:s})=>{const r=Jo(Zs(t/1e3),Zs(s/1e3)),a=n=>{const o=new Date(n);return wt(new Date(o.getTime()+o.getTimezoneOffset()*6e4),"yyyy-MM-dd HH:mm:ss")};return e.jsxs(Vt,{children:[e.jsx(Ut,{children:e.jsx("span",{className:"cursor-default",children:r})}),e.jsx(mt,{className:"w-fit",children:e.jsx("div",{className:"space-y-2",children:e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"px-2 py-0.5 text-xs font-medium bg-gray-100 rounded dark:bg-gray-700 w-14 text-center",children:"From"}),e.jsx("span",{className:"font-mono",children:a(t)})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"px-2 py-0.5 text-xs font-medium bg-gray-100 rounded dark:bg-gray-700 w-14 text-center",children:"To"}),e.jsx("span",{className:"font-mono",children:a(s)})]})]})})})]})},Yu=({requests:t,sortField:s,sortDirection:r,onSort:a})=>{const n=[...t].sort((o,l)=>{let c=0,d,u;switch(s){case"status":c=o.status.localeCompare(l.status);break;case"user":c=o.user_id.localeCompare(l.user_id);break;case"createdAt":c=o.created_at-l.created_at;break;case"duration":d=o.end_time-o.start_time,u=l.end_time-l.start_time,c=d-u;break}return r==="asc"?c:-c});return e.jsx("div",{className:"rounded-md border bg-card",children:e.jsxs(Ce,{children:[e.jsx(Te,{children:e.jsxs(X,{className:"hover:bg-transparent",children:[e.jsx(D,{className:"w-[80px]",children:e.jsx(Z,{title:"Status",field:"status",sortField:s,sortDirection:r,onSort:a})}),e.jsx(D,{className:"w-[100px]",children:e.jsx(Z,{title:"User",field:"user",sortField:s,sortDirection:r,onSort:a})}),e.jsx(D,{className:"w-[200px]",children:e.jsx(Z,{title:"Created At",field:"createdAt",sortField:s,sortDirection:r,onSort:a})}),e.jsx(D,{className:"w-[150px]",children:e.jsx(Z,{title:"Range",field:"duration",sortField:s,sortDirection:r,onSort:a})}),e.jsx(D,{className:"w-[100px]",children:"Deleted Lines"}),e.jsx(D,{children:"Query"})]})}),e.jsxs(Re,{children:[n.map(o=>e.jsxs(X,{children:[e.jsx(F,{className:"px-4",children:e.jsx(Wu,{status:o.status})}),e.jsx(F,{children:o.user_id}),e.jsx(F,{children:e.jsx(Os,{date:new Date(o.created_at)})}),e.jsx(F,{children:e.jsx(Zu,{start:o.start_time,end:o.end_time})}),e.jsx(F,{children:o.deleted_lines}),e.jsx(F,{children:e.jsx("code",{className:"font-mono text-sm whitespace-pre-wrap break-all",children:o.query})})]},`${o.request_id}-${o.start_time}-${o.end_time}`)),n.length===0&&e.jsx(X,{children:e.jsx(F,{colSpan:7,className:"h-24 text-center",children:e.jsx("div",{className:"text-muted-foreground",children:"No delete requests found"})})})]})]})})},Xu=()=>{const[t,s]=i.useState([_t.Received,_t.Processing]),[r,a]=i.useState(""),[n,o]=i.useState("createdAt"),[l,c]=i.useState("desc"),{data:d,isLoading:u,error:m}=Hu(t),f=i.useMemo(()=>!d||!r?d:d.filter(N=>N.query.toLowerCase().includes(r.toLowerCase())),[d,r]),y=N=>{N===n?c(l==="asc"?"desc":"asc"):(o(N),c("desc"))};return e.jsx(ke,{children:e.jsxs(ee,{className:"shadow-sm",children:[e.jsx(se,{children:e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-3xl font-semibold tracking-tight",children:"Delete Requests"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"View and manage delete requests in your cluster"})]}),e.jsx(q,{variant:"default",asChild:!0,children:e.jsxs(ce,{to:"/tenants/deletes/new",children:[e.jsx(qo,{className:"mr-2 h-4 w-4"}),"New Delete Request"]})})]}),e.jsx(Ku,{selectedStatus:t,onStatusChange:s,queryFilter:r,onQueryFilterChange:a})]})}),e.jsx(te,{children:e.jsxs("div",{className:"space-y-4",children:[m&&e.jsxs(Ge,{variant:"destructive",children:[e.jsx(nt,{className:"h-4 w-4"}),e.jsx(He,{children:"Error"}),e.jsx(Ke,{children:m.message})]}),u&&e.jsx("div",{className:"flex items-center justify-center p-8",children:e.jsx(he,{className:"h-16 w-16 animate-spin"})}),!u&&!m&&f&&e.jsx(Yu,{requests:f,sortField:n,sortDirection:l,onSort:y})]})})]})})},mn=Pi,gn=i.createContext({}),Ie=({...t})=>e.jsx(gn.Provider,{value:{name:t.name},children:e.jsx(Di,{...t})}),Wt=()=>{const t=i.useContext(gn),s=i.useContext(fn),{getFieldState:r,formState:a}=Li(),n=r(t.name,a);if(!t)throw new Error("useFormField should be used within ");const{id:o}=s;return{id:o,name:t.name,formItemId:`${o}-form-item`,formDescriptionId:`${o}-form-item-description`,formMessageId:`${o}-form-item-message`,...n}},fn=i.createContext({}),ve=i.forwardRef(({className:t,...s},r)=>{const a=i.useId();return e.jsx(fn.Provider,{value:{id:a},children:e.jsx("div",{ref:r,className:v("space-y-2",t),...s})})});ve.displayName="FormItem";const fe=i.forwardRef(({className:t,...s},r)=>{const{error:a,formItemId:n}=Wt();return e.jsx(le,{ref:r,className:v(a&&"text-destructive",t),htmlFor:n,...s})});fe.displayName="FormLabel";const je=i.forwardRef(({...t},s)=>{const{error:r,formItemId:a,formDescriptionId:n,formMessageId:o}=Wt();return e.jsx(Se,{ref:s,id:a,"aria-describedby":r?`${n} ${o}`:`${n}`,"aria-invalid":!!r,...t})});je.displayName="FormControl";const hn=i.forwardRef(({className:t,...s},r)=>{const{formDescriptionId:a}=Wt();return e.jsx("p",{ref:r,id:a,className:v("text-[0.8rem] text-muted-foreground",t),...s})});hn.displayName="FormDescription";const we=i.forwardRef(({className:t,children:s,...r},a)=>{const{error:n,formMessageId:o}=Wt(),l=n?String(n==null?void 0:n.message):s;return l?e.jsx("p",{ref:a,id:o,className:v("text-[0.8rem] font-medium text-destructive",t),...r,children:l}):null});we.displayName="FormMessage";const xn=i.forwardRef(({className:t,...s},r)=>e.jsx("textarea",{className:v("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",t),ref:r,...s}));xn.displayName="Textarea";var Qu=function(t,s){for(var r={};t.length;){var a=t[0],n=a.code,o=a.message,l=a.path.join(".");if(!r[l])if("unionErrors"in a){var c=a.unionErrors[0].errors[0];r[l]={message:c.message,type:c.code}}else r[l]={message:o,type:n};if("unionErrors"in a&&a.unionErrors.forEach(function(m){return m.errors.forEach(function(f){return t.push(f)})}),s){var d=r[l].types,u=d&&d[a.code];r[l]=Mi(l,s,r,n,u?[].concat(u,a.message):a.message)}t.shift()}return r},bn=function(t,s,r){return r===void 0&&(r={}),function(a,n,o){try{return Promise.resolve(function(l,c){try{var d=Promise.resolve(t[r.mode==="sync"?"parse":"parseAsync"](a,s)).then(function(u){return o.shouldUseNativeValidation&&Oi({},o),{errors:{},values:r.raw?a:u}})}catch(u){return c(u)}return d&&d.then?d.then(void 0,c):d}(0,function(l){if(function(c){return Array.isArray(c==null?void 0:c.errors)}(l))return{values:{},errors:$i(Qu(l.errors,!o.shouldUseNativeValidation&&o.criteriaMode==="all"),o)};throw l}))}catch(l){return Promise.reject(l)}}};const Ju=ia({tenant_id:Ye().min(1,"Tenant ID is required"),query:Ye().min(1,"Query is required"),start_time:Xs(),end_time:Xs().refine(t=>t>new Date(Date.now()-7*24*60*60*1e3),"End time must be after start time")}),ep=()=>{const t=It(),s=Ai(),[r,a]=i.useState(null),[n,o]=i.useState(!1),{cluster:l}=ue(),c=i.useMemo(()=>Oe(l==null?void 0:l.members,ya.compactor),[l==null?void 0:l.members]),d=la({resolver:bn(Ju),defaultValues:{tenant_id:"",query:"",start_time:new Date(Date.now()-7*24*60*60*1e3),end_time:new Date}}),u=i.useCallback(async(N,h=!1)=>{if(N.trim()){o(!0);try{const p=await fetch(`/ui/api/v1/proxy/${c}/loki/api/v1/format_query?query=${N}`,{method:"POST"}),g=await p.json();if(!p.ok||g.status==="invalid-query")throw new Error(g.error||"Invalid LogQL query");d.clearErrors("query"),h&&d.setValue("query",g.data)}catch(p){d.setError("query",{message:p instanceof Error?p.message:"Invalid LogQL query"})}finally{o(!1)}}},[d,c]),m=i.useMemo(()=>ki(N=>u(N,!1),1e3),[u]),f=async N=>{const h=new URLSearchParams;h.append("query",N.query),h.append("start",Math.floor(N.start_time.getTime()/1e3).toString()),h.append("end",Math.floor(N.end_time.getTime()/1e3).toString());try{const p=await fetch(`/ui/api/v1/proxy/${c}/compactor/ui/api/v1/deletes?${h.toString()}`,{method:"POST",headers:{"X-Scope-OrgID":N.tenant_id}});if(!p.ok){const g=await p.text();throw new Error(g||"Failed to create delete request")}await s.invalidateQueries({queryKey:["deletes"]}),t("/tenants/deletes")}catch(p){console.error("Error creating delete request:",p),a(p instanceof Error?p.message:"Failed to create delete request")}},y=i.useMemo(()=>{const N=d.watch("start_time"),h=d.watch("end_time");return ei(ti({start:N,end:h}),{format:["years","months","weeks","days","hours","minutes"],zero:!1})},[d]);return e.jsx(ke,{children:e.jsxs(ee,{children:[e.jsx(se,{children:e.jsx(ae,{children:"New Delete Request"})}),e.jsxs(te,{children:[r&&e.jsxs(Ge,{variant:"destructive",className:"mb-6",children:[e.jsx(nt,{className:"h-4 w-4"}),e.jsx(He,{children:"Error"}),e.jsx(Ke,{children:r})]}),e.jsx(mn,{...d,children:e.jsxs("form",{onSubmit:d.handleSubmit(f),className:"space-y-8",children:[e.jsx(Ie,{control:d.control,name:"tenant_id",render:({field:N})=>e.jsxs(ve,{children:[e.jsx(fe,{children:"TENANT ID"}),e.jsx(je,{children:e.jsx(xe,{placeholder:"Enter tenant ID",...N})}),e.jsx(we,{})]})}),e.jsx(Ie,{control:d.control,name:"query",render:({field:N})=>e.jsxs(ve,{children:[e.jsx(fe,{children:"LOGQL QUERY"}),e.jsx(je,{children:e.jsxs("div",{className:"relative",children:[e.jsx(xn,{placeholder:'{app="example"}',className:"font-mono",...N,onChange:h=>{N.onChange(h),m(h.target.value)},onBlur:async h=>{N.onBlur(),h.target.value&&await u(h.target.value,!0)}}),n&&e.jsx("div",{className:"absolute right-3 top-3",children:e.jsx(he,{className:"h-5 w-5 animate-spin"})})]})}),e.jsx(hn,{children:"Enter a LogQL query with labels in curly braces"}),e.jsx(we,{})]})}),e.jsxs("div",{className:"grid grid-cols-3 gap-8",children:[e.jsx(Ie,{control:d.control,name:"start_time",render:({field:N})=>e.jsxs(ve,{children:[e.jsx(fe,{children:"START TIME"}),e.jsx(je,{children:e.jsx(Ys,{selected:N.value,onChange:N.onChange,showTimeSelect:!0,timeFormat:"HH:mm",timeIntervals:15,dateFormat:"yyyy-MM-dd HH:mm",className:"flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50"})}),e.jsx(we,{})]})}),e.jsx(Ie,{control:d.control,name:"end_time",render:({field:N})=>e.jsxs(ve,{children:[e.jsx(fe,{children:"END TIME"}),e.jsx(je,{children:e.jsx(Ys,{selected:N.value,onChange:N.onChange,showTimeSelect:!0,timeFormat:"HH:mm",timeIntervals:15,dateFormat:"yyyy-MM-dd HH:mm",minDate:d.watch("start_time"),className:"flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50"})}),e.jsx(we,{})]})}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(fe,{children:"DURATION"}),e.jsx("div",{className:"h-10 flex items-center",children:e.jsx("span",{className:"text-sm text-muted-foreground",children:y})})]})]}),e.jsxs("div",{className:"flex justify-end space-x-3 pt-6 border-t",children:[e.jsx(q,{type:"button",variant:"outline",onClick:()=>t("/tenants/deletes"),children:"Cancel"}),e.jsx(q,{type:"submit",disabled:!d.formState.isValid||d.formState.isSubmitting,children:d.formState.isSubmitting?"Creating...":"Create Delete Request"})]})]})})]})]})})},tp={light:"",dark:".dark"},yn=i.createContext(null);function vn(){const t=i.useContext(yn);if(!t)throw new Error("useChart must be used within a ");return t}const jn=i.forwardRef(({id:t,className:s,children:r,config:a,...n},o)=>{const l=i.useId(),c=`chart-${t||l.replace(/:/g,"")}`;return e.jsx(yn.Provider,{value:{config:a},children:e.jsxs("div",{"data-chart":c,ref:o,className:v("flex aspect-video justify-center text-xs [&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-none [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-sector]:outline-none [&_.recharts-surface]:outline-none",s),...n,children:[e.jsx(sp,{id:c,config:a}),e.jsx(ct,{children:r})]})})});jn.displayName="Chart";const sp=({id:t,config:s})=>{const r=Object.entries(s).filter(([,a])=>a.theme||a.color);return r.length?e.jsx("style",{dangerouslySetInnerHTML:{__html:Object.entries(tp).map(([a,n])=>` -${n} [data-chart=${t}] { -${r.map(([o,l])=>{var d;const c=((d=l.theme)==null?void 0:d[a])||l.color;return c?` --color-${o}: ${c};`:null}).join(` -`)} -} -`).join(` -`)}}):null},rp=dt,wn=i.forwardRef(({active:t,payload:s,className:r,indicator:a="dot",hideLabel:n=!1,hideIndicator:o=!1,label:l,labelFormatter:c,labelClassName:d,formatter:u,color:m,nameKey:f,labelKey:y},N)=>{const{config:h}=vn(),p=i.useMemo(()=>{var E;if(n||!(s!=null&&s.length))return null;const[x]=s,b=`${y||x.dataKey||x.name||"value"}`,j=gs(h,x,b),w=!y&&typeof l=="string"?((E=h[l])==null?void 0:E.label)||l:j==null?void 0:j.label;return c?e.jsx("div",{className:v("font-medium",d),children:c(w,s)}):w?e.jsx("div",{className:v("font-medium",d),children:w}):null},[l,c,s,n,d,h,y]);if(!t||!(s!=null&&s.length))return null;const g=s.length===1&&a!=="dot";return e.jsxs("div",{ref:N,className:v("grid min-w-[8rem] items-start gap-1.5 rounded-lg border border-border/50 bg-background px-2.5 py-1.5 text-xs shadow-xl",r),children:[g?null:p,e.jsx("div",{className:"grid gap-1.5",children:s.map((x,b)=>{const j=`${f||x.name||x.dataKey||"value"}`,w=gs(h,x,j),E=m||x.payload.fill||x.color;return e.jsx("div",{className:v("flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-muted-foreground",a==="dot"&&"items-center"),children:u&&(x==null?void 0:x.value)!==void 0&&x.name?u(x.value,x.name,x,b,x.payload):e.jsxs(e.Fragment,{children:[w!=null&&w.icon?e.jsx(w.icon,{}):!o&&e.jsx("div",{className:v("shrink-0 rounded-[2px] border-[--color-border] bg-[--color-bg]",{"h-2.5 w-2.5":a==="dot","w-1":a==="line","w-0 border-[1.5px] border-dashed bg-transparent":a==="dashed","my-0.5":g&&a==="dashed"}),style:{"--color-bg":E,"--color-border":E}}),e.jsxs("div",{className:v("flex flex-1 justify-between leading-none",g?"items-end":"items-center"),children:[e.jsxs("div",{className:"grid gap-1.5",children:[g?p:null,e.jsx("span",{className:"text-muted-foreground",children:(w==null?void 0:w.label)||x.name})]}),x.value&&e.jsx("span",{className:"font-mono font-medium tabular-nums text-foreground",children:x.value.toLocaleString()})]})]})},x.dataKey)})})]})});wn.displayName="ChartTooltip";const ap=i.forwardRef(({className:t,hideIcon:s=!1,payload:r,verticalAlign:a="bottom",nameKey:n},o)=>{const{config:l}=vn();return r!=null&&r.length?e.jsx("div",{ref:o,className:v("flex items-center justify-center gap-4",a==="top"?"pb-3":"pt-3",t),children:r.map(c=>{const d=`${n||c.dataKey||"value"}`,u=gs(l,c,d);return e.jsxs("div",{className:v("flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-muted-foreground"),children:[u!=null&&u.icon&&!s?e.jsx(u.icon,{}):e.jsx("div",{className:"h-2 w-2 shrink-0 rounded-[2px]",style:{backgroundColor:c.color}}),u==null?void 0:u.label]},c.value)})}):null});ap.displayName="ChartLegend";function gs(t,s,r){if(typeof s!="object"||s===null)return;const a="payload"in s&&typeof s.payload=="object"&&s.payload!==null?s.payload:void 0;let n=r;return r in s&&typeof s[r]=="string"?n=s[r]:a&&r in a&&typeof a[r]=="string"&&(n=a[r]),n in t?t[n]:t[r]}const np=ji,op=wi,ip=Ni,lp=ia({tenant:Ye().min(1,"Tenant ID is required"),since:Ye(),matcher:Ye().default("{}")}),cp=[{value:"1h",label:"Last 1 hour"},{value:"3h",label:"Last 3 hours"},{value:"6h",label:"Last 6 hours"},{value:"12h",label:"Last 12 hours"},{value:"24h",label:"Last 24 hours"}];function dp({values:t,totalValues:s}){return e.jsx("div",{className:"space-y-2 py-2",children:t.map(({value:r,count:a})=>e.jsxs("div",{className:"grid grid-cols-[200px_1fr_80px] items-center gap-4",children:[e.jsx(be,{variant:"outline",className:"font-mono text-xs justify-self-start overflow-hidden",children:r}),e.jsx("div",{className:"h-2 bg-muted rounded-full overflow-hidden",children:e.jsx("div",{className:"h-full bg-primary",style:{width:`${a/s*100}%`}})}),e.jsxs("span",{className:"text-xs text-muted-foreground tabular-nums justify-self-end",children:[(a/s*100).toFixed(1),"%"]})]},r))})}function up(){const{cluster:t}=ue(),{toast:s}=zt(),[r,a]=i.useState(null),[n,o]=i.useState("uniqueValues"),[l,c]=i.useState("desc"),[d,u]=i.useState("uniqueValues"),[m,f]=i.useState(new Set),y=la({resolver:bn(lp),defaultValues:{matcher:"{}",since:"1h"}}),N=Oe(t==null?void 0:t.members,"query-frontend"),{isLoading:h,refetch:p}=Mt({queryKey:["analyze-labels"],queryFn:async()=>{try{const w=y.getValues(),E=new Date,C=new Date(E.getTime()-pp(w.since)),A=await fetch(`/ui/api/v1/proxy/${N}/loki/api/v1/series?match[]=${encodeURIComponent(w.matcher)}&start=${C.getTime()*1e6}&end=${E.getTime()*1e6}`,{headers:{"X-Scope-OrgID":w.tenant}});if(!A.ok){const M=await A.text();throw new Error(M||"Failed to fetch series")}const B=await A.json(),z=new Map,Y=new Map;B.data.forEach(M=>{Object.entries(M).forEach(([W,T])=>{z.has(W)||(z.set(W,{uniqueValues:new Set,inStreams:0}),Y.set(W,new Map));const O=z.get(W),V=Y.get(W);O.uniqueValues.add(T),O.inStreams++,V.set(T,(V.get(T)||0)+1)})});const K=Array.from(z.entries()).map(([M,W])=>{const T=Array.from(Y.get(M).entries()).map(([O,V])=>({value:O,count:V})).sort((O,V)=>V.count-O.count).slice(0,5);return{name:M,uniqueValues:W.uniqueValues.size,inStreams:W.inStreams,sampleValues:T}});return K.sort((M,W)=>W.uniqueValues-M.uniqueValues),a({totalStreams:B.data.length,uniqueLabels:z.size,labels:K}),B}catch(w){throw s({variant:"destructive",title:"Error analyzing labels",description:w instanceof Error?w.message:"An unexpected error occurred"}),w}},enabled:!1});function g(){p()}const x=i.useMemo(()=>{const w=document.createElement("style"),E=(r==null?void 0:r.labels.slice(0,10).map((C,A)=>{const B=A*137.5%360;return`--chart-color-${A}: hsl(${B}, 70%, 50%);`}).join(` -`))||"";return w.textContent=`:root { ${E} }`,document.head.appendChild(w),()=>w.remove()},[r]);i.useEffect(()=>x,[x]);const b={value:{label:d==="uniqueValues"?"Unique Values":"Found In Streams",theme:{light:"var(--chart-color-0)",dark:"var(--chart-color-0)"}}},j=i.useMemo(()=>r?[...r.labels].sort((w,E)=>{let C=0;switch(n){case"name":C=w.name.localeCompare(E.name);break;case"uniqueValues":C=w.uniqueValues-E.uniqueValues;break;case"inStreams":C=w.inStreams-E.inStreams;break;case"cardinality":C=w.uniqueValues/w.inStreams-E.uniqueValues/E.inStreams;break}return l==="asc"?C:-C}):[],[r,n,l]);return e.jsxs("div",{className:"container mx-auto p-4 space-y-6",children:[e.jsxs(ee,{children:[e.jsxs(se,{children:[e.jsx(ae,{children:"Analyze Labels"}),e.jsx(Qe,{children:"Analyze label distribution across your log streams"})]}),e.jsx(te,{children:e.jsx(mn,{...y,children:e.jsxs("form",{onSubmit:y.handleSubmit(g),className:"grid grid-cols-1 md:grid-cols-4 gap-4",children:[e.jsx(Ie,{control:y.control,name:"tenant",render:({field:w})=>e.jsxs(ve,{className:"flex flex-col space-y-1.5",children:[e.jsx(fe,{children:"Tenant ID"}),e.jsx(je,{children:e.jsx(xe,{placeholder:"Enter tenant ID...",...w})}),e.jsx(we,{className:"text-xs"})]})}),e.jsx(Ie,{control:y.control,name:"since",render:({field:w})=>e.jsxs(ve,{className:"flex flex-col space-y-1.5",children:[e.jsx(fe,{children:"Time Range"}),e.jsxs(Tt,{onValueChange:w.onChange,defaultValue:w.value,children:[e.jsx(je,{children:e.jsx(et,{children:e.jsx(Rt,{placeholder:"Select time range"})})}),e.jsx(tt,{children:cp.map(E=>e.jsx(ze,{value:E.value,children:E.label},E.value))})]}),e.jsx(we,{className:"text-xs"})]})}),e.jsx(Ie,{control:y.control,name:"matcher",render:({field:w})=>e.jsxs(ve,{className:"flex flex-col space-y-1.5",children:[e.jsx(fe,{children:"Matcher"}),e.jsx(je,{children:e.jsx(xe,{placeholder:"Enter matcher... (default: {})",...w})}),e.jsx(we,{className:"text-xs"})]})}),e.jsx(q,{type:"submit",disabled:h,className:"self-end h-10",children:h?"Analyzing...":"Analyze"})]})})})]}),r&&e.jsxs(e.Fragment,{children:[e.jsxs(ee,{children:[e.jsxs(se,{className:"flex flex-col items-stretch space-y-0 border-b p-0 sm:flex-row",children:[e.jsxs("div",{className:"flex flex-1 flex-col justify-center gap-1 px-6 py-5 sm:py-6",children:[e.jsx(ae,{children:"Label Distribution"}),e.jsx(Qe,{children:"Top 20 labels by unique values"})]}),e.jsxs("div",{className:"flex",children:[e.jsxs("div",{className:"relative z-30 flex flex-1 flex-col justify-center gap-1 px-6 py-4 text-left sm:px-8 sm:py-6",children:[e.jsx("span",{className:"text-xs text-muted-foreground",children:"Total Streams"}),e.jsx("span",{className:"text-lg font-bold leading-none sm:text-3xl",children:r.totalStreams.toLocaleString()})]}),e.jsxs("div",{className:"relative z-30 flex flex-1 flex-col justify-center gap-1 border-l px-6 py-4 text-left sm:px-8 sm:py-6",children:[e.jsx("span",{className:"text-xs text-muted-foreground",children:"Unique Labels"}),e.jsx("span",{className:"text-lg font-bold leading-none sm:text-3xl",children:r.uniqueLabels.toLocaleString()})]})]})]}),e.jsxs(te,{className:"px-2 sm:p-6",children:[e.jsx("div",{className:"mb-4",children:e.jsxs(Tt,{value:d,onValueChange:w=>u(w),children:[e.jsx(et,{className:"w-[200px]",children:e.jsx(Rt,{placeholder:"Select metric"})}),e.jsxs(tt,{children:[e.jsx(ze,{value:"uniqueValues",children:"Unique Values"}),e.jsx(ze,{value:"inStreams",children:"Found In Streams"})]})]})}),e.jsx(jn,{config:b,className:"aspect-auto h-[500px] w-full",children:e.jsxs(Si,{data:r.labels.slice(0,20).map((w,E)=>({name:w.name,value:d==="uniqueValues"?w.uniqueValues:w.inStreams,fill:`var(--chart-color-${E})`})),layout:"vertical",margin:{right:24},barSize:452/Math.min(20,r.labels.length)*.6,maxBarSize:24,children:[e.jsx(Ei,{horizontal:!1}),e.jsx(Ci,{dataKey:"name",type:"category",tickLine:!1,axisLine:!1,width:90,fontSize:11,interval:0}),e.jsx(Ti,{type:"number",tickLine:!1,axisLine:!1,tickMargin:8}),e.jsx(rp,{content:e.jsx(wn,{className:"w-[200px]"})}),e.jsx(Ri,{dataKey:"value",fillOpacity:.8,radius:[4,4,0,0]})]})})]})]}),e.jsxs(ee,{children:[e.jsx(se,{children:e.jsx(ae,{children:"Label Details"})}),e.jsx(te,{children:e.jsxs(Ce,{children:[e.jsx(Te,{children:e.jsxs(X,{children:[e.jsx(D,{children:e.jsx(Z,{title:"Label Name",field:"name",sortField:n,sortDirection:l,onSort:w=>{w===n?c(l==="asc"?"desc":"asc"):(o(w),c("desc"))}})}),e.jsx(D,{children:e.jsx(Z,{title:"Unique Values",field:"uniqueValues",sortField:n,sortDirection:l,onSort:w=>{w===n?c(l==="asc"?"desc":"asc"):(o(w),c("desc"))}})}),e.jsx(D,{children:e.jsx(Z,{title:"Found In Streams",field:"inStreams",sortField:n,sortDirection:l,onSort:w=>{w===n?c(l==="asc"?"desc":"asc"):(o(w),c("desc"))}})}),e.jsx(D,{children:e.jsx(Z,{title:"Cardinality %",field:"cardinality",sortField:n,sortDirection:l,onSort:w=>{w===n?c(l==="asc"?"desc":"asc"):(o(w),c("desc"))}})})]})}),e.jsx(Re,{children:j.map(w=>e.jsx(np,{asChild:!0,open:m.has(w.name),onOpenChange:E=>{const C=new Set(m);E?C.add(w.name):C.delete(w.name),f(C)},children:e.jsxs(e.Fragment,{children:[e.jsxs(X,{children:[e.jsx(F,{className:"font-medium",children:e.jsxs(op,{className:"flex items-center gap-2 hover:text-primary",children:[e.jsx(ot,{className:v("h-4 w-4 transition-transform",m.has(w.name)&&"rotate-180")}),w.name]})}),e.jsx(F,{children:w.uniqueValues.toLocaleString()}),e.jsx(F,{children:w.inStreams.toLocaleString()}),e.jsxs(F,{children:[(w.uniqueValues/w.inStreams*100).toFixed(2),"%"]})]}),e.jsx(ip,{asChild:!0,children:e.jsx(X,{children:e.jsx(F,{colSpan:4,className:"border-t-0 bg-muted/5",children:e.jsx("div",{className:"px-4",children:e.jsx(dp,{values:w.sampleValues,totalValues:w.inStreams})})})})})]})},w.name))})]})})]})]})]})}function pp(t){const s=parseInt(t),a=t.slice(-1)==="h"?36e5:0;return s*a}const Nn=[{path:"/",breadcrumb:"Home",element:e.jsx(lr,{})},{path:"/nodes",breadcrumb:"Nodes",element:e.jsx(lr,{})},{path:"/nodes/:nodeName",breadcrumb:Ki,element:e.jsx(qu,{})},{path:"/versions",breadcrumb:"Versions",element:e.jsx(Ae,{})},{path:"/rings",breadcrumb:"Rings",element:e.jsx(or,{})},{path:"/rings/:ringName",breadcrumb:Wi,element:e.jsx(or,{})},{path:"/storage",breadcrumb:"Storage",element:e.jsx(Ae,{})},{path:"/storage/object",breadcrumb:"Object Storage",element:e.jsx(Ae,{})},{path:"/storage/dataobj",breadcrumb:"Data Objects",element:e.jsx(Dc,{})},{path:"/storage/dataobj/metadata",breadcrumb:"File Metadata",element:e.jsx(Yc,{})},{path:"/tenants",breadcrumb:"Tenants",element:e.jsx(Ae,{})},{path:"/tenants/deletes",breadcrumb:"Deletes",element:e.jsx(Xu,{})},{path:"/tenants/deletes/new",element:e.jsx(ep,{}),breadcrumb:"New Delete Request"},{path:"/tenants/analyze-labels",element:e.jsx(up,{}),breadcrumb:"Analyze Labels"},{path:"/tenants/limits",breadcrumb:"Limits",element:e.jsx(Ae,{})},{path:"/tenants/labels",breadcrumb:"Labels",element:e.jsx(Ae,{})},{path:"/rules",breadcrumb:"Rules",element:e.jsx(Ae,{})},{path:"/404",breadcrumb:"404",element:e.jsx(Zi,{})}];function mp(){const t=So(Nn,{disableDefaults:!0});return e.jsx(ks,{children:e.jsx(Ss,{children:t.map(({match:s,breadcrumb:r},a)=>e.jsxs(i.Fragment,{children:[e.jsx(Nt,{className:a===0?"hidden md:block":"",children:a===t.length-1?e.jsx(pa,{children:r}):e.jsx(kt,{asChild:!0,children:e.jsx(ce,{to:s.pathname,children:r})})}),a{let l;return s?a(!0):l=setTimeout(()=>{a(!1)},500),()=>{l&&clearTimeout(l)}},[s]);const n=()=>{if(!(t!=null&&t.members))return"v0.0.0";const l=new Map;Object.values(t.members).forEach(u=>{if(!u.build.version)return;const m=u.build.version;l.set(m,(l.get(m)||0)+1)});let c="v0.0.0",d=0;return l.forEach((u,m)=>{u>d&&(d=u,c=m)}),c},o=()=>{if(!(t!=null&&t.members))return[];const l=new Set,c=new Map;return Object.values(t.members).forEach(d=>{const u=d.build.version;l.add(u),c.set(u,{revision:d.build.revision,branch:d.build.branch,buildUser:d.build.buildUser,buildDate:d.build.buildDate,goVersion:d.build.goVersion})}),Array.from(l).map(d=>({version:d??"v0.0.0",info:c.get(d)??{revision:"v0.0.0",branch:"v0.0.0",buildUser:"v0.0.0",buildDate:"v0.0.0",goVersion:"v0.0.0"}}))};return{mostCommonVersion:n(),versionInfos:o(),isLoading:r}}function fp(){const{mostCommonVersion:t,versionInfos:s,isLoading:r}=gp(),[a,n]=i.useState(!1),o=()=>s.map(({version:l,info:c})=>`Version: ${l} -Revision: ${c.revision} -Branch: ${c.branch} -Build User: ${c.buildUser} -Build Date: ${c.buildDate} -Go Version: ${c.goVersion} -`).join(` -`);return e.jsxs(Vt,{open:a,onOpenChange:n,children:[e.jsx(Ut,{asChild:!0,children:e.jsxs("span",{className:"text-sm text-muted-foreground flex items-center gap-1",children:[e.jsx("button",{onClick:()=>n(!a),className:v("transition-opacity duration-200 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 rounded px-1 -mx-1",{"opacity-0":r,"opacity-100":!r}),children:t}),r&&e.jsxs(e.Fragment,{children:[e.jsx(he,{className:"h-3 w-3 animate-spin"}),"Loading..."]})]})}),e.jsx(mt,{side:"bottom",align:"start",className:"w-[400px]",children:e.jsxs("div",{className:"p-2",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("div",{className:"font-semibold",children:"Build Information"}),!r&&s.length>0&&e.jsx($s,{text:o()})]}),e.jsx("div",{className:v("transition-opacity duration-200",{"opacity-0":r,"opacity-100":!r}),children:s.length>0?s.map(({version:l,info:c})=>e.jsxs("div",{className:"mb-2 last:mb-0",children:[e.jsx("div",{className:"font-semibold",children:l}),e.jsxs("div",{className:"text-sm",children:[e.jsxs("div",{children:["Revision: ",c.revision]}),e.jsxs("div",{children:["Branch: ",c.branch]}),e.jsxs("div",{children:["Build User: ",c.buildUser]}),e.jsxs("div",{children:["Build Date: ",c.buildDate]}),e.jsxs("div",{children:["Go Version: ",c.goVersion]})]})]},l)):e.jsx("div",{className:"text-sm text-muted-foreground",children:"No build information available"})}),r&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(he,{className:"h-4 w-4 animate-spin"}),e.jsx("span",{children:"Loading build information..."})]})]})})]})}const ns=768;function hp(){const[t,s]=i.useState(void 0);return i.useEffect(()=>{const r=window.matchMedia(`(max-width: ${ns-1}px)`),a=()=>{s(window.innerWidthr.removeEventListener("change",a)},[]),!!t}const Vs=i.forwardRef(({className:t,orientation:s="horizontal",decorative:r=!0,...a},n)=>e.jsx(oa,{ref:n,decorative:r,orientation:s,className:v("shrink-0 bg-border",s==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",t),...a}));Vs.displayName=oa.displayName;const xp=ws,bp=Ns,Sn=i.forwardRef(({className:t,...s},r)=>e.jsx(it,{className:v("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...s,ref:r}));Sn.displayName=it.displayName;const yp=Ee("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),En=i.forwardRef(({side:t="right",className:s,children:r,...a},n)=>e.jsxs(bp,{children:[e.jsx(Sn,{}),e.jsxs(lt,{ref:n,className:v(yp({side:t}),s),...a,children:[e.jsxs(aa,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[e.jsx(vs,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]}),r]})]}));En.displayName=lt.displayName;const vp=i.forwardRef(({className:t,...s},r)=>e.jsx(Lt,{ref:r,className:v("text-lg font-semibold text-foreground",t),...s}));vp.displayName=Lt.displayName;const jp=i.forwardRef(({className:t,...s},r)=>e.jsx(Pt,{ref:r,className:v("text-sm text-muted-foreground",t),...s}));jp.displayName=Pt.displayName;function mr({className:t,...s}){return e.jsx("div",{className:v("animate-pulse rounded-md bg-primary/10",t),...s})}const wp="sidebar:state",Np=60*60*24*7,kp="16rem",Sp="18rem",Ep="3rem",Cp="b",Cn=i.createContext(null);function Zt(){const t=i.useContext(Cn);if(!t)throw new Error("useSidebar must be used within a SidebarProvider.");return t}const Tn=i.forwardRef(({defaultOpen:t=!0,open:s,onOpenChange:r,className:a,style:n,children:o,...l},c)=>{const d=hp(),[u,m]=i.useState(!1),[f,y]=i.useState(t),N=s??f,h=i.useCallback(b=>{const j=typeof b=="function"?b(N):b;r?r(j):y(j),document.cookie=`${wp}=${j}; path=/; max-age=${Np}`},[r,N]),p=i.useCallback(()=>d?m(b=>!b):h(b=>!b),[d,h,m]);i.useEffect(()=>{const b=j=>{j.key===Cp&&(j.metaKey||j.ctrlKey)&&(j.preventDefault(),p())};return window.addEventListener("keydown",b),()=>window.removeEventListener("keydown",b)},[p]);const g=N?"expanded":"collapsed",x=i.useMemo(()=>({state:g,open:N,setOpen:h,isMobile:d,openMobile:u,setOpenMobile:m,toggleSidebar:p}),[g,N,h,d,u,m,p]);return e.jsx(Cn.Provider,{value:x,children:e.jsx(Ms,{delayDuration:0,children:e.jsx("div",{style:{"--sidebar-width":kp,"--sidebar-width-icon":Ep,...n},className:v("group/sidebar-wrapper flex min-h-svh w-full has-[[data-variant=inset]]:bg-sidebar",a),ref:c,...l,children:o})})})});Tn.displayName="SidebarProvider";const Rn=i.forwardRef(({side:t="left",variant:s="sidebar",collapsible:r="offcanvas",className:a,children:n,...o},l)=>{const{isMobile:c,state:d,openMobile:u,setOpenMobile:m}=Zt();return r==="none"?e.jsx("div",{className:v("flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground",a),ref:l,...o,children:n}):c?e.jsx(xp,{open:u,onOpenChange:m,...o,children:e.jsx(En,{"data-sidebar":"sidebar","data-mobile":"true",className:"w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":Sp},side:t,children:e.jsx("div",{className:"flex h-full w-full flex-col",children:n})})}):e.jsxs("div",{ref:l,className:"group peer hidden text-sidebar-foreground md:block","data-state":d,"data-collapsible":d==="collapsed"?r:"","data-variant":s,"data-side":t,children:[e.jsx("div",{className:v("relative h-svh w-[--sidebar-width] bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",s==="floating"||s==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon]")}),e.jsx("div",{className:v("fixed inset-y-0 z-10 hidden h-svh w-[--sidebar-width] transition-[left,right,width] duration-200 ease-linear md:flex",t==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",s==="floating"||s==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon] group-data-[side=left]:border-r group-data-[side=right]:border-l",a),...o,children:e.jsx("div",{"data-sidebar":"sidebar",className:"flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow",children:n})})]})});Rn.displayName="Sidebar";const An=i.forwardRef(({className:t,onClick:s,...r},a)=>{const{toggleSidebar:n}=Zt();return e.jsxs(q,{ref:a,"data-sidebar":"trigger",variant:"ghost",size:"icon",className:v("h-7 w-7",t),onClick:o=>{s==null||s(o),n()},...r,children:[e.jsx(Go,{}),e.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})});An.displayName="SidebarTrigger";const _n=i.forwardRef(({className:t,...s},r)=>{const{toggleSidebar:a}=Zt();return e.jsx("button",{ref:r,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:a,title:"Toggle Sidebar",className:v("absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex","[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:hover:bg-sidebar","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",t),...s})});_n.displayName="SidebarRail";const In=i.forwardRef(({className:t,...s},r)=>e.jsx("main",{ref:r,className:v("relative flex min-h-svh flex-1 flex-col bg-background","peer-data-[variant=inset]:min-h-[calc(100svh-theme(spacing.4))] md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow",t),...s}));In.displayName="SidebarInset";const Tp=i.forwardRef(({className:t,...s},r)=>e.jsx(xe,{ref:r,"data-sidebar":"input",className:v("h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",t),...s}));Tp.displayName="SidebarInput";const Fn=i.forwardRef(({className:t,...s},r)=>e.jsx("div",{ref:r,"data-sidebar":"header",className:v("flex flex-col gap-2 p-2",t),...s}));Fn.displayName="SidebarHeader";const Rp=i.forwardRef(({className:t,...s},r)=>e.jsx("div",{ref:r,"data-sidebar":"footer",className:v("flex flex-col gap-2 p-2",t),...s}));Rp.displayName="SidebarFooter";const Ap=i.forwardRef(({className:t,...s},r)=>e.jsx(Vs,{ref:r,"data-sidebar":"separator",className:v("mx-2 w-auto bg-sidebar-border",t),...s}));Ap.displayName="SidebarSeparator";const Ln=i.forwardRef(({className:t,...s},r)=>e.jsx("div",{ref:r,"data-sidebar":"content",className:v("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",t),...s}));Ln.displayName="SidebarContent";const Pn=i.forwardRef(({className:t,...s},r)=>e.jsx("div",{ref:r,"data-sidebar":"group",className:v("relative flex w-full min-w-0 flex-col p-2",t),...s}));Pn.displayName="SidebarGroup";const _p=i.forwardRef(({className:t,asChild:s=!1,...r},a)=>{const n=s?Se:"div";return e.jsx(n,{ref:a,"data-sidebar":"group-label",className:v("flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 outline-none ring-sidebar-ring transition-[margin,opa] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",t),...r})});_p.displayName="SidebarGroupLabel";const Ip=i.forwardRef(({className:t,asChild:s=!1,...r},a)=>{const n=s?Se:"button";return e.jsx(n,{ref:a,"data-sidebar":"group-action",className:v("absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","group-data-[collapsible=icon]:hidden",t),...r})});Ip.displayName="SidebarGroupAction";const Fp=i.forwardRef(({className:t,...s},r)=>e.jsx("div",{ref:r,"data-sidebar":"group-content",className:v("w-full text-sm",t),...s}));Fp.displayName="SidebarGroupContent";const fs=i.forwardRef(({className:t,...s},r)=>e.jsx("ul",{ref:r,"data-sidebar":"menu",className:v("flex w-full min-w-0 flex-col gap-1",t),...s}));fs.displayName="SidebarMenu";const Us=i.forwardRef(({className:t,...s},r)=>e.jsx("li",{ref:r,"data-sidebar":"menu-item",className:v("group/menu-item relative",t),...s}));Us.displayName="SidebarMenuItem";const Lp=Ee("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:!p-0"}},defaultVariants:{variant:"default",size:"default"}}),qs=i.forwardRef(({asChild:t=!1,isActive:s=!1,variant:r="default",size:a="default",tooltip:n,className:o,...l},c)=>{const d=t?Se:"button",{isMobile:u,state:m}=Zt(),f=e.jsx(d,{ref:c,"data-sidebar":"menu-button","data-size":a,"data-active":s,className:v(Lp({variant:r,size:a}),o),...l});return n?(typeof n=="string"&&(n={children:n}),e.jsxs(st,{children:[e.jsx(rt,{asChild:!0,children:f}),e.jsx(Ue,{side:"right",align:"center",hidden:m!=="collapsed"||u,...n})]})):f});qs.displayName="SidebarMenuButton";const Pp=i.forwardRef(({className:t,asChild:s=!1,showOnHover:r=!1,...a},n)=>{const o=s?Se:"button";return e.jsx(o,{ref:n,"data-sidebar":"menu-action",className:v("absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 peer-hover/menu-button:text-sidebar-accent-foreground [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",r&&"group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground md:opacity-0",t),...a})});Pp.displayName="SidebarMenuAction";const Dp=i.forwardRef(({className:t,...s},r)=>e.jsx("div",{ref:r,"data-sidebar":"menu-badge",className:v("pointer-events-none absolute right-1 flex h-5 min-w-5 select-none items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums text-sidebar-foreground","peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",t),...s}));Dp.displayName="SidebarMenuBadge";const Op=i.forwardRef(({className:t,showIcon:s=!1,...r},a)=>{const n=i.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return e.jsxs("div",{ref:a,"data-sidebar":"menu-skeleton",className:v("flex h-8 items-center gap-2 rounded-md px-2",t),...r,children:[s&&e.jsx(mr,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),e.jsx(mr,{className:"h-4 max-w-[--skeleton-width] flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":n}})]})});Op.displayName="SidebarMenuSkeleton";const Dn=i.forwardRef(({className:t,...s},r)=>e.jsx("ul",{ref:r,"data-sidebar":"menu-sub",className:v("mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",t),...s}));Dn.displayName="SidebarMenuSub";const On=i.forwardRef(({...t},s)=>e.jsx("li",{ref:s,...t}));On.displayName="SidebarMenuSubItem";const $n=i.forwardRef(({asChild:t=!1,size:s="md",isActive:r,className:a,...n},o)=>{const l=t?Se:"a";return e.jsx(l,{ref:o,"data-sidebar":"menu-sub-button","data-size":s,"data-active":r,className:v("flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-none ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",s==="sm"&&"text-xs",s==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",a),...n})});$n.displayName="SidebarMenuSubButton";function $p(t,s){const[r,a]=i.useState(s);return i.useEffect(()=>{if(!(t!=null&&t.members))return;const n=s.map(o=>o.title==="Rings"&&t.members?{...o,items:el(t.members)}:o);a(n)},[t==null?void 0:t.members,s]),r}const os=[{title:"Cluster",url:"/nodes",icon:e.jsx(Ho,{className:"h-4 w-4"}),items:[{title:"Nodes",url:"/nodes"},{title:"Rollouts & Versions",url:"/versions"}]},{title:"Rings",url:"/rings",icon:e.jsx(Cr,{className:"h-4 w-4"}),items:[]},{title:"Storage",url:"/storage",icon:e.jsx(Ko,{className:"h-4 w-4"}),items:[{title:"Object Storage",url:"/storage/object"},{title:"Data Objects",url:"/storage/dataobj"}]},{title:"Tenants",url:"/tenants",icon:e.jsx(Wo,{className:"h-4 w-4"}),items:[{title:"Analyze Labels",url:"/tenants/analyze-labels"},{title:"Deletes",url:"/tenants/deletes"},{title:"Limits",url:"/tenants/limits"},{title:"Labels",url:"/tenants/labels"}]},{title:"Rules",url:"/rules",icon:e.jsx(Zo,{className:"h-4 w-4"}),items:[]},{title:"Documentation",url:"https://grafana.com/docs/loki/latest/",icon:e.jsx(Yo,{className:"h-4 w-4"}),items:[]}];function Mp(t){return e.jsx(_n,{...t,className:v("after:bg-border/40 hover:after:bg-border","hover:bg-muted/50",t.className)})}const gr="loki-sidebar-open-sections",Bp=i.memo(function({item:s,isOpen:r,isActive:a,onToggle:n}){return e.jsxs(Us,{children:[e.jsx(qs,{asChild:!0,isActive:a(s.url),onClick:()=>n(s.title),children:e.jsxs("div",{className:"flex items-center justify-between font-medium",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[s.icon,e.jsx(ce,{to:`${s.url}`,target:s.url.includes("http")?"_blank":"_self",children:s.title})]}),s.items&&s.items.length>0&&e.jsx(ot,{className:v("h-4 w-4 transition-transform duration-200",r?"rotate-0":"-rotate-90")})]})}),s.items&&s.items.length>0&&r&&e.jsx(Dn,{children:s.items.map(o=>e.jsx(On,{children:e.jsx($n,{asChild:!0,isActive:a(o.url),children:e.jsx(ce,{to:`${o.url}`,children:o.title})})},o.title))})]})});function zp({...t}){const s=kn(),r=Eo(),{cluster:a}=ue(),n=r.pathname.replace(s,"/"),[o,l]=i.useState(()=>{const m=localStorage.getItem(gr);if(m)try{return JSON.parse(m)}catch{return os.reduce((f,y)=>({...f,[y.title]:!0}),{})}return os.reduce((f,y)=>({...f,[y.title]:!0}),{})}),c=$p(a,os),d=i.useCallback(m=>m==="/"?n==="/":n.startsWith(m),[n]),u=i.useCallback(m=>{l(f=>{const y={...f,[m]:!f[m]};return localStorage.setItem(gr,JSON.stringify(y)),y})},[]);return e.jsxs(Rn,{...t,children:[e.jsx(Fn,{className:"py-4",children:e.jsx(fs,{children:e.jsx(Us,{children:e.jsx(qs,{size:"lg",asChild:!0,children:e.jsxs("div",{className:"flex items-center gap-3 px-6 py-4",children:[e.jsx("img",{src:"https://grafana.com/media/docs/loki/logo-grafana-loki.png",alt:"Loki Logo",className:"h-7 w-7"}),e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{className:"text-sm font-semibold leading-none",children:"Grafana Loki"}),e.jsx(fp,{})]})]})})})})}),e.jsx(pt,{className:"flex-1",children:e.jsx(Ln,{children:e.jsx(Pn,{children:e.jsx(fs,{children:c.map(m=>e.jsx(i.Fragment,{children:e.jsx(Bp,{item:m,isOpen:o[m.title],isActive:d,onToggle:u})},m.title))})})})}),e.jsx(Mp,{})]})}function Vp(){const[t,s]=i.useState(!1);i.useEffect(()=>{const a=()=>{s(window.scrollY>300)};return window.addEventListener("scroll",a),()=>window.removeEventListener("scroll",a)},[]);const r=()=>{window.scrollTo({top:0,behavior:"smooth"})};return t?e.jsx(q,{onClick:r,size:"icon",className:"fixed bottom-8 right-8 rounded-full shadow-lg transition-all duration-300","aria-label":"Back to top",children:e.jsx(ls,{className:"h-4 w-4"})}):null}var Gs="ToastProvider",[Hs,Up,qp]=bi("Toast"),[Mn,Fm]=hr("Toast",[qp]),[Gp,Yt]=Mn(Gs),Bn=t=>{const{__scopeToast:s,label:r="Notification",duration:a=5e3,swipeDirection:n="right",swipeThreshold:o=50,children:l}=t,[c,d]=i.useState(null),[u,m]=i.useState(0),f=i.useRef(!1),y=i.useRef(!1);return r.trim()||console.error(`Invalid prop \`label\` supplied to \`${Gs}\`. Expected non-empty \`string\`.`),e.jsx(Hs.Provider,{scope:s,children:e.jsx(Gp,{scope:s,label:r,duration:a,swipeDirection:n,swipeThreshold:o,toastCount:u,viewport:c,onViewportChange:d,onToastAdd:i.useCallback(()=>m(N=>N+1),[]),onToastRemove:i.useCallback(()=>m(N=>N-1),[]),isFocusedToastEscapeKeyDownRef:f,isClosePausedRef:y,children:l})})};Bn.displayName=Gs;var zn="ToastViewport",Hp=["F8"],hs="toast.viewportPause",xs="toast.viewportResume",Vn=i.forwardRef((t,s)=>{const{__scopeToast:r,hotkey:a=Hp,label:n="Notifications ({hotkey})",...o}=t,l=Yt(zn,r),c=Up(r),d=i.useRef(null),u=i.useRef(null),m=i.useRef(null),f=i.useRef(null),y=vr(s,f,l.onViewportChange),N=a.join("+").replace(/Key/g,"").replace(/Digit/g,""),h=l.toastCount>0;i.useEffect(()=>{const g=x=>{var j;a.length!==0&&a.every(w=>x[w]||x.code===w)&&((j=f.current)==null||j.focus())};return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[a]),i.useEffect(()=>{const g=d.current,x=f.current;if(h&&g&&x){const b=()=>{if(!l.isClosePausedRef.current){const C=new CustomEvent(hs);x.dispatchEvent(C),l.isClosePausedRef.current=!0}},j=()=>{if(l.isClosePausedRef.current){const C=new CustomEvent(xs);x.dispatchEvent(C),l.isClosePausedRef.current=!1}},w=C=>{!g.contains(C.relatedTarget)&&j()},E=()=>{g.contains(document.activeElement)||j()};return g.addEventListener("focusin",b),g.addEventListener("focusout",w),g.addEventListener("pointermove",b),g.addEventListener("pointerleave",E),window.addEventListener("blur",b),window.addEventListener("focus",j),()=>{g.removeEventListener("focusin",b),g.removeEventListener("focusout",w),g.removeEventListener("pointermove",b),g.removeEventListener("pointerleave",E),window.removeEventListener("blur",b),window.removeEventListener("focus",j)}}},[h,l.isClosePausedRef]);const p=i.useCallback(({tabbingDirection:g})=>{const b=c().map(j=>{const w=j.ref.current,E=[w,...nm(w)];return g==="forwards"?E:E.reverse()});return(g==="forwards"?b.reverse():b).flat()},[c]);return i.useEffect(()=>{const g=f.current;if(g){const x=b=>{var E,C,A;const j=b.altKey||b.ctrlKey||b.metaKey;if(b.key==="Tab"&&!j){const B=document.activeElement,z=b.shiftKey;if(b.target===g&&z){(E=u.current)==null||E.focus();return}const M=p({tabbingDirection:z?"backwards":"forwards"}),W=M.findIndex(T=>T===B);is(M.slice(W+1))?b.preventDefault():z?(C=u.current)==null||C.focus():(A=m.current)==null||A.focus()}};return g.addEventListener("keydown",x),()=>g.removeEventListener("keydown",x)}},[c,p]),e.jsxs(bo,{ref:d,role:"region","aria-label":n.replace("{hotkey}",N),tabIndex:-1,style:{pointerEvents:h?void 0:"none"},children:[h&&e.jsx(bs,{ref:u,onFocusFromOutsideViewport:()=>{const g=p({tabbingDirection:"forwards"});is(g)}}),e.jsx(Hs.Slot,{scope:r,children:e.jsx(re.ol,{tabIndex:-1,...o,ref:y})}),h&&e.jsx(bs,{ref:m,onFocusFromOutsideViewport:()=>{const g=p({tabbingDirection:"backwards"});is(g)}})]})});Vn.displayName=zn;var Un="ToastFocusProxy",bs=i.forwardRef((t,s)=>{const{__scopeToast:r,onFocusFromOutsideViewport:a,...n}=t,o=Yt(Un,r);return e.jsx(jr,{"aria-hidden":!0,tabIndex:0,...n,ref:s,style:{position:"fixed"},onFocus:l=>{var u;const c=l.relatedTarget;!((u=o.viewport)!=null&&u.contains(c))&&a()}})});bs.displayName=Un;var Xt="Toast",Kp="toast.swipeStart",Wp="toast.swipeMove",Zp="toast.swipeCancel",Yp="toast.swipeEnd",qn=i.forwardRef((t,s)=>{const{forceMount:r,open:a,defaultOpen:n,onOpenChange:o,...l}=t,[c=!0,d]=yo({prop:a,defaultProp:n,onChange:o});return e.jsx(vo,{present:r||c,children:e.jsx(Jp,{open:c,...l,ref:s,onClose:()=>d(!1),onPause:jt(t.onPause),onResume:jt(t.onResume),onSwipeStart:pe(t.onSwipeStart,u=>{u.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:pe(t.onSwipeMove,u=>{const{x:m,y:f}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","move"),u.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${m}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${f}px`)}),onSwipeCancel:pe(t.onSwipeCancel,u=>{u.currentTarget.setAttribute("data-swipe","cancel"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:pe(t.onSwipeEnd,u=>{const{x:m,y:f}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","end"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${m}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${f}px`),d(!1)})})})});qn.displayName=Xt;var[Xp,Qp]=Mn(Xt,{onClose(){}}),Jp=i.forwardRef((t,s)=>{const{__scopeToast:r,type:a="foreground",duration:n,open:o,onClose:l,onEscapeKeyDown:c,onPause:d,onResume:u,onSwipeStart:m,onSwipeMove:f,onSwipeCancel:y,onSwipeEnd:N,...h}=t,p=Yt(Xt,r),[g,x]=i.useState(null),b=vr(s,T=>x(T)),j=i.useRef(null),w=i.useRef(null),E=n||p.duration,C=i.useRef(0),A=i.useRef(E),B=i.useRef(0),{onToastAdd:z,onToastRemove:Y}=p,K=jt(()=>{var O;(g==null?void 0:g.contains(document.activeElement))&&((O=p.viewport)==null||O.focus()),l()}),M=i.useCallback(T=>{!T||T===1/0||(window.clearTimeout(B.current),C.current=new Date().getTime(),B.current=window.setTimeout(K,T))},[K]);i.useEffect(()=>{const T=p.viewport;if(T){const O=()=>{M(A.current),u==null||u()},V=()=>{const Q=new Date().getTime()-C.current;A.current=A.current-Q,window.clearTimeout(B.current),d==null||d()};return T.addEventListener(hs,V),T.addEventListener(xs,O),()=>{T.removeEventListener(hs,V),T.removeEventListener(xs,O)}}},[p.viewport,E,d,u,M]),i.useEffect(()=>{o&&!p.isClosePausedRef.current&&M(E)},[o,E,p.isClosePausedRef,M]),i.useEffect(()=>(z(),()=>Y()),[z,Y]);const W=i.useMemo(()=>g?Xn(g):null,[g]);return p.viewport?e.jsxs(e.Fragment,{children:[W&&e.jsx(em,{__scopeToast:r,role:"status","aria-live":a==="foreground"?"assertive":"polite","aria-atomic":!0,children:W}),e.jsx(Xp,{scope:r,onClose:K,children:wr.createPortal(e.jsx(Hs.ItemSlot,{scope:r,children:e.jsx(jo,{asChild:!0,onEscapeKeyDown:pe(c,()=>{p.isFocusedToastEscapeKeyDownRef.current||K(),p.isFocusedToastEscapeKeyDownRef.current=!1}),children:e.jsx(re.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":o?"open":"closed","data-swipe-direction":p.swipeDirection,...h,ref:b,style:{userSelect:"none",touchAction:"none",...t.style},onKeyDown:pe(t.onKeyDown,T=>{T.key==="Escape"&&(c==null||c(T.nativeEvent),T.nativeEvent.defaultPrevented||(p.isFocusedToastEscapeKeyDownRef.current=!0,K()))}),onPointerDown:pe(t.onPointerDown,T=>{T.button===0&&(j.current={x:T.clientX,y:T.clientY})}),onPointerMove:pe(t.onPointerMove,T=>{if(!j.current)return;const O=T.clientX-j.current.x,V=T.clientY-j.current.y,Q=!!w.current,_=["left","right"].includes(p.swipeDirection),I=["left","up"].includes(p.swipeDirection)?Math.min:Math.max,P=_?I(0,O):0,U=_?0:I(0,V),S=T.pointerType==="touch"?10:2,R={x:P,y:U},$={originalEvent:T,delta:R};Q?(w.current=R,ht(Wp,f,$,{discrete:!1})):fr(R,p.swipeDirection,S)?(w.current=R,ht(Kp,m,$,{discrete:!1}),T.target.setPointerCapture(T.pointerId)):(Math.abs(O)>S||Math.abs(V)>S)&&(j.current=null)}),onPointerUp:pe(t.onPointerUp,T=>{const O=w.current,V=T.target;if(V.hasPointerCapture(T.pointerId)&&V.releasePointerCapture(T.pointerId),w.current=null,j.current=null,O){const Q=T.currentTarget,_={originalEvent:T,delta:O};fr(O,p.swipeDirection,p.swipeThreshold)?ht(Yp,N,_,{discrete:!0}):ht(Zp,y,_,{discrete:!0}),Q.addEventListener("click",I=>I.preventDefault(),{once:!0})}})})})}),p.viewport)})]}):null}),em=t=>{const{__scopeToast:s,children:r,...a}=t,n=Yt(Xt,s),[o,l]=i.useState(!1),[c,d]=i.useState(!1);return rm(()=>l(!0)),i.useEffect(()=>{const u=window.setTimeout(()=>d(!0),1e3);return()=>window.clearTimeout(u)},[]),c?null:e.jsx(wo,{asChild:!0,children:e.jsx(jr,{...a,children:o&&e.jsxs(e.Fragment,{children:[n.label," ",r]})})})},tm="ToastTitle",Gn=i.forwardRef((t,s)=>{const{__scopeToast:r,...a}=t;return e.jsx(re.div,{...a,ref:s})});Gn.displayName=tm;var sm="ToastDescription",Hn=i.forwardRef((t,s)=>{const{__scopeToast:r,...a}=t;return e.jsx(re.div,{...a,ref:s})});Hn.displayName=sm;var Kn="ToastAction",Wn=i.forwardRef((t,s)=>{const{altText:r,...a}=t;return r.trim()?e.jsx(Yn,{altText:r,asChild:!0,children:e.jsx(Ks,{...a,ref:s})}):(console.error(`Invalid prop \`altText\` supplied to \`${Kn}\`. Expected non-empty \`string\`.`),null)});Wn.displayName=Kn;var Zn="ToastClose",Ks=i.forwardRef((t,s)=>{const{__scopeToast:r,...a}=t,n=Qp(Zn,r);return e.jsx(Yn,{asChild:!0,children:e.jsx(re.button,{type:"button",...a,ref:s,onClick:pe(t.onClick,n.onClose)})})});Ks.displayName=Zn;var Yn=i.forwardRef((t,s)=>{const{__scopeToast:r,altText:a,...n}=t;return e.jsx(re.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":a||void 0,...n,ref:s})});function Xn(t){const s=[];return Array.from(t.childNodes).forEach(a=>{if(a.nodeType===a.TEXT_NODE&&a.textContent&&s.push(a.textContent),am(a)){const n=a.ariaHidden||a.hidden||a.style.display==="none",o=a.dataset.radixToastAnnounceExclude==="";if(!n)if(o){const l=a.dataset.radixToastAnnounceAlt;l&&s.push(l)}else s.push(...Xn(a))}}),s}function ht(t,s,r,{discrete:a}){const n=r.originalEvent.currentTarget,o=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:r});s&&n.addEventListener(t,s,{once:!0}),a?ko(n,o):n.dispatchEvent(o)}var fr=(t,s,r=0)=>{const a=Math.abs(t.x),n=Math.abs(t.y),o=a>n;return s==="left"||s==="right"?o&&a>r:!o&&n>r};function rm(t=()=>{}){const s=jt(t);No(()=>{let r=0,a=0;return r=window.requestAnimationFrame(()=>a=window.requestAnimationFrame(s)),()=>{window.cancelAnimationFrame(r),window.cancelAnimationFrame(a)}},[s])}function am(t){return t.nodeType===t.ELEMENT_NODE}function nm(t){const s=[],r=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:a=>{const n=a.tagName==="INPUT"&&a.type==="hidden";return a.disabled||a.hidden||n?NodeFilter.FILTER_SKIP:a.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)s.push(r.currentNode);return s}function is(t){const s=document.activeElement;return t.some(r=>r===s?!0:(r.focus(),document.activeElement!==s))}var om=Bn,Qn=Vn,Jn=qn,eo=Gn,to=Hn,so=Wn,ro=Ks;const im=om,ao=i.forwardRef(({className:t,...s},r)=>e.jsx(Qn,{ref:r,className:v("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",t),...s}));ao.displayName=Qn.displayName;const lm=Ee("group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md border p-4 pr-6 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),no=i.forwardRef(({className:t,variant:s,...r},a)=>e.jsx(Jn,{ref:a,className:v(lm({variant:s}),t),...r}));no.displayName=Jn.displayName;const cm=i.forwardRef(({className:t,...s},r)=>e.jsx(so,{ref:r,className:v("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors hover:bg-secondary focus:outline-none focus:ring-1 focus:ring-ring disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",t),...s}));cm.displayName=so.displayName;const oo=i.forwardRef(({className:t,...s},r)=>e.jsx(ro,{ref:r,className:v("absolute right-1 top-1 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",t),"toast-close":"",...s,children:e.jsx(vs,{className:"h-4 w-4"})}));oo.displayName=ro.displayName;const io=i.forwardRef(({className:t,...s},r)=>e.jsx(eo,{ref:r,className:v("text-sm font-semibold [&+div]:text-xs",t),...s}));io.displayName=eo.displayName;const lo=i.forwardRef(({className:t,...s},r)=>e.jsx(to,{ref:r,className:v("text-sm opacity-90",t),...s}));lo.displayName=to.displayName;function dm(){const{toasts:t}=zt();return e.jsxs(im,{children:[t.map(function({id:s,title:r,description:a,action:n,...o}){return e.jsxs(no,{...o,children:[e.jsxs("div",{className:"grid gap-1",children:[r&&e.jsx(io,{children:r}),a&&e.jsx(lo,{children:a})]}),n,e.jsx(oo,{})]},s)}),e.jsx(ao,{})]})}function um({children:t}){return e.jsx("div",{className:"flex min-h-screen",children:e.jsxs(Tn,{children:[e.jsx(zp,{}),e.jsxs(In,{children:[e.jsxs("header",{className:"flex h-16 shrink-0 items-center gap-2 border-b px-4",children:[e.jsx(An,{}),e.jsx(Vs,{orientation:"vertical",className:"mr-2 h-4"}),e.jsx(mp,{}),e.jsx("div",{className:"ml-auto px-4",children:e.jsx(Hi,{})})]}),e.jsx("main",{className:"flex flex-1 flex-col",children:t}),e.jsx(dm,{}),e.jsx(Vp,{})]})]})})}var pm=function(){return null};const mm=new _i({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:!1,staleTime:5*60*1e3}}});function gm({children:t}){return e.jsxs(Ii,{client:mm,children:[t,e.jsx(pm,{initialIsOpen:!1})]})}function fm({children:t}){const[s,r]=i.useState(null),[a,n]=i.useState(null),[o,l]=i.useState(!0),c=i.useRef(!1),d=i.useCallback(async()=>{if(!c.current){c.current=!0,l(!0);try{const m=await fetch("/ui/api/v1/cluster/nodes");if(!m.ok)throw new Error(`Failed to fetch cluster data: ${m.statusText}`);const f=await m.json();r(f),n(null)}catch(m){n(m instanceof Error?m.message:"An unknown error occurred")}finally{l(!1),c.current=!1}}},[]),u=i.useCallback(async()=>{await d()},[d]);return i.useEffect(()=>{d()},[d]),e.jsx(fa.Provider,{value:{cluster:s,error:a,isLoading:o,refresh:u},children:t})}function hm(){return e.jsx(gm,{children:e.jsx(qi,{defaultTheme:"dark",storageKey:"loki-ui-theme",children:e.jsx(fm,{children:e.jsx(um,{children:e.jsx(Co,{children:Nn.map(t=>e.jsx(To,{path:t.path,element:t.element},t.path))})})})})})}const xm=kn(),bm=Ro([{path:"*",element:e.jsx(hm,{})}],{basename:xm,future:{v7_relativeSplatPath:!0}}),co=document.getElementById("root");if(!co)throw new Error("Root element not found");ca(co).render(e.jsx(i.StrictMode,{children:e.jsx(Ao,{router:bm,future:{v7_startTransition:!0}})})); diff --git a/pkg/ui/frontend/dist/assets/query-management-DbWM5GrR.js b/pkg/ui/frontend/dist/assets/query-management-D8IQJSUy.js similarity index 99% rename from pkg/ui/frontend/dist/assets/query-management-DbWM5GrR.js rename to pkg/ui/frontend/dist/assets/query-management-D8IQJSUy.js index 47a82c4617148..d03bf384da87d 100644 --- a/pkg/ui/frontend/dist/assets/query-management-DbWM5GrR.js +++ b/pkg/ui/frontend/dist/assets/query-management-D8IQJSUy.js @@ -1 +1 @@ -var at=t=>{throw TypeError(t)};var He=(t,e,s)=>e.has(t)||at("Cannot "+s);var r=(t,e,s)=>(He(t,e,"read from private field"),s?s.call(t):e.get(t)),l=(t,e,s)=>e.has(t)?at("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,s),u=(t,e,s,i)=>(He(t,e,"write to private field"),i?i.call(t,s):e.set(t,s),s),p=(t,e,s)=>(He(t,e,"access private method"),s);var ke=(t,e,s,i)=>({set _(n){u(t,e,n,s)},get _(){return r(t,e,i)}});import{r as L}from"./react-core-D_V7s-9r.js";import{j as jt}from"./radix-core-ByqQ8fsu.js";var Ue=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},de=typeof window>"u"||"Deno"in globalThis;function k(){}function kt(t,e){return typeof t=="function"?t(e):t}function Ge(t){return typeof t=="number"&&t>=0&&t!==1/0}function Ft(t,e){return Math.max(t+(e||0)-Date.now(),0)}function pe(t,e){return typeof t=="function"?t(e):t}function G(t,e){return typeof t=="function"?t(e):t}function ut(t,e){const{type:s="all",exact:i,fetchStatus:n,predicate:a,queryKey:h,stale:c}=t;if(h){if(i){if(e.queryHash!==st(h,e.options))return!1}else if(!Te(e.queryKey,h))return!1}if(s!=="all"){const d=e.isActive();if(s==="active"&&!d||s==="inactive"&&d)return!1}return!(typeof c=="boolean"&&e.isStale()!==c||n&&n!==e.state.fetchStatus||a&&!a(e))}function ht(t,e){const{exact:s,status:i,predicate:n,mutationKey:a}=t;if(a){if(!e.options.mutationKey)return!1;if(s){if(Me(e.options.mutationKey)!==Me(a))return!1}else if(!Te(e.options.mutationKey,a))return!1}return!(i&&e.state.status!==i||n&&!n(e))}function st(t,e){return((e==null?void 0:e.queryKeyHashFn)||Me)(t)}function Me(t){return JSON.stringify(t,(e,s)=>Be(s)?Object.keys(s).sort().reduce((i,n)=>(i[n]=s[n],i),{}):s)}function Te(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?!Object.keys(e).some(s=>!Te(t[s],e[s])):!1}function Qt(t,e){if(t===e)return t;const s=ot(t)&&ot(e);if(s||Be(t)&&Be(e)){const i=s?t:Object.keys(t),n=i.length,a=s?e:Object.keys(e),h=a.length,c=s?[]:{};let d=0;for(let w=0;w{setTimeout(e,t)})}function ze(t,e,s){return typeof s.structuralSharing=="function"?s.structuralSharing(t,e):s.structuralSharing!==!1?Qt(t,e):e}function Kt(t,e,s=0){const i=[...t,e];return s&&i.length>s?i.slice(1):i}function Ht(t,e,s=0){const i=[e,...t];return s&&i.length>s?i.slice(0,-1):i}var it=Symbol();function Et(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===it?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}var re,X,me,bt,_t=(bt=class extends Ue{constructor(){super();l(this,re);l(this,X);l(this,me);u(this,me,e=>{if(!de&&window.addEventListener){const s=()=>e();return window.addEventListener("visibilitychange",s,!1),()=>{window.removeEventListener("visibilitychange",s)}}})}onSubscribe(){r(this,X)||this.setEventListener(r(this,me))}onUnsubscribe(){var e;this.hasListeners()||((e=r(this,X))==null||e.call(this),u(this,X,void 0))}setEventListener(e){var s;u(this,me,e),(s=r(this,X))==null||s.call(this),u(this,X,e(i=>{typeof i=="boolean"?this.setFocused(i):this.onFocus()}))}setFocused(e){r(this,re)!==e&&(u(this,re,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(s=>{s(e)})}isFocused(){var e;return typeof r(this,re)=="boolean"?r(this,re):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},re=new WeakMap,X=new WeakMap,me=new WeakMap,bt),rt=new _t,be,Y,ge,gt,Gt=(gt=class extends Ue{constructor(){super();l(this,be,!0);l(this,Y);l(this,ge);u(this,ge,e=>{if(!de&&window.addEventListener){const s=()=>e(!0),i=()=>e(!1);return window.addEventListener("online",s,!1),window.addEventListener("offline",i,!1),()=>{window.removeEventListener("online",s),window.removeEventListener("offline",i)}}})}onSubscribe(){r(this,Y)||this.setEventListener(r(this,ge))}onUnsubscribe(){var e;this.hasListeners()||((e=r(this,Y))==null||e.call(this),u(this,Y,void 0))}setEventListener(e){var s;u(this,ge,e),(s=r(this,Y))==null||s.call(this),u(this,Y,e(this.setOnline.bind(this)))}setOnline(e){r(this,be)!==e&&(u(this,be,e),this.listeners.forEach(i=>{i(e)}))}isOnline(){return r(this,be)}},be=new WeakMap,Y=new WeakMap,ge=new WeakMap,gt),Ke=new Gt;function Ve(){let t,e;const s=new Promise((n,a)=>{t=n,e=a});s.status="pending",s.catch(()=>{});function i(n){Object.assign(s,n),delete s.resolve,delete s.reject}return s.resolve=n=>{i({status:"fulfilled",value:n}),t(n)},s.reject=n=>{i({status:"rejected",reason:n}),e(n)},s}function Nt(t){return Math.min(1e3*2**t,3e4)}function Dt(t){return(t??"online")==="online"?Ke.isOnline():!0}var Mt=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function _e(t){return t instanceof Mt}function Tt(t){let e=!1,s=0,i=!1,n;const a=Ve(),h=f=>{var y;i||(C(new Mt(f)),(y=t.abort)==null||y.call(t))},c=()=>{e=!0},d=()=>{e=!1},w=()=>rt.isFocused()&&(t.networkMode==="always"||Ke.isOnline())&&t.canRun(),b=()=>Dt(t.networkMode)&&t.canRun(),o=f=>{var y;i||(i=!0,(y=t.onSuccess)==null||y.call(t,f),n==null||n(),a.resolve(f))},C=f=>{var y;i||(i=!0,(y=t.onError)==null||y.call(t,f),n==null||n(),a.reject(f))},g=()=>new Promise(f=>{var y;n=Q=>{(i||w())&&f(Q)},(y=t.onPause)==null||y.call(t)}).then(()=>{var f;n=void 0,i||(f=t.onContinue)==null||f.call(t)}),S=()=>{if(i)return;let f;const y=s===0?t.initialPromise:void 0;try{f=y??t.fn()}catch(Q){f=Promise.reject(Q)}Promise.resolve(f).then(o).catch(Q=>{var K;if(i)return;const T=t.retry??(de?0:3),R=t.retryDelay??Nt,D=typeof R=="function"?R(s,Q):R,U=T===!0||typeof T=="number"&&sw()?void 0:g()).then(()=>{e?C(Q):S()})})};return{promise:a,cancel:h,continue:()=>(n==null||n(),a),cancelRetry:c,continueRetry:d,canStart:b,start:()=>(b()?S():g().then(S),a)}}function Bt(){let t=[],e=0,s=c=>{c()},i=c=>{c()},n=c=>setTimeout(c,0);const a=c=>{e?t.push(c):n(()=>{s(c)})},h=()=>{const c=t;t=[],c.length&&n(()=>{i(()=>{c.forEach(d=>{s(d)})})})};return{batch:c=>{let d;e++;try{d=c()}finally{e--,e||h()}return d},batchCalls:c=>(...d)=>{a(()=>{c(...d)})},schedule:a,setNotifyFunction:c=>{s=c},setBatchNotifyFunction:c=>{i=c},setScheduler:c=>{n=c}}}var E=Bt(),ne,vt,At=(vt=class{constructor(){l(this,ne)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Ge(this.gcTime)&&u(this,ne,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(de?1/0:5*60*1e3))}clearGcTimeout(){r(this,ne)&&(clearTimeout(r(this,ne)),u(this,ne,void 0))}},ne=new WeakMap,vt),ve,we,j,ae,M,Ae,ue,H,$,wt,zt=(wt=class extends At{constructor(e){super();l(this,H);l(this,ve);l(this,we);l(this,j);l(this,ae);l(this,M);l(this,Ae);l(this,ue);u(this,ue,!1),u(this,Ae,e.defaultOptions),this.setOptions(e.options),this.observers=[],u(this,ae,e.client),u(this,j,r(this,ae).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,u(this,ve,Vt(this.options)),this.state=e.state??r(this,ve),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var e;return(e=r(this,M))==null?void 0:e.promise}setOptions(e){this.options={...r(this,Ae),...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&r(this,j).remove(this)}setData(e,s){const i=ze(this.state.data,e,this.options);return p(this,H,$).call(this,{data:i,type:"success",dataUpdatedAt:s==null?void 0:s.updatedAt,manual:s==null?void 0:s.manual}),i}setState(e,s){p(this,H,$).call(this,{type:"setState",state:e,setStateOptions:s})}cancel(e){var i,n;const s=(i=r(this,M))==null?void 0:i.promise;return(n=r(this,M))==null||n.cancel(e),s?s.then(k).catch(k):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(r(this,ve))}isActive(){return this.observers.some(e=>G(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===it||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(e=0){return this.state.isInvalidated||this.state.data===void 0||!Ft(this.state.dataUpdatedAt,e)}onFocus(){var s;const e=this.observers.find(i=>i.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(s=r(this,M))==null||s.continue()}onOnline(){var s;const e=this.observers.find(i=>i.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(s=r(this,M))==null||s.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),r(this,j).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(s=>s!==e),this.observers.length||(r(this,M)&&(r(this,ue)?r(this,M).cancel({revert:!0}):r(this,M).cancelRetry()),this.scheduleGc()),r(this,j).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||p(this,H,$).call(this,{type:"invalidate"})}fetch(e,s){var d,w,b;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(s!=null&&s.cancelRefetch))this.cancel({silent:!0});else if(r(this,M))return r(this,M).continueRetry(),r(this,M).promise}if(e&&this.setOptions(e),!this.options.queryFn){const o=this.observers.find(C=>C.options.queryFn);o&&this.setOptions(o.options)}const i=new AbortController,n=o=>{Object.defineProperty(o,"signal",{enumerable:!0,get:()=>(u(this,ue,!0),i.signal)})},a=()=>{const o=Et(this.options,s),C={client:r(this,ae),queryKey:this.queryKey,meta:this.meta};return n(C),u(this,ue,!1),this.options.persister?this.options.persister(o,C,this):o(C)},h={fetchOptions:s,options:this.options,queryKey:this.queryKey,client:r(this,ae),state:this.state,fetchFn:a};n(h),(d=this.options.behavior)==null||d.onFetch(h,this),u(this,we,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((w=h.fetchOptions)==null?void 0:w.meta))&&p(this,H,$).call(this,{type:"fetch",meta:(b=h.fetchOptions)==null?void 0:b.meta});const c=o=>{var C,g,S,f;_e(o)&&o.silent||p(this,H,$).call(this,{type:"error",error:o}),_e(o)||((g=(C=r(this,j).config).onError)==null||g.call(C,o,this),(f=(S=r(this,j).config).onSettled)==null||f.call(S,this.state.data,o,this)),this.scheduleGc()};return u(this,M,Tt({initialPromise:s==null?void 0:s.initialPromise,fn:h.fetchFn,abort:i.abort.bind(i),onSuccess:o=>{var C,g,S,f;if(o===void 0){c(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(o)}catch(y){c(y);return}(g=(C=r(this,j).config).onSuccess)==null||g.call(C,o,this),(f=(S=r(this,j).config).onSettled)==null||f.call(S,o,this.state.error,this),this.scheduleGc()},onError:c,onFail:(o,C)=>{p(this,H,$).call(this,{type:"failed",failureCount:o,error:C})},onPause:()=>{p(this,H,$).call(this,{type:"pause"})},onContinue:()=>{p(this,H,$).call(this,{type:"continue"})},retry:h.options.retry,retryDelay:h.options.retryDelay,networkMode:h.options.networkMode,canRun:()=>!0})),r(this,M).start()}},ve=new WeakMap,we=new WeakMap,j=new WeakMap,ae=new WeakMap,M=new WeakMap,Ae=new WeakMap,ue=new WeakMap,H=new WeakSet,$=function(e){const s=i=>{switch(e.type){case"failed":return{...i,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...i,fetchStatus:"paused"};case"continue":return{...i,fetchStatus:"fetching"};case"fetch":return{...i,...It(i.data,this.options),fetchMeta:e.meta??null};case"success":return{...i,data:e.data,dataUpdateCount:i.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const n=e.error;return _e(n)&&n.revert&&r(this,we)?{...r(this,we),fetchStatus:"idle"}:{...i,error:n,errorUpdateCount:i.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:i.fetchFailureCount+1,fetchFailureReason:n,fetchStatus:"idle",status:"error"};case"invalidate":return{...i,isInvalidated:!0};case"setState":return{...i,...e.state}}};this.state=s(this.state),E.batch(()=>{this.observers.forEach(i=>{i.onQueryUpdate()}),r(this,j).notify({query:this,type:"updated",action:e})})},wt);function It(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Dt(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function Vt(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,s=e!==void 0,i=s?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:s?i??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:s?"success":"pending",fetchStatus:"idle"}}var N,Ct,$t=(Ct=class extends Ue{constructor(e={}){super();l(this,N);this.config=e,u(this,N,new Map)}build(e,s,i){const n=s.queryKey,a=s.queryHash??st(n,s);let h=this.get(a);return h||(h=new zt({client:e,queryKey:n,queryHash:a,options:e.defaultQueryOptions(s),state:i,defaultOptions:e.getQueryDefaults(n)}),this.add(h)),h}add(e){r(this,N).has(e.queryHash)||(r(this,N).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const s=r(this,N).get(e.queryHash);s&&(e.destroy(),s===e&&r(this,N).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){E.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return r(this,N).get(e)}getAll(){return[...r(this,N).values()]}find(e){const s={exact:!0,...e};return this.getAll().find(i=>ut(s,i))}findAll(e={}){const s=this.getAll();return Object.keys(e).length>0?s.filter(i=>ut(e,i)):s}notify(e){E.batch(()=>{this.listeners.forEach(s=>{s(e)})})}onFocus(){E.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){E.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},N=new WeakMap,Ct),B,I,he,z,J,Ot,Wt=(Ot=class extends At{constructor(e){super();l(this,z);l(this,B);l(this,I);l(this,he);this.mutationId=e.mutationId,u(this,I,e.mutationCache),u(this,B,[]),this.state=e.state||Jt(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){r(this,B).includes(e)||(r(this,B).push(e),this.clearGcTimeout(),r(this,I).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){u(this,B,r(this,B).filter(s=>s!==e)),this.scheduleGc(),r(this,I).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){r(this,B).length||(this.state.status==="pending"?this.scheduleGc():r(this,I).remove(this))}continue(){var e;return((e=r(this,he))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var n,a,h,c,d,w,b,o,C,g,S,f,y,Q,T,R,D,U,K,A;u(this,he,Tt({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(F,O)=>{p(this,z,J).call(this,{type:"failed",failureCount:F,error:O})},onPause:()=>{p(this,z,J).call(this,{type:"pause"})},onContinue:()=>{p(this,z,J).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>r(this,I).canRun(this)}));const s=this.state.status==="pending",i=!r(this,he).canStart();try{if(!s){p(this,z,J).call(this,{type:"pending",variables:e,isPaused:i}),await((a=(n=r(this,I).config).onMutate)==null?void 0:a.call(n,e,this));const O=await((c=(h=this.options).onMutate)==null?void 0:c.call(h,e));O!==this.state.context&&p(this,z,J).call(this,{type:"pending",context:O,variables:e,isPaused:i})}const F=await r(this,he).start();return await((w=(d=r(this,I).config).onSuccess)==null?void 0:w.call(d,F,e,this.state.context,this)),await((o=(b=this.options).onSuccess)==null?void 0:o.call(b,F,e,this.state.context)),await((g=(C=r(this,I).config).onSettled)==null?void 0:g.call(C,F,null,this.state.variables,this.state.context,this)),await((f=(S=this.options).onSettled)==null?void 0:f.call(S,F,null,e,this.state.context)),p(this,z,J).call(this,{type:"success",data:F}),F}catch(F){try{throw await((Q=(y=r(this,I).config).onError)==null?void 0:Q.call(y,F,e,this.state.context,this)),await((R=(T=this.options).onError)==null?void 0:R.call(T,F,e,this.state.context)),await((U=(D=r(this,I).config).onSettled)==null?void 0:U.call(D,void 0,F,this.state.variables,this.state.context,this)),await((A=(K=this.options).onSettled)==null?void 0:A.call(K,void 0,F,e,this.state.context)),F}finally{p(this,z,J).call(this,{type:"error",error:F})}}finally{r(this,I).runNext(this)}}},B=new WeakMap,I=new WeakMap,he=new WeakMap,z=new WeakSet,J=function(e){const s=i=>{switch(e.type){case"failed":return{...i,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...i,isPaused:!0};case"continue":return{...i,isPaused:!1};case"pending":return{...i,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...i,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...i,data:void 0,error:e.error,failureCount:i.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=s(this.state),E.batch(()=>{r(this,B).forEach(i=>{i.onMutationUpdate(e)}),r(this,I).notify({mutation:this,type:"updated",action:e})})},Ot);function Jt(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var W,_,Ie,Rt,Xt=(Rt=class extends Ue{constructor(e={}){super();l(this,W);l(this,_);l(this,Ie);this.config=e,u(this,W,new Set),u(this,_,new Map),u(this,Ie,0)}build(e,s,i){const n=new Wt({mutationCache:this,mutationId:++ke(this,Ie)._,options:e.defaultMutationOptions(s),state:i});return this.add(n),n}add(e){r(this,W).add(e);const s=Le(e);if(typeof s=="string"){const i=r(this,_).get(s);i?i.push(e):r(this,_).set(s,[e])}this.notify({type:"added",mutation:e})}remove(e){if(r(this,W).delete(e)){const s=Le(e);if(typeof s=="string"){const i=r(this,_).get(s);if(i)if(i.length>1){const n=i.indexOf(e);n!==-1&&i.splice(n,1)}else i[0]===e&&r(this,_).delete(s)}}this.notify({type:"removed",mutation:e})}canRun(e){const s=Le(e);if(typeof s=="string"){const i=r(this,_).get(s),n=i==null?void 0:i.find(a=>a.state.status==="pending");return!n||n===e}else return!0}runNext(e){var i;const s=Le(e);if(typeof s=="string"){const n=(i=r(this,_).get(s))==null?void 0:i.find(a=>a!==e&&a.state.isPaused);return(n==null?void 0:n.continue())??Promise.resolve()}else return Promise.resolve()}clear(){E.batch(()=>{r(this,W).forEach(e=>{this.notify({type:"removed",mutation:e})}),r(this,W).clear(),r(this,_).clear()})}getAll(){return Array.from(r(this,W))}find(e){const s={exact:!0,...e};return this.getAll().find(i=>ht(s,i))}findAll(e={}){return this.getAll().filter(s=>ht(e,s))}notify(e){E.batch(()=>{this.listeners.forEach(s=>{s(e)})})}resumePausedMutations(){const e=this.getAll().filter(s=>s.state.isPaused);return E.batch(()=>Promise.all(e.map(s=>s.continue().catch(k))))}},W=new WeakMap,_=new WeakMap,Ie=new WeakMap,Rt);function Le(t){var e;return(e=t.options.scope)==null?void 0:e.id}function lt(t){return{onFetch:(e,s)=>{var b,o,C,g,S;const i=e.options,n=(C=(o=(b=e.fetchOptions)==null?void 0:b.meta)==null?void 0:o.fetchMore)==null?void 0:C.direction,a=((g=e.state.data)==null?void 0:g.pages)||[],h=((S=e.state.data)==null?void 0:S.pageParams)||[];let c={pages:[],pageParams:[]},d=0;const w=async()=>{let f=!1;const y=R=>{Object.defineProperty(R,"signal",{enumerable:!0,get:()=>(e.signal.aborted?f=!0:e.signal.addEventListener("abort",()=>{f=!0}),e.signal)})},Q=Et(e.options,e.fetchOptions),T=async(R,D,U)=>{if(f)return Promise.reject();if(D==null&&R.pages.length)return Promise.resolve(R);const K={client:e.client,queryKey:e.queryKey,pageParam:D,direction:U?"backward":"forward",meta:e.options.meta};y(K);const A=await Q(K),{maxPages:F}=e.options,O=U?Ht:Kt;return{pages:O(R.pages,A,F),pageParams:O(R.pageParams,D,F)}};if(n&&a.length){const R=n==="backward",D=R?Yt:dt,U={pages:a,pageParams:h},K=D(i,U);c=await T(U,K,R)}else{const R=t??a.length;do{const D=d===0?h[0]??i.initialPageParam:dt(i,c);if(d>0&&D==null)break;c=await T(c,D),d++}while(d{var f,y;return(y=(f=e.options).persister)==null?void 0:y.call(f,w,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},s)}:e.fetchFn=w}}}function dt(t,{pages:e,pageParams:s}){const i=e.length-1;return e.length>0?t.getNextPageParam(e[i],e,s[i],s):void 0}function Yt(t,{pages:e,pageParams:s}){var i;return e.length>0?(i=t.getPreviousPageParam)==null?void 0:i.call(t,e[0],e,s[0],s):void 0}var P,Z,ee,Ce,Oe,te,Re,Pe,Pt,gs=(Pt=class{constructor(t={}){l(this,P);l(this,Z);l(this,ee);l(this,Ce);l(this,Oe);l(this,te);l(this,Re);l(this,Pe);u(this,P,t.queryCache||new $t),u(this,Z,t.mutationCache||new Xt),u(this,ee,t.defaultOptions||{}),u(this,Ce,new Map),u(this,Oe,new Map),u(this,te,0)}mount(){ke(this,te)._++,r(this,te)===1&&(u(this,Re,rt.subscribe(async t=>{t&&(await this.resumePausedMutations(),r(this,P).onFocus())})),u(this,Pe,Ke.subscribe(async t=>{t&&(await this.resumePausedMutations(),r(this,P).onOnline())})))}unmount(){var t,e;ke(this,te)._--,r(this,te)===0&&((t=r(this,Re))==null||t.call(this),u(this,Re,void 0),(e=r(this,Pe))==null||e.call(this),u(this,Pe,void 0))}isFetching(t){return r(this,P).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return r(this,Z).findAll({...t,status:"pending"}).length}getQueryData(t){var s;const e=this.defaultQueryOptions({queryKey:t});return(s=r(this,P).get(e.queryHash))==null?void 0:s.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),s=r(this,P).build(this,e),i=s.state.data;return i===void 0?this.fetchQuery(t):(t.revalidateIfStale&&s.isStaleByTime(pe(e.staleTime,s))&&this.prefetchQuery(e),Promise.resolve(i))}getQueriesData(t){return r(this,P).findAll(t).map(({queryKey:e,state:s})=>{const i=s.data;return[e,i]})}setQueryData(t,e,s){const i=this.defaultQueryOptions({queryKey:t}),n=r(this,P).get(i.queryHash),a=n==null?void 0:n.state.data,h=kt(e,a);if(h!==void 0)return r(this,P).build(this,i).setData(h,{...s,manual:!0})}setQueriesData(t,e,s){return E.batch(()=>r(this,P).findAll(t).map(({queryKey:i})=>[i,this.setQueryData(i,e,s)]))}getQueryState(t){var s;const e=this.defaultQueryOptions({queryKey:t});return(s=r(this,P).get(e.queryHash))==null?void 0:s.state}removeQueries(t){const e=r(this,P);E.batch(()=>{e.findAll(t).forEach(s=>{e.remove(s)})})}resetQueries(t,e){const s=r(this,P),i={type:"active",...t};return E.batch(()=>(s.findAll(t).forEach(n=>{n.reset()}),this.refetchQueries(i,e)))}cancelQueries(t,e={}){const s={revert:!0,...e},i=E.batch(()=>r(this,P).findAll(t).map(n=>n.cancel(s)));return Promise.all(i).then(k).catch(k)}invalidateQueries(t,e={}){return E.batch(()=>{if(r(this,P).findAll(t).forEach(i=>{i.invalidate()}),(t==null?void 0:t.refetchType)==="none")return Promise.resolve();const s={...t,type:(t==null?void 0:t.refetchType)??(t==null?void 0:t.type)??"active"};return this.refetchQueries(s,e)})}refetchQueries(t,e={}){const s={...e,cancelRefetch:e.cancelRefetch??!0},i=E.batch(()=>r(this,P).findAll(t).filter(n=>!n.isDisabled()).map(n=>{let a=n.fetch(void 0,s);return s.throwOnError||(a=a.catch(k)),n.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(i).then(k)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const s=r(this,P).build(this,e);return s.isStaleByTime(pe(e.staleTime,s))?s.fetch(e):Promise.resolve(s.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(k).catch(k)}fetchInfiniteQuery(t){return t.behavior=lt(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(k).catch(k)}ensureInfiniteQueryData(t){return t.behavior=lt(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return Ke.isOnline()?r(this,Z).resumePausedMutations():Promise.resolve()}getQueryCache(){return r(this,P)}getMutationCache(){return r(this,Z)}getDefaultOptions(){return r(this,ee)}setDefaultOptions(t){u(this,ee,t)}setQueryDefaults(t,e){r(this,Ce).set(Me(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...r(this,Ce).values()],s={};return e.forEach(i=>{Te(t,i.queryKey)&&Object.assign(s,i.defaultOptions)}),s}setMutationDefaults(t,e){r(this,Oe).set(Me(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...r(this,Oe).values()];let s={};return e.forEach(i=>{Te(t,i.mutationKey)&&(s={...s,...i.defaultOptions})}),s}defaultQueryOptions(t){if(t._defaulted)return t;const e={...r(this,ee).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=st(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===it&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...r(this,ee).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){r(this,P).clear(),r(this,Z).clear()}},P=new WeakMap,Z=new WeakMap,ee=new WeakMap,Ce=new WeakMap,Oe=new WeakMap,te=new WeakMap,Re=new WeakMap,Pe=new WeakMap,Pt),q,m,xe,x,oe,Se,se,V,qe,Fe,Qe,ce,le,ie,Ee,v,De,$e,We,Je,Xe,Ye,Ze,et,xt,St,Zt=(St=class extends Ue{constructor(e,s){super();l(this,v);l(this,q);l(this,m);l(this,xe);l(this,x);l(this,oe);l(this,Se);l(this,se);l(this,V);l(this,qe);l(this,Fe);l(this,Qe);l(this,ce);l(this,le);l(this,ie);l(this,Ee,new Set);this.options=s,u(this,q,e),u(this,V,null),u(this,se,Ve()),this.options.experimental_prefetchInRender||r(this,se).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(s)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(r(this,m).addObserver(this),ft(r(this,m),this.options)?p(this,v,De).call(this):this.updateResult(),p(this,v,Xe).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return tt(r(this,m),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return tt(r(this,m),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,p(this,v,Ye).call(this),p(this,v,Ze).call(this),r(this,m).removeObserver(this)}setOptions(e,s){const i=this.options,n=r(this,m);if(this.options=r(this,q).defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof G(this.options.enabled,r(this,m))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");p(this,v,et).call(this),r(this,m).setOptions(this.options),i._defaulted&&!Ne(this.options,i)&&r(this,q).getQueryCache().notify({type:"observerOptionsUpdated",query:r(this,m),observer:this});const a=this.hasListeners();a&&yt(r(this,m),n,this.options,i)&&p(this,v,De).call(this),this.updateResult(s),a&&(r(this,m)!==n||G(this.options.enabled,r(this,m))!==G(i.enabled,r(this,m))||pe(this.options.staleTime,r(this,m))!==pe(i.staleTime,r(this,m)))&&p(this,v,$e).call(this);const h=p(this,v,We).call(this);a&&(r(this,m)!==n||G(this.options.enabled,r(this,m))!==G(i.enabled,r(this,m))||h!==r(this,ie))&&p(this,v,Je).call(this,h)}getOptimisticResult(e){const s=r(this,q).getQueryCache().build(r(this,q),e),i=this.createResult(s,e);return ts(this,i)&&(u(this,x,i),u(this,Se,this.options),u(this,oe,r(this,m).state)),i}getCurrentResult(){return r(this,x)}trackResult(e,s){const i={};return Object.keys(e).forEach(n=>{Object.defineProperty(i,n,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(n),s==null||s(n),e[n])})}),i}trackProp(e){r(this,Ee).add(e)}getCurrentQuery(){return r(this,m)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const s=r(this,q).defaultQueryOptions(e),i=r(this,q).getQueryCache().build(r(this,q),s);return i.fetch().then(()=>this.createResult(i,s))}fetch(e){return p(this,v,De).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),r(this,x)))}createResult(e,s){var F;const i=r(this,m),n=this.options,a=r(this,x),h=r(this,oe),c=r(this,Se),w=e!==i?e.state:r(this,xe),{state:b}=e;let o={...b},C=!1,g;if(s._optimisticResults){const O=this.hasListeners(),fe=!O&&ft(e,s),ye=O&&yt(e,i,s,n);(fe||ye)&&(o={...o,...It(b.data,e.options)}),s._optimisticResults==="isRestoring"&&(o.fetchStatus="idle")}let{error:S,errorUpdatedAt:f,status:y}=o;if(s.select&&o.data!==void 0)if(a&&o.data===(h==null?void 0:h.data)&&s.select===r(this,qe))g=r(this,Fe);else try{u(this,qe,s.select),g=s.select(o.data),g=ze(a==null?void 0:a.data,g,s),u(this,Fe,g),u(this,V,null)}catch(O){u(this,V,O)}else g=o.data;if(s.placeholderData!==void 0&&g===void 0&&y==="pending"){let O;if(a!=null&&a.isPlaceholderData&&s.placeholderData===(c==null?void 0:c.placeholderData))O=a.data;else if(O=typeof s.placeholderData=="function"?s.placeholderData((F=r(this,Qe))==null?void 0:F.state.data,r(this,Qe)):s.placeholderData,s.select&&O!==void 0)try{O=s.select(O),u(this,V,null)}catch(fe){u(this,V,fe)}O!==void 0&&(y="success",g=ze(a==null?void 0:a.data,O,s),C=!0)}r(this,V)&&(S=r(this,V),g=r(this,Fe),f=Date.now(),y="error");const Q=o.fetchStatus==="fetching",T=y==="pending",R=y==="error",D=T&&Q,U=g!==void 0,A={status:y,fetchStatus:o.fetchStatus,isPending:T,isSuccess:y==="success",isError:R,isInitialLoading:D,isLoading:D,data:g,dataUpdatedAt:o.dataUpdatedAt,error:S,errorUpdatedAt:f,failureCount:o.fetchFailureCount,failureReason:o.fetchFailureReason,errorUpdateCount:o.errorUpdateCount,isFetched:o.dataUpdateCount>0||o.errorUpdateCount>0,isFetchedAfterMount:o.dataUpdateCount>w.dataUpdateCount||o.errorUpdateCount>w.errorUpdateCount,isFetching:Q,isRefetching:Q&&!T,isLoadingError:R&&!U,isPaused:o.fetchStatus==="paused",isPlaceholderData:C,isRefetchError:R&&U,isStale:nt(e,s),refetch:this.refetch,promise:r(this,se)};if(this.options.experimental_prefetchInRender){const O=je=>{A.status==="error"?je.reject(A.error):A.data!==void 0&&je.resolve(A.data)},fe=()=>{const je=u(this,se,A.promise=Ve());O(je)},ye=r(this,se);switch(ye.status){case"pending":e.queryHash===i.queryHash&&O(ye);break;case"fulfilled":(A.status==="error"||A.data!==ye.value)&&fe();break;case"rejected":(A.status!=="error"||A.error!==ye.reason)&&fe();break}}return A}updateResult(e){const s=r(this,x),i=this.createResult(r(this,m),this.options);if(u(this,oe,r(this,m).state),u(this,Se,this.options),r(this,oe).data!==void 0&&u(this,Qe,r(this,m)),Ne(i,s))return;u(this,x,i);const n={},a=()=>{if(!s)return!0;const{notifyOnChangeProps:h}=this.options,c=typeof h=="function"?h():h;if(c==="all"||!c&&!r(this,Ee).size)return!0;const d=new Set(c??r(this,Ee));return this.options.throwOnError&&d.add("error"),Object.keys(r(this,x)).some(w=>{const b=w;return r(this,x)[b]!==s[b]&&d.has(b)})};(e==null?void 0:e.listeners)!==!1&&a()&&(n.listeners=!0),p(this,v,xt).call(this,{...n,...e})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&p(this,v,Xe).call(this)}},q=new WeakMap,m=new WeakMap,xe=new WeakMap,x=new WeakMap,oe=new WeakMap,Se=new WeakMap,se=new WeakMap,V=new WeakMap,qe=new WeakMap,Fe=new WeakMap,Qe=new WeakMap,ce=new WeakMap,le=new WeakMap,ie=new WeakMap,Ee=new WeakMap,v=new WeakSet,De=function(e){p(this,v,et).call(this);let s=r(this,m).fetch(this.options,e);return e!=null&&e.throwOnError||(s=s.catch(k)),s},$e=function(){p(this,v,Ye).call(this);const e=pe(this.options.staleTime,r(this,m));if(de||r(this,x).isStale||!Ge(e))return;const i=Ft(r(this,x).dataUpdatedAt,e)+1;u(this,ce,setTimeout(()=>{r(this,x).isStale||this.updateResult()},i))},We=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(r(this,m)):this.options.refetchInterval)??!1},Je=function(e){p(this,v,Ze).call(this),u(this,ie,e),!(de||G(this.options.enabled,r(this,m))===!1||!Ge(r(this,ie))||r(this,ie)===0)&&u(this,le,setInterval(()=>{(this.options.refetchIntervalInBackground||rt.isFocused())&&p(this,v,De).call(this)},r(this,ie)))},Xe=function(){p(this,v,$e).call(this),p(this,v,Je).call(this,p(this,v,We).call(this))},Ye=function(){r(this,ce)&&(clearTimeout(r(this,ce)),u(this,ce,void 0))},Ze=function(){r(this,le)&&(clearInterval(r(this,le)),u(this,le,void 0))},et=function(){const e=r(this,q).getQueryCache().build(r(this,q),this.options);if(e===r(this,m))return;const s=r(this,m);u(this,m,e),u(this,xe,e.state),this.hasListeners()&&(s==null||s.removeObserver(this),e.addObserver(this))},xt=function(e){E.batch(()=>{e.listeners&&this.listeners.forEach(s=>{s(r(this,x))}),r(this,q).getQueryCache().notify({query:r(this,m),type:"observerResultsUpdated"})})},St);function es(t,e){return G(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&e.retryOnMount===!1)}function ft(t,e){return es(t,e)||t.state.data!==void 0&&tt(t,e,e.refetchOnMount)}function tt(t,e,s){if(G(e.enabled,t)!==!1){const i=typeof s=="function"?s(t):s;return i==="always"||i!==!1&&nt(t,e)}return!1}function yt(t,e,s,i){return(t!==e||G(i.enabled,t)===!1)&&(!s.suspense||t.state.status!=="error")&&nt(t,s)}function nt(t,e){return G(e.enabled,t)!==!1&&t.isStaleByTime(pe(e.staleTime,t))}function ts(t,e){return!Ne(t.getCurrentResult(),e)}var qt=L.createContext(void 0),ss=t=>{const e=L.useContext(qt);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},vs=({client:t,children:e})=>(L.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),jt.jsx(qt.Provider,{value:t,children:e})),Ut=L.createContext(!1),is=()=>L.useContext(Ut);Ut.Provider;function rs(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var ns=L.createContext(rs()),as=()=>L.useContext(ns);function us(t,e){return typeof t=="function"?t(...e):!!t}function pt(){}var hs=(t,e)=>{(t.suspense||t.throwOnError||t.experimental_prefetchInRender)&&(e.isReset()||(t.retryOnMount=!1))},os=t=>{L.useEffect(()=>{t.clearReset()},[t])},cs=({result:t,errorResetBoundary:e,throwOnError:s,query:i,suspense:n})=>t.isError&&!e.isReset()&&!t.isFetching&&i&&(n&&t.data===void 0||us(s,[t.error,i])),ls=t=>{const e=t.staleTime;t.suspense&&(t.staleTime=typeof e=="function"?(...s)=>Math.max(e(...s),1e3):Math.max(e??1e3,1e3),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3)))},ds=(t,e)=>t.isLoading&&t.isFetching&&!e,fs=(t,e)=>(t==null?void 0:t.suspense)&&e.isPending,mt=(t,e,s)=>e.fetchOptimistic(t).catch(()=>{s.clearReset()});function ys(t,e,s){var o,C,g,S,f;const i=ss(),n=is(),a=as(),h=i.defaultQueryOptions(t);(C=(o=i.getDefaultOptions().queries)==null?void 0:o._experimental_beforeQuery)==null||C.call(o,h),h._optimisticResults=n?"isRestoring":"optimistic",ls(h),hs(h,a),os(a);const c=!i.getQueryCache().get(h.queryHash),[d]=L.useState(()=>new e(i,h)),w=d.getOptimisticResult(h),b=!n&&t.subscribed!==!1;if(L.useSyncExternalStore(L.useCallback(y=>{const Q=b?d.subscribe(E.batchCalls(y)):pt;return d.updateResult(),Q},[d,b]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),L.useEffect(()=>{d.setOptions(h,{listeners:!1})},[h,d]),fs(h,w))throw mt(h,d,a);if(cs({result:w,errorResetBoundary:a,throwOnError:h.throwOnError,query:i.getQueryCache().get(h.queryHash),suspense:h.suspense}))throw w.error;if((S=(g=i.getDefaultOptions().queries)==null?void 0:g._experimental_afterQuery)==null||S.call(g,h,w),h.experimental_prefetchInRender&&!de&&ds(w,n)){const y=c?mt(h,d,a):(f=i.getQueryCache().get(h.queryHash))==null?void 0:f.promise;y==null||y.catch(pt).finally(()=>{d.updateResult()})}return h.notifyOnChangeProps?w:d.trackResult(w)}function ws(t,e){return ys(t,Zt)}export{gs as Q,ss as a,vs as b,ws as u}; +var at=t=>{throw TypeError(t)};var He=(t,e,s)=>e.has(t)||at("Cannot "+s);var r=(t,e,s)=>(He(t,e,"read from private field"),s?s.call(t):e.get(t)),l=(t,e,s)=>e.has(t)?at("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,s),u=(t,e,s,i)=>(He(t,e,"write to private field"),i?i.call(t,s):e.set(t,s),s),p=(t,e,s)=>(He(t,e,"access private method"),s);var ke=(t,e,s,i)=>({set _(n){u(t,e,n,s)},get _(){return r(t,e,i)}});import{r as L}from"./react-core-D_V7s-9r.js";import{j as jt}from"./radix-core-mDeFS0Pz.js";var Ue=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},de=typeof window>"u"||"Deno"in globalThis;function k(){}function kt(t,e){return typeof t=="function"?t(e):t}function Ge(t){return typeof t=="number"&&t>=0&&t!==1/0}function Ft(t,e){return Math.max(t+(e||0)-Date.now(),0)}function pe(t,e){return typeof t=="function"?t(e):t}function G(t,e){return typeof t=="function"?t(e):t}function ut(t,e){const{type:s="all",exact:i,fetchStatus:n,predicate:a,queryKey:h,stale:c}=t;if(h){if(i){if(e.queryHash!==st(h,e.options))return!1}else if(!Te(e.queryKey,h))return!1}if(s!=="all"){const d=e.isActive();if(s==="active"&&!d||s==="inactive"&&d)return!1}return!(typeof c=="boolean"&&e.isStale()!==c||n&&n!==e.state.fetchStatus||a&&!a(e))}function ht(t,e){const{exact:s,status:i,predicate:n,mutationKey:a}=t;if(a){if(!e.options.mutationKey)return!1;if(s){if(Me(e.options.mutationKey)!==Me(a))return!1}else if(!Te(e.options.mutationKey,a))return!1}return!(i&&e.state.status!==i||n&&!n(e))}function st(t,e){return((e==null?void 0:e.queryKeyHashFn)||Me)(t)}function Me(t){return JSON.stringify(t,(e,s)=>Be(s)?Object.keys(s).sort().reduce((i,n)=>(i[n]=s[n],i),{}):s)}function Te(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?!Object.keys(e).some(s=>!Te(t[s],e[s])):!1}function Qt(t,e){if(t===e)return t;const s=ot(t)&&ot(e);if(s||Be(t)&&Be(e)){const i=s?t:Object.keys(t),n=i.length,a=s?e:Object.keys(e),h=a.length,c=s?[]:{};let d=0;for(let w=0;w{setTimeout(e,t)})}function ze(t,e,s){return typeof s.structuralSharing=="function"?s.structuralSharing(t,e):s.structuralSharing!==!1?Qt(t,e):e}function Kt(t,e,s=0){const i=[...t,e];return s&&i.length>s?i.slice(1):i}function Ht(t,e,s=0){const i=[e,...t];return s&&i.length>s?i.slice(0,-1):i}var it=Symbol();function Et(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===it?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}var re,X,me,bt,_t=(bt=class extends Ue{constructor(){super();l(this,re);l(this,X);l(this,me);u(this,me,e=>{if(!de&&window.addEventListener){const s=()=>e();return window.addEventListener("visibilitychange",s,!1),()=>{window.removeEventListener("visibilitychange",s)}}})}onSubscribe(){r(this,X)||this.setEventListener(r(this,me))}onUnsubscribe(){var e;this.hasListeners()||((e=r(this,X))==null||e.call(this),u(this,X,void 0))}setEventListener(e){var s;u(this,me,e),(s=r(this,X))==null||s.call(this),u(this,X,e(i=>{typeof i=="boolean"?this.setFocused(i):this.onFocus()}))}setFocused(e){r(this,re)!==e&&(u(this,re,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(s=>{s(e)})}isFocused(){var e;return typeof r(this,re)=="boolean"?r(this,re):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},re=new WeakMap,X=new WeakMap,me=new WeakMap,bt),rt=new _t,be,Y,ge,gt,Gt=(gt=class extends Ue{constructor(){super();l(this,be,!0);l(this,Y);l(this,ge);u(this,ge,e=>{if(!de&&window.addEventListener){const s=()=>e(!0),i=()=>e(!1);return window.addEventListener("online",s,!1),window.addEventListener("offline",i,!1),()=>{window.removeEventListener("online",s),window.removeEventListener("offline",i)}}})}onSubscribe(){r(this,Y)||this.setEventListener(r(this,ge))}onUnsubscribe(){var e;this.hasListeners()||((e=r(this,Y))==null||e.call(this),u(this,Y,void 0))}setEventListener(e){var s;u(this,ge,e),(s=r(this,Y))==null||s.call(this),u(this,Y,e(this.setOnline.bind(this)))}setOnline(e){r(this,be)!==e&&(u(this,be,e),this.listeners.forEach(i=>{i(e)}))}isOnline(){return r(this,be)}},be=new WeakMap,Y=new WeakMap,ge=new WeakMap,gt),Ke=new Gt;function Ve(){let t,e;const s=new Promise((n,a)=>{t=n,e=a});s.status="pending",s.catch(()=>{});function i(n){Object.assign(s,n),delete s.resolve,delete s.reject}return s.resolve=n=>{i({status:"fulfilled",value:n}),t(n)},s.reject=n=>{i({status:"rejected",reason:n}),e(n)},s}function Nt(t){return Math.min(1e3*2**t,3e4)}function Dt(t){return(t??"online")==="online"?Ke.isOnline():!0}var Mt=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function _e(t){return t instanceof Mt}function Tt(t){let e=!1,s=0,i=!1,n;const a=Ve(),h=f=>{var y;i||(C(new Mt(f)),(y=t.abort)==null||y.call(t))},c=()=>{e=!0},d=()=>{e=!1},w=()=>rt.isFocused()&&(t.networkMode==="always"||Ke.isOnline())&&t.canRun(),b=()=>Dt(t.networkMode)&&t.canRun(),o=f=>{var y;i||(i=!0,(y=t.onSuccess)==null||y.call(t,f),n==null||n(),a.resolve(f))},C=f=>{var y;i||(i=!0,(y=t.onError)==null||y.call(t,f),n==null||n(),a.reject(f))},g=()=>new Promise(f=>{var y;n=Q=>{(i||w())&&f(Q)},(y=t.onPause)==null||y.call(t)}).then(()=>{var f;n=void 0,i||(f=t.onContinue)==null||f.call(t)}),S=()=>{if(i)return;let f;const y=s===0?t.initialPromise:void 0;try{f=y??t.fn()}catch(Q){f=Promise.reject(Q)}Promise.resolve(f).then(o).catch(Q=>{var K;if(i)return;const T=t.retry??(de?0:3),R=t.retryDelay??Nt,D=typeof R=="function"?R(s,Q):R,U=T===!0||typeof T=="number"&&sw()?void 0:g()).then(()=>{e?C(Q):S()})})};return{promise:a,cancel:h,continue:()=>(n==null||n(),a),cancelRetry:c,continueRetry:d,canStart:b,start:()=>(b()?S():g().then(S),a)}}function Bt(){let t=[],e=0,s=c=>{c()},i=c=>{c()},n=c=>setTimeout(c,0);const a=c=>{e?t.push(c):n(()=>{s(c)})},h=()=>{const c=t;t=[],c.length&&n(()=>{i(()=>{c.forEach(d=>{s(d)})})})};return{batch:c=>{let d;e++;try{d=c()}finally{e--,e||h()}return d},batchCalls:c=>(...d)=>{a(()=>{c(...d)})},schedule:a,setNotifyFunction:c=>{s=c},setBatchNotifyFunction:c=>{i=c},setScheduler:c=>{n=c}}}var E=Bt(),ne,vt,At=(vt=class{constructor(){l(this,ne)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Ge(this.gcTime)&&u(this,ne,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(de?1/0:5*60*1e3))}clearGcTimeout(){r(this,ne)&&(clearTimeout(r(this,ne)),u(this,ne,void 0))}},ne=new WeakMap,vt),ve,we,j,ae,M,Ae,ue,H,$,wt,zt=(wt=class extends At{constructor(e){super();l(this,H);l(this,ve);l(this,we);l(this,j);l(this,ae);l(this,M);l(this,Ae);l(this,ue);u(this,ue,!1),u(this,Ae,e.defaultOptions),this.setOptions(e.options),this.observers=[],u(this,ae,e.client),u(this,j,r(this,ae).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,u(this,ve,Vt(this.options)),this.state=e.state??r(this,ve),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var e;return(e=r(this,M))==null?void 0:e.promise}setOptions(e){this.options={...r(this,Ae),...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&r(this,j).remove(this)}setData(e,s){const i=ze(this.state.data,e,this.options);return p(this,H,$).call(this,{data:i,type:"success",dataUpdatedAt:s==null?void 0:s.updatedAt,manual:s==null?void 0:s.manual}),i}setState(e,s){p(this,H,$).call(this,{type:"setState",state:e,setStateOptions:s})}cancel(e){var i,n;const s=(i=r(this,M))==null?void 0:i.promise;return(n=r(this,M))==null||n.cancel(e),s?s.then(k).catch(k):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(r(this,ve))}isActive(){return this.observers.some(e=>G(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===it||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(e=0){return this.state.isInvalidated||this.state.data===void 0||!Ft(this.state.dataUpdatedAt,e)}onFocus(){var s;const e=this.observers.find(i=>i.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(s=r(this,M))==null||s.continue()}onOnline(){var s;const e=this.observers.find(i=>i.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(s=r(this,M))==null||s.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),r(this,j).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(s=>s!==e),this.observers.length||(r(this,M)&&(r(this,ue)?r(this,M).cancel({revert:!0}):r(this,M).cancelRetry()),this.scheduleGc()),r(this,j).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||p(this,H,$).call(this,{type:"invalidate"})}fetch(e,s){var d,w,b;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(s!=null&&s.cancelRefetch))this.cancel({silent:!0});else if(r(this,M))return r(this,M).continueRetry(),r(this,M).promise}if(e&&this.setOptions(e),!this.options.queryFn){const o=this.observers.find(C=>C.options.queryFn);o&&this.setOptions(o.options)}const i=new AbortController,n=o=>{Object.defineProperty(o,"signal",{enumerable:!0,get:()=>(u(this,ue,!0),i.signal)})},a=()=>{const o=Et(this.options,s),C={client:r(this,ae),queryKey:this.queryKey,meta:this.meta};return n(C),u(this,ue,!1),this.options.persister?this.options.persister(o,C,this):o(C)},h={fetchOptions:s,options:this.options,queryKey:this.queryKey,client:r(this,ae),state:this.state,fetchFn:a};n(h),(d=this.options.behavior)==null||d.onFetch(h,this),u(this,we,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((w=h.fetchOptions)==null?void 0:w.meta))&&p(this,H,$).call(this,{type:"fetch",meta:(b=h.fetchOptions)==null?void 0:b.meta});const c=o=>{var C,g,S,f;_e(o)&&o.silent||p(this,H,$).call(this,{type:"error",error:o}),_e(o)||((g=(C=r(this,j).config).onError)==null||g.call(C,o,this),(f=(S=r(this,j).config).onSettled)==null||f.call(S,this.state.data,o,this)),this.scheduleGc()};return u(this,M,Tt({initialPromise:s==null?void 0:s.initialPromise,fn:h.fetchFn,abort:i.abort.bind(i),onSuccess:o=>{var C,g,S,f;if(o===void 0){c(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(o)}catch(y){c(y);return}(g=(C=r(this,j).config).onSuccess)==null||g.call(C,o,this),(f=(S=r(this,j).config).onSettled)==null||f.call(S,o,this.state.error,this),this.scheduleGc()},onError:c,onFail:(o,C)=>{p(this,H,$).call(this,{type:"failed",failureCount:o,error:C})},onPause:()=>{p(this,H,$).call(this,{type:"pause"})},onContinue:()=>{p(this,H,$).call(this,{type:"continue"})},retry:h.options.retry,retryDelay:h.options.retryDelay,networkMode:h.options.networkMode,canRun:()=>!0})),r(this,M).start()}},ve=new WeakMap,we=new WeakMap,j=new WeakMap,ae=new WeakMap,M=new WeakMap,Ae=new WeakMap,ue=new WeakMap,H=new WeakSet,$=function(e){const s=i=>{switch(e.type){case"failed":return{...i,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...i,fetchStatus:"paused"};case"continue":return{...i,fetchStatus:"fetching"};case"fetch":return{...i,...It(i.data,this.options),fetchMeta:e.meta??null};case"success":return{...i,data:e.data,dataUpdateCount:i.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const n=e.error;return _e(n)&&n.revert&&r(this,we)?{...r(this,we),fetchStatus:"idle"}:{...i,error:n,errorUpdateCount:i.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:i.fetchFailureCount+1,fetchFailureReason:n,fetchStatus:"idle",status:"error"};case"invalidate":return{...i,isInvalidated:!0};case"setState":return{...i,...e.state}}};this.state=s(this.state),E.batch(()=>{this.observers.forEach(i=>{i.onQueryUpdate()}),r(this,j).notify({query:this,type:"updated",action:e})})},wt);function It(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Dt(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function Vt(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,s=e!==void 0,i=s?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:s?i??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:s?"success":"pending",fetchStatus:"idle"}}var N,Ct,$t=(Ct=class extends Ue{constructor(e={}){super();l(this,N);this.config=e,u(this,N,new Map)}build(e,s,i){const n=s.queryKey,a=s.queryHash??st(n,s);let h=this.get(a);return h||(h=new zt({client:e,queryKey:n,queryHash:a,options:e.defaultQueryOptions(s),state:i,defaultOptions:e.getQueryDefaults(n)}),this.add(h)),h}add(e){r(this,N).has(e.queryHash)||(r(this,N).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const s=r(this,N).get(e.queryHash);s&&(e.destroy(),s===e&&r(this,N).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){E.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return r(this,N).get(e)}getAll(){return[...r(this,N).values()]}find(e){const s={exact:!0,...e};return this.getAll().find(i=>ut(s,i))}findAll(e={}){const s=this.getAll();return Object.keys(e).length>0?s.filter(i=>ut(e,i)):s}notify(e){E.batch(()=>{this.listeners.forEach(s=>{s(e)})})}onFocus(){E.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){E.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},N=new WeakMap,Ct),B,I,he,z,J,Ot,Wt=(Ot=class extends At{constructor(e){super();l(this,z);l(this,B);l(this,I);l(this,he);this.mutationId=e.mutationId,u(this,I,e.mutationCache),u(this,B,[]),this.state=e.state||Jt(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){r(this,B).includes(e)||(r(this,B).push(e),this.clearGcTimeout(),r(this,I).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){u(this,B,r(this,B).filter(s=>s!==e)),this.scheduleGc(),r(this,I).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){r(this,B).length||(this.state.status==="pending"?this.scheduleGc():r(this,I).remove(this))}continue(){var e;return((e=r(this,he))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var n,a,h,c,d,w,b,o,C,g,S,f,y,Q,T,R,D,U,K,A;u(this,he,Tt({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(F,O)=>{p(this,z,J).call(this,{type:"failed",failureCount:F,error:O})},onPause:()=>{p(this,z,J).call(this,{type:"pause"})},onContinue:()=>{p(this,z,J).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>r(this,I).canRun(this)}));const s=this.state.status==="pending",i=!r(this,he).canStart();try{if(!s){p(this,z,J).call(this,{type:"pending",variables:e,isPaused:i}),await((a=(n=r(this,I).config).onMutate)==null?void 0:a.call(n,e,this));const O=await((c=(h=this.options).onMutate)==null?void 0:c.call(h,e));O!==this.state.context&&p(this,z,J).call(this,{type:"pending",context:O,variables:e,isPaused:i})}const F=await r(this,he).start();return await((w=(d=r(this,I).config).onSuccess)==null?void 0:w.call(d,F,e,this.state.context,this)),await((o=(b=this.options).onSuccess)==null?void 0:o.call(b,F,e,this.state.context)),await((g=(C=r(this,I).config).onSettled)==null?void 0:g.call(C,F,null,this.state.variables,this.state.context,this)),await((f=(S=this.options).onSettled)==null?void 0:f.call(S,F,null,e,this.state.context)),p(this,z,J).call(this,{type:"success",data:F}),F}catch(F){try{throw await((Q=(y=r(this,I).config).onError)==null?void 0:Q.call(y,F,e,this.state.context,this)),await((R=(T=this.options).onError)==null?void 0:R.call(T,F,e,this.state.context)),await((U=(D=r(this,I).config).onSettled)==null?void 0:U.call(D,void 0,F,this.state.variables,this.state.context,this)),await((A=(K=this.options).onSettled)==null?void 0:A.call(K,void 0,F,e,this.state.context)),F}finally{p(this,z,J).call(this,{type:"error",error:F})}}finally{r(this,I).runNext(this)}}},B=new WeakMap,I=new WeakMap,he=new WeakMap,z=new WeakSet,J=function(e){const s=i=>{switch(e.type){case"failed":return{...i,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...i,isPaused:!0};case"continue":return{...i,isPaused:!1};case"pending":return{...i,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...i,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...i,data:void 0,error:e.error,failureCount:i.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=s(this.state),E.batch(()=>{r(this,B).forEach(i=>{i.onMutationUpdate(e)}),r(this,I).notify({mutation:this,type:"updated",action:e})})},Ot);function Jt(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var W,_,Ie,Rt,Xt=(Rt=class extends Ue{constructor(e={}){super();l(this,W);l(this,_);l(this,Ie);this.config=e,u(this,W,new Set),u(this,_,new Map),u(this,Ie,0)}build(e,s,i){const n=new Wt({mutationCache:this,mutationId:++ke(this,Ie)._,options:e.defaultMutationOptions(s),state:i});return this.add(n),n}add(e){r(this,W).add(e);const s=Le(e);if(typeof s=="string"){const i=r(this,_).get(s);i?i.push(e):r(this,_).set(s,[e])}this.notify({type:"added",mutation:e})}remove(e){if(r(this,W).delete(e)){const s=Le(e);if(typeof s=="string"){const i=r(this,_).get(s);if(i)if(i.length>1){const n=i.indexOf(e);n!==-1&&i.splice(n,1)}else i[0]===e&&r(this,_).delete(s)}}this.notify({type:"removed",mutation:e})}canRun(e){const s=Le(e);if(typeof s=="string"){const i=r(this,_).get(s),n=i==null?void 0:i.find(a=>a.state.status==="pending");return!n||n===e}else return!0}runNext(e){var i;const s=Le(e);if(typeof s=="string"){const n=(i=r(this,_).get(s))==null?void 0:i.find(a=>a!==e&&a.state.isPaused);return(n==null?void 0:n.continue())??Promise.resolve()}else return Promise.resolve()}clear(){E.batch(()=>{r(this,W).forEach(e=>{this.notify({type:"removed",mutation:e})}),r(this,W).clear(),r(this,_).clear()})}getAll(){return Array.from(r(this,W))}find(e){const s={exact:!0,...e};return this.getAll().find(i=>ht(s,i))}findAll(e={}){return this.getAll().filter(s=>ht(e,s))}notify(e){E.batch(()=>{this.listeners.forEach(s=>{s(e)})})}resumePausedMutations(){const e=this.getAll().filter(s=>s.state.isPaused);return E.batch(()=>Promise.all(e.map(s=>s.continue().catch(k))))}},W=new WeakMap,_=new WeakMap,Ie=new WeakMap,Rt);function Le(t){var e;return(e=t.options.scope)==null?void 0:e.id}function lt(t){return{onFetch:(e,s)=>{var b,o,C,g,S;const i=e.options,n=(C=(o=(b=e.fetchOptions)==null?void 0:b.meta)==null?void 0:o.fetchMore)==null?void 0:C.direction,a=((g=e.state.data)==null?void 0:g.pages)||[],h=((S=e.state.data)==null?void 0:S.pageParams)||[];let c={pages:[],pageParams:[]},d=0;const w=async()=>{let f=!1;const y=R=>{Object.defineProperty(R,"signal",{enumerable:!0,get:()=>(e.signal.aborted?f=!0:e.signal.addEventListener("abort",()=>{f=!0}),e.signal)})},Q=Et(e.options,e.fetchOptions),T=async(R,D,U)=>{if(f)return Promise.reject();if(D==null&&R.pages.length)return Promise.resolve(R);const K={client:e.client,queryKey:e.queryKey,pageParam:D,direction:U?"backward":"forward",meta:e.options.meta};y(K);const A=await Q(K),{maxPages:F}=e.options,O=U?Ht:Kt;return{pages:O(R.pages,A,F),pageParams:O(R.pageParams,D,F)}};if(n&&a.length){const R=n==="backward",D=R?Yt:dt,U={pages:a,pageParams:h},K=D(i,U);c=await T(U,K,R)}else{const R=t??a.length;do{const D=d===0?h[0]??i.initialPageParam:dt(i,c);if(d>0&&D==null)break;c=await T(c,D),d++}while(d{var f,y;return(y=(f=e.options).persister)==null?void 0:y.call(f,w,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},s)}:e.fetchFn=w}}}function dt(t,{pages:e,pageParams:s}){const i=e.length-1;return e.length>0?t.getNextPageParam(e[i],e,s[i],s):void 0}function Yt(t,{pages:e,pageParams:s}){var i;return e.length>0?(i=t.getPreviousPageParam)==null?void 0:i.call(t,e[0],e,s[0],s):void 0}var P,Z,ee,Ce,Oe,te,Re,Pe,Pt,gs=(Pt=class{constructor(t={}){l(this,P);l(this,Z);l(this,ee);l(this,Ce);l(this,Oe);l(this,te);l(this,Re);l(this,Pe);u(this,P,t.queryCache||new $t),u(this,Z,t.mutationCache||new Xt),u(this,ee,t.defaultOptions||{}),u(this,Ce,new Map),u(this,Oe,new Map),u(this,te,0)}mount(){ke(this,te)._++,r(this,te)===1&&(u(this,Re,rt.subscribe(async t=>{t&&(await this.resumePausedMutations(),r(this,P).onFocus())})),u(this,Pe,Ke.subscribe(async t=>{t&&(await this.resumePausedMutations(),r(this,P).onOnline())})))}unmount(){var t,e;ke(this,te)._--,r(this,te)===0&&((t=r(this,Re))==null||t.call(this),u(this,Re,void 0),(e=r(this,Pe))==null||e.call(this),u(this,Pe,void 0))}isFetching(t){return r(this,P).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return r(this,Z).findAll({...t,status:"pending"}).length}getQueryData(t){var s;const e=this.defaultQueryOptions({queryKey:t});return(s=r(this,P).get(e.queryHash))==null?void 0:s.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),s=r(this,P).build(this,e),i=s.state.data;return i===void 0?this.fetchQuery(t):(t.revalidateIfStale&&s.isStaleByTime(pe(e.staleTime,s))&&this.prefetchQuery(e),Promise.resolve(i))}getQueriesData(t){return r(this,P).findAll(t).map(({queryKey:e,state:s})=>{const i=s.data;return[e,i]})}setQueryData(t,e,s){const i=this.defaultQueryOptions({queryKey:t}),n=r(this,P).get(i.queryHash),a=n==null?void 0:n.state.data,h=kt(e,a);if(h!==void 0)return r(this,P).build(this,i).setData(h,{...s,manual:!0})}setQueriesData(t,e,s){return E.batch(()=>r(this,P).findAll(t).map(({queryKey:i})=>[i,this.setQueryData(i,e,s)]))}getQueryState(t){var s;const e=this.defaultQueryOptions({queryKey:t});return(s=r(this,P).get(e.queryHash))==null?void 0:s.state}removeQueries(t){const e=r(this,P);E.batch(()=>{e.findAll(t).forEach(s=>{e.remove(s)})})}resetQueries(t,e){const s=r(this,P),i={type:"active",...t};return E.batch(()=>(s.findAll(t).forEach(n=>{n.reset()}),this.refetchQueries(i,e)))}cancelQueries(t,e={}){const s={revert:!0,...e},i=E.batch(()=>r(this,P).findAll(t).map(n=>n.cancel(s)));return Promise.all(i).then(k).catch(k)}invalidateQueries(t,e={}){return E.batch(()=>{if(r(this,P).findAll(t).forEach(i=>{i.invalidate()}),(t==null?void 0:t.refetchType)==="none")return Promise.resolve();const s={...t,type:(t==null?void 0:t.refetchType)??(t==null?void 0:t.type)??"active"};return this.refetchQueries(s,e)})}refetchQueries(t,e={}){const s={...e,cancelRefetch:e.cancelRefetch??!0},i=E.batch(()=>r(this,P).findAll(t).filter(n=>!n.isDisabled()).map(n=>{let a=n.fetch(void 0,s);return s.throwOnError||(a=a.catch(k)),n.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(i).then(k)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const s=r(this,P).build(this,e);return s.isStaleByTime(pe(e.staleTime,s))?s.fetch(e):Promise.resolve(s.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(k).catch(k)}fetchInfiniteQuery(t){return t.behavior=lt(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(k).catch(k)}ensureInfiniteQueryData(t){return t.behavior=lt(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return Ke.isOnline()?r(this,Z).resumePausedMutations():Promise.resolve()}getQueryCache(){return r(this,P)}getMutationCache(){return r(this,Z)}getDefaultOptions(){return r(this,ee)}setDefaultOptions(t){u(this,ee,t)}setQueryDefaults(t,e){r(this,Ce).set(Me(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...r(this,Ce).values()],s={};return e.forEach(i=>{Te(t,i.queryKey)&&Object.assign(s,i.defaultOptions)}),s}setMutationDefaults(t,e){r(this,Oe).set(Me(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...r(this,Oe).values()];let s={};return e.forEach(i=>{Te(t,i.mutationKey)&&(s={...s,...i.defaultOptions})}),s}defaultQueryOptions(t){if(t._defaulted)return t;const e={...r(this,ee).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=st(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===it&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...r(this,ee).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){r(this,P).clear(),r(this,Z).clear()}},P=new WeakMap,Z=new WeakMap,ee=new WeakMap,Ce=new WeakMap,Oe=new WeakMap,te=new WeakMap,Re=new WeakMap,Pe=new WeakMap,Pt),q,m,xe,x,oe,Se,se,V,qe,Fe,Qe,ce,le,ie,Ee,v,De,$e,We,Je,Xe,Ye,Ze,et,xt,St,Zt=(St=class extends Ue{constructor(e,s){super();l(this,v);l(this,q);l(this,m);l(this,xe);l(this,x);l(this,oe);l(this,Se);l(this,se);l(this,V);l(this,qe);l(this,Fe);l(this,Qe);l(this,ce);l(this,le);l(this,ie);l(this,Ee,new Set);this.options=s,u(this,q,e),u(this,V,null),u(this,se,Ve()),this.options.experimental_prefetchInRender||r(this,se).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(s)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(r(this,m).addObserver(this),ft(r(this,m),this.options)?p(this,v,De).call(this):this.updateResult(),p(this,v,Xe).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return tt(r(this,m),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return tt(r(this,m),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,p(this,v,Ye).call(this),p(this,v,Ze).call(this),r(this,m).removeObserver(this)}setOptions(e,s){const i=this.options,n=r(this,m);if(this.options=r(this,q).defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof G(this.options.enabled,r(this,m))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");p(this,v,et).call(this),r(this,m).setOptions(this.options),i._defaulted&&!Ne(this.options,i)&&r(this,q).getQueryCache().notify({type:"observerOptionsUpdated",query:r(this,m),observer:this});const a=this.hasListeners();a&&yt(r(this,m),n,this.options,i)&&p(this,v,De).call(this),this.updateResult(s),a&&(r(this,m)!==n||G(this.options.enabled,r(this,m))!==G(i.enabled,r(this,m))||pe(this.options.staleTime,r(this,m))!==pe(i.staleTime,r(this,m)))&&p(this,v,$e).call(this);const h=p(this,v,We).call(this);a&&(r(this,m)!==n||G(this.options.enabled,r(this,m))!==G(i.enabled,r(this,m))||h!==r(this,ie))&&p(this,v,Je).call(this,h)}getOptimisticResult(e){const s=r(this,q).getQueryCache().build(r(this,q),e),i=this.createResult(s,e);return ts(this,i)&&(u(this,x,i),u(this,Se,this.options),u(this,oe,r(this,m).state)),i}getCurrentResult(){return r(this,x)}trackResult(e,s){const i={};return Object.keys(e).forEach(n=>{Object.defineProperty(i,n,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(n),s==null||s(n),e[n])})}),i}trackProp(e){r(this,Ee).add(e)}getCurrentQuery(){return r(this,m)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const s=r(this,q).defaultQueryOptions(e),i=r(this,q).getQueryCache().build(r(this,q),s);return i.fetch().then(()=>this.createResult(i,s))}fetch(e){return p(this,v,De).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),r(this,x)))}createResult(e,s){var F;const i=r(this,m),n=this.options,a=r(this,x),h=r(this,oe),c=r(this,Se),w=e!==i?e.state:r(this,xe),{state:b}=e;let o={...b},C=!1,g;if(s._optimisticResults){const O=this.hasListeners(),fe=!O&&ft(e,s),ye=O&&yt(e,i,s,n);(fe||ye)&&(o={...o,...It(b.data,e.options)}),s._optimisticResults==="isRestoring"&&(o.fetchStatus="idle")}let{error:S,errorUpdatedAt:f,status:y}=o;if(s.select&&o.data!==void 0)if(a&&o.data===(h==null?void 0:h.data)&&s.select===r(this,qe))g=r(this,Fe);else try{u(this,qe,s.select),g=s.select(o.data),g=ze(a==null?void 0:a.data,g,s),u(this,Fe,g),u(this,V,null)}catch(O){u(this,V,O)}else g=o.data;if(s.placeholderData!==void 0&&g===void 0&&y==="pending"){let O;if(a!=null&&a.isPlaceholderData&&s.placeholderData===(c==null?void 0:c.placeholderData))O=a.data;else if(O=typeof s.placeholderData=="function"?s.placeholderData((F=r(this,Qe))==null?void 0:F.state.data,r(this,Qe)):s.placeholderData,s.select&&O!==void 0)try{O=s.select(O),u(this,V,null)}catch(fe){u(this,V,fe)}O!==void 0&&(y="success",g=ze(a==null?void 0:a.data,O,s),C=!0)}r(this,V)&&(S=r(this,V),g=r(this,Fe),f=Date.now(),y="error");const Q=o.fetchStatus==="fetching",T=y==="pending",R=y==="error",D=T&&Q,U=g!==void 0,A={status:y,fetchStatus:o.fetchStatus,isPending:T,isSuccess:y==="success",isError:R,isInitialLoading:D,isLoading:D,data:g,dataUpdatedAt:o.dataUpdatedAt,error:S,errorUpdatedAt:f,failureCount:o.fetchFailureCount,failureReason:o.fetchFailureReason,errorUpdateCount:o.errorUpdateCount,isFetched:o.dataUpdateCount>0||o.errorUpdateCount>0,isFetchedAfterMount:o.dataUpdateCount>w.dataUpdateCount||o.errorUpdateCount>w.errorUpdateCount,isFetching:Q,isRefetching:Q&&!T,isLoadingError:R&&!U,isPaused:o.fetchStatus==="paused",isPlaceholderData:C,isRefetchError:R&&U,isStale:nt(e,s),refetch:this.refetch,promise:r(this,se)};if(this.options.experimental_prefetchInRender){const O=je=>{A.status==="error"?je.reject(A.error):A.data!==void 0&&je.resolve(A.data)},fe=()=>{const je=u(this,se,A.promise=Ve());O(je)},ye=r(this,se);switch(ye.status){case"pending":e.queryHash===i.queryHash&&O(ye);break;case"fulfilled":(A.status==="error"||A.data!==ye.value)&&fe();break;case"rejected":(A.status!=="error"||A.error!==ye.reason)&&fe();break}}return A}updateResult(e){const s=r(this,x),i=this.createResult(r(this,m),this.options);if(u(this,oe,r(this,m).state),u(this,Se,this.options),r(this,oe).data!==void 0&&u(this,Qe,r(this,m)),Ne(i,s))return;u(this,x,i);const n={},a=()=>{if(!s)return!0;const{notifyOnChangeProps:h}=this.options,c=typeof h=="function"?h():h;if(c==="all"||!c&&!r(this,Ee).size)return!0;const d=new Set(c??r(this,Ee));return this.options.throwOnError&&d.add("error"),Object.keys(r(this,x)).some(w=>{const b=w;return r(this,x)[b]!==s[b]&&d.has(b)})};(e==null?void 0:e.listeners)!==!1&&a()&&(n.listeners=!0),p(this,v,xt).call(this,{...n,...e})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&p(this,v,Xe).call(this)}},q=new WeakMap,m=new WeakMap,xe=new WeakMap,x=new WeakMap,oe=new WeakMap,Se=new WeakMap,se=new WeakMap,V=new WeakMap,qe=new WeakMap,Fe=new WeakMap,Qe=new WeakMap,ce=new WeakMap,le=new WeakMap,ie=new WeakMap,Ee=new WeakMap,v=new WeakSet,De=function(e){p(this,v,et).call(this);let s=r(this,m).fetch(this.options,e);return e!=null&&e.throwOnError||(s=s.catch(k)),s},$e=function(){p(this,v,Ye).call(this);const e=pe(this.options.staleTime,r(this,m));if(de||r(this,x).isStale||!Ge(e))return;const i=Ft(r(this,x).dataUpdatedAt,e)+1;u(this,ce,setTimeout(()=>{r(this,x).isStale||this.updateResult()},i))},We=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(r(this,m)):this.options.refetchInterval)??!1},Je=function(e){p(this,v,Ze).call(this),u(this,ie,e),!(de||G(this.options.enabled,r(this,m))===!1||!Ge(r(this,ie))||r(this,ie)===0)&&u(this,le,setInterval(()=>{(this.options.refetchIntervalInBackground||rt.isFocused())&&p(this,v,De).call(this)},r(this,ie)))},Xe=function(){p(this,v,$e).call(this),p(this,v,Je).call(this,p(this,v,We).call(this))},Ye=function(){r(this,ce)&&(clearTimeout(r(this,ce)),u(this,ce,void 0))},Ze=function(){r(this,le)&&(clearInterval(r(this,le)),u(this,le,void 0))},et=function(){const e=r(this,q).getQueryCache().build(r(this,q),this.options);if(e===r(this,m))return;const s=r(this,m);u(this,m,e),u(this,xe,e.state),this.hasListeners()&&(s==null||s.removeObserver(this),e.addObserver(this))},xt=function(e){E.batch(()=>{e.listeners&&this.listeners.forEach(s=>{s(r(this,x))}),r(this,q).getQueryCache().notify({query:r(this,m),type:"observerResultsUpdated"})})},St);function es(t,e){return G(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&e.retryOnMount===!1)}function ft(t,e){return es(t,e)||t.state.data!==void 0&&tt(t,e,e.refetchOnMount)}function tt(t,e,s){if(G(e.enabled,t)!==!1){const i=typeof s=="function"?s(t):s;return i==="always"||i!==!1&&nt(t,e)}return!1}function yt(t,e,s,i){return(t!==e||G(i.enabled,t)===!1)&&(!s.suspense||t.state.status!=="error")&&nt(t,s)}function nt(t,e){return G(e.enabled,t)!==!1&&t.isStaleByTime(pe(e.staleTime,t))}function ts(t,e){return!Ne(t.getCurrentResult(),e)}var qt=L.createContext(void 0),ss=t=>{const e=L.useContext(qt);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},vs=({client:t,children:e})=>(L.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),jt.jsx(qt.Provider,{value:t,children:e})),Ut=L.createContext(!1),is=()=>L.useContext(Ut);Ut.Provider;function rs(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var ns=L.createContext(rs()),as=()=>L.useContext(ns);function us(t,e){return typeof t=="function"?t(...e):!!t}function pt(){}var hs=(t,e)=>{(t.suspense||t.throwOnError||t.experimental_prefetchInRender)&&(e.isReset()||(t.retryOnMount=!1))},os=t=>{L.useEffect(()=>{t.clearReset()},[t])},cs=({result:t,errorResetBoundary:e,throwOnError:s,query:i,suspense:n})=>t.isError&&!e.isReset()&&!t.isFetching&&i&&(n&&t.data===void 0||us(s,[t.error,i])),ls=t=>{const e=t.staleTime;t.suspense&&(t.staleTime=typeof e=="function"?(...s)=>Math.max(e(...s),1e3):Math.max(e??1e3,1e3),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3)))},ds=(t,e)=>t.isLoading&&t.isFetching&&!e,fs=(t,e)=>(t==null?void 0:t.suspense)&&e.isPending,mt=(t,e,s)=>e.fetchOptimistic(t).catch(()=>{s.clearReset()});function ys(t,e,s){var o,C,g,S,f;const i=ss(),n=is(),a=as(),h=i.defaultQueryOptions(t);(C=(o=i.getDefaultOptions().queries)==null?void 0:o._experimental_beforeQuery)==null||C.call(o,h),h._optimisticResults=n?"isRestoring":"optimistic",ls(h),hs(h,a),os(a);const c=!i.getQueryCache().get(h.queryHash),[d]=L.useState(()=>new e(i,h)),w=d.getOptimisticResult(h),b=!n&&t.subscribed!==!1;if(L.useSyncExternalStore(L.useCallback(y=>{const Q=b?d.subscribe(E.batchCalls(y)):pt;return d.updateResult(),Q},[d,b]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),L.useEffect(()=>{d.setOptions(h,{listeners:!1})},[h,d]),fs(h,w))throw mt(h,d,a);if(cs({result:w,errorResetBoundary:a,throwOnError:h.throwOnError,query:i.getQueryCache().get(h.queryHash),suspense:h.suspense}))throw w.error;if((S=(g=i.getDefaultOptions().queries)==null?void 0:g._experimental_afterQuery)==null||S.call(g,h,w),h.experimental_prefetchInRender&&!de&&ds(w,n)){const y=c?mt(h,d,a):(f=i.getQueryCache().get(h.queryHash))==null?void 0:f.promise;y==null||y.catch(pt).finally(()=>{d.updateResult()})}return h.notifyOnChangeProps?w:d.trackResult(w)}function ws(t,e){return ys(t,Zt)}export{gs as Q,ss as a,vs as b,ws as u}; diff --git a/pkg/ui/frontend/dist/assets/radix-core-ByqQ8fsu.js b/pkg/ui/frontend/dist/assets/radix-core-ByqQ8fsu.js deleted file mode 100644 index 6ce59bacc2ea3..0000000000000 --- a/pkg/ui/frontend/dist/assets/radix-core-ByqQ8fsu.js +++ /dev/null @@ -1,49 +0,0 @@ -import{r as c,c as nn,R as Er,d as Cr}from"./react-core-D_V7s-9r.js";var rn={exports:{}},je={};/** - * @license React - * react-jsx-runtime.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var Pr=c,Ar=Symbol.for("react.element"),Rr=Symbol.for("react.fragment"),Sr=Object.prototype.hasOwnProperty,Or=Pr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Tr={key:!0,ref:!0,__self:!0,__source:!0};function on(e,t,n){var r,o={},i=null,s=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(s=t.ref);for(r in t)Sr.call(t,r)&&!Tr.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)o[r]===void 0&&(o[r]=t[r]);return{$$typeof:Ar,type:e,key:i,ref:s,props:o,_owner:Or.current}}je.Fragment=Rr;je.jsx=on;je.jsxs=on;rn.exports=je;var C=rn.exports;function kt(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function sn(...e){return t=>{let n=!1;const r=e.map(o=>{const i=kt(o,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let o=0;o{const{children:n,...r}=e,o=c.Children.toArray(n),i=o.find(Nr);if(i){const s=i.props.children,a=o.map(l=>l===i?c.Children.count(s)>1?c.Children.only(null):c.isValidElement(s)?s.props.children:null:l);return C.jsx(rt,{...r,ref:t,children:c.isValidElement(s)?c.cloneElement(s,void 0,a):null})}return C.jsx(rt,{...r,ref:t,children:n})});ft.displayName="Slot";var rt=c.forwardRef((e,t)=>{const{children:n,...r}=e;if(c.isValidElement(n)){const o=Lr(n);return c.cloneElement(n,{...Mr(r,n.props),ref:t?sn(t,o):o})}return c.Children.count(n)>1?c.Children.only(null):null});rt.displayName="SlotClone";var an=({children:e})=>C.jsx(C.Fragment,{children:e});function Nr(e){return c.isValidElement(e)&&e.type===an}function Mr(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{i(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function Lr(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function As(e,t){const n=c.createContext(t),r=i=>{const{children:s,...a}=i,l=c.useMemo(()=>a,Object.values(a));return C.jsx(n.Provider,{value:l,children:s})};r.displayName=e+"Provider";function o(i){const s=c.useContext(n);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,o]}function dt(e,t=[]){let n=[];function r(i,s){const a=c.createContext(s),l=n.length;n=[...n,s];const u=d=>{var y;const{scope:m,children:h,...g}=d,p=((y=m==null?void 0:m[e])==null?void 0:y[l])||a,v=c.useMemo(()=>g,Object.values(g));return C.jsx(p.Provider,{value:v,children:h})};u.displayName=i+"Provider";function f(d,m){var p;const h=((p=m==null?void 0:m[e])==null?void 0:p[l])||a,g=c.useContext(h);if(g)return g;if(s!==void 0)return s;throw new Error(`\`${d}\` must be used within \`${i}\``)}return[u,f]}const o=()=>{const i=n.map(s=>c.createContext(s));return function(a){const l=(a==null?void 0:a[e])||i;return c.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,Dr(o,...t)]}function Dr(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=r.reduce((a,{useScope:l,scopeName:u})=>{const d=l(i)[`__scope${u}`];return{...a,...d}},{});return c.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function I(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function J(e){const t=c.useRef(e);return c.useEffect(()=>{t.current=e}),c.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function cn({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=_r({defaultProp:t,onChange:n}),i=e!==void 0,s=i?e:r,a=J(n),l=c.useCallback(u=>{if(i){const d=typeof u=="function"?u(e):u;d!==e&&a(d)}else o(u)},[i,e,o,a]);return[s,l]}function _r({defaultProp:e,onChange:t}){const n=c.useState(e),[r]=n,o=c.useRef(r),i=J(t);return c.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}var oe=globalThis!=null&&globalThis.document?c.useLayoutEffect:()=>{};function kr(e){const[t,n]=c.useState(void 0);return oe(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let s,a;if("borderBoxSize"in i){const l=i.borderBoxSize,u=Array.isArray(l)?l[0]:l;s=u.inlineSize,a=u.blockSize}else s=e.offsetWidth,a=e.offsetHeight;n({width:s,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}function Fr(e,t){return c.useReducer((n,r)=>t[n][r]??n,e)}var we=e=>{const{present:t,children:n}=e,r=Ir(t),o=typeof n=="function"?n({present:r.isPresent}):c.Children.only(n),i=K(r.ref,jr(o));return typeof n=="function"||r.isPresent?c.cloneElement(o,{ref:i}):null};we.displayName="Presence";function Ir(e){const[t,n]=c.useState(),r=c.useRef({}),o=c.useRef(e),i=c.useRef("none"),s=e?"mounted":"unmounted",[a,l]=Fr(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return c.useEffect(()=>{const u=Ae(r.current);i.current=a==="mounted"?u:"none"},[a]),oe(()=>{const u=r.current,f=o.current;if(f!==e){const m=i.current,h=Ae(u);e?l("MOUNT"):h==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(f&&m!==h?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),oe(()=>{if(t){let u;const f=t.ownerDocument.defaultView??window,d=h=>{const p=Ae(r.current).includes(h.animationName);if(h.target===t&&p&&(l("ANIMATION_END"),!o.current)){const v=t.style.animationFillMode;t.style.animationFillMode="forwards",u=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=v)})}},m=h=>{h.target===t&&(i.current=Ae(r.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{f.clearTimeout(u),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:c.useCallback(u=>{u&&(r.current=getComputedStyle(u)),n(u)},[])}}function Ae(e){return(e==null?void 0:e.animationName)||"none"}function jr(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Wr=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],B=Wr.reduce((e,t)=>{const n=c.forwardRef((r,o)=>{const{asChild:i,...s}=r,a=i?ft:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),C.jsx(a,{...s,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function $r(e,t){e&&nn.flushSync(()=>e.dispatchEvent(t))}function Br(e,t=globalThis==null?void 0:globalThis.document){const n=J(e);c.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var Hr="DismissableLayer",ot="dismissableLayer.update",Vr="dismissableLayer.pointerDownOutside",Ur="dismissableLayer.focusOutside",Ft,ln=c.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),We=c.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,onDismiss:a,...l}=e,u=c.useContext(ln),[f,d]=c.useState(null),m=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,h]=c.useState({}),g=K(t,P=>d(P)),p=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=p.indexOf(v),w=f?p.indexOf(f):-1,b=u.layersWithOutsidePointerEventsDisabled.size>0,x=w>=y,E=Yr(P=>{const S=P.target,N=[...u.branches].some(O=>O.contains(S));!x||N||(o==null||o(P),s==null||s(P),P.defaultPrevented||a==null||a())},m),A=Xr(P=>{const S=P.target;[...u.branches].some(O=>O.contains(S))||(i==null||i(P),s==null||s(P),P.defaultPrevented||a==null||a())},m);return Br(P=>{w===u.layers.size-1&&(r==null||r(P),!P.defaultPrevented&&a&&(P.preventDefault(),a()))},m),c.useEffect(()=>{if(f)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Ft=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),It(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=Ft)}},[f,m,n,u]),c.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),It())},[f,u]),c.useEffect(()=>{const P=()=>h({});return document.addEventListener(ot,P),()=>document.removeEventListener(ot,P)},[]),C.jsx(B.div,{...l,ref:g,style:{pointerEvents:b?x?"auto":"none":void 0,...e.style},onFocusCapture:I(e.onFocusCapture,A.onFocusCapture),onBlurCapture:I(e.onBlurCapture,A.onBlurCapture),onPointerDownCapture:I(e.onPointerDownCapture,E.onPointerDownCapture)})});We.displayName=Hr;var zr="DismissableLayerBranch",un=c.forwardRef((e,t)=>{const n=c.useContext(ln),r=c.useRef(null),o=K(t,r);return c.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),C.jsx(B.div,{...e,ref:o})});un.displayName=zr;function Yr(e,t=globalThis==null?void 0:globalThis.document){const n=J(e),r=c.useRef(!1),o=c.useRef(()=>{});return c.useEffect(()=>{const i=a=>{if(a.target&&!r.current){let l=function(){fn(Vr,n,u,{discrete:!0})};const u={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=l,t.addEventListener("click",o.current,{once:!0})):l()}else t.removeEventListener("click",o.current);r.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Xr(e,t=globalThis==null?void 0:globalThis.document){const n=J(e),r=c.useRef(!1);return c.useEffect(()=>{const o=i=>{i.target&&!r.current&&fn(Ur,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function It(){const e=new CustomEvent(ot);document.dispatchEvent(e)}function fn(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?$r(o,i):o.dispatchEvent(i)}var Rs=We,Ss=un,Ke=0;function Kr(){c.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??jt()),document.body.insertAdjacentElement("beforeend",e[1]??jt()),Ke++,()=>{Ke===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Ke--}},[])}function jt(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Ge="focusScope.autoFocusOnMount",qe="focusScope.autoFocusOnUnmount",Wt={bubbles:!1,cancelable:!0},Gr="FocusScope",dn=c.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=e,[a,l]=c.useState(null),u=J(o),f=J(i),d=c.useRef(null),m=K(t,p=>l(p)),h=c.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;c.useEffect(()=>{if(r){let p=function(b){if(h.paused||!a)return;const x=b.target;a.contains(x)?d.current=x:Q(d.current,{select:!0})},v=function(b){if(h.paused||!a)return;const x=b.relatedTarget;x!==null&&(a.contains(x)||Q(d.current,{select:!0}))},y=function(b){if(document.activeElement===document.body)for(const E of b)E.removedNodes.length>0&&Q(a)};document.addEventListener("focusin",p),document.addEventListener("focusout",v);const w=new MutationObserver(y);return a&&w.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",p),document.removeEventListener("focusout",v),w.disconnect()}}},[r,a,h.paused]),c.useEffect(()=>{if(a){Bt.add(h);const p=document.activeElement;if(!a.contains(p)){const y=new CustomEvent(Ge,Wt);a.addEventListener(Ge,u),a.dispatchEvent(y),y.defaultPrevented||(qr(to(pn(a)),{select:!0}),document.activeElement===p&&Q(a))}return()=>{a.removeEventListener(Ge,u),setTimeout(()=>{const y=new CustomEvent(qe,Wt);a.addEventListener(qe,f),a.dispatchEvent(y),y.defaultPrevented||Q(p??document.body,{select:!0}),a.removeEventListener(qe,f),Bt.remove(h)},0)}}},[a,u,f,h]);const g=c.useCallback(p=>{if(!n&&!r||h.paused)return;const v=p.key==="Tab"&&!p.altKey&&!p.ctrlKey&&!p.metaKey,y=document.activeElement;if(v&&y){const w=p.currentTarget,[b,x]=Zr(w);b&&x?!p.shiftKey&&y===x?(p.preventDefault(),n&&Q(b,{select:!0})):p.shiftKey&&y===b&&(p.preventDefault(),n&&Q(x,{select:!0})):y===w&&p.preventDefault()}},[n,r,h.paused]);return C.jsx(B.div,{tabIndex:-1,...s,ref:m,onKeyDown:g})});dn.displayName=Gr;function qr(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Q(r,{select:t}),document.activeElement!==n)return}function Zr(e){const t=pn(e),n=$t(t,e),r=$t(t.reverse(),e);return[n,r]}function pn(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function $t(e,t){for(const n of e)if(!Qr(n,{upTo:t}))return n}function Qr(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Jr(e){return e instanceof HTMLInputElement&&"select"in e}function Q(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Jr(e)&&t&&e.select()}}var Bt=eo();function eo(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Ht(e,t),e.unshift(t)},remove(t){var n;e=Ht(e,t),(n=e[0])==null||n.resume()}}}function Ht(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function to(e){return e.filter(t=>t.tagName!=="A")}var no=Er.useId||(()=>{}),ro=0;function hn(e){const[t,n]=c.useState(no());return oe(()=>{n(r=>r??String(ro++))},[e]),t?`radix-${t}`:""}const oo=["top","right","bottom","left"],ee=Math.min,j=Math.max,_e=Math.round,Re=Math.floor,Y=e=>({x:e,y:e}),io={left:"right",right:"left",bottom:"top",top:"bottom"},so={start:"end",end:"start"};function it(e,t,n){return j(e,ee(t,n))}function q(e,t){return typeof e=="function"?e(t):e}function Z(e){return e.split("-")[0]}function he(e){return e.split("-")[1]}function pt(e){return e==="x"?"y":"x"}function ht(e){return e==="y"?"height":"width"}function te(e){return["top","bottom"].includes(Z(e))?"y":"x"}function mt(e){return pt(te(e))}function ao(e,t,n){n===void 0&&(n=!1);const r=he(e),o=mt(e),i=ht(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=ke(s)),[s,ke(s)]}function co(e){const t=ke(e);return[st(e),t,st(t)]}function st(e){return e.replace(/start|end/g,t=>so[t])}function lo(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:s;default:return[]}}function uo(e,t,n,r){const o=he(e);let i=lo(Z(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(st)))),i}function ke(e){return e.replace(/left|right|bottom|top/g,t=>io[t])}function fo(e){return{top:0,right:0,bottom:0,left:0,...e}}function mn(e){return typeof e!="number"?fo(e):{top:e,right:e,bottom:e,left:e}}function Fe(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function Vt(e,t,n){let{reference:r,floating:o}=e;const i=te(t),s=mt(t),a=ht(s),l=Z(t),u=i==="y",f=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,m=r[a]/2-o[a]/2;let h;switch(l){case"top":h={x:f,y:r.y-o.height};break;case"bottom":h={x:f,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:d};break;case"left":h={x:r.x-o.width,y:d};break;default:h={x:r.x,y:r.y}}switch(he(t)){case"start":h[s]-=m*(n&&u?-1:1);break;case"end":h[s]+=m*(n&&u?-1:1);break}return h}const po=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(t));let u=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:f,y:d}=Vt(u,r,l),m=r,h={},g=0;for(let p=0;p({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:u,padding:f=0}=q(e,t)||{};if(u==null)return{};const d=mn(f),m={x:n,y:r},h=mt(o),g=ht(h),p=await s.getDimensions(u),v=h==="y",y=v?"top":"left",w=v?"bottom":"right",b=v?"clientHeight":"clientWidth",x=i.reference[g]+i.reference[h]-m[h]-i.floating[g],E=m[h]-i.reference[h],A=await(s.getOffsetParent==null?void 0:s.getOffsetParent(u));let P=A?A[b]:0;(!P||!await(s.isElement==null?void 0:s.isElement(A)))&&(P=a.floating[b]||i.floating[g]);const S=x/2-E/2,N=P/2-p[g]/2-1,O=ee(d[y],N),k=ee(d[w],N),F=O,M=P-p[g]-k,T=P/2-p[g]/2+S,$=it(F,T,M),L=!l.arrow&&he(o)!=null&&T!==$&&i.reference[g]/2-(TT<=0)){var k,F;const T=(((k=i.flip)==null?void 0:k.index)||0)+1,$=P[T];if($)return{data:{index:T,overflows:O},reset:{placement:$}};let L=(F=O.filter(D=>D.overflows[0]<=0).sort((D,R)=>D.overflows[1]-R.overflows[1])[0])==null?void 0:F.placement;if(!L)switch(h){case"bestFit":{var M;const D=(M=O.filter(R=>{if(A){const _=te(R.placement);return _===w||_==="y"}return!0}).map(R=>[R.placement,R.overflows.filter(_=>_>0).reduce((_,U)=>_+U,0)]).sort((R,_)=>R[1]-_[1])[0])==null?void 0:M[0];D&&(L=D);break}case"initialPlacement":L=a;break}if(o!==L)return{reset:{placement:L}}}return{}}}};function Ut(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function zt(e){return oo.some(t=>e[t]>=0)}const vo=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=q(e,t);switch(r){case"referenceHidden":{const i=await ge(t,{...o,elementContext:"reference"}),s=Ut(i,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:zt(s)}}}case"escaped":{const i=await ge(t,{...o,altBoundary:!0}),s=Ut(i,n.floating);return{data:{escapedOffsets:s,escaped:zt(s)}}}default:return{}}}}};async function go(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=Z(n),a=he(n),l=te(n)==="y",u=["left","top"].includes(s)?-1:1,f=i&&l?-1:1,d=q(t,e);let{mainAxis:m,crossAxis:h,alignmentAxis:g}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof g=="number"&&(h=a==="end"?g*-1:g),l?{x:h*f,y:m*u}:{x:m*u,y:h*f}}const yo=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:a}=t,l=await go(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:s}}}}},wo=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:a={fn:v=>{let{x:y,y:w}=v;return{x:y,y:w}}},...l}=q(e,t),u={x:n,y:r},f=await ge(t,l),d=te(Z(o)),m=pt(d);let h=u[m],g=u[d];if(i){const v=m==="y"?"top":"left",y=m==="y"?"bottom":"right",w=h+f[v],b=h-f[y];h=it(w,h,b)}if(s){const v=d==="y"?"top":"left",y=d==="y"?"bottom":"right",w=g+f[v],b=g-f[y];g=it(w,g,b)}const p=a.fn({...t,[m]:h,[d]:g});return{...p,data:{x:p.x-n,y:p.y-r,enabled:{[m]:i,[d]:s}}}}}},xo=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:s}=t,{offset:a=0,mainAxis:l=!0,crossAxis:u=!0}=q(e,t),f={x:n,y:r},d=te(o),m=pt(d);let h=f[m],g=f[d];const p=q(a,t),v=typeof p=="number"?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(l){const b=m==="y"?"height":"width",x=i.reference[m]-i.floating[b]+v.mainAxis,E=i.reference[m]+i.reference[b]-v.mainAxis;hE&&(h=E)}if(u){var y,w;const b=m==="y"?"width":"height",x=["top","left"].includes(Z(o)),E=i.reference[d]-i.floating[b]+(x&&((y=s.offset)==null?void 0:y[d])||0)+(x?0:v.crossAxis),A=i.reference[d]+i.reference[b]+(x?0:((w=s.offset)==null?void 0:w[d])||0)-(x?v.crossAxis:0);gA&&(g=A)}return{[m]:h,[d]:g}}}},bo=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:s,elements:a}=t,{apply:l=()=>{},...u}=q(e,t),f=await ge(t,u),d=Z(o),m=he(o),h=te(o)==="y",{width:g,height:p}=i.floating;let v,y;d==="top"||d==="bottom"?(v=d,y=m===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(y=d,v=m==="end"?"top":"bottom");const w=p-f.top-f.bottom,b=g-f.left-f.right,x=ee(p-f[v],w),E=ee(g-f[y],b),A=!t.middlewareData.shift;let P=x,S=E;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(S=b),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(P=w),A&&!m){const O=j(f.left,0),k=j(f.right,0),F=j(f.top,0),M=j(f.bottom,0);h?S=g-2*(O!==0||k!==0?O+k:j(f.left,f.right)):P=p-2*(F!==0||M!==0?F+M:j(f.top,f.bottom))}await l({...t,availableWidth:S,availableHeight:P});const N=await s.getDimensions(a.floating);return g!==N.width||p!==N.height?{reset:{rects:!0}}:{}}}};function $e(){return typeof window<"u"}function me(e){return vn(e)?(e.nodeName||"").toLowerCase():"#document"}function W(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function G(e){var t;return(t=(vn(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function vn(e){return $e()?e instanceof Node||e instanceof W(e).Node:!1}function H(e){return $e()?e instanceof Element||e instanceof W(e).Element:!1}function X(e){return $e()?e instanceof HTMLElement||e instanceof W(e).HTMLElement:!1}function Yt(e){return!$e()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof W(e).ShadowRoot}function xe(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=V(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function Eo(e){return["table","td","th"].includes(me(e))}function Be(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function vt(e){const t=gt(),n=H(e)?V(e):e;return["transform","translate","scale","rotate","perspective"].some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function Co(e){let t=ne(e);for(;X(t)&&!fe(t);){if(vt(t))return t;if(Be(t))return null;t=ne(t)}return null}function gt(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function fe(e){return["html","body","#document"].includes(me(e))}function V(e){return W(e).getComputedStyle(e)}function He(e){return H(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ne(e){if(me(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Yt(e)&&e.host||G(e);return Yt(t)?t.host:t}function gn(e){const t=ne(e);return fe(t)?e.ownerDocument?e.ownerDocument.body:e.body:X(t)&&xe(t)?t:gn(t)}function ye(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=gn(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=W(o);if(i){const a=at(s);return t.concat(s,s.visualViewport||[],xe(o)?o:[],a&&n?ye(a):[])}return t.concat(o,ye(o,[],n))}function at(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function yn(e){const t=V(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=X(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=_e(n)!==i||_e(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function yt(e){return H(e)?e:e.contextElement}function le(e){const t=yt(e);if(!X(t))return Y(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=yn(t);let s=(i?_e(n.width):n.width)/r,a=(i?_e(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const Po=Y(0);function wn(e){const t=W(e);return!gt()||!t.visualViewport?Po:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Ao(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==W(e)?!1:t}function ie(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=yt(e);let s=Y(1);t&&(r?H(r)&&(s=le(r)):s=le(e));const a=Ao(i,n,r)?wn(i):Y(0);let l=(o.left+a.x)/s.x,u=(o.top+a.y)/s.y,f=o.width/s.x,d=o.height/s.y;if(i){const m=W(i),h=r&&H(r)?W(r):r;let g=m,p=at(g);for(;p&&r&&h!==g;){const v=le(p),y=p.getBoundingClientRect(),w=V(p),b=y.left+(p.clientLeft+parseFloat(w.paddingLeft))*v.x,x=y.top+(p.clientTop+parseFloat(w.paddingTop))*v.y;l*=v.x,u*=v.y,f*=v.x,d*=v.y,l+=b,u+=x,g=W(p),p=at(g)}}return Fe({width:f,height:d,x:l,y:u})}function wt(e,t){const n=He(e).scrollLeft;return t?t.left+n:ie(G(e)).left+n}function xn(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-(n?0:wt(e,r)),i=r.top+t.scrollTop;return{x:o,y:i}}function Ro(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",s=G(r),a=t?Be(t.floating):!1;if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},u=Y(1);const f=Y(0),d=X(r);if((d||!d&&!i)&&((me(r)!=="body"||xe(s))&&(l=He(r)),X(r))){const h=ie(r);u=le(r),f.x=h.x+r.clientLeft,f.y=h.y+r.clientTop}const m=s&&!d&&!i?xn(s,l,!0):Y(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+f.x+m.x,y:n.y*u.y-l.scrollTop*u.y+f.y+m.y}}function So(e){return Array.from(e.getClientRects())}function Oo(e){const t=G(e),n=He(e),r=e.ownerDocument.body,o=j(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=j(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+wt(e);const a=-n.scrollTop;return V(r).direction==="rtl"&&(s+=j(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}function To(e,t){const n=W(e),r=G(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const u=gt();(!u||u&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a,y:l}}function No(e,t){const n=ie(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=X(e)?le(e):Y(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,l=o*i.x,u=r*i.y;return{width:s,height:a,x:l,y:u}}function Xt(e,t,n){let r;if(t==="viewport")r=To(e,n);else if(t==="document")r=Oo(G(e));else if(H(t))r=No(t,n);else{const o=wn(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Fe(r)}function bn(e,t){const n=ne(e);return n===t||!H(n)||fe(n)?!1:V(n).position==="fixed"||bn(n,t)}function Mo(e,t){const n=t.get(e);if(n)return n;let r=ye(e,[],!1).filter(a=>H(a)&&me(a)!=="body"),o=null;const i=V(e).position==="fixed";let s=i?ne(e):e;for(;H(s)&&!fe(s);){const a=V(s),l=vt(s);!l&&a.position==="fixed"&&(o=null),(i?!l&&!o:!l&&a.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||xe(s)&&!l&&bn(e,s))?r=r.filter(f=>f!==s):o=a,s=ne(s)}return t.set(e,r),r}function Lo(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?Be(t)?[]:Mo(t,this._c):[].concat(n),r],a=s[0],l=s.reduce((u,f)=>{const d=Xt(t,f,o);return u.top=j(d.top,u.top),u.right=ee(d.right,u.right),u.bottom=ee(d.bottom,u.bottom),u.left=j(d.left,u.left),u},Xt(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Do(e){const{width:t,height:n}=yn(e);return{width:t,height:n}}function _o(e,t,n){const r=X(t),o=G(t),i=n==="fixed",s=ie(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=Y(0);if(r||!r&&!i)if((me(t)!=="body"||xe(o))&&(a=He(t)),r){const m=ie(t,!0,i,t);l.x=m.x+t.clientLeft,l.y=m.y+t.clientTop}else o&&(l.x=wt(o));const u=o&&!r&&!i?xn(o,a):Y(0),f=s.left+a.scrollLeft-l.x-u.x,d=s.top+a.scrollTop-l.y-u.y;return{x:f,y:d,width:s.width,height:s.height}}function Ze(e){return V(e).position==="static"}function Kt(e,t){if(!X(e)||V(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return G(e)===n&&(n=n.ownerDocument.body),n}function En(e,t){const n=W(e);if(Be(e))return n;if(!X(e)){let o=ne(e);for(;o&&!fe(o);){if(H(o)&&!Ze(o))return o;o=ne(o)}return n}let r=Kt(e,t);for(;r&&Eo(r)&&Ze(r);)r=Kt(r,t);return r&&fe(r)&&Ze(r)&&!vt(r)?n:r||Co(e)||n}const ko=async function(e){const t=this.getOffsetParent||En,n=this.getDimensions,r=await n(e.floating);return{reference:_o(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Fo(e){return V(e).direction==="rtl"}const Io={convertOffsetParentRelativeRectToViewportRelativeRect:Ro,getDocumentElement:G,getClippingRect:Lo,getOffsetParent:En,getElementRects:ko,getClientRects:So,getDimensions:Do,getScale:le,isElement:H,isRTL:Fo};function Cn(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function jo(e,t){let n=null,r;const o=G(e);function i(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),i();const u=e.getBoundingClientRect(),{left:f,top:d,width:m,height:h}=u;if(a||t(),!m||!h)return;const g=Re(d),p=Re(o.clientWidth-(f+m)),v=Re(o.clientHeight-(d+h)),y=Re(f),b={rootMargin:-g+"px "+-p+"px "+-v+"px "+-y+"px",threshold:j(0,ee(1,l))||1};let x=!0;function E(A){const P=A[0].intersectionRatio;if(P!==l){if(!x)return s();P?s(!1,P):r=setTimeout(()=>{s(!1,1e-7)},1e3)}P===1&&!Cn(u,e.getBoundingClientRect())&&s(),x=!1}try{n=new IntersectionObserver(E,{...b,root:o.ownerDocument})}catch{n=new IntersectionObserver(E,b)}n.observe(e)}return s(!0),i}function Wo(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=yt(e),f=o||i?[...u?ye(u):[],...ye(t)]:[];f.forEach(y=>{o&&y.addEventListener("scroll",n,{passive:!0}),i&&y.addEventListener("resize",n)});const d=u&&a?jo(u,n):null;let m=-1,h=null;s&&(h=new ResizeObserver(y=>{let[w]=y;w&&w.target===u&&h&&(h.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var b;(b=h)==null||b.observe(t)})),n()}),u&&!l&&h.observe(u),h.observe(t));let g,p=l?ie(e):null;l&&v();function v(){const y=ie(e);p&&!Cn(p,y)&&n(),p=y,g=requestAnimationFrame(v)}return n(),()=>{var y;f.forEach(w=>{o&&w.removeEventListener("scroll",n),i&&w.removeEventListener("resize",n)}),d==null||d(),(y=h)==null||y.disconnect(),h=null,l&&cancelAnimationFrame(g)}}const $o=yo,Bo=wo,Ho=mo,Vo=bo,Uo=vo,Gt=ho,zo=xo,Yo=(e,t,n)=>{const r=new Map,o={platform:Io,...n},i={...o.platform,_c:r};return po(e,t,{...o,platform:i})};var Me=typeof document<"u"?c.useLayoutEffect:c.useEffect;function Ie(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Ie(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!Ie(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function Pn(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function qt(e,t){const n=Pn(e);return Math.round(t*n)/n}function Qe(e){const t=c.useRef(e);return Me(()=>{t.current=e}),t}function Xo(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:s}={},transform:a=!0,whileElementsMounted:l,open:u}=e,[f,d]=c.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,h]=c.useState(r);Ie(m,r)||h(r);const[g,p]=c.useState(null),[v,y]=c.useState(null),w=c.useCallback(R=>{R!==A.current&&(A.current=R,p(R))},[]),b=c.useCallback(R=>{R!==P.current&&(P.current=R,y(R))},[]),x=i||g,E=s||v,A=c.useRef(null),P=c.useRef(null),S=c.useRef(f),N=l!=null,O=Qe(l),k=Qe(o),F=Qe(u),M=c.useCallback(()=>{if(!A.current||!P.current)return;const R={placement:t,strategy:n,middleware:m};k.current&&(R.platform=k.current),Yo(A.current,P.current,R).then(_=>{const U={..._,isPositioned:F.current!==!1};T.current&&!Ie(S.current,U)&&(S.current=U,nn.flushSync(()=>{d(U)}))})},[m,t,n,k,F]);Me(()=>{u===!1&&S.current.isPositioned&&(S.current.isPositioned=!1,d(R=>({...R,isPositioned:!1})))},[u]);const T=c.useRef(!1);Me(()=>(T.current=!0,()=>{T.current=!1}),[]),Me(()=>{if(x&&(A.current=x),E&&(P.current=E),x&&E){if(O.current)return O.current(x,E,M);M()}},[x,E,M,O,N]);const $=c.useMemo(()=>({reference:A,floating:P,setReference:w,setFloating:b}),[w,b]),L=c.useMemo(()=>({reference:x,floating:E}),[x,E]),D=c.useMemo(()=>{const R={position:n,left:0,top:0};if(!L.floating)return R;const _=qt(L.floating,f.x),U=qt(L.floating,f.y);return a?{...R,transform:"translate("+_+"px, "+U+"px)",...Pn(L.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:_,top:U}},[n,a,L.floating,f.x,f.y]);return c.useMemo(()=>({...f,update:M,refs:$,elements:L,floatingStyles:D}),[f,M,$,L,D])}const Ko=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?Gt({element:r.current,padding:o}).fn(n):{}:r?Gt({element:r,padding:o}).fn(n):{}}}},Go=(e,t)=>({...$o(e),options:[e,t]}),qo=(e,t)=>({...Bo(e),options:[e,t]}),Zo=(e,t)=>({...zo(e),options:[e,t]}),Qo=(e,t)=>({...Ho(e),options:[e,t]}),Jo=(e,t)=>({...Vo(e),options:[e,t]}),ei=(e,t)=>({...Uo(e),options:[e,t]}),ti=(e,t)=>({...Ko(e),options:[e,t]});var ni="Arrow",An=c.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...i}=e;return C.jsx(B.svg,{...i,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:C.jsx("polygon",{points:"0,0 30,0 15,10"})})});An.displayName=ni;var ri=An,xt="Popper",[Rn,Ve]=dt(xt),[oi,Sn]=Rn(xt),On=e=>{const{__scopePopper:t,children:n}=e,[r,o]=c.useState(null);return C.jsx(oi,{scope:t,anchor:r,onAnchorChange:o,children:n})};On.displayName=xt;var Tn="PopperAnchor",Nn=c.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=Sn(Tn,n),s=c.useRef(null),a=K(t,s);return c.useEffect(()=>{i.onAnchorChange((r==null?void 0:r.current)||s.current)}),r?null:C.jsx(B.div,{...o,ref:a})});Nn.displayName=Tn;var bt="PopperContent",[ii,si]=Rn(bt),Mn=c.forwardRef((e,t)=>{var Ot,Tt,Nt,Mt,Lt,Dt;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:i="center",alignOffset:s=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:f=0,sticky:d="partial",hideWhenDetached:m=!1,updatePositionStrategy:h="optimized",onPlaced:g,...p}=e,v=Sn(bt,n),[y,w]=c.useState(null),b=K(t,ve=>w(ve)),[x,E]=c.useState(null),A=kr(x),P=(A==null?void 0:A.width)??0,S=(A==null?void 0:A.height)??0,N=r+(i!=="center"?"-"+i:""),O=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},k=Array.isArray(u)?u:[u],F=k.length>0,M={padding:O,boundary:k.filter(ci),altBoundary:F},{refs:T,floatingStyles:$,placement:L,isPositioned:D,middlewareData:R}=Xo({strategy:"fixed",placement:N,whileElementsMounted:(...ve)=>Wo(...ve,{animationFrame:h==="always"}),elements:{reference:v.anchor},middleware:[Go({mainAxis:o+S,alignmentAxis:s}),l&&qo({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?Zo():void 0,...M}),l&&Qo({...M}),Jo({...M,apply:({elements:ve,rects:_t,availableWidth:yr,availableHeight:wr})=>{const{width:xr,height:br}=_t.reference,Pe=ve.floating.style;Pe.setProperty("--radix-popper-available-width",`${yr}px`),Pe.setProperty("--radix-popper-available-height",`${wr}px`),Pe.setProperty("--radix-popper-anchor-width",`${xr}px`),Pe.setProperty("--radix-popper-anchor-height",`${br}px`)}}),x&&ti({element:x,padding:a}),li({arrowWidth:P,arrowHeight:S}),m&&ei({strategy:"referenceHidden",...M})]}),[_,U]=_n(L),Ce=J(g);oe(()=>{D&&(Ce==null||Ce())},[D,Ce]);const pr=(Ot=R.arrow)==null?void 0:Ot.x,hr=(Tt=R.arrow)==null?void 0:Tt.y,mr=((Nt=R.arrow)==null?void 0:Nt.centerOffset)!==0,[vr,gr]=c.useState();return oe(()=>{y&&gr(window.getComputedStyle(y).zIndex)},[y]),C.jsx("div",{ref:T.setFloating,"data-radix-popper-content-wrapper":"",style:{...$,transform:D?$.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:vr,"--radix-popper-transform-origin":[(Mt=R.transformOrigin)==null?void 0:Mt.x,(Lt=R.transformOrigin)==null?void 0:Lt.y].join(" "),...((Dt=R.hide)==null?void 0:Dt.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:C.jsx(ii,{scope:n,placedSide:_,onArrowChange:E,arrowX:pr,arrowY:hr,shouldHideArrow:mr,children:C.jsx(B.div,{"data-side":_,"data-align":U,...p,ref:b,style:{...p.style,animation:D?void 0:"none"}})})})});Mn.displayName=bt;var Ln="PopperArrow",ai={top:"bottom",right:"left",bottom:"top",left:"right"},Dn=c.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,i=si(Ln,r),s=ai[i.placedSide];return C.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:C.jsx(ri,{...o,ref:n,style:{...o.style,display:"block"}})})});Dn.displayName=Ln;function ci(e){return e!==null}var li=e=>({name:"transformOrigin",options:e,fn(t){var v,y,w;const{placement:n,rects:r,middlewareData:o}=t,s=((v=o.arrow)==null?void 0:v.centerOffset)!==0,a=s?0:e.arrowWidth,l=s?0:e.arrowHeight,[u,f]=_n(n),d={start:"0%",center:"50%",end:"100%"}[f],m=(((y=o.arrow)==null?void 0:y.x)??0)+a/2,h=(((w=o.arrow)==null?void 0:w.y)??0)+l/2;let g="",p="";return u==="bottom"?(g=s?d:`${m}px`,p=`${-l}px`):u==="top"?(g=s?d:`${m}px`,p=`${r.floating.height+l}px`):u==="right"?(g=`${-l}px`,p=s?d:`${h}px`):u==="left"&&(g=`${r.floating.width+l}px`,p=s?d:`${h}px`),{data:{x:g,y:p}}}});function _n(e){const[t,n="center"]=e.split("-");return[t,n]}var kn=On,Et=Nn,Fn=Mn,In=Dn,ui="Portal",Ct=c.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[o,i]=c.useState(!1);oe(()=>i(!0),[]);const s=n||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return s?Cr.createPortal(C.jsx(B.div,{...r,ref:t}),s):null});Ct.displayName=ui;var fi=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},se=new WeakMap,Se=new WeakMap,Oe={},Je=0,jn=function(e){return e&&(e.host||jn(e.parentNode))},di=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=jn(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},pi=function(e,t,n,r){var o=di(t,Array.isArray(e)?e:[e]);Oe[n]||(Oe[n]=new WeakMap);var i=Oe[n],s=[],a=new Set,l=new Set(o),u=function(d){!d||a.has(d)||(a.add(d),u(d.parentNode))};o.forEach(u);var f=function(d){!d||l.has(d)||Array.prototype.forEach.call(d.children,function(m){if(a.has(m))f(m);else try{var h=m.getAttribute(r),g=h!==null&&h!=="false",p=(se.get(m)||0)+1,v=(i.get(m)||0)+1;se.set(m,p),i.set(m,v),s.push(m),p===1&&g&&Se.set(m,!0),v===1&&m.setAttribute(n,"true"),g||m.setAttribute(r,"true")}catch(y){console.error("aria-hidden: cannot operate on ",m,y)}})};return f(t),a.clear(),Je++,function(){s.forEach(function(d){var m=se.get(d)-1,h=i.get(d)-1;se.set(d,m),i.set(d,h),m||(Se.has(d)||d.removeAttribute(r),Se.delete(d)),h||d.removeAttribute(n)}),Je--,Je||(se=new WeakMap,se=new WeakMap,Se=new WeakMap,Oe={})}},hi=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=fi(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),pi(r,o,n,"aria-hidden")):function(){return null}},z=function(){return z=Object.assign||function(t){for(var n,r=1,o=arguments.length;r"u")return Mi;var t=Li(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},_i=Hn(),ue="data-scroll-locked",ki=function(e,t,n,r){var o=e.left,i=e.top,s=e.right,a=e.gap;return n===void 0&&(n="margin"),` - .`.concat(vi,` { - overflow: hidden `).concat(r,`; - padding-right: `).concat(a,"px ").concat(r,`; - } - body[`).concat(ue,`] { - overflow: hidden `).concat(r,`; - overscroll-behavior: contain; - `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&` - padding-left: `.concat(o,`px; - padding-top: `).concat(i,`px; - padding-right: `).concat(s,`px; - margin-left:0; - margin-top:0; - margin-right: `).concat(a,"px ").concat(r,`; - `),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),` - } - - .`).concat(Le,` { - right: `).concat(a,"px ").concat(r,`; - } - - .`).concat(De,` { - margin-right: `).concat(a,"px ").concat(r,`; - } - - .`).concat(Le," .").concat(Le,` { - right: 0 `).concat(r,`; - } - - .`).concat(De," .").concat(De,` { - margin-right: 0 `).concat(r,`; - } - - body[`).concat(ue,`] { - `).concat(gi,": ").concat(a,`px; - } -`)},Qt=function(){var e=parseInt(document.body.getAttribute(ue)||"0",10);return isFinite(e)?e:0},Fi=function(){c.useEffect(function(){return document.body.setAttribute(ue,(Qt()+1).toString()),function(){var e=Qt()-1;e<=0?document.body.removeAttribute(ue):document.body.setAttribute(ue,e.toString())}},[])},Ii=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;Fi();var i=c.useMemo(function(){return Di(o)},[o]);return c.createElement(_i,{styles:ki(i,!t,o,n?"":"!important")})},ct=!1;if(typeof window<"u")try{var Te=Object.defineProperty({},"passive",{get:function(){return ct=!0,!0}});window.addEventListener("test",Te,Te),window.removeEventListener("test",Te,Te)}catch{ct=!1}var ae=ct?{passive:!1}:!1,ji=function(e){return e.tagName==="TEXTAREA"},Vn=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!ji(e)&&n[t]==="visible")},Wi=function(e){return Vn(e,"overflowY")},$i=function(e){return Vn(e,"overflowX")},Jt=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=Un(e,r);if(o){var i=zn(e,r),s=i[1],a=i[2];if(s>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Bi=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Hi=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Un=function(e,t){return e==="v"?Wi(t):$i(t)},zn=function(e,t){return e==="v"?Bi(t):Hi(t)},Vi=function(e,t){return e==="h"&&t==="rtl"?-1:1},Ui=function(e,t,n,r,o){var i=Vi(e,window.getComputedStyle(t).direction),s=i*r,a=n.target,l=t.contains(a),u=!1,f=s>0,d=0,m=0;do{var h=zn(e,a),g=h[0],p=h[1],v=h[2],y=p-v-i*g;(g||y)&&Un(e,a)&&(d+=y,m+=g),a instanceof ShadowRoot?a=a.host:a=a.parentNode}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(f&&Math.abs(d)<1||!f&&Math.abs(m)<1)&&(u=!0),u},Ne=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},en=function(e){return[e.deltaX,e.deltaY]},tn=function(e){return e&&"current"in e?e.current:e},zi=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Yi=function(e){return` - .block-interactivity-`.concat(e,` {pointer-events: none;} - .allow-interactivity-`).concat(e,` {pointer-events: all;} -`)},Xi=0,ce=[];function Ki(e){var t=c.useRef([]),n=c.useRef([0,0]),r=c.useRef(),o=c.useState(Xi++)[0],i=c.useState(Hn)[0],s=c.useRef(e);c.useEffect(function(){s.current=e},[e]),c.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var p=mi([e.lockRef.current],(e.shards||[]).map(tn),!0).filter(Boolean);return p.forEach(function(v){return v.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),p.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=c.useCallback(function(p,v){if("touches"in p&&p.touches.length===2||p.type==="wheel"&&p.ctrlKey)return!s.current.allowPinchZoom;var y=Ne(p),w=n.current,b="deltaX"in p?p.deltaX:w[0]-y[0],x="deltaY"in p?p.deltaY:w[1]-y[1],E,A=p.target,P=Math.abs(b)>Math.abs(x)?"h":"v";if("touches"in p&&P==="h"&&A.type==="range")return!1;var S=Jt(P,A);if(!S)return!0;if(S?E=P:(E=P==="v"?"h":"v",S=Jt(P,A)),!S)return!1;if(!r.current&&"changedTouches"in p&&(b||x)&&(r.current=E),!E)return!0;var N=r.current||E;return Ui(N,v,p,N==="h"?b:x)},[]),l=c.useCallback(function(p){var v=p;if(!(!ce.length||ce[ce.length-1]!==i)){var y="deltaY"in v?en(v):Ne(v),w=t.current.filter(function(E){return E.name===v.type&&(E.target===v.target||v.target===E.shadowParent)&&zi(E.delta,y)})[0];if(w&&w.should){v.cancelable&&v.preventDefault();return}if(!w){var b=(s.current.shards||[]).map(tn).filter(Boolean).filter(function(E){return E.contains(v.target)}),x=b.length>0?a(v,b[0]):!s.current.noIsolation;x&&v.cancelable&&v.preventDefault()}}},[]),u=c.useCallback(function(p,v,y,w){var b={name:p,delta:v,target:y,should:w,shadowParent:Gi(y)};t.current.push(b),setTimeout(function(){t.current=t.current.filter(function(x){return x!==b})},1)},[]),f=c.useCallback(function(p){n.current=Ne(p),r.current=void 0},[]),d=c.useCallback(function(p){u(p.type,en(p),p.target,a(p,e.lockRef.current))},[]),m=c.useCallback(function(p){u(p.type,Ne(p),p.target,a(p,e.lockRef.current))},[]);c.useEffect(function(){return ce.push(i),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:m}),document.addEventListener("wheel",l,ae),document.addEventListener("touchmove",l,ae),document.addEventListener("touchstart",f,ae),function(){ce=ce.filter(function(p){return p!==i}),document.removeEventListener("wheel",l,ae),document.removeEventListener("touchmove",l,ae),document.removeEventListener("touchstart",f,ae)}},[]);var h=e.removeScrollBar,g=e.inert;return c.createElement(c.Fragment,null,g?c.createElement(i,{styles:Yi(o)}):null,h?c.createElement(Ii,{gapMode:e.gapMode}):null)}function Gi(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const qi=Pi(Bn,Ki);var Yn=c.forwardRef(function(e,t){return c.createElement(Ue,z({},e,{ref:t,sideCar:qi}))});Yn.classNames=Ue.classNames;var Pt="Popover",[Xn,Os]=dt(Pt,[Ve]),be=Ve(),[Zi,re]=Xn(Pt),Kn=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:s=!1}=e,a=be(t),l=c.useRef(null),[u,f]=c.useState(!1),[d=!1,m]=cn({prop:r,defaultProp:o,onChange:i});return C.jsx(kn,{...a,children:C.jsx(Zi,{scope:t,contentId:hn(),triggerRef:l,open:d,onOpenChange:m,onOpenToggle:c.useCallback(()=>m(h=>!h),[m]),hasCustomAnchor:u,onCustomAnchorAdd:c.useCallback(()=>f(!0),[]),onCustomAnchorRemove:c.useCallback(()=>f(!1),[]),modal:s,children:n})})};Kn.displayName=Pt;var Gn="PopoverAnchor",Qi=c.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=re(Gn,n),i=be(n),{onCustomAnchorAdd:s,onCustomAnchorRemove:a}=o;return c.useEffect(()=>(s(),()=>a()),[s,a]),C.jsx(Et,{...i,...r,ref:t})});Qi.displayName=Gn;var qn="PopoverTrigger",Zn=c.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=re(qn,n),i=be(n),s=K(t,o.triggerRef),a=C.jsx(B.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":nr(o.open),...r,ref:s,onClick:I(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?a:C.jsx(Et,{asChild:!0,...i,children:a})});Zn.displayName=qn;var At="PopoverPortal",[Ji,es]=Xn(At,{forceMount:void 0}),Qn=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,i=re(At,t);return C.jsx(Ji,{scope:t,forceMount:n,children:C.jsx(we,{present:n||i.open,children:C.jsx(Ct,{asChild:!0,container:o,children:r})})})};Qn.displayName=At;var de="PopoverContent",Jn=c.forwardRef((e,t)=>{const n=es(de,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,i=re(de,e.__scopePopover);return C.jsx(we,{present:r||i.open,children:i.modal?C.jsx(ts,{...o,ref:t}):C.jsx(ns,{...o,ref:t})})});Jn.displayName=de;var ts=c.forwardRef((e,t)=>{const n=re(de,e.__scopePopover),r=c.useRef(null),o=K(t,r),i=c.useRef(!1);return c.useEffect(()=>{const s=r.current;if(s)return hi(s)},[]),C.jsx(Yn,{as:ft,allowPinchZoom:!0,children:C.jsx(er,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:I(e.onCloseAutoFocus,s=>{var a;s.preventDefault(),i.current||(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:I(e.onPointerDownOutside,s=>{const a=s.detail.originalEvent,l=a.button===0&&a.ctrlKey===!0,u=a.button===2||l;i.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:I(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})})}),ns=c.forwardRef((e,t)=>{const n=re(de,e.__scopePopover),r=c.useRef(!1),o=c.useRef(!1);return C.jsx(er,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var s,a;(s=e.onCloseAutoFocus)==null||s.call(e,i),i.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),i.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:i=>{var l,u;(l=e.onInteractOutside)==null||l.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const s=i.target;((u=n.triggerRef.current)==null?void 0:u.contains(s))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}})}),er=c.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:s,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:u,onInteractOutside:f,...d}=e,m=re(de,n),h=be(n);return Kr(),C.jsx(dn,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i,children:C.jsx(We,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:f,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:u,onDismiss:()=>m.onOpenChange(!1),children:C.jsx(Fn,{"data-state":nr(m.open),role:"dialog",id:m.contentId,...h,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),tr="PopoverClose",rs=c.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=re(tr,n);return C.jsx(B.button,{type:"button",...r,ref:t,onClick:I(e.onClick,()=>o.onOpenChange(!1))})});rs.displayName=tr;var os="PopoverArrow",is=c.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=be(n);return C.jsx(In,{...o,...r,ref:t})});is.displayName=os;function nr(e){return e?"open":"closed"}var Ts=Kn,Ns=Zn,Ms=Qn,Ls=Jn,ss="VisuallyHidden",rr=c.forwardRef((e,t)=>C.jsx(B.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));rr.displayName=ss;var as=rr,[ze,Ds]=dt("Tooltip",[Ve]),Ye=Ve(),or="TooltipProvider",cs=700,lt="tooltip.open",[ls,Rt]=ze(or),ir=e=>{const{__scopeTooltip:t,delayDuration:n=cs,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:i}=e,[s,a]=c.useState(!0),l=c.useRef(!1),u=c.useRef(0);return c.useEffect(()=>{const f=u.current;return()=>window.clearTimeout(f)},[]),C.jsx(ls,{scope:t,isOpenDelayed:s,delayDuration:n,onOpen:c.useCallback(()=>{window.clearTimeout(u.current),a(!1)},[]),onClose:c.useCallback(()=>{window.clearTimeout(u.current),u.current=window.setTimeout(()=>a(!0),r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:c.useCallback(f=>{l.current=f},[]),disableHoverableContent:o,children:i})};ir.displayName=or;var Xe="Tooltip",[us,Ee]=ze(Xe),sr=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o=!1,onOpenChange:i,disableHoverableContent:s,delayDuration:a}=e,l=Rt(Xe,e.__scopeTooltip),u=Ye(t),[f,d]=c.useState(null),m=hn(),h=c.useRef(0),g=s??l.disableHoverableContent,p=a??l.delayDuration,v=c.useRef(!1),[y=!1,w]=cn({prop:r,defaultProp:o,onChange:P=>{P?(l.onOpen(),document.dispatchEvent(new CustomEvent(lt))):l.onClose(),i==null||i(P)}}),b=c.useMemo(()=>y?v.current?"delayed-open":"instant-open":"closed",[y]),x=c.useCallback(()=>{window.clearTimeout(h.current),h.current=0,v.current=!1,w(!0)},[w]),E=c.useCallback(()=>{window.clearTimeout(h.current),h.current=0,w(!1)},[w]),A=c.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{v.current=!0,w(!0),h.current=0},p)},[p,w]);return c.useEffect(()=>()=>{h.current&&(window.clearTimeout(h.current),h.current=0)},[]),C.jsx(kn,{...u,children:C.jsx(us,{scope:t,contentId:m,open:y,stateAttribute:b,trigger:f,onTriggerChange:d,onTriggerEnter:c.useCallback(()=>{l.isOpenDelayed?A():x()},[l.isOpenDelayed,A,x]),onTriggerLeave:c.useCallback(()=>{g?E():(window.clearTimeout(h.current),h.current=0)},[E,g]),onOpen:x,onClose:E,disableHoverableContent:g,children:n})})};sr.displayName=Xe;var ut="TooltipTrigger",ar=c.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=Ee(ut,n),i=Rt(ut,n),s=Ye(n),a=c.useRef(null),l=K(t,a,o.onTriggerChange),u=c.useRef(!1),f=c.useRef(!1),d=c.useCallback(()=>u.current=!1,[]);return c.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),C.jsx(Et,{asChild:!0,...s,children:C.jsx(B.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:l,onPointerMove:I(e.onPointerMove,m=>{m.pointerType!=="touch"&&!f.current&&!i.isPointerInTransitRef.current&&(o.onTriggerEnter(),f.current=!0)}),onPointerLeave:I(e.onPointerLeave,()=>{o.onTriggerLeave(),f.current=!1}),onPointerDown:I(e.onPointerDown,()=>{u.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:I(e.onFocus,()=>{u.current||o.onOpen()}),onBlur:I(e.onBlur,o.onClose),onClick:I(e.onClick,o.onClose)})})});ar.displayName=ut;var St="TooltipPortal",[fs,ds]=ze(St,{forceMount:void 0}),cr=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:o}=e,i=Ee(St,t);return C.jsx(fs,{scope:t,forceMount:n,children:C.jsx(we,{present:n||i.open,children:C.jsx(Ct,{asChild:!0,container:o,children:r})})})};cr.displayName=St;var pe="TooltipContent",lr=c.forwardRef((e,t)=>{const n=ds(pe,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...i}=e,s=Ee(pe,e.__scopeTooltip);return C.jsx(we,{present:r||s.open,children:s.disableHoverableContent?C.jsx(ur,{side:o,...i,ref:t}):C.jsx(ps,{side:o,...i,ref:t})})}),ps=c.forwardRef((e,t)=>{const n=Ee(pe,e.__scopeTooltip),r=Rt(pe,e.__scopeTooltip),o=c.useRef(null),i=K(t,o),[s,a]=c.useState(null),{trigger:l,onClose:u}=n,f=o.current,{onPointerInTransitChange:d}=r,m=c.useCallback(()=>{a(null),d(!1)},[d]),h=c.useCallback((g,p)=>{const v=g.currentTarget,y={x:g.clientX,y:g.clientY},w=gs(y,v.getBoundingClientRect()),b=ys(y,w),x=ws(p.getBoundingClientRect()),E=bs([...b,...x]);a(E),d(!0)},[d]);return c.useEffect(()=>()=>m(),[m]),c.useEffect(()=>{if(l&&f){const g=v=>h(v,f),p=v=>h(v,l);return l.addEventListener("pointerleave",g),f.addEventListener("pointerleave",p),()=>{l.removeEventListener("pointerleave",g),f.removeEventListener("pointerleave",p)}}},[l,f,h,m]),c.useEffect(()=>{if(s){const g=p=>{const v=p.target,y={x:p.clientX,y:p.clientY},w=(l==null?void 0:l.contains(v))||(f==null?void 0:f.contains(v)),b=!xs(y,s);w?m():b&&(m(),u())};return document.addEventListener("pointermove",g),()=>document.removeEventListener("pointermove",g)}},[l,f,s,u,m]),C.jsx(ur,{...e,ref:i})}),[hs,ms]=ze(Xe,{isInside:!1}),ur=c.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:i,onPointerDownOutside:s,...a}=e,l=Ee(pe,n),u=Ye(n),{onClose:f}=l;return c.useEffect(()=>(document.addEventListener(lt,f),()=>document.removeEventListener(lt,f)),[f]),c.useEffect(()=>{if(l.trigger){const d=m=>{const h=m.target;h!=null&&h.contains(l.trigger)&&f()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[l.trigger,f]),C.jsx(We,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:d=>d.preventDefault(),onDismiss:f,children:C.jsxs(Fn,{"data-state":l.stateAttribute,...u,...a,ref:t,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[C.jsx(an,{children:r}),C.jsx(hs,{scope:n,isInside:!0,children:C.jsx(as,{id:l.contentId,role:"tooltip",children:o||r})})]})})});lr.displayName=pe;var fr="TooltipArrow",vs=c.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=Ye(n);return ms(fr,n).isInside?null:C.jsx(In,{...o,...r,ref:t})});vs.displayName=fr;function gs(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,o,i)){case i:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function ys(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function ws(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function xs(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,s=t.length-1;ir!=f>r&&n<(u-a)*(r-l)/(f-l)+a&&(o=!o)}return o}function bs(e){const t=e.slice();return t.sort((n,r)=>n.xr.x?1:n.yr.y?1:0),Es(t)}function Es(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r=2;){const i=t[t.length-1],s=t[t.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const i=n[n.length-1],s=n[n.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var _s=ir,ks=sr,Fs=ar,Is=cr,js=lr,Cs="Label",dr=c.forwardRef((e,t)=>C.jsx(B.label,{...e,ref:t,onMouseDown:n=>{var o;n.target.closest("button, input, select, textarea")||((o=e.onMouseDown)==null||o.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));dr.displayName=Cs;var Ws=dr;export{Et as A,Ms as B,Fn as C,We as D,Ls as E,dn as F,Ts as G,Is as H,js as I,_s as J,ks as K,Fs as L,Ws as M,Ss as N,Rs as O,B as P,Yn as R,ft as S,Ns as T,rr as V,cn as a,J as b,dt as c,I as d,hn as e,Ve as f,we as g,hi as h,Kr as i,C as j,In as k,sn as l,$r as m,Ct as n,kn as o,oe as p,kr as q,As as r,V as s,Xo as t,K as u,H as v,Wo as w,Qo as x,Go as y,ti as z}; diff --git a/pkg/ui/frontend/dist/assets/radix-core-mDeFS0Pz.js b/pkg/ui/frontend/dist/assets/radix-core-mDeFS0Pz.js new file mode 100644 index 0000000000000..8c11d76f46f4f --- /dev/null +++ b/pkg/ui/frontend/dist/assets/radix-core-mDeFS0Pz.js @@ -0,0 +1,49 @@ +import{r as c,c as nn,R as Er,d as Cr}from"./react-core-D_V7s-9r.js";var rn={exports:{}},je={};/** + * @license React + * react-jsx-runtime.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Pr=c,Ar=Symbol.for("react.element"),Rr=Symbol.for("react.fragment"),Sr=Object.prototype.hasOwnProperty,Or=Pr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Tr={key:!0,ref:!0,__self:!0,__source:!0};function on(e,t,n){var r,o={},i=null,s=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(s=t.ref);for(r in t)Sr.call(t,r)&&!Tr.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)o[r]===void 0&&(o[r]=t[r]);return{$$typeof:Ar,type:e,key:i,ref:s,props:o,_owner:Or.current}}je.Fragment=Rr;je.jsx=on;je.jsxs=on;rn.exports=je;var C=rn.exports;function kt(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function sn(...e){return t=>{let n=!1;const r=e.map(o=>{const i=kt(o,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let o=0;o{const{children:n,...r}=e,o=c.Children.toArray(n),i=o.find(Nr);if(i){const s=i.props.children,a=o.map(l=>l===i?c.Children.count(s)>1?c.Children.only(null):c.isValidElement(s)?s.props.children:null:l);return C.jsx(rt,{...r,ref:t,children:c.isValidElement(s)?c.cloneElement(s,void 0,a):null})}return C.jsx(rt,{...r,ref:t,children:n})});ft.displayName="Slot";var rt=c.forwardRef((e,t)=>{const{children:n,...r}=e;if(c.isValidElement(n)){const o=Lr(n),i=Mr(r,n.props);return n.type!==c.Fragment&&(i.ref=t?sn(t,o):o),c.cloneElement(n,i)}return c.Children.count(n)>1?c.Children.only(null):null});rt.displayName="SlotClone";var an=({children:e})=>C.jsx(C.Fragment,{children:e});function Nr(e){return c.isValidElement(e)&&e.type===an}function Mr(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{i(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function Lr(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function As(e,t){const n=c.createContext(t),r=i=>{const{children:s,...a}=i,l=c.useMemo(()=>a,Object.values(a));return C.jsx(n.Provider,{value:l,children:s})};r.displayName=e+"Provider";function o(i){const s=c.useContext(n);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,o]}function dt(e,t=[]){let n=[];function r(i,s){const a=c.createContext(s),l=n.length;n=[...n,s];const u=d=>{var y;const{scope:m,children:h,...g}=d,p=((y=m==null?void 0:m[e])==null?void 0:y[l])||a,v=c.useMemo(()=>g,Object.values(g));return C.jsx(p.Provider,{value:v,children:h})};u.displayName=i+"Provider";function f(d,m){var p;const h=((p=m==null?void 0:m[e])==null?void 0:p[l])||a,g=c.useContext(h);if(g)return g;if(s!==void 0)return s;throw new Error(`\`${d}\` must be used within \`${i}\``)}return[u,f]}const o=()=>{const i=n.map(s=>c.createContext(s));return function(a){const l=(a==null?void 0:a[e])||i;return c.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,Dr(o,...t)]}function Dr(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=r.reduce((a,{useScope:l,scopeName:u})=>{const d=l(i)[`__scope${u}`];return{...a,...d}},{});return c.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function I(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function J(e){const t=c.useRef(e);return c.useEffect(()=>{t.current=e}),c.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function cn({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=_r({defaultProp:t,onChange:n}),i=e!==void 0,s=i?e:r,a=J(n),l=c.useCallback(u=>{if(i){const d=typeof u=="function"?u(e):u;d!==e&&a(d)}else o(u)},[i,e,o,a]);return[s,l]}function _r({defaultProp:e,onChange:t}){const n=c.useState(e),[r]=n,o=c.useRef(r),i=J(t);return c.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}var oe=globalThis!=null&&globalThis.document?c.useLayoutEffect:()=>{};function kr(e){const[t,n]=c.useState(void 0);return oe(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let s,a;if("borderBoxSize"in i){const l=i.borderBoxSize,u=Array.isArray(l)?l[0]:l;s=u.inlineSize,a=u.blockSize}else s=e.offsetWidth,a=e.offsetHeight;n({width:s,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}function Fr(e,t){return c.useReducer((n,r)=>t[n][r]??n,e)}var we=e=>{const{present:t,children:n}=e,r=Ir(t),o=typeof n=="function"?n({present:r.isPresent}):c.Children.only(n),i=K(r.ref,jr(o));return typeof n=="function"||r.isPresent?c.cloneElement(o,{ref:i}):null};we.displayName="Presence";function Ir(e){const[t,n]=c.useState(),r=c.useRef({}),o=c.useRef(e),i=c.useRef("none"),s=e?"mounted":"unmounted",[a,l]=Fr(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return c.useEffect(()=>{const u=Ae(r.current);i.current=a==="mounted"?u:"none"},[a]),oe(()=>{const u=r.current,f=o.current;if(f!==e){const m=i.current,h=Ae(u);e?l("MOUNT"):h==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(f&&m!==h?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),oe(()=>{if(t){let u;const f=t.ownerDocument.defaultView??window,d=h=>{const p=Ae(r.current).includes(h.animationName);if(h.target===t&&p&&(l("ANIMATION_END"),!o.current)){const v=t.style.animationFillMode;t.style.animationFillMode="forwards",u=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=v)})}},m=h=>{h.target===t&&(i.current=Ae(r.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{f.clearTimeout(u),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:c.useCallback(u=>{u&&(r.current=getComputedStyle(u)),n(u)},[])}}function Ae(e){return(e==null?void 0:e.animationName)||"none"}function jr(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Wr=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],B=Wr.reduce((e,t)=>{const n=c.forwardRef((r,o)=>{const{asChild:i,...s}=r,a=i?ft:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),C.jsx(a,{...s,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function $r(e,t){e&&nn.flushSync(()=>e.dispatchEvent(t))}function Br(e,t=globalThis==null?void 0:globalThis.document){const n=J(e);c.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var Hr="DismissableLayer",ot="dismissableLayer.update",Vr="dismissableLayer.pointerDownOutside",Ur="dismissableLayer.focusOutside",Ft,ln=c.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),We=c.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,onDismiss:a,...l}=e,u=c.useContext(ln),[f,d]=c.useState(null),m=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,h]=c.useState({}),g=K(t,P=>d(P)),p=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=p.indexOf(v),w=f?p.indexOf(f):-1,b=u.layersWithOutsidePointerEventsDisabled.size>0,x=w>=y,E=Yr(P=>{const S=P.target,N=[...u.branches].some(O=>O.contains(S));!x||N||(o==null||o(P),s==null||s(P),P.defaultPrevented||a==null||a())},m),A=Xr(P=>{const S=P.target;[...u.branches].some(O=>O.contains(S))||(i==null||i(P),s==null||s(P),P.defaultPrevented||a==null||a())},m);return Br(P=>{w===u.layers.size-1&&(r==null||r(P),!P.defaultPrevented&&a&&(P.preventDefault(),a()))},m),c.useEffect(()=>{if(f)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Ft=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),It(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=Ft)}},[f,m,n,u]),c.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),It())},[f,u]),c.useEffect(()=>{const P=()=>h({});return document.addEventListener(ot,P),()=>document.removeEventListener(ot,P)},[]),C.jsx(B.div,{...l,ref:g,style:{pointerEvents:b?x?"auto":"none":void 0,...e.style},onFocusCapture:I(e.onFocusCapture,A.onFocusCapture),onBlurCapture:I(e.onBlurCapture,A.onBlurCapture),onPointerDownCapture:I(e.onPointerDownCapture,E.onPointerDownCapture)})});We.displayName=Hr;var zr="DismissableLayerBranch",un=c.forwardRef((e,t)=>{const n=c.useContext(ln),r=c.useRef(null),o=K(t,r);return c.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),C.jsx(B.div,{...e,ref:o})});un.displayName=zr;function Yr(e,t=globalThis==null?void 0:globalThis.document){const n=J(e),r=c.useRef(!1),o=c.useRef(()=>{});return c.useEffect(()=>{const i=a=>{if(a.target&&!r.current){let l=function(){fn(Vr,n,u,{discrete:!0})};const u={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=l,t.addEventListener("click",o.current,{once:!0})):l()}else t.removeEventListener("click",o.current);r.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Xr(e,t=globalThis==null?void 0:globalThis.document){const n=J(e),r=c.useRef(!1);return c.useEffect(()=>{const o=i=>{i.target&&!r.current&&fn(Ur,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function It(){const e=new CustomEvent(ot);document.dispatchEvent(e)}function fn(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?$r(o,i):o.dispatchEvent(i)}var Rs=We,Ss=un,Ke=0;function Kr(){c.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??jt()),document.body.insertAdjacentElement("beforeend",e[1]??jt()),Ke++,()=>{Ke===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Ke--}},[])}function jt(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Ge="focusScope.autoFocusOnMount",qe="focusScope.autoFocusOnUnmount",Wt={bubbles:!1,cancelable:!0},Gr="FocusScope",dn=c.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=e,[a,l]=c.useState(null),u=J(o),f=J(i),d=c.useRef(null),m=K(t,p=>l(p)),h=c.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;c.useEffect(()=>{if(r){let p=function(b){if(h.paused||!a)return;const x=b.target;a.contains(x)?d.current=x:Q(d.current,{select:!0})},v=function(b){if(h.paused||!a)return;const x=b.relatedTarget;x!==null&&(a.contains(x)||Q(d.current,{select:!0}))},y=function(b){if(document.activeElement===document.body)for(const E of b)E.removedNodes.length>0&&Q(a)};document.addEventListener("focusin",p),document.addEventListener("focusout",v);const w=new MutationObserver(y);return a&&w.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",p),document.removeEventListener("focusout",v),w.disconnect()}}},[r,a,h.paused]),c.useEffect(()=>{if(a){Bt.add(h);const p=document.activeElement;if(!a.contains(p)){const y=new CustomEvent(Ge,Wt);a.addEventListener(Ge,u),a.dispatchEvent(y),y.defaultPrevented||(qr(to(pn(a)),{select:!0}),document.activeElement===p&&Q(a))}return()=>{a.removeEventListener(Ge,u),setTimeout(()=>{const y=new CustomEvent(qe,Wt);a.addEventListener(qe,f),a.dispatchEvent(y),y.defaultPrevented||Q(p??document.body,{select:!0}),a.removeEventListener(qe,f),Bt.remove(h)},0)}}},[a,u,f,h]);const g=c.useCallback(p=>{if(!n&&!r||h.paused)return;const v=p.key==="Tab"&&!p.altKey&&!p.ctrlKey&&!p.metaKey,y=document.activeElement;if(v&&y){const w=p.currentTarget,[b,x]=Zr(w);b&&x?!p.shiftKey&&y===x?(p.preventDefault(),n&&Q(b,{select:!0})):p.shiftKey&&y===b&&(p.preventDefault(),n&&Q(x,{select:!0})):y===w&&p.preventDefault()}},[n,r,h.paused]);return C.jsx(B.div,{tabIndex:-1,...s,ref:m,onKeyDown:g})});dn.displayName=Gr;function qr(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Q(r,{select:t}),document.activeElement!==n)return}function Zr(e){const t=pn(e),n=$t(t,e),r=$t(t.reverse(),e);return[n,r]}function pn(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function $t(e,t){for(const n of e)if(!Qr(n,{upTo:t}))return n}function Qr(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Jr(e){return e instanceof HTMLInputElement&&"select"in e}function Q(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Jr(e)&&t&&e.select()}}var Bt=eo();function eo(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Ht(e,t),e.unshift(t)},remove(t){var n;e=Ht(e,t),(n=e[0])==null||n.resume()}}}function Ht(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function to(e){return e.filter(t=>t.tagName!=="A")}var no=Er.useId||(()=>{}),ro=0;function hn(e){const[t,n]=c.useState(no());return oe(()=>{n(r=>r??String(ro++))},[e]),t?`radix-${t}`:""}const oo=["top","right","bottom","left"],ee=Math.min,j=Math.max,_e=Math.round,Re=Math.floor,Y=e=>({x:e,y:e}),io={left:"right",right:"left",bottom:"top",top:"bottom"},so={start:"end",end:"start"};function it(e,t,n){return j(e,ee(t,n))}function q(e,t){return typeof e=="function"?e(t):e}function Z(e){return e.split("-")[0]}function he(e){return e.split("-")[1]}function pt(e){return e==="x"?"y":"x"}function ht(e){return e==="y"?"height":"width"}function te(e){return["top","bottom"].includes(Z(e))?"y":"x"}function mt(e){return pt(te(e))}function ao(e,t,n){n===void 0&&(n=!1);const r=he(e),o=mt(e),i=ht(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=ke(s)),[s,ke(s)]}function co(e){const t=ke(e);return[st(e),t,st(t)]}function st(e){return e.replace(/start|end/g,t=>so[t])}function lo(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:s;default:return[]}}function uo(e,t,n,r){const o=he(e);let i=lo(Z(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(st)))),i}function ke(e){return e.replace(/left|right|bottom|top/g,t=>io[t])}function fo(e){return{top:0,right:0,bottom:0,left:0,...e}}function mn(e){return typeof e!="number"?fo(e):{top:e,right:e,bottom:e,left:e}}function Fe(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function Vt(e,t,n){let{reference:r,floating:o}=e;const i=te(t),s=mt(t),a=ht(s),l=Z(t),u=i==="y",f=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,m=r[a]/2-o[a]/2;let h;switch(l){case"top":h={x:f,y:r.y-o.height};break;case"bottom":h={x:f,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:d};break;case"left":h={x:r.x-o.width,y:d};break;default:h={x:r.x,y:r.y}}switch(he(t)){case"start":h[s]-=m*(n&&u?-1:1);break;case"end":h[s]+=m*(n&&u?-1:1);break}return h}const po=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(t));let u=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:f,y:d}=Vt(u,r,l),m=r,h={},g=0;for(let p=0;p({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:u,padding:f=0}=q(e,t)||{};if(u==null)return{};const d=mn(f),m={x:n,y:r},h=mt(o),g=ht(h),p=await s.getDimensions(u),v=h==="y",y=v?"top":"left",w=v?"bottom":"right",b=v?"clientHeight":"clientWidth",x=i.reference[g]+i.reference[h]-m[h]-i.floating[g],E=m[h]-i.reference[h],A=await(s.getOffsetParent==null?void 0:s.getOffsetParent(u));let P=A?A[b]:0;(!P||!await(s.isElement==null?void 0:s.isElement(A)))&&(P=a.floating[b]||i.floating[g]);const S=x/2-E/2,N=P/2-p[g]/2-1,O=ee(d[y],N),k=ee(d[w],N),F=O,M=P-p[g]-k,T=P/2-p[g]/2+S,$=it(F,T,M),L=!l.arrow&&he(o)!=null&&T!==$&&i.reference[g]/2-(TT<=0)){var k,F;const T=(((k=i.flip)==null?void 0:k.index)||0)+1,$=P[T];if($)return{data:{index:T,overflows:O},reset:{placement:$}};let L=(F=O.filter(D=>D.overflows[0]<=0).sort((D,R)=>D.overflows[1]-R.overflows[1])[0])==null?void 0:F.placement;if(!L)switch(h){case"bestFit":{var M;const D=(M=O.filter(R=>{if(A){const _=te(R.placement);return _===w||_==="y"}return!0}).map(R=>[R.placement,R.overflows.filter(_=>_>0).reduce((_,U)=>_+U,0)]).sort((R,_)=>R[1]-_[1])[0])==null?void 0:M[0];D&&(L=D);break}case"initialPlacement":L=a;break}if(o!==L)return{reset:{placement:L}}}return{}}}};function Ut(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function zt(e){return oo.some(t=>e[t]>=0)}const vo=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=q(e,t);switch(r){case"referenceHidden":{const i=await ge(t,{...o,elementContext:"reference"}),s=Ut(i,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:zt(s)}}}case"escaped":{const i=await ge(t,{...o,altBoundary:!0}),s=Ut(i,n.floating);return{data:{escapedOffsets:s,escaped:zt(s)}}}default:return{}}}}};async function go(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=Z(n),a=he(n),l=te(n)==="y",u=["left","top"].includes(s)?-1:1,f=i&&l?-1:1,d=q(t,e);let{mainAxis:m,crossAxis:h,alignmentAxis:g}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof g=="number"&&(h=a==="end"?g*-1:g),l?{x:h*f,y:m*u}:{x:m*u,y:h*f}}const yo=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:a}=t,l=await go(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:s}}}}},wo=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:a={fn:v=>{let{x:y,y:w}=v;return{x:y,y:w}}},...l}=q(e,t),u={x:n,y:r},f=await ge(t,l),d=te(Z(o)),m=pt(d);let h=u[m],g=u[d];if(i){const v=m==="y"?"top":"left",y=m==="y"?"bottom":"right",w=h+f[v],b=h-f[y];h=it(w,h,b)}if(s){const v=d==="y"?"top":"left",y=d==="y"?"bottom":"right",w=g+f[v],b=g-f[y];g=it(w,g,b)}const p=a.fn({...t,[m]:h,[d]:g});return{...p,data:{x:p.x-n,y:p.y-r,enabled:{[m]:i,[d]:s}}}}}},xo=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:s}=t,{offset:a=0,mainAxis:l=!0,crossAxis:u=!0}=q(e,t),f={x:n,y:r},d=te(o),m=pt(d);let h=f[m],g=f[d];const p=q(a,t),v=typeof p=="number"?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(l){const b=m==="y"?"height":"width",x=i.reference[m]-i.floating[b]+v.mainAxis,E=i.reference[m]+i.reference[b]-v.mainAxis;hE&&(h=E)}if(u){var y,w;const b=m==="y"?"width":"height",x=["top","left"].includes(Z(o)),E=i.reference[d]-i.floating[b]+(x&&((y=s.offset)==null?void 0:y[d])||0)+(x?0:v.crossAxis),A=i.reference[d]+i.reference[b]+(x?0:((w=s.offset)==null?void 0:w[d])||0)-(x?v.crossAxis:0);gA&&(g=A)}return{[m]:h,[d]:g}}}},bo=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:s,elements:a}=t,{apply:l=()=>{},...u}=q(e,t),f=await ge(t,u),d=Z(o),m=he(o),h=te(o)==="y",{width:g,height:p}=i.floating;let v,y;d==="top"||d==="bottom"?(v=d,y=m===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(y=d,v=m==="end"?"top":"bottom");const w=p-f.top-f.bottom,b=g-f.left-f.right,x=ee(p-f[v],w),E=ee(g-f[y],b),A=!t.middlewareData.shift;let P=x,S=E;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(S=b),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(P=w),A&&!m){const O=j(f.left,0),k=j(f.right,0),F=j(f.top,0),M=j(f.bottom,0);h?S=g-2*(O!==0||k!==0?O+k:j(f.left,f.right)):P=p-2*(F!==0||M!==0?F+M:j(f.top,f.bottom))}await l({...t,availableWidth:S,availableHeight:P});const N=await s.getDimensions(a.floating);return g!==N.width||p!==N.height?{reset:{rects:!0}}:{}}}};function $e(){return typeof window<"u"}function me(e){return vn(e)?(e.nodeName||"").toLowerCase():"#document"}function W(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function G(e){var t;return(t=(vn(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function vn(e){return $e()?e instanceof Node||e instanceof W(e).Node:!1}function H(e){return $e()?e instanceof Element||e instanceof W(e).Element:!1}function X(e){return $e()?e instanceof HTMLElement||e instanceof W(e).HTMLElement:!1}function Yt(e){return!$e()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof W(e).ShadowRoot}function xe(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=V(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function Eo(e){return["table","td","th"].includes(me(e))}function Be(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function vt(e){const t=gt(),n=H(e)?V(e):e;return["transform","translate","scale","rotate","perspective"].some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function Co(e){let t=ne(e);for(;X(t)&&!fe(t);){if(vt(t))return t;if(Be(t))return null;t=ne(t)}return null}function gt(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function fe(e){return["html","body","#document"].includes(me(e))}function V(e){return W(e).getComputedStyle(e)}function He(e){return H(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ne(e){if(me(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Yt(e)&&e.host||G(e);return Yt(t)?t.host:t}function gn(e){const t=ne(e);return fe(t)?e.ownerDocument?e.ownerDocument.body:e.body:X(t)&&xe(t)?t:gn(t)}function ye(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=gn(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=W(o);if(i){const a=at(s);return t.concat(s,s.visualViewport||[],xe(o)?o:[],a&&n?ye(a):[])}return t.concat(o,ye(o,[],n))}function at(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function yn(e){const t=V(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=X(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=_e(n)!==i||_e(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function yt(e){return H(e)?e:e.contextElement}function le(e){const t=yt(e);if(!X(t))return Y(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=yn(t);let s=(i?_e(n.width):n.width)/r,a=(i?_e(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const Po=Y(0);function wn(e){const t=W(e);return!gt()||!t.visualViewport?Po:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Ao(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==W(e)?!1:t}function ie(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=yt(e);let s=Y(1);t&&(r?H(r)&&(s=le(r)):s=le(e));const a=Ao(i,n,r)?wn(i):Y(0);let l=(o.left+a.x)/s.x,u=(o.top+a.y)/s.y,f=o.width/s.x,d=o.height/s.y;if(i){const m=W(i),h=r&&H(r)?W(r):r;let g=m,p=at(g);for(;p&&r&&h!==g;){const v=le(p),y=p.getBoundingClientRect(),w=V(p),b=y.left+(p.clientLeft+parseFloat(w.paddingLeft))*v.x,x=y.top+(p.clientTop+parseFloat(w.paddingTop))*v.y;l*=v.x,u*=v.y,f*=v.x,d*=v.y,l+=b,u+=x,g=W(p),p=at(g)}}return Fe({width:f,height:d,x:l,y:u})}function wt(e,t){const n=He(e).scrollLeft;return t?t.left+n:ie(G(e)).left+n}function xn(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-(n?0:wt(e,r)),i=r.top+t.scrollTop;return{x:o,y:i}}function Ro(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",s=G(r),a=t?Be(t.floating):!1;if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},u=Y(1);const f=Y(0),d=X(r);if((d||!d&&!i)&&((me(r)!=="body"||xe(s))&&(l=He(r)),X(r))){const h=ie(r);u=le(r),f.x=h.x+r.clientLeft,f.y=h.y+r.clientTop}const m=s&&!d&&!i?xn(s,l,!0):Y(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+f.x+m.x,y:n.y*u.y-l.scrollTop*u.y+f.y+m.y}}function So(e){return Array.from(e.getClientRects())}function Oo(e){const t=G(e),n=He(e),r=e.ownerDocument.body,o=j(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=j(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+wt(e);const a=-n.scrollTop;return V(r).direction==="rtl"&&(s+=j(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}function To(e,t){const n=W(e),r=G(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const u=gt();(!u||u&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a,y:l}}function No(e,t){const n=ie(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=X(e)?le(e):Y(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,l=o*i.x,u=r*i.y;return{width:s,height:a,x:l,y:u}}function Xt(e,t,n){let r;if(t==="viewport")r=To(e,n);else if(t==="document")r=Oo(G(e));else if(H(t))r=No(t,n);else{const o=wn(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Fe(r)}function bn(e,t){const n=ne(e);return n===t||!H(n)||fe(n)?!1:V(n).position==="fixed"||bn(n,t)}function Mo(e,t){const n=t.get(e);if(n)return n;let r=ye(e,[],!1).filter(a=>H(a)&&me(a)!=="body"),o=null;const i=V(e).position==="fixed";let s=i?ne(e):e;for(;H(s)&&!fe(s);){const a=V(s),l=vt(s);!l&&a.position==="fixed"&&(o=null),(i?!l&&!o:!l&&a.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||xe(s)&&!l&&bn(e,s))?r=r.filter(f=>f!==s):o=a,s=ne(s)}return t.set(e,r),r}function Lo(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?Be(t)?[]:Mo(t,this._c):[].concat(n),r],a=s[0],l=s.reduce((u,f)=>{const d=Xt(t,f,o);return u.top=j(d.top,u.top),u.right=ee(d.right,u.right),u.bottom=ee(d.bottom,u.bottom),u.left=j(d.left,u.left),u},Xt(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Do(e){const{width:t,height:n}=yn(e);return{width:t,height:n}}function _o(e,t,n){const r=X(t),o=G(t),i=n==="fixed",s=ie(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=Y(0);if(r||!r&&!i)if((me(t)!=="body"||xe(o))&&(a=He(t)),r){const m=ie(t,!0,i,t);l.x=m.x+t.clientLeft,l.y=m.y+t.clientTop}else o&&(l.x=wt(o));const u=o&&!r&&!i?xn(o,a):Y(0),f=s.left+a.scrollLeft-l.x-u.x,d=s.top+a.scrollTop-l.y-u.y;return{x:f,y:d,width:s.width,height:s.height}}function Ze(e){return V(e).position==="static"}function Kt(e,t){if(!X(e)||V(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return G(e)===n&&(n=n.ownerDocument.body),n}function En(e,t){const n=W(e);if(Be(e))return n;if(!X(e)){let o=ne(e);for(;o&&!fe(o);){if(H(o)&&!Ze(o))return o;o=ne(o)}return n}let r=Kt(e,t);for(;r&&Eo(r)&&Ze(r);)r=Kt(r,t);return r&&fe(r)&&Ze(r)&&!vt(r)?n:r||Co(e)||n}const ko=async function(e){const t=this.getOffsetParent||En,n=this.getDimensions,r=await n(e.floating);return{reference:_o(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Fo(e){return V(e).direction==="rtl"}const Io={convertOffsetParentRelativeRectToViewportRelativeRect:Ro,getDocumentElement:G,getClippingRect:Lo,getOffsetParent:En,getElementRects:ko,getClientRects:So,getDimensions:Do,getScale:le,isElement:H,isRTL:Fo};function Cn(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function jo(e,t){let n=null,r;const o=G(e);function i(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),i();const u=e.getBoundingClientRect(),{left:f,top:d,width:m,height:h}=u;if(a||t(),!m||!h)return;const g=Re(d),p=Re(o.clientWidth-(f+m)),v=Re(o.clientHeight-(d+h)),y=Re(f),b={rootMargin:-g+"px "+-p+"px "+-v+"px "+-y+"px",threshold:j(0,ee(1,l))||1};let x=!0;function E(A){const P=A[0].intersectionRatio;if(P!==l){if(!x)return s();P?s(!1,P):r=setTimeout(()=>{s(!1,1e-7)},1e3)}P===1&&!Cn(u,e.getBoundingClientRect())&&s(),x=!1}try{n=new IntersectionObserver(E,{...b,root:o.ownerDocument})}catch{n=new IntersectionObserver(E,b)}n.observe(e)}return s(!0),i}function Wo(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=yt(e),f=o||i?[...u?ye(u):[],...ye(t)]:[];f.forEach(y=>{o&&y.addEventListener("scroll",n,{passive:!0}),i&&y.addEventListener("resize",n)});const d=u&&a?jo(u,n):null;let m=-1,h=null;s&&(h=new ResizeObserver(y=>{let[w]=y;w&&w.target===u&&h&&(h.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var b;(b=h)==null||b.observe(t)})),n()}),u&&!l&&h.observe(u),h.observe(t));let g,p=l?ie(e):null;l&&v();function v(){const y=ie(e);p&&!Cn(p,y)&&n(),p=y,g=requestAnimationFrame(v)}return n(),()=>{var y;f.forEach(w=>{o&&w.removeEventListener("scroll",n),i&&w.removeEventListener("resize",n)}),d==null||d(),(y=h)==null||y.disconnect(),h=null,l&&cancelAnimationFrame(g)}}const $o=yo,Bo=wo,Ho=mo,Vo=bo,Uo=vo,Gt=ho,zo=xo,Yo=(e,t,n)=>{const r=new Map,o={platform:Io,...n},i={...o.platform,_c:r};return po(e,t,{...o,platform:i})};var Me=typeof document<"u"?c.useLayoutEffect:c.useEffect;function Ie(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Ie(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!Ie(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function Pn(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function qt(e,t){const n=Pn(e);return Math.round(t*n)/n}function Qe(e){const t=c.useRef(e);return Me(()=>{t.current=e}),t}function Xo(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:s}={},transform:a=!0,whileElementsMounted:l,open:u}=e,[f,d]=c.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,h]=c.useState(r);Ie(m,r)||h(r);const[g,p]=c.useState(null),[v,y]=c.useState(null),w=c.useCallback(R=>{R!==A.current&&(A.current=R,p(R))},[]),b=c.useCallback(R=>{R!==P.current&&(P.current=R,y(R))},[]),x=i||g,E=s||v,A=c.useRef(null),P=c.useRef(null),S=c.useRef(f),N=l!=null,O=Qe(l),k=Qe(o),F=Qe(u),M=c.useCallback(()=>{if(!A.current||!P.current)return;const R={placement:t,strategy:n,middleware:m};k.current&&(R.platform=k.current),Yo(A.current,P.current,R).then(_=>{const U={..._,isPositioned:F.current!==!1};T.current&&!Ie(S.current,U)&&(S.current=U,nn.flushSync(()=>{d(U)}))})},[m,t,n,k,F]);Me(()=>{u===!1&&S.current.isPositioned&&(S.current.isPositioned=!1,d(R=>({...R,isPositioned:!1})))},[u]);const T=c.useRef(!1);Me(()=>(T.current=!0,()=>{T.current=!1}),[]),Me(()=>{if(x&&(A.current=x),E&&(P.current=E),x&&E){if(O.current)return O.current(x,E,M);M()}},[x,E,M,O,N]);const $=c.useMemo(()=>({reference:A,floating:P,setReference:w,setFloating:b}),[w,b]),L=c.useMemo(()=>({reference:x,floating:E}),[x,E]),D=c.useMemo(()=>{const R={position:n,left:0,top:0};if(!L.floating)return R;const _=qt(L.floating,f.x),U=qt(L.floating,f.y);return a?{...R,transform:"translate("+_+"px, "+U+"px)",...Pn(L.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:_,top:U}},[n,a,L.floating,f.x,f.y]);return c.useMemo(()=>({...f,update:M,refs:$,elements:L,floatingStyles:D}),[f,M,$,L,D])}const Ko=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?Gt({element:r.current,padding:o}).fn(n):{}:r?Gt({element:r,padding:o}).fn(n):{}}}},Go=(e,t)=>({...$o(e),options:[e,t]}),qo=(e,t)=>({...Bo(e),options:[e,t]}),Zo=(e,t)=>({...zo(e),options:[e,t]}),Qo=(e,t)=>({...Ho(e),options:[e,t]}),Jo=(e,t)=>({...Vo(e),options:[e,t]}),ei=(e,t)=>({...Uo(e),options:[e,t]}),ti=(e,t)=>({...Ko(e),options:[e,t]});var ni="Arrow",An=c.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...i}=e;return C.jsx(B.svg,{...i,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:C.jsx("polygon",{points:"0,0 30,0 15,10"})})});An.displayName=ni;var ri=An,xt="Popper",[Rn,Ve]=dt(xt),[oi,Sn]=Rn(xt),On=e=>{const{__scopePopper:t,children:n}=e,[r,o]=c.useState(null);return C.jsx(oi,{scope:t,anchor:r,onAnchorChange:o,children:n})};On.displayName=xt;var Tn="PopperAnchor",Nn=c.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=Sn(Tn,n),s=c.useRef(null),a=K(t,s);return c.useEffect(()=>{i.onAnchorChange((r==null?void 0:r.current)||s.current)}),r?null:C.jsx(B.div,{...o,ref:a})});Nn.displayName=Tn;var bt="PopperContent",[ii,si]=Rn(bt),Mn=c.forwardRef((e,t)=>{var Ot,Tt,Nt,Mt,Lt,Dt;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:i="center",alignOffset:s=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:f=0,sticky:d="partial",hideWhenDetached:m=!1,updatePositionStrategy:h="optimized",onPlaced:g,...p}=e,v=Sn(bt,n),[y,w]=c.useState(null),b=K(t,ve=>w(ve)),[x,E]=c.useState(null),A=kr(x),P=(A==null?void 0:A.width)??0,S=(A==null?void 0:A.height)??0,N=r+(i!=="center"?"-"+i:""),O=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},k=Array.isArray(u)?u:[u],F=k.length>0,M={padding:O,boundary:k.filter(ci),altBoundary:F},{refs:T,floatingStyles:$,placement:L,isPositioned:D,middlewareData:R}=Xo({strategy:"fixed",placement:N,whileElementsMounted:(...ve)=>Wo(...ve,{animationFrame:h==="always"}),elements:{reference:v.anchor},middleware:[Go({mainAxis:o+S,alignmentAxis:s}),l&&qo({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?Zo():void 0,...M}),l&&Qo({...M}),Jo({...M,apply:({elements:ve,rects:_t,availableWidth:yr,availableHeight:wr})=>{const{width:xr,height:br}=_t.reference,Pe=ve.floating.style;Pe.setProperty("--radix-popper-available-width",`${yr}px`),Pe.setProperty("--radix-popper-available-height",`${wr}px`),Pe.setProperty("--radix-popper-anchor-width",`${xr}px`),Pe.setProperty("--radix-popper-anchor-height",`${br}px`)}}),x&&ti({element:x,padding:a}),li({arrowWidth:P,arrowHeight:S}),m&&ei({strategy:"referenceHidden",...M})]}),[_,U]=_n(L),Ce=J(g);oe(()=>{D&&(Ce==null||Ce())},[D,Ce]);const pr=(Ot=R.arrow)==null?void 0:Ot.x,hr=(Tt=R.arrow)==null?void 0:Tt.y,mr=((Nt=R.arrow)==null?void 0:Nt.centerOffset)!==0,[vr,gr]=c.useState();return oe(()=>{y&&gr(window.getComputedStyle(y).zIndex)},[y]),C.jsx("div",{ref:T.setFloating,"data-radix-popper-content-wrapper":"",style:{...$,transform:D?$.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:vr,"--radix-popper-transform-origin":[(Mt=R.transformOrigin)==null?void 0:Mt.x,(Lt=R.transformOrigin)==null?void 0:Lt.y].join(" "),...((Dt=R.hide)==null?void 0:Dt.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:C.jsx(ii,{scope:n,placedSide:_,onArrowChange:E,arrowX:pr,arrowY:hr,shouldHideArrow:mr,children:C.jsx(B.div,{"data-side":_,"data-align":U,...p,ref:b,style:{...p.style,animation:D?void 0:"none"}})})})});Mn.displayName=bt;var Ln="PopperArrow",ai={top:"bottom",right:"left",bottom:"top",left:"right"},Dn=c.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,i=si(Ln,r),s=ai[i.placedSide];return C.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:C.jsx(ri,{...o,ref:n,style:{...o.style,display:"block"}})})});Dn.displayName=Ln;function ci(e){return e!==null}var li=e=>({name:"transformOrigin",options:e,fn(t){var v,y,w;const{placement:n,rects:r,middlewareData:o}=t,s=((v=o.arrow)==null?void 0:v.centerOffset)!==0,a=s?0:e.arrowWidth,l=s?0:e.arrowHeight,[u,f]=_n(n),d={start:"0%",center:"50%",end:"100%"}[f],m=(((y=o.arrow)==null?void 0:y.x)??0)+a/2,h=(((w=o.arrow)==null?void 0:w.y)??0)+l/2;let g="",p="";return u==="bottom"?(g=s?d:`${m}px`,p=`${-l}px`):u==="top"?(g=s?d:`${m}px`,p=`${r.floating.height+l}px`):u==="right"?(g=`${-l}px`,p=s?d:`${h}px`):u==="left"&&(g=`${r.floating.width+l}px`,p=s?d:`${h}px`),{data:{x:g,y:p}}}});function _n(e){const[t,n="center"]=e.split("-");return[t,n]}var kn=On,Et=Nn,Fn=Mn,In=Dn,ui="Portal",Ct=c.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[o,i]=c.useState(!1);oe(()=>i(!0),[]);const s=n||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return s?Cr.createPortal(C.jsx(B.div,{...r,ref:t}),s):null});Ct.displayName=ui;var fi=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},se=new WeakMap,Se=new WeakMap,Oe={},Je=0,jn=function(e){return e&&(e.host||jn(e.parentNode))},di=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=jn(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},pi=function(e,t,n,r){var o=di(t,Array.isArray(e)?e:[e]);Oe[n]||(Oe[n]=new WeakMap);var i=Oe[n],s=[],a=new Set,l=new Set(o),u=function(d){!d||a.has(d)||(a.add(d),u(d.parentNode))};o.forEach(u);var f=function(d){!d||l.has(d)||Array.prototype.forEach.call(d.children,function(m){if(a.has(m))f(m);else try{var h=m.getAttribute(r),g=h!==null&&h!=="false",p=(se.get(m)||0)+1,v=(i.get(m)||0)+1;se.set(m,p),i.set(m,v),s.push(m),p===1&&g&&Se.set(m,!0),v===1&&m.setAttribute(n,"true"),g||m.setAttribute(r,"true")}catch(y){console.error("aria-hidden: cannot operate on ",m,y)}})};return f(t),a.clear(),Je++,function(){s.forEach(function(d){var m=se.get(d)-1,h=i.get(d)-1;se.set(d,m),i.set(d,h),m||(Se.has(d)||d.removeAttribute(r),Se.delete(d)),h||d.removeAttribute(n)}),Je--,Je||(se=new WeakMap,se=new WeakMap,Se=new WeakMap,Oe={})}},hi=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=fi(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),pi(r,o,n,"aria-hidden")):function(){return null}},z=function(){return z=Object.assign||function(t){for(var n,r=1,o=arguments.length;r"u")return Mi;var t=Li(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},_i=Hn(),ue="data-scroll-locked",ki=function(e,t,n,r){var o=e.left,i=e.top,s=e.right,a=e.gap;return n===void 0&&(n="margin"),` + .`.concat(vi,` { + overflow: hidden `).concat(r,`; + padding-right: `).concat(a,"px ").concat(r,`; + } + body[`).concat(ue,`] { + overflow: hidden `).concat(r,`; + overscroll-behavior: contain; + `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&` + padding-left: `.concat(o,`px; + padding-top: `).concat(i,`px; + padding-right: `).concat(s,`px; + margin-left:0; + margin-top:0; + margin-right: `).concat(a,"px ").concat(r,`; + `),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),` + } + + .`).concat(Le,` { + right: `).concat(a,"px ").concat(r,`; + } + + .`).concat(De,` { + margin-right: `).concat(a,"px ").concat(r,`; + } + + .`).concat(Le," .").concat(Le,` { + right: 0 `).concat(r,`; + } + + .`).concat(De," .").concat(De,` { + margin-right: 0 `).concat(r,`; + } + + body[`).concat(ue,`] { + `).concat(gi,": ").concat(a,`px; + } +`)},Qt=function(){var e=parseInt(document.body.getAttribute(ue)||"0",10);return isFinite(e)?e:0},Fi=function(){c.useEffect(function(){return document.body.setAttribute(ue,(Qt()+1).toString()),function(){var e=Qt()-1;e<=0?document.body.removeAttribute(ue):document.body.setAttribute(ue,e.toString())}},[])},Ii=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;Fi();var i=c.useMemo(function(){return Di(o)},[o]);return c.createElement(_i,{styles:ki(i,!t,o,n?"":"!important")})},ct=!1;if(typeof window<"u")try{var Te=Object.defineProperty({},"passive",{get:function(){return ct=!0,!0}});window.addEventListener("test",Te,Te),window.removeEventListener("test",Te,Te)}catch{ct=!1}var ae=ct?{passive:!1}:!1,ji=function(e){return e.tagName==="TEXTAREA"},Vn=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!ji(e)&&n[t]==="visible")},Wi=function(e){return Vn(e,"overflowY")},$i=function(e){return Vn(e,"overflowX")},Jt=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=Un(e,r);if(o){var i=zn(e,r),s=i[1],a=i[2];if(s>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Bi=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Hi=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Un=function(e,t){return e==="v"?Wi(t):$i(t)},zn=function(e,t){return e==="v"?Bi(t):Hi(t)},Vi=function(e,t){return e==="h"&&t==="rtl"?-1:1},Ui=function(e,t,n,r,o){var i=Vi(e,window.getComputedStyle(t).direction),s=i*r,a=n.target,l=t.contains(a),u=!1,f=s>0,d=0,m=0;do{var h=zn(e,a),g=h[0],p=h[1],v=h[2],y=p-v-i*g;(g||y)&&Un(e,a)&&(d+=y,m+=g),a instanceof ShadowRoot?a=a.host:a=a.parentNode}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(f&&Math.abs(d)<1||!f&&Math.abs(m)<1)&&(u=!0),u},Ne=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},en=function(e){return[e.deltaX,e.deltaY]},tn=function(e){return e&&"current"in e?e.current:e},zi=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Yi=function(e){return` + .block-interactivity-`.concat(e,` {pointer-events: none;} + .allow-interactivity-`).concat(e,` {pointer-events: all;} +`)},Xi=0,ce=[];function Ki(e){var t=c.useRef([]),n=c.useRef([0,0]),r=c.useRef(),o=c.useState(Xi++)[0],i=c.useState(Hn)[0],s=c.useRef(e);c.useEffect(function(){s.current=e},[e]),c.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var p=mi([e.lockRef.current],(e.shards||[]).map(tn),!0).filter(Boolean);return p.forEach(function(v){return v.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),p.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=c.useCallback(function(p,v){if("touches"in p&&p.touches.length===2||p.type==="wheel"&&p.ctrlKey)return!s.current.allowPinchZoom;var y=Ne(p),w=n.current,b="deltaX"in p?p.deltaX:w[0]-y[0],x="deltaY"in p?p.deltaY:w[1]-y[1],E,A=p.target,P=Math.abs(b)>Math.abs(x)?"h":"v";if("touches"in p&&P==="h"&&A.type==="range")return!1;var S=Jt(P,A);if(!S)return!0;if(S?E=P:(E=P==="v"?"h":"v",S=Jt(P,A)),!S)return!1;if(!r.current&&"changedTouches"in p&&(b||x)&&(r.current=E),!E)return!0;var N=r.current||E;return Ui(N,v,p,N==="h"?b:x)},[]),l=c.useCallback(function(p){var v=p;if(!(!ce.length||ce[ce.length-1]!==i)){var y="deltaY"in v?en(v):Ne(v),w=t.current.filter(function(E){return E.name===v.type&&(E.target===v.target||v.target===E.shadowParent)&&zi(E.delta,y)})[0];if(w&&w.should){v.cancelable&&v.preventDefault();return}if(!w){var b=(s.current.shards||[]).map(tn).filter(Boolean).filter(function(E){return E.contains(v.target)}),x=b.length>0?a(v,b[0]):!s.current.noIsolation;x&&v.cancelable&&v.preventDefault()}}},[]),u=c.useCallback(function(p,v,y,w){var b={name:p,delta:v,target:y,should:w,shadowParent:Gi(y)};t.current.push(b),setTimeout(function(){t.current=t.current.filter(function(x){return x!==b})},1)},[]),f=c.useCallback(function(p){n.current=Ne(p),r.current=void 0},[]),d=c.useCallback(function(p){u(p.type,en(p),p.target,a(p,e.lockRef.current))},[]),m=c.useCallback(function(p){u(p.type,Ne(p),p.target,a(p,e.lockRef.current))},[]);c.useEffect(function(){return ce.push(i),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:m}),document.addEventListener("wheel",l,ae),document.addEventListener("touchmove",l,ae),document.addEventListener("touchstart",f,ae),function(){ce=ce.filter(function(p){return p!==i}),document.removeEventListener("wheel",l,ae),document.removeEventListener("touchmove",l,ae),document.removeEventListener("touchstart",f,ae)}},[]);var h=e.removeScrollBar,g=e.inert;return c.createElement(c.Fragment,null,g?c.createElement(i,{styles:Yi(o)}):null,h?c.createElement(Ii,{gapMode:e.gapMode}):null)}function Gi(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const qi=Pi(Bn,Ki);var Yn=c.forwardRef(function(e,t){return c.createElement(Ue,z({},e,{ref:t,sideCar:qi}))});Yn.classNames=Ue.classNames;var Pt="Popover",[Xn,Os]=dt(Pt,[Ve]),be=Ve(),[Zi,re]=Xn(Pt),Kn=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:s=!1}=e,a=be(t),l=c.useRef(null),[u,f]=c.useState(!1),[d=!1,m]=cn({prop:r,defaultProp:o,onChange:i});return C.jsx(kn,{...a,children:C.jsx(Zi,{scope:t,contentId:hn(),triggerRef:l,open:d,onOpenChange:m,onOpenToggle:c.useCallback(()=>m(h=>!h),[m]),hasCustomAnchor:u,onCustomAnchorAdd:c.useCallback(()=>f(!0),[]),onCustomAnchorRemove:c.useCallback(()=>f(!1),[]),modal:s,children:n})})};Kn.displayName=Pt;var Gn="PopoverAnchor",Qi=c.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=re(Gn,n),i=be(n),{onCustomAnchorAdd:s,onCustomAnchorRemove:a}=o;return c.useEffect(()=>(s(),()=>a()),[s,a]),C.jsx(Et,{...i,...r,ref:t})});Qi.displayName=Gn;var qn="PopoverTrigger",Zn=c.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=re(qn,n),i=be(n),s=K(t,o.triggerRef),a=C.jsx(B.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":nr(o.open),...r,ref:s,onClick:I(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?a:C.jsx(Et,{asChild:!0,...i,children:a})});Zn.displayName=qn;var At="PopoverPortal",[Ji,es]=Xn(At,{forceMount:void 0}),Qn=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,i=re(At,t);return C.jsx(Ji,{scope:t,forceMount:n,children:C.jsx(we,{present:n||i.open,children:C.jsx(Ct,{asChild:!0,container:o,children:r})})})};Qn.displayName=At;var de="PopoverContent",Jn=c.forwardRef((e,t)=>{const n=es(de,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,i=re(de,e.__scopePopover);return C.jsx(we,{present:r||i.open,children:i.modal?C.jsx(ts,{...o,ref:t}):C.jsx(ns,{...o,ref:t})})});Jn.displayName=de;var ts=c.forwardRef((e,t)=>{const n=re(de,e.__scopePopover),r=c.useRef(null),o=K(t,r),i=c.useRef(!1);return c.useEffect(()=>{const s=r.current;if(s)return hi(s)},[]),C.jsx(Yn,{as:ft,allowPinchZoom:!0,children:C.jsx(er,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:I(e.onCloseAutoFocus,s=>{var a;s.preventDefault(),i.current||(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:I(e.onPointerDownOutside,s=>{const a=s.detail.originalEvent,l=a.button===0&&a.ctrlKey===!0,u=a.button===2||l;i.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:I(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})})}),ns=c.forwardRef((e,t)=>{const n=re(de,e.__scopePopover),r=c.useRef(!1),o=c.useRef(!1);return C.jsx(er,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var s,a;(s=e.onCloseAutoFocus)==null||s.call(e,i),i.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),i.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:i=>{var l,u;(l=e.onInteractOutside)==null||l.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const s=i.target;((u=n.triggerRef.current)==null?void 0:u.contains(s))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}})}),er=c.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:s,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:u,onInteractOutside:f,...d}=e,m=re(de,n),h=be(n);return Kr(),C.jsx(dn,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i,children:C.jsx(We,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:f,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:u,onDismiss:()=>m.onOpenChange(!1),children:C.jsx(Fn,{"data-state":nr(m.open),role:"dialog",id:m.contentId,...h,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),tr="PopoverClose",rs=c.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=re(tr,n);return C.jsx(B.button,{type:"button",...r,ref:t,onClick:I(e.onClick,()=>o.onOpenChange(!1))})});rs.displayName=tr;var os="PopoverArrow",is=c.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=be(n);return C.jsx(In,{...o,...r,ref:t})});is.displayName=os;function nr(e){return e?"open":"closed"}var Ts=Kn,Ns=Zn,Ms=Qn,Ls=Jn,ss="VisuallyHidden",rr=c.forwardRef((e,t)=>C.jsx(B.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));rr.displayName=ss;var as=rr,[ze,Ds]=dt("Tooltip",[Ve]),Ye=Ve(),or="TooltipProvider",cs=700,lt="tooltip.open",[ls,Rt]=ze(or),ir=e=>{const{__scopeTooltip:t,delayDuration:n=cs,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:i}=e,[s,a]=c.useState(!0),l=c.useRef(!1),u=c.useRef(0);return c.useEffect(()=>{const f=u.current;return()=>window.clearTimeout(f)},[]),C.jsx(ls,{scope:t,isOpenDelayed:s,delayDuration:n,onOpen:c.useCallback(()=>{window.clearTimeout(u.current),a(!1)},[]),onClose:c.useCallback(()=>{window.clearTimeout(u.current),u.current=window.setTimeout(()=>a(!0),r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:c.useCallback(f=>{l.current=f},[]),disableHoverableContent:o,children:i})};ir.displayName=or;var Xe="Tooltip",[us,Ee]=ze(Xe),sr=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o=!1,onOpenChange:i,disableHoverableContent:s,delayDuration:a}=e,l=Rt(Xe,e.__scopeTooltip),u=Ye(t),[f,d]=c.useState(null),m=hn(),h=c.useRef(0),g=s??l.disableHoverableContent,p=a??l.delayDuration,v=c.useRef(!1),[y=!1,w]=cn({prop:r,defaultProp:o,onChange:P=>{P?(l.onOpen(),document.dispatchEvent(new CustomEvent(lt))):l.onClose(),i==null||i(P)}}),b=c.useMemo(()=>y?v.current?"delayed-open":"instant-open":"closed",[y]),x=c.useCallback(()=>{window.clearTimeout(h.current),h.current=0,v.current=!1,w(!0)},[w]),E=c.useCallback(()=>{window.clearTimeout(h.current),h.current=0,w(!1)},[w]),A=c.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{v.current=!0,w(!0),h.current=0},p)},[p,w]);return c.useEffect(()=>()=>{h.current&&(window.clearTimeout(h.current),h.current=0)},[]),C.jsx(kn,{...u,children:C.jsx(us,{scope:t,contentId:m,open:y,stateAttribute:b,trigger:f,onTriggerChange:d,onTriggerEnter:c.useCallback(()=>{l.isOpenDelayed?A():x()},[l.isOpenDelayed,A,x]),onTriggerLeave:c.useCallback(()=>{g?E():(window.clearTimeout(h.current),h.current=0)},[E,g]),onOpen:x,onClose:E,disableHoverableContent:g,children:n})})};sr.displayName=Xe;var ut="TooltipTrigger",ar=c.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=Ee(ut,n),i=Rt(ut,n),s=Ye(n),a=c.useRef(null),l=K(t,a,o.onTriggerChange),u=c.useRef(!1),f=c.useRef(!1),d=c.useCallback(()=>u.current=!1,[]);return c.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),C.jsx(Et,{asChild:!0,...s,children:C.jsx(B.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:l,onPointerMove:I(e.onPointerMove,m=>{m.pointerType!=="touch"&&!f.current&&!i.isPointerInTransitRef.current&&(o.onTriggerEnter(),f.current=!0)}),onPointerLeave:I(e.onPointerLeave,()=>{o.onTriggerLeave(),f.current=!1}),onPointerDown:I(e.onPointerDown,()=>{u.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:I(e.onFocus,()=>{u.current||o.onOpen()}),onBlur:I(e.onBlur,o.onClose),onClick:I(e.onClick,o.onClose)})})});ar.displayName=ut;var St="TooltipPortal",[fs,ds]=ze(St,{forceMount:void 0}),cr=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:o}=e,i=Ee(St,t);return C.jsx(fs,{scope:t,forceMount:n,children:C.jsx(we,{present:n||i.open,children:C.jsx(Ct,{asChild:!0,container:o,children:r})})})};cr.displayName=St;var pe="TooltipContent",lr=c.forwardRef((e,t)=>{const n=ds(pe,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...i}=e,s=Ee(pe,e.__scopeTooltip);return C.jsx(we,{present:r||s.open,children:s.disableHoverableContent?C.jsx(ur,{side:o,...i,ref:t}):C.jsx(ps,{side:o,...i,ref:t})})}),ps=c.forwardRef((e,t)=>{const n=Ee(pe,e.__scopeTooltip),r=Rt(pe,e.__scopeTooltip),o=c.useRef(null),i=K(t,o),[s,a]=c.useState(null),{trigger:l,onClose:u}=n,f=o.current,{onPointerInTransitChange:d}=r,m=c.useCallback(()=>{a(null),d(!1)},[d]),h=c.useCallback((g,p)=>{const v=g.currentTarget,y={x:g.clientX,y:g.clientY},w=gs(y,v.getBoundingClientRect()),b=ys(y,w),x=ws(p.getBoundingClientRect()),E=bs([...b,...x]);a(E),d(!0)},[d]);return c.useEffect(()=>()=>m(),[m]),c.useEffect(()=>{if(l&&f){const g=v=>h(v,f),p=v=>h(v,l);return l.addEventListener("pointerleave",g),f.addEventListener("pointerleave",p),()=>{l.removeEventListener("pointerleave",g),f.removeEventListener("pointerleave",p)}}},[l,f,h,m]),c.useEffect(()=>{if(s){const g=p=>{const v=p.target,y={x:p.clientX,y:p.clientY},w=(l==null?void 0:l.contains(v))||(f==null?void 0:f.contains(v)),b=!xs(y,s);w?m():b&&(m(),u())};return document.addEventListener("pointermove",g),()=>document.removeEventListener("pointermove",g)}},[l,f,s,u,m]),C.jsx(ur,{...e,ref:i})}),[hs,ms]=ze(Xe,{isInside:!1}),ur=c.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:i,onPointerDownOutside:s,...a}=e,l=Ee(pe,n),u=Ye(n),{onClose:f}=l;return c.useEffect(()=>(document.addEventListener(lt,f),()=>document.removeEventListener(lt,f)),[f]),c.useEffect(()=>{if(l.trigger){const d=m=>{const h=m.target;h!=null&&h.contains(l.trigger)&&f()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[l.trigger,f]),C.jsx(We,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:d=>d.preventDefault(),onDismiss:f,children:C.jsxs(Fn,{"data-state":l.stateAttribute,...u,...a,ref:t,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[C.jsx(an,{children:r}),C.jsx(hs,{scope:n,isInside:!0,children:C.jsx(as,{id:l.contentId,role:"tooltip",children:o||r})})]})})});lr.displayName=pe;var fr="TooltipArrow",vs=c.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=Ye(n);return ms(fr,n).isInside?null:C.jsx(In,{...o,...r,ref:t})});vs.displayName=fr;function gs(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,o,i)){case i:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function ys(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function ws(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function xs(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,s=t.length-1;ir!=f>r&&n<(u-a)*(r-l)/(f-l)+a&&(o=!o)}return o}function bs(e){const t=e.slice();return t.sort((n,r)=>n.xr.x?1:n.yr.y?1:0),Es(t)}function Es(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r=2;){const i=t[t.length-1],s=t[t.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const i=n[n.length-1],s=n[n.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var _s=ir,ks=sr,Fs=ar,Is=cr,js=lr,Cs="Label",dr=c.forwardRef((e,t)=>C.jsx(B.label,{...e,ref:t,onMouseDown:n=>{var o;n.target.closest("button, input, select, textarea")||((o=e.onMouseDown)==null||o.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));dr.displayName=Cs;var Ws=dr;export{Et as A,Ms as B,Fn as C,We as D,Ls as E,dn as F,Ts as G,Is as H,js as I,_s as J,ks as K,Fs as L,Ws as M,Ss as N,Rs as O,B as P,Yn as R,ft as S,Ns as T,rr as V,cn as a,J as b,dt as c,I as d,hn as e,Ve as f,we as g,hi as h,Kr as i,C as j,In as k,sn as l,$r as m,Ct as n,kn as o,oe as p,kr as q,As as r,V as s,Xo as t,K as u,H as v,Wo as w,Qo as x,Go as y,ti as z}; diff --git a/pkg/ui/frontend/dist/assets/radix-inputs-D4_OLmm6.js b/pkg/ui/frontend/dist/assets/radix-inputs-CUuf_8as.js similarity index 99% rename from pkg/ui/frontend/dist/assets/radix-inputs-D4_OLmm6.js rename to pkg/ui/frontend/dist/assets/radix-inputs-CUuf_8as.js index 39b4651f1a911..3fc7cf35fac68 100644 --- a/pkg/ui/frontend/dist/assets/radix-inputs-D4_OLmm6.js +++ b/pkg/ui/frontend/dist/assets/radix-inputs-CUuf_8as.js @@ -1 +1 @@ -import{r as a,c as Le,b as V}from"./react-core-D_V7s-9r.js";import{c as fe,u as A,a as ee,j as d,P as _,d as E,g as kt,q as Ve,f as Be,A as Nt,p as q,h as Mt,i as jt,R as At,S as Ot,F as Dt,D as Lt,C as Vt,e as Ee,k as Bt,V as Ht,b as Gt,n as Ft,o as Wt}from"./radix-core-ByqQ8fsu.js";import{c as Kt,a as Oe,u as He,b as Ge,R as Ut,I as $t}from"./radix-navigation-DYoR-lWZ.js";function _e(t){const s=a.useRef({value:t,previous:t});return a.useMemo(()=>(s.current.value!==t&&(s.current.previous=s.current.value,s.current.value=t),s.current.previous),[t])}var ke="Checkbox",[zt,_o]=fe(ke),[qt,Xt]=zt(ke),Fe=a.forwardRef((t,s)=>{const{__scopeCheckbox:e,name:c,checked:r,defaultChecked:i,required:n,disabled:o,value:l="on",onCheckedChange:u,form:h,...v}=t,[S,y]=a.useState(null),w=A(s,b=>y(b)),p=a.useRef(!1),x=S?h||!!S.closest("form"):!0,[C=!1,f]=ee({prop:r,defaultProp:i,onChange:u}),m=a.useRef(C);return a.useEffect(()=>{const b=S==null?void 0:S.form;if(b){const k=()=>f(m.current);return b.addEventListener("reset",k),()=>b.removeEventListener("reset",k)}},[S,f]),d.jsxs(qt,{scope:e,state:C,disabled:o,children:[d.jsx(_.button,{type:"button",role:"checkbox","aria-checked":z(C)?"mixed":C,"aria-required":n,"data-state":Ue(C),"data-disabled":o?"":void 0,disabled:o,value:l,...v,ref:w,onKeyDown:E(t.onKeyDown,b=>{b.key==="Enter"&&b.preventDefault()}),onClick:E(t.onClick,b=>{f(k=>z(k)?!0:!k),x&&(p.current=b.isPropagationStopped(),p.current||b.stopPropagation())})}),x&&d.jsx(Yt,{control:S,bubbles:!p.current,name:c,value:l,checked:C,required:n,disabled:o,form:h,style:{transform:"translateX(-100%)"},defaultChecked:z(i)?!1:i})]})});Fe.displayName=ke;var We="CheckboxIndicator",Ke=a.forwardRef((t,s)=>{const{__scopeCheckbox:e,forceMount:c,...r}=t,i=Xt(We,e);return d.jsx(kt,{present:c||z(i.state)||i.state===!0,children:d.jsx(_.span,{"data-state":Ue(i.state),"data-disabled":i.disabled?"":void 0,...r,ref:s,style:{pointerEvents:"none",...t.style}})})});Ke.displayName=We;var Yt=t=>{const{control:s,checked:e,bubbles:c=!0,defaultChecked:r,...i}=t,n=a.useRef(null),o=_e(e),l=Ve(s);a.useEffect(()=>{const h=n.current,v=window.HTMLInputElement.prototype,y=Object.getOwnPropertyDescriptor(v,"checked").set;if(o!==e&&y){const w=new Event("click",{bubbles:c});h.indeterminate=z(e),y.call(h,z(e)?!1:e),h.dispatchEvent(w)}},[o,e,c]);const u=a.useRef(z(e)?!1:e);return d.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r??u.current,...i,tabIndex:-1,ref:n,style:{...t.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function z(t){return t==="indeterminate"}function Ue(t){return z(t)?"indeterminate":t?"checked":"unchecked"}var ko=Fe,No=Ke,Zt=[" ","Enter","ArrowUp","ArrowDown"],Jt=[" ","Enter"],le="Select",[he,me,Qt]=Kt(le),[ne,Mo]=fe(le,[Qt,Be]),ge=Be(),[eo,X]=ne(le),[to,oo]=ne(le),$e=t=>{const{__scopeSelect:s,children:e,open:c,defaultOpen:r,onOpenChange:i,value:n,defaultValue:o,onValueChange:l,dir:u,name:h,autoComplete:v,disabled:S,required:y,form:w}=t,p=ge(s),[x,C]=a.useState(null),[f,m]=a.useState(null),[b,k]=a.useState(!1),se=He(u),[N=!1,D]=ee({prop:c,defaultProp:r,onChange:i}),[K,Z]=ee({prop:n,defaultProp:o,onChange:l}),B=a.useRef(null),H=x?w||!!x.closest("form"):!0,[U,G]=a.useState(new Set),F=Array.from(U).map(M=>M.props.value).join(";");return d.jsx(Wt,{...p,children:d.jsxs(eo,{required:y,scope:s,trigger:x,onTriggerChange:C,valueNode:f,onValueNodeChange:m,valueNodeHasChildren:b,onValueNodeHasChildrenChange:k,contentId:Ee(),value:K,onValueChange:Z,open:N,onOpenChange:D,dir:se,triggerPointerDownPosRef:B,disabled:S,children:[d.jsx(he.Provider,{scope:s,children:d.jsx(to,{scope:t.__scopeSelect,onNativeOptionAdd:a.useCallback(M=>{G(L=>new Set(L).add(M))},[]),onNativeOptionRemove:a.useCallback(M=>{G(L=>{const W=new Set(L);return W.delete(M),W})},[]),children:e})}),H?d.jsxs(vt,{"aria-hidden":!0,required:y,tabIndex:-1,name:h,autoComplete:v,value:K,onChange:M=>Z(M.target.value),disabled:S,form:w,children:[K===void 0?d.jsx("option",{value:""}):null,Array.from(U)]},F):null]})})};$e.displayName=le;var ze="SelectTrigger",qe=a.forwardRef((t,s)=>{const{__scopeSelect:e,disabled:c=!1,...r}=t,i=ge(e),n=X(ze,e),o=n.disabled||c,l=A(s,n.onTriggerChange),u=me(e),h=a.useRef("touch"),[v,S,y]=xt(p=>{const x=u().filter(m=>!m.disabled),C=x.find(m=>m.value===n.value),f=St(x,p,C);f!==void 0&&n.onValueChange(f.value)}),w=p=>{o||(n.onOpenChange(!0),y()),p&&(n.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return d.jsx(Nt,{asChild:!0,...i,children:d.jsx(_.button,{type:"button",role:"combobox","aria-controls":n.contentId,"aria-expanded":n.open,"aria-required":n.required,"aria-autocomplete":"none",dir:n.dir,"data-state":n.open?"open":"closed",disabled:o,"data-disabled":o?"":void 0,"data-placeholder":gt(n.value)?"":void 0,...r,ref:l,onClick:E(r.onClick,p=>{p.currentTarget.focus(),h.current!=="mouse"&&w(p)}),onPointerDown:E(r.onPointerDown,p=>{h.current=p.pointerType;const x=p.target;x.hasPointerCapture(p.pointerId)&&x.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(w(p),p.preventDefault())}),onKeyDown:E(r.onKeyDown,p=>{const x=v.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&S(p.key),!(x&&p.key===" ")&&Zt.includes(p.key)&&(w(),p.preventDefault())})})})});qe.displayName=ze;var Xe="SelectValue",Ye=a.forwardRef((t,s)=>{const{__scopeSelect:e,className:c,style:r,children:i,placeholder:n="",...o}=t,l=X(Xe,e),{onValueNodeHasChildrenChange:u}=l,h=i!==void 0,v=A(s,l.onValueNodeChange);return q(()=>{u(h)},[u,h]),d.jsx(_.span,{...o,ref:v,style:{pointerEvents:"none"},children:gt(l.value)?d.jsx(d.Fragment,{children:n}):i})});Ye.displayName=Xe;var no="SelectIcon",Ze=a.forwardRef((t,s)=>{const{__scopeSelect:e,children:c,...r}=t;return d.jsx(_.span,{"aria-hidden":!0,...r,ref:s,children:c||"▼"})});Ze.displayName=no;var ro="SelectPortal",Je=t=>d.jsx(Ft,{asChild:!0,...t});Je.displayName=ro;var te="SelectContent",Qe=a.forwardRef((t,s)=>{const e=X(te,t.__scopeSelect),[c,r]=a.useState();if(q(()=>{r(new DocumentFragment)},[]),!e.open){const i=c;return i?Le.createPortal(d.jsx(et,{scope:t.__scopeSelect,children:d.jsx(he.Slot,{scope:t.__scopeSelect,children:d.jsx("div",{children:t.children})})}),i):null}return d.jsx(tt,{...t,ref:s})});Qe.displayName=te;var O=10,[et,Y]=ne(te),so="SelectContentImpl",tt=a.forwardRef((t,s)=>{const{__scopeSelect:e,position:c="item-aligned",onCloseAutoFocus:r,onEscapeKeyDown:i,onPointerDownOutside:n,side:o,sideOffset:l,align:u,alignOffset:h,arrowPadding:v,collisionBoundary:S,collisionPadding:y,sticky:w,hideWhenDetached:p,avoidCollisions:x,...C}=t,f=X(te,e),[m,b]=a.useState(null),[k,se]=a.useState(null),N=A(s,g=>b(g)),[D,K]=a.useState(null),[Z,B]=a.useState(null),H=me(e),[U,G]=a.useState(!1),F=a.useRef(!1);a.useEffect(()=>{if(m)return Mt(m)},[m]),jt();const M=a.useCallback(g=>{const[R,...j]=H().map(T=>T.ref.current),[I]=j.slice(-1),P=document.activeElement;for(const T of g)if(T===P||(T==null||T.scrollIntoView({block:"nearest"}),T===R&&k&&(k.scrollTop=0),T===I&&k&&(k.scrollTop=k.scrollHeight),T==null||T.focus(),document.activeElement!==P))return},[H,k]),L=a.useCallback(()=>M([D,m]),[M,D,m]);a.useEffect(()=>{U&&L()},[U,L]);const{onOpenChange:W,triggerPointerDownPosRef:$}=f;a.useEffect(()=>{if(m){let g={x:0,y:0};const R=I=>{var P,T;g={x:Math.abs(Math.round(I.pageX)-(((P=$.current)==null?void 0:P.x)??0)),y:Math.abs(Math.round(I.pageY)-(((T=$.current)==null?void 0:T.y)??0))}},j=I=>{g.x<=10&&g.y<=10?I.preventDefault():m.contains(I.target)||W(!1),document.removeEventListener("pointermove",R),$.current=null};return $.current!==null&&(document.addEventListener("pointermove",R),document.addEventListener("pointerup",j,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",R),document.removeEventListener("pointerup",j,{capture:!0})}}},[m,W,$]),a.useEffect(()=>{const g=()=>W(!1);return window.addEventListener("blur",g),window.addEventListener("resize",g),()=>{window.removeEventListener("blur",g),window.removeEventListener("resize",g)}},[W]);const[ve,ie]=xt(g=>{const R=H().filter(P=>!P.disabled),j=R.find(P=>P.ref.current===document.activeElement),I=St(R,g,j);I&&setTimeout(()=>I.ref.current.focus())}),xe=a.useCallback((g,R,j)=>{const I=!F.current&&!j;(f.value!==void 0&&f.value===R||I)&&(K(g),I&&(F.current=!0))},[f.value]),Se=a.useCallback(()=>m==null?void 0:m.focus(),[m]),oe=a.useCallback((g,R,j)=>{const I=!F.current&&!j;(f.value!==void 0&&f.value===R||I)&&B(g)},[f.value]),de=c==="popper"?be:ot,ae=de===be?{side:o,sideOffset:l,align:u,alignOffset:h,arrowPadding:v,collisionBoundary:S,collisionPadding:y,sticky:w,hideWhenDetached:p,avoidCollisions:x}:{};return d.jsx(et,{scope:e,content:m,viewport:k,onViewportChange:se,itemRefCallback:xe,selectedItem:D,onItemLeave:Se,itemTextRefCallback:oe,focusSelectedItem:L,selectedItemText:Z,position:c,isPositioned:U,searchRef:ve,children:d.jsx(At,{as:Ot,allowPinchZoom:!0,children:d.jsx(Dt,{asChild:!0,trapped:f.open,onMountAutoFocus:g=>{g.preventDefault()},onUnmountAutoFocus:E(r,g=>{var R;(R=f.trigger)==null||R.focus({preventScroll:!0}),g.preventDefault()}),children:d.jsx(Lt,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:n,onFocusOutside:g=>g.preventDefault(),onDismiss:()=>f.onOpenChange(!1),children:d.jsx(de,{role:"listbox",id:f.contentId,"data-state":f.open?"open":"closed",dir:f.dir,onContextMenu:g=>g.preventDefault(),...C,...ae,onPlaced:()=>G(!0),ref:N,style:{display:"flex",flexDirection:"column",outline:"none",...C.style},onKeyDown:E(C.onKeyDown,g=>{const R=g.ctrlKey||g.altKey||g.metaKey;if(g.key==="Tab"&&g.preventDefault(),!R&&g.key.length===1&&ie(g.key),["ArrowUp","ArrowDown","Home","End"].includes(g.key)){let I=H().filter(P=>!P.disabled).map(P=>P.ref.current);if(["ArrowUp","End"].includes(g.key)&&(I=I.slice().reverse()),["ArrowUp","ArrowDown"].includes(g.key)){const P=g.target,T=I.indexOf(P);I=I.slice(T+1)}setTimeout(()=>M(I)),g.preventDefault()}})})})})})})});tt.displayName=so;var ao="SelectItemAlignedPosition",ot=a.forwardRef((t,s)=>{const{__scopeSelect:e,onPlaced:c,...r}=t,i=X(te,e),n=Y(te,e),[o,l]=a.useState(null),[u,h]=a.useState(null),v=A(s,N=>h(N)),S=me(e),y=a.useRef(!1),w=a.useRef(!0),{viewport:p,selectedItem:x,selectedItemText:C,focusSelectedItem:f}=n,m=a.useCallback(()=>{if(i.trigger&&i.valueNode&&o&&u&&p&&x&&C){const N=i.trigger.getBoundingClientRect(),D=u.getBoundingClientRect(),K=i.valueNode.getBoundingClientRect(),Z=C.getBoundingClientRect();if(i.dir!=="rtl"){const P=Z.left-D.left,T=K.left-P,J=N.left-T,Q=N.width+J,Ce=Math.max(Q,D.width),we=window.innerWidth-O,ye=Oe(T,[O,Math.max(O,we-Ce)]);o.style.minWidth=Q+"px",o.style.left=ye+"px"}else{const P=D.right-Z.right,T=window.innerWidth-K.right-P,J=window.innerWidth-N.right-T,Q=N.width+J,Ce=Math.max(Q,D.width),we=window.innerWidth-O,ye=Oe(T,[O,Math.max(O,we-Ce)]);o.style.minWidth=Q+"px",o.style.right=ye+"px"}const B=S(),H=window.innerHeight-O*2,U=p.scrollHeight,G=window.getComputedStyle(u),F=parseInt(G.borderTopWidth,10),M=parseInt(G.paddingTop,10),L=parseInt(G.borderBottomWidth,10),W=parseInt(G.paddingBottom,10),$=F+M+U+W+L,ve=Math.min(x.offsetHeight*5,$),ie=window.getComputedStyle(p),xe=parseInt(ie.paddingTop,10),Se=parseInt(ie.paddingBottom,10),oe=N.top+N.height/2-O,de=H-oe,ae=x.offsetHeight/2,g=x.offsetTop+ae,R=F+M+g,j=$-R;if(R<=oe){const P=B.length>0&&x===B[B.length-1].ref.current;o.style.bottom="0px";const T=u.clientHeight-p.offsetTop-p.offsetHeight,J=Math.max(de,ae+(P?Se:0)+T+L),Q=R+J;o.style.height=Q+"px"}else{const P=B.length>0&&x===B[0].ref.current;o.style.top="0px";const J=Math.max(oe,F+p.offsetTop+(P?xe:0)+ae)+j;o.style.height=J+"px",p.scrollTop=R-oe+p.offsetTop}o.style.margin=`${O}px 0`,o.style.minHeight=ve+"px",o.style.maxHeight=H+"px",c==null||c(),requestAnimationFrame(()=>y.current=!0)}},[S,i.trigger,i.valueNode,o,u,p,x,C,i.dir,c]);q(()=>m(),[m]);const[b,k]=a.useState();q(()=>{u&&k(window.getComputedStyle(u).zIndex)},[u]);const se=a.useCallback(N=>{N&&w.current===!0&&(m(),f==null||f(),w.current=!1)},[m,f]);return d.jsx(lo,{scope:e,contentWrapper:o,shouldExpandOnScrollRef:y,onScrollButtonChange:se,children:d.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:b},children:d.jsx(_.div,{...r,ref:v,style:{boxSizing:"border-box",maxHeight:"100%",...r.style}})})})});ot.displayName=ao;var co="SelectPopperPosition",be=a.forwardRef((t,s)=>{const{__scopeSelect:e,align:c="start",collisionPadding:r=O,...i}=t,n=ge(e);return d.jsx(Vt,{...n,...i,ref:s,align:c,collisionPadding:r,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});be.displayName=co;var[lo,Ne]=ne(te,{}),Pe="SelectViewport",nt=a.forwardRef((t,s)=>{const{__scopeSelect:e,nonce:c,...r}=t,i=Y(Pe,e),n=Ne(Pe,e),o=A(s,i.onViewportChange),l=a.useRef(0);return d.jsxs(d.Fragment,{children:[d.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:c}),d.jsx(he.Slot,{scope:e,children:d.jsx(_.div,{"data-radix-select-viewport":"",role:"presentation",...r,ref:o,style:{position:"relative",flex:1,overflow:"hidden auto",...r.style},onScroll:E(r.onScroll,u=>{const h=u.currentTarget,{contentWrapper:v,shouldExpandOnScrollRef:S}=n;if(S!=null&&S.current&&v){const y=Math.abs(l.current-h.scrollTop);if(y>0){const w=window.innerHeight-O*2,p=parseFloat(v.style.minHeight),x=parseFloat(v.style.height),C=Math.max(p,x);if(C0?b:0,v.style.justifyContent="flex-end")}}}l.current=h.scrollTop})})})]})});nt.displayName=Pe;var rt="SelectGroup",[io,uo]=ne(rt),po=a.forwardRef((t,s)=>{const{__scopeSelect:e,...c}=t,r=Ee();return d.jsx(io,{scope:e,id:r,children:d.jsx(_.div,{role:"group","aria-labelledby":r,...c,ref:s})})});po.displayName=rt;var st="SelectLabel",at=a.forwardRef((t,s)=>{const{__scopeSelect:e,...c}=t,r=uo(st,e);return d.jsx(_.div,{id:r.id,...c,ref:s})});at.displayName=st;var ue="SelectItem",[fo,ct]=ne(ue),lt=a.forwardRef((t,s)=>{const{__scopeSelect:e,value:c,disabled:r=!1,textValue:i,...n}=t,o=X(ue,e),l=Y(ue,e),u=o.value===c,[h,v]=a.useState(i??""),[S,y]=a.useState(!1),w=A(s,f=>{var m;return(m=l.itemRefCallback)==null?void 0:m.call(l,f,c,r)}),p=Ee(),x=a.useRef("touch"),C=()=>{r||(o.onValueChange(c),o.onOpenChange(!1))};if(c==="")throw new Error("A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return d.jsx(fo,{scope:e,value:c,disabled:r,textId:p,isSelected:u,onItemTextChange:a.useCallback(f=>{v(m=>m||((f==null?void 0:f.textContent)??"").trim())},[]),children:d.jsx(he.ItemSlot,{scope:e,value:c,disabled:r,textValue:h,children:d.jsx(_.div,{role:"option","aria-labelledby":p,"data-highlighted":S?"":void 0,"aria-selected":u&&S,"data-state":u?"checked":"unchecked","aria-disabled":r||void 0,"data-disabled":r?"":void 0,tabIndex:r?void 0:-1,...n,ref:w,onFocus:E(n.onFocus,()=>y(!0)),onBlur:E(n.onBlur,()=>y(!1)),onClick:E(n.onClick,()=>{x.current!=="mouse"&&C()}),onPointerUp:E(n.onPointerUp,()=>{x.current==="mouse"&&C()}),onPointerDown:E(n.onPointerDown,f=>{x.current=f.pointerType}),onPointerMove:E(n.onPointerMove,f=>{var m;x.current=f.pointerType,r?(m=l.onItemLeave)==null||m.call(l):x.current==="mouse"&&f.currentTarget.focus({preventScroll:!0})}),onPointerLeave:E(n.onPointerLeave,f=>{var m;f.currentTarget===document.activeElement&&((m=l.onItemLeave)==null||m.call(l))}),onKeyDown:E(n.onKeyDown,f=>{var b;((b=l.searchRef)==null?void 0:b.current)!==""&&f.key===" "||(Jt.includes(f.key)&&C(),f.key===" "&&f.preventDefault())})})})})});lt.displayName=ue;var ce="SelectItemText",it=a.forwardRef((t,s)=>{const{__scopeSelect:e,className:c,style:r,...i}=t,n=X(ce,e),o=Y(ce,e),l=ct(ce,e),u=oo(ce,e),[h,v]=a.useState(null),S=A(s,C=>v(C),l.onItemTextChange,C=>{var f;return(f=o.itemTextRefCallback)==null?void 0:f.call(o,C,l.value,l.disabled)}),y=h==null?void 0:h.textContent,w=a.useMemo(()=>d.jsx("option",{value:l.value,disabled:l.disabled,children:y},l.value),[l.disabled,l.value,y]),{onNativeOptionAdd:p,onNativeOptionRemove:x}=u;return q(()=>(p(w),()=>x(w)),[p,x,w]),d.jsxs(d.Fragment,{children:[d.jsx(_.span,{id:l.textId,...i,ref:S}),l.isSelected&&n.valueNode&&!n.valueNodeHasChildren?Le.createPortal(i.children,n.valueNode):null]})});it.displayName=ce;var dt="SelectItemIndicator",ut=a.forwardRef((t,s)=>{const{__scopeSelect:e,...c}=t;return ct(dt,e).isSelected?d.jsx(_.span,{"aria-hidden":!0,...c,ref:s}):null});ut.displayName=dt;var Te="SelectScrollUpButton",pt=a.forwardRef((t,s)=>{const e=Y(Te,t.__scopeSelect),c=Ne(Te,t.__scopeSelect),[r,i]=a.useState(!1),n=A(s,c.onScrollButtonChange);return q(()=>{if(e.viewport&&e.isPositioned){let o=function(){const u=l.scrollTop>0;i(u)};const l=e.viewport;return o(),l.addEventListener("scroll",o),()=>l.removeEventListener("scroll",o)}},[e.viewport,e.isPositioned]),r?d.jsx(ht,{...t,ref:n,onAutoScroll:()=>{const{viewport:o,selectedItem:l}=e;o&&l&&(o.scrollTop=o.scrollTop-l.offsetHeight)}}):null});pt.displayName=Te;var Ie="SelectScrollDownButton",ft=a.forwardRef((t,s)=>{const e=Y(Ie,t.__scopeSelect),c=Ne(Ie,t.__scopeSelect),[r,i]=a.useState(!1),n=A(s,c.onScrollButtonChange);return q(()=>{if(e.viewport&&e.isPositioned){let o=function(){const u=l.scrollHeight-l.clientHeight,h=Math.ceil(l.scrollTop)l.removeEventListener("scroll",o)}},[e.viewport,e.isPositioned]),r?d.jsx(ht,{...t,ref:n,onAutoScroll:()=>{const{viewport:o,selectedItem:l}=e;o&&l&&(o.scrollTop=o.scrollTop+l.offsetHeight)}}):null});ft.displayName=Ie;var ht=a.forwardRef((t,s)=>{const{__scopeSelect:e,onAutoScroll:c,...r}=t,i=Y("SelectScrollButton",e),n=a.useRef(null),o=me(e),l=a.useCallback(()=>{n.current!==null&&(window.clearInterval(n.current),n.current=null)},[]);return a.useEffect(()=>()=>l(),[l]),q(()=>{var h;const u=o().find(v=>v.ref.current===document.activeElement);(h=u==null?void 0:u.ref.current)==null||h.scrollIntoView({block:"nearest"})},[o]),d.jsx(_.div,{"aria-hidden":!0,...r,ref:s,style:{flexShrink:0,...r.style},onPointerDown:E(r.onPointerDown,()=>{n.current===null&&(n.current=window.setInterval(c,50))}),onPointerMove:E(r.onPointerMove,()=>{var u;(u=i.onItemLeave)==null||u.call(i),n.current===null&&(n.current=window.setInterval(c,50))}),onPointerLeave:E(r.onPointerLeave,()=>{l()})})}),ho="SelectSeparator",mt=a.forwardRef((t,s)=>{const{__scopeSelect:e,...c}=t;return d.jsx(_.div,{"aria-hidden":!0,...c,ref:s})});mt.displayName=ho;var Re="SelectArrow",mo=a.forwardRef((t,s)=>{const{__scopeSelect:e,...c}=t,r=ge(e),i=X(Re,e),n=Y(Re,e);return i.open&&n.position==="popper"?d.jsx(Bt,{...r,...c,ref:s}):null});mo.displayName=Re;function gt(t){return t===""||t===void 0}var vt=a.forwardRef((t,s)=>{const{value:e,...c}=t,r=a.useRef(null),i=A(s,r),n=_e(e);return a.useEffect(()=>{const o=r.current,l=window.HTMLSelectElement.prototype,h=Object.getOwnPropertyDescriptor(l,"value").set;if(n!==e&&h){const v=new Event("change",{bubbles:!0});h.call(o,e),o.dispatchEvent(v)}},[n,e]),d.jsx(Ht,{asChild:!0,children:d.jsx("select",{...c,ref:i,defaultValue:e})})});vt.displayName="BubbleSelect";function xt(t){const s=Gt(t),e=a.useRef(""),c=a.useRef(0),r=a.useCallback(n=>{const o=e.current+n;s(o),function l(u){e.current=u,window.clearTimeout(c.current),u!==""&&(c.current=window.setTimeout(()=>l(""),1e3))}(o)},[s]),i=a.useCallback(()=>{e.current="",window.clearTimeout(c.current)},[]);return a.useEffect(()=>()=>window.clearTimeout(c.current),[]),[e,r,i]}function St(t,s,e){const r=s.length>1&&Array.from(s).every(u=>u===s[0])?s[0]:s,i=e?t.indexOf(e):-1;let n=go(t,Math.max(i,0));r.length===1&&(n=n.filter(u=>u!==e));const l=n.find(u=>u.textValue.toLowerCase().startsWith(r.toLowerCase()));return l!==e?l:void 0}function go(t,s){return t.map((e,c)=>t[(s+c)%t.length])}var jo=$e,Ao=qe,Oo=Ye,Do=Ze,Lo=Je,Vo=Qe,Bo=nt,Ho=at,Go=lt,Fo=it,Wo=ut,Ko=pt,Uo=ft,$o=mt,Me="Switch",[vo,zo]=fe(Me),[xo,So]=vo(Me),Ct=a.forwardRef((t,s)=>{const{__scopeSwitch:e,name:c,checked:r,defaultChecked:i,required:n,disabled:o,value:l="on",onCheckedChange:u,form:h,...v}=t,[S,y]=a.useState(null),w=A(s,m=>y(m)),p=a.useRef(!1),x=S?h||!!S.closest("form"):!0,[C=!1,f]=ee({prop:r,defaultProp:i,onChange:u});return d.jsxs(xo,{scope:e,checked:C,disabled:o,children:[d.jsx(_.button,{type:"button",role:"switch","aria-checked":C,"aria-required":n,"data-state":bt(C),"data-disabled":o?"":void 0,disabled:o,value:l,...v,ref:w,onClick:E(t.onClick,m=>{f(b=>!b),x&&(p.current=m.isPropagationStopped(),p.current||m.stopPropagation())})}),x&&d.jsx(Co,{control:S,bubbles:!p.current,name:c,value:l,checked:C,required:n,disabled:o,form:h,style:{transform:"translateX(-100%)"}})]})});Ct.displayName=Me;var wt="SwitchThumb",yt=a.forwardRef((t,s)=>{const{__scopeSwitch:e,...c}=t,r=So(wt,e);return d.jsx(_.span,{"data-state":bt(r.checked),"data-disabled":r.disabled?"":void 0,...c,ref:s})});yt.displayName=wt;var Co=t=>{const{control:s,checked:e,bubbles:c=!0,...r}=t,i=a.useRef(null),n=_e(e),o=Ve(s);return a.useEffect(()=>{const l=i.current,u=window.HTMLInputElement.prototype,v=Object.getOwnPropertyDescriptor(u,"checked").set;if(n!==e&&v){const S=new Event("click",{bubbles:c});v.call(l,e),l.dispatchEvent(S)}},[n,e,c]),d.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:e,...r,tabIndex:-1,ref:i,style:{...t.style,...o,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function bt(t){return t?"checked":"unchecked"}var qo=Ct,Xo=yt,wo="Toggle",je=a.forwardRef((t,s)=>{const{pressed:e,defaultPressed:c=!1,onPressedChange:r,...i}=t,[n=!1,o]=ee({prop:e,onChange:r,defaultProp:c});return d.jsx(_.button,{type:"button","aria-pressed":n,"data-state":n?"on":"off","data-disabled":t.disabled?"":void 0,...i,ref:s,onClick:E(t.onClick,()=>{t.disabled||o(!n)})})});je.displayName=wo;var Yo=je,re="ToggleGroup",[Pt,Zo]=fe(re,[Ge]),Tt=Ge(),Ae=V.forwardRef((t,s)=>{const{type:e,...c}=t;if(e==="single"){const r=c;return d.jsx(yo,{...r,ref:s})}if(e==="multiple"){const r=c;return d.jsx(bo,{...r,ref:s})}throw new Error(`Missing prop \`type\` expected on \`${re}\``)});Ae.displayName=re;var[It,Rt]=Pt(re),yo=V.forwardRef((t,s)=>{const{value:e,defaultValue:c,onValueChange:r=()=>{},...i}=t,[n,o]=ee({prop:e,defaultProp:c,onChange:r});return d.jsx(It,{scope:t.__scopeToggleGroup,type:"single",value:n?[n]:[],onItemActivate:o,onItemDeactivate:V.useCallback(()=>o(""),[o]),children:d.jsx(Et,{...i,ref:s})})}),bo=V.forwardRef((t,s)=>{const{value:e,defaultValue:c,onValueChange:r=()=>{},...i}=t,[n=[],o]=ee({prop:e,defaultProp:c,onChange:r}),l=V.useCallback(h=>o((v=[])=>[...v,h]),[o]),u=V.useCallback(h=>o((v=[])=>v.filter(S=>S!==h)),[o]);return d.jsx(It,{scope:t.__scopeToggleGroup,type:"multiple",value:n,onItemActivate:l,onItemDeactivate:u,children:d.jsx(Et,{...i,ref:s})})});Ae.displayName=re;var[Po,To]=Pt(re),Et=V.forwardRef((t,s)=>{const{__scopeToggleGroup:e,disabled:c=!1,rovingFocus:r=!0,orientation:i,dir:n,loop:o=!0,...l}=t,u=Tt(e),h=He(n),v={role:"group",dir:h,...l};return d.jsx(Po,{scope:e,rovingFocus:r,disabled:c,children:r?d.jsx(Ut,{asChild:!0,...u,orientation:i,dir:h,loop:o,children:d.jsx(_.div,{...v,ref:s})}):d.jsx(_.div,{...v,ref:s})})}),pe="ToggleGroupItem",_t=V.forwardRef((t,s)=>{const e=Rt(pe,t.__scopeToggleGroup),c=To(pe,t.__scopeToggleGroup),r=Tt(t.__scopeToggleGroup),i=e.value.includes(t.value),n=c.disabled||t.disabled,o={...t,pressed:i,disabled:n},l=V.useRef(null);return c.rovingFocus?d.jsx($t,{asChild:!0,...r,focusable:!n,active:i,ref:l,children:d.jsx(De,{...o,ref:s})}):d.jsx(De,{...o,ref:s})});_t.displayName=pe;var De=V.forwardRef((t,s)=>{const{__scopeToggleGroup:e,value:c,...r}=t,i=Rt(pe,e),n={role:"radio","aria-checked":t.pressed,"aria-pressed":void 0},o=i.type==="single"?n:void 0;return d.jsx(je,{...o,...r,ref:s,onPressedChange:l=>{l?i.onItemActivate(c):i.onItemDeactivate(c)}})}),Jo=Ae,Qo=_t;export{Vo as C,No as I,Ho as L,Lo as P,ko as R,Ko as S,Ao as T,Bo as V,Do as a,Uo as b,Go as c,Wo as d,Fo as e,$o as f,jo as g,Oo as h,qo as i,Xo as j,Yo as k,Jo as l,Qo as m}; +import{r as a,c as Le,b as V}from"./react-core-D_V7s-9r.js";import{c as fe,u as A,a as ee,j as d,P as _,d as E,g as kt,q as Ve,f as Be,A as Nt,p as q,h as Mt,i as jt,R as At,S as Ot,F as Dt,D as Lt,C as Vt,e as Ee,k as Bt,V as Ht,b as Gt,n as Ft,o as Wt}from"./radix-core-mDeFS0Pz.js";import{c as Kt,a as Oe,u as He,b as Ge,R as Ut,I as $t}from"./radix-navigation-WDVJ59Wc.js";function _e(t){const s=a.useRef({value:t,previous:t});return a.useMemo(()=>(s.current.value!==t&&(s.current.previous=s.current.value,s.current.value=t),s.current.previous),[t])}var ke="Checkbox",[zt,_o]=fe(ke),[qt,Xt]=zt(ke),Fe=a.forwardRef((t,s)=>{const{__scopeCheckbox:e,name:c,checked:r,defaultChecked:i,required:n,disabled:o,value:l="on",onCheckedChange:u,form:h,...v}=t,[S,y]=a.useState(null),w=A(s,b=>y(b)),p=a.useRef(!1),x=S?h||!!S.closest("form"):!0,[C=!1,f]=ee({prop:r,defaultProp:i,onChange:u}),m=a.useRef(C);return a.useEffect(()=>{const b=S==null?void 0:S.form;if(b){const k=()=>f(m.current);return b.addEventListener("reset",k),()=>b.removeEventListener("reset",k)}},[S,f]),d.jsxs(qt,{scope:e,state:C,disabled:o,children:[d.jsx(_.button,{type:"button",role:"checkbox","aria-checked":z(C)?"mixed":C,"aria-required":n,"data-state":Ue(C),"data-disabled":o?"":void 0,disabled:o,value:l,...v,ref:w,onKeyDown:E(t.onKeyDown,b=>{b.key==="Enter"&&b.preventDefault()}),onClick:E(t.onClick,b=>{f(k=>z(k)?!0:!k),x&&(p.current=b.isPropagationStopped(),p.current||b.stopPropagation())})}),x&&d.jsx(Yt,{control:S,bubbles:!p.current,name:c,value:l,checked:C,required:n,disabled:o,form:h,style:{transform:"translateX(-100%)"},defaultChecked:z(i)?!1:i})]})});Fe.displayName=ke;var We="CheckboxIndicator",Ke=a.forwardRef((t,s)=>{const{__scopeCheckbox:e,forceMount:c,...r}=t,i=Xt(We,e);return d.jsx(kt,{present:c||z(i.state)||i.state===!0,children:d.jsx(_.span,{"data-state":Ue(i.state),"data-disabled":i.disabled?"":void 0,...r,ref:s,style:{pointerEvents:"none",...t.style}})})});Ke.displayName=We;var Yt=t=>{const{control:s,checked:e,bubbles:c=!0,defaultChecked:r,...i}=t,n=a.useRef(null),o=_e(e),l=Ve(s);a.useEffect(()=>{const h=n.current,v=window.HTMLInputElement.prototype,y=Object.getOwnPropertyDescriptor(v,"checked").set;if(o!==e&&y){const w=new Event("click",{bubbles:c});h.indeterminate=z(e),y.call(h,z(e)?!1:e),h.dispatchEvent(w)}},[o,e,c]);const u=a.useRef(z(e)?!1:e);return d.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r??u.current,...i,tabIndex:-1,ref:n,style:{...t.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function z(t){return t==="indeterminate"}function Ue(t){return z(t)?"indeterminate":t?"checked":"unchecked"}var ko=Fe,No=Ke,Zt=[" ","Enter","ArrowUp","ArrowDown"],Jt=[" ","Enter"],le="Select",[he,me,Qt]=Kt(le),[ne,Mo]=fe(le,[Qt,Be]),ge=Be(),[eo,X]=ne(le),[to,oo]=ne(le),$e=t=>{const{__scopeSelect:s,children:e,open:c,defaultOpen:r,onOpenChange:i,value:n,defaultValue:o,onValueChange:l,dir:u,name:h,autoComplete:v,disabled:S,required:y,form:w}=t,p=ge(s),[x,C]=a.useState(null),[f,m]=a.useState(null),[b,k]=a.useState(!1),se=He(u),[N=!1,D]=ee({prop:c,defaultProp:r,onChange:i}),[K,Z]=ee({prop:n,defaultProp:o,onChange:l}),B=a.useRef(null),H=x?w||!!x.closest("form"):!0,[U,G]=a.useState(new Set),F=Array.from(U).map(M=>M.props.value).join(";");return d.jsx(Wt,{...p,children:d.jsxs(eo,{required:y,scope:s,trigger:x,onTriggerChange:C,valueNode:f,onValueNodeChange:m,valueNodeHasChildren:b,onValueNodeHasChildrenChange:k,contentId:Ee(),value:K,onValueChange:Z,open:N,onOpenChange:D,dir:se,triggerPointerDownPosRef:B,disabled:S,children:[d.jsx(he.Provider,{scope:s,children:d.jsx(to,{scope:t.__scopeSelect,onNativeOptionAdd:a.useCallback(M=>{G(L=>new Set(L).add(M))},[]),onNativeOptionRemove:a.useCallback(M=>{G(L=>{const W=new Set(L);return W.delete(M),W})},[]),children:e})}),H?d.jsxs(vt,{"aria-hidden":!0,required:y,tabIndex:-1,name:h,autoComplete:v,value:K,onChange:M=>Z(M.target.value),disabled:S,form:w,children:[K===void 0?d.jsx("option",{value:""}):null,Array.from(U)]},F):null]})})};$e.displayName=le;var ze="SelectTrigger",qe=a.forwardRef((t,s)=>{const{__scopeSelect:e,disabled:c=!1,...r}=t,i=ge(e),n=X(ze,e),o=n.disabled||c,l=A(s,n.onTriggerChange),u=me(e),h=a.useRef("touch"),[v,S,y]=xt(p=>{const x=u().filter(m=>!m.disabled),C=x.find(m=>m.value===n.value),f=St(x,p,C);f!==void 0&&n.onValueChange(f.value)}),w=p=>{o||(n.onOpenChange(!0),y()),p&&(n.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return d.jsx(Nt,{asChild:!0,...i,children:d.jsx(_.button,{type:"button",role:"combobox","aria-controls":n.contentId,"aria-expanded":n.open,"aria-required":n.required,"aria-autocomplete":"none",dir:n.dir,"data-state":n.open?"open":"closed",disabled:o,"data-disabled":o?"":void 0,"data-placeholder":gt(n.value)?"":void 0,...r,ref:l,onClick:E(r.onClick,p=>{p.currentTarget.focus(),h.current!=="mouse"&&w(p)}),onPointerDown:E(r.onPointerDown,p=>{h.current=p.pointerType;const x=p.target;x.hasPointerCapture(p.pointerId)&&x.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(w(p),p.preventDefault())}),onKeyDown:E(r.onKeyDown,p=>{const x=v.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&S(p.key),!(x&&p.key===" ")&&Zt.includes(p.key)&&(w(),p.preventDefault())})})})});qe.displayName=ze;var Xe="SelectValue",Ye=a.forwardRef((t,s)=>{const{__scopeSelect:e,className:c,style:r,children:i,placeholder:n="",...o}=t,l=X(Xe,e),{onValueNodeHasChildrenChange:u}=l,h=i!==void 0,v=A(s,l.onValueNodeChange);return q(()=>{u(h)},[u,h]),d.jsx(_.span,{...o,ref:v,style:{pointerEvents:"none"},children:gt(l.value)?d.jsx(d.Fragment,{children:n}):i})});Ye.displayName=Xe;var no="SelectIcon",Ze=a.forwardRef((t,s)=>{const{__scopeSelect:e,children:c,...r}=t;return d.jsx(_.span,{"aria-hidden":!0,...r,ref:s,children:c||"▼"})});Ze.displayName=no;var ro="SelectPortal",Je=t=>d.jsx(Ft,{asChild:!0,...t});Je.displayName=ro;var te="SelectContent",Qe=a.forwardRef((t,s)=>{const e=X(te,t.__scopeSelect),[c,r]=a.useState();if(q(()=>{r(new DocumentFragment)},[]),!e.open){const i=c;return i?Le.createPortal(d.jsx(et,{scope:t.__scopeSelect,children:d.jsx(he.Slot,{scope:t.__scopeSelect,children:d.jsx("div",{children:t.children})})}),i):null}return d.jsx(tt,{...t,ref:s})});Qe.displayName=te;var O=10,[et,Y]=ne(te),so="SelectContentImpl",tt=a.forwardRef((t,s)=>{const{__scopeSelect:e,position:c="item-aligned",onCloseAutoFocus:r,onEscapeKeyDown:i,onPointerDownOutside:n,side:o,sideOffset:l,align:u,alignOffset:h,arrowPadding:v,collisionBoundary:S,collisionPadding:y,sticky:w,hideWhenDetached:p,avoidCollisions:x,...C}=t,f=X(te,e),[m,b]=a.useState(null),[k,se]=a.useState(null),N=A(s,g=>b(g)),[D,K]=a.useState(null),[Z,B]=a.useState(null),H=me(e),[U,G]=a.useState(!1),F=a.useRef(!1);a.useEffect(()=>{if(m)return Mt(m)},[m]),jt();const M=a.useCallback(g=>{const[R,...j]=H().map(T=>T.ref.current),[I]=j.slice(-1),P=document.activeElement;for(const T of g)if(T===P||(T==null||T.scrollIntoView({block:"nearest"}),T===R&&k&&(k.scrollTop=0),T===I&&k&&(k.scrollTop=k.scrollHeight),T==null||T.focus(),document.activeElement!==P))return},[H,k]),L=a.useCallback(()=>M([D,m]),[M,D,m]);a.useEffect(()=>{U&&L()},[U,L]);const{onOpenChange:W,triggerPointerDownPosRef:$}=f;a.useEffect(()=>{if(m){let g={x:0,y:0};const R=I=>{var P,T;g={x:Math.abs(Math.round(I.pageX)-(((P=$.current)==null?void 0:P.x)??0)),y:Math.abs(Math.round(I.pageY)-(((T=$.current)==null?void 0:T.y)??0))}},j=I=>{g.x<=10&&g.y<=10?I.preventDefault():m.contains(I.target)||W(!1),document.removeEventListener("pointermove",R),$.current=null};return $.current!==null&&(document.addEventListener("pointermove",R),document.addEventListener("pointerup",j,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",R),document.removeEventListener("pointerup",j,{capture:!0})}}},[m,W,$]),a.useEffect(()=>{const g=()=>W(!1);return window.addEventListener("blur",g),window.addEventListener("resize",g),()=>{window.removeEventListener("blur",g),window.removeEventListener("resize",g)}},[W]);const[ve,ie]=xt(g=>{const R=H().filter(P=>!P.disabled),j=R.find(P=>P.ref.current===document.activeElement),I=St(R,g,j);I&&setTimeout(()=>I.ref.current.focus())}),xe=a.useCallback((g,R,j)=>{const I=!F.current&&!j;(f.value!==void 0&&f.value===R||I)&&(K(g),I&&(F.current=!0))},[f.value]),Se=a.useCallback(()=>m==null?void 0:m.focus(),[m]),oe=a.useCallback((g,R,j)=>{const I=!F.current&&!j;(f.value!==void 0&&f.value===R||I)&&B(g)},[f.value]),de=c==="popper"?be:ot,ae=de===be?{side:o,sideOffset:l,align:u,alignOffset:h,arrowPadding:v,collisionBoundary:S,collisionPadding:y,sticky:w,hideWhenDetached:p,avoidCollisions:x}:{};return d.jsx(et,{scope:e,content:m,viewport:k,onViewportChange:se,itemRefCallback:xe,selectedItem:D,onItemLeave:Se,itemTextRefCallback:oe,focusSelectedItem:L,selectedItemText:Z,position:c,isPositioned:U,searchRef:ve,children:d.jsx(At,{as:Ot,allowPinchZoom:!0,children:d.jsx(Dt,{asChild:!0,trapped:f.open,onMountAutoFocus:g=>{g.preventDefault()},onUnmountAutoFocus:E(r,g=>{var R;(R=f.trigger)==null||R.focus({preventScroll:!0}),g.preventDefault()}),children:d.jsx(Lt,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:n,onFocusOutside:g=>g.preventDefault(),onDismiss:()=>f.onOpenChange(!1),children:d.jsx(de,{role:"listbox",id:f.contentId,"data-state":f.open?"open":"closed",dir:f.dir,onContextMenu:g=>g.preventDefault(),...C,...ae,onPlaced:()=>G(!0),ref:N,style:{display:"flex",flexDirection:"column",outline:"none",...C.style},onKeyDown:E(C.onKeyDown,g=>{const R=g.ctrlKey||g.altKey||g.metaKey;if(g.key==="Tab"&&g.preventDefault(),!R&&g.key.length===1&&ie(g.key),["ArrowUp","ArrowDown","Home","End"].includes(g.key)){let I=H().filter(P=>!P.disabled).map(P=>P.ref.current);if(["ArrowUp","End"].includes(g.key)&&(I=I.slice().reverse()),["ArrowUp","ArrowDown"].includes(g.key)){const P=g.target,T=I.indexOf(P);I=I.slice(T+1)}setTimeout(()=>M(I)),g.preventDefault()}})})})})})})});tt.displayName=so;var ao="SelectItemAlignedPosition",ot=a.forwardRef((t,s)=>{const{__scopeSelect:e,onPlaced:c,...r}=t,i=X(te,e),n=Y(te,e),[o,l]=a.useState(null),[u,h]=a.useState(null),v=A(s,N=>h(N)),S=me(e),y=a.useRef(!1),w=a.useRef(!0),{viewport:p,selectedItem:x,selectedItemText:C,focusSelectedItem:f}=n,m=a.useCallback(()=>{if(i.trigger&&i.valueNode&&o&&u&&p&&x&&C){const N=i.trigger.getBoundingClientRect(),D=u.getBoundingClientRect(),K=i.valueNode.getBoundingClientRect(),Z=C.getBoundingClientRect();if(i.dir!=="rtl"){const P=Z.left-D.left,T=K.left-P,J=N.left-T,Q=N.width+J,Ce=Math.max(Q,D.width),we=window.innerWidth-O,ye=Oe(T,[O,Math.max(O,we-Ce)]);o.style.minWidth=Q+"px",o.style.left=ye+"px"}else{const P=D.right-Z.right,T=window.innerWidth-K.right-P,J=window.innerWidth-N.right-T,Q=N.width+J,Ce=Math.max(Q,D.width),we=window.innerWidth-O,ye=Oe(T,[O,Math.max(O,we-Ce)]);o.style.minWidth=Q+"px",o.style.right=ye+"px"}const B=S(),H=window.innerHeight-O*2,U=p.scrollHeight,G=window.getComputedStyle(u),F=parseInt(G.borderTopWidth,10),M=parseInt(G.paddingTop,10),L=parseInt(G.borderBottomWidth,10),W=parseInt(G.paddingBottom,10),$=F+M+U+W+L,ve=Math.min(x.offsetHeight*5,$),ie=window.getComputedStyle(p),xe=parseInt(ie.paddingTop,10),Se=parseInt(ie.paddingBottom,10),oe=N.top+N.height/2-O,de=H-oe,ae=x.offsetHeight/2,g=x.offsetTop+ae,R=F+M+g,j=$-R;if(R<=oe){const P=B.length>0&&x===B[B.length-1].ref.current;o.style.bottom="0px";const T=u.clientHeight-p.offsetTop-p.offsetHeight,J=Math.max(de,ae+(P?Se:0)+T+L),Q=R+J;o.style.height=Q+"px"}else{const P=B.length>0&&x===B[0].ref.current;o.style.top="0px";const J=Math.max(oe,F+p.offsetTop+(P?xe:0)+ae)+j;o.style.height=J+"px",p.scrollTop=R-oe+p.offsetTop}o.style.margin=`${O}px 0`,o.style.minHeight=ve+"px",o.style.maxHeight=H+"px",c==null||c(),requestAnimationFrame(()=>y.current=!0)}},[S,i.trigger,i.valueNode,o,u,p,x,C,i.dir,c]);q(()=>m(),[m]);const[b,k]=a.useState();q(()=>{u&&k(window.getComputedStyle(u).zIndex)},[u]);const se=a.useCallback(N=>{N&&w.current===!0&&(m(),f==null||f(),w.current=!1)},[m,f]);return d.jsx(lo,{scope:e,contentWrapper:o,shouldExpandOnScrollRef:y,onScrollButtonChange:se,children:d.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:b},children:d.jsx(_.div,{...r,ref:v,style:{boxSizing:"border-box",maxHeight:"100%",...r.style}})})})});ot.displayName=ao;var co="SelectPopperPosition",be=a.forwardRef((t,s)=>{const{__scopeSelect:e,align:c="start",collisionPadding:r=O,...i}=t,n=ge(e);return d.jsx(Vt,{...n,...i,ref:s,align:c,collisionPadding:r,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});be.displayName=co;var[lo,Ne]=ne(te,{}),Pe="SelectViewport",nt=a.forwardRef((t,s)=>{const{__scopeSelect:e,nonce:c,...r}=t,i=Y(Pe,e),n=Ne(Pe,e),o=A(s,i.onViewportChange),l=a.useRef(0);return d.jsxs(d.Fragment,{children:[d.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:c}),d.jsx(he.Slot,{scope:e,children:d.jsx(_.div,{"data-radix-select-viewport":"",role:"presentation",...r,ref:o,style:{position:"relative",flex:1,overflow:"hidden auto",...r.style},onScroll:E(r.onScroll,u=>{const h=u.currentTarget,{contentWrapper:v,shouldExpandOnScrollRef:S}=n;if(S!=null&&S.current&&v){const y=Math.abs(l.current-h.scrollTop);if(y>0){const w=window.innerHeight-O*2,p=parseFloat(v.style.minHeight),x=parseFloat(v.style.height),C=Math.max(p,x);if(C0?b:0,v.style.justifyContent="flex-end")}}}l.current=h.scrollTop})})})]})});nt.displayName=Pe;var rt="SelectGroup",[io,uo]=ne(rt),po=a.forwardRef((t,s)=>{const{__scopeSelect:e,...c}=t,r=Ee();return d.jsx(io,{scope:e,id:r,children:d.jsx(_.div,{role:"group","aria-labelledby":r,...c,ref:s})})});po.displayName=rt;var st="SelectLabel",at=a.forwardRef((t,s)=>{const{__scopeSelect:e,...c}=t,r=uo(st,e);return d.jsx(_.div,{id:r.id,...c,ref:s})});at.displayName=st;var ue="SelectItem",[fo,ct]=ne(ue),lt=a.forwardRef((t,s)=>{const{__scopeSelect:e,value:c,disabled:r=!1,textValue:i,...n}=t,o=X(ue,e),l=Y(ue,e),u=o.value===c,[h,v]=a.useState(i??""),[S,y]=a.useState(!1),w=A(s,f=>{var m;return(m=l.itemRefCallback)==null?void 0:m.call(l,f,c,r)}),p=Ee(),x=a.useRef("touch"),C=()=>{r||(o.onValueChange(c),o.onOpenChange(!1))};if(c==="")throw new Error("A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return d.jsx(fo,{scope:e,value:c,disabled:r,textId:p,isSelected:u,onItemTextChange:a.useCallback(f=>{v(m=>m||((f==null?void 0:f.textContent)??"").trim())},[]),children:d.jsx(he.ItemSlot,{scope:e,value:c,disabled:r,textValue:h,children:d.jsx(_.div,{role:"option","aria-labelledby":p,"data-highlighted":S?"":void 0,"aria-selected":u&&S,"data-state":u?"checked":"unchecked","aria-disabled":r||void 0,"data-disabled":r?"":void 0,tabIndex:r?void 0:-1,...n,ref:w,onFocus:E(n.onFocus,()=>y(!0)),onBlur:E(n.onBlur,()=>y(!1)),onClick:E(n.onClick,()=>{x.current!=="mouse"&&C()}),onPointerUp:E(n.onPointerUp,()=>{x.current==="mouse"&&C()}),onPointerDown:E(n.onPointerDown,f=>{x.current=f.pointerType}),onPointerMove:E(n.onPointerMove,f=>{var m;x.current=f.pointerType,r?(m=l.onItemLeave)==null||m.call(l):x.current==="mouse"&&f.currentTarget.focus({preventScroll:!0})}),onPointerLeave:E(n.onPointerLeave,f=>{var m;f.currentTarget===document.activeElement&&((m=l.onItemLeave)==null||m.call(l))}),onKeyDown:E(n.onKeyDown,f=>{var b;((b=l.searchRef)==null?void 0:b.current)!==""&&f.key===" "||(Jt.includes(f.key)&&C(),f.key===" "&&f.preventDefault())})})})})});lt.displayName=ue;var ce="SelectItemText",it=a.forwardRef((t,s)=>{const{__scopeSelect:e,className:c,style:r,...i}=t,n=X(ce,e),o=Y(ce,e),l=ct(ce,e),u=oo(ce,e),[h,v]=a.useState(null),S=A(s,C=>v(C),l.onItemTextChange,C=>{var f;return(f=o.itemTextRefCallback)==null?void 0:f.call(o,C,l.value,l.disabled)}),y=h==null?void 0:h.textContent,w=a.useMemo(()=>d.jsx("option",{value:l.value,disabled:l.disabled,children:y},l.value),[l.disabled,l.value,y]),{onNativeOptionAdd:p,onNativeOptionRemove:x}=u;return q(()=>(p(w),()=>x(w)),[p,x,w]),d.jsxs(d.Fragment,{children:[d.jsx(_.span,{id:l.textId,...i,ref:S}),l.isSelected&&n.valueNode&&!n.valueNodeHasChildren?Le.createPortal(i.children,n.valueNode):null]})});it.displayName=ce;var dt="SelectItemIndicator",ut=a.forwardRef((t,s)=>{const{__scopeSelect:e,...c}=t;return ct(dt,e).isSelected?d.jsx(_.span,{"aria-hidden":!0,...c,ref:s}):null});ut.displayName=dt;var Te="SelectScrollUpButton",pt=a.forwardRef((t,s)=>{const e=Y(Te,t.__scopeSelect),c=Ne(Te,t.__scopeSelect),[r,i]=a.useState(!1),n=A(s,c.onScrollButtonChange);return q(()=>{if(e.viewport&&e.isPositioned){let o=function(){const u=l.scrollTop>0;i(u)};const l=e.viewport;return o(),l.addEventListener("scroll",o),()=>l.removeEventListener("scroll",o)}},[e.viewport,e.isPositioned]),r?d.jsx(ht,{...t,ref:n,onAutoScroll:()=>{const{viewport:o,selectedItem:l}=e;o&&l&&(o.scrollTop=o.scrollTop-l.offsetHeight)}}):null});pt.displayName=Te;var Ie="SelectScrollDownButton",ft=a.forwardRef((t,s)=>{const e=Y(Ie,t.__scopeSelect),c=Ne(Ie,t.__scopeSelect),[r,i]=a.useState(!1),n=A(s,c.onScrollButtonChange);return q(()=>{if(e.viewport&&e.isPositioned){let o=function(){const u=l.scrollHeight-l.clientHeight,h=Math.ceil(l.scrollTop)l.removeEventListener("scroll",o)}},[e.viewport,e.isPositioned]),r?d.jsx(ht,{...t,ref:n,onAutoScroll:()=>{const{viewport:o,selectedItem:l}=e;o&&l&&(o.scrollTop=o.scrollTop+l.offsetHeight)}}):null});ft.displayName=Ie;var ht=a.forwardRef((t,s)=>{const{__scopeSelect:e,onAutoScroll:c,...r}=t,i=Y("SelectScrollButton",e),n=a.useRef(null),o=me(e),l=a.useCallback(()=>{n.current!==null&&(window.clearInterval(n.current),n.current=null)},[]);return a.useEffect(()=>()=>l(),[l]),q(()=>{var h;const u=o().find(v=>v.ref.current===document.activeElement);(h=u==null?void 0:u.ref.current)==null||h.scrollIntoView({block:"nearest"})},[o]),d.jsx(_.div,{"aria-hidden":!0,...r,ref:s,style:{flexShrink:0,...r.style},onPointerDown:E(r.onPointerDown,()=>{n.current===null&&(n.current=window.setInterval(c,50))}),onPointerMove:E(r.onPointerMove,()=>{var u;(u=i.onItemLeave)==null||u.call(i),n.current===null&&(n.current=window.setInterval(c,50))}),onPointerLeave:E(r.onPointerLeave,()=>{l()})})}),ho="SelectSeparator",mt=a.forwardRef((t,s)=>{const{__scopeSelect:e,...c}=t;return d.jsx(_.div,{"aria-hidden":!0,...c,ref:s})});mt.displayName=ho;var Re="SelectArrow",mo=a.forwardRef((t,s)=>{const{__scopeSelect:e,...c}=t,r=ge(e),i=X(Re,e),n=Y(Re,e);return i.open&&n.position==="popper"?d.jsx(Bt,{...r,...c,ref:s}):null});mo.displayName=Re;function gt(t){return t===""||t===void 0}var vt=a.forwardRef((t,s)=>{const{value:e,...c}=t,r=a.useRef(null),i=A(s,r),n=_e(e);return a.useEffect(()=>{const o=r.current,l=window.HTMLSelectElement.prototype,h=Object.getOwnPropertyDescriptor(l,"value").set;if(n!==e&&h){const v=new Event("change",{bubbles:!0});h.call(o,e),o.dispatchEvent(v)}},[n,e]),d.jsx(Ht,{asChild:!0,children:d.jsx("select",{...c,ref:i,defaultValue:e})})});vt.displayName="BubbleSelect";function xt(t){const s=Gt(t),e=a.useRef(""),c=a.useRef(0),r=a.useCallback(n=>{const o=e.current+n;s(o),function l(u){e.current=u,window.clearTimeout(c.current),u!==""&&(c.current=window.setTimeout(()=>l(""),1e3))}(o)},[s]),i=a.useCallback(()=>{e.current="",window.clearTimeout(c.current)},[]);return a.useEffect(()=>()=>window.clearTimeout(c.current),[]),[e,r,i]}function St(t,s,e){const r=s.length>1&&Array.from(s).every(u=>u===s[0])?s[0]:s,i=e?t.indexOf(e):-1;let n=go(t,Math.max(i,0));r.length===1&&(n=n.filter(u=>u!==e));const l=n.find(u=>u.textValue.toLowerCase().startsWith(r.toLowerCase()));return l!==e?l:void 0}function go(t,s){return t.map((e,c)=>t[(s+c)%t.length])}var jo=$e,Ao=qe,Oo=Ye,Do=Ze,Lo=Je,Vo=Qe,Bo=nt,Ho=at,Go=lt,Fo=it,Wo=ut,Ko=pt,Uo=ft,$o=mt,Me="Switch",[vo,zo]=fe(Me),[xo,So]=vo(Me),Ct=a.forwardRef((t,s)=>{const{__scopeSwitch:e,name:c,checked:r,defaultChecked:i,required:n,disabled:o,value:l="on",onCheckedChange:u,form:h,...v}=t,[S,y]=a.useState(null),w=A(s,m=>y(m)),p=a.useRef(!1),x=S?h||!!S.closest("form"):!0,[C=!1,f]=ee({prop:r,defaultProp:i,onChange:u});return d.jsxs(xo,{scope:e,checked:C,disabled:o,children:[d.jsx(_.button,{type:"button",role:"switch","aria-checked":C,"aria-required":n,"data-state":bt(C),"data-disabled":o?"":void 0,disabled:o,value:l,...v,ref:w,onClick:E(t.onClick,m=>{f(b=>!b),x&&(p.current=m.isPropagationStopped(),p.current||m.stopPropagation())})}),x&&d.jsx(Co,{control:S,bubbles:!p.current,name:c,value:l,checked:C,required:n,disabled:o,form:h,style:{transform:"translateX(-100%)"}})]})});Ct.displayName=Me;var wt="SwitchThumb",yt=a.forwardRef((t,s)=>{const{__scopeSwitch:e,...c}=t,r=So(wt,e);return d.jsx(_.span,{"data-state":bt(r.checked),"data-disabled":r.disabled?"":void 0,...c,ref:s})});yt.displayName=wt;var Co=t=>{const{control:s,checked:e,bubbles:c=!0,...r}=t,i=a.useRef(null),n=_e(e),o=Ve(s);return a.useEffect(()=>{const l=i.current,u=window.HTMLInputElement.prototype,v=Object.getOwnPropertyDescriptor(u,"checked").set;if(n!==e&&v){const S=new Event("click",{bubbles:c});v.call(l,e),l.dispatchEvent(S)}},[n,e,c]),d.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:e,...r,tabIndex:-1,ref:i,style:{...t.style,...o,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function bt(t){return t?"checked":"unchecked"}var qo=Ct,Xo=yt,wo="Toggle",je=a.forwardRef((t,s)=>{const{pressed:e,defaultPressed:c=!1,onPressedChange:r,...i}=t,[n=!1,o]=ee({prop:e,onChange:r,defaultProp:c});return d.jsx(_.button,{type:"button","aria-pressed":n,"data-state":n?"on":"off","data-disabled":t.disabled?"":void 0,...i,ref:s,onClick:E(t.onClick,()=>{t.disabled||o(!n)})})});je.displayName=wo;var Yo=je,re="ToggleGroup",[Pt,Zo]=fe(re,[Ge]),Tt=Ge(),Ae=V.forwardRef((t,s)=>{const{type:e,...c}=t;if(e==="single"){const r=c;return d.jsx(yo,{...r,ref:s})}if(e==="multiple"){const r=c;return d.jsx(bo,{...r,ref:s})}throw new Error(`Missing prop \`type\` expected on \`${re}\``)});Ae.displayName=re;var[It,Rt]=Pt(re),yo=V.forwardRef((t,s)=>{const{value:e,defaultValue:c,onValueChange:r=()=>{},...i}=t,[n,o]=ee({prop:e,defaultProp:c,onChange:r});return d.jsx(It,{scope:t.__scopeToggleGroup,type:"single",value:n?[n]:[],onItemActivate:o,onItemDeactivate:V.useCallback(()=>o(""),[o]),children:d.jsx(Et,{...i,ref:s})})}),bo=V.forwardRef((t,s)=>{const{value:e,defaultValue:c,onValueChange:r=()=>{},...i}=t,[n=[],o]=ee({prop:e,defaultProp:c,onChange:r}),l=V.useCallback(h=>o((v=[])=>[...v,h]),[o]),u=V.useCallback(h=>o((v=[])=>v.filter(S=>S!==h)),[o]);return d.jsx(It,{scope:t.__scopeToggleGroup,type:"multiple",value:n,onItemActivate:l,onItemDeactivate:u,children:d.jsx(Et,{...i,ref:s})})});Ae.displayName=re;var[Po,To]=Pt(re),Et=V.forwardRef((t,s)=>{const{__scopeToggleGroup:e,disabled:c=!1,rovingFocus:r=!0,orientation:i,dir:n,loop:o=!0,...l}=t,u=Tt(e),h=He(n),v={role:"group",dir:h,...l};return d.jsx(Po,{scope:e,rovingFocus:r,disabled:c,children:r?d.jsx(Ut,{asChild:!0,...u,orientation:i,dir:h,loop:o,children:d.jsx(_.div,{...v,ref:s})}):d.jsx(_.div,{...v,ref:s})})}),pe="ToggleGroupItem",_t=V.forwardRef((t,s)=>{const e=Rt(pe,t.__scopeToggleGroup),c=To(pe,t.__scopeToggleGroup),r=Tt(t.__scopeToggleGroup),i=e.value.includes(t.value),n=c.disabled||t.disabled,o={...t,pressed:i,disabled:n},l=V.useRef(null);return c.rovingFocus?d.jsx($t,{asChild:!0,...r,focusable:!n,active:i,ref:l,children:d.jsx(De,{...o,ref:s})}):d.jsx(De,{...o,ref:s})});_t.displayName=pe;var De=V.forwardRef((t,s)=>{const{__scopeToggleGroup:e,value:c,...r}=t,i=Rt(pe,e),n={role:"radio","aria-checked":t.pressed,"aria-pressed":void 0},o=i.type==="single"?n:void 0;return d.jsx(je,{...o,...r,ref:s,onPressedChange:l=>{l?i.onItemActivate(c):i.onItemDeactivate(c)}})}),Jo=Ae,Qo=_t;export{Vo as C,No as I,Ho as L,Lo as P,ko as R,Ko as S,Ao as T,Bo as V,Do as a,Uo as b,Go as c,Wo as d,Fo as e,$o as f,jo as g,Oo as h,qo as i,Xo as j,Yo as k,Jo as l,Qo as m}; diff --git a/pkg/ui/frontend/dist/assets/radix-layout-BqTpm3s4.js b/pkg/ui/frontend/dist/assets/radix-layout-CuQMCqor.js similarity index 99% rename from pkg/ui/frontend/dist/assets/radix-layout-BqTpm3s4.js rename to pkg/ui/frontend/dist/assets/radix-layout-CuQMCqor.js index a9e1f24a60ada..8199b294712f4 100644 --- a/pkg/ui/frontend/dist/assets/radix-layout-BqTpm3s4.js +++ b/pkg/ui/frontend/dist/assets/radix-layout-CuQMCqor.js @@ -1,4 +1,4 @@ -import{r as s}from"./react-core-D_V7s-9r.js";import{c as I,u as _,j as i,P as R,d as g,g as N,R as Re,S as xe,h as me,i as De,F as Pe,D as q,r as be,a as j,e as O,n as Ee,f as z,A as _e,C as Ne,k as Oe,o as ye,p as Te}from"./radix-core-ByqQ8fsu.js";var M="Dialog",[Y,ot]=I(M),[we,v]=Y(M),Z=e=>{const{__scopeDialog:o,children:r,open:a,defaultOpen:t,onOpenChange:n,modal:c=!0}=e,l=s.useRef(null),u=s.useRef(null),[f=!1,p]=j({prop:a,defaultProp:t,onChange:n});return i.jsx(we,{scope:o,triggerRef:l,contentRef:u,contentId:O(),titleId:O(),descriptionId:O(),open:f,onOpenChange:p,onOpenToggle:s.useCallback(()=>p(x=>!x),[p]),modal:c,children:r})};Z.displayName=M;var J="DialogTrigger",Se=s.forwardRef((e,o)=>{const{__scopeDialog:r,...a}=e,t=v(J,r),n=_(o,t.triggerRef);return i.jsx(R.button,{type:"button","aria-haspopup":"dialog","aria-expanded":t.open,"aria-controls":t.contentId,"data-state":L(t.open),...a,ref:n,onClick:g(e.onClick,t.onOpenToggle)})});Se.displayName=J;var F="DialogPortal",[Ae,Q]=Y(F,{forceMount:void 0}),X=e=>{const{__scopeDialog:o,forceMount:r,children:a,container:t}=e,n=v(F,o);return i.jsx(Ae,{scope:o,forceMount:r,children:s.Children.map(a,c=>i.jsx(N,{present:r||n.open,children:i.jsx(Ee,{asChild:!0,container:t,children:c})}))})};X.displayName=F;var y="DialogOverlay",ee=s.forwardRef((e,o)=>{const r=Q(y,e.__scopeDialog),{forceMount:a=r.forceMount,...t}=e,n=v(y,e.__scopeDialog);return n.modal?i.jsx(N,{present:a||n.open,children:i.jsx(Ie,{...t,ref:o})}):null});ee.displayName=y;var Ie=s.forwardRef((e,o)=>{const{__scopeDialog:r,...a}=e,t=v(y,r);return i.jsx(Re,{as:xe,allowPinchZoom:!0,shards:[t.contentRef],children:i.jsx(R.div,{"data-state":L(t.open),...a,ref:o,style:{pointerEvents:"auto",...a.style}})})}),b="DialogContent",te=s.forwardRef((e,o)=>{const r=Q(b,e.__scopeDialog),{forceMount:a=r.forceMount,...t}=e,n=v(b,e.__scopeDialog);return i.jsx(N,{present:a||n.open,children:n.modal?i.jsx(je,{...t,ref:o}):i.jsx(Me,{...t,ref:o})})});te.displayName=b;var je=s.forwardRef((e,o)=>{const r=v(b,e.__scopeDialog),a=s.useRef(null),t=_(o,r.contentRef,a);return s.useEffect(()=>{const n=a.current;if(n)return me(n)},[]),i.jsx(oe,{...e,ref:t,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:g(e.onCloseAutoFocus,n=>{var c;n.preventDefault(),(c=r.triggerRef.current)==null||c.focus()}),onPointerDownOutside:g(e.onPointerDownOutside,n=>{const c=n.detail.originalEvent,l=c.button===0&&c.ctrlKey===!0;(c.button===2||l)&&n.preventDefault()}),onFocusOutside:g(e.onFocusOutside,n=>n.preventDefault())})}),Me=s.forwardRef((e,o)=>{const r=v(b,e.__scopeDialog),a=s.useRef(!1),t=s.useRef(!1);return i.jsx(oe,{...e,ref:o,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:n=>{var c,l;(c=e.onCloseAutoFocus)==null||c.call(e,n),n.defaultPrevented||(a.current||(l=r.triggerRef.current)==null||l.focus(),n.preventDefault()),a.current=!1,t.current=!1},onInteractOutside:n=>{var u,f;(u=e.onInteractOutside)==null||u.call(e,n),n.defaultPrevented||(a.current=!0,n.detail.originalEvent.type==="pointerdown"&&(t.current=!0));const c=n.target;((f=r.triggerRef.current)==null?void 0:f.contains(c))&&n.preventDefault(),n.detail.originalEvent.type==="focusin"&&t.current&&n.preventDefault()}})}),oe=s.forwardRef((e,o)=>{const{__scopeDialog:r,trapFocus:a,onOpenAutoFocus:t,onCloseAutoFocus:n,...c}=e,l=v(b,r),u=s.useRef(null),f=_(o,u);return De(),i.jsxs(i.Fragment,{children:[i.jsx(Pe,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:t,onUnmountAutoFocus:n,children:i.jsx(q,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":L(l.open),...c,ref:f,onDismiss:()=>l.onOpenChange(!1)})}),i.jsxs(i.Fragment,{children:[i.jsx(Fe,{titleId:l.titleId}),i.jsx(Le,{contentRef:u,descriptionId:l.descriptionId})]})]})}),H="DialogTitle",ne=s.forwardRef((e,o)=>{const{__scopeDialog:r,...a}=e,t=v(H,r);return i.jsx(R.h2,{id:t.titleId,...a,ref:o})});ne.displayName=H;var re="DialogDescription",ae=s.forwardRef((e,o)=>{const{__scopeDialog:r,...a}=e,t=v(re,r);return i.jsx(R.p,{id:t.descriptionId,...a,ref:o})});ae.displayName=re;var se="DialogClose",ie=s.forwardRef((e,o)=>{const{__scopeDialog:r,...a}=e,t=v(se,r);return i.jsx(R.button,{type:"button",...a,ref:o,onClick:g(e.onClick,()=>t.onOpenChange(!1))})});ie.displayName=se;function L(e){return e?"open":"closed"}var ce="DialogTitleWarning",[nt,le]=be(ce,{contentName:b,titleName:H,docsSlug:"dialog"}),Fe=({titleId:e})=>{const o=le(ce),r=`\`${o.contentName}\` requires a \`${o.titleName}\` for the component to be accessible for screen reader users. +import{r as s}from"./react-core-D_V7s-9r.js";import{c as I,u as _,j as i,P as R,d as g,g as N,R as Re,S as xe,h as me,i as De,F as Pe,D as q,r as be,a as j,e as O,n as Ee,f as z,A as _e,C as Ne,k as Oe,o as ye,p as Te}from"./radix-core-mDeFS0Pz.js";var M="Dialog",[Y,ot]=I(M),[we,v]=Y(M),Z=e=>{const{__scopeDialog:o,children:r,open:a,defaultOpen:t,onOpenChange:n,modal:c=!0}=e,l=s.useRef(null),u=s.useRef(null),[f=!1,p]=j({prop:a,defaultProp:t,onChange:n});return i.jsx(we,{scope:o,triggerRef:l,contentRef:u,contentId:O(),titleId:O(),descriptionId:O(),open:f,onOpenChange:p,onOpenToggle:s.useCallback(()=>p(x=>!x),[p]),modal:c,children:r})};Z.displayName=M;var J="DialogTrigger",Se=s.forwardRef((e,o)=>{const{__scopeDialog:r,...a}=e,t=v(J,r),n=_(o,t.triggerRef);return i.jsx(R.button,{type:"button","aria-haspopup":"dialog","aria-expanded":t.open,"aria-controls":t.contentId,"data-state":L(t.open),...a,ref:n,onClick:g(e.onClick,t.onOpenToggle)})});Se.displayName=J;var F="DialogPortal",[Ae,Q]=Y(F,{forceMount:void 0}),X=e=>{const{__scopeDialog:o,forceMount:r,children:a,container:t}=e,n=v(F,o);return i.jsx(Ae,{scope:o,forceMount:r,children:s.Children.map(a,c=>i.jsx(N,{present:r||n.open,children:i.jsx(Ee,{asChild:!0,container:t,children:c})}))})};X.displayName=F;var y="DialogOverlay",ee=s.forwardRef((e,o)=>{const r=Q(y,e.__scopeDialog),{forceMount:a=r.forceMount,...t}=e,n=v(y,e.__scopeDialog);return n.modal?i.jsx(N,{present:a||n.open,children:i.jsx(Ie,{...t,ref:o})}):null});ee.displayName=y;var Ie=s.forwardRef((e,o)=>{const{__scopeDialog:r,...a}=e,t=v(y,r);return i.jsx(Re,{as:xe,allowPinchZoom:!0,shards:[t.contentRef],children:i.jsx(R.div,{"data-state":L(t.open),...a,ref:o,style:{pointerEvents:"auto",...a.style}})})}),b="DialogContent",te=s.forwardRef((e,o)=>{const r=Q(b,e.__scopeDialog),{forceMount:a=r.forceMount,...t}=e,n=v(b,e.__scopeDialog);return i.jsx(N,{present:a||n.open,children:n.modal?i.jsx(je,{...t,ref:o}):i.jsx(Me,{...t,ref:o})})});te.displayName=b;var je=s.forwardRef((e,o)=>{const r=v(b,e.__scopeDialog),a=s.useRef(null),t=_(o,r.contentRef,a);return s.useEffect(()=>{const n=a.current;if(n)return me(n)},[]),i.jsx(oe,{...e,ref:t,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:g(e.onCloseAutoFocus,n=>{var c;n.preventDefault(),(c=r.triggerRef.current)==null||c.focus()}),onPointerDownOutside:g(e.onPointerDownOutside,n=>{const c=n.detail.originalEvent,l=c.button===0&&c.ctrlKey===!0;(c.button===2||l)&&n.preventDefault()}),onFocusOutside:g(e.onFocusOutside,n=>n.preventDefault())})}),Me=s.forwardRef((e,o)=>{const r=v(b,e.__scopeDialog),a=s.useRef(!1),t=s.useRef(!1);return i.jsx(oe,{...e,ref:o,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:n=>{var c,l;(c=e.onCloseAutoFocus)==null||c.call(e,n),n.defaultPrevented||(a.current||(l=r.triggerRef.current)==null||l.focus(),n.preventDefault()),a.current=!1,t.current=!1},onInteractOutside:n=>{var u,f;(u=e.onInteractOutside)==null||u.call(e,n),n.defaultPrevented||(a.current=!0,n.detail.originalEvent.type==="pointerdown"&&(t.current=!0));const c=n.target;((f=r.triggerRef.current)==null?void 0:f.contains(c))&&n.preventDefault(),n.detail.originalEvent.type==="focusin"&&t.current&&n.preventDefault()}})}),oe=s.forwardRef((e,o)=>{const{__scopeDialog:r,trapFocus:a,onOpenAutoFocus:t,onCloseAutoFocus:n,...c}=e,l=v(b,r),u=s.useRef(null),f=_(o,u);return De(),i.jsxs(i.Fragment,{children:[i.jsx(Pe,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:t,onUnmountAutoFocus:n,children:i.jsx(q,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":L(l.open),...c,ref:f,onDismiss:()=>l.onOpenChange(!1)})}),i.jsxs(i.Fragment,{children:[i.jsx(Fe,{titleId:l.titleId}),i.jsx(Le,{contentRef:u,descriptionId:l.descriptionId})]})]})}),H="DialogTitle",ne=s.forwardRef((e,o)=>{const{__scopeDialog:r,...a}=e,t=v(H,r);return i.jsx(R.h2,{id:t.titleId,...a,ref:o})});ne.displayName=H;var re="DialogDescription",ae=s.forwardRef((e,o)=>{const{__scopeDialog:r,...a}=e,t=v(re,r);return i.jsx(R.p,{id:t.descriptionId,...a,ref:o})});ae.displayName=re;var se="DialogClose",ie=s.forwardRef((e,o)=>{const{__scopeDialog:r,...a}=e,t=v(se,r);return i.jsx(R.button,{type:"button",...a,ref:o,onClick:g(e.onClick,()=>t.onOpenChange(!1))})});ie.displayName=se;function L(e){return e?"open":"closed"}var ce="DialogTitleWarning",[nt,le]=be(ce,{contentName:b,titleName:H,docsSlug:"dialog"}),Fe=({titleId:e})=>{const o=le(ce),r=`\`${o.contentName}\` requires a \`${o.titleName}\` for the component to be accessible for screen reader users. If you want to hide the \`${o.titleName}\`, you can wrap it with our VisuallyHidden component. diff --git a/pkg/ui/frontend/dist/assets/radix-navigation-DYoR-lWZ.js b/pkg/ui/frontend/dist/assets/radix-navigation-WDVJ59Wc.js similarity index 99% rename from pkg/ui/frontend/dist/assets/radix-navigation-DYoR-lWZ.js rename to pkg/ui/frontend/dist/assets/radix-navigation-WDVJ59Wc.js index 32ba7a49c0999..a0aaa16946727 100644 --- a/pkg/ui/frontend/dist/assets/radix-navigation-DYoR-lWZ.js +++ b/pkg/ui/frontend/dist/assets/radix-navigation-WDVJ59Wc.js @@ -1 +1 @@ -import{b as W,r as s}from"./react-core-D_V7s-9r.js";import{c as J,u as y,j as i,S as Re,a as Ee,b as G,P as E,d as w,e as ce,f as We,A as co,g as $,h as io,i as lo,F as uo,D as fo,C as po,k as mo,l as He,R as ho,m as vo,n as wo,o as bo,p as go}from"./radix-core-ByqQ8fsu.js";function Ye(e){const o=e+"CollectionProvider",[t,n]=J(o),[r,a]=t(o,{collectionRef:{current:null},itemMap:new Map}),c=v=>{const{scope:h,children:S}=v,R=W.useRef(null),g=W.useRef(new Map).current;return i.jsx(r,{scope:h,itemMap:g,collectionRef:R,children:S})};c.displayName=o;const u=e+"CollectionSlot",f=W.forwardRef((v,h)=>{const{scope:S,children:R}=v,g=a(u,S),C=y(h,g.collectionRef);return i.jsx(Re,{ref:C,children:R})});f.displayName=u;const m=e+"CollectionItemSlot",d="data-radix-collection-item",l=W.forwardRef((v,h)=>{const{scope:S,children:R,...g}=v,C=W.useRef(null),P=y(h,C),I=a(m,S);return W.useEffect(()=>(I.itemMap.set(C,{ref:C,...g}),()=>void I.itemMap.delete(C))),i.jsx(Re,{[d]:"",ref:P,children:R})});l.displayName=m;function p(v){const h=a(e+"CollectionConsumer",v);return W.useCallback(()=>{const R=h.collectionRef.current;if(!R)return[];const g=Array.from(R.querySelectorAll(`[${d}]`));return Array.from(h.itemMap.values()).sort((I,A)=>g.indexOf(I.ref.current)-g.indexOf(A.ref.current))},[h.collectionRef,h.itemMap])}return[{Provider:c,Slot:f,ItemSlot:l},p,n]}var So=s.createContext(void 0);function fe(e){const o=s.useContext(So);return e||o||"ltr"}var xe="rovingFocusGroup.onEntryFocus",Co={bubbles:!1,cancelable:!0},pe="RovingFocusGroup",[Me,ze,xo]=Ye(pe),[Ro,me]=J(pe,[xo]),[Mo,_o]=Ro(pe),Xe=s.forwardRef((e,o)=>i.jsx(Me.Provider,{scope:e.__scopeRovingFocusGroup,children:i.jsx(Me.Slot,{scope:e.__scopeRovingFocusGroup,children:i.jsx(Eo,{...e,ref:o})})}));Xe.displayName=pe;var Eo=s.forwardRef((e,o)=>{const{__scopeRovingFocusGroup:t,orientation:n,loop:r=!1,dir:a,currentTabStopId:c,defaultCurrentTabStopId:u,onCurrentTabStopIdChange:f,onEntryFocus:m,preventScrollOnEntryFocus:d=!1,...l}=e,p=s.useRef(null),v=y(o,p),h=fe(a),[S=null,R]=Ee({prop:c,defaultProp:u,onChange:f}),[g,C]=s.useState(!1),P=G(m),I=ze(t),A=s.useRef(!1),[F,D]=s.useState(0);return s.useEffect(()=>{const M=p.current;if(M)return M.addEventListener(xe,P),()=>M.removeEventListener(xe,P)},[P]),i.jsx(Mo,{scope:t,orientation:n,dir:h,loop:r,currentTabStopId:S,onItemFocus:s.useCallback(M=>R(M),[R]),onItemShiftTab:s.useCallback(()=>C(!0),[]),onFocusableItemAdd:s.useCallback(()=>D(M=>M+1),[]),onFocusableItemRemove:s.useCallback(()=>D(M=>M-1),[]),children:i.jsx(E.div,{tabIndex:g||F===0?-1:0,"data-orientation":n,...l,ref:v,style:{outline:"none",...e.style},onMouseDown:w(e.onMouseDown,()=>{A.current=!0}),onFocus:w(e.onFocus,M=>{const x=!A.current;if(M.target===M.currentTarget&&x&&!g){const _=new CustomEvent(xe,Co);if(M.currentTarget.dispatchEvent(_),!_.defaultPrevented){const N=I().filter(U=>U.focusable),z=N.find(U=>U.active),ae=N.find(U=>U.id===S),ge=[z,ae,...N].filter(Boolean).map(U=>U.ref.current);Je(ge,d)}}A.current=!1}),onBlur:w(e.onBlur,()=>C(!1))})})}),qe="RovingFocusGroupItem",Ze=s.forwardRef((e,o)=>{const{__scopeRovingFocusGroup:t,focusable:n=!0,active:r=!1,tabStopId:a,...c}=e,u=ce(),f=a||u,m=_o(qe,t),d=m.currentTabStopId===f,l=ze(t),{onFocusableItemAdd:p,onFocusableItemRemove:v}=m;return s.useEffect(()=>{if(n)return p(),()=>v()},[n,p,v]),i.jsx(Me.ItemSlot,{scope:t,id:f,focusable:n,active:r,children:i.jsx(E.span,{tabIndex:d?0:-1,"data-orientation":m.orientation,...c,ref:o,onMouseDown:w(e.onMouseDown,h=>{n?m.onItemFocus(f):h.preventDefault()}),onFocus:w(e.onFocus,()=>m.onItemFocus(f)),onKeyDown:w(e.onKeyDown,h=>{if(h.key==="Tab"&&h.shiftKey){m.onItemShiftTab();return}if(h.target!==h.currentTarget)return;const S=Io(h,m.orientation,m.dir);if(S!==void 0){if(h.metaKey||h.ctrlKey||h.altKey||h.shiftKey)return;h.preventDefault();let g=l().filter(C=>C.focusable).map(C=>C.ref.current);if(S==="last")g.reverse();else if(S==="prev"||S==="next"){S==="prev"&&g.reverse();const C=g.indexOf(h.currentTarget);g=m.loop?yo(g,C+1):g.slice(C+1)}setTimeout(()=>Je(g))}})})})});Ze.displayName=qe;var Po={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function To(e,o){return o!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Io(e,o,t){const n=To(e.key,t);if(!(o==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(o==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return Po[n]}function Je(e,o=!1){const t=document.activeElement;for(const n of e)if(n===t||(n.focus({preventScroll:o}),document.activeElement!==t))return}function yo(e,o){return e.map((t,n)=>e[(o+n)%e.length])}var Qe=Xe,et=Ze,_e=["Enter"," "],Ao=["ArrowDown","PageUp","Home"],tt=["ArrowUp","PageDown","End"],Do=[...Ao,...tt],No={ltr:[..._e,"ArrowRight"],rtl:[..._e,"ArrowLeft"]},Oo={ltr:["ArrowLeft"],rtl:["ArrowRight"]},ne="Menu",[te,jo,Lo]=Ye(ne),[H,ot]=J(ne,[Lo,We,me]),he=We(),nt=me(),[Fo,Y]=H(ne),[ko,re]=H(ne),rt=e=>{const{__scopeMenu:o,open:t=!1,children:n,dir:r,onOpenChange:a,modal:c=!0}=e,u=he(o),[f,m]=s.useState(null),d=s.useRef(!1),l=G(a),p=fe(r);return s.useEffect(()=>{const v=()=>{d.current=!0,document.addEventListener("pointerdown",h,{capture:!0,once:!0}),document.addEventListener("pointermove",h,{capture:!0,once:!0})},h=()=>d.current=!1;return document.addEventListener("keydown",v,{capture:!0}),()=>{document.removeEventListener("keydown",v,{capture:!0}),document.removeEventListener("pointerdown",h,{capture:!0}),document.removeEventListener("pointermove",h,{capture:!0})}},[]),i.jsx(bo,{...u,children:i.jsx(Fo,{scope:o,open:t,onOpenChange:l,content:f,onContentChange:m,children:i.jsx(ko,{scope:o,onClose:s.useCallback(()=>l(!1),[l]),isUsingKeyboardRef:d,dir:p,modal:c,children:n})})})};rt.displayName=ne;var Go="MenuAnchor",Pe=s.forwardRef((e,o)=>{const{__scopeMenu:t,...n}=e,r=he(t);return i.jsx(co,{...r,...n,ref:o})});Pe.displayName=Go;var Te="MenuPortal",[Ko,at]=H(Te,{forceMount:void 0}),st=e=>{const{__scopeMenu:o,forceMount:t,children:n,container:r}=e,a=Y(Te,o);return i.jsx(Ko,{scope:o,forceMount:t,children:i.jsx($,{present:t||a.open,children:i.jsx(wo,{asChild:!0,container:r,children:n})})})};st.displayName=Te;var j="MenuContent",[Uo,Ie]=H(j),ct=s.forwardRef((e,o)=>{const t=at(j,e.__scopeMenu),{forceMount:n=t.forceMount,...r}=e,a=Y(j,e.__scopeMenu),c=re(j,e.__scopeMenu);return i.jsx(te.Provider,{scope:e.__scopeMenu,children:i.jsx($,{present:n||a.open,children:i.jsx(te.Slot,{scope:e.__scopeMenu,children:c.modal?i.jsx(Vo,{...r,ref:o}):i.jsx($o,{...r,ref:o})})})})}),Vo=s.forwardRef((e,o)=>{const t=Y(j,e.__scopeMenu),n=s.useRef(null),r=y(o,n);return s.useEffect(()=>{const a=n.current;if(a)return io(a)},[]),i.jsx(ye,{...e,ref:r,trapFocus:t.open,disableOutsidePointerEvents:t.open,disableOutsideScroll:!0,onFocusOutside:w(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>t.onOpenChange(!1)})}),$o=s.forwardRef((e,o)=>{const t=Y(j,e.__scopeMenu);return i.jsx(ye,{...e,ref:o,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>t.onOpenChange(!1)})}),ye=s.forwardRef((e,o)=>{const{__scopeMenu:t,loop:n=!1,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:c,disableOutsidePointerEvents:u,onEntryFocus:f,onEscapeKeyDown:m,onPointerDownOutside:d,onFocusOutside:l,onInteractOutside:p,onDismiss:v,disableOutsideScroll:h,...S}=e,R=Y(j,t),g=re(j,t),C=he(t),P=nt(t),I=jo(t),[A,F]=s.useState(null),D=s.useRef(null),M=y(o,D,R.onContentChange),x=s.useRef(0),_=s.useRef(""),N=s.useRef(0),z=s.useRef(null),ae=s.useRef("right"),se=s.useRef(0),ge=h?ho:s.Fragment,U=h?{as:Re,allowPinchZoom:!0}:void 0,so=b=>{var q,Ue;const O=_.current+b,k=I().filter(V=>!V.disabled),B=document.activeElement,Se=(q=k.find(V=>V.ref.current===B))==null?void 0:q.textValue,Ce=k.map(V=>V.textValue),Ke=tn(Ce,O,Se),Q=(Ue=k.find(V=>V.textValue===Ke))==null?void 0:Ue.ref.current;(function V(Ve){_.current=Ve,window.clearTimeout(x.current),Ve!==""&&(x.current=window.setTimeout(()=>V(""),1e3))})(O),Q&&setTimeout(()=>Q.focus())};s.useEffect(()=>()=>window.clearTimeout(x.current),[]),lo();const X=s.useCallback(b=>{var k,B;return ae.current===((k=z.current)==null?void 0:k.side)&&nn(b,(B=z.current)==null?void 0:B.area)},[]);return i.jsx(Uo,{scope:t,searchRef:_,onItemEnter:s.useCallback(b=>{X(b)&&b.preventDefault()},[X]),onItemLeave:s.useCallback(b=>{var O;X(b)||((O=D.current)==null||O.focus(),F(null))},[X]),onTriggerLeave:s.useCallback(b=>{X(b)&&b.preventDefault()},[X]),pointerGraceTimerRef:N,onPointerGraceIntentChange:s.useCallback(b=>{z.current=b},[]),children:i.jsx(ge,{...U,children:i.jsx(uo,{asChild:!0,trapped:r,onMountAutoFocus:w(a,b=>{var O;b.preventDefault(),(O=D.current)==null||O.focus({preventScroll:!0})}),onUnmountAutoFocus:c,children:i.jsx(fo,{asChild:!0,disableOutsidePointerEvents:u,onEscapeKeyDown:m,onPointerDownOutside:d,onFocusOutside:l,onInteractOutside:p,onDismiss:v,children:i.jsx(Qe,{asChild:!0,...P,dir:g.dir,orientation:"vertical",loop:n,currentTabStopId:A,onCurrentTabStopIdChange:F,onEntryFocus:w(f,b=>{g.isUsingKeyboardRef.current||b.preventDefault()}),preventScrollOnEntryFocus:!0,children:i.jsx(po,{role:"menu","aria-orientation":"vertical","data-state":Rt(R.open),"data-radix-menu-content":"",dir:g.dir,...C,...S,ref:M,style:{outline:"none",...S.style},onKeyDown:w(S.onKeyDown,b=>{const k=b.target.closest("[data-radix-menu-content]")===b.currentTarget,B=b.ctrlKey||b.altKey||b.metaKey,Se=b.key.length===1;k&&(b.key==="Tab"&&b.preventDefault(),!B&&Se&&so(b.key));const Ce=D.current;if(b.target!==Ce||!Do.includes(b.key))return;b.preventDefault();const Q=I().filter(q=>!q.disabled).map(q=>q.ref.current);tt.includes(b.key)&&Q.reverse(),Qo(Q)}),onBlur:w(e.onBlur,b=>{b.currentTarget.contains(b.target)||(window.clearTimeout(x.current),_.current="")}),onPointerMove:w(e.onPointerMove,oe(b=>{const O=b.target,k=se.current!==b.clientX;if(b.currentTarget.contains(O)&&k){const B=b.clientX>se.current?"right":"left";ae.current=B,se.current=b.clientX}}))})})})})})})});ct.displayName=j;var Bo="MenuGroup",Ae=s.forwardRef((e,o)=>{const{__scopeMenu:t,...n}=e;return i.jsx(E.div,{role:"group",...n,ref:o})});Ae.displayName=Bo;var Wo="MenuLabel",it=s.forwardRef((e,o)=>{const{__scopeMenu:t,...n}=e;return i.jsx(E.div,{...n,ref:o})});it.displayName=Wo;var ie="MenuItem",$e="menu.itemSelect",ve=s.forwardRef((e,o)=>{const{disabled:t=!1,onSelect:n,...r}=e,a=s.useRef(null),c=re(ie,e.__scopeMenu),u=Ie(ie,e.__scopeMenu),f=y(o,a),m=s.useRef(!1),d=()=>{const l=a.current;if(!t&&l){const p=new CustomEvent($e,{bubbles:!0,cancelable:!0});l.addEventListener($e,v=>n==null?void 0:n(v),{once:!0}),vo(l,p),p.defaultPrevented?m.current=!1:c.onClose()}};return i.jsx(lt,{...r,ref:f,disabled:t,onClick:w(e.onClick,d),onPointerDown:l=>{var p;(p=e.onPointerDown)==null||p.call(e,l),m.current=!0},onPointerUp:w(e.onPointerUp,l=>{var p;m.current||(p=l.currentTarget)==null||p.click()}),onKeyDown:w(e.onKeyDown,l=>{const p=u.searchRef.current!=="";t||p&&l.key===" "||_e.includes(l.key)&&(l.currentTarget.click(),l.preventDefault())})})});ve.displayName=ie;var lt=s.forwardRef((e,o)=>{const{__scopeMenu:t,disabled:n=!1,textValue:r,...a}=e,c=Ie(ie,t),u=nt(t),f=s.useRef(null),m=y(o,f),[d,l]=s.useState(!1),[p,v]=s.useState("");return s.useEffect(()=>{const h=f.current;h&&v((h.textContent??"").trim())},[a.children]),i.jsx(te.ItemSlot,{scope:t,disabled:n,textValue:r??p,children:i.jsx(et,{asChild:!0,...u,focusable:!n,children:i.jsx(E.div,{role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":n||void 0,"data-disabled":n?"":void 0,...a,ref:m,onPointerMove:w(e.onPointerMove,oe(h=>{n?c.onItemLeave(h):(c.onItemEnter(h),h.defaultPrevented||h.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:w(e.onPointerLeave,oe(h=>c.onItemLeave(h))),onFocus:w(e.onFocus,()=>l(!0)),onBlur:w(e.onBlur,()=>l(!1))})})})}),Ho="MenuCheckboxItem",ut=s.forwardRef((e,o)=>{const{checked:t=!1,onCheckedChange:n,...r}=e;return i.jsx(ht,{scope:e.__scopeMenu,checked:t,children:i.jsx(ve,{role:"menuitemcheckbox","aria-checked":le(t)?"mixed":t,...r,ref:o,"data-state":Ne(t),onSelect:w(r.onSelect,()=>n==null?void 0:n(le(t)?!0:!t),{checkForDefaultPrevented:!1})})})});ut.displayName=Ho;var dt="MenuRadioGroup",[Yo,zo]=H(dt,{value:void 0,onValueChange:()=>{}}),ft=s.forwardRef((e,o)=>{const{value:t,onValueChange:n,...r}=e,a=G(n);return i.jsx(Yo,{scope:e.__scopeMenu,value:t,onValueChange:a,children:i.jsx(Ae,{...r,ref:o})})});ft.displayName=dt;var pt="MenuRadioItem",mt=s.forwardRef((e,o)=>{const{value:t,...n}=e,r=zo(pt,e.__scopeMenu),a=t===r.value;return i.jsx(ht,{scope:e.__scopeMenu,checked:a,children:i.jsx(ve,{role:"menuitemradio","aria-checked":a,...n,ref:o,"data-state":Ne(a),onSelect:w(n.onSelect,()=>{var c;return(c=r.onValueChange)==null?void 0:c.call(r,t)},{checkForDefaultPrevented:!1})})})});mt.displayName=pt;var De="MenuItemIndicator",[ht,Xo]=H(De,{checked:!1}),vt=s.forwardRef((e,o)=>{const{__scopeMenu:t,forceMount:n,...r}=e,a=Xo(De,t);return i.jsx($,{present:n||le(a.checked)||a.checked===!0,children:i.jsx(E.span,{...r,ref:o,"data-state":Ne(a.checked)})})});vt.displayName=De;var qo="MenuSeparator",wt=s.forwardRef((e,o)=>{const{__scopeMenu:t,...n}=e;return i.jsx(E.div,{role:"separator","aria-orientation":"horizontal",...n,ref:o})});wt.displayName=qo;var Zo="MenuArrow",bt=s.forwardRef((e,o)=>{const{__scopeMenu:t,...n}=e,r=he(t);return i.jsx(mo,{...r,...n,ref:o})});bt.displayName=Zo;var Jo="MenuSub",[tr,gt]=H(Jo),ee="MenuSubTrigger",St=s.forwardRef((e,o)=>{const t=Y(ee,e.__scopeMenu),n=re(ee,e.__scopeMenu),r=gt(ee,e.__scopeMenu),a=Ie(ee,e.__scopeMenu),c=s.useRef(null),{pointerGraceTimerRef:u,onPointerGraceIntentChange:f}=a,m={__scopeMenu:e.__scopeMenu},d=s.useCallback(()=>{c.current&&window.clearTimeout(c.current),c.current=null},[]);return s.useEffect(()=>d,[d]),s.useEffect(()=>{const l=u.current;return()=>{window.clearTimeout(l),f(null)}},[u,f]),i.jsx(Pe,{asChild:!0,...m,children:i.jsx(lt,{id:r.triggerId,"aria-haspopup":"menu","aria-expanded":t.open,"aria-controls":r.contentId,"data-state":Rt(t.open),...e,ref:He(o,r.onTriggerChange),onClick:l=>{var p;(p=e.onClick)==null||p.call(e,l),!(e.disabled||l.defaultPrevented)&&(l.currentTarget.focus(),t.open||t.onOpenChange(!0))},onPointerMove:w(e.onPointerMove,oe(l=>{a.onItemEnter(l),!l.defaultPrevented&&!e.disabled&&!t.open&&!c.current&&(a.onPointerGraceIntentChange(null),c.current=window.setTimeout(()=>{t.onOpenChange(!0),d()},100))})),onPointerLeave:w(e.onPointerLeave,oe(l=>{var v,h;d();const p=(v=t.content)==null?void 0:v.getBoundingClientRect();if(p){const S=(h=t.content)==null?void 0:h.dataset.side,R=S==="right",g=R?-5:5,C=p[R?"left":"right"],P=p[R?"right":"left"];a.onPointerGraceIntentChange({area:[{x:l.clientX+g,y:l.clientY},{x:C,y:p.top},{x:P,y:p.top},{x:P,y:p.bottom},{x:C,y:p.bottom}],side:S}),window.clearTimeout(u.current),u.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(l),l.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:w(e.onKeyDown,l=>{var v;const p=a.searchRef.current!=="";e.disabled||p&&l.key===" "||No[n.dir].includes(l.key)&&(t.onOpenChange(!0),(v=t.content)==null||v.focus(),l.preventDefault())})})})});St.displayName=ee;var Ct="MenuSubContent",xt=s.forwardRef((e,o)=>{const t=at(j,e.__scopeMenu),{forceMount:n=t.forceMount,...r}=e,a=Y(j,e.__scopeMenu),c=re(j,e.__scopeMenu),u=gt(Ct,e.__scopeMenu),f=s.useRef(null),m=y(o,f);return i.jsx(te.Provider,{scope:e.__scopeMenu,children:i.jsx($,{present:n||a.open,children:i.jsx(te.Slot,{scope:e.__scopeMenu,children:i.jsx(ye,{id:u.contentId,"aria-labelledby":u.triggerId,...r,ref:m,align:"start",side:c.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:d=>{var l;c.isUsingKeyboardRef.current&&((l=f.current)==null||l.focus()),d.preventDefault()},onCloseAutoFocus:d=>d.preventDefault(),onFocusOutside:w(e.onFocusOutside,d=>{d.target!==u.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:w(e.onEscapeKeyDown,d=>{c.onClose(),d.preventDefault()}),onKeyDown:w(e.onKeyDown,d=>{var v;const l=d.currentTarget.contains(d.target),p=Oo[c.dir].includes(d.key);l&&p&&(a.onOpenChange(!1),(v=u.trigger)==null||v.focus(),d.preventDefault())})})})})})});xt.displayName=Ct;function Rt(e){return e?"open":"closed"}function le(e){return e==="indeterminate"}function Ne(e){return le(e)?"indeterminate":e?"checked":"unchecked"}function Qo(e){const o=document.activeElement;for(const t of e)if(t===o||(t.focus(),document.activeElement!==o))return}function en(e,o){return e.map((t,n)=>e[(o+n)%e.length])}function tn(e,o,t){const r=o.length>1&&Array.from(o).every(m=>m===o[0])?o[0]:o,a=t?e.indexOf(t):-1;let c=en(e,Math.max(a,0));r.length===1&&(c=c.filter(m=>m!==t));const f=c.find(m=>m.toLowerCase().startsWith(r.toLowerCase()));return f!==t?f:void 0}function on(e,o){const{x:t,y:n}=e;let r=!1;for(let a=0,c=o.length-1;an!=d>n&&t<(m-u)*(n-f)/(d-f)+u&&(r=!r)}return r}function nn(e,o){if(!o)return!1;const t={x:e.clientX,y:e.clientY};return on(t,o)}function oe(e){return o=>o.pointerType==="mouse"?e(o):void 0}var rn=rt,an=Pe,sn=st,cn=ct,ln=Ae,un=it,dn=ve,fn=ut,pn=ft,mn=mt,hn=vt,vn=wt,wn=bt,bn=St,gn=xt,Oe="DropdownMenu",[Sn,or]=J(Oe,[ot]),T=ot(),[Cn,Mt]=Sn(Oe),_t=e=>{const{__scopeDropdownMenu:o,children:t,dir:n,open:r,defaultOpen:a,onOpenChange:c,modal:u=!0}=e,f=T(o),m=s.useRef(null),[d=!1,l]=Ee({prop:r,defaultProp:a,onChange:c});return i.jsx(Cn,{scope:o,triggerId:ce(),triggerRef:m,contentId:ce(),open:d,onOpenChange:l,onOpenToggle:s.useCallback(()=>l(p=>!p),[l]),modal:u,children:i.jsx(rn,{...f,open:d,onOpenChange:l,dir:n,modal:u,children:t})})};_t.displayName=Oe;var Et="DropdownMenuTrigger",Pt=s.forwardRef((e,o)=>{const{__scopeDropdownMenu:t,disabled:n=!1,...r}=e,a=Mt(Et,t),c=T(t);return i.jsx(an,{asChild:!0,...c,children:i.jsx(E.button,{type:"button",id:a.triggerId,"aria-haspopup":"menu","aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?"open":"closed","data-disabled":n?"":void 0,disabled:n,...r,ref:He(o,a.triggerRef),onPointerDown:w(e.onPointerDown,u=>{!n&&u.button===0&&u.ctrlKey===!1&&(a.onOpenToggle(),a.open||u.preventDefault())}),onKeyDown:w(e.onKeyDown,u=>{n||(["Enter"," "].includes(u.key)&&a.onOpenToggle(),u.key==="ArrowDown"&&a.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(u.key)&&u.preventDefault())})})})});Pt.displayName=Et;var xn="DropdownMenuPortal",Tt=e=>{const{__scopeDropdownMenu:o,...t}=e,n=T(o);return i.jsx(sn,{...n,...t})};Tt.displayName=xn;var It="DropdownMenuContent",yt=s.forwardRef((e,o)=>{const{__scopeDropdownMenu:t,...n}=e,r=Mt(It,t),a=T(t),c=s.useRef(!1);return i.jsx(cn,{id:r.contentId,"aria-labelledby":r.triggerId,...a,...n,ref:o,onCloseAutoFocus:w(e.onCloseAutoFocus,u=>{var f;c.current||(f=r.triggerRef.current)==null||f.focus(),c.current=!1,u.preventDefault()}),onInteractOutside:w(e.onInteractOutside,u=>{const f=u.detail.originalEvent,m=f.button===0&&f.ctrlKey===!0,d=f.button===2||m;(!r.modal||d)&&(c.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});yt.displayName=It;var Rn="DropdownMenuGroup",Mn=s.forwardRef((e,o)=>{const{__scopeDropdownMenu:t,...n}=e,r=T(t);return i.jsx(ln,{...r,...n,ref:o})});Mn.displayName=Rn;var _n="DropdownMenuLabel",At=s.forwardRef((e,o)=>{const{__scopeDropdownMenu:t,...n}=e,r=T(t);return i.jsx(un,{...r,...n,ref:o})});At.displayName=_n;var En="DropdownMenuItem",Dt=s.forwardRef((e,o)=>{const{__scopeDropdownMenu:t,...n}=e,r=T(t);return i.jsx(dn,{...r,...n,ref:o})});Dt.displayName=En;var Pn="DropdownMenuCheckboxItem",Nt=s.forwardRef((e,o)=>{const{__scopeDropdownMenu:t,...n}=e,r=T(t);return i.jsx(fn,{...r,...n,ref:o})});Nt.displayName=Pn;var Tn="DropdownMenuRadioGroup",In=s.forwardRef((e,o)=>{const{__scopeDropdownMenu:t,...n}=e,r=T(t);return i.jsx(pn,{...r,...n,ref:o})});In.displayName=Tn;var yn="DropdownMenuRadioItem",Ot=s.forwardRef((e,o)=>{const{__scopeDropdownMenu:t,...n}=e,r=T(t);return i.jsx(mn,{...r,...n,ref:o})});Ot.displayName=yn;var An="DropdownMenuItemIndicator",jt=s.forwardRef((e,o)=>{const{__scopeDropdownMenu:t,...n}=e,r=T(t);return i.jsx(hn,{...r,...n,ref:o})});jt.displayName=An;var Dn="DropdownMenuSeparator",Lt=s.forwardRef((e,o)=>{const{__scopeDropdownMenu:t,...n}=e,r=T(t);return i.jsx(vn,{...r,...n,ref:o})});Lt.displayName=Dn;var Nn="DropdownMenuArrow",On=s.forwardRef((e,o)=>{const{__scopeDropdownMenu:t,...n}=e,r=T(t);return i.jsx(wn,{...r,...n,ref:o})});On.displayName=Nn;var jn="DropdownMenuSubTrigger",Ft=s.forwardRef((e,o)=>{const{__scopeDropdownMenu:t,...n}=e,r=T(t);return i.jsx(bn,{...r,...n,ref:o})});Ft.displayName=jn;var Ln="DropdownMenuSubContent",kt=s.forwardRef((e,o)=>{const{__scopeDropdownMenu:t,...n}=e,r=T(t);return i.jsx(gn,{...r,...n,ref:o,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});kt.displayName=Ln;var nr=_t,rr=Pt,ar=Tt,sr=yt,cr=At,ir=Dt,lr=Nt,ur=Ot,dr=jt,fr=Lt,pr=Ft,mr=kt;function Fn(e,[o,t]){return Math.min(t,Math.max(o,e))}function kn(e,o){return s.useReducer((t,n)=>o[t][n]??t,e)}var je="ScrollArea",[Gt,hr]=J(je),[Gn,L]=Gt(je),Kt=s.forwardRef((e,o)=>{const{__scopeScrollArea:t,type:n="hover",dir:r,scrollHideDelay:a=600,...c}=e,[u,f]=s.useState(null),[m,d]=s.useState(null),[l,p]=s.useState(null),[v,h]=s.useState(null),[S,R]=s.useState(null),[g,C]=s.useState(0),[P,I]=s.useState(0),[A,F]=s.useState(!1),[D,M]=s.useState(!1),x=y(o,N=>f(N)),_=fe(r);return i.jsx(Gn,{scope:t,type:n,dir:_,scrollHideDelay:a,scrollArea:u,viewport:m,onViewportChange:d,content:l,onContentChange:p,scrollbarX:v,onScrollbarXChange:h,scrollbarXEnabled:A,onScrollbarXEnabledChange:F,scrollbarY:S,onScrollbarYChange:R,scrollbarYEnabled:D,onScrollbarYEnabledChange:M,onCornerWidthChange:C,onCornerHeightChange:I,children:i.jsx(E.div,{dir:_,...c,ref:x,style:{position:"relative","--radix-scroll-area-corner-width":g+"px","--radix-scroll-area-corner-height":P+"px",...e.style}})})});Kt.displayName=je;var Ut="ScrollAreaViewport",Vt=s.forwardRef((e,o)=>{const{__scopeScrollArea:t,children:n,nonce:r,...a}=e,c=L(Ut,t),u=s.useRef(null),f=y(o,u,c.onViewportChange);return i.jsxs(i.Fragment,{children:[i.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),i.jsx(E.div,{"data-radix-scroll-area-viewport":"",...a,ref:f,style:{overflowX:c.scrollbarXEnabled?"scroll":"hidden",overflowY:c.scrollbarYEnabled?"scroll":"hidden",...e.style},children:i.jsx("div",{ref:c.onContentChange,style:{minWidth:"100%",display:"table"},children:n})})]})});Vt.displayName=Ut;var K="ScrollAreaScrollbar",Kn=s.forwardRef((e,o)=>{const{forceMount:t,...n}=e,r=L(K,e.__scopeScrollArea),{onScrollbarXEnabledChange:a,onScrollbarYEnabledChange:c}=r,u=e.orientation==="horizontal";return s.useEffect(()=>(u?a(!0):c(!0),()=>{u?a(!1):c(!1)}),[u,a,c]),r.type==="hover"?i.jsx(Un,{...n,ref:o,forceMount:t}):r.type==="scroll"?i.jsx(Vn,{...n,ref:o,forceMount:t}):r.type==="auto"?i.jsx($t,{...n,ref:o,forceMount:t}):r.type==="always"?i.jsx(Le,{...n,ref:o}):null});Kn.displayName=K;var Un=s.forwardRef((e,o)=>{const{forceMount:t,...n}=e,r=L(K,e.__scopeScrollArea),[a,c]=s.useState(!1);return s.useEffect(()=>{const u=r.scrollArea;let f=0;if(u){const m=()=>{window.clearTimeout(f),c(!0)},d=()=>{f=window.setTimeout(()=>c(!1),r.scrollHideDelay)};return u.addEventListener("pointerenter",m),u.addEventListener("pointerleave",d),()=>{window.clearTimeout(f),u.removeEventListener("pointerenter",m),u.removeEventListener("pointerleave",d)}}},[r.scrollArea,r.scrollHideDelay]),i.jsx($,{present:t||a,children:i.jsx($t,{"data-state":a?"visible":"hidden",...n,ref:o})})}),Vn=s.forwardRef((e,o)=>{const{forceMount:t,...n}=e,r=L(K,e.__scopeScrollArea),a=e.orientation==="horizontal",c=be(()=>f("SCROLL_END"),100),[u,f]=kn("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return s.useEffect(()=>{if(u==="idle"){const m=window.setTimeout(()=>f("HIDE"),r.scrollHideDelay);return()=>window.clearTimeout(m)}},[u,r.scrollHideDelay,f]),s.useEffect(()=>{const m=r.viewport,d=a?"scrollLeft":"scrollTop";if(m){let l=m[d];const p=()=>{const v=m[d];l!==v&&(f("SCROLL"),c()),l=v};return m.addEventListener("scroll",p),()=>m.removeEventListener("scroll",p)}},[r.viewport,a,f,c]),i.jsx($,{present:t||u!=="hidden",children:i.jsx(Le,{"data-state":u==="hidden"?"hidden":"visible",...n,ref:o,onPointerEnter:w(e.onPointerEnter,()=>f("POINTER_ENTER")),onPointerLeave:w(e.onPointerLeave,()=>f("POINTER_LEAVE"))})})}),$t=s.forwardRef((e,o)=>{const t=L(K,e.__scopeScrollArea),{forceMount:n,...r}=e,[a,c]=s.useState(!1),u=e.orientation==="horizontal",f=be(()=>{if(t.viewport){const m=t.viewport.offsetWidth{const{orientation:t="vertical",...n}=e,r=L(K,e.__scopeScrollArea),a=s.useRef(null),c=s.useRef(0),[u,f]=s.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),m=Yt(u.viewport,u.content),d={...n,sizes:u,onSizesChange:f,hasThumb:m>0&&m<1,onThumbChange:p=>a.current=p,onThumbPointerUp:()=>c.current=0,onThumbPointerDown:p=>c.current=p};function l(p,v){return Xn(p,c.current,u,v)}return t==="horizontal"?i.jsx($n,{...d,ref:o,onThumbPositionChange:()=>{if(r.viewport&&a.current){const p=r.viewport.scrollLeft,v=Be(p,u,r.dir);a.current.style.transform=`translate3d(${v}px, 0, 0)`}},onWheelScroll:p=>{r.viewport&&(r.viewport.scrollLeft=p)},onDragScroll:p=>{r.viewport&&(r.viewport.scrollLeft=l(p,r.dir))}}):t==="vertical"?i.jsx(Bn,{...d,ref:o,onThumbPositionChange:()=>{if(r.viewport&&a.current){const p=r.viewport.scrollTop,v=Be(p,u);a.current.style.transform=`translate3d(0, ${v}px, 0)`}},onWheelScroll:p=>{r.viewport&&(r.viewport.scrollTop=p)},onDragScroll:p=>{r.viewport&&(r.viewport.scrollTop=l(p))}}):null}),$n=s.forwardRef((e,o)=>{const{sizes:t,onSizesChange:n,...r}=e,a=L(K,e.__scopeScrollArea),[c,u]=s.useState(),f=s.useRef(null),m=y(o,f,a.onScrollbarXChange);return s.useEffect(()=>{f.current&&u(getComputedStyle(f.current))},[f]),i.jsx(Wt,{"data-orientation":"horizontal",...r,ref:m,sizes:t,style:{bottom:0,left:a.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:a.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":we(t)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.x),onDragScroll:d=>e.onDragScroll(d.x),onWheelScroll:(d,l)=>{if(a.viewport){const p=a.viewport.scrollLeft+d.deltaX;e.onWheelScroll(p),Xt(p,l)&&d.preventDefault()}},onResize:()=>{f.current&&a.viewport&&c&&n({content:a.viewport.scrollWidth,viewport:a.viewport.offsetWidth,scrollbar:{size:f.current.clientWidth,paddingStart:de(c.paddingLeft),paddingEnd:de(c.paddingRight)}})}})}),Bn=s.forwardRef((e,o)=>{const{sizes:t,onSizesChange:n,...r}=e,a=L(K,e.__scopeScrollArea),[c,u]=s.useState(),f=s.useRef(null),m=y(o,f,a.onScrollbarYChange);return s.useEffect(()=>{f.current&&u(getComputedStyle(f.current))},[f]),i.jsx(Wt,{"data-orientation":"vertical",...r,ref:m,sizes:t,style:{top:0,right:a.dir==="ltr"?0:void 0,left:a.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":we(t)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.y),onDragScroll:d=>e.onDragScroll(d.y),onWheelScroll:(d,l)=>{if(a.viewport){const p=a.viewport.scrollTop+d.deltaY;e.onWheelScroll(p),Xt(p,l)&&d.preventDefault()}},onResize:()=>{f.current&&a.viewport&&c&&n({content:a.viewport.scrollHeight,viewport:a.viewport.offsetHeight,scrollbar:{size:f.current.clientHeight,paddingStart:de(c.paddingTop),paddingEnd:de(c.paddingBottom)}})}})}),[Wn,Bt]=Gt(K),Wt=s.forwardRef((e,o)=>{const{__scopeScrollArea:t,sizes:n,hasThumb:r,onThumbChange:a,onThumbPointerUp:c,onThumbPointerDown:u,onThumbPositionChange:f,onDragScroll:m,onWheelScroll:d,onResize:l,...p}=e,v=L(K,t),[h,S]=s.useState(null),R=y(o,x=>S(x)),g=s.useRef(null),C=s.useRef(""),P=v.viewport,I=n.content-n.viewport,A=G(d),F=G(f),D=be(l,10);function M(x){if(g.current){const _=x.clientX-g.current.left,N=x.clientY-g.current.top;m({x:_,y:N})}}return s.useEffect(()=>{const x=_=>{const N=_.target;(h==null?void 0:h.contains(N))&&A(_,I)};return document.addEventListener("wheel",x,{passive:!1}),()=>document.removeEventListener("wheel",x,{passive:!1})},[P,h,I,A]),s.useEffect(F,[n,F]),Z(h,D),Z(v.content,D),i.jsx(Wn,{scope:t,scrollbar:h,hasThumb:r,onThumbChange:G(a),onThumbPointerUp:G(c),onThumbPositionChange:F,onThumbPointerDown:G(u),children:i.jsx(E.div,{...p,ref:R,style:{position:"absolute",...p.style},onPointerDown:w(e.onPointerDown,x=>{x.button===0&&(x.target.setPointerCapture(x.pointerId),g.current=h.getBoundingClientRect(),C.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",v.viewport&&(v.viewport.style.scrollBehavior="auto"),M(x))}),onPointerMove:w(e.onPointerMove,M),onPointerUp:w(e.onPointerUp,x=>{const _=x.target;_.hasPointerCapture(x.pointerId)&&_.releasePointerCapture(x.pointerId),document.body.style.webkitUserSelect=C.current,v.viewport&&(v.viewport.style.scrollBehavior=""),g.current=null})})})}),ue="ScrollAreaThumb",Hn=s.forwardRef((e,o)=>{const{forceMount:t,...n}=e,r=Bt(ue,e.__scopeScrollArea);return i.jsx($,{present:t||r.hasThumb,children:i.jsx(Yn,{ref:o,...n})})}),Yn=s.forwardRef((e,o)=>{const{__scopeScrollArea:t,style:n,...r}=e,a=L(ue,t),c=Bt(ue,t),{onThumbPositionChange:u}=c,f=y(o,l=>c.onThumbChange(l)),m=s.useRef(void 0),d=be(()=>{m.current&&(m.current(),m.current=void 0)},100);return s.useEffect(()=>{const l=a.viewport;if(l){const p=()=>{if(d(),!m.current){const v=qn(l,u);m.current=v,u()}};return u(),l.addEventListener("scroll",p),()=>l.removeEventListener("scroll",p)}},[a.viewport,d,u]),i.jsx(E.div,{"data-state":c.hasThumb?"visible":"hidden",...r,ref:f,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...n},onPointerDownCapture:w(e.onPointerDownCapture,l=>{const v=l.target.getBoundingClientRect(),h=l.clientX-v.left,S=l.clientY-v.top;c.onThumbPointerDown({x:h,y:S})}),onPointerUp:w(e.onPointerUp,c.onThumbPointerUp)})});Hn.displayName=ue;var Fe="ScrollAreaCorner",Ht=s.forwardRef((e,o)=>{const t=L(Fe,e.__scopeScrollArea),n=!!(t.scrollbarX&&t.scrollbarY);return t.type!=="scroll"&&n?i.jsx(zn,{...e,ref:o}):null});Ht.displayName=Fe;var zn=s.forwardRef((e,o)=>{const{__scopeScrollArea:t,...n}=e,r=L(Fe,t),[a,c]=s.useState(0),[u,f]=s.useState(0),m=!!(a&&u);return Z(r.scrollbarX,()=>{var l;const d=((l=r.scrollbarX)==null?void 0:l.offsetHeight)||0;r.onCornerHeightChange(d),f(d)}),Z(r.scrollbarY,()=>{var l;const d=((l=r.scrollbarY)==null?void 0:l.offsetWidth)||0;r.onCornerWidthChange(d),c(d)}),m?i.jsx(E.div,{...n,ref:o,style:{width:a,height:u,position:"absolute",right:r.dir==="ltr"?0:void 0,left:r.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function de(e){return e?parseInt(e,10):0}function Yt(e,o){const t=e/o;return isNaN(t)?0:t}function we(e){const o=Yt(e.viewport,e.content),t=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=(e.scrollbar.size-t)*o;return Math.max(n,18)}function Xn(e,o,t,n="ltr"){const r=we(t),a=r/2,c=o||a,u=r-c,f=t.scrollbar.paddingStart+c,m=t.scrollbar.size-t.scrollbar.paddingEnd-u,d=t.content-t.viewport,l=n==="ltr"?[0,d]:[d*-1,0];return zt([f,m],l)(e)}function Be(e,o,t="ltr"){const n=we(o),r=o.scrollbar.paddingStart+o.scrollbar.paddingEnd,a=o.scrollbar.size-r,c=o.content-o.viewport,u=a-n,f=t==="ltr"?[0,c]:[c*-1,0],m=Fn(e,f);return zt([0,c],[0,u])(m)}function zt(e,o){return t=>{if(e[0]===e[1]||o[0]===o[1])return o[0];const n=(o[1]-o[0])/(e[1]-e[0]);return o[0]+n*(t-e[0])}}function Xt(e,o){return e>0&&e{})=>{let t={left:e.scrollLeft,top:e.scrollTop},n=0;return function r(){const a={left:e.scrollLeft,top:e.scrollTop},c=t.left!==a.left,u=t.top!==a.top;(c||u)&&o(),t=a,n=window.requestAnimationFrame(r)}(),()=>window.cancelAnimationFrame(n)};function be(e,o){const t=G(e),n=s.useRef(0);return s.useEffect(()=>()=>window.clearTimeout(n.current),[]),s.useCallback(()=>{window.clearTimeout(n.current),n.current=window.setTimeout(t,o)},[t,o])}function Z(e,o){const t=G(o);go(()=>{let n=0;if(e){const r=new ResizeObserver(()=>{cancelAnimationFrame(n),n=window.requestAnimationFrame(t)});return r.observe(e),()=>{window.cancelAnimationFrame(n),r.unobserve(e)}}},[e,t])}var vr=Kt,wr=Vt,br=Ht,ke="Tabs",[Zn,gr]=J(ke,[me]),qt=me(),[Jn,Ge]=Zn(ke),Zt=s.forwardRef((e,o)=>{const{__scopeTabs:t,value:n,onValueChange:r,defaultValue:a,orientation:c="horizontal",dir:u,activationMode:f="automatic",...m}=e,d=fe(u),[l,p]=Ee({prop:n,onChange:r,defaultProp:a});return i.jsx(Jn,{scope:t,baseId:ce(),value:l,onValueChange:p,orientation:c,dir:d,activationMode:f,children:i.jsx(E.div,{dir:d,"data-orientation":c,...m,ref:o})})});Zt.displayName=ke;var Jt="TabsList",Qt=s.forwardRef((e,o)=>{const{__scopeTabs:t,loop:n=!0,...r}=e,a=Ge(Jt,t),c=qt(t);return i.jsx(Qe,{asChild:!0,...c,orientation:a.orientation,dir:a.dir,loop:n,children:i.jsx(E.div,{role:"tablist","aria-orientation":a.orientation,...r,ref:o})})});Qt.displayName=Jt;var eo="TabsTrigger",to=s.forwardRef((e,o)=>{const{__scopeTabs:t,value:n,disabled:r=!1,...a}=e,c=Ge(eo,t),u=qt(t),f=ro(c.baseId,n),m=ao(c.baseId,n),d=n===c.value;return i.jsx(et,{asChild:!0,...u,focusable:!r,active:d,children:i.jsx(E.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":m,"data-state":d?"active":"inactive","data-disabled":r?"":void 0,disabled:r,id:f,...a,ref:o,onMouseDown:w(e.onMouseDown,l=>{!r&&l.button===0&&l.ctrlKey===!1?c.onValueChange(n):l.preventDefault()}),onKeyDown:w(e.onKeyDown,l=>{[" ","Enter"].includes(l.key)&&c.onValueChange(n)}),onFocus:w(e.onFocus,()=>{const l=c.activationMode!=="manual";!d&&!r&&l&&c.onValueChange(n)})})})});to.displayName=eo;var oo="TabsContent",no=s.forwardRef((e,o)=>{const{__scopeTabs:t,value:n,forceMount:r,children:a,...c}=e,u=Ge(oo,t),f=ro(u.baseId,n),m=ao(u.baseId,n),d=n===u.value,l=s.useRef(d);return s.useEffect(()=>{const p=requestAnimationFrame(()=>l.current=!1);return()=>cancelAnimationFrame(p)},[]),i.jsx($,{present:r||d,children:({present:p})=>i.jsx(E.div,{"data-state":d?"active":"inactive","data-orientation":u.orientation,role:"tabpanel","aria-labelledby":f,hidden:!p,id:m,tabIndex:0,...c,ref:o,style:{...e.style,animationDuration:l.current?"0s":void 0},children:p&&a})})});no.displayName=oo;function ro(e,o){return`${e}-trigger-${o}`}function ao(e,o){return`${e}-content-${o}`}var Sr=Zt,Cr=Qt,xr=to,Rr=no;export{sr as C,et as I,cr as L,ar as P,Qe as R,pr as S,rr as T,wr as V,Fn as a,me as b,Ye as c,mr as d,ir as e,lr as f,dr as g,ur as h,fr as i,nr as j,vr as k,br as l,Kn as m,Hn as n,Cr as o,xr as p,Rr as q,Sr as r,fe as u}; +import{b as W,r as s}from"./react-core-D_V7s-9r.js";import{c as J,u as y,j as i,S as Re,a as Ee,b as G,P as E,d as w,e as ce,f as We,A as co,g as $,h as io,i as lo,F as uo,D as fo,C as po,k as mo,l as He,R as ho,m as vo,n as wo,o as bo,p as go}from"./radix-core-mDeFS0Pz.js";function Ye(e){const o=e+"CollectionProvider",[t,n]=J(o),[r,a]=t(o,{collectionRef:{current:null},itemMap:new Map}),c=v=>{const{scope:h,children:S}=v,R=W.useRef(null),g=W.useRef(new Map).current;return i.jsx(r,{scope:h,itemMap:g,collectionRef:R,children:S})};c.displayName=o;const u=e+"CollectionSlot",f=W.forwardRef((v,h)=>{const{scope:S,children:R}=v,g=a(u,S),C=y(h,g.collectionRef);return i.jsx(Re,{ref:C,children:R})});f.displayName=u;const m=e+"CollectionItemSlot",d="data-radix-collection-item",l=W.forwardRef((v,h)=>{const{scope:S,children:R,...g}=v,C=W.useRef(null),P=y(h,C),I=a(m,S);return W.useEffect(()=>(I.itemMap.set(C,{ref:C,...g}),()=>void I.itemMap.delete(C))),i.jsx(Re,{[d]:"",ref:P,children:R})});l.displayName=m;function p(v){const h=a(e+"CollectionConsumer",v);return W.useCallback(()=>{const R=h.collectionRef.current;if(!R)return[];const g=Array.from(R.querySelectorAll(`[${d}]`));return Array.from(h.itemMap.values()).sort((I,A)=>g.indexOf(I.ref.current)-g.indexOf(A.ref.current))},[h.collectionRef,h.itemMap])}return[{Provider:c,Slot:f,ItemSlot:l},p,n]}var So=s.createContext(void 0);function fe(e){const o=s.useContext(So);return e||o||"ltr"}var xe="rovingFocusGroup.onEntryFocus",Co={bubbles:!1,cancelable:!0},pe="RovingFocusGroup",[Me,ze,xo]=Ye(pe),[Ro,me]=J(pe,[xo]),[Mo,_o]=Ro(pe),Xe=s.forwardRef((e,o)=>i.jsx(Me.Provider,{scope:e.__scopeRovingFocusGroup,children:i.jsx(Me.Slot,{scope:e.__scopeRovingFocusGroup,children:i.jsx(Eo,{...e,ref:o})})}));Xe.displayName=pe;var Eo=s.forwardRef((e,o)=>{const{__scopeRovingFocusGroup:t,orientation:n,loop:r=!1,dir:a,currentTabStopId:c,defaultCurrentTabStopId:u,onCurrentTabStopIdChange:f,onEntryFocus:m,preventScrollOnEntryFocus:d=!1,...l}=e,p=s.useRef(null),v=y(o,p),h=fe(a),[S=null,R]=Ee({prop:c,defaultProp:u,onChange:f}),[g,C]=s.useState(!1),P=G(m),I=ze(t),A=s.useRef(!1),[F,D]=s.useState(0);return s.useEffect(()=>{const M=p.current;if(M)return M.addEventListener(xe,P),()=>M.removeEventListener(xe,P)},[P]),i.jsx(Mo,{scope:t,orientation:n,dir:h,loop:r,currentTabStopId:S,onItemFocus:s.useCallback(M=>R(M),[R]),onItemShiftTab:s.useCallback(()=>C(!0),[]),onFocusableItemAdd:s.useCallback(()=>D(M=>M+1),[]),onFocusableItemRemove:s.useCallback(()=>D(M=>M-1),[]),children:i.jsx(E.div,{tabIndex:g||F===0?-1:0,"data-orientation":n,...l,ref:v,style:{outline:"none",...e.style},onMouseDown:w(e.onMouseDown,()=>{A.current=!0}),onFocus:w(e.onFocus,M=>{const x=!A.current;if(M.target===M.currentTarget&&x&&!g){const _=new CustomEvent(xe,Co);if(M.currentTarget.dispatchEvent(_),!_.defaultPrevented){const N=I().filter(U=>U.focusable),z=N.find(U=>U.active),ae=N.find(U=>U.id===S),ge=[z,ae,...N].filter(Boolean).map(U=>U.ref.current);Je(ge,d)}}A.current=!1}),onBlur:w(e.onBlur,()=>C(!1))})})}),qe="RovingFocusGroupItem",Ze=s.forwardRef((e,o)=>{const{__scopeRovingFocusGroup:t,focusable:n=!0,active:r=!1,tabStopId:a,...c}=e,u=ce(),f=a||u,m=_o(qe,t),d=m.currentTabStopId===f,l=ze(t),{onFocusableItemAdd:p,onFocusableItemRemove:v}=m;return s.useEffect(()=>{if(n)return p(),()=>v()},[n,p,v]),i.jsx(Me.ItemSlot,{scope:t,id:f,focusable:n,active:r,children:i.jsx(E.span,{tabIndex:d?0:-1,"data-orientation":m.orientation,...c,ref:o,onMouseDown:w(e.onMouseDown,h=>{n?m.onItemFocus(f):h.preventDefault()}),onFocus:w(e.onFocus,()=>m.onItemFocus(f)),onKeyDown:w(e.onKeyDown,h=>{if(h.key==="Tab"&&h.shiftKey){m.onItemShiftTab();return}if(h.target!==h.currentTarget)return;const S=Io(h,m.orientation,m.dir);if(S!==void 0){if(h.metaKey||h.ctrlKey||h.altKey||h.shiftKey)return;h.preventDefault();let g=l().filter(C=>C.focusable).map(C=>C.ref.current);if(S==="last")g.reverse();else if(S==="prev"||S==="next"){S==="prev"&&g.reverse();const C=g.indexOf(h.currentTarget);g=m.loop?yo(g,C+1):g.slice(C+1)}setTimeout(()=>Je(g))}})})})});Ze.displayName=qe;var Po={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function To(e,o){return o!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Io(e,o,t){const n=To(e.key,t);if(!(o==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(o==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return Po[n]}function Je(e,o=!1){const t=document.activeElement;for(const n of e)if(n===t||(n.focus({preventScroll:o}),document.activeElement!==t))return}function yo(e,o){return e.map((t,n)=>e[(o+n)%e.length])}var Qe=Xe,et=Ze,_e=["Enter"," "],Ao=["ArrowDown","PageUp","Home"],tt=["ArrowUp","PageDown","End"],Do=[...Ao,...tt],No={ltr:[..._e,"ArrowRight"],rtl:[..._e,"ArrowLeft"]},Oo={ltr:["ArrowLeft"],rtl:["ArrowRight"]},ne="Menu",[te,jo,Lo]=Ye(ne),[H,ot]=J(ne,[Lo,We,me]),he=We(),nt=me(),[Fo,Y]=H(ne),[ko,re]=H(ne),rt=e=>{const{__scopeMenu:o,open:t=!1,children:n,dir:r,onOpenChange:a,modal:c=!0}=e,u=he(o),[f,m]=s.useState(null),d=s.useRef(!1),l=G(a),p=fe(r);return s.useEffect(()=>{const v=()=>{d.current=!0,document.addEventListener("pointerdown",h,{capture:!0,once:!0}),document.addEventListener("pointermove",h,{capture:!0,once:!0})},h=()=>d.current=!1;return document.addEventListener("keydown",v,{capture:!0}),()=>{document.removeEventListener("keydown",v,{capture:!0}),document.removeEventListener("pointerdown",h,{capture:!0}),document.removeEventListener("pointermove",h,{capture:!0})}},[]),i.jsx(bo,{...u,children:i.jsx(Fo,{scope:o,open:t,onOpenChange:l,content:f,onContentChange:m,children:i.jsx(ko,{scope:o,onClose:s.useCallback(()=>l(!1),[l]),isUsingKeyboardRef:d,dir:p,modal:c,children:n})})})};rt.displayName=ne;var Go="MenuAnchor",Pe=s.forwardRef((e,o)=>{const{__scopeMenu:t,...n}=e,r=he(t);return i.jsx(co,{...r,...n,ref:o})});Pe.displayName=Go;var Te="MenuPortal",[Ko,at]=H(Te,{forceMount:void 0}),st=e=>{const{__scopeMenu:o,forceMount:t,children:n,container:r}=e,a=Y(Te,o);return i.jsx(Ko,{scope:o,forceMount:t,children:i.jsx($,{present:t||a.open,children:i.jsx(wo,{asChild:!0,container:r,children:n})})})};st.displayName=Te;var j="MenuContent",[Uo,Ie]=H(j),ct=s.forwardRef((e,o)=>{const t=at(j,e.__scopeMenu),{forceMount:n=t.forceMount,...r}=e,a=Y(j,e.__scopeMenu),c=re(j,e.__scopeMenu);return i.jsx(te.Provider,{scope:e.__scopeMenu,children:i.jsx($,{present:n||a.open,children:i.jsx(te.Slot,{scope:e.__scopeMenu,children:c.modal?i.jsx(Vo,{...r,ref:o}):i.jsx($o,{...r,ref:o})})})})}),Vo=s.forwardRef((e,o)=>{const t=Y(j,e.__scopeMenu),n=s.useRef(null),r=y(o,n);return s.useEffect(()=>{const a=n.current;if(a)return io(a)},[]),i.jsx(ye,{...e,ref:r,trapFocus:t.open,disableOutsidePointerEvents:t.open,disableOutsideScroll:!0,onFocusOutside:w(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>t.onOpenChange(!1)})}),$o=s.forwardRef((e,o)=>{const t=Y(j,e.__scopeMenu);return i.jsx(ye,{...e,ref:o,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>t.onOpenChange(!1)})}),ye=s.forwardRef((e,o)=>{const{__scopeMenu:t,loop:n=!1,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:c,disableOutsidePointerEvents:u,onEntryFocus:f,onEscapeKeyDown:m,onPointerDownOutside:d,onFocusOutside:l,onInteractOutside:p,onDismiss:v,disableOutsideScroll:h,...S}=e,R=Y(j,t),g=re(j,t),C=he(t),P=nt(t),I=jo(t),[A,F]=s.useState(null),D=s.useRef(null),M=y(o,D,R.onContentChange),x=s.useRef(0),_=s.useRef(""),N=s.useRef(0),z=s.useRef(null),ae=s.useRef("right"),se=s.useRef(0),ge=h?ho:s.Fragment,U=h?{as:Re,allowPinchZoom:!0}:void 0,so=b=>{var q,Ue;const O=_.current+b,k=I().filter(V=>!V.disabled),B=document.activeElement,Se=(q=k.find(V=>V.ref.current===B))==null?void 0:q.textValue,Ce=k.map(V=>V.textValue),Ke=tn(Ce,O,Se),Q=(Ue=k.find(V=>V.textValue===Ke))==null?void 0:Ue.ref.current;(function V(Ve){_.current=Ve,window.clearTimeout(x.current),Ve!==""&&(x.current=window.setTimeout(()=>V(""),1e3))})(O),Q&&setTimeout(()=>Q.focus())};s.useEffect(()=>()=>window.clearTimeout(x.current),[]),lo();const X=s.useCallback(b=>{var k,B;return ae.current===((k=z.current)==null?void 0:k.side)&&nn(b,(B=z.current)==null?void 0:B.area)},[]);return i.jsx(Uo,{scope:t,searchRef:_,onItemEnter:s.useCallback(b=>{X(b)&&b.preventDefault()},[X]),onItemLeave:s.useCallback(b=>{var O;X(b)||((O=D.current)==null||O.focus(),F(null))},[X]),onTriggerLeave:s.useCallback(b=>{X(b)&&b.preventDefault()},[X]),pointerGraceTimerRef:N,onPointerGraceIntentChange:s.useCallback(b=>{z.current=b},[]),children:i.jsx(ge,{...U,children:i.jsx(uo,{asChild:!0,trapped:r,onMountAutoFocus:w(a,b=>{var O;b.preventDefault(),(O=D.current)==null||O.focus({preventScroll:!0})}),onUnmountAutoFocus:c,children:i.jsx(fo,{asChild:!0,disableOutsidePointerEvents:u,onEscapeKeyDown:m,onPointerDownOutside:d,onFocusOutside:l,onInteractOutside:p,onDismiss:v,children:i.jsx(Qe,{asChild:!0,...P,dir:g.dir,orientation:"vertical",loop:n,currentTabStopId:A,onCurrentTabStopIdChange:F,onEntryFocus:w(f,b=>{g.isUsingKeyboardRef.current||b.preventDefault()}),preventScrollOnEntryFocus:!0,children:i.jsx(po,{role:"menu","aria-orientation":"vertical","data-state":Rt(R.open),"data-radix-menu-content":"",dir:g.dir,...C,...S,ref:M,style:{outline:"none",...S.style},onKeyDown:w(S.onKeyDown,b=>{const k=b.target.closest("[data-radix-menu-content]")===b.currentTarget,B=b.ctrlKey||b.altKey||b.metaKey,Se=b.key.length===1;k&&(b.key==="Tab"&&b.preventDefault(),!B&&Se&&so(b.key));const Ce=D.current;if(b.target!==Ce||!Do.includes(b.key))return;b.preventDefault();const Q=I().filter(q=>!q.disabled).map(q=>q.ref.current);tt.includes(b.key)&&Q.reverse(),Qo(Q)}),onBlur:w(e.onBlur,b=>{b.currentTarget.contains(b.target)||(window.clearTimeout(x.current),_.current="")}),onPointerMove:w(e.onPointerMove,oe(b=>{const O=b.target,k=se.current!==b.clientX;if(b.currentTarget.contains(O)&&k){const B=b.clientX>se.current?"right":"left";ae.current=B,se.current=b.clientX}}))})})})})})})});ct.displayName=j;var Bo="MenuGroup",Ae=s.forwardRef((e,o)=>{const{__scopeMenu:t,...n}=e;return i.jsx(E.div,{role:"group",...n,ref:o})});Ae.displayName=Bo;var Wo="MenuLabel",it=s.forwardRef((e,o)=>{const{__scopeMenu:t,...n}=e;return i.jsx(E.div,{...n,ref:o})});it.displayName=Wo;var ie="MenuItem",$e="menu.itemSelect",ve=s.forwardRef((e,o)=>{const{disabled:t=!1,onSelect:n,...r}=e,a=s.useRef(null),c=re(ie,e.__scopeMenu),u=Ie(ie,e.__scopeMenu),f=y(o,a),m=s.useRef(!1),d=()=>{const l=a.current;if(!t&&l){const p=new CustomEvent($e,{bubbles:!0,cancelable:!0});l.addEventListener($e,v=>n==null?void 0:n(v),{once:!0}),vo(l,p),p.defaultPrevented?m.current=!1:c.onClose()}};return i.jsx(lt,{...r,ref:f,disabled:t,onClick:w(e.onClick,d),onPointerDown:l=>{var p;(p=e.onPointerDown)==null||p.call(e,l),m.current=!0},onPointerUp:w(e.onPointerUp,l=>{var p;m.current||(p=l.currentTarget)==null||p.click()}),onKeyDown:w(e.onKeyDown,l=>{const p=u.searchRef.current!=="";t||p&&l.key===" "||_e.includes(l.key)&&(l.currentTarget.click(),l.preventDefault())})})});ve.displayName=ie;var lt=s.forwardRef((e,o)=>{const{__scopeMenu:t,disabled:n=!1,textValue:r,...a}=e,c=Ie(ie,t),u=nt(t),f=s.useRef(null),m=y(o,f),[d,l]=s.useState(!1),[p,v]=s.useState("");return s.useEffect(()=>{const h=f.current;h&&v((h.textContent??"").trim())},[a.children]),i.jsx(te.ItemSlot,{scope:t,disabled:n,textValue:r??p,children:i.jsx(et,{asChild:!0,...u,focusable:!n,children:i.jsx(E.div,{role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":n||void 0,"data-disabled":n?"":void 0,...a,ref:m,onPointerMove:w(e.onPointerMove,oe(h=>{n?c.onItemLeave(h):(c.onItemEnter(h),h.defaultPrevented||h.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:w(e.onPointerLeave,oe(h=>c.onItemLeave(h))),onFocus:w(e.onFocus,()=>l(!0)),onBlur:w(e.onBlur,()=>l(!1))})})})}),Ho="MenuCheckboxItem",ut=s.forwardRef((e,o)=>{const{checked:t=!1,onCheckedChange:n,...r}=e;return i.jsx(ht,{scope:e.__scopeMenu,checked:t,children:i.jsx(ve,{role:"menuitemcheckbox","aria-checked":le(t)?"mixed":t,...r,ref:o,"data-state":Ne(t),onSelect:w(r.onSelect,()=>n==null?void 0:n(le(t)?!0:!t),{checkForDefaultPrevented:!1})})})});ut.displayName=Ho;var dt="MenuRadioGroup",[Yo,zo]=H(dt,{value:void 0,onValueChange:()=>{}}),ft=s.forwardRef((e,o)=>{const{value:t,onValueChange:n,...r}=e,a=G(n);return i.jsx(Yo,{scope:e.__scopeMenu,value:t,onValueChange:a,children:i.jsx(Ae,{...r,ref:o})})});ft.displayName=dt;var pt="MenuRadioItem",mt=s.forwardRef((e,o)=>{const{value:t,...n}=e,r=zo(pt,e.__scopeMenu),a=t===r.value;return i.jsx(ht,{scope:e.__scopeMenu,checked:a,children:i.jsx(ve,{role:"menuitemradio","aria-checked":a,...n,ref:o,"data-state":Ne(a),onSelect:w(n.onSelect,()=>{var c;return(c=r.onValueChange)==null?void 0:c.call(r,t)},{checkForDefaultPrevented:!1})})})});mt.displayName=pt;var De="MenuItemIndicator",[ht,Xo]=H(De,{checked:!1}),vt=s.forwardRef((e,o)=>{const{__scopeMenu:t,forceMount:n,...r}=e,a=Xo(De,t);return i.jsx($,{present:n||le(a.checked)||a.checked===!0,children:i.jsx(E.span,{...r,ref:o,"data-state":Ne(a.checked)})})});vt.displayName=De;var qo="MenuSeparator",wt=s.forwardRef((e,o)=>{const{__scopeMenu:t,...n}=e;return i.jsx(E.div,{role:"separator","aria-orientation":"horizontal",...n,ref:o})});wt.displayName=qo;var Zo="MenuArrow",bt=s.forwardRef((e,o)=>{const{__scopeMenu:t,...n}=e,r=he(t);return i.jsx(mo,{...r,...n,ref:o})});bt.displayName=Zo;var Jo="MenuSub",[tr,gt]=H(Jo),ee="MenuSubTrigger",St=s.forwardRef((e,o)=>{const t=Y(ee,e.__scopeMenu),n=re(ee,e.__scopeMenu),r=gt(ee,e.__scopeMenu),a=Ie(ee,e.__scopeMenu),c=s.useRef(null),{pointerGraceTimerRef:u,onPointerGraceIntentChange:f}=a,m={__scopeMenu:e.__scopeMenu},d=s.useCallback(()=>{c.current&&window.clearTimeout(c.current),c.current=null},[]);return s.useEffect(()=>d,[d]),s.useEffect(()=>{const l=u.current;return()=>{window.clearTimeout(l),f(null)}},[u,f]),i.jsx(Pe,{asChild:!0,...m,children:i.jsx(lt,{id:r.triggerId,"aria-haspopup":"menu","aria-expanded":t.open,"aria-controls":r.contentId,"data-state":Rt(t.open),...e,ref:He(o,r.onTriggerChange),onClick:l=>{var p;(p=e.onClick)==null||p.call(e,l),!(e.disabled||l.defaultPrevented)&&(l.currentTarget.focus(),t.open||t.onOpenChange(!0))},onPointerMove:w(e.onPointerMove,oe(l=>{a.onItemEnter(l),!l.defaultPrevented&&!e.disabled&&!t.open&&!c.current&&(a.onPointerGraceIntentChange(null),c.current=window.setTimeout(()=>{t.onOpenChange(!0),d()},100))})),onPointerLeave:w(e.onPointerLeave,oe(l=>{var v,h;d();const p=(v=t.content)==null?void 0:v.getBoundingClientRect();if(p){const S=(h=t.content)==null?void 0:h.dataset.side,R=S==="right",g=R?-5:5,C=p[R?"left":"right"],P=p[R?"right":"left"];a.onPointerGraceIntentChange({area:[{x:l.clientX+g,y:l.clientY},{x:C,y:p.top},{x:P,y:p.top},{x:P,y:p.bottom},{x:C,y:p.bottom}],side:S}),window.clearTimeout(u.current),u.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(l),l.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:w(e.onKeyDown,l=>{var v;const p=a.searchRef.current!=="";e.disabled||p&&l.key===" "||No[n.dir].includes(l.key)&&(t.onOpenChange(!0),(v=t.content)==null||v.focus(),l.preventDefault())})})})});St.displayName=ee;var Ct="MenuSubContent",xt=s.forwardRef((e,o)=>{const t=at(j,e.__scopeMenu),{forceMount:n=t.forceMount,...r}=e,a=Y(j,e.__scopeMenu),c=re(j,e.__scopeMenu),u=gt(Ct,e.__scopeMenu),f=s.useRef(null),m=y(o,f);return i.jsx(te.Provider,{scope:e.__scopeMenu,children:i.jsx($,{present:n||a.open,children:i.jsx(te.Slot,{scope:e.__scopeMenu,children:i.jsx(ye,{id:u.contentId,"aria-labelledby":u.triggerId,...r,ref:m,align:"start",side:c.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:d=>{var l;c.isUsingKeyboardRef.current&&((l=f.current)==null||l.focus()),d.preventDefault()},onCloseAutoFocus:d=>d.preventDefault(),onFocusOutside:w(e.onFocusOutside,d=>{d.target!==u.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:w(e.onEscapeKeyDown,d=>{c.onClose(),d.preventDefault()}),onKeyDown:w(e.onKeyDown,d=>{var v;const l=d.currentTarget.contains(d.target),p=Oo[c.dir].includes(d.key);l&&p&&(a.onOpenChange(!1),(v=u.trigger)==null||v.focus(),d.preventDefault())})})})})})});xt.displayName=Ct;function Rt(e){return e?"open":"closed"}function le(e){return e==="indeterminate"}function Ne(e){return le(e)?"indeterminate":e?"checked":"unchecked"}function Qo(e){const o=document.activeElement;for(const t of e)if(t===o||(t.focus(),document.activeElement!==o))return}function en(e,o){return e.map((t,n)=>e[(o+n)%e.length])}function tn(e,o,t){const r=o.length>1&&Array.from(o).every(m=>m===o[0])?o[0]:o,a=t?e.indexOf(t):-1;let c=en(e,Math.max(a,0));r.length===1&&(c=c.filter(m=>m!==t));const f=c.find(m=>m.toLowerCase().startsWith(r.toLowerCase()));return f!==t?f:void 0}function on(e,o){const{x:t,y:n}=e;let r=!1;for(let a=0,c=o.length-1;an!=d>n&&t<(m-u)*(n-f)/(d-f)+u&&(r=!r)}return r}function nn(e,o){if(!o)return!1;const t={x:e.clientX,y:e.clientY};return on(t,o)}function oe(e){return o=>o.pointerType==="mouse"?e(o):void 0}var rn=rt,an=Pe,sn=st,cn=ct,ln=Ae,un=it,dn=ve,fn=ut,pn=ft,mn=mt,hn=vt,vn=wt,wn=bt,bn=St,gn=xt,Oe="DropdownMenu",[Sn,or]=J(Oe,[ot]),T=ot(),[Cn,Mt]=Sn(Oe),_t=e=>{const{__scopeDropdownMenu:o,children:t,dir:n,open:r,defaultOpen:a,onOpenChange:c,modal:u=!0}=e,f=T(o),m=s.useRef(null),[d=!1,l]=Ee({prop:r,defaultProp:a,onChange:c});return i.jsx(Cn,{scope:o,triggerId:ce(),triggerRef:m,contentId:ce(),open:d,onOpenChange:l,onOpenToggle:s.useCallback(()=>l(p=>!p),[l]),modal:u,children:i.jsx(rn,{...f,open:d,onOpenChange:l,dir:n,modal:u,children:t})})};_t.displayName=Oe;var Et="DropdownMenuTrigger",Pt=s.forwardRef((e,o)=>{const{__scopeDropdownMenu:t,disabled:n=!1,...r}=e,a=Mt(Et,t),c=T(t);return i.jsx(an,{asChild:!0,...c,children:i.jsx(E.button,{type:"button",id:a.triggerId,"aria-haspopup":"menu","aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?"open":"closed","data-disabled":n?"":void 0,disabled:n,...r,ref:He(o,a.triggerRef),onPointerDown:w(e.onPointerDown,u=>{!n&&u.button===0&&u.ctrlKey===!1&&(a.onOpenToggle(),a.open||u.preventDefault())}),onKeyDown:w(e.onKeyDown,u=>{n||(["Enter"," "].includes(u.key)&&a.onOpenToggle(),u.key==="ArrowDown"&&a.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(u.key)&&u.preventDefault())})})})});Pt.displayName=Et;var xn="DropdownMenuPortal",Tt=e=>{const{__scopeDropdownMenu:o,...t}=e,n=T(o);return i.jsx(sn,{...n,...t})};Tt.displayName=xn;var It="DropdownMenuContent",yt=s.forwardRef((e,o)=>{const{__scopeDropdownMenu:t,...n}=e,r=Mt(It,t),a=T(t),c=s.useRef(!1);return i.jsx(cn,{id:r.contentId,"aria-labelledby":r.triggerId,...a,...n,ref:o,onCloseAutoFocus:w(e.onCloseAutoFocus,u=>{var f;c.current||(f=r.triggerRef.current)==null||f.focus(),c.current=!1,u.preventDefault()}),onInteractOutside:w(e.onInteractOutside,u=>{const f=u.detail.originalEvent,m=f.button===0&&f.ctrlKey===!0,d=f.button===2||m;(!r.modal||d)&&(c.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});yt.displayName=It;var Rn="DropdownMenuGroup",Mn=s.forwardRef((e,o)=>{const{__scopeDropdownMenu:t,...n}=e,r=T(t);return i.jsx(ln,{...r,...n,ref:o})});Mn.displayName=Rn;var _n="DropdownMenuLabel",At=s.forwardRef((e,o)=>{const{__scopeDropdownMenu:t,...n}=e,r=T(t);return i.jsx(un,{...r,...n,ref:o})});At.displayName=_n;var En="DropdownMenuItem",Dt=s.forwardRef((e,o)=>{const{__scopeDropdownMenu:t,...n}=e,r=T(t);return i.jsx(dn,{...r,...n,ref:o})});Dt.displayName=En;var Pn="DropdownMenuCheckboxItem",Nt=s.forwardRef((e,o)=>{const{__scopeDropdownMenu:t,...n}=e,r=T(t);return i.jsx(fn,{...r,...n,ref:o})});Nt.displayName=Pn;var Tn="DropdownMenuRadioGroup",In=s.forwardRef((e,o)=>{const{__scopeDropdownMenu:t,...n}=e,r=T(t);return i.jsx(pn,{...r,...n,ref:o})});In.displayName=Tn;var yn="DropdownMenuRadioItem",Ot=s.forwardRef((e,o)=>{const{__scopeDropdownMenu:t,...n}=e,r=T(t);return i.jsx(mn,{...r,...n,ref:o})});Ot.displayName=yn;var An="DropdownMenuItemIndicator",jt=s.forwardRef((e,o)=>{const{__scopeDropdownMenu:t,...n}=e,r=T(t);return i.jsx(hn,{...r,...n,ref:o})});jt.displayName=An;var Dn="DropdownMenuSeparator",Lt=s.forwardRef((e,o)=>{const{__scopeDropdownMenu:t,...n}=e,r=T(t);return i.jsx(vn,{...r,...n,ref:o})});Lt.displayName=Dn;var Nn="DropdownMenuArrow",On=s.forwardRef((e,o)=>{const{__scopeDropdownMenu:t,...n}=e,r=T(t);return i.jsx(wn,{...r,...n,ref:o})});On.displayName=Nn;var jn="DropdownMenuSubTrigger",Ft=s.forwardRef((e,o)=>{const{__scopeDropdownMenu:t,...n}=e,r=T(t);return i.jsx(bn,{...r,...n,ref:o})});Ft.displayName=jn;var Ln="DropdownMenuSubContent",kt=s.forwardRef((e,o)=>{const{__scopeDropdownMenu:t,...n}=e,r=T(t);return i.jsx(gn,{...r,...n,ref:o,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});kt.displayName=Ln;var nr=_t,rr=Pt,ar=Tt,sr=yt,cr=At,ir=Dt,lr=Nt,ur=Ot,dr=jt,fr=Lt,pr=Ft,mr=kt;function Fn(e,[o,t]){return Math.min(t,Math.max(o,e))}function kn(e,o){return s.useReducer((t,n)=>o[t][n]??t,e)}var je="ScrollArea",[Gt,hr]=J(je),[Gn,L]=Gt(je),Kt=s.forwardRef((e,o)=>{const{__scopeScrollArea:t,type:n="hover",dir:r,scrollHideDelay:a=600,...c}=e,[u,f]=s.useState(null),[m,d]=s.useState(null),[l,p]=s.useState(null),[v,h]=s.useState(null),[S,R]=s.useState(null),[g,C]=s.useState(0),[P,I]=s.useState(0),[A,F]=s.useState(!1),[D,M]=s.useState(!1),x=y(o,N=>f(N)),_=fe(r);return i.jsx(Gn,{scope:t,type:n,dir:_,scrollHideDelay:a,scrollArea:u,viewport:m,onViewportChange:d,content:l,onContentChange:p,scrollbarX:v,onScrollbarXChange:h,scrollbarXEnabled:A,onScrollbarXEnabledChange:F,scrollbarY:S,onScrollbarYChange:R,scrollbarYEnabled:D,onScrollbarYEnabledChange:M,onCornerWidthChange:C,onCornerHeightChange:I,children:i.jsx(E.div,{dir:_,...c,ref:x,style:{position:"relative","--radix-scroll-area-corner-width":g+"px","--radix-scroll-area-corner-height":P+"px",...e.style}})})});Kt.displayName=je;var Ut="ScrollAreaViewport",Vt=s.forwardRef((e,o)=>{const{__scopeScrollArea:t,children:n,nonce:r,...a}=e,c=L(Ut,t),u=s.useRef(null),f=y(o,u,c.onViewportChange);return i.jsxs(i.Fragment,{children:[i.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),i.jsx(E.div,{"data-radix-scroll-area-viewport":"",...a,ref:f,style:{overflowX:c.scrollbarXEnabled?"scroll":"hidden",overflowY:c.scrollbarYEnabled?"scroll":"hidden",...e.style},children:i.jsx("div",{ref:c.onContentChange,style:{minWidth:"100%",display:"table"},children:n})})]})});Vt.displayName=Ut;var K="ScrollAreaScrollbar",Kn=s.forwardRef((e,o)=>{const{forceMount:t,...n}=e,r=L(K,e.__scopeScrollArea),{onScrollbarXEnabledChange:a,onScrollbarYEnabledChange:c}=r,u=e.orientation==="horizontal";return s.useEffect(()=>(u?a(!0):c(!0),()=>{u?a(!1):c(!1)}),[u,a,c]),r.type==="hover"?i.jsx(Un,{...n,ref:o,forceMount:t}):r.type==="scroll"?i.jsx(Vn,{...n,ref:o,forceMount:t}):r.type==="auto"?i.jsx($t,{...n,ref:o,forceMount:t}):r.type==="always"?i.jsx(Le,{...n,ref:o}):null});Kn.displayName=K;var Un=s.forwardRef((e,o)=>{const{forceMount:t,...n}=e,r=L(K,e.__scopeScrollArea),[a,c]=s.useState(!1);return s.useEffect(()=>{const u=r.scrollArea;let f=0;if(u){const m=()=>{window.clearTimeout(f),c(!0)},d=()=>{f=window.setTimeout(()=>c(!1),r.scrollHideDelay)};return u.addEventListener("pointerenter",m),u.addEventListener("pointerleave",d),()=>{window.clearTimeout(f),u.removeEventListener("pointerenter",m),u.removeEventListener("pointerleave",d)}}},[r.scrollArea,r.scrollHideDelay]),i.jsx($,{present:t||a,children:i.jsx($t,{"data-state":a?"visible":"hidden",...n,ref:o})})}),Vn=s.forwardRef((e,o)=>{const{forceMount:t,...n}=e,r=L(K,e.__scopeScrollArea),a=e.orientation==="horizontal",c=be(()=>f("SCROLL_END"),100),[u,f]=kn("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return s.useEffect(()=>{if(u==="idle"){const m=window.setTimeout(()=>f("HIDE"),r.scrollHideDelay);return()=>window.clearTimeout(m)}},[u,r.scrollHideDelay,f]),s.useEffect(()=>{const m=r.viewport,d=a?"scrollLeft":"scrollTop";if(m){let l=m[d];const p=()=>{const v=m[d];l!==v&&(f("SCROLL"),c()),l=v};return m.addEventListener("scroll",p),()=>m.removeEventListener("scroll",p)}},[r.viewport,a,f,c]),i.jsx($,{present:t||u!=="hidden",children:i.jsx(Le,{"data-state":u==="hidden"?"hidden":"visible",...n,ref:o,onPointerEnter:w(e.onPointerEnter,()=>f("POINTER_ENTER")),onPointerLeave:w(e.onPointerLeave,()=>f("POINTER_LEAVE"))})})}),$t=s.forwardRef((e,o)=>{const t=L(K,e.__scopeScrollArea),{forceMount:n,...r}=e,[a,c]=s.useState(!1),u=e.orientation==="horizontal",f=be(()=>{if(t.viewport){const m=t.viewport.offsetWidth{const{orientation:t="vertical",...n}=e,r=L(K,e.__scopeScrollArea),a=s.useRef(null),c=s.useRef(0),[u,f]=s.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),m=Yt(u.viewport,u.content),d={...n,sizes:u,onSizesChange:f,hasThumb:m>0&&m<1,onThumbChange:p=>a.current=p,onThumbPointerUp:()=>c.current=0,onThumbPointerDown:p=>c.current=p};function l(p,v){return Xn(p,c.current,u,v)}return t==="horizontal"?i.jsx($n,{...d,ref:o,onThumbPositionChange:()=>{if(r.viewport&&a.current){const p=r.viewport.scrollLeft,v=Be(p,u,r.dir);a.current.style.transform=`translate3d(${v}px, 0, 0)`}},onWheelScroll:p=>{r.viewport&&(r.viewport.scrollLeft=p)},onDragScroll:p=>{r.viewport&&(r.viewport.scrollLeft=l(p,r.dir))}}):t==="vertical"?i.jsx(Bn,{...d,ref:o,onThumbPositionChange:()=>{if(r.viewport&&a.current){const p=r.viewport.scrollTop,v=Be(p,u);a.current.style.transform=`translate3d(0, ${v}px, 0)`}},onWheelScroll:p=>{r.viewport&&(r.viewport.scrollTop=p)},onDragScroll:p=>{r.viewport&&(r.viewport.scrollTop=l(p))}}):null}),$n=s.forwardRef((e,o)=>{const{sizes:t,onSizesChange:n,...r}=e,a=L(K,e.__scopeScrollArea),[c,u]=s.useState(),f=s.useRef(null),m=y(o,f,a.onScrollbarXChange);return s.useEffect(()=>{f.current&&u(getComputedStyle(f.current))},[f]),i.jsx(Wt,{"data-orientation":"horizontal",...r,ref:m,sizes:t,style:{bottom:0,left:a.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:a.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":we(t)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.x),onDragScroll:d=>e.onDragScroll(d.x),onWheelScroll:(d,l)=>{if(a.viewport){const p=a.viewport.scrollLeft+d.deltaX;e.onWheelScroll(p),Xt(p,l)&&d.preventDefault()}},onResize:()=>{f.current&&a.viewport&&c&&n({content:a.viewport.scrollWidth,viewport:a.viewport.offsetWidth,scrollbar:{size:f.current.clientWidth,paddingStart:de(c.paddingLeft),paddingEnd:de(c.paddingRight)}})}})}),Bn=s.forwardRef((e,o)=>{const{sizes:t,onSizesChange:n,...r}=e,a=L(K,e.__scopeScrollArea),[c,u]=s.useState(),f=s.useRef(null),m=y(o,f,a.onScrollbarYChange);return s.useEffect(()=>{f.current&&u(getComputedStyle(f.current))},[f]),i.jsx(Wt,{"data-orientation":"vertical",...r,ref:m,sizes:t,style:{top:0,right:a.dir==="ltr"?0:void 0,left:a.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":we(t)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.y),onDragScroll:d=>e.onDragScroll(d.y),onWheelScroll:(d,l)=>{if(a.viewport){const p=a.viewport.scrollTop+d.deltaY;e.onWheelScroll(p),Xt(p,l)&&d.preventDefault()}},onResize:()=>{f.current&&a.viewport&&c&&n({content:a.viewport.scrollHeight,viewport:a.viewport.offsetHeight,scrollbar:{size:f.current.clientHeight,paddingStart:de(c.paddingTop),paddingEnd:de(c.paddingBottom)}})}})}),[Wn,Bt]=Gt(K),Wt=s.forwardRef((e,o)=>{const{__scopeScrollArea:t,sizes:n,hasThumb:r,onThumbChange:a,onThumbPointerUp:c,onThumbPointerDown:u,onThumbPositionChange:f,onDragScroll:m,onWheelScroll:d,onResize:l,...p}=e,v=L(K,t),[h,S]=s.useState(null),R=y(o,x=>S(x)),g=s.useRef(null),C=s.useRef(""),P=v.viewport,I=n.content-n.viewport,A=G(d),F=G(f),D=be(l,10);function M(x){if(g.current){const _=x.clientX-g.current.left,N=x.clientY-g.current.top;m({x:_,y:N})}}return s.useEffect(()=>{const x=_=>{const N=_.target;(h==null?void 0:h.contains(N))&&A(_,I)};return document.addEventListener("wheel",x,{passive:!1}),()=>document.removeEventListener("wheel",x,{passive:!1})},[P,h,I,A]),s.useEffect(F,[n,F]),Z(h,D),Z(v.content,D),i.jsx(Wn,{scope:t,scrollbar:h,hasThumb:r,onThumbChange:G(a),onThumbPointerUp:G(c),onThumbPositionChange:F,onThumbPointerDown:G(u),children:i.jsx(E.div,{...p,ref:R,style:{position:"absolute",...p.style},onPointerDown:w(e.onPointerDown,x=>{x.button===0&&(x.target.setPointerCapture(x.pointerId),g.current=h.getBoundingClientRect(),C.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",v.viewport&&(v.viewport.style.scrollBehavior="auto"),M(x))}),onPointerMove:w(e.onPointerMove,M),onPointerUp:w(e.onPointerUp,x=>{const _=x.target;_.hasPointerCapture(x.pointerId)&&_.releasePointerCapture(x.pointerId),document.body.style.webkitUserSelect=C.current,v.viewport&&(v.viewport.style.scrollBehavior=""),g.current=null})})})}),ue="ScrollAreaThumb",Hn=s.forwardRef((e,o)=>{const{forceMount:t,...n}=e,r=Bt(ue,e.__scopeScrollArea);return i.jsx($,{present:t||r.hasThumb,children:i.jsx(Yn,{ref:o,...n})})}),Yn=s.forwardRef((e,o)=>{const{__scopeScrollArea:t,style:n,...r}=e,a=L(ue,t),c=Bt(ue,t),{onThumbPositionChange:u}=c,f=y(o,l=>c.onThumbChange(l)),m=s.useRef(void 0),d=be(()=>{m.current&&(m.current(),m.current=void 0)},100);return s.useEffect(()=>{const l=a.viewport;if(l){const p=()=>{if(d(),!m.current){const v=qn(l,u);m.current=v,u()}};return u(),l.addEventListener("scroll",p),()=>l.removeEventListener("scroll",p)}},[a.viewport,d,u]),i.jsx(E.div,{"data-state":c.hasThumb?"visible":"hidden",...r,ref:f,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...n},onPointerDownCapture:w(e.onPointerDownCapture,l=>{const v=l.target.getBoundingClientRect(),h=l.clientX-v.left,S=l.clientY-v.top;c.onThumbPointerDown({x:h,y:S})}),onPointerUp:w(e.onPointerUp,c.onThumbPointerUp)})});Hn.displayName=ue;var Fe="ScrollAreaCorner",Ht=s.forwardRef((e,o)=>{const t=L(Fe,e.__scopeScrollArea),n=!!(t.scrollbarX&&t.scrollbarY);return t.type!=="scroll"&&n?i.jsx(zn,{...e,ref:o}):null});Ht.displayName=Fe;var zn=s.forwardRef((e,o)=>{const{__scopeScrollArea:t,...n}=e,r=L(Fe,t),[a,c]=s.useState(0),[u,f]=s.useState(0),m=!!(a&&u);return Z(r.scrollbarX,()=>{var l;const d=((l=r.scrollbarX)==null?void 0:l.offsetHeight)||0;r.onCornerHeightChange(d),f(d)}),Z(r.scrollbarY,()=>{var l;const d=((l=r.scrollbarY)==null?void 0:l.offsetWidth)||0;r.onCornerWidthChange(d),c(d)}),m?i.jsx(E.div,{...n,ref:o,style:{width:a,height:u,position:"absolute",right:r.dir==="ltr"?0:void 0,left:r.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function de(e){return e?parseInt(e,10):0}function Yt(e,o){const t=e/o;return isNaN(t)?0:t}function we(e){const o=Yt(e.viewport,e.content),t=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=(e.scrollbar.size-t)*o;return Math.max(n,18)}function Xn(e,o,t,n="ltr"){const r=we(t),a=r/2,c=o||a,u=r-c,f=t.scrollbar.paddingStart+c,m=t.scrollbar.size-t.scrollbar.paddingEnd-u,d=t.content-t.viewport,l=n==="ltr"?[0,d]:[d*-1,0];return zt([f,m],l)(e)}function Be(e,o,t="ltr"){const n=we(o),r=o.scrollbar.paddingStart+o.scrollbar.paddingEnd,a=o.scrollbar.size-r,c=o.content-o.viewport,u=a-n,f=t==="ltr"?[0,c]:[c*-1,0],m=Fn(e,f);return zt([0,c],[0,u])(m)}function zt(e,o){return t=>{if(e[0]===e[1]||o[0]===o[1])return o[0];const n=(o[1]-o[0])/(e[1]-e[0]);return o[0]+n*(t-e[0])}}function Xt(e,o){return e>0&&e{})=>{let t={left:e.scrollLeft,top:e.scrollTop},n=0;return function r(){const a={left:e.scrollLeft,top:e.scrollTop},c=t.left!==a.left,u=t.top!==a.top;(c||u)&&o(),t=a,n=window.requestAnimationFrame(r)}(),()=>window.cancelAnimationFrame(n)};function be(e,o){const t=G(e),n=s.useRef(0);return s.useEffect(()=>()=>window.clearTimeout(n.current),[]),s.useCallback(()=>{window.clearTimeout(n.current),n.current=window.setTimeout(t,o)},[t,o])}function Z(e,o){const t=G(o);go(()=>{let n=0;if(e){const r=new ResizeObserver(()=>{cancelAnimationFrame(n),n=window.requestAnimationFrame(t)});return r.observe(e),()=>{window.cancelAnimationFrame(n),r.unobserve(e)}}},[e,t])}var vr=Kt,wr=Vt,br=Ht,ke="Tabs",[Zn,gr]=J(ke,[me]),qt=me(),[Jn,Ge]=Zn(ke),Zt=s.forwardRef((e,o)=>{const{__scopeTabs:t,value:n,onValueChange:r,defaultValue:a,orientation:c="horizontal",dir:u,activationMode:f="automatic",...m}=e,d=fe(u),[l,p]=Ee({prop:n,onChange:r,defaultProp:a});return i.jsx(Jn,{scope:t,baseId:ce(),value:l,onValueChange:p,orientation:c,dir:d,activationMode:f,children:i.jsx(E.div,{dir:d,"data-orientation":c,...m,ref:o})})});Zt.displayName=ke;var Jt="TabsList",Qt=s.forwardRef((e,o)=>{const{__scopeTabs:t,loop:n=!0,...r}=e,a=Ge(Jt,t),c=qt(t);return i.jsx(Qe,{asChild:!0,...c,orientation:a.orientation,dir:a.dir,loop:n,children:i.jsx(E.div,{role:"tablist","aria-orientation":a.orientation,...r,ref:o})})});Qt.displayName=Jt;var eo="TabsTrigger",to=s.forwardRef((e,o)=>{const{__scopeTabs:t,value:n,disabled:r=!1,...a}=e,c=Ge(eo,t),u=qt(t),f=ro(c.baseId,n),m=ao(c.baseId,n),d=n===c.value;return i.jsx(et,{asChild:!0,...u,focusable:!r,active:d,children:i.jsx(E.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":m,"data-state":d?"active":"inactive","data-disabled":r?"":void 0,disabled:r,id:f,...a,ref:o,onMouseDown:w(e.onMouseDown,l=>{!r&&l.button===0&&l.ctrlKey===!1?c.onValueChange(n):l.preventDefault()}),onKeyDown:w(e.onKeyDown,l=>{[" ","Enter"].includes(l.key)&&c.onValueChange(n)}),onFocus:w(e.onFocus,()=>{const l=c.activationMode!=="manual";!d&&!r&&l&&c.onValueChange(n)})})})});to.displayName=eo;var oo="TabsContent",no=s.forwardRef((e,o)=>{const{__scopeTabs:t,value:n,forceMount:r,children:a,...c}=e,u=Ge(oo,t),f=ro(u.baseId,n),m=ao(u.baseId,n),d=n===u.value,l=s.useRef(d);return s.useEffect(()=>{const p=requestAnimationFrame(()=>l.current=!1);return()=>cancelAnimationFrame(p)},[]),i.jsx($,{present:r||d,children:({present:p})=>i.jsx(E.div,{"data-state":d?"active":"inactive","data-orientation":u.orientation,role:"tabpanel","aria-labelledby":f,hidden:!p,id:m,tabIndex:0,...c,ref:o,style:{...e.style,animationDuration:l.current?"0s":void 0},children:p&&a})})});no.displayName=oo;function ro(e,o){return`${e}-trigger-${o}`}function ao(e,o){return`${e}-content-${o}`}var Sr=Zt,Cr=Qt,xr=to,Rr=no;export{sr as C,et as I,cr as L,ar as P,Qe as R,pr as S,rr as T,wr as V,Fn as a,me as b,Ye as c,mr as d,ir as e,lr as f,dr as g,ur as h,fr as i,nr as j,vr as k,br as l,Kn as m,Hn as n,Cr as o,xr as p,Rr as q,Sr as r,fe as u}; diff --git a/pkg/ui/frontend/dist/assets/react-router-Bj-soKrx.js b/pkg/ui/frontend/dist/assets/react-router-Bj-soKrx.js deleted file mode 100644 index b0f79b109cbed..0000000000000 --- a/pkg/ui/frontend/dist/assets/react-router-Bj-soKrx.js +++ /dev/null @@ -1,29 +0,0 @@ -import{r as v,R as en,a as tn,b as rn}from"./react-core-D_V7s-9r.js";/** - * @remix-run/router v1.21.1 - * - * Copyright (c) Remix Software Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function V(){return V=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function Ne(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function an(){return Math.random().toString(36).substr(2,8)}function Xt(e,t){return{usr:e.state,key:e.key,idx:t}}function Ze(e,t,r,n){return r===void 0&&(r=null),V({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?he(t):t,{state:r,key:t&&t.key||n||an()})}function Le(e){let{pathname:t="/",search:r="",hash:n=""}=e;return r&&r!=="?"&&(t+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function he(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function on(e,t,r,n){n===void 0&&(n={});let{window:a=document.defaultView,v5Compat:l=!1}=n,o=a.history,d=J.Pop,u=null,f=h();f==null&&(f=0,o.replaceState(V({},o.state,{idx:f}),""));function h(){return(o.state||{idx:null}).idx}function p(){d=J.Pop;let R=h(),j=R==null?null:R-f;f=R,u&&u({action:d,location:x.location,delta:j})}function y(R,j){d=J.Push;let M=Ze(x.location,R,j);f=h()+1;let I=Xt(M,f),k=x.createHref(M);try{o.pushState(I,"",k)}catch(X){if(X instanceof DOMException&&X.name==="DataCloneError")throw X;a.location.assign(k)}l&&u&&u({action:d,location:x.location,delta:1})}function b(R,j){d=J.Replace;let M=Ze(x.location,R,j);f=h();let I=Xt(M,f),k=x.createHref(M);o.replaceState(I,"",k),l&&u&&u({action:d,location:x.location,delta:0})}function S(R){let j=a.location.origin!=="null"?a.location.origin:a.location.href,M=typeof R=="string"?R:Le(R);return M=M.replace(/ $/,"%20"),U(j,"No window.location.(origin|href) available to create URL for href: "+M),new URL(M,j)}let x={get action(){return d},get location(){return e(a,o)},listen(R){if(u)throw new Error("A history only accepts one active listener");return a.addEventListener(Gt,p),u=R,()=>{a.removeEventListener(Gt,p),u=null}},createHref(R){return t(a,R)},createURL:S,encodeLocation(R){let j=S(R);return{pathname:j.pathname,search:j.search,hash:j.hash}},push:y,replace:b,go(R){return o.go(R)}};return x}var z;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(z||(z={}));const ln=new Set(["lazy","caseSensitive","path","id","index","children"]);function sn(e){return e.index===!0}function pt(e,t,r,n){return r===void 0&&(r=[]),n===void 0&&(n={}),e.map((a,l)=>{let o=[...r,String(l)],d=typeof a.id=="string"?a.id:o.join("-");if(U(a.index!==!0||!a.children,"Cannot specify children on an index route"),U(!n[d],'Found a route id collision on id "'+d+`". Route id's must be globally unique within Data Router usages`),sn(a)){let u=V({},a,t(a),{id:d});return n[d]=u,u}else{let u=V({},a,t(a),{id:d,children:void 0});return n[d]=u,a.children&&(u.children=pt(a.children,t,o,n)),u}})}function xe(e,t,r){return r===void 0&&(r="/"),ht(e,t,r,!1)}function ht(e,t,r,n){let a=typeof t=="string"?he(t):t,l=Ae(a.pathname||"/",r);if(l==null)return null;let o=vr(e);dn(o);let d=null;for(let u=0;d==null&&u{let u={relativePath:d===void 0?l.path||"":d,caseSensitive:l.caseSensitive===!0,childrenIndex:o,route:l};u.relativePath.startsWith("/")&&(U(u.relativePath.startsWith(n),'Absolute route path "'+u.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),u.relativePath=u.relativePath.slice(n.length));let f=fe([n,u.relativePath]),h=r.concat(u);l.children&&l.children.length>0&&(U(l.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+f+'".')),vr(l.children,t,h,f)),!(l.path==null&&!l.index)&&t.push({path:f,score:vn(f,l.index),routesMeta:h})};return e.forEach((l,o)=>{var d;if(l.path===""||!((d=l.path)!=null&&d.includes("?")))a(l,o);else for(let u of yr(l.path))a(l,o,u)}),t}function yr(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,a=r.endsWith("?"),l=r.replace(/\?$/,"");if(n.length===0)return a?[l,""]:[l];let o=yr(n.join("/")),d=[];return d.push(...o.map(u=>u===""?l:[l,u].join("/"))),a&&d.push(...o),d.map(u=>e.startsWith("/")&&u===""?"/":u)}function dn(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:yn(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const cn=/^:[\w-]+$/,fn=3,hn=2,pn=1,mn=10,gn=-2,Qt=e=>e==="*";function vn(e,t){let r=e.split("/"),n=r.length;return r.some(Qt)&&(n+=gn),t&&(n+=hn),r.filter(a=>!Qt(a)).reduce((a,l)=>a+(cn.test(l)?fn:l===""?pn:mn),n)}function yn(e,t){return e.length===t.length&&e.slice(0,-1).every((n,a)=>n===t[a])?e[e.length-1]-t[t.length-1]:0}function bn(e,t,r){r===void 0&&(r=!1);let{routesMeta:n}=e,a={},l="/",o=[];for(let d=0;d{let{paramName:y,isOptional:b}=h;if(y==="*"){let x=d[p]||"";o=l.slice(0,l.length-x.length).replace(/(.)\/+$/,"$1")}const S=d[p];return b&&!S?f[y]=void 0:f[y]=(S||"").replace(/%2F/g,"/"),f},{}),pathname:l,pathnameBase:o,pattern:e}}function wn(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),Ne(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let n=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,d,u)=>(n.push({paramName:d,isOptional:u!=null}),u?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(n.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),n]}function Rn(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Ne(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function Ae(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}function En(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:a=""}=typeof e=="string"?he(e):e;return{pathname:r?r.startsWith("/")?r:Sn(r,t):t,search:Pn(n),hash:Dn(a)}}function Sn(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(a=>{a===".."?r.length>1&&r.pop():a!=="."&&r.push(a)}),r.length>1?r.join("/"):"/"}function xt(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(n)+"]. Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function br(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function Ft(e,t){let r=br(e);return t?r.map((n,a)=>a===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function _t(e,t,r,n){n===void 0&&(n=!1);let a;typeof e=="string"?a=he(e):(a=V({},e),U(!a.pathname||!a.pathname.includes("?"),xt("?","pathname","search",a)),U(!a.pathname||!a.pathname.includes("#"),xt("#","pathname","hash",a)),U(!a.search||!a.search.includes("#"),xt("#","search","hash",a)));let l=e===""||a.pathname==="",o=l?"/":a.pathname,d;if(o==null)d=r;else{let p=t.length-1;if(!n&&o.startsWith("..")){let y=o.split("/");for(;y[0]==="..";)y.shift(),p-=1;a.pathname=y.join("/")}d=p>=0?t[p]:"/"}let u=En(a,d),f=o&&o!=="/"&&o.endsWith("/"),h=(l||o===".")&&r.endsWith("/");return!u.pathname.endsWith("/")&&(f||h)&&(u.pathname+="/"),u}const fe=e=>e.join("/").replace(/\/\/+/g,"/"),xn=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Pn=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Dn=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class mt{constructor(t,r,n,a){a===void 0&&(a=!1),this.status=t,this.statusText=r||"",this.internal=a,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}}function vt(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const wr=["post","put","patch","delete"],Ln=new Set(wr),Cn=["get",...wr],Mn=new Set(Cn),Tn=new Set([301,302,303,307,308]),Un=new Set([307,308]),Pt={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Fn={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Je={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},Ot=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,_n=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),Rr="remix-router-transitions";function On(e){const t=e.window?e.window:typeof window<"u"?window:void 0,r=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u",n=!r;U(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let a;if(e.mapRouteProperties)a=e.mapRouteProperties;else if(e.detectErrorBoundary){let i=e.detectErrorBoundary;a=s=>({hasErrorBoundary:i(s)})}else a=_n;let l={},o=pt(e.routes,a,void 0,l),d,u=e.basename||"/",f=e.dataStrategy||Nn,h=e.patchRoutesOnNavigation,p=V({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,v7_skipActionErrorRevalidation:!1},e.future),y=null,b=new Set,S=null,x=null,R=null,j=e.hydrationData!=null,M=xe(o,e.history.location,u),I=null;if(M==null&&!h){let i=ae(404,{pathname:e.history.location.pathname}),{matches:s,route:c}=sr(o);M=s,I={[c.id]:i}}M&&!e.hydrationData&&st(M,o,e.history.location.pathname).active&&(M=null);let k;if(M)if(M.some(i=>i.route.lazy))k=!1;else if(!M.some(i=>i.route.loader))k=!0;else if(p.v7_partialHydration){let i=e.hydrationData?e.hydrationData.loaderData:null,s=e.hydrationData?e.hydrationData.errors:null;if(s){let c=M.findIndex(g=>s[g.route.id]!==void 0);k=M.slice(0,c+1).every(g=>!Ct(g.route,i,s))}else k=M.every(c=>!Ct(c.route,i,s))}else k=e.hydrationData!=null;else if(k=!1,M=[],p.v7_partialHydration){let i=st(null,o,e.history.location.pathname);i.active&&i.matches&&(M=i.matches)}let X,m={historyAction:e.history.action,location:e.history.location,matches:M,initialized:k,navigation:Pt,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||I,fetchers:new Map,blockers:new Map},ee=J.Pop,F=!1,O,$=!1,te=new Map,Q=null,ne=!1,Z=!1,Me=[],nt=new Set,G=new Map,at=0,ke=-1,Te=new Map,ue=new Set,Ue=new Map,He=new Map,oe=new Set,be=new Map,we=new Map,it;function Ir(){if(y=e.history.listen(i=>{let{action:s,location:c,delta:g}=i;if(it){it(),it=void 0;return}Ne(we.size===0||g!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let w=Wt({currentLocation:m.location,nextLocation:c,historyAction:s});if(w&&g!=null){let L=new Promise(T=>{it=T});e.history.go(g*-1),lt(w,{state:"blocked",location:c,proceed(){lt(w,{state:"proceeding",proceed:void 0,reset:void 0,location:c}),L.then(()=>e.history.go(g))},reset(){let T=new Map(m.blockers);T.set(w,Je),re({blockers:T})}});return}return Re(s,c)}),r){Zn(t,te);let i=()=>qn(t,te);t.addEventListener("pagehide",i),Q=()=>t.removeEventListener("pagehide",i)}return m.initialized||Re(J.Pop,m.location,{initialHydration:!0}),X}function Nr(){y&&y(),Q&&Q(),b.clear(),O&&O.abort(),m.fetchers.forEach((i,s)=>ot(s)),m.blockers.forEach((i,s)=>Vt(s))}function Ar(i){return b.add(i),()=>b.delete(i)}function re(i,s){s===void 0&&(s={}),m=V({},m,i);let c=[],g=[];p.v7_fetcherPersist&&m.fetchers.forEach((w,L)=>{w.state==="idle"&&(oe.has(L)?g.push(L):c.push(L))}),oe.forEach(w=>{!m.fetchers.has(w)&&!G.has(w)&&g.push(w)}),[...b].forEach(w=>w(m,{deletedFetchers:g,viewTransitionOpts:s.viewTransitionOpts,flushSync:s.flushSync===!0})),p.v7_fetcherPersist?(c.forEach(w=>m.fetchers.delete(w)),g.forEach(w=>ot(w))):g.forEach(w=>oe.delete(w))}function Fe(i,s,c){var g,w;let{flushSync:L}=c===void 0?{}:c,T=m.actionData!=null&&m.navigation.formMethod!=null&&le(m.navigation.formMethod)&&m.navigation.state==="loading"&&((g=i.state)==null?void 0:g._isRedirect)!==!0,P;s.actionData?Object.keys(s.actionData).length>0?P=s.actionData:P=null:T?P=m.actionData:P=null;let D=s.loaderData?or(m.loaderData,s.loaderData,s.matches||[],s.errors):m.loaderData,E=m.blockers;E.size>0&&(E=new Map(E),E.forEach((B,q)=>E.set(q,Je)));let C=F===!0||m.navigation.formMethod!=null&&le(m.navigation.formMethod)&&((w=i.state)==null?void 0:w._isRedirect)!==!0;d&&(o=d,d=void 0),ne||ee===J.Pop||(ee===J.Push?e.history.push(i,i.state):ee===J.Replace&&e.history.replace(i,i.state));let _;if(ee===J.Pop){let B=te.get(m.location.pathname);B&&B.has(i.pathname)?_={currentLocation:m.location,nextLocation:i}:te.has(i.pathname)&&(_={currentLocation:i,nextLocation:m.location})}else if($){let B=te.get(m.location.pathname);B?B.add(i.pathname):(B=new Set([i.pathname]),te.set(m.location.pathname,B)),_={currentLocation:m.location,nextLocation:i}}re(V({},s,{actionData:P,loaderData:D,historyAction:ee,location:i,initialized:!0,navigation:Pt,revalidation:"idle",restoreScrollPosition:Jt(i,s.matches||m.matches),preventScrollReset:C,blockers:E}),{viewTransitionOpts:_,flushSync:L===!0}),ee=J.Pop,F=!1,$=!1,ne=!1,Z=!1,Me=[]}async function It(i,s){if(typeof i=="number"){e.history.go(i);return}let c=Lt(m.location,m.matches,u,p.v7_prependBasename,i,p.v7_relativeSplatPath,s==null?void 0:s.fromRouteId,s==null?void 0:s.relative),{path:g,submission:w,error:L}=Zt(p.v7_normalizeFormMethod,!1,c,s),T=m.location,P=Ze(m.location,g,s&&s.state);P=V({},P,e.history.encodeLocation(P));let D=s&&s.replace!=null?s.replace:void 0,E=J.Push;D===!0?E=J.Replace:D===!1||w!=null&&le(w.formMethod)&&w.formAction===m.location.pathname+m.location.search&&(E=J.Replace);let C=s&&"preventScrollReset"in s?s.preventScrollReset===!0:void 0,_=(s&&s.flushSync)===!0,B=Wt({currentLocation:T,nextLocation:P,historyAction:E});if(B){lt(B,{state:"blocked",location:P,proceed(){lt(B,{state:"proceeding",proceed:void 0,reset:void 0,location:P}),It(i,s)},reset(){let q=new Map(m.blockers);q.set(B,Je),re({blockers:q})}});return}return await Re(E,P,{submission:w,pendingError:L,preventScrollReset:C,replace:s&&s.replace,enableViewTransition:s&&s.viewTransition,flushSync:_})}function zr(){if(wt(),re({revalidation:"loading"}),m.navigation.state!=="submitting"){if(m.navigation.state==="idle"){Re(m.historyAction,m.location,{startUninterruptedRevalidation:!0});return}Re(ee||m.historyAction,m.navigation.location,{overrideNavigation:m.navigation,enableViewTransition:$===!0})}}async function Re(i,s,c){O&&O.abort(),O=null,ee=i,ne=(c&&c.startUninterruptedRevalidation)===!0,Xr(m.location,m.matches),F=(c&&c.preventScrollReset)===!0,$=(c&&c.enableViewTransition)===!0;let g=d||o,w=c&&c.overrideNavigation,L=xe(g,s,u),T=(c&&c.flushSync)===!0,P=st(L,g,s.pathname);if(P.active&&P.matches&&(L=P.matches),!L){let{error:H,notFoundMatches:A,route:W}=Rt(s.pathname);Fe(s,{matches:A,loaderData:{},errors:{[W.id]:H}},{flushSync:T});return}if(m.initialized&&!Z&&Vn(m.location,s)&&!(c&&c.submission&&le(c.submission.formMethod))){Fe(s,{matches:L},{flushSync:T});return}O=new AbortController;let D=Be(e.history,s,O.signal,c&&c.submission),E;if(c&&c.pendingError)E=[Pe(L).route.id,{type:z.error,error:c.pendingError}];else if(c&&c.submission&&le(c.submission.formMethod)){let H=await kr(D,s,c.submission,L,P.active,{replace:c.replace,flushSync:T});if(H.shortCircuited)return;if(H.pendingActionResult){let[A,W]=H.pendingActionResult;if(ie(W)&&vt(W.error)&&W.error.status===404){O=null,Fe(s,{matches:H.matches,loaderData:{},errors:{[A]:W.error}});return}}L=H.matches||L,E=H.pendingActionResult,w=Dt(s,c.submission),T=!1,P.active=!1,D=Be(e.history,D.url,D.signal)}let{shortCircuited:C,matches:_,loaderData:B,errors:q}=await Hr(D,s,L,P.active,w,c&&c.submission,c&&c.fetcherSubmission,c&&c.replace,c&&c.initialHydration===!0,T,E);C||(O=null,Fe(s,V({matches:_||L},lr(E),{loaderData:B,errors:q})))}async function kr(i,s,c,g,w,L){L===void 0&&(L={}),wt();let T=Xn(s,c);if(re({navigation:T},{flushSync:L.flushSync===!0}),w){let E=await ut(g,s.pathname,i.signal);if(E.type==="aborted")return{shortCircuited:!0};if(E.type==="error"){let C=Pe(E.partialMatches).route.id;return{matches:E.partialMatches,pendingActionResult:[C,{type:z.error,error:E.error}]}}else if(E.matches)g=E.matches;else{let{notFoundMatches:C,error:_,route:B}=Rt(s.pathname);return{matches:C,pendingActionResult:[B.id,{type:z.error,error:_}]}}}let P,D=Xe(g,s);if(!D.route.action&&!D.route.lazy)P={type:z.error,error:ae(405,{method:i.method,pathname:s.pathname,routeId:D.route.id})};else if(P=(await $e("action",m,i,[D],g,null))[D.route.id],i.signal.aborted)return{shortCircuited:!0};if(De(P)){let E;return L&&L.replace!=null?E=L.replace:E=nr(P.response.headers.get("Location"),new URL(i.url),u)===m.location.pathname+m.location.search,await Ee(i,P,!0,{submission:c,replace:E}),{shortCircuited:!0}}if(ve(P))throw ae(400,{type:"defer-action"});if(ie(P)){let E=Pe(g,D.route.id);return(L&&L.replace)!==!0&&(ee=J.Push),{matches:g,pendingActionResult:[E.route.id,P]}}return{matches:g,pendingActionResult:[D.route.id,P]}}async function Hr(i,s,c,g,w,L,T,P,D,E,C){let _=w||Dt(s,L),B=L||T||dr(_),q=!ne&&(!p.v7_partialHydration||!D);if(g){if(q){let K=Nt(C);re(V({navigation:_},K!==void 0?{actionData:K}:{}),{flushSync:E})}let N=await ut(c,s.pathname,i.signal);if(N.type==="aborted")return{shortCircuited:!0};if(N.type==="error"){let K=Pe(N.partialMatches).route.id;return{matches:N.partialMatches,loaderData:{},errors:{[K]:N.error}}}else if(N.matches)c=N.matches;else{let{error:K,notFoundMatches:Oe,route:Ke}=Rt(s.pathname);return{matches:Oe,loaderData:{},errors:{[Ke.id]:K}}}}let H=d||o,[A,W]=er(e.history,m,c,B,s,p.v7_partialHydration&&D===!0,p.v7_skipActionErrorRevalidation,Z,Me,nt,oe,Ue,ue,H,u,C);if(Et(N=>!(c&&c.some(K=>K.route.id===N))||A&&A.some(K=>K.route.id===N)),ke=++at,A.length===0&&W.length===0){let N=Ht();return Fe(s,V({matches:c,loaderData:{},errors:C&&ie(C[1])?{[C[0]]:C[1].error}:null},lr(C),N?{fetchers:new Map(m.fetchers)}:{}),{flushSync:E}),{shortCircuited:!0}}if(q){let N={};if(!g){N.navigation=_;let K=Nt(C);K!==void 0&&(N.actionData=K)}W.length>0&&(N.fetchers=$r(W)),re(N,{flushSync:E})}W.forEach(N=>{me(N.key),N.controller&&G.set(N.key,N.controller)});let _e=()=>W.forEach(N=>me(N.key));O&&O.signal.addEventListener("abort",_e);let{loaderResults:Ve,fetcherResults:ce}=await At(m,c,A,W,i);if(i.signal.aborted)return{shortCircuited:!0};O&&O.signal.removeEventListener("abort",_e),W.forEach(N=>G.delete(N.key));let se=ft(Ve);if(se)return await Ee(i,se.result,!0,{replace:P}),{shortCircuited:!0};if(se=ft(ce),se)return ue.add(se.key),await Ee(i,se.result,!0,{replace:P}),{shortCircuited:!0};let{loaderData:St,errors:We}=ir(m,c,Ve,C,W,ce,be);be.forEach((N,K)=>{N.subscribe(Oe=>{(Oe||N.done)&&be.delete(K)})}),p.v7_partialHydration&&D&&m.errors&&(We=V({},m.errors,We));let Se=Ht(),dt=$t(ke),ct=Se||dt||W.length>0;return V({matches:c,loaderData:St,errors:We},ct?{fetchers:new Map(m.fetchers)}:{})}function Nt(i){if(i&&!ie(i[1]))return{[i[0]]:i[1].data};if(m.actionData)return Object.keys(m.actionData).length===0?null:m.actionData}function $r(i){return i.forEach(s=>{let c=m.fetchers.get(s.key),g=Ye(void 0,c?c.data:void 0);m.fetchers.set(s.key,g)}),new Map(m.fetchers)}function Vr(i,s,c,g){if(n)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");me(i);let w=(g&&g.flushSync)===!0,L=d||o,T=Lt(m.location,m.matches,u,p.v7_prependBasename,c,p.v7_relativeSplatPath,s,g==null?void 0:g.relative),P=xe(L,T,u),D=st(P,L,T);if(D.active&&D.matches&&(P=D.matches),!P){de(i,s,ae(404,{pathname:T}),{flushSync:w});return}let{path:E,submission:C,error:_}=Zt(p.v7_normalizeFormMethod,!0,T,g);if(_){de(i,s,_,{flushSync:w});return}let B=Xe(P,E),q=(g&&g.preventScrollReset)===!0;if(C&&le(C.formMethod)){Wr(i,s,E,B,P,D.active,w,q,C);return}Ue.set(i,{routeId:s,path:E}),Kr(i,s,E,B,P,D.active,w,q,C)}async function Wr(i,s,c,g,w,L,T,P,D){wt(),Ue.delete(i);function E(Y){if(!Y.route.action&&!Y.route.lazy){let je=ae(405,{method:D.formMethod,pathname:c,routeId:s});return de(i,s,je,{flushSync:T}),!0}return!1}if(!L&&E(g))return;let C=m.fetchers.get(i);pe(i,Qn(D,C),{flushSync:T});let _=new AbortController,B=Be(e.history,c,_.signal,D);if(L){let Y=await ut(w,c,B.signal);if(Y.type==="aborted")return;if(Y.type==="error"){de(i,s,Y.error,{flushSync:T});return}else if(Y.matches){if(w=Y.matches,g=Xe(w,c),E(g))return}else{de(i,s,ae(404,{pathname:c}),{flushSync:T});return}}G.set(i,_);let q=at,A=(await $e("action",m,B,[g],w,i))[g.route.id];if(B.signal.aborted){G.get(i)===_&&G.delete(i);return}if(p.v7_fetcherPersist&&oe.has(i)){if(De(A)||ie(A)){pe(i,ge(void 0));return}}else{if(De(A))if(G.delete(i),ke>q){pe(i,ge(void 0));return}else return ue.add(i),pe(i,Ye(D)),Ee(B,A,!1,{fetcherSubmission:D,preventScrollReset:P});if(ie(A)){de(i,s,A.error);return}}if(ve(A))throw ae(400,{type:"defer-action"});let W=m.navigation.location||m.location,_e=Be(e.history,W,_.signal),Ve=d||o,ce=m.navigation.state!=="idle"?xe(Ve,m.navigation.location,u):m.matches;U(ce,"Didn't find any matches after fetcher action");let se=++at;Te.set(i,se);let St=Ye(D,A.data);m.fetchers.set(i,St);let[We,Se]=er(e.history,m,ce,D,W,!1,p.v7_skipActionErrorRevalidation,Z,Me,nt,oe,Ue,ue,Ve,u,[g.route.id,A]);Se.filter(Y=>Y.key!==i).forEach(Y=>{let je=Y.key,Yt=m.fetchers.get(je),qr=Ye(void 0,Yt?Yt.data:void 0);m.fetchers.set(je,qr),me(je),Y.controller&&G.set(je,Y.controller)}),re({fetchers:new Map(m.fetchers)});let dt=()=>Se.forEach(Y=>me(Y.key));_.signal.addEventListener("abort",dt);let{loaderResults:ct,fetcherResults:N}=await At(m,ce,We,Se,_e);if(_.signal.aborted)return;_.signal.removeEventListener("abort",dt),Te.delete(i),G.delete(i),Se.forEach(Y=>G.delete(Y.key));let K=ft(ct);if(K)return Ee(_e,K.result,!1,{preventScrollReset:P});if(K=ft(N),K)return ue.add(K.key),Ee(_e,K.result,!1,{preventScrollReset:P});let{loaderData:Oe,errors:Ke}=ir(m,ce,ct,void 0,Se,N,be);if(m.fetchers.has(i)){let Y=ge(A.data);m.fetchers.set(i,Y)}$t(se),m.navigation.state==="loading"&&se>ke?(U(ee,"Expected pending action"),O&&O.abort(),Fe(m.navigation.location,{matches:ce,loaderData:Oe,errors:Ke,fetchers:new Map(m.fetchers)})):(re({errors:Ke,loaderData:or(m.loaderData,Oe,ce,Ke),fetchers:new Map(m.fetchers)}),Z=!1)}async function Kr(i,s,c,g,w,L,T,P,D){let E=m.fetchers.get(i);pe(i,Ye(D,E?E.data:void 0),{flushSync:T});let C=new AbortController,_=Be(e.history,c,C.signal);if(L){let A=await ut(w,c,_.signal);if(A.type==="aborted")return;if(A.type==="error"){de(i,s,A.error,{flushSync:T});return}else if(A.matches)w=A.matches,g=Xe(w,c);else{de(i,s,ae(404,{pathname:c}),{flushSync:T});return}}G.set(i,C);let B=at,H=(await $e("loader",m,_,[g],w,i))[g.route.id];if(ve(H)&&(H=await jt(H,_.signal,!0)||H),G.get(i)===C&&G.delete(i),!_.signal.aborted){if(oe.has(i)){pe(i,ge(void 0));return}if(De(H))if(ke>B){pe(i,ge(void 0));return}else{ue.add(i),await Ee(_,H,!1,{preventScrollReset:P});return}if(ie(H)){de(i,s,H.error);return}U(!ve(H),"Unhandled fetcher deferred data"),pe(i,ge(H.data))}}async function Ee(i,s,c,g){let{submission:w,fetcherSubmission:L,preventScrollReset:T,replace:P}=g===void 0?{}:g;s.response.headers.has("X-Remix-Revalidate")&&(Z=!0);let D=s.response.headers.get("Location");U(D,"Expected a Location header on the redirect Response"),D=nr(D,new URL(i.url),u);let E=Ze(m.location,D,{_isRedirect:!0});if(r){let A=!1;if(s.response.headers.has("X-Remix-Reload-Document"))A=!0;else if(Ot.test(D)){const W=e.history.createURL(D);A=W.origin!==t.location.origin||Ae(W.pathname,u)==null}if(A){P?t.location.replace(D):t.location.assign(D);return}}O=null;let C=P===!0||s.response.headers.has("X-Remix-Replace")?J.Replace:J.Push,{formMethod:_,formAction:B,formEncType:q}=m.navigation;!w&&!L&&_&&B&&q&&(w=dr(m.navigation));let H=w||L;if(Un.has(s.response.status)&&H&&le(H.formMethod))await Re(C,E,{submission:V({},H,{formAction:D}),preventScrollReset:T||F,enableViewTransition:c?$:void 0});else{let A=Dt(E,w);await Re(C,E,{overrideNavigation:A,fetcherSubmission:L,preventScrollReset:T||F,enableViewTransition:c?$:void 0})}}async function $e(i,s,c,g,w,L){let T,P={};try{T=await An(f,i,s,c,g,w,L,l,a)}catch(D){return g.forEach(E=>{P[E.route.id]={type:z.error,error:D}}),P}for(let[D,E]of Object.entries(T))if(Wn(E)){let C=E.result;P[D]={type:z.redirect,response:Hn(C,c,D,w,u,p.v7_relativeSplatPath)}}else P[D]=await kn(E);return P}async function At(i,s,c,g,w){let L=i.matches,T=$e("loader",i,w,c,s,null),P=Promise.all(g.map(async C=>{if(C.matches&&C.match&&C.controller){let B=(await $e("loader",i,Be(e.history,C.path,C.controller.signal),[C.match],C.matches,C.key))[C.match.route.id];return{[C.key]:B}}else return Promise.resolve({[C.key]:{type:z.error,error:ae(404,{pathname:C.path})}})})),D=await T,E=(await P).reduce((C,_)=>Object.assign(C,_),{});return await Promise.all([Yn(s,D,w.signal,L,i.loaderData),Gn(s,E,g)]),{loaderResults:D,fetcherResults:E}}function wt(){Z=!0,Me.push(...Et()),Ue.forEach((i,s)=>{G.has(s)&&nt.add(s),me(s)})}function pe(i,s,c){c===void 0&&(c={}),m.fetchers.set(i,s),re({fetchers:new Map(m.fetchers)},{flushSync:(c&&c.flushSync)===!0})}function de(i,s,c,g){g===void 0&&(g={});let w=Pe(m.matches,s);ot(i),re({errors:{[w.route.id]:c},fetchers:new Map(m.fetchers)},{flushSync:(g&&g.flushSync)===!0})}function zt(i){return He.set(i,(He.get(i)||0)+1),oe.has(i)&&oe.delete(i),m.fetchers.get(i)||Fn}function ot(i){let s=m.fetchers.get(i);G.has(i)&&!(s&&s.state==="loading"&&Te.has(i))&&me(i),Ue.delete(i),Te.delete(i),ue.delete(i),p.v7_fetcherPersist&&oe.delete(i),nt.delete(i),m.fetchers.delete(i)}function Jr(i){let s=(He.get(i)||0)-1;s<=0?(He.delete(i),oe.add(i),p.v7_fetcherPersist||ot(i)):He.set(i,s),re({fetchers:new Map(m.fetchers)})}function me(i){let s=G.get(i);s&&(s.abort(),G.delete(i))}function kt(i){for(let s of i){let c=zt(s),g=ge(c.data);m.fetchers.set(s,g)}}function Ht(){let i=[],s=!1;for(let c of ue){let g=m.fetchers.get(c);U(g,"Expected fetcher: "+c),g.state==="loading"&&(ue.delete(c),i.push(c),s=!0)}return kt(i),s}function $t(i){let s=[];for(let[c,g]of Te)if(g0}function Yr(i,s){let c=m.blockers.get(i)||Je;return we.get(i)!==s&&we.set(i,s),c}function Vt(i){m.blockers.delete(i),we.delete(i)}function lt(i,s){let c=m.blockers.get(i)||Je;U(c.state==="unblocked"&&s.state==="blocked"||c.state==="blocked"&&s.state==="blocked"||c.state==="blocked"&&s.state==="proceeding"||c.state==="blocked"&&s.state==="unblocked"||c.state==="proceeding"&&s.state==="unblocked","Invalid blocker state transition: "+c.state+" -> "+s.state);let g=new Map(m.blockers);g.set(i,s),re({blockers:g})}function Wt(i){let{currentLocation:s,nextLocation:c,historyAction:g}=i;if(we.size===0)return;we.size>1&&Ne(!1,"A router only supports one blocker at a time");let w=Array.from(we.entries()),[L,T]=w[w.length-1],P=m.blockers.get(L);if(!(P&&P.state==="proceeding")&&T({currentLocation:s,nextLocation:c,historyAction:g}))return L}function Rt(i){let s=ae(404,{pathname:i}),c=d||o,{matches:g,route:w}=sr(c);return Et(),{notFoundMatches:g,route:w,error:s}}function Et(i){let s=[];return be.forEach((c,g)=>{(!i||i(g))&&(c.cancel(),s.push(g),be.delete(g))}),s}function Gr(i,s,c){if(S=i,R=s,x=c||null,!j&&m.navigation===Pt){j=!0;let g=Jt(m.location,m.matches);g!=null&&re({restoreScrollPosition:g})}return()=>{S=null,R=null,x=null}}function Kt(i,s){return x&&x(i,s.map(g=>un(g,m.loaderData)))||i.key}function Xr(i,s){if(S&&R){let c=Kt(i,s);S[c]=R()}}function Jt(i,s){if(S){let c=Kt(i,s),g=S[c];if(typeof g=="number")return g}return null}function st(i,s,c){if(h)if(i){if(Object.keys(i[0].params).length>0)return{active:!0,matches:ht(s,c,u,!0)}}else return{active:!0,matches:ht(s,c,u,!0)||[]};return{active:!1,matches:null}}async function ut(i,s,c){if(!h)return{type:"success",matches:i};let g=i;for(;;){let w=d==null,L=d||o,T=l;try{await h({path:s,matches:g,patch:(E,C)=>{c.aborted||rr(E,C,L,T,a)}})}catch(E){return{type:"error",error:E,partialMatches:g}}finally{w&&!c.aborted&&(o=[...o])}if(c.aborted)return{type:"aborted"};let P=xe(L,s,u);if(P)return{type:"success",matches:P};let D=ht(L,s,u,!0);if(!D||g.length===D.length&&g.every((E,C)=>E.route.id===D[C].route.id))return{type:"success",matches:null};g=D}}function Qr(i){l={},d=pt(i,a,void 0,l)}function Zr(i,s){let c=d==null;rr(i,s,d||o,l,a),c&&(o=[...o],re({}))}return X={get basename(){return u},get future(){return p},get state(){return m},get routes(){return o},get window(){return t},initialize:Ir,subscribe:Ar,enableScrollRestoration:Gr,navigate:It,fetch:Vr,revalidate:zr,createHref:i=>e.history.createHref(i),encodeLocation:i=>e.history.encodeLocation(i),getFetcher:zt,deleteFetcher:Jr,dispose:Nr,getBlocker:Yr,deleteBlocker:Vt,patchRoutes:Zr,_internalFetchControllers:G,_internalActiveDeferreds:be,_internalSetRoutes:Qr},X}function jn(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function Lt(e,t,r,n,a,l,o,d){let u,f;if(o){u=[];for(let p of t)if(u.push(p),p.route.id===o){f=p;break}}else u=t,f=t[t.length-1];let h=_t(a||".",Ft(u,l),Ae(e.pathname,r)||e.pathname,d==="path");if(a==null&&(h.search=e.search,h.hash=e.hash),(a==null||a===""||a===".")&&f){let p=Bt(h.search);if(f.route.index&&!p)h.search=h.search?h.search.replace(/^\?/,"?index&"):"?index";else if(!f.route.index&&p){let y=new URLSearchParams(h.search),b=y.getAll("index");y.delete("index"),b.filter(x=>x).forEach(x=>y.append("index",x));let S=y.toString();h.search=S?"?"+S:""}}return n&&r!=="/"&&(h.pathname=h.pathname==="/"?r:fe([r,h.pathname])),Le(h)}function Zt(e,t,r,n){if(!n||!jn(n))return{path:r};if(n.formMethod&&!Jn(n.formMethod))return{path:r,error:ae(405,{method:n.formMethod})};let a=()=>({path:r,error:ae(400,{type:"invalid-body"})}),l=n.formMethod||"get",o=e?l.toUpperCase():l.toLowerCase(),d=xr(r);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!le(o))return a();let y=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((b,S)=>{let[x,R]=S;return""+b+x+"="+R+` -`},""):String(n.body);return{path:r,submission:{formMethod:o,formAction:d,formEncType:n.formEncType,formData:void 0,json:void 0,text:y}}}else if(n.formEncType==="application/json"){if(!le(o))return a();try{let y=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:r,submission:{formMethod:o,formAction:d,formEncType:n.formEncType,formData:void 0,json:y,text:void 0}}}catch{return a()}}}U(typeof FormData=="function","FormData is not available in this environment");let u,f;if(n.formData)u=Mt(n.formData),f=n.formData;else if(n.body instanceof FormData)u=Mt(n.body),f=n.body;else if(n.body instanceof URLSearchParams)u=n.body,f=ar(u);else if(n.body==null)u=new URLSearchParams,f=new FormData;else try{u=new URLSearchParams(n.body),f=ar(u)}catch{return a()}let h={formMethod:o,formAction:d,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:f,json:void 0,text:void 0};if(le(h.formMethod))return{path:r,submission:h};let p=he(r);return t&&p.search&&Bt(p.search)&&u.append("index",""),p.search="?"+u,{path:Le(p),submission:h}}function qt(e,t,r){r===void 0&&(r=!1);let n=e.findIndex(a=>a.route.id===t);return n>=0?e.slice(0,r?n+1:n):e}function er(e,t,r,n,a,l,o,d,u,f,h,p,y,b,S,x){let R=x?ie(x[1])?x[1].error:x[1].data:void 0,j=e.createURL(t.location),M=e.createURL(a),I=r;l&&t.errors?I=qt(r,Object.keys(t.errors)[0],!0):x&&ie(x[1])&&(I=qt(r,x[0]));let k=x?x[1].statusCode:void 0,X=o&&k&&k>=400,m=I.filter((F,O)=>{let{route:$}=F;if($.lazy)return!0;if($.loader==null)return!1;if(l)return Ct($,t.loaderData,t.errors);if(Bn(t.loaderData,t.matches[O],F)||u.some(ne=>ne===F.route.id))return!0;let te=t.matches[O],Q=F;return tr(F,V({currentUrl:j,currentParams:te.params,nextUrl:M,nextParams:Q.params},n,{actionResult:R,actionStatus:k,defaultShouldRevalidate:X?!1:d||j.pathname+j.search===M.pathname+M.search||j.search!==M.search||Er(te,Q)}))}),ee=[];return p.forEach((F,O)=>{if(l||!r.some(Z=>Z.route.id===F.routeId)||h.has(O))return;let $=xe(b,F.path,S);if(!$){ee.push({key:O,routeId:F.routeId,path:F.path,matches:null,match:null,controller:null});return}let te=t.fetchers.get(O),Q=Xe($,F.path),ne=!1;y.has(O)?ne=!1:f.has(O)?(f.delete(O),ne=!0):te&&te.state!=="idle"&&te.data===void 0?ne=d:ne=tr(Q,V({currentUrl:j,currentParams:t.matches[t.matches.length-1].params,nextUrl:M,nextParams:r[r.length-1].params},n,{actionResult:R,actionStatus:k,defaultShouldRevalidate:X?!1:d})),ne&&ee.push({key:O,routeId:F.routeId,path:F.path,matches:$,match:Q,controller:new AbortController})}),[m,ee]}function Ct(e,t,r){if(e.lazy)return!0;if(!e.loader)return!1;let n=t!=null&&t[e.id]!==void 0,a=r!=null&&r[e.id]!==void 0;return!n&&a?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!n&&!a}function Bn(e,t,r){let n=!t||r.route.id!==t.route.id,a=e[r.route.id]===void 0;return n||a}function Er(e,t){let r=e.route.path;return e.pathname!==t.pathname||r!=null&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}function tr(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if(typeof r=="boolean")return r}return t.defaultShouldRevalidate}function rr(e,t,r,n,a){var l;let o;if(e){let f=n[e];U(f,"No route found to patch children into: routeId = "+e),f.children||(f.children=[]),o=f.children}else o=r;let d=t.filter(f=>!o.some(h=>Sr(f,h))),u=pt(d,a,[e||"_","patch",String(((l=o)==null?void 0:l.length)||"0")],n);o.push(...u)}function Sr(e,t){return"id"in e&&"id"in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children.every((r,n)=>{var a;return(a=t.children)==null?void 0:a.some(l=>Sr(r,l))}):!1}async function In(e,t,r){if(!e.lazy)return;let n=await e.lazy();if(!e.lazy)return;let a=r[e.id];U(a,"No route found in manifest");let l={};for(let o in n){let u=a[o]!==void 0&&o!=="hasErrorBoundary";Ne(!u,'Route "'+a.id+'" has a static property "'+o+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+o+'" will be ignored.')),!u&&!ln.has(o)&&(l[o]=n[o])}Object.assign(a,l),Object.assign(a,V({},t(a),{lazy:void 0}))}async function Nn(e){let{matches:t}=e,r=t.filter(a=>a.shouldLoad);return(await Promise.all(r.map(a=>a.resolve()))).reduce((a,l,o)=>Object.assign(a,{[r[o].route.id]:l}),{})}async function An(e,t,r,n,a,l,o,d,u,f){let h=l.map(b=>b.route.lazy?In(b.route,u,d):void 0),p=l.map((b,S)=>{let x=h[S],R=a.some(M=>M.route.id===b.route.id);return V({},b,{shouldLoad:R,resolve:async M=>(M&&n.method==="GET"&&(b.route.lazy||b.route.loader)&&(R=!0),R?zn(t,n,b,x,M,f):Promise.resolve({type:z.data,result:void 0}))})}),y=await e({matches:p,request:n,params:l[0].params,fetcherKey:o,context:f});try{await Promise.all(h)}catch{}return y}async function zn(e,t,r,n,a,l){let o,d,u=f=>{let h,p=new Promise((S,x)=>h=x);d=()=>h(),t.signal.addEventListener("abort",d);let y=S=>typeof f!="function"?Promise.reject(new Error("You cannot call the handler for a route which defines a boolean "+('"'+e+'" [routeId: '+r.route.id+"]"))):f({request:t,params:r.params,context:l},...S!==void 0?[S]:[]),b=(async()=>{try{return{type:"data",result:await(a?a(x=>y(x)):y())}}catch(S){return{type:"error",result:S}}})();return Promise.race([b,p])};try{let f=r.route[e];if(n)if(f){let h,[p]=await Promise.all([u(f).catch(y=>{h=y}),n]);if(h!==void 0)throw h;o=p}else if(await n,f=r.route[e],f)o=await u(f);else if(e==="action"){let h=new URL(t.url),p=h.pathname+h.search;throw ae(405,{method:t.method,pathname:p,routeId:r.route.id})}else return{type:z.data,result:void 0};else if(f)o=await u(f);else{let h=new URL(t.url),p=h.pathname+h.search;throw ae(404,{pathname:p})}U(o.result!==void 0,"You defined "+(e==="action"?"an action":"a loader")+" for route "+('"'+r.route.id+"\" but didn't return anything from your `"+e+"` ")+"function. Please return a value or `null`.")}catch(f){return{type:z.error,result:f}}finally{d&&t.signal.removeEventListener("abort",d)}return o}async function kn(e){let{result:t,type:r}=e;if(Pr(t)){let f;try{let h=t.headers.get("Content-Type");h&&/\bapplication\/json\b/.test(h)?t.body==null?f=null:f=await t.json():f=await t.text()}catch(h){return{type:z.error,error:h}}return r===z.error?{type:z.error,error:new mt(t.status,t.statusText,f),statusCode:t.status,headers:t.headers}:{type:z.data,data:f,statusCode:t.status,headers:t.headers}}if(r===z.error){if(ur(t)){var n;if(t.data instanceof Error){var a;return{type:z.error,error:t.data,statusCode:(a=t.init)==null?void 0:a.status}}t=new mt(((n=t.init)==null?void 0:n.status)||500,void 0,t.data)}return{type:z.error,error:t,statusCode:vt(t)?t.status:void 0}}if(Kn(t)){var l,o;return{type:z.deferred,deferredData:t,statusCode:(l=t.init)==null?void 0:l.status,headers:((o=t.init)==null?void 0:o.headers)&&new Headers(t.init.headers)}}if(ur(t)){var d,u;return{type:z.data,data:t.data,statusCode:(d=t.init)==null?void 0:d.status,headers:(u=t.init)!=null&&u.headers?new Headers(t.init.headers):void 0}}return{type:z.data,data:t}}function Hn(e,t,r,n,a,l){let o=e.headers.get("Location");if(U(o,"Redirects returned/thrown from loaders/actions must have a Location header"),!Ot.test(o)){let d=n.slice(0,n.findIndex(u=>u.route.id===r)+1);o=Lt(new URL(t.url),d,a,!0,o,l),e.headers.set("Location",o)}return e}function nr(e,t,r){if(Ot.test(e)){let n=e,a=n.startsWith("//")?new URL(t.protocol+n):new URL(n),l=Ae(a.pathname,r)!=null;if(a.origin===t.origin&&l)return a.pathname+a.search+a.hash}return e}function Be(e,t,r,n){let a=e.createURL(xr(t)).toString(),l={signal:r};if(n&&le(n.formMethod)){let{formMethod:o,formEncType:d}=n;l.method=o.toUpperCase(),d==="application/json"?(l.headers=new Headers({"Content-Type":d}),l.body=JSON.stringify(n.json)):d==="text/plain"?l.body=n.text:d==="application/x-www-form-urlencoded"&&n.formData?l.body=Mt(n.formData):l.body=n.formData}return new Request(a,l)}function Mt(e){let t=new URLSearchParams;for(let[r,n]of e.entries())t.append(r,typeof n=="string"?n:n.name);return t}function ar(e){let t=new FormData;for(let[r,n]of e.entries())t.append(r,n);return t}function $n(e,t,r,n,a){let l={},o=null,d,u=!1,f={},h=r&&ie(r[1])?r[1].error:void 0;return e.forEach(p=>{if(!(p.route.id in t))return;let y=p.route.id,b=t[y];if(U(!De(b),"Cannot handle redirect results in processLoaderData"),ie(b)){let S=b.error;h!==void 0&&(S=h,h=void 0),o=o||{};{let x=Pe(e,y);o[x.route.id]==null&&(o[x.route.id]=S)}l[y]=void 0,u||(u=!0,d=vt(b.error)?b.error.status:500),b.headers&&(f[y]=b.headers)}else ve(b)?(n.set(y,b.deferredData),l[y]=b.deferredData.data,b.statusCode!=null&&b.statusCode!==200&&!u&&(d=b.statusCode),b.headers&&(f[y]=b.headers)):(l[y]=b.data,b.statusCode&&b.statusCode!==200&&!u&&(d=b.statusCode),b.headers&&(f[y]=b.headers))}),h!==void 0&&r&&(o={[r[0]]:h},l[r[0]]=void 0),{loaderData:l,errors:o,statusCode:d||200,loaderHeaders:f}}function ir(e,t,r,n,a,l,o){let{loaderData:d,errors:u}=$n(t,r,n,o);return a.forEach(f=>{let{key:h,match:p,controller:y}=f,b=l[h];if(U(b,"Did not find corresponding fetcher result"),!(y&&y.signal.aborted))if(ie(b)){let S=Pe(e.matches,p==null?void 0:p.route.id);u&&u[S.route.id]||(u=V({},u,{[S.route.id]:b.error})),e.fetchers.delete(h)}else if(De(b))U(!1,"Unhandled fetcher revalidation redirect");else if(ve(b))U(!1,"Unhandled fetcher deferred data");else{let S=ge(b.data);e.fetchers.set(h,S)}}),{loaderData:d,errors:u}}function or(e,t,r,n){let a=V({},t);for(let l of r){let o=l.route.id;if(t.hasOwnProperty(o)?t[o]!==void 0&&(a[o]=t[o]):e[o]!==void 0&&l.route.loader&&(a[o]=e[o]),n&&n.hasOwnProperty(o))break}return a}function lr(e){return e?ie(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Pe(e,t){return(t?e.slice(0,e.findIndex(n=>n.route.id===t)+1):[...e]).reverse().find(n=>n.route.hasErrorBoundary===!0)||e[0]}function sr(e){let t=e.length===1?e[0]:e.find(r=>r.index||!r.path||r.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function ae(e,t){let{pathname:r,routeId:n,method:a,type:l,message:o}=t===void 0?{}:t,d="Unknown Server Error",u="Unknown @remix-run/router error";return e===400?(d="Bad Request",a&&r&&n?u="You made a "+a+' request to "'+r+'" but '+('did not provide a `loader` for route "'+n+'", ')+"so there is no way to handle the request.":l==="defer-action"?u="defer() is not supported in actions":l==="invalid-body"&&(u="Unable to encode submission body")):e===403?(d="Forbidden",u='Route "'+n+'" does not match URL "'+r+'"'):e===404?(d="Not Found",u='No route matches URL "'+r+'"'):e===405&&(d="Method Not Allowed",a&&r&&n?u="You made a "+a.toUpperCase()+' request to "'+r+'" but '+('did not provide an `action` for route "'+n+'", ')+"so there is no way to handle the request.":a&&(u='Invalid request method "'+a.toUpperCase()+'"')),new mt(e||500,d,new Error(u),!0)}function ft(e){let t=Object.entries(e);for(let r=t.length-1;r>=0;r--){let[n,a]=t[r];if(De(a))return{key:n,result:a}}}function xr(e){let t=typeof e=="string"?he(e):e;return Le(V({},t,{hash:""}))}function Vn(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function Wn(e){return Pr(e.result)&&Tn.has(e.result.status)}function ve(e){return e.type===z.deferred}function ie(e){return e.type===z.error}function De(e){return(e&&e.type)===z.redirect}function ur(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function Kn(e){let t=e;return t&&typeof t=="object"&&typeof t.data=="object"&&typeof t.subscribe=="function"&&typeof t.cancel=="function"&&typeof t.resolveData=="function"}function Pr(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function Jn(e){return Mn.has(e.toLowerCase())}function le(e){return Ln.has(e.toLowerCase())}async function Yn(e,t,r,n,a){let l=Object.entries(t);for(let o=0;o(y==null?void 0:y.route.id)===d);if(!f)continue;let h=n.find(y=>y.route.id===f.route.id),p=h!=null&&!Er(h,f)&&(a&&a[f.route.id])!==void 0;ve(u)&&p&&await jt(u,r,!1).then(y=>{y&&(t[d]=y)})}}async function Gn(e,t,r){for(let n=0;n(f==null?void 0:f.route.id)===l)&&ve(d)&&(U(o,"Expected an AbortController for revalidating fetcher deferred result"),await jt(d,o.signal,!0).then(f=>{f&&(t[a]=f)}))}}async function jt(e,t,r){if(r===void 0&&(r=!1),!await e.deferredData.resolveData(t)){if(r)try{return{type:z.data,data:e.deferredData.unwrappedData}}catch(a){return{type:z.error,error:a}}return{type:z.data,data:e.deferredData.data}}}function Bt(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function Xe(e,t){let r=typeof t=="string"?he(t).search:t.search;if(e[e.length-1].route.index&&Bt(r||""))return e[e.length-1];let n=br(e);return n[n.length-1]}function dr(e){let{formMethod:t,formAction:r,formEncType:n,text:a,formData:l,json:o}=e;if(!(!t||!r||!n)){if(a!=null)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:void 0,text:a};if(l!=null)return{formMethod:t,formAction:r,formEncType:n,formData:l,json:void 0,text:void 0};if(o!==void 0)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:o,text:void 0}}}function Dt(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function Xn(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function Ye(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function Qn(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function ge(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function Zn(e,t){try{let r=e.sessionStorage.getItem(Rr);if(r){let n=JSON.parse(r);for(let[a,l]of Object.entries(n||{}))l&&Array.isArray(l)&&t.set(a,new Set(l||[]))}}catch{}}function qn(e,t){if(t.size>0){let r={};for(let[n,a]of t)r[n]=[...a];try{e.sessionStorage.setItem(Rr,JSON.stringify(r))}catch(n){Ne(!1,"Failed to save applied view transitions in sessionStorage ("+n+").")}}}/** - * React Router v6.28.2 - * - * Copyright (c) Remix Software Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function et(){return et=Object.assign?Object.assign.bind():function(e){for(var t=1;t{d.current=!0}),v.useCallback(function(f,h){if(h===void 0&&(h={}),!d.current)return;if(typeof f=="number"){n.go(f);return}let p=_t(f,JSON.parse(o),l,h.relative==="path");e==null&&t!=="/"&&(p.pathname=p.pathname==="/"?t:fe([t,p.pathname])),(h.replace?n.replace:n.push)(p,h.state,h)},[t,n,o,l,e])}function Qa(){let{matches:e}=v.useContext(ye),t=e[e.length-1];return t?t.params:{}}function Tr(e,t){let{relative:r}=t===void 0?{}:t,{future:n}=v.useContext(Ce),{matches:a}=v.useContext(ye),{pathname:l}=ze(),o=JSON.stringify(Ft(a,n.v7_relativeSplatPath));return v.useMemo(()=>_t(e,JSON.parse(o),l,r==="path"),[e,o,l,r])}function ra(e,t){return Ur(e,t)}function Ur(e,t,r,n){rt()||U(!1);let{navigator:a}=v.useContext(Ce),{matches:l}=v.useContext(ye),o=l[l.length-1],d=o?o.params:{};o&&o.pathname;let u=o?o.pathnameBase:"/";o&&o.route;let f=ze(),h;if(t){var p;let R=typeof t=="string"?he(t):t;u==="/"||(p=R.pathname)!=null&&p.startsWith(u)||U(!1),h=R}else h=f;let y=h.pathname||"/",b=y;if(u!=="/"){let R=u.replace(/^\//,"").split("/");b="/"+y.replace(/^\//,"").split("/").slice(R.length).join("/")}let S=xe(e,{pathname:b}),x=la(S&&S.map(R=>Object.assign({},R,{params:Object.assign({},d,R.params),pathname:fe([u,a.encodeLocation?a.encodeLocation(R.pathname).pathname:R.pathname]),pathnameBase:R.pathnameBase==="/"?u:fe([u,a.encodeLocation?a.encodeLocation(R.pathnameBase).pathname:R.pathnameBase])})),l,r,n);return t&&x?v.createElement(bt.Provider,{value:{location:et({pathname:"/",search:"",hash:"",state:null,key:"default"},h),navigationType:J.Pop}},x):x}function na(){let e=ca(),t=vt(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,a={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return v.createElement(v.Fragment,null,v.createElement("h2",null,"Unexpected Application Error!"),v.createElement("h3",{style:{fontStyle:"italic"}},t),r?v.createElement("pre",{style:a},r):null,null)}const aa=v.createElement(na,null);class ia extends v.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,r){return r.location!==t.location||r.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:r.error,location:r.location,revalidation:t.revalidation||r.revalidation}}componentDidCatch(t,r){console.error("React Router caught the following error during render",t,r)}render(){return this.state.error!==void 0?v.createElement(ye.Provider,{value:this.props.routeContext},v.createElement(Lr.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function oa(e){let{routeContext:t,match:r,children:n}=e,a=v.useContext(yt);return a&&a.static&&a.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=r.route.id),v.createElement(ye.Provider,{value:t},n)}function la(e,t,r,n){var a;if(t===void 0&&(t=[]),r===void 0&&(r=null),n===void 0&&(n=null),e==null){var l;if(!r)return null;if(r.errors)e=r.matches;else if((l=n)!=null&&l.v7_partialHydration&&t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let o=e,d=(a=r)==null?void 0:a.errors;if(d!=null){let h=o.findIndex(p=>p.route.id&&(d==null?void 0:d[p.route.id])!==void 0);h>=0||U(!1),o=o.slice(0,Math.min(o.length,h+1))}let u=!1,f=-1;if(r&&n&&n.v7_partialHydration)for(let h=0;h=0?o=o.slice(0,f+1):o=[o[0]];break}}}return o.reduceRight((h,p,y)=>{let b,S=!1,x=null,R=null;r&&(b=d&&p.route.id?d[p.route.id]:void 0,x=p.route.errorElement||aa,u&&(f<0&&y===0?(S=!0,R=null):f===y&&(S=!0,R=p.route.hydrateFallbackElement||null)));let j=t.concat(o.slice(0,y+1)),M=()=>{let I;return b?I=x:S?I=R:p.route.Component?I=v.createElement(p.route.Component,null):p.route.element?I=p.route.element:I=h,v.createElement(oa,{match:p,routeContext:{outlet:h,matches:j,isDataRoute:r!=null},children:I})};return r&&(p.route.ErrorBoundary||p.route.errorElement||y===0)?v.createElement(ia,{location:r.location,revalidation:r.revalidation,component:x,error:b,children:M(),routeContext:{outlet:null,matches:j,isDataRoute:!0}}):M()},null)}var Fr=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(Fr||{}),gt=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(gt||{});function sa(e){let t=v.useContext(yt);return t||U(!1),t}function ua(e){let t=v.useContext(Dr);return t||U(!1),t}function da(e){let t=v.useContext(ye);return t||U(!1),t}function _r(e){let t=da(),r=t.matches[t.matches.length-1];return r.route.id||U(!1),r.route.id}function ca(){var e;let t=v.useContext(Lr),r=ua(gt.UseRouteError),n=_r(gt.UseRouteError);return t!==void 0?t:(e=r.errors)==null?void 0:e[n]}function fa(){let{router:e}=sa(Fr.UseNavigateStable),t=_r(gt.UseNavigateStable),r=v.useRef(!1);return Cr(()=>{r.current=!0}),v.useCallback(function(a,l){l===void 0&&(l={}),r.current&&(typeof a=="number"?e.navigate(a):e.navigate(a,et({fromRouteId:t},l)))},[e,t])}const cr={};function ha(e,t){cr[t]||(cr[t]=!0,console.warn(t))}const Ie=(e,t,r)=>ha(e,"⚠️ React Router Future Flag Warning: "+t+". "+("You can use the `"+e+"` future flag to opt-in early. ")+("For more information, see "+r+"."));function pa(e,t){(e==null?void 0:e.v7_startTransition)===void 0&&Ie("v7_startTransition","React Router will begin wrapping state updates in `React.startTransition` in v7","https://reactrouter.com/v6/upgrading/future#v7_starttransition"),(e==null?void 0:e.v7_relativeSplatPath)===void 0&&(!t||!t.v7_relativeSplatPath)&&Ie("v7_relativeSplatPath","Relative route resolution within Splat routes is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_relativesplatpath"),t&&(t.v7_fetcherPersist===void 0&&Ie("v7_fetcherPersist","The persistence behavior of fetchers is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_fetcherpersist"),t.v7_normalizeFormMethod===void 0&&Ie("v7_normalizeFormMethod","Casing of `formMethod` fields is being normalized to uppercase in v7","https://reactrouter.com/v6/upgrading/future#v7_normalizeformmethod"),t.v7_partialHydration===void 0&&Ie("v7_partialHydration","`RouterProvider` hydration behavior is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_partialhydration"),t.v7_skipActionErrorRevalidation===void 0&&Ie("v7_skipActionErrorRevalidation","The revalidation behavior after 4xx/5xx `action` responses is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_skipactionerrorrevalidation"))}function ma(e){U(!1)}function ga(e){let{basename:t="/",children:r=null,location:n,navigationType:a=J.Pop,navigator:l,static:o=!1,future:d}=e;rt()&&U(!1);let u=t.replace(/^\/*/,"/"),f=v.useMemo(()=>({basename:u,navigator:l,static:o,future:et({v7_relativeSplatPath:!1},d)}),[u,d,l,o]);typeof n=="string"&&(n=he(n));let{pathname:h="/",search:p="",hash:y="",state:b=null,key:S="default"}=n,x=v.useMemo(()=>{let R=Ae(h,u);return R==null?null:{location:{pathname:R,search:p,hash:y,state:b,key:S},navigationType:a}},[u,h,p,y,b,S,a]);return x==null?null:v.createElement(Ce.Provider,{value:f},v.createElement(bt.Provider,{children:r,value:x}))}function Za(e){let{children:t,location:r}=e;return ra(Tt(t),r)}new Promise(()=>{});function Tt(e,t){t===void 0&&(t=[]);let r=[];return v.Children.forEach(e,(n,a)=>{if(!v.isValidElement(n))return;let l=[...t,a];if(n.type===v.Fragment){r.push.apply(r,Tt(n.props.children,l));return}n.type!==ma&&U(!1),!n.props.index||!n.props.children||U(!1);let o={id:n.props.id||l.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,loader:n.props.loader,action:n.props.action,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(o.children=Tt(n.props.children,l)),r.push(o)}),r}function va(e){let t={hasErrorBoundary:e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&Object.assign(t,{element:v.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:v.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:v.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}/** - * React Router DOM v6.28.2 - * - * Copyright (c) Remix Software Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function tt(){return tt=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(r[a]=e[a]);return r}function ba(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function wa(e,t){return e.button===0&&(!t||t==="_self")&&!ba(e)}function Ut(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let n=e[r];return t.concat(Array.isArray(n)?n.map(a=>[r,a]):[[r,n]])},[]))}function Ra(e,t){let r=Ut(e);return t&&t.forEach((n,a)=>{r.has(a)||t.getAll(a).forEach(l=>{r.append(a,l)})}),r}const Ea=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],Sa="6";try{window.__reactRouterVersion=Sa}catch{}function qa(e,t){return On({basename:t==null?void 0:t.basename,future:tt({},t==null?void 0:t.future,{v7_prependBasename:!0}),history:nn({window:t==null?void 0:t.window}),hydrationData:(t==null?void 0:t.hydrationData)||xa(),routes:e,mapRouteProperties:va,dataStrategy:t==null?void 0:t.dataStrategy,patchRoutesOnNavigation:t==null?void 0:t.patchRoutesOnNavigation,window:t==null?void 0:t.window}).initialize()}function xa(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=tt({},t,{errors:Pa(t.errors)})),t}function Pa(e){if(!e)return null;let t=Object.entries(e),r={};for(let[n,a]of t)if(a&&a.__type==="RouteErrorResponse")r[n]=new mt(a.status,a.statusText,a.data,a.internal===!0);else if(a&&a.__type==="Error"){if(a.__subType){let l=window[a.__subType];if(typeof l=="function")try{let o=new l(a.message);o.stack="",r[n]=o}catch{}}if(r[n]==null){let l=new Error(a.message);l.stack="",r[n]=l}}else r[n]=a;return r}const Da=v.createContext({isTransitioning:!1}),La=v.createContext(new Map),Ca="startTransition",fr=en[Ca],Ma="flushSync",hr=tn[Ma];function Ta(e){fr?fr(e):e()}function Ge(e){hr?hr(e):e()}class Ua{constructor(){this.status="pending",this.promise=new Promise((t,r)=>{this.resolve=n=>{this.status==="pending"&&(this.status="resolved",t(n))},this.reject=n=>{this.status==="pending"&&(this.status="rejected",r(n))}})}}function ei(e){let{fallbackElement:t,router:r,future:n}=e,[a,l]=v.useState(r.state),[o,d]=v.useState(),[u,f]=v.useState({isTransitioning:!1}),[h,p]=v.useState(),[y,b]=v.useState(),[S,x]=v.useState(),R=v.useRef(new Map),{v7_startTransition:j}=n||{},M=v.useCallback(F=>{j?Ta(F):F()},[j]),I=v.useCallback((F,O)=>{let{deletedFetchers:$,flushSync:te,viewTransitionOpts:Q}=O;F.fetchers.forEach((Z,Me)=>{Z.data!==void 0&&R.current.set(Me,Z.data)}),$.forEach(Z=>R.current.delete(Z));let ne=r.window==null||r.window.document==null||typeof r.window.document.startViewTransition!="function";if(!Q||ne){te?Ge(()=>l(F)):M(()=>l(F));return}if(te){Ge(()=>{y&&(h&&h.resolve(),y.skipTransition()),f({isTransitioning:!0,flushSync:!0,currentLocation:Q.currentLocation,nextLocation:Q.nextLocation})});let Z=r.window.document.startViewTransition(()=>{Ge(()=>l(F))});Z.finished.finally(()=>{Ge(()=>{p(void 0),b(void 0),d(void 0),f({isTransitioning:!1})})}),Ge(()=>b(Z));return}y?(h&&h.resolve(),y.skipTransition(),x({state:F,currentLocation:Q.currentLocation,nextLocation:Q.nextLocation})):(d(F),f({isTransitioning:!0,flushSync:!1,currentLocation:Q.currentLocation,nextLocation:Q.nextLocation}))},[r.window,y,h,R,M]);v.useLayoutEffect(()=>r.subscribe(I),[r,I]),v.useEffect(()=>{u.isTransitioning&&!u.flushSync&&p(new Ua)},[u]),v.useEffect(()=>{if(h&&o&&r.window){let F=o,O=h.promise,$=r.window.document.startViewTransition(async()=>{M(()=>l(F)),await O});$.finished.finally(()=>{p(void 0),b(void 0),d(void 0),f({isTransitioning:!1})}),b($)}},[M,o,h,r.window]),v.useEffect(()=>{h&&o&&a.location.key===o.location.key&&h.resolve()},[h,y,a.location,o]),v.useEffect(()=>{!u.isTransitioning&&S&&(d(S.state),f({isTransitioning:!0,flushSync:!1,currentLocation:S.currentLocation,nextLocation:S.nextLocation}),x(void 0))},[u.isTransitioning,S]),v.useEffect(()=>{},[]);let k=v.useMemo(()=>({createHref:r.createHref,encodeLocation:r.encodeLocation,go:F=>r.navigate(F),push:(F,O,$)=>r.navigate(F,{state:O,preventScrollReset:$==null?void 0:$.preventScrollReset}),replace:(F,O,$)=>r.navigate(F,{replace:!0,state:O,preventScrollReset:$==null?void 0:$.preventScrollReset})}),[r]),X=r.basename||"/",m=v.useMemo(()=>({router:r,navigator:k,static:!1,basename:X}),[r,k,X]),ee=v.useMemo(()=>({v7_relativeSplatPath:r.future.v7_relativeSplatPath}),[r.future.v7_relativeSplatPath]);return v.useEffect(()=>pa(n,r.future),[n,r.future]),v.createElement(v.Fragment,null,v.createElement(yt.Provider,{value:m},v.createElement(Dr.Provider,{value:a},v.createElement(La.Provider,{value:R.current},v.createElement(Da.Provider,{value:u},v.createElement(ga,{basename:X,location:a.location,navigationType:a.historyAction,navigator:k,future:ee},a.initialized||r.future.v7_partialHydration?v.createElement(Fa,{routes:r.routes,future:r.future,state:a}):t))))),null)}const Fa=v.memo(_a);function _a(e){let{routes:t,future:r,state:n}=e;return Ur(t,void 0,n,r)}const Oa=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",ja=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ti=v.forwardRef(function(t,r){let{onClick:n,relative:a,reloadDocument:l,replace:o,state:d,target:u,to:f,preventScrollReset:h,viewTransition:p}=t,y=ya(t,Ea),{basename:b}=v.useContext(Ce),S,x=!1;if(typeof f=="string"&&ja.test(f)&&(S=f,Oa))try{let I=new URL(window.location.href),k=f.startsWith("//")?new URL(I.protocol+f):new URL(f),X=Ae(k.pathname,b);k.origin===I.origin&&X!=null?f=X+k.search+k.hash:x=!0}catch{}let R=ea(f,{relative:a}),j=Ba(f,{replace:o,state:d,target:u,preventScrollReset:h,relative:a,viewTransition:p});function M(I){n&&n(I),I.defaultPrevented||j(I)}return v.createElement("a",tt({},y,{href:S||R,onClick:x||l?n:M,ref:r,target:u}))});var pr;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(pr||(pr={}));var mr;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(mr||(mr={}));function Ba(e,t){let{target:r,replace:n,state:a,preventScrollReset:l,relative:o,viewTransition:d}=t===void 0?{}:t,u=Mr(),f=ze(),h=Tr(e,{relative:o});return v.useCallback(p=>{if(wa(p,r)){p.preventDefault();let y=n!==void 0?n:Le(f)===Le(h);u(e,{replace:y,state:a,preventScrollReset:l,relative:o,viewTransition:d})}},[f,u,h,n,a,r,e,l,o,d])}function ri(e){let t=v.useRef(Ut(e)),r=v.useRef(!1),n=ze(),a=v.useMemo(()=>Ra(n.search,r.current?null:t.current),[n.search]),l=Mr(),o=v.useCallback((d,u)=>{const f=Ut(typeof d=="function"?d(a):d);r.current=!0,l("?"+f,u)},[l,a]);return[a,o]}var Ia=function(t){return t.join("/").replace(/\/\/+/g,"/")},Na=/^:\w+$/,Aa=3,za=2,ka=1,Ha=10,$a=-2,gr=function(t){return t==="*"};function Va(e,t){var r=e.split("/"),n=r.length;return r.some(gr)&&(n+=$a),t&&(n+=za),r.filter(function(a){return!gr(a)}).reduce(function(a,l){return Na.test(l)?a+Aa:l===""?a+ka:a+Ha},n)}function Wa(e,t){var r=e.length===t.length&&e.slice(0,-1).every(function(n,a){return n===t[a]});return r?e[e.length-1]-t[t.length-1]:0}function Or(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"";return e.forEach(function(a,l){var o;if(typeof a.path!="string"&&!a.index&&!(!((o=a.children)===null||o===void 0)&&o.length))throw new Error("useBreadcrumbs: `path` or `index` must be provided in every route object");if(a.path&&a.index)throw new Error("useBreadcrumbs: `path` and `index` cannot be provided at the same time");var d={relativePath:a.path||"",childrenIndex:l,route:a};if(d.relativePath.charAt(0)==="/"){if(!d.relativePath.startsWith(n))throw new Error("useBreadcrumbs: The absolute path of the child route must start with the parent path");d.relativePath=d.relativePath.slice(n.length)}var u=Ia([n,d.relativePath]),f=r.concat(d);if(a.children&&a.children.length>0){if(a.index)throw new Error("useBreadcrumbs: Index route cannot have child routes");Or(a.children,t,f,u)}t.push({path:u,score:Va(u,a.index),routesMeta:f})}),t}function Ka(e){return e.sort(function(t,r){return t.score!==r.score?r.score-t.score:Wa(t.routesMeta.map(function(n){return n.childrenIndex}),r.routesMeta.map(function(n){return n.childrenIndex}))})}var Qe=Symbol("NO_BREADCRUMB"),jr=function(t){return t.replace(/^[\s_]+|[\s_]+$/g,"").replace(/[-_\s]+/g," ").replace(/^[a-z]/,function(r){return r.toUpperCase()})},Br=function(t){var r=t.breadcrumb,n=t.match,a=t.location,l=t.props,o=Object.assign({match:n,location:a,key:n.pathname},l||{});return Object.assign(Object.assign({},o),{breadcrumb:typeof r=="string"?v.createElement("span",{key:o.key},r):rn.createElement(r,Object.assign({},o))})},Ja=function(t){var r=t.currentSection,n=t.location,a=t.pathSection,l=t.defaultFormatter,o=qe({end:!0,path:a},a);return Br({breadcrumb:l?l(r):jr(r),match:o,location:n})},Ya=function(t){var r=t.currentSection,n=t.disableDefaults,a=t.excludePaths,l=t.defaultFormatter,o=t.location,d=t.pathSection,u=t.branches,f,h=function(y){return qe({path:y,end:!0},d)!=null};return a&&a.some(h)?Qe:(u.some(function(p){var y=p.path,b=p.routesMeta,S=b[b.length-1].route,x=S.breadcrumb;if(!x&&S.index){var R=b[b.length-2];R&&R.route.breadcrumb&&(x=R.route.breadcrumb)}var j=S.caseSensitive,M=S.props,I=qe({path:y,end:!0,caseSensitive:j},d);return I&&x===null?(f=Qe,!0):I?!x&&n?(f=Qe,!0):(f=Br({breadcrumb:x||(l?l(r):jr(r)),match:Object.assign(Object.assign({},I),{route:S}),location:o,props:M}),!0):!1}),f||(n?Qe:Ja({pathSection:d,currentSection:d==="/"?"Home":r,location:o,defaultFormatter:l})))},Ga=function(t){var r=t.routes,n=t.location,a=t.options,l=a===void 0?{}:a,o=n.pathname,d=Ka(Or(r)),u=[];return o.split("?")[0].split("/").reduce(function(f,h,p){var y=h?"".concat(f,"/").concat(h):"/";if(y==="/"&&p!==0)return"";var b=Ya(Object.assign({currentSection:h,location:n,pathSection:y,branches:d},l));return b!==Qe&&u.push(b),y==="/"?"":y},""),u},ni=function(t,r){return Ga({routes:t,location:ze(),options:r})};export{ti as L,Za as R,ri as a,Qa as b,ni as c,ze as d,ma as e,qa as f,ei as g,Mr as u}; diff --git a/pkg/ui/frontend/dist/assets/react-router-CHYnaA34.js b/pkg/ui/frontend/dist/assets/react-router-CHYnaA34.js new file mode 100644 index 0000000000000..04526d8c4ed1b --- /dev/null +++ b/pkg/ui/frontend/dist/assets/react-router-CHYnaA34.js @@ -0,0 +1,29 @@ +import{r as y,R as qr,a as en,b as tn}from"./react-core-D_V7s-9r.js";/** + * @remix-run/router v1.22.0 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function $(){return $=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function Ie(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function nn(){return Math.random().toString(36).substr(2,8)}function Xt(e,t){return{usr:e.state,key:e.key,idx:t}}function Qe(e,t,r,n){return r===void 0&&(r=null),$({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?he(t):t,{state:r,key:t&&t.key||n||nn()})}function Ce(e){let{pathname:t="/",search:r="",hash:n=""}=e;return r&&r!=="?"&&(t+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function he(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function an(e,t,r,n){n===void 0&&(n={});let{window:a=document.defaultView,v5Compat:l=!1}=n,o=a.history,d=Y.Pop,u=null,f=m();f==null&&(f=0,o.replaceState($({},o.state,{idx:f}),""));function m(){return(o.state||{idx:null}).idx}function h(){d=Y.Pop;let D=m(),T=D==null?null:D-f;f=D,u&&u({action:d,location:x.location,delta:T})}function v(D,T){d=Y.Push;let M=Qe(x.location,D,T);f=m()+1;let I=Xt(M,f),K=x.createHref(M);try{o.pushState(I,"",K)}catch(J){if(J instanceof DOMException&&J.name==="DataCloneError")throw J;a.location.assign(K)}l&&u&&u({action:d,location:x.location,delta:1})}function b(D,T){d=Y.Replace;let M=Qe(x.location,D,T);f=m();let I=Xt(M,f),K=x.createHref(M);o.replaceState(I,"",K),l&&u&&u({action:d,location:x.location,delta:0})}function E(D){let T=a.location.origin!=="null"?a.location.origin:a.location.href,M=typeof D=="string"?D:Ce(D);return M=M.replace(/ $/,"%20"),O(T,"No window.location.(origin|href) available to create URL for href: "+M),new URL(M,T)}let x={get action(){return d},get location(){return e(a,o)},listen(D){if(u)throw new Error("A history only accepts one active listener");return a.addEventListener(Gt,h),u=D,()=>{a.removeEventListener(Gt,h),u=null}},createHref(D){return t(a,D)},createURL:E,encodeLocation(D){let T=E(D);return{pathname:T.pathname,search:T.search,hash:T.hash}},push:v,replace:b,go(D){return o.go(D)}};return x}var z;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(z||(z={}));const on=new Set(["lazy","caseSensitive","path","id","index","children"]);function ln(e){return e.index===!0}function mt(e,t,r,n){return r===void 0&&(r=[]),n===void 0&&(n={}),e.map((a,l)=>{let o=[...r,String(l)],d=typeof a.id=="string"?a.id:o.join("-");if(O(a.index!==!0||!a.children,"Cannot specify children on an index route"),O(!n[d],'Found a route id collision on id "'+d+`". Route id's must be globally unique within Data Router usages`),ln(a)){let u=$({},a,t(a),{id:d});return n[d]=u,u}else{let u=$({},a,t(a),{id:d,children:void 0});return n[d]=u,a.children&&(u.children=mt(a.children,t,o,n)),u}})}function Pe(e,t,r){return r===void 0&&(r="/"),pt(e,t,r,!1)}function pt(e,t,r,n){let a=typeof t=="string"?he(t):t,l=Ne(a.pathname||"/",r);if(l==null)return null;let o=gr(e);un(o);let d=null;for(let u=0;d==null&&u{let u={relativePath:d===void 0?l.path||"":d,caseSensitive:l.caseSensitive===!0,childrenIndex:o,route:l};u.relativePath.startsWith("/")&&(O(u.relativePath.startsWith(n),'Absolute route path "'+u.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),u.relativePath=u.relativePath.slice(n.length));let f=fe([n,u.relativePath]),m=r.concat(u);l.children&&l.children.length>0&&(O(l.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+f+'".')),gr(l.children,t,m,f)),!(l.path==null&&!l.index)&&t.push({path:f,score:gn(f,l.index),routesMeta:m})};return e.forEach((l,o)=>{var d;if(l.path===""||!((d=l.path)!=null&&d.includes("?")))a(l,o);else for(let u of vr(l.path))a(l,o,u)}),t}function vr(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,a=r.endsWith("?"),l=r.replace(/\?$/,"");if(n.length===0)return a?[l,""]:[l];let o=vr(n.join("/")),d=[];return d.push(...o.map(u=>u===""?l:[l,u].join("/"))),a&&d.push(...o),d.map(u=>e.startsWith("/")&&u===""?"/":u)}function un(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:vn(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const dn=/^:[\w-]+$/,cn=3,fn=2,hn=1,pn=10,mn=-2,Qt=e=>e==="*";function gn(e,t){let r=e.split("/"),n=r.length;return r.some(Qt)&&(n+=mn),t&&(n+=fn),r.filter(a=>!Qt(a)).reduce((a,l)=>a+(dn.test(l)?cn:l===""?hn:pn),n)}function vn(e,t){return e.length===t.length&&e.slice(0,-1).every((n,a)=>n===t[a])?e[e.length-1]-t[t.length-1]:0}function yn(e,t,r){r===void 0&&(r=!1);let{routesMeta:n}=e,a={},l="/",o=[];for(let d=0;d{let{paramName:v,isOptional:b}=m;if(v==="*"){let x=d[h]||"";o=l.slice(0,l.length-x.length).replace(/(.)\/+$/,"$1")}const E=d[h];return b&&!E?f[v]=void 0:f[v]=(E||"").replace(/%2F/g,"/"),f},{}),pathname:l,pathnameBase:o,pattern:e}}function bn(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),Ie(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let n=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,d,u)=>(n.push({paramName:d,isOptional:u!=null}),u?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(n.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),n]}function wn(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Ie(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function Ne(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}function Rn(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:a=""}=typeof e=="string"?he(e):e;return{pathname:r?r.startsWith("/")?r:En(r,t):t,search:xn(n),hash:Pn(a)}}function En(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(a=>{a===".."?r.length>1&&r.pop():a!=="."&&r.push(a)}),r.length>1?r.join("/"):"/"}function xt(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(n)+"]. Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function yr(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function Ft(e,t){let r=yr(e);return t?r.map((n,a)=>a===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function Ot(e,t,r,n){n===void 0&&(n=!1);let a;typeof e=="string"?a=he(e):(a=$({},e),O(!a.pathname||!a.pathname.includes("?"),xt("?","pathname","search",a)),O(!a.pathname||!a.pathname.includes("#"),xt("#","pathname","hash",a)),O(!a.search||!a.search.includes("#"),xt("#","search","hash",a)));let l=e===""||a.pathname==="",o=l?"/":a.pathname,d;if(o==null)d=r;else{let h=t.length-1;if(!n&&o.startsWith("..")){let v=o.split("/");for(;v[0]==="..";)v.shift(),h-=1;a.pathname=v.join("/")}d=h>=0?t[h]:"/"}let u=Rn(a,d),f=o&&o!=="/"&&o.endsWith("/"),m=(l||o===".")&&r.endsWith("/");return!u.pathname.endsWith("/")&&(f||m)&&(u.pathname+="/"),u}const fe=e=>e.join("/").replace(/\/\/+/g,"/"),Sn=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),xn=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Pn=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class gt{constructor(t,r,n,a){a===void 0&&(a=!1),this.status=t,this.statusText=r||"",this.internal=a,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}}function qe(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const br=["post","put","patch","delete"],Dn=new Set(br),Ln=["get",...br],Cn=new Set(Ln),Mn=new Set([301,302,303,307,308]),Tn=new Set([307,308]),Pt={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Un={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Ke={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},jt=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Fn=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),wr="remix-router-transitions";function On(e){const t=e.window?e.window:typeof window<"u"?window:void 0,r=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u",n=!r;O(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let a;if(e.mapRouteProperties)a=e.mapRouteProperties;else if(e.detectErrorBoundary){let i=e.detectErrorBoundary;a=s=>({hasErrorBoundary:i(s)})}else a=Fn;let l={},o=mt(e.routes,a,void 0,l),d,u=e.basename||"/",f=e.dataStrategy||In,m=e.patchRoutesOnNavigation,h=$({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,v7_skipActionErrorRevalidation:!1},e.future),v=null,b=new Set,E=null,x=null,D=null,T=e.hydrationData!=null,M=Pe(o,e.history.location,u),I=!1,K=null;if(M==null&&!m){let i=re(404,{pathname:e.history.location.pathname}),{matches:s,route:c}=sr(o);M=s,K={[c.id]:i}}M&&!e.hydrationData&&ut(M,o,e.history.location.pathname).active&&(M=null);let J;if(M)if(M.some(i=>i.route.lazy))J=!1;else if(!M.some(i=>i.route.loader))J=!0;else if(h.v7_partialHydration){let i=e.hydrationData?e.hydrationData.loaderData:null,s=e.hydrationData?e.hydrationData.errors:null;if(s){let c=M.findIndex(g=>s[g.route.id]!==void 0);J=M.slice(0,c+1).every(g=>!Ct(g.route,i,s))}else J=M.every(c=>!Ct(c.route,i,s))}else J=e.hydrationData!=null;else if(J=!1,M=[],h.v7_partialHydration){let i=ut(null,o,e.history.location.pathname);i.active&&i.matches&&(I=!0,M=i.matches)}let be,p={historyAction:e.history.action,location:e.history.location,matches:M,initialized:J,navigation:Pt,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||K,fetchers:new Map,blockers:new Map},F=Y.Pop,H=!1,B,q=!1,G=new Map,ne=null,te=!1,se=!1,nt=[],at=new Set,Q=new Map,it=0,ze=-1,Te=new Map,ue=new Set,Ue=new Map,ke=new Map,ie=new Set,we=new Map,Re=new Map,ot;function _r(){if(v=e.history.listen(i=>{let{action:s,location:c,delta:g}=i;if(ot){ot(),ot=void 0;return}Ie(Re.size===0||g!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let w=Wt({currentLocation:p.location,nextLocation:c,historyAction:s});if(w&&g!=null){let L=new Promise(U=>{ot=U});e.history.go(g*-1),st(w,{state:"blocked",location:c,proceed(){st(w,{state:"proceeding",proceed:void 0,reset:void 0,location:c}),L.then(()=>e.history.go(g))},reset(){let U=new Map(p.blockers);U.set(w,Ke),ee({blockers:U})}});return}return Ee(s,c)}),r){Qn(t,G);let i=()=>Zn(t,G);t.addEventListener("pagehide",i),ne=()=>t.removeEventListener("pagehide",i)}return p.initialized||Ee(Y.Pop,p.location,{initialHydration:!0}),be}function Ir(){v&&v(),ne&&ne(),b.clear(),B&&B.abort(),p.fetchers.forEach((i,s)=>lt(s)),p.blockers.forEach((i,s)=>Vt(s))}function Nr(i){return b.add(i),()=>b.delete(i)}function ee(i,s){s===void 0&&(s={}),p=$({},p,i);let c=[],g=[];h.v7_fetcherPersist&&p.fetchers.forEach((w,L)=>{w.state==="idle"&&(ie.has(L)?g.push(L):c.push(L))}),ie.forEach(w=>{!p.fetchers.has(w)&&!Q.has(w)&&g.push(w)}),[...b].forEach(w=>w(p,{deletedFetchers:g,viewTransitionOpts:s.viewTransitionOpts,flushSync:s.flushSync===!0})),h.v7_fetcherPersist?(c.forEach(w=>p.fetchers.delete(w)),g.forEach(w=>lt(w))):g.forEach(w=>ie.delete(w))}function Fe(i,s,c){var g,w;let{flushSync:L}=c===void 0?{}:c,U=p.actionData!=null&&p.navigation.formMethod!=null&&oe(p.navigation.formMethod)&&p.navigation.state==="loading"&&((g=i.state)==null?void 0:g._isRedirect)!==!0,S;s.actionData?Object.keys(s.actionData).length>0?S=s.actionData:S=null:U?S=p.actionData:S=null;let P=s.loaderData?or(p.loaderData,s.loaderData,s.matches||[],s.errors):p.loaderData,R=p.blockers;R.size>0&&(R=new Map(R),R.forEach((_,Z)=>R.set(Z,Ke)));let C=H===!0||p.navigation.formMethod!=null&&oe(p.navigation.formMethod)&&((w=i.state)==null?void 0:w._isRedirect)!==!0;d&&(o=d,d=void 0),te||F===Y.Pop||(F===Y.Push?e.history.push(i,i.state):F===Y.Replace&&e.history.replace(i,i.state));let j;if(F===Y.Pop){let _=G.get(p.location.pathname);_&&_.has(i.pathname)?j={currentLocation:p.location,nextLocation:i}:G.has(i.pathname)&&(j={currentLocation:i,nextLocation:p.location})}else if(q){let _=G.get(p.location.pathname);_?_.add(i.pathname):(_=new Set([i.pathname]),G.set(p.location.pathname,_)),j={currentLocation:p.location,nextLocation:i}}ee($({},s,{actionData:S,loaderData:P,historyAction:F,location:i,initialized:!0,navigation:Pt,revalidation:"idle",restoreScrollPosition:Jt(i,s.matches||p.matches),preventScrollReset:C,blockers:R}),{viewTransitionOpts:j,flushSync:L===!0}),F=Y.Pop,H=!1,q=!1,te=!1,se=!1,nt=[]}async function It(i,s){if(typeof i=="number"){e.history.go(i);return}let c=Lt(p.location,p.matches,u,h.v7_prependBasename,i,h.v7_relativeSplatPath,s==null?void 0:s.fromRouteId,s==null?void 0:s.relative),{path:g,submission:w,error:L}=Zt(h.v7_normalizeFormMethod,!1,c,s),U=p.location,S=Qe(p.location,g,s&&s.state);S=$({},S,e.history.encodeLocation(S));let P=s&&s.replace!=null?s.replace:void 0,R=Y.Push;P===!0?R=Y.Replace:P===!1||w!=null&&oe(w.formMethod)&&w.formAction===p.location.pathname+p.location.search&&(R=Y.Replace);let C=s&&"preventScrollReset"in s?s.preventScrollReset===!0:void 0,j=(s&&s.flushSync)===!0,_=Wt({currentLocation:U,nextLocation:S,historyAction:R});if(_){st(_,{state:"blocked",location:S,proceed(){st(_,{state:"proceeding",proceed:void 0,reset:void 0,location:S}),It(i,s)},reset(){let Z=new Map(p.blockers);Z.set(_,Ke),ee({blockers:Z})}});return}return await Ee(R,S,{submission:w,pendingError:L,preventScrollReset:C,replace:s&&s.replace,enableViewTransition:s&&s.viewTransition,flushSync:j})}function Ar(){if(wt(),ee({revalidation:"loading"}),p.navigation.state!=="submitting"){if(p.navigation.state==="idle"){Ee(p.historyAction,p.location,{startUninterruptedRevalidation:!0});return}Ee(F||p.historyAction,p.navigation.location,{overrideNavigation:p.navigation,enableViewTransition:q===!0})}}async function Ee(i,s,c){B&&B.abort(),B=null,F=i,te=(c&&c.startUninterruptedRevalidation)===!0,Gr(p.location,p.matches),H=(c&&c.preventScrollReset)===!0,q=(c&&c.enableViewTransition)===!0;let g=d||o,w=c&&c.overrideNavigation,L=c!=null&&c.initialHydration&&p.matches&&p.matches.length>0&&!I?p.matches:Pe(g,s,u),U=(c&&c.flushSync)===!0,S=ut(L,g,s.pathname);if(S.active&&S.matches&&(L=S.matches),!L){let{error:k,notFoundMatches:A,route:V}=Rt(s.pathname);Fe(s,{matches:A,loaderData:{},errors:{[V.id]:k}},{flushSync:U});return}if(p.initialized&&!se&&$n(p.location,s)&&!(c&&c.submission&&oe(c.submission.formMethod))){Fe(s,{matches:L},{flushSync:U});return}B=new AbortController;let P=_e(e.history,s,B.signal,c&&c.submission),R;if(c&&c.pendingError)R=[De(L).route.id,{type:z.error,error:c.pendingError}];else if(c&&c.submission&&oe(c.submission.formMethod)){let k=await zr(P,s,c.submission,L,S.active,{replace:c.replace,flushSync:U});if(k.shortCircuited)return;if(k.pendingActionResult){let[A,V]=k.pendingActionResult;if(ae(V)&&qe(V.error)&&V.error.status===404){B=null,Fe(s,{matches:k.matches,loaderData:{},errors:{[A]:V.error}});return}}L=k.matches||L,R=k.pendingActionResult,w=Dt(s,c.submission),U=!1,S.active=!1,P=_e(e.history,P.url,P.signal)}let{shortCircuited:C,matches:j,loaderData:_,errors:Z}=await kr(P,s,L,S.active,w,c&&c.submission,c&&c.fetcherSubmission,c&&c.replace,c&&c.initialHydration===!0,U,R);C||(B=null,Fe(s,$({matches:j||L},lr(R),{loaderData:_,errors:Z})))}async function zr(i,s,c,g,w,L){L===void 0&&(L={}),wt();let U=Gn(s,c);if(ee({navigation:U},{flushSync:L.flushSync===!0}),w){let R=await dt(g,s.pathname,i.signal);if(R.type==="aborted")return{shortCircuited:!0};if(R.type==="error"){let C=De(R.partialMatches).route.id;return{matches:R.partialMatches,pendingActionResult:[C,{type:z.error,error:R.error}]}}else if(R.matches)g=R.matches;else{let{notFoundMatches:C,error:j,route:_}=Rt(s.pathname);return{matches:C,pendingActionResult:[_.id,{type:z.error,error:j}]}}}let S,P=Ge(g,s);if(!P.route.action&&!P.route.lazy)S={type:z.error,error:re(405,{method:i.method,pathname:s.pathname,routeId:P.route.id})};else if(S=(await He("action",p,i,[P],g,null))[P.route.id],i.signal.aborted)return{shortCircuited:!0};if(Le(S)){let R;return L&&L.replace!=null?R=L.replace:R=nr(S.response.headers.get("Location"),new URL(i.url),u)===p.location.pathname+p.location.search,await Se(i,S,!0,{submission:c,replace:R}),{shortCircuited:!0}}if(ve(S))throw re(400,{type:"defer-action"});if(ae(S)){let R=De(g,P.route.id);return(L&&L.replace)!==!0&&(F=Y.Push),{matches:g,pendingActionResult:[R.route.id,S]}}return{matches:g,pendingActionResult:[P.route.id,S]}}async function kr(i,s,c,g,w,L,U,S,P,R,C){let j=w||Dt(s,L),_=L||U||dr(j),Z=!te&&(!h.v7_partialHydration||!P);if(g){if(Z){let W=Nt(C);ee($({navigation:j},W!==void 0?{actionData:W}:{}),{flushSync:R})}let N=await dt(c,s.pathname,i.signal);if(N.type==="aborted")return{shortCircuited:!0};if(N.type==="error"){let W=De(N.partialMatches).route.id;return{matches:N.partialMatches,loaderData:{},errors:{[W]:N.error}}}else if(N.matches)c=N.matches;else{let{error:W,notFoundMatches:je,route:We}=Rt(s.pathname);return{matches:je,loaderData:{},errors:{[We.id]:W}}}}let k=d||o,[A,V]=er(e.history,p,c,_,s,h.v7_partialHydration&&P===!0,h.v7_skipActionErrorRevalidation,se,nt,at,ie,Ue,ue,k,u,C);if(Et(N=>!(c&&c.some(W=>W.route.id===N))||A&&A.some(W=>W.route.id===N)),ze=++it,A.length===0&&V.length===0){let N=Ht();return Fe(s,$({matches:c,loaderData:{},errors:C&&ae(C[1])?{[C[0]]:C[1].error}:null},lr(C),N?{fetchers:new Map(p.fetchers)}:{}),{flushSync:R}),{shortCircuited:!0}}if(Z){let N={};if(!g){N.navigation=j;let W=Nt(C);W!==void 0&&(N.actionData=W)}V.length>0&&(N.fetchers=Hr(V)),ee(N,{flushSync:R})}V.forEach(N=>{me(N.key),N.controller&&Q.set(N.key,N.controller)});let Oe=()=>V.forEach(N=>me(N.key));B&&B.signal.addEventListener("abort",Oe);let{loaderResults:$e,fetcherResults:ce}=await At(p,c,A,V,i);if(i.signal.aborted)return{shortCircuited:!0};B&&B.signal.removeEventListener("abort",Oe),V.forEach(N=>Q.delete(N.key));let le=ht($e);if(le)return await Se(i,le.result,!0,{replace:S}),{shortCircuited:!0};if(le=ht(ce),le)return ue.add(le.key),await Se(i,le.result,!0,{replace:S}),{shortCircuited:!0};let{loaderData:St,errors:Ve}=ir(p,c,$e,C,V,ce,we);we.forEach((N,W)=>{N.subscribe(je=>{(je||N.done)&&we.delete(W)})}),h.v7_partialHydration&&P&&p.errors&&(Ve=$({},p.errors,Ve));let xe=Ht(),ct=$t(ze),ft=xe||ct||V.length>0;return $({matches:c,loaderData:St,errors:Ve},ft?{fetchers:new Map(p.fetchers)}:{})}function Nt(i){if(i&&!ae(i[1]))return{[i[0]]:i[1].data};if(p.actionData)return Object.keys(p.actionData).length===0?null:p.actionData}function Hr(i){return i.forEach(s=>{let c=p.fetchers.get(s.key),g=Je(void 0,c?c.data:void 0);p.fetchers.set(s.key,g)}),new Map(p.fetchers)}function $r(i,s,c,g){if(n)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");me(i);let w=(g&&g.flushSync)===!0,L=d||o,U=Lt(p.location,p.matches,u,h.v7_prependBasename,c,h.v7_relativeSplatPath,s,g==null?void 0:g.relative),S=Pe(L,U,u),P=ut(S,L,U);if(P.active&&P.matches&&(S=P.matches),!S){de(i,s,re(404,{pathname:U}),{flushSync:w});return}let{path:R,submission:C,error:j}=Zt(h.v7_normalizeFormMethod,!0,U,g);if(j){de(i,s,j,{flushSync:w});return}let _=Ge(S,R),Z=(g&&g.preventScrollReset)===!0;if(C&&oe(C.formMethod)){Vr(i,s,R,_,S,P.active,w,Z,C);return}Ue.set(i,{routeId:s,path:R}),Wr(i,s,R,_,S,P.active,w,Z,C)}async function Vr(i,s,c,g,w,L,U,S,P){wt(),Ue.delete(i);function R(X){if(!X.route.action&&!X.route.lazy){let Be=re(405,{method:P.formMethod,pathname:c,routeId:s});return de(i,s,Be,{flushSync:U}),!0}return!1}if(!L&&R(g))return;let C=p.fetchers.get(i);pe(i,Xn(P,C),{flushSync:U});let j=new AbortController,_=_e(e.history,c,j.signal,P);if(L){let X=await dt(w,new URL(_.url).pathname,_.signal);if(X.type==="aborted")return;if(X.type==="error"){de(i,s,X.error,{flushSync:U});return}else if(X.matches){if(w=X.matches,g=Ge(w,c),R(g))return}else{de(i,s,re(404,{pathname:c}),{flushSync:U});return}}Q.set(i,j);let Z=it,A=(await He("action",p,_,[g],w,i))[g.route.id];if(_.signal.aborted){Q.get(i)===j&&Q.delete(i);return}if(h.v7_fetcherPersist&&ie.has(i)){if(Le(A)||ae(A)){pe(i,ge(void 0));return}}else{if(Le(A))if(Q.delete(i),ze>Z){pe(i,ge(void 0));return}else return ue.add(i),pe(i,Je(P)),Se(_,A,!1,{fetcherSubmission:P,preventScrollReset:S});if(ae(A)){de(i,s,A.error);return}}if(ve(A))throw re(400,{type:"defer-action"});let V=p.navigation.location||p.location,Oe=_e(e.history,V,j.signal),$e=d||o,ce=p.navigation.state!=="idle"?Pe($e,p.navigation.location,u):p.matches;O(ce,"Didn't find any matches after fetcher action");let le=++it;Te.set(i,le);let St=Je(P,A.data);p.fetchers.set(i,St);let[Ve,xe]=er(e.history,p,ce,P,V,!1,h.v7_skipActionErrorRevalidation,se,nt,at,ie,Ue,ue,$e,u,[g.route.id,A]);xe.filter(X=>X.key!==i).forEach(X=>{let Be=X.key,Yt=p.fetchers.get(Be),Zr=Je(void 0,Yt?Yt.data:void 0);p.fetchers.set(Be,Zr),me(Be),X.controller&&Q.set(Be,X.controller)}),ee({fetchers:new Map(p.fetchers)});let ct=()=>xe.forEach(X=>me(X.key));j.signal.addEventListener("abort",ct);let{loaderResults:ft,fetcherResults:N}=await At(p,ce,Ve,xe,Oe);if(j.signal.aborted)return;j.signal.removeEventListener("abort",ct),Te.delete(i),Q.delete(i),xe.forEach(X=>Q.delete(X.key));let W=ht(ft);if(W)return Se(Oe,W.result,!1,{preventScrollReset:S});if(W=ht(N),W)return ue.add(W.key),Se(Oe,W.result,!1,{preventScrollReset:S});let{loaderData:je,errors:We}=ir(p,ce,ft,void 0,xe,N,we);if(p.fetchers.has(i)){let X=ge(A.data);p.fetchers.set(i,X)}$t(le),p.navigation.state==="loading"&&le>ze?(O(F,"Expected pending action"),B&&B.abort(),Fe(p.navigation.location,{matches:ce,loaderData:je,errors:We,fetchers:new Map(p.fetchers)})):(ee({errors:We,loaderData:or(p.loaderData,je,ce,We),fetchers:new Map(p.fetchers)}),se=!1)}async function Wr(i,s,c,g,w,L,U,S,P){let R=p.fetchers.get(i);pe(i,Je(P,R?R.data:void 0),{flushSync:U});let C=new AbortController,j=_e(e.history,c,C.signal);if(L){let A=await dt(w,new URL(j.url).pathname,j.signal);if(A.type==="aborted")return;if(A.type==="error"){de(i,s,A.error,{flushSync:U});return}else if(A.matches)w=A.matches,g=Ge(w,c);else{de(i,s,re(404,{pathname:c}),{flushSync:U});return}}Q.set(i,C);let _=it,k=(await He("loader",p,j,[g],w,i))[g.route.id];if(ve(k)&&(k=await Bt(k,j.signal,!0)||k),Q.get(i)===C&&Q.delete(i),!j.signal.aborted){if(ie.has(i)){pe(i,ge(void 0));return}if(Le(k))if(ze>_){pe(i,ge(void 0));return}else{ue.add(i),await Se(j,k,!1,{preventScrollReset:S});return}if(ae(k)){de(i,s,k.error);return}O(!ve(k),"Unhandled fetcher deferred data"),pe(i,ge(k.data))}}async function Se(i,s,c,g){let{submission:w,fetcherSubmission:L,preventScrollReset:U,replace:S}=g===void 0?{}:g;s.response.headers.has("X-Remix-Revalidate")&&(se=!0);let P=s.response.headers.get("Location");O(P,"Expected a Location header on the redirect Response"),P=nr(P,new URL(i.url),u);let R=Qe(p.location,P,{_isRedirect:!0});if(r){let A=!1;if(s.response.headers.has("X-Remix-Reload-Document"))A=!0;else if(jt.test(P)){const V=e.history.createURL(P);A=V.origin!==t.location.origin||Ne(V.pathname,u)==null}if(A){S?t.location.replace(P):t.location.assign(P);return}}B=null;let C=S===!0||s.response.headers.has("X-Remix-Replace")?Y.Replace:Y.Push,{formMethod:j,formAction:_,formEncType:Z}=p.navigation;!w&&!L&&j&&_&&Z&&(w=dr(p.navigation));let k=w||L;if(Tn.has(s.response.status)&&k&&oe(k.formMethod))await Ee(C,R,{submission:$({},k,{formAction:P}),preventScrollReset:U||H,enableViewTransition:c?q:void 0});else{let A=Dt(R,w);await Ee(C,R,{overrideNavigation:A,fetcherSubmission:L,preventScrollReset:U||H,enableViewTransition:c?q:void 0})}}async function He(i,s,c,g,w,L){let U,S={};try{U=await Nn(f,i,s,c,g,w,L,l,a)}catch(P){return g.forEach(R=>{S[R.route.id]={type:z.error,error:P}}),S}for(let[P,R]of Object.entries(U))if(Vn(R)){let C=R.result;S[P]={type:z.redirect,response:kn(C,c,P,w,u,h.v7_relativeSplatPath)}}else S[P]=await zn(R);return S}async function At(i,s,c,g,w){let L=i.matches,U=He("loader",i,w,c,s,null),S=Promise.all(g.map(async C=>{if(C.matches&&C.match&&C.controller){let _=(await He("loader",i,_e(e.history,C.path,C.controller.signal),[C.match],C.matches,C.key))[C.match.route.id];return{[C.key]:_}}else return Promise.resolve({[C.key]:{type:z.error,error:re(404,{pathname:C.path})}})})),P=await U,R=(await S).reduce((C,j)=>Object.assign(C,j),{});return await Promise.all([Jn(s,P,w.signal,L,i.loaderData),Yn(s,R,g)]),{loaderResults:P,fetcherResults:R}}function wt(){se=!0,nt.push(...Et()),Ue.forEach((i,s)=>{Q.has(s)&&at.add(s),me(s)})}function pe(i,s,c){c===void 0&&(c={}),p.fetchers.set(i,s),ee({fetchers:new Map(p.fetchers)},{flushSync:(c&&c.flushSync)===!0})}function de(i,s,c,g){g===void 0&&(g={});let w=De(p.matches,s);lt(i),ee({errors:{[w.route.id]:c},fetchers:new Map(p.fetchers)},{flushSync:(g&&g.flushSync)===!0})}function zt(i){return ke.set(i,(ke.get(i)||0)+1),ie.has(i)&&ie.delete(i),p.fetchers.get(i)||Un}function lt(i){let s=p.fetchers.get(i);Q.has(i)&&!(s&&s.state==="loading"&&Te.has(i))&&me(i),Ue.delete(i),Te.delete(i),ue.delete(i),h.v7_fetcherPersist&&ie.delete(i),at.delete(i),p.fetchers.delete(i)}function Kr(i){let s=(ke.get(i)||0)-1;s<=0?(ke.delete(i),ie.add(i),h.v7_fetcherPersist||lt(i)):ke.set(i,s),ee({fetchers:new Map(p.fetchers)})}function me(i){let s=Q.get(i);s&&(s.abort(),Q.delete(i))}function kt(i){for(let s of i){let c=zt(s),g=ge(c.data);p.fetchers.set(s,g)}}function Ht(){let i=[],s=!1;for(let c of ue){let g=p.fetchers.get(c);O(g,"Expected fetcher: "+c),g.state==="loading"&&(ue.delete(c),i.push(c),s=!0)}return kt(i),s}function $t(i){let s=[];for(let[c,g]of Te)if(g0}function Jr(i,s){let c=p.blockers.get(i)||Ke;return Re.get(i)!==s&&Re.set(i,s),c}function Vt(i){p.blockers.delete(i),Re.delete(i)}function st(i,s){let c=p.blockers.get(i)||Ke;O(c.state==="unblocked"&&s.state==="blocked"||c.state==="blocked"&&s.state==="blocked"||c.state==="blocked"&&s.state==="proceeding"||c.state==="blocked"&&s.state==="unblocked"||c.state==="proceeding"&&s.state==="unblocked","Invalid blocker state transition: "+c.state+" -> "+s.state);let g=new Map(p.blockers);g.set(i,s),ee({blockers:g})}function Wt(i){let{currentLocation:s,nextLocation:c,historyAction:g}=i;if(Re.size===0)return;Re.size>1&&Ie(!1,"A router only supports one blocker at a time");let w=Array.from(Re.entries()),[L,U]=w[w.length-1],S=p.blockers.get(L);if(!(S&&S.state==="proceeding")&&U({currentLocation:s,nextLocation:c,historyAction:g}))return L}function Rt(i){let s=re(404,{pathname:i}),c=d||o,{matches:g,route:w}=sr(c);return Et(),{notFoundMatches:g,route:w,error:s}}function Et(i){let s=[];return we.forEach((c,g)=>{(!i||i(g))&&(c.cancel(),s.push(g),we.delete(g))}),s}function Yr(i,s,c){if(E=i,D=s,x=c||null,!T&&p.navigation===Pt){T=!0;let g=Jt(p.location,p.matches);g!=null&&ee({restoreScrollPosition:g})}return()=>{E=null,D=null,x=null}}function Kt(i,s){return x&&x(i,s.map(g=>sn(g,p.loaderData)))||i.key}function Gr(i,s){if(E&&D){let c=Kt(i,s);E[c]=D()}}function Jt(i,s){if(E){let c=Kt(i,s),g=E[c];if(typeof g=="number")return g}return null}function ut(i,s,c){if(m)if(i){if(Object.keys(i[0].params).length>0)return{active:!0,matches:pt(s,c,u,!0)}}else return{active:!0,matches:pt(s,c,u,!0)||[]};return{active:!1,matches:null}}async function dt(i,s,c){if(!m)return{type:"success",matches:i};let g=i;for(;;){let w=d==null,L=d||o,U=l;try{await m({signal:c,path:s,matches:g,patch:(R,C)=>{c.aborted||rr(R,C,L,U,a)}})}catch(R){return{type:"error",error:R,partialMatches:g}}finally{w&&!c.aborted&&(o=[...o])}if(c.aborted)return{type:"aborted"};let S=Pe(L,s,u);if(S)return{type:"success",matches:S};let P=pt(L,s,u,!0);if(!P||g.length===P.length&&g.every((R,C)=>R.route.id===P[C].route.id))return{type:"success",matches:null};g=P}}function Xr(i){l={},d=mt(i,a,void 0,l)}function Qr(i,s){let c=d==null;rr(i,s,d||o,l,a),c&&(o=[...o],ee({}))}return be={get basename(){return u},get future(){return h},get state(){return p},get routes(){return o},get window(){return t},initialize:_r,subscribe:Nr,enableScrollRestoration:Yr,navigate:It,fetch:$r,revalidate:Ar,createHref:i=>e.history.createHref(i),encodeLocation:i=>e.history.encodeLocation(i),getFetcher:zt,deleteFetcher:Kr,dispose:Ir,getBlocker:Jr,deleteBlocker:Vt,patchRoutes:Qr,_internalFetchControllers:Q,_internalActiveDeferreds:we,_internalSetRoutes:Xr},be}function jn(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function Lt(e,t,r,n,a,l,o,d){let u,f;if(o){u=[];for(let h of t)if(u.push(h),h.route.id===o){f=h;break}}else u=t,f=t[t.length-1];let m=Ot(a||".",Ft(u,l),Ne(e.pathname,r)||e.pathname,d==="path");if(a==null&&(m.search=e.search,m.hash=e.hash),(a==null||a===""||a===".")&&f){let h=_t(m.search);if(f.route.index&&!h)m.search=m.search?m.search.replace(/^\?/,"?index&"):"?index";else if(!f.route.index&&h){let v=new URLSearchParams(m.search),b=v.getAll("index");v.delete("index"),b.filter(x=>x).forEach(x=>v.append("index",x));let E=v.toString();m.search=E?"?"+E:""}}return n&&r!=="/"&&(m.pathname=m.pathname==="/"?r:fe([r,m.pathname])),Ce(m)}function Zt(e,t,r,n){if(!n||!jn(n))return{path:r};if(n.formMethod&&!Kn(n.formMethod))return{path:r,error:re(405,{method:n.formMethod})};let a=()=>({path:r,error:re(400,{type:"invalid-body"})}),l=n.formMethod||"get",o=e?l.toUpperCase():l.toLowerCase(),d=Sr(r);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!oe(o))return a();let v=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((b,E)=>{let[x,D]=E;return""+b+x+"="+D+` +`},""):String(n.body);return{path:r,submission:{formMethod:o,formAction:d,formEncType:n.formEncType,formData:void 0,json:void 0,text:v}}}else if(n.formEncType==="application/json"){if(!oe(o))return a();try{let v=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:r,submission:{formMethod:o,formAction:d,formEncType:n.formEncType,formData:void 0,json:v,text:void 0}}}catch{return a()}}}O(typeof FormData=="function","FormData is not available in this environment");let u,f;if(n.formData)u=Mt(n.formData),f=n.formData;else if(n.body instanceof FormData)u=Mt(n.body),f=n.body;else if(n.body instanceof URLSearchParams)u=n.body,f=ar(u);else if(n.body==null)u=new URLSearchParams,f=new FormData;else try{u=new URLSearchParams(n.body),f=ar(u)}catch{return a()}let m={formMethod:o,formAction:d,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:f,json:void 0,text:void 0};if(oe(m.formMethod))return{path:r,submission:m};let h=he(r);return t&&h.search&&_t(h.search)&&u.append("index",""),h.search="?"+u,{path:Ce(h),submission:m}}function qt(e,t,r){r===void 0&&(r=!1);let n=e.findIndex(a=>a.route.id===t);return n>=0?e.slice(0,r?n+1:n):e}function er(e,t,r,n,a,l,o,d,u,f,m,h,v,b,E,x){let D=x?ae(x[1])?x[1].error:x[1].data:void 0,T=e.createURL(t.location),M=e.createURL(a),I=r;l&&t.errors?I=qt(r,Object.keys(t.errors)[0],!0):x&&ae(x[1])&&(I=qt(r,x[0]));let K=x?x[1].statusCode:void 0,J=o&&K&&K>=400,be=I.filter((F,H)=>{let{route:B}=F;if(B.lazy)return!0;if(B.loader==null)return!1;if(l)return Ct(B,t.loaderData,t.errors);if(Bn(t.loaderData,t.matches[H],F)||u.some(ne=>ne===F.route.id))return!0;let q=t.matches[H],G=F;return tr(F,$({currentUrl:T,currentParams:q.params,nextUrl:M,nextParams:G.params},n,{actionResult:D,actionStatus:K,defaultShouldRevalidate:J?!1:d||T.pathname+T.search===M.pathname+M.search||T.search!==M.search||Rr(q,G)}))}),p=[];return h.forEach((F,H)=>{if(l||!r.some(te=>te.route.id===F.routeId)||m.has(H))return;let B=Pe(b,F.path,E);if(!B){p.push({key:H,routeId:F.routeId,path:F.path,matches:null,match:null,controller:null});return}let q=t.fetchers.get(H),G=Ge(B,F.path),ne=!1;v.has(H)?ne=!1:f.has(H)?(f.delete(H),ne=!0):q&&q.state!=="idle"&&q.data===void 0?ne=d:ne=tr(G,$({currentUrl:T,currentParams:t.matches[t.matches.length-1].params,nextUrl:M,nextParams:r[r.length-1].params},n,{actionResult:D,actionStatus:K,defaultShouldRevalidate:J?!1:d})),ne&&p.push({key:H,routeId:F.routeId,path:F.path,matches:B,match:G,controller:new AbortController})}),[be,p]}function Ct(e,t,r){if(e.lazy)return!0;if(!e.loader)return!1;let n=t!=null&&t[e.id]!==void 0,a=r!=null&&r[e.id]!==void 0;return!n&&a?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!n&&!a}function Bn(e,t,r){let n=!t||r.route.id!==t.route.id,a=e[r.route.id]===void 0;return n||a}function Rr(e,t){let r=e.route.path;return e.pathname!==t.pathname||r!=null&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}function tr(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if(typeof r=="boolean")return r}return t.defaultShouldRevalidate}function rr(e,t,r,n,a){var l;let o;if(e){let f=n[e];O(f,"No route found to patch children into: routeId = "+e),f.children||(f.children=[]),o=f.children}else o=r;let d=t.filter(f=>!o.some(m=>Er(f,m))),u=mt(d,a,[e||"_","patch",String(((l=o)==null?void 0:l.length)||"0")],n);o.push(...u)}function Er(e,t){return"id"in e&&"id"in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children.every((r,n)=>{var a;return(a=t.children)==null?void 0:a.some(l=>Er(r,l))}):!1}async function _n(e,t,r){if(!e.lazy)return;let n=await e.lazy();if(!e.lazy)return;let a=r[e.id];O(a,"No route found in manifest");let l={};for(let o in n){let u=a[o]!==void 0&&o!=="hasErrorBoundary";Ie(!u,'Route "'+a.id+'" has a static property "'+o+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+o+'" will be ignored.')),!u&&!on.has(o)&&(l[o]=n[o])}Object.assign(a,l),Object.assign(a,$({},t(a),{lazy:void 0}))}async function In(e){let{matches:t}=e,r=t.filter(a=>a.shouldLoad);return(await Promise.all(r.map(a=>a.resolve()))).reduce((a,l,o)=>Object.assign(a,{[r[o].route.id]:l}),{})}async function Nn(e,t,r,n,a,l,o,d,u,f){let m=l.map(b=>b.route.lazy?_n(b.route,u,d):void 0),h=l.map((b,E)=>{let x=m[E],D=a.some(M=>M.route.id===b.route.id);return $({},b,{shouldLoad:D,resolve:async M=>(M&&n.method==="GET"&&(b.route.lazy||b.route.loader)&&(D=!0),D?An(t,n,b,x,M,f):Promise.resolve({type:z.data,result:void 0}))})}),v=await e({matches:h,request:n,params:l[0].params,fetcherKey:o,context:f});try{await Promise.all(m)}catch{}return v}async function An(e,t,r,n,a,l){let o,d,u=f=>{let m,h=new Promise((E,x)=>m=x);d=()=>m(),t.signal.addEventListener("abort",d);let v=E=>typeof f!="function"?Promise.reject(new Error("You cannot call the handler for a route which defines a boolean "+('"'+e+'" [routeId: '+r.route.id+"]"))):f({request:t,params:r.params,context:l},...E!==void 0?[E]:[]),b=(async()=>{try{return{type:"data",result:await(a?a(x=>v(x)):v())}}catch(E){return{type:"error",result:E}}})();return Promise.race([b,h])};try{let f=r.route[e];if(n)if(f){let m,[h]=await Promise.all([u(f).catch(v=>{m=v}),n]);if(m!==void 0)throw m;o=h}else if(await n,f=r.route[e],f)o=await u(f);else if(e==="action"){let m=new URL(t.url),h=m.pathname+m.search;throw re(405,{method:t.method,pathname:h,routeId:r.route.id})}else return{type:z.data,result:void 0};else if(f)o=await u(f);else{let m=new URL(t.url),h=m.pathname+m.search;throw re(404,{pathname:h})}O(o.result!==void 0,"You defined "+(e==="action"?"an action":"a loader")+" for route "+('"'+r.route.id+"\" but didn't return anything from your `"+e+"` ")+"function. Please return a value or `null`.")}catch(f){return{type:z.error,result:f}}finally{d&&t.signal.removeEventListener("abort",d)}return o}async function zn(e){let{result:t,type:r}=e;if(xr(t)){let h;try{let v=t.headers.get("Content-Type");v&&/\bapplication\/json\b/.test(v)?t.body==null?h=null:h=await t.json():h=await t.text()}catch(v){return{type:z.error,error:v}}return r===z.error?{type:z.error,error:new gt(t.status,t.statusText,h),statusCode:t.status,headers:t.headers}:{type:z.data,data:h,statusCode:t.status,headers:t.headers}}if(r===z.error){if(ur(t)){var n,a;if(t.data instanceof Error){var l,o;return{type:z.error,error:t.data,statusCode:(l=t.init)==null?void 0:l.status,headers:(o=t.init)!=null&&o.headers?new Headers(t.init.headers):void 0}}return{type:z.error,error:new gt(((n=t.init)==null?void 0:n.status)||500,void 0,t.data),statusCode:qe(t)?t.status:void 0,headers:(a=t.init)!=null&&a.headers?new Headers(t.init.headers):void 0}}return{type:z.error,error:t,statusCode:qe(t)?t.status:void 0}}if(Wn(t)){var d,u;return{type:z.deferred,deferredData:t,statusCode:(d=t.init)==null?void 0:d.status,headers:((u=t.init)==null?void 0:u.headers)&&new Headers(t.init.headers)}}if(ur(t)){var f,m;return{type:z.data,data:t.data,statusCode:(f=t.init)==null?void 0:f.status,headers:(m=t.init)!=null&&m.headers?new Headers(t.init.headers):void 0}}return{type:z.data,data:t}}function kn(e,t,r,n,a,l){let o=e.headers.get("Location");if(O(o,"Redirects returned/thrown from loaders/actions must have a Location header"),!jt.test(o)){let d=n.slice(0,n.findIndex(u=>u.route.id===r)+1);o=Lt(new URL(t.url),d,a,!0,o,l),e.headers.set("Location",o)}return e}function nr(e,t,r){if(jt.test(e)){let n=e,a=n.startsWith("//")?new URL(t.protocol+n):new URL(n),l=Ne(a.pathname,r)!=null;if(a.origin===t.origin&&l)return a.pathname+a.search+a.hash}return e}function _e(e,t,r,n){let a=e.createURL(Sr(t)).toString(),l={signal:r};if(n&&oe(n.formMethod)){let{formMethod:o,formEncType:d}=n;l.method=o.toUpperCase(),d==="application/json"?(l.headers=new Headers({"Content-Type":d}),l.body=JSON.stringify(n.json)):d==="text/plain"?l.body=n.text:d==="application/x-www-form-urlencoded"&&n.formData?l.body=Mt(n.formData):l.body=n.formData}return new Request(a,l)}function Mt(e){let t=new URLSearchParams;for(let[r,n]of e.entries())t.append(r,typeof n=="string"?n:n.name);return t}function ar(e){let t=new FormData;for(let[r,n]of e.entries())t.append(r,n);return t}function Hn(e,t,r,n,a){let l={},o=null,d,u=!1,f={},m=r&&ae(r[1])?r[1].error:void 0;return e.forEach(h=>{if(!(h.route.id in t))return;let v=h.route.id,b=t[v];if(O(!Le(b),"Cannot handle redirect results in processLoaderData"),ae(b)){let E=b.error;m!==void 0&&(E=m,m=void 0),o=o||{};{let x=De(e,v);o[x.route.id]==null&&(o[x.route.id]=E)}l[v]=void 0,u||(u=!0,d=qe(b.error)?b.error.status:500),b.headers&&(f[v]=b.headers)}else ve(b)?(n.set(v,b.deferredData),l[v]=b.deferredData.data,b.statusCode!=null&&b.statusCode!==200&&!u&&(d=b.statusCode),b.headers&&(f[v]=b.headers)):(l[v]=b.data,b.statusCode&&b.statusCode!==200&&!u&&(d=b.statusCode),b.headers&&(f[v]=b.headers))}),m!==void 0&&r&&(o={[r[0]]:m},l[r[0]]=void 0),{loaderData:l,errors:o,statusCode:d||200,loaderHeaders:f}}function ir(e,t,r,n,a,l,o){let{loaderData:d,errors:u}=Hn(t,r,n,o);return a.forEach(f=>{let{key:m,match:h,controller:v}=f,b=l[m];if(O(b,"Did not find corresponding fetcher result"),!(v&&v.signal.aborted))if(ae(b)){let E=De(e.matches,h==null?void 0:h.route.id);u&&u[E.route.id]||(u=$({},u,{[E.route.id]:b.error})),e.fetchers.delete(m)}else if(Le(b))O(!1,"Unhandled fetcher revalidation redirect");else if(ve(b))O(!1,"Unhandled fetcher deferred data");else{let E=ge(b.data);e.fetchers.set(m,E)}}),{loaderData:d,errors:u}}function or(e,t,r,n){let a=$({},t);for(let l of r){let o=l.route.id;if(t.hasOwnProperty(o)?t[o]!==void 0&&(a[o]=t[o]):e[o]!==void 0&&l.route.loader&&(a[o]=e[o]),n&&n.hasOwnProperty(o))break}return a}function lr(e){return e?ae(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function De(e,t){return(t?e.slice(0,e.findIndex(n=>n.route.id===t)+1):[...e]).reverse().find(n=>n.route.hasErrorBoundary===!0)||e[0]}function sr(e){let t=e.length===1?e[0]:e.find(r=>r.index||!r.path||r.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function re(e,t){let{pathname:r,routeId:n,method:a,type:l,message:o}=t===void 0?{}:t,d="Unknown Server Error",u="Unknown @remix-run/router error";return e===400?(d="Bad Request",a&&r&&n?u="You made a "+a+' request to "'+r+'" but '+('did not provide a `loader` for route "'+n+'", ')+"so there is no way to handle the request.":l==="defer-action"?u="defer() is not supported in actions":l==="invalid-body"&&(u="Unable to encode submission body")):e===403?(d="Forbidden",u='Route "'+n+'" does not match URL "'+r+'"'):e===404?(d="Not Found",u='No route matches URL "'+r+'"'):e===405&&(d="Method Not Allowed",a&&r&&n?u="You made a "+a.toUpperCase()+' request to "'+r+'" but '+('did not provide an `action` for route "'+n+'", ')+"so there is no way to handle the request.":a&&(u='Invalid request method "'+a.toUpperCase()+'"')),new gt(e||500,d,new Error(u),!0)}function ht(e){let t=Object.entries(e);for(let r=t.length-1;r>=0;r--){let[n,a]=t[r];if(Le(a))return{key:n,result:a}}}function Sr(e){let t=typeof e=="string"?he(e):e;return Ce($({},t,{hash:""}))}function $n(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function Vn(e){return xr(e.result)&&Mn.has(e.result.status)}function ve(e){return e.type===z.deferred}function ae(e){return e.type===z.error}function Le(e){return(e&&e.type)===z.redirect}function ur(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function Wn(e){let t=e;return t&&typeof t=="object"&&typeof t.data=="object"&&typeof t.subscribe=="function"&&typeof t.cancel=="function"&&typeof t.resolveData=="function"}function xr(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function Kn(e){return Cn.has(e.toLowerCase())}function oe(e){return Dn.has(e.toLowerCase())}async function Jn(e,t,r,n,a){let l=Object.entries(t);for(let o=0;o(v==null?void 0:v.route.id)===d);if(!f)continue;let m=n.find(v=>v.route.id===f.route.id),h=m!=null&&!Rr(m,f)&&(a&&a[f.route.id])!==void 0;ve(u)&&h&&await Bt(u,r,!1).then(v=>{v&&(t[d]=v)})}}async function Yn(e,t,r){for(let n=0;n(f==null?void 0:f.route.id)===l)&&ve(d)&&(O(o,"Expected an AbortController for revalidating fetcher deferred result"),await Bt(d,o.signal,!0).then(f=>{f&&(t[a]=f)}))}}async function Bt(e,t,r){if(r===void 0&&(r=!1),!await e.deferredData.resolveData(t)){if(r)try{return{type:z.data,data:e.deferredData.unwrappedData}}catch(a){return{type:z.error,error:a}}return{type:z.data,data:e.deferredData.data}}}function _t(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function Ge(e,t){let r=typeof t=="string"?he(t).search:t.search;if(e[e.length-1].route.index&&_t(r||""))return e[e.length-1];let n=yr(e);return n[n.length-1]}function dr(e){let{formMethod:t,formAction:r,formEncType:n,text:a,formData:l,json:o}=e;if(!(!t||!r||!n)){if(a!=null)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:void 0,text:a};if(l!=null)return{formMethod:t,formAction:r,formEncType:n,formData:l,json:void 0,text:void 0};if(o!==void 0)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:o,text:void 0}}}function Dt(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function Gn(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function Je(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function Xn(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function ge(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function Qn(e,t){try{let r=e.sessionStorage.getItem(wr);if(r){let n=JSON.parse(r);for(let[a,l]of Object.entries(n||{}))l&&Array.isArray(l)&&t.set(a,new Set(l||[]))}}catch{}}function Zn(e,t){if(t.size>0){let r={};for(let[n,a]of t)r[n]=[...a];try{e.sessionStorage.setItem(wr,JSON.stringify(r))}catch(n){Ie(!1,"Failed to save applied view transitions in sessionStorage ("+n+").")}}}/** + * React Router v6.29.0 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function et(){return et=Object.assign?Object.assign.bind():function(e){for(var t=1;t{d.current=!0}),y.useCallback(function(f,m){if(m===void 0&&(m={}),!d.current)return;if(typeof f=="number"){n.go(f);return}let h=Ot(f,JSON.parse(o),l,m.relative==="path");e==null&&t!=="/"&&(h.pathname=h.pathname==="/"?t:fe([t,h.pathname])),(m.replace?n.replace:n.push)(h,m.state,m)},[t,n,o,l,e])}function Ga(){let{matches:e}=y.useContext(ye),t=e[e.length-1];return t?t.params:{}}function Mr(e,t){let{relative:r}=t===void 0?{}:t,{future:n}=y.useContext(Me),{matches:a}=y.useContext(ye),{pathname:l}=Ae(),o=JSON.stringify(Ft(a,n.v7_relativeSplatPath));return y.useMemo(()=>Ot(e,JSON.parse(o),l,r==="path"),[e,o,l,r])}function ta(e,t){return Tr(e,t)}function Tr(e,t,r,n){rt()||O(!1);let{navigator:a,static:l}=y.useContext(Me),{matches:o}=y.useContext(ye),d=o[o.length-1],u=d?d.params:{};d&&d.pathname;let f=d?d.pathnameBase:"/";d&&d.route;let m=Ae(),h;if(t){var v;let T=typeof t=="string"?he(t):t;f==="/"||(v=T.pathname)!=null&&v.startsWith(f)||O(!1),h=T}else h=m;let b=h.pathname||"/",E=b;if(f!=="/"){let T=f.replace(/^\//,"").split("/");E="/"+b.replace(/^\//,"").split("/").slice(T.length).join("/")}let x=!l&&r&&r.matches&&r.matches.length>0?r.matches:Pe(e,{pathname:E}),D=oa(x&&x.map(T=>Object.assign({},T,{params:Object.assign({},u,T.params),pathname:fe([f,a.encodeLocation?a.encodeLocation(T.pathname).pathname:T.pathname]),pathnameBase:T.pathnameBase==="/"?f:fe([f,a.encodeLocation?a.encodeLocation(T.pathnameBase).pathname:T.pathnameBase])})),o,r,n);return t&&D?y.createElement(bt.Provider,{value:{location:et({pathname:"/",search:"",hash:"",state:null,key:"default"},h),navigationType:Y.Pop}},D):D}function ra(){let e=da(),t=qe(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,a={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return y.createElement(y.Fragment,null,y.createElement("h2",null,"Unexpected Application Error!"),y.createElement("h3",{style:{fontStyle:"italic"}},t),r?y.createElement("pre",{style:a},r):null,null)}const na=y.createElement(ra,null);class aa extends y.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,r){return r.location!==t.location||r.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:r.error,location:r.location,revalidation:t.revalidation||r.revalidation}}componentDidCatch(t,r){console.error("React Router caught the following error during render",t,r)}render(){return this.state.error!==void 0?y.createElement(ye.Provider,{value:this.props.routeContext},y.createElement(Dr.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function ia(e){let{routeContext:t,match:r,children:n}=e,a=y.useContext(yt);return a&&a.static&&a.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=r.route.id),y.createElement(ye.Provider,{value:t},n)}function oa(e,t,r,n){var a;if(t===void 0&&(t=[]),r===void 0&&(r=null),n===void 0&&(n=null),e==null){var l;if(!r)return null;if(r.errors)e=r.matches;else if((l=n)!=null&&l.v7_partialHydration&&t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let o=e,d=(a=r)==null?void 0:a.errors;if(d!=null){let m=o.findIndex(h=>h.route.id&&(d==null?void 0:d[h.route.id])!==void 0);m>=0||O(!1),o=o.slice(0,Math.min(o.length,m+1))}let u=!1,f=-1;if(r&&n&&n.v7_partialHydration)for(let m=0;m=0?o=o.slice(0,f+1):o=[o[0]];break}}}return o.reduceRight((m,h,v)=>{let b,E=!1,x=null,D=null;r&&(b=d&&h.route.id?d[h.route.id]:void 0,x=h.route.errorElement||na,u&&(f<0&&v===0?(E=!0,D=null):f===v&&(E=!0,D=h.route.hydrateFallbackElement||null)));let T=t.concat(o.slice(0,v+1)),M=()=>{let I;return b?I=x:E?I=D:h.route.Component?I=y.createElement(h.route.Component,null):h.route.element?I=h.route.element:I=m,y.createElement(ia,{match:h,routeContext:{outlet:m,matches:T,isDataRoute:r!=null},children:I})};return r&&(h.route.ErrorBoundary||h.route.errorElement||v===0)?y.createElement(aa,{location:r.location,revalidation:r.revalidation,component:x,error:b,children:M(),routeContext:{outlet:null,matches:T,isDataRoute:!0}}):M()},null)}var Ur=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(Ur||{}),vt=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(vt||{});function la(e){let t=y.useContext(yt);return t||O(!1),t}function sa(e){let t=y.useContext(Pr);return t||O(!1),t}function ua(e){let t=y.useContext(ye);return t||O(!1),t}function Fr(e){let t=ua(),r=t.matches[t.matches.length-1];return r.route.id||O(!1),r.route.id}function da(){var e;let t=y.useContext(Dr),r=sa(vt.UseRouteError),n=Fr(vt.UseRouteError);return t!==void 0?t:(e=r.errors)==null?void 0:e[n]}function ca(){let{router:e}=la(Ur.UseNavigateStable),t=Fr(vt.UseNavigateStable),r=y.useRef(!1);return Lr(()=>{r.current=!0}),y.useCallback(function(a,l){l===void 0&&(l={}),r.current&&(typeof a=="number"?e.navigate(a):e.navigate(a,et({fromRouteId:t},l)))},[e,t])}function fa(e,t){e==null||e.v7_startTransition,(e==null?void 0:e.v7_relativeSplatPath)===void 0&&(!t||t.v7_relativeSplatPath),t&&(t.v7_fetcherPersist,t.v7_normalizeFormMethod,t.v7_partialHydration,t.v7_skipActionErrorRevalidation)}function ha(e){O(!1)}function pa(e){let{basename:t="/",children:r=null,location:n,navigationType:a=Y.Pop,navigator:l,static:o=!1,future:d}=e;rt()&&O(!1);let u=t.replace(/^\/*/,"/"),f=y.useMemo(()=>({basename:u,navigator:l,static:o,future:et({v7_relativeSplatPath:!1},d)}),[u,d,l,o]);typeof n=="string"&&(n=he(n));let{pathname:m="/",search:h="",hash:v="",state:b=null,key:E="default"}=n,x=y.useMemo(()=>{let D=Ne(m,u);return D==null?null:{location:{pathname:D,search:h,hash:v,state:b,key:E},navigationType:a}},[u,m,h,v,b,E,a]);return x==null?null:y.createElement(Me.Provider,{value:f},y.createElement(bt.Provider,{children:r,value:x}))}function Xa(e){let{children:t,location:r}=e;return ta(Tt(t),r)}new Promise(()=>{});function Tt(e,t){t===void 0&&(t=[]);let r=[];return y.Children.forEach(e,(n,a)=>{if(!y.isValidElement(n))return;let l=[...t,a];if(n.type===y.Fragment){r.push.apply(r,Tt(n.props.children,l));return}n.type!==ha&&O(!1),!n.props.index||!n.props.children||O(!1);let o={id:n.props.id||l.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,loader:n.props.loader,action:n.props.action,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(o.children=Tt(n.props.children,l)),r.push(o)}),r}function ma(e){let t={hasErrorBoundary:e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&Object.assign(t,{element:y.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:y.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:y.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}/** + * React Router DOM v6.29.0 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function tt(){return tt=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(r[a]=e[a]);return r}function va(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function ya(e,t){return e.button===0&&(!t||t==="_self")&&!va(e)}function Ut(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let n=e[r];return t.concat(Array.isArray(n)?n.map(a=>[r,a]):[[r,n]])},[]))}function ba(e,t){let r=Ut(e);return t&&t.forEach((n,a)=>{r.has(a)||t.getAll(a).forEach(l=>{r.append(a,l)})}),r}const wa=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],Ra="6";try{window.__reactRouterVersion=Ra}catch{}function Qa(e,t){return On({basename:t==null?void 0:t.basename,future:tt({},t==null?void 0:t.future,{v7_prependBasename:!0}),history:rn({window:t==null?void 0:t.window}),hydrationData:(t==null?void 0:t.hydrationData)||Ea(),routes:e,mapRouteProperties:ma,dataStrategy:t==null?void 0:t.dataStrategy,patchRoutesOnNavigation:t==null?void 0:t.patchRoutesOnNavigation,window:t==null?void 0:t.window}).initialize()}function Ea(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=tt({},t,{errors:Sa(t.errors)})),t}function Sa(e){if(!e)return null;let t=Object.entries(e),r={};for(let[n,a]of t)if(a&&a.__type==="RouteErrorResponse")r[n]=new gt(a.status,a.statusText,a.data,a.internal===!0);else if(a&&a.__type==="Error"){if(a.__subType){let l=window[a.__subType];if(typeof l=="function")try{let o=new l(a.message);o.stack="",r[n]=o}catch{}}if(r[n]==null){let l=new Error(a.message);l.stack="",r[n]=l}}else r[n]=a;return r}const xa=y.createContext({isTransitioning:!1}),Pa=y.createContext(new Map),Da="startTransition",cr=qr[Da],La="flushSync",fr=en[La];function Ca(e){cr?cr(e):e()}function Ye(e){fr?fr(e):e()}class Ma{constructor(){this.status="pending",this.promise=new Promise((t,r)=>{this.resolve=n=>{this.status==="pending"&&(this.status="resolved",t(n))},this.reject=n=>{this.status==="pending"&&(this.status="rejected",r(n))}})}}function Za(e){let{fallbackElement:t,router:r,future:n}=e,[a,l]=y.useState(r.state),[o,d]=y.useState(),[u,f]=y.useState({isTransitioning:!1}),[m,h]=y.useState(),[v,b]=y.useState(),[E,x]=y.useState(),D=y.useRef(new Map),{v7_startTransition:T}=n||{},M=y.useCallback(F=>{T?Ca(F):F()},[T]),I=y.useCallback((F,H)=>{let{deletedFetchers:B,flushSync:q,viewTransitionOpts:G}=H;F.fetchers.forEach((te,se)=>{te.data!==void 0&&D.current.set(se,te.data)}),B.forEach(te=>D.current.delete(te));let ne=r.window==null||r.window.document==null||typeof r.window.document.startViewTransition!="function";if(!G||ne){q?Ye(()=>l(F)):M(()=>l(F));return}if(q){Ye(()=>{v&&(m&&m.resolve(),v.skipTransition()),f({isTransitioning:!0,flushSync:!0,currentLocation:G.currentLocation,nextLocation:G.nextLocation})});let te=r.window.document.startViewTransition(()=>{Ye(()=>l(F))});te.finished.finally(()=>{Ye(()=>{h(void 0),b(void 0),d(void 0),f({isTransitioning:!1})})}),Ye(()=>b(te));return}v?(m&&m.resolve(),v.skipTransition(),x({state:F,currentLocation:G.currentLocation,nextLocation:G.nextLocation})):(d(F),f({isTransitioning:!0,flushSync:!1,currentLocation:G.currentLocation,nextLocation:G.nextLocation}))},[r.window,v,m,D,M]);y.useLayoutEffect(()=>r.subscribe(I),[r,I]),y.useEffect(()=>{u.isTransitioning&&!u.flushSync&&h(new Ma)},[u]),y.useEffect(()=>{if(m&&o&&r.window){let F=o,H=m.promise,B=r.window.document.startViewTransition(async()=>{M(()=>l(F)),await H});B.finished.finally(()=>{h(void 0),b(void 0),d(void 0),f({isTransitioning:!1})}),b(B)}},[M,o,m,r.window]),y.useEffect(()=>{m&&o&&a.location.key===o.location.key&&m.resolve()},[m,v,a.location,o]),y.useEffect(()=>{!u.isTransitioning&&E&&(d(E.state),f({isTransitioning:!0,flushSync:!1,currentLocation:E.currentLocation,nextLocation:E.nextLocation}),x(void 0))},[u.isTransitioning,E]),y.useEffect(()=>{},[]);let K=y.useMemo(()=>({createHref:r.createHref,encodeLocation:r.encodeLocation,go:F=>r.navigate(F),push:(F,H,B)=>r.navigate(F,{state:H,preventScrollReset:B==null?void 0:B.preventScrollReset}),replace:(F,H,B)=>r.navigate(F,{replace:!0,state:H,preventScrollReset:B==null?void 0:B.preventScrollReset})}),[r]),J=r.basename||"/",be=y.useMemo(()=>({router:r,navigator:K,static:!1,basename:J}),[r,K,J]),p=y.useMemo(()=>({v7_relativeSplatPath:r.future.v7_relativeSplatPath}),[r.future.v7_relativeSplatPath]);return y.useEffect(()=>fa(n,r.future),[n,r.future]),y.createElement(y.Fragment,null,y.createElement(yt.Provider,{value:be},y.createElement(Pr.Provider,{value:a},y.createElement(Pa.Provider,{value:D.current},y.createElement(xa.Provider,{value:u},y.createElement(pa,{basename:J,location:a.location,navigationType:a.historyAction,navigator:K,future:p},a.initialized||r.future.v7_partialHydration?y.createElement(Ta,{routes:r.routes,future:r.future,state:a}):t))))),null)}const Ta=y.memo(Ua);function Ua(e){let{routes:t,future:r,state:n}=e;return Tr(t,void 0,n,r)}const Fa=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Oa=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,qa=y.forwardRef(function(t,r){let{onClick:n,relative:a,reloadDocument:l,replace:o,state:d,target:u,to:f,preventScrollReset:m,viewTransition:h}=t,v=ga(t,wa),{basename:b}=y.useContext(Me),E,x=!1;if(typeof f=="string"&&Oa.test(f)&&(E=f,Fa))try{let I=new URL(window.location.href),K=f.startsWith("//")?new URL(I.protocol+f):new URL(f),J=Ne(K.pathname,b);K.origin===I.origin&&J!=null?f=J+K.search+K.hash:x=!0}catch{}let D=qn(f,{relative:a}),T=ja(f,{replace:o,state:d,target:u,preventScrollReset:m,relative:a,viewTransition:h});function M(I){n&&n(I),I.defaultPrevented||T(I)}return y.createElement("a",tt({},v,{href:E||D,onClick:x||l?n:M,ref:r,target:u}))});var hr;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(hr||(hr={}));var pr;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(pr||(pr={}));function ja(e,t){let{target:r,replace:n,state:a,preventScrollReset:l,relative:o,viewTransition:d}=t===void 0?{}:t,u=Cr(),f=Ae(),m=Mr(e,{relative:o});return y.useCallback(h=>{if(ya(h,r)){h.preventDefault();let v=n!==void 0?n:Ce(f)===Ce(m);u(e,{replace:v,state:a,preventScrollReset:l,relative:o,viewTransition:d})}},[f,u,m,n,a,r,e,l,o,d])}function ei(e){let t=y.useRef(Ut(e)),r=y.useRef(!1),n=Ae(),a=y.useMemo(()=>ba(n.search,r.current?null:t.current),[n.search]),l=Cr(),o=y.useCallback((d,u)=>{const f=Ut(typeof d=="function"?d(a):d);r.current=!0,l("?"+f,u)},[l,a]);return[a,o]}var Ba=function(t){return t.join("/").replace(/\/\/+/g,"/")},_a=/^:\w+$/,Ia=3,Na=2,Aa=1,za=10,ka=-2,mr=function(t){return t==="*"};function Ha(e,t){var r=e.split("/"),n=r.length;return r.some(mr)&&(n+=ka),t&&(n+=Na),r.filter(function(a){return!mr(a)}).reduce(function(a,l){return _a.test(l)?a+Ia:l===""?a+Aa:a+za},n)}function $a(e,t){var r=e.length===t.length&&e.slice(0,-1).every(function(n,a){return n===t[a]});return r?e[e.length-1]-t[t.length-1]:0}function Or(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"";return e.forEach(function(a,l){var o;if(typeof a.path!="string"&&!a.index&&!(!((o=a.children)===null||o===void 0)&&o.length))throw new Error("useBreadcrumbs: `path` or `index` must be provided in every route object");if(a.path&&a.index)throw new Error("useBreadcrumbs: `path` and `index` cannot be provided at the same time");var d={relativePath:a.path||"",childrenIndex:l,route:a};if(d.relativePath.charAt(0)==="/"){if(!d.relativePath.startsWith(n))throw new Error("useBreadcrumbs: The absolute path of the child route must start with the parent path");d.relativePath=d.relativePath.slice(n.length)}var u=Ba([n,d.relativePath]),f=r.concat(d);if(a.children&&a.children.length>0){if(a.index)throw new Error("useBreadcrumbs: Index route cannot have child routes");Or(a.children,t,f,u)}t.push({path:u,score:Ha(u,a.index),routesMeta:f})}),t}function Va(e){return e.sort(function(t,r){return t.score!==r.score?r.score-t.score:$a(t.routesMeta.map(function(n){return n.childrenIndex}),r.routesMeta.map(function(n){return n.childrenIndex}))})}var Xe=Symbol("NO_BREADCRUMB"),jr=function(t){return t.replace(/^[\s_]+|[\s_]+$/g,"").replace(/[-_\s]+/g," ").replace(/^[a-z]/,function(r){return r.toUpperCase()})},Br=function(t){var r=t.breadcrumb,n=t.match,a=t.location,l=t.props,o=Object.assign({match:n,location:a,key:n.pathname},l||{});return Object.assign(Object.assign({},o),{breadcrumb:typeof r=="string"?y.createElement("span",{key:o.key},r):tn.createElement(r,Object.assign({},o))})},Wa=function(t){var r=t.currentSection,n=t.location,a=t.pathSection,l=t.defaultFormatter,o=Ze({end:!0,path:a},a);return Br({breadcrumb:l?l(r):jr(r),match:o,location:n})},Ka=function(t){var r=t.currentSection,n=t.disableDefaults,a=t.excludePaths,l=t.defaultFormatter,o=t.location,d=t.pathSection,u=t.branches,f,m=function(v){return Ze({path:v,end:!0},d)!=null};return a&&a.some(m)?Xe:(u.some(function(h){var v=h.path,b=h.routesMeta,E=b[b.length-1].route,x=E.breadcrumb;if(!x&&E.index){var D=b[b.length-2];D&&D.route.breadcrumb&&(x=D.route.breadcrumb)}var T=E.caseSensitive,M=E.props,I=Ze({path:v,end:!0,caseSensitive:T},d);return I&&x===null?(f=Xe,!0):I?!x&&n?(f=Xe,!0):(f=Br({breadcrumb:x||(l?l(r):jr(r)),match:Object.assign(Object.assign({},I),{route:E}),location:o,props:M}),!0):!1}),f||(n?Xe:Wa({pathSection:d,currentSection:d==="/"?"Home":r,location:o,defaultFormatter:l})))},Ja=function(t){var r=t.routes,n=t.location,a=t.options,l=a===void 0?{}:a,o=n.pathname,d=Va(Or(r)),u=[];return o.split("?")[0].split("/").reduce(function(f,m,h){var v=m?"".concat(f,"/").concat(m):"/";if(v==="/"&&h!==0)return"";var b=Ka(Object.assign({currentSection:m,location:n,pathSection:v,branches:d},l));return b!==Xe&&u.push(b),v==="/"?"":v},""),u},ti=function(t,r){return Ja({routes:t,location:Ae(),options:r})};export{qa as L,Xa as R,ei as a,Ga as b,ti as c,Ae as d,ha as e,Qa as f,Za as g,Cr as u}; diff --git a/pkg/ui/frontend/dist/assets/ui-icons-CFVjIJRk.js b/pkg/ui/frontend/dist/assets/ui-icons-CjYyohUG.js similarity index 90% rename from pkg/ui/frontend/dist/assets/ui-icons-CFVjIJRk.js rename to pkg/ui/frontend/dist/assets/ui-icons-CjYyohUG.js index df33ce94fd275..f4246323a4bab 100644 --- a/pkg/ui/frontend/dist/assets/ui-icons-CFVjIJRk.js +++ b/pkg/ui/frontend/dist/assets/ui-icons-CjYyohUG.js @@ -1,190 +1,190 @@ import{r as h,b as s}from"./react-core-D_V7s-9r.js";/** - * @license lucide-react v0.474.0 - ISC + * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const g=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),m=(...e)=>e.filter((t,o,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===o).join(" ").trim();/** - * @license lucide-react v0.474.0 - ISC + * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */var x={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** - * @license lucide-react v0.474.0 - ISC + * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const b=h.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:o=2,absoluteStrokeWidth:r,className:a="",children:c,iconNode:p,...y},i)=>h.createElement("svg",{ref:i,...x,width:t,height:t,stroke:e,strokeWidth:r?Number(o)*24/Number(t):o,className:m("lucide",a),...y},[...p.map(([w,_])=>h.createElement(w,_)),...Array.isArray(c)?c:[c]]));/** - * @license lucide-react v0.474.0 - ISC + * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const n=(e,t)=>{const o=h.forwardRef(({className:r,...a},c)=>h.createElement(b,{ref:c,iconNode:t,className:m(`lucide-${g(e)}`,r),...a}));return o.displayName=`${e}`,o};/** - * @license lucide-react v0.474.0 - ISC + * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const C=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],le=n("ArrowDown",C);/** - * @license lucide-react v0.474.0 - ISC + * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const M=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],pe=n("ArrowUp",M);/** - * @license lucide-react v0.474.0 - ISC + * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const N=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],ue=n("BookOpen",N);/** - * @license lucide-react v0.474.0 - ISC + * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const $=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],ke=n("Check",$);/** - * @license lucide-react v0.474.0 - ISC + * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const j=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],me=n("ChevronDown",j);/** - * @license lucide-react v0.474.0 - ISC + * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const O=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],ve=n("ChevronRight",O);/** - * @license lucide-react v0.474.0 - ISC + * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const P=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],fe=n("ChevronUp",P);/** - * @license lucide-react v0.474.0 - ISC + * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const D=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],we=n("ChevronsUpDown",D);/** - * @license lucide-react v0.474.0 - ISC + * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const A=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],_e=n("CircleAlert",A);/** - * @license lucide-react v0.474.0 - ISC + * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const q=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 8v8",key:"napkw2"}],["path",{d:"m8 12 4 4 4-4",key:"k98ssh"}]],ge=n("CircleArrowDown",q);/** - * @license lucide-react v0.474.0 - ISC + * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const z=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"m12 16 4-4-4-4",key:"1i9zcv"}]],xe=n("CircleArrowRight",z);/** - * @license lucide-react v0.474.0 - ISC + * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const L=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 12-4-4-4 4",key:"177agl"}],["path",{d:"M12 16V8",key:"1sbj14"}]],be=n("CircleArrowUp",L);/** - * @license lucide-react v0.474.0 - ISC + * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const E=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]],Ce=n("CircleDot",E);/** - * @license lucide-react v0.474.0 - ISC + * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const R=[["path",{d:"M15.6 2.7a10 10 0 1 0 5.7 5.7",key:"1e0p6d"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"M13.4 10.6 19 5",key:"1kr7tw"}]],Me=n("CircleGauge",R);/** - * @license lucide-react v0.474.0 - ISC + * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const S=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Ne=n("Circle",S);/** - * @license lucide-react v0.474.0 - ISC + * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const U=[["rect",{x:"2",y:"6",width:"20",height:"8",rx:"1",key:"1estib"}],["path",{d:"M17 14v7",key:"7m2elx"}],["path",{d:"M7 14v7",key:"1cm7wv"}],["path",{d:"M17 3v3",key:"1v4jwn"}],["path",{d:"M7 3v3",key:"7o6guu"}],["path",{d:"M10 14 2.3 6.3",key:"1023jk"}],["path",{d:"m14 6 7.7 7.7",key:"1s8pl2"}],["path",{d:"m8 6 8 8",key:"hl96qh"}]],$e=n("Construction",U);/** - * @license lucide-react v0.474.0 - ISC + * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const H=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],je=n("Copy",H);/** - * @license lucide-react v0.474.0 - ISC + * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const V=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],Oe=n("Database",V);/** - * @license lucide-react v0.474.0 - ISC + * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const B=[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]],Pe=n("Download",B);/** - * @license lucide-react v0.474.0 - ISC + * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const I=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]],De=n("File",I);/** - * @license lucide-react v0.474.0 - ISC + * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const F=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],Ae=n("Folder",F);/** - * @license lucide-react v0.474.0 - ISC + * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const G=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]],qe=n("House",G);/** - * @license lucide-react v0.474.0 - ISC + * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const W=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],ze=n("LayoutDashboard",W);/** - * @license lucide-react v0.474.0 - ISC + * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Z=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Le=n("LoaderCircle",Z);/** - * @license lucide-react v0.474.0 - ISC + * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const K=[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]],Ee=n("Moon",K);/** - * @license lucide-react v0.474.0 - ISC + * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const T=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],Re=n("PanelLeft",T);/** - * @license lucide-react v0.474.0 - ISC + * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const X=[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]],Se=n("Pause",X);/** - * @license lucide-react v0.474.0 - ISC + * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const J=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Ue=n("Plus",J);/** - * @license lucide-react v0.474.0 - ISC + * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Q=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],He=n("RefreshCw",Q);/** - * @license lucide-react v0.474.0 - ISC + * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Y=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],Ve=n("RotateCcw",Y);/** - * @license lucide-react v0.474.0 - ISC + * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const ee=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],Be=n("Search",ee);/** - * @license lucide-react v0.474.0 - ISC + * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const te=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],Ie=n("Sun",te);/** - * @license lucide-react v0.474.0 - ISC + * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const oe=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]],Fe=n("Users",oe);/** - * @license lucide-react v0.474.0 - ISC + * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. diff --git a/pkg/ui/frontend/dist/index.html b/pkg/ui/frontend/dist/index.html index 9af5b6ebeea80..e5f77cfb45cec 100644 --- a/pkg/ui/frontend/dist/index.html +++ b/pkg/ui/frontend/dist/index.html @@ -5,18 +5,18 @@ Loki UI - + - - + + - - - - - + + + + + - + diff --git a/pkg/ui/frontend/src/components/explorer/breadcrumb.tsx b/pkg/ui/frontend/src/components/explorer/breadcrumb.tsx index 000e707dfd3b6..31dc563d724c2 100644 --- a/pkg/ui/frontend/src/components/explorer/breadcrumb.tsx +++ b/pkg/ui/frontend/src/components/explorer/breadcrumb.tsx @@ -10,6 +10,7 @@ import { BreadcrumbSeparator, } from "@/components/ui/breadcrumb"; import { Link } from "react-router-dom"; +import { absolutePath } from "@/util"; const getProviderStyles = ( provider: string @@ -105,7 +106,7 @@ export function ExplorerBreadcrumb() { }, [cluster?.members]); React.useEffect(() => { if (nodeName) { - fetch(`/ui/api/v1/proxy/${nodeName}/dataobj/api/v1/provider`) + fetch(absolutePath(`/api/v1/proxy/${nodeName}/dataobj/api/v1/provider`)) .then((res) => res.json()) .then((data) => setProvider(data.provider)) .catch(console.error); diff --git a/pkg/ui/frontend/src/components/nodes/node-status-indicator.tsx b/pkg/ui/frontend/src/components/nodes/node-status-indicator.tsx index 41c76b853ae40..ed308b994e92a 100644 --- a/pkg/ui/frontend/src/components/nodes/node-status-indicator.tsx +++ b/pkg/ui/frontend/src/components/nodes/node-status-indicator.tsx @@ -1,5 +1,6 @@ import { useEffect, useState } from "react"; import { cn } from "@/lib/utils"; +import { absolutePath } from "@/util"; interface NodeStatusIndicatorProps { nodeName: string; @@ -24,7 +25,9 @@ export function NodeStatusIndicator({ useEffect(() => { const checkStatus = async () => { try { - const response = await fetch(`/ui/api/v1/proxy/${nodeName}/ready`); + const response = await fetch( + absolutePath(`/api/v1/proxy/${nodeName}/ready`) + ); const text = await response.text(); setStatus({ isReady: response.ok && text.includes("ready"), diff --git a/pkg/ui/frontend/src/components/nodes/pprof-controls.tsx b/pkg/ui/frontend/src/components/nodes/pprof-controls.tsx index d8d13ef9a6c9a..bbaba36e59a8e 100644 --- a/pkg/ui/frontend/src/components/nodes/pprof-controls.tsx +++ b/pkg/ui/frontend/src/components/nodes/pprof-controls.tsx @@ -4,6 +4,7 @@ import { TooltipContent, TooltipTrigger, } from "@/components/ui/tooltip"; +import { absolutePath } from "@/util"; interface PprofControlsProps { nodeName: string; @@ -70,7 +71,10 @@ const pprofTypes = [ export function PprofControls({ nodeName }: PprofControlsProps) { const downloadPprof = (type: string) => { - window.open(`/ui/api/v1/proxy/${nodeName}/debug/pprof/${type}`, "_blank"); + window.open( + absolutePath(`/api/v1/proxy/${nodeName}/debug/pprof/${type}`), + "_blank" + ); }; return ( diff --git a/pkg/ui/frontend/src/contexts/cluster-provider.tsx b/pkg/ui/frontend/src/contexts/cluster-provider.tsx index bfb31ec4d1030..ef44ce56ae3d4 100644 --- a/pkg/ui/frontend/src/contexts/cluster-provider.tsx +++ b/pkg/ui/frontend/src/contexts/cluster-provider.tsx @@ -1,6 +1,7 @@ import { useState, useCallback, useRef, useEffect, ReactNode } from "react"; import { Cluster } from "@/types/cluster"; import { ClusterContext } from "./cluster-context"; +import { absolutePath } from "@/util"; interface ClusterProviderProps { children: ReactNode; @@ -21,7 +22,7 @@ export function ClusterProvider({ children }: ClusterProviderProps) { setIsLoading(true); try { - const response = await fetch("/ui/api/v1/cluster/nodes"); + const response = await fetch(absolutePath("/api/v1/cluster/nodes")); if (!response.ok) { throw new Error(`Failed to fetch cluster data: ${response.statusText}`); } diff --git a/pkg/ui/frontend/src/hooks/use-explorer-data.ts b/pkg/ui/frontend/src/hooks/use-explorer-data.ts index bc21b1c65e864..bf029d88b87e9 100644 --- a/pkg/ui/frontend/src/hooks/use-explorer-data.ts +++ b/pkg/ui/frontend/src/hooks/use-explorer-data.ts @@ -3,6 +3,7 @@ import { ExplorerData, ExplorerFile } from "@/types/explorer"; import { useCluster } from "@/contexts/use-cluster"; import { useMemo } from "react"; import { findNodeName } from "@/lib/utils"; +import { absolutePath } from "@/util"; // mux.HandleFunc("/api/v1/dataobj/list", s.handleList) // mux.HandleFunc("/api/v1/dataobj/inspect", s.handleInspect) @@ -23,9 +24,11 @@ export function useExplorerData(path: string) { throw new Error("Node name not found"); } const response = await fetch( - `/ui/api/v1/proxy/${nodeName}/dataobj/api/v1/list?path=${encodeURIComponent( - path - )}` + absolutePath( + `/api/v1/proxy/${nodeName}/dataobj/api/v1/list?path=${encodeURIComponent( + path + )}` + ) ); if (!response.ok) { throw new Error("Failed to fetch explorer data"); @@ -35,9 +38,11 @@ export function useExplorerData(path: string) { ...data, files: sortFilesByDate(data.files).map((file) => ({ ...file, - downloadUrl: `/api/v1/proxy/${nodeName}/dataobj/api/v1/download?file=${encodeURIComponent( - path ? `${path}/${file.name}` : file.name - )}`, + downloadUrl: absolutePath( + `/api/v1/proxy/${nodeName}/dataobj/api/v1/download?file=${encodeURIComponent( + path ? `${path}/${file.name}` : file.name + )}` + ), })), }; }, diff --git a/pkg/ui/frontend/src/hooks/use-file-metadata.ts b/pkg/ui/frontend/src/hooks/use-file-metadata.ts index 7038af5e5c462..537f201b7eefe 100644 --- a/pkg/ui/frontend/src/hooks/use-file-metadata.ts +++ b/pkg/ui/frontend/src/hooks/use-file-metadata.ts @@ -3,7 +3,7 @@ import { findNodeName } from "@/lib/utils"; import { useCluster } from "@/contexts/use-cluster"; import { useMemo } from "react"; import { FileMetadataResponse } from "@/types/explorer"; - +import { absolutePath } from "@/util"; export function useFileMetadata(path: string | undefined) { const { cluster } = useCluster(); const nodeName = useMemo(() => { @@ -20,9 +20,11 @@ export function useFileMetadata(path: string | undefined) { if (!path) throw new Error("No file path provided"); if (!nodeName) throw new Error("Node name not found"); const response = await fetch( - `/ui/api/v1/proxy/${nodeName}/dataobj/api/v1/inspect?file=${encodeURIComponent( - path - )}` + absolutePath( + `/api/v1/proxy/${nodeName}/dataobj/api/v1/inspect?file=${encodeURIComponent( + path + )}` + ) ); if (!response.ok) { throw new Error("Failed to fetch file metadata"); diff --git a/pkg/ui/frontend/src/hooks/use-log-level.ts b/pkg/ui/frontend/src/hooks/use-log-level.ts index da3e564d03402..76bbdf2b0329b 100644 --- a/pkg/ui/frontend/src/hooks/use-log-level.ts +++ b/pkg/ui/frontend/src/hooks/use-log-level.ts @@ -1,3 +1,4 @@ +import { absolutePath } from "@/util"; import { useState, useEffect } from "react"; interface LogLevelResponse { @@ -32,7 +33,9 @@ export function useLogLevel(nodeName: string | undefined): UseLogLevelResult { setError(null); try { - const res = await fetch(`/ui/api/v1/proxy/${nodeName}/log_level`); + const res = await fetch( + absolutePath(`/api/v1/proxy/${nodeName}/log_level`) + ); if (!res.ok) throw new Error(`Failed to fetch log level: ${res.statusText}`); const data: LogLevelResponse = await res.json(); @@ -58,7 +61,7 @@ export function useLogLevel(nodeName: string | undefined): UseLogLevelResult { try { const res = await fetch( - `/ui/api/v1/proxy/${nodeName}/log_level?log_level=${level}`, + absolutePath(`/api/v1/proxy/${nodeName}/log_level?log_level=${level}`), { method: "POST" } ); if (!res.ok) diff --git a/pkg/ui/frontend/src/hooks/use-node-details.ts b/pkg/ui/frontend/src/hooks/use-node-details.ts index 78928e6e96e72..31be0579e581d 100644 --- a/pkg/ui/frontend/src/hooks/use-node-details.ts +++ b/pkg/ui/frontend/src/hooks/use-node-details.ts @@ -1,3 +1,4 @@ +import { absolutePath } from "@/util"; import { useState, useEffect } from "react"; interface NodeMetrics { @@ -48,7 +49,11 @@ export function useNodeDetails( setIsLoading(true); setError(null); - fetch(`/ui/api/v1/proxy/${nodeName}/ui/api/v1/cluster/nodes/self/details`) + fetch( + absolutePath( + `/api/v1/proxy/${nodeName}/ui/api/v1/cluster/nodes/self/details` + ) + ) .then((response) => { if (!response.ok) { throw new Error( diff --git a/pkg/ui/frontend/src/hooks/use-node-metrics.ts b/pkg/ui/frontend/src/hooks/use-node-metrics.ts index 5cd9227a17540..91680573bb257 100644 --- a/pkg/ui/frontend/src/hooks/use-node-metrics.ts +++ b/pkg/ui/frontend/src/hooks/use-node-metrics.ts @@ -1,3 +1,4 @@ +import { absolutePath } from "@/util"; import { useState, useEffect } from "react"; interface UseNodeMetricsResult { @@ -33,9 +34,12 @@ export function useNodeMetrics( setError(null); try { - const response = await fetch(`/ui/api/v1/proxy/${nodeName}/metrics`, { - signal: abortController.signal, - }); + const response = await fetch( + absolutePath(`/api/v1/proxy/${nodeName}/metrics`), + { + signal: abortController.signal, + } + ); if (!response.ok) { throw new Error(`Failed to fetch metrics: ${response.statusText}`); diff --git a/pkg/ui/frontend/src/hooks/use-rate-node-metrics.ts b/pkg/ui/frontend/src/hooks/use-rate-node-metrics.ts index 867e618dc8de3..f8d2bfc0bea1d 100644 --- a/pkg/ui/frontend/src/hooks/use-rate-node-metrics.ts +++ b/pkg/ui/frontend/src/hooks/use-rate-node-metrics.ts @@ -1,5 +1,5 @@ import { useCallback, useRef } from "react"; - +import { absolutePath } from "@/util"; interface MetricSample { timestamp: number; values: Record; @@ -41,7 +41,7 @@ export const useRateNodeMetrics = () => { nodeNames.map(async (nodeName) => { try { const response = await fetch( - `/ui/api/v1/proxy/${nodeName}/metrics` + absolutePath(`/api/v1/proxy/${nodeName}/metrics`) ); if (!response.ok) { diff --git a/pkg/ui/frontend/src/lib/ring-utils.ts b/pkg/ui/frontend/src/lib/ring-utils.ts index bd29b45f2a447..42a93fb910c7c 100644 --- a/pkg/ui/frontend/src/lib/ring-utils.ts +++ b/pkg/ui/frontend/src/lib/ring-utils.ts @@ -1,6 +1,7 @@ import { RingType, RingTypes } from "@/types/ring"; import { formatDistanceToNowStrict, formatISO } from "date-fns"; import { findNodeName, hasService } from "./utils"; +import { absolutePath } from "@/util"; export function formatRelativeTime(timestamp: string) { const date = new Date(timestamp); @@ -202,7 +203,7 @@ export function getRingProxyPath( const nodeName = findNodeName(members, serviceName); if (!nodeName) return ""; - const proxyPath = `/ui/api/v1/proxy/${nodeName}`; + const proxyPath = absolutePath(`/api/v1/proxy/${nodeName}`); const ringPath = RingServices[serviceName].ringPath; const tokensParam = RingServices[serviceName].needsTokens ? "?tokens=true" diff --git a/pkg/ui/frontend/src/pages/analyze-labels.tsx b/pkg/ui/frontend/src/pages/analyze-labels.tsx index d8ec30d4f7c72..cd5bf65aefcac 100644 --- a/pkg/ui/frontend/src/pages/analyze-labels.tsx +++ b/pkg/ui/frontend/src/pages/analyze-labels.tsx @@ -54,6 +54,7 @@ import { import { Badge } from "@/components/ui/badge"; import { cn } from "@/lib/utils"; import { useToast } from "@/hooks/use-toast"; +import { absolutePath } from "@/util"; const formSchema = z.object({ tenant: z.string().min(1, "Tenant ID is required"), @@ -151,9 +152,11 @@ export default function AnalyzeLabels() { const start = new Date(end.getTime() - parseDuration(values.since)); const response = await fetch( - `/ui/api/v1/proxy/${nodeName}/loki/api/v1/series?match[]=${encodeURIComponent( - values.matcher - )}&start=${start.getTime() * 1e6}&end=${end.getTime() * 1e6}`, + absolutePath( + `/api/v1/proxy/${nodeName}/loki/api/v1/series?match[]=${encodeURIComponent( + values.matcher + )}&start=${start.getTime() * 1e6}&end=${end.getTime() * 1e6}` + ), { headers: { "X-Scope-OrgID": values.tenant, diff --git a/pkg/ui/frontend/src/pages/deletes.tsx b/pkg/ui/frontend/src/pages/deletes.tsx index 183f5e2c5fbe4..4b36b188471d7 100644 --- a/pkg/ui/frontend/src/pages/deletes.tsx +++ b/pkg/ui/frontend/src/pages/deletes.tsx @@ -28,6 +28,7 @@ import { } from "@/components/ui/hover-card"; import { Input } from "@/components/ui/input"; import { PageContainer } from "@/layout/page-container"; +import { absolutePath } from "@/util"; interface DeleteRequest { request_id: string; @@ -58,7 +59,9 @@ const useDeletes = (status: string[]) => { const requests = await Promise.all( status.map(async (s) => { const response = await fetch( - `/ui/api/v1/proxy/${nodeName}/compactor/ui/api/v1/deletes?status=${s}` + absolutePath( + `/api/v1/proxy/${nodeName}/compactor/ui/api/v1/deletes?status=${s}` + ) ); if (!response.ok) { const errorText = await response.text(); diff --git a/pkg/ui/frontend/src/pages/new-delete.tsx b/pkg/ui/frontend/src/pages/new-delete.tsx index 307b2245fbc28..f6ec4359d0a17 100644 --- a/pkg/ui/frontend/src/pages/new-delete.tsx +++ b/pkg/ui/frontend/src/pages/new-delete.tsx @@ -27,6 +27,7 @@ import * as z from "zod"; import DatePicker from "react-datepicker"; import "react-datepicker/dist/react-datepicker.css"; import { PageContainer } from "@/layout/page-container"; +import { absolutePath } from "@/util"; const formSchema = z.object({ tenant_id: z.string().min(1, "Tenant ID is required"), @@ -72,7 +73,9 @@ const NewDeleteRequest = () => { setQueryValidating(true); try { const response = await fetch( - `/ui/api/v1/proxy/${nodeName}/loki/api/v1/format_query?query=${query}`, + absolutePath( + `/api/v1/proxy/${nodeName}/loki/api/v1/format_query?query=${query}` + ), { method: "POST", } @@ -121,7 +124,9 @@ const NewDeleteRequest = () => { try { const response = await fetch( - `/ui/api/v1/proxy/${nodeName}/compactor/ui/api/v1/deletes?${params.toString()}`, + absolutePath( + `/api/v1/proxy/${nodeName}/compactor/ui/api/v1/deletes?${params.toString()}` + ), { method: "POST", headers: { diff --git a/pkg/ui/frontend/src/util.ts b/pkg/ui/frontend/src/util.ts index c0335c77f66bd..9d7003372b9a7 100644 --- a/pkg/ui/frontend/src/util.ts +++ b/pkg/ui/frontend/src/util.ts @@ -7,3 +7,8 @@ export function getBasename(): string { const match = pathname.match(/(.*\/ui\/)/); return match?.[1] || "/ui/"; } + +export function absolutePath(path: string): string { + const basename = getBasename(); + return `${basename}${path.startsWith("/") ? path.slice(1) : path}`; +}