@rozenite/storage-plugin 2.1.0 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/dist/devtools/assets/panel-D5z1BY8U.js +32 -0
- package/dist/devtools/assets/panel-DVlWRg6d.css +1 -0
- package/dist/devtools/panel.html +2 -2
- package/dist/rozenite.json +1 -1
- package/package.json +7 -7
- package/src/ui/__tests__/panel.test.tsx +14 -0
- package/src/ui/add-entry-dialog.tsx +63 -73
- package/src/ui/binary-value-editor.tsx +1 -1
- package/src/ui/edit-entry-dialog.tsx +59 -70
- package/src/ui/entry-detail-dialog.tsx +4 -2
- package/src/ui/format-value.tsx +1 -1
- package/src/ui/import-dialog.tsx +5 -5
- package/src/ui/panel.tsx +70 -88
- package/tsconfig.json +4 -7
- package/dist/devtools/assets/panel-BlDRXgVW.js +0 -32
- package/dist/devtools/assets/panel-DBweZnW5.css +0 -1
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
function PH(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in t)){const s=Object.getOwnPropertyDescriptor(r,i);s&&Object.defineProperty(t,i,s.get?s:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const a of s.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();var zH=t=>t.disabled||Array.isArray(t.accessibilityStates)&&t.accessibilityStates.indexOf("disabled")>-1,NH={adjustable:"slider",button:"button",header:"heading",image:"img",imagebutton:null,keyboardkey:null,label:null,link:"link",none:"presentation",search:"search",summary:"region",text:null},CI=t=>{var e=t.accessibilityRole,n=t.role,r=n||e;if(r){var i=NH[r];if(i!==null)return i||r}},LH={article:"article",banner:"header",blockquote:"blockquote",button:"button",code:"code",complementary:"aside",contentinfo:"footer",deletion:"del",emphasis:"em",figure:"figure",insertion:"ins",form:"form",list:"ul",listitem:"li",main:"main",navigation:"nav",paragraph:"p",region:"section",strong:"strong"},BH={},jH=function(e){e===void 0&&(e=BH);var n=e.role||e.accessibilityRole;if(n==="label")return"label";var r=CI(e);if(r){if(r==="heading"){var i=e.accessibilityLevel||e["aria-level"];return i!=null?"h"+i:"h1"}return LH[r]}},RI={isDisabled:zH,propsToAccessibilityComponent:jH,propsToAriaRole:CI};function Rd(t){"@babel/helpers - typeof";return Rd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Rd(t)}function _H(t,e){if(Rd(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(Rd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function HH(t){var e=_H(t,"string");return Rd(e)=="symbol"?e:e+""}function VH(t,e,n){return(e=HH(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function WE(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Mc(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?WE(Object(n),!0).forEach(function(r){VH(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):WE(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function km(t,e){if(t==null)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.indexOf(r)!==-1)continue;n[r]=t[r]}return n}var Tg={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,flex:!0,flexGrow:!0,flexOrder:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,fontWeight:!0,gridRow:!0,gridRowEnd:!0,gridRowGap:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnGap:!0,gridColumnStart:!0,lineClamp:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0,scale:!0,scaleX:!0,scaleY:!0,scaleZ:!0,shadowOpacity:!0},FH=["ms","Moz","O","Webkit"],UH=(t,e)=>t+e.charAt(0).toUpperCase()+e.substring(1);Object.keys(Tg).forEach(t=>{FH.forEach(e=>{Tg[UH(e,t)]=Tg[t]})});var $H=t=>t==="currentcolor"||t==="currentColor"||t==="inherit"||t.indexOf("var(")===0;function Fo(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function TI(t){if(Object.prototype.hasOwnProperty.call(t,"__esModule"))return t;var e=t.default;if(typeof e=="function"){var n=function r(){var i=!1;try{i=this instanceof r}catch{}return i?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}),n}var E0,KE;function qH(){if(KE)return E0;KE=1;function t(w){if(typeof w=="number")return w>>>0===w&&w>=0&&w<=4294967295?w:null;if(typeof w!="string")return null;const C=h();let T;if(T=C.hex6.exec(w))return parseInt(T[1]+"ff",16)>>>0;const E=x(w);return E??((T=C.rgb.exec(w))?(g(T[1])<<24|g(T[2])<<16|g(T[3])<<8|255)>>>0:(T=C.rgba.exec(w))?T[6]!==void 0?(g(T[6])<<24|g(T[7])<<16|g(T[8])<<8|y(T[9]))>>>0:(g(T[2])<<24|g(T[3])<<16|g(T[4])<<8|y(T[5]))>>>0:(T=C.hex3.exec(w))?parseInt(T[1]+T[1]+T[2]+T[2]+T[3]+T[3]+"ff",16)>>>0:(T=C.hex8.exec(w))?parseInt(T[1],16)>>>0:(T=C.hex4.exec(w))?parseInt(T[1]+T[1]+T[2]+T[2]+T[3]+T[3]+T[4]+T[4],16)>>>0:(T=C.hsl.exec(w))?(n(m(T[1]),b(T[2]),b(T[3]))|255)>>>0:(T=C.hsla.exec(w))?T[6]!==void 0?(n(m(T[6]),b(T[7]),b(T[8]))|y(T[9]))>>>0:(n(m(T[2]),b(T[3]),b(T[4]))|y(T[5]))>>>0:(T=C.hwb.exec(w))?(r(m(T[1]),b(T[2]),b(T[3]))|255)>>>0:null)}function e(w,C,T){return T<0&&(T+=1),T>1&&(T-=1),T<1/6?w+(C-w)*6*T:T<1/2?C:T<2/3?w+(C-w)*(2/3-T)*6:w}function n(w,C,T){const E=T<.5?T*(1+C):T+C-T*C,M=2*T-E,k=e(M,E,w+1/3),P=e(M,E,w),A=e(M,E,w-1/3);return Math.round(k*255)<<24|Math.round(P*255)<<16|Math.round(A*255)<<8}function r(w,C,T){if(C+T>=1){const P=Math.round(C*255/(C+T));return P<<24|P<<16|P<<8}const E=e(0,1,w+1/3)*(1-C-T)+C,M=e(0,1,w)*(1-C-T)+C,k=e(0,1,w-1/3)*(1-C-T)+C;return Math.round(E*255)<<24|Math.round(M*255)<<16|Math.round(k*255)<<8}const i="[-+]?\\d*\\.?\\d+",s=i+"%";function a(...w){return"\\(\\s*("+w.join(")\\s*,?\\s*(")+")\\s*\\)"}function u(...w){return"\\(\\s*("+w.slice(0,w.length-1).join(")\\s*,?\\s*(")+")\\s*/\\s*("+w[w.length-1]+")\\s*\\)"}function c(...w){return"\\(\\s*("+w.join(")\\s*,\\s*(")+")\\s*\\)"}let d;function h(){return d===void 0&&(d={rgb:new RegExp("rgb"+a(i,i,i)),rgba:new RegExp("rgba("+c(i,i,i,i)+"|"+u(i,i,i,i)+")"),hsl:new RegExp("hsl"+a(i,s,s)),hsla:new RegExp("hsla("+c(i,s,s,i)+"|"+u(i,s,s,i)+")"),hwb:new RegExp("hwb"+a(i,s,s)),hex3:/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex4:/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#([0-9a-fA-F]{6})$/,hex8:/^#([0-9a-fA-F]{8})$/}),d}function g(w){const C=parseInt(w,10);return C<0?0:C>255?255:C}function m(w){return(parseFloat(w)%360+360)%360/360}function y(w){const C=parseFloat(w);return C<0?0:C>1?255:Math.round(C*255)}function b(w){const C=parseFloat(w);return C<0?0:C>100?1:C/100}function x(w){switch(w){case"transparent":return 0;case"aliceblue":return 4042850303;case"antiquewhite":return 4209760255;case"aqua":return 16777215;case"aquamarine":return 2147472639;case"azure":return 4043309055;case"beige":return 4126530815;case"bisque":return 4293182719;case"black":return 255;case"blanchedalmond":return 4293643775;case"blue":return 65535;case"blueviolet":return 2318131967;case"brown":return 2771004159;case"burlywood":return 3736635391;case"burntsienna":return 3934150143;case"cadetblue":return 1604231423;case"chartreuse":return 2147418367;case"chocolate":return 3530104575;case"coral":return 4286533887;case"cornflowerblue":return 1687547391;case"cornsilk":return 4294499583;case"crimson":return 3692313855;case"cyan":return 16777215;case"darkblue":return 35839;case"darkcyan":return 9145343;case"darkgoldenrod":return 3095792639;case"darkgray":return 2846468607;case"darkgreen":return 6553855;case"darkgrey":return 2846468607;case"darkkhaki":return 3182914559;case"darkmagenta":return 2332068863;case"darkolivegreen":return 1433087999;case"darkorange":return 4287365375;case"darkorchid":return 2570243327;case"darkred":return 2332033279;case"darksalmon":return 3918953215;case"darkseagreen":return 2411499519;case"darkslateblue":return 1211993087;case"darkslategray":return 793726975;case"darkslategrey":return 793726975;case"darkturquoise":return 13554175;case"darkviolet":return 2483082239;case"deeppink":return 4279538687;case"deepskyblue":return 12582911;case"dimgray":return 1768516095;case"dimgrey":return 1768516095;case"dodgerblue":return 512819199;case"firebrick":return 2988581631;case"floralwhite":return 4294635775;case"forestgreen":return 579543807;case"fuchsia":return 4278255615;case"gainsboro":return 3705462015;case"ghostwhite":return 4177068031;case"gold":return 4292280575;case"goldenrod":return 3668254975;case"gray":return 2155905279;case"green":return 8388863;case"greenyellow":return 2919182335;case"grey":return 2155905279;case"honeydew":return 4043305215;case"hotpink":return 4285117695;case"indianred":return 3445382399;case"indigo":return 1258324735;case"ivory":return 4294963455;case"khaki":return 4041641215;case"lavender":return 3873897215;case"lavenderblush":return 4293981695;case"lawngreen":return 2096890111;case"lemonchiffon":return 4294626815;case"lightblue":return 2916673279;case"lightcoral":return 4034953471;case"lightcyan":return 3774873599;case"lightgoldenrodyellow":return 4210742015;case"lightgray":return 3553874943;case"lightgreen":return 2431553791;case"lightgrey":return 3553874943;case"lightpink":return 4290167295;case"lightsalmon":return 4288707327;case"lightseagreen":return 548580095;case"lightskyblue":return 2278488831;case"lightslategray":return 2005441023;case"lightslategrey":return 2005441023;case"lightsteelblue":return 2965692159;case"lightyellow":return 4294959359;case"lime":return 16711935;case"limegreen":return 852308735;case"linen":return 4210091775;case"magenta":return 4278255615;case"maroon":return 2147483903;case"mediumaquamarine":return 1724754687;case"mediumblue":return 52735;case"mediumorchid":return 3126187007;case"mediumpurple":return 2473647103;case"mediumseagreen":return 1018393087;case"mediumslateblue":return 2070474495;case"mediumspringgreen":return 16423679;case"mediumturquoise":return 1221709055;case"mediumvioletred":return 3340076543;case"midnightblue":return 421097727;case"mintcream":return 4127193855;case"mistyrose":return 4293190143;case"moccasin":return 4293178879;case"navajowhite":return 4292783615;case"navy":return 33023;case"oldlace":return 4260751103;case"olive":return 2155872511;case"olivedrab":return 1804477439;case"orange":return 4289003775;case"orangered":return 4282712319;case"orchid":return 3664828159;case"palegoldenrod":return 4008225535;case"palegreen":return 2566625535;case"paleturquoise":return 2951671551;case"palevioletred":return 3681588223;case"papayawhip":return 4293907967;case"peachpuff":return 4292524543;case"peru":return 3448061951;case"pink":return 4290825215;case"plum":return 3718307327;case"powderblue":return 2967529215;case"purple":return 2147516671;case"rebeccapurple":return 1714657791;case"red":return 4278190335;case"rosybrown":return 3163525119;case"royalblue":return 1097458175;case"saddlebrown":return 2336560127;case"salmon":return 4202722047;case"sandybrown":return 4104413439;case"seagreen":return 780883967;case"seashell":return 4294307583;case"sienna":return 2689740287;case"silver":return 3233857791;case"skyblue":return 2278484991;case"slateblue":return 1784335871;case"slategray":return 1887473919;case"slategrey":return 1887473919;case"snow":return 4294638335;case"springgreen":return 16744447;case"steelblue":return 1182971135;case"tan":return 3535047935;case"teal":return 8421631;case"thistle":return 3636451583;case"tomato":return 4284696575;case"turquoise":return 1088475391;case"violet":return 4001558271;case"wheat":return 4125012991;case"white":return 4294967295;case"whitesmoke":return 4126537215;case"yellow":return 4294902015;case"yellowgreen":return 2597139199}return null}return E0=t,E0}var GH=qH();const WH=Fo(GH);var KH=t=>{if(t==null)return t;var e=WH(t);if(e!=null)return e=(e<<24|e>>>8)>>>0,e},rw=function(e,n){if(n===void 0&&(n=1),e!=null){if(typeof e=="string"&&$H(e))return e;var r=KH(e);if(r!=null){var i=r>>16&255,s=r>>8&255,a=r&255,u=(r>>24&255)/255,c=(u*n).toFixed(2);return"rgba("+i+","+s+","+a+","+c+")"}}},YH={backgroundColor:!0,borderColor:!0,borderTopColor:!0,borderRightColor:!0,borderBottomColor:!0,borderLeftColor:!0,color:!0,shadowColor:!0,textDecorationColor:!0,textShadowColor:!0};function si(t,e){var n=t;return(e==null||!Tg[e])&&typeof t=="number"?n=t+"px":e!=null&&YH[e]&&(n=rw(t)),n}var Su=!!(typeof window<"u"&&window.document&&window.document.createElement),XH={},QH=!Su||window.CSS!=null&&window.CSS.supports!=null&&(window.CSS.supports("text-decoration-line","none")||window.CSS.supports("-webkit-text-decoration-line","none")),ZH="monospace,monospace",YE='-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif',JH={borderColor:["borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"],borderBlockColor:["borderTopColor","borderBottomColor"],borderInlineColor:["borderRightColor","borderLeftColor"],borderRadius:["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"],borderStyle:["borderTopStyle","borderRightStyle","borderBottomStyle","borderLeftStyle"],borderBlockStyle:["borderTopStyle","borderBottomStyle"],borderInlineStyle:["borderRightStyle","borderLeftStyle"],borderWidth:["borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth"],borderBlockWidth:["borderTopWidth","borderBottomWidth"],borderInlineWidth:["borderRightWidth","borderLeftWidth"],insetBlock:["top","bottom"],insetInline:["left","right"],marginBlock:["marginTop","marginBottom"],marginInline:["marginRight","marginLeft"],paddingBlock:["paddingTop","paddingBottom"],paddingInline:["paddingRight","paddingLeft"],overflow:["overflowX","overflowY"],overscrollBehavior:["overscrollBehaviorX","overscrollBehaviorY"],borderBlockStartColor:["borderTopColor"],borderBlockStartStyle:["borderTopStyle"],borderBlockStartWidth:["borderTopWidth"],borderBlockEndColor:["borderBottomColor"],borderBlockEndStyle:["borderBottomStyle"],borderBlockEndWidth:["borderBottomWidth"],borderEndStartRadius:["borderBottomLeftRadius"],borderEndEndRadius:["borderBottomRightRadius"],borderStartStartRadius:["borderTopLeftRadius"],borderStartEndRadius:["borderTopRightRadius"],insetBlockEnd:["bottom"],insetBlockStart:["top"],marginBlockStart:["marginTop"],marginBlockEnd:["marginBottom"],paddingBlockStart:["paddingTop"],paddingBlockEnd:["paddingBottom"]},EI=(t,e)=>{if(!t)return XH;var n={},r=function(){var u=t[i];if(u==null)return"continue";if(i==="backgroundClip")u==="text"&&(n.backgroundClip=u,n.WebkitBackgroundClip=u);else if(i==="flex")u===-1?(n.flexGrow=0,n.flexShrink=1,n.flexBasis="auto"):n.flex=u;else if(i==="font")n[i]=u.replace("System",YE);else if(i==="fontFamily")if(u.indexOf("System")>-1){var c=u.split(/,\s*/);c[c.indexOf("System")]=YE,n[i]=c.join(",")}else u==="monospace"?n[i]=ZH:n[i]=u;else if(i==="textDecorationLine")QH?n.textDecorationLine=u:n.textDecoration=u;else if(i==="writingDirection")n.direction=u;else{var d=si(t[i],i),h=JH[i];e&&i==="inset"?(t.insetInline==null&&(n.left=d,n.right=d),t.insetBlock==null&&(n.top=d,n.bottom=d)):e&&i==="margin"?(t.marginInline==null&&(n.marginLeft=d,n.marginRight=d),t.marginBlock==null&&(n.marginTop=d,n.marginBottom=d)):e&&i==="padding"?(t.paddingInline==null&&(n.paddingLeft=d,n.paddingRight=d),t.paddingBlock==null&&(n.paddingTop=d,n.paddingBottom=d)):h?h.forEach((g,m)=>{t[g]==null&&(n[g]=d)}):n[i]=d}};for(var i in t)var s=r();return n};function eV(t,e){for(var n=t.length,r=e^n,i=0,s;n>=4;)s=t.charCodeAt(i)&255|(t.charCodeAt(++i)&255)<<8|(t.charCodeAt(++i)&255)<<16|(t.charCodeAt(++i)&255)<<24,s=(s&65535)*1540483477+(((s>>>16)*1540483477&65535)<<16),s^=s>>>24,s=(s&65535)*1540483477+(((s>>>16)*1540483477&65535)<<16),r=(r&65535)*1540483477+(((r>>>16)*1540483477&65535)<<16)^s,n-=4,++i;switch(n){case 3:r^=(t.charCodeAt(i+2)&255)<<16;case 2:r^=(t.charCodeAt(i+1)&255)<<8;case 1:r^=t.charCodeAt(i)&255,r=(r&65535)*1540483477+(((r>>>16)*1540483477&65535)<<16)}return r^=r>>>13,r=(r&65535)*1540483477+(((r>>>16)*1540483477&65535)<<16),r^=r>>>15,r>>>0}var tV=t=>eV(t,1).toString(36),nV=/[A-Z]/g,rV=/^ms-/,M0={};function iV(t){return"-"+t.toLowerCase()}function oV(t){if(t in M0)return M0[t];var e=t.replace(nV,iV);return M0[t]=rV.test(e)?"-"+e:e}var Cp={},Rp={},Tp={},XE;function MI(){if(XE)return Tp;XE=1,Object.defineProperty(Tp,"__esModule",{value:!0}),Tp.default=t;function t(e){return e.charAt(0).toUpperCase()+e.slice(1)}return Tp}var QE;function sV(){if(QE)return Rp;QE=1,Object.defineProperty(Rp,"__esModule",{value:!0}),Rp.default=r;var t=MI(),e=n(t);function n(i){return i&&i.__esModule?i:{default:i}}function r(i,s,a){var u=i[s];if(u&&a.hasOwnProperty(s))for(var c=(0,e.default)(s),d=0;d<u.length;++d){var h=u[d]+c;a[h]||(a[h]=a[s])}return a}return Rp}var Ep={},ZE;function lV(){if(ZE)return Ep;ZE=1,Object.defineProperty(Ep,"__esModule",{value:!0}),Ep.default=t;function t(e,n,r,i,s){for(var a=0,u=e.length;a<u;++a){var c=e[a](n,r,i,s);if(c)return c}}return Ep}var Mp={},JE;function aV(){if(JE)return Mp;JE=1,Object.defineProperty(Mp,"__esModule",{value:!0}),Mp.default=e;function t(n,r){n.indexOf(r)===-1&&n.push(r)}function e(n,r){if(Array.isArray(r))for(var i=0,s=r.length;i<s;++i)t(n,r[i]);else t(n,r)}return Mp}var Ap={},eM;function uV(){if(eM)return Ap;eM=1,Object.defineProperty(Ap,"__esModule",{value:!0}),Ap.default=t;function t(e){return e instanceof Object&&!Array.isArray(e)}return Ap}var tM;function cV(){if(tM)return Cp;tM=1,Object.defineProperty(Cp,"__esModule",{value:!0}),Cp.default=d;var t=sV(),e=c(t),n=lV(),r=c(n),i=aV(),s=c(i),a=uV(),u=c(a);function c(h){return h&&h.__esModule?h:{default:h}}function d(h){var g=h.prefixMap,m=h.plugins;return function y(b){for(var x in b){var w=b[x];if((0,u.default)(w))b[x]=y(w);else if(Array.isArray(w)){for(var C=[],T=0,E=w.length;T<E;++T){var M=(0,r.default)(m,x,w[T],b,g);(0,s.default)(C,M||w[T])}C.length>0&&(b[x]=C)}else{var k=(0,r.default)(m,x,w,b,g);k&&(b[x]=k),b=(0,e.default)(g,x,b)}}return b}}return Cp}var fV=cV();const dV=Fo(fV);var Op={};function Eg(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Eg=function(n){return typeof n}:Eg=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Eg(t)}function hV(t){return yV(t)||mV(t)||gV(t)||pV()}function pV(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
2
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function gV(t,e){if(t){if(typeof t=="string")return rx(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return rx(t,e)}}function mV(t){if(typeof Symbol<"u"&&Symbol.iterator in Object(t))return Array.from(t)}function yV(t){if(Array.isArray(t))return rx(t)}function rx(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function nM(t){return t.filter(function(e,n){return t.lastIndexOf(e)===n})}function AI(t){for(var e=0,n=arguments.length<=1?0:arguments.length-1;e<n;++e){var r=e+1<1||arguments.length<=e+1?void 0:arguments[e+1];for(var i in r){var s=r[i],a=t[i];if(a&&s){if(Array.isArray(a)){t[i]=nM(a.concat(s));continue}if(Array.isArray(s)){t[i]=nM([a].concat(hV(s)));continue}if(Eg(s)==="object"){t[i]=AI({},a,s);continue}}t[i]=s}}return t}var vV=/-([a-z])/g,bV=/^Ms/g,A0={};function xV(t){return t[1].toUpperCase()}function OI(t){if(A0.hasOwnProperty(t))return A0[t];var e=t.replace(vV,xV).replace(bV,"ms");return A0[t]=e,e}var SV=/[A-Z]/g,wV=/^ms-/,O0={};function CV(t){return"-"+t.toLowerCase()}function kI(t){if(O0.hasOwnProperty(t))return O0[t];var e=t.replace(SV,CV);return O0[t]=wV.test(e)?"-"+e:e}const RV=Object.freeze(Object.defineProperty({__proto__:null,default:kI},Symbol.toStringTag,{value:"Module"}));function Im(t){return kI(t)}function II(t,e){return Im(t)+":"+e}function TV(t){var e="";for(var n in t){var r=t[n];typeof r!="string"&&typeof r!="number"||(e&&(e+=";"),e+=II(n,r))}return e}var EV=/^(Webkit|Moz|O|ms)/;function MV(t){return EV.test(t)}var AV=/-webkit-|-moz-|-ms-/;function OV(t){return typeof t=="string"&&AV.test(t)}var Td={borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},rM=["animationIterationCount","boxFlex","boxFlexGroup","boxOrdinalGroup","columnCount","flex","flexGrow","flexPositive","flexShrink","flexNegative","flexOrder","gridColumn","gridColumnEnd","gridColumnStart","gridRow","gridRowEnd","gridRowStart","lineClamp","order"],iM=["Webkit","ms","Moz","O"];function kV(t,e){return t+e.charAt(0).toUpperCase()+e.slice(1)}for(var k0=0,IV=rM.length;k0<IV;++k0){var oM=rM[k0];Td[oM]=!0;for(var I0=0,DV=iM.length;I0<DV;++I0)Td[kV(iM[I0],oM)]=!0}for(var PV in Td)Td[Im(PV)]=!0;function zV(t){return Td.hasOwnProperty(t)}var NV=/^(ms|Webkit|Moz|O)/;function DI(t){var e=t.replace(NV,"");return e.charAt(0).toLowerCase()+e.slice(1)}function LV(t){return DI(OI(t))}function BV(t,e){return e.join(";"+Im(t)+":")}var jV=/(-ms-|-webkit-|-moz-|-o-)/g;function _V(t){return typeof t=="string"?t.replace(jV,""):t}const HV=Object.freeze(Object.defineProperty({__proto__:null,assignStyle:AI,camelCaseProperty:OI,cssifyDeclaration:II,cssifyObject:TV,hyphenateProperty:Im,isPrefixedProperty:MV,isPrefixedValue:OV,isUnitlessProperty:zV,normalizeProperty:LV,resolveArrayValue:BV,unprefixProperty:DI,unprefixValue:_V},Symbol.toStringTag,{value:"Module"})),VV=TI(HV);var sM;function FV(){if(sM)return Op;sM=1,Object.defineProperty(Op,"__esModule",{value:!0}),Op.default=r;var t=VV,e=/cross-fade\(/g,n=["-webkit-",""];function r(i,s){if(typeof s=="string"&&!(0,t.isPrefixedValue)(s)&&s.indexOf("cross-fade(")!==-1)return n.map(function(a){return s.replace(e,a+"cross-fade(")})}return Op}var UV=FV();const $V=Fo(UV);var kp={},D0={},lM;function PI(){return lM||(lM=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=n;var e=/-webkit-|-moz-|-ms-/;function n(r){return typeof r=="string"&&e.test(r)}})(D0)),D0}var aM;function qV(){if(aM)return kp;aM=1,Object.defineProperty(kp,"__esModule",{value:!0}),kp.default=i;var t=PI(),e=n(t);function n(s){return s&&s.__esModule?s:{default:s}}var r=["-webkit-",""];function i(s,a){if(typeof a=="string"&&!(0,e.default)(a)&&a.indexOf("image-set(")>-1)return r.map(function(u){return a.replace(/image-set\(/g,u+"image-set(")})}return kp}var GV=qV();const WV=Fo(GV);var Ip={},uM;function KV(){if(uM)return Ip;uM=1,Object.defineProperty(Ip,"__esModule",{value:!0}),Ip.default=e;var t={marginBlockStart:["WebkitMarginBefore"],marginBlockEnd:["WebkitMarginAfter"],marginInlineStart:["WebkitMarginStart","MozMarginStart"],marginInlineEnd:["WebkitMarginEnd","MozMarginEnd"],paddingBlockStart:["WebkitPaddingBefore"],paddingBlockEnd:["WebkitPaddingAfter"],paddingInlineStart:["WebkitPaddingStart","MozPaddingStart"],paddingInlineEnd:["WebkitPaddingEnd","MozPaddingEnd"],borderBlockStart:["WebkitBorderBefore"],borderBlockStartColor:["WebkitBorderBeforeColor"],borderBlockStartStyle:["WebkitBorderBeforeStyle"],borderBlockStartWidth:["WebkitBorderBeforeWidth"],borderBlockEnd:["WebkitBorderAfter"],borderBlockEndColor:["WebkitBorderAfterColor"],borderBlockEndStyle:["WebkitBorderAfterStyle"],borderBlockEndWidth:["WebkitBorderAfterWidth"],borderInlineStart:["WebkitBorderStart","MozBorderStart"],borderInlineStartColor:["WebkitBorderStartColor","MozBorderStartColor"],borderInlineStartStyle:["WebkitBorderStartStyle","MozBorderStartStyle"],borderInlineStartWidth:["WebkitBorderStartWidth","MozBorderStartWidth"],borderInlineEnd:["WebkitBorderEnd","MozBorderEnd"],borderInlineEndColor:["WebkitBorderEndColor","MozBorderEndColor"],borderInlineEndStyle:["WebkitBorderEndStyle","MozBorderEndStyle"],borderInlineEndWidth:["WebkitBorderEndWidth","MozBorderEndWidth"]};function e(n,r,i){if(Object.prototype.hasOwnProperty.call(t,n))for(var s=t[n],a=0,u=s.length;a<u;++a)i[s[a]]=r}return Ip}var YV=KV();const XV=Fo(YV);var Dp={},cM;function QV(){if(cM)return Dp;cM=1,Object.defineProperty(Dp,"__esModule",{value:!0}),Dp.default=t;function t(e,n){if(e==="position"&&n==="sticky")return["-webkit-sticky","sticky"]}return Dp}var ZV=QV();const JV=Fo(ZV);var Pp={},fM;function e3(){if(fM)return Pp;fM=1,Object.defineProperty(Pp,"__esModule",{value:!0}),Pp.default=r;var t=["-webkit-","-moz-",""],e={maxHeight:!0,maxWidth:!0,width:!0,height:!0,columnWidth:!0,minWidth:!0,minHeight:!0},n={"min-content":!0,"max-content":!0,"fill-available":!0,"fit-content":!0,"contain-floats":!0};function r(i,s){if(e.hasOwnProperty(i)&&n.hasOwnProperty(s))return t.map(function(a){return a+s})}return Pp}var t3=e3();const n3=Fo(t3);var zp={},P0={};const r3=TI(RV);var dM;function i3(){return dM||(dM=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var e=r3,n=r(e);function r(s){return s&&s.__esModule?s:{default:s}}function i(s){return(0,n.default)(s)}})(P0)),P0}var hM;function o3(){if(hM)return zp;hM=1,Object.defineProperty(zp,"__esModule",{value:!0}),zp.default=h;var t=i3(),e=a(t),n=PI(),r=a(n),i=MI(),s=a(i);function a(g){return g&&g.__esModule?g:{default:g}}var u={transition:!0,transitionProperty:!0,WebkitTransition:!0,WebkitTransitionProperty:!0,MozTransition:!0,MozTransitionProperty:!0},c={Webkit:"-webkit-",Moz:"-moz-",ms:"-ms-"};function d(g,m){if((0,r.default)(g))return g;for(var y=g.split(/,(?![^()]*(?:\([^()]*\))?\))/g),b=0,x=y.length;b<x;++b){var w=y[b],C=[w];for(var T in m){var E=(0,e.default)(T);if(w.indexOf(E)>-1&&E!=="order")for(var M=m[T],k=0,P=M.length;k<P;++k)C.unshift(w.replace(E,c[M[k]]+E))}y[b]=C.join(",")}return y.join(",")}function h(g,m,y,b){if(typeof m=="string"&&u.hasOwnProperty(g)){var x=d(m,b),w=x.split(/,(?![^()]*(?:\([^()]*\))?\))/g).filter(function(T){return!/-moz-|-ms-/.test(T)}).join(",");if(g.indexOf("Webkit")>-1)return w;var C=x.split(/,(?![^()]*(?:\([^()]*\))?\))/g).filter(function(T){return!/-webkit-|-ms-/.test(T)}).join(",");return g.indexOf("Moz")>-1?C:(y["Webkit"+(0,s.default)(g)]=w,y["Moz"+(0,s.default)(g)]=C,x)}}return zp}var s3=o3();const l3=Fo(s3);var Mn=["Webkit"],a3=["Moz"],u3=["Webkit","Moz"],Yn=["Webkit","ms"],c3=["Webkit","Moz","ms"];const f3={plugins:[$V,WV,XV,JV,n3,l3],prefixMap:{appearance:c3,userSelect:u3,textEmphasisPosition:Yn,textEmphasis:Yn,textEmphasisStyle:Yn,textEmphasisColor:Yn,boxDecorationBreak:Yn,clipPath:Mn,maskImage:Yn,maskMode:Yn,maskRepeat:Yn,maskPosition:Yn,maskClip:Yn,maskOrigin:Yn,maskSize:Yn,maskComposite:Yn,mask:Yn,maskBorderSource:Yn,maskBorderMode:Yn,maskBorderSlice:Yn,maskBorderWidth:Yn,maskBorderOutset:Yn,maskBorderRepeat:Yn,maskBorder:Yn,maskType:Yn,textDecorationStyle:Mn,textDecorationSkip:Mn,textDecorationLine:Mn,textDecorationColor:Mn,filter:Mn,breakAfter:Mn,breakBefore:Mn,breakInside:Mn,columnCount:Mn,columnFill:Mn,columnGap:Mn,columnRule:Mn,columnRuleColor:Mn,columnRuleStyle:Mn,columnRuleWidth:Mn,columns:Mn,columnSpan:Mn,columnWidth:Mn,backdropFilter:Mn,hyphens:Mn,flowInto:Mn,flowFrom:Mn,regionFragment:Mn,textOrientation:Mn,tabSize:a3,fontKerning:Mn,textSizeAdjust:Mn}};var d3=dV(f3),h3=["animationKeyframes"],pM=new Map,p3={},g3=1,m3=3,y3={borderColor:2,borderRadius:2,borderStyle:2,borderWidth:2,display:2,flex:2,inset:2,margin:2,overflow:2,overscrollBehavior:2,padding:2,insetBlock:2.1,insetInline:2.1,marginInline:2.1,marginBlock:2.1,paddingInline:2.1,paddingBlock:2.1,borderBlockStartColor:2.2,borderBlockStartStyle:2.2,borderBlockStartWidth:2.2,borderBlockEndColor:2.2,borderBlockEndStyle:2.2,borderBlockEndWidth:2.2,borderInlineStartColor:2.2,borderInlineStartStyle:2.2,borderInlineStartWidth:2.2,borderInlineEndColor:2.2,borderInlineEndStyle:2.2,borderInlineEndWidth:2.2,borderEndStartRadius:2.2,borderEndEndRadius:2.2,borderStartStartRadius:2.2,borderStartEndRadius:2.2,insetBlockEnd:2.2,insetBlockStart:2.2,insetInlineEnd:2.2,insetInlineStart:2.2,marginBlockStart:2.2,marginBlockEnd:2.2,marginInlineStart:2.2,marginInlineEnd:2.2,paddingBlockStart:2.2,paddingBlockEnd:2.2,paddingInlineStart:2.2,paddingInlineEnd:2.2},ix="borderTopLeftRadius",ox="borderTopRightRadius",sx="borderBottomLeftRadius",lx="borderBottomRightRadius",ax="borderLeftColor",ux="borderLeftStyle",cx="borderLeftWidth",fx="borderRightColor",dx="borderRightStyle",hx="borderRightWidth",px="right",gx="marginLeft",mx="marginRight",yx="paddingLeft",vx="paddingRight",bx="left",Fg={[ix]:ox,[ox]:ix,[sx]:lx,[lx]:sx,[ax]:fx,[ux]:dx,[cx]:hx,[fx]:ax,[dx]:ux,[hx]:cx,[bx]:px,[gx]:mx,[mx]:gx,[yx]:vx,[vx]:yx,[px]:bx},cd={borderStartStartRadius:ix,borderStartEndRadius:ox,borderEndStartRadius:sx,borderEndEndRadius:lx,borderInlineStartColor:ax,borderInlineStartStyle:ux,borderInlineStartWidth:cx,borderInlineEndColor:fx,borderInlineEndStyle:dx,borderInlineEndWidth:hx,insetInlineEnd:px,insetInlineStart:bx,marginInlineStart:gx,marginInlineEnd:mx,paddingInlineStart:yx,paddingInlineEnd:vx},zI=["clear","float","textAlign"];function v3(t){var e={$$css:!0},n=[];function r(i,s,a){var u=S3(a,s),c=s+u,d=pM.get(c),h;if(d!=null)h=d[0],n.push(d[1]);else{var g=i!==s?c:u;h=iw("r",i,g);var m=y3[i]||m3,y=w3(h,s,a),b=[y,m];n.push(b),pM.set(c,[h,b])}return h}return Object.keys(t).sort().forEach(i=>{var s=t[i];if(s!=null){var a;if(zI.indexOf(i)>-1){var u=r(i,i,"left"),c=r(i,i,"right");s==="start"?a=[u,c]:s==="end"&&(a=[c,u])}var d=cd[i];if(d!=null){var h=r(i,d,s),g=r(i,Fg[d],s);a=[h,g]}if(i==="transitionProperty"){for(var m=Array.isArray(s)?s:[s],y=[],b=0;b<m.length;b++){var x=m[b];typeof x=="string"&&cd[x]!=null&&y.push(b)}if(y.length>0){var w=[...m],C=[...m];y.forEach(T=>{var E=w[T];if(typeof E=="string"){var M=cd[E],k=Fg[M];w[T]=M,C[T]=k;var P=r(i,i,w),A=r(i,i,C);a=[P,A]}})}}a==null?a=r(i,i,s):e.$$css$localize=!0,e[i]=a}}),[e,n]}function b3(t,e){var n={$$css:!0},r=[],i=t.animationKeyframes,s=km(t,h3),a=iw("css",e,JSON.stringify(t)),u="."+a,c;if(i!=null){var d=NI(i),h=d[0],g=d[1];c=h.join(","),r.push(...g)}var m=ls(Mc(Mc({},s),{},{animationName:c}));return r.push(""+u+m),n[a]=a,[n,[[r,g3]]]}function x3(t,e){var n=t||p3,r={},i={},s=function(){var d=n[a],h=a,g=d;if(!Object.prototype.hasOwnProperty.call(n,a)||d==null)return"continue";zI.indexOf(a)>-1&&(d==="start"?g=e?"right":"left":d==="end"&&(g=e?"left":"right"));var m=cd[a];if(m!=null&&(h=e?Fg[m]:m),a==="transitionProperty"){var y=Array.isArray(d)?d:[d];y.forEach((b,x)=>{if(typeof b=="string"){var w=cd[b];w!=null&&(y[x]=e?Fg[w]:w,g=y.join(" "))}})}r[h]||(i[h]=g),h===a&&(r[h]=!0)};for(var a in n)var u=s();return EI(i,!0)}function S3(t,e){var n=si(t,e);return typeof n!="string"?JSON.stringify(n||""):n}function w3(t,e,n){var r=[],i="."+t;switch(e){case"animationKeyframes":{var s=NI(n),a=s[0],u=s[1],c=ls({animationName:a.join(",")});r.push(""+i+c,...u);break}case"placeholderTextColor":{var d=ls({color:n,opacity:1});r.push(i+"::-webkit-input-placeholder"+d,i+"::-moz-placeholder"+d,i+":-ms-input-placeholder"+d,i+"::placeholder"+d);break}case"pointerEvents":{var h=n;if(n==="auto")h="auto!important";else if(n==="none"){h="none!important";var g=ls({pointerEvents:"none"});r.push(i+">* "+g)}else if(n==="box-none"){h="none!important";var m=ls({pointerEvents:"auto"});r.push(i+">* "+m)}else if(n==="box-only"){h="auto!important";var y=ls({pointerEvents:"none"});r.push(i+">* "+y)}var b=ls({pointerEvents:h});r.push(""+i+b);break}case"scrollbarWidth":{n==="none"&&r.push(i+"::-webkit-scrollbar{display:none}");var x=ls({scrollbarWidth:n});r.push(""+i+x);break}default:{var w=ls({[e]:n});r.push(""+i+w);break}}return r}function ls(t){var e=d3(EI(t)),n=Object.keys(e).map(r=>{var i=e[r],s=oV(r);return Array.isArray(i)?i.map(a=>s+":"+a).join(";"):s+":"+i}).sort().join(";");return"{"+n+";}"}function iw(t,e,n){var r=tV(e+n);return t+"-"+r}function C3(t){var e=["-webkit-",""],n=iw("r","animation",JSON.stringify(t)),r="{"+Object.keys(t).map(s=>{var a=t[s],u=ls(a);return""+s+u}).join("")+"}",i=e.map(s=>"@"+s+"keyframes "+n+r);return[n,i]}function NI(t){if(typeof t=="number")throw new Error("Invalid CSS keyframes type: "+typeof t);var e=[],n=[],r=Array.isArray(t)?t:[t];return r.forEach(i=>{if(typeof i=="string")e.push(i);else{var s=C3(i),a=s[0],u=s[1];e.push(a),n.push(...u)}}),[e,n]}function z0(t,e,n){if(Su){var r=e??document,i=r.getElementById(t);if(i==null)if(i=document.createElement("style"),i.setAttribute("id",t),typeof n=="string"&&i.appendChild(document.createTextNode(n)),r instanceof ShadowRoot)r.insertBefore(i,r.firstChild);else{var s=r.head;s&&s.insertBefore(i,s.firstChild)}return i.sheet}else return null}var R3=Array.prototype.slice;function N0(t){var e={},n={};if(t!=null){var r;R3.call(t.cssRules).forEach((a,u)=>{var c=a.cssText;if(c.indexOf("stylesheet-group")>-1)r=M3(a),e[r]={start:u,rules:[c]};else{var d=mM(c);d!=null&&(n[d]=!0,e[r].rules.push(c))}})}function i(a,u,c){var d=gM(e),h=d.indexOf(u),g=h+1,m=d[g],y=m!=null&&e[m].start!=null?e[m].start:a.cssRules.length,b=O3(a,c,y);if(b){e[u].start==null&&(e[u].start=y);for(var x=g;x<d.length;x+=1){var w=d[x],C=e[w].start||0;e[w].start=C+1}}return b}var s={getTextContent(){return gM(e).map(a=>{var u=e[a].rules,c=u.shift();return u.sort(),u.unshift(c),u.join(`
|
|
3
|
+
`)}).join(`
|
|
4
|
+
`)},insert(a,u){var c=Number(u);if(e[c]==null){var d=T3(c);e[c]={start:null,rules:[d]},t!=null&&i(t,c,d)}var h=mM(a);if(h!=null&&n[h]==null&&(n[h]=!0,e[c].rules.push(a),t!=null)){var g=i(t,c,a);g||e[c].rules.pop()}}};return s}function T3(t){return'[stylesheet-group="'+t+'"]{}'}var E3=/["']/g;function M3(t){return Number(t.selectorText.split(E3)[1])}function gM(t){return Object.keys(t).map(Number).sort((e,n)=>e>n?1:-1)}var A3=/\s*([,])\s*/g;function mM(t){var e=t.split("{")[0].trim();return e!==""?e.replace(A3,"$1"):null}function O3(t,e,n){try{return t.insertRule(e,n),!0}catch{return!1}}var k3="react-native-stylesheet",L0=new WeakMap,Ao=[],yM=["html{-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:rgba(0,0,0,0);}","body{margin:0;}","button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0;}","input::-webkit-search-cancel-button,input::-webkit-search-decoration,input::-webkit-search-results-button,input::-webkit-search-results-decoration{display:none;}"];function ow(t,e){e===void 0&&(e=k3);var n;if(Su){var r=t!=null?t.getRootNode():document;if(Ao.length===0)n=N0(z0(e)),yM.forEach(u=>{n.insert(u,0)}),L0.set(r,Ao.length),Ao.push(n);else{var i=L0.get(r);if(i==null){var s=Ao[0],a=s!=null?s.getTextContent():"";n=N0(z0(e,r,a)),L0.set(r,Ao.length),Ao.push(n)}else n=Ao[i]}}else Ao.length===0?(n=N0(z0(e)),yM.forEach(u=>{n.insert(u,0)}),Ao.push(n)):n=Ao[0];return{getTextContent(){return n.getTextContent()},id:e,insert(u,c){Ao.forEach(d=>{d.insert(u,c)})}}}var Np={},vM;function I3(){if(vM)return Np;vM=1,Object.defineProperty(Np,"__esModule",{value:!0}),Np.localizeStyle=r;var t=new WeakMap,e="$$css$localize";function n(i,s){var a={};for(var u in i)if(u!==e){var c=i[u];Array.isArray(c)?a[u]=s?c[1]:c[0]:a[u]=c}return a}function r(i,s){if(i[e]!=null){var a=s?1:0;if(t.has(i)){var u=t.get(i),c=u[a];return c==null&&(c=n(i,s),u[a]=c,t.set(i,u)),c}var d=n(i,s),h=new Array(2);return h[a]=d,t.set(i,h),d}return i}return Np}var B0,bM;function D3(){return bM||(bM=1,B0=I3()),B0}var P3=D3(),z3={},LI={height:0,width:0},N3=t=>{var e=t.shadowColor,n=t.shadowOffset,r=t.shadowOpacity,i=t.shadowRadius,s=n||LI,a=s.height,u=s.width,c=si(u),d=si(a),h=si(i||0),g=rw(e||"black",r);if(g!=null&&c!=null&&d!=null&&h!=null)return c+" "+d+" "+h+" "+g},L3=t=>{var e=t.textShadowColor,n=t.textShadowOffset,r=t.textShadowRadius,i=n||LI,s=i.height,a=i.width,u=r||0,c=si(a),d=si(s),h=si(u),g=si(e,"textShadowColor");if(g&&(s!==0||a!==0||u!==0)&&c!=null&&d!=null&&h!=null)return c+" "+d+" "+h+" "+g},B3=t=>{if(typeof t=="string")return t;var e=si(t.offsetX)||0,n=si(t.offsetY)||0,r=si(t.blurRadius)||0,i=si(t.spreadDistance)||0,s=rw(t.color)||"black",a=t.inset?"inset ":"";return""+a+e+" "+n+" "+r+" "+i+" "+s},j3=t=>t.map(B3).join(", "),_3=t=>{var e=Object.keys(t)[0],n=t[e];if(e==="matrix"||e==="matrix3d")return e+"("+n.join(",")+")";var r=si(n,e);return e+"("+r+")"},H3=t=>t.map(_3).join(" "),V3=t=>t.map(e=>si(e)).join(" "),F3={borderBottomEndRadius:"borderEndEndRadius",borderBottomStartRadius:"borderEndStartRadius",borderTopEndRadius:"borderStartEndRadius",borderTopStartRadius:"borderStartStartRadius",borderEndColor:"borderInlineEndColor",borderEndStyle:"borderInlineEndStyle",borderEndWidth:"borderInlineEndWidth",borderStartColor:"borderInlineStartColor",borderStartStyle:"borderInlineStartStyle",borderStartWidth:"borderInlineStartWidth",end:"insetInlineEnd",marginEnd:"marginInlineEnd",marginHorizontal:"marginInline",marginStart:"marginInlineStart",marginVertical:"marginBlock",paddingEnd:"paddingInlineEnd",paddingHorizontal:"paddingInline",paddingStart:"paddingInlineStart",paddingVertical:"paddingBlock",start:"insetInlineStart"},U3={elevation:!0,overlayColor:!0,resizeMode:!0,tintColor:!0},BI=function(e,n){n===void 0&&(n={});var r=e||z3,i={};if(n.shadow,r.shadowColor!=null||r.shadowOffset!=null||r.shadowOpacity!=null||r.shadowRadius!=null){var s=N3(r);s!=null&&(i.boxShadow=s)}if(n.textShadow,r.textShadowColor!=null||r.textShadowOffset!=null||r.textShadowRadius!=null){var a=L3(r);if(a!=null&&i.textShadow==null){var u=r.textShadow,c=u?u+", "+a:a;i.textShadow=c}}for(var d in r)if(!(U3[d]!=null||d==="shadowColor"||d==="shadowOffset"||d==="shadowOpacity"||d==="shadowRadius"||d==="textShadowColor"||d==="textShadowOffset"||d==="textShadowRadius")){var h=r[d],g=F3[d]||d,m=h;if(!(!Object.prototype.hasOwnProperty.call(r,d)||g!==d&&r[g]!=null))if(g==="aspectRatio"&&typeof m=="number")i[g]=m.toString();else if(g==="boxShadow"){Array.isArray(m)&&(m=j3(m));var y=i.boxShadow;i.boxShadow=y?m+", "+y:m}else g==="fontVariant"?(Array.isArray(m)&&m.length>0&&(m=m.join(" ")),i[g]=m):g==="textAlignVertical"?r.verticalAlign==null&&(i.verticalAlign=m==="center"?"middle":m):g==="transform"?(Array.isArray(m)&&(m=H3(m)),i.transform=m):g==="transformOrigin"?(Array.isArray(m)&&(m=V3(m)),i.transformOrigin=m):i[g]=m}return i},Uf={},xM;function $3(){if(xM)return Uf;xM=1,Object.defineProperty(Uf,"__esModule",{value:!0}),Uf.styleq=void 0;var t=new WeakMap,e="$$css";function n(i){var s,a,u;return i!=null&&(s=i.disableCache===!0,a=i.disableMix===!0,u=i.transform),function(){for(var d=[],h="",g=null,m=s?null:t,y=new Array(arguments.length),b=0;b<arguments.length;b++)y[b]=arguments[b];for(;y.length>0;){var x=y.pop();if(!(x==null||x===!1)){if(Array.isArray(x)){for(var w=0;w<x.length;w++)y.push(x[w]);continue}var C=u!=null?u(x):x;if(C.$$css){var T="";if(m!=null&&m.has(C)){var E=m.get(C);E!=null&&(T=E[0],d.push.apply(d,E[1]),m=E[2])}else{var M=[];for(var k in C){var P=C[k];k!==e&&(typeof P=="string"||P===null?d.includes(k)||(d.push(k),m!=null&&M.push(k),typeof P=="string"&&(T+=T?" "+P:P)):console.error("styleq: ".concat(k," typeof ").concat(String(P),' is not "string" or "null".')))}if(m!=null){var A=new WeakMap;m.set(C,[T,M,A]),m=A}}T&&(h=h?T+" "+h:T)}else if(a)g==null&&(g={}),g=Object.assign({},C,g);else{var I=null;for(var L in C){var j=C[L];j!==void 0&&(d.includes(L)||(j!=null&&(g==null&&(g={}),I==null&&(I={}),I[L]=j),d.push(L),m=null))}I!=null&&(g=Object.assign(I,g))}}}var N=[h,g];return N}}var r=n();return Uf.styleq=r,r.factory=n,Uf}var q3=$3(),G3=["writingDirection"],jI=new WeakMap,Ug=ow(),_I={shadow:!0,textShadow:!0};function W3(t,e){e===void 0&&(e={});var n=e,r=n.writingDirection,i=km(n,G3),s=r==="rtl";return q3.styleq.factory({transform(a){var u=jI.get(a);return u!=null?P3.localizeStyle(u,s):BI(a,Mc(Mc({},_I),i))}})(t)}function HI(t){t.forEach(e=>{var n=e[0],r=e[1];Ug!=null&&n.forEach(i=>{Ug.insert(i,r)})})}function K3(t){var e=v3(BI(t,_I)),n=e[0],r=e[1];return HI(r),n}function Y3(t,e){var n=b3(t,e),r=n[0],i=n[1];return HI(i),r}var VI={position:"absolute",left:0,right:0,top:0,bottom:0},X3=FI({x:Mc({},VI)}).x;function FI(t){return Object.keys(t).forEach(e=>{var n=t[e];if(n!=null&&n.$$css!==!0){var r;e.indexOf("$raw")>-1?r=Y3(n,e.split("$raw")[0]):r=K3(n),jI.set(n,r)}}),t}function Q3(t,e){return[t,e]}function Z3(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];for(var r=e.flat(1/0),i={},s=0;s<r.length;s++){var a=r[s];a!=null&&typeof a=="object"&&Object.assign(i,a)}return i}function J3(){return{id:Ug.id,textContent:Ug.getTextContent()}}function cl(t,e){e===void 0&&(e={});var n=e.writingDirection==="rtl",r=W3(t,e);return Array.isArray(r)&&r[1]!=null&&(r[1]=x3(r[1],n)),r}cl.absoluteFill=X3;cl.absoluteFillObject=VI;cl.create=FI;cl.compose=Q3;cl.flatten=Z3;cl.getSheet=J3;cl.hairlineWidth=1;Su&&window.__REACT_DEVTOOLS_GLOBAL_HOOK__&&(window.__REACT_DEVTOOLS_GLOBAL_HOOK__.resolveRNStyle=cl.flatten);var Qd=cl,eF=["aria-activedescendant","accessibilityActiveDescendant","aria-atomic","accessibilityAtomic","aria-autocomplete","accessibilityAutoComplete","aria-busy","accessibilityBusy","aria-checked","accessibilityChecked","aria-colcount","accessibilityColumnCount","aria-colindex","accessibilityColumnIndex","aria-colspan","accessibilityColumnSpan","aria-controls","accessibilityControls","aria-current","accessibilityCurrent","aria-describedby","accessibilityDescribedBy","aria-details","accessibilityDetails","aria-disabled","accessibilityDisabled","aria-errormessage","accessibilityErrorMessage","aria-expanded","accessibilityExpanded","aria-flowto","accessibilityFlowTo","aria-haspopup","accessibilityHasPopup","aria-hidden","accessibilityHidden","aria-invalid","accessibilityInvalid","aria-keyshortcuts","accessibilityKeyShortcuts","aria-label","accessibilityLabel","aria-labelledby","accessibilityLabelledBy","aria-level","accessibilityLevel","aria-live","accessibilityLiveRegion","aria-modal","accessibilityModal","aria-multiline","accessibilityMultiline","aria-multiselectable","accessibilityMultiSelectable","aria-orientation","accessibilityOrientation","aria-owns","accessibilityOwns","aria-placeholder","accessibilityPlaceholder","aria-posinset","accessibilityPosInSet","aria-pressed","accessibilityPressed","aria-readonly","accessibilityReadOnly","aria-required","accessibilityRequired","role","accessibilityRole","aria-roledescription","accessibilityRoleDescription","aria-rowcount","accessibilityRowCount","aria-rowindex","accessibilityRowIndex","aria-rowspan","accessibilityRowSpan","aria-selected","accessibilitySelected","aria-setsize","accessibilitySetSize","aria-sort","accessibilitySort","aria-valuemax","accessibilityValueMax","aria-valuemin","accessibilityValueMin","aria-valuenow","accessibilityValueNow","aria-valuetext","accessibilityValueText","dataSet","focusable","id","nativeID","pointerEvents","style","tabIndex","testID"],tF={},nF=Object.prototype.hasOwnProperty,rF=Array.isArray,iF=/[A-Z]/g;function oF(t){return"-"+t.toLowerCase()}function sF(t){return t.replace(iF,oF)}function oc(t){return rF(t)?t.join(" "):t}var lF=Qd.create({auto:{pointerEvents:"auto"},"box-none":{pointerEvents:"box-none"},"box-only":{pointerEvents:"box-only"},none:{pointerEvents:"none"}}),aF=(t,e,n)=>{e||(e=tF);var r=e,i=r["aria-activedescendant"],s=r.accessibilityActiveDescendant,a=r["aria-atomic"],u=r.accessibilityAtomic,c=r["aria-autocomplete"],d=r.accessibilityAutoComplete,h=r["aria-busy"],g=r.accessibilityBusy,m=r["aria-checked"],y=r.accessibilityChecked,b=r["aria-colcount"],x=r.accessibilityColumnCount,w=r["aria-colindex"],C=r.accessibilityColumnIndex,T=r["aria-colspan"],E=r.accessibilityColumnSpan,M=r["aria-controls"],k=r.accessibilityControls,P=r["aria-current"],A=r.accessibilityCurrent,I=r["aria-describedby"],L=r.accessibilityDescribedBy,j=r["aria-details"],N=r.accessibilityDetails,_=r["aria-disabled"],H=r.accessibilityDisabled,F=r["aria-errormessage"],G=r.accessibilityErrorMessage,B=r["aria-expanded"],q=r.accessibilityExpanded,U=r["aria-flowto"],X=r.accessibilityFlowTo,Z=r["aria-haspopup"],z=r.accessibilityHasPopup,$=r["aria-hidden"],W=r.accessibilityHidden,K=r["aria-invalid"],ie=r.accessibilityInvalid,ee=r["aria-keyshortcuts"],ae=r.accessibilityKeyShortcuts,Y=r["aria-label"],se=r.accessibilityLabel,ve=r["aria-labelledby"],ye=r.accessibilityLabelledBy,he=r["aria-level"],pe=r.accessibilityLevel,Te=r["aria-live"],Ie=r.accessibilityLiveRegion,De=r["aria-modal"],Ee=r.accessibilityModal,_e=r["aria-multiline"],Me=r.accessibilityMultiline,oe=r["aria-multiselectable"],xe=r.accessibilityMultiSelectable,Pe=r["aria-orientation"],ne=r.accessibilityOrientation,J=r["aria-owns"],le=r.accessibilityOwns,we=r["aria-placeholder"],de=r.accessibilityPlaceholder,me=r["aria-posinset"],Be=r.accessibilityPosInSet,Ke=r["aria-pressed"],wt=r.accessibilityPressed,xt=r["aria-readonly"],st=r.accessibilityReadOnly,Ct=r["aria-required"],Wt=r.accessibilityRequired;r.role,r.accessibilityRole;var at=r["aria-roledescription"],Tn=r.accessibilityRoleDescription,Kt=r["aria-rowcount"],tn=r.accessibilityRowCount,Vt=r["aria-rowindex"],$t=r.accessibilityRowIndex,lt=r["aria-rowspan"],gt=r.accessibilityRowSpan,nt=r["aria-selected"],nn=r.accessibilitySelected,Vn=r["aria-setsize"],Fn=r.accessibilitySetSize,rn=r["aria-sort"],kn=r.accessibilitySort,Pt=r["aria-valuemax"],Hr=r.accessibilityValueMax,ar=r["aria-valuemin"],rt=r.accessibilityValueMin,qt=r["aria-valuenow"],qn=r.accessibilityValueNow,jn=r["aria-valuetext"],Tr=r.accessibilityValueText,ln=r.dataSet,zt=r.focusable,Nt=r.id,et=r.nativeID,Er=r.pointerEvents,nf=r.style,Es=r.tabIndex,ml=r.testID,qe=km(r,eF),Aa=_||H,Jn=RI.propsToAriaRole(e),Vi=i??s;Vi!=null&&(qe["aria-activedescendant"]=Vi);var fi=a!=null?i:u;fi!=null&&(qe["aria-atomic"]=fi);var di=c??d;di!=null&&(qe["aria-autocomplete"]=di);var Un=h??g;Un!=null&&(qe["aria-busy"]=Un);var ur=m??y;ur!=null&&(qe["aria-checked"]=ur);var Vr=b??x;Vr!=null&&(qe["aria-colcount"]=Vr);var Fi=w??C;Fi!=null&&(qe["aria-colindex"]=Fi);var xo=T??E;xo!=null&&(qe["aria-colspan"]=xo);var Oa=M??k;Oa!=null&&(qe["aria-controls"]=oc(Oa));var ka=P??A;ka!=null&&(qe["aria-current"]=ka);var Ms=I??L;Ms!=null&&(qe["aria-describedby"]=oc(Ms));var Ia=j??N;Ia!=null&&(qe["aria-details"]=Ia),Aa===!0&&(qe["aria-disabled"]=!0,(t==="button"||t==="form"||t==="input"||t==="select"||t==="textarea")&&(qe.disabled=!0));var So=F??G;So!=null&&(qe["aria-errormessage"]=So);var As=B??q;As!=null&&(qe["aria-expanded"]=As);var ni=U??X;ni!=null&&(qe["aria-flowto"]=oc(ni));var Gn=Z??z;Gn!=null&&(qe["aria-haspopup"]=Gn);var Fr=$??W;Fr===!0&&(qe["aria-hidden"]=Fr);var ri=K??ie;ri!=null&&(qe["aria-invalid"]=ri);var Ui=ee??ae;Ui!=null&&(qe["aria-keyshortcuts"]=oc(Ui));var Wo=Y??se;Wo!=null&&(qe["aria-label"]=Wo);var Os=ve??ye;Os!=null&&(qe["aria-labelledby"]=oc(Os));var Au=he??pe;Au!=null&&(qe["aria-level"]=Au);var cr=Te??Ie;cr!=null&&(qe["aria-live"]=cr==="none"?"off":cr);var yl=De??Ee;yl!=null&&(qe["aria-modal"]=yl);var Da=_e??Me;Da!=null&&(qe["aria-multiline"]=Da);var ks=oe??xe;ks!=null&&(qe["aria-multiselectable"]=ks);var hi=Pe??ne;hi!=null&&(qe["aria-orientation"]=hi);var vl=J??le;vl!=null&&(qe["aria-owns"]=oc(vl));var Ko=we??de;Ko!=null&&(qe["aria-placeholder"]=Ko);var $i=me??Be;$i!=null&&(qe["aria-posinset"]=$i);var Is=Ke??wt;Is!=null&&(qe["aria-pressed"]=Is);var bl=xt??st;bl!=null&&(qe["aria-readonly"]=bl,(t==="input"||t==="select"||t==="textarea")&&(qe.readOnly=!0));var Yo=Ct??Wt;Yo!=null&&(qe["aria-required"]=Yo,(t==="input"||t==="select"||t==="textarea")&&(qe.required=Wt)),Jn!=null&&(qe.role=Jn==="none"?"presentation":Jn);var Ti=at??Tn;Ti!=null&&(qe["aria-roledescription"]=Ti);var xl=Kt??tn;xl!=null&&(qe["aria-rowcount"]=xl);var Sl=Vt??$t;Sl!=null&&(qe["aria-rowindex"]=Sl);var wo=lt??gt;wo!=null&&(qe["aria-rowspan"]=wo);var Ur=nt??nn;Ur!=null&&(qe["aria-selected"]=Ur);var wl=Vn??Fn;wl!=null&&(qe["aria-setsize"]=wl);var Cl=rn??kn;Cl!=null&&(qe["aria-sort"]=Cl);var Co=Pt??Hr;Co!=null&&(qe["aria-valuemax"]=Co);var Ro=ar??rt;Ro!=null&&(qe["aria-valuemin"]=Ro);var Ds=qt??qn;Ds!=null&&(qe["aria-valuenow"]=Ds);var Rl=jn??Tr;if(Rl!=null&&(qe["aria-valuetext"]=Rl),ln!=null){for(var Tl in ln)if(nF.call(ln,Tl)){var je=sF(Tl),He=ln[Tl];He!=null&&(qe["data-"+je]=He)}}Es===0||Es==="0"||Es===-1||Es==="-1"?qe.tabIndex=Es:(zt===!1&&(qe.tabIndex="-1"),t==="a"||t==="button"||t==="input"||t==="select"||t==="textarea"?(zt===!1||H===!0)&&(qe.tabIndex="-1"):Jn==="button"||Jn==="checkbox"||Jn==="link"||Jn==="radio"||Jn==="textbox"||Jn==="switch"?zt!==!1&&(qe.tabIndex="0"):zt===!0&&(qe.tabIndex="0"));var Gt=Qd([nf,Er&&lF[Er]],Mc({writingDirection:"ltr"},n)),jt=Gt[0],on=Gt[1];jt&&(qe.className=jt),on&&(qe.style=on);var er=Nt??et;return er!=null&&(qe.id=er),ml!=null&&(qe["data-testid"]=ml),qe.type==null&&t==="button"&&(qe.type="button"),qe},j0={exports:{}},St={};var SM;function uF(){if(SM)return St;SM=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),a=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),m=Symbol.iterator;function y(z){return z===null||typeof z!="object"?null:(z=m&&z[m]||z["@@iterator"],typeof z=="function"?z:null)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},x=Object.assign,w={};function C(z,$,W){this.props=z,this.context=$,this.refs=w,this.updater=W||b}C.prototype.isReactComponent={},C.prototype.setState=function(z,$){if(typeof z!="object"&&typeof z!="function"&&z!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,z,$,"setState")},C.prototype.forceUpdate=function(z){this.updater.enqueueForceUpdate(this,z,"forceUpdate")};function T(){}T.prototype=C.prototype;function E(z,$,W){this.props=z,this.context=$,this.refs=w,this.updater=W||b}var M=E.prototype=new T;M.constructor=E,x(M,C.prototype),M.isPureReactComponent=!0;var k=Array.isArray;function P(){}var A={H:null,A:null,T:null,S:null},I=Object.prototype.hasOwnProperty;function L(z,$,W){var K=W.ref;return{$$typeof:t,type:z,key:$,ref:K!==void 0?K:null,props:W}}function j(z,$){return L(z.type,$,z.props)}function N(z){return typeof z=="object"&&z!==null&&z.$$typeof===t}function _(z){var $={"=":"=0",":":"=2"};return"$"+z.replace(/[=:]/g,function(W){return $[W]})}var H=/\/+/g;function F(z,$){return typeof z=="object"&&z!==null&&z.key!=null?_(""+z.key):$.toString(36)}function G(z){switch(z.status){case"fulfilled":return z.value;case"rejected":throw z.reason;default:switch(typeof z.status=="string"?z.then(P,P):(z.status="pending",z.then(function($){z.status==="pending"&&(z.status="fulfilled",z.value=$)},function($){z.status==="pending"&&(z.status="rejected",z.reason=$)})),z.status){case"fulfilled":return z.value;case"rejected":throw z.reason}}throw z}function B(z,$,W,K,ie){var ee=typeof z;(ee==="undefined"||ee==="boolean")&&(z=null);var ae=!1;if(z===null)ae=!0;else switch(ee){case"bigint":case"string":case"number":ae=!0;break;case"object":switch(z.$$typeof){case t:case e:ae=!0;break;case h:return ae=z._init,B(ae(z._payload),$,W,K,ie)}}if(ae)return ie=ie(z),ae=K===""?"."+F(z,0):K,k(ie)?(W="",ae!=null&&(W=ae.replace(H,"$&/")+"/"),B(ie,$,W,"",function(ve){return ve})):ie!=null&&(N(ie)&&(ie=j(ie,W+(ie.key==null||z&&z.key===ie.key?"":(""+ie.key).replace(H,"$&/")+"/")+ae)),$.push(ie)),1;ae=0;var Y=K===""?".":K+":";if(k(z))for(var se=0;se<z.length;se++)K=z[se],ee=Y+F(K,se),ae+=B(K,$,W,ee,ie);else if(se=y(z),typeof se=="function")for(z=se.call(z),se=0;!(K=z.next()).done;)K=K.value,ee=Y+F(K,se++),ae+=B(K,$,W,ee,ie);else if(ee==="object"){if(typeof z.then=="function")return B(G(z),$,W,K,ie);throw $=String(z),Error("Objects are not valid as a React child (found: "+($==="[object Object]"?"object with keys {"+Object.keys(z).join(", ")+"}":$)+"). If you meant to render a collection of children, use an array instead.")}return ae}function q(z,$,W){if(z==null)return z;var K=[],ie=0;return B(z,K,"","",function(ee){return $.call(W,ee,ie++)}),K}function U(z){if(z._status===-1){var $=z._result;$=$(),$.then(function(W){(z._status===0||z._status===-1)&&(z._status=1,z._result=W)},function(W){(z._status===0||z._status===-1)&&(z._status=2,z._result=W)}),z._status===-1&&(z._status=0,z._result=$)}if(z._status===1)return z._result.default;throw z._result}var X=typeof reportError=="function"?reportError:function(z){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var $=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof z=="object"&&z!==null&&typeof z.message=="string"?String(z.message):String(z),error:z});if(!window.dispatchEvent($))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",z);return}console.error(z)},Z={map:q,forEach:function(z,$,W){q(z,function(){$.apply(this,arguments)},W)},count:function(z){var $=0;return q(z,function(){$++}),$},toArray:function(z){return q(z,function($){return $})||[]},only:function(z){if(!N(z))throw Error("React.Children.only expected to receive a single React element child.");return z}};return St.Activity=g,St.Children=Z,St.Component=C,St.Fragment=n,St.Profiler=i,St.PureComponent=E,St.StrictMode=r,St.Suspense=c,St.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=A,St.__COMPILER_RUNTIME={__proto__:null,c:function(z){return A.H.useMemoCache(z)}},St.cache=function(z){return function(){return z.apply(null,arguments)}},St.cacheSignal=function(){return null},St.cloneElement=function(z,$,W){if(z==null)throw Error("The argument must be a React element, but you passed "+z+".");var K=x({},z.props),ie=z.key;if($!=null)for(ee in $.key!==void 0&&(ie=""+$.key),$)!I.call($,ee)||ee==="key"||ee==="__self"||ee==="__source"||ee==="ref"&&$.ref===void 0||(K[ee]=$[ee]);var ee=arguments.length-2;if(ee===1)K.children=W;else if(1<ee){for(var ae=Array(ee),Y=0;Y<ee;Y++)ae[Y]=arguments[Y+2];K.children=ae}return L(z.type,ie,K)},St.createContext=function(z){return z={$$typeof:a,_currentValue:z,_currentValue2:z,_threadCount:0,Provider:null,Consumer:null},z.Provider=z,z.Consumer={$$typeof:s,_context:z},z},St.createElement=function(z,$,W){var K,ie={},ee=null;if($!=null)for(K in $.key!==void 0&&(ee=""+$.key),$)I.call($,K)&&K!=="key"&&K!=="__self"&&K!=="__source"&&(ie[K]=$[K]);var ae=arguments.length-2;if(ae===1)ie.children=W;else if(1<ae){for(var Y=Array(ae),se=0;se<ae;se++)Y[se]=arguments[se+2];ie.children=Y}if(z&&z.defaultProps)for(K in ae=z.defaultProps,ae)ie[K]===void 0&&(ie[K]=ae[K]);return L(z,ee,ie)},St.createRef=function(){return{current:null}},St.forwardRef=function(z){return{$$typeof:u,render:z}},St.isValidElement=N,St.lazy=function(z){return{$$typeof:h,_payload:{_status:-1,_result:z},_init:U}},St.memo=function(z,$){return{$$typeof:d,type:z,compare:$===void 0?null:$}},St.startTransition=function(z){var $=A.T,W={};A.T=W;try{var K=z(),ie=A.S;ie!==null&&ie(W,K),typeof K=="object"&&K!==null&&typeof K.then=="function"&&K.then(P,X)}catch(ee){X(ee)}finally{$!==null&&W.types!==null&&($.types=W.types),A.T=$}},St.unstable_useCacheRefresh=function(){return A.H.useCacheRefresh()},St.use=function(z){return A.H.use(z)},St.useActionState=function(z,$,W){return A.H.useActionState(z,$,W)},St.useCallback=function(z,$){return A.H.useCallback(z,$)},St.useContext=function(z){return A.H.useContext(z)},St.useDebugValue=function(){},St.useDeferredValue=function(z,$){return A.H.useDeferredValue(z,$)},St.useEffect=function(z,$){return A.H.useEffect(z,$)},St.useEffectEvent=function(z){return A.H.useEffectEvent(z)},St.useId=function(){return A.H.useId()},St.useImperativeHandle=function(z,$,W){return A.H.useImperativeHandle(z,$,W)},St.useInsertionEffect=function(z,$){return A.H.useInsertionEffect(z,$)},St.useLayoutEffect=function(z,$){return A.H.useLayoutEffect(z,$)},St.useMemo=function(z,$){return A.H.useMemo(z,$)},St.useOptimistic=function(z,$){return A.H.useOptimistic(z,$)},St.useReducer=function(z,$,W){return A.H.useReducer(z,$,W)},St.useRef=function(z){return A.H.useRef(z)},St.useState=function(z){return A.H.useState(z)},St.useSyncExternalStore=function(z,$,W){return A.H.useSyncExternalStore(z,$,W)},St.useTransition=function(){return A.H.useTransition()},St.version="19.2.3",St}var wM;function Zd(){return wM||(wM=1,j0.exports=uF()),j0.exports}var R=Zd();const Ve=Fo(R),cF=PH({__proto__:null,default:Ve},[R]);var fF=new Set(["Arab","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),CM=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","far","glk","he","iw","khw","ks","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]),RM=new Map;function dF(t){var e=RM.get(t);if(e)return e;var n=!1;if(Intl.Locale)try{var r=new Intl.Locale(t).maximize().script;n=fF.has(r)}catch{var i=t.split("-")[0];n=CM.has(i)}else{var s=t.split("-")[0];n=CM.has(s)}return RM.set(t,n),n}var hF={direction:"ltr",locale:"en-US"},UI=R.createContext(hF);function $I(t){return dF(t)?"rtl":"ltr"}function pF(t){var e=t.direction,n=t.locale,r=t.children,i=e||n;return i?Ve.createElement(UI.Provider,{children:r,value:{direction:n?$I(n):e,locale:n}}):r}function gF(){return R.useContext(UI)}var mF=(t,e,n)=>{var r;t&&t.constructor===String&&(r=RI.propsToAccessibilityComponent(e));var i=r||t,s=aF(i,e,n),a=Ve.createElement(i,s),u=s.dir?Ve.createElement(pF,{children:a,direction:s.dir,locale:s.lang}):a;return u},_0={exports:{}},$f={},H0={exports:{}},V0={};var TM;function yF(){return TM||(TM=1,(function(t){function e(B,q){var U=B.length;B.push(q);e:for(;0<U;){var X=U-1>>>1,Z=B[X];if(0<i(Z,q))B[X]=q,B[U]=Z,U=X;else break e}}function n(B){return B.length===0?null:B[0]}function r(B){if(B.length===0)return null;var q=B[0],U=B.pop();if(U!==q){B[0]=U;e:for(var X=0,Z=B.length,z=Z>>>1;X<z;){var $=2*(X+1)-1,W=B[$],K=$+1,ie=B[K];if(0>i(W,U))K<Z&&0>i(ie,W)?(B[X]=ie,B[K]=U,X=K):(B[X]=W,B[$]=U,X=$);else if(K<Z&&0>i(ie,U))B[X]=ie,B[K]=U,X=K;else break e}}return q}function i(B,q){var U=B.sortIndex-q.sortIndex;return U!==0?U:B.id-q.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;t.unstable_now=function(){return s.now()}}else{var a=Date,u=a.now();t.unstable_now=function(){return a.now()-u}}var c=[],d=[],h=1,g=null,m=3,y=!1,b=!1,x=!1,w=!1,C=typeof setTimeout=="function"?setTimeout:null,T=typeof clearTimeout=="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null;function M(B){for(var q=n(d);q!==null;){if(q.callback===null)r(d);else if(q.startTime<=B)r(d),q.sortIndex=q.expirationTime,e(c,q);else break;q=n(d)}}function k(B){if(x=!1,M(B),!b)if(n(c)!==null)b=!0,P||(P=!0,_());else{var q=n(d);q!==null&&G(k,q.startTime-B)}}var P=!1,A=-1,I=5,L=-1;function j(){return w?!0:!(t.unstable_now()-L<I)}function N(){if(w=!1,P){var B=t.unstable_now();L=B;var q=!0;try{e:{b=!1,x&&(x=!1,T(A),A=-1),y=!0;var U=m;try{t:{for(M(B),g=n(c);g!==null&&!(g.expirationTime>B&&j());){var X=g.callback;if(typeof X=="function"){g.callback=null,m=g.priorityLevel;var Z=X(g.expirationTime<=B);if(B=t.unstable_now(),typeof Z=="function"){g.callback=Z,M(B),q=!0;break t}g===n(c)&&r(c),M(B)}else r(c);g=n(c)}if(g!==null)q=!0;else{var z=n(d);z!==null&&G(k,z.startTime-B),q=!1}}break e}finally{g=null,m=U,y=!1}q=void 0}}finally{q?_():P=!1}}}var _;if(typeof E=="function")_=function(){E(N)};else if(typeof MessageChannel<"u"){var H=new MessageChannel,F=H.port2;H.port1.onmessage=N,_=function(){F.postMessage(null)}}else _=function(){C(N,0)};function G(B,q){A=C(function(){B(t.unstable_now())},q)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(B){B.callback=null},t.unstable_forceFrameRate=function(B){0>B||125<B?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):I=0<B?Math.floor(1e3/B):5},t.unstable_getCurrentPriorityLevel=function(){return m},t.unstable_next=function(B){switch(m){case 1:case 2:case 3:var q=3;break;default:q=m}var U=m;m=q;try{return B()}finally{m=U}},t.unstable_requestPaint=function(){w=!0},t.unstable_runWithPriority=function(B,q){switch(B){case 1:case 2:case 3:case 4:case 5:break;default:B=3}var U=m;m=B;try{return q()}finally{m=U}},t.unstable_scheduleCallback=function(B,q,U){var X=t.unstable_now();switch(typeof U=="object"&&U!==null?(U=U.delay,U=typeof U=="number"&&0<U?X+U:X):U=X,B){case 1:var Z=-1;break;case 2:Z=250;break;case 5:Z=1073741823;break;case 4:Z=1e4;break;default:Z=5e3}return Z=U+Z,B={id:h++,callback:q,priorityLevel:B,startTime:U,expirationTime:Z,sortIndex:-1},U>X?(B.sortIndex=U,e(d,B),n(c)===null&&B===n(d)&&(x?(T(A),A=-1):x=!0,G(k,U-X))):(B.sortIndex=Z,e(c,B),b||y||(b=!0,P||(P=!0,_()))),B},t.unstable_shouldYield=j,t.unstable_wrapCallback=function(B){var q=m;return function(){var U=m;m=q;try{return B.apply(this,arguments)}finally{m=U}}}})(V0)),V0}var EM;function vF(){return EM||(EM=1,H0.exports=yF()),H0.exports}var F0={exports:{}},Gr={};var MM;function bF(){if(MM)return Gr;MM=1;var t=Zd();function e(c){var d="https://react.dev/errors/"+c;if(1<arguments.length){d+="?args[]="+encodeURIComponent(arguments[1]);for(var h=2;h<arguments.length;h++)d+="&args[]="+encodeURIComponent(arguments[h])}return"Minified React error #"+c+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(e(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},i=Symbol.for("react.portal");function s(c,d,h){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:g==null?null:""+g,children:c,containerInfo:d,implementation:h}}var a=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(c,d){if(c==="font")return"";if(typeof d=="string")return d==="use-credentials"?d:""}return Gr.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Gr.createPortal=function(c,d){var h=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!d||d.nodeType!==1&&d.nodeType!==9&&d.nodeType!==11)throw Error(e(299));return s(c,d,null,h)},Gr.flushSync=function(c){var d=a.T,h=r.p;try{if(a.T=null,r.p=2,c)return c()}finally{a.T=d,r.p=h,r.d.f()}},Gr.preconnect=function(c,d){typeof c=="string"&&(d?(d=d.crossOrigin,d=typeof d=="string"?d==="use-credentials"?d:"":void 0):d=null,r.d.C(c,d))},Gr.prefetchDNS=function(c){typeof c=="string"&&r.d.D(c)},Gr.preinit=function(c,d){if(typeof c=="string"&&d&&typeof d.as=="string"){var h=d.as,g=u(h,d.crossOrigin),m=typeof d.integrity=="string"?d.integrity:void 0,y=typeof d.fetchPriority=="string"?d.fetchPriority:void 0;h==="style"?r.d.S(c,typeof d.precedence=="string"?d.precedence:void 0,{crossOrigin:g,integrity:m,fetchPriority:y}):h==="script"&&r.d.X(c,{crossOrigin:g,integrity:m,fetchPriority:y,nonce:typeof d.nonce=="string"?d.nonce:void 0})}},Gr.preinitModule=function(c,d){if(typeof c=="string")if(typeof d=="object"&&d!==null){if(d.as==null||d.as==="script"){var h=u(d.as,d.crossOrigin);r.d.M(c,{crossOrigin:h,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0})}}else d==null&&r.d.M(c)},Gr.preload=function(c,d){if(typeof c=="string"&&typeof d=="object"&&d!==null&&typeof d.as=="string"){var h=d.as,g=u(h,d.crossOrigin);r.d.L(c,h,{crossOrigin:g,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0,type:typeof d.type=="string"?d.type:void 0,fetchPriority:typeof d.fetchPriority=="string"?d.fetchPriority:void 0,referrerPolicy:typeof d.referrerPolicy=="string"?d.referrerPolicy:void 0,imageSrcSet:typeof d.imageSrcSet=="string"?d.imageSrcSet:void 0,imageSizes:typeof d.imageSizes=="string"?d.imageSizes:void 0,media:typeof d.media=="string"?d.media:void 0})}},Gr.preloadModule=function(c,d){if(typeof c=="string")if(d){var h=u(d.as,d.crossOrigin);r.d.m(c,{as:typeof d.as=="string"&&d.as!=="script"?d.as:void 0,crossOrigin:h,integrity:typeof d.integrity=="string"?d.integrity:void 0})}else r.d.m(c)},Gr.requestFormReset=function(c){r.d.r(c)},Gr.unstable_batchedUpdates=function(c,d){return c(d)},Gr.useFormState=function(c,d,h){return a.H.useFormState(c,d,h)},Gr.useFormStatus=function(){return a.H.useHostTransitionStatus()},Gr.version="19.2.3",Gr}var AM;function qI(){if(AM)return F0.exports;AM=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),F0.exports=bF(),F0.exports}var OM;function xF(){if(OM)return $f;OM=1;var t=vF(),e=Zd(),n=qI();function r(o){var l="https://react.dev/errors/"+o;if(1<arguments.length){l+="?args[]="+encodeURIComponent(arguments[1]);for(var f=2;f<arguments.length;f++)l+="&args[]="+encodeURIComponent(arguments[f])}return"Minified React error #"+o+"; visit "+l+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(o){return!(!o||o.nodeType!==1&&o.nodeType!==9&&o.nodeType!==11)}function s(o){var l=o,f=o;if(o.alternate)for(;l.return;)l=l.return;else{o=l;do l=o,(l.flags&4098)!==0&&(f=l.return),o=l.return;while(o)}return l.tag===3?f:null}function a(o){if(o.tag===13){var l=o.memoizedState;if(l===null&&(o=o.alternate,o!==null&&(l=o.memoizedState)),l!==null)return l.dehydrated}return null}function u(o){if(o.tag===31){var l=o.memoizedState;if(l===null&&(o=o.alternate,o!==null&&(l=o.memoizedState)),l!==null)return l.dehydrated}return null}function c(o){if(s(o)!==o)throw Error(r(188))}function d(o){var l=o.alternate;if(!l){if(l=s(o),l===null)throw Error(r(188));return l!==o?null:o}for(var f=o,p=l;;){var v=f.return;if(v===null)break;var S=v.alternate;if(S===null){if(p=v.return,p!==null){f=p;continue}break}if(v.child===S.child){for(S=v.child;S;){if(S===f)return c(v),o;if(S===p)return c(v),l;S=S.sibling}throw Error(r(188))}if(f.return!==p.return)f=v,p=S;else{for(var D=!1,V=v.child;V;){if(V===f){D=!0,f=v,p=S;break}if(V===p){D=!0,p=v,f=S;break}V=V.sibling}if(!D){for(V=S.child;V;){if(V===f){D=!0,f=S,p=v;break}if(V===p){D=!0,p=S,f=v;break}V=V.sibling}if(!D)throw Error(r(189))}}if(f.alternate!==p)throw Error(r(190))}if(f.tag!==3)throw Error(r(188));return f.stateNode.current===f?o:l}function h(o){var l=o.tag;if(l===5||l===26||l===27||l===6)return o;for(o=o.child;o!==null;){if(l=h(o),l!==null)return l;o=o.sibling}return null}var g=Object.assign,m=Symbol.for("react.element"),y=Symbol.for("react.transitional.element"),b=Symbol.for("react.portal"),x=Symbol.for("react.fragment"),w=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),T=Symbol.for("react.consumer"),E=Symbol.for("react.context"),M=Symbol.for("react.forward_ref"),k=Symbol.for("react.suspense"),P=Symbol.for("react.suspense_list"),A=Symbol.for("react.memo"),I=Symbol.for("react.lazy"),L=Symbol.for("react.activity"),j=Symbol.for("react.memo_cache_sentinel"),N=Symbol.iterator;function _(o){return o===null||typeof o!="object"?null:(o=N&&o[N]||o["@@iterator"],typeof o=="function"?o:null)}var H=Symbol.for("react.client.reference");function F(o){if(o==null)return null;if(typeof o=="function")return o.$$typeof===H?null:o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case x:return"Fragment";case C:return"Profiler";case w:return"StrictMode";case k:return"Suspense";case P:return"SuspenseList";case L:return"Activity"}if(typeof o=="object")switch(o.$$typeof){case b:return"Portal";case E:return o.displayName||"Context";case T:return(o._context.displayName||"Context")+".Consumer";case M:var l=o.render;return o=o.displayName,o||(o=l.displayName||l.name||"",o=o!==""?"ForwardRef("+o+")":"ForwardRef"),o;case A:return l=o.displayName||null,l!==null?l:F(o.type)||"Memo";case I:l=o._payload,o=o._init;try{return F(o(l))}catch{}}return null}var G=Array.isArray,B=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,q=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,U={pending:!1,data:null,method:null,action:null},X=[],Z=-1;function z(o){return{current:o}}function $(o){0>Z||(o.current=X[Z],X[Z]=null,Z--)}function W(o,l){Z++,X[Z]=o.current,o.current=l}var K=z(null),ie=z(null),ee=z(null),ae=z(null);function Y(o,l){switch(W(ee,l),W(ie,o),W(K,null),l.nodeType){case 9:case 11:o=(o=l.documentElement)&&(o=o.namespaceURI)?mE(o):0;break;default:if(o=l.tagName,l=l.namespaceURI)l=mE(l),o=yE(l,o);else switch(o){case"svg":o=1;break;case"math":o=2;break;default:o=0}}$(K),W(K,o)}function se(){$(K),$(ie),$(ee)}function ve(o){o.memoizedState!==null&&W(ae,o);var l=K.current,f=yE(l,o.type);l!==f&&(W(ie,o),W(K,f))}function ye(o){ie.current===o&&($(K),$(ie)),ae.current===o&&($(ae),_f._currentValue=U)}var he,pe;function Te(o){if(he===void 0)try{throw Error()}catch(f){var l=f.stack.trim().match(/\n( *(at )?)/);he=l&&l[1]||"",pe=-1<f.stack.indexOf(`
|
|
5
|
+
at`)?" (<anonymous>)":-1<f.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
6
|
+
`+he+o+pe}var Ie=!1;function De(o,l){if(!o||Ie)return"";Ie=!0;var f=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var p={DetermineComponentFrameRoot:function(){try{if(l){var Re=function(){throw Error()};if(Object.defineProperty(Re.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Re,[])}catch(ge){var fe=ge}Reflect.construct(o,[],Re)}else{try{Re.call()}catch(ge){fe=ge}o.call(Re.prototype)}}else{try{throw Error()}catch(ge){fe=ge}(Re=o())&&typeof Re.catch=="function"&&Re.catch(function(){})}}catch(ge){if(ge&&fe&&typeof ge.stack=="string")return[ge.stack,fe.stack]}return[null,null]}};p.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var v=Object.getOwnPropertyDescriptor(p.DetermineComponentFrameRoot,"name");v&&v.configurable&&Object.defineProperty(p.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var S=p.DetermineComponentFrameRoot(),D=S[0],V=S[1];if(D&&V){var Q=D.split(`
|
|
7
|
+
`),ce=V.split(`
|
|
8
|
+
`);for(v=p=0;p<Q.length&&!Q[p].includes("DetermineComponentFrameRoot");)p++;for(;v<ce.length&&!ce[v].includes("DetermineComponentFrameRoot");)v++;if(p===Q.length||v===ce.length)for(p=Q.length-1,v=ce.length-1;1<=p&&0<=v&&Q[p]!==ce[v];)v--;for(;1<=p&&0<=v;p--,v--)if(Q[p]!==ce[v]){if(p!==1||v!==1)do if(p--,v--,0>v||Q[p]!==ce[v]){var be=`
|
|
9
|
+
`+Q[p].replace(" at new "," at ");return o.displayName&&be.includes("<anonymous>")&&(be=be.replace("<anonymous>",o.displayName)),be}while(1<=p&&0<=v);break}}}finally{Ie=!1,Error.prepareStackTrace=f}return(f=o?o.displayName||o.name:"")?Te(f):""}function Ee(o,l){switch(o.tag){case 26:case 27:case 5:return Te(o.type);case 16:return Te("Lazy");case 13:return o.child!==l&&l!==null?Te("Suspense Fallback"):Te("Suspense");case 19:return Te("SuspenseList");case 0:case 15:return De(o.type,!1);case 11:return De(o.type.render,!1);case 1:return De(o.type,!0);case 31:return Te("Activity");default:return""}}function _e(o){try{var l="",f=null;do l+=Ee(o,f),f=o,o=o.return;while(o);return l}catch(p){return`
|
|
10
|
+
Error generating stack: `+p.message+`
|
|
11
|
+
`+p.stack}}var Me=Object.prototype.hasOwnProperty,oe=t.unstable_scheduleCallback,xe=t.unstable_cancelCallback,Pe=t.unstable_shouldYield,ne=t.unstable_requestPaint,J=t.unstable_now,le=t.unstable_getCurrentPriorityLevel,we=t.unstable_ImmediatePriority,de=t.unstable_UserBlockingPriority,me=t.unstable_NormalPriority,Be=t.unstable_LowPriority,Ke=t.unstable_IdlePriority,wt=t.log,xt=t.unstable_setDisableYieldValue,st=null,Ct=null;function Wt(o){if(typeof wt=="function"&&xt(o),Ct&&typeof Ct.setStrictMode=="function")try{Ct.setStrictMode(st,o)}catch{}}var at=Math.clz32?Math.clz32:tn,Tn=Math.log,Kt=Math.LN2;function tn(o){return o>>>=0,o===0?32:31-(Tn(o)/Kt|0)|0}var Vt=256,$t=262144,lt=4194304;function gt(o){var l=o&42;if(l!==0)return l;switch(o&-o){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return o&261888;case 262144:case 524288:case 1048576:case 2097152:return o&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return o&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return o}}function nt(o,l,f){var p=o.pendingLanes;if(p===0)return 0;var v=0,S=o.suspendedLanes,D=o.pingedLanes;o=o.warmLanes;var V=p&134217727;return V!==0?(p=V&~S,p!==0?v=gt(p):(D&=V,D!==0?v=gt(D):f||(f=V&~o,f!==0&&(v=gt(f))))):(V=p&~S,V!==0?v=gt(V):D!==0?v=gt(D):f||(f=p&~o,f!==0&&(v=gt(f)))),v===0?0:l!==0&&l!==v&&(l&S)===0&&(S=v&-v,f=l&-l,S>=f||S===32&&(f&4194048)!==0)?l:v}function nn(o,l){return(o.pendingLanes&~(o.suspendedLanes&~o.pingedLanes)&l)===0}function Vn(o,l){switch(o){case 1:case 2:case 4:case 8:case 64:return l+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return l+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Fn(){var o=lt;return lt<<=1,(lt&62914560)===0&&(lt=4194304),o}function rn(o){for(var l=[],f=0;31>f;f++)l.push(o);return l}function kn(o,l){o.pendingLanes|=l,l!==268435456&&(o.suspendedLanes=0,o.pingedLanes=0,o.warmLanes=0)}function Pt(o,l,f,p,v,S){var D=o.pendingLanes;o.pendingLanes=f,o.suspendedLanes=0,o.pingedLanes=0,o.warmLanes=0,o.expiredLanes&=f,o.entangledLanes&=f,o.errorRecoveryDisabledLanes&=f,o.shellSuspendCounter=0;var V=o.entanglements,Q=o.expirationTimes,ce=o.hiddenUpdates;for(f=D&~f;0<f;){var be=31-at(f),Re=1<<be;V[be]=0,Q[be]=-1;var fe=ce[be];if(fe!==null)for(ce[be]=null,be=0;be<fe.length;be++){var ge=fe[be];ge!==null&&(ge.lane&=-536870913)}f&=~Re}p!==0&&Hr(o,p,0),S!==0&&v===0&&o.tag!==0&&(o.suspendedLanes|=S&~(D&~l))}function Hr(o,l,f){o.pendingLanes|=l,o.suspendedLanes&=~l;var p=31-at(l);o.entangledLanes|=l,o.entanglements[p]=o.entanglements[p]|1073741824|f&261930}function ar(o,l){var f=o.entangledLanes|=l;for(o=o.entanglements;f;){var p=31-at(f),v=1<<p;v&l|o[p]&l&&(o[p]|=l),f&=~v}}function rt(o,l){var f=l&-l;return f=(f&42)!==0?1:qt(f),(f&(o.suspendedLanes|l))!==0?0:f}function qt(o){switch(o){case 2:o=1;break;case 8:o=4;break;case 32:o=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:o=128;break;case 268435456:o=134217728;break;default:o=0}return o}function qn(o){return o&=-o,2<o?8<o?(o&134217727)!==0?32:268435456:8:2}function jn(){var o=q.p;return o!==0?o:(o=window.event,o===void 0?32:HE(o.type))}function Tr(o,l){var f=q.p;try{return q.p=o,l()}finally{q.p=f}}var ln=Math.random().toString(36).slice(2),zt="__reactFiber$"+ln,Nt="__reactProps$"+ln,et="__reactContainer$"+ln,Er="__reactEvents$"+ln,nf="__reactListeners$"+ln,Es="__reactHandles$"+ln,ml="__reactResources$"+ln,qe="__reactMarker$"+ln;function Aa(o){delete o[zt],delete o[Nt],delete o[Er],delete o[nf],delete o[Es]}function Jn(o){var l=o[zt];if(l)return l;for(var f=o.parentNode;f;){if(l=f[et]||f[zt]){if(f=l.alternate,l.child!==null||f!==null&&f.child!==null)for(o=RE(o);o!==null;){if(f=o[zt])return f;o=RE(o)}return l}o=f,f=o.parentNode}return null}function Vi(o){if(o=o[zt]||o[et]){var l=o.tag;if(l===5||l===6||l===13||l===31||l===26||l===27||l===3)return o}return null}function fi(o){var l=o.tag;if(l===5||l===26||l===27||l===6)return o.stateNode;throw Error(r(33))}function di(o){var l=o[ml];return l||(l=o[ml]={hoistableStyles:new Map,hoistableScripts:new Map}),l}function Un(o){o[qe]=!0}var ur=new Set,Vr={};function Fi(o,l){xo(o,l),xo(o+"Capture",l)}function xo(o,l){for(Vr[o]=l,o=0;o<l.length;o++)ur.add(l[o])}var Oa=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),ka={},Ms={};function Ia(o){return Me.call(Ms,o)?!0:Me.call(ka,o)?!1:Oa.test(o)?Ms[o]=!0:(ka[o]=!0,!1)}function So(o,l,f){if(Ia(l))if(f===null)o.removeAttribute(l);else{switch(typeof f){case"undefined":case"function":case"symbol":o.removeAttribute(l);return;case"boolean":var p=l.toLowerCase().slice(0,5);if(p!=="data-"&&p!=="aria-"){o.removeAttribute(l);return}}o.setAttribute(l,""+f)}}function As(o,l,f){if(f===null)o.removeAttribute(l);else{switch(typeof f){case"undefined":case"function":case"symbol":case"boolean":o.removeAttribute(l);return}o.setAttribute(l,""+f)}}function ni(o,l,f,p){if(p===null)o.removeAttribute(f);else{switch(typeof p){case"undefined":case"function":case"symbol":case"boolean":o.removeAttribute(f);return}o.setAttributeNS(l,f,""+p)}}function Gn(o){switch(typeof o){case"bigint":case"boolean":case"number":case"string":case"undefined":return o;case"object":return o;default:return""}}function Fr(o){var l=o.type;return(o=o.nodeName)&&o.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function ri(o,l,f){var p=Object.getOwnPropertyDescriptor(o.constructor.prototype,l);if(!o.hasOwnProperty(l)&&typeof p<"u"&&typeof p.get=="function"&&typeof p.set=="function"){var v=p.get,S=p.set;return Object.defineProperty(o,l,{configurable:!0,get:function(){return v.call(this)},set:function(D){f=""+D,S.call(this,D)}}),Object.defineProperty(o,l,{enumerable:p.enumerable}),{getValue:function(){return f},setValue:function(D){f=""+D},stopTracking:function(){o._valueTracker=null,delete o[l]}}}}function Ui(o){if(!o._valueTracker){var l=Fr(o)?"checked":"value";o._valueTracker=ri(o,l,""+o[l])}}function Wo(o){if(!o)return!1;var l=o._valueTracker;if(!l)return!0;var f=l.getValue(),p="";return o&&(p=Fr(o)?o.checked?"true":"false":o.value),o=p,o!==f?(l.setValue(o),!0):!1}function Os(o){if(o=o||(typeof document<"u"?document:void 0),typeof o>"u")return null;try{return o.activeElement||o.body}catch{return o.body}}var Au=/[\n"\\]/g;function cr(o){return o.replace(Au,function(l){return"\\"+l.charCodeAt(0).toString(16)+" "})}function yl(o,l,f,p,v,S,D,V){o.name="",D!=null&&typeof D!="function"&&typeof D!="symbol"&&typeof D!="boolean"?o.type=D:o.removeAttribute("type"),l!=null?D==="number"?(l===0&&o.value===""||o.value!=l)&&(o.value=""+Gn(l)):o.value!==""+Gn(l)&&(o.value=""+Gn(l)):D!=="submit"&&D!=="reset"||o.removeAttribute("value"),l!=null?ks(o,D,Gn(l)):f!=null?ks(o,D,Gn(f)):p!=null&&o.removeAttribute("value"),v==null&&S!=null&&(o.defaultChecked=!!S),v!=null&&(o.checked=v&&typeof v!="function"&&typeof v!="symbol"),V!=null&&typeof V!="function"&&typeof V!="symbol"&&typeof V!="boolean"?o.name=""+Gn(V):o.removeAttribute("name")}function Da(o,l,f,p,v,S,D,V){if(S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"&&(o.type=S),l!=null||f!=null){if(!(S!=="submit"&&S!=="reset"||l!=null)){Ui(o);return}f=f!=null?""+Gn(f):"",l=l!=null?""+Gn(l):f,V||l===o.value||(o.value=l),o.defaultValue=l}p=p??v,p=typeof p!="function"&&typeof p!="symbol"&&!!p,o.checked=V?o.checked:!!p,o.defaultChecked=!!p,D!=null&&typeof D!="function"&&typeof D!="symbol"&&typeof D!="boolean"&&(o.name=D),Ui(o)}function ks(o,l,f){l==="number"&&Os(o.ownerDocument)===o||o.defaultValue===""+f||(o.defaultValue=""+f)}function hi(o,l,f,p){if(o=o.options,l){l={};for(var v=0;v<f.length;v++)l["$"+f[v]]=!0;for(f=0;f<o.length;f++)v=l.hasOwnProperty("$"+o[f].value),o[f].selected!==v&&(o[f].selected=v),v&&p&&(o[f].defaultSelected=!0)}else{for(f=""+Gn(f),l=null,v=0;v<o.length;v++){if(o[v].value===f){o[v].selected=!0,p&&(o[v].defaultSelected=!0);return}l!==null||o[v].disabled||(l=o[v])}l!==null&&(l.selected=!0)}}function vl(o,l,f){if(l!=null&&(l=""+Gn(l),l!==o.value&&(o.value=l),f==null)){o.defaultValue!==l&&(o.defaultValue=l);return}o.defaultValue=f!=null?""+Gn(f):""}function Ko(o,l,f,p){if(l==null){if(p!=null){if(f!=null)throw Error(r(92));if(G(p)){if(1<p.length)throw Error(r(93));p=p[0]}f=p}f==null&&(f=""),l=f}f=Gn(l),o.defaultValue=f,p=o.textContent,p===f&&p!==""&&p!==null&&(o.value=p),Ui(o)}function $i(o,l){if(l){var f=o.firstChild;if(f&&f===o.lastChild&&f.nodeType===3){f.nodeValue=l;return}}o.textContent=l}var Is=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function bl(o,l,f){var p=l.indexOf("--")===0;f==null||typeof f=="boolean"||f===""?p?o.setProperty(l,""):l==="float"?o.cssFloat="":o[l]="":p?o.setProperty(l,f):typeof f!="number"||f===0||Is.has(l)?l==="float"?o.cssFloat=f:o[l]=(""+f).trim():o[l]=f+"px"}function Yo(o,l,f){if(l!=null&&typeof l!="object")throw Error(r(62));if(o=o.style,f!=null){for(var p in f)!f.hasOwnProperty(p)||l!=null&&l.hasOwnProperty(p)||(p.indexOf("--")===0?o.setProperty(p,""):p==="float"?o.cssFloat="":o[p]="");for(var v in l)p=l[v],l.hasOwnProperty(v)&&f[v]!==p&&bl(o,v,p)}else for(var S in l)l.hasOwnProperty(S)&&bl(o,S,l[S])}function Ti(o){if(o.indexOf("-")===-1)return!1;switch(o){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var xl=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Sl=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function wo(o){return Sl.test(""+o)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":o}function Ur(){}var wl=null;function Cl(o){return o=o.target||o.srcElement||window,o.correspondingUseElement&&(o=o.correspondingUseElement),o.nodeType===3?o.parentNode:o}var Co=null,Ro=null;function Ds(o){var l=Vi(o);if(l&&(o=l.stateNode)){var f=o[Nt]||null;e:switch(o=l.stateNode,l.type){case"input":if(yl(o,f.value,f.defaultValue,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name),l=f.name,f.type==="radio"&&l!=null){for(f=o;f.parentNode;)f=f.parentNode;for(f=f.querySelectorAll('input[name="'+cr(""+l)+'"][type="radio"]'),l=0;l<f.length;l++){var p=f[l];if(p!==o&&p.form===o.form){var v=p[Nt]||null;if(!v)throw Error(r(90));yl(p,v.value,v.defaultValue,v.defaultValue,v.checked,v.defaultChecked,v.type,v.name)}}for(l=0;l<f.length;l++)p=f[l],p.form===o.form&&Wo(p)}break e;case"textarea":vl(o,f.value,f.defaultValue);break e;case"select":l=f.value,l!=null&&hi(o,!!f.multiple,l,!1)}}}var Rl=!1;function Tl(o,l,f){if(Rl)return o(l,f);Rl=!0;try{var p=o(l);return p}finally{if(Rl=!1,(Co!==null||Ro!==null)&&(tp(),Co&&(l=Co,o=Ro,Ro=Co=null,Ds(l),o)))for(l=0;l<o.length;l++)Ds(o[l])}}function je(o,l){var f=o.stateNode;if(f===null)return null;var p=f[Nt]||null;if(p===null)return null;f=p[l];e:switch(l){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(p=!p.disabled)||(o=o.type,p=!(o==="button"||o==="input"||o==="select"||o==="textarea")),o=!p;break e;default:o=!1}if(o)return null;if(f&&typeof f!="function")throw Error(r(231,l,typeof f));return f}var He=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Gt=!1;if(He)try{var jt={};Object.defineProperty(jt,"passive",{get:function(){Gt=!0}}),window.addEventListener("test",jt,jt),window.removeEventListener("test",jt,jt)}catch{Gt=!1}var on=null,er=null,yn=null;function Or(){if(yn)return yn;var o,l=er,f=l.length,p,v="value"in on?on.value:on.textContent,S=v.length;for(o=0;o<f&&l[o]===v[o];o++);var D=f-o;for(p=1;p<=D&&l[f-p]===v[S-p];p++);return yn=v.slice(o,1<p?1-p:void 0)}function $r(o){var l=o.keyCode;return"charCode"in o?(o=o.charCode,o===0&&l===13&&(o=13)):o=l,o===10&&(o=13),32<=o||o===13?o:0}function Ei(){return!0}function El(){return!1}function qr(o){function l(f,p,v,S,D){this._reactName=f,this._targetInst=v,this.type=p,this.nativeEvent=S,this.target=D,this.currentTarget=null;for(var V in o)o.hasOwnProperty(V)&&(f=o[V],this[V]=f?f(S):S[V]);return this.isDefaultPrevented=(S.defaultPrevented!=null?S.defaultPrevented:S.returnValue===!1)?Ei:El,this.isPropagationStopped=El,this}return g(l.prototype,{preventDefault:function(){this.defaultPrevented=!0;var f=this.nativeEvent;f&&(f.preventDefault?f.preventDefault():typeof f.returnValue!="unknown"&&(f.returnValue=!1),this.isDefaultPrevented=Ei)},stopPropagation:function(){var f=this.nativeEvent;f&&(f.stopPropagation?f.stopPropagation():typeof f.cancelBubble!="unknown"&&(f.cancelBubble=!0),this.isPropagationStopped=Ei)},persist:function(){},isPersistent:Ei}),l}var Xo={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(o){return o.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ou=qr(Xo),rf=g({},Xo,{view:0,detail:0}),Ij=qr(rf),Ay,Oy,of,bh=g({},rf,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Iy,button:0,buttons:0,relatedTarget:function(o){return o.relatedTarget===void 0?o.fromElement===o.srcElement?o.toElement:o.fromElement:o.relatedTarget},movementX:function(o){return"movementX"in o?o.movementX:(o!==of&&(of&&o.type==="mousemove"?(Ay=o.screenX-of.screenX,Oy=o.screenY-of.screenY):Oy=Ay=0,of=o),Ay)},movementY:function(o){return"movementY"in o?o.movementY:Oy}}),bC=qr(bh),Dj=g({},bh,{dataTransfer:0}),Pj=qr(Dj),zj=g({},rf,{relatedTarget:0}),ky=qr(zj),Nj=g({},Xo,{animationName:0,elapsedTime:0,pseudoElement:0}),Lj=qr(Nj),Bj=g({},Xo,{clipboardData:function(o){return"clipboardData"in o?o.clipboardData:window.clipboardData}}),jj=qr(Bj),_j=g({},Xo,{data:0}),xC=qr(_j),Hj={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Vj={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Fj={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Uj(o){var l=this.nativeEvent;return l.getModifierState?l.getModifierState(o):(o=Fj[o])?!!l[o]:!1}function Iy(){return Uj}var $j=g({},rf,{key:function(o){if(o.key){var l=Hj[o.key]||o.key;if(l!=="Unidentified")return l}return o.type==="keypress"?(o=$r(o),o===13?"Enter":String.fromCharCode(o)):o.type==="keydown"||o.type==="keyup"?Vj[o.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Iy,charCode:function(o){return o.type==="keypress"?$r(o):0},keyCode:function(o){return o.type==="keydown"||o.type==="keyup"?o.keyCode:0},which:function(o){return o.type==="keypress"?$r(o):o.type==="keydown"||o.type==="keyup"?o.keyCode:0}}),qj=qr($j),Gj=g({},bh,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),SC=qr(Gj),Wj=g({},rf,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Iy}),Kj=qr(Wj),Yj=g({},Xo,{propertyName:0,elapsedTime:0,pseudoElement:0}),Xj=qr(Yj),Qj=g({},bh,{deltaX:function(o){return"deltaX"in o?o.deltaX:"wheelDeltaX"in o?-o.wheelDeltaX:0},deltaY:function(o){return"deltaY"in o?o.deltaY:"wheelDeltaY"in o?-o.wheelDeltaY:"wheelDelta"in o?-o.wheelDelta:0},deltaZ:0,deltaMode:0}),Zj=qr(Qj),Jj=g({},Xo,{newState:0,oldState:0}),e_=qr(Jj),t_=[9,13,27,32],Dy=He&&"CompositionEvent"in window,sf=null;He&&"documentMode"in document&&(sf=document.documentMode);var n_=He&&"TextEvent"in window&&!sf,wC=He&&(!Dy||sf&&8<sf&&11>=sf),CC=" ",RC=!1;function TC(o,l){switch(o){case"keyup":return t_.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function EC(o){return o=o.detail,typeof o=="object"&&"data"in o?o.data:null}var ku=!1;function r_(o,l){switch(o){case"compositionend":return EC(l);case"keypress":return l.which!==32?null:(RC=!0,CC);case"textInput":return o=l.data,o===CC&&RC?null:o;default:return null}}function i_(o,l){if(ku)return o==="compositionend"||!Dy&&TC(o,l)?(o=Or(),yn=er=on=null,ku=!1,o):null;switch(o){case"paste":return null;case"keypress":if(!(l.ctrlKey||l.altKey||l.metaKey)||l.ctrlKey&&l.altKey){if(l.char&&1<l.char.length)return l.char;if(l.which)return String.fromCharCode(l.which)}return null;case"compositionend":return wC&&l.locale!=="ko"?null:l.data;default:return null}}var o_={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function MC(o){var l=o&&o.nodeName&&o.nodeName.toLowerCase();return l==="input"?!!o_[o.type]:l==="textarea"}function AC(o,l,f,p){Co?Ro?Ro.push(p):Ro=[p]:Co=p,l=ap(l,"onChange"),0<l.length&&(f=new Ou("onChange","change",null,f,p),o.push({event:f,listeners:l}))}var lf=null,af=null;function s_(o){cE(o,0)}function xh(o){var l=fi(o);if(Wo(l))return o}function OC(o,l){if(o==="change")return l}var kC=!1;if(He){var Py;if(He){var zy="oninput"in document;if(!zy){var IC=document.createElement("div");IC.setAttribute("oninput","return;"),zy=typeof IC.oninput=="function"}Py=zy}else Py=!1;kC=Py&&(!document.documentMode||9<document.documentMode)}function DC(){lf&&(lf.detachEvent("onpropertychange",PC),af=lf=null)}function PC(o){if(o.propertyName==="value"&&xh(af)){var l=[];AC(l,af,o,Cl(o)),Tl(s_,l)}}function l_(o,l,f){o==="focusin"?(DC(),lf=l,af=f,lf.attachEvent("onpropertychange",PC)):o==="focusout"&&DC()}function a_(o){if(o==="selectionchange"||o==="keyup"||o==="keydown")return xh(af)}function u_(o,l){if(o==="click")return xh(l)}function c_(o,l){if(o==="input"||o==="change")return xh(l)}function f_(o,l){return o===l&&(o!==0||1/o===1/l)||o!==o&&l!==l}var Mi=typeof Object.is=="function"?Object.is:f_;function uf(o,l){if(Mi(o,l))return!0;if(typeof o!="object"||o===null||typeof l!="object"||l===null)return!1;var f=Object.keys(o),p=Object.keys(l);if(f.length!==p.length)return!1;for(p=0;p<f.length;p++){var v=f[p];if(!Me.call(l,v)||!Mi(o[v],l[v]))return!1}return!0}function zC(o){for(;o&&o.firstChild;)o=o.firstChild;return o}function NC(o,l){var f=zC(o);o=0;for(var p;f;){if(f.nodeType===3){if(p=o+f.textContent.length,o<=l&&p>=l)return{node:f,offset:l-o};o=p}e:{for(;f;){if(f.nextSibling){f=f.nextSibling;break e}f=f.parentNode}f=void 0}f=zC(f)}}function LC(o,l){return o&&l?o===l?!0:o&&o.nodeType===3?!1:l&&l.nodeType===3?LC(o,l.parentNode):"contains"in o?o.contains(l):o.compareDocumentPosition?!!(o.compareDocumentPosition(l)&16):!1:!1}function BC(o){o=o!=null&&o.ownerDocument!=null&&o.ownerDocument.defaultView!=null?o.ownerDocument.defaultView:window;for(var l=Os(o.document);l instanceof o.HTMLIFrameElement;){try{var f=typeof l.contentWindow.location.href=="string"}catch{f=!1}if(f)o=l.contentWindow;else break;l=Os(o.document)}return l}function Ny(o){var l=o&&o.nodeName&&o.nodeName.toLowerCase();return l&&(l==="input"&&(o.type==="text"||o.type==="search"||o.type==="tel"||o.type==="url"||o.type==="password")||l==="textarea"||o.contentEditable==="true")}var d_=He&&"documentMode"in document&&11>=document.documentMode,Iu=null,Ly=null,cf=null,By=!1;function jC(o,l,f){var p=f.window===f?f.document:f.nodeType===9?f:f.ownerDocument;By||Iu==null||Iu!==Os(p)||(p=Iu,"selectionStart"in p&&Ny(p)?p={start:p.selectionStart,end:p.selectionEnd}:(p=(p.ownerDocument&&p.ownerDocument.defaultView||window).getSelection(),p={anchorNode:p.anchorNode,anchorOffset:p.anchorOffset,focusNode:p.focusNode,focusOffset:p.focusOffset}),cf&&uf(cf,p)||(cf=p,p=ap(Ly,"onSelect"),0<p.length&&(l=new Ou("onSelect","select",null,l,f),o.push({event:l,listeners:p}),l.target=Iu)))}function Pa(o,l){var f={};return f[o.toLowerCase()]=l.toLowerCase(),f["Webkit"+o]="webkit"+l,f["Moz"+o]="moz"+l,f}var Du={animationend:Pa("Animation","AnimationEnd"),animationiteration:Pa("Animation","AnimationIteration"),animationstart:Pa("Animation","AnimationStart"),transitionrun:Pa("Transition","TransitionRun"),transitionstart:Pa("Transition","TransitionStart"),transitioncancel:Pa("Transition","TransitionCancel"),transitionend:Pa("Transition","TransitionEnd")},jy={},_C={};He&&(_C=document.createElement("div").style,"AnimationEvent"in window||(delete Du.animationend.animation,delete Du.animationiteration.animation,delete Du.animationstart.animation),"TransitionEvent"in window||delete Du.transitionend.transition);function za(o){if(jy[o])return jy[o];if(!Du[o])return o;var l=Du[o],f;for(f in l)if(l.hasOwnProperty(f)&&f in _C)return jy[o]=l[f];return o}var HC=za("animationend"),VC=za("animationiteration"),FC=za("animationstart"),h_=za("transitionrun"),p_=za("transitionstart"),g_=za("transitioncancel"),UC=za("transitionend"),$C=new Map,_y="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");_y.push("scrollEnd");function To(o,l){$C.set(o,l),Fi(l,[o])}var Sh=typeof reportError=="function"?reportError:function(o){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var l=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof o=="object"&&o!==null&&typeof o.message=="string"?String(o.message):String(o),error:o});if(!window.dispatchEvent(l))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",o);return}console.error(o)},qi=[],Pu=0,Hy=0;function wh(){for(var o=Pu,l=Hy=Pu=0;l<o;){var f=qi[l];qi[l++]=null;var p=qi[l];qi[l++]=null;var v=qi[l];qi[l++]=null;var S=qi[l];if(qi[l++]=null,p!==null&&v!==null){var D=p.pending;D===null?v.next=v:(v.next=D.next,D.next=v),p.pending=v}S!==0&&qC(f,v,S)}}function Ch(o,l,f,p){qi[Pu++]=o,qi[Pu++]=l,qi[Pu++]=f,qi[Pu++]=p,Hy|=p,o.lanes|=p,o=o.alternate,o!==null&&(o.lanes|=p)}function Vy(o,l,f,p){return Ch(o,l,f,p),Rh(o)}function Na(o,l){return Ch(o,null,null,l),Rh(o)}function qC(o,l,f){o.lanes|=f;var p=o.alternate;p!==null&&(p.lanes|=f);for(var v=!1,S=o.return;S!==null;)S.childLanes|=f,p=S.alternate,p!==null&&(p.childLanes|=f),S.tag===22&&(o=S.stateNode,o===null||o._visibility&1||(v=!0)),o=S,S=S.return;return o.tag===3?(S=o.stateNode,v&&l!==null&&(v=31-at(f),o=S.hiddenUpdates,p=o[v],p===null?o[v]=[l]:p.push(l),l.lane=f|536870912),S):null}function Rh(o){if(50<Df)throw Df=0,Xv=null,Error(r(185));for(var l=o.return;l!==null;)o=l,l=o.return;return o.tag===3?o.stateNode:null}var zu={};function m_(o,l,f,p){this.tag=o,this.key=f,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=l,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=p,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ai(o,l,f,p){return new m_(o,l,f,p)}function Fy(o){return o=o.prototype,!(!o||!o.isReactComponent)}function Ps(o,l){var f=o.alternate;return f===null?(f=Ai(o.tag,l,o.key,o.mode),f.elementType=o.elementType,f.type=o.type,f.stateNode=o.stateNode,f.alternate=o,o.alternate=f):(f.pendingProps=l,f.type=o.type,f.flags=0,f.subtreeFlags=0,f.deletions=null),f.flags=o.flags&65011712,f.childLanes=o.childLanes,f.lanes=o.lanes,f.child=o.child,f.memoizedProps=o.memoizedProps,f.memoizedState=o.memoizedState,f.updateQueue=o.updateQueue,l=o.dependencies,f.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext},f.sibling=o.sibling,f.index=o.index,f.ref=o.ref,f.refCleanup=o.refCleanup,f}function GC(o,l){o.flags&=65011714;var f=o.alternate;return f===null?(o.childLanes=0,o.lanes=l,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=f.childLanes,o.lanes=f.lanes,o.child=f.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=f.memoizedProps,o.memoizedState=f.memoizedState,o.updateQueue=f.updateQueue,o.type=f.type,l=f.dependencies,o.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext}),o}function Th(o,l,f,p,v,S){var D=0;if(p=o,typeof o=="function")Fy(o)&&(D=1);else if(typeof o=="string")D=SH(o,f,K.current)?26:o==="html"||o==="head"||o==="body"?27:5;else e:switch(o){case L:return o=Ai(31,f,l,v),o.elementType=L,o.lanes=S,o;case x:return La(f.children,v,S,l);case w:D=8,v|=24;break;case C:return o=Ai(12,f,l,v|2),o.elementType=C,o.lanes=S,o;case k:return o=Ai(13,f,l,v),o.elementType=k,o.lanes=S,o;case P:return o=Ai(19,f,l,v),o.elementType=P,o.lanes=S,o;default:if(typeof o=="object"&&o!==null)switch(o.$$typeof){case E:D=10;break e;case T:D=9;break e;case M:D=11;break e;case A:D=14;break e;case I:D=16,p=null;break e}D=29,f=Error(r(130,o===null?"null":typeof o,"")),p=null}return l=Ai(D,f,l,v),l.elementType=o,l.type=p,l.lanes=S,l}function La(o,l,f,p){return o=Ai(7,o,p,l),o.lanes=f,o}function Uy(o,l,f){return o=Ai(6,o,null,l),o.lanes=f,o}function WC(o){var l=Ai(18,null,null,0);return l.stateNode=o,l}function $y(o,l,f){return l=Ai(4,o.children!==null?o.children:[],o.key,l),l.lanes=f,l.stateNode={containerInfo:o.containerInfo,pendingChildren:null,implementation:o.implementation},l}var KC=new WeakMap;function Gi(o,l){if(typeof o=="object"&&o!==null){var f=KC.get(o);return f!==void 0?f:(l={value:o,source:l,stack:_e(l)},KC.set(o,l),l)}return{value:o,source:l,stack:_e(l)}}var Nu=[],Lu=0,Eh=null,ff=0,Wi=[],Ki=0,Ml=null,Qo=1,Zo="";function zs(o,l){Nu[Lu++]=ff,Nu[Lu++]=Eh,Eh=o,ff=l}function YC(o,l,f){Wi[Ki++]=Qo,Wi[Ki++]=Zo,Wi[Ki++]=Ml,Ml=o;var p=Qo;o=Zo;var v=32-at(p)-1;p&=~(1<<v),f+=1;var S=32-at(l)+v;if(30<S){var D=v-v%5;S=(p&(1<<D)-1).toString(32),p>>=D,v-=D,Qo=1<<32-at(l)+v|f<<v|p,Zo=S+o}else Qo=1<<S|f<<v|p,Zo=o}function qy(o){o.return!==null&&(zs(o,1),YC(o,1,0))}function Gy(o){for(;o===Eh;)Eh=Nu[--Lu],Nu[Lu]=null,ff=Nu[--Lu],Nu[Lu]=null;for(;o===Ml;)Ml=Wi[--Ki],Wi[Ki]=null,Zo=Wi[--Ki],Wi[Ki]=null,Qo=Wi[--Ki],Wi[Ki]=null}function XC(o,l){Wi[Ki++]=Qo,Wi[Ki++]=Zo,Wi[Ki++]=Ml,Qo=l.id,Zo=l.overflow,Ml=o}var kr=null,Dn=null,Ft=!1,Al=null,Yi=!1,Wy=Error(r(519));function Ol(o){var l=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw df(Gi(l,o)),Wy}function QC(o){var l=o.stateNode,f=o.type,p=o.memoizedProps;switch(l[zt]=o,l[Nt]=p,f){case"dialog":Bt("cancel",l),Bt("close",l);break;case"iframe":case"object":case"embed":Bt("load",l);break;case"video":case"audio":for(f=0;f<zf.length;f++)Bt(zf[f],l);break;case"source":Bt("error",l);break;case"img":case"image":case"link":Bt("error",l),Bt("load",l);break;case"details":Bt("toggle",l);break;case"input":Bt("invalid",l),Da(l,p.value,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name,!0);break;case"select":Bt("invalid",l);break;case"textarea":Bt("invalid",l),Ko(l,p.value,p.defaultValue,p.children)}f=p.children,typeof f!="string"&&typeof f!="number"&&typeof f!="bigint"||l.textContent===""+f||p.suppressHydrationWarning===!0||pE(l.textContent,f)?(p.popover!=null&&(Bt("beforetoggle",l),Bt("toggle",l)),p.onScroll!=null&&Bt("scroll",l),p.onScrollEnd!=null&&Bt("scrollend",l),p.onClick!=null&&(l.onclick=Ur),l=!0):l=!1,l||Ol(o,!0)}function ZC(o){for(kr=o.return;kr;)switch(kr.tag){case 5:case 31:case 13:Yi=!1;return;case 27:case 3:Yi=!0;return;default:kr=kr.return}}function Bu(o){if(o!==kr)return!1;if(!Ft)return ZC(o),Ft=!0,!1;var l=o.tag,f;if((f=l!==3&&l!==27)&&((f=l===5)&&(f=o.type,f=!(f!=="form"&&f!=="button")||f0(o.type,o.memoizedProps)),f=!f),f&&Dn&&Ol(o),ZC(o),l===13){if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(r(317));Dn=CE(o)}else if(l===31){if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(r(317));Dn=CE(o)}else l===27?(l=Dn,Ul(o.type)?(o=m0,m0=null,Dn=o):Dn=l):Dn=kr?Qi(o.stateNode.nextSibling):null;return!0}function Ba(){Dn=kr=null,Ft=!1}function Ky(){var o=Al;return o!==null&&(yi===null?yi=o:yi.push.apply(yi,o),Al=null),o}function df(o){Al===null?Al=[o]:Al.push(o)}var Yy=z(null),ja=null,Ns=null;function kl(o,l,f){W(Yy,l._currentValue),l._currentValue=f}function Ls(o){o._currentValue=Yy.current,$(Yy)}function Xy(o,l,f){for(;o!==null;){var p=o.alternate;if((o.childLanes&l)!==l?(o.childLanes|=l,p!==null&&(p.childLanes|=l)):p!==null&&(p.childLanes&l)!==l&&(p.childLanes|=l),o===f)break;o=o.return}}function Qy(o,l,f,p){var v=o.child;for(v!==null&&(v.return=o);v!==null;){var S=v.dependencies;if(S!==null){var D=v.child;S=S.firstContext;e:for(;S!==null;){var V=S;S=v;for(var Q=0;Q<l.length;Q++)if(V.context===l[Q]){S.lanes|=f,V=S.alternate,V!==null&&(V.lanes|=f),Xy(S.return,f,o),p||(D=null);break e}S=V.next}}else if(v.tag===18){if(D=v.return,D===null)throw Error(r(341));D.lanes|=f,S=D.alternate,S!==null&&(S.lanes|=f),Xy(D,f,o),D=null}else D=v.child;if(D!==null)D.return=v;else for(D=v;D!==null;){if(D===o){D=null;break}if(v=D.sibling,v!==null){v.return=D.return,D=v;break}D=D.return}v=D}}function ju(o,l,f,p){o=null;for(var v=l,S=!1;v!==null;){if(!S){if((v.flags&524288)!==0)S=!0;else if((v.flags&262144)!==0)break}if(v.tag===10){var D=v.alternate;if(D===null)throw Error(r(387));if(D=D.memoizedProps,D!==null){var V=v.type;Mi(v.pendingProps.value,D.value)||(o!==null?o.push(V):o=[V])}}else if(v===ae.current){if(D=v.alternate,D===null)throw Error(r(387));D.memoizedState.memoizedState!==v.memoizedState.memoizedState&&(o!==null?o.push(_f):o=[_f])}v=v.return}o!==null&&Qy(l,o,f,p),l.flags|=262144}function Mh(o){for(o=o.firstContext;o!==null;){if(!Mi(o.context._currentValue,o.memoizedValue))return!0;o=o.next}return!1}function _a(o){ja=o,Ns=null,o=o.dependencies,o!==null&&(o.firstContext=null)}function Ir(o){return JC(ja,o)}function Ah(o,l){return ja===null&&_a(o),JC(o,l)}function JC(o,l){var f=l._currentValue;if(l={context:l,memoizedValue:f,next:null},Ns===null){if(o===null)throw Error(r(308));Ns=l,o.dependencies={lanes:0,firstContext:l},o.flags|=524288}else Ns=Ns.next=l;return f}var y_=typeof AbortController<"u"?AbortController:function(){var o=[],l=this.signal={aborted:!1,addEventListener:function(f,p){o.push(p)}};this.abort=function(){l.aborted=!0,o.forEach(function(f){return f()})}},v_=t.unstable_scheduleCallback,b_=t.unstable_NormalPriority,fr={$$typeof:E,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Zy(){return{controller:new y_,data:new Map,refCount:0}}function hf(o){o.refCount--,o.refCount===0&&v_(b_,function(){o.controller.abort()})}var pf=null,Jy=0,_u=0,Hu=null;function x_(o,l){if(pf===null){var f=pf=[];Jy=0,_u=n0(),Hu={status:"pending",value:void 0,then:function(p){f.push(p)}}}return Jy++,l.then(eR,eR),l}function eR(){if(--Jy===0&&pf!==null){Hu!==null&&(Hu.status="fulfilled");var o=pf;pf=null,_u=0,Hu=null;for(var l=0;l<o.length;l++)(0,o[l])()}}function S_(o,l){var f=[],p={status:"pending",value:null,reason:null,then:function(v){f.push(v)}};return o.then(function(){p.status="fulfilled",p.value=l;for(var v=0;v<f.length;v++)(0,f[v])(l)},function(v){for(p.status="rejected",p.reason=v,v=0;v<f.length;v++)(0,f[v])(void 0)}),p}var tR=B.S;B.S=function(o,l){jT=J(),typeof l=="object"&&l!==null&&typeof l.then=="function"&&x_(o,l),tR!==null&&tR(o,l)};var Ha=z(null);function ev(){var o=Ha.current;return o!==null?o:En.pooledCache}function Oh(o,l){l===null?W(Ha,Ha.current):W(Ha,l.pool)}function nR(){var o=ev();return o===null?null:{parent:fr._currentValue,pool:o}}var Vu=Error(r(460)),tv=Error(r(474)),kh=Error(r(542)),Ih={then:function(){}};function rR(o){return o=o.status,o==="fulfilled"||o==="rejected"}function iR(o,l,f){switch(f=o[f],f===void 0?o.push(l):f!==l&&(l.then(Ur,Ur),l=f),l.status){case"fulfilled":return l.value;case"rejected":throw o=l.reason,sR(o),o;default:if(typeof l.status=="string")l.then(Ur,Ur);else{if(o=En,o!==null&&100<o.shellSuspendCounter)throw Error(r(482));o=l,o.status="pending",o.then(function(p){if(l.status==="pending"){var v=l;v.status="fulfilled",v.value=p}},function(p){if(l.status==="pending"){var v=l;v.status="rejected",v.reason=p}})}switch(l.status){case"fulfilled":return l.value;case"rejected":throw o=l.reason,sR(o),o}throw Fa=l,Vu}}function Va(o){try{var l=o._init;return l(o._payload)}catch(f){throw f!==null&&typeof f=="object"&&typeof f.then=="function"?(Fa=f,Vu):f}}var Fa=null;function oR(){if(Fa===null)throw Error(r(459));var o=Fa;return Fa=null,o}function sR(o){if(o===Vu||o===kh)throw Error(r(483))}var Fu=null,gf=0;function Dh(o){var l=gf;return gf+=1,Fu===null&&(Fu=[]),iR(Fu,o,l)}function mf(o,l){l=l.props.ref,o.ref=l!==void 0?l:null}function Ph(o,l){throw l.$$typeof===m?Error(r(525)):(o=Object.prototype.toString.call(l),Error(r(31,o==="[object Object]"?"object with keys {"+Object.keys(l).join(", ")+"}":o)))}function lR(o){function l(re,te){if(o){var ue=re.deletions;ue===null?(re.deletions=[te],re.flags|=16):ue.push(te)}}function f(re,te){if(!o)return null;for(;te!==null;)l(re,te),te=te.sibling;return null}function p(re){for(var te=new Map;re!==null;)re.key!==null?te.set(re.key,re):te.set(re.index,re),re=re.sibling;return te}function v(re,te){return re=Ps(re,te),re.index=0,re.sibling=null,re}function S(re,te,ue){return re.index=ue,o?(ue=re.alternate,ue!==null?(ue=ue.index,ue<te?(re.flags|=67108866,te):ue):(re.flags|=67108866,te)):(re.flags|=1048576,te)}function D(re){return o&&re.alternate===null&&(re.flags|=67108866),re}function V(re,te,ue,Ce){return te===null||te.tag!==6?(te=Uy(ue,re.mode,Ce),te.return=re,te):(te=v(te,ue),te.return=re,te)}function Q(re,te,ue,Ce){var it=ue.type;return it===x?be(re,te,ue.props.children,Ce,ue.key):te!==null&&(te.elementType===it||typeof it=="object"&&it!==null&&it.$$typeof===I&&Va(it)===te.type)?(te=v(te,ue.props),mf(te,ue),te.return=re,te):(te=Th(ue.type,ue.key,ue.props,null,re.mode,Ce),mf(te,ue),te.return=re,te)}function ce(re,te,ue,Ce){return te===null||te.tag!==4||te.stateNode.containerInfo!==ue.containerInfo||te.stateNode.implementation!==ue.implementation?(te=$y(ue,re.mode,Ce),te.return=re,te):(te=v(te,ue.children||[]),te.return=re,te)}function be(re,te,ue,Ce,it){return te===null||te.tag!==7?(te=La(ue,re.mode,Ce,it),te.return=re,te):(te=v(te,ue),te.return=re,te)}function Re(re,te,ue){if(typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint")return te=Uy(""+te,re.mode,ue),te.return=re,te;if(typeof te=="object"&&te!==null){switch(te.$$typeof){case y:return ue=Th(te.type,te.key,te.props,null,re.mode,ue),mf(ue,te),ue.return=re,ue;case b:return te=$y(te,re.mode,ue),te.return=re,te;case I:return te=Va(te),Re(re,te,ue)}if(G(te)||_(te))return te=La(te,re.mode,ue,null),te.return=re,te;if(typeof te.then=="function")return Re(re,Dh(te),ue);if(te.$$typeof===E)return Re(re,Ah(re,te),ue);Ph(re,te)}return null}function fe(re,te,ue,Ce){var it=te!==null?te.key:null;if(typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint")return it!==null?null:V(re,te,""+ue,Ce);if(typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case y:return ue.key===it?Q(re,te,ue,Ce):null;case b:return ue.key===it?ce(re,te,ue,Ce):null;case I:return ue=Va(ue),fe(re,te,ue,Ce)}if(G(ue)||_(ue))return it!==null?null:be(re,te,ue,Ce,null);if(typeof ue.then=="function")return fe(re,te,Dh(ue),Ce);if(ue.$$typeof===E)return fe(re,te,Ah(re,ue),Ce);Ph(re,ue)}return null}function ge(re,te,ue,Ce,it){if(typeof Ce=="string"&&Ce!==""||typeof Ce=="number"||typeof Ce=="bigint")return re=re.get(ue)||null,V(te,re,""+Ce,it);if(typeof Ce=="object"&&Ce!==null){switch(Ce.$$typeof){case y:return re=re.get(Ce.key===null?ue:Ce.key)||null,Q(te,re,Ce,it);case b:return re=re.get(Ce.key===null?ue:Ce.key)||null,ce(te,re,Ce,it);case I:return Ce=Va(Ce),ge(re,te,ue,Ce,it)}if(G(Ce)||_(Ce))return re=re.get(ue)||null,be(te,re,Ce,it,null);if(typeof Ce.then=="function")return ge(re,te,ue,Dh(Ce),it);if(Ce.$$typeof===E)return ge(re,te,ue,Ah(te,Ce),it);Ph(te,Ce)}return null}function Xe(re,te,ue,Ce){for(var it=null,Qt=null,Je=te,Et=te=0,Ht=null;Je!==null&&Et<ue.length;Et++){Je.index>Et?(Ht=Je,Je=null):Ht=Je.sibling;var Zt=fe(re,Je,ue[Et],Ce);if(Zt===null){Je===null&&(Je=Ht);break}o&&Je&&Zt.alternate===null&&l(re,Je),te=S(Zt,te,Et),Qt===null?it=Zt:Qt.sibling=Zt,Qt=Zt,Je=Ht}if(Et===ue.length)return f(re,Je),Ft&&zs(re,Et),it;if(Je===null){for(;Et<ue.length;Et++)Je=Re(re,ue[Et],Ce),Je!==null&&(te=S(Je,te,Et),Qt===null?it=Je:Qt.sibling=Je,Qt=Je);return Ft&&zs(re,Et),it}for(Je=p(Je);Et<ue.length;Et++)Ht=ge(Je,re,Et,ue[Et],Ce),Ht!==null&&(o&&Ht.alternate!==null&&Je.delete(Ht.key===null?Et:Ht.key),te=S(Ht,te,Et),Qt===null?it=Ht:Qt.sibling=Ht,Qt=Ht);return o&&Je.forEach(function(Kl){return l(re,Kl)}),Ft&&zs(re,Et),it}function ut(re,te,ue,Ce){if(ue==null)throw Error(r(151));for(var it=null,Qt=null,Je=te,Et=te=0,Ht=null,Zt=ue.next();Je!==null&&!Zt.done;Et++,Zt=ue.next()){Je.index>Et?(Ht=Je,Je=null):Ht=Je.sibling;var Kl=fe(re,Je,Zt.value,Ce);if(Kl===null){Je===null&&(Je=Ht);break}o&&Je&&Kl.alternate===null&&l(re,Je),te=S(Kl,te,Et),Qt===null?it=Kl:Qt.sibling=Kl,Qt=Kl,Je=Ht}if(Zt.done)return f(re,Je),Ft&&zs(re,Et),it;if(Je===null){for(;!Zt.done;Et++,Zt=ue.next())Zt=Re(re,Zt.value,Ce),Zt!==null&&(te=S(Zt,te,Et),Qt===null?it=Zt:Qt.sibling=Zt,Qt=Zt);return Ft&&zs(re,Et),it}for(Je=p(Je);!Zt.done;Et++,Zt=ue.next())Zt=ge(Je,re,Et,Zt.value,Ce),Zt!==null&&(o&&Zt.alternate!==null&&Je.delete(Zt.key===null?Et:Zt.key),te=S(Zt,te,Et),Qt===null?it=Zt:Qt.sibling=Zt,Qt=Zt);return o&&Je.forEach(function(DH){return l(re,DH)}),Ft&&zs(re,Et),it}function xn(re,te,ue,Ce){if(typeof ue=="object"&&ue!==null&&ue.type===x&&ue.key===null&&(ue=ue.props.children),typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case y:e:{for(var it=ue.key;te!==null;){if(te.key===it){if(it=ue.type,it===x){if(te.tag===7){f(re,te.sibling),Ce=v(te,ue.props.children),Ce.return=re,re=Ce;break e}}else if(te.elementType===it||typeof it=="object"&&it!==null&&it.$$typeof===I&&Va(it)===te.type){f(re,te.sibling),Ce=v(te,ue.props),mf(Ce,ue),Ce.return=re,re=Ce;break e}f(re,te);break}else l(re,te);te=te.sibling}ue.type===x?(Ce=La(ue.props.children,re.mode,Ce,ue.key),Ce.return=re,re=Ce):(Ce=Th(ue.type,ue.key,ue.props,null,re.mode,Ce),mf(Ce,ue),Ce.return=re,re=Ce)}return D(re);case b:e:{for(it=ue.key;te!==null;){if(te.key===it)if(te.tag===4&&te.stateNode.containerInfo===ue.containerInfo&&te.stateNode.implementation===ue.implementation){f(re,te.sibling),Ce=v(te,ue.children||[]),Ce.return=re,re=Ce;break e}else{f(re,te);break}else l(re,te);te=te.sibling}Ce=$y(ue,re.mode,Ce),Ce.return=re,re=Ce}return D(re);case I:return ue=Va(ue),xn(re,te,ue,Ce)}if(G(ue))return Xe(re,te,ue,Ce);if(_(ue)){if(it=_(ue),typeof it!="function")throw Error(r(150));return ue=it.call(ue),ut(re,te,ue,Ce)}if(typeof ue.then=="function")return xn(re,te,Dh(ue),Ce);if(ue.$$typeof===E)return xn(re,te,Ah(re,ue),Ce);Ph(re,ue)}return typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint"?(ue=""+ue,te!==null&&te.tag===6?(f(re,te.sibling),Ce=v(te,ue),Ce.return=re,re=Ce):(f(re,te),Ce=Uy(ue,re.mode,Ce),Ce.return=re,re=Ce),D(re)):f(re,te)}return function(re,te,ue,Ce){try{gf=0;var it=xn(re,te,ue,Ce);return Fu=null,it}catch(Je){if(Je===Vu||Je===kh)throw Je;var Qt=Ai(29,Je,null,re.mode);return Qt.lanes=Ce,Qt.return=re,Qt}}}var Ua=lR(!0),aR=lR(!1),Il=!1;function nv(o){o.updateQueue={baseState:o.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function rv(o,l){o=o.updateQueue,l.updateQueue===o&&(l.updateQueue={baseState:o.baseState,firstBaseUpdate:o.firstBaseUpdate,lastBaseUpdate:o.lastBaseUpdate,shared:o.shared,callbacks:null})}function Dl(o){return{lane:o,tag:0,payload:null,callback:null,next:null}}function Pl(o,l,f){var p=o.updateQueue;if(p===null)return null;if(p=p.shared,(sn&2)!==0){var v=p.pending;return v===null?l.next=l:(l.next=v.next,v.next=l),p.pending=l,l=Rh(o),qC(o,null,f),l}return Ch(o,p,l,f),Rh(o)}function yf(o,l,f){if(l=l.updateQueue,l!==null&&(l=l.shared,(f&4194048)!==0)){var p=l.lanes;p&=o.pendingLanes,f|=p,l.lanes=f,ar(o,f)}}function iv(o,l){var f=o.updateQueue,p=o.alternate;if(p!==null&&(p=p.updateQueue,f===p)){var v=null,S=null;if(f=f.firstBaseUpdate,f!==null){do{var D={lane:f.lane,tag:f.tag,payload:f.payload,callback:null,next:null};S===null?v=S=D:S=S.next=D,f=f.next}while(f!==null);S===null?v=S=l:S=S.next=l}else v=S=l;f={baseState:p.baseState,firstBaseUpdate:v,lastBaseUpdate:S,shared:p.shared,callbacks:p.callbacks},o.updateQueue=f;return}o=f.lastBaseUpdate,o===null?f.firstBaseUpdate=l:o.next=l,f.lastBaseUpdate=l}var ov=!1;function vf(){if(ov){var o=Hu;if(o!==null)throw o}}function bf(o,l,f,p){ov=!1;var v=o.updateQueue;Il=!1;var S=v.firstBaseUpdate,D=v.lastBaseUpdate,V=v.shared.pending;if(V!==null){v.shared.pending=null;var Q=V,ce=Q.next;Q.next=null,D===null?S=ce:D.next=ce,D=Q;var be=o.alternate;be!==null&&(be=be.updateQueue,V=be.lastBaseUpdate,V!==D&&(V===null?be.firstBaseUpdate=ce:V.next=ce,be.lastBaseUpdate=Q))}if(S!==null){var Re=v.baseState;D=0,be=ce=Q=null,V=S;do{var fe=V.lane&-536870913,ge=fe!==V.lane;if(ge?(_t&fe)===fe:(p&fe)===fe){fe!==0&&fe===_u&&(ov=!0),be!==null&&(be=be.next={lane:0,tag:V.tag,payload:V.payload,callback:null,next:null});e:{var Xe=o,ut=V;fe=l;var xn=f;switch(ut.tag){case 1:if(Xe=ut.payload,typeof Xe=="function"){Re=Xe.call(xn,Re,fe);break e}Re=Xe;break e;case 3:Xe.flags=Xe.flags&-65537|128;case 0:if(Xe=ut.payload,fe=typeof Xe=="function"?Xe.call(xn,Re,fe):Xe,fe==null)break e;Re=g({},Re,fe);break e;case 2:Il=!0}}fe=V.callback,fe!==null&&(o.flags|=64,ge&&(o.flags|=8192),ge=v.callbacks,ge===null?v.callbacks=[fe]:ge.push(fe))}else ge={lane:fe,tag:V.tag,payload:V.payload,callback:V.callback,next:null},be===null?(ce=be=ge,Q=Re):be=be.next=ge,D|=fe;if(V=V.next,V===null){if(V=v.shared.pending,V===null)break;ge=V,V=ge.next,ge.next=null,v.lastBaseUpdate=ge,v.shared.pending=null}}while(!0);be===null&&(Q=Re),v.baseState=Q,v.firstBaseUpdate=ce,v.lastBaseUpdate=be,S===null&&(v.shared.lanes=0),jl|=D,o.lanes=D,o.memoizedState=Re}}function uR(o,l){if(typeof o!="function")throw Error(r(191,o));o.call(l)}function cR(o,l){var f=o.callbacks;if(f!==null)for(o.callbacks=null,o=0;o<f.length;o++)uR(f[o],l)}var Uu=z(null),zh=z(0);function fR(o,l){o=qs,W(zh,o),W(Uu,l),qs=o|l.baseLanes}function sv(){W(zh,qs),W(Uu,Uu.current)}function lv(){qs=zh.current,$(Uu),$(zh)}var Oi=z(null),Xi=null;function zl(o){var l=o.alternate;W(tr,tr.current&1),W(Oi,o),Xi===null&&(l===null||Uu.current!==null||l.memoizedState!==null)&&(Xi=o)}function av(o){W(tr,tr.current),W(Oi,o),Xi===null&&(Xi=o)}function dR(o){o.tag===22?(W(tr,tr.current),W(Oi,o),Xi===null&&(Xi=o)):Nl()}function Nl(){W(tr,tr.current),W(Oi,Oi.current)}function ki(o){$(Oi),Xi===o&&(Xi=null),$(tr)}var tr=z(0);function Nh(o){for(var l=o;l!==null;){if(l.tag===13){var f=l.memoizedState;if(f!==null&&(f=f.dehydrated,f===null||p0(f)||g0(f)))return l}else if(l.tag===19&&(l.memoizedProps.revealOrder==="forwards"||l.memoizedProps.revealOrder==="backwards"||l.memoizedProps.revealOrder==="unstable_legacy-backwards"||l.memoizedProps.revealOrder==="together")){if((l.flags&128)!==0)return l}else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===o)break;for(;l.sibling===null;){if(l.return===null||l.return===o)return null;l=l.return}l.sibling.return=l.return,l=l.sibling}return null}var Bs=0,Rt=null,vn=null,dr=null,Lh=!1,$u=!1,$a=!1,Bh=0,xf=0,qu=null,w_=0;function Wn(){throw Error(r(321))}function uv(o,l){if(l===null)return!1;for(var f=0;f<l.length&&f<o.length;f++)if(!Mi(o[f],l[f]))return!1;return!0}function cv(o,l,f,p,v,S){return Bs=S,Rt=l,l.memoizedState=null,l.updateQueue=null,l.lanes=0,B.H=o===null||o.memoizedState===null?YR:Tv,$a=!1,S=f(p,v),$a=!1,$u&&(S=pR(l,f,p,v)),hR(o),S}function hR(o){B.H=Cf;var l=vn!==null&&vn.next!==null;if(Bs=0,dr=vn=Rt=null,Lh=!1,xf=0,qu=null,l)throw Error(r(300));o===null||hr||(o=o.dependencies,o!==null&&Mh(o)&&(hr=!0))}function pR(o,l,f,p){Rt=o;var v=0;do{if($u&&(qu=null),xf=0,$u=!1,25<=v)throw Error(r(301));if(v+=1,dr=vn=null,o.updateQueue!=null){var S=o.updateQueue;S.lastEffect=null,S.events=null,S.stores=null,S.memoCache!=null&&(S.memoCache.index=0)}B.H=XR,S=l(f,p)}while($u);return S}function C_(){var o=B.H,l=o.useState()[0];return l=typeof l.then=="function"?Sf(l):l,o=o.useState()[0],(vn!==null?vn.memoizedState:null)!==o&&(Rt.flags|=1024),l}function fv(){var o=Bh!==0;return Bh=0,o}function dv(o,l,f){l.updateQueue=o.updateQueue,l.flags&=-2053,o.lanes&=~f}function hv(o){if(Lh){for(o=o.memoizedState;o!==null;){var l=o.queue;l!==null&&(l.pending=null),o=o.next}Lh=!1}Bs=0,dr=vn=Rt=null,$u=!1,xf=Bh=0,qu=null}function ii(){var o={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return dr===null?Rt.memoizedState=dr=o:dr=dr.next=o,dr}function nr(){if(vn===null){var o=Rt.alternate;o=o!==null?o.memoizedState:null}else o=vn.next;var l=dr===null?Rt.memoizedState:dr.next;if(l!==null)dr=l,vn=o;else{if(o===null)throw Rt.alternate===null?Error(r(467)):Error(r(310));vn=o,o={memoizedState:vn.memoizedState,baseState:vn.baseState,baseQueue:vn.baseQueue,queue:vn.queue,next:null},dr===null?Rt.memoizedState=dr=o:dr=dr.next=o}return dr}function jh(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Sf(o){var l=xf;return xf+=1,qu===null&&(qu=[]),o=iR(qu,o,l),l=Rt,(dr===null?l.memoizedState:dr.next)===null&&(l=l.alternate,B.H=l===null||l.memoizedState===null?YR:Tv),o}function _h(o){if(o!==null&&typeof o=="object"){if(typeof o.then=="function")return Sf(o);if(o.$$typeof===E)return Ir(o)}throw Error(r(438,String(o)))}function pv(o){var l=null,f=Rt.updateQueue;if(f!==null&&(l=f.memoCache),l==null){var p=Rt.alternate;p!==null&&(p=p.updateQueue,p!==null&&(p=p.memoCache,p!=null&&(l={data:p.data.map(function(v){return v.slice()}),index:0})))}if(l==null&&(l={data:[],index:0}),f===null&&(f=jh(),Rt.updateQueue=f),f.memoCache=l,f=l.data[l.index],f===void 0)for(f=l.data[l.index]=Array(o),p=0;p<o;p++)f[p]=j;return l.index++,f}function js(o,l){return typeof l=="function"?l(o):l}function Hh(o){var l=nr();return gv(l,vn,o)}function gv(o,l,f){var p=o.queue;if(p===null)throw Error(r(311));p.lastRenderedReducer=f;var v=o.baseQueue,S=p.pending;if(S!==null){if(v!==null){var D=v.next;v.next=S.next,S.next=D}l.baseQueue=v=S,p.pending=null}if(S=o.baseState,v===null)o.memoizedState=S;else{l=v.next;var V=D=null,Q=null,ce=l,be=!1;do{var Re=ce.lane&-536870913;if(Re!==ce.lane?(_t&Re)===Re:(Bs&Re)===Re){var fe=ce.revertLane;if(fe===0)Q!==null&&(Q=Q.next={lane:0,revertLane:0,gesture:null,action:ce.action,hasEagerState:ce.hasEagerState,eagerState:ce.eagerState,next:null}),Re===_u&&(be=!0);else if((Bs&fe)===fe){ce=ce.next,fe===_u&&(be=!0);continue}else Re={lane:0,revertLane:ce.revertLane,gesture:null,action:ce.action,hasEagerState:ce.hasEagerState,eagerState:ce.eagerState,next:null},Q===null?(V=Q=Re,D=S):Q=Q.next=Re,Rt.lanes|=fe,jl|=fe;Re=ce.action,$a&&f(S,Re),S=ce.hasEagerState?ce.eagerState:f(S,Re)}else fe={lane:Re,revertLane:ce.revertLane,gesture:ce.gesture,action:ce.action,hasEagerState:ce.hasEagerState,eagerState:ce.eagerState,next:null},Q===null?(V=Q=fe,D=S):Q=Q.next=fe,Rt.lanes|=Re,jl|=Re;ce=ce.next}while(ce!==null&&ce!==l);if(Q===null?D=S:Q.next=V,!Mi(S,o.memoizedState)&&(hr=!0,be&&(f=Hu,f!==null)))throw f;o.memoizedState=S,o.baseState=D,o.baseQueue=Q,p.lastRenderedState=S}return v===null&&(p.lanes=0),[o.memoizedState,p.dispatch]}function mv(o){var l=nr(),f=l.queue;if(f===null)throw Error(r(311));f.lastRenderedReducer=o;var p=f.dispatch,v=f.pending,S=l.memoizedState;if(v!==null){f.pending=null;var D=v=v.next;do S=o(S,D.action),D=D.next;while(D!==v);Mi(S,l.memoizedState)||(hr=!0),l.memoizedState=S,l.baseQueue===null&&(l.baseState=S),f.lastRenderedState=S}return[S,p]}function gR(o,l,f){var p=Rt,v=nr(),S=Ft;if(S){if(f===void 0)throw Error(r(407));f=f()}else f=l();var D=!Mi((vn||v).memoizedState,f);if(D&&(v.memoizedState=f,hr=!0),v=v.queue,bv(vR.bind(null,p,v,o),[o]),v.getSnapshot!==l||D||dr!==null&&dr.memoizedState.tag&1){if(p.flags|=2048,Gu(9,{destroy:void 0},yR.bind(null,p,v,f,l),null),En===null)throw Error(r(349));S||(Bs&127)!==0||mR(p,l,f)}return f}function mR(o,l,f){o.flags|=16384,o={getSnapshot:l,value:f},l=Rt.updateQueue,l===null?(l=jh(),Rt.updateQueue=l,l.stores=[o]):(f=l.stores,f===null?l.stores=[o]:f.push(o))}function yR(o,l,f,p){l.value=f,l.getSnapshot=p,bR(l)&&xR(o)}function vR(o,l,f){return f(function(){bR(l)&&xR(o)})}function bR(o){var l=o.getSnapshot;o=o.value;try{var f=l();return!Mi(o,f)}catch{return!0}}function xR(o){var l=Na(o,2);l!==null&&vi(l,o,2)}function yv(o){var l=ii();if(typeof o=="function"){var f=o;if(o=f(),$a){Wt(!0);try{f()}finally{Wt(!1)}}}return l.memoizedState=l.baseState=o,l.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:js,lastRenderedState:o},l}function SR(o,l,f,p){return o.baseState=f,gv(o,vn,typeof p=="function"?p:js)}function R_(o,l,f,p,v){if(Uh(o))throw Error(r(485));if(o=l.action,o!==null){var S={payload:v,action:o,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(D){S.listeners.push(D)}};B.T!==null?f(!0):S.isTransition=!1,p(S),f=l.pending,f===null?(S.next=l.pending=S,wR(l,S)):(S.next=f.next,l.pending=f.next=S)}}function wR(o,l){var f=l.action,p=l.payload,v=o.state;if(l.isTransition){var S=B.T,D={};B.T=D;try{var V=f(v,p),Q=B.S;Q!==null&&Q(D,V),CR(o,l,V)}catch(ce){vv(o,l,ce)}finally{S!==null&&D.types!==null&&(S.types=D.types),B.T=S}}else try{S=f(v,p),CR(o,l,S)}catch(ce){vv(o,l,ce)}}function CR(o,l,f){f!==null&&typeof f=="object"&&typeof f.then=="function"?f.then(function(p){RR(o,l,p)},function(p){return vv(o,l,p)}):RR(o,l,f)}function RR(o,l,f){l.status="fulfilled",l.value=f,TR(l),o.state=f,l=o.pending,l!==null&&(f=l.next,f===l?o.pending=null:(f=f.next,l.next=f,wR(o,f)))}function vv(o,l,f){var p=o.pending;if(o.pending=null,p!==null){p=p.next;do l.status="rejected",l.reason=f,TR(l),l=l.next;while(l!==p)}o.action=null}function TR(o){o=o.listeners;for(var l=0;l<o.length;l++)(0,o[l])()}function ER(o,l){return l}function MR(o,l){if(Ft){var f=En.formState;if(f!==null){e:{var p=Rt;if(Ft){if(Dn){t:{for(var v=Dn,S=Yi;v.nodeType!==8;){if(!S){v=null;break t}if(v=Qi(v.nextSibling),v===null){v=null;break t}}S=v.data,v=S==="F!"||S==="F"?v:null}if(v){Dn=Qi(v.nextSibling),p=v.data==="F!";break e}}Ol(p)}p=!1}p&&(l=f[0])}}return f=ii(),f.memoizedState=f.baseState=l,p={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ER,lastRenderedState:l},f.queue=p,f=GR.bind(null,Rt,p),p.dispatch=f,p=yv(!1),S=Rv.bind(null,Rt,!1,p.queue),p=ii(),v={state:l,dispatch:null,action:o,pending:null},p.queue=v,f=R_.bind(null,Rt,v,S,f),v.dispatch=f,p.memoizedState=o,[l,f,!1]}function AR(o){var l=nr();return OR(l,vn,o)}function OR(o,l,f){if(l=gv(o,l,ER)[0],o=Hh(js)[0],typeof l=="object"&&l!==null&&typeof l.then=="function")try{var p=Sf(l)}catch(D){throw D===Vu?kh:D}else p=l;l=nr();var v=l.queue,S=v.dispatch;return f!==l.memoizedState&&(Rt.flags|=2048,Gu(9,{destroy:void 0},T_.bind(null,v,f),null)),[p,S,o]}function T_(o,l){o.action=l}function kR(o){var l=nr(),f=vn;if(f!==null)return OR(l,f,o);nr(),l=l.memoizedState,f=nr();var p=f.queue.dispatch;return f.memoizedState=o,[l,p,!1]}function Gu(o,l,f,p){return o={tag:o,create:f,deps:p,inst:l,next:null},l=Rt.updateQueue,l===null&&(l=jh(),Rt.updateQueue=l),f=l.lastEffect,f===null?l.lastEffect=o.next=o:(p=f.next,f.next=o,o.next=p,l.lastEffect=o),o}function IR(){return nr().memoizedState}function Vh(o,l,f,p){var v=ii();Rt.flags|=o,v.memoizedState=Gu(1|l,{destroy:void 0},f,p===void 0?null:p)}function Fh(o,l,f,p){var v=nr();p=p===void 0?null:p;var S=v.memoizedState.inst;vn!==null&&p!==null&&uv(p,vn.memoizedState.deps)?v.memoizedState=Gu(l,S,f,p):(Rt.flags|=o,v.memoizedState=Gu(1|l,S,f,p))}function DR(o,l){Vh(8390656,8,o,l)}function bv(o,l){Fh(2048,8,o,l)}function E_(o){Rt.flags|=4;var l=Rt.updateQueue;if(l===null)l=jh(),Rt.updateQueue=l,l.events=[o];else{var f=l.events;f===null?l.events=[o]:f.push(o)}}function PR(o){var l=nr().memoizedState;return E_({ref:l,nextImpl:o}),function(){if((sn&2)!==0)throw Error(r(440));return l.impl.apply(void 0,arguments)}}function zR(o,l){return Fh(4,2,o,l)}function NR(o,l){return Fh(4,4,o,l)}function LR(o,l){if(typeof l=="function"){o=o();var f=l(o);return function(){typeof f=="function"?f():l(null)}}if(l!=null)return o=o(),l.current=o,function(){l.current=null}}function BR(o,l,f){f=f!=null?f.concat([o]):null,Fh(4,4,LR.bind(null,l,o),f)}function xv(){}function jR(o,l){var f=nr();l=l===void 0?null:l;var p=f.memoizedState;return l!==null&&uv(l,p[1])?p[0]:(f.memoizedState=[o,l],o)}function _R(o,l){var f=nr();l=l===void 0?null:l;var p=f.memoizedState;if(l!==null&&uv(l,p[1]))return p[0];if(p=o(),$a){Wt(!0);try{o()}finally{Wt(!1)}}return f.memoizedState=[p,l],p}function Sv(o,l,f){return f===void 0||(Bs&1073741824)!==0&&(_t&261930)===0?o.memoizedState=l:(o.memoizedState=f,o=HT(),Rt.lanes|=o,jl|=o,f)}function HR(o,l,f,p){return Mi(f,l)?f:Uu.current!==null?(o=Sv(o,f,p),Mi(o,l)||(hr=!0),o):(Bs&42)===0||(Bs&1073741824)!==0&&(_t&261930)===0?(hr=!0,o.memoizedState=f):(o=HT(),Rt.lanes|=o,jl|=o,l)}function VR(o,l,f,p,v){var S=q.p;q.p=S!==0&&8>S?S:8;var D=B.T,V={};B.T=V,Rv(o,!1,l,f);try{var Q=v(),ce=B.S;if(ce!==null&&ce(V,Q),Q!==null&&typeof Q=="object"&&typeof Q.then=="function"){var be=S_(Q,p);wf(o,l,be,Pi(o))}else wf(o,l,p,Pi(o))}catch(Re){wf(o,l,{then:function(){},status:"rejected",reason:Re},Pi())}finally{q.p=S,D!==null&&V.types!==null&&(D.types=V.types),B.T=D}}function M_(){}function wv(o,l,f,p){if(o.tag!==5)throw Error(r(476));var v=FR(o).queue;VR(o,v,l,U,f===null?M_:function(){return UR(o),f(p)})}function FR(o){var l=o.memoizedState;if(l!==null)return l;l={memoizedState:U,baseState:U,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:js,lastRenderedState:U},next:null};var f={};return l.next={memoizedState:f,baseState:f,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:js,lastRenderedState:f},next:null},o.memoizedState=l,o=o.alternate,o!==null&&(o.memoizedState=l),l}function UR(o){var l=FR(o);l.next===null&&(l=o.alternate.memoizedState),wf(o,l.next.queue,{},Pi())}function Cv(){return Ir(_f)}function $R(){return nr().memoizedState}function qR(){return nr().memoizedState}function A_(o){for(var l=o.return;l!==null;){switch(l.tag){case 24:case 3:var f=Pi();o=Dl(f);var p=Pl(l,o,f);p!==null&&(vi(p,l,f),yf(p,l,f)),l={cache:Zy()},o.payload=l;return}l=l.return}}function O_(o,l,f){var p=Pi();f={lane:p,revertLane:0,gesture:null,action:f,hasEagerState:!1,eagerState:null,next:null},Uh(o)?WR(l,f):(f=Vy(o,l,f,p),f!==null&&(vi(f,o,p),KR(f,l,p)))}function GR(o,l,f){var p=Pi();wf(o,l,f,p)}function wf(o,l,f,p){var v={lane:p,revertLane:0,gesture:null,action:f,hasEagerState:!1,eagerState:null,next:null};if(Uh(o))WR(l,v);else{var S=o.alternate;if(o.lanes===0&&(S===null||S.lanes===0)&&(S=l.lastRenderedReducer,S!==null))try{var D=l.lastRenderedState,V=S(D,f);if(v.hasEagerState=!0,v.eagerState=V,Mi(V,D))return Ch(o,l,v,0),En===null&&wh(),!1}catch{}if(f=Vy(o,l,v,p),f!==null)return vi(f,o,p),KR(f,l,p),!0}return!1}function Rv(o,l,f,p){if(p={lane:2,revertLane:n0(),gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null},Uh(o)){if(l)throw Error(r(479))}else l=Vy(o,f,p,2),l!==null&&vi(l,o,2)}function Uh(o){var l=o.alternate;return o===Rt||l!==null&&l===Rt}function WR(o,l){$u=Lh=!0;var f=o.pending;f===null?l.next=l:(l.next=f.next,f.next=l),o.pending=l}function KR(o,l,f){if((f&4194048)!==0){var p=l.lanes;p&=o.pendingLanes,f|=p,l.lanes=f,ar(o,f)}}var Cf={readContext:Ir,use:_h,useCallback:Wn,useContext:Wn,useEffect:Wn,useImperativeHandle:Wn,useLayoutEffect:Wn,useInsertionEffect:Wn,useMemo:Wn,useReducer:Wn,useRef:Wn,useState:Wn,useDebugValue:Wn,useDeferredValue:Wn,useTransition:Wn,useSyncExternalStore:Wn,useId:Wn,useHostTransitionStatus:Wn,useFormState:Wn,useActionState:Wn,useOptimistic:Wn,useMemoCache:Wn,useCacheRefresh:Wn};Cf.useEffectEvent=Wn;var YR={readContext:Ir,use:_h,useCallback:function(o,l){return ii().memoizedState=[o,l===void 0?null:l],o},useContext:Ir,useEffect:DR,useImperativeHandle:function(o,l,f){f=f!=null?f.concat([o]):null,Vh(4194308,4,LR.bind(null,l,o),f)},useLayoutEffect:function(o,l){return Vh(4194308,4,o,l)},useInsertionEffect:function(o,l){Vh(4,2,o,l)},useMemo:function(o,l){var f=ii();l=l===void 0?null:l;var p=o();if($a){Wt(!0);try{o()}finally{Wt(!1)}}return f.memoizedState=[p,l],p},useReducer:function(o,l,f){var p=ii();if(f!==void 0){var v=f(l);if($a){Wt(!0);try{f(l)}finally{Wt(!1)}}}else v=l;return p.memoizedState=p.baseState=v,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:o,lastRenderedState:v},p.queue=o,o=o.dispatch=O_.bind(null,Rt,o),[p.memoizedState,o]},useRef:function(o){var l=ii();return o={current:o},l.memoizedState=o},useState:function(o){o=yv(o);var l=o.queue,f=GR.bind(null,Rt,l);return l.dispatch=f,[o.memoizedState,f]},useDebugValue:xv,useDeferredValue:function(o,l){var f=ii();return Sv(f,o,l)},useTransition:function(){var o=yv(!1);return o=VR.bind(null,Rt,o.queue,!0,!1),ii().memoizedState=o,[!1,o]},useSyncExternalStore:function(o,l,f){var p=Rt,v=ii();if(Ft){if(f===void 0)throw Error(r(407));f=f()}else{if(f=l(),En===null)throw Error(r(349));(_t&127)!==0||mR(p,l,f)}v.memoizedState=f;var S={value:f,getSnapshot:l};return v.queue=S,DR(vR.bind(null,p,S,o),[o]),p.flags|=2048,Gu(9,{destroy:void 0},yR.bind(null,p,S,f,l),null),f},useId:function(){var o=ii(),l=En.identifierPrefix;if(Ft){var f=Zo,p=Qo;f=(p&~(1<<32-at(p)-1)).toString(32)+f,l="_"+l+"R_"+f,f=Bh++,0<f&&(l+="H"+f.toString(32)),l+="_"}else f=w_++,l="_"+l+"r_"+f.toString(32)+"_";return o.memoizedState=l},useHostTransitionStatus:Cv,useFormState:MR,useActionState:MR,useOptimistic:function(o){var l=ii();l.memoizedState=l.baseState=o;var f={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return l.queue=f,l=Rv.bind(null,Rt,!0,f),f.dispatch=l,[o,l]},useMemoCache:pv,useCacheRefresh:function(){return ii().memoizedState=A_.bind(null,Rt)},useEffectEvent:function(o){var l=ii(),f={impl:o};return l.memoizedState=f,function(){if((sn&2)!==0)throw Error(r(440));return f.impl.apply(void 0,arguments)}}},Tv={readContext:Ir,use:_h,useCallback:jR,useContext:Ir,useEffect:bv,useImperativeHandle:BR,useInsertionEffect:zR,useLayoutEffect:NR,useMemo:_R,useReducer:Hh,useRef:IR,useState:function(){return Hh(js)},useDebugValue:xv,useDeferredValue:function(o,l){var f=nr();return HR(f,vn.memoizedState,o,l)},useTransition:function(){var o=Hh(js)[0],l=nr().memoizedState;return[typeof o=="boolean"?o:Sf(o),l]},useSyncExternalStore:gR,useId:$R,useHostTransitionStatus:Cv,useFormState:AR,useActionState:AR,useOptimistic:function(o,l){var f=nr();return SR(f,vn,o,l)},useMemoCache:pv,useCacheRefresh:qR};Tv.useEffectEvent=PR;var XR={readContext:Ir,use:_h,useCallback:jR,useContext:Ir,useEffect:bv,useImperativeHandle:BR,useInsertionEffect:zR,useLayoutEffect:NR,useMemo:_R,useReducer:mv,useRef:IR,useState:function(){return mv(js)},useDebugValue:xv,useDeferredValue:function(o,l){var f=nr();return vn===null?Sv(f,o,l):HR(f,vn.memoizedState,o,l)},useTransition:function(){var o=mv(js)[0],l=nr().memoizedState;return[typeof o=="boolean"?o:Sf(o),l]},useSyncExternalStore:gR,useId:$R,useHostTransitionStatus:Cv,useFormState:kR,useActionState:kR,useOptimistic:function(o,l){var f=nr();return vn!==null?SR(f,vn,o,l):(f.baseState=o,[o,f.queue.dispatch])},useMemoCache:pv,useCacheRefresh:qR};XR.useEffectEvent=PR;function Ev(o,l,f,p){l=o.memoizedState,f=f(p,l),f=f==null?l:g({},l,f),o.memoizedState=f,o.lanes===0&&(o.updateQueue.baseState=f)}var Mv={enqueueSetState:function(o,l,f){o=o._reactInternals;var p=Pi(),v=Dl(p);v.payload=l,f!=null&&(v.callback=f),l=Pl(o,v,p),l!==null&&(vi(l,o,p),yf(l,o,p))},enqueueReplaceState:function(o,l,f){o=o._reactInternals;var p=Pi(),v=Dl(p);v.tag=1,v.payload=l,f!=null&&(v.callback=f),l=Pl(o,v,p),l!==null&&(vi(l,o,p),yf(l,o,p))},enqueueForceUpdate:function(o,l){o=o._reactInternals;var f=Pi(),p=Dl(f);p.tag=2,l!=null&&(p.callback=l),l=Pl(o,p,f),l!==null&&(vi(l,o,f),yf(l,o,f))}};function QR(o,l,f,p,v,S,D){return o=o.stateNode,typeof o.shouldComponentUpdate=="function"?o.shouldComponentUpdate(p,S,D):l.prototype&&l.prototype.isPureReactComponent?!uf(f,p)||!uf(v,S):!0}function ZR(o,l,f,p){o=l.state,typeof l.componentWillReceiveProps=="function"&&l.componentWillReceiveProps(f,p),typeof l.UNSAFE_componentWillReceiveProps=="function"&&l.UNSAFE_componentWillReceiveProps(f,p),l.state!==o&&Mv.enqueueReplaceState(l,l.state,null)}function qa(o,l){var f=l;if("ref"in l){f={};for(var p in l)p!=="ref"&&(f[p]=l[p])}if(o=o.defaultProps){f===l&&(f=g({},f));for(var v in o)f[v]===void 0&&(f[v]=o[v])}return f}function JR(o){Sh(o)}function eT(o){console.error(o)}function tT(o){Sh(o)}function $h(o,l){try{var f=o.onUncaughtError;f(l.value,{componentStack:l.stack})}catch(p){setTimeout(function(){throw p})}}function nT(o,l,f){try{var p=o.onCaughtError;p(f.value,{componentStack:f.stack,errorBoundary:l.tag===1?l.stateNode:null})}catch(v){setTimeout(function(){throw v})}}function Av(o,l,f){return f=Dl(f),f.tag=3,f.payload={element:null},f.callback=function(){$h(o,l)},f}function rT(o){return o=Dl(o),o.tag=3,o}function iT(o,l,f,p){var v=f.type.getDerivedStateFromError;if(typeof v=="function"){var S=p.value;o.payload=function(){return v(S)},o.callback=function(){nT(l,f,p)}}var D=f.stateNode;D!==null&&typeof D.componentDidCatch=="function"&&(o.callback=function(){nT(l,f,p),typeof v!="function"&&(_l===null?_l=new Set([this]):_l.add(this));var V=p.stack;this.componentDidCatch(p.value,{componentStack:V!==null?V:""})})}function k_(o,l,f,p,v){if(f.flags|=32768,p!==null&&typeof p=="object"&&typeof p.then=="function"){if(l=f.alternate,l!==null&&ju(l,f,v,!0),f=Oi.current,f!==null){switch(f.tag){case 31:case 13:return Xi===null?np():f.alternate===null&&Kn===0&&(Kn=3),f.flags&=-257,f.flags|=65536,f.lanes=v,p===Ih?f.flags|=16384:(l=f.updateQueue,l===null?f.updateQueue=new Set([p]):l.add(p),Jv(o,p,v)),!1;case 22:return f.flags|=65536,p===Ih?f.flags|=16384:(l=f.updateQueue,l===null?(l={transitions:null,markerInstances:null,retryQueue:new Set([p])},f.updateQueue=l):(f=l.retryQueue,f===null?l.retryQueue=new Set([p]):f.add(p)),Jv(o,p,v)),!1}throw Error(r(435,f.tag))}return Jv(o,p,v),np(),!1}if(Ft)return l=Oi.current,l!==null?((l.flags&65536)===0&&(l.flags|=256),l.flags|=65536,l.lanes=v,p!==Wy&&(o=Error(r(422),{cause:p}),df(Gi(o,f)))):(p!==Wy&&(l=Error(r(423),{cause:p}),df(Gi(l,f))),o=o.current.alternate,o.flags|=65536,v&=-v,o.lanes|=v,p=Gi(p,f),v=Av(o.stateNode,p,v),iv(o,v),Kn!==4&&(Kn=2)),!1;var S=Error(r(520),{cause:p});if(S=Gi(S,f),If===null?If=[S]:If.push(S),Kn!==4&&(Kn=2),l===null)return!0;p=Gi(p,f),f=l;do{switch(f.tag){case 3:return f.flags|=65536,o=v&-v,f.lanes|=o,o=Av(f.stateNode,p,o),iv(f,o),!1;case 1:if(l=f.type,S=f.stateNode,(f.flags&128)===0&&(typeof l.getDerivedStateFromError=="function"||S!==null&&typeof S.componentDidCatch=="function"&&(_l===null||!_l.has(S))))return f.flags|=65536,v&=-v,f.lanes|=v,v=rT(v),iT(v,o,f,p),iv(f,v),!1}f=f.return}while(f!==null);return!1}var Ov=Error(r(461)),hr=!1;function Dr(o,l,f,p){l.child=o===null?aR(l,null,f,p):Ua(l,o.child,f,p)}function oT(o,l,f,p,v){f=f.render;var S=l.ref;if("ref"in p){var D={};for(var V in p)V!=="ref"&&(D[V]=p[V])}else D=p;return _a(l),p=cv(o,l,f,D,S,v),V=fv(),o!==null&&!hr?(dv(o,l,v),_s(o,l,v)):(Ft&&V&&qy(l),l.flags|=1,Dr(o,l,p,v),l.child)}function sT(o,l,f,p,v){if(o===null){var S=f.type;return typeof S=="function"&&!Fy(S)&&S.defaultProps===void 0&&f.compare===null?(l.tag=15,l.type=S,lT(o,l,S,p,v)):(o=Th(f.type,null,p,l,l.mode,v),o.ref=l.ref,o.return=l,l.child=o)}if(S=o.child,!Bv(o,v)){var D=S.memoizedProps;if(f=f.compare,f=f!==null?f:uf,f(D,p)&&o.ref===l.ref)return _s(o,l,v)}return l.flags|=1,o=Ps(S,p),o.ref=l.ref,o.return=l,l.child=o}function lT(o,l,f,p,v){if(o!==null){var S=o.memoizedProps;if(uf(S,p)&&o.ref===l.ref)if(hr=!1,l.pendingProps=p=S,Bv(o,v))(o.flags&131072)!==0&&(hr=!0);else return l.lanes=o.lanes,_s(o,l,v)}return kv(o,l,f,p,v)}function aT(o,l,f,p){var v=p.children,S=o!==null?o.memoizedState:null;if(o===null&&l.stateNode===null&&(l.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),p.mode==="hidden"){if((l.flags&128)!==0){if(S=S!==null?S.baseLanes|f:f,o!==null){for(p=l.child=o.child,v=0;p!==null;)v=v|p.lanes|p.childLanes,p=p.sibling;p=v&~S}else p=0,l.child=null;return uT(o,l,S,f,p)}if((f&536870912)!==0)l.memoizedState={baseLanes:0,cachePool:null},o!==null&&Oh(l,S!==null?S.cachePool:null),S!==null?fR(l,S):sv(),dR(l);else return p=l.lanes=536870912,uT(o,l,S!==null?S.baseLanes|f:f,f,p)}else S!==null?(Oh(l,S.cachePool),fR(l,S),Nl(),l.memoizedState=null):(o!==null&&Oh(l,null),sv(),Nl());return Dr(o,l,v,f),l.child}function Rf(o,l){return o!==null&&o.tag===22||l.stateNode!==null||(l.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.sibling}function uT(o,l,f,p,v){var S=ev();return S=S===null?null:{parent:fr._currentValue,pool:S},l.memoizedState={baseLanes:f,cachePool:S},o!==null&&Oh(l,null),sv(),dR(l),o!==null&&ju(o,l,p,!0),l.childLanes=v,null}function qh(o,l){return l=Wh({mode:l.mode,children:l.children},o.mode),l.ref=o.ref,o.child=l,l.return=o,l}function cT(o,l,f){return Ua(l,o.child,null,f),o=qh(l,l.pendingProps),o.flags|=2,ki(l),l.memoizedState=null,o}function I_(o,l,f){var p=l.pendingProps,v=(l.flags&128)!==0;if(l.flags&=-129,o===null){if(Ft){if(p.mode==="hidden")return o=qh(l,p),l.lanes=536870912,Rf(null,o);if(av(l),(o=Dn)?(o=wE(o,Yi),o=o!==null&&o.data==="&"?o:null,o!==null&&(l.memoizedState={dehydrated:o,treeContext:Ml!==null?{id:Qo,overflow:Zo}:null,retryLane:536870912,hydrationErrors:null},f=WC(o),f.return=l,l.child=f,kr=l,Dn=null)):o=null,o===null)throw Ol(l);return l.lanes=536870912,null}return qh(l,p)}var S=o.memoizedState;if(S!==null){var D=S.dehydrated;if(av(l),v)if(l.flags&256)l.flags&=-257,l=cT(o,l,f);else if(l.memoizedState!==null)l.child=o.child,l.flags|=128,l=null;else throw Error(r(558));else if(hr||ju(o,l,f,!1),v=(f&o.childLanes)!==0,hr||v){if(p=En,p!==null&&(D=rt(p,f),D!==0&&D!==S.retryLane))throw S.retryLane=D,Na(o,D),vi(p,o,D),Ov;np(),l=cT(o,l,f)}else o=S.treeContext,Dn=Qi(D.nextSibling),kr=l,Ft=!0,Al=null,Yi=!1,o!==null&&XC(l,o),l=qh(l,p),l.flags|=4096;return l}return o=Ps(o.child,{mode:p.mode,children:p.children}),o.ref=l.ref,l.child=o,o.return=l,o}function Gh(o,l){var f=l.ref;if(f===null)o!==null&&o.ref!==null&&(l.flags|=4194816);else{if(typeof f!="function"&&typeof f!="object")throw Error(r(284));(o===null||o.ref!==f)&&(l.flags|=4194816)}}function kv(o,l,f,p,v){return _a(l),f=cv(o,l,f,p,void 0,v),p=fv(),o!==null&&!hr?(dv(o,l,v),_s(o,l,v)):(Ft&&p&&qy(l),l.flags|=1,Dr(o,l,f,v),l.child)}function fT(o,l,f,p,v,S){return _a(l),l.updateQueue=null,f=pR(l,p,f,v),hR(o),p=fv(),o!==null&&!hr?(dv(o,l,S),_s(o,l,S)):(Ft&&p&&qy(l),l.flags|=1,Dr(o,l,f,S),l.child)}function dT(o,l,f,p,v){if(_a(l),l.stateNode===null){var S=zu,D=f.contextType;typeof D=="object"&&D!==null&&(S=Ir(D)),S=new f(p,S),l.memoizedState=S.state!==null&&S.state!==void 0?S.state:null,S.updater=Mv,l.stateNode=S,S._reactInternals=l,S=l.stateNode,S.props=p,S.state=l.memoizedState,S.refs={},nv(l),D=f.contextType,S.context=typeof D=="object"&&D!==null?Ir(D):zu,S.state=l.memoizedState,D=f.getDerivedStateFromProps,typeof D=="function"&&(Ev(l,f,D,p),S.state=l.memoizedState),typeof f.getDerivedStateFromProps=="function"||typeof S.getSnapshotBeforeUpdate=="function"||typeof S.UNSAFE_componentWillMount!="function"&&typeof S.componentWillMount!="function"||(D=S.state,typeof S.componentWillMount=="function"&&S.componentWillMount(),typeof S.UNSAFE_componentWillMount=="function"&&S.UNSAFE_componentWillMount(),D!==S.state&&Mv.enqueueReplaceState(S,S.state,null),bf(l,p,S,v),vf(),S.state=l.memoizedState),typeof S.componentDidMount=="function"&&(l.flags|=4194308),p=!0}else if(o===null){S=l.stateNode;var V=l.memoizedProps,Q=qa(f,V);S.props=Q;var ce=S.context,be=f.contextType;D=zu,typeof be=="object"&&be!==null&&(D=Ir(be));var Re=f.getDerivedStateFromProps;be=typeof Re=="function"||typeof S.getSnapshotBeforeUpdate=="function",V=l.pendingProps!==V,be||typeof S.UNSAFE_componentWillReceiveProps!="function"&&typeof S.componentWillReceiveProps!="function"||(V||ce!==D)&&ZR(l,S,p,D),Il=!1;var fe=l.memoizedState;S.state=fe,bf(l,p,S,v),vf(),ce=l.memoizedState,V||fe!==ce||Il?(typeof Re=="function"&&(Ev(l,f,Re,p),ce=l.memoizedState),(Q=Il||QR(l,f,Q,p,fe,ce,D))?(be||typeof S.UNSAFE_componentWillMount!="function"&&typeof S.componentWillMount!="function"||(typeof S.componentWillMount=="function"&&S.componentWillMount(),typeof S.UNSAFE_componentWillMount=="function"&&S.UNSAFE_componentWillMount()),typeof S.componentDidMount=="function"&&(l.flags|=4194308)):(typeof S.componentDidMount=="function"&&(l.flags|=4194308),l.memoizedProps=p,l.memoizedState=ce),S.props=p,S.state=ce,S.context=D,p=Q):(typeof S.componentDidMount=="function"&&(l.flags|=4194308),p=!1)}else{S=l.stateNode,rv(o,l),D=l.memoizedProps,be=qa(f,D),S.props=be,Re=l.pendingProps,fe=S.context,ce=f.contextType,Q=zu,typeof ce=="object"&&ce!==null&&(Q=Ir(ce)),V=f.getDerivedStateFromProps,(ce=typeof V=="function"||typeof S.getSnapshotBeforeUpdate=="function")||typeof S.UNSAFE_componentWillReceiveProps!="function"&&typeof S.componentWillReceiveProps!="function"||(D!==Re||fe!==Q)&&ZR(l,S,p,Q),Il=!1,fe=l.memoizedState,S.state=fe,bf(l,p,S,v),vf();var ge=l.memoizedState;D!==Re||fe!==ge||Il||o!==null&&o.dependencies!==null&&Mh(o.dependencies)?(typeof V=="function"&&(Ev(l,f,V,p),ge=l.memoizedState),(be=Il||QR(l,f,be,p,fe,ge,Q)||o!==null&&o.dependencies!==null&&Mh(o.dependencies))?(ce||typeof S.UNSAFE_componentWillUpdate!="function"&&typeof S.componentWillUpdate!="function"||(typeof S.componentWillUpdate=="function"&&S.componentWillUpdate(p,ge,Q),typeof S.UNSAFE_componentWillUpdate=="function"&&S.UNSAFE_componentWillUpdate(p,ge,Q)),typeof S.componentDidUpdate=="function"&&(l.flags|=4),typeof S.getSnapshotBeforeUpdate=="function"&&(l.flags|=1024)):(typeof S.componentDidUpdate!="function"||D===o.memoizedProps&&fe===o.memoizedState||(l.flags|=4),typeof S.getSnapshotBeforeUpdate!="function"||D===o.memoizedProps&&fe===o.memoizedState||(l.flags|=1024),l.memoizedProps=p,l.memoizedState=ge),S.props=p,S.state=ge,S.context=Q,p=be):(typeof S.componentDidUpdate!="function"||D===o.memoizedProps&&fe===o.memoizedState||(l.flags|=4),typeof S.getSnapshotBeforeUpdate!="function"||D===o.memoizedProps&&fe===o.memoizedState||(l.flags|=1024),p=!1)}return S=p,Gh(o,l),p=(l.flags&128)!==0,S||p?(S=l.stateNode,f=p&&typeof f.getDerivedStateFromError!="function"?null:S.render(),l.flags|=1,o!==null&&p?(l.child=Ua(l,o.child,null,v),l.child=Ua(l,null,f,v)):Dr(o,l,f,v),l.memoizedState=S.state,o=l.child):o=_s(o,l,v),o}function hT(o,l,f,p){return Ba(),l.flags|=256,Dr(o,l,f,p),l.child}var Iv={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Dv(o){return{baseLanes:o,cachePool:nR()}}function Pv(o,l,f){return o=o!==null?o.childLanes&~f:0,l&&(o|=Di),o}function pT(o,l,f){var p=l.pendingProps,v=!1,S=(l.flags&128)!==0,D;if((D=S)||(D=o!==null&&o.memoizedState===null?!1:(tr.current&2)!==0),D&&(v=!0,l.flags&=-129),D=(l.flags&32)!==0,l.flags&=-33,o===null){if(Ft){if(v?zl(l):Nl(),(o=Dn)?(o=wE(o,Yi),o=o!==null&&o.data!=="&"?o:null,o!==null&&(l.memoizedState={dehydrated:o,treeContext:Ml!==null?{id:Qo,overflow:Zo}:null,retryLane:536870912,hydrationErrors:null},f=WC(o),f.return=l,l.child=f,kr=l,Dn=null)):o=null,o===null)throw Ol(l);return g0(o)?l.lanes=32:l.lanes=536870912,null}var V=p.children;return p=p.fallback,v?(Nl(),v=l.mode,V=Wh({mode:"hidden",children:V},v),p=La(p,v,f,null),V.return=l,p.return=l,V.sibling=p,l.child=V,p=l.child,p.memoizedState=Dv(f),p.childLanes=Pv(o,D,f),l.memoizedState=Iv,Rf(null,p)):(zl(l),zv(l,V))}var Q=o.memoizedState;if(Q!==null&&(V=Q.dehydrated,V!==null)){if(S)l.flags&256?(zl(l),l.flags&=-257,l=Nv(o,l,f)):l.memoizedState!==null?(Nl(),l.child=o.child,l.flags|=128,l=null):(Nl(),V=p.fallback,v=l.mode,p=Wh({mode:"visible",children:p.children},v),V=La(V,v,f,null),V.flags|=2,p.return=l,V.return=l,p.sibling=V,l.child=p,Ua(l,o.child,null,f),p=l.child,p.memoizedState=Dv(f),p.childLanes=Pv(o,D,f),l.memoizedState=Iv,l=Rf(null,p));else if(zl(l),g0(V)){if(D=V.nextSibling&&V.nextSibling.dataset,D)var ce=D.dgst;D=ce,p=Error(r(419)),p.stack="",p.digest=D,df({value:p,source:null,stack:null}),l=Nv(o,l,f)}else if(hr||ju(o,l,f,!1),D=(f&o.childLanes)!==0,hr||D){if(D=En,D!==null&&(p=rt(D,f),p!==0&&p!==Q.retryLane))throw Q.retryLane=p,Na(o,p),vi(D,o,p),Ov;p0(V)||np(),l=Nv(o,l,f)}else p0(V)?(l.flags|=192,l.child=o.child,l=null):(o=Q.treeContext,Dn=Qi(V.nextSibling),kr=l,Ft=!0,Al=null,Yi=!1,o!==null&&XC(l,o),l=zv(l,p.children),l.flags|=4096);return l}return v?(Nl(),V=p.fallback,v=l.mode,Q=o.child,ce=Q.sibling,p=Ps(Q,{mode:"hidden",children:p.children}),p.subtreeFlags=Q.subtreeFlags&65011712,ce!==null?V=Ps(ce,V):(V=La(V,v,f,null),V.flags|=2),V.return=l,p.return=l,p.sibling=V,l.child=p,Rf(null,p),p=l.child,V=o.child.memoizedState,V===null?V=Dv(f):(v=V.cachePool,v!==null?(Q=fr._currentValue,v=v.parent!==Q?{parent:Q,pool:Q}:v):v=nR(),V={baseLanes:V.baseLanes|f,cachePool:v}),p.memoizedState=V,p.childLanes=Pv(o,D,f),l.memoizedState=Iv,Rf(o.child,p)):(zl(l),f=o.child,o=f.sibling,f=Ps(f,{mode:"visible",children:p.children}),f.return=l,f.sibling=null,o!==null&&(D=l.deletions,D===null?(l.deletions=[o],l.flags|=16):D.push(o)),l.child=f,l.memoizedState=null,f)}function zv(o,l){return l=Wh({mode:"visible",children:l},o.mode),l.return=o,o.child=l}function Wh(o,l){return o=Ai(22,o,null,l),o.lanes=0,o}function Nv(o,l,f){return Ua(l,o.child,null,f),o=zv(l,l.pendingProps.children),o.flags|=2,l.memoizedState=null,o}function gT(o,l,f){o.lanes|=l;var p=o.alternate;p!==null&&(p.lanes|=l),Xy(o.return,l,f)}function Lv(o,l,f,p,v,S){var D=o.memoizedState;D===null?o.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:p,tail:f,tailMode:v,treeForkCount:S}:(D.isBackwards=l,D.rendering=null,D.renderingStartTime=0,D.last=p,D.tail=f,D.tailMode=v,D.treeForkCount=S)}function mT(o,l,f){var p=l.pendingProps,v=p.revealOrder,S=p.tail;p=p.children;var D=tr.current,V=(D&2)!==0;if(V?(D=D&1|2,l.flags|=128):D&=1,W(tr,D),Dr(o,l,p,f),p=Ft?ff:0,!V&&o!==null&&(o.flags&128)!==0)e:for(o=l.child;o!==null;){if(o.tag===13)o.memoizedState!==null&&gT(o,f,l);else if(o.tag===19)gT(o,f,l);else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===l)break e;for(;o.sibling===null;){if(o.return===null||o.return===l)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}switch(v){case"forwards":for(f=l.child,v=null;f!==null;)o=f.alternate,o!==null&&Nh(o)===null&&(v=f),f=f.sibling;f=v,f===null?(v=l.child,l.child=null):(v=f.sibling,f.sibling=null),Lv(l,!1,v,f,S,p);break;case"backwards":case"unstable_legacy-backwards":for(f=null,v=l.child,l.child=null;v!==null;){if(o=v.alternate,o!==null&&Nh(o)===null){l.child=v;break}o=v.sibling,v.sibling=f,f=v,v=o}Lv(l,!0,f,null,S,p);break;case"together":Lv(l,!1,null,null,void 0,p);break;default:l.memoizedState=null}return l.child}function _s(o,l,f){if(o!==null&&(l.dependencies=o.dependencies),jl|=l.lanes,(f&l.childLanes)===0)if(o!==null){if(ju(o,l,f,!1),(f&l.childLanes)===0)return null}else return null;if(o!==null&&l.child!==o.child)throw Error(r(153));if(l.child!==null){for(o=l.child,f=Ps(o,o.pendingProps),l.child=f,f.return=l;o.sibling!==null;)o=o.sibling,f=f.sibling=Ps(o,o.pendingProps),f.return=l;f.sibling=null}return l.child}function Bv(o,l){return(o.lanes&l)!==0?!0:(o=o.dependencies,!!(o!==null&&Mh(o)))}function D_(o,l,f){switch(l.tag){case 3:Y(l,l.stateNode.containerInfo),kl(l,fr,o.memoizedState.cache),Ba();break;case 27:case 5:ve(l);break;case 4:Y(l,l.stateNode.containerInfo);break;case 10:kl(l,l.type,l.memoizedProps.value);break;case 31:if(l.memoizedState!==null)return l.flags|=128,av(l),null;break;case 13:var p=l.memoizedState;if(p!==null)return p.dehydrated!==null?(zl(l),l.flags|=128,null):(f&l.child.childLanes)!==0?pT(o,l,f):(zl(l),o=_s(o,l,f),o!==null?o.sibling:null);zl(l);break;case 19:var v=(o.flags&128)!==0;if(p=(f&l.childLanes)!==0,p||(ju(o,l,f,!1),p=(f&l.childLanes)!==0),v){if(p)return mT(o,l,f);l.flags|=128}if(v=l.memoizedState,v!==null&&(v.rendering=null,v.tail=null,v.lastEffect=null),W(tr,tr.current),p)break;return null;case 22:return l.lanes=0,aT(o,l,f,l.pendingProps);case 24:kl(l,fr,o.memoizedState.cache)}return _s(o,l,f)}function yT(o,l,f){if(o!==null)if(o.memoizedProps!==l.pendingProps)hr=!0;else{if(!Bv(o,f)&&(l.flags&128)===0)return hr=!1,D_(o,l,f);hr=(o.flags&131072)!==0}else hr=!1,Ft&&(l.flags&1048576)!==0&&YC(l,ff,l.index);switch(l.lanes=0,l.tag){case 16:e:{var p=l.pendingProps;if(o=Va(l.elementType),l.type=o,typeof o=="function")Fy(o)?(p=qa(o,p),l.tag=1,l=dT(null,l,o,p,f)):(l.tag=0,l=kv(null,l,o,p,f));else{if(o!=null){var v=o.$$typeof;if(v===M){l.tag=11,l=oT(null,l,o,p,f);break e}else if(v===A){l.tag=14,l=sT(null,l,o,p,f);break e}}throw l=F(o)||o,Error(r(306,l,""))}}return l;case 0:return kv(o,l,l.type,l.pendingProps,f);case 1:return p=l.type,v=qa(p,l.pendingProps),dT(o,l,p,v,f);case 3:e:{if(Y(l,l.stateNode.containerInfo),o===null)throw Error(r(387));p=l.pendingProps;var S=l.memoizedState;v=S.element,rv(o,l),bf(l,p,null,f);var D=l.memoizedState;if(p=D.cache,kl(l,fr,p),p!==S.cache&&Qy(l,[fr],f,!0),vf(),p=D.element,S.isDehydrated)if(S={element:p,isDehydrated:!1,cache:D.cache},l.updateQueue.baseState=S,l.memoizedState=S,l.flags&256){l=hT(o,l,p,f);break e}else if(p!==v){v=Gi(Error(r(424)),l),df(v),l=hT(o,l,p,f);break e}else for(o=l.stateNode.containerInfo,o.nodeType===9?o=o.body:o=o.nodeName==="HTML"?o.ownerDocument.body:o,Dn=Qi(o.firstChild),kr=l,Ft=!0,Al=null,Yi=!0,f=aR(l,null,p,f),l.child=f;f;)f.flags=f.flags&-3|4096,f=f.sibling;else{if(Ba(),p===v){l=_s(o,l,f);break e}Dr(o,l,p,f)}l=l.child}return l;case 26:return Gh(o,l),o===null?(f=AE(l.type,null,l.pendingProps,null))?l.memoizedState=f:Ft||(f=l.type,o=l.pendingProps,p=up(ee.current).createElement(f),p[zt]=l,p[Nt]=o,Pr(p,f,o),Un(p),l.stateNode=p):l.memoizedState=AE(l.type,o.memoizedProps,l.pendingProps,o.memoizedState),null;case 27:return ve(l),o===null&&Ft&&(p=l.stateNode=TE(l.type,l.pendingProps,ee.current),kr=l,Yi=!0,v=Dn,Ul(l.type)?(m0=v,Dn=Qi(p.firstChild)):Dn=v),Dr(o,l,l.pendingProps.children,f),Gh(o,l),o===null&&(l.flags|=4194304),l.child;case 5:return o===null&&Ft&&((v=p=Dn)&&(p=aH(p,l.type,l.pendingProps,Yi),p!==null?(l.stateNode=p,kr=l,Dn=Qi(p.firstChild),Yi=!1,v=!0):v=!1),v||Ol(l)),ve(l),v=l.type,S=l.pendingProps,D=o!==null?o.memoizedProps:null,p=S.children,f0(v,S)?p=null:D!==null&&f0(v,D)&&(l.flags|=32),l.memoizedState!==null&&(v=cv(o,l,C_,null,null,f),_f._currentValue=v),Gh(o,l),Dr(o,l,p,f),l.child;case 6:return o===null&&Ft&&((o=f=Dn)&&(f=uH(f,l.pendingProps,Yi),f!==null?(l.stateNode=f,kr=l,Dn=null,o=!0):o=!1),o||Ol(l)),null;case 13:return pT(o,l,f);case 4:return Y(l,l.stateNode.containerInfo),p=l.pendingProps,o===null?l.child=Ua(l,null,p,f):Dr(o,l,p,f),l.child;case 11:return oT(o,l,l.type,l.pendingProps,f);case 7:return Dr(o,l,l.pendingProps,f),l.child;case 8:return Dr(o,l,l.pendingProps.children,f),l.child;case 12:return Dr(o,l,l.pendingProps.children,f),l.child;case 10:return p=l.pendingProps,kl(l,l.type,p.value),Dr(o,l,p.children,f),l.child;case 9:return v=l.type._context,p=l.pendingProps.children,_a(l),v=Ir(v),p=p(v),l.flags|=1,Dr(o,l,p,f),l.child;case 14:return sT(o,l,l.type,l.pendingProps,f);case 15:return lT(o,l,l.type,l.pendingProps,f);case 19:return mT(o,l,f);case 31:return I_(o,l,f);case 22:return aT(o,l,f,l.pendingProps);case 24:return _a(l),p=Ir(fr),o===null?(v=ev(),v===null&&(v=En,S=Zy(),v.pooledCache=S,S.refCount++,S!==null&&(v.pooledCacheLanes|=f),v=S),l.memoizedState={parent:p,cache:v},nv(l),kl(l,fr,v)):((o.lanes&f)!==0&&(rv(o,l),bf(l,null,null,f),vf()),v=o.memoizedState,S=l.memoizedState,v.parent!==p?(v={parent:p,cache:p},l.memoizedState=v,l.lanes===0&&(l.memoizedState=l.updateQueue.baseState=v),kl(l,fr,p)):(p=S.cache,kl(l,fr,p),p!==v.cache&&Qy(l,[fr],f,!0))),Dr(o,l,l.pendingProps.children,f),l.child;case 29:throw l.pendingProps}throw Error(r(156,l.tag))}function Hs(o){o.flags|=4}function jv(o,l,f,p,v){if((l=(o.mode&32)!==0)&&(l=!1),l){if(o.flags|=16777216,(v&335544128)===v)if(o.stateNode.complete)o.flags|=8192;else if($T())o.flags|=8192;else throw Fa=Ih,tv}else o.flags&=-16777217}function vT(o,l){if(l.type!=="stylesheet"||(l.state.loading&4)!==0)o.flags&=-16777217;else if(o.flags|=16777216,!PE(l))if($T())o.flags|=8192;else throw Fa=Ih,tv}function Kh(o,l){l!==null&&(o.flags|=4),o.flags&16384&&(l=o.tag!==22?Fn():536870912,o.lanes|=l,Xu|=l)}function Tf(o,l){if(!Ft)switch(o.tailMode){case"hidden":l=o.tail;for(var f=null;l!==null;)l.alternate!==null&&(f=l),l=l.sibling;f===null?o.tail=null:f.sibling=null;break;case"collapsed":f=o.tail;for(var p=null;f!==null;)f.alternate!==null&&(p=f),f=f.sibling;p===null?l||o.tail===null?o.tail=null:o.tail.sibling=null:p.sibling=null}}function Pn(o){var l=o.alternate!==null&&o.alternate.child===o.child,f=0,p=0;if(l)for(var v=o.child;v!==null;)f|=v.lanes|v.childLanes,p|=v.subtreeFlags&65011712,p|=v.flags&65011712,v.return=o,v=v.sibling;else for(v=o.child;v!==null;)f|=v.lanes|v.childLanes,p|=v.subtreeFlags,p|=v.flags,v.return=o,v=v.sibling;return o.subtreeFlags|=p,o.childLanes=f,l}function P_(o,l,f){var p=l.pendingProps;switch(Gy(l),l.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Pn(l),null;case 1:return Pn(l),null;case 3:return f=l.stateNode,p=null,o!==null&&(p=o.memoizedState.cache),l.memoizedState.cache!==p&&(l.flags|=2048),Ls(fr),se(),f.pendingContext&&(f.context=f.pendingContext,f.pendingContext=null),(o===null||o.child===null)&&(Bu(l)?Hs(l):o===null||o.memoizedState.isDehydrated&&(l.flags&256)===0||(l.flags|=1024,Ky())),Pn(l),null;case 26:var v=l.type,S=l.memoizedState;return o===null?(Hs(l),S!==null?(Pn(l),vT(l,S)):(Pn(l),jv(l,v,null,p,f))):S?S!==o.memoizedState?(Hs(l),Pn(l),vT(l,S)):(Pn(l),l.flags&=-16777217):(o=o.memoizedProps,o!==p&&Hs(l),Pn(l),jv(l,v,o,p,f)),null;case 27:if(ye(l),f=ee.current,v=l.type,o!==null&&l.stateNode!=null)o.memoizedProps!==p&&Hs(l);else{if(!p){if(l.stateNode===null)throw Error(r(166));return Pn(l),null}o=K.current,Bu(l)?QC(l):(o=TE(v,p,f),l.stateNode=o,Hs(l))}return Pn(l),null;case 5:if(ye(l),v=l.type,o!==null&&l.stateNode!=null)o.memoizedProps!==p&&Hs(l);else{if(!p){if(l.stateNode===null)throw Error(r(166));return Pn(l),null}if(S=K.current,Bu(l))QC(l);else{var D=up(ee.current);switch(S){case 1:S=D.createElementNS("http://www.w3.org/2000/svg",v);break;case 2:S=D.createElementNS("http://www.w3.org/1998/Math/MathML",v);break;default:switch(v){case"svg":S=D.createElementNS("http://www.w3.org/2000/svg",v);break;case"math":S=D.createElementNS("http://www.w3.org/1998/Math/MathML",v);break;case"script":S=D.createElement("div"),S.innerHTML="<script><\/script>",S=S.removeChild(S.firstChild);break;case"select":S=typeof p.is=="string"?D.createElement("select",{is:p.is}):D.createElement("select"),p.multiple?S.multiple=!0:p.size&&(S.size=p.size);break;default:S=typeof p.is=="string"?D.createElement(v,{is:p.is}):D.createElement(v)}}S[zt]=l,S[Nt]=p;e:for(D=l.child;D!==null;){if(D.tag===5||D.tag===6)S.appendChild(D.stateNode);else if(D.tag!==4&&D.tag!==27&&D.child!==null){D.child.return=D,D=D.child;continue}if(D===l)break e;for(;D.sibling===null;){if(D.return===null||D.return===l)break e;D=D.return}D.sibling.return=D.return,D=D.sibling}l.stateNode=S;e:switch(Pr(S,v,p),v){case"button":case"input":case"select":case"textarea":p=!!p.autoFocus;break e;case"img":p=!0;break e;default:p=!1}p&&Hs(l)}}return Pn(l),jv(l,l.type,o===null?null:o.memoizedProps,l.pendingProps,f),null;case 6:if(o&&l.stateNode!=null)o.memoizedProps!==p&&Hs(l);else{if(typeof p!="string"&&l.stateNode===null)throw Error(r(166));if(o=ee.current,Bu(l)){if(o=l.stateNode,f=l.memoizedProps,p=null,v=kr,v!==null)switch(v.tag){case 27:case 5:p=v.memoizedProps}o[zt]=l,o=!!(o.nodeValue===f||p!==null&&p.suppressHydrationWarning===!0||pE(o.nodeValue,f)),o||Ol(l,!0)}else o=up(o).createTextNode(p),o[zt]=l,l.stateNode=o}return Pn(l),null;case 31:if(f=l.memoizedState,o===null||o.memoizedState!==null){if(p=Bu(l),f!==null){if(o===null){if(!p)throw Error(r(318));if(o=l.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(r(557));o[zt]=l}else Ba(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;Pn(l),o=!1}else f=Ky(),o!==null&&o.memoizedState!==null&&(o.memoizedState.hydrationErrors=f),o=!0;if(!o)return l.flags&256?(ki(l),l):(ki(l),null);if((l.flags&128)!==0)throw Error(r(558))}return Pn(l),null;case 13:if(p=l.memoizedState,o===null||o.memoizedState!==null&&o.memoizedState.dehydrated!==null){if(v=Bu(l),p!==null&&p.dehydrated!==null){if(o===null){if(!v)throw Error(r(318));if(v=l.memoizedState,v=v!==null?v.dehydrated:null,!v)throw Error(r(317));v[zt]=l}else Ba(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;Pn(l),v=!1}else v=Ky(),o!==null&&o.memoizedState!==null&&(o.memoizedState.hydrationErrors=v),v=!0;if(!v)return l.flags&256?(ki(l),l):(ki(l),null)}return ki(l),(l.flags&128)!==0?(l.lanes=f,l):(f=p!==null,o=o!==null&&o.memoizedState!==null,f&&(p=l.child,v=null,p.alternate!==null&&p.alternate.memoizedState!==null&&p.alternate.memoizedState.cachePool!==null&&(v=p.alternate.memoizedState.cachePool.pool),S=null,p.memoizedState!==null&&p.memoizedState.cachePool!==null&&(S=p.memoizedState.cachePool.pool),S!==v&&(p.flags|=2048)),f!==o&&f&&(l.child.flags|=8192),Kh(l,l.updateQueue),Pn(l),null);case 4:return se(),o===null&&s0(l.stateNode.containerInfo),Pn(l),null;case 10:return Ls(l.type),Pn(l),null;case 19:if($(tr),p=l.memoizedState,p===null)return Pn(l),null;if(v=(l.flags&128)!==0,S=p.rendering,S===null)if(v)Tf(p,!1);else{if(Kn!==0||o!==null&&(o.flags&128)!==0)for(o=l.child;o!==null;){if(S=Nh(o),S!==null){for(l.flags|=128,Tf(p,!1),o=S.updateQueue,l.updateQueue=o,Kh(l,o),l.subtreeFlags=0,o=f,f=l.child;f!==null;)GC(f,o),f=f.sibling;return W(tr,tr.current&1|2),Ft&&zs(l,p.treeForkCount),l.child}o=o.sibling}p.tail!==null&&J()>Jh&&(l.flags|=128,v=!0,Tf(p,!1),l.lanes=4194304)}else{if(!v)if(o=Nh(S),o!==null){if(l.flags|=128,v=!0,o=o.updateQueue,l.updateQueue=o,Kh(l,o),Tf(p,!0),p.tail===null&&p.tailMode==="hidden"&&!S.alternate&&!Ft)return Pn(l),null}else 2*J()-p.renderingStartTime>Jh&&f!==536870912&&(l.flags|=128,v=!0,Tf(p,!1),l.lanes=4194304);p.isBackwards?(S.sibling=l.child,l.child=S):(o=p.last,o!==null?o.sibling=S:l.child=S,p.last=S)}return p.tail!==null?(o=p.tail,p.rendering=o,p.tail=o.sibling,p.renderingStartTime=J(),o.sibling=null,f=tr.current,W(tr,v?f&1|2:f&1),Ft&&zs(l,p.treeForkCount),o):(Pn(l),null);case 22:case 23:return ki(l),lv(),p=l.memoizedState!==null,o!==null?o.memoizedState!==null!==p&&(l.flags|=8192):p&&(l.flags|=8192),p?(f&536870912)!==0&&(l.flags&128)===0&&(Pn(l),l.subtreeFlags&6&&(l.flags|=8192)):Pn(l),f=l.updateQueue,f!==null&&Kh(l,f.retryQueue),f=null,o!==null&&o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(f=o.memoizedState.cachePool.pool),p=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(p=l.memoizedState.cachePool.pool),p!==f&&(l.flags|=2048),o!==null&&$(Ha),null;case 24:return f=null,o!==null&&(f=o.memoizedState.cache),l.memoizedState.cache!==f&&(l.flags|=2048),Ls(fr),Pn(l),null;case 25:return null;case 30:return null}throw Error(r(156,l.tag))}function z_(o,l){switch(Gy(l),l.tag){case 1:return o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 3:return Ls(fr),se(),o=l.flags,(o&65536)!==0&&(o&128)===0?(l.flags=o&-65537|128,l):null;case 26:case 27:case 5:return ye(l),null;case 31:if(l.memoizedState!==null){if(ki(l),l.alternate===null)throw Error(r(340));Ba()}return o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 13:if(ki(l),o=l.memoizedState,o!==null&&o.dehydrated!==null){if(l.alternate===null)throw Error(r(340));Ba()}return o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 19:return $(tr),null;case 4:return se(),null;case 10:return Ls(l.type),null;case 22:case 23:return ki(l),lv(),o!==null&&$(Ha),o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 24:return Ls(fr),null;case 25:return null;default:return null}}function bT(o,l){switch(Gy(l),l.tag){case 3:Ls(fr),se();break;case 26:case 27:case 5:ye(l);break;case 4:se();break;case 31:l.memoizedState!==null&&ki(l);break;case 13:ki(l);break;case 19:$(tr);break;case 10:Ls(l.type);break;case 22:case 23:ki(l),lv(),o!==null&&$(Ha);break;case 24:Ls(fr)}}function Ef(o,l){try{var f=l.updateQueue,p=f!==null?f.lastEffect:null;if(p!==null){var v=p.next;f=v;do{if((f.tag&o)===o){p=void 0;var S=f.create,D=f.inst;p=S(),D.destroy=p}f=f.next}while(f!==v)}}catch(V){hn(l,l.return,V)}}function Ll(o,l,f){try{var p=l.updateQueue,v=p!==null?p.lastEffect:null;if(v!==null){var S=v.next;p=S;do{if((p.tag&o)===o){var D=p.inst,V=D.destroy;if(V!==void 0){D.destroy=void 0,v=l;var Q=f,ce=V;try{ce()}catch(be){hn(v,Q,be)}}}p=p.next}while(p!==S)}}catch(be){hn(l,l.return,be)}}function xT(o){var l=o.updateQueue;if(l!==null){var f=o.stateNode;try{cR(l,f)}catch(p){hn(o,o.return,p)}}}function ST(o,l,f){f.props=qa(o.type,o.memoizedProps),f.state=o.memoizedState;try{f.componentWillUnmount()}catch(p){hn(o,l,p)}}function Mf(o,l){try{var f=o.ref;if(f!==null){switch(o.tag){case 26:case 27:case 5:var p=o.stateNode;break;case 30:p=o.stateNode;break;default:p=o.stateNode}typeof f=="function"?o.refCleanup=f(p):f.current=p}}catch(v){hn(o,l,v)}}function Jo(o,l){var f=o.ref,p=o.refCleanup;if(f!==null)if(typeof p=="function")try{p()}catch(v){hn(o,l,v)}finally{o.refCleanup=null,o=o.alternate,o!=null&&(o.refCleanup=null)}else if(typeof f=="function")try{f(null)}catch(v){hn(o,l,v)}else f.current=null}function wT(o){var l=o.type,f=o.memoizedProps,p=o.stateNode;try{e:switch(l){case"button":case"input":case"select":case"textarea":f.autoFocus&&p.focus();break e;case"img":f.src?p.src=f.src:f.srcSet&&(p.srcset=f.srcSet)}}catch(v){hn(o,o.return,v)}}function _v(o,l,f){try{var p=o.stateNode;nH(p,o.type,f,l),p[Nt]=l}catch(v){hn(o,o.return,v)}}function CT(o){return o.tag===5||o.tag===3||o.tag===26||o.tag===27&&Ul(o.type)||o.tag===4}function Hv(o){e:for(;;){for(;o.sibling===null;){if(o.return===null||CT(o.return))return null;o=o.return}for(o.sibling.return=o.return,o=o.sibling;o.tag!==5&&o.tag!==6&&o.tag!==18;){if(o.tag===27&&Ul(o.type)||o.flags&2||o.child===null||o.tag===4)continue e;o.child.return=o,o=o.child}if(!(o.flags&2))return o.stateNode}}function Vv(o,l,f){var p=o.tag;if(p===5||p===6)o=o.stateNode,l?(f.nodeType===9?f.body:f.nodeName==="HTML"?f.ownerDocument.body:f).insertBefore(o,l):(l=f.nodeType===9?f.body:f.nodeName==="HTML"?f.ownerDocument.body:f,l.appendChild(o),f=f._reactRootContainer,f!=null||l.onclick!==null||(l.onclick=Ur));else if(p!==4&&(p===27&&Ul(o.type)&&(f=o.stateNode,l=null),o=o.child,o!==null))for(Vv(o,l,f),o=o.sibling;o!==null;)Vv(o,l,f),o=o.sibling}function Yh(o,l,f){var p=o.tag;if(p===5||p===6)o=o.stateNode,l?f.insertBefore(o,l):f.appendChild(o);else if(p!==4&&(p===27&&Ul(o.type)&&(f=o.stateNode),o=o.child,o!==null))for(Yh(o,l,f),o=o.sibling;o!==null;)Yh(o,l,f),o=o.sibling}function RT(o){var l=o.stateNode,f=o.memoizedProps;try{for(var p=o.type,v=l.attributes;v.length;)l.removeAttributeNode(v[0]);Pr(l,p,f),l[zt]=o,l[Nt]=f}catch(S){hn(o,o.return,S)}}var Vs=!1,pr=!1,Fv=!1,TT=typeof WeakSet=="function"?WeakSet:Set,Mr=null;function N_(o,l){if(o=o.containerInfo,u0=mp,o=BC(o),Ny(o)){if("selectionStart"in o)var f={start:o.selectionStart,end:o.selectionEnd};else e:{f=(f=o.ownerDocument)&&f.defaultView||window;var p=f.getSelection&&f.getSelection();if(p&&p.rangeCount!==0){f=p.anchorNode;var v=p.anchorOffset,S=p.focusNode;p=p.focusOffset;try{f.nodeType,S.nodeType}catch{f=null;break e}var D=0,V=-1,Q=-1,ce=0,be=0,Re=o,fe=null;t:for(;;){for(var ge;Re!==f||v!==0&&Re.nodeType!==3||(V=D+v),Re!==S||p!==0&&Re.nodeType!==3||(Q=D+p),Re.nodeType===3&&(D+=Re.nodeValue.length),(ge=Re.firstChild)!==null;)fe=Re,Re=ge;for(;;){if(Re===o)break t;if(fe===f&&++ce===v&&(V=D),fe===S&&++be===p&&(Q=D),(ge=Re.nextSibling)!==null)break;Re=fe,fe=Re.parentNode}Re=ge}f=V===-1||Q===-1?null:{start:V,end:Q}}else f=null}f=f||{start:0,end:0}}else f=null;for(c0={focusedElem:o,selectionRange:f},mp=!1,Mr=l;Mr!==null;)if(l=Mr,o=l.child,(l.subtreeFlags&1028)!==0&&o!==null)o.return=l,Mr=o;else for(;Mr!==null;){switch(l=Mr,S=l.alternate,o=l.flags,l.tag){case 0:if((o&4)!==0&&(o=l.updateQueue,o=o!==null?o.events:null,o!==null))for(f=0;f<o.length;f++)v=o[f],v.ref.impl=v.nextImpl;break;case 11:case 15:break;case 1:if((o&1024)!==0&&S!==null){o=void 0,f=l,v=S.memoizedProps,S=S.memoizedState,p=f.stateNode;try{var Xe=qa(f.type,v);o=p.getSnapshotBeforeUpdate(Xe,S),p.__reactInternalSnapshotBeforeUpdate=o}catch(ut){hn(f,f.return,ut)}}break;case 3:if((o&1024)!==0){if(o=l.stateNode.containerInfo,f=o.nodeType,f===9)h0(o);else if(f===1)switch(o.nodeName){case"HEAD":case"HTML":case"BODY":h0(o);break;default:o.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((o&1024)!==0)throw Error(r(163))}if(o=l.sibling,o!==null){o.return=l.return,Mr=o;break}Mr=l.return}}function ET(o,l,f){var p=f.flags;switch(f.tag){case 0:case 11:case 15:Us(o,f),p&4&&Ef(5,f);break;case 1:if(Us(o,f),p&4)if(o=f.stateNode,l===null)try{o.componentDidMount()}catch(D){hn(f,f.return,D)}else{var v=qa(f.type,l.memoizedProps);l=l.memoizedState;try{o.componentDidUpdate(v,l,o.__reactInternalSnapshotBeforeUpdate)}catch(D){hn(f,f.return,D)}}p&64&&xT(f),p&512&&Mf(f,f.return);break;case 3:if(Us(o,f),p&64&&(o=f.updateQueue,o!==null)){if(l=null,f.child!==null)switch(f.child.tag){case 27:case 5:l=f.child.stateNode;break;case 1:l=f.child.stateNode}try{cR(o,l)}catch(D){hn(f,f.return,D)}}break;case 27:l===null&&p&4&&RT(f);case 26:case 5:Us(o,f),l===null&&p&4&&wT(f),p&512&&Mf(f,f.return);break;case 12:Us(o,f);break;case 31:Us(o,f),p&4&&OT(o,f);break;case 13:Us(o,f),p&4&&kT(o,f),p&64&&(o=f.memoizedState,o!==null&&(o=o.dehydrated,o!==null&&(f=$_.bind(null,f),cH(o,f))));break;case 22:if(p=f.memoizedState!==null||Vs,!p){l=l!==null&&l.memoizedState!==null||pr,v=Vs;var S=pr;Vs=p,(pr=l)&&!S?$s(o,f,(f.subtreeFlags&8772)!==0):Us(o,f),Vs=v,pr=S}break;case 30:break;default:Us(o,f)}}function MT(o){var l=o.alternate;l!==null&&(o.alternate=null,MT(l)),o.child=null,o.deletions=null,o.sibling=null,o.tag===5&&(l=o.stateNode,l!==null&&Aa(l)),o.stateNode=null,o.return=null,o.dependencies=null,o.memoizedProps=null,o.memoizedState=null,o.pendingProps=null,o.stateNode=null,o.updateQueue=null}var _n=null,pi=!1;function Fs(o,l,f){for(f=f.child;f!==null;)AT(o,l,f),f=f.sibling}function AT(o,l,f){if(Ct&&typeof Ct.onCommitFiberUnmount=="function")try{Ct.onCommitFiberUnmount(st,f)}catch{}switch(f.tag){case 26:pr||Jo(f,l),Fs(o,l,f),f.memoizedState?f.memoizedState.count--:f.stateNode&&(f=f.stateNode,f.parentNode.removeChild(f));break;case 27:pr||Jo(f,l);var p=_n,v=pi;Ul(f.type)&&(_n=f.stateNode,pi=!1),Fs(o,l,f),Lf(f.stateNode),_n=p,pi=v;break;case 5:pr||Jo(f,l);case 6:if(p=_n,v=pi,_n=null,Fs(o,l,f),_n=p,pi=v,_n!==null)if(pi)try{(_n.nodeType===9?_n.body:_n.nodeName==="HTML"?_n.ownerDocument.body:_n).removeChild(f.stateNode)}catch(S){hn(f,l,S)}else try{_n.removeChild(f.stateNode)}catch(S){hn(f,l,S)}break;case 18:_n!==null&&(pi?(o=_n,xE(o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,f.stateNode),ic(o)):xE(_n,f.stateNode));break;case 4:p=_n,v=pi,_n=f.stateNode.containerInfo,pi=!0,Fs(o,l,f),_n=p,pi=v;break;case 0:case 11:case 14:case 15:Ll(2,f,l),pr||Ll(4,f,l),Fs(o,l,f);break;case 1:pr||(Jo(f,l),p=f.stateNode,typeof p.componentWillUnmount=="function"&&ST(f,l,p)),Fs(o,l,f);break;case 21:Fs(o,l,f);break;case 22:pr=(p=pr)||f.memoizedState!==null,Fs(o,l,f),pr=p;break;default:Fs(o,l,f)}}function OT(o,l){if(l.memoizedState===null&&(o=l.alternate,o!==null&&(o=o.memoizedState,o!==null))){o=o.dehydrated;try{ic(o)}catch(f){hn(l,l.return,f)}}}function kT(o,l){if(l.memoizedState===null&&(o=l.alternate,o!==null&&(o=o.memoizedState,o!==null&&(o=o.dehydrated,o!==null))))try{ic(o)}catch(f){hn(l,l.return,f)}}function L_(o){switch(o.tag){case 31:case 13:case 19:var l=o.stateNode;return l===null&&(l=o.stateNode=new TT),l;case 22:return o=o.stateNode,l=o._retryCache,l===null&&(l=o._retryCache=new TT),l;default:throw Error(r(435,o.tag))}}function Xh(o,l){var f=L_(o);l.forEach(function(p){if(!f.has(p)){f.add(p);var v=q_.bind(null,o,p);p.then(v,v)}})}function gi(o,l){var f=l.deletions;if(f!==null)for(var p=0;p<f.length;p++){var v=f[p],S=o,D=l,V=D;e:for(;V!==null;){switch(V.tag){case 27:if(Ul(V.type)){_n=V.stateNode,pi=!1;break e}break;case 5:_n=V.stateNode,pi=!1;break e;case 3:case 4:_n=V.stateNode.containerInfo,pi=!0;break e}V=V.return}if(_n===null)throw Error(r(160));AT(S,D,v),_n=null,pi=!1,S=v.alternate,S!==null&&(S.return=null),v.return=null}if(l.subtreeFlags&13886)for(l=l.child;l!==null;)IT(l,o),l=l.sibling}var Eo=null;function IT(o,l){var f=o.alternate,p=o.flags;switch(o.tag){case 0:case 11:case 14:case 15:gi(l,o),mi(o),p&4&&(Ll(3,o,o.return),Ef(3,o),Ll(5,o,o.return));break;case 1:gi(l,o),mi(o),p&512&&(pr||f===null||Jo(f,f.return)),p&64&&Vs&&(o=o.updateQueue,o!==null&&(p=o.callbacks,p!==null&&(f=o.shared.hiddenCallbacks,o.shared.hiddenCallbacks=f===null?p:f.concat(p))));break;case 26:var v=Eo;if(gi(l,o),mi(o),p&512&&(pr||f===null||Jo(f,f.return)),p&4){var S=f!==null?f.memoizedState:null;if(p=o.memoizedState,f===null)if(p===null)if(o.stateNode===null){e:{p=o.type,f=o.memoizedProps,v=v.ownerDocument||v;t:switch(p){case"title":S=v.getElementsByTagName("title")[0],(!S||S[qe]||S[zt]||S.namespaceURI==="http://www.w3.org/2000/svg"||S.hasAttribute("itemprop"))&&(S=v.createElement(p),v.head.insertBefore(S,v.querySelector("head > title"))),Pr(S,p,f),S[zt]=o,Un(S),p=S;break e;case"link":var D=IE("link","href",v).get(p+(f.href||""));if(D){for(var V=0;V<D.length;V++)if(S=D[V],S.getAttribute("href")===(f.href==null||f.href===""?null:f.href)&&S.getAttribute("rel")===(f.rel==null?null:f.rel)&&S.getAttribute("title")===(f.title==null?null:f.title)&&S.getAttribute("crossorigin")===(f.crossOrigin==null?null:f.crossOrigin)){D.splice(V,1);break t}}S=v.createElement(p),Pr(S,p,f),v.head.appendChild(S);break;case"meta":if(D=IE("meta","content",v).get(p+(f.content||""))){for(V=0;V<D.length;V++)if(S=D[V],S.getAttribute("content")===(f.content==null?null:""+f.content)&&S.getAttribute("name")===(f.name==null?null:f.name)&&S.getAttribute("property")===(f.property==null?null:f.property)&&S.getAttribute("http-equiv")===(f.httpEquiv==null?null:f.httpEquiv)&&S.getAttribute("charset")===(f.charSet==null?null:f.charSet)){D.splice(V,1);break t}}S=v.createElement(p),Pr(S,p,f),v.head.appendChild(S);break;default:throw Error(r(468,p))}S[zt]=o,Un(S),p=S}o.stateNode=p}else DE(v,o.type,o.stateNode);else o.stateNode=kE(v,p,o.memoizedProps);else S!==p?(S===null?f.stateNode!==null&&(f=f.stateNode,f.parentNode.removeChild(f)):S.count--,p===null?DE(v,o.type,o.stateNode):kE(v,p,o.memoizedProps)):p===null&&o.stateNode!==null&&_v(o,o.memoizedProps,f.memoizedProps)}break;case 27:gi(l,o),mi(o),p&512&&(pr||f===null||Jo(f,f.return)),f!==null&&p&4&&_v(o,o.memoizedProps,f.memoizedProps);break;case 5:if(gi(l,o),mi(o),p&512&&(pr||f===null||Jo(f,f.return)),o.flags&32){v=o.stateNode;try{$i(v,"")}catch(Xe){hn(o,o.return,Xe)}}p&4&&o.stateNode!=null&&(v=o.memoizedProps,_v(o,v,f!==null?f.memoizedProps:v)),p&1024&&(Fv=!0);break;case 6:if(gi(l,o),mi(o),p&4){if(o.stateNode===null)throw Error(r(162));p=o.memoizedProps,f=o.stateNode;try{f.nodeValue=p}catch(Xe){hn(o,o.return,Xe)}}break;case 3:if(dp=null,v=Eo,Eo=cp(l.containerInfo),gi(l,o),Eo=v,mi(o),p&4&&f!==null&&f.memoizedState.isDehydrated)try{ic(l.containerInfo)}catch(Xe){hn(o,o.return,Xe)}Fv&&(Fv=!1,DT(o));break;case 4:p=Eo,Eo=cp(o.stateNode.containerInfo),gi(l,o),mi(o),Eo=p;break;case 12:gi(l,o),mi(o);break;case 31:gi(l,o),mi(o),p&4&&(p=o.updateQueue,p!==null&&(o.updateQueue=null,Xh(o,p)));break;case 13:gi(l,o),mi(o),o.child.flags&8192&&o.memoizedState!==null!=(f!==null&&f.memoizedState!==null)&&(Zh=J()),p&4&&(p=o.updateQueue,p!==null&&(o.updateQueue=null,Xh(o,p)));break;case 22:v=o.memoizedState!==null;var Q=f!==null&&f.memoizedState!==null,ce=Vs,be=pr;if(Vs=ce||v,pr=be||Q,gi(l,o),pr=be,Vs=ce,mi(o),p&8192)e:for(l=o.stateNode,l._visibility=v?l._visibility&-2:l._visibility|1,v&&(f===null||Q||Vs||pr||Ga(o)),f=null,l=o;;){if(l.tag===5||l.tag===26){if(f===null){Q=f=l;try{if(S=Q.stateNode,v)D=S.style,typeof D.setProperty=="function"?D.setProperty("display","none","important"):D.display="none";else{V=Q.stateNode;var Re=Q.memoizedProps.style,fe=Re!=null&&Re.hasOwnProperty("display")?Re.display:null;V.style.display=fe==null||typeof fe=="boolean"?"":(""+fe).trim()}}catch(Xe){hn(Q,Q.return,Xe)}}}else if(l.tag===6){if(f===null){Q=l;try{Q.stateNode.nodeValue=v?"":Q.memoizedProps}catch(Xe){hn(Q,Q.return,Xe)}}}else if(l.tag===18){if(f===null){Q=l;try{var ge=Q.stateNode;v?SE(ge,!0):SE(Q.stateNode,!1)}catch(Xe){hn(Q,Q.return,Xe)}}}else if((l.tag!==22&&l.tag!==23||l.memoizedState===null||l===o)&&l.child!==null){l.child.return=l,l=l.child;continue}if(l===o)break e;for(;l.sibling===null;){if(l.return===null||l.return===o)break e;f===l&&(f=null),l=l.return}f===l&&(f=null),l.sibling.return=l.return,l=l.sibling}p&4&&(p=o.updateQueue,p!==null&&(f=p.retryQueue,f!==null&&(p.retryQueue=null,Xh(o,f))));break;case 19:gi(l,o),mi(o),p&4&&(p=o.updateQueue,p!==null&&(o.updateQueue=null,Xh(o,p)));break;case 30:break;case 21:break;default:gi(l,o),mi(o)}}function mi(o){var l=o.flags;if(l&2){try{for(var f,p=o.return;p!==null;){if(CT(p)){f=p;break}p=p.return}if(f==null)throw Error(r(160));switch(f.tag){case 27:var v=f.stateNode,S=Hv(o);Yh(o,S,v);break;case 5:var D=f.stateNode;f.flags&32&&($i(D,""),f.flags&=-33);var V=Hv(o);Yh(o,V,D);break;case 3:case 4:var Q=f.stateNode.containerInfo,ce=Hv(o);Vv(o,ce,Q);break;default:throw Error(r(161))}}catch(be){hn(o,o.return,be)}o.flags&=-3}l&4096&&(o.flags&=-4097)}function DT(o){if(o.subtreeFlags&1024)for(o=o.child;o!==null;){var l=o;DT(l),l.tag===5&&l.flags&1024&&l.stateNode.reset(),o=o.sibling}}function Us(o,l){if(l.subtreeFlags&8772)for(l=l.child;l!==null;)ET(o,l.alternate,l),l=l.sibling}function Ga(o){for(o=o.child;o!==null;){var l=o;switch(l.tag){case 0:case 11:case 14:case 15:Ll(4,l,l.return),Ga(l);break;case 1:Jo(l,l.return);var f=l.stateNode;typeof f.componentWillUnmount=="function"&&ST(l,l.return,f),Ga(l);break;case 27:Lf(l.stateNode);case 26:case 5:Jo(l,l.return),Ga(l);break;case 22:l.memoizedState===null&&Ga(l);break;case 30:Ga(l);break;default:Ga(l)}o=o.sibling}}function $s(o,l,f){for(f=f&&(l.subtreeFlags&8772)!==0,l=l.child;l!==null;){var p=l.alternate,v=o,S=l,D=S.flags;switch(S.tag){case 0:case 11:case 15:$s(v,S,f),Ef(4,S);break;case 1:if($s(v,S,f),p=S,v=p.stateNode,typeof v.componentDidMount=="function")try{v.componentDidMount()}catch(ce){hn(p,p.return,ce)}if(p=S,v=p.updateQueue,v!==null){var V=p.stateNode;try{var Q=v.shared.hiddenCallbacks;if(Q!==null)for(v.shared.hiddenCallbacks=null,v=0;v<Q.length;v++)uR(Q[v],V)}catch(ce){hn(p,p.return,ce)}}f&&D&64&&xT(S),Mf(S,S.return);break;case 27:RT(S);case 26:case 5:$s(v,S,f),f&&p===null&&D&4&&wT(S),Mf(S,S.return);break;case 12:$s(v,S,f);break;case 31:$s(v,S,f),f&&D&4&&OT(v,S);break;case 13:$s(v,S,f),f&&D&4&&kT(v,S);break;case 22:S.memoizedState===null&&$s(v,S,f),Mf(S,S.return);break;case 30:break;default:$s(v,S,f)}l=l.sibling}}function Uv(o,l){var f=null;o!==null&&o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(f=o.memoizedState.cachePool.pool),o=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(o=l.memoizedState.cachePool.pool),o!==f&&(o!=null&&o.refCount++,f!=null&&hf(f))}function $v(o,l){o=null,l.alternate!==null&&(o=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==o&&(l.refCount++,o!=null&&hf(o))}function Mo(o,l,f,p){if(l.subtreeFlags&10256)for(l=l.child;l!==null;)PT(o,l,f,p),l=l.sibling}function PT(o,l,f,p){var v=l.flags;switch(l.tag){case 0:case 11:case 15:Mo(o,l,f,p),v&2048&&Ef(9,l);break;case 1:Mo(o,l,f,p);break;case 3:Mo(o,l,f,p),v&2048&&(o=null,l.alternate!==null&&(o=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==o&&(l.refCount++,o!=null&&hf(o)));break;case 12:if(v&2048){Mo(o,l,f,p),o=l.stateNode;try{var S=l.memoizedProps,D=S.id,V=S.onPostCommit;typeof V=="function"&&V(D,l.alternate===null?"mount":"update",o.passiveEffectDuration,-0)}catch(Q){hn(l,l.return,Q)}}else Mo(o,l,f,p);break;case 31:Mo(o,l,f,p);break;case 13:Mo(o,l,f,p);break;case 23:break;case 22:S=l.stateNode,D=l.alternate,l.memoizedState!==null?S._visibility&2?Mo(o,l,f,p):Af(o,l):S._visibility&2?Mo(o,l,f,p):(S._visibility|=2,Wu(o,l,f,p,(l.subtreeFlags&10256)!==0||!1)),v&2048&&Uv(D,l);break;case 24:Mo(o,l,f,p),v&2048&&$v(l.alternate,l);break;default:Mo(o,l,f,p)}}function Wu(o,l,f,p,v){for(v=v&&((l.subtreeFlags&10256)!==0||!1),l=l.child;l!==null;){var S=o,D=l,V=f,Q=p,ce=D.flags;switch(D.tag){case 0:case 11:case 15:Wu(S,D,V,Q,v),Ef(8,D);break;case 23:break;case 22:var be=D.stateNode;D.memoizedState!==null?be._visibility&2?Wu(S,D,V,Q,v):Af(S,D):(be._visibility|=2,Wu(S,D,V,Q,v)),v&&ce&2048&&Uv(D.alternate,D);break;case 24:Wu(S,D,V,Q,v),v&&ce&2048&&$v(D.alternate,D);break;default:Wu(S,D,V,Q,v)}l=l.sibling}}function Af(o,l){if(l.subtreeFlags&10256)for(l=l.child;l!==null;){var f=o,p=l,v=p.flags;switch(p.tag){case 22:Af(f,p),v&2048&&Uv(p.alternate,p);break;case 24:Af(f,p),v&2048&&$v(p.alternate,p);break;default:Af(f,p)}l=l.sibling}}var Of=8192;function Ku(o,l,f){if(o.subtreeFlags&Of)for(o=o.child;o!==null;)zT(o,l,f),o=o.sibling}function zT(o,l,f){switch(o.tag){case 26:Ku(o,l,f),o.flags&Of&&o.memoizedState!==null&&wH(f,Eo,o.memoizedState,o.memoizedProps);break;case 5:Ku(o,l,f);break;case 3:case 4:var p=Eo;Eo=cp(o.stateNode.containerInfo),Ku(o,l,f),Eo=p;break;case 22:o.memoizedState===null&&(p=o.alternate,p!==null&&p.memoizedState!==null?(p=Of,Of=16777216,Ku(o,l,f),Of=p):Ku(o,l,f));break;default:Ku(o,l,f)}}function NT(o){var l=o.alternate;if(l!==null&&(o=l.child,o!==null)){l.child=null;do l=o.sibling,o.sibling=null,o=l;while(o!==null)}}function kf(o){var l=o.deletions;if((o.flags&16)!==0){if(l!==null)for(var f=0;f<l.length;f++){var p=l[f];Mr=p,BT(p,o)}NT(o)}if(o.subtreeFlags&10256)for(o=o.child;o!==null;)LT(o),o=o.sibling}function LT(o){switch(o.tag){case 0:case 11:case 15:kf(o),o.flags&2048&&Ll(9,o,o.return);break;case 3:kf(o);break;case 12:kf(o);break;case 22:var l=o.stateNode;o.memoizedState!==null&&l._visibility&2&&(o.return===null||o.return.tag!==13)?(l._visibility&=-3,Qh(o)):kf(o);break;default:kf(o)}}function Qh(o){var l=o.deletions;if((o.flags&16)!==0){if(l!==null)for(var f=0;f<l.length;f++){var p=l[f];Mr=p,BT(p,o)}NT(o)}for(o=o.child;o!==null;){switch(l=o,l.tag){case 0:case 11:case 15:Ll(8,l,l.return),Qh(l);break;case 22:f=l.stateNode,f._visibility&2&&(f._visibility&=-3,Qh(l));break;default:Qh(l)}o=o.sibling}}function BT(o,l){for(;Mr!==null;){var f=Mr;switch(f.tag){case 0:case 11:case 15:Ll(8,f,l);break;case 23:case 22:if(f.memoizedState!==null&&f.memoizedState.cachePool!==null){var p=f.memoizedState.cachePool.pool;p!=null&&p.refCount++}break;case 24:hf(f.memoizedState.cache)}if(p=f.child,p!==null)p.return=f,Mr=p;else e:for(f=o;Mr!==null;){p=Mr;var v=p.sibling,S=p.return;if(MT(p),p===f){Mr=null;break e}if(v!==null){v.return=S,Mr=v;break e}Mr=S}}}var B_={getCacheForType:function(o){var l=Ir(fr),f=l.data.get(o);return f===void 0&&(f=o(),l.data.set(o,f)),f},cacheSignal:function(){return Ir(fr).controller.signal}},j_=typeof WeakMap=="function"?WeakMap:Map,sn=0,En=null,Lt=null,_t=0,dn=0,Ii=null,Bl=!1,Yu=!1,qv=!1,qs=0,Kn=0,jl=0,Wa=0,Gv=0,Di=0,Xu=0,If=null,yi=null,Wv=!1,Zh=0,jT=0,Jh=1/0,ep=null,_l=null,yr=0,Hl=null,Qu=null,Gs=0,Kv=0,Yv=null,_T=null,Df=0,Xv=null;function Pi(){return(sn&2)!==0&&_t!==0?_t&-_t:B.T!==null?n0():jn()}function HT(){if(Di===0)if((_t&536870912)===0||Ft){var o=$t;$t<<=1,($t&3932160)===0&&($t=262144),Di=o}else Di=536870912;return o=Oi.current,o!==null&&(o.flags|=32),Di}function vi(o,l,f){(o===En&&(dn===2||dn===9)||o.cancelPendingCommit!==null)&&(Zu(o,0),Vl(o,_t,Di,!1)),kn(o,f),((sn&2)===0||o!==En)&&(o===En&&((sn&2)===0&&(Wa|=f),Kn===4&&Vl(o,_t,Di,!1)),es(o))}function VT(o,l,f){if((sn&6)!==0)throw Error(r(327));var p=!f&&(l&127)===0&&(l&o.expiredLanes)===0||nn(o,l),v=p?V_(o,l):Zv(o,l,!0),S=p;do{if(v===0){Yu&&!p&&Vl(o,l,0,!1);break}else{if(f=o.current.alternate,S&&!__(f)){v=Zv(o,l,!1),S=!1;continue}if(v===2){if(S=l,o.errorRecoveryDisabledLanes&S)var D=0;else D=o.pendingLanes&-536870913,D=D!==0?D:D&536870912?536870912:0;if(D!==0){l=D;e:{var V=o;v=If;var Q=V.current.memoizedState.isDehydrated;if(Q&&(Zu(V,D).flags|=256),D=Zv(V,D,!1),D!==2){if(qv&&!Q){V.errorRecoveryDisabledLanes|=S,Wa|=S,v=4;break e}S=yi,yi=v,S!==null&&(yi===null?yi=S:yi.push.apply(yi,S))}v=D}if(S=!1,v!==2)continue}}if(v===1){Zu(o,0),Vl(o,l,0,!0);break}e:{switch(p=o,S=v,S){case 0:case 1:throw Error(r(345));case 4:if((l&4194048)!==l)break;case 6:Vl(p,l,Di,!Bl);break e;case 2:yi=null;break;case 3:case 5:break;default:throw Error(r(329))}if((l&62914560)===l&&(v=Zh+300-J(),10<v)){if(Vl(p,l,Di,!Bl),nt(p,0,!0)!==0)break e;Gs=l,p.timeoutHandle=vE(FT.bind(null,p,f,yi,ep,Wv,l,Di,Wa,Xu,Bl,S,"Throttled",-0,0),v);break e}FT(p,f,yi,ep,Wv,l,Di,Wa,Xu,Bl,S,null,-0,0)}}break}while(!0);es(o)}function FT(o,l,f,p,v,S,D,V,Q,ce,be,Re,fe,ge){if(o.timeoutHandle=-1,Re=l.subtreeFlags,Re&8192||(Re&16785408)===16785408){Re={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ur},zT(l,S,Re);var Xe=(S&62914560)===S?Zh-J():(S&4194048)===S?jT-J():0;if(Xe=CH(Re,Xe),Xe!==null){Gs=S,o.cancelPendingCommit=Xe(XT.bind(null,o,l,S,f,p,v,D,V,Q,be,Re,null,fe,ge)),Vl(o,S,D,!ce);return}}XT(o,l,S,f,p,v,D,V,Q)}function __(o){for(var l=o;;){var f=l.tag;if((f===0||f===11||f===15)&&l.flags&16384&&(f=l.updateQueue,f!==null&&(f=f.stores,f!==null)))for(var p=0;p<f.length;p++){var v=f[p],S=v.getSnapshot;v=v.value;try{if(!Mi(S(),v))return!1}catch{return!1}}if(f=l.child,l.subtreeFlags&16384&&f!==null)f.return=l,l=f;else{if(l===o)break;for(;l.sibling===null;){if(l.return===null||l.return===o)return!0;l=l.return}l.sibling.return=l.return,l=l.sibling}}return!0}function Vl(o,l,f,p){l&=~Gv,l&=~Wa,o.suspendedLanes|=l,o.pingedLanes&=~l,p&&(o.warmLanes|=l),p=o.expirationTimes;for(var v=l;0<v;){var S=31-at(v),D=1<<S;p[S]=-1,v&=~D}f!==0&&Hr(o,f,l)}function tp(){return(sn&6)===0?(Pf(0),!1):!0}function Qv(){if(Lt!==null){if(dn===0)var o=Lt.return;else o=Lt,Ns=ja=null,hv(o),Fu=null,gf=0,o=Lt;for(;o!==null;)bT(o.alternate,o),o=o.return;Lt=null}}function Zu(o,l){var f=o.timeoutHandle;f!==-1&&(o.timeoutHandle=-1,oH(f)),f=o.cancelPendingCommit,f!==null&&(o.cancelPendingCommit=null,f()),Gs=0,Qv(),En=o,Lt=f=Ps(o.current,null),_t=l,dn=0,Ii=null,Bl=!1,Yu=nn(o,l),qv=!1,Xu=Di=Gv=Wa=jl=Kn=0,yi=If=null,Wv=!1,(l&8)!==0&&(l|=l&32);var p=o.entangledLanes;if(p!==0)for(o=o.entanglements,p&=l;0<p;){var v=31-at(p),S=1<<v;l|=o[v],p&=~S}return qs=l,wh(),f}function UT(o,l){Rt=null,B.H=Cf,l===Vu||l===kh?(l=oR(),dn=3):l===tv?(l=oR(),dn=4):dn=l===Ov?8:l!==null&&typeof l=="object"&&typeof l.then=="function"?6:1,Ii=l,Lt===null&&(Kn=1,$h(o,Gi(l,o.current)))}function $T(){var o=Oi.current;return o===null?!0:(_t&4194048)===_t?Xi===null:(_t&62914560)===_t||(_t&536870912)!==0?o===Xi:!1}function qT(){var o=B.H;return B.H=Cf,o===null?Cf:o}function GT(){var o=B.A;return B.A=B_,o}function np(){Kn=4,Bl||(_t&4194048)!==_t&&Oi.current!==null||(Yu=!0),(jl&134217727)===0&&(Wa&134217727)===0||En===null||Vl(En,_t,Di,!1)}function Zv(o,l,f){var p=sn;sn|=2;var v=qT(),S=GT();(En!==o||_t!==l)&&(ep=null,Zu(o,l)),l=!1;var D=Kn;e:do try{if(dn!==0&&Lt!==null){var V=Lt,Q=Ii;switch(dn){case 8:Qv(),D=6;break e;case 3:case 2:case 9:case 6:Oi.current===null&&(l=!0);var ce=dn;if(dn=0,Ii=null,Ju(o,V,Q,ce),f&&Yu){D=0;break e}break;default:ce=dn,dn=0,Ii=null,Ju(o,V,Q,ce)}}H_(),D=Kn;break}catch(be){UT(o,be)}while(!0);return l&&o.shellSuspendCounter++,Ns=ja=null,sn=p,B.H=v,B.A=S,Lt===null&&(En=null,_t=0,wh()),D}function H_(){for(;Lt!==null;)WT(Lt)}function V_(o,l){var f=sn;sn|=2;var p=qT(),v=GT();En!==o||_t!==l?(ep=null,Jh=J()+500,Zu(o,l)):Yu=nn(o,l);e:do try{if(dn!==0&&Lt!==null){l=Lt;var S=Ii;t:switch(dn){case 1:dn=0,Ii=null,Ju(o,l,S,1);break;case 2:case 9:if(rR(S)){dn=0,Ii=null,KT(l);break}l=function(){dn!==2&&dn!==9||En!==o||(dn=7),es(o)},S.then(l,l);break e;case 3:dn=7;break e;case 4:dn=5;break e;case 7:rR(S)?(dn=0,Ii=null,KT(l)):(dn=0,Ii=null,Ju(o,l,S,7));break;case 5:var D=null;switch(Lt.tag){case 26:D=Lt.memoizedState;case 5:case 27:var V=Lt;if(D?PE(D):V.stateNode.complete){dn=0,Ii=null;var Q=V.sibling;if(Q!==null)Lt=Q;else{var ce=V.return;ce!==null?(Lt=ce,rp(ce)):Lt=null}break t}}dn=0,Ii=null,Ju(o,l,S,5);break;case 6:dn=0,Ii=null,Ju(o,l,S,6);break;case 8:Qv(),Kn=6;break e;default:throw Error(r(462))}}F_();break}catch(be){UT(o,be)}while(!0);return Ns=ja=null,B.H=p,B.A=v,sn=f,Lt!==null?0:(En=null,_t=0,wh(),Kn)}function F_(){for(;Lt!==null&&!Pe();)WT(Lt)}function WT(o){var l=yT(o.alternate,o,qs);o.memoizedProps=o.pendingProps,l===null?rp(o):Lt=l}function KT(o){var l=o,f=l.alternate;switch(l.tag){case 15:case 0:l=fT(f,l,l.pendingProps,l.type,void 0,_t);break;case 11:l=fT(f,l,l.pendingProps,l.type.render,l.ref,_t);break;case 5:hv(l);default:bT(f,l),l=Lt=GC(l,qs),l=yT(f,l,qs)}o.memoizedProps=o.pendingProps,l===null?rp(o):Lt=l}function Ju(o,l,f,p){Ns=ja=null,hv(l),Fu=null,gf=0;var v=l.return;try{if(k_(o,v,l,f,_t)){Kn=1,$h(o,Gi(f,o.current)),Lt=null;return}}catch(S){if(v!==null)throw Lt=v,S;Kn=1,$h(o,Gi(f,o.current)),Lt=null;return}l.flags&32768?(Ft||p===1?o=!0:Yu||(_t&536870912)!==0?o=!1:(Bl=o=!0,(p===2||p===9||p===3||p===6)&&(p=Oi.current,p!==null&&p.tag===13&&(p.flags|=16384))),YT(l,o)):rp(l)}function rp(o){var l=o;do{if((l.flags&32768)!==0){YT(l,Bl);return}o=l.return;var f=P_(l.alternate,l,qs);if(f!==null){Lt=f;return}if(l=l.sibling,l!==null){Lt=l;return}Lt=l=o}while(l!==null);Kn===0&&(Kn=5)}function YT(o,l){do{var f=z_(o.alternate,o);if(f!==null){f.flags&=32767,Lt=f;return}if(f=o.return,f!==null&&(f.flags|=32768,f.subtreeFlags=0,f.deletions=null),!l&&(o=o.sibling,o!==null)){Lt=o;return}Lt=o=f}while(o!==null);Kn=6,Lt=null}function XT(o,l,f,p,v,S,D,V,Q){o.cancelPendingCommit=null;do ip();while(yr!==0);if((sn&6)!==0)throw Error(r(327));if(l!==null){if(l===o.current)throw Error(r(177));if(S=l.lanes|l.childLanes,S|=Hy,Pt(o,f,S,D,V,Q),o===En&&(Lt=En=null,_t=0),Qu=l,Hl=o,Gs=f,Kv=S,Yv=v,_T=p,(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?(o.callbackNode=null,o.callbackPriority=0,G_(me,function(){return tE(),null})):(o.callbackNode=null,o.callbackPriority=0),p=(l.flags&13878)!==0,(l.subtreeFlags&13878)!==0||p){p=B.T,B.T=null,v=q.p,q.p=2,D=sn,sn|=4;try{N_(o,l,f)}finally{sn=D,q.p=v,B.T=p}}yr=1,QT(),ZT(),JT()}}function QT(){if(yr===1){yr=0;var o=Hl,l=Qu,f=(l.flags&13878)!==0;if((l.subtreeFlags&13878)!==0||f){f=B.T,B.T=null;var p=q.p;q.p=2;var v=sn;sn|=4;try{IT(l,o);var S=c0,D=BC(o.containerInfo),V=S.focusedElem,Q=S.selectionRange;if(D!==V&&V&&V.ownerDocument&&LC(V.ownerDocument.documentElement,V)){if(Q!==null&&Ny(V)){var ce=Q.start,be=Q.end;if(be===void 0&&(be=ce),"selectionStart"in V)V.selectionStart=ce,V.selectionEnd=Math.min(be,V.value.length);else{var Re=V.ownerDocument||document,fe=Re&&Re.defaultView||window;if(fe.getSelection){var ge=fe.getSelection(),Xe=V.textContent.length,ut=Math.min(Q.start,Xe),xn=Q.end===void 0?ut:Math.min(Q.end,Xe);!ge.extend&&ut>xn&&(D=xn,xn=ut,ut=D);var re=NC(V,ut),te=NC(V,xn);if(re&&te&&(ge.rangeCount!==1||ge.anchorNode!==re.node||ge.anchorOffset!==re.offset||ge.focusNode!==te.node||ge.focusOffset!==te.offset)){var ue=Re.createRange();ue.setStart(re.node,re.offset),ge.removeAllRanges(),ut>xn?(ge.addRange(ue),ge.extend(te.node,te.offset)):(ue.setEnd(te.node,te.offset),ge.addRange(ue))}}}}for(Re=[],ge=V;ge=ge.parentNode;)ge.nodeType===1&&Re.push({element:ge,left:ge.scrollLeft,top:ge.scrollTop});for(typeof V.focus=="function"&&V.focus(),V=0;V<Re.length;V++){var Ce=Re[V];Ce.element.scrollLeft=Ce.left,Ce.element.scrollTop=Ce.top}}mp=!!u0,c0=u0=null}finally{sn=v,q.p=p,B.T=f}}o.current=l,yr=2}}function ZT(){if(yr===2){yr=0;var o=Hl,l=Qu,f=(l.flags&8772)!==0;if((l.subtreeFlags&8772)!==0||f){f=B.T,B.T=null;var p=q.p;q.p=2;var v=sn;sn|=4;try{ET(o,l.alternate,l)}finally{sn=v,q.p=p,B.T=f}}yr=3}}function JT(){if(yr===4||yr===3){yr=0,ne();var o=Hl,l=Qu,f=Gs,p=_T;(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?yr=5:(yr=0,Qu=Hl=null,eE(o,o.pendingLanes));var v=o.pendingLanes;if(v===0&&(_l=null),qn(f),l=l.stateNode,Ct&&typeof Ct.onCommitFiberRoot=="function")try{Ct.onCommitFiberRoot(st,l,void 0,(l.current.flags&128)===128)}catch{}if(p!==null){l=B.T,v=q.p,q.p=2,B.T=null;try{for(var S=o.onRecoverableError,D=0;D<p.length;D++){var V=p[D];S(V.value,{componentStack:V.stack})}}finally{B.T=l,q.p=v}}(Gs&3)!==0&&ip(),es(o),v=o.pendingLanes,(f&261930)!==0&&(v&42)!==0?o===Xv?Df++:(Df=0,Xv=o):Df=0,Pf(0)}}function eE(o,l){(o.pooledCacheLanes&=l)===0&&(l=o.pooledCache,l!=null&&(o.pooledCache=null,hf(l)))}function ip(){return QT(),ZT(),JT(),tE()}function tE(){if(yr!==5)return!1;var o=Hl,l=Kv;Kv=0;var f=qn(Gs),p=B.T,v=q.p;try{q.p=32>f?32:f,B.T=null,f=Yv,Yv=null;var S=Hl,D=Gs;if(yr=0,Qu=Hl=null,Gs=0,(sn&6)!==0)throw Error(r(331));var V=sn;if(sn|=4,LT(S.current),PT(S,S.current,D,f),sn=V,Pf(0,!1),Ct&&typeof Ct.onPostCommitFiberRoot=="function")try{Ct.onPostCommitFiberRoot(st,S)}catch{}return!0}finally{q.p=v,B.T=p,eE(o,l)}}function nE(o,l,f){l=Gi(f,l),l=Av(o.stateNode,l,2),o=Pl(o,l,2),o!==null&&(kn(o,2),es(o))}function hn(o,l,f){if(o.tag===3)nE(o,o,f);else for(;l!==null;){if(l.tag===3){nE(l,o,f);break}else if(l.tag===1){var p=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof p.componentDidCatch=="function"&&(_l===null||!_l.has(p))){o=Gi(f,o),f=rT(2),p=Pl(l,f,2),p!==null&&(iT(f,p,l,o),kn(p,2),es(p));break}}l=l.return}}function Jv(o,l,f){var p=o.pingCache;if(p===null){p=o.pingCache=new j_;var v=new Set;p.set(l,v)}else v=p.get(l),v===void 0&&(v=new Set,p.set(l,v));v.has(f)||(qv=!0,v.add(f),o=U_.bind(null,o,l,f),l.then(o,o))}function U_(o,l,f){var p=o.pingCache;p!==null&&p.delete(l),o.pingedLanes|=o.suspendedLanes&f,o.warmLanes&=~f,En===o&&(_t&f)===f&&(Kn===4||Kn===3&&(_t&62914560)===_t&&300>J()-Zh?(sn&2)===0&&Zu(o,0):Gv|=f,Xu===_t&&(Xu=0)),es(o)}function rE(o,l){l===0&&(l=Fn()),o=Na(o,l),o!==null&&(kn(o,l),es(o))}function $_(o){var l=o.memoizedState,f=0;l!==null&&(f=l.retryLane),rE(o,f)}function q_(o,l){var f=0;switch(o.tag){case 31:case 13:var p=o.stateNode,v=o.memoizedState;v!==null&&(f=v.retryLane);break;case 19:p=o.stateNode;break;case 22:p=o.stateNode._retryCache;break;default:throw Error(r(314))}p!==null&&p.delete(l),rE(o,f)}function G_(o,l){return oe(o,l)}var op=null,ec=null,e0=!1,sp=!1,t0=!1,Fl=0;function es(o){o!==ec&&o.next===null&&(ec===null?op=ec=o:ec=ec.next=o),sp=!0,e0||(e0=!0,K_())}function Pf(o,l){if(!t0&&sp){t0=!0;do for(var f=!1,p=op;p!==null;){if(o!==0){var v=p.pendingLanes;if(v===0)var S=0;else{var D=p.suspendedLanes,V=p.pingedLanes;S=(1<<31-at(42|o)+1)-1,S&=v&~(D&~V),S=S&201326741?S&201326741|1:S?S|2:0}S!==0&&(f=!0,lE(p,S))}else S=_t,S=nt(p,p===En?S:0,p.cancelPendingCommit!==null||p.timeoutHandle!==-1),(S&3)===0||nn(p,S)||(f=!0,lE(p,S));p=p.next}while(f);t0=!1}}function W_(){iE()}function iE(){sp=e0=!1;var o=0;Fl!==0&&iH()&&(o=Fl);for(var l=J(),f=null,p=op;p!==null;){var v=p.next,S=oE(p,l);S===0?(p.next=null,f===null?op=v:f.next=v,v===null&&(ec=f)):(f=p,(o!==0||(S&3)!==0)&&(sp=!0)),p=v}yr!==0&&yr!==5||Pf(o),Fl!==0&&(Fl=0)}function oE(o,l){for(var f=o.suspendedLanes,p=o.pingedLanes,v=o.expirationTimes,S=o.pendingLanes&-62914561;0<S;){var D=31-at(S),V=1<<D,Q=v[D];Q===-1?((V&f)===0||(V&p)!==0)&&(v[D]=Vn(V,l)):Q<=l&&(o.expiredLanes|=V),S&=~V}if(l=En,f=_t,f=nt(o,o===l?f:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),p=o.callbackNode,f===0||o===l&&(dn===2||dn===9)||o.cancelPendingCommit!==null)return p!==null&&p!==null&&xe(p),o.callbackNode=null,o.callbackPriority=0;if((f&3)===0||nn(o,f)){if(l=f&-f,l===o.callbackPriority)return l;switch(p!==null&&xe(p),qn(f)){case 2:case 8:f=de;break;case 32:f=me;break;case 268435456:f=Ke;break;default:f=me}return p=sE.bind(null,o),f=oe(f,p),o.callbackPriority=l,o.callbackNode=f,l}return p!==null&&p!==null&&xe(p),o.callbackPriority=2,o.callbackNode=null,2}function sE(o,l){if(yr!==0&&yr!==5)return o.callbackNode=null,o.callbackPriority=0,null;var f=o.callbackNode;if(ip()&&o.callbackNode!==f)return null;var p=_t;return p=nt(o,o===En?p:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),p===0?null:(VT(o,p,l),oE(o,J()),o.callbackNode!=null&&o.callbackNode===f?sE.bind(null,o):null)}function lE(o,l){if(ip())return null;VT(o,l,!0)}function K_(){sH(function(){(sn&6)!==0?oe(we,W_):iE()})}function n0(){if(Fl===0){var o=_u;o===0&&(o=Vt,Vt<<=1,(Vt&261888)===0&&(Vt=256)),Fl=o}return Fl}function aE(o){return o==null||typeof o=="symbol"||typeof o=="boolean"?null:typeof o=="function"?o:wo(""+o)}function uE(o,l){var f=l.ownerDocument.createElement("input");return f.name=l.name,f.value=l.value,o.id&&f.setAttribute("form",o.id),l.parentNode.insertBefore(f,l),o=new FormData(o),f.parentNode.removeChild(f),o}function Y_(o,l,f,p,v){if(l==="submit"&&f&&f.stateNode===v){var S=aE((v[Nt]||null).action),D=p.submitter;D&&(l=(l=D[Nt]||null)?aE(l.formAction):D.getAttribute("formAction"),l!==null&&(S=l,D=null));var V=new Ou("action","action",null,p,v);o.push({event:V,listeners:[{instance:null,listener:function(){if(p.defaultPrevented){if(Fl!==0){var Q=D?uE(v,D):new FormData(v);wv(f,{pending:!0,data:Q,method:v.method,action:S},null,Q)}}else typeof S=="function"&&(V.preventDefault(),Q=D?uE(v,D):new FormData(v),wv(f,{pending:!0,data:Q,method:v.method,action:S},S,Q))},currentTarget:v}]})}}for(var r0=0;r0<_y.length;r0++){var i0=_y[r0],X_=i0.toLowerCase(),Q_=i0[0].toUpperCase()+i0.slice(1);To(X_,"on"+Q_)}To(HC,"onAnimationEnd"),To(VC,"onAnimationIteration"),To(FC,"onAnimationStart"),To("dblclick","onDoubleClick"),To("focusin","onFocus"),To("focusout","onBlur"),To(h_,"onTransitionRun"),To(p_,"onTransitionStart"),To(g_,"onTransitionCancel"),To(UC,"onTransitionEnd"),xo("onMouseEnter",["mouseout","mouseover"]),xo("onMouseLeave",["mouseout","mouseover"]),xo("onPointerEnter",["pointerout","pointerover"]),xo("onPointerLeave",["pointerout","pointerover"]),Fi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Fi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Fi("onBeforeInput",["compositionend","keypress","textInput","paste"]),Fi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Fi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Fi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var zf="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Z_=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(zf));function cE(o,l){l=(l&4)!==0;for(var f=0;f<o.length;f++){var p=o[f],v=p.event;p=p.listeners;e:{var S=void 0;if(l)for(var D=p.length-1;0<=D;D--){var V=p[D],Q=V.instance,ce=V.currentTarget;if(V=V.listener,Q!==S&&v.isPropagationStopped())break e;S=V,v.currentTarget=ce;try{S(v)}catch(be){Sh(be)}v.currentTarget=null,S=Q}else for(D=0;D<p.length;D++){if(V=p[D],Q=V.instance,ce=V.currentTarget,V=V.listener,Q!==S&&v.isPropagationStopped())break e;S=V,v.currentTarget=ce;try{S(v)}catch(be){Sh(be)}v.currentTarget=null,S=Q}}}}function Bt(o,l){var f=l[Er];f===void 0&&(f=l[Er]=new Set);var p=o+"__bubble";f.has(p)||(fE(l,o,2,!1),f.add(p))}function o0(o,l,f){var p=0;l&&(p|=4),fE(f,o,p,l)}var lp="_reactListening"+Math.random().toString(36).slice(2);function s0(o){if(!o[lp]){o[lp]=!0,ur.forEach(function(f){f!=="selectionchange"&&(Z_.has(f)||o0(f,!1,o),o0(f,!0,o))});var l=o.nodeType===9?o:o.ownerDocument;l===null||l[lp]||(l[lp]=!0,o0("selectionchange",!1,l))}}function fE(o,l,f,p){switch(HE(l)){case 2:var v=EH;break;case 8:v=MH;break;default:v=S0}f=v.bind(null,l,f,o),v=void 0,!Gt||l!=="touchstart"&&l!=="touchmove"&&l!=="wheel"||(v=!0),p?v!==void 0?o.addEventListener(l,f,{capture:!0,passive:v}):o.addEventListener(l,f,!0):v!==void 0?o.addEventListener(l,f,{passive:v}):o.addEventListener(l,f,!1)}function l0(o,l,f,p,v){var S=p;if((l&1)===0&&(l&2)===0&&p!==null)e:for(;;){if(p===null)return;var D=p.tag;if(D===3||D===4){var V=p.stateNode.containerInfo;if(V===v)break;if(D===4)for(D=p.return;D!==null;){var Q=D.tag;if((Q===3||Q===4)&&D.stateNode.containerInfo===v)return;D=D.return}for(;V!==null;){if(D=Jn(V),D===null)return;if(Q=D.tag,Q===5||Q===6||Q===26||Q===27){p=S=D;continue e}V=V.parentNode}}p=p.return}Tl(function(){var ce=S,be=Cl(f),Re=[];e:{var fe=$C.get(o);if(fe!==void 0){var ge=Ou,Xe=o;switch(o){case"keypress":if($r(f)===0)break e;case"keydown":case"keyup":ge=qj;break;case"focusin":Xe="focus",ge=ky;break;case"focusout":Xe="blur",ge=ky;break;case"beforeblur":case"afterblur":ge=ky;break;case"click":if(f.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ge=bC;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ge=Pj;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ge=Kj;break;case HC:case VC:case FC:ge=Lj;break;case UC:ge=Xj;break;case"scroll":case"scrollend":ge=Ij;break;case"wheel":ge=Zj;break;case"copy":case"cut":case"paste":ge=jj;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ge=SC;break;case"toggle":case"beforetoggle":ge=e_}var ut=(l&4)!==0,xn=!ut&&(o==="scroll"||o==="scrollend"),re=ut?fe!==null?fe+"Capture":null:fe;ut=[];for(var te=ce,ue;te!==null;){var Ce=te;if(ue=Ce.stateNode,Ce=Ce.tag,Ce!==5&&Ce!==26&&Ce!==27||ue===null||re===null||(Ce=je(te,re),Ce!=null&&ut.push(Nf(te,Ce,ue))),xn)break;te=te.return}0<ut.length&&(fe=new ge(fe,Xe,null,f,be),Re.push({event:fe,listeners:ut}))}}if((l&7)===0){e:{if(fe=o==="mouseover"||o==="pointerover",ge=o==="mouseout"||o==="pointerout",fe&&f!==wl&&(Xe=f.relatedTarget||f.fromElement)&&(Jn(Xe)||Xe[et]))break e;if((ge||fe)&&(fe=be.window===be?be:(fe=be.ownerDocument)?fe.defaultView||fe.parentWindow:window,ge?(Xe=f.relatedTarget||f.toElement,ge=ce,Xe=Xe?Jn(Xe):null,Xe!==null&&(xn=s(Xe),ut=Xe.tag,Xe!==xn||ut!==5&&ut!==27&&ut!==6)&&(Xe=null)):(ge=null,Xe=ce),ge!==Xe)){if(ut=bC,Ce="onMouseLeave",re="onMouseEnter",te="mouse",(o==="pointerout"||o==="pointerover")&&(ut=SC,Ce="onPointerLeave",re="onPointerEnter",te="pointer"),xn=ge==null?fe:fi(ge),ue=Xe==null?fe:fi(Xe),fe=new ut(Ce,te+"leave",ge,f,be),fe.target=xn,fe.relatedTarget=ue,Ce=null,Jn(be)===ce&&(ut=new ut(re,te+"enter",Xe,f,be),ut.target=ue,ut.relatedTarget=xn,Ce=ut),xn=Ce,ge&&Xe)t:{for(ut=J_,re=ge,te=Xe,ue=0,Ce=re;Ce;Ce=ut(Ce))ue++;Ce=0;for(var it=te;it;it=ut(it))Ce++;for(;0<ue-Ce;)re=ut(re),ue--;for(;0<Ce-ue;)te=ut(te),Ce--;for(;ue--;){if(re===te||te!==null&&re===te.alternate){ut=re;break t}re=ut(re),te=ut(te)}ut=null}else ut=null;ge!==null&&dE(Re,fe,ge,ut,!1),Xe!==null&&xn!==null&&dE(Re,xn,Xe,ut,!0)}}e:{if(fe=ce?fi(ce):window,ge=fe.nodeName&&fe.nodeName.toLowerCase(),ge==="select"||ge==="input"&&fe.type==="file")var Qt=OC;else if(MC(fe))if(kC)Qt=c_;else{Qt=a_;var Je=l_}else ge=fe.nodeName,!ge||ge.toLowerCase()!=="input"||fe.type!=="checkbox"&&fe.type!=="radio"?ce&&Ti(ce.elementType)&&(Qt=OC):Qt=u_;if(Qt&&(Qt=Qt(o,ce))){AC(Re,Qt,f,be);break e}Je&&Je(o,fe,ce),o==="focusout"&&ce&&fe.type==="number"&&ce.memoizedProps.value!=null&&ks(fe,"number",fe.value)}switch(Je=ce?fi(ce):window,o){case"focusin":(MC(Je)||Je.contentEditable==="true")&&(Iu=Je,Ly=ce,cf=null);break;case"focusout":cf=Ly=Iu=null;break;case"mousedown":By=!0;break;case"contextmenu":case"mouseup":case"dragend":By=!1,jC(Re,f,be);break;case"selectionchange":if(d_)break;case"keydown":case"keyup":jC(Re,f,be)}var Et;if(Dy)e:{switch(o){case"compositionstart":var Ht="onCompositionStart";break e;case"compositionend":Ht="onCompositionEnd";break e;case"compositionupdate":Ht="onCompositionUpdate";break e}Ht=void 0}else ku?TC(o,f)&&(Ht="onCompositionEnd"):o==="keydown"&&f.keyCode===229&&(Ht="onCompositionStart");Ht&&(wC&&f.locale!=="ko"&&(ku||Ht!=="onCompositionStart"?Ht==="onCompositionEnd"&&ku&&(Et=Or()):(on=be,er="value"in on?on.value:on.textContent,ku=!0)),Je=ap(ce,Ht),0<Je.length&&(Ht=new xC(Ht,o,null,f,be),Re.push({event:Ht,listeners:Je}),Et?Ht.data=Et:(Et=EC(f),Et!==null&&(Ht.data=Et)))),(Et=n_?r_(o,f):i_(o,f))&&(Ht=ap(ce,"onBeforeInput"),0<Ht.length&&(Je=new xC("onBeforeInput","beforeinput",null,f,be),Re.push({event:Je,listeners:Ht}),Je.data=Et)),Y_(Re,o,ce,f,be)}cE(Re,l)})}function Nf(o,l,f){return{instance:o,listener:l,currentTarget:f}}function ap(o,l){for(var f=l+"Capture",p=[];o!==null;){var v=o,S=v.stateNode;if(v=v.tag,v!==5&&v!==26&&v!==27||S===null||(v=je(o,f),v!=null&&p.unshift(Nf(o,v,S)),v=je(o,l),v!=null&&p.push(Nf(o,v,S))),o.tag===3)return p;o=o.return}return[]}function J_(o){if(o===null)return null;do o=o.return;while(o&&o.tag!==5&&o.tag!==27);return o||null}function dE(o,l,f,p,v){for(var S=l._reactName,D=[];f!==null&&f!==p;){var V=f,Q=V.alternate,ce=V.stateNode;if(V=V.tag,Q!==null&&Q===p)break;V!==5&&V!==26&&V!==27||ce===null||(Q=ce,v?(ce=je(f,S),ce!=null&&D.unshift(Nf(f,ce,Q))):v||(ce=je(f,S),ce!=null&&D.push(Nf(f,ce,Q)))),f=f.return}D.length!==0&&o.push({event:l,listeners:D})}var eH=/\r\n?/g,tH=/\u0000|\uFFFD/g;function hE(o){return(typeof o=="string"?o:""+o).replace(eH,`
|
|
12
|
+
`).replace(tH,"")}function pE(o,l){return l=hE(l),hE(o)===l}function bn(o,l,f,p,v,S){switch(f){case"children":typeof p=="string"?l==="body"||l==="textarea"&&p===""||$i(o,p):(typeof p=="number"||typeof p=="bigint")&&l!=="body"&&$i(o,""+p);break;case"className":As(o,"class",p);break;case"tabIndex":As(o,"tabindex",p);break;case"dir":case"role":case"viewBox":case"width":case"height":As(o,f,p);break;case"style":Yo(o,p,S);break;case"data":if(l!=="object"){As(o,"data",p);break}case"src":case"href":if(p===""&&(l!=="a"||f!=="href")){o.removeAttribute(f);break}if(p==null||typeof p=="function"||typeof p=="symbol"||typeof p=="boolean"){o.removeAttribute(f);break}p=wo(""+p),o.setAttribute(f,p);break;case"action":case"formAction":if(typeof p=="function"){o.setAttribute(f,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof S=="function"&&(f==="formAction"?(l!=="input"&&bn(o,l,"name",v.name,v,null),bn(o,l,"formEncType",v.formEncType,v,null),bn(o,l,"formMethod",v.formMethod,v,null),bn(o,l,"formTarget",v.formTarget,v,null)):(bn(o,l,"encType",v.encType,v,null),bn(o,l,"method",v.method,v,null),bn(o,l,"target",v.target,v,null)));if(p==null||typeof p=="symbol"||typeof p=="boolean"){o.removeAttribute(f);break}p=wo(""+p),o.setAttribute(f,p);break;case"onClick":p!=null&&(o.onclick=Ur);break;case"onScroll":p!=null&&Bt("scroll",o);break;case"onScrollEnd":p!=null&&Bt("scrollend",o);break;case"dangerouslySetInnerHTML":if(p!=null){if(typeof p!="object"||!("__html"in p))throw Error(r(61));if(f=p.__html,f!=null){if(v.children!=null)throw Error(r(60));o.innerHTML=f}}break;case"multiple":o.multiple=p&&typeof p!="function"&&typeof p!="symbol";break;case"muted":o.muted=p&&typeof p!="function"&&typeof p!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(p==null||typeof p=="function"||typeof p=="boolean"||typeof p=="symbol"){o.removeAttribute("xlink:href");break}f=wo(""+p),o.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",f);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":p!=null&&typeof p!="function"&&typeof p!="symbol"?o.setAttribute(f,""+p):o.removeAttribute(f);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":p&&typeof p!="function"&&typeof p!="symbol"?o.setAttribute(f,""):o.removeAttribute(f);break;case"capture":case"download":p===!0?o.setAttribute(f,""):p!==!1&&p!=null&&typeof p!="function"&&typeof p!="symbol"?o.setAttribute(f,p):o.removeAttribute(f);break;case"cols":case"rows":case"size":case"span":p!=null&&typeof p!="function"&&typeof p!="symbol"&&!isNaN(p)&&1<=p?o.setAttribute(f,p):o.removeAttribute(f);break;case"rowSpan":case"start":p==null||typeof p=="function"||typeof p=="symbol"||isNaN(p)?o.removeAttribute(f):o.setAttribute(f,p);break;case"popover":Bt("beforetoggle",o),Bt("toggle",o),So(o,"popover",p);break;case"xlinkActuate":ni(o,"http://www.w3.org/1999/xlink","xlink:actuate",p);break;case"xlinkArcrole":ni(o,"http://www.w3.org/1999/xlink","xlink:arcrole",p);break;case"xlinkRole":ni(o,"http://www.w3.org/1999/xlink","xlink:role",p);break;case"xlinkShow":ni(o,"http://www.w3.org/1999/xlink","xlink:show",p);break;case"xlinkTitle":ni(o,"http://www.w3.org/1999/xlink","xlink:title",p);break;case"xlinkType":ni(o,"http://www.w3.org/1999/xlink","xlink:type",p);break;case"xmlBase":ni(o,"http://www.w3.org/XML/1998/namespace","xml:base",p);break;case"xmlLang":ni(o,"http://www.w3.org/XML/1998/namespace","xml:lang",p);break;case"xmlSpace":ni(o,"http://www.w3.org/XML/1998/namespace","xml:space",p);break;case"is":So(o,"is",p);break;case"innerText":case"textContent":break;default:(!(2<f.length)||f[0]!=="o"&&f[0]!=="O"||f[1]!=="n"&&f[1]!=="N")&&(f=xl.get(f)||f,So(o,f,p))}}function a0(o,l,f,p,v,S){switch(f){case"style":Yo(o,p,S);break;case"dangerouslySetInnerHTML":if(p!=null){if(typeof p!="object"||!("__html"in p))throw Error(r(61));if(f=p.__html,f!=null){if(v.children!=null)throw Error(r(60));o.innerHTML=f}}break;case"children":typeof p=="string"?$i(o,p):(typeof p=="number"||typeof p=="bigint")&&$i(o,""+p);break;case"onScroll":p!=null&&Bt("scroll",o);break;case"onScrollEnd":p!=null&&Bt("scrollend",o);break;case"onClick":p!=null&&(o.onclick=Ur);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Vr.hasOwnProperty(f))e:{if(f[0]==="o"&&f[1]==="n"&&(v=f.endsWith("Capture"),l=f.slice(2,v?f.length-7:void 0),S=o[Nt]||null,S=S!=null?S[f]:null,typeof S=="function"&&o.removeEventListener(l,S,v),typeof p=="function")){typeof S!="function"&&S!==null&&(f in o?o[f]=null:o.hasAttribute(f)&&o.removeAttribute(f)),o.addEventListener(l,p,v);break e}f in o?o[f]=p:p===!0?o.setAttribute(f,""):So(o,f,p)}}}function Pr(o,l,f){switch(l){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Bt("error",o),Bt("load",o);var p=!1,v=!1,S;for(S in f)if(f.hasOwnProperty(S)){var D=f[S];if(D!=null)switch(S){case"src":p=!0;break;case"srcSet":v=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,l));default:bn(o,l,S,D,f,null)}}v&&bn(o,l,"srcSet",f.srcSet,f,null),p&&bn(o,l,"src",f.src,f,null);return;case"input":Bt("invalid",o);var V=S=D=v=null,Q=null,ce=null;for(p in f)if(f.hasOwnProperty(p)){var be=f[p];if(be!=null)switch(p){case"name":v=be;break;case"type":D=be;break;case"checked":Q=be;break;case"defaultChecked":ce=be;break;case"value":S=be;break;case"defaultValue":V=be;break;case"children":case"dangerouslySetInnerHTML":if(be!=null)throw Error(r(137,l));break;default:bn(o,l,p,be,f,null)}}Da(o,S,V,Q,ce,D,v,!1);return;case"select":Bt("invalid",o),p=D=S=null;for(v in f)if(f.hasOwnProperty(v)&&(V=f[v],V!=null))switch(v){case"value":S=V;break;case"defaultValue":D=V;break;case"multiple":p=V;default:bn(o,l,v,V,f,null)}l=S,f=D,o.multiple=!!p,l!=null?hi(o,!!p,l,!1):f!=null&&hi(o,!!p,f,!0);return;case"textarea":Bt("invalid",o),S=v=p=null;for(D in f)if(f.hasOwnProperty(D)&&(V=f[D],V!=null))switch(D){case"value":p=V;break;case"defaultValue":v=V;break;case"children":S=V;break;case"dangerouslySetInnerHTML":if(V!=null)throw Error(r(91));break;default:bn(o,l,D,V,f,null)}Ko(o,p,v,S);return;case"option":for(Q in f)f.hasOwnProperty(Q)&&(p=f[Q],p!=null)&&(Q==="selected"?o.selected=p&&typeof p!="function"&&typeof p!="symbol":bn(o,l,Q,p,f,null));return;case"dialog":Bt("beforetoggle",o),Bt("toggle",o),Bt("cancel",o),Bt("close",o);break;case"iframe":case"object":Bt("load",o);break;case"video":case"audio":for(p=0;p<zf.length;p++)Bt(zf[p],o);break;case"image":Bt("error",o),Bt("load",o);break;case"details":Bt("toggle",o);break;case"embed":case"source":case"link":Bt("error",o),Bt("load",o);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ce in f)if(f.hasOwnProperty(ce)&&(p=f[ce],p!=null))switch(ce){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,l));default:bn(o,l,ce,p,f,null)}return;default:if(Ti(l)){for(be in f)f.hasOwnProperty(be)&&(p=f[be],p!==void 0&&a0(o,l,be,p,f,void 0));return}}for(V in f)f.hasOwnProperty(V)&&(p=f[V],p!=null&&bn(o,l,V,p,f,null))}function nH(o,l,f,p){switch(l){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var v=null,S=null,D=null,V=null,Q=null,ce=null,be=null;for(ge in f){var Re=f[ge];if(f.hasOwnProperty(ge)&&Re!=null)switch(ge){case"checked":break;case"value":break;case"defaultValue":Q=Re;default:p.hasOwnProperty(ge)||bn(o,l,ge,null,p,Re)}}for(var fe in p){var ge=p[fe];if(Re=f[fe],p.hasOwnProperty(fe)&&(ge!=null||Re!=null))switch(fe){case"type":S=ge;break;case"name":v=ge;break;case"checked":ce=ge;break;case"defaultChecked":be=ge;break;case"value":D=ge;break;case"defaultValue":V=ge;break;case"children":case"dangerouslySetInnerHTML":if(ge!=null)throw Error(r(137,l));break;default:ge!==Re&&bn(o,l,fe,ge,p,Re)}}yl(o,D,V,Q,ce,be,S,v);return;case"select":ge=D=V=fe=null;for(S in f)if(Q=f[S],f.hasOwnProperty(S)&&Q!=null)switch(S){case"value":break;case"multiple":ge=Q;default:p.hasOwnProperty(S)||bn(o,l,S,null,p,Q)}for(v in p)if(S=p[v],Q=f[v],p.hasOwnProperty(v)&&(S!=null||Q!=null))switch(v){case"value":fe=S;break;case"defaultValue":V=S;break;case"multiple":D=S;default:S!==Q&&bn(o,l,v,S,p,Q)}l=V,f=D,p=ge,fe!=null?hi(o,!!f,fe,!1):!!p!=!!f&&(l!=null?hi(o,!!f,l,!0):hi(o,!!f,f?[]:"",!1));return;case"textarea":ge=fe=null;for(V in f)if(v=f[V],f.hasOwnProperty(V)&&v!=null&&!p.hasOwnProperty(V))switch(V){case"value":break;case"children":break;default:bn(o,l,V,null,p,v)}for(D in p)if(v=p[D],S=f[D],p.hasOwnProperty(D)&&(v!=null||S!=null))switch(D){case"value":fe=v;break;case"defaultValue":ge=v;break;case"children":break;case"dangerouslySetInnerHTML":if(v!=null)throw Error(r(91));break;default:v!==S&&bn(o,l,D,v,p,S)}vl(o,fe,ge);return;case"option":for(var Xe in f)fe=f[Xe],f.hasOwnProperty(Xe)&&fe!=null&&!p.hasOwnProperty(Xe)&&(Xe==="selected"?o.selected=!1:bn(o,l,Xe,null,p,fe));for(Q in p)fe=p[Q],ge=f[Q],p.hasOwnProperty(Q)&&fe!==ge&&(fe!=null||ge!=null)&&(Q==="selected"?o.selected=fe&&typeof fe!="function"&&typeof fe!="symbol":bn(o,l,Q,fe,p,ge));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var ut in f)fe=f[ut],f.hasOwnProperty(ut)&&fe!=null&&!p.hasOwnProperty(ut)&&bn(o,l,ut,null,p,fe);for(ce in p)if(fe=p[ce],ge=f[ce],p.hasOwnProperty(ce)&&fe!==ge&&(fe!=null||ge!=null))switch(ce){case"children":case"dangerouslySetInnerHTML":if(fe!=null)throw Error(r(137,l));break;default:bn(o,l,ce,fe,p,ge)}return;default:if(Ti(l)){for(var xn in f)fe=f[xn],f.hasOwnProperty(xn)&&fe!==void 0&&!p.hasOwnProperty(xn)&&a0(o,l,xn,void 0,p,fe);for(be in p)fe=p[be],ge=f[be],!p.hasOwnProperty(be)||fe===ge||fe===void 0&&ge===void 0||a0(o,l,be,fe,p,ge);return}}for(var re in f)fe=f[re],f.hasOwnProperty(re)&&fe!=null&&!p.hasOwnProperty(re)&&bn(o,l,re,null,p,fe);for(Re in p)fe=p[Re],ge=f[Re],!p.hasOwnProperty(Re)||fe===ge||fe==null&&ge==null||bn(o,l,Re,fe,p,ge)}function gE(o){switch(o){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function rH(){if(typeof performance.getEntriesByType=="function"){for(var o=0,l=0,f=performance.getEntriesByType("resource"),p=0;p<f.length;p++){var v=f[p],S=v.transferSize,D=v.initiatorType,V=v.duration;if(S&&V&&gE(D)){for(D=0,V=v.responseEnd,p+=1;p<f.length;p++){var Q=f[p],ce=Q.startTime;if(ce>V)break;var be=Q.transferSize,Re=Q.initiatorType;be&&gE(Re)&&(Q=Q.responseEnd,D+=be*(Q<V?1:(V-ce)/(Q-ce)))}if(--p,l+=8*(S+D)/(v.duration/1e3),o++,10<o)break}}if(0<o)return l/o/1e6}return navigator.connection&&(o=navigator.connection.downlink,typeof o=="number")?o:5}var u0=null,c0=null;function up(o){return o.nodeType===9?o:o.ownerDocument}function mE(o){switch(o){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function yE(o,l){if(o===0)switch(l){case"svg":return 1;case"math":return 2;default:return 0}return o===1&&l==="foreignObject"?0:o}function f0(o,l){return o==="textarea"||o==="noscript"||typeof l.children=="string"||typeof l.children=="number"||typeof l.children=="bigint"||typeof l.dangerouslySetInnerHTML=="object"&&l.dangerouslySetInnerHTML!==null&&l.dangerouslySetInnerHTML.__html!=null}var d0=null;function iH(){var o=window.event;return o&&o.type==="popstate"?o===d0?!1:(d0=o,!0):(d0=null,!1)}var vE=typeof setTimeout=="function"?setTimeout:void 0,oH=typeof clearTimeout=="function"?clearTimeout:void 0,bE=typeof Promise=="function"?Promise:void 0,sH=typeof queueMicrotask=="function"?queueMicrotask:typeof bE<"u"?function(o){return bE.resolve(null).then(o).catch(lH)}:vE;function lH(o){setTimeout(function(){throw o})}function Ul(o){return o==="head"}function xE(o,l){var f=l,p=0;do{var v=f.nextSibling;if(o.removeChild(f),v&&v.nodeType===8)if(f=v.data,f==="/$"||f==="/&"){if(p===0){o.removeChild(v),ic(l);return}p--}else if(f==="$"||f==="$?"||f==="$~"||f==="$!"||f==="&")p++;else if(f==="html")Lf(o.ownerDocument.documentElement);else if(f==="head"){f=o.ownerDocument.head,Lf(f);for(var S=f.firstChild;S;){var D=S.nextSibling,V=S.nodeName;S[qe]||V==="SCRIPT"||V==="STYLE"||V==="LINK"&&S.rel.toLowerCase()==="stylesheet"||f.removeChild(S),S=D}}else f==="body"&&Lf(o.ownerDocument.body);f=v}while(f);ic(l)}function SE(o,l){var f=o;o=0;do{var p=f.nextSibling;if(f.nodeType===1?l?(f._stashedDisplay=f.style.display,f.style.display="none"):(f.style.display=f._stashedDisplay||"",f.getAttribute("style")===""&&f.removeAttribute("style")):f.nodeType===3&&(l?(f._stashedText=f.nodeValue,f.nodeValue=""):f.nodeValue=f._stashedText||""),p&&p.nodeType===8)if(f=p.data,f==="/$"){if(o===0)break;o--}else f!=="$"&&f!=="$?"&&f!=="$~"&&f!=="$!"||o++;f=p}while(f)}function h0(o){var l=o.firstChild;for(l&&l.nodeType===10&&(l=l.nextSibling);l;){var f=l;switch(l=l.nextSibling,f.nodeName){case"HTML":case"HEAD":case"BODY":h0(f),Aa(f);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(f.rel.toLowerCase()==="stylesheet")continue}o.removeChild(f)}}function aH(o,l,f,p){for(;o.nodeType===1;){var v=f;if(o.nodeName.toLowerCase()!==l.toLowerCase()){if(!p&&(o.nodeName!=="INPUT"||o.type!=="hidden"))break}else if(p){if(!o[qe])switch(l){case"meta":if(!o.hasAttribute("itemprop"))break;return o;case"link":if(S=o.getAttribute("rel"),S==="stylesheet"&&o.hasAttribute("data-precedence"))break;if(S!==v.rel||o.getAttribute("href")!==(v.href==null||v.href===""?null:v.href)||o.getAttribute("crossorigin")!==(v.crossOrigin==null?null:v.crossOrigin)||o.getAttribute("title")!==(v.title==null?null:v.title))break;return o;case"style":if(o.hasAttribute("data-precedence"))break;return o;case"script":if(S=o.getAttribute("src"),(S!==(v.src==null?null:v.src)||o.getAttribute("type")!==(v.type==null?null:v.type)||o.getAttribute("crossorigin")!==(v.crossOrigin==null?null:v.crossOrigin))&&S&&o.hasAttribute("async")&&!o.hasAttribute("itemprop"))break;return o;default:return o}}else if(l==="input"&&o.type==="hidden"){var S=v.name==null?null:""+v.name;if(v.type==="hidden"&&o.getAttribute("name")===S)return o}else return o;if(o=Qi(o.nextSibling),o===null)break}return null}function uH(o,l,f){if(l==="")return null;for(;o.nodeType!==3;)if((o.nodeType!==1||o.nodeName!=="INPUT"||o.type!=="hidden")&&!f||(o=Qi(o.nextSibling),o===null))return null;return o}function wE(o,l){for(;o.nodeType!==8;)if((o.nodeType!==1||o.nodeName!=="INPUT"||o.type!=="hidden")&&!l||(o=Qi(o.nextSibling),o===null))return null;return o}function p0(o){return o.data==="$?"||o.data==="$~"}function g0(o){return o.data==="$!"||o.data==="$?"&&o.ownerDocument.readyState!=="loading"}function cH(o,l){var f=o.ownerDocument;if(o.data==="$~")o._reactRetry=l;else if(o.data!=="$?"||f.readyState!=="loading")l();else{var p=function(){l(),f.removeEventListener("DOMContentLoaded",p)};f.addEventListener("DOMContentLoaded",p),o._reactRetry=p}}function Qi(o){for(;o!=null;o=o.nextSibling){var l=o.nodeType;if(l===1||l===3)break;if(l===8){if(l=o.data,l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"||l==="F!"||l==="F")break;if(l==="/$"||l==="/&")return null}}return o}var m0=null;function CE(o){o=o.nextSibling;for(var l=0;o;){if(o.nodeType===8){var f=o.data;if(f==="/$"||f==="/&"){if(l===0)return Qi(o.nextSibling);l--}else f!=="$"&&f!=="$!"&&f!=="$?"&&f!=="$~"&&f!=="&"||l++}o=o.nextSibling}return null}function RE(o){o=o.previousSibling;for(var l=0;o;){if(o.nodeType===8){var f=o.data;if(f==="$"||f==="$!"||f==="$?"||f==="$~"||f==="&"){if(l===0)return o;l--}else f!=="/$"&&f!=="/&"||l++}o=o.previousSibling}return null}function TE(o,l,f){switch(l=up(f),o){case"html":if(o=l.documentElement,!o)throw Error(r(452));return o;case"head":if(o=l.head,!o)throw Error(r(453));return o;case"body":if(o=l.body,!o)throw Error(r(454));return o;default:throw Error(r(451))}}function Lf(o){for(var l=o.attributes;l.length;)o.removeAttributeNode(l[0]);Aa(o)}var Zi=new Map,EE=new Set;function cp(o){return typeof o.getRootNode=="function"?o.getRootNode():o.nodeType===9?o:o.ownerDocument}var Ws=q.d;q.d={f:fH,r:dH,D:hH,C:pH,L:gH,m:mH,X:vH,S:yH,M:bH};function fH(){var o=Ws.f(),l=tp();return o||l}function dH(o){var l=Vi(o);l!==null&&l.tag===5&&l.type==="form"?UR(l):Ws.r(o)}var tc=typeof document>"u"?null:document;function ME(o,l,f){var p=tc;if(p&&typeof l=="string"&&l){var v=cr(l);v='link[rel="'+o+'"][href="'+v+'"]',typeof f=="string"&&(v+='[crossorigin="'+f+'"]'),EE.has(v)||(EE.add(v),o={rel:o,crossOrigin:f,href:l},p.querySelector(v)===null&&(l=p.createElement("link"),Pr(l,"link",o),Un(l),p.head.appendChild(l)))}}function hH(o){Ws.D(o),ME("dns-prefetch",o,null)}function pH(o,l){Ws.C(o,l),ME("preconnect",o,l)}function gH(o,l,f){Ws.L(o,l,f);var p=tc;if(p&&o&&l){var v='link[rel="preload"][as="'+cr(l)+'"]';l==="image"&&f&&f.imageSrcSet?(v+='[imagesrcset="'+cr(f.imageSrcSet)+'"]',typeof f.imageSizes=="string"&&(v+='[imagesizes="'+cr(f.imageSizes)+'"]')):v+='[href="'+cr(o)+'"]';var S=v;switch(l){case"style":S=nc(o);break;case"script":S=rc(o)}Zi.has(S)||(o=g({rel:"preload",href:l==="image"&&f&&f.imageSrcSet?void 0:o,as:l},f),Zi.set(S,o),p.querySelector(v)!==null||l==="style"&&p.querySelector(Bf(S))||l==="script"&&p.querySelector(jf(S))||(l=p.createElement("link"),Pr(l,"link",o),Un(l),p.head.appendChild(l)))}}function mH(o,l){Ws.m(o,l);var f=tc;if(f&&o){var p=l&&typeof l.as=="string"?l.as:"script",v='link[rel="modulepreload"][as="'+cr(p)+'"][href="'+cr(o)+'"]',S=v;switch(p){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":S=rc(o)}if(!Zi.has(S)&&(o=g({rel:"modulepreload",href:o},l),Zi.set(S,o),f.querySelector(v)===null)){switch(p){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(f.querySelector(jf(S)))return}p=f.createElement("link"),Pr(p,"link",o),Un(p),f.head.appendChild(p)}}}function yH(o,l,f){Ws.S(o,l,f);var p=tc;if(p&&o){var v=di(p).hoistableStyles,S=nc(o);l=l||"default";var D=v.get(S);if(!D){var V={loading:0,preload:null};if(D=p.querySelector(Bf(S)))V.loading=5;else{o=g({rel:"stylesheet",href:o,"data-precedence":l},f),(f=Zi.get(S))&&y0(o,f);var Q=D=p.createElement("link");Un(Q),Pr(Q,"link",o),Q._p=new Promise(function(ce,be){Q.onload=ce,Q.onerror=be}),Q.addEventListener("load",function(){V.loading|=1}),Q.addEventListener("error",function(){V.loading|=2}),V.loading|=4,fp(D,l,p)}D={type:"stylesheet",instance:D,count:1,state:V},v.set(S,D)}}}function vH(o,l){Ws.X(o,l);var f=tc;if(f&&o){var p=di(f).hoistableScripts,v=rc(o),S=p.get(v);S||(S=f.querySelector(jf(v)),S||(o=g({src:o,async:!0},l),(l=Zi.get(v))&&v0(o,l),S=f.createElement("script"),Un(S),Pr(S,"link",o),f.head.appendChild(S)),S={type:"script",instance:S,count:1,state:null},p.set(v,S))}}function bH(o,l){Ws.M(o,l);var f=tc;if(f&&o){var p=di(f).hoistableScripts,v=rc(o),S=p.get(v);S||(S=f.querySelector(jf(v)),S||(o=g({src:o,async:!0,type:"module"},l),(l=Zi.get(v))&&v0(o,l),S=f.createElement("script"),Un(S),Pr(S,"link",o),f.head.appendChild(S)),S={type:"script",instance:S,count:1,state:null},p.set(v,S))}}function AE(o,l,f,p){var v=(v=ee.current)?cp(v):null;if(!v)throw Error(r(446));switch(o){case"meta":case"title":return null;case"style":return typeof f.precedence=="string"&&typeof f.href=="string"?(l=nc(f.href),f=di(v).hoistableStyles,p=f.get(l),p||(p={type:"style",instance:null,count:0,state:null},f.set(l,p)),p):{type:"void",instance:null,count:0,state:null};case"link":if(f.rel==="stylesheet"&&typeof f.href=="string"&&typeof f.precedence=="string"){o=nc(f.href);var S=di(v).hoistableStyles,D=S.get(o);if(D||(v=v.ownerDocument||v,D={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},S.set(o,D),(S=v.querySelector(Bf(o)))&&!S._p&&(D.instance=S,D.state.loading=5),Zi.has(o)||(f={rel:"preload",as:"style",href:f.href,crossOrigin:f.crossOrigin,integrity:f.integrity,media:f.media,hrefLang:f.hrefLang,referrerPolicy:f.referrerPolicy},Zi.set(o,f),S||xH(v,o,f,D.state))),l&&p===null)throw Error(r(528,""));return D}if(l&&p!==null)throw Error(r(529,""));return null;case"script":return l=f.async,f=f.src,typeof f=="string"&&l&&typeof l!="function"&&typeof l!="symbol"?(l=rc(f),f=di(v).hoistableScripts,p=f.get(l),p||(p={type:"script",instance:null,count:0,state:null},f.set(l,p)),p):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,o))}}function nc(o){return'href="'+cr(o)+'"'}function Bf(o){return'link[rel="stylesheet"]['+o+"]"}function OE(o){return g({},o,{"data-precedence":o.precedence,precedence:null})}function xH(o,l,f,p){o.querySelector('link[rel="preload"][as="style"]['+l+"]")?p.loading=1:(l=o.createElement("link"),p.preload=l,l.addEventListener("load",function(){return p.loading|=1}),l.addEventListener("error",function(){return p.loading|=2}),Pr(l,"link",f),Un(l),o.head.appendChild(l))}function rc(o){return'[src="'+cr(o)+'"]'}function jf(o){return"script[async]"+o}function kE(o,l,f){if(l.count++,l.instance===null)switch(l.type){case"style":var p=o.querySelector('style[data-href~="'+cr(f.href)+'"]');if(p)return l.instance=p,Un(p),p;var v=g({},f,{"data-href":f.href,"data-precedence":f.precedence,href:null,precedence:null});return p=(o.ownerDocument||o).createElement("style"),Un(p),Pr(p,"style",v),fp(p,f.precedence,o),l.instance=p;case"stylesheet":v=nc(f.href);var S=o.querySelector(Bf(v));if(S)return l.state.loading|=4,l.instance=S,Un(S),S;p=OE(f),(v=Zi.get(v))&&y0(p,v),S=(o.ownerDocument||o).createElement("link"),Un(S);var D=S;return D._p=new Promise(function(V,Q){D.onload=V,D.onerror=Q}),Pr(S,"link",p),l.state.loading|=4,fp(S,f.precedence,o),l.instance=S;case"script":return S=rc(f.src),(v=o.querySelector(jf(S)))?(l.instance=v,Un(v),v):(p=f,(v=Zi.get(S))&&(p=g({},f),v0(p,v)),o=o.ownerDocument||o,v=o.createElement("script"),Un(v),Pr(v,"link",p),o.head.appendChild(v),l.instance=v);case"void":return null;default:throw Error(r(443,l.type))}else l.type==="stylesheet"&&(l.state.loading&4)===0&&(p=l.instance,l.state.loading|=4,fp(p,f.precedence,o));return l.instance}function fp(o,l,f){for(var p=f.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),v=p.length?p[p.length-1]:null,S=v,D=0;D<p.length;D++){var V=p[D];if(V.dataset.precedence===l)S=V;else if(S!==v)break}S?S.parentNode.insertBefore(o,S.nextSibling):(l=f.nodeType===9?f.head:f,l.insertBefore(o,l.firstChild))}function y0(o,l){o.crossOrigin==null&&(o.crossOrigin=l.crossOrigin),o.referrerPolicy==null&&(o.referrerPolicy=l.referrerPolicy),o.title==null&&(o.title=l.title)}function v0(o,l){o.crossOrigin==null&&(o.crossOrigin=l.crossOrigin),o.referrerPolicy==null&&(o.referrerPolicy=l.referrerPolicy),o.integrity==null&&(o.integrity=l.integrity)}var dp=null;function IE(o,l,f){if(dp===null){var p=new Map,v=dp=new Map;v.set(f,p)}else v=dp,p=v.get(f),p||(p=new Map,v.set(f,p));if(p.has(o))return p;for(p.set(o,null),f=f.getElementsByTagName(o),v=0;v<f.length;v++){var S=f[v];if(!(S[qe]||S[zt]||o==="link"&&S.getAttribute("rel")==="stylesheet")&&S.namespaceURI!=="http://www.w3.org/2000/svg"){var D=S.getAttribute(l)||"";D=o+D;var V=p.get(D);V?V.push(S):p.set(D,[S])}}return p}function DE(o,l,f){o=o.ownerDocument||o,o.head.insertBefore(f,l==="title"?o.querySelector("head > title"):null)}function SH(o,l,f){if(f===1||l.itemProp!=null)return!1;switch(o){case"meta":case"title":return!0;case"style":if(typeof l.precedence!="string"||typeof l.href!="string"||l.href==="")break;return!0;case"link":if(typeof l.rel!="string"||typeof l.href!="string"||l.href===""||l.onLoad||l.onError)break;return l.rel==="stylesheet"?(o=l.disabled,typeof l.precedence=="string"&&o==null):!0;case"script":if(l.async&&typeof l.async!="function"&&typeof l.async!="symbol"&&!l.onLoad&&!l.onError&&l.src&&typeof l.src=="string")return!0}return!1}function PE(o){return!(o.type==="stylesheet"&&(o.state.loading&3)===0)}function wH(o,l,f,p){if(f.type==="stylesheet"&&(typeof p.media!="string"||matchMedia(p.media).matches!==!1)&&(f.state.loading&4)===0){if(f.instance===null){var v=nc(p.href),S=l.querySelector(Bf(v));if(S){l=S._p,l!==null&&typeof l=="object"&&typeof l.then=="function"&&(o.count++,o=hp.bind(o),l.then(o,o)),f.state.loading|=4,f.instance=S,Un(S);return}S=l.ownerDocument||l,p=OE(p),(v=Zi.get(v))&&y0(p,v),S=S.createElement("link"),Un(S);var D=S;D._p=new Promise(function(V,Q){D.onload=V,D.onerror=Q}),Pr(S,"link",p),f.instance=S}o.stylesheets===null&&(o.stylesheets=new Map),o.stylesheets.set(f,l),(l=f.state.preload)&&(f.state.loading&3)===0&&(o.count++,f=hp.bind(o),l.addEventListener("load",f),l.addEventListener("error",f))}}var b0=0;function CH(o,l){return o.stylesheets&&o.count===0&&gp(o,o.stylesheets),0<o.count||0<o.imgCount?function(f){var p=setTimeout(function(){if(o.stylesheets&&gp(o,o.stylesheets),o.unsuspend){var S=o.unsuspend;o.unsuspend=null,S()}},6e4+l);0<o.imgBytes&&b0===0&&(b0=62500*rH());var v=setTimeout(function(){if(o.waitingForImages=!1,o.count===0&&(o.stylesheets&&gp(o,o.stylesheets),o.unsuspend)){var S=o.unsuspend;o.unsuspend=null,S()}},(o.imgBytes>b0?50:800)+l);return o.unsuspend=f,function(){o.unsuspend=null,clearTimeout(p),clearTimeout(v)}}:null}function hp(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)gp(this,this.stylesheets);else if(this.unsuspend){var o=this.unsuspend;this.unsuspend=null,o()}}}var pp=null;function gp(o,l){o.stylesheets=null,o.unsuspend!==null&&(o.count++,pp=new Map,l.forEach(RH,o),pp=null,hp.call(o))}function RH(o,l){if(!(l.state.loading&4)){var f=pp.get(o);if(f)var p=f.get(null);else{f=new Map,pp.set(o,f);for(var v=o.querySelectorAll("link[data-precedence],style[data-precedence]"),S=0;S<v.length;S++){var D=v[S];(D.nodeName==="LINK"||D.getAttribute("media")!=="not all")&&(f.set(D.dataset.precedence,D),p=D)}p&&f.set(null,p)}v=l.instance,D=v.getAttribute("data-precedence"),S=f.get(D)||p,S===p&&f.set(null,v),f.set(D,v),this.count++,p=hp.bind(this),v.addEventListener("load",p),v.addEventListener("error",p),S?S.parentNode.insertBefore(v,S.nextSibling):(o=o.nodeType===9?o.head:o,o.insertBefore(v,o.firstChild)),l.state.loading|=4}}var _f={$$typeof:E,Provider:null,Consumer:null,_currentValue:U,_currentValue2:U,_threadCount:0};function TH(o,l,f,p,v,S,D,V,Q){this.tag=1,this.containerInfo=o,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=rn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=rn(0),this.hiddenUpdates=rn(null),this.identifierPrefix=p,this.onUncaughtError=v,this.onCaughtError=S,this.onRecoverableError=D,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=Q,this.incompleteTransitions=new Map}function zE(o,l,f,p,v,S,D,V,Q,ce,be,Re){return o=new TH(o,l,f,D,Q,ce,be,Re,V),l=1,S===!0&&(l|=24),S=Ai(3,null,null,l),o.current=S,S.stateNode=o,l=Zy(),l.refCount++,o.pooledCache=l,l.refCount++,S.memoizedState={element:p,isDehydrated:f,cache:l},nv(S),o}function NE(o){return o?(o=zu,o):zu}function LE(o,l,f,p,v,S){v=NE(v),p.context===null?p.context=v:p.pendingContext=v,p=Dl(l),p.payload={element:f},S=S===void 0?null:S,S!==null&&(p.callback=S),f=Pl(o,p,l),f!==null&&(vi(f,o,l),yf(f,o,l))}function BE(o,l){if(o=o.memoizedState,o!==null&&o.dehydrated!==null){var f=o.retryLane;o.retryLane=f!==0&&f<l?f:l}}function x0(o,l){BE(o,l),(o=o.alternate)&&BE(o,l)}function jE(o){if(o.tag===13||o.tag===31){var l=Na(o,67108864);l!==null&&vi(l,o,67108864),x0(o,67108864)}}function _E(o){if(o.tag===13||o.tag===31){var l=Pi();l=qt(l);var f=Na(o,l);f!==null&&vi(f,o,l),x0(o,l)}}var mp=!0;function EH(o,l,f,p){var v=B.T;B.T=null;var S=q.p;try{q.p=2,S0(o,l,f,p)}finally{q.p=S,B.T=v}}function MH(o,l,f,p){var v=B.T;B.T=null;var S=q.p;try{q.p=8,S0(o,l,f,p)}finally{q.p=S,B.T=v}}function S0(o,l,f,p){if(mp){var v=w0(p);if(v===null)l0(o,l,p,yp,f),VE(o,p);else if(OH(v,o,l,f,p))p.stopPropagation();else if(VE(o,p),l&4&&-1<AH.indexOf(o)){for(;v!==null;){var S=Vi(v);if(S!==null)switch(S.tag){case 3:if(S=S.stateNode,S.current.memoizedState.isDehydrated){var D=gt(S.pendingLanes);if(D!==0){var V=S;for(V.pendingLanes|=2,V.entangledLanes|=2;D;){var Q=1<<31-at(D);V.entanglements[1]|=Q,D&=~Q}es(S),(sn&6)===0&&(Jh=J()+500,Pf(0))}}break;case 31:case 13:V=Na(S,2),V!==null&&vi(V,S,2),tp(),x0(S,2)}if(S=w0(p),S===null&&l0(o,l,p,yp,f),S===v)break;v=S}v!==null&&p.stopPropagation()}else l0(o,l,p,null,f)}}function w0(o){return o=Cl(o),C0(o)}var yp=null;function C0(o){if(yp=null,o=Jn(o),o!==null){var l=s(o);if(l===null)o=null;else{var f=l.tag;if(f===13){if(o=a(l),o!==null)return o;o=null}else if(f===31){if(o=u(l),o!==null)return o;o=null}else if(f===3){if(l.stateNode.current.memoizedState.isDehydrated)return l.tag===3?l.stateNode.containerInfo:null;o=null}else l!==o&&(o=null)}}return yp=o,null}function HE(o){switch(o){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(le()){case we:return 2;case de:return 8;case me:case Be:return 32;case Ke:return 268435456;default:return 32}default:return 32}}var R0=!1,$l=null,ql=null,Gl=null,Hf=new Map,Vf=new Map,Wl=[],AH="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function VE(o,l){switch(o){case"focusin":case"focusout":$l=null;break;case"dragenter":case"dragleave":ql=null;break;case"mouseover":case"mouseout":Gl=null;break;case"pointerover":case"pointerout":Hf.delete(l.pointerId);break;case"gotpointercapture":case"lostpointercapture":Vf.delete(l.pointerId)}}function Ff(o,l,f,p,v,S){return o===null||o.nativeEvent!==S?(o={blockedOn:l,domEventName:f,eventSystemFlags:p,nativeEvent:S,targetContainers:[v]},l!==null&&(l=Vi(l),l!==null&&jE(l)),o):(o.eventSystemFlags|=p,l=o.targetContainers,v!==null&&l.indexOf(v)===-1&&l.push(v),o)}function OH(o,l,f,p,v){switch(l){case"focusin":return $l=Ff($l,o,l,f,p,v),!0;case"dragenter":return ql=Ff(ql,o,l,f,p,v),!0;case"mouseover":return Gl=Ff(Gl,o,l,f,p,v),!0;case"pointerover":var S=v.pointerId;return Hf.set(S,Ff(Hf.get(S)||null,o,l,f,p,v)),!0;case"gotpointercapture":return S=v.pointerId,Vf.set(S,Ff(Vf.get(S)||null,o,l,f,p,v)),!0}return!1}function FE(o){var l=Jn(o.target);if(l!==null){var f=s(l);if(f!==null){if(l=f.tag,l===13){if(l=a(f),l!==null){o.blockedOn=l,Tr(o.priority,function(){_E(f)});return}}else if(l===31){if(l=u(f),l!==null){o.blockedOn=l,Tr(o.priority,function(){_E(f)});return}}else if(l===3&&f.stateNode.current.memoizedState.isDehydrated){o.blockedOn=f.tag===3?f.stateNode.containerInfo:null;return}}}o.blockedOn=null}function vp(o){if(o.blockedOn!==null)return!1;for(var l=o.targetContainers;0<l.length;){var f=w0(o.nativeEvent);if(f===null){f=o.nativeEvent;var p=new f.constructor(f.type,f);wl=p,f.target.dispatchEvent(p),wl=null}else return l=Vi(f),l!==null&&jE(l),o.blockedOn=f,!1;l.shift()}return!0}function UE(o,l,f){vp(o)&&f.delete(l)}function kH(){R0=!1,$l!==null&&vp($l)&&($l=null),ql!==null&&vp(ql)&&(ql=null),Gl!==null&&vp(Gl)&&(Gl=null),Hf.forEach(UE),Vf.forEach(UE)}function bp(o,l){o.blockedOn===l&&(o.blockedOn=null,R0||(R0=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,kH)))}var xp=null;function $E(o){xp!==o&&(xp=o,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){xp===o&&(xp=null);for(var l=0;l<o.length;l+=3){var f=o[l],p=o[l+1],v=o[l+2];if(typeof p!="function"){if(C0(p||f)===null)continue;break}var S=Vi(f);S!==null&&(o.splice(l,3),l-=3,wv(S,{pending:!0,data:v,method:f.method,action:p},p,v))}}))}function ic(o){function l(Q){return bp(Q,o)}$l!==null&&bp($l,o),ql!==null&&bp(ql,o),Gl!==null&&bp(Gl,o),Hf.forEach(l),Vf.forEach(l);for(var f=0;f<Wl.length;f++){var p=Wl[f];p.blockedOn===o&&(p.blockedOn=null)}for(;0<Wl.length&&(f=Wl[0],f.blockedOn===null);)FE(f),f.blockedOn===null&&Wl.shift();if(f=(o.ownerDocument||o).$$reactFormReplay,f!=null)for(p=0;p<f.length;p+=3){var v=f[p],S=f[p+1],D=v[Nt]||null;if(typeof S=="function")D||$E(f);else if(D){var V=null;if(S&&S.hasAttribute("formAction")){if(v=S,D=S[Nt]||null)V=D.formAction;else if(C0(v)!==null)continue}else V=D.action;typeof V=="function"?f[p+1]=V:(f.splice(p,3),p-=3),$E(f)}}}function qE(){function o(S){S.canIntercept&&S.info==="react-transition"&&S.intercept({handler:function(){return new Promise(function(D){return v=D})},focusReset:"manual",scroll:"manual"})}function l(){v!==null&&(v(),v=null),p||setTimeout(f,20)}function f(){if(!p&&!navigation.transition){var S=navigation.currentEntry;S&&S.url!=null&&navigation.navigate(S.url,{state:S.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var p=!1,v=null;return navigation.addEventListener("navigate",o),navigation.addEventListener("navigatesuccess",l),navigation.addEventListener("navigateerror",l),setTimeout(f,100),function(){p=!0,navigation.removeEventListener("navigate",o),navigation.removeEventListener("navigatesuccess",l),navigation.removeEventListener("navigateerror",l),v!==null&&(v(),v=null)}}}function T0(o){this._internalRoot=o}Sp.prototype.render=T0.prototype.render=function(o){var l=this._internalRoot;if(l===null)throw Error(r(409));var f=l.current,p=Pi();LE(f,p,o,l,null,null)},Sp.prototype.unmount=T0.prototype.unmount=function(){var o=this._internalRoot;if(o!==null){this._internalRoot=null;var l=o.containerInfo;LE(o.current,2,null,o,null,null),tp(),l[et]=null}};function Sp(o){this._internalRoot=o}Sp.prototype.unstable_scheduleHydration=function(o){if(o){var l=jn();o={blockedOn:null,target:o,priority:l};for(var f=0;f<Wl.length&&l!==0&&l<Wl[f].priority;f++);Wl.splice(f,0,o),f===0&&FE(o)}};var GE=e.version;if(GE!=="19.2.3")throw Error(r(527,GE,"19.2.3"));q.findDOMNode=function(o){var l=o._reactInternals;if(l===void 0)throw typeof o.render=="function"?Error(r(188)):(o=Object.keys(o).join(","),Error(r(268,o)));return o=d(l),o=o!==null?h(o):null,o=o===null?null:o.stateNode,o};var IH={bundleType:0,version:"19.2.3",rendererPackageName:"react-dom",currentDispatcherRef:B,reconcilerVersion:"19.2.3"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var wp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!wp.isDisabled&&wp.supportsFiber)try{st=wp.inject(IH),Ct=wp}catch{}}return $f.createRoot=function(o,l){if(!i(o))throw Error(r(299));var f=!1,p="",v=JR,S=eT,D=tT;return l!=null&&(l.unstable_strictMode===!0&&(f=!0),l.identifierPrefix!==void 0&&(p=l.identifierPrefix),l.onUncaughtError!==void 0&&(v=l.onUncaughtError),l.onCaughtError!==void 0&&(S=l.onCaughtError),l.onRecoverableError!==void 0&&(D=l.onRecoverableError)),l=zE(o,1,!1,null,null,f,p,null,v,S,D,qE),o[et]=l.current,s0(o),new T0(l)},$f.hydrateRoot=function(o,l,f){if(!i(o))throw Error(r(299));var p=!1,v="",S=JR,D=eT,V=tT,Q=null;return f!=null&&(f.unstable_strictMode===!0&&(p=!0),f.identifierPrefix!==void 0&&(v=f.identifierPrefix),f.onUncaughtError!==void 0&&(S=f.onUncaughtError),f.onCaughtError!==void 0&&(D=f.onCaughtError),f.onRecoverableError!==void 0&&(V=f.onRecoverableError),f.formState!==void 0&&(Q=f.formState)),l=zE(o,1,!0,l,f??null,p,v,Q,S,D,V,qE),l.context=NE(null),f=l.current,p=Pi(),p=qt(p),v=Dl(p),v.callback=null,Pl(f,v,p),f=p,l.current.lanes=f,kn(l,f),es(l),o[et]=l.current,s0(o),new Sp(l)},$f.version="19.2.3",$f}var kM;function SF(){if(kM)return _0.exports;kM=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),_0.exports=xF(),_0.exports}var GI=SF();function wF(t,e){return ow(e),GI.hydrateRoot(e,t)}function CF(t,e){ow(e);var n=GI.createRoot(e);return n.render(t),n}function RF(t){return t.unmount(),!0}var xx=t=>{if(t!=null){var e=t.nodeType===1;if(e&&typeof t.getBoundingClientRect=="function")return t.getBoundingClientRect()}},fd={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,flex:!0,flexGrow:!0,flexOrder:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,fontWeight:!0,gridRow:!0,gridRowEnd:!0,gridRowGap:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnGap:!0,gridColumnStart:!0,lineClamp:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0,scale:!0,scaleX:!0,scaleY:!0,scaleZ:!0,shadowOpacity:!0},TF=["ms","Moz","O","Webkit"],EF=(t,e)=>t+e.charAt(0).toUpperCase()+e.substring(1);Object.keys(fd).forEach(t=>{TF.forEach(e=>{fd[EF(e,t)]=fd[t]})});function MF(t,e,n){var r=e==null||typeof e=="boolean"||e==="";return r?"":!n&&typeof e=="number"&&e!==0&&!(fd.hasOwnProperty(t)&&fd[t])?e+"px":(""+e).trim()}function AF(t,e){var n=t.style;for(var r in e)if(e.hasOwnProperty(r)){var i=r.indexOf("--")===0,s=MF(r,e[r],i);r==="float"&&(r="cssFloat"),i?n.setProperty(r,s):n[r]=s}}var IM=t=>{var e=t.offsetHeight,n=t.offsetWidth,r=t.offsetLeft,i=t.offsetTop;for(t=t.offsetParent;t&&t.nodeType===1;)r+=t.offsetLeft+t.clientLeft-t.scrollLeft,i+=t.offsetTop+t.clientTop-t.scrollTop,t=t.offsetParent;return i-=window.scrollY,r-=window.scrollX,{width:n,height:e,top:i,left:r}},DM=(t,e,n)=>{var r=e||t&&t.parentNode;t&&r&&setTimeout(()=>{if(t.isConnected&&r.isConnected){var i=IM(r),s=IM(t),a=s.height,u=s.left,c=s.top,d=s.width,h=u-i.left,g=c-i.top;n(h,g,d,a,u,c)}},0)},OF={A:!0,BODY:!0,INPUT:!0,SELECT:!0,TEXTAREA:!0},Mg={blur(t){try{t.blur()}catch{}},focus(t){try{var e=t.nodeName;t.getAttribute("tabIndex")==null&&t.isContentEditable!==!0&&OF[e]==null&&t.setAttribute("tabIndex","-1"),t.focus()}catch{}},measure(t,e){DM(t,null,e)},measureInWindow(t,e){t&&setTimeout(()=>{var n=xx(t),r=n.height,i=n.left,s=n.top,a=n.width;e(i,s,a,r)},0)},measureLayout(t,e,n,r){DM(t,e,r)},updateView(t,e){for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=e[n];switch(n){case"style":{AF(t,r);break}case"class":case"className":{t.setAttribute("class",r);break}case"text":case"value":t.value=r;break;default:t.setAttribute(n,r)}}},configureNextLayoutAnimation(t,e){e()},setLayoutAnimationEnabledExperimental(){}};function Sx(){return Sx=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Sx.apply(null,arguments)}var kF={children:!0,dataSet:!0,dir:!0,id:!0,ref:!0,suppressHydrationWarning:!0,tabIndex:!0,testID:!0,focusable:!0,nativeID:!0},IF={"aria-activedescendant":!0,"aria-atomic":!0,"aria-autocomplete":!0,"aria-busy":!0,"aria-checked":!0,"aria-colcount":!0,"aria-colindex":!0,"aria-colspan":!0,"aria-controls":!0,"aria-current":!0,"aria-describedby":!0,"aria-details":!0,"aria-disabled":!0,"aria-errormessage":!0,"aria-expanded":!0,"aria-flowto":!0,"aria-haspopup":!0,"aria-hidden":!0,"aria-invalid":!0,"aria-keyshortcuts":!0,"aria-label":!0,"aria-labelledby":!0,"aria-level":!0,"aria-live":!0,"aria-modal":!0,"aria-multiline":!0,"aria-multiselectable":!0,"aria-orientation":!0,"aria-owns":!0,"aria-placeholder":!0,"aria-posinset":!0,"aria-pressed":!0,"aria-readonly":!0,"aria-required":!0,inert:!0,role:!0,"aria-roledescription":!0,"aria-rowcount":!0,"aria-rowindex":!0,"aria-rowspan":!0,"aria-selected":!0,"aria-setsize":!0,"aria-sort":!0,"aria-valuemax":!0,"aria-valuemin":!0,"aria-valuenow":!0,"aria-valuetext":!0,accessibilityActiveDescendant:!0,accessibilityAtomic:!0,accessibilityAutoComplete:!0,accessibilityBusy:!0,accessibilityChecked:!0,accessibilityColumnCount:!0,accessibilityColumnIndex:!0,accessibilityColumnSpan:!0,accessibilityControls:!0,accessibilityCurrent:!0,accessibilityDescribedBy:!0,accessibilityDetails:!0,accessibilityDisabled:!0,accessibilityErrorMessage:!0,accessibilityExpanded:!0,accessibilityFlowTo:!0,accessibilityHasPopup:!0,accessibilityHidden:!0,accessibilityInvalid:!0,accessibilityKeyShortcuts:!0,accessibilityLabel:!0,accessibilityLabelledBy:!0,accessibilityLevel:!0,accessibilityLiveRegion:!0,accessibilityModal:!0,accessibilityMultiline:!0,accessibilityMultiSelectable:!0,accessibilityOrientation:!0,accessibilityOwns:!0,accessibilityPlaceholder:!0,accessibilityPosInSet:!0,accessibilityPressed:!0,accessibilityReadOnly:!0,accessibilityRequired:!0,accessibilityRole:!0,accessibilityRoleDescription:!0,accessibilityRowCount:!0,accessibilityRowIndex:!0,accessibilityRowSpan:!0,accessibilitySelected:!0,accessibilitySetSize:!0,accessibilitySort:!0,accessibilityValueMax:!0,accessibilityValueMin:!0,accessibilityValueNow:!0,accessibilityValueText:!0},DF={onClick:!0,onAuxClick:!0,onContextMenu:!0,onGotPointerCapture:!0,onLostPointerCapture:!0,onPointerCancel:!0,onPointerDown:!0,onPointerEnter:!0,onPointerMove:!0,onPointerLeave:!0,onPointerOut:!0,onPointerOver:!0,onPointerUp:!0},PF={onBlur:!0,onFocus:!0},zF={onKeyDown:!0,onKeyDownCapture:!0,onKeyUp:!0,onKeyUpCapture:!0},NF={onMouseDown:!0,onMouseEnter:!0,onMouseLeave:!0,onMouseMove:!0,onMouseOver:!0,onMouseOut:!0,onMouseUp:!0},LF={onTouchCancel:!0,onTouchCancelCapture:!0,onTouchEnd:!0,onTouchEndCapture:!0,onTouchMove:!0,onTouchMoveCapture:!0,onTouchStart:!0,onTouchStartCapture:!0},BF={style:!0};function jF(t,e){var n={};for(var r in t)t.hasOwnProperty(r)&&e[r]===!0&&(n[r]=t[r]);return n}var PM=Su?R.useLayoutEffect:R.useEffect,wx="__reactLayoutHandler",U0=null;function _F(){return Su&&typeof window.ResizeObserver<"u"&&U0==null&&(U0=new window.ResizeObserver(function(t){t.forEach(e=>{var n=e.target,r=n[wx];typeof r=="function"&&Mg.measure(n,(i,s,a,u,c,d)=>{var h={nativeEvent:{layout:{x:i,y:s,width:a,height:u,left:c,top:d}},timeStamp:Date.now()};Object.defineProperty(h.nativeEvent,"target",{enumerable:!0,get:()=>e.target}),r(h)})})})),U0}function HF(t,e){var n=_F();PM(()=>{var r=t.current;r!=null&&(r[wx]=e)},[t,e]),PM(()=>{var r=t.current;return r!=null&&n!=null&&(typeof r[wx]=="function"?n.observe(r):n.unobserve(r)),()=>{r!=null&&n!=null&&n.unobserve(r)}},[t,n])}function VF(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return function(i){e.forEach(s=>{if(s!=null){if(typeof s=="function"){s(i);return}if(typeof s=="object"){s.current=i;return}console.error("mergeRefs cannot handle Refs of type boolean, number or string, received ref "+String(s))}})}}function FF(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return R.useMemo(()=>VF(...e),[...e])}var zM=typeof Symbol=="function"&&typeof Symbol()=="symbol"?Symbol():Object.freeze({});function UF(t){var e=R.useRef(zM);return e.current===zM&&(e.current=t()),e.current}function $F(t){t.pointerEvents,t.style;var e=UF(()=>n=>{n!=null&&(n.measure=r=>Mg.measure(n,r),n.measureLayout=(r,i,s)=>Mg.measureLayout(n,r,s,i),n.measureInWindow=r=>Mg.measureInWindow(n,r))});return e}var NM=()=>{},qF={},GF=[];function LM(t){return t>20?t%20:t}function WI(t,e){var n,r=!1,i,s,a=t.changedTouches,u=t.type,c=t.metaKey===!0,d=t.shiftKey===!0,h=a&&a[0].force||0,g=LM(a&&a[0].identifier||0),m=a&&a[0].clientX||t.clientX,y=a&&a[0].clientY||t.clientY,b=a&&a[0].pageX||t.pageX,x=a&&a[0].pageY||t.pageY,w=typeof t.preventDefault=="function"?t.preventDefault.bind(t):NM,C=t.timeStamp;function T(A){return Array.prototype.slice.call(A).map(I=>({force:I.force,identifier:LM(I.identifier),get locationX(){return k(I.clientX)},get locationY(){return P(I.clientY)},pageX:I.pageX,pageY:I.pageY,target:I.target,timestamp:C}))}if(a!=null)i=T(a),s=T(t.touches);else{var E=[{force:h,identifier:g,get locationX(){return k(m)},get locationY(){return P(y)},pageX:b,pageY:x,target:t.target,timestamp:C}];i=E,s=u==="mouseup"||u==="dragstart"?GF:E}var M={bubbles:!0,cancelable:!0,currentTarget:null,defaultPrevented:t.defaultPrevented,dispatchConfig:qF,eventPhase:t.eventPhase,isDefaultPrevented(){return t.defaultPrevented},isPropagationStopped(){return r},isTrusted:t.isTrusted,nativeEvent:{altKey:!1,ctrlKey:!1,metaKey:c,shiftKey:d,changedTouches:i,force:h,identifier:g,get locationX(){return k(m)},get locationY(){return P(y)},pageX:b,pageY:x,target:t.target,timestamp:C,touches:s,type:u},persist:NM,preventDefault:w,stopPropagation(){r=!0},target:t.target,timeStamp:C,touchHistory:e.touchHistory};function k(A){if(n=n||xx(M.currentTarget),n)return A-n.left}function P(A){if(n=n||xx(M.currentTarget),n)return A-n.top}return M}var WF="mousedown",KF="mousemove",YF="mouseup",XF="dragstart",QF="touchstart",ZF="touchmove",JF="touchend",e5="touchcancel",t5="scroll",n5="select",r5="selectionchange";function KI(t){return t===QF||t===WF}function YI(t){return t===ZF||t===KF}function XI(t){return t===JF||t===YF||QI(t)}function QI(t){return t===e5||t===XF}function i5(t){return t===t5}function o5(t){return t===n5||t===r5}function s5(){var t=window.getSelection(),e=t.toString(),n=t.anchorNode,r=t.focusNode,i=n&&n.nodeType===window.Node.TEXT_NODE||r&&r.nodeType===window.Node.TEXT_NODE;return e.length>=1&&e!==`
|
|
13
|
+
`&&i}var ZI="__reactResponderId";function l5(t){if(t.type==="selectionchange"){var e=window.getSelection().anchorNode;return BM(e)}else{var n=t.composedPath!=null?t.composedPath():BM(t.target);return n}}function BM(t){for(var e=[];t!=null&&t!==document.body;)e.push(t),t=t.parentNode;return e}function a5(t){return t!=null?t[ZI]:null}function u5(t,e){t!=null&&(t[ZI]=e)}function c5(t){for(var e=[],n=[],r=l5(t),i=0;i<r.length;i++){var s=r[i],a=a5(s);a!=null&&(e.push(a),n.push(s))}return{idPath:e,nodePath:n}}function f5(t,e){var n=t.length,r=e.length;if(n===0||r===0||t[n-1]!==e[r-1])return null;var i=t[0],s=0,a=e[0],u=0;n-r>0&&(s=n-r,i=t[s],n=r),r-n>0&&(u=r-n,a=e[u],r=n);for(var c=n;c--;){if(i===a)return i;i=t[s++],a=e[u++]}return null}function d5(t,e){if(!e||e.length===0)return!1;for(var n=0;n<e.length;n++){var r=e[n].target;if(r!=null&&t.contains(r))return!0}return!1}function h5(t){return t.type==="selectionchange"?s5():t.type==="select"}function p5(t){var e=t.altKey,n=t.button,r=t.buttons,i=t.ctrlKey,s=t.type,a=s==="touchstart"||s==="touchmove",u=s==="mousedown"&&(n===0||r===1),c=s==="mousemove"&&r===1,d=e===!1&&i===!1;return!!(a||u&&d||c&&d)}var jM=20;function uo(t){return t.timeStamp||t.timestamp}function g5(t){return{touchActive:!0,startPageX:t.pageX,startPageY:t.pageY,startTimeStamp:uo(t),currentPageX:t.pageX,currentPageY:t.pageY,currentTimeStamp:uo(t),previousPageX:t.pageX,previousPageY:t.pageY,previousTimeStamp:uo(t)}}function m5(t,e){t.touchActive=!0,t.startPageX=e.pageX,t.startPageY=e.pageY,t.startTimeStamp=uo(e),t.currentPageX=e.pageX,t.currentPageY=e.pageY,t.currentTimeStamp=uo(e),t.previousPageX=e.pageX,t.previousPageY=e.pageY,t.previousTimeStamp=uo(e)}function sw(t){var e=t.identifier;return e==null&&console.error("Touch object is missing identifier."),e}function y5(t,e){var n=sw(t),r=e.touchBank[n];r?m5(r,t):e.touchBank[n]=g5(t),e.mostRecentTimeStamp=uo(t)}function v5(t,e){var n=e.touchBank[sw(t)];n?(n.touchActive=!0,n.previousPageX=n.currentPageX,n.previousPageY=n.currentPageY,n.previousTimeStamp=n.currentTimeStamp,n.currentPageX=t.pageX,n.currentPageY=t.pageY,n.currentTimeStamp=uo(t),e.mostRecentTimeStamp=uo(t)):console.warn(`Cannot record touch move without a touch start.
|
|
14
|
+
`,"Touch Move: "+JI(t)+`
|
|
15
|
+
`,"Touch Bank: "+eD(e))}function b5(t,e){var n=e.touchBank[sw(t)];n?(n.touchActive=!1,n.previousPageX=n.currentPageX,n.previousPageY=n.currentPageY,n.previousTimeStamp=n.currentTimeStamp,n.currentPageX=t.pageX,n.currentPageY=t.pageY,n.currentTimeStamp=uo(t),e.mostRecentTimeStamp=uo(t)):console.warn(`Cannot record touch end without a touch start.
|
|
16
|
+
`,"Touch End: "+JI(t)+`
|
|
17
|
+
`,"Touch Bank: "+eD(e))}function JI(t){return JSON.stringify({identifier:t.identifier,pageX:t.pageX,pageY:t.pageY,timestamp:uo(t)})}function eD(t){var e=t.touchBank,n=JSON.stringify(e.slice(0,jM));return e.length>jM&&(n+=" (original size: "+e.length+")"),n}class x5{constructor(){this._touchHistory={touchBank:[],numberActiveTouches:0,indexOfSingleActiveTouch:-1,mostRecentTimeStamp:0}}recordTouchTrack(e,n){var r=this._touchHistory;if(YI(e))n.changedTouches.forEach(u=>v5(u,r));else if(KI(e))n.changedTouches.forEach(u=>y5(u,r)),r.numberActiveTouches=n.touches.length,r.numberActiveTouches===1&&(r.indexOfSingleActiveTouch=n.touches[0].identifier);else if(XI(e)&&(n.changedTouches.forEach(u=>b5(u,r)),r.numberActiveTouches=n.touches.length,r.numberActiveTouches===1))for(var i=r.touchBank,s=0;s<i.length;s++){var a=i[s];if(a!=null&&a.touchActive){r.indexOfSingleActiveTouch=s;break}}}get touchHistory(){return this._touchHistory}}var S5={},_M=["onStartShouldSetResponderCapture","onStartShouldSetResponder",{bubbles:!0}],HM=["onMoveShouldSetResponderCapture","onMoveShouldSetResponder",{bubbles:!0}],w5=["onScrollShouldSetResponderCapture","onScrollShouldSetResponder",{bubbles:!1}],C5={touchstart:_M,mousedown:_M,touchmove:HM,mousemove:HM,scroll:w5},Cx={id:null,idPath:null,node:null},$g=new Map,Xl=!1,os=0,ds={id:null,node:null,idPath:null},Rx=new x5;function Ed(t){ds=t}function Md(t){var e=$g.get(t);return e??S5}function $0(t){var e=t.type,n=t.target;if(e==="touchstart"&&(Xl=!0),(e==="touchmove"||os>1)&&(Xl=!1),!(e==="mousedown"&&Xl||e==="mousemove"&&Xl||e==="mousemove"&&os<1)){if(Xl&&e==="mouseup"){os===0&&(Xl=!1);return}var r=KI(e)&&p5(t),i=YI(e),s=XI(e),a=i5(e),u=o5(e),c=WI(t,Rx);(r||i||s)&&(t.touches?os=t.touches.length:r?os=1:s&&(os=0),Rx.recordTouchTrack(e,c.nativeEvent));var d=c5(t),h=!1,g;if(r||i||a&&os>0){var m=ds.idPath,y=d.idPath;if(m!=null&&y!=null){var b=f5(m,y);if(b!=null){var x=y.indexOf(b),w=x+(b===ds.id?1:0);d={idPath:y.slice(w),nodePath:d.nodePath.slice(w)}}else d=null}d!=null&&(g=R5(d,t,c),g!=null&&(T5(c,g),h=!0))}if(ds.id!=null&&ds.node!=null){var C=ds,T=C.id,E=C.node,M=Md(T),k=M.onResponderStart,P=M.onResponderMove,A=M.onResponderEnd,I=M.onResponderRelease,L=M.onResponderTerminate,j=M.onResponderTerminationRequest;if(c.bubbles=!1,c.cancelable=!1,c.currentTarget=E,r)k!=null&&(c.dispatchConfig.registrationName="onResponderStart",k(c));else if(i)P!=null&&(c.dispatchConfig.registrationName="onResponderMove",P(c));else{var N=QI(e)||e==="contextmenu"||e==="blur"&&n===window||e==="blur"&&n.contains(E)&&t.relatedTarget!==E||a&&os===0||a&&n.contains(E)&&n!==E||u&&h5(t),_=s&&!N&&!d5(E,t.touches);if(s&&A!=null&&(c.dispatchConfig.registrationName="onResponderEnd",A(c)),_&&(I!=null&&(c.dispatchConfig.registrationName="onResponderRelease",I(c)),Ed(Cx)),N){var H=!0;(e==="contextmenu"||e==="scroll"||e==="selectionchange")&&(h?H=!1:j!=null&&(c.dispatchConfig.registrationName="onResponderTerminationRequest",j(c)===!1&&(H=!1))),H&&(L!=null&&(c.dispatchConfig.registrationName="onResponderTerminate",L(c)),Ed(Cx),Xl=!1,os=0)}}}}}function R5(t,e,n){var r=C5[e.type];if(r!=null){for(var i=t.idPath,s=t.nodePath,a=r[0],u=r[1],c=r[2].bubbles,d=function(P,A,I){var L=Md(P),j=L[I];if(j!=null&&(n.currentTarget=A,j(n)===!0)){var N=i.slice(i.indexOf(P));return{id:P,node:A,idPath:N}}},h=i.length-1;h>=0;h--){var g=i[h],m=s[h],y=d(g,m,a);if(y!=null)return y;if(n.isPropagationStopped()===!0)return}if(c)for(var b=0;b<i.length;b++){var x=i[b],w=s[b],C=d(x,w,u);if(C!=null)return C;if(n.isPropagationStopped()===!0)return}else{var T=i[0],E=s[0],M=e.target;if(M===E)return d(T,E,u)}}}function T5(t,e){var n=ds,r=n.id,i=n.node,s=e.id,a=e.node,u=Md(s),c=u.onResponderGrant,d=u.onResponderReject;if(t.bubbles=!1,t.cancelable=!1,t.currentTarget=a,r==null)c!=null&&(t.currentTarget=a,t.dispatchConfig.registrationName="onResponderGrant",c(t)),Ed(e);else{var h=Md(r),g=h.onResponderTerminate,m=h.onResponderTerminationRequest,y=!0;m!=null&&(t.currentTarget=i,t.dispatchConfig.registrationName="onResponderTerminationRequest",m(t)===!1&&(y=!1)),y?(g!=null&&(t.currentTarget=i,t.dispatchConfig.registrationName="onResponderTerminate",g(t)),c!=null&&(t.currentTarget=a,t.dispatchConfig.registrationName="onResponderGrant",c(t)),Ed(e)):d!=null&&(t.currentTarget=a,t.dispatchConfig.registrationName="onResponderReject",d(t))}}var E5=["blur","scroll"],M5=["mousedown","mousemove","mouseup","dragstart","touchstart","touchmove","touchend","touchcancel","contextmenu","select","selectionchange"];function A5(){Su&&window.__reactResponderSystemActive==null&&(window.addEventListener("blur",$0),M5.forEach(t=>{document.addEventListener(t,$0)}),E5.forEach(t=>{document.addEventListener(t,$0,!0)}),window.__reactResponderSystemActive=!0)}function O5(t,e,n){u5(e,t),$g.set(t,n)}function VM(t){ds.id===t&&k5(),$g.has(t)&&$g.delete(t)}function k5(){var t=ds,e=t.id,n=t.node;if(e!=null&&n!=null){var r=Md(e),i=r.onResponderTerminate;if(i!=null){var s=WI({},Rx);s.currentTarget=n,i(s)}Ed(Cx)}Xl=!1,os=0}function I5(){return ds.node}var D5={},P5=0;function z5(t){var e=R.useRef(null);return e.current==null&&(e.current=t()),e.current}function N5(t,e){e===void 0&&(e=D5);var n=z5(()=>P5++),r=R.useRef(!1);R.useEffect(()=>(A5(),()=>{VM(n)}),[n]),R.useEffect(()=>{var i=e,s=i.onMoveShouldSetResponder,a=i.onMoveShouldSetResponderCapture,u=i.onScrollShouldSetResponder,c=i.onScrollShouldSetResponderCapture,d=i.onSelectionChangeShouldSetResponder,h=i.onSelectionChangeShouldSetResponderCapture,g=i.onStartShouldSetResponder,m=i.onStartShouldSetResponderCapture,y=s!=null||a!=null||u!=null||c!=null||d!=null||h!=null||g!=null||m!=null,b=t.current;y?(O5(n,b,e),r.current=!0):r.current&&(VM(n),r.current=!1)},[e,t,n]),R.useDebugValue({isResponder:t.current===I5()}),R.useDebugValue(e)}var L5=R.createContext(!1),B5=["hrefAttrs","onLayout","onMoveShouldSetResponder","onMoveShouldSetResponderCapture","onResponderEnd","onResponderGrant","onResponderMove","onResponderReject","onResponderRelease","onResponderStart","onResponderTerminate","onResponderTerminationRequest","onScrollShouldSetResponder","onScrollShouldSetResponderCapture","onSelectionChangeShouldSetResponder","onSelectionChangeShouldSetResponderCapture","onStartShouldSetResponder","onStartShouldSetResponderCapture"],j5=Object.assign({},kF,IF,DF,PF,zF,NF,LF,BF,{href:!0,lang:!0,onScroll:!0,onWheel:!0,pointerEvents:!0}),_5=t=>jF(t,j5),Tx=R.forwardRef((t,e)=>{var n=t.hrefAttrs,r=t.onLayout,i=t.onMoveShouldSetResponder,s=t.onMoveShouldSetResponderCapture,a=t.onResponderEnd,u=t.onResponderGrant,c=t.onResponderMove,d=t.onResponderReject,h=t.onResponderRelease,g=t.onResponderStart,m=t.onResponderTerminate,y=t.onResponderTerminationRequest,b=t.onScrollShouldSetResponder,x=t.onScrollShouldSetResponderCapture,w=t.onSelectionChangeShouldSetResponder,C=t.onSelectionChangeShouldSetResponderCapture,T=t.onStartShouldSetResponder,E=t.onStartShouldSetResponderCapture,M=km(t,B5),k=R.useContext(L5),P=R.useRef(null),A=gF(),I=A.direction;HF(P,r),N5(P,{onMoveShouldSetResponder:i,onMoveShouldSetResponderCapture:s,onResponderEnd:a,onResponderGrant:u,onResponderMove:c,onResponderReject:d,onResponderRelease:h,onResponderStart:g,onResponderTerminate:m,onResponderTerminationRequest:y,onScrollShouldSetResponder:b,onScrollShouldSetResponderCapture:x,onSelectionChangeShouldSetResponder:w,onSelectionChangeShouldSetResponderCapture:C,onStartShouldSetResponder:T,onStartShouldSetResponderCapture:E});var L="div",j=t.lang!=null?$I(t.lang):null,N=t.dir||j,_=N||I,H=_5(M);if(H.dir=N,H.style=[FM.view$raw,k&&FM.inline,t.style],t.href!=null&&(L="a",n!=null)){var F=n.download,G=n.rel,B=n.target;F!=null&&(H.download=F),G!=null&&(H.rel=G),typeof B=="string"&&(H.target=B.charAt(0)!=="_"?"_"+B:B)}var q=$F(H),U=FF(P,q,e);return H.ref=U,mF(L,H,{writingDirection:_})});Tx.displayName="View";var FM=Qd.create({view$raw:{alignContent:"flex-start",alignItems:"stretch",backgroundColor:"transparent",border:"0 solid black",boxSizing:"border-box",display:"flex",flexBasis:"auto",flexDirection:"column",flexShrink:0,listStyle:"none",margin:0,minHeight:0,minWidth:0,padding:0,position:"relative",textDecoration:"none",zIndex:0},inline:{display:"inline-flex"}}),q0,UM;function H5(){if(UM)return q0;UM=1;function t(e,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),s=2;s<r;s++)i[s-2]=arguments[s];if(!e){var a;if(n===void 0)a=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=0;a=new Error(n.replace(/%s/g,function(){return String(i[u++])})),a.name="Invariant Violation"}throw a.framesToPop=1,a}}return q0=t,q0}var V5=H5();const Ag=Fo(V5);var F5=R.createContext(null),lw=R.forwardRef((t,e)=>{var n=t.children,r=t.WrapperComponent,i=R.createElement(Tx,{children:n,key:1,style:$M.appContainer});return r&&(i=R.createElement(r,null,i)),R.createElement(F5.Provider,{value:t.rootTag},R.createElement(Tx,{ref:e,style:$M.appContainer},i))});lw.displayName="AppContainer";var $M=Qd.create({appContainer:{flex:1,pointerEvents:"box-none"}});function U5(t,e,n,r){var i=r.hydrate,s=r.initialProps,a=r.rootTag,u=i?wF:CF;return Ag(a,"Expect to have a valid rootTag, instead got ",a),u(Ve.createElement(lw,{WrapperComponent:e,ref:n,rootTag:a},Ve.createElement(t,s)),a)}function $5(t,e,n){var r=Ve.createElement(lw,{WrapperComponent:n,rootTag:{}},Ve.createElement(t,e)),i=s=>{var a=Qd.getSheet();return Ve.createElement("style",Sx({},s,{dangerouslySetInnerHTML:{__html:a.textContent},id:a.id}))};return{element:r,getStyleElement:i}}var qM={},Ks={},G0=t=>t(),qf;class Ad{static getAppKeys(){return Object.keys(Ks)}static getApplication(e,n){return Ag(Ks[e]&&Ks[e].getApplication,"Application "+e+" has not been registered. This is either due to an import error during initialization or failure to call AppRegistry.registerComponent."),Ks[e].getApplication(n)}static registerComponent(e,n){return Ks[e]={getApplication:r=>$5(G0(n),r?r.initialProps:qM,qf&&qf(r)),run:r=>U5(G0(n),qf&&qf(r),r.callback,{hydrate:r.hydrate||!1,initialProps:r.initialProps||qM,mode:r.mode||"concurrent",rootTag:r.rootTag})},e}static registerConfig(e){e.forEach(n=>{var r=n.appKey,i=n.component,s=n.run;s?Ad.registerRunnable(r,s):(Ag(i,"No component provider passed in"),Ad.registerComponent(r,i))})}static registerRunnable(e,n){return Ks[e]={run:n},e}static runApplication(e,n){return Ag(Ks[e]&&Ks[e].run,'Application "'+e+'" has not been registered. This is either due to an import error during initialization or failure to call AppRegistry.registerComponent.'),Ks[e].run(n)}static setComponentProviderInstrumentationHook(e){G0=e}static setWrapperComponentProvider(e){qf=e}static unmountApplicationComponentAtRootTag(e){RF(e)}}var po=qI();const q5=Fo(po);var W0={exports:{}},Gf={};var GM;function G5(){if(GM)return Gf;GM=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function n(r,i,s){var a=null;if(s!==void 0&&(a=""+s),i.key!==void 0&&(a=""+i.key),"key"in i){s={};for(var u in i)u!=="key"&&(s[u]=i[u])}else s=i;return i=s.ref,{$$typeof:t,type:r,key:a,ref:i!==void 0?i:null,props:s}}return Gf.Fragment=e,Gf.jsx=n,Gf.jsxs=n,Gf}var WM;function W5(){return WM||(WM=1,W0.exports=G5()),W0.exports}var O=W5(),Jd=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(){}},cu=typeof window>"u"||"Deno"in globalThis;function bi(){}function K5(t,e){return typeof t=="function"?t(e):t}function Ex(t){return typeof t=="number"&&t>=0&&t!==1/0}function tD(t,e){return Math.max(t+(e||0)-Date.now(),0)}function ia(t,e){return typeof t=="function"?t(e):t}function to(t,e){return typeof t=="function"?t(e):t}function KM(t,e){const{type:n="all",exact:r,fetchStatus:i,predicate:s,queryKey:a,stale:u}=t;if(a){if(r){if(e.queryHash!==aw(a,e.options))return!1}else if(!kd(e.queryKey,a))return!1}if(n!=="all"){const c=e.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof u=="boolean"&&e.isStale()!==u||i&&i!==e.state.fetchStatus||s&&!s(e))}function YM(t,e){const{exact:n,status:r,predicate:i,mutationKey:s}=t;if(s){if(!e.options.mutationKey)return!1;if(n){if(Od(e.options.mutationKey)!==Od(s))return!1}else if(!kd(e.options.mutationKey,s))return!1}return!(r&&e.state.status!==r||i&&!i(e))}function aw(t,e){return(e?.queryKeyHashFn||Od)(t)}function Od(t){return JSON.stringify(t,(e,n)=>Ax(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function kd(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?Object.keys(e).every(n=>kd(t[n],e[n])):!1}function nD(t,e){if(t===e)return t;const n=XM(t)&&XM(e);if(n||Ax(t)&&Ax(e)){const r=n?t:Object.keys(t),i=r.length,s=n?e:Object.keys(e),a=s.length,u=n?[]:{},c=new Set(r);let d=0;for(let h=0;h<a;h++){const g=n?h:s[h];(!n&&c.has(g)||n)&&t[g]===void 0&&e[g]===void 0?(u[g]=void 0,d++):(u[g]=nD(t[g],e[g]),u[g]===t[g]&&t[g]!==void 0&&d++)}return i===a&&d===i?t:u}return e}function Mx(t,e){if(!e||Object.keys(t).length!==Object.keys(e).length)return!1;for(const n in t)if(t[n]!==e[n])return!1;return!0}function XM(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function Ax(t){if(!QM(t))return!1;const e=t.constructor;if(e===void 0)return!0;const n=e.prototype;return!(!QM(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function QM(t){return Object.prototype.toString.call(t)==="[object Object]"}function Y5(t){return new Promise(e=>{setTimeout(e,t)})}function Ox(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?nD(t,e):e}function X5(t){return t}function Q5(t,e,n=0){const r=[...t,e];return n&&r.length>n?r.slice(1):r}function Z5(t,e,n=0){const r=[e,...t];return n&&r.length>n?r.slice(0,-1):r}var uw=Symbol();function rD(t,e){return!t.queryFn&&e?.initialPromise?()=>e.initialPromise:!t.queryFn||t.queryFn===uw?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function J5(t,e){return typeof t=="function"?t(...e):!!t}var e4=class extends Jd{#e;#t;#n;constructor(){super(),this.#n=t=>{if(!cu&&window.addEventListener){const e=()=>t();return window.addEventListener("visibilitychange",e,!1),()=>{window.removeEventListener("visibilitychange",e)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(t){this.#n=t,this.#t?.(),this.#t=t(e=>{typeof e=="boolean"?this.setFocused(e):this.onFocus()})}setFocused(t){this.#e!==t&&(this.#e=t,this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(e=>{e(t)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},cw=new e4,t4=class extends Jd{#e=!0;#t;#n;constructor(){super(),this.#n=t=>{if(!cu&&window.addEventListener){const e=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",e,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(t){this.#n=t,this.#t?.(),this.#t=t(this.setOnline.bind(this))}setOnline(t){this.#e!==t&&(this.#e=t,this.listeners.forEach(n=>{n(t)}))}isOnline(){return this.#e}},qg=new t4;function kx(){let t,e;const n=new Promise((i,s)=>{t=i,e=s});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),t(i)},n.reject=i=>{r({status:"rejected",reason:i}),e(i)},n}function n4(t){return Math.min(1e3*2**t,3e4)}function iD(t){return(t??"online")==="online"?qg.isOnline():!0}var oD=class extends Error{constructor(t){super("CancelledError"),this.revert=t?.revert,this.silent=t?.silent}};function K0(t){return t instanceof oD}function sD(t){let e=!1,n=0,r=!1,i;const s=kx(),a=x=>{r||(m(new oD(x)),t.abort?.())},u=()=>{e=!0},c=()=>{e=!1},d=()=>cw.isFocused()&&(t.networkMode==="always"||qg.isOnline())&&t.canRun(),h=()=>iD(t.networkMode)&&t.canRun(),g=x=>{r||(r=!0,t.onSuccess?.(x),i?.(),s.resolve(x))},m=x=>{r||(r=!0,t.onError?.(x),i?.(),s.reject(x))},y=()=>new Promise(x=>{i=w=>{(r||d())&&x(w)},t.onPause?.()}).then(()=>{i=void 0,r||t.onContinue?.()}),b=()=>{if(r)return;let x;const w=n===0?t.initialPromise:void 0;try{x=w??t.fn()}catch(C){x=Promise.reject(C)}Promise.resolve(x).then(g).catch(C=>{if(r)return;const T=t.retry??(cu?0:3),E=t.retryDelay??n4,M=typeof E=="function"?E(n,C):E,k=T===!0||typeof T=="number"&&n<T||typeof T=="function"&&T(n,C);if(e||!k){m(C);return}n++,t.onFail?.(n,C),Y5(M).then(()=>d()?void 0:y()).then(()=>{e?m(C):b()})})};return{promise:s,cancel:a,continue:()=>(i?.(),s),cancelRetry:u,continueRetry:c,canStart:h,start:()=>(h()?b():y().then(b),s)}}var r4=t=>setTimeout(t,0);function i4(){let t=[],e=0,n=u=>{u()},r=u=>{u()},i=r4;const s=u=>{e?t.push(u):i(()=>{n(u)})},a=()=>{const u=t;t=[],u.length&&i(()=>{r(()=>{u.forEach(c=>{n(c)})})})};return{batch:u=>{let c;e++;try{c=u()}finally{e--,e||a()}return c},batchCalls:u=>(...c)=>{s(()=>{u(...c)})},schedule:s,setNotifyFunction:u=>{n=u},setBatchNotifyFunction:u=>{r=u},setScheduler:u=>{i=u}}}var Lr=i4(),lD=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Ex(this.gcTime)&&(this.#e=setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(cu?1/0:300*1e3))}clearGcTimeout(){this.#e&&(clearTimeout(this.#e),this.#e=void 0)}},o4=class extends lD{#e;#t;#n;#r;#i;#l;#s;constructor(t){super(),this.#s=!1,this.#l=t.defaultOptions,this.setOptions(t.options),this.observers=[],this.#r=t.client,this.#n=this.#r.getQueryCache(),this.queryKey=t.queryKey,this.queryHash=t.queryHash,this.#e=s4(this.options),this.state=t.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#i?.promise}setOptions(t){this.options={...this.#l,...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(t,e){const n=Ox(this.state.data,t,this.options);return this.#o({data:n,type:"success",dataUpdatedAt:e?.updatedAt,manual:e?.manual}),n}setState(t,e){this.#o({type:"setState",state:t,setStateOptions:e})}cancel(t){const e=this.#i?.promise;return this.#i?.cancel(t),e?e.then(bi).catch(bi):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(t=>to(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===uw||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>ia(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!tD(this.state.dataUpdatedAt,t)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#i?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#i?.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(e=>e!==t),this.observers.length||(this.#i&&(this.#s?this.#i.cancel({revert:!0}):this.#i.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#o({type:"invalidate"})}fetch(t,e){if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&e?.cancelRefetch)this.cancel({silent:!0});else if(this.#i)return this.#i.continueRetry(),this.#i.promise}if(t&&this.setOptions(t),!this.options.queryFn){const c=this.observers.find(d=>d.options.queryFn);c&&this.setOptions(c.options)}const n=new AbortController,r=c=>{Object.defineProperty(c,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{const c=rD(this.options,e),h=(()=>{const g={client:this.#r,queryKey:this.queryKey,meta:this.meta};return r(g),g})();return this.#s=!1,this.options.persister?this.options.persister(c,h,this):c(h)},a=(()=>{const c={fetchOptions:e,options:this.options,queryKey:this.queryKey,client:this.#r,state:this.state,fetchFn:i};return r(c),c})();this.options.behavior?.onFetch(a,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#o({type:"fetch",meta:a.fetchOptions?.meta});const u=c=>{K0(c)&&c.silent||this.#o({type:"error",error:c}),K0(c)||(this.#n.config.onError?.(c,this),this.#n.config.onSettled?.(this.state.data,c,this)),this.scheduleGc()};return this.#i=sD({initialPromise:e?.initialPromise,fn:a.fetchFn,abort:n.abort.bind(n),onSuccess:c=>{if(c===void 0){u(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(c)}catch(d){u(d);return}this.#n.config.onSuccess?.(c,this),this.#n.config.onSettled?.(c,this.state.error,this),this.scheduleGc()},onError:u,onFail:(c,d)=>{this.#o({type:"failed",failureCount:c,error:d})},onPause:()=>{this.#o({type:"pause"})},onContinue:()=>{this.#o({type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0}),this.#i.start()}#o(t){const e=n=>{switch(t.type){case"failed":return{...n,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...aD(n.data,this.options),fetchMeta:t.meta??null};case"success":return this.#t=void 0,{...n,data:t.data,dataUpdateCount:n.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const r=t.error;return K0(r)&&r.revert&&this.#t?{...this.#t,fetchStatus:"idle"}:{...n,error:r,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=e(this.state),Lr.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:t})})}};function aD(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:iD(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function s4(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,n=e!==void 0,r=n?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var l4=class extends Jd{constructor(t={}){super(),this.config=t,this.#e=new Map}#e;build(t,e,n){const r=e.queryKey,i=e.queryHash??aw(r,e);let s=this.get(i);return s||(s=new o4({client:t,queryKey:r,queryHash:i,options:t.defaultQueryOptions(e),state:n,defaultOptions:t.getQueryDefaults(r)}),this.add(s)),s}add(t){this.#e.has(t.queryHash)||(this.#e.set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const e=this.#e.get(t.queryHash);e&&(t.destroy(),e===t&&this.#e.delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Lr.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return this.#e.get(t)}getAll(){return[...this.#e.values()]}find(t){const e={exact:!0,...t};return this.getAll().find(n=>KM(e,n))}findAll(t={}){const e=this.getAll();return Object.keys(t).length>0?e.filter(n=>KM(t,n)):e}notify(t){Lr.batch(()=>{this.listeners.forEach(e=>{e(t)})})}onFocus(){Lr.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Lr.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},a4=class extends lD{#e;#t;#n;constructor(t){super(),this.mutationId=t.mutationId,this.#t=t.mutationCache,this.#e=[],this.state=t.state||u4(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){this.#e.includes(t)||(this.#e.push(t),this.clearGcTimeout(),this.#t.notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){this.#e=this.#e.filter(e=>e!==t),this.scheduleGc(),this.#t.notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){this.#e.length||(this.state.status==="pending"?this.scheduleGc():this.#t.remove(this))}continue(){return this.#n?.continue()??this.execute(this.state.variables)}async execute(t){const e=()=>{this.#r({type:"continue"})};this.#n=sD({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(i,s)=>{this.#r({type:"failed",failureCount:i,error:s})},onPause:()=>{this.#r({type:"pause"})},onContinue:e,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#t.canRun(this)});const n=this.state.status==="pending",r=!this.#n.canStart();try{if(n)e();else{this.#r({type:"pending",variables:t,isPaused:r}),await this.#t.config.onMutate?.(t,this);const s=await this.options.onMutate?.(t);s!==this.state.context&&this.#r({type:"pending",context:s,variables:t,isPaused:r})}const i=await this.#n.start();return await this.#t.config.onSuccess?.(i,t,this.state.context,this),await this.options.onSuccess?.(i,t,this.state.context),await this.#t.config.onSettled?.(i,null,this.state.variables,this.state.context,this),await this.options.onSettled?.(i,null,t,this.state.context),this.#r({type:"success",data:i}),i}catch(i){try{throw await this.#t.config.onError?.(i,t,this.state.context,this),await this.options.onError?.(i,t,this.state.context),await this.#t.config.onSettled?.(void 0,i,this.state.variables,this.state.context,this),await this.options.onSettled?.(void 0,i,t,this.state.context),i}finally{this.#r({type:"error",error:i})}}finally{this.#t.runNext(this)}}#r(t){const e=n=>{switch(t.type){case"failed":return{...n,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...n,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:t.error,failureCount:n.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=e(this.state),Lr.batch(()=>{this.#e.forEach(n=>{n.onMutationUpdate(t)}),this.#t.notify({mutation:this,type:"updated",action:t})})}};function u4(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var c4=class extends Jd{constructor(t={}){super(),this.config=t,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(t,e,n){const r=new a4({mutationCache:this,mutationId:++this.#n,options:t.defaultMutationOptions(e),state:n});return this.add(r),r}add(t){this.#e.add(t);const e=Lp(t);if(typeof e=="string"){const n=this.#t.get(e);n?n.push(t):this.#t.set(e,[t])}this.notify({type:"added",mutation:t})}remove(t){if(this.#e.delete(t)){const e=Lp(t);if(typeof e=="string"){const n=this.#t.get(e);if(n)if(n.length>1){const r=n.indexOf(t);r!==-1&&n.splice(r,1)}else n[0]===t&&this.#t.delete(e)}}this.notify({type:"removed",mutation:t})}canRun(t){const e=Lp(t);if(typeof e=="string"){const r=this.#t.get(e)?.find(i=>i.state.status==="pending");return!r||r===t}else return!0}runNext(t){const e=Lp(t);return typeof e=="string"?this.#t.get(e)?.find(r=>r!==t&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Lr.batch(()=>{this.#e.forEach(t=>{this.notify({type:"removed",mutation:t})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(t){const e={exact:!0,...t};return this.getAll().find(n=>YM(e,n))}findAll(t={}){return this.getAll().filter(e=>YM(t,e))}notify(t){Lr.batch(()=>{this.listeners.forEach(e=>{e(t)})})}resumePausedMutations(){const t=this.getAll().filter(e=>e.state.isPaused);return Lr.batch(()=>Promise.all(t.map(e=>e.continue().catch(bi))))}};function Lp(t){return t.options.scope?.id}function Gg(t){return{onFetch:(e,n)=>{const r=e.options,i=e.fetchOptions?.meta?.fetchMore?.direction,s=e.state.data?.pages||[],a=e.state.data?.pageParams||[];let u={pages:[],pageParams:[]},c=0;const d=async()=>{let h=!1;const g=b=>{Object.defineProperty(b,"signal",{enumerable:!0,get:()=>(e.signal.aborted?h=!0:e.signal.addEventListener("abort",()=>{h=!0}),e.signal)})},m=rD(e.options,e.fetchOptions),y=async(b,x,w)=>{if(h)return Promise.reject();if(x==null&&b.pages.length)return Promise.resolve(b);const T=(()=>{const P={client:e.client,queryKey:e.queryKey,pageParam:x,direction:w?"backward":"forward",meta:e.options.meta};return g(P),P})(),E=await m(T),{maxPages:M}=e.options,k=w?Z5:Q5;return{pages:k(b.pages,E,M),pageParams:k(b.pageParams,x,M)}};if(i&&s.length){const b=i==="backward",x=b?uD:Ix,w={pages:s,pageParams:a},C=x(r,w);u=await y(w,C,b)}else{const b=t??s.length;do{const x=c===0?a[0]??r.initialPageParam:Ix(r,u);if(c>0&&x==null)break;u=await y(u,x),c++}while(c<b)}return u};e.options.persister?e.fetchFn=()=>e.options.persister?.(d,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},n):e.fetchFn=d}}}function Ix(t,{pages:e,pageParams:n}){const r=e.length-1;return e.length>0?t.getNextPageParam(e[r],e,n[r],n):void 0}function uD(t,{pages:e,pageParams:n}){return e.length>0?t.getPreviousPageParam?.(e[0],e,n[0],n):void 0}function f4(t,e){return e?Ix(t,e)!=null:!1}function d4(t,e){return!e||!t.getPreviousPageParam?!1:uD(t,e)!=null}var h4=class{#e;#t;#n;#r;#i;#l;#s;#o;constructor(t={}){this.#e=t.queryCache||new l4,this.#t=t.mutationCache||new c4,this.#n=t.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#l=0}mount(){this.#l++,this.#l===1&&(this.#s=cw.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#o=qg.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#l--,this.#l===0&&(this.#s?.(),this.#s=void 0,this.#o?.(),this.#o=void 0)}isFetching(t){return this.#e.findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return this.#t.findAll({...t,status:"pending"}).length}getQueryData(t){const e=this.defaultQueryOptions({queryKey:t});return this.#e.get(e.queryHash)?.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),n=this.#e.build(this,e),r=n.state.data;return r===void 0?this.fetchQuery(t):(t.revalidateIfStale&&n.isStaleByTime(ia(e.staleTime,n))&&this.prefetchQuery(e),Promise.resolve(r))}getQueriesData(t){return this.#e.findAll(t).map(({queryKey:e,state:n})=>{const r=n.data;return[e,r]})}setQueryData(t,e,n){const r=this.defaultQueryOptions({queryKey:t}),s=this.#e.get(r.queryHash)?.state.data,a=K5(e,s);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(t,e,n){return Lr.batch(()=>this.#e.findAll(t).map(({queryKey:r})=>[r,this.setQueryData(r,e,n)]))}getQueryState(t){const e=this.defaultQueryOptions({queryKey:t});return this.#e.get(e.queryHash)?.state}removeQueries(t){const e=this.#e;Lr.batch(()=>{e.findAll(t).forEach(n=>{e.remove(n)})})}resetQueries(t,e){const n=this.#e;return Lr.batch(()=>(n.findAll(t).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const n={revert:!0,...e},r=Lr.batch(()=>this.#e.findAll(t).map(i=>i.cancel(n)));return Promise.all(r).then(bi).catch(bi)}invalidateQueries(t,e={}){return Lr.batch(()=>(this.#e.findAll(t).forEach(n=>{n.invalidate()}),t?.refetchType==="none"?Promise.resolve():this.refetchQueries({...t,type:t?.refetchType??t?.type??"active"},e)))}refetchQueries(t,e={}){const n={...e,cancelRefetch:e.cancelRefetch??!0},r=Lr.batch(()=>this.#e.findAll(t).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let s=i.fetch(void 0,n);return n.throwOnError||(s=s.catch(bi)),i.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(bi)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=this.#e.build(this,e);return n.isStaleByTime(ia(e.staleTime,n))?n.fetch(e):Promise.resolve(n.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(bi).catch(bi)}fetchInfiniteQuery(t){return t.behavior=Gg(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(bi).catch(bi)}ensureInfiniteQueryData(t){return t.behavior=Gg(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return qg.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(t){this.#n=t}setQueryDefaults(t,e){this.#r.set(Od(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...this.#r.values()],n={};return e.forEach(r=>{kd(t,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(t,e){this.#i.set(Od(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...this.#i.values()],n={};return e.forEach(r=>{kd(t,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(t){if(t._defaulted)return t;const e={...this.#n.queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=aw(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===uw&&(e.enabled=!1),e}defaultMutationOptions(t){return t?._defaulted?t:{...this.#n.mutations,...t?.mutationKey&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},cD=class extends Jd{constructor(t,e){super(),this.options=e,this.#e=t,this.#o=null,this.#s=kx(),this.options.experimental_prefetchInRender||this.#s.reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(e)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#l;#s;#o;#g;#d;#h;#u;#c;#a;#p=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),ZM(this.#t,this.options)?this.#f():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Dx(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Dx(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#x(),this.#S(),this.#t.removeObserver(this)}setOptions(t){const e=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof to(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#w(),this.#t.setOptions(this.options),e._defaulted&&!Mx(this.options,e)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const r=this.hasListeners();r&&JM(this.#t,n,this.options,e)&&this.#f(),this.updateResult(),r&&(this.#t!==n||to(this.options.enabled,this.#t)!==to(e.enabled,this.#t)||ia(this.options.staleTime,this.#t)!==ia(e.staleTime,this.#t))&&this.#m();const i=this.#y();r&&(this.#t!==n||to(this.options.enabled,this.#t)!==to(e.enabled,this.#t)||i!==this.#a)&&this.#v(i)}getOptimisticResult(t){const e=this.#e.getQueryCache().build(this.#e,t),n=this.createResult(e,t);return g4(this,n)&&(this.#r=n,this.#l=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(t,e){return new Proxy(t,{get:(n,r)=>(this.trackProp(r),e?.(r),Reflect.get(n,r))})}trackProp(t){this.#p.add(t)}getCurrentQuery(){return this.#t}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const e=this.#e.defaultQueryOptions(t),n=this.#e.getQueryCache().build(this.#e,e);return n.fetch().then(()=>this.createResult(n,e))}fetch(t){return this.#f({...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#f(t){this.#w();let e=this.#t.fetch(this.options,t);return t?.throwOnError||(e=e.catch(bi)),e}#m(){this.#x();const t=ia(this.options.staleTime,this.#t);if(cu||this.#r.isStale||!Ex(t))return;const n=tD(this.#r.dataUpdatedAt,t)+1;this.#u=setTimeout(()=>{this.#r.isStale||this.updateResult()},n)}#y(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(t){this.#S(),this.#a=t,!(cu||to(this.options.enabled,this.#t)===!1||!Ex(this.#a)||this.#a===0)&&(this.#c=setInterval(()=>{(this.options.refetchIntervalInBackground||cw.isFocused())&&this.#f()},this.#a))}#b(){this.#m(),this.#v(this.#y())}#x(){this.#u&&(clearTimeout(this.#u),this.#u=void 0)}#S(){this.#c&&(clearInterval(this.#c),this.#c=void 0)}createResult(t,e){const n=this.#t,r=this.options,i=this.#r,s=this.#i,a=this.#l,c=t!==n?t.state:this.#n,{state:d}=t;let h={...d},g=!1,m;if(e._optimisticResults){const I=this.hasListeners(),L=!I&&ZM(t,e),j=I&&JM(t,n,e,r);(L||j)&&(h={...h,...aD(d.data,t.options)}),e._optimisticResults==="isRestoring"&&(h.fetchStatus="idle")}let{error:y,errorUpdatedAt:b,status:x}=h;m=h.data;let w=!1;if(e.placeholderData!==void 0&&m===void 0&&x==="pending"){let I;i?.isPlaceholderData&&e.placeholderData===a?.placeholderData?(I=i.data,w=!0):I=typeof e.placeholderData=="function"?e.placeholderData(this.#h?.state.data,this.#h):e.placeholderData,I!==void 0&&(x="success",m=Ox(i?.data,I,e),g=!0)}if(e.select&&m!==void 0&&!w)if(i&&m===s?.data&&e.select===this.#g)m=this.#d;else try{this.#g=e.select,m=e.select(m),m=Ox(i?.data,m,e),this.#d=m,this.#o=null}catch(I){this.#o=I}this.#o&&(y=this.#o,m=this.#d,b=Date.now(),x="error");const C=h.fetchStatus==="fetching",T=x==="pending",E=x==="error",M=T&&C,k=m!==void 0,A={status:x,fetchStatus:h.fetchStatus,isPending:T,isSuccess:x==="success",isError:E,isInitialLoading:M,isLoading:M,data:m,dataUpdatedAt:h.dataUpdatedAt,error:y,errorUpdatedAt:b,failureCount:h.fetchFailureCount,failureReason:h.fetchFailureReason,errorUpdateCount:h.errorUpdateCount,isFetched:h.dataUpdateCount>0||h.errorUpdateCount>0,isFetchedAfterMount:h.dataUpdateCount>c.dataUpdateCount||h.errorUpdateCount>c.errorUpdateCount,isFetching:C,isRefetching:C&&!T,isLoadingError:E&&!k,isPaused:h.fetchStatus==="paused",isPlaceholderData:g,isRefetchError:E&&k,isStale:fw(t,e),refetch:this.refetch,promise:this.#s,isEnabled:to(e.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const I=N=>{A.status==="error"?N.reject(A.error):A.data!==void 0&&N.resolve(A.data)},L=()=>{const N=this.#s=A.promise=kx();I(N)},j=this.#s;switch(j.status){case"pending":t.queryHash===n.queryHash&&I(j);break;case"fulfilled":(A.status==="error"||A.data!==j.value)&&L();break;case"rejected":(A.status!=="error"||A.error!==j.reason)&&L();break}}return A}updateResult(){const t=this.#r,e=this.createResult(this.#t,this.options);if(this.#i=this.#t.state,this.#l=this.options,this.#i.data!==void 0&&(this.#h=this.#t),Mx(e,t))return;this.#r=e;const n=()=>{if(!t)return!0;const{notifyOnChangeProps:r}=this.options,i=typeof r=="function"?r():r;if(i==="all"||!i&&!this.#p.size)return!0;const s=new Set(i??this.#p);return this.options.throwOnError&&s.add("error"),Object.keys(this.#r).some(a=>{const u=a;return this.#r[u]!==t[u]&&s.has(u)})};this.#C({listeners:n()})}#w(){const t=this.#e.getQueryCache().build(this.#e,this.options);if(t===this.#t)return;const e=this.#t;this.#t=t,this.#n=t.state,this.hasListeners()&&(e?.removeObserver(this),t.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#C(t){Lr.batch(()=>{t.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function p4(t,e){return to(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&e.retryOnMount===!1)}function ZM(t,e){return p4(t,e)||t.state.data!==void 0&&Dx(t,e,e.refetchOnMount)}function Dx(t,e,n){if(to(e.enabled,t)!==!1&&ia(e.staleTime,t)!=="static"){const r=typeof n=="function"?n(t):n;return r==="always"||r!==!1&&fw(t,e)}return!1}function JM(t,e,n,r){return(t!==e||to(r.enabled,t)===!1)&&(!n.suspense||t.state.status!=="error")&&fw(t,n)}function fw(t,e){return to(e.enabled,t)!==!1&&t.isStaleByTime(ia(e.staleTime,t))}function g4(t,e){return!Mx(t.getCurrentResult(),e)}var m4=class extends cD{constructor(t,e){super(t,e)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(t){super.setOptions({...t,behavior:Gg()})}getOptimisticResult(t){return t.behavior=Gg(),super.getOptimisticResult(t)}fetchNextPage(t){return this.fetch({...t,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(t){return this.fetch({...t,meta:{fetchMore:{direction:"backward"}}})}createResult(t,e){const{state:n}=t,r=super.createResult(t,e),{isFetching:i,isRefetching:s,isError:a,isRefetchError:u}=r,c=n.fetchMeta?.fetchMore?.direction,d=a&&c==="forward",h=i&&c==="forward",g=a&&c==="backward",m=i&&c==="backward";return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:f4(e,n.data),hasPreviousPage:d4(e,n.data),isFetchNextPageError:d,isFetchingNextPage:h,isFetchPreviousPageError:g,isFetchingPreviousPage:m,isRefetchError:u&&!d&&!g,isRefetching:s&&!h&&!m}}},fD=R.createContext(void 0),dw=t=>{const e=R.useContext(fD);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},y4=({client:t,children:e})=>(R.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),O.jsx(fD.Provider,{value:t,children:e})),dD=R.createContext(!1),v4=()=>R.useContext(dD);dD.Provider;function b4(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var x4=R.createContext(b4()),S4=()=>R.useContext(x4),w4=(t,e)=>{(t.suspense||t.throwOnError||t.experimental_prefetchInRender)&&(e.isReset()||(t.retryOnMount=!1))},C4=t=>{R.useEffect(()=>{t.clearReset()},[t])},R4=({result:t,errorResetBoundary:e,throwOnError:n,query:r,suspense:i})=>t.isError&&!e.isReset()&&!t.isFetching&&r&&(i&&t.data===void 0||J5(n,[t.error,r])),T4=t=>{if(t.suspense){const e=r=>r==="static"?r:Math.max(r??1e3,1e3),n=t.staleTime;t.staleTime=typeof n=="function"?(...r)=>e(n(...r)):e(n),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3))}},E4=(t,e)=>t.isLoading&&t.isFetching&&!e,M4=(t,e)=>t?.suspense&&e.isPending,eA=(t,e,n)=>e.fetchOptimistic(t).catch(()=>{n.clearReset()});function hD(t,e,n){const r=v4(),i=S4(),s=dw(),a=s.defaultQueryOptions(t);s.getDefaultOptions().queries?._experimental_beforeQuery?.(a),a._optimisticResults=r?"isRestoring":"optimistic",T4(a),w4(a,i),C4(i);const u=!s.getQueryCache().get(a.queryHash),[c]=R.useState(()=>new e(s,a)),d=c.getOptimisticResult(a),h=!r&&t.subscribed!==!1;if(R.useSyncExternalStore(R.useCallback(g=>{const m=h?c.subscribe(Lr.batchCalls(g)):bi;return c.updateResult(),m},[c,h]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),R.useEffect(()=>{c.setOptions(a)},[a,c]),M4(a,d))throw eA(a,c,i);if(R4({result:d,errorResetBoundary:i,throwOnError:a.throwOnError,query:s.getQueryCache().get(a.queryHash),suspense:a.suspense}))throw d.error;return s.getDefaultOptions().queries?._experimental_afterQuery?.(a,d),a.experimental_prefetchInRender&&!cu&&E4(d,r)&&(u?eA(a,c,i):s.getQueryCache().get(a.queryHash)?.promise)?.catch(bi).finally(()=>{c.updateResult()}),a.notifyOnChangeProps?d:c.trackResult(d)}function A4(t,e){return hD(t,cD)}function O4(t,e){return hD(t,m4)}const pD=()=>typeof window<"u"&&typeof window.document<"u",k4=()=>pD()&&typeof window.__ROZENITE_WEB__<"u",I4=()=>typeof window>"u";let gD=class extends Error{constructor(e){super(`Unsupported platform: ${e}`),this.name="UnsupportedPlatformError"}},mD=class extends Error{constructor(){super("Rozenite for web is not configured. A separate integration is required for web. Consult Rozenite docs for details."),this.name="MissingRozeniteForWebError"}};const hw="rozenite",D4=()=>{const t=self.__FUSEBOX_REACT_DEVTOOLS_DISPATCHER__,e=t.BINDING_NAME;return self[e]!=null?t.initializeDomain(hw):null},P4=()=>new Promise(t=>{const e=n=>{n.name===hw&&(self.__FUSEBOX_REACT_DEVTOOLS_DISPATCHER__.onDomainInitialization.removeEventListener(e),setTimeout(()=>t(n)))};self.__FUSEBOX_REACT_DEVTOOLS_DISPATCHER__.onDomainInitialization.addEventListener(e)}),z4=async()=>{const t=new Set;let e=D4();e||(e=await P4());const n=()=>{if(!e)throw new Error("Domain not initialized");return e},r=i=>{i.name===hw&&(e&&t.forEach(s=>{e.onMessage.removeEventListener(s)}),e=i,t.forEach(s=>{i.onMessage.addEventListener(s)}))};return self.__FUSEBOX_REACT_DEVTOOLS_DISPATCHER__.onDomainInitialization.addEventListener(r),{send:i=>{n().sendMessage(i)},onMessage(i){const s=a=>{setTimeout(()=>{i(a)})};return t.add(s),n().onMessage.addEventListener(s),{remove:()=>{t.delete(s),n().onMessage.removeEventListener(s)}}},close:()=>{self.__FUSEBOX_REACT_DEVTOOLS_DISPATCHER__.onDomainInitialization.removeEventListener(r)}}},N4=async()=>{if(pD()&&!k4())throw new mD;if(I4())throw new gD("server");return z4()},L4=async()=>{const t=new Set,e=n=>{t.forEach(r=>{r(n.data)})};return window.addEventListener("message",e),{send:n=>{window.parent.postMessage({type:"rozenite-message",payload:n},"*")},onMessage:n=>(t.add(n),{remove:()=>{t.delete(n)}}),close:()=>{t.clear(),window.removeEventListener("message",e)}}};let Wf=null;const B4=async()=>{if(Wf)return Wf;const t="__ROZENITE_PANEL__"in window?L4():N4();Wf=t;try{const e=await t;return Wf=e,e}catch(e){throw Wf=null,e}},j4=t=>typeof t!="object"||t===null||typeof t.pluginId!="string"||!("type"in t)||!("payload"in t)?null:t;class tA extends Error{constructor(e){super(`Request "${e}" was aborted.`),this.requestId=e,this.name="RozeniteDevToolsRequestAbortedError"}}let _4=class extends Error{constructor(e,n){super(`Request "${e}" timed out after ${n}ms.`),this.requestId=e,this.timeoutMs=n,this.name="RozeniteDevToolsRequestTimeoutError"}},nA=class extends Error{constructor(e){super(`Request "${e}" was cancelled because the client closed.`),this.requestId=e,this.name="RozeniteDevToolsRequestClientClosedError"}},H4=class extends Error{constructor(e){super(`Request "${e.requestId}" received an error response.`),this.payload=e,this.name="RozeniteDevToolsRequestResponseError"}};const V4=3e4;let rA=0;const F4=()=>typeof globalThis.crypto?.randomUUID=="function"?globalThis.crypto.randomUUID():(rA+=1,`rozenite-${Date.now()}-${rA}`),U4=async t=>{const e=await B4(),n=new Map,r=new Set;let i=!1;const s=async d=>{const h=j4(d);if(!h||h.pluginId!==t)return;n.get(h.type)?.forEach(m=>{m(h.payload)})},a=(d,h)=>{e.send({pluginId:t,type:d,payload:h})},u=e.onMessage(s),c={send:a,onMessage:(d,h)=>{const g=n.get(d)??new Set;return g.add(h),n.set(d,g),{remove:()=>{g.delete(h),g.size===0&&n.delete(d)}}},request:d=>{const h=d.requestId??F4(),g=d.timeoutMs??V4;return!Number.isFinite(g)||g<0?Promise.reject(new RangeError("timeoutMs must be a finite, non-negative number.")):i?Promise.reject(new nA(h)):d.signal?.aborted?Promise.reject(new tA(h)):new Promise((m,y)=>{let b=!1;const x=()=>{T(new tA(h))},w=()=>{M.remove(),k?.remove(),clearTimeout(P),d.signal?.removeEventListener("abort",x),r.delete(E)},C=A=>{b||(b=!0,w(),A())},T=A=>{C(()=>{y(A)})},E=()=>{T(new nA(h))},M=c.onMessage(d.responseType,A=>{A.requestId===h&&C(()=>{m(A)})}),k=d.errorType!=null?c.onMessage(d.errorType,A=>{A.requestId===h&&C(()=>{y(new H4(A))})}):void 0;d.signal?.addEventListener("abort",x,{once:!0}),r.add(E);const P=setTimeout(()=>{T(new _4(h,g))},g);try{c.send(d.requestType,{...d.payload,requestId:h})}catch(A){T(A instanceof Error?A:new Error(String(A)))}})},close:()=>{i||(i=!0,r.forEach(d=>{d()}),n.clear(),u.remove(),e.close())}};return c},$4=async t=>U4(t),q4=()=>"__ROZENITE_PANEL__"in globalThis,G4=({pluginId:t})=>{const[e,n]=R.useState(null),[r,i]=R.useState(null);if(R.useEffect(()=>{let s=!0,a=null;const u=async()=>{try{a=await $4(t),s&&n(a)}catch(d){if(d instanceof mD){console.warn(`[Rozenite, ${t}] Rozenite for web is not configured. A separate integration is required for web. Consult Rozenite docs for details.`);return}if(d instanceof gD){console.warn(`[Rozenite, ${t}] Unsupported platform, skipping setup.`);return}console.error(`[Rozenite, ${t}] Error setting up client.`,d),s&&i(d)}},c=async()=>{try{a?.close()}catch{}};return u(),()=>{s=!1,c()}},[t]),r!=null)throw r;return R.useEffect(()=>{if(!e||q4())return;const s=e,a=setTimeout(()=>{s.send("plugin-mounted",{pluginId:t})},0);return()=>{clearTimeout(a)}},[e,t]),e};function yD(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;e<i;e++)t[e]&&(n=yD(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function vD(){for(var t,e,n=0,r="",i=arguments.length;n<i;n++)(t=arguments[n])&&(e=yD(t))&&(r&&(r+=" "),r+=e);return r}const W4=(t,e)=>{const n=new Array(t.length+e.length);for(let r=0;r<t.length;r++)n[r]=t[r];for(let r=0;r<e.length;r++)n[t.length+r]=e[r];return n},K4=(t,e)=>({classGroupId:t,validator:e}),bD=(t=new Map,e=null,n)=>({nextPart:t,validators:e,classGroupId:n}),Wg="-",iA=[],Y4="arbitrary..",X4=t=>{const e=Z4(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:a=>{if(a.startsWith("[")&&a.endsWith("]"))return Q4(a);const u=a.split(Wg),c=u[0]===""&&u.length>1?1:0;return xD(u,c,e)},getConflictingClassGroupIds:(a,u)=>{if(u){const c=r[a],d=n[a];return c?d?W4(d,c):c:d||iA}return n[a]||iA}}},xD=(t,e,n)=>{if(t.length-e===0)return n.classGroupId;const i=t[e],s=n.nextPart.get(i);if(s){const d=xD(t,e+1,s);if(d)return d}const a=n.validators;if(a===null)return;const u=e===0?t.join(Wg):t.slice(e).join(Wg),c=a.length;for(let d=0;d<c;d++){const h=a[d];if(h.validator(u))return h.classGroupId}},Q4=t=>t.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const e=t.slice(1,-1),n=e.indexOf(":"),r=e.slice(0,n);return r?Y4+r:void 0})(),Z4=t=>{const{theme:e,classGroups:n}=t;return J4(n,e)},J4=(t,e)=>{const n=bD();for(const r in t){const i=t[r];pw(i,n,r,e)}return n},pw=(t,e,n,r)=>{const i=t.length;for(let s=0;s<i;s++){const a=t[s];e8(a,e,n,r)}},e8=(t,e,n,r)=>{if(typeof t=="string"){t8(t,e,n);return}if(typeof t=="function"){n8(t,e,n,r);return}r8(t,e,n,r)},t8=(t,e,n)=>{const r=t===""?e:SD(e,t);r.classGroupId=n},n8=(t,e,n,r)=>{if(i8(t)){pw(t(r),e,n,r);return}e.validators===null&&(e.validators=[]),e.validators.push(K4(n,t))},r8=(t,e,n,r)=>{const i=Object.entries(t),s=i.length;for(let a=0;a<s;a++){const[u,c]=i[a];pw(c,SD(e,u),n,r)}},SD=(t,e)=>{let n=t;const r=e.split(Wg),i=r.length;for(let s=0;s<i;s++){const a=r[s];let u=n.nextPart.get(a);u||(u=bD(),n.nextPart.set(a,u)),n=u}return n},i8=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,o8=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=Object.create(null),r=Object.create(null);const i=(s,a)=>{n[s]=a,e++,e>t&&(e=0,r=n,n=Object.create(null))};return{get(s){let a=n[s];if(a!==void 0)return a;if((a=r[s])!==void 0)return i(s,a),a},set(s,a){s in n?n[s]=a:i(s,a)}}},Px="!",oA=":",s8=[],sA=(t,e,n,r,i)=>({modifiers:t,hasImportantModifier:e,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),l8=t=>{const{prefix:e,experimentalParseClassName:n}=t;let r=i=>{const s=[];let a=0,u=0,c=0,d;const h=i.length;for(let x=0;x<h;x++){const w=i[x];if(a===0&&u===0){if(w===oA){s.push(i.slice(c,x)),c=x+1;continue}if(w==="/"){d=x;continue}}w==="["?a++:w==="]"?a--:w==="("?u++:w===")"&&u--}const g=s.length===0?i:i.slice(c);let m=g,y=!1;g.endsWith(Px)?(m=g.slice(0,-1),y=!0):g.startsWith(Px)&&(m=g.slice(1),y=!0);const b=d&&d>c?d-c:void 0;return sA(s,y,m,b)};if(e){const i=e+oA,s=r;r=a=>a.startsWith(i)?s(a.slice(i.length)):sA(s8,!1,a,void 0,!0)}if(n){const i=r;r=s=>n({className:s,parseClassName:i})}return r},a8=t=>{const e=new Map;return t.orderSensitiveModifiers.forEach((n,r)=>{e.set(n,1e6+r)}),n=>{const r=[];let i=[];for(let s=0;s<n.length;s++){const a=n[s],u=a[0]==="[",c=e.has(a);u||c?(i.length>0&&(i.sort(),r.push(...i),i=[]),r.push(a)):i.push(a)}return i.length>0&&(i.sort(),r.push(...i)),r}},u8=t=>({cache:o8(t.cacheSize),parseClassName:l8(t),sortModifiers:a8(t),...X4(t)}),c8=/\s+/,f8=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:s}=e,a=[],u=t.trim().split(c8);let c="";for(let d=u.length-1;d>=0;d-=1){const h=u[d],{isExternal:g,modifiers:m,hasImportantModifier:y,baseClassName:b,maybePostfixModifierPosition:x}=n(h);if(g){c=h+(c.length>0?" "+c:c);continue}let w=!!x,C=r(w?b.substring(0,x):b);if(!C){if(!w){c=h+(c.length>0?" "+c:c);continue}if(C=r(b),!C){c=h+(c.length>0?" "+c:c);continue}w=!1}const T=m.length===0?"":m.length===1?m[0]:s(m).join(":"),E=y?T+Px:T,M=E+C;if(a.indexOf(M)>-1)continue;a.push(M);const k=i(C,w);for(let P=0;P<k.length;++P){const A=k[P];a.push(E+A)}c=h+(c.length>0?" "+c:c)}return c},d8=(...t)=>{let e=0,n,r,i="";for(;e<t.length;)(n=t[e++])&&(r=wD(n))&&(i&&(i+=" "),i+=r);return i},wD=t=>{if(typeof t=="string")return t;let e,n="";for(let r=0;r<t.length;r++)t[r]&&(e=wD(t[r]))&&(n&&(n+=" "),n+=e);return n},h8=(t,...e)=>{let n,r,i,s;const a=c=>{const d=e.reduce((h,g)=>g(h),t());return n=u8(d),r=n.cache.get,i=n.cache.set,s=u,u(c)},u=c=>{const d=r(c);if(d)return d;const h=f8(c,n);return i(c,h),h};return s=a,(...c)=>s(d8(...c))},p8=[],vr=t=>{const e=n=>n[t]||p8;return e.isThemeGetter=!0,e},CD=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,RD=/^\((?:(\w[\w-]*):)?(.+)\)$/i,g8=/^\d+\/\d+$/,m8=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,y8=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,v8=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,b8=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,x8=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,sc=t=>g8.test(t),Dt=t=>!!t&&!Number.isNaN(Number(t)),Yl=t=>!!t&&Number.isInteger(Number(t)),Y0=t=>t.endsWith("%")&&Dt(t.slice(0,-1)),Ys=t=>m8.test(t),S8=()=>!0,w8=t=>y8.test(t)&&!v8.test(t),TD=()=>!1,C8=t=>b8.test(t),R8=t=>x8.test(t),T8=t=>!Qe(t)&&!Ze(t),E8=t=>Uc(t,AD,TD),Qe=t=>CD.test(t),Ka=t=>Uc(t,OD,w8),X0=t=>Uc(t,I8,Dt),lA=t=>Uc(t,ED,TD),M8=t=>Uc(t,MD,R8),Bp=t=>Uc(t,kD,C8),Ze=t=>RD.test(t),Kf=t=>$c(t,OD),A8=t=>$c(t,D8),aA=t=>$c(t,ED),O8=t=>$c(t,AD),k8=t=>$c(t,MD),jp=t=>$c(t,kD,!0),Uc=(t,e,n)=>{const r=CD.exec(t);return r?r[1]?e(r[1]):n(r[2]):!1},$c=(t,e,n=!1)=>{const r=RD.exec(t);return r?r[1]?e(r[1]):n:!1},ED=t=>t==="position"||t==="percentage",MD=t=>t==="image"||t==="url",AD=t=>t==="length"||t==="size"||t==="bg-size",OD=t=>t==="length",I8=t=>t==="number",D8=t=>t==="family-name",kD=t=>t==="shadow",P8=()=>{const t=vr("color"),e=vr("font"),n=vr("text"),r=vr("font-weight"),i=vr("tracking"),s=vr("leading"),a=vr("breakpoint"),u=vr("container"),c=vr("spacing"),d=vr("radius"),h=vr("shadow"),g=vr("inset-shadow"),m=vr("text-shadow"),y=vr("drop-shadow"),b=vr("blur"),x=vr("perspective"),w=vr("aspect"),C=vr("ease"),T=vr("animate"),E=()=>["auto","avoid","all","avoid-page","page","left","right","column"],M=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],k=()=>[...M(),Ze,Qe],P=()=>["auto","hidden","clip","visible","scroll"],A=()=>["auto","contain","none"],I=()=>[Ze,Qe,c],L=()=>[sc,"full","auto",...I()],j=()=>[Yl,"none","subgrid",Ze,Qe],N=()=>["auto",{span:["full",Yl,Ze,Qe]},Yl,Ze,Qe],_=()=>[Yl,"auto",Ze,Qe],H=()=>["auto","min","max","fr",Ze,Qe],F=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],G=()=>["start","end","center","stretch","center-safe","end-safe"],B=()=>["auto",...I()],q=()=>[sc,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...I()],U=()=>[t,Ze,Qe],X=()=>[...M(),aA,lA,{position:[Ze,Qe]}],Z=()=>["no-repeat",{repeat:["","x","y","space","round"]}],z=()=>["auto","cover","contain",O8,E8,{size:[Ze,Qe]}],$=()=>[Y0,Kf,Ka],W=()=>["","none","full",d,Ze,Qe],K=()=>["",Dt,Kf,Ka],ie=()=>["solid","dashed","dotted","double"],ee=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ae=()=>[Dt,Y0,aA,lA],Y=()=>["","none",b,Ze,Qe],se=()=>["none",Dt,Ze,Qe],ve=()=>["none",Dt,Ze,Qe],ye=()=>[Dt,Ze,Qe],he=()=>[sc,"full",...I()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Ys],breakpoint:[Ys],color:[S8],container:[Ys],"drop-shadow":[Ys],ease:["in","out","in-out"],font:[T8],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Ys],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Ys],shadow:[Ys],spacing:["px",Dt],text:[Ys],"text-shadow":[Ys],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",sc,Qe,Ze,w]}],container:["container"],columns:[{columns:[Dt,Qe,Ze,u]}],"break-after":[{"break-after":E()}],"break-before":[{"break-before":E()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:k()}],overflow:[{overflow:P()}],"overflow-x":[{"overflow-x":P()}],"overflow-y":[{"overflow-y":P()}],overscroll:[{overscroll:A()}],"overscroll-x":[{"overscroll-x":A()}],"overscroll-y":[{"overscroll-y":A()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:L()}],"inset-x":[{"inset-x":L()}],"inset-y":[{"inset-y":L()}],start:[{start:L()}],end:[{end:L()}],top:[{top:L()}],right:[{right:L()}],bottom:[{bottom:L()}],left:[{left:L()}],visibility:["visible","invisible","collapse"],z:[{z:[Yl,"auto",Ze,Qe]}],basis:[{basis:[sc,"full","auto",u,...I()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Dt,sc,"auto","initial","none",Qe]}],grow:[{grow:["",Dt,Ze,Qe]}],shrink:[{shrink:["",Dt,Ze,Qe]}],order:[{order:[Yl,"first","last","none",Ze,Qe]}],"grid-cols":[{"grid-cols":j()}],"col-start-end":[{col:N()}],"col-start":[{"col-start":_()}],"col-end":[{"col-end":_()}],"grid-rows":[{"grid-rows":j()}],"row-start-end":[{row:N()}],"row-start":[{"row-start":_()}],"row-end":[{"row-end":_()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":H()}],"auto-rows":[{"auto-rows":H()}],gap:[{gap:I()}],"gap-x":[{"gap-x":I()}],"gap-y":[{"gap-y":I()}],"justify-content":[{justify:[...F(),"normal"]}],"justify-items":[{"justify-items":[...G(),"normal"]}],"justify-self":[{"justify-self":["auto",...G()]}],"align-content":[{content:["normal",...F()]}],"align-items":[{items:[...G(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...G(),{baseline:["","last"]}]}],"place-content":[{"place-content":F()}],"place-items":[{"place-items":[...G(),"baseline"]}],"place-self":[{"place-self":["auto",...G()]}],p:[{p:I()}],px:[{px:I()}],py:[{py:I()}],ps:[{ps:I()}],pe:[{pe:I()}],pt:[{pt:I()}],pr:[{pr:I()}],pb:[{pb:I()}],pl:[{pl:I()}],m:[{m:B()}],mx:[{mx:B()}],my:[{my:B()}],ms:[{ms:B()}],me:[{me:B()}],mt:[{mt:B()}],mr:[{mr:B()}],mb:[{mb:B()}],ml:[{ml:B()}],"space-x":[{"space-x":I()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":I()}],"space-y-reverse":["space-y-reverse"],size:[{size:q()}],w:[{w:[u,"screen",...q()]}],"min-w":[{"min-w":[u,"screen","none",...q()]}],"max-w":[{"max-w":[u,"screen","none","prose",{screen:[a]},...q()]}],h:[{h:["screen","lh",...q()]}],"min-h":[{"min-h":["screen","lh","none",...q()]}],"max-h":[{"max-h":["screen","lh",...q()]}],"font-size":[{text:["base",n,Kf,Ka]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Ze,X0]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Y0,Qe]}],"font-family":[{font:[A8,Qe,e]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[i,Ze,Qe]}],"line-clamp":[{"line-clamp":[Dt,"none",Ze,X0]}],leading:[{leading:[s,...I()]}],"list-image":[{"list-image":["none",Ze,Qe]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ze,Qe]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:U()}],"text-color":[{text:U()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ie(),"wavy"]}],"text-decoration-thickness":[{decoration:[Dt,"from-font","auto",Ze,Ka]}],"text-decoration-color":[{decoration:U()}],"underline-offset":[{"underline-offset":[Dt,"auto",Ze,Qe]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:I()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ze,Qe]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ze,Qe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:X()}],"bg-repeat":[{bg:Z()}],"bg-size":[{bg:z()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Yl,Ze,Qe],radial:["",Ze,Qe],conic:[Yl,Ze,Qe]},k8,M8]}],"bg-color":[{bg:U()}],"gradient-from-pos":[{from:$()}],"gradient-via-pos":[{via:$()}],"gradient-to-pos":[{to:$()}],"gradient-from":[{from:U()}],"gradient-via":[{via:U()}],"gradient-to":[{to:U()}],rounded:[{rounded:W()}],"rounded-s":[{"rounded-s":W()}],"rounded-e":[{"rounded-e":W()}],"rounded-t":[{"rounded-t":W()}],"rounded-r":[{"rounded-r":W()}],"rounded-b":[{"rounded-b":W()}],"rounded-l":[{"rounded-l":W()}],"rounded-ss":[{"rounded-ss":W()}],"rounded-se":[{"rounded-se":W()}],"rounded-ee":[{"rounded-ee":W()}],"rounded-es":[{"rounded-es":W()}],"rounded-tl":[{"rounded-tl":W()}],"rounded-tr":[{"rounded-tr":W()}],"rounded-br":[{"rounded-br":W()}],"rounded-bl":[{"rounded-bl":W()}],"border-w":[{border:K()}],"border-w-x":[{"border-x":K()}],"border-w-y":[{"border-y":K()}],"border-w-s":[{"border-s":K()}],"border-w-e":[{"border-e":K()}],"border-w-t":[{"border-t":K()}],"border-w-r":[{"border-r":K()}],"border-w-b":[{"border-b":K()}],"border-w-l":[{"border-l":K()}],"divide-x":[{"divide-x":K()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":K()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ie(),"hidden","none"]}],"divide-style":[{divide:[...ie(),"hidden","none"]}],"border-color":[{border:U()}],"border-color-x":[{"border-x":U()}],"border-color-y":[{"border-y":U()}],"border-color-s":[{"border-s":U()}],"border-color-e":[{"border-e":U()}],"border-color-t":[{"border-t":U()}],"border-color-r":[{"border-r":U()}],"border-color-b":[{"border-b":U()}],"border-color-l":[{"border-l":U()}],"divide-color":[{divide:U()}],"outline-style":[{outline:[...ie(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Dt,Ze,Qe]}],"outline-w":[{outline:["",Dt,Kf,Ka]}],"outline-color":[{outline:U()}],shadow:[{shadow:["","none",h,jp,Bp]}],"shadow-color":[{shadow:U()}],"inset-shadow":[{"inset-shadow":["none",g,jp,Bp]}],"inset-shadow-color":[{"inset-shadow":U()}],"ring-w":[{ring:K()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:U()}],"ring-offset-w":[{"ring-offset":[Dt,Ka]}],"ring-offset-color":[{"ring-offset":U()}],"inset-ring-w":[{"inset-ring":K()}],"inset-ring-color":[{"inset-ring":U()}],"text-shadow":[{"text-shadow":["none",m,jp,Bp]}],"text-shadow-color":[{"text-shadow":U()}],opacity:[{opacity:[Dt,Ze,Qe]}],"mix-blend":[{"mix-blend":[...ee(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ee()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Dt]}],"mask-image-linear-from-pos":[{"mask-linear-from":ae()}],"mask-image-linear-to-pos":[{"mask-linear-to":ae()}],"mask-image-linear-from-color":[{"mask-linear-from":U()}],"mask-image-linear-to-color":[{"mask-linear-to":U()}],"mask-image-t-from-pos":[{"mask-t-from":ae()}],"mask-image-t-to-pos":[{"mask-t-to":ae()}],"mask-image-t-from-color":[{"mask-t-from":U()}],"mask-image-t-to-color":[{"mask-t-to":U()}],"mask-image-r-from-pos":[{"mask-r-from":ae()}],"mask-image-r-to-pos":[{"mask-r-to":ae()}],"mask-image-r-from-color":[{"mask-r-from":U()}],"mask-image-r-to-color":[{"mask-r-to":U()}],"mask-image-b-from-pos":[{"mask-b-from":ae()}],"mask-image-b-to-pos":[{"mask-b-to":ae()}],"mask-image-b-from-color":[{"mask-b-from":U()}],"mask-image-b-to-color":[{"mask-b-to":U()}],"mask-image-l-from-pos":[{"mask-l-from":ae()}],"mask-image-l-to-pos":[{"mask-l-to":ae()}],"mask-image-l-from-color":[{"mask-l-from":U()}],"mask-image-l-to-color":[{"mask-l-to":U()}],"mask-image-x-from-pos":[{"mask-x-from":ae()}],"mask-image-x-to-pos":[{"mask-x-to":ae()}],"mask-image-x-from-color":[{"mask-x-from":U()}],"mask-image-x-to-color":[{"mask-x-to":U()}],"mask-image-y-from-pos":[{"mask-y-from":ae()}],"mask-image-y-to-pos":[{"mask-y-to":ae()}],"mask-image-y-from-color":[{"mask-y-from":U()}],"mask-image-y-to-color":[{"mask-y-to":U()}],"mask-image-radial":[{"mask-radial":[Ze,Qe]}],"mask-image-radial-from-pos":[{"mask-radial-from":ae()}],"mask-image-radial-to-pos":[{"mask-radial-to":ae()}],"mask-image-radial-from-color":[{"mask-radial-from":U()}],"mask-image-radial-to-color":[{"mask-radial-to":U()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":M()}],"mask-image-conic-pos":[{"mask-conic":[Dt]}],"mask-image-conic-from-pos":[{"mask-conic-from":ae()}],"mask-image-conic-to-pos":[{"mask-conic-to":ae()}],"mask-image-conic-from-color":[{"mask-conic-from":U()}],"mask-image-conic-to-color":[{"mask-conic-to":U()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:X()}],"mask-repeat":[{mask:Z()}],"mask-size":[{mask:z()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ze,Qe]}],filter:[{filter:["","none",Ze,Qe]}],blur:[{blur:Y()}],brightness:[{brightness:[Dt,Ze,Qe]}],contrast:[{contrast:[Dt,Ze,Qe]}],"drop-shadow":[{"drop-shadow":["","none",y,jp,Bp]}],"drop-shadow-color":[{"drop-shadow":U()}],grayscale:[{grayscale:["",Dt,Ze,Qe]}],"hue-rotate":[{"hue-rotate":[Dt,Ze,Qe]}],invert:[{invert:["",Dt,Ze,Qe]}],saturate:[{saturate:[Dt,Ze,Qe]}],sepia:[{sepia:["",Dt,Ze,Qe]}],"backdrop-filter":[{"backdrop-filter":["","none",Ze,Qe]}],"backdrop-blur":[{"backdrop-blur":Y()}],"backdrop-brightness":[{"backdrop-brightness":[Dt,Ze,Qe]}],"backdrop-contrast":[{"backdrop-contrast":[Dt,Ze,Qe]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Dt,Ze,Qe]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Dt,Ze,Qe]}],"backdrop-invert":[{"backdrop-invert":["",Dt,Ze,Qe]}],"backdrop-opacity":[{"backdrop-opacity":[Dt,Ze,Qe]}],"backdrop-saturate":[{"backdrop-saturate":[Dt,Ze,Qe]}],"backdrop-sepia":[{"backdrop-sepia":["",Dt,Ze,Qe]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":I()}],"border-spacing-x":[{"border-spacing-x":I()}],"border-spacing-y":[{"border-spacing-y":I()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ze,Qe]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Dt,"initial",Ze,Qe]}],ease:[{ease:["linear","initial",C,Ze,Qe]}],delay:[{delay:[Dt,Ze,Qe]}],animate:[{animate:["none",T,Ze,Qe]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[x,Ze,Qe]}],"perspective-origin":[{"perspective-origin":k()}],rotate:[{rotate:se()}],"rotate-x":[{"rotate-x":se()}],"rotate-y":[{"rotate-y":se()}],"rotate-z":[{"rotate-z":se()}],scale:[{scale:ve()}],"scale-x":[{"scale-x":ve()}],"scale-y":[{"scale-y":ve()}],"scale-z":[{"scale-z":ve()}],"scale-3d":["scale-3d"],skew:[{skew:ye()}],"skew-x":[{"skew-x":ye()}],"skew-y":[{"skew-y":ye()}],transform:[{transform:[Ze,Qe,"","none","gpu","cpu"]}],"transform-origin":[{origin:k()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:he()}],"translate-x":[{"translate-x":he()}],"translate-y":[{"translate-y":he()}],"translate-z":[{"translate-z":he()}],"translate-none":["translate-none"],accent:[{accent:U()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:U()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ze,Qe]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":I()}],"scroll-mx":[{"scroll-mx":I()}],"scroll-my":[{"scroll-my":I()}],"scroll-ms":[{"scroll-ms":I()}],"scroll-me":[{"scroll-me":I()}],"scroll-mt":[{"scroll-mt":I()}],"scroll-mr":[{"scroll-mr":I()}],"scroll-mb":[{"scroll-mb":I()}],"scroll-ml":[{"scroll-ml":I()}],"scroll-p":[{"scroll-p":I()}],"scroll-px":[{"scroll-px":I()}],"scroll-py":[{"scroll-py":I()}],"scroll-ps":[{"scroll-ps":I()}],"scroll-pe":[{"scroll-pe":I()}],"scroll-pt":[{"scroll-pt":I()}],"scroll-pr":[{"scroll-pr":I()}],"scroll-pb":[{"scroll-pb":I()}],"scroll-pl":[{"scroll-pl":I()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ze,Qe]}],fill:[{fill:["none",...U()]}],"stroke-w":[{stroke:[Dt,Kf,Ka,X0]}],stroke:[{stroke:["none",...U()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},z8=h8(P8),uA=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,cA=vD,qc=(t,e)=>n=>{var r;if(e?.variants==null)return cA(t,n?.class,n?.className);const{variants:i,defaultVariants:s}=e,a=Object.keys(i).map(d=>{const h=n?.[d],g=s?.[d];if(h===null)return null;const m=uA(h)||uA(g);return i[d][m]}),u=n&&Object.entries(n).reduce((d,h)=>{let[g,m]=h;return m===void 0||(d[g]=m),d},{}),c=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((d,h)=>{let{class:g,className:m,...y}=h;return Object.entries(y).every(b=>{let[x,w]=b;return Array.isArray(w)?w.includes({...s,...u}[x]):{...s,...u}[x]===w})?[...d,g,m]:d},[]);return cA(t,a,c,n?.class,n?.className)};function N8(t,e){return function(r,...i){const s=new URL(t);return s.searchParams.set("code",r.toString()),i.forEach(a=>s.searchParams.append("args[]",a)),`${e} error #${r}; visit ${s} for the full message.`}}const Jt=N8("https://base-ui.com/production-error","Base UI"),fA={};function Qn(t,e){const n=R.useRef(fA);return n.current===fA&&(n.current=t(e)),n}function ws(t,e,n,r){const i=Qn(ID).current;return B8(i,t,e,n,r)&&DD(i,[t,e,n,r]),i.callback}function L8(t){const e=Qn(ID).current;return j8(e,t)&&DD(e,t),e.callback}function ID(){return{callback:null,cleanup:null,refs:[]}}function B8(t,e,n,r,i){return t.refs[0]!==e||t.refs[1]!==n||t.refs[2]!==r||t.refs[3]!==i}function j8(t,e){return t.refs.length!==e.length||t.refs.some((n,r)=>n!==e[r])}function DD(t,e){if(t.refs=e,e.every(n=>n==null)){t.callback=null;return}t.callback=n=>{if(t.cleanup&&(t.cleanup(),t.cleanup=null),n!=null){const r=Array(e.length).fill(null);for(let i=0;i<e.length;i+=1){const s=e[i];if(s!=null)switch(typeof s){case"function":{const a=s(n);typeof a=="function"&&(r[i]=a);break}case"object":{s.current=n;break}}}t.cleanup=()=>{for(let i=0;i<e.length;i+=1){const s=e[i];if(s!=null)switch(typeof s){case"function":{const a=r[i];typeof a=="function"?a():s(null);break}case"object":{s.current=null;break}}}}}}}const _8=parseInt(R.version,10);function gw(t){return _8>=t}function dA(t){if(!R.isValidElement(t))return null;const e=t,n=e.props;return(gw(19)?n?.ref:e.ref)??null}function zx(t,e){if(t&&!e)return t;if(!t&&e)return e;if(t||e)return{...t,...e}}function On(){}const Si=Object.freeze([]),gn=Object.freeze({});function H8(t,e){const n={};for(const r in t){const i=t[r];if(e?.hasOwnProperty(r)){const s=e[r](i);s!=null&&Object.assign(n,s);continue}i===!0?n[`data-${r.toLowerCase()}`]="":i&&(n[`data-${r.toLowerCase()}`]=i.toString())}return n}function V8(t,e){return typeof t=="function"?t(e):t}function F8(t,e){return typeof t=="function"?t(e):t}const mw={};function Zr(t,e,n,r,i){if(!n&&!r&&!i&&!t)return Kg(e);let s=Kg(t);return e&&(s=rd(s,e)),n&&(s=rd(s,n)),r&&(s=rd(s,r)),i&&(s=rd(s,i)),s}function U8(t){if(t.length===0)return mw;if(t.length===1)return Kg(t[0]);let e=Kg(t[0]);for(let n=1;n<t.length;n+=1)e=rd(e,t[n]);return e}function Kg(t){return yw(t)?{...zD(t,mw)}:$8(t)}function rd(t,e){return yw(e)?zD(e,t):q8(t,e)}function $8(t){const e={...t};for(const n in e){const r=e[n];PD(n,r)&&(e[n]=ND(r))}return e}function q8(t,e){if(!e)return t;for(const n in e){const r=e[n];switch(n){case"style":{t[n]=zx(t.style,r);break}case"className":{t[n]=LD(t.className,r);break}default:PD(n,r)?t[n]=G8(t[n],r):t[n]=r}}return t}function PD(t,e){const n=t.charCodeAt(0),r=t.charCodeAt(1),i=t.charCodeAt(2);return n===111&&r===110&&i>=65&&i<=90&&(typeof e=="function"||typeof e>"u")}function yw(t){return typeof t=="function"}function zD(t,e){return yw(t)?t(e):t??mw}function G8(t,e){return e?t?(...n)=>{const r=n[0];if(BD(r)){const s=r;Yg(s);const a=e(...n);return s.baseUIHandlerPrevented||t?.(...n),a}const i=e(...n);return t?.(...n),i}:ND(e):t}function ND(t){return t&&((...e)=>{const n=e[0];return BD(n)&&Yg(n),t(...e)})}function Yg(t){return t.preventBaseUIHandler=()=>{t.baseUIHandlerPrevented=!0},t}function LD(t,e){return e?t?e+" "+t:e:t}function BD(t){return t!=null&&typeof t=="object"&&"nativeEvent"in t}function ot(t,e,n={}){const r=e.render,i=W8(e,n);if(n.enabled===!1)return null;const s=n.state??gn;return X8(t,r,i,s)}function W8(t,e={}){const{className:n,style:r,render:i}=t,{state:s=gn,ref:a,props:u,stateAttributesMapping:c,enabled:d=!0}=e,h=d?V8(n,s):void 0,g=d?F8(r,s):void 0,m=d?H8(s,c):gn,y=d&&u?K8(u):void 0,b=d?zx(m,y)??{}:gn;return typeof document<"u"&&(d?Array.isArray(a)?b.ref=L8([b.ref,dA(i),...a]):b.ref=ws(b.ref,dA(i),a):ws(null,null)),d?(h!==void 0&&(b.className=LD(b.className,h)),g!==void 0&&(b.style=zx(b.style,g)),b):gn}function K8(t){return Array.isArray(t)?U8(t):Zr(void 0,t)}const Y8=Symbol.for("react.lazy");function X8(t,e,n,r){if(e){if(typeof e=="function")return e(n,r);const i=Zr(n,e.props);i.ref=n.ref;let s=e;return s?.$$typeof===Y8&&(s=R.Children.toArray(e)[0]),R.cloneElement(s,i)}if(t&&typeof t=="string")return Q8(t,n);throw new Error(Jt(8))}function Q8(t,e){return t==="button"?R.createElement("button",{type:"button",...e,key:e.key}):t==="img"?R.createElement("img",{alt:"",...e,key:e.key}):R.createElement(t,e)}function Hi(t){return ot(t.defaultTagName??"div",t,t)}var Z8={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"};const J8=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),e6=(t,e)=>{const n=R.forwardRef(({color:r="currentColor",size:i=24,strokeWidth:s=2,absoluteStrokeWidth:a,children:u,...c},d)=>R.createElement("svg",{ref:d,...Z8,width:i,height:i,stroke:r,strokeWidth:a?Number(s)*24/Number(i):s,className:`lucide lucide-${J8(t)}`,...c},[...e.map(([h,g])=>R.createElement(h,g)),...(Array.isArray(u)?u:[u])||[]]));return n.displayName=`${t}`,n};var Zn=e6;const t6=Zn("AlertTriangle",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z",key:"c3ski4"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),n6=Zn("CheckCircle2",[["path",{d:"M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10z",key:"14v8dr"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]),vw=Zn("Check",[["polyline",{points:"20 6 9 17 4 12",key:"10jjfj"}]]),r6=Zn("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),bw=Zn("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]),i6=Zn("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]),xw=Zn("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]),hA=Zn("Database",[["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"}]]),o6=Zn("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]),s6=Zn("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]),l6=Zn("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]),a6=Zn("Loader2",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),u6=Zn("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]),jD=Zn("PenLine",[["path",{d:"M12 20h9",key:"t2du7b"}],["path",{d:"M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4Z",key:"ymcmye"}]]),c6=Zn("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]),f6=Zn("RefreshCw",[["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"}]]),d6=Zn("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]),h6=Zn("Sun",[["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"}]]),pA=Zn("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]),p6=Zn("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]),_D=Zn("XCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]),Dm=Zn("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Nx=[];let Lx;function g6(){return Lx}function m6(t){Nx.push(t)}function Sw(t){const e=(n,r)=>{const i=Qn(y6).current;let s;try{Lx=i;for(const a of Nx)a.before(i);s=t(n,r);for(const a of Nx)a.after(i);i.didInitialize=!0}finally{Lx=void 0}return s};return e.displayName=t.displayName||t.name,e}function HD(t){return R.forwardRef(Sw(t))}function y6(){return{didInitialize:!1}}const v6=()=>{},Ae=typeof document<"u"?R.useLayoutEffect:v6,VD=R.createContext(void 0);function Pm(t){const e=R.useContext(VD);if(e===void 0&&!t)throw new Error(Jt(72));return e}function zm(t){R.useEffect(t,Si)}const Yf=0;class ji{static create(){return new ji}currentId=Yf;start(e,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Yf,n()},e)}isStarted(){return this.currentId!==Yf}clear=()=>{this.currentId!==Yf&&(clearTimeout(this.currentId),this.currentId=Yf)};disposeEffect=()=>this.clear}function lr(){const t=Qn(ji.create).current;return zm(t.disposeEffect),t}function b6(){return typeof navigator>"u"?{userAgent:"",platform:"",maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??0}}const{userAgent:x6,platform:S6,maxTouchPoints:w6}=b6(),Nm=x6.toLowerCase(),Id=S6.toLowerCase(),eh=/^i(os$|p)/.test(Id)||Id==="macintel"&&w6>1,gA="android",Xg=Id===gA||Nm.includes(gA),ww=!eh&&Id.startsWith("mac");Id.startsWith("win");const C6=ww||eh,fl=typeof CSS<"u"&&!!CSS.supports?.("-webkit-backdrop-filter:none"),mA=!fl&&Nm.includes("firefox");!fl&&Nm.includes("chrom");const R6=C6,Cw=/jsdom|happydom/.test(Nm);function Nr(t){t.preventDefault(),t.stopPropagation()}function T6(t){return"nativeEvent"in t}function Rw(t){return t.pointerType===""&&t.isTrusted?!0:Xg&&t.pointerType?t.type==="click"&&t.buttons===1:t.detail===0&&!t.pointerType}function Tw(t){return Cw?!1:!Xg&&t.width===0&&t.height===0||Xg&&t.width===1&&t.height===1&&t.pressure===0&&t.detail===0&&t.pointerType==="mouse"||t.width<1&&t.height<1&&t.pressure===0&&t.detail===0&&t.pointerType==="touch"}function oa(t,e){const n=["mouse","pen"];return e||n.push("",void 0),n.includes(t)}function E6(t){const e=t.type;return e==="click"||e==="mousedown"||e==="keydown"||e==="keyup"}function Lm(){return typeof window<"u"}function _r(t){return Ew(t)?(t.nodeName||"").toLowerCase():"#document"}function Rn(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function dl(t){var e;return(e=(Ew(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Ew(t){return Lm()?t instanceof Node||t instanceof Rn(t).Node:!1}function It(t){return Lm()?t instanceof Element||t instanceof Rn(t).Element:!1}function cn(t){return Lm()?t instanceof HTMLElement||t instanceof Rn(t).HTMLElement:!1}function Ac(t){return!Lm()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Rn(t).ShadowRoot}function th(t){const{overflow:e,overflowX:n,overflowY:r,display:i}=Ci(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&i!=="inline"&&i!=="contents"}function M6(t){return/^(table|td|th)$/.test(_r(t))}function Bm(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const A6=/transform|translate|scale|rotate|perspective|filter/,O6=/paint|layout|strict|content/,Ya=t=>!!t&&t!=="none";let Q0;function Mw(t){const e=It(t)?Ci(t):t;return Ya(e.transform)||Ya(e.translate)||Ya(e.scale)||Ya(e.rotate)||Ya(e.perspective)||!Aw()&&(Ya(e.backdropFilter)||Ya(e.filter))||A6.test(e.willChange||"")||O6.test(e.contain||"")}function k6(t){let e=ll(t);for(;cn(e)&&!rl(e);){if(Mw(e))return e;if(Bm(e))return null;e=ll(e)}return null}function Aw(){return Q0==null&&(Q0=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Q0}function rl(t){return/^(html|body|#document)$/.test(_r(t))}function Ci(t){return Rn(t).getComputedStyle(t)}function jm(t){return It(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function ll(t){if(_r(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Ac(t)&&t.host||dl(t);return Ac(e)?e.host:e}function FD(t){const e=ll(t);return rl(e)?(t.ownerDocument||t).body:cn(e)&&th(e)?e:FD(e)}function Oc(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=FD(t),s=i===((r=t.ownerDocument)==null?void 0:r.body),a=Rn(i);if(s){const u=Bx(a);return e.concat(a,a.visualViewport||[],th(i)?i:[],u&&n?Oc(u):[])}else return e.concat(i,Oc(i,[],n))}function Bx(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}const jx="data-base-ui-focusable",UD="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",su="ArrowLeft",lu="ArrowRight",Ow="ArrowUp",_m="ArrowDown";function ir(t){let e=t.activeElement;for(;e?.shadowRoot?.activeElement!=null;)e=e.shadowRoot.activeElement;return e}function Ge(t,e){if(!t||!e)return!1;const n=e.getRootNode?.();if(t.contains(e))return!0;if(n&&Ac(n)){let r=e;for(;r;){if(t===r)return!0;r=r.parentNode||r.host}}return!1}function mn(t){return"composedPath"in t?t.composedPath()[0]:t.target}function Qg(t,e){if(!It(t))return!1;const n=t;if(e.hasElement(n))return!n.hasAttribute("data-trigger-disabled");for(const[,r]of e.entries())if(Ge(r,n))return!r.hasAttribute("data-trigger-disabled");return!1}function Z0(t,e){if(e==null)return!1;if("composedPath"in t)return t.composedPath().includes(e);const n=t;return n.target!=null&&e.contains(n.target)}function I6(t){return t.matches("html,body")}function Hm(t){return cn(t)&&t.matches(UD)}function $D(t){return t?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${UD}`)!=null}function _x(t){return t?t.getAttribute("role")==="combobox"&&Hm(t):!1}function Zg(t){if(!t||Cw)return!0;try{return t.matches(":focus-visible")}catch{return!0}}function Jg(t){return t?t.hasAttribute(jx)?t:t.querySelector(`[${jx}]`)||t:null}function D6(t,e){return e!=null&&!oa(e)?0:typeof t=="function"?t():t}function ua(t,e,n){const r=D6(t,n);return typeof r=="number"?r:r?.[e]}function yA(t){return typeof t=="function"?t():t}function qD(t,e){return e||t==="click"||t==="mousedown"}function P6(t){return t?.includes("mouse")&&t!=="mousedown"}const xr="none",Gc="trigger-press",Sr="trigger-hover",pc="trigger-focus",nh="outside-press",au="item-press",GD="close-press",vA="clear-press",dd="input-change",as="input-clear",WD="input-press",ca="focus-out",Wc="escape-key",Hx="list-navigation",kw="keyboard",Iw="pointer",KD="cancel-open",id="sibling-open",YD="disabled",bA="missing",xA="initial",Dw="imperative-action",z6="window-resize";function $e(t,e,n,r){let i=!1,s=!1;const a=r??gn;return{reason:t,event:e??new Event("base-ui"),cancel(){i=!0},allowPropagation(){s=!0},get isCanceled(){return i},get isPropagationAllowed(){return s},trigger:n,...a}}function N6(t,e,n){const r=n??gn;return{reason:t,event:e??new Event("base-ui"),...r}}const XD=R.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new ji,currentIdRef:{current:null},currentContextRef:{current:null}});function L6(t,e){t.current=e.current}function B6(t){const{children:e,delay:n,timeoutMs:r=0}=t,i=R.useRef(n),s=R.useRef(n),a=R.useRef(null),u=R.useRef(null),c=lr();return Ae(()=>{if(s.current=n,!a.current){i.current=n;return}i.current={open:ua(i.current,"open"),close:ua(n,"close")}},[n,a,i,s]),O.jsx(XD.Provider,{value:R.useMemo(()=>({hasProvider:!0,delayRef:i,initialDelayRef:s,currentIdRef:a,timeoutMs:r,currentContextRef:u,timeout:c}),[r,c]),children:e})}function j6(t,e={open:!1}){const{open:n}=e,r="rootStore"in t?t.rootStore:t,i=r.useState("floatingId"),s=R.useContext(XD),{currentIdRef:a,delayRef:u,timeoutMs:c,initialDelayRef:d,currentContextRef:h,hasProvider:g,timeout:m}=s,[y,b]=R.useState(!1),x=R.useRef(n);return Ae(()=>{x.current=n},[n]),Ae(()=>{function w(){h.current?.setIsInstantPhase(!1),a.current=null,h.current=null,u.current=d.current,m.clear()}if(a.current&&!n&&a.current===i){if(b(!1),c){const C=i;return m.start(c,()=>{r.select("open")||a.current&&a.current!==C||w()}),()=>{(x.current||a.current!==C)&&m.clear()}}w()}},[n,i,a,u,c,d,h,m,r]),Ae(()=>{if(!n)return;const w=h.current,C=a.current;m.clear(),h.current={onOpenChange:r.setOpen,setIsInstantPhase:b},a.current=i,u.current={open:0,close:ua(d.current,"close")},C!==null&&C!==i?(b(!0),w?.setIsInstantPhase(!0),w?.onOpenChange(!1,$e(xr))):(b(!1),w?.setIsInstantPhase(!1))},[n,i,r,a,u,d,h,m]),Ae(()=>()=>{if(a.current===i){if(h.current=null,!x.current)return;a.current=null,L6(u,d),m.clear()}},[h,a,u,i,d,m]),R.useMemo(()=>({hasProvider:g,delayRef:u,isInstantPhase:y}),[g,u,y])}function yt(t,e,n,r){return t.addEventListener(e,n,r),()=>{t.removeEventListener(e,n,r)}}function zo(...t){return()=>{for(let e=0;e<t.length;e+=1){const n=t[e];n&&n()}}}function $n(t){const e=Qn(_6,t).current;return e.next=t,Ae(e.effect),e}function _6(t){const e={current:t,next:t,effect:()=>{e.current=e.next}};return e}const Pw={...cF},J0=Pw.useInsertionEffect,H6=J0&&J0!==Pw.useLayoutEffect?J0:t=>t();function ke(t){const e=Qn(V6).current;return e.next=t,H6(e.effect),e.trampoline}function V6(){const t={next:void 0,callback:F6,trampoline:(...e)=>t.callback?.(...e),effect:()=>{t.callback=t.next}};return t}function F6(){}const _p=null;class U6{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;const n=this.callbacks,r=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,r>0)for(let i=0;i<n.length;i+=1)n[i]?.(e)};request(e){const n=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,!this.isScheduled&&(requestAnimationFrame(this.tick),this.isScheduled=!0),n}cancel(e){const n=e-this.startId;n<0||n>=this.callbacks.length||(this.callbacks[n]=null,this.callbacksCount-=1)}}let Hp=new U6;class cs{static create(){return new cs}static request(e){return Hp.request(e)}static cancel(e){return Hp.cancel(e)}currentId=_p;request(e){this.cancel(),this.currentId=Hp.request(()=>{this.currentId=_p,e()})}cancel=()=>{this.currentId!==_p&&(Hp.cancel(this.currentId),this.currentId=_p)};disposeEffect=()=>this.cancel}function kc(){const t=Qn(cs.create).current;return zm(t.disposeEffect),t}function vt(t){return t?.ownerDocument||document}const QD={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},Vm={...QD,position:"fixed",top:0,left:0},zw={...QD,position:"absolute"},fu=R.forwardRef(function(e,n){const[r,i]=R.useState();Ae(()=>{R6&&fl&&i("button")},[]);const s={tabIndex:0,role:r};return O.jsx("span",{...e,ref:n,style:Vm,"aria-hidden":r?void 0:!0,...s,"data-base-ui-focus-guard":""})}),Ic=Math.min,il=Math.max,em=Math.round,eu=Math.floor,ol=t=>({x:t,y:t}),$6={left:"right",right:"left",bottom:"top",top:"bottom"};function ZD(t,e,n){return il(t,Ic(e,n))}function fa(t,e){return typeof t=="function"?t(e):t}function co(t){return t.split("-")[0]}function ba(t){return t.split("-")[1]}function Nw(t){return t==="x"?"y":"x"}function Lw(t){return t==="y"?"height":"width"}function io(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function Bw(t){return Nw(io(t))}function q6(t,e,n){n===void 0&&(n=!1);const r=ba(t),i=Bw(t),s=Lw(i);let a=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(a=tm(a)),[a,tm(a)]}function G6(t){const e=tm(t);return[Vx(t),e,Vx(e)]}function Vx(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const SA=["left","right"],wA=["right","left"],W6=["top","bottom"],K6=["bottom","top"];function Y6(t,e,n){switch(t){case"top":case"bottom":return n?e?wA:SA:e?SA:wA;case"left":case"right":return e?W6:K6;default:return[]}}function X6(t,e,n,r){const i=ba(t);let s=Y6(co(t),n==="start",r);return i&&(s=s.map(a=>a+"-"+i),e&&(s=s.concat(s.map(Vx)))),s}function tm(t){const e=co(t);return $6[e]+t.slice(e.length)}function Q6(t){var e,n,r,i;return{top:(e=t.top)!=null?e:0,right:(n=t.right)!=null?n:0,bottom:(r=t.bottom)!=null?r:0,left:(i=t.left)!=null?i:0}}function JD(t){return typeof t!="number"?Q6(t):{top:t,right:t,bottom:t,left:t}}function Dd(t){const{x:e,y:n,width:r,height:i}=t;return{width:r,height:i,top:n,left:e,right:e+r,bottom:n+i,x:e,y:n}}function Vp(t,e,n){return Math.floor(t/e)!==n}function sa(t,e){return e<0||e>=t.length}function Og(t,e){return Ar(t.current,{disabledIndices:e})}function Fx(t,e){return Ar(t.current,{decrement:!0,startingIndex:t.current.length,disabledIndices:e})}function Ar(t,{startingIndex:e=-1,decrement:n=!1,disabledIndices:r,amount:i=1}={}){let s=e;do s+=n?-i:i;while(s>=0&&s<=t.length-1&&Dc(t,s,r));return s}function Z6(t,{event:e,orientation:n,loopFocus:r,onLoop:i,rtl:s,cols:a,disabledIndices:u,minIndex:c,maxIndex:d,prevIndex:h,stopEvent:g=!1}){let m=h,y;if(e.key===Ow?y="up":e.key===_m&&(y="down"),y){const b=[],x=[];let w=!1,C=0;{let L=null,j=-1;t.forEach((N,_)=>{if(N==null)return;C+=1;const H=N.closest('[role="row"]');H&&(w=!0),(H!==L||j===-1)&&(L=H,j+=1,b[j]=[]),b[j].push(_),x[_]=j})}let T=!1,E=0;if(w)for(const L of b){const j=L.length;j>E&&(E=j),j!==a&&(T=!0)}const M=T&&C<t.length,k=E||a,P=L=>{if(!T||h===-1)return;const j=x[h];if(j==null)return;const N=b[j].indexOf(h),_=L==="up"?-1:1;for(let H=j+_,F=0;F<b.length;F+=1,H+=_){if(H<0||H>=b.length){if(!r||M)return;if(H=H<0?b.length-1:0,i){const B=Math.min(N,b[H].length-1),q=b[H][B]??b[H][0],U=i(e,h,q);H=x[U]??H}}const G=b[H];for(let B=Math.min(N,G.length-1);B>=0;B-=1){const q=G[B];if(!Dc(t,q,u))return q}}},A=L=>{if(!M||h===-1)return;const j=h%k,N=L==="up"?-k:k,_=d-d%k,H=eu(d/k)+1;for(let F=h-j+N,G=0;G<H;G+=1,F+=N){if(F<0||F>d){if(!r)return;F=F<0?_:0}const B=Math.min(F+k-1,d);for(let q=Math.min(F+j,B);q>=F;q-=1)if(!Dc(t,q,u))return q}};g&&Nr(e);const I=P(y)??A(y);if(I!==void 0)m=I;else if(h===-1)m=y==="up"?d:c;else if(m=Ar(t,{startingIndex:h,amount:k,decrement:y==="up",disabledIndices:u}),r){if(y==="up"&&(h-k<c||m<0)){const L=h%k,j=d%k,N=d-(j-L);j===L?m=d:m=j>L?N:N-k,i&&(m=i(e,h,m))}y==="down"&&h+k>d&&(m=Ar(t,{startingIndex:h%k-k,amount:k,disabledIndices:u}),i&&(m=i(e,h,m)))}sa(t,m)&&(m=h)}if(n==="both"){const b=eu(h/a);e.key===(s?su:lu)&&(g&&Nr(e),h%a!==a-1?(m=Ar(t,{startingIndex:h,disabledIndices:u}),r&&Vp(m,a,b)&&(m=Ar(t,{startingIndex:h-h%a-1,disabledIndices:u}),i&&(m=i(e,h,m)))):r&&(m=Ar(t,{startingIndex:h-h%a-1,disabledIndices:u}),i&&(m=i(e,h,m))),Vp(m,a,b)&&(m=h)),e.key===(s?lu:su)&&(g&&Nr(e),h%a!==0?(m=Ar(t,{startingIndex:h,decrement:!0,disabledIndices:u}),r&&Vp(m,a,b)&&(m=Ar(t,{startingIndex:h+(a-h%a),decrement:!0,disabledIndices:u}),i&&(m=i(e,h,m)))):r&&(m=Ar(t,{startingIndex:h+(a-h%a),decrement:!0,disabledIndices:u}),i&&(m=i(e,h,m))),Vp(m,a,b)&&(m=h));const x=eu(d/a)===b;sa(t,m)&&(r&&x?(m=e.key===(s?lu:su)?d:Ar(t,{startingIndex:h-h%a-1,disabledIndices:u}),i&&(m=i(e,h,m))):m=h)}return m}function Dc(t,e,n){if(typeof n=="function"?n(e):n?.includes(e)??!1)return!0;const i=t[e];return i?!Fm(i)||i.matches(":disabled")?!0:!n&&(i.hasAttribute("disabled")||i.getAttribute("aria-disabled")==="true"):!1}function J6(t){return t.visibility==="hidden"||t.visibility==="collapse"}function Fm(t,e=t?Ci(t):null){return!t||!t.isConnected||!e||J6(e)?!1:typeof t.checkVisibility=="function"?t.checkVisibility():e.display!=="none"&&e.display!=="contents"}const eU='a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]';function tU(t){const e=t.assignedSlot;if(e)return e;if(t.parentElement)return t.parentElement;const n=t.getRootNode();return Ac(n)?n.host:null}function Ux(t){for(const e of Array.from(t.children))if(_r(e)==="summary")return e;return null}function nU(t,e){const n=Ux(e);return!!n&&(t===n||Ge(n,t))}function eP(t){const e=t?_r(t):"";return t!=null&&t.matches(eU)&&(e!=="summary"||t.parentElement!=null&&_r(t.parentElement)==="details"&&Ux(t.parentElement)===t)&&(e!=="details"||Ux(t)==null)&&(e!=="input"||t.type!=="hidden")}function tP(t){if(!eP(t)||!t.isConnected||t.matches(":disabled"))return!1;for(let e=t;e;e=tU(e)){const n=e!==t,r=_r(e)==="slot";if(e.hasAttribute("inert")||n&&_r(e)==="details"&&!e.open&&!nU(t,e)||e.hasAttribute("hidden")||!r&&!rU(e,n))return!1}return!0}function rU(t,e){const n=Ci(t);return e?n.display!=="none":Fm(t,n)}function nP(t){const e=t.tabIndex;if(e<0){const n=_r(t);if(n==="details"||n==="audio"||n==="video"||cn(t)&&t.isContentEditable)return 0}return e}function eb(t){if(_r(t)!=="input")return null;const e=t;return e.type==="radio"&&e.name!==""?e:null}function iU(t,e){const n=eb(t);if(!n)return!0;const r=e.find(i=>{const s=eb(i);return s?.name===n.name&&s.form===n.form&&s.checked});return r?r===n:e.find(i=>{const s=eb(i);return s?.name===n.name&&s.form===n.form})===n}function rP(t){if(cn(t)&&_r(t)==="slot"){const e=t.assignedElements({flatten:!0});if(e.length>0)return e}return cn(t)&&t.shadowRoot?Array.from(t.shadowRoot.children):Array.from(t.children)}function iP(t,e){rP(t).forEach(n=>{eP(n)&&e.push(n),iP(n,e)})}function oP(t,e,n){rP(t).forEach(r=>{cn(r)&&r.matches(e)&&n.push(r),oP(r,e,n)})}function jw(t){return tP(t)&&nP(t)>=0}function sP(t){const e=[];return iP(t,e),e.filter(tP)}function rh(t){const e=sP(t);return e.filter(n=>nP(n)>=0&&iU(n,e))}function lP(t,e){const n=rh(t),r=n.length;if(r===0)return;const i=ir(vt(t)),s=n.indexOf(i),a=s===-1?e===1?0:r-1:s+e;return n[a]}function _w(t){return lP(vt(t).body,1)||t}function aP(t){return lP(vt(t).body,-1)||t}function uP(t,e){if(!t)return null;const n=rh(vt(t).body),r=n.length;if(r===0)return null;const i=n.indexOf(t);if(i===-1)return null;const s=(i+e+r)%r;return n[s]}function oU(t){return uP(t,1)}function sU(t){return uP(t,-1)}function gc(t,e){const n=e||t.currentTarget,r=t.relatedTarget;return!r||!Ge(n,r)}function lU(t){rh(t).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function CA(t){const e=[];oP(t,"[data-tabindex]",e),e.forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}function da(t,e,n=!0){return t.filter(i=>i.parentId===e).flatMap(i=>[...!n||i.context?.open?[i]:[],...da(t,i.id,n)])}function RA(t,e){let n=[],r=t.find(i=>i.id===e)?.parentId;for(;r;){const i=t.find(s=>s.id===r);r=i?.parentId,i&&(n=n.concat(i))}return n}function Pd(t){return`data-base-ui-${t}`}let Fp=0;function kg(t,e={}){const{preventScroll:n=!1,sync:r=!1,shouldFocus:i}=e;cancelAnimationFrame(Fp);function s(){i&&!i()||t?.focus({preventScroll:n})}if(r)return s(),On;const a=requestAnimationFrame(s);return Fp=a,()=>{Fp===a&&(cancelAnimationFrame(a),Fp=0)}}const tb={inert:new WeakMap,"aria-hidden":new WeakMap},TA="data-base-ui-inert",$x={inert:new WeakSet,"aria-hidden":new WeakSet};let Xf=new WeakMap,nb=0;function aU(t){return $x[t]}function cP(t){return t?Ac(t)?t.host:cP(t.parentNode):null}const EA=(t,e)=>e.map(n=>{if(t.contains(n))return n;const r=cP(n);return t.contains(r)?r:null}).filter(n=>n!=null),MA=t=>{const e=new Set;return t.forEach(n=>{let r=n;for(;r&&!e.has(r);)e.add(r),r=r.parentNode}),e},AA=(t,e,n)=>{const r=[],i=s=>{!s||n.has(s)||Array.from(s.children).forEach(a=>{_r(a)!=="script"&&(e.has(a)?i(a):r.push(a))})};return i(t),r};function uU(t,e,n,r,{mark:i=!0}){let s=null;r?s="inert":n&&(s="aria-hidden");let a=null,u=null;const c=EA(e,t),d=i?AA(e,MA(c),new Set(c)):[],h=[],g=[];if(s){const m=tb[s],y=aU(s);u=y,a=m;const b=EA(e,Array.from(e.querySelectorAll("[aria-live]"))),x=c.concat(b);AA(e,MA(x),new Set(x)).forEach(C=>{const T=C.getAttribute(s),E=T!==null&&T!=="false",M=(m.get(C)||0)+1;m.set(C,M),h.push(C),M===1&&E&&y.add(C),E||C.setAttribute(s,s==="inert"?"":"true")})}return i&&d.forEach(m=>{const y=(Xf.get(m)||0)+1;Xf.set(m,y),g.push(m),y===1&&m.setAttribute(TA,"")}),nb+=1,()=>{a&&h.forEach(m=>{const b=(a.get(m)||0)-1;a.set(m,b),b||(!u?.has(m)&&s&&m.removeAttribute(s),u?.delete(m))}),i&&g.forEach(m=>{const y=(Xf.get(m)||0)-1;Xf.set(m,y),y||m.removeAttribute(TA)}),nb-=1,nb||(tb.inert=new WeakMap,tb["aria-hidden"]=new WeakMap,$x.inert=new WeakSet,$x["aria-hidden"]=new WeakSet,Xf=new WeakMap)}}function OA(t,e={}){const{ariaHidden:n=!1,inert:r=!1,mark:i=!0}=e,s=vt(t[0]).body;return uU(t,s,n,r,{mark:i})}let kA=0;function cU(t,e="mui"){const[n,r]=R.useState(t),i=t||n;return R.useEffect(()=>{n==null&&(kA+=1,r(`${e}-${kA}`))},[n,e]),i}const IA=Pw.useId;function ha(t,e){if(IA!==void 0){const n=IA();return t??(e?`${e}-${n}`:n)}return cU(t,e)}const fU=500,dU=500,hU={style:{transition:"none"}},fP="data-base-ui-click-trigger",pU="data-base-ui-swipe-ignore",gU="data-swipe-ignore",mU=`[${pU}]`,yU=`[${gU}]`,Hw={fallbackAxisSide:"none"},dP={fallbackAxisSide:"end"},vU={clipPath:"inset(50%)",position:"fixed",top:0,left:0},hP=R.createContext(null),pP=()=>R.useContext(hP),bU=Pd("portal");function gP(t={}){const{ref:e,container:n,componentProps:r=gn,elementProps:i}=t,s=ha(),u=pP()?.portalNode,[c,d]=R.useState(null),[h,g]=R.useState(null),m=ke(w=>{w!==null&&g(w)}),y=R.useRef(null);Ae(()=>{if(n===null){y.current&&(y.current=null,g(null),d(null));return}const w=(n&&(Ew(n)?n:n.current))??u??document.body;if(w==null){y.current&&(y.current=null,g(null),d(null));return}y.current!==w&&(y.current=w,g(null),d(w))},[n,u]);const b=ot("div",r,{ref:[e,m],props:[{id:s,[bU]:""},i]}),x=c&&b?po.createPortal(b,c):null;return{node:h,nodeId:R.isValidElement(b)?b.props.id:void 0,subtree:x}}const Um=R.forwardRef(function(e,n){const{render:r,className:i,style:s,children:a,container:u,...c}=e,{node:d,nodeId:h,subtree:g}=gP({container:u,ref:n,componentProps:e,elementProps:c}),m=R.useRef(null),y=R.useRef(null),b=R.useRef(null),x=R.useRef(null),[w,C]=R.useState(null),T=R.useRef(!1),E=w?.modal,M=w?.open,k=!!w&&!w.modal&&w.open&&!!d;R.useEffect(()=>{if(!d||E)return;function A(I){d&&I.relatedTarget&&gc(I)&&(I.type==="focusin"?T.current&&(CA(d),T.current=!1):(lU(d),T.current=!0))}return zo(yt(d,"focusin",A,!0),yt(d,"focusout",A,!0))},[d,E]),Ae(()=>{!d||M!==!0||!T.current||(CA(d),T.current=!1)},[M,d]);const P=R.useMemo(()=>({beforeOutsideRef:m,afterOutsideRef:y,beforeInsideRef:b,afterInsideRef:x,portalNode:d,setFocusManagerState:C}),[d]);return O.jsxs(R.Fragment,{children:[g,O.jsxs(hP.Provider,{value:P,children:[k&&d&&O.jsx(fu,{"data-type":"outside",ref:m,onFocus:A=>{if(gc(A,d))b.current?.focus();else{const I=w?w.domReference:null;aP(I)?.focus()}}}),k&&d&&O.jsx("span",{"aria-owns":h,style:vU}),d&&po.createPortal(a,d),k&&d&&O.jsx(fu,{"data-type":"outside",ref:y,onFocus:A=>{if(gc(A,d))x.current?.focus();else{const I=w?w.domReference:null;_w(I)?.focus(),w?.closeOnFocusOut&&w?.onOpenChange(!1,$e(ca,A.nativeEvent))}}})]})]})});function mP(){const t=new Map;return{emit(e,n){t.get(e)?.forEach(r=>r(n))},on(e,n){t.has(e)||t.set(e,new Set),t.get(e).add(n)},off(e,n){t.get(e)?.delete(n)}}}class Vw{nodesRef={current:[]};events=mP();addNode(e){this.nodesRef.current.push(e)}removeNode(e){const n=this.nodesRef.current.findIndex(r=>r===e);n!==-1&&this.nodesRef.current.splice(n,1)}}const yP=R.createContext(null),vP=R.createContext(null),xa=()=>R.useContext(yP)?.id||null,Sa=t=>{const e=R.useContext(vP);return t??e};function bP(t){const e=ha(),n=Sa(t),r=xa();return Ae(()=>{if(!e)return;const i={id:e,parentId:r};return n?.addNode(i),()=>{n?.removeNode(i)}},[n,e,r]),e}function xU(t){const{children:e,id:n}=t,r=xa();return O.jsx(yP.Provider,{value:R.useMemo(()=>({id:n,parentId:r}),[n,r]),children:e})}function SU(t){const{children:e,externalTree:n}=t,r=Qn(()=>n??new Vw).current;return O.jsx(vP.Provider,{value:r,children:e})}function Xs(t){return t==null?t:"current"in t?t.current:t}function wU(t,e){const n=Rn(mn(t));return t instanceof n.KeyboardEvent?"keyboard":t instanceof n.FocusEvent?e||"keyboard":"pointerType"in t?t.pointerType||"keyboard":"touches"in t?"touch":t instanceof n.MouseEvent?e||(t.detail===0?"keyboard":"mouse"):""}const DA=20;let ea=[];function Fw(){ea=ea.filter(t=>t.deref()?.isConnected)}function PA(t){Fw(),t&&_r(t)!=="body"&&(ea.push(new WeakRef(t)),ea.length>DA&&(ea=ea.slice(-DA)))}function zA(){return Fw(),ea[ea.length-1]?.deref()}function CU(t){return t?jw(t)?t:rh(t)[0]||t:null}function NA(t){if(t.hasAttribute("tabindex")&&!t.hasAttribute("data-tabindex")||!t.getAttribute("role")?.includes("dialog"))return;const n=sP(t).filter(i=>{const s=i.getAttribute("data-tabindex")||"";return jw(i)||i.hasAttribute("data-tabindex")&&!s.startsWith("-")}),r=t.getAttribute("tabindex");n.length===0?r!=="0"&&(t.setAttribute("tabindex","0"),t.setAttribute("data-tabindex","0")):(r!=="-1"||t.hasAttribute("data-tabindex")&&t.getAttribute("data-tabindex")!=="-1")&&(t.setAttribute("tabindex","-1"),t.setAttribute("data-tabindex","-1"))}function $m(t){const{context:e,children:n,disabled:r=!1,initialFocus:i=!0,returnFocus:s=!0,restoreFocus:a=!1,modal:u=!0,closeOnFocusOut:c=!0,openInteractionType:d="",nextFocusableElement:h,previousFocusableElement:g,beforeContentFocusGuardRef:m,externalTree:y,getInsideElements:b}=t,x="rootStore"in e?e.rootStore:e,w=x.useState("open"),C=x.useState("domReferenceElement"),T=x.useState("floatingElement"),{events:E,dataRef:M}=x.context,k=ke(()=>M.current.floatingContext?.nodeId),P=i===!1,A=_x(C)&&P,I=$n(i),L=$n(s),j=$n(d),N=$n(w),_=Sa(y),H=pP(),F=R.useRef(!1),G=R.useRef(!1),B=R.useRef(!1),q=R.useRef(null),U=R.useRef(""),X=R.useRef(""),Z=R.useRef(null),z=R.useRef(null),$=ws(Z,m,H?.beforeInsideRef),W=ws(z,H?.afterInsideRef),K=lr(),ie=lr(),ee=kc(),ae=H!=null,Y=Jg(T),se=ke((he=Y)=>he?rh(he):[]),ve=ke(()=>b?.().filter(he=>he!=null)??[]);R.useEffect(()=>{if(r||!u)return;function he(Te){Te.key==="Tab"&&Ge(Y,ir(vt(Y)))&&se().length===0&&!A&&Nr(Te)}const pe=vt(Y);return yt(pe,"keydown",he)},[r,Y,u,A,se]),R.useEffect(()=>{if(r||!w)return;const he=vt(Y);function pe(){B.current=!1}function Te(De){const Ee=mn(De),_e=ve(),Me=Ge(T,Ee)||Ge(C,Ee)||Ge(H?.portalNode,Ee)||_e.some(oe=>oe===Ee||Ge(oe,Ee));B.current=!Me,X.current=De.pointerType||"keyboard",Ee?.closest(`[${fP}]`)&&(G.current=!0,ie.start(0,()=>{G.current=!1}))}function Ie(){X.current="keyboard"}return zo(yt(he,"pointerdown",Te,!0),yt(he,"pointerup",pe,!0),yt(he,"pointercancel",pe,!0),yt(he,"keydown",Ie,!0),pe)},[r,T,C,Y,w,H,ie,ve]),R.useEffect(()=>{if(r||!c)return;const he=vt(Y);function pe(){G.current=!0,ie.start(0,()=>{G.current=!1})}function Te(_e){const Me=mn(_e);jw(Me)&&(q.current=Me)}function Ie(_e){const Me=_e.relatedTarget,oe=_e.currentTarget,xe=mn(_e);u&&Me==null&&xe!=null&&Ge(T,xe)&&PA(xe),queueMicrotask(()=>{const Pe=k(),ne=x.context.triggerElements,J=ve(),le=Me?.hasAttribute(Pd("focus-guard"))&&[Z.current,z.current,H?.beforeInsideRef.current,H?.afterInsideRef.current,H?.beforeOutsideRef.current,H?.afterOutsideRef.current,Xs(g),Xs(h)].includes(Me),we=!(Ge(C,Me)||Ge(T,Me)||Ge(Me,T)||Ge(H?.portalNode,Me)||J.some(de=>de===Me||Ge(de,Me))||ne.hasMatchingElement(de=>Ge(de,Me))||le||_&&(da(_.nodesRef.current,Pe).find(de=>Ge(de.context?.elements.floating,Me)||Ge(de.context?.elements.domReference,Me))||RA(_.nodesRef.current,Pe).find(de=>[de.context?.elements.floating,Jg(de.context?.elements.floating)].includes(Me)||de.context?.elements.domReference===Me)));if(oe===C&&Y&&NA(Y),a&&oe!==C&&!Fm(xe)&&ir(he)===he.body){if(cn(Y)&&(Y.focus(),a==="popup")){ee.request(()=>{Y.focus()});return}const de=se(),me=q.current,Be=(me&&de.includes(me)?me:null)||de[de.length-1]||Y;cn(Be)&&Be.focus()}if(M.current.insideReactTree){M.current.insideReactTree=!1;return}(A||!u)&&Me&&we&&!G.current&&(A||Me!==zA())&&(F.current=!0,x.setOpen(!1,$e(ca,_e)))})}function De(){B.current||(M.current.insideReactTree=!0,K.start(0,()=>{M.current.insideReactTree=!1}))}const Ee=cn(C)?C:null;if(!(!T&&!Ee))return zo(Ee&&yt(Ee,"focusout",Ie),Ee&&yt(Ee,"pointerdown",pe),T&&yt(T,"focusin",Te),T&&yt(T,"focusout",Ie),T&&H&&yt(T,"focusout",De,!0))},[r,C,T,Y,u,_,H,x,c,a,se,A,k,M,K,ie,ee,h,g,ve]),R.useEffect(()=>{if(r||!T||!w)return;const he=Array.from(H?.portalNode?.querySelectorAll(`[${Pd("portal")}]`)||[]),Te=(_?RA(_.nodesRef.current,k()):[]).find(oe=>_x(oe.context?.elements.domReference||null))?.context?.elements.domReference,De=[...[T,...he,Z.current,z.current,H?.beforeOutsideRef.current,H?.afterOutsideRef.current,...ve()],Te,Xs(g),Xs(h),A?C:null].filter(oe=>oe!=null),Ee=OA(De,{ariaHidden:u||A,mark:!1}),_e=[T,...he].filter(oe=>oe!=null),Me=OA(_e);return()=>{Me(),Ee()}},[w,r,C,T,u,H,A,_,k,h,g,ve]),Ae(()=>{if(!w||r||!cn(Y))return;U.current="",X.current="";const he=vt(Y),pe=ir(he);queueMicrotask(()=>{const Te=I.current,Ie=typeof Te=="function"?Te(j.current||""):Te;if(Ie===void 0||Ie===!1||Ge(Y,pe))return;let Ee=null;const _e=()=>(Ee==null&&(Ee=se(Y)),Ee[0]||Y);let Me;Ie===!0||Ie===null?Me=_e():Me=Xs(Ie),Me=Me||_e();const oe=Ge(Y,ir(he));kg(Me,{preventScroll:Me===Y,shouldFocus(){if(!N.current)return!1;if(oe)return!0;const xe=ir(he);return!(xe!==Me&&Ge(Y,xe))}})})},[r,w,Y,se,I,j,N]),Ae(()=>{if(r||!Y)return;const he=vt(Y),pe=ir(he),Te=j.current==null;PA(pe);function Ie(Ee){if(Ee.open||(U.current=wU(Ee.nativeEvent,X.current)),Ee.reason===Sr&&Ee.nativeEvent.type==="mouseleave"&&(F.current=!0),Ee.reason===nh)if(Ee.nested)F.current=!1;else if(Rw(Ee.nativeEvent)||Tw(Ee.nativeEvent))F.current=!1;else{let _e=!1;vt(Y).createElement("div").focus({get preventScroll(){return _e=!0,!1}}),_e?F.current=!1:F.current=!0}}E.on("openchange",Ie);function De(Ee){const _e=L.current;let Me=typeof _e=="function"?_e(Ee):_e;if(Me===void 0||Me===!1)return null;Me===null&&(Me=!0);const oe=C?.isConnected?C:null,xe=pe?.isConnected&&_r(pe)!=="body"?pe:null;let Pe=Te?xe||oe:oe||xe;return Pe||(Pe=zA()||null),typeof Me=="boolean"?Pe:Xs(Me)||Pe||null}return()=>{E.off("openchange",Ie);const Ee=ir(he),_e=ve(),Me=Ge(T,Ee)||_e.some(ne=>ne===Ee||Ge(ne,Ee))||_&&da(_.nodesRef.current,k(),!1).some(ne=>Ge(ne.context?.elements.floating,Ee)),oe=L.current,xe=U.current,Pe=De(xe);queueMicrotask(()=>{const ne=CU(Pe),J=typeof oe!="boolean";if(oe&&!F.current&&cn(ne)&&(!(!J&&ne!==Ee&&Ee!==he.body)||Me)){const le={preventScroll:!0};xe==="keyboard"&&(le.focusVisible=!0),ne.focus(le)}F.current=!1})}},[r,T,Y,L,j,E,_,C,k,ve]),Ae(()=>{if(!fl||w||!T)return;const he=ir(vt(T));!cn(he)||!Hm(he)||Ge(T,he)&&he.blur()},[w,T]),Ae(()=>{if(!(r||!H))return H.setFocusManagerState({modal:u,closeOnFocusOut:c,open:w,onOpenChange:x.setOpen,domReference:C}),()=>{H.setFocusManagerState(null)}},[r,H,u,w,x,c,C]),Ae(()=>{if(!(r||!Y))return NA(Y),()=>{queueMicrotask(Fw)}},[r,Y]);const ye=!r&&(u?!A:!0)&&(ae||u);return O.jsxs(R.Fragment,{children:[ye&&O.jsx(fu,{"data-type":"inside",ref:$,onFocus:he=>{if(u){const pe=se();kg(pe[pe.length-1])}else H?.portalNode&&(F.current=!1,gc(he,H.portalNode)?_w(C)?.focus():Xs(g??H.beforeOutsideRef)?.focus())}}),n,ye&&O.jsx(fu,{"data-type":"inside",ref:W,onFocus:he=>{u?kg(se()[0]):H?.portalNode&&(c&&(F.current=!0),gc(he,H.portalNode)?aP(C)?.focus():Xs(h??H.afterOutsideRef)?.focus())}})]})}function qm(t,e={}){const{enabled:n=!0,event:r="click",toggle:i=!0,ignoreMouse:s=!1,stickIfOpen:a=!0,touchOpenDelay:u=0,reason:c=Gc}=e,d="rootStore"in t?t.rootStore:t,h=d.context.dataRef,g=R.useRef(void 0),m=kc(),y=lr(),b=R.useMemo(()=>{function x(C,T,E,M){const k=$e(c,T,E);C&&M==="touch"&&u>0?y.start(u,()=>{d.setOpen(!0,k)}):d.setOpen(C,k)}function w(C,T,E){const M=h.current.openEvent,k=d.select("domReferenceElement")!==T;return C&&k||!C||!i?!0:M&&a?!E(M.type):!1}return{onPointerDown(C){g.current=oa(C.pointerType,!0)&&Tw(C.nativeEvent)?"virtual":C.pointerType},onMouseDown(C){const T=g.current,E=C.nativeEvent,M=d.select("open");if(C.button!==0||r==="click"||oa(T,!0)&&s)return;const k=w(M,C.currentTarget,I=>I==="click"||I==="mousedown"),P=mn(E);if(Hm(P)){x(k,E,P,T);return}const A=C.currentTarget;m.request(()=>{x(k,E,A,T)})},onClick(C){if(r==="mousedown-only")return;const T=g.current;if(r==="mousedown"&&T){g.current=void 0;return}if(oa(T,!0)&&s)return;const E=d.select("open"),M=w(E,C.currentTarget,k=>k==="click"||k==="mousedown"||k==="keydown"||k==="keyup");x(M,C.nativeEvent,C.currentTarget,T)},onKeyDown(){g.current=void 0}}},[h,r,s,c,d,a,i,m,y,u]);return R.useMemo(()=>n?{reference:b}:gn,[n,b])}function RU(t,e){let n=null,r=null,i=!1;return{contextElement:t||void 0,getBoundingClientRect(){const s=t?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},a=e.axis==="x"||e.axis==="both",u=e.axis==="y"||e.axis==="both",c=["mouseenter","mousemove"].includes(e.dataRef.current.openEvent?.type||"")&&e.pointerType!=="touch";let d=s.width,h=s.height,g=s.x,m=s.y;return n==null&&e.x&&a&&(n=s.x-e.x),r==null&&e.y&&u&&(r=s.y-e.y),g-=n||0,m-=r||0,d=0,h=0,!i||c?(d=e.axis==="y"?s.width:0,h=e.axis==="x"?s.height:0,g=a&&e.x!=null?e.x:g,m=u&&e.y!=null?e.y:m):i&&!c&&(h=e.axis==="x"?s.height:h,d=e.axis==="y"?s.width:d),i=!0,{width:d,height:h,x:g,y:m,top:m,right:g+d,bottom:m+h,left:g}}}}function LA(t){return t!=null&&t.clientX!=null}function TU(t,e={}){const{enabled:n=!0,axis:r="both"}=e,i="rootStore"in t?t.rootStore:t,s=i.useState("open"),a=i.useState("floatingElement"),u=i.useState("domReferenceElement"),c=i.context.dataRef,d=R.useRef(!1),h=R.useRef(null),[g,m]=R.useState(),[y,b]=R.useState([]),x=ke(M=>{i.set("positionReference",M)}),w=ke((M,k,P)=>{d.current||c.current.openEvent&&!LA(c.current.openEvent)||i.set("positionReference",RU(P??u,{x:M,y:k,axis:r,dataRef:c,pointerType:g}))}),C=ke(M=>{s?h.current||(w(M.clientX,M.clientY,M.currentTarget),b([])):w(M.clientX,M.clientY,M.currentTarget)}),T=oa(g)?a:s;R.useEffect(()=>{if(!n){x(u);return}if(!T)return;function M(){h.current?.(),h.current=null}const k=Rn(a);function P(A){const I=mn(A);Ge(a,I)?M():w(A.clientX,A.clientY)}return!c.current.openEvent||LA(c.current.openEvent)?h.current=yt(k,"mousemove",P):x(u),M},[T,n,a,c,u,i,w,x,y]),R.useEffect(()=>()=>{i.set("positionReference",null)},[i]),R.useEffect(()=>{n&&!a&&(d.current=!1)},[n,a]),R.useEffect(()=>{!n&&s&&(d.current=!0)},[n,s]);const E=R.useMemo(()=>{function M(k){m(k.pointerType)}return{onPointerDown:M,onPointerEnter:M,onMouseMove:C,onMouseEnter:C}},[C]);return R.useMemo(()=>n?{reference:E,trigger:E}:{},[n,E])}function EU(){return!1}function MU(t){return{escapeKey:typeof t=="boolean"?t:t?.escapeKey??!1,outsidePress:typeof t=="boolean"?t:t?.outsidePress??!0}}function ih(t,e={}){const{enabled:n=!0,escapeKey:r=!0,outsidePress:i=!0,outsidePressEvent:s="sloppy",referencePress:a=EU,bubbles:u,externalTree:c}=e,d="rootStore"in t?t.rootStore:t,h=d.useState("open"),g=d.useState("floatingElement"),{dataRef:m}=d.context,y=Sa(c),b=ke(typeof i=="function"?i:()=>!1),x=typeof i=="function"?b:i,w=x!==!1,C=ke(()=>s),{escapeKey:T,outsidePress:E}=MU(u),M=R.useRef(!1),k=R.useRef(!1),P=R.useRef(!1),A=R.useRef(!1),I=R.useRef(""),L=R.useRef(null),j=lr(),N=lr(),_=ke(()=>{N.clear(),m.current.insideReactTree=!1}),H=ke($=>{const W=m.current.floatingContext?.nodeId;return(y?da(y.nodesRef.current,W):[]).some(ie=>ie.context?.open&&!ie.context.dataRef.current[$])}),F=ke($=>Z0($,d.select("floatingElement"))||Z0($,d.select("domReferenceElement"))),G=ke($=>{a()&&d.setOpen(!1,$e(Gc,$.nativeEvent))}),B=ke($=>{if(!h||!n||!r||$.key!=="Escape"||A.current||!T&&H("__escapeKeyBubbles"))return;const W=T6($)?$.nativeEvent:$,K=$e(Wc,W);d.setOpen(!1,K),K.isCanceled||$.preventDefault(),!T&&!K.isPropagationAllowed&&$.stopPropagation()}),q=ke(()=>{m.current.insideReactTree=!0,N.start(0,_)}),U=ke($=>{if(!h||!n||$.button!==0)return;const W=mn($.nativeEvent);Ge(d.select("floatingElement"),W)&&(M.current||(M.current=!0,k.current=!1))}),X=ke($=>{!h||!n||($.defaultPrevented||$.nativeEvent.defaultPrevented)&&M.current&&(k.current=!0)});R.useEffect(()=>{if(!h||!n)return _;m.current.__escapeKeyBubbles=T,m.current.__outsidePressBubbles=E;const $=new ji,W=new ji;function K(){$.clear(),A.current=!0}function ie(){$.start(fl?5:0,()=>{A.current=!1})}function ee(){P.current=!0,W.start(0,()=>{P.current=!1})}function ae(){M.current=!1,k.current=!1}function Y(){const J=I.current,le=J==="pen"||!J?"mouse":J,we=C(),de=typeof we=="function"?we():we;return typeof de=="string"?de:de[le]}function se(J){const le=Y();return le==="intentional"&&J.type!=="click"||le==="sloppy"&&J.type==="click"}function ve(J){const le=m.current.floatingContext?.nodeId,we=y&&da(y.nodesRef.current,le).some(de=>Z0(J,de.context?.elements.floating));return F(J)||we}function ye(J){if(se(J)){J.type!=="click"&&!F(J)&&(W.clear(),P.current=!1),_();return}if(m.current.insideReactTree){_();return}const le=mn(J),we=`[${Pd("inert")}]`,de=It(le)?le.getRootNode():null,me=Array.from((Ac(de)?de:vt(d.select("floatingElement"))).querySelectorAll(we)),Be=d.context.triggerElements;if(le&&(Be.hasElement(le)||Be.hasMatchingElement(wt=>Ge(wt,le))))return;let Ke=It(le)?le:null;for(;Ke&&!rl(Ke);){const wt=ll(Ke);if(rl(wt)||!It(wt))break;Ke=wt}if(!(me.length&&It(le)&&!I6(le)&&!Ge(le,d.select("floatingElement"))&&me.every(wt=>!Ge(Ke,wt)))){if(cn(le)&&!("touches"in J)){const wt=rl(le),xt=Ci(le),st=/auto|scroll/,Ct=wt||st.test(xt.overflowX),Wt=wt||st.test(xt.overflowY),at=Ct&&le.clientWidth>0&&le.scrollWidth>le.clientWidth,Tn=Wt&&le.clientHeight>0&&le.scrollHeight>le.clientHeight,Kt=xt.direction==="rtl",tn=Tn&&(Kt?J.offsetX<=le.offsetWidth-le.clientWidth:J.offsetX>le.clientWidth),Vt=at&&J.offsetY>le.clientHeight;if(tn||Vt)return}if(!ve(J)){if(Y()==="intentional"&&P.current){W.clear(),P.current=!1;return}typeof x=="function"&&!x(J)||H("__outsidePressBubbles")||(d.setOpen(!1,$e(nh,J)),_())}}}function he(J){Y()!=="sloppy"||J.pointerType==="touch"||!d.select("open")||!n||F(J)||ye(J)}function pe(J){if(Y()!=="sloppy"||!d.select("open")||!n||F(J))return;const le=J.touches[0];le&&(L.current={startTime:Date.now(),startX:le.clientX,startY:le.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},j.start(1e3,()=>{L.current&&(L.current.dismissOnTouchEnd=!1,L.current.dismissOnMouseDown=!1)}))}function Te(J,le){const we=mn(J);if(!we)return;const de=yt(we,J.type,()=>{le(J),de()})}function Ie(J){I.current="touch",Te(J,pe)}function De(J){j.clear(),J.type==="pointerdown"&&(I.current=J.pointerType),!(J.type==="mousedown"&&L.current&&!L.current.dismissOnMouseDown)&&Te(J,le=>{le.type==="pointerdown"?he(le):ye(le)})}function Ee(J){if(!M.current)return;const le=k.current;if(ae(),Y()==="intentional"){if(J.type==="pointercancel"){le&&ee();return}if(!ve(J)){if(le){ee();return}typeof x=="function"&&!x(J)||(W.clear(),P.current=!0,_())}}}function _e(J){if(Y()!=="sloppy"||!L.current||F(J))return;const le=J.touches[0];if(!le)return;const we=Math.abs(le.clientX-L.current.startX),de=Math.abs(le.clientY-L.current.startY),me=Math.sqrt(we*we+de*de);me>5&&(L.current.dismissOnTouchEnd=!0),me>10&&(ye(J),j.clear(),L.current=null)}function Me(J){Te(J,_e)}function oe(J){Y()!=="sloppy"||!L.current||F(J)||(L.current.dismissOnTouchEnd&&ye(J),j.clear(),L.current=null)}function xe(J){Te(J,oe)}const Pe=vt(g),ne=zo(r&&zo(yt(Pe,"keydown",B),yt(Pe,"compositionstart",K),yt(Pe,"compositionend",ie)),w&&zo(yt(Pe,"click",De,!0),yt(Pe,"pointerdown",De,!0),yt(Pe,"pointerup",Ee,!0),yt(Pe,"pointercancel",Ee,!0),yt(Pe,"mousedown",De,!0),yt(Pe,"mouseup",Ee,!0),yt(Pe,"touchstart",Ie,!0),yt(Pe,"touchmove",Me,!0),yt(Pe,"touchend",xe,!0)));return()=>{ne(),$.clear(),W.clear(),ae(),P.current=!1,_()}},[m,g,r,w,x,h,n,T,E,B,_,C,H,F,y,d,j]);const Z=R.useMemo(()=>({onKeyDown:B,onPointerDown:G,onClick:G}),[B,G]),z=R.useMemo(()=>({onKeyDown:B,onPointerDown:X,onMouseDown:X,onClickCapture:q,onMouseDownCapture($){q(),U($)},onPointerDownCapture($){q(),U($)},onMouseUpCapture:q,onTouchEndCapture:q,onTouchMoveCapture:q}),[B,q,U,X]);return R.useMemo(()=>n?{reference:Z,floating:z,trigger:Z}:{},[n,Z,z])}function BA(t,e,n){let{reference:r,floating:i}=t;const s=io(e),a=Bw(e),u=Lw(a),c=co(e),d=s==="y",h=r.x+r.width/2-i.width/2,g=r.y+r.height/2-i.height/2,m=r[u]/2-i[u]/2;let y;switch(c){case"top":y={x:h,y:r.y-i.height};break;case"bottom":y={x:h,y:r.y+r.height};break;case"right":y={x:r.x+r.width,y:g};break;case"left":y={x:r.x-i.width,y:g};break;default:y={x:r.x,y:r.y}}const b=ba(e);return b&&(y[a]+=m*(b==="end"?1:-1)*(n&&d?-1:1)),y}async function AU(t,e){var n;e===void 0&&(e={});const{x:r,y:i,platform:s,rects:a,elements:u,strategy:c}=t,{boundary:d="clippingAncestors",rootBoundary:h="viewport",elementContext:g="floating",altBoundary:m=!1,padding:y=0}=fa(e,t),b=JD(y),w=u[m?g==="floating"?"reference":"floating":g],C=Dd(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(w)))==null||n?w:w.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(u.floating)),boundary:d,rootBoundary:h,strategy:c})),T=g==="floating"?{x:r,y:i,width:a.floating.width,height:a.floating.height}:a.reference,E=await(s.getOffsetParent==null?void 0:s.getOffsetParent(u.floating)),M=await(s.isElement==null?void 0:s.isElement(E))&&await(s.getScale==null?void 0:s.getScale(E))||{x:1,y:1},k=Dd(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:T,offsetParent:E,strategy:c}):T);return{top:(C.top-k.top+b.top)/M.y,bottom:(k.bottom-C.bottom+b.bottom)/M.y,left:(C.left-k.left+b.left)/M.x,right:(k.right-C.right+b.right)/M.x}}const OU=50,kU=async(t,e,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:s=[],platform:a}=n,u=a.detectOverflow?a:{...a,detectOverflow:AU},c=await(a.isRTL==null?void 0:a.isRTL(e));let d=await a.getElementRects({reference:t,floating:e,strategy:i}),{x:h,y:g}=BA(d,r,c),m=r,y=0;const b={};for(let x=0;x<s.length;x++){const w=s[x];if(!w)continue;const{name:C,fn:T}=w,{x:E,y:M,data:k,reset:P}=await T({x:h,y:g,initialPlacement:r,placement:m,strategy:i,middlewareData:b,rects:d,platform:u,elements:{reference:t,floating:e}});h=E??h,g=M??g,b[C]={...b[C],...k},P&&y<OU&&(y++,typeof P=="object"&&(P.placement&&(m=P.placement),P.rects&&(d=P.rects===!0?await a.getElementRects({reference:t,floating:e,strategy:i}):P.rects),{x:h,y:g}=BA(d,m,c)),x=-1)}return{x:h,y:g,placement:m,strategy:i,middlewareData:b}},IU=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:i,middlewareData:s,rects:a,initialPlacement:u,platform:c,elements:d}=e,{mainAxis:h=!0,crossAxis:g=!0,fallbackPlacements:m,fallbackStrategy:y="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:x=!0,...w}=fa(t,e);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const C=co(i),T=io(u),E=co(u)===u,M=await(c.isRTL==null?void 0:c.isRTL(d.floating)),k=m||(E||!x?[tm(u)]:G6(u)),P=b!=="none";!m&&P&&k.push(...X6(u,x,b,M));const A=[u,...k],I=await c.detectOverflow(e,w),L=[];let j=((r=s.flip)==null?void 0:r.overflows)||[];if(h&&L.push(I[C]),g){const F=q6(i,a,M);L.push(I[F[0]],I[F[1]])}if(j=[...j,{placement:i,overflows:L}],!L.every(F=>F<=0)){var N,_;const F=(((N=s.flip)==null?void 0:N.index)||0)+1,G=A[F];if(G&&(!(g==="alignment"?T!==io(G):!1)||j.every(U=>io(U.placement)===T?U.overflows[0]>0:!0)))return{data:{index:F,overflows:j},reset:{placement:G}};let B=(_=j.filter(q=>q.overflows[0]<=0).sort((q,U)=>q.overflows[1]-U.overflows[1])[0])==null?void 0:_.placement;if(!B)switch(y){case"bestFit":{var H;const q=(H=j.filter(U=>{if(P){const X=io(U.placement);return X===T||X==="y"}return!0}).map(U=>[U.placement,U.overflows.filter(X=>X>0).reduce((X,Z)=>X+Z,0)]).sort((U,X)=>U[1]-X[1])[0])==null?void 0:H[0];q&&(B=q);break}case"initialPlacement":B=u;break}if(i!==B)return{reset:{placement:B}}}return{}}}},xP=new Set(["left","top"]);async function DU(t,e){const{placement:n,platform:r,elements:i}=t,s=await(r.isRTL==null?void 0:r.isRTL(i.floating)),a=co(n),u=ba(n),c=io(n)==="y",d=xP.has(a)?-1:1,h=s&&c?-1:1,g=fa(e,t);let{mainAxis:m,crossAxis:y,alignmentAxis:b}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return u&&typeof b=="number"&&(y=u==="end"?b*-1:b),c?{x:y*h,y:m*d}:{x:m*d,y:y*h}}const PU=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:i,y:s,placement:a,middlewareData:u}=e,c=await DU(e,t);return a===((n=u.offset)==null?void 0:n.placement)&&(r=u.arrow)!=null&&r.alignmentOffset?{}:{x:i+c.x,y:s+c.y,data:{...c,placement:a}}}}},zU=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:i,platform:s}=e,{mainAxis:a=!0,crossAxis:u=!1,limiter:c={fn:T=>{let{x:E,y:M}=T;return{x:E,y:M}}},...d}=fa(t,e),h={x:n,y:r},g=await s.detectOverflow(e,d),m=io(i),y=Nw(m);let b=h[y],x=h[m];const w=(T,E)=>ZD(E+g[T==="y"?"top":"left"],E,E-g[T==="y"?"bottom":"right"]);a&&(b=w(y,b)),u&&(x=w(m,x));const C=c.fn({...e,[y]:b,[m]:x});return{...C,data:{x:C.x-n,y:C.y-r,enabled:{[y]:a,[m]:u}}}}}},NU=function(t){return t===void 0&&(t={}),{options:t,fn(e){var n,r;const{x:i,y:s,placement:a,rects:u,middlewareData:c}=e,{offset:d=0,mainAxis:h=!0,crossAxis:g=!0}=fa(t,e),m={x:i,y:s},y=io(a),b=Nw(y);let x=m[b],w=m[y];const C=fa(d,e),T=typeof C=="number"?{mainAxis:C,crossAxis:0}:{mainAxis:(n=C.mainAxis)!=null?n:0,crossAxis:(r=C.crossAxis)!=null?r:0};if(h){const k=b==="y"?"height":"width",P=u.reference[b]-u.floating[k]+T.mainAxis,A=u.reference[b]+u.reference[k]-T.mainAxis;x<P?x=P:x>A&&(x=A)}if(g){var E,M;const k=b==="y"?"width":"height",P=xP.has(co(a)),A=u.reference[y]-u.floating[k]+(P&&((E=c.offset)==null?void 0:E[y])||0)+(P?0:T.crossAxis),I=u.reference[y]+u.reference[k]+(P?0:((M=c.offset)==null?void 0:M[y])||0)-(P?T.crossAxis:0);w<A?w=A:w>I&&(w=I)}return{[b]:x,[y]:w}}}},LU=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){const{placement:n,rects:r,platform:i,elements:s}=e,{apply:a=()=>{},...u}=fa(t,e),c=await i.detectOverflow(e,u),d=co(n),h=ba(n),g=io(n)==="y",{width:m,height:y}=r.floating;let b,x;d==="top"||d==="bottom"?(b=d,x=h===(await(i.isRTL==null?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(x=d,b=h==="end"?"top":"bottom");const w=y-c.top-c.bottom,C=m-c.left-c.right,T=Ic(y-c[b],w),E=Ic(m-c[x],C),M=e.middlewareData.shift,k=!M;let P=T,A=E;M!=null&&M.enabled.x&&(A=C),M!=null&&M.enabled.y&&(P=w),k&&!h&&(g?A=m-2*il(c.left,c.right):P=y-2*il(c.top,c.bottom)),await a({...e,availableWidth:A,availableHeight:P});const I=await i.getDimensions(s.floating);return m!==I.width||y!==I.height?{reset:{rects:!0}}:{}}}};function SP(t){const e=Ci(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=cn(t),s=i?t.offsetWidth:n,a=i?t.offsetHeight:r,u=em(n)!==s||em(r)!==a;return u&&(n=s,r=a),{width:n,height:r,$:u}}function Uw(t){return It(t)?t:t.contextElement}function mc(t){const e=Uw(t);if(!cn(e))return ol(1);const n=e.getBoundingClientRect(),{width:r,height:i,$:s}=SP(e);let a=(s?em(n.width):n.width)/r,u=(s?em(n.height):n.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!u||!Number.isFinite(u))&&(u=1),{x:a,y:u}}const BU=ol(0);function wP(t){const e=Rn(t);return!Aw()||!e.visualViewport?BU:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function jU(t,e,n){return e===void 0&&(e=!1),!!n&&e&&n===Rn(t)}function du(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),s=Uw(t);let a=ol(1);e&&(r?It(r)&&(a=mc(r)):a=mc(t));const u=jU(s,n,r)?wP(s):ol(0);let c=(i.left+u.x)/a.x,d=(i.top+u.y)/a.y,h=i.width/a.x,g=i.height/a.y;if(s&&r){const m=Rn(s),y=It(r)?Rn(r):r;let b=m,x=Bx(b);for(;x&&y!==b;){const w=mc(x),C=x.getBoundingClientRect(),T=Ci(x),E=C.left+(x.clientLeft+parseFloat(T.paddingLeft))*w.x,M=C.top+(x.clientTop+parseFloat(T.paddingTop))*w.y;c*=w.x,d*=w.y,h*=w.x,g*=w.y,c+=E,d+=M,b=Rn(x),x=Bx(b)}}return Dd({width:h,height:g,x:c,y:d})}function Gm(t,e){const n=jm(t).scrollLeft;return e?e.left+n:du(dl(t)).left+n}function CP(t,e){const n=t.getBoundingClientRect(),r=n.left+e.scrollLeft-Gm(t,n),i=n.top+e.scrollTop;return{x:r,y:i}}function _U(t){let{elements:e,rect:n,offsetParent:r,strategy:i}=t;const s=i==="fixed",a=dl(r),u=e?Bm(e.floating):!1;if(r===a||u&&s)return n;let c={scrollLeft:0,scrollTop:0},d=ol(1);const h=ol(0),g=cn(r);if((g||!s)&&((_r(r)!=="body"||th(a))&&(c=jm(r)),g)){const y=du(r);d=mc(r),h.x=y.x+r.clientLeft,h.y=y.y+r.clientTop}const m=a&&!g&&!s?CP(a,c):ol(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-c.scrollLeft*d.x+h.x+m.x,y:n.y*d.y-c.scrollTop*d.y+h.y+m.y}}function HU(t){return t.getClientRects?Array.from(t.getClientRects()):[]}function VU(t){const e=jm(t),n=t.ownerDocument.body,r=il(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),i=il(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let s=-e.scrollLeft+Gm(t);const a=-e.scrollTop;return Ci(n).direction==="rtl"&&(s+=il(t.clientWidth,n.clientWidth)-r),{width:r,height:i,x:s,y:a}}const FU=25;function UU(t,e,n){n===void 0&&(n="viewport");const r=n==="layoutViewport",i=Rn(t),s=dl(t),a=i.visualViewport;let u=s.clientWidth,c=s.clientHeight,d=0,h=0;if(a){const m=!Aw()||e==="fixed";r?m||(d=-a.offsetLeft,h=-a.offsetTop):(u=a.width,c=a.height,m&&(d=a.offsetLeft,h=a.offsetTop))}if(Gm(s)<=0){const m=s.ownerDocument,y=m.body,b=getComputedStyle(y),x=m.compatMode==="CSS1Compat"&&parseFloat(b.marginLeft)+parseFloat(b.marginRight)||0,w=Math.abs(s.clientWidth-y.clientWidth-x),C=getComputedStyle(s).scrollbarGutter==="stable both-edges"?w/2:w;C<=FU&&(u-=C)}return{width:u,height:c,x:d,y:h}}function $U(t,e){const n=du(t,!0,e==="fixed"),r=n.top+t.clientTop,i=n.left+t.clientLeft,s=mc(t),a=t.clientWidth*s.x,u=t.clientHeight*s.y,c=i*s.x,d=r*s.y;return{width:a,height:u,x:c,y:d}}function jA(t,e,n){let r;if(e==="viewport"||e==="layoutViewport")r=UU(t,n,e);else if(e==="document")r=VU(dl(t));else if(It(e))r=$U(e,n);else{const i=wP(t);r={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return Dd(r)}function qU(t,e){const n=e.get(t);if(n)return n;let r=Oc(t,[],!1).filter(u=>It(u)&&_r(u)!=="body"),i=null;const s=Ci(t).position==="fixed";let a=s?ll(t):t;for(;It(a)&&!rl(a);){const u=Ci(a),c=Mw(a),d=i?i.position:s?"fixed":"";!c&&(d==="fixed"||d==="absolute"&&u.position==="static")?r=r.filter(g=>g!==a):i=u,a=ll(a)}return e.set(t,r),r}function GU(t){let{element:e,boundary:n,rootBoundary:r,strategy:i}=t;const a=[...n==="clippingAncestors"?Bm(e)?[]:qU(e,this._c):[].concat(n),r],u=jA(e,a[0],i);let c=u.top,d=u.right,h=u.bottom,g=u.left;for(let m=1;m<a.length;m++){const y=jA(e,a[m],i);c=il(y.top,c),d=Ic(y.right,d),h=Ic(y.bottom,h),g=il(y.left,g)}return{width:d-g,height:h-c,x:g,y:c}}function WU(t){const{width:e,height:n}=SP(t);return{width:e,height:n}}function KU(t,e,n){const r=cn(e),i=dl(e),s=n==="fixed",a=du(t,!0,s,e);let u={scrollLeft:0,scrollTop:0};const c=ol(0);if((r||!s)&&((_r(e)!=="body"||th(i))&&(u=jm(e)),r)){const m=du(e,!0,s,e);c.x=m.x+e.clientLeft,c.y=m.y+e.clientTop}!r&&i&&(c.x=Gm(i));const d=i&&!r&&!s?CP(i,u):ol(0),h=a.left+u.scrollLeft-c.x-d.x,g=a.top+u.scrollTop-c.y-d.y;return{x:h,y:g,width:a.width,height:a.height}}function rb(t){return Ci(t).position==="static"}function _A(t,e){if(!cn(t)||Ci(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return dl(t)===n&&(n=n.ownerDocument.body),n}function RP(t,e){const n=Rn(t);if(Bm(t))return n;if(!cn(t)){let i=ll(t);for(;i&&!rl(i);){if(It(i)&&!rb(i))return i;i=ll(i)}return n}let r=_A(t,e);for(;r&&M6(r)&&rb(r);)r=_A(r,e);return r&&rl(r)&&rb(r)&&!Mw(r)?n:r||k6(t)||n}const YU=async function(t){const e=this.getOffsetParent||RP,n=this.getDimensions,r=await n(t.floating);return{reference:KU(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function XU(t){return Ci(t).direction==="rtl"}const TP={convertOffsetParentRelativeRectToViewportRelativeRect:_U,getDocumentElement:dl,getClippingRect:GU,getOffsetParent:RP,getElementRects:YU,getClientRects:HU,getDimensions:WU,getScale:mc,isElement:It,isRTL:XU};function EP(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function QU(t,e,n){let r=null,i;const s=dl(t);function a(){var h;clearTimeout(i),(h=r)==null||h.disconnect(),r=null}function u(h,g){h===void 0&&(h=!1),g===void 0&&(g=1),a();const m=t.getBoundingClientRect(),{left:y,top:b,width:x,height:w}=m;if(h||e(),!x||!w)return;const C=eu(b),T=eu(s.clientWidth-(y+x)),E=eu(s.clientHeight-(b+w)),M=eu(y),P={rootMargin:-C+"px "+-T+"px "+-E+"px "+-M+"px",threshold:il(0,Ic(1,g))||1};let A=!0;function I(L){const j=L[0].intersectionRatio;if(!EP(m,t.getBoundingClientRect()))return u();if(j!==g){if(!A)return u();j?u(!1,j):i=setTimeout(()=>{u(!1,1e-7)},1e3)}A=!1}try{r=new IntersectionObserver(I,{...P,root:s.ownerDocument})}catch{r=new IntersectionObserver(I,P)}r.observe(t)}const c=Rn(t),d=()=>u(n);return c.addEventListener("resize",d),u(!0),()=>{c.removeEventListener("resize",d),a()}}function HA(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,d=Uw(t),h=i||s?[...d?Oc(d):[],...e?Oc(e):[]]:[];h.forEach(C=>{i&&C.addEventListener("scroll",n),s&&C.addEventListener("resize",n)});const g=d&&u?QU(d,n,s):null;let m=-1,y=null;a&&(y=new ResizeObserver(C=>{let[T]=C;T&&T.target===d&&y&&e&&(y.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var E;(E=y)==null||E.observe(e)})),n()}),d&&!c&&y.observe(d),e&&y.observe(e));let b,x=c?du(t):null;c&&w();function w(){const C=du(t);x&&!EP(x,C)&&n(),x=C,b=requestAnimationFrame(w)}return n(),()=>{var C;h.forEach(T=>{i&&T.removeEventListener("scroll",n),s&&T.removeEventListener("resize",n)}),g?.(),(C=y)==null||C.disconnect(),y=null,c&&cancelAnimationFrame(b)}}const ZU=PU,JU=zU,e$=IU,t$=LU,n$=NU,r$=(t,e,n)=>{const r=new Map,i=n??{},s={...TP,...i.platform,_c:r};return kU(t,e,{...i,platform:s})};var i$=typeof document<"u",o$=function(){},Ig=i$?R.useLayoutEffect:o$;function nm(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,r,i;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(r=n;r--!==0;)if(!nm(t[r],e[r]))return!1;return!0}if(i=Object.keys(t),n=i.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(e,i[r]))return!1;for(r=n;r--!==0;){const s=i[r];if(!(s==="_owner"&&t.$$typeof)&&!nm(t[s],e[s]))return!1}return!0}return t!==t&&e!==e}function MP(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function VA(t,e){const n=MP(t);return Math.round(e*n)/n}function ib(t){const e=R.useRef(t);return Ig(()=>{e.current=t}),e}function s$(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:s,floating:a}={},transform:u=!0,whileElementsMounted:c,open:d}=t,[h,g]=R.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[m,y]=R.useState(r);nm(m,r)||y(r);const[b,x]=R.useState(null),[w,C]=R.useState(null),T=R.useCallback(U=>{U!==P.current&&(P.current=U,x(U))},[]),E=R.useCallback(U=>{U!==A.current&&(A.current=U,C(U))},[]),M=s||b,k=a||w,P=R.useRef(null),A=R.useRef(null),I=R.useRef(h),L=c!=null,j=ib(c),N=ib(i),_=ib(d),H=R.useCallback(()=>{if(!P.current||!A.current)return;const U={placement:e,strategy:n,middleware:m};N.current&&(U.platform=N.current),r$(P.current,A.current,U).then(X=>{const Z={...X,isPositioned:_.current!==!1};F.current&&!nm(I.current,Z)&&(I.current=Z,po.flushSync(()=>{g(Z)}))})},[m,e,n,N,_]);Ig(()=>{d===!1&&I.current.isPositioned&&(I.current.isPositioned=!1,g(U=>({...U,isPositioned:!1})))},[d]);const F=R.useRef(!1);Ig(()=>(F.current=!0,()=>{F.current=!1}),[]),Ig(()=>{if(M&&(P.current=M),k&&(A.current=k),M&&k){if(j.current)return j.current(M,k,H);H()}},[M,k,H,j,L]);const G=R.useMemo(()=>({reference:P,floating:A,setReference:T,setFloating:E}),[T,E]),B=R.useMemo(()=>({reference:M,floating:k}),[M,k]),q=R.useMemo(()=>{const U={position:n,left:0,top:0};if(!B.floating)return U;const X=VA(B.floating,h.x),Z=VA(B.floating,h.y);return u?{...U,transform:"translate("+X+"px, "+Z+"px)",...MP(B.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:X,top:Z}},[n,u,B.floating,h.x,h.y]);return R.useMemo(()=>({...h,update:H,refs:G,elements:B,floatingStyles:q}),[h,H,G,B,q])}const l$=(t,e)=>{const n=ZU(t);return{name:n.name,fn:n.fn,options:[t,e]}},a$=(t,e)=>{const n=JU(t);return{name:n.name,fn:n.fn,options:[t,e]}},u$=(t,e)=>({fn:n$(t).fn,options:[t,e]}),c$=(t,e)=>{const n=e$(t);return{name:n.name,fn:n.fn,options:[t,e]}},f$=(t,e)=>{const n=t$(t);return{name:n.name,fn:n.fn,options:[t,e]}};var ob={exports:{}},sb={};var FA;function d$(){if(FA)return sb;FA=1;var t=Zd();function e(g,m){return g===m&&(g!==0||1/g===1/m)||g!==g&&m!==m}var n=typeof Object.is=="function"?Object.is:e,r=t.useState,i=t.useEffect,s=t.useLayoutEffect,a=t.useDebugValue;function u(g,m){var y=m(),b=r({inst:{value:y,getSnapshot:m}}),x=b[0].inst,w=b[1];return s(function(){x.value=y,x.getSnapshot=m,c(x)&&w({inst:x})},[g,y,m]),i(function(){return c(x)&&w({inst:x}),g(function(){c(x)&&w({inst:x})})},[g]),a(y),y}function c(g){var m=g.getSnapshot;g=g.value;try{var y=m();return!n(g,y)}catch{return!0}}function d(g,m){return m()}var h=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:u;return sb.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:h,sb}var UA;function AP(){return UA||(UA=1,ob.exports=d$()),ob.exports}var $w=AP(),lb={exports:{}},ab={};var $A;function h$(){if($A)return ab;$A=1;var t=Zd(),e=AP();function n(d,h){return d===h&&(d!==0||1/d===1/h)||d!==d&&h!==h}var r=typeof Object.is=="function"?Object.is:n,i=e.useSyncExternalStore,s=t.useRef,a=t.useEffect,u=t.useMemo,c=t.useDebugValue;return ab.useSyncExternalStoreWithSelector=function(d,h,g,m,y){var b=s(null);if(b.current===null){var x={hasValue:!1,value:null};b.current=x}else x=b.current;b=u(function(){function C(P){if(!T){if(T=!0,E=P,P=m(P),y!==void 0&&x.hasValue){var A=x.value;if(y(A,P))return M=A}return M=P}if(A=M,r(E,P))return A;var I=m(P);return y!==void 0&&y(A,I)?(E=P,A):(E=P,M=I)}var T=!1,E,M,k=g===void 0?null:g;return[function(){return C(h())},k===null?void 0:function(){return C(k())}]},[h,g,m,y]);var w=i(d,b[0],b[1]);return a(function(){x.hasValue=!0,x.value=w},[w]),c(w),w},ab}var qA;function p$(){return qA||(qA=1,lb.exports=h$()),lb.exports}var g$=p$();const m$=gw(19),y$=m$?b$:x$;function Se(t,e,n,r,i){return y$(t,e,n,r,i)}function v$(t,e,n,r,i){const s=R.useCallback(()=>e(t.getSnapshot(),n,r,i),[t,e,n,r,i]);return $w.useSyncExternalStore(t.subscribe,s,s)}m6({before(t){t.syncIndex=0,t.didInitialize||(t.syncTick=1,t.syncHooks=[],t.didChangeStore=!0,t.getSnapshot=()=>{let e=!1;for(let n=0;n<t.syncHooks.length;n+=1){const r=t.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,i)||(e=!0,r.value=i)}return e&&(t.syncTick+=1),t.syncTick})},after(t){t.syncHooks.length>0&&(t.didChangeStore&&(t.didChangeStore=!1,t.subscribe=e=>{const n=new Set;for(const i of t.syncHooks)n.add(i.store);const r=[];for(const i of n)r.push(i.subscribe(e));return()=>{for(const i of r)i()}}),$w.useSyncExternalStore(t.subscribe,t.getSnapshot,t.getSnapshot))}});function b$(t,e,n,r,i){const s=g6();if(!s)return v$(t,e,n,r,i);const a=s.syncIndex;s.syncIndex+=1;let u;return s.didInitialize?(u=s.syncHooks[a],(u.store!==t||u.selector!==e||!Object.is(u.a1,n)||!Object.is(u.a2,r)||!Object.is(u.a3,i))&&(u.store!==t&&(s.didChangeStore=!0),u.store=t,u.selector=e,u.a1=n,u.a2=r,u.a3=i,u.value=e(t.getSnapshot(),n,r,i))):(u={store:t,selector:e,a1:n,a2:r,a3:i,value:e(t.getSnapshot(),n,r,i)},s.syncHooks.push(u)),u.value}function x$(t,e,n,r,i){return g$.useSyncExternalStoreWithSelector(t.subscribe,t.getSnapshot,t.getSnapshot,s=>e(s,n,r,i))}class OP{constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;const n=this.updateTick;for(const r of this.listeners){if(n!==this.updateTick)return;r(e)}}update(e){for(const n in e)if(!Object.is(this.state[n],e[n])){this.setState({...this.state,...e});return}}set(e,n){Object.is(this.state[e],n)||this.setState({...this.state,[e]:n})}notifyAll(){const e={...this.state};this.setState(e)}use(e,n,r,i){return Se(this,e,n,r,i)}}class Kc extends OP{constructor(e,n={},r){super(e),this.context=n,this.selectors=r}useSyncedValue(e,n){R.useDebugValue(e);const r=this;Ae(()=>{r.state[e]!==n&&r.set(e,n)},[r,e,n])}useSyncedValueWithCleanup(e,n){const r=this;Ae(()=>(r.state[e]!==n&&r.set(e,n),()=>{r.set(e,void 0)}),[r,e,n])}useSyncedValues(e){const n=this,r=Object.values(e);Ae(()=>{n.update(e)},[n,...r])}useControlledProp(e,n){R.useDebugValue(e);const r=this,i=n!==void 0;Ae(()=>{i&&!Object.is(r.state[e],n)&&r.setState({...r.state,[e]:n})},[r,e,n,i])}select(e,n,r,i){const s=this.selectors[e];return s(this.state,n,r,i)}useState(e,n,r,i){return R.useDebugValue(e),Se(this,this.selectors[e],n,r,i)}useContextCallback(e,n){R.useDebugValue(e);const r=ke(n??On);this.context[e]=r}useStateSetter(e){const n=R.useRef(void 0);return n.current===void 0&&(n.current=r=>{this.set(e,r)}),n.current}observe(e,n){let r;typeof e=="function"?r=e:r=this.selectors[e];let i=r(this.state);return n(i,i,this),this.subscribe(s=>{const a=r(s);if(!Object.is(i,a)){const u=i;i=a,n(a,u,this)}})}}const S$={open:t=>t.open,transitionStatus:t=>t.transitionStatus,domReferenceElement:t=>t.domReferenceElement,referenceElement:t=>t.positionReference??t.referenceElement,floatingElement:t=>t.floatingElement,floatingId:t=>t.floatingId};class Wm extends Kc{constructor(e){const{syncOnly:n,nested:r,onOpenChange:i,triggerElements:s,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:i,dataRef:{current:{}},events:mP(),nested:r,triggerElements:s},S$),this.syncOnly=n}syncOpenEvent=(e,n)=>{(!e||!this.state.open||n!=null&&E6(n))&&(this.context.dataRef.current.openEvent=e?n:void 0)};dispatchOpenChange=(e,n)=>{this.syncOpenEvent(e,n.event);const r={open:e,reason:n.reason,nativeEvent:n.event,nested:this.context.nested,triggerElement:n.trigger};this.context.events.emit("openchange",r)};setOpen=(e,n)=>{if(this.syncOnly){this.context.onOpenChange?.(e,n);return}this.dispatchOpenChange(e,n),this.context.onOpenChange?.(e,n)}}function kP(t){const{popupStore:e,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:i,nested:s,onOpenChange:a}=t,u=e.useState("open"),c=e.useState("activeTriggerElement"),d=e.useState(n?"popupElement":"positionerElement"),h=e.context.triggerElements,g=a,m=R.useRef(null);r===void 0&&m.current===null&&(m.current=new Wm({open:u,transitionStatus:void 0,referenceElement:c,floatingElement:d,triggerElements:h,onOpenChange:g,floatingId:i,syncOnly:!0,nested:s}));const y=r??m.current;return e.useSyncedValue("floatingId",i),Ae(()=>{const b={open:u,floatingId:i,referenceElement:c,floatingElement:d};It(c)&&(b.domReferenceElement=c),y.state.positionReference===y.state.referenceElement&&(b.positionReference=c),y.update(b)},[u,i,c,d,y]),y.context.onOpenChange=g,y.context.nested=s,y}function hl(t,e=!1,n=!1){const[r,i]=R.useState(t&&e?"idle":void 0),[s,a]=R.useState(t);return t&&!s&&(a(!0),i("starting")),!t&&s&&r!=="ending"&&!n&&i("ending"),!t&&!s&&r==="ending"&&i(void 0),Ae(()=>{if(!t&&s&&r!=="ending"&&n){const u=cs.request(()=>{i("ending")});return()=>{cs.cancel(u)}}},[t,s,r,n]),Ae(()=>{if(!t||e)return;const u=cs.request(()=>{i(void 0)});return()=>{cs.cancel(u)}},[e,t]),Ae(()=>{if(!t||!e)return;t&&s&&r!=="idle"&&i("starting");const u=cs.request(()=>{i("idle")});return()=>{cs.cancel(u)}},[e,t,s,r]),{mounted:s,setMounted:a,transitionStatus:r}}function IP(t,e=!1){const n=kc();return ke((r,i=null)=>{n.cancel();const s=Xs(t);if(s==null)return;const a=s,u=()=>{po.flushSync(r)};if(typeof a.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){r();return}function c(){Promise.all(a.getAnimations().map(d=>d.finished)).then(()=>{i?.aborted||u()},()=>{if(i?.aborted)return;if(a.getAnimations().some(h=>h.pending||h.playState!=="finished")){c();return}u()})}if(e){const d="data-starting-style";if(!a.hasAttribute(d)){n.request(c);return}const h=new MutationObserver(()=>{a.hasAttribute(d)||(h.disconnect(),c())});h.observe(a,{attributes:!0,attributeFilter:[d]}),i?.addEventListener("abort",()=>h.disconnect(),{once:!0});return}n.request(c)})}function ui(t){const{enabled:e=!0,open:n,ref:r,onComplete:i}=t,s=ke(i),a=IP(r,n);R.useEffect(()=>{if(!e)return;const u=new AbortController;return a(s,u.signal),()=>{u.abort()}},[e,n,s,a])}const oh={tabIndex:-1,[jx]:""};function w$(t){return e=>e==="touch"?t.current:!0}function DP(t,e=!1){const n=ha(),r=xa()!=null,i=Qn(()=>t(n,r)).current;return kP({popupStore:i,treatPopupAsFloatingElement:e,floatingRootContext:i.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:i.setOpen}),i}function qw({handle:t,store:e}){return Ae(()=>t.attachStore(e),[t,e]),null}function C$(t,e){const n=R.useRef(null),r=R.useRef(null);return R.useCallback(i=>{if(t===void 0)return;let s=!1;if(n.current!==null){const a=n.current,u=r.current,c=e.context.triggerElements.getById(a);u&&c===u&&(e.context.triggerElements.delete(a),s=!0),n.current=null,r.current=null}if(i!==null&&(n.current=t,r.current=i,e.context.triggerElements.add(t,i),s=!0),s){const a=e.context.triggerElements.size;e.select("open")&&e.state.triggerCount!==a&&e.set("triggerCount",a)}},[e,t])}function Gw(t,e,n,r=!1){e?t.preventUnmountingOnClose=!1:r&&(t.preventUnmountingOnClose=!0);const i=n?.id??null;(i||e)&&(t.activeTriggerId=i,t.activeTriggerElement=n??null)}function PP(t){let e=!1;return t.preventUnmountOnClose=()=>{e=!0},()=>e}function R$(t,e,n,r={}){const i=n.reason,s=i===Sr,a=e&&i===pc,u=!e&&(i===Gc||i===Wc),c=PP(n);if(t.context.onOpenChange?.(e,n),n.isCanceled)return;r.onBeforeDispatch?.(),t.state.floatingRootContext.dispatchOpenChange(e,n);const d=()=>{const h={...r.extraState,open:e};a?h.instantType="focus":u?h.instantType="dismiss":s&&(h.instantType=void 0),Gw(h,e,n.trigger,c()),t.update(h)};s?po.flushSync(d):d()}function Ww(t,e,n,r){const i=n.useState("isMountedByTrigger",t),s=C$(t,n),a=ke(c=>{const d=n.select("open"),h=n.select("activeTriggerId");if(h===t){n.update({activeTriggerElement:c,...d?r:null});return}h==null&&d&&n.update({activeTriggerId:t,activeTriggerElement:c,...r})}),u=R.useCallback(c=>{s(c),c&&a(c)},[s,a]);return Ae(()=>{i&&n.update({activeTriggerElement:e.current,...r})},[i,n,e,...Object.values(r)]),{registerTrigger:u,isMountedByThisTrigger:i}}function Kw(t,e={}){const{closeOnActiveTriggerUnmount:n=!1}=e,r=R.useRef(null),i=t.useState("open"),s=t.useState("triggerCount"),a=t.useState("activeTriggerId"),u=t.useState("activeTriggerElement");Ae(()=>{if(!i){r.current=null,t.state.triggerCount!==0&&t.set("triggerCount",0);return}const c=t.context.triggerElements.size,d={};t.state.triggerCount!==c&&(d.triggerCount=c);const h=t.select("activeTriggerId");let g=null;if(h){const m=t.context.triggerElements.getById(h);if(m)r.current=h,m!==t.state.activeTriggerElement&&(d.activeTriggerElement=m);else{for(const[y,b]of t.context.triggerElements.entries())if(b===t.state.activeTriggerElement){d.activeTriggerId=y,d.activeTriggerElement=b,r.current=y;break}d.activeTriggerId===void 0&&(r.current===h?g=h:r.current=null)}}else r.current=null;if(!g&&!h&&c===1){const m=t.context.triggerElements.entries().next();if(!m.done){const[y,b]=m.value;d.activeTriggerId=y,d.activeTriggerElement=b,r.current=y}}(d.triggerCount!==void 0||d.activeTriggerId!==void 0||d.activeTriggerElement!==void 0)&&t.update(d),g&&n&&queueMicrotask(()=>{if(t.select("open")&&t.select("activeTriggerId")===g&&!t.context.triggerElements.getById(g)){const m=$e(xr);t.setOpen(!1,m),m.isCanceled||t.update({activeTriggerId:null,activeTriggerElement:null})}})},[i,t,s,a,u,n])}function Yw(t,e,n){const{mounted:r,setMounted:i,transitionStatus:s}=hl(t),a=e.useState("preventUnmountingOnClose"),u=t?!1:a;e.useSyncedValues({mounted:r,transitionStatus:s,preventUnmountingOnClose:u});const c=ke(()=>{i(!1),e.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),e.context.onOpenChangeComplete?.(!1)});return ui({enabled:r&&!t&&!u,open:t,ref:e.context.popupRef,onComplete(){t||c()}}),{forceUnmount:c,transitionStatus:s}}function Xw(t,e){t.useSyncedValues(e),Ae(()=>()=>{t.update({activeTriggerProps:gn,inactiveTriggerProps:gn,popupProps:gn})},[t])}function T$(t,e){Ae(()=>{!e&&t.state.openMethod!==null&&t.set("openMethod",null)},[e,t]),Ae(()=>()=>{t.state.openMethod!==null&&t.set("openMethod",null)},[t])}class sh{constructor(){this.idMap=new Map}add(e,n){this.idMap.set(e,n)}delete(e){this.idMap.delete(e)}hasElement(e){for(const n of this.idMap.values())if(n===e)return!0;return!1}hasMatchingElement(e){for(const n of this.idMap.values())if(e(n))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}}function E$(){return new Wm({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:new sh,floatingId:void 0,syncOnly:!1,nested:!1,onOpenChange:void 0})}function Qw(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:E$(),floatingId:void 0,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:gn,inactiveTriggerProps:gn,popupProps:gn}}function zP(t,e,n=!1){return new Wm({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:t,floatingId:e,syncOnly:!0,nested:n,onOpenChange:void 0})}const hd=t=>t.triggerIdProp??t.activeTriggerId,Zw=t=>t.openProp??t.open,GA=t=>(t.popupElement?.id??t.floatingId)||void 0;function NP(t,e){return e!==void 0&&Zw(t)&&hd(t)===e}function M$(t,e){return NP(t,e)?!0:e!==void 0&&Zw(t)&&hd(t)==null&&t.triggerCount===1}const Jw={open:Zw,mounted:t=>t.mounted,transitionStatus:t=>t.transitionStatus,floatingRootContext:t=>t.floatingRootContext,triggerCount:t=>t.triggerCount,preventUnmountingOnClose:t=>t.preventUnmountingOnClose,payload:t=>t.payload,activeTriggerId:hd,activeTriggerElement:t=>t.mounted?t.activeTriggerElement:null,popupId:GA,isTriggerActive:(t,e)=>e!==void 0&&hd(t)===e,isOpenedByTrigger:(t,e)=>NP(t,e),isMountedByTrigger:(t,e)=>e!==void 0&&hd(t)===e&&t.mounted,triggerProps:(t,e)=>e?t.activeTriggerProps:t.inactiveTriggerProps,triggerPopupId:(t,e)=>M$(t,e)?GA(t):void 0,popupProps:t=>t.popupProps,popupElement:t=>t.popupElement,positionerElement:t=>t.positionerElement};function e1(t){const e=R.useCallback(r=>t===void 0?On:t.subscribeStore(r),[t]),n=R.useCallback(()=>t===void 0?void 0:t.store,[t]);return $w.useSyncExternalStore(e,n,()=>t?.serverStore)}function LP(t){const{open:e=!1,onOpenChange:n,elements:r={}}=t,i=ha(),s=xa()!=null,a=Qn(()=>new Wm({open:e,transitionStatus:void 0,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:new sh,floatingId:i,syncOnly:!1,nested:s})).current;return Ae(()=>{const u={open:e,floatingId:i};r.reference!==void 0&&(u.referenceElement=r.reference,u.domReferenceElement=It(r.reference)?r.reference:null),r.floating!==void 0&&(u.floatingElement=r.floating),a.update(u)},[e,i,r.reference,r.floating,a]),a.context.onOpenChange=n,a.context.nested=s,a}function A$(t){return O$(t,t.rootContext)}function O$(t,e){const{nodeId:n,externalTree:r}=t,i=e.useState("referenceElement"),s=e.useState("floatingElement"),a=e.useState("domReferenceElement"),u=e.useState("open"),c=e.useState("floatingId"),[d,h]=R.useState(null),[g,m]=R.useState(void 0),[y,b]=R.useState(void 0),x=R.useRef(null),w=Sa(r),C=R.useMemo(()=>({reference:i,floating:s,domReference:a}),[i,s,a]),T=s$({...t,elements:{...C,...d&&{reference:d}}}),E=It(g)?g:null,M=y===void 0?e.state.floatingElement:y;e.useSyncedValue("referenceElement",g??null),e.useSyncedValue("domReferenceElement",g===void 0?a:E),e.useSyncedValue("floatingElement",M);const k=R.useCallback(N=>{const _=It(N)?{getBoundingClientRect:()=>N.getBoundingClientRect(),getClientRects:()=>N.getClientRects(),contextElement:N}:N;h(_),T.refs.setReference(_)},[T.refs]),P=R.useCallback(N=>{(It(N)||N===null)&&(x.current=N,m(N)),(It(T.refs.reference.current)||T.refs.reference.current===null||N!==null&&!It(N))&&T.refs.setReference(N)},[T.refs,m]),A=R.useCallback(N=>{b(N),T.refs.setFloating(N)},[T.refs]),I=R.useMemo(()=>({...T.refs,setReference:P,setFloating:A,setPositionReference:k,domReference:x}),[T.refs,P,A,k]),L=R.useMemo(()=>({...T.elements,domReference:a}),[T.elements,a]),j=R.useMemo(()=>({...T,dataRef:e.context.dataRef,open:u,onOpenChange:e.setOpen,events:e.context.events,floatingId:c,refs:I,elements:L,nodeId:n,rootStore:e}),[T,I,L,n,e,u,c]);return Ae(()=>{a&&(x.current=a)},[a]),Ae(()=>{e.context.dataRef.current.floatingContext=j;const N=w?.nodesRef.current.find(_=>_.id===n);N&&(N.context=j)}),R.useMemo(()=>({...T,context:j,refs:I,elements:L,rootStore:e}),[T,I,L,j,e])}const ub=ww&&fl;function BP(t,e={}){const{enabled:n=!0,delay:r}=e,i="rootStore"in t?t.rootStore:t,{events:s,dataRef:a}=i.context,u=R.useRef(!1),c=R.useRef(null),d=R.useRef(!0),h=lr();R.useEffect(()=>{const m=i.select("domReferenceElement");if(!n)return;const y=Rn(m);function b(){const C=i.select("domReferenceElement");!i.select("open")&&cn(C)&&C===ir(vt(C))&&(u.current=!0)}function x(){d.current=!0}function w(){d.current=!1}return zo(yt(y,"blur",b),ub&&yt(y,"keydown",x,!0),ub&&yt(y,"pointerdown",w,!0))},[i,n]),R.useEffect(()=>{if(!n)return;function m(y){if(y.reason===Gc||y.reason===Wc){const b=i.select("domReferenceElement");It(b)&&(c.current=b,u.current=!0)}}return s.on("openchange",m),()=>{s.off("openchange",m)}},[s,n,i]);const g=R.useMemo(()=>{function m(){u.current=!1,c.current=null}return{onMouseLeave(){m()},onFocus(y){const b=y.currentTarget;if(u.current){if(c.current===b)return;m()}const x=mn(y.nativeEvent);if(It(x)){if(ub&&!y.relatedTarget){if(!d.current&&!Hm(x))return}else if(!Zg(x))return}const w=Qg(y.relatedTarget,i.context.triggerElements),{nativeEvent:C,currentTarget:T}=y,E=typeof r=="function"?r():r;if(i.select("open")&&w||E===0||E===void 0){i.setOpen(!0,$e(pc,C,T));return}h.start(E,()=>{u.current||i.setOpen(!0,$e(pc,C,T))})},onBlur(y){m();const b=y.relatedTarget,x=y.nativeEvent,w=It(b)&&b.hasAttribute(Pd("focus-guard"))&&b.getAttribute("data-type")==="outside";h.start(0,()=>{const C=i.select("domReferenceElement"),T=ir(vt(C));!b&&T===C||Ge(a.current.floatingContext?.refs.floating.current,T)||Ge(C,T)||w||Qg(b??T,i.context.triggerElements)||i.setOpen(!1,$e(pc,x))})}}},[a,r,i,h]);return R.useMemo(()=>n?{reference:g,trigger:g}:{},[n,g])}class t1{constructor(){this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new ji,this.restTimeout=new ji,this.handleCloseOptions=void 0}static create(){return new t1}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose}const rm=new WeakMap;function im(t){if(!t.performedPointerEventsMutation)return;const e=t.pointerEventsScopeElement;e&&rm.get(e)===t&&(t.pointerEventsScopeElement?.style.removeProperty("pointer-events"),t.pointerEventsReferenceElement?.style.removeProperty("pointer-events"),t.pointerEventsFloatingElement?.style.removeProperty("pointer-events"),rm.delete(e)),t.performedPointerEventsMutation=!1,t.pointerEventsScopeElement=null,t.pointerEventsReferenceElement=null,t.pointerEventsFloatingElement=null}function jP(t,e){const{scopeElement:n,referenceElement:r,floatingElement:i}=e,s=rm.get(n);s&&s!==t&&im(s),im(t),t.performedPointerEventsMutation=!0,t.pointerEventsScopeElement=n,t.pointerEventsReferenceElement=r,t.pointerEventsFloatingElement=i,rm.set(n,t),n.style.pointerEvents="none",r.style.pointerEvents="auto",i.style.pointerEvents="auto"}function n1(t){const e=t.context.dataRef.current,n=Qn(()=>e.hoverInteractionState??t1.create()).current;return e.hoverInteractionState||(e.hoverInteractionState=n),zm(e.hoverInteractionState.disposeEffect),e.hoverInteractionState}function _P(t,e={}){const{enabled:n=!0,closeDelay:r=0,nodeId:i}=e,s="rootStore"in t?t.rootStore:t,a=s.useState("open"),u=s.useState("floatingElement"),c=s.useState("domReferenceElement"),{dataRef:d}=s.context,h=Sa(),g=xa(),m=n1(s),y=lr(),b=ke(()=>qD(d.current.openEvent?.type,m.interactedInside)),x=ke(()=>P6(d.current.openEvent?.type)),w=ke(()=>{im(m)});Ae(()=>{a||(m.pointerType=void 0,m.restTimeoutPending=!1,m.interactedInside=!1,w())},[a,m,w]),R.useEffect(()=>w,[w]),Ae(()=>{if(n&&a&&m.handleCloseOptions?.blockPointerEvents&&x()&&It(c)&&u){const C=c,T=u,E=vt(u),M=h?.nodesRef.current.find(I=>I.id===g)?.context?.elements.floating;M&&(M.style.pointerEvents="");const k=m.pointerEventsScopeElement!==T?m.pointerEventsScopeElement:null,P=M!==T?M:null,A=m.handleCloseOptions?.getScope?.()??k??P??C.closest("[data-rootownerid]")??E.body;return jP(m,{scopeElement:A,referenceElement:C,floatingElement:T}),()=>{w()}}},[n,a,c,u,m,x,h,g,w]),R.useEffect(()=>{if(!n)return;function C(){return!!(h&&g&&da(h.nodesRef.current,g).length>0)}function T(I){const L=ua(r,"close",m.pointerType),j=()=>{s.setOpen(!1,$e(Sr,I)),h?.events.emit("floating.closed",I)};L?m.openChangeTimeout.start(L,j):(m.openChangeTimeout.clear(),j())}function E(I){const L=mn(I);if(!$D(L)){m.interactedInside=!1;return}m.interactedInside=L?.closest("[aria-haspopup]")!=null}function M(){m.openChangeTimeout.clear(),y.clear(),h?.events.off("floating.closed",P),w()}function k(I){if(C()&&h){h.events.on("floating.closed",P);return}if(Qg(I.relatedTarget,s.context.triggerElements))return;const L=d.current.floatingContext?.nodeId??i,j=I.relatedTarget;if(!(h&&L&&It(j)&&da(h.nodesRef.current,L,!1).some(_=>Ge(_.context?.elements.floating,j)))){if(m.handler){m.handler(I);return}w(),x()&&!b()&&T(I)}}function P(I){!h||!g||C()||y.start(0,()=>{h.events.off("floating.closed",P),s.setOpen(!1,$e(Sr,I)),h.events.emit("floating.closed",I)})}const A=u;return zo(A&&yt(A,"mouseenter",M),A&&yt(A,"mouseleave",k),A&&yt(A,"pointerdown",E,!0),()=>{h?.events.off("floating.closed",P)})},[n,u,s,d,r,i,x,b,w,m,h,g,y])}const k$={current:null};function HP(t,e={}){const{enabled:n=!0,delay:r=0,handleClose:i=null,mouseOnly:s=!1,restMs:a=0,move:u=!0,triggerElementRef:c=k$,externalTree:d,isActiveTrigger:h=!0,getHandleCloseContext:g,isClosing:m,shouldOpen:y,guardStaleOpen:b=!1}=e,x="rootStore"in t?t.rootStore:t,{dataRef:w,events:C}=x.context,T=Sa(d),E=n1(x),M=R.useRef(!1),k=$n(i),P=$n(r),A=$n(a),I=$n(n),L=$n(y),j=$n(m),N=ke(()=>qD(w.current.openEvent?.type,E.interactedInside)),_=ke(()=>L.current?.()!==!1),H=ke((B,q,U)=>{const X=x.context.triggerElements;if(X.hasElement(q))return!B||!Ge(B,q);if(!It(U))return!1;const Z=U;return X.hasMatchingElement(z=>Ge(z,Z))&&(!B||!Ge(B,Z))}),F=ke(()=>{if(!E.handler)return;vt(x.select("domReferenceElement")).removeEventListener("mousemove",E.handler),E.handler=void 0}),G=ke(()=>{im(E)});return h&&(E.handleCloseOptions=k.current?.__options),R.useEffect(()=>F,[F]),R.useEffect(()=>{if(!n)return;function B(q){q.open?M.current=!1:(M.current=q.reason===Sr,F(),E.openChangeTimeout.clear(),E.restTimeout.clear(),E.blockMouseMove=!0,E.restTimeoutPending=!1)}return C.on("openchange",B),()=>{C.off("openchange",B)}},[n,C,E,F]),R.useEffect(()=>{if(!n)return;function B($,W=!0){const K=ua(P.current,"close",E.pointerType);K?E.openChangeTimeout.start(K,()=>{x.setOpen(!1,$e(Sr,$)),T?.events.emit("floating.closed",$)}):W&&(E.openChangeTimeout.clear(),x.setOpen(!1,$e(Sr,$)),T?.events.emit("floating.closed",$))}const q=c.current??(h?x.select("domReferenceElement"):null);if(!It(q))return;function U($){if(E.openChangeTimeout.clear(),E.blockMouseMove=!1,s&&!oa(E.pointerType))return;const W=yA(A.current),K=ua(P.current,"open",E.pointerType),ie=mn($),ee=$.currentTarget??null,ae=x.select("domReferenceElement");let Y=ee;if(It(ie)&&!x.context.triggerElements.hasElement(ie)){for(const Ee of x.context.triggerElements.elements())if(Ge(Ee,ie)){Y=Ee;break}}It(ee)&&It(ae)&&!x.context.triggerElements.hasElement(ee)&&Ge(ee,ae)&&(Y=ae);const se=Y==null?!1:H(ae,Y,ie),ve=x.select("open"),ye=j.current?.()??x.select("transitionStatus")==="ending",he=!ve&&ye&&M.current,pe=!se&&It(Y)&&It(ae)&&Ge(ae,Y)&&he,Te=W>0&&!K,Ie=se&&(ve||he)||pe,De=!ve||se;if(Ie){_()&&x.setOpen(!0,$e(Sr,$,Y));return}Te||(K?E.openChangeTimeout.start(K,()=>{De&&_()&&x.setOpen(!0,$e(Sr,$,Y))}):De&&_()&&x.setOpen(!0,$e(Sr,$,Y)))}function X($){if(N()){G();return}F();const W=x.select("domReferenceElement"),K=vt(W);E.restTimeout.clear(),E.restTimeoutPending=!1;const ie=w.current.floatingContext??g?.();if(Qg($.relatedTarget,x.context.triggerElements))return;if(k.current&&ie){x.select("open")||E.openChangeTimeout.clear();const ae=c.current;E.handler=k.current({...ie,tree:T,x:$.clientX,y:$.clientY,onClose(){G(),F(),I.current&&!N()&&ae===x.select("domReferenceElement")&&B($,!0)}}),K.addEventListener("mousemove",E.handler),E.handler($);return}(E.pointerType!=="touch"||!Ge(x.select("floatingElement"),$.relatedTarget))&&B($)}function Z($){Ge(q,$.relatedTarget)||(E.openChangeTimeout.clear(),E.restTimeout.clear(),E.restTimeoutPending=!1)}const z=b?yt(q,"mouseout",Z):void 0;return u?zo(yt(q,"mousemove",U,{once:!0}),yt(q,"mouseenter",U),yt(q,"mouseleave",X),z):zo(yt(q,"mouseenter",U),yt(q,"mouseleave",X),z)},[F,G,w,P,x,n,k,E,h,H,N,s,u,A,c,T,I,g,j,_,b]),R.useMemo(()=>{if(!n)return;function B(q){E.pointerType=q.pointerType}return{onPointerDown:B,onPointerEnter:B,onMouseMove(q){const{nativeEvent:U}=q,X=q.currentTarget,Z=x.select("domReferenceElement"),z=x.select("open"),$=H(Z,X,q.target);if(s&&!oa(E.pointerType))return;if(z&&$&&E.handleCloseOptions?.blockPointerEvents){const ie=x.select("floatingElement");if(ie){const ee=E.handleCloseOptions?.getScope?.()??X.ownerDocument.body;jP(E,{scopeElement:ee,referenceElement:X,floatingElement:ie})}}const W=yA(A.current);if(z&&!$||W===0||!$&&E.restTimeoutPending&&q.movementX**2+q.movementY**2<2)return;E.restTimeout.clear();function K(){if(E.restTimeoutPending=!1,N())return;const ie=x.select("open");!E.blockMouseMove&&(!ie||$)&&_()&&x.setOpen(!0,$e(Sr,U,X))}E.pointerType==="touch"?po.flushSync(()=>{K()}):$&&z?K():(E.restTimeoutPending=!0,E.restTimeout.start(W,K))}}},[n,E,N,H,s,x,A,_])}const I$="Escape";function WA(t){return fl&&t.movementX===0&&t.movementY===0}function Km(t,e,n){switch(t){case"vertical":return e;case"horizontal":return n;default:return e||n}}function Up(t,e){return Km(e,t===Ow||t===_m,t===su||t===lu)}function cb(t,e,n){return Km(e,t===_m,n?t===su:t===lu)||t==="Enter"||t===" "||t===""}function D$(t,e,n){return Km(e,n?t===su:t===lu,t===_m)}function P$(t,e,n,r){const i=n?t===lu:t===su,s=t===Ow;return e==="both"||e==="horizontal"&&r?t===I$:Km(e,i,s)}function r1(t,e){const{listRef:n,activeIndex:r,onNavigate:i=()=>{},enabled:s=!0,selectedIndex:a=null,allowEscape:u=!1,loopFocus:c=!1,nested:d=!1,rtl:h=!1,virtual:g=!1,focusItemOnOpen:m="auto",focusItemOnHover:y=!0,openOnArrowKeyDown:b=!0,disabledIndices:x=void 0,orientation:w="vertical",parentOrientation:C,id:T,resetOnPointerLeave:E=!0,externalTree:M,grid:k}=e,P=k!=null,A="rootStore"in t?t.rootStore:t,I=A.useState("open"),L=A.useState("floatingElement"),j=A.useState("domReferenceElement"),N=A.context.dataRef,_=Jg(L),H=_x(j),F=$n(_),G=xa(),B=Sa(M),q=R.useRef(m),U=R.useRef(a??-1),X=R.useRef(null),Z=R.useRef(!0),z=ke(J=>{i(U.current===-1?null:U.current,J)}),$=R.useRef(!!L),W=R.useRef(I),K=R.useRef(!1),ie=R.useRef(!1),ee=R.useRef(null),ae=$n(x),Y=$n(I),se=$n(a),ve=$n(E),ye=kc(),he=kc(),pe=ke(()=>{function J(me){g?B?.events.emit("virtualfocus",me):ee.current=kg(me,{sync:K.current,preventScroll:!0})}const le=n.current[U.current],we=ie.current;le&&J(le),(K.current?me=>me():me=>ye.request(me))(()=>{const me=n.current[U.current]||le;if(!me)return;le||J(me),Me&&(we||!Z.current)&&me.scrollIntoView?.({block:"nearest",inline:"nearest"})})});Ae(()=>{N.current.orientation=w},[N,w]),Ae(()=>{s&&(I&&L?(U.current=a??-1,q.current&&a!=null&&(ie.current=!0,z())):$.current&&(U.current=-1,z()))},[s,I,L,a,z]),Ae(()=>{if(s){if(!I){K.current=!1;return}if(L)if(r==null){if(K.current=!1,se.current!=null)return;if($.current&&(U.current=-1,pe()),(!W.current||!$.current)&&q.current&&(X.current!=null||q.current===!0&&X.current==null)){let J=0;const le=()=>{n.current[0]==null?(J<2&&(J?de=>he.request(de):queueMicrotask)(le),J+=1):(U.current=X.current==null||cb(X.current,w,h)||d?Og(n):Fx(n),X.current=null,z())};le()}}else sa(n.current,r)||(U.current=r,pe(),ie.current=!1)}},[s,I,L,r,se,d,n,w,h,z,pe,he]),Ae(()=>{if(!s||L||!B||g||!$.current)return;const J=B.nodesRef.current,le=J.find(me=>me.id===G)?.context?.elements.floating,we=ir(vt(j??le??null)),de=J.some(me=>me.context&&Ge(me.context.elements.floating,we));le&&!de&&Z.current&&le.focus({preventScroll:!0})},[s,L,j,B,G,g]),Ae(()=>{W.current=I,$.current=!!L}),Ae(()=>{I||(X.current=null,q.current=m)},[I,m]);const Te=r!=null,Ie=ke(J=>{if(!Y.current)return;const le=n.current.indexOf(J.currentTarget);le!==-1&&(U.current!==le||r!==le)&&(U.current=le,z(J))}),De=ke(()=>C??B?.nodesRef.current.find(J=>J.id===G)?.context?.dataRef?.current.orientation),Ee=ke(()=>Og(n,ae.current)),_e=ke(J=>{if(Z.current=!1,K.current=!0,J.which===229||!Y.current&&J.currentTarget===F.current)return;if(d&&P$(J.key,w,h,P)){Up(J.key,De())||Nr(J),A.setOpen(!1,$e(Hx,J.nativeEvent)),cn(j)&&(g?B?.events.emit("virtualfocus",j):j.focus());return}const le=U.current,we=Og(n,x),de=Fx(n,x);if(H||(J.key==="Home"&&(Nr(J),U.current=we,z(J)),J.key==="End"&&(Nr(J),U.current=de,z(J))),k!=null){const me=k(J,U.current,n,w,c,h,x,we,de);if(me!=null&&(U.current=me,z(J)),w==="both")return}if(Up(J.key,w)){if(Nr(J),I&&!g&&ir(J.currentTarget.ownerDocument)===J.currentTarget){U.current=cb(J.key,w,h)?we:de,z(J);return}cb(J.key,w,h)?c?le>=de?u&&le!==n.current.length?U.current=-1:(K.current=!1,U.current=we):U.current=Ar(n.current,{startingIndex:le,disabledIndices:x}):U.current=Math.min(de,Ar(n.current,{startingIndex:le,disabledIndices:x})):c?le<=we?u&&le!==-1?U.current=n.current.length:(K.current=!1,U.current=de):U.current=Ar(n.current,{startingIndex:le,decrement:!0,disabledIndices:x}):U.current=Math.max(we,Ar(n.current,{startingIndex:le,decrement:!0,disabledIndices:x})),sa(n.current,U.current)&&(U.current=-1),z(J)}}),Me=R.useMemo(()=>({onFocus(le){K.current=!0,Ie(le)},onClick:({currentTarget:le})=>le.focus({preventScroll:!0}),onMouseMove(le){WA(le)||(K.current=!0,ie.current=!1,y&&Ie(le))},onPointerLeave(le){if(!Y.current||!Z.current||le.pointerType==="touch")return;K.current=!0;const we=le.relatedTarget;if(!(!y||n.current.includes(we))&&ve.current&&(ee.current?.(),ee.current=null,U.current=-1,z(le),!g)){const de=F.current,me=ir(vt(de));de&&Ge(de,me)&&de.focus({preventScroll:!0})}}}),[Ie,Y,F,y,n,z,ve,g]),oe=R.useMemo(()=>g&&I&&Te&&{"aria-activedescendant":`${T}-${r}`},[g,I,Te,T,r]),xe=R.useMemo(()=>({"aria-orientation":w==="both"?void 0:w,...H?{}:oe,onKeyDown(J){if(J.key==="Tab"&&J.shiftKey&&I&&!g){const le=mn(J.nativeEvent);if(le&&!Ge(F.current,le))return;Nr(J),A.setOpen(!1,$e(ca,J.nativeEvent)),cn(j)&&j.focus();return}_e(J)},onPointerMove(J){WA(J)||(Z.current=!0)}}),[oe,_e,F,w,H,A,I,g,j]),Pe=R.useMemo(()=>{function J(de){A.setOpen(!0,$e(Hx,de.nativeEvent,de.currentTarget))}function le(de){m==="auto"&&Rw(de.nativeEvent)&&(q.current=!g)}function we(de){q.current=m,m==="auto"&&Tw(de.nativeEvent)&&(q.current=!0)}return{onKeyDown(de){const me=A.select("open");Z.current=!1;const Be=de.key.startsWith("Arrow"),Ke=D$(de.key,De(),h),wt=Up(de.key,w),xt=(d?Ke:wt)||de.key==="Enter"||de.key.trim()==="";if(g&&me)return _e(de);if(!(!me&&!b&&Be)){if(xt){const st=Up(de.key,De());X.current=d&&st?null:de.key}if(d){Ke&&(Nr(de),me?(U.current=Ee(),z(de)):J(de));return}wt&&(se.current!=null&&(U.current=se.current),Nr(de),!me&&b?J(de):_e(de),me&&z(de))}},onFocus(de){A.select("open")&&!g&&(U.current=-1,z(de))},onPointerDown:we,onPointerEnter:we,onMouseDown:le,onClick:le}},[_e,m,Ee,d,z,A,b,w,De,h,se,g]),ne=R.useMemo(()=>({...oe,...Pe}),[oe,Pe]);return R.useMemo(()=>s?{reference:ne,floating:xe,item:Me,trigger:Pe}:{},[s,ne,xe,Pe,Me])}function VP(t,e){const{listRef:n,elementsRef:r,activeIndex:i,onMatch:s,disabledIndices:a,onTyping:u,enabled:c=!0,resetMs:d=750,selectedIndex:h=null}=e,g="rootStore"in t?t.rootStore:t,m=g.useState("open"),y=lr(),b=R.useRef(""),x=R.useRef(h??i??-1),w=R.useRef(null),C=ke(M=>{function k(F){return r?.current[F]}function P(F){const G=k(F);return G&&!Fm(G)||G?.matches(":disabled")?!1:a==null||!Dc(Si,F,a)}function A(F,G,B=0){if(F.length===0)return-1;const q=(B%F.length+F.length)%F.length,U=G.toLowerCase();for(let X=0;X<F.length;X+=1){const Z=(q+X)%F.length;if(!(!F[Z]?.toLowerCase().startsWith(U)||!P(Z)))return Z}return-1}const I=n.current;if(b.current.length>0&&M.key===" "&&(Nr(M),u?.(!0)),b.current.length>0&&b.current[0]!==" "&&A(I,b.current)===-1&&M.key!==" "&&u?.(!1),I==null||M.key.length!==1||M.ctrlKey||M.metaKey||M.altKey)return;m&&M.key!==" "&&(Nr(M),u?.(!0));const L=b.current==="";L&&(x.current=h??i??-1),I.every((F,G)=>F&&P(G)?F[0]?.toLowerCase()!==F[1]?.toLowerCase():!0)&&b.current===M.key&&(b.current="",x.current=w.current),b.current+=M.key,y.start(d,()=>{b.current="",x.current=w.current,u?.(!1)});const _=((L?h??i??-1:x.current)??0)+1,H=A(I,b.current,_);H!==-1?(s?.(H),w.current=H):M.key!==" "&&(b.current="",u?.(!1))}),T=ke(M=>{const k=M.relatedTarget,P=g.select("domReferenceElement"),A=g.select("floatingElement");Ge(P,k)||Ge(A,k)||(y.clear(),b.current="",x.current=w.current,u?.(!1))});Ae(()=>{!m&&h!==null||(y.clear(),w.current=null,b.current!==""&&(b.current=""))},[m,h,y]);const E=R.useMemo(()=>({onKeyDown:C,onBlur:T}),[C,T]);return R.useMemo(()=>c?{reference:E,floating:E}:{},[c,E])}const KA=.1,z$=KA*KA,Sn=.5;function $p(t,e,n,r,i,s){return r>=e!=s>=e&&t<=(i-n)*(e-r)/(s-r)+n}function qp(t,e,n,r,i,s,a,u,c,d){let h=!1;return $p(t,e,n,r,i,s)&&(h=!h),$p(t,e,i,s,a,u)&&(h=!h),$p(t,e,a,u,c,d)&&(h=!h),$p(t,e,c,d,n,r)&&(h=!h),h}function N$(t,e,n){return t>=n.x&&t<=n.x+n.width&&e>=n.y&&e<=n.y+n.height}function Gp(t,e,n,r,i,s){const a=Math.min(n,i),u=Math.max(n,i),c=Math.min(r,s),d=Math.max(r,s);return t>=a&&t<=u&&e>=c&&e<=d}function FP(t={}){const{blockPointerEvents:e=!1}=t,n=new ji,r=({x:i,y:s,placement:a,elements:u,onClose:c,nodeId:d,tree:h})=>{const g=a?.split("-")[0];let m=!1,y=null,b=null,x=typeof performance<"u"?performance.now():0;function w(T,E){const M=performance.now(),k=M-x;if(y===null||b===null||k===0)return y=T,b=E,x=M,!1;const P=T-y,A=E-b,I=P*P+A*A,L=k*k*z$;return y=T,b=E,x=M,I<L}function C(){n.clear(),c()}return function(E){n.clear();const M=u.domReference,k=u.floating;if(!M||!k||g==null||i==null||s==null)return;const{clientX:P,clientY:A}=E,I=mn(E),L=E.type==="mouseleave",j=Ge(k,I),N=Ge(M,I);if(j&&(m=!0,!L))return;if(N&&(m=!1,!L)){m=!0;return}if(L&&It(E.relatedTarget)&&Ge(k,E.relatedTarget))return;function _(){return!!(h&&da(h.nodesRef.current,d).length>0)}function H(){_()||C()}if(_())return;const F=M.getBoundingClientRect(),G=k.getBoundingClientRect(),B=i>G.right-G.width/2,q=s>G.bottom-G.height/2,U=G.width>F.width,X=G.height>F.height,Z=(U?F:G).left,z=(U?F:G).right,$=(X?F:G).top,W=(X?F:G).bottom;if(g==="top"&&s>=F.bottom-1||g==="bottom"&&s<=F.top+1||g==="left"&&i>=F.right-1||g==="right"&&i<=F.left+1){H();return}let K=!1;switch(g){case"top":K=Gp(P,A,Z,F.top+1,z,G.bottom-1);break;case"bottom":K=Gp(P,A,Z,G.top+1,z,F.bottom-1);break;case"left":K=Gp(P,A,G.right-1,W,F.left+1,$);break;case"right":K=Gp(P,A,F.right-1,W,G.left+1,$);break}if(K)return;if(m&&!N$(P,A,F)){H();return}if(!L&&w(P,A)){H();return}let ie=!1;switch(g){case"top":{const ee=U?Sn/2:Sn*4,ae=U||B?i+ee:i-ee,Y=U?i-ee:B?i+ee:i-ee,se=s+Sn+1,ve=B||U?G.bottom-Sn:G.top,ye=B?U?G.bottom-Sn:G.top:G.bottom-Sn;ie=qp(P,A,ae,se,Y,se,G.left,ve,G.right,ye);break}case"bottom":{const ee=U?Sn/2:Sn*4,ae=U||B?i+ee:i-ee,Y=U?i-ee:B?i+ee:i-ee,se=s-Sn,ve=B||U?G.top+Sn:G.bottom,ye=B?U?G.top+Sn:G.bottom:G.top+Sn;ie=qp(P,A,ae,se,Y,se,G.left,ve,G.right,ye);break}case"left":{const ee=X?Sn/2:Sn*4,ae=X||q?s+ee:s-ee,Y=X?s-ee:q?s+ee:s-ee,se=i+Sn+1,ve=q||X?G.right-Sn:G.left,ye=q?X?G.right-Sn:G.left:G.right-Sn;ie=qp(P,A,ve,G.top,ye,G.bottom,se,ae,se,Y);break}case"right":{const ee=X?Sn/2:Sn*4,ae=X||q?s+ee:s-ee,Y=X?s-ee:q?s+ee:s-ee,se=i-Sn,ve=q||X?G.left+Sn:G.right,ye=q?X?G.left+Sn:G.right:G.left+Sn;ie=qp(P,A,se,ae,se,Y,ve,G.top,ye,G.bottom);break}}ie?m||n.start(40,H):H()}};return r.__options={...t,blockPointerEvents:e},r}const L$={...Jw,disabled:t=>t.disabled,instantType:t=>t.instantType,isInstantPhase:t=>t.isInstantPhase,trackCursorAxis:t=>t.trackCursorAxis,disableHoverablePopup:t=>t.disableHoverablePopup,lastOpenChangeReason:t=>t.openChangeReason,closeOnClick:t=>t.closeOnClick,closeDelay:t=>t.closeDelay,adaptiveOrigin:t=>t.adaptiveOrigin};class B$ extends Kc{constructor(e,n,r){const i=new sh;super(j$(e,i,n,r),_$(i),L$)}setOpen=(e,n)=>{R$(this,e,n,{extraState:{openChangeReason:n.reason}})};cancelPendingOpen(e){this.state.floatingRootContext.dispatchOpenChange(!1,$e(Gc,e))}}function j$(t,e,n,r=!1){const i={...Qw(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,adaptiveOrigin:void 0,...t};return i.floatingRootContext=zP(e,n,r),i}function _$(t){return{popupRef:R.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:t}}const H$=Sw(function(e){const{disabled:n=!1,defaultOpen:r=!1,open:i,disableHoverablePopup:s=!1,trackCursorAxis:a="none",actionsRef:u,onOpenChange:c,onOpenChangeComplete:d,handle:h,triggerId:g,defaultTriggerId:m=null,children:y}=e,b=DP((N,_)=>new B$({open:r,openProp:i,activeTriggerId:m,triggerIdProp:g},N,_));b.useControlledProp("openProp",i),b.useControlledProp("triggerIdProp",g),b.useContextCallback("onOpenChange",c),b.useContextCallback("onOpenChangeComplete",d);const x=b.useState("open"),w=!n&&x,C=b.useState("activeTriggerId"),T=b.useState("mounted"),E=b.useState("payload");b.useSyncedValues({trackCursorAxis:a,disableHoverablePopup:s,disabled:n}),Kw(b,{closeOnActiveTriggerUnmount:!0});const{forceUnmount:M,transitionStatus:k}=Yw(w,b),P=b.useState("isInstantPhase"),A=b.useState("instantType"),I=b.useState("lastOpenChangeReason"),L=R.useRef(null);Ae(()=>{x&&n&&b.setOpen(!1,$e(YD))},[x,n,b]),Ae(()=>{k==="ending"&&I===xr||k!=="ending"&&P?(A!=="delay"&&(L.current=A),b.set("instantType","delay")):L.current!==null&&(b.set("instantType",L.current),L.current=null)},[k,P,I,A,b]),Ae(()=>{w&&C==null&&b.set("payload",void 0)},[b,C,w]),R.useImperativeHandle(u,()=>({unmount:M,close:()=>b.setOpen(!1,$e(Dw))}),[M,b]);const j=w||T||!n&&a!=="none";return O.jsxs(VD.Provider,{value:b,children:[h&&O.jsx(qw,{handle:h,store:b}),j&&O.jsx(V$,{store:b,disabled:n,trackCursorAxis:a}),typeof y=="function"?y({payload:E}):y]})});function V$({store:t,disabled:e,trackCursorAxis:n}){const r=t.useState("floatingRootContext"),i=ih(r,{enabled:!e,referencePress:()=>t.select("closeOnClick")}),s=TU(r,{enabled:!e&&n!=="none",axis:n==="none"?void 0:n}),a=R.useMemo(()=>Zr(s.reference,i.reference),[s.reference,i.reference]);return Xw(t,{activeTriggerProps:a,inactiveTriggerProps:a,popupProps:i.floating??gn}),null}let YA=(function(t){return t.startingStyle="data-starting-style",t.endingStyle="data-ending-style",t})({});const F$={"data-starting-style":""},U$={"data-ending-style":""},Uo={transitionStatus(t){return t==="starting"?F$:t==="ending"?U$:null}};(function(t){return t.open="data-open",t.closed="data-closed",t[t.startingStyle=YA.startingStyle]="startingStyle",t[t.endingStyle=YA.endingStyle]="endingStyle",t.anchorHidden="data-anchor-hidden",t.side="data-side",t.align="data-align",t})({});const $$={"data-popup-open":""},q$={"data-popup-open":"","data-pressed":""},G$={"data-open":""},W$={"data-closed":""},K$={"data-anchor-hidden":""},Ym={open(t){return t?$$:null}},om={open(t){return t?q$:null}},lh={open(t){return t?G$:W$},anchorHidden(t){return t?K$:null}},i1={...lh,...Uo};function ei(t){return ha(t,"base-ui")}const UP=R.createContext(void 0);function Y$(){return R.useContext(UP)}const XA=600,$P="data-base-ui-tooltip-trigger";function QA(t){if("composedPath"in t){const n=t.composedPath();for(let r=0;r<n.length;r+=1){const i=n[r];if(It(i))return i}}const e=t.target;return It(e)?e:null}function X$(t){let e=t;for(;e;){const n=e.closest(`[${$P}]`);if(n)return n;const r=e.getRootNode();e="host"in r&&It(r.host)?r.host:null}return null}const Q$=HD(function(e,n){const{render:r,className:i,style:s,handle:a,payload:u,disabled:c,delay:d,closeOnClick:h=!0,closeDelay:g,id:m,...y}=e,b=Pm(!0),w=e1(a)??b;if(!w)throw new Error(Jt(82));const C=ei(m),T=w.useState("isTriggerActive",C),E=w.useState("isOpenedByTrigger",C),M=w.useState("floatingRootContext"),k=R.useRef(null),P=d??XA,A=g??0,{registerTrigger:I,isMountedByThisTrigger:L}=Ww(C,k,w,{payload:u,closeOnClick:h,closeDelay:A}),j=Y$(),{delayRef:N,isInstantPhase:_,hasProvider:H}=j6(M,{open:E}),F=n1(M);w.useSyncedValue("isInstantPhase",_);const G=w.useState("disabled"),B=c??G,q=$n(B),U=w.useState("trackCursorAxis"),X=w.useState("disableHoverablePopup"),Z=R.useRef(!1),z=lr(),$=R.useRef(void 0);function W(){return H?ua(N.current,"open")===0?0:d??j??XA:P}function K(pe){const Te=k.current;if(!Te||!pe)return!1;const Ie=X$(pe);return Ie!==null&&Ie!==Te&&Ge(Te,Ie)}function ie(pe){const Te=K(pe);return Z.current=Te,Te&&(F.openChangeTimeout.clear(),F.restTimeout.clear(),F.restTimeoutPending=!1,z.clear()),Te}const ee=HP(M,{enabled:!B,mouseOnly:!0,move:!1,handleClose:!X&&U!=="both"?FP():null,restMs:W,delay(){return g==null&&H?{close:ua(N.current,"close")}:{close:A}},triggerElementRef:k,isActiveTrigger:T,isClosing:()=>w.select("transitionStatus")==="ending",shouldOpen(){return!Z.current}}),ae=BP(M,{enabled:!B}).reference,Y=pe=>{const Te=Z.current,Ie=QA(pe),De=ie(Ie),Ee=k.current,_e=Ee&&Ie&&Ge(Ee,Ie);if(De&&w.select("open")&&w.select("lastOpenChangeReason")===Sr){w.setOpen(!1,$e(Sr,pe));return}if(Te&&!De&&_e&&!q.current&&!w.select("open")&&Ee&&oa($.current)){const Me=()=>{!Z.current&&!q.current&&!w.select("open")&&w.setOpen(!0,$e(Sr,pe,Ee))},oe=W();oe===0?(z.clear(),Me()):z.start(oe,Me)}},se=w.useState("triggerProps",L);return ot("button",e,{state:{open:E},ref:[n,I,k],props:[ee,ae,L||U!=="none"?se:void 0,{onMouseOver(pe){Y(pe.nativeEvent)},onFocus(pe){K(QA(pe.nativeEvent))&&pe.preventBaseUIHandler()},onMouseLeave(){Z.current=!1,z.clear(),$.current=void 0},onPointerEnter(pe){$.current=pe.pointerType},onPointerDown(pe){$.current=pe.pointerType,w.set("closeOnClick",h),h&&!w.select("open")&&w.cancelPendingOpen(pe.nativeEvent)},onClick(pe){h&&!w.select("open")&&w.cancelPendingOpen(pe.nativeEvent)},id:C,"data-trigger-disabled":B?"":void 0,[$P]:B?void 0:""},y],stateAttributesMapping:Ym})}),qP=R.createContext(void 0);function Z$(){const t=R.useContext(qP);if(t===void 0)throw new Error(Jt(70));return t}const GP=R.forwardRef(function(e,n){const{children:r,container:i,className:s,render:a,style:u,...c}=e,{node:d,subtree:h}=gP({container:i,ref:n,componentProps:e,elementProps:c});return!h&&!d?null:O.jsxs(R.Fragment,{children:[h,d&&po.createPortal(r,d)]})}),J$=R.forwardRef(function(e,n){const{keepMounted:r=!1,...i}=e;return Pm().useState("mounted")||r?O.jsx(qP.Provider,{value:r,children:O.jsx(GP,{ref:n,...i})}):null}),WP=R.createContext(void 0);function e2(){const t=R.useContext(WP);if(t===void 0)throw new Error(Jt(71));return t}const t2=R.createContext(void 0);function Yc(){return R.useContext(t2)?.direction??"ltr"}const n2=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:i,rects:s,platform:a,elements:u,middlewareData:c}=e,{element:d,padding:h=0,offsetParent:g="real"}=fa(t,e)||{};if(d==null)return{};const m=JD(h),y={x:n,y:r},b=Bw(i),x=Lw(b),w=await a.getDimensions(d),C=b==="y",T=C?"top":"left",E=C?"bottom":"right",M=C?"clientHeight":"clientWidth",k=s.reference[x]+s.reference[b]-y[b]-s.floating[x],P=y[b]-s.reference[b],A=g==="real"?await a.getOffsetParent?.(d):u.floating;let I=u.floating[M]||s.floating[x];(!I||!await a.isElement?.(A))&&(I=u.floating[M]||s.floating[x]);const L=k/2-P/2,j=I/2-w[x]/2-1,N=Math.min(m[T],j),_=Math.min(m[E],j),H=N,F=I-w[x]-_,G=I/2-w[x]/2+L,B=ZD(H,G,F),q=!c.arrow&&ba(i)!=null&&G!==B&&s.reference[x]/2-(G<H?N:_)-w[x]/2<0,U=q?G<H?G-H:G-F:0;return{[b]:y[b]+U,data:{[b]:B,centerOffset:G-B-U,...q&&{alignmentOffset:U}},reset:q}}}),r2=(t,e)=>({...n2(t),options:[t,e]}),i2={name:"hide",async fn(t){const{width:e,height:n,x:r,y:i}=t.rects.reference,s=e===0&&n===0&&r===0&&i===0,a=await t.platform.detectOverflow(t,{elementContext:"reference"});return{data:{referenceHidden:a.top-n>=0||a.right-e>=0||a.bottom-n>=0||a.left-e>=0||s}}}},o2={sideX:"left",sideY:"top"},ZA="--available-width",JA="--available-height";function KP(t,e,n){const r=t==="inline-start"||t==="inline-end";return{top:"top",right:r?n?"inline-start":"inline-end":"right",bottom:"bottom",left:r?n?"inline-end":"inline-start":"left"}[e]}function eO(t,e,n){const{rects:r,placement:i}=t;return{side:KP(e,co(i),n),align:ba(i)||"center",anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function Xm(t){return s2(t,A$)}function s2(t,e){const{anchor:n,positionMethod:r="absolute",side:i="bottom",sideOffset:s=0,align:a="center",alignOffset:u=0,collisionBoundary:c,collisionPadding:d=5,sticky:h=!1,arrowPadding:g=5,disableAnchorTracking:m=!1,inline:y,keepMounted:b=!1,floatingRootContext:x,mounted:w,collisionAvoidance:C,shift:T,nodeId:E,adaptiveOrigin:M,lazyFlip:k=!1,externalTree:P}=t,[A,I]=R.useState(null);!w&&A!==null&&I(null);const L=C.side||"flip",j=C.align||"flip",N=C.fallbackAxisSide||"end",_=T?.crossAxis??!1,H=T?.rootBoundary,F=typeof n=="function"?n:void 0,G=ke(F),B=F?G:n,q=$n(n),U=$n(w),Z=Yc()==="rtl",z=A||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":Z?"left":"right","inline-start":Z?"right":"left"}[i],$=a==="center"?z:`${z}-${a}`;let W=d;typeof W=="number"?W={top:W,right:W,bottom:W,left:W}:W&&(W={top:W.top||0,right:W.right||0,bottom:W.bottom||0,left:W.left||0});const K=1,ie=i==="bottom"?K:0,ee=i==="top"?K:0,ae=i==="right"?K:0,Y=i==="left"?K:0,se={boundary:c==="clipping-ancestors"?"clippingAncestors":c,padding:W},ve=R.useRef(null),ye=$n(s),he=$n(u),pe=typeof s!="function"?s:0,Te=typeof u!="function"?u:0,Ie=[];y&&Ie.push(y),Ie.push(l$(lt=>{const gt=eO(lt,i,Z),nt=typeof ye.current=="function"?ye.current(gt):ye.current,nn=typeof he.current=="function"?he.current(gt):he.current;return{mainAxis:nt,crossAxis:nn,alignmentAxis:nn}},[pe,Te,Z,i]));const De=j==="none"&&L!=="shift",Ee=!De&&(h||_||L==="shift"),_e=L==="none"?null:c$({...se,padding:{top:W.top+K+ie,right:W.right+K+Y,bottom:W.bottom+K+ee,left:W.left+K+ae},mainAxis:!_&&L==="flip",crossAxis:j==="flip"?"alignment":!1,fallbackAxisSideDirection:N}),Me=De?null:a$({...se,rootBoundary:H,mainAxis:j!=="none",crossAxis:Ee,limiter:h||_?void 0:u$(lt=>{if(!ve.current)return{};const{width:gt,height:nt}=ve.current.getBoundingClientRect(),nn=io(co(lt.placement)),Vn=nn==="y"?gt:nt,Fn=nn==="y"?W.left+W.right:W.top+W.bottom;return{offset:Vn/2+Fn/2}})},[se,h,_,H,W,j]);L==="shift"||j==="shift"||a==="center"?Ie.push(Me,_e):Ie.push(_e,Me),Ie.push(f$({...se,apply({elements:{floating:lt},availableWidth:gt,availableHeight:nt,rects:nn}){if(!U.current)return;const Vn=lt.style;Vn.setProperty(ZA,`${gt}px`),Vn.setProperty(JA,`${nt}px`);const Fn=Rn(lt).devicePixelRatio||1,{x:rn,y:kn,width:Pt,height:Hr}=nn.reference,ar=(Math.round((rn+Pt)*Fn)-Math.round(rn*Fn))/Fn,rt=(Math.round((kn+Hr)*Fn)-Math.round(kn*Fn))/Fn;Vn.setProperty("--anchor-width",`${ar}px`),Vn.setProperty("--anchor-height",`${rt}px`)}}),r2(lt=>({element:ve.current||vt(lt.elements.floating).createElement("div"),padding:g,offsetParent:"floating"}),[g]),{name:"transformOrigin",fn(lt){const{elements:gt,middlewareData:nt,placement:nn,rects:Vn,y:Fn}=lt,rn=co(nn),kn=io(rn),Pt=ve.current,Hr=nt.arrow?.x||0,ar=nt.arrow?.y||0,rt=Pt?.clientWidth||0,qt=Pt?.clientHeight||0,qn=Hr+rt/2,jn=ar+qt/2,Tr=Math.abs(nt.shift?.y||0),ln=Vn.reference.height/2,zt=typeof s=="function"?s(eO(lt,i,Z)):s,Nt=Tr>zt,et={top:`${qn}px calc(100% + ${zt}px)`,bottom:`${qn}px ${-zt}px`,left:`calc(100% + ${zt}px) ${jn}px`,right:`${-zt}px ${jn}px`}[rn],Er=`${qn}px ${Vn.reference.y+ln-Fn}px`;return gt.floating.style.setProperty("--transform-origin",Ee&&kn==="y"&&Nt?Er:et),{}}},i2,M),Ae(()=>{!w&&x&&x.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[w,x]);const oe=R.useMemo(()=>({elementResize:!m&&typeof ResizeObserver<"u",layoutShift:!m&&typeof IntersectionObserver<"u"}),[m]),{refs:xe,elements:Pe,x:ne,y:J,middlewareData:le,update:we,placement:de,context:me,isPositioned:Be,floatingStyles:Ke}=e({rootContext:x,open:b?w:void 0,placement:$,middleware:Ie,strategy:r,whileElementsMounted:b?void 0:(...lt)=>HA(...lt,oe),nodeId:E,externalTree:P}),{sideX:wt,sideY:xt}=le.adaptiveOrigin||o2,st=Be?r:"fixed",Ct=R.useMemo(()=>{let lt;return Be?M?lt={position:st,[wt]:ne,[xt]:J}:lt={...Ke,position:st}:lt={position:st,top:0,left:0},lt[ZA]="100vw",lt[JA]="100vh",Be||(lt.opacity=0),lt},[M,st,wt,ne,xt,J,Ke,Be]),Wt=R.useRef(null);Ae(()=>{if(!w)return;const lt=q.current,gt=typeof lt=="function"?lt():lt,nn=(tO(gt)?gt.current:gt)||null||null;nn!==Wt.current&&(xe.setPositionReference(nn),Wt.current=nn)},[w,xe,B,q]),R.useEffect(()=>{if(!w)return;const lt=q.current;typeof lt!="function"&&tO(lt)&<.current!==Wt.current&&(xe.setPositionReference(lt.current),Wt.current=lt.current)},[w,xe,B,q]),R.useEffect(()=>{if(b&&w&&Pe.reference&&Pe.floating)return HA(Pe.reference,Pe.floating,we,oe)},[b,w,Pe,we,oe]);const at=co(de),Tn=KP(i,at,Z),Kt=ba(de)||"center",tn=!!le.hide?.referenceHidden;Ae(()=>{k&&w&&Be&&at!==z&&I(at)},[k,w,Be,at,z]);const Vt=R.useMemo(()=>({position:"absolute",top:le.arrow?.y,left:le.arrow?.x}),[le.arrow]),$t=le.arrow?.centerOffset!==0;return R.useMemo(()=>({positionerStyles:Ct,arrowStyles:Vt,arrowRef:ve,arrowUncentered:$t,side:Tn,align:Kt,physicalSide:at,anchorHidden:tn,refs:xe,context:me,isPositioned:Be,update:we}),[Ct,Vt,ve,$t,Tn,Kt,at,tn,xe,me,Be,we])}function tO(t){return t!=null&&"current"in t}function ah(t){return t==="starting"?hU:gn}function Qm(t,e,{styles:n,transitionStatus:r,props:i,refs:s,hidden:a,inert:u=!1}){const c={...n};return u&&(c.pointerEvents="none"),ot("div",t,{state:e,ref:s,props:[{role:"presentation",hidden:a,style:c},ah(r),i],stateAttributesMapping:lh})}const l2=R.forwardRef(function(e,n){const{render:r,className:i,anchor:s,positionMethod:a="absolute",side:u="top",align:c="center",sideOffset:d=0,alignOffset:h=0,collisionBoundary:g="clipping-ancestors",collisionPadding:m=5,arrowPadding:y=5,sticky:b=!1,disableAnchorTracking:x=!1,collisionAvoidance:w=dP,style:C,...T}=e,E=Pm(),M=Z$(),k=E.useState("open"),P=E.useState("mounted"),A=E.useState("trackCursorAxis"),I=E.useState("disableHoverablePopup"),L=E.useState("floatingRootContext"),j=E.useState("instantType"),N=E.useState("transitionStatus"),_=E.useState("adaptiveOrigin"),H=Xm({anchor:s,positionMethod:a,floatingRootContext:L,mounted:P,side:u,sideOffset:d,align:c,alignOffset:h,collisionBoundary:g,collisionPadding:m,sticky:b,arrowPadding:y,disableAnchorTracking:x,keepMounted:M,collisionAvoidance:w,adaptiveOrigin:_}),F=R.useMemo(()=>({open:k,side:H.side,align:H.align,anchorHidden:H.anchorHidden,instant:A!=="none"?"tracking-cursor":j}),[k,H.side,H.align,H.anchorHidden,A,j]),G=Qm(e,F,{styles:H.positionerStyles,transitionStatus:N,props:T,refs:[n,E.useStateSetter("positionerElement")],hidden:!P,inert:!k||A==="both"||I});return O.jsx(WP.Provider,{value:H,children:G})}),a2=R.forwardRef(function(e,n){const{render:r,className:i,style:s,...a}=e,u=Pm(),{side:c,align:d}=e2(),h=u.useState("open"),g=u.useState("instantType"),m=u.useState("transitionStatus"),y=u.useState("popupProps"),b=u.useState("floatingRootContext"),x=u.useState("disabled"),w=u.useState("closeDelay");ui({open:h,ref:u.context.popupRef,onComplete(){h&&u.context.onOpenChangeComplete?.(!0)}}),_P(b,{enabled:!x,closeDelay:w});const C=u.useStateSetter("popupElement");return ot("div",e,{state:{open:h,side:c,align:d,instant:g,transitionStatus:m},ref:[n,u.context.popupRef,C],props:[oh,y,ah(m),a],stateAttributesMapping:i1})}),u2=function(e){const{delay:n,closeDelay:r,timeout:i=400}=e,s=R.useMemo(()=>({open:n,close:r}),[n,r]);return O.jsx(UP.Provider,{value:n,children:O.jsx(B6,{delay:s,timeoutMs:i,children:e.children})})};function Xc(t){return gw(19)?t:t?"true":void 0}function c2(t){const[e,n]=R.useState({current:t,previous:null});return Object.is(t,e.current)||n({current:t,previous:e.current}),e.previous}const YP=R.createContext(void 0);function o1(t){const e=R.useContext(YP);if(e===void 0&&!t)throw new Error(Jt(33));return e}const XP=R.createContext(void 0);function wu(t){const e=R.useContext(XP);if(e===void 0&&!t)throw new Error(Jt(36));return e}const f2=R.createContext(void 0);function s1(t=!0){const e=R.useContext(f2);if(e===void 0&&!t)throw new Error(Jt(25));return e}function la({controlled:t,default:e,name:n,state:r="value"}){const{current:i}=R.useRef(t!==void 0),[s,a]=R.useState(e),u=i?t:s,c=R.useCallback(d=>{i||a(d)},[]);return[u,c]}const QP=R.createContext(void 0);function d2(){const t=R.useContext(QP);if(t===void 0)throw new Error(Jt(30));return t}const ZP=R.createContext(void 0);function Zm(t=!1){const e=R.useContext(ZP);if(e===void 0&&!t)throw new Error(Jt(16));return e}function h2(t){const{focusableWhenDisabled:e,disabled:n,composite:r=!1,tabIndex:i=0,isNativeButton:s}=t,a=r&&e!==!1,u=r&&e===!1;return{props:R.useMemo(()=>{const d={onKeyDown(h){n&&e&&h.key!=="Tab"&&h.preventDefault()}};return r||(d.tabIndex=i,!s&&n&&(d.tabIndex=e?i:-1)),(s&&(e||a)||!s&&n)&&(d["aria-disabled"]=n),s&&(!e||u)&&(d.disabled=n),d},[r,n,e,a,u,s,i])}}function Dg(t,e,{detail:n=0}={}){t.dispatchEvent(new(Rn(t)).PointerEvent("click",{bubbles:!0,cancelable:!0,composed:!0,detail:n,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey}))}function yo(t={}){const{disabled:e=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0,composite:s}=t,a=R.useRef(null),u=Zm(!0),c=s??u!==void 0,{props:d}=h2({focusableWhenDisabled:n,disabled:e,composite:c,tabIndex:r,isNativeButton:i}),h=R.useCallback(()=>{const y=a.current;fb(y)&&c&&e&&d.disabled===void 0&&y.disabled&&(y.disabled=!1)},[e,d.disabled,c]);Ae(h,[h]);const g=R.useCallback((y={})=>{const{onClick:b,onMouseDown:x,onKeyUp:w,onKeyDown:C,onPointerDown:T,...E}=y;return Zr({onClick(M){if(e){M.preventDefault();return}b?.(M)},onMouseDown(M){e||x?.(M)},onKeyDown(M){if(e||(Yg(M),C?.(M),M.baseUIHandlerPrevented))return;const k=M.target===M.currentTarget,P=M.currentTarget,A=fb(P),I=!i&&p2(P),L=k&&(i?A:!I),j=M.key==="Enter",N=M.key===" ",_=P.getAttribute("role"),H=_?.startsWith("menuitem")||_==="option"||_==="gridcell";if(k&&c&&N){if(M.defaultPrevented&&H)return;M.preventDefault(),(!i||A)&&(M.preventBaseUIHandler(),Dg(P,M));return}if(!L||i||!N&&!j){k&&I&&N&&M.preventDefault();return}M.defaultPrevented||(M.preventDefault(),j&&(M.preventBaseUIHandler(),Dg(P,M)))},onKeyUp(M){if(!e){if(Yg(M),w?.(M),M.target===M.currentTarget&&i&&c&&fb(M.currentTarget)&&M.key===" "){M.preventDefault();return}M.baseUIHandlerPrevented||M.target===M.currentTarget&&!i&&!c&&!M.defaultPrevented&&M.key===" "&&(M.preventBaseUIHandler(),Dg(M.currentTarget,M))}},onPointerDown(M){if(e){M.preventDefault();return}T?.(M)}},i?{type:"button"}:{role:"button"},d,E)},[e,d,c,i]),m=ke(y=>{a.current=y,h()});return{getButtonProps:g,buttonRef:m}}function fb(t){return cn(t)&&t.tagName==="BUTTON"}function p2(t){return cn(t)&&t.tagName==="A"&&!!t.href}function g2(t){const{closeOnClick:e,highlighted:n,id:r,nodeId:i,store:s,typingRef:a,itemRef:u,itemMetadata:c}=t,{events:d}=s.useState("floatingTreeRoot"),h=s.useState("open"),g=s1(!0),m=g!==void 0;return R.useMemo(()=>({id:r,role:"menuitem",tabIndex:h&&n?0:-1,onKeyDown(y){y.key===" "&&a?.current&&y.preventDefault()},onMouseMove(y){i&&d.emit("itemhover",{nodeId:i,target:y.currentTarget})},onClick(y){e&&d.emit("close",{domEvent:y,reason:au})},onMouseUp(y){if(g){const b=g.initialCursorPointRef.current;if(g.initialCursorPointRef.current=null,m&&b&&Math.abs(y.clientX-b.x)<=1&&Math.abs(y.clientY-b.y)<=1||m&&!ww&&y.button===2)return}u.current&&s.context.allowMouseUpTriggerRef.current&&(!m||y.button===2)&&c.type==="regular-item"&&Dg(u.current,y,{detail:1})}}),[e,n,r,d,i,h,s,a,u,g,m,c])}const JP={type:"regular-item"};function ez(t){const{closeOnClick:e,disabled:n,highlighted:r,id:i,store:s,typingRef:a=s.context.typingRef,nativeButton:u,itemMetadata:c,nodeId:d}=t,h=R.useRef(null),{getButtonProps:g,buttonRef:m}=yo({disabled:n,focusableWhenDisabled:!0,native:u,composite:!0}),y=g2({closeOnClick:e,highlighted:r,id:i,nodeId:d,store:s,typingRef:a,itemRef:h,itemMetadata:c}),b=R.useCallback(w=>Zr(y,{onMouseEnter(){c.type==="submenu-trigger"&&c.setActive()}},w,g),[y,g,c]),x=ws(h,m);return R.useMemo(()=>({getItemProps:b,itemRef:x}),[b,x])}const tz=R.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function m2(){return R.useContext(tz)}function Qc(t={}){const{guess:e,label:n,metadata:r,textRef:i,index:s}=t,{register:a,unregister:u,subscribeMapChange:c,nextIndexRef:d}=m2(),h=R.useRef(-1),[g,m]=R.useState(s==null&&e?()=>{if(h.current===-1){const w=d.current;d.current+=1,h.current=w}return h.current}:-1),y=s??g,b=R.useRef(null),x=R.useCallback(w=>{const C=b.current;C&&u(C),b.current=w,w&&a(w,{metadata:r??null,index:s??null,label:n,textRef:i})},[s,a,u,r,n,i]);return Ae(()=>{if(s==null)return c(w=>{const C=b.current?w.get(b.current)?.index:null;C!=null&&m(C)})},[s,c]),{ref:x,index:y}}let nO=(function(t){return t.checked="data-checked",t.unchecked="data-unchecked",t.disabled="data-disabled",t.highlighted="data-highlighted",t})({});const nz={checked(t){return t?{[nO.checked]:""}:{[nO.unchecked]:""}},...Uo},y2=R.forwardRef(function(e,n){const{render:r,className:i,id:s,label:a,nativeButton:u=!1,disabled:c=!1,closeOnClick:d=!1,checked:h,defaultChecked:g,onCheckedChange:m,style:y,...b}=e,x=Qc({guess:!0,label:a}),w=o1(!0),C=ei(s),{store:T}=wu(),E=T.useState("disabled"),M=c||E,k=T.useState("isActive",x.index),P=T.useState("itemProps"),[A,I]=la({controlled:h,default:g??!1,name:"MenuCheckboxItem",state:"checked"}),{getItemProps:L,itemRef:j}=ez({closeOnClick:d,disabled:M,highlighted:k,id:C,store:T,nativeButton:u,nodeId:w?.context.nodeId,itemMetadata:JP}),N=R.useMemo(()=>({disabled:M,highlighted:k,checked:A}),[M,k,A]);function _(F){const G=$e(au,F.nativeEvent,void 0,{preventUnmountOnClose:On});m?.(!A,G),!G.isCanceled&&I(B=>!B)}const H=ot("div",e,{state:N,stateAttributesMapping:nz,props:[P,{role:"menuitemcheckbox","aria-checked":A,onClick:_},b,L],ref:[j,n,x.ref]});return O.jsx(QP.Provider,{value:N,children:H})}),v2=R.forwardRef(function(e,n){const{render:r,className:i,style:s,keepMounted:a=!1,...u}=e,c=d2(),d=R.useRef(null),{transitionStatus:h,mounted:g,setMounted:m}=hl(c.checked);ui({open:c.checked,ref:d,onComplete(){c.checked||m(!1)}});const y={checked:c.checked,disabled:c.disabled,highlighted:c.highlighted,transitionStatus:h};return ot("span",e,{state:y,ref:[n,d],stateAttributesMapping:nz,props:{"aria-hidden":!0,...u},enabled:a||g})}),rz=R.createContext(void 0);function b2(){const t=R.useContext(rz);if(t===void 0)throw new Error(Jt(31));return t}const x2=R.forwardRef(function(e,n){const{render:r,className:i,style:s,...a}=e,[u,c]=R.useState(void 0),d=ot("div",e,{ref:n,props:{role:"group","aria-labelledby":u,...a}});return O.jsx(rz.Provider,{value:c,children:d})}),S2=R.forwardRef(function(e,n){const{render:r,className:i,style:s,id:a,...u}=e,c=ei(a),d=b2();return Ae(()=>(d(c),()=>{d(h=>h===c?void 0:h)}),[d,c]),ot("div",e,{ref:n,props:{id:c,role:"presentation",...u}})}),w2=R.forwardRef(function(e,n){const{render:r,className:i,id:s,label:a,nativeButton:u=!1,disabled:c=!1,closeOnClick:d=!0,style:h,...g}=e,m=Qc({guess:!0,label:a}),y=o1(!0),b=ei(s),{store:x}=wu(),w=x.useState("disabled"),C=c||w,T=x.useState("isActive",m.index),E=x.useState("itemProps"),{getItemProps:M,itemRef:k}=ez({closeOnClick:d,disabled:C,highlighted:T,id:b,store:x,nativeButton:u,nodeId:y?.context.nodeId,itemMetadata:JP});return ot("div",e,{state:{disabled:C,highlighted:T},props:[E,g,M],ref:[k,n,m.ref]})}),iz=R.createContext(void 0);function Jm(t){const e=R.useContext(iz);if(e===void 0&&!t)throw new Error(Jt(69));return e}const qx="ArrowUp",Gx="ArrowDown",Wx="ArrowLeft",Kx="ArrowRight",Yx="Home",Xx="End",ey=new Set([qx,Gx,Wx,Kx,Yx,Xx]),C2="Shift",R2=[C2,"Control","Alt","Meta"];function T2(t){return cn(t)&&t.tagName==="INPUT"}function rO(t){return!!(T2(t)&&t.selectionStart!=null||cn(t)&&t.tagName==="TEXTAREA")}function iO(t,e,n,r){if(!t||!e||!e.scrollTo)return;let i=t.scrollLeft,s=t.scrollTop;const a=t.clientWidth<t.scrollWidth,u=t.clientHeight<t.scrollHeight;if(a&&r!=="vertical"){const c=oO(t,e,"left"),d=Wp(t),h=Wp(e);n==="ltr"&&(c+e.offsetWidth+h.scrollMarginRight>t.scrollLeft+t.clientWidth-d.scrollPaddingRight?i=c+e.offsetWidth+h.scrollMarginRight-t.clientWidth+d.scrollPaddingRight:c-h.scrollMarginLeft<t.scrollLeft+d.scrollPaddingLeft&&(i=c-h.scrollMarginLeft-d.scrollPaddingLeft)),n==="rtl"&&(c-h.scrollMarginLeft<t.scrollLeft+d.scrollPaddingLeft?i=c-h.scrollMarginLeft-d.scrollPaddingLeft:c+e.offsetWidth+h.scrollMarginRight>t.scrollLeft+t.clientWidth-d.scrollPaddingRight&&(i=c+e.offsetWidth+h.scrollMarginRight-t.clientWidth+d.scrollPaddingRight))}if(u&&r!=="horizontal"){const c=oO(t,e,"top"),d=Wp(t),h=Wp(e);c-h.scrollMarginTop<t.scrollTop+d.scrollPaddingTop?s=c-h.scrollMarginTop-d.scrollPaddingTop:c+e.offsetHeight+h.scrollMarginBottom>t.scrollTop+t.clientHeight-d.scrollPaddingBottom&&(s=c+e.offsetHeight+h.scrollMarginBottom-t.clientHeight+d.scrollPaddingBottom)}t.scrollTo({left:i,top:s,behavior:"auto"})}function oO(t,e,n){const r=n==="left"?"offsetLeft":"offsetTop";let i=0;for(;e.offsetParent&&(i+=e[r],e.offsetParent!==t);)e=e.offsetParent;return i}function Wp(t){const e=getComputedStyle(t);return{scrollMarginTop:parseFloat(e.scrollMarginTop)||0,scrollMarginRight:parseFloat(e.scrollMarginRight)||0,scrollMarginBottom:parseFloat(e.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(e.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(e.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(e.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(e.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(e.scrollPaddingLeft)||0}}const E2=R.forwardRef(function(e,n){const{render:r,className:i,style:s,finalFocus:a,...u}=e,{store:c}=wu(),{side:d,align:h}=o1(),g=Jm(!0)!=null,m=c.useState("open"),y=c.useState("transitionStatus"),b=c.useState("popupProps"),x=c.useState("mounted"),w=c.useState("instantType"),C=c.useState("activeTriggerElement"),T=c.useState("parent"),E=c.useState("lastOpenChangeReason"),M=c.useState("rootId"),k=c.useState("floatingRootContext"),P=c.useState("floatingTreeRoot"),A=c.useState("closeDelay"),I=c.useState("hoverEnabled"),L=c.useState("disabled"),j=c.useState("openMethod"),N=T.type==="context-menu";ui({open:m,ref:c.context.popupRef,onComplete(){m&&c.context.onOpenChangeComplete?.(!0)}}),R.useEffect(()=>{function B(q){c.setOpen(!1,$e(q.reason,q.domEvent))}return P.events.on("close",B),()=>{P.events.off("close",B)}},[P.events,c]),_P(k,{enabled:I&&!L&&!N&&T.type!=="menubar",closeDelay:A});const _=c.useStateSetter("popupElement"),H={transitionStatus:y,side:d,align:h,open:m,nested:T.type==="menu",instant:w},F=ot("div",e,{state:H,ref:[n,c.context.popupRef,_],stateAttributesMapping:i1,props:[b,{onKeyDown(B){g&&ey.has(B.key)&&B.stopPropagation()}},ah(y),u,{"data-rootownerid":M}]});let G=T.type===void 0||N;return(C||T.type==="menubar"&&E!==nh)&&(G=!0),O.jsx($m,{context:k,openInteractionType:j,modal:N,disabled:!x,returnFocus:a===void 0?G:a,initialFocus:T.type!=="menu",restoreFocus:!0,externalTree:T.type!=="menubar"?P:void 0,previousFocusableElement:C,nextFocusableElement:T.type===void 0?c.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:T.type===void 0?c.context.beforeContentFocusGuardRef:void 0,children:F})}),oz=R.createContext(void 0);function M2(){const t=R.useContext(oz);if(t===void 0)throw new Error(Jt(32));return t}const A2=R.forwardRef(function(e,n){const{keepMounted:r=!1,...i}=e,{store:s}=wu();return s.useState("mounted")||r?O.jsx(oz.Provider,{value:r,children:O.jsx(Um,{ref:n,...i})}):null});function uh(t){const{children:e,elementsRef:n,labelsRef:r,onMapChange:i}=t,s=ke(i),[,a]=R.useState(!1),u=Qn(k2).current,c=Qn(O2).current,d=R.useRef(0),h=R.useRef(!0),g=R.useRef([]),m=R.useRef(null),y=ke(()=>{h.current||(h.current=!0,a(k=>!k))}),b=ke((k,P)=>{c.set(k,P),y()}),x=ke(k=>{c.delete(k),y()}),w=ke(k=>{const P=new Map;return n.current.length=0,r&&(r.current.length=0),k.forEach(A=>{P.set(A.element,{...A.registration.metadata??{},index:A.index}),n.current[A.index]=A.element,r&&(r.current[A.index]=A.registration.label!==void 0?A.registration.label:A.registration.textRef?.current?.textContent??A.element.textContent)}),d.current=n.current.length,P});function C(k){if(m.current?.disconnect(),m.current=null,typeof MutationObserver!="function"||k.length<2)return;const P=new MutationObserver(I=>{if(!P2(I))return;let L=null;for(const j of k)if(j.isConnected){if(L&&sz(L,j)>0){P.disconnect(),y();return}L=j}});m.current=P;const A=new Set;for(let I=1;I<k.length;I+=1){const L=D2(k[I-1],k[I]);L&&A.add(L)}A.forEach(I=>P.observe(I,{childList:!0}))}const T=ke(()=>{const[k,P]=I2(c),A=w(k);C(P),g.current=k,h.current=!1,u.forEach(I=>I(A)),s(A)});Ae(()=>(h.current||w(g.current),()=>{n.current=[],r&&(r.current=[])}),[n,r,w]),Ae(()=>{h.current&&T()}),Ae(()=>()=>{m.current?.disconnect(),h.current=!0},[]);const E=ke(k=>(u.add(k),()=>{u.delete(k)})),M=R.useMemo(()=>({register:b,unregister:x,subscribeMapChange:E,nextIndexRef:d}),[b,x,E,d]);return O.jsx(tz.Provider,{value:M,children:e})}function O2(){return new Map}function k2(){return new Set}function I2(t){const e=new Set,n=[],r=[];t.forEach((s,a)=>{if(!a.isConnected)return;const u=s.index,c={index:u??-1,element:a,registration:s};u===null?r.push(c):u>=0&&(e.add(u),n.push(c))});let i=0;return r.sort((s,a)=>sz(s.element,a.element)),r.forEach(s=>{for(;e.has(i);)i+=1;s.index=i,n.push(s),i+=1}),e.size>0&&n.sort((s,a)=>s.index-a.index),[n,r.map(s=>s.element)]}function D2(t,e){let n=t.parentElement;for(;n&&!n.contains(e);)n=n.parentElement;return n}function P2(t){for(const e of t)for(let n=0;n<e.removedNodes.length;n+=1)if(e.removedNodes[n].isConnected)return!0;return!1}function sz(t,e){return t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}const ty=R.forwardRef(function(e,n){const{cutout:r,...i}=e;let s;if(r){const a=r.getBoundingClientRect();s=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${a.left}px ${a.top}px,${a.left}px ${a.bottom}px,${a.right}px ${a.bottom}px,${a.right}px ${a.top}px,${a.left}px ${a.top}px)`}return O.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...i,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:s}})});let sO={},lO={},aO="";function ny(t,e){return th(t)?t:e}function uO(t,e,n){return/hidden|clip/.test(t.getComputedStyle(ny(e,n)).overflowY)}function z2(t){if(typeof document>"u")return!1;const e=vt(t);return Rn(e).innerWidth-e.documentElement.clientWidth>0}function N2(t){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const n=vt(t),r=n.documentElement,i=n.body,s=ny(r,i),a=s.style.overflowY,u=r.style.scrollbarGutter;r.style.scrollbarGutter="stable",s.style.overflowY="scroll";const c=s.offsetWidth;s.style.overflowY="hidden";const d=s.offsetWidth;return s.style.overflowY=a,r.style.scrollbarGutter=u,c===d}function L2(t){const e=vt(t),n=e.documentElement,r=e.body,i=ny(n,r),s={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(i.style,s)}}function B2(t){const e=vt(t),n=e.documentElement,r=e.body,i=Rn(n);let s=0,a=0,u=!1;const c=cs.create();if(fl&&(i.visualViewport?.scale??1)!==1)return()=>{};function d(){const y=i.getComputedStyle(n),b=i.getComputedStyle(r),C=(y.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";s=n.scrollTop,a=n.scrollLeft,sO={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},aO=n.style.scrollBehavior,lO={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};const T=n.scrollHeight>n.clientHeight,E=n.scrollWidth>n.clientWidth,M=y.overflowY==="scroll"||b.overflowY==="scroll",k=y.overflowX==="scroll"||b.overflowX==="scroll",P=Math.max(0,i.innerWidth-r.clientWidth),A=Math.max(0,i.innerHeight-r.clientHeight),I=parseFloat(b.marginTop)+parseFloat(b.marginBottom),L=parseFloat(b.marginLeft)+parseFloat(b.marginRight),j=ny(n,r);if(u=N2(t),u){n.style.scrollbarGutter=C,j.style.overflowY="hidden",j.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:C,overflowY:"hidden",overflowX:"hidden"}),(T||M)&&(n.style.overflowY="scroll"),(E||k)&&(n.style.overflowX="scroll"),Object.assign(r.style,{position:"relative",height:I||A?`calc(100dvh - ${I+A}px)`:"100dvh",width:L||P?`calc(100vw - ${L+P}px)`:"100vw",boxSizing:"border-box",overflowY:"hidden",overflowX:"hidden",scrollBehavior:"unset"}),r.scrollTop=s,r.scrollLeft=a,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function h(){Object.assign(n.style,sO),Object.assign(r.style,lO),u||(n.scrollTop=s,n.scrollLeft=a,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=aO)}function g(){h(),c.request(d)}d();const m=yt(i,"resize",g);return()=>{c.cancel(),h(),typeof i.removeEventListener=="function"&&m()}}class j2{lockCount=0;restore=null;timeoutLock=ji.create();timeoutUnlock=ji.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(this.lockCount===0||this.restore!==null)return;const n=vt(e),r=n.documentElement,i=n.body,s=Rn(r);if(uO(s,r,i)){const u=new s.MutationObserver(()=>{uO(s,r,i)||(u.disconnect(),this.restore=null,this.lock(e))}),c={attributes:!0};u.observe(r,c),u.observe(i,c),this.restore=()=>u.disconnect();return}const a=eh||!z2(e);this.restore=a?L2(e):B2(e)}}const _2=new j2;function lz(t=!0,e=null){Ae(()=>{if(t)return _2.acquire(e)},[t,e])}const H2=20;function l1(t,e,n,r){const[i,s]=R.useState(!1);Ae(()=>{if(!t||!e||n==null){s(!1);return}const a=vt(n).documentElement.clientWidth,u=n.offsetWidth;s(a>0&&u>0&&u>=a-H2)},[t,e,n]),lz(t&&(!e||i),r)}const V2=R.forwardRef(function(e,n){const{anchor:r,positionMethod:i="absolute",className:s,render:a,side:u,align:c,sideOffset:d=0,alignOffset:h=0,collisionBoundary:g="clipping-ancestors",collisionPadding:m=5,arrowPadding:y=5,sticky:b=!1,disableAnchorTracking:x=!1,collisionAvoidance:w=Hw,style:C,...T}=e,{store:E}=wu(),M=M2(),k=s1(!0),P=E.useState("parent"),A=E.useState("floatingRootContext"),I=E.useState("floatingTreeRoot"),L=E.useState("mounted"),j=E.useState("open"),N=E.useState("modal"),_=E.useState("openMethod"),H=E.useState("activeTriggerElement"),F=E.useState("transitionStatus"),G=E.useState("positionerElement"),B=E.useState("instantType"),q=E.useState("adaptiveOrigin"),U=E.useState("lastOpenChangeReason"),X=E.useState("floatingNodeId"),Z=E.useState("floatingParentNodeId"),z=A.useState("domReferenceElement"),$=R.useRef(null),W=IP(G);let K=r,ie=d,ee=h,ae=c,Y=w;P.type==="context-menu"&&(K=r??P.context?.anchor,ae=ae??"start",!u&&ae!=="center"&&(ee=e.alignOffset??2,ie=e.sideOffset??-5));let se=u,ve=ae;P.type==="menu"?(se=se??"inline-end",ve=ve??"start",Y=e.collisionAvoidance??dP):P.type==="menubar"&&(se=se??(P.context.orientation==="vertical"?"inline-end":"bottom"),ve=ve??"start");const ye=P.type==="context-menu",he=Xm({anchor:K,floatingRootContext:A,positionMethod:k?"fixed":i,mounted:L,side:se,sideOffset:ie,align:ve,alignOffset:ee,arrowPadding:ye?0:y,collisionBoundary:g,collisionPadding:m,sticky:b,nodeId:X,keepMounted:M,disableAnchorTracking:x,collisionAvoidance:Y,shift:ye?{crossAxis:!("side"in Y&&Y.side==="flip"),rootBoundary:"layoutViewport"}:void 0,externalTree:I,adaptiveOrigin:q});R.useEffect(()=>{function oe(xe){xe.open&&(xe.parentNodeId===X&&E.set("hoverEnabled",!1),xe.nodeId!==X&&xe.parentNodeId===E.select("floatingParentNodeId")&&E.setOpen(!1,$e(id)))}return I.events.on("menuopenchange",oe),()=>{I.events.off("menuopenchange",oe)}},[E,I.events,X]),R.useEffect(()=>{if(E.select("floatingParentNodeId")==null)return;function oe(xe){if(xe.open||xe.nodeId!==E.select("floatingParentNodeId"))return;const Pe=xe.reason??id;E.setOpen(!1,$e(Pe))}return I.events.on("menuopenchange",oe),()=>{I.events.off("menuopenchange",oe)}},[I.events,E]);const pe=lr();R.useEffect(()=>{j||pe.clear()},[j,pe]),R.useEffect(()=>{function oe(xe){if(!(!j||xe.nodeId!==E.select("floatingParentNodeId")))if(xe.target&&H&&H!==xe.target){const Pe=E.select("closeDelay");Pe>0?pe.isStarted()||pe.start(Pe,()=>{E.setOpen(!1,$e(id))}):E.setOpen(!1,$e(id))}else pe.clear()}return I.events.on("itemhover",oe),()=>{I.events.off("itemhover",oe)}},[I.events,j,H,E,pe]),R.useEffect(()=>{const oe={open:j,nodeId:X,parentNodeId:Z,reason:E.select("lastOpenChangeReason")};I.events.emit("menuopenchange",oe)},[I.events,j,E,X,Z]),Ae(()=>{const oe=z,xe=$.current;if(oe&&($.current=oe),xe&&oe&&oe!==xe){E.set("instantType",void 0);const Pe=new AbortController;return W(()=>{E.set("instantType","trigger-change")},Pe.signal),()=>{Pe.abort()}}},[z,W,E]);const Te={open:j,side:he.side,align:he.align,anchorHidden:he.anchorHidden,nested:P.type==="menu",instant:B},Ie=P.type==="menubar"&&P.context.modal;l1(j&&(Ie||N&&U!==Sr),_==="touch",G,H);const Ee=Qm(e,Te,{styles:he.positionerStyles,transitionStatus:F,props:T,refs:[n,E.useStateSetter("positionerElement")],hidden:!L,inert:!j}),_e=L&&P.type!=="menu"&&(P.type!=="menubar"&&N&&U!==Sr||P.type==="menubar"&&P.context.modal);let Me=null;return P.type==="menubar"?Me=P.context.contentElement:P.type===void 0&&(Me=H),O.jsxs(YP.Provider,{value:he,children:[_e&&O.jsx(ty,{ref:P.type==="context-menu"||P.type==="nested-context-menu"?P.context.internalBackdropRef:null,inert:Xc(!j),cutout:Me}),O.jsx(xU,{id:X,children:O.jsx(uh,{elementsRef:E.context.itemDomElements,labelsRef:E.context.itemLabels,children:Ee})})]})}),F2=R.createContext(null);function az(t){return R.useContext(F2)}function U2(t){const e=R.useRef(""),n=R.useCallback(i=>{i.defaultPrevented||(e.current=i.pointerType,t(i,i.pointerType))},[t]);return{onClick:R.useCallback(i=>{if(i.detail===0){t(i,"keyboard");return}"pointerType"in i?t(i,i.pointerType):t(i,e.current),e.current=""},[t]),onPointerDown:n}}function cc(t,e){const n=R.useRef(t),r=ke(e);Ae(()=>{n.current!==t&&r(n.current),n.current=t},[t,r])}function uz(t,e){const n=ke((s,a)=>{(typeof t=="function"?t():t)||e(a||(eh?"touch":""))}),{onClick:r,onPointerDown:i}=U2(n);return R.useMemo(()=>({onClick:r,onPointerDown:i}),[r,i])}function a1(t){const[e,n]=R.useState(null),r=uz(t,n);return cc(t,i=>{i&&!t&&n(null)}),R.useMemo(()=>({openMethod:e,triggerProps:r}),[e,r])}const $2={...Jw,disabled:t=>t.parent.type==="menubar"&&t.parent.context.disabled||t.disabled,modal:t=>(t.parent.type===void 0||t.parent.type==="context-menu")&&(t.modal??!0),openMethod:t=>t.openMethod,allowMouseEnter:t=>t.allowMouseEnter,highlightItemOnHover:t=>t.highlightItemOnHover,parent:t=>t.parent,rootId:t=>t.parent.type==="menu"?t.parent.store.select("rootId"):t.parent.type!==void 0?t.parent.context.rootId:t.rootId,activeIndex:t=>t.activeIndex,isActive:(t,e)=>t.activeIndex===e,hoverEnabled:t=>t.hoverEnabled,instantType:t=>t.instantType,lastOpenChangeReason:t=>t.openChangeReason,floatingTreeRoot:t=>t.parent.type==="menu"?t.parent.store.select("floatingTreeRoot"):t.floatingTreeRoot,floatingNodeId:t=>t.floatingNodeId,floatingParentNodeId:t=>t.floatingParentNodeId,itemProps:t=>t.itemProps,closeDelay:t=>t.closeDelay,adaptiveOrigin:t=>t.adaptiveOrigin,keyboardEventRelay:t=>{if(t.keyboardEventRelay)return t.keyboardEventRelay;if(t.parent.type==="menu")return t.parent.store.select("keyboardEventRelay")}};class q2 extends Kc{constructor(e){super({...W2(),...e},G2(),$2),this.unsubscribeParentListener=this.observe("parent",n=>{if(this.unsubscribeParentListener?.(),n.type==="menu"){let r=n.store.select("rootId"),i=n.store.select("floatingTreeRoot"),s=n.store.select("keyboardEventRelay");this.unsubscribeParentListener=n.store.subscribe(()=>{const a=n.store.select("rootId"),u=n.store.select("floatingTreeRoot"),c=n.store.select("keyboardEventRelay");r===a&&i===u&&s===c||(r=a,i=u,s=c,this.notifyAll())}),this.context.allowMouseUpTriggerRef=n.store.context.allowMouseUpTriggerRef;return}n.type!==void 0&&(this.context.allowMouseUpTriggerRef=n.context.allowMouseUpTriggerRef),this.unsubscribeParentListener=null})}setOpen(e,n){this.state.floatingRootContext.context.events.emit("setOpen",{open:e,eventDetails:n})}unsubscribeParentListener=null}function G2(){return{positionerRef:R.createRef(),popupRef:R.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:R.createRef(),beforeContentFocusGuardRef:R.createRef(),onOpenChangeComplete:void 0,triggerElements:new sh}}function W2(){return{...Qw(),disabled:!1,modal:!0,openMethod:null,allowMouseEnter:!1,highlightItemOnHover:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new Vw,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:gn,keyboardEventRelay:void 0,closeDelay:0,adaptiveOrigin:void 0}}const K2=R.createContext(void 0);function Y2(){return R.useContext(K2)}const X2=Sw(function(e){const{children:n,open:r,onOpenChange:i,onOpenChangeComplete:s,defaultOpen:a=!1,disabled:u=!1,modal:c,loopFocus:d=!0,orientation:h="vertical",actionsRef:g,closeParentOnEsc:m=!1,handle:y,triggerId:b,defaultTriggerId:x=null,highlightItemOnHover:w=!0}=e,C=s1(!0),T=wu(!0),E=az(!0),M=Y2(),k=R.useMemo(()=>M&&T?{type:"menu",store:T.store}:E?{type:"menubar",context:E}:C&&!T?{type:"context-menu",context:C}:{type:void 0},[C,T,E,M]),P=Q2({open:a,openProp:r,activeTriggerId:x,triggerIdProp:b,parent:k});P.useControlledProp("openProp",r),P.useControlledProp("triggerIdProp",b),P.useContextCallback("onOpenChangeComplete",s);const A=ha(),I=ha(),L=P.useState("floatingTreeRoot"),j=bP(L),N=xa(),_=P.useState("open"),H=P.useState("activeTriggerElement"),F=P.useState("positionerElement"),G=P.useState("hoverEnabled"),B=P.useState("disabled"),q=P.useState("lastOpenChangeReason"),U=P.useState("parent"),X=P.useState("activeIndex"),Z=P.useState("payload"),z=P.useState("floatingParentNodeId"),$=R.useRef(null),W=R.useRef(U.type!=="context-menu"),K=lr(),ie=R.useRef(!0),ee=lr(),ae=z!=null,{openMethod:Y,triggerProps:se}=a1(_);P.useSyncedValues({disabled:u,highlightItemOnHover:w,modal:U.type===void 0?c:void 0,openMethod:Y,rootId:A}),Kw(P);const{forceUnmount:ve}=Yw(_,P,()=>{P.set("allowMouseEnter",!1)});Ae(()=>{C&&!T?P.update({parent:{type:"context-menu",context:C},floatingNodeId:j,floatingParentNodeId:N}):T&&P.update({floatingNodeId:j,floatingParentNodeId:N})},[C,T,j,N,P]),R.useEffect(()=>{if(_||($.current=null),U.type==="context-menu"){if(!_){K.clear(),W.current=!1;return}K.start(500,()=>{W.current=!0})}},[K,_,U.type]),Ae(()=>{!_&&!G&&P.set("hoverEnabled",!0)},[_,G,P]);const ye=ke((me,Be)=>{const Ke=Be.reason;if(!me&&!P.select("open")||_===me&&Be.trigger===H&&q===Ke)return;const wt=PP(Be);if(!me&&Be.trigger==null&&(Be.trigger=H??void 0),i?.(me,Be),Be.isCanceled)return;P.state.floatingRootContext.dispatchOpenChange(me,Be);const xt=Be.event;if(me===!1&&xt?.type==="click"&&xt.pointerType==="touch"&&!ie.current)return;me&&Ke===pc?(ie.current=!1,ee.start(300,()=>{ie.current=!0})):(ie.current=!0,ee.clear());const st=(Ke===Gc||Ke===au)&&xt.detail===0,Ct=!me&&(Ke===Wc||Ke==null),Wt={open:me,openChangeReason:Ke};$.current=Be.event,Gw(Wt,me,Be.trigger,wt()),P.update(Wt),U.type==="menubar"&&(Ke===pc||Ke===ca||Ke===Sr||Ke===Hx||Ke===id)?P.set("instantType","group"):st||Ct?P.set("instantType",st?"click":"dismiss"):P.set("instantType",void 0)}),he=kP({popupStore:P,floatingId:I,nested:N!=null,onOpenChange:ye}),pe=he.context.events;Ae(()=>{const me=({open:Be,eventDetails:Ke})=>ye(Be,Ke);return pe.on("setOpen",me),()=>{pe?.off("setOpen",me)}},[pe,ye]);const Te=R.useCallback(()=>{P.setOpen(!1,$e(Dw))},[P]);R.useImperativeHandle(g,()=>({unmount:ve,close:Te}),[ve,Te]);let Ie;U.type==="context-menu"&&(Ie=U.context),R.useImperativeHandle(Ie?.positionerRef,()=>F,[F]),R.useImperativeHandle(Ie?.actionsRef,()=>({setOpen:ye}),[ye]);const De=ih(he,{enabled:!B,bubbles:{escapeKey:m&&U.type==="menu"},outsidePress(){return U.type!=="context-menu"||$.current?.type==="contextmenu"?!0:W.current},externalTree:ae?L:void 0}),Ee=Yc(),_e=R.useCallback(me=>{P.select("activeIndex")!==me&&P.set("activeIndex",me)},[P]),Me=r1(he,{enabled:!B,listRef:P.context.itemDomElements,activeIndex:X,nested:U.type!==void 0,loopFocus:d,orientation:h,parentOrientation:U.type==="menubar"?U.context.orientation:void 0,rtl:Ee==="rtl",disabledIndices:Si,onNavigate:_e,openOnArrowKeyDown:U.type!=="context-menu",externalTree:ae?L:void 0,focusItemOnHover:w}),oe=R.useCallback(me=>{P.context.typingRef.current=me},[P]),xe=VP(he,{enabled:!B,listRef:P.context.itemLabels,elementsRef:P.context.itemDomElements,activeIndex:X,resetMs:fU,onMatch:me=>{_&&me!==X&&P.set("activeIndex",me)},onTyping:oe}),Pe=R.useMemo(()=>{const me=Zr(xe.reference,Me.reference,De.reference,{onMouseMove(){P.set("allowMouseEnter",!0)}},se);return me["aria-haspopup"]="menu",me["aria-expanded"]=_,me},[P,xe.reference,Me.reference,De.reference,se,_]),ne=R.useMemo(()=>{const me=Zr(Me.trigger,De.trigger,se);return me["aria-haspopup"]="menu",me["aria-expanded"]=!1,me},[Me.trigger,De.trigger,se]),J=R.useMemo(()=>Zr(oh,{id:I,role:"menu","aria-labelledby":H?.id,onMouseMove(){P.set("allowMouseEnter",!0),U.type==="menu"&&P.set("hoverEnabled",!1)},onClick(){P.select("hoverEnabled")&&P.set("hoverEnabled",!1)},onKeyDown(me){const Be=P.select("keyboardEventRelay");Be&&!me.isPropagationStopped()&&Be(me)}},xe.floating,Me.floating,De.floating),[H,I,U.type,P,xe.floating,Me.floating,De.floating]),le=Me.item??gn;Xw(P,{floatingRootContext:he,activeTriggerProps:Pe,inactiveTriggerProps:ne,popupProps:J,itemProps:le});const we=R.useMemo(()=>({store:P,parent:k}),[P,k]),de=O.jsxs(XP.Provider,{value:we,children:[y&&O.jsx(qw,{handle:y,store:P}),typeof n=="function"?n({payload:Z}):n]});return U.type===void 0||U.type==="context-menu"?O.jsx(SU,{externalTree:L,children:de}):de});function Q2(t){return Qn(()=>new q2(t)).current}const Kp=5;function cz(t,e){const n=Z2(e);return t.clientX>=n.left-Kp&&t.clientX<=n.right+Kp&&t.clientY>=n.top-Kp&&t.clientY<=n.bottom+Kp}function Z2(t){const e=t.getBoundingClientRect(),n=Rn(t);if(Cw)return e;const r=n.getComputedStyle(t,"::before"),i=n.getComputedStyle(t,"::after");if(!(r.content!=="none"||i.content!=="none"))return e;const a=parseFloat(r.width)||0,u=parseFloat(r.height)||0,c=parseFloat(i.width)||0,d=parseFloat(i.height)||0,h=Math.max(e.width,a,c),g=Math.max(e.height,u,d),m=h-e.width,y=g-e.height;return{left:e.left-m/2,right:e.right+m/2,top:e.top-y/2,bottom:e.bottom+y/2}}function fz(t={}){const{highlightItemOnHover:e,highlightedIndex:n,onHighlightedIndexChange:r}=Zm(),{ref:i,index:s}=Qc(t),a=n===s,u=R.useRef(null),c=ws(i,u);return{compositeProps:{tabIndex:a?0:-1,onFocus(){r(s)},onMouseMove(){const h=u.current;if(!e||!h)return;const g=h.hasAttribute("disabled")||h.ariaDisabled==="true";!a&&!g&&h.focus()}},compositeRef:c,index:s}}function dz(t){const{render:e,className:n,style:r,state:i=gn,props:s=Si,refs:a=Si,metadata:u,stateAttributesMapping:c,tag:d="div",...h}=t,{compositeProps:g,compositeRef:m}=fz({metadata:u});return ot(d,t,{state:i,ref:[m,...a],props:[g,...s,h],stateAttributesMapping:c})}function hz(t){if(cn(t)&&t.hasAttribute("data-rootownerid"))return t.getAttribute("data-rootownerid");if(!rl(t))return hz(ll(t))}function J2(t,e){const n=R.useRef(null);function r(s){po.flushSync(()=>{t.setOpen(!1,$e(ca,s.nativeEvent,s.currentTarget))}),sU(n.current)?.focus()}function i(s){const a=t.select("positionerElement");if(a&&gc(s,a))t.context.beforeContentFocusGuardRef.current?.focus();else{po.flushSync(()=>{t.setOpen(!1,$e(ca,s.nativeEvent,s.currentTarget))});let u=oU(t.context.triggerFocusTargetRef.current||e.current);for(;u!==null&&Ge(a,u);){const c=u;if(u=_w(u),u===c)break}u?.focus()}}return{preFocusGuardRef:n,handlePreFocusGuardFocus:r,handleFocusTargetFocus:i}}function eq(t){const{enabled:e=!0,mouseDownAction:n,open:r}=t,i=R.useRef(!1);return R.useMemo(()=>e?{onMouseDown:s=>{(n==="open"&&!r||n==="close"&&r)&&(i.current=!0,vt(s.currentTarget).addEventListener("click",()=>{i.current=!1},{once:!0}))},onClick:s=>{i.current&&(i.current=!1,s.preventBaseUIHandler())}}:gn,[e,n,r])}const tq=HD(function(e,n){const{render:r,className:i,style:s,disabled:a=!1,nativeButton:u=!0,id:c,openOnHover:d,delay:h=100,closeDelay:g=0,handle:m,payload:y,...b}=e,x=wu(!0),C=e1(m)??x?.store;if(!C)throw new Error(Jt(85));const T=ei(c),E=C.useState("isTriggerActive",T),M=C.useState("floatingRootContext"),k=C.useState("isOpenedByTrigger",T),P=C.useState("triggerPopupId",T),A=R.useRef(null),I=rq(),L=Zm(!0),j=Sa(),N=R.useMemo(()=>j??new Vw,[j]),_=bP(N),H=xa(),{registerTrigger:F,isMountedByThisTrigger:G}=Ww(T,A,C,{payload:y,closeDelay:g,parent:I,floatingTreeRoot:N,floatingNodeId:_,floatingParentNodeId:H,keyboardEventRelay:L?.relayKeyboardEvent}),B=I.type==="menubar",q=C.useState("disabled"),U=a||q||B&&I.context.disabled,{getButtonProps:X,buttonRef:Z}=yo({disabled:U,native:u});R.useEffect(()=>{!k&&I.type===void 0&&(C.context.allowMouseUpTriggerRef.current=!1)},[C,k,I.type]);const z=R.useRef(null),$=lr(),W=ke(oe=>{if(!z.current)return;$.clear(),C.context.allowMouseUpTriggerRef.current=!1;const xe=oe.target;Ge(z.current,xe)||Ge(C.select("positionerElement"),xe)||xe===z.current||xe!=null&&hz(xe)===C.select("rootId")||cz(oe,z.current)||N.events.emit("close",{domEvent:oe,reason:KD})});R.useEffect(()=>{k&&C.select("lastOpenChangeReason")===Sr&&vt(z.current).addEventListener("mouseup",W,{once:!0})},[k,W,C]);const K=B&&I.context.hasSubmenuOpen,ee=HP(M,{enabled:(d??K)&&!U&&(!B||K&&!G),handleClose:FP({blockPointerEvents:!B}),mouseOnly:!0,move:!1,restMs:I.type===void 0?h:void 0,delay:{close:g},triggerElementRef:A,externalTree:N,isActiveTrigger:E,isClosing:()=>C.select("transitionStatus")==="ending"}),ae=nq(k,C.select("lastOpenChangeReason")),Y=qm(M,{enabled:!U,event:k&&B?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:I.type===void 0?ae:!1}),se=BP(M,{enabled:!U&&K}),ve=eq({open:k,enabled:B,mouseDownAction:"open"}),ye=R.useMemo(()=>Zr(se.reference,Y.reference),[se.reference,Y.reference]),he=C.useState("triggerProps",G),{preFocusGuardRef:pe,handlePreFocusGuardFocus:Te,handleFocusTargetFocus:Ie}=J2(C,A),De={disabled:U,open:k},Ee=[z,n,Z,F,A],_e=[ye,ee??gn,he,{"aria-haspopup":"menu","aria-controls":P,id:T,onMouseDown:oe=>{if(C.select("open"))return;$.start(200,()=>{C.context.allowMouseUpTriggerRef.current=!0}),vt(oe.currentTarget).addEventListener("mouseup",W,{once:!0})}},B?{role:"menuitem"}:{},ve,b,X],Me=ot("button",e,{enabled:!B,stateAttributesMapping:om,state:De,ref:Ee,props:_e});return B?O.jsx(dz,{tag:"button",render:r,className:i,style:s,state:De,refs:Ee,props:_e,stateAttributesMapping:om}):k?O.jsxs(R.Fragment,{children:[O.jsx(fu,{ref:pe,onFocus:Te},`${T}-pre-focus-guard`),O.jsx(R.Fragment,{children:Me},T),O.jsx(fu,{ref:C.context.triggerFocusTargetRef,onFocus:Ie},`${T}-post-focus-guard`)]}):O.jsx(R.Fragment,{children:Me},T)});function nq(t,e){const n=lr(),[r,i]=R.useState(!1);return Ae(()=>{t&&e===Sr?(i(!0),n.start(dU,()=>{i(!1)})):t||(n.clear(),i(!1))},[t,e,n]),r}function rq(){const t=az();return R.useMemo(()=>t?{type:"menubar",context:t}:{type:void 0},[t])}const pz=R.forwardRef(function(e,n){const{className:r,render:i,orientation:s="horizontal",style:a,...u}=e;return ot("div",e,{state:{orientation:s},ref:n,props:[{role:"separator","aria-orientation":s},u]})});function gz(t){return t==null||t.hasAttribute("disabled")||t.getAttribute("aria-disabled")==="true"}function iq(t,e){const n=getComputedStyle(t),r=parseFloat(n.fontSize);return e*r}function oq(t,e){const n=getComputedStyle(t.ownerDocument.documentElement),r=parseFloat(n.fontSize);return e*r}function sq(t){return t/100*window.innerHeight}function lq(t){return t/100*window.innerWidth}function aq(t){switch(typeof t){case"number":return[t,"px"];case"string":{const e=parseFloat(t);return t.endsWith("%")?[e,"%"]:t.endsWith("px")?[e,"px"]:t.endsWith("rem")?[e,"rem"]:t.endsWith("em")?[e,"em"]:t.endsWith("vh")?[e,"vh"]:t.endsWith("vw")?[e,"vw"]:[e,"%"]}}}function od({groupSize:t,panelElement:e,styleProp:n}){let r;const[i,s]=aq(n);switch(s){case"%":{r=i/100*t;break}case"px":{r=i;break}case"rem":{r=oq(e,i);break}case"em":{r=iq(e,i);break}case"vh":{r=sq(i);break}case"vw":{r=lq(i);break}}return r}function li(t){return parseFloat(t.toFixed(3))}function Pc({group:t}){const{orientation:e,panels:n}=t;return n.reduce((r,i)=>(r+=e==="horizontal"?i.element.offsetWidth:i.element.offsetHeight,r),0)}function Qx(t){const{panels:e}=t,n=Pc({group:t});return n===0?e.map(r=>({groupResizeBehavior:r.panelConstraints.groupResizeBehavior,collapsedSize:0,collapsible:r.panelConstraints.collapsible===!0,defaultSize:void 0,disabled:r.panelConstraints.disabled,minSize:0,maxSize:100,panelId:r.id})):e.map(r=>{const{element:i,panelConstraints:s}=r;let a=0;if(s.collapsedSize!==void 0){const h=od({groupSize:n,panelElement:i,styleProp:s.collapsedSize});a=li(h/n*100)}let u;if(s.defaultSize!==void 0){const h=od({groupSize:n,panelElement:i,styleProp:s.defaultSize});u=li(h/n*100)}let c=0;if(s.minSize!==void 0){const h=od({groupSize:n,panelElement:i,styleProp:s.minSize});c=li(h/n*100)}let d=100;if(s.maxSize!==void 0){const h=od({groupSize:n,panelElement:i,styleProp:s.maxSize});d=li(h/n*100)}return{groupResizeBehavior:s.groupResizeBehavior,collapsedSize:a,collapsible:s.collapsible===!0,defaultSize:u,disabled:s.disabled,minSize:c,maxSize:d,panelId:r.id}})}function wn(t,e="Assertion error"){if(!t)throw Error(e)}function Zx(t,e){return Array.from(e).sort(t==="horizontal"?uq:cq)}function uq(t,e){const n=t.element.offsetLeft-e.element.offsetLeft;return n!==0?n:t.element.offsetWidth-e.element.offsetWidth}function cq(t,e){const n=t.element.offsetTop-e.element.offsetTop;return n!==0?n:t.element.offsetHeight-e.element.offsetHeight}function mz(t){return t!==null&&typeof t=="object"&&"nodeType"in t&&t.nodeType===Node.ELEMENT_NODE}function yz(t,e){return{x:t.x>=e.left&&t.x<=e.right?0:Math.min(Math.abs(t.x-e.left),Math.abs(t.x-e.right)),y:t.y>=e.top&&t.y<=e.bottom?0:Math.min(Math.abs(t.y-e.top),Math.abs(t.y-e.bottom))}}function fq({orientation:t,rects:e,targetRect:n}){const r={x:n.x+n.width/2,y:n.y+n.height/2};let i,s=Number.MAX_VALUE;for(const a of e){const{x:u,y:c}=yz(r,a),d=t==="horizontal"?u:c;d<s&&(s=d,i=a)}return wn(i,"No rect found"),i}let Yp;function dq(){return Yp===void 0&&(typeof matchMedia=="function"?Yp=!!matchMedia("(pointer:coarse)").matches:Yp=!1),Yp}function vz(t){const{element:e,orientation:n,panels:r,separators:i}=t,s=Zx(n,Array.from(e.children).filter(mz).map(b=>({element:b}))).map(({element:b})=>b),a=[];let u=!1,c=!1,d=-1,h=-1,g=0,m,y=[];{let b=-1;for(const x of s)x.hasAttribute("data-panel")&&(b++,x.hasAttribute("data-disabled")||(g++,d===-1&&(d=b),h=b))}if(g>1){let b=-1;for(const x of s)if(x.hasAttribute("data-panel")){b++;const w=r.find(C=>C.element===x);if(w){if(m){const C=m.element.getBoundingClientRect(),T=x.getBoundingClientRect();let E;if(c){const M=n==="horizontal"?new DOMRect(C.right,C.top,0,C.height):new DOMRect(C.left,C.bottom,C.width,0),k=n==="horizontal"?new DOMRect(T.left,T.top,0,T.height):new DOMRect(T.left,T.top,T.width,0);switch(y.length){case 0:{E=[M,k];break}case 1:{const P=y[0],A=fq({orientation:n,rects:[C,T],targetRect:P.element.getBoundingClientRect()});E=[P,A===C?k:M];break}default:{E=y;break}}}else y.length?E=y:E=[n==="horizontal"?new DOMRect(C.right,T.top,T.left-C.right,T.height):new DOMRect(T.left,C.bottom,T.width,T.top-C.bottom)];for(const M of E){let k="width"in M?M:M.element.getBoundingClientRect();const P=dq()?t.resizeTargetMinimumSize.coarse:t.resizeTargetMinimumSize.fine;if(k.width<P){const I=P-k.width;k=new DOMRect(k.x-I/2,k.y,k.width+I,k.height)}if(k.height<P){const I=P-k.height;k=new DOMRect(k.x,k.y-I/2,k.width,k.height+I)}const A=b<=d||b>h;!u&&!A&&a.push({group:t,groupSize:Pc({group:t}),panels:[m,w],separator:"width"in M?void 0:M,rect:k}),u=!1}}c=!1,m=w,y=[]}}else if(x.hasAttribute("data-separator")){x.ariaDisabled!==null&&(u=!0);const w=i.find(C=>C.element===x);w?y.push(w):(m=void 0,y=[])}else c=!0}return a}let bz=class{#e={};addListener(e,n){const r=this.#e[e];return r===void 0?this.#e[e]=[n]:r.includes(n)||r.push(n),()=>{this.removeListener(e,n)}}emit(e,n){const r=this.#e[e];if(r!==void 0)if(r.length===1)r[0].call(null,n);else{let i=!1,s=null;const a=Array.from(r);for(let u=0;u<a.length;u++){const c=a[u];try{c.call(null,n)}catch(d){s===null&&(i=!0,s=d)}}if(i)throw s}}removeAllListeners(){this.#e={}}removeListener(e,n){const r=this.#e[e];if(r!==void 0){const i=r.indexOf(n);i>=0&&r.splice(i,1)}}},yc={cursorFlags:0,state:"inactive"};const u1=new bz;function hu(){return yc}function hq(t){return u1.addListener("change",t)}function pq(t){const e=yc,n={...yc};n.cursorFlags=t,yc=n,u1.emit("change",{prev:e,next:n})}function vc(t){const e=yc;yc=t,u1.emit("change",{prev:e,next:t})}const gq=t=>t,db=()=>{},xz=1,Sz=2,wz=4,Cz=8,cO=3,fO=12;let Xp;function dO(){return Xp===void 0&&(Xp=!1,typeof window<"u"&&(window.navigator.userAgent.includes("Chrome")||window.navigator.userAgent.includes("Firefox"))&&(Xp=!0)),Xp}function mq({cursorFlags:t,groups:e,state:n}){let r=0,i=0;switch(n){case"active":case"hover":e.forEach(s=>{if(!s.mutableState.disableCursor)switch(s.orientation){case"horizontal":{r++;break}case"vertical":{i++;break}}})}if(!(r===0&&i===0)){switch(n){case"active":{if(t&&dO()){const s=(t&xz)!==0,a=(t&Sz)!==0,u=(t&wz)!==0,c=(t&Cz)!==0;if(s)return u?"se-resize":c?"ne-resize":"e-resize";if(a)return u?"sw-resize":c?"nw-resize":"w-resize";if(u)return"s-resize";if(c)return"n-resize"}break}}return dO()?r>0&&i>0?"move":r>0?"ew-resize":"ns-resize":r>0&&i>0?"grab":r>0?"col-resize":"row-resize"}}const hO=new WeakMap;function c1(t){if(t.defaultView===null||t.defaultView===void 0)return;let{prevStyle:e,styleSheet:n}=hO.get(t)??{};n===void 0&&(n=new t.defaultView.CSSStyleSheet,t.adoptedStyleSheets&&(Object.isExtensible(t.adoptedStyleSheets)?t.adoptedStyleSheets.push(n):t.adoptedStyleSheets=[...t.adoptedStyleSheets,n]));const r=hu();switch(r.state){case"active":case"hover":{const i=mq({cursorFlags:r.cursorFlags,groups:r.hitRegions.map(a=>a.group),state:r.state}),s=`*, *:hover {cursor: ${i} !important; }`;if(e===s)return;e=s,i?n.cssRules.length===0?n.insertRule(s):n.replaceSync(s):n.cssRules.length===1&&n.deleteRule(0);break}case"inactive":{e=void 0,n.cssRules.length===1&&n.deleteRule(0);break}}hO.set(t,{prevStyle:e,styleSheet:n})}let ms=new Map;const Rz=new bz;function yq(t){ms=new Map(ms),ms.delete(t)}function pO(t,e){for(const[n]of ms)if(n.id===t)return n}function aa(t,e){for(const[n,r]of ms)if(n.id===t)return r;if(e)throw Error(`Could not find data for Group with id ${t}`)}function Cu(){return ms}function f1(t,e){return Rz.addListener("groupChange",n=>{n.group.id===t&&e(n)})}function al(t,e,n){const r=ms.get(t);ms=new Map(ms),ms.set(t,e),Rz.emit("groupChange",{group:t,isUserInteraction:n?.isUserInteraction===!0,prev:r,next:e})}function Tz(t){const e=hu();let n=!1;return e.state==="active"&&(vc({cursorFlags:0,state:"inactive"}),e.hitRegions.length>0&&(c1(t),n=!0,e.hitRegions.forEach(r=>{const i=aa(r.group.id,!0);al(r.group,i,{isUserInteraction:!0})}))),n}function gO(t){t.defaultPrevented||Tz(t.currentTarget)}function vq(t,e,n){let r,i={x:1/0,y:1/0};for(const s of e){const a=yz(n,s.rect);switch(t){case"horizontal":{a.x<=i.x&&(r=s,i=a);break}case"vertical":{a.y<=i.y&&(r=s,i=a);break}}}return r?{distance:i,hitRegion:r}:void 0}function bq(t){return t!==null&&typeof t=="object"&&"nodeType"in t&&t.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function xq(t,e){if(t===e)throw new Error("Cannot compare node with itself");const n={a:vO(t),b:vO(e)};let r;for(;n.a.at(-1)===n.b.at(-1);)r=n.a.pop(),n.b.pop();wn(r,"Stacking order can only be calculated for elements with a common ancestor");const i={a:yO(mO(n.a)),b:yO(mO(n.b))};if(i.a===i.b){const s=r.childNodes,a={a:n.a.at(-1),b:n.b.at(-1)};let u=s.length;for(;u--;){const c=s[u];if(c===a.a)return 1;if(c===a.b)return-1}}return Math.sign(i.a-i.b)}const Sq=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function wq(t){const e=getComputedStyle(Ez(t)??t).display;return e==="flex"||e==="inline-flex"}function Cq(t){const e=getComputedStyle(t);return!!(e.position==="fixed"||e.zIndex!=="auto"&&(e.position!=="static"||wq(t))||+e.opacity<1||"transform"in e&&e.transform!=="none"||"webkitTransform"in e&&e.webkitTransform!=="none"||"mixBlendMode"in e&&e.mixBlendMode!=="normal"||"filter"in e&&e.filter!=="none"||"webkitFilter"in e&&e.webkitFilter!=="none"||"isolation"in e&&e.isolation==="isolate"||Sq.test(e.willChange)||e.webkitOverflowScrolling==="touch")}function mO(t){let e=t.length;for(;e--;){const n=t[e];if(wn(n,"Missing node"),Cq(n))return n}return null}function yO(t){return t&&Number(getComputedStyle(t).zIndex)||0}function vO(t){const e=[];for(;t;)e.push(t),t=Ez(t);return e}function Ez(t){const{parentNode:e}=t;return bq(e)?e.host:e}function Rq(t,e){return t.x<e.x+e.width&&t.x+t.width>e.x&&t.y<e.y+e.height&&t.y+t.height>e.y}function Tq({groupElement:t,hitRegion:e,pointerEventTarget:n}){if(!mz(n)||n.contains(t)||t.contains(n))return!0;if(xq(n,t)>0){let r=n;for(;r;){if(r.contains(t))return!0;if(Rq(r.getBoundingClientRect(),e))return!1;r=r.parentElement}}return!0}function d1(t,e){const n=[];return e.forEach((r,i)=>{if(i.disabled)return;const s=vz(i),a=vq(i.orientation,s,{x:t.clientX,y:t.clientY});a&&a.distance.x<=0&&a.distance.y<=0&&Tq({groupElement:i.element,hitRegion:a.hitRegion.rect,pointerEventTarget:t.target})&&n.push(a.hitRegion)}),n}function Eq(t,e){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!=e[n])return!1;return!0}function Kr(t,e,n=0){return Math.abs(li(t)-li(e))<=n}function us(t,e){return Kr(t,e)?0:t>e?1:-1}function fc({overrideDisabledPanels:t,panelConstraints:e,prevSize:n,size:r}){const{collapsedSize:i=0,collapsible:s,disabled:a,maxSize:u=100,minSize:c=0}=e;if(a&&!t)return n;if(us(r,c)<0)if(s){const d=(i+c)/2;us(r,d)<0?r=i:r=c}else r=c;return r=Math.min(u,r),r=li(r),r}function zd({delta:t,initialLayout:e,panelConstraints:n,pivotIndices:r,prevLayout:i,trigger:s}){if(Kr(t,0))return e;const a=s==="imperative-api",u=Object.values(e),c=Object.values(i),d=[...u],[h,g]=r;wn(h!=null,"Invalid first pivot index"),wn(g!=null,"Invalid second pivot index");let m=0;switch(s){case"keyboard":{{const x=t<0?g:h,w=n[x];wn(w,`Panel constraints not found for index ${x}`);const{collapsedSize:C=0,collapsible:T,minSize:E=0}=w;if(T){const M=u[x];if(wn(M!=null,`Previous layout not found for panel index ${x}`),Kr(M,C)){const k=E-M;us(k,Math.abs(t))>0&&(t=t<0?0-k:k)}}}{const x=t<0?h:g,w=n[x];wn(w,`No panel constraints found for index ${x}`);const{collapsedSize:C=0,collapsible:T,minSize:E=0}=w;if(T){const M=u[x];if(wn(M!=null,`Previous layout not found for panel index ${x}`),Kr(M,E)){const k=M-C;us(k,Math.abs(t))>0&&(t=t<0?0-k:k)}}}break}default:{const x=t<0?g:h,w=n[x];wn(w,`Panel constraints not found for index ${x}`);const C=u[x],{collapsible:T,collapsedSize:E,minSize:M}=w;if(T&&us(C,M)<0)if(t>0){const k=M-E,P=k/2,A=C+t;us(A,M)<0&&(t=us(t,P)<=0?0:k)}else{const k=M-E,P=100-k/2,A=C-t;us(A,M)<0&&(t=us(100+t,P)>0?0:-k)}break}}{const x=t<0?1:-1;let w=t<0?g:h,C=0;for(;;){const E=u[w];wn(E!=null,`Previous layout not found for panel index ${w}`);const M=fc({overrideDisabledPanels:a,panelConstraints:n[w],prevSize:E,size:100})-E;if(C+=M,w+=x,w<0||w>=n.length)break}const T=Math.min(Math.abs(t),Math.abs(C));t=t<0?0-T:T}{let x=t<0?h:g;for(;x>=0&&x<n.length;){const w=Math.abs(t)-Math.abs(m),C=u[x];wn(C!=null,`Previous layout not found for panel index ${x}`);const T=C-w,E=fc({overrideDisabledPanels:a,panelConstraints:n[x],prevSize:C,size:T});if(!Kr(C,E)&&(m+=C-E,d[x]=E,m.toFixed(3).localeCompare(Math.abs(t).toFixed(3),void 0,{numeric:!0})>=0))break;t<0?x--:x++}}if(Eq(c,d))return i;{const x=t<0?g:h,w=u[x];wn(w!=null,`Previous layout not found for panel index ${x}`);const C=w+m,T=fc({overrideDisabledPanels:a,panelConstraints:n[x],prevSize:w,size:C});if(d[x]=T,!Kr(T,C)){let E=C-T,M=t<0?g:h;for(;M>=0&&M<n.length;){const k=d[M];wn(k!=null,`Previous layout not found for panel index ${M}`);const P=k+E,A=fc({overrideDisabledPanels:a,panelConstraints:n[M],prevSize:k,size:P});if(Kr(k,A)||(E-=A-k,d[M]=A),Kr(E,0))break;t>0?M--:M++}}}const y=Object.values(d).reduce((x,w)=>w+x,0);if(!Kr(y,100,.1))return i;const b=Object.keys(i);return d.reduce((x,w,C)=>(x[b[C]]=w,x),{})}function pu(t,e){if(Object.keys(t).length!==Object.keys(e).length)return!1;for(const n in t)if(e[n]===void 0||us(t[n],e[n])!==0)return!1;return!0}function gu({layout:t,panelConstraints:e}){const n=Object.values(t),r=[...n],i=r.reduce((u,c)=>u+c,0);if(r.length!==e.length)throw Error(`Invalid ${e.length} panel layout: ${r.map(u=>`${u}%`).join(", ")}`);if(!Kr(i,100)&&r.length>0)for(let u=0;u<e.length;u++){const c=r[u];wn(c!=null,`No layout data found for index ${u}`);const d=100/i*c;r[u]=d}let s=0;for(let u=0;u<e.length;u++){const c=n[u];wn(c!=null,`No layout data found for index ${u}`);const d=r[u];wn(d!=null,`No layout data found for index ${u}`);const h=fc({overrideDisabledPanels:!0,panelConstraints:e[u],prevSize:c,size:d});d!=h&&(s+=d-h,r[u]=h)}if(!Kr(s,0))for(let u=0;u<e.length;u++){const c=r[u];wn(c!=null,`No layout data found for index ${u}`);const d=c+s,h=fc({overrideDisabledPanels:!0,panelConstraints:e[u],prevSize:c,size:d});if(c!==h&&(s-=h-c,r[u]=h,Kr(s,0)))break}const a=Object.keys(t);return r.reduce((u,c,d)=>(u[a[d]]=c,u),{})}function Mz({groupId:t,panelId:e}){const n=()=>{const c=Cu();for(const[d,{defaultLayoutDeferred:h,derivedPanelConstraints:g,layout:m,groupSize:y,separatorToPanels:b}]of c)if(d.id===t)return{defaultLayoutDeferred:h,derivedPanelConstraints:g,group:d,groupSize:y,layout:m,separatorToPanels:b};throw Error(`Group ${t} not found`)},r=()=>{const c=n().derivedPanelConstraints.find(d=>d.panelId===e);if(c!==void 0)return c;throw Error(`Panel constraints not found for Panel ${e}`)},i=()=>{const c=n().group.panels.find(d=>d.id===e);if(c!==void 0)return c;throw Error(`Layout not found for Panel ${e}`)},s=()=>{const c=n().layout[e];if(c!==void 0)return c;throw Error(`Layout not found for Panel ${e}`)},a=({nextSize:c,panels:d,prevLayout:h,derivedPanelConstraints:g})=>{const m=s(),y=d.findIndex(w=>w.id===e),b=y===0,x=y===d.length-1;if(x&&c<m&&(b||d.slice(0,y).every((w,C)=>{const T=g[C];return T?.collapsible&&Kr(T.collapsedSize,h[T.panelId])}))){const w=d.slice(0,y).reduce((C,T)=>C+h[T.id],0);return{...h,[e]:li(100-w)}}return zd({delta:x?m-c:c-m,initialLayout:h,panelConstraints:g,pivotIndices:x?[y-1,y]:[y,y+1],prevLayout:h,trigger:"imperative-api"})},u=c=>{const d=s();if(c===d)return;const{defaultLayoutDeferred:h,derivedPanelConstraints:g,group:m,groupSize:y,layout:b,separatorToPanels:x}=n(),w=a({nextSize:c,panels:m.panels,prevLayout:b,derivedPanelConstraints:g}),C=gu({layout:w,panelConstraints:g});pu(b,C)||al(m,{defaultLayoutDeferred:h,derivedPanelConstraints:g,groupSize:y,layout:C,separatorToPanels:x})};return{collapse:()=>{const{collapsible:c,collapsedSize:d}=r(),{mutableValues:h}=i(),g=s();c&&g!==d&&(h.expandToSize=g,u(d))},expand:()=>{const{collapsible:c,collapsedSize:d,minSize:h}=r(),{mutableValues:g}=i(),m=s();if(c&&m===d){let y=g.expandToSize??h;y===0&&(y=1),u(y)}},getSize:()=>{const{group:c}=n(),d=s(),{element:h}=i(),g=c.orientation==="horizontal"?h.offsetWidth:h.offsetHeight;return{asPercentage:d,inPixels:g}},isCollapsed:()=>{const{collapsible:c,collapsedSize:d}=r(),h=s();return c&&Kr(d,h)},resize:c=>{const{group:d}=n(),{element:h}=i(),g=Pc({group:d}),m=od({groupSize:g,panelElement:h,styleProp:c}),y=li(m/g*100);u(y)}}}function bO(t){if(t.defaultPrevented)return;const e=Cu();d1(t,e).forEach(n=>{if(n.separator&&!n.separator.disableDoubleClick){const r=n.panels.find(i=>i.panelConstraints.defaultSize!==void 0);if(r){const i=r.panelConstraints.defaultSize,s=Mz({groupId:n.group.id,panelId:r.id});s&&i!==void 0&&(s.resize(i),t.preventDefault())}}})}function Pg(t){const e=Cu();for(const[n]of e)if(n.separators.some(r=>r.element===t))return n;throw Error("Could not find parent Group for separator element")}function Az({groupId:t}){const e=()=>{const n=Cu();for(const[r,i]of n)if(r.id===t)return{group:r,...i};throw Error(`Could not find Group with id "${t}"`)};return{getLayout(){const{defaultLayoutDeferred:n,layout:r}=e();return n?{}:r},setLayout(n){const{defaultLayoutDeferred:r,derivedPanelConstraints:i,group:s,groupSize:a,layout:u,separatorToPanels:c}=e(),d=gu({layout:n,panelConstraints:i});return r?u:(pu(u,d)||al(s,{defaultLayoutDeferred:r,derivedPanelConstraints:i,groupSize:a,layout:d,separatorToPanels:c}),d)}}}function Xa(t,e){const n=Pg(t),r=aa(n.id,!0),i=n.separators.find(h=>h.element===t);wn(i,"Matching separator not found");const s=r.separatorToPanels.get(i);wn(s,"Matching panels not found");const a=s.map(h=>n.panels.indexOf(h)),u=Az({groupId:n.id}).getLayout(),c=zd({delta:e,initialLayout:u,panelConstraints:r.derivedPanelConstraints,pivotIndices:a,prevLayout:u,trigger:"keyboard"}),d=gu({layout:c,panelConstraints:r.derivedPanelConstraints});pu(u,d)||al(n,{defaultLayoutDeferred:r.defaultLayoutDeferred,derivedPanelConstraints:r.derivedPanelConstraints,groupSize:r.groupSize,layout:d,separatorToPanels:r.separatorToPanels},{isUserInteraction:!0})}function xO(t){if(t.defaultPrevented)return;const e=t.currentTarget,n=Pg(e);if(!n.disabled)switch(t.key){case"ArrowDown":{t.preventDefault(),n.orientation==="vertical"&&Xa(e,5);break}case"ArrowLeft":{t.preventDefault(),n.orientation==="horizontal"&&Xa(e,-5);break}case"ArrowRight":{t.preventDefault(),n.orientation==="horizontal"&&Xa(e,5);break}case"ArrowUp":{t.preventDefault(),n.orientation==="vertical"&&Xa(e,-5);break}case"End":{t.preventDefault(),Xa(e,100);break}case"Enter":{t.preventDefault();const r=Pg(e),i=aa(r.id,!0),{derivedPanelConstraints:s,layout:a,separatorToPanels:u}=i,c=r.separators.find(m=>m.element===e);wn(c,"Matching separator not found");const d=u.get(c);wn(d,"Matching panels not found");const h=d[0],g=s.find(m=>m.panelId===h.id);if(wn(g,"Panel metadata not found"),g.collapsible){const m=a[h.id],y=g.collapsedSize===m?r.mutableState.expandedPanelSizes[h.id]??g.minSize:g.collapsedSize;Xa(e,y-m)}break}case"F6":{t.preventDefault();const r=Pg(e).separators.map(a=>a.element),i=Array.from(r).findIndex(a=>a===t.currentTarget);wn(i!==null,"Index not found");const s=t.shiftKey?i>0?i-1:r.length-1:i+1<r.length?i+1:0;r[s].focus({preventScroll:!0});break}case"Home":{t.preventDefault(),Xa(e,-100);break}}}function SO(t){if(t.defaultPrevented||t.pointerType==="mouse"&&t.button>0)return;const e=Cu(),n=d1(t,e),r=new Map;let i=!1;n.forEach(s=>{s.separator&&(i||(i=!0,s.separator.element.focus({focusVisible:!1,preventScroll:!0})));const a=e.get(s.group);a&&r.set(s.group,a.layout)}),vc({cursorFlags:0,hitRegions:n,initialLayoutMap:r,pointerDownAtPoint:{x:t.clientX,y:t.clientY},state:"active"}),n.length&&t.preventDefault()}function Oz({document:t,event:e,hitRegions:n,initialLayoutMap:r,mountedGroups:i,pointerDownAtPoint:s,prevCursorFlags:a}){let u=0;n.forEach(d=>{const{group:h,groupSize:g}=d,{orientation:m,panels:y}=h,{disableCursor:b}=h.mutableState;let x=0;s?m==="horizontal"?x=(e.clientX-s.x)/g*100:x=(e.clientY-s.y)/g*100:m==="horizontal"?x=e.clientX<0?-100:100:x=e.clientY<0?-100:100;const w=r.get(h),C=i.get(h);if(!w||!C)return;const{defaultLayoutDeferred:T,derivedPanelConstraints:E,groupSize:M,layout:k,separatorToPanels:P}=C;if(E&&k&&P){const A=zd({delta:x,initialLayout:w,panelConstraints:E,pivotIndices:d.panels.map(I=>y.indexOf(I)),prevLayout:k,trigger:"mouse-or-touch"});if(pu(A,k)){if(x!==0&&!b)switch(m){case"horizontal":{u|=x<0?xz:Sz;break}case"vertical":{u|=x<0?wz:Cz;break}}}else al(d.group,{defaultLayoutDeferred:T,derivedPanelConstraints:E,groupSize:M,layout:A,separatorToPanels:P})}});let c=0;e.movementX===0?c|=a&cO:c|=u&cO,e.movementY===0?c|=a&fO:c|=u&fO,pq(c),c1(t)}function wO(t){const e=Cu(),n=hu();n.state==="active"&&Oz({document:t.currentTarget,event:t,hitRegions:n.hitRegions,initialLayoutMap:n.initialLayoutMap,mountedGroups:e,prevCursorFlags:n.cursorFlags})}function CO(t){if(t.defaultPrevented)return;const e=hu(),n=Cu();switch(e.state){case"active":{if(t.buttons===0){vc({cursorFlags:0,state:"inactive"}),e.hitRegions.forEach(r=>{const i=aa(r.group.id,!0);al(r.group,i,{isUserInteraction:!0})});return}for(const r of e.hitRegions)if(r.separator){const{element:i}=r.separator;i.hasPointerCapture?.(t.pointerId)||i.setPointerCapture?.(t.pointerId)}Oz({document:t.currentTarget,event:t,hitRegions:e.hitRegions,initialLayoutMap:e.initialLayoutMap,mountedGroups:n,pointerDownAtPoint:e.pointerDownAtPoint,prevCursorFlags:e.cursorFlags});break}default:{const r=d1(t,n);r.length===0?e.state!=="inactive"&&vc({cursorFlags:0,state:"inactive"}):vc({cursorFlags:0,hitRegions:r,state:"hover"}),c1(t.currentTarget);break}}}function RO(t){t.relatedTarget instanceof HTMLIFrameElement&&hu().state==="hover"&&vc({cursorFlags:0,state:"inactive"})}function TO(t){t.defaultPrevented||t.pointerType==="mouse"&&t.button>0||Tz(t.currentTarget)&&t.preventDefault()}function EO(t){let e=0,n=0;const r={};for(const s of t)if(s.defaultSize!==void 0){e++;const a=li(s.defaultSize);n+=a,r[s.panelId]=a}else r[s.panelId]=void 0;const i=t.length-e;if(i!==0){const s=li((100-n)/i);for(const a of t)a.defaultSize===void 0&&(r[a.panelId]=s)}return r}function Mq(t,e,n){if(!n[0])return;const r=t.panels.find(c=>c.element===e);if(!r||!r.onResize)return;const i=Pc({group:t}),s=t.orientation==="horizontal"?r.element.offsetWidth:r.element.offsetHeight,a=r.mutableValues.prevSize,u={asPercentage:li(s/i*100),inPixels:s};r.mutableValues.prevSize=u,r.onResize(u,r.id,a)}function Aq(t,e){if(Object.keys(t).length!==Object.keys(e).length)return!1;for(const n in t)if(t[n]!==e[n])return!1;return!0}function Oq({group:t,nextGroupSize:e,prevGroupSize:n,prevLayout:r}){if(n<=0||e<=0||n===e)return r;let i=0,s=0,a=!1;const u=new Map,c=[];for(const g of t.panels){const m=r[g.id]??0;if(g.panelConstraints.groupResizeBehavior==="preserve-pixel-size"){a=!0;const y=m/100*n,b=li(y/e*100);u.set(g.id,b),i+=b}else c.push(g.id),s+=m}if(!a||c.length===0)return r;const d=100-i,h={...r};if(u.forEach((g,m)=>{h[m]=g}),s>0)for(const g of c){const m=r[g]??0;h[g]=li(m/s*d)}else{const g=li(d/c.length);for(const m of c)h[m]=g}return h}function kq(t,e){const n=t.map(i=>i.id),r=Object.keys(e);if(n.length!==r.length)return!1;for(const i of n)if(!r.includes(i))return!1;return!0}const lc=new Map;function Iq(t){let e=!0;wn(t.element.ownerDocument.defaultView,"Cannot register an unmounted Group");const n=t.element.ownerDocument.defaultView.ResizeObserver,r=new Set,i=new Set,s=new n(b=>{for(const x of b){const{borderBoxSize:w,target:C}=x;if(C===t.element){if(e){const T=Pc({group:t});if(T===0)return;const E=aa(t.id);if(!E)return;const M=Qx(t),k=E.defaultLayoutDeferred?EO(M):E.layout,P=Oq({group:t,nextGroupSize:T,prevGroupSize:E.groupSize,prevLayout:k}),A=gu({layout:P,panelConstraints:M});if(!E.defaultLayoutDeferred&&pu(E.layout,A)&&Aq(E.derivedPanelConstraints,M)&&E.groupSize===T)return;al(t,{defaultLayoutDeferred:!1,derivedPanelConstraints:M,groupSize:T,layout:A,separatorToPanels:E.separatorToPanels})}}else Mq(t,C,w)}});s.observe(t.element),t.panels.forEach(b=>{wn(!r.has(b.id),`Panel ids must be unique; id "${b.id}" was used more than once`),r.add(b.id),b.onResize&&s.observe(b.element)});const a=Pc({group:t}),u=Qx(t),c=t.panels.map(({id:b})=>b).join(",");let d=t.mutableState.defaultLayout;d&&(kq(t.panels,d)||(d=void 0));const h=t.mutableState.layouts[c]??d??EO(u),g=gu({layout:h,panelConstraints:u}),m=t.element.ownerDocument;lc.set(m,(lc.get(m)??0)+1);const y=new Map;return vz(t).forEach(b=>{b.separator&&y.set(b.separator,b.panels)}),al(t,{defaultLayoutDeferred:a===0,derivedPanelConstraints:u,groupSize:a,layout:g,separatorToPanels:y}),t.separators.forEach(b=>{wn(!i.has(b.id),`Separator ids must be unique; id "${b.id}" was used more than once`),i.add(b.id),b.element.addEventListener("keydown",xO)}),lc.get(m)===1&&(m.addEventListener("contextmenu",gO,!0),m.addEventListener("dblclick",bO,!0),m.addEventListener("pointerdown",SO,!0),m.addEventListener("pointerleave",wO),m.addEventListener("pointermove",CO),m.addEventListener("pointerout",RO),m.addEventListener("pointerup",TO,!0)),function(){e=!1,lc.set(m,Math.max(0,(lc.get(m)??0)-1)),yq(t),t.separators.forEach(b=>{b.element.removeEventListener("keydown",xO)}),lc.get(m)||(m.removeEventListener("contextmenu",gO,!0),m.removeEventListener("dblclick",bO,!0),m.removeEventListener("pointerdown",SO,!0),m.removeEventListener("pointerleave",wO),m.removeEventListener("pointermove",CO),m.removeEventListener("pointerout",RO),m.removeEventListener("pointerup",TO,!0)),s.disconnect()}}function Dq(){const[t,e]=R.useState({}),n=R.useCallback(()=>e({}),[]);return[t,n]}function h1(t){const e=R.useId();return`${t??e}`}const Ru=typeof window<"u"?R.useLayoutEffect:R.useEffect;function pd(t){const e=R.useRef(t);return Ru(()=>{e.current=t},[t]),R.useCallback((...n)=>e.current?.(...n),[e])}function p1(...t){return pd(e=>{t.forEach(n=>{if(n)switch(typeof n){case"function":{n(e);break}case"object":{n.current=e;break}}})})}function g1(t){const e=R.useRef({...t});return Ru(()=>{for(const n in t)e.current[n]=t[n]},[t]),e.current}const kz=R.createContext(null);function Pq(t,e){const n=R.useRef({getLayout:()=>({}),setLayout:gq});R.useImperativeHandle(e,()=>n.current,[]),Ru(()=>{Object.assign(n.current,Az({groupId:t}))})}function Iz({children:t,className:e,defaultLayout:n,disableCursor:r,disabled:i,elementRef:s,groupRef:a,id:u,onLayoutChange:c,onLayoutChanged:d,orientation:h="horizontal",resizeTargetMinimumSize:g={coarse:20,fine:10},style:m,...y}){const b=R.useRef({onLayoutChange:{},onLayoutChanged:{}}),x=pd(N=>{pu(b.current.onLayoutChange,N)||(b.current.onLayoutChange=N,c?.(N))}),w=pd((N,_)=>{pu(b.current.onLayoutChanged,N)||(b.current.onLayoutChanged=N,d?.(N,{isUserInteraction:_}))}),C=h1(u),T=R.useRef(null),[E,M]=Dq(),k=R.useRef({lastExpandedPanelSizes:{},layouts:{},panels:[],resizeTargetMinimumSize:g,separators:[]}),P=p1(T,s);Pq(C,a);const A=pd((N,_)=>{const H=hu(),F=pO(N),G=aa(N);if(G){let B=!1;return H.state==="active"&&(B=H.hitRegions.some(q=>q.group===F)),{flexGrow:G.layout[_]??1,pointerEvents:B?"none":void 0}}if(n?.[_])return{flexGrow:n?.[_]}}),I=g1({defaultLayout:n,disableCursor:r}),L=R.useMemo(()=>({get disableCursor(){return!!I.disableCursor},getPanelStyles:A,id:C,orientation:h,registerPanel:N=>{const _=k.current;return _.panels=Zx(h,[..._.panels,N]),M(),()=>{_.panels=_.panels.filter(H=>H!==N),M()}},registerSeparator:N=>{const _=k.current;return _.separators=Zx(h,[..._.separators,N]),M(),()=>{_.separators=_.separators.filter(H=>H!==N),M()}},updatePanelProps:(N,{disabled:_})=>{const H=k.current.panels.find(B=>B.id===N);H&&(H.panelConstraints.disabled=_);const F=pO(C),G=aa(C);F&&G&&al(F,{...G,derivedPanelConstraints:Qx(F)})},updateSeparatorProps:(N,{disabled:_,disableDoubleClick:H})=>{const F=k.current.separators.find(G=>G.id===N);F&&(F.disabled=_,F.disableDoubleClick=H)}}),[A,C,M,h,I]),j=R.useRef(null);return Ru(()=>{const N=T.current;if(N===null)return;const _=k.current;let H;if(I.defaultLayout!==void 0&&Object.keys(I.defaultLayout).length===_.panels.length){H={};for(const Z of _.panels){const z=I.defaultLayout[Z.id];z!==void 0&&(H[Z.id]=z)}}const F={disabled:!!i,element:N,id:C,mutableState:{defaultLayout:H,disableCursor:!!I.disableCursor,expandedPanelSizes:k.current.lastExpandedPanelSizes,layouts:k.current.layouts},orientation:h,panels:_.panels,resizeTargetMinimumSize:_.resizeTargetMinimumSize,separators:_.separators};j.current=F;const G=Iq(F),{defaultLayoutDeferred:B,derivedPanelConstraints:q,layout:U}=aa(F.id,!0);!B&&q.length>0&&(x(U),w(U,!1));const X=f1(C,Z=>{const{defaultLayoutDeferred:z,derivedPanelConstraints:$,layout:W}=Z.next;if(z||$.length===0)return;const K=F.panels.map(({id:ee})=>ee).join(",");F.mutableState.layouts[K]=W,$.forEach(ee=>{if(ee.collapsible){const{layout:ae}=Z.prev??{};if(ae){const Y=Kr(ee.collapsedSize,W[ee.panelId]),se=Kr(ee.collapsedSize,ae[ee.panelId]);Y&&!se&&(F.mutableState.expandedPanelSizes[ee.panelId]=ae[ee.panelId])}}});const ie=hu().state!=="active";x(W),ie&&w(W,Z.isUserInteraction)});return()=>{j.current=null,G(),X()}},[i,C,w,x,h,E,I]),R.useEffect(()=>{const N=j.current;N&&(N.mutableState.defaultLayout=n,N.mutableState.disableCursor=!!r)}),O.jsx(kz.Provider,{value:L,children:O.jsx("div",{...y,className:e,"data-group":!0,"data-testid":C,id:C,ref:P,style:{height:"100%",width:"100%",overflow:"hidden",...m,display:"flex",flexDirection:h==="horizontal"?"row":"column",flexWrap:"nowrap",touchAction:h==="horizontal"?"pan-y":"pan-x"},children:t})})}Iz.displayName="Group";function m1(){const t=R.useContext(kz);return wn(t,"Group Context not found; did you render a Panel or Separator outside of a Group?"),t}function zq(t,e){const{id:n}=m1(),r=R.useRef({collapse:db,expand:db,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:db});R.useImperativeHandle(e,()=>r.current,[]),Ru(()=>{Object.assign(r.current,Mz({groupId:n,panelId:t}))})}function Dz({children:t,className:e,collapsedSize:n="0%",collapsible:r=!1,defaultSize:i,disabled:s,elementRef:a,groupResizeBehavior:u="preserve-relative-size",id:c,maxSize:d="100%",minSize:h="0%",onResize:g,panelRef:m,style:y,...b}){const x=!!c,w=h1(c),C=g1({disabled:s}),T=R.useRef(null),E=p1(T,a),{getPanelStyles:M,id:k,orientation:P,registerPanel:A,updatePanelProps:I}=m1(),L=g!==null,j=pd((F,G,B)=>{g?.(F,c,B)});Ru(()=>{const F=T.current;if(F!==null){const G={element:F,id:w,idIsStable:x,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:L?j:void 0,panelConstraints:{groupResizeBehavior:u,collapsedSize:n,collapsible:r,defaultSize:i,disabled:C.disabled,maxSize:d,minSize:h}};return A(G)}},[u,n,r,i,L,w,x,d,h,j,A,C]),R.useEffect(()=>{I(w,{disabled:s})},[s,w,I]),zq(w,m);const N=()=>{const F=M(k,w);if(F)return JSON.stringify(F)},_=R.useSyncExternalStore(F=>f1(k,F),N,N);let H;return _?H=JSON.parse(_):i!==void 0?H={flexGrow:void 0,flexShrink:void 0,flexBasis:i}:H={flexGrow:1},O.jsx("div",{...b,"data-disabled":s||void 0,"data-panel":!0,"data-testid":w,id:w,ref:E,style:{...Nq,display:"flex",flexBasis:0,flexShrink:1,overflow:"visible",...H},children:O.jsx("div",{className:e,style:{maxHeight:"100%",maxWidth:"100%",flexGrow:1,overflow:"auto",...y,touchAction:P==="horizontal"?"pan-y":"pan-x"},children:t})})}Dz.displayName="Panel";const Nq={minHeight:0,maxHeight:"100%",height:"auto",minWidth:0,maxWidth:"100%",width:"auto",border:"none",borderWidth:0,padding:0,margin:0};function Lq({layout:t,panelConstraints:e,panelId:n,panelIndex:r}){let i,s;const a=t[n],u=e.find(c=>c.panelId===n);if(u){const c=u.maxSize,d=u.collapsible?u.collapsedSize:u.minSize,h=[r,r+1];s=gu({layout:zd({delta:d-a,initialLayout:t,panelConstraints:e,pivotIndices:h,prevLayout:t}),panelConstraints:e})[n],i=gu({layout:zd({delta:c-a,initialLayout:t,panelConstraints:e,pivotIndices:h,prevLayout:t}),panelConstraints:e})[n]}return{valueControls:n,valueMax:i,valueMin:s,valueNow:a}}function Pz({children:t,className:e,disabled:n,disableDoubleClick:r,elementRef:i,id:s,style:a,...u}){const c=h1(s),d=g1({disabled:n,disableDoubleClick:r}),[h,g]=R.useState({}),[m,y]=R.useState("inactive"),[b,x]=R.useState(!1),w=R.useRef(null),C=p1(w,i),{disableCursor:T,id:E,orientation:M,registerSeparator:k,updateSeparatorProps:P}=m1(),A=M==="horizontal"?"vertical":"horizontal";Ru(()=>{const j=w.current;if(j!==null){const N={disabled:d.disabled,disableDoubleClick:d.disableDoubleClick,element:j,id:c},_=k(N),H=hq(G=>{y(G.next.state!=="inactive"&&G.next.hitRegions.some(B=>B.separator===N)?G.next.state:"inactive")}),F=f1(E,G=>{const{derivedPanelConstraints:B,layout:q,separatorToPanels:U}=G.next,X=U.get(N);if(X){const Z=X[0],z=X.indexOf(Z);g(Lq({layout:q,panelConstraints:B,panelId:Z.id,panelIndex:z}))}});return()=>{H(),F(),_()}}},[E,c,k,d]),R.useEffect(()=>{P(c,{disabled:n,disableDoubleClick:r})},[n,r,c,P]);let I;n&&!T&&(I="not-allowed");let L;return n?L="disabled":m==="active"?L="active":b?L="focus":L=m,O.jsx("div",{...u,"aria-controls":h.valueControls,"aria-disabled":n||void 0,"aria-orientation":A,"aria-valuemax":h.valueMax,"aria-valuemin":h.valueMin,"aria-valuenow":h.valueNow,children:t,className:e,"data-separator":L,"data-testid":c,id:c,onBlur:()=>x(!1),onFocus:()=>x(!0),ref:C,role:"separator",style:{flexBasis:"auto",cursor:I,...a,flexGrow:0,flexShrink:0,touchAction:"none"},tabIndex:n?void 0:0})}Pz.displayName="Separator";const zz=R.createContext(void 0);function pl(t){const e=R.useContext(zz);if(!t&&e===void 0)throw new Error(Jt(27));return e}const Bq=R.forwardRef(function(e,n){const{render:r,className:i,style:s,forceRender:a=!1,...u}=e,c=pl(),d=c.useState("open"),h=c.useState("nested"),g=c.useState("mounted"),m=c.useState("transitionStatus");return ot("div",e,{state:{open:d,transitionStatus:m},ref:[c.context.backdropRef,n],stateAttributesMapping:i1,props:[{role:"presentation",hidden:!g,style:{userSelect:"none",WebkitUserSelect:"none"}},u],enabled:a||!h})}),Nz=R.forwardRef(function(e,n){const{render:r,className:i,style:s,disabled:a=!1,nativeButton:u=!0,...c}=e,d=pl(),h=d.useState("open"),{getButtonProps:g,buttonRef:m}=yo({disabled:a,native:u}),y={disabled:a};function b(x){h&&d.setOpen(!1,$e(GD,x.nativeEvent))}return ot("button",e,{state:y,ref:[n,m],props:[{onClick:b},c,g]})}),jq=R.forwardRef(function(e,n){const{render:r,className:i,style:s,id:a,...u}=e,c=pl(),d=ei(a);return c.useSyncedValueWithCleanup("descriptionElementId",d),ot("p",e,{ref:n,props:[{id:d},u]})}),Lz=R.createContext(void 0);function Bz(){const t=R.useContext(Lz);if(t===void 0)throw new Error(Jt(26));return t}const jz={...lh,...Uo,nestedDialogOpen(t){return t?{"data-nested-dialog-open":""}:null}},_q=R.forwardRef(function(e,n){const{render:r,className:i,style:s,finalFocus:a,initialFocus:u,...c}=e,d=pl(),h=d.useState("descriptionElementId"),g=d.useState("disablePointerDismissal"),m=d.useState("floatingRootContext"),y=d.useState("popupProps"),b=d.useState("modal"),x=d.useState("mounted"),w=d.useState("nested"),C=d.useState("nestedOpenDialogCount"),T=d.useState("open"),E=d.useState("openMethod"),M=d.useState("titleElementId"),k=d.useState("transitionStatus"),P=d.useState("role"),A=m.useState("floatingId");Bz(),ui({open:T,ref:d.context.popupRef,onComplete(){T&&d.context.onOpenChangeComplete?.(!0)}});const I=u===void 0?w$(d.context.popupRef):u,L=C>0,j=d.useStateSetter("popupElement"),_=ot("div",e,{state:{open:T,nested:w,transitionStatus:k,nestedDialogOpen:L},props:[y,{id:A,"aria-labelledby":M,"aria-describedby":h,role:P,...oh,hidden:!x,onKeyDown(H){ey.has(H.key)&&H.stopPropagation()},style:{"--nested-dialogs":C}},c],ref:[n,d.context.popupRef,j],stateAttributesMapping:jz});return O.jsx($m,{context:m,openInteractionType:E,disabled:!x,closeOnFocusOut:!g,initialFocus:I,returnFocus:a,modal:b!==!1,restoreFocus:"popup",children:_})}),Hq=R.forwardRef(function(e,n){const{keepMounted:r=!1,...i}=e,s=pl(),a=s.useState("mounted"),u=s.useState("modal"),c=s.useState("open");return a||r?O.jsx(Lz.Provider,{value:r,children:O.jsxs(Um,{ref:n,...i,children:[a&&u===!0&&O.jsx(ty,{ref:s.context.internalBackdropRef,inert:Xc(!c)}),e.children]})}):null});function Vq({store:t,parentContext:e,isDrawer:n}){const r=t.useState("open"),i=t.useState("disablePointerDismissal"),s=t.useState("modal"),a=t.useState("popupElement"),u=t.useState("floatingRootContext"),[c,d]=R.useState(0),[h,g]=R.useState(0),m=c===0,y=ih(u,{outsidePressEvent(){return t.context.internalBackdropRef.current||t.context.backdropRef.current?"intentional":{mouse:s==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(b){if(!t.context.outsidePressEnabledRef.current||"button"in b&&b.button!==0)return!1;if("touches"in b){if(b.type==="touchend"){if(b.changedTouches.length!==1||b.touches.length!==0)return!1}else if(b.touches.length!==1)return!1}const x=mn(b);if(m&&!i){if(s){const w=t.context.internalBackdropRef.current,C=t.context.backdropRef.current;return w||C?w===x||C===x||Ge(x,a)&&!x?.hasAttribute("data-base-ui-portal"):!0}return!0}return!1},escapeKey:m});return lz(r&&s===!0,a),t.useContextCallback("onNestedDialogOpen",(b,x)=>{d(b),g(x)}),Ae(()=>(e?.onNestedDialogOpen&&(r?e.onNestedDialogOpen(c+1,h+(n?1:0)):e.onNestedDialogOpen(0,0)),()=>{e?.onNestedDialogOpen&&r&&e.onNestedDialogOpen(0,0)}),[n,r,c,h,e]),Xw(t,{activeTriggerProps:y.reference,inactiveTriggerProps:y.trigger,popupProps:y.floating,nestedOpenDialogCount:c,nestedOpenDrawerCount:h}),null}const Fq={...Jw,modal:t=>t.modal,nested:t=>t.nested,nestedOpenDialogCount:t=>t.nestedOpenDialogCount,nestedOpenDrawerCount:t=>t.nestedOpenDrawerCount,disablePointerDismissal:t=>t.disablePointerDismissal,openMethod:t=>t.openMethod,descriptionElementId:t=>t.descriptionElementId,titleElementId:t=>t.titleElementId,viewportElement:t=>t.viewportElement,role:t=>t.role};class Uq extends Kc{constructor(e,n,r){const i=new sh,s=$q(e,i,n,r);super(s,qq(i),Fq)}setOpen=(e,n)=>{if(n.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!e&&n.trigger==null&&this.state.activeTriggerId!=null&&(n.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(e,n),n.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,n);const r={open:e};Gw(r,e,n.trigger),this.update(r)}}function $q(t,e,n,r=!1){const i={...Qw(),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:"dialog",...t};return i.floatingRootContext=zP(e,n,r),i}function qq(t){return{popupRef:R.createRef(),backdropRef:R.createRef(),internalBackdropRef:R.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:t,onOpenChange:void 0,onOpenChangeComplete:void 0}}function Gq(t,e){const{children:n,open:r,defaultOpen:i=!1,onOpenChange:s,onOpenChangeComplete:a,disablePointerDismissal:u=!1,modal:c=!0,actionsRef:d,handle:h,triggerId:g,defaultTriggerId:m=null}=e,y=t==="drawer",b=c,x=u,w="dialog",C=pl(!0),T=C!=null,E={modal:b,disablePointerDismissal:x,nested:T,role:w},M=DP((j,N)=>new Uq({open:i,openProp:r,activeTriggerId:m,triggerIdProp:g,...E},j,N),!0);M.useControlledProp("openProp",r),M.useControlledProp("triggerIdProp",g),M.useSyncedValues(E),M.useContextCallback("onOpenChange",s),M.useContextCallback("onOpenChangeComplete",a);const k=M.useState("open"),P=M.useState("mounted"),A=M.useState("payload");T$(M,k),Kw(M);const{forceUnmount:I}=Yw(k,M);R.useImperativeHandle(d,()=>({unmount:I,close:()=>M.setOpen(!1,$e(Dw))}),[I,M]);const L=k||P;return O.jsxs(zz.Provider,{value:M,children:[h&&O.jsx(qw,{handle:h,store:M}),L&&O.jsx(Vq,{store:M,parentContext:C?.context,isDrawer:y}),typeof n=="function"?n({payload:A}):n]})}function Wq(t){return Gq("dialog",t)}const Kq=R.forwardRef(function(e,n){const{render:r,className:i,style:s,children:a,...u}=e,c=Bz(),d=pl(),h=d.useState("open"),g=d.useState("nested"),m=d.useState("transitionStatus"),y=d.useState("nestedOpenDialogCount"),b=d.useState("mounted"),x=d.useStateSetter("viewportElement"),w=y>0;return ot("div",e,{enabled:c||b,state:{open:h,nested:g,transitionStatus:m,nestedDialogOpen:w},ref:[n,x],stateAttributesMapping:jz,props:[{role:"presentation",hidden:!b,style:{pointerEvents:h?void 0:"none"},children:a},u]})}),Yq=R.forwardRef(function(e,n){const{render:r,className:i,style:s,id:a,...u}=e,c=pl(),d=ei(a);return c.useSyncedValueWithCleanup("titleElementId",d),ot("h2",e,{ref:n,props:[{id:d},u]})}),Xq=R.forwardRef(function(e,n){const{render:r,className:i,style:s,disabled:a=!1,nativeButton:u=!0,id:c,payload:d,handle:h,...g}=e,m=pl(!0),b=e1(h)??m;if(!b)throw new Error(Jt(79));const x=ei(c),w=b.useState("floatingRootContext"),C=b.useState("isOpenedByTrigger",x),T=b.useState("triggerPopupId",x),E=R.useRef(null),{registerTrigger:M,isMountedByThisTrigger:k}=Ww(x,E,b,{payload:d}),{getButtonProps:P,buttonRef:A}=yo({disabled:a,native:u}),I=qm(w),L=uz(()=>b.select("open"),_=>{b.set("openMethod",_)}),j={disabled:a,open:C},N=b.useState("triggerProps",k);return ot("button",e,{state:j,ref:[A,n,M,E],props:[I.reference,N,L,{[fP]:"",id:x,"aria-haspopup":"dialog","aria-expanded":C,"aria-controls":T},g,P],stateAttributesMapping:Ym})}),_z=R.createContext(void 0);function ry(){const t=R.useContext(_z);if(!t)throw new Error(Jt(73));return t}let MO=0;function Qq(t){return MO+=1,`${t}-${Math.random().toString(36).slice(2,6)}-${MO}`}function hb(t,e){if(typeof t=="string")return{description:t};if(typeof t=="function"){const n=t(e);return typeof n=="string"?{description:n}:n}return t}function pb(t){const e=new Map;let n=0,r=0;return t.forEach((i,s)=>{const a=i.transitionStatus==="ending";e.set(i.id,{value:i,domIndex:s,visibleIndex:a?-1:n,offsetY:r}),r+=i.height||0,a||(n+=1)}),e}function gb(t,e){let n=0;return t.map(r=>{if(r.transitionStatus==="ending")return r;const i=n>=e;return n+=1,r.limited===i?r:{...r,limited:i}})}const ts={toasts:t=>t.toasts,isEmpty:t=>t.toasts.length===0,toast:(t,e)=>t.toastMetadata.get(e)?.value,toastIndex:(t,e)=>t.toastMetadata.get(e)?.domIndex??-1,toastOffsetY:(t,e)=>t.toastMetadata.get(e)?.offsetY??0,toastVisibleIndex:(t,e)=>t.toastMetadata.get(e)?.visibleIndex??-1,focused:t=>t.focused,expanded:t=>t.hovering||t.focused,expandedOrOutOfFocus:t=>t.hovering||t.focused||!t.isWindowFocused,prevFocusElement:t=>t.prevFocusElement};class Zq extends Kc{timers=new Map;areTimersPaused=!1;constructor(e){super({...e,toastMetadata:pb(e.toasts)},{},ts)}setViewport=e=>{this.set("viewport",e)};syncProviderProps(e,n){const r=this.state.limit!==n;if(this.state.timeout===e&&!r)return;const i={timeout:e,limit:n};if(r){const s=gb(this.state.toasts,n);i.toasts=s,i.toastMetadata=pb(s)}this.update(i)}disposeEffect=()=>()=>{this.timers.forEach(e=>{e.timeout?.clear()}),this.timers.clear()};removeToast(e,n=!1){const r=ts.toastIndex(this.state,e);if(r===-1)return;const i=this.state.toasts[r];n||i?.onRemove?.();const s=[...this.state.toasts];s.splice(r,1),this.setToasts(s)}addToast=e=>{const{timeout:n,limit:r}=this.state,i=e.id||Qq("toast");if(e.id){const c=ts.toast(this.state,e.id);if(c)if(c.transitionStatus==="ending")this.removeToast(e.id,!0);else{const{id:d,transitionStatus:h,...g}=e;return this.updateToastInternal(e.id,g,!0,!0),e.id}}const s={...e,id:i,updateKey:0,transitionStatus:"starting"},a=[s,...this.state.toasts];this.setToasts(gb(a,r));const u=s.timeout??n;return s.type!=="loading"&&u>0&&this.scheduleTimer(i,u,()=>this.closeToast(i)),ts.expandedOrOutOfFocus(this.state)&&this.pauseTimers(),i};updateToast=(e,n)=>{this.updateToastInternal(e,n,!1,!0)};updateToastInternal=(e,n,r=!1,i=!1)=>{const{timeout:s,toasts:a}=this.state,u=ts.toast(this.state,e);if(!u||u.transitionStatus==="ending")return;const c={...u,...n,...i&&{updateKey:u.updateKey+1}};this.setToasts(a.map(w=>w.id===e?c:w));const d=c.timeout??s,h=u.timeout??s,g=Object.hasOwn(n,"timeout"),m=c.transitionStatus!=="ending"&&c.type!=="loading"&&d>0,y=this.timers.has(e),b=h!==d,x=u.type==="loading";if(!m&&y){this.clearTimer(e);return}m&&(!y||b||g||x||r)&&(this.clearTimer(e),this.scheduleTimer(e,d,()=>this.closeToast(e)),ts.expandedOrOutOfFocus(this.state)&&this.pauseTimers())};closeToast=e=>{const n=e===void 0,{limit:r,toasts:i}=this.state;let s;if(n)s=i,this.clearTimers();else{const c=ts.toast(this.state,e);if(!c)return;s=[c],this.clearTimer(e)}const a=i.map(c=>n||c.id===e?{...c,transitionStatus:"ending",height:0}:c),u=gb(a,r);this.setToasts(u,!u.some(c=>c.transitionStatus!=="ending")),s.forEach(c=>{c.transitionStatus!=="ending"&&c.onClose?.()}),this.handleFocusManagement(e)};promiseToast=(e,n)=>{const r=hb(n.loading),i=this.addToast({...r,type:"loading"}),s=e.then(a=>{const u=hb(n.success,a);return this.updateToast(i,{...u,type:"success",timeout:u.timeout}),a}).catch(a=>{const u=hb(n.error,a);return this.updateToast(i,{...u,type:"error",timeout:u.timeout}),Promise.reject(a)});return{}.hasOwnProperty.call(n,"setPromise")&&n.setPromise(s),s};pauseTimers(){this.areTimersPaused||(this.areTimersPaused=!0,this.timers.forEach(e=>{e.timeout&&(e.timeout.clear(),e.remaining=Math.max(e.remaining-(Date.now()-e.start),0))}))}resumeTimers(){this.areTimersPaused&&(this.areTimersPaused=!1,this.timers.forEach((e,n)=>{e.remaining=e.remaining>0?e.remaining:e.delay,e.timeout??=ji.create(),e.timeout.start(e.remaining,()=>{this.handleTimerFired(n),e.callback()}),e.start=Date.now()}))}restoreFocusToPrevElement(){this.state.prevFocusElement?.focus({preventScroll:!0})}handleDocumentPointerDown=e=>{if(e.pointerType!=="touch")return;const n=mn(e);Ge(this.state.viewport,n)||(this.resumeTimers(),this.update({hovering:!1,focused:!1}))};scheduleTimer(e,n,r){const i=Date.now(),a=!ts.expandedOrOutOfFocus(this.state)?ji.create():void 0;a?.start(n,()=>{this.handleTimerFired(e),r()}),this.timers.set(e,{timeout:a,start:i,delay:n,remaining:n,callback:r})}clearTimers(){this.timers.forEach(e=>{e.timeout?.clear()}),this.timers.clear(),this.areTimersPaused=!1}clearTimer(e){this.timers.get(e)?.timeout?.clear(),this.timers.delete(e),this.resetPausedStateIfNoTimersRemain()}handleTimerFired(e){this.timers.delete(e),this.resetPausedStateIfNoTimersRemain()}resetPausedStateIfNoTimersRemain(){this.timers.size===0&&(this.areTimersPaused=!1)}setToasts(e,n=e.length===0){const r={toasts:e,toastMetadata:pb(e)};n&&(r.hovering=!1,r.focused=!1),this.update(r)}handleFocusManagement(e){const n=ir(vt(this.state.viewport));if(!this.state.viewport||!Ge(this.state.viewport,n)||!Zg(n))return;if(e===void 0){this.restoreFocusToPrevElement();return}const r=ts.toasts(this.state),i=ts.toastIndex(this.state,e),s=(u,c)=>{for(let d=u;d>=0&&d<r.length;d+=c)if(r[d].transitionStatus!=="ending")return r[d];return null},a=s(i+1,1)??s(i-1,-1);a?a.ref?.current?.focus():this.restoreFocusToPrevElement()}}const Jq=function(e){const{children:n,timeout:r=5e3,limit:i=3,toastManager:s}=e,a=Qn(()=>new Zq({timeout:r,limit:i,viewport:null,toasts:[],hovering:!1,focused:!1,isWindowFocused:!0,prevFocusElement:null})).current;return zm(a.disposeEffect),R.useEffect(function(){return s?s[" subscribe"](({action:d,options:h})=>{const g=h.id;d==="promise"&&h.promise?a.promiseToast(h.promise,h):d==="update"&&g?a.updateToast(g,h):d==="close"?a.closeToast(g):a.addToast(h)}):void 0},[a,s]),O.jsxs(_z.Provider,{value:a,children:[O.jsx(e9,{store:a,timeout:r,limit:i}),n]})};function e9(t){const{store:e,timeout:n,limit:r}=t;return Ae(()=>{e.syncProviderProps(n,r)},[e,n,r]),null}const t9=R.forwardRef(function(e,n){const{render:r,className:i,style:s,children:a,...u}=e,c=ry(),d=lr(),h=R.useRef(!1),g=R.useRef(!1),m=R.useRef(!1),y=c.useState("isEmpty"),b=c.useState("toasts"),x=c.useState("focused"),w=c.useState("expanded"),C=c.useState("prevFocusElement"),T=b[0]?.height,E=b.some(X=>X.transitionStatus==="ending"),M=b.filter(X=>X.priority==="high");R.useEffect(()=>{const X=c.state.viewport;if(!X||y)return;const Z=Rn(X),z=vt(X);function $(ie){ie.key==="F6"&&mn(ie)!==X&&(ie.preventDefault(),c.set("prevFocusElement",ir(z)),X?.focus({preventScroll:!0}),c.pauseTimers(),c.set("focused",!0))}function W(ie){mn(ie)===Z&&(c.set("isWindowFocused",!1),c.pauseTimers())}function K(ie){if(ie.relatedTarget)return;const ee=mn(ie),ae=ir(vt(X));(ee===Z||!Ge(X,ee)||!Zg(ae))&&c.resumeTimers(),d.start(0,()=>c.set("isWindowFocused",!0))}return zo(yt(Z,"keydown",$),yt(Z,"blur",W,!0),yt(Z,"focus",K,!0),yt(z,"pointerdown",c.handleDocumentPointerDown,!0))},[c,d,y]);function k(X){h.current=!0;const Z=X.relatedTarget===c.state.viewport?b.find(z=>z.transitionStatus!=="ending"&&!z.limited):void 0;Z?Z.ref?.current?.focus():c.restoreFocusToPrevElement()}function P(X){X.key==="Tab"&&X.shiftKey&&mn(X.nativeEvent)===c.state.viewport&&(X.preventDefault(),c.restoreFocusToPrevElement())}function A(){c.state.toasts.some(Z=>Z.transitionStatus==="ending")||m.current||!g.current||(c.state.isWindowFocused&&c.resumeTimers(),c.set("hovering",!1),g.current=!1)}R.useEffect(A,[E,c]);function I(){c.pauseTimers(),c.set("hovering",!0),g.current=!1}function L(){c.state.isWindowFocused&&c.resumeTimers()}function j(){g.current=!0,A()}function N(X){X.pointerType==="touch"&&(m.current=!0)}function _(X){X.pointerType==="touch"&&(m.current=!1,A())}function H(){if(h.current){h.current=!1;return}x||Zg(ir(vt(c.state.viewport)))&&(c.set("focused",!0),c.pauseTimers())}function F(X){!x||Ge(c.state.viewport,X.relatedTarget)||(c.set("focused",!1),L())}const G={tabIndex:-1,role:"region","aria-live":"polite","aria-atomic":!1,"aria-relevant":"additions text","aria-label":"Notifications",onMouseEnter:I,onMouseMove:I,onMouseLeave:j,onFocus:H,onBlur:F,onKeyDown:P,onClick:H,onPointerDown:N,onPointerUp:_,onPointerCancel:_,style:{"--toast-frontmost-height":T?`${T}px`:void 0}},B={expanded:w},q=!y&&C&&O.jsx(fu,{onFocus:k}),U=ot("div",e,{ref:[n,c.setViewport],state:B,props:[G,u,{children:O.jsxs(R.Fragment,{children:[q,a,q]})}]});return O.jsxs(R.Fragment,{children:[q,U,!x&&M.length>0&&O.jsx("div",{style:Vm,children:M.map(X=>O.jsxs("div",{role:"alert","aria-atomic":!0,children:[O.jsx("div",{children:X.title}),O.jsx("div",{children:X.description})]},X.id))})]})}),Hz=R.createContext(void 0);function y1(){const t=R.useContext(Hz);if(!t)throw new Error(Jt(66));return t}function n9(t,e=!1){const{overflowY:n}=Ci(t);return n!=="auto"&&n!=="scroll"?!1:e?t.clientHeight>0:t.scrollHeight>t.clientHeight}function sd(t,e=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(e,Math.min(t,n))}function mb(t,e,n){switch(t){case"up":return-n;case"down":return n;case"left":return-e;case"right":return e;default:return 0}}function r9(t){const n=Rn(t).getComputedStyle(t).transform;let r=0,i=0,s=1;if(n&&n!=="none"){const a=n.match(/matrix(?:3d)?\(([^)]+)\)/);if(a){const u=a[1].split(", ").map(parseFloat);u.length===6?(r=u[4],i=u[5],s=Math.sqrt(u[0]*u[0]+u[1]*u[1])):u.length===16&&(r=u[12],i=u[13],s=u[0])}}return{x:r,y:i,scale:s}}const i9={...Uo,swipeDirection(t){return t?{"data-swipe-direction":t}:null}},AO=40,o9=10,OO=.5,s9=1,l9=`${mU},${yU}`,a9=R.forwardRef(function(e,n){const{toast:r,render:i,className:s,swipeDirection:a=["down","right"],style:u,...c}=e,d=r.positionerProps?.anchor!==void 0;let h=[];d||(h=Array.isArray(a)?a:[a]);const g=h.length>0,m=ry(),[y,b]=R.useState(void 0),[x,w]=R.useState(!1),[C,T]=R.useState(!1),[E,M]=R.useState({x:0,y:0}),[k,P]=R.useState({x:0,y:0,scale:1}),[A,I]=R.useState(),[L,j]=R.useState(),[N,_]=R.useState(null),H=R.useRef(null),F=R.useRef(void 0),G=R.useRef({x:0,y:0}),B=R.useRef({x:0,y:0,scale:1}),q=R.useRef(void 0),U=R.useRef(0),X=R.useRef(!1),Z=R.useRef({x:0,y:0}),z=R.useRef(!1),$=R.useRef({x:0,y:0}),W=R.useRef(null),K=R.useRef(null),ie=m.useState("toastIndex",r.id),ee=m.useState("toastVisibleIndex",r.id),ae=m.useState("toastOffsetY",r.id),Y=m.useState("focused"),se=m.useState("expanded");ui({open:r.transitionStatus!=="ending",ref:H,onComplete(){r.transitionStatus==="ending"&&m.removeToast(r.id)}});const ve=ke((ne=!1)=>{const J=H.current;if(!J)return;const le=J.style.height;J.style.height="auto";const we=J.offsetHeight;J.style.height=le;function de(){m.updateToastInternal(r.id,{ref:H,height:we,transitionStatus:void 0})}ne?po.flushSync(de):de()});Ae(()=>{const ne=F.current;r.transitionStatus!=="starting"&&ne===r.id||(ne!==void 0&&(b(void 0),P({x:0,y:0,scale:1}),ye({x:0,y:0})),F.current=r.id,ve())},[ve,r.id,r.transitionStatus]);function ye(ne){$.current=ne,M(ne)}Ae(()=>()=>{K.current?.abort()},[]);function he(ne,J){const le=me=>me>0?me**OO:-(Math.abs(me)**OO),we=ne>0&&!h.includes("right")||ne<0&&!h.includes("left"),de=J>0&&!h.includes("down")||J<0&&!h.includes("up");return{x:we?le(ne):ne,y:de?le(J):J}}const pe=ke(ne=>{if(ne.pointerId!==W.current)return;W.current=null,K.current?.abort(),K.current=null,w(!1),T(!1),_(null);const J=B.current;if(ne.type==="pointercancel"||X.current){ye({x:J.x,y:J.y}),b(void 0);return}const le=$.current,we=le.x-J.x,de=le.y-J.y;let me;for(const Be of h)if(mb(Be,we,de)>AO){me=Be;break}me?(b(me),m.closeToast(r.id)):(ye({x:J.x,y:J.y}),b(void 0))});function Te(ne){if(ne.button!==0||(ne.pointerType==="touch"&&m.pauseTimers(),mn(ne.nativeEvent)?.closest(`button,a,input,textarea,[role="button"],${l9}`)))return;X.current=!1,q.current=void 0,U.current=0,W.current=ne.pointerId,G.current={x:ne.clientX,y:ne.clientY},Z.current=G.current;const we=ne.currentTarget,de=r9(we);B.current=de,P(de),ye({x:de.x,y:de.y}),m.set("hovering",!0),w(!0),T(!1),_(null),z.current=!0,K.current?.abort();const me=new AbortController;K.current=me;const Be=vt(we);Be.addEventListener("pointerup",pe,{signal:me.signal}),Be.addEventListener("pointercancel",pe,{signal:me.signal}),we.setPointerCapture?.(ne.pointerId)}function Ie(ne){if(ne.pointerId!==W.current)return;ne.preventDefault(),z.current&&(G.current={x:ne.clientX,y:ne.clientY},z.current=!1);const{clientY:J,clientX:le,movementX:we,movementY:de}=ne;(de<0&&J>Z.current.y||de>0&&J<Z.current.y)&&(Z.current={x:Z.current.x,y:J}),(we<0&&le>Z.current.x||we>0&&le<Z.current.x)&&(Z.current={x:le,y:Z.current.y});const me=le-G.current.x,Be=J-G.current.y,Ke=J-Z.current.y,wt=le-Z.current.x;let xt=N;if(!C&&Math.sqrt(me*me+Be*Be)>=s9){T(!0);const Vt=h.includes("left")||h.includes("right"),$t=h.includes("up")||h.includes("down");if(Vt&&$t){const lt=Math.abs(me),gt=Math.abs(Be);xt=lt>gt?"horizontal":"vertical",_(xt)}}let st;if(!q.current)xt==="vertical"?Be>0?st="down":Be<0&&(st="up"):xt==="horizontal"?me>0?st="right":me<0&&(st="left"):Math.abs(me)>=Math.abs(Be)?st=me>0?"right":"left":st=Be>0?"down":"up",st&&h.includes(st)&&(q.current=st,U.current=mb(st,me,Be),b(st));else{const tn=q.current,Vt=mb(tn,wt,Ke);Vt>AO?(X.current=!1,b(tn)):!(h.includes("left")&&h.includes("right"))&&!(h.includes("up")&&h.includes("down"))&&U.current-Vt>=o9&&(X.current=!0)}const Ct=he(me,Be);let Wt=B.current.x,at=B.current.y;const Tn=h.includes("left")||h.includes("right"),Kt=h.includes("up")||h.includes("down");xt!=="vertical"&&Tn&&(Wt+=Ct.x),xt!=="horizontal"&&Kt&&(at+=Ct.y),ye({x:Wt,y:at})}function De(ne){if(ne.key==="Escape"){if(!H.current||!Ge(H.current,ir(vt(H.current))))return;m.closeToast(r.id)}}R.useEffect(()=>{const ne=H.current;if(!g||!ne)return;function J(le){W.current===null||!Ge(ne,mn(le))||le.preventDefault()}return yt(ne,"touchmove",J,{passive:!1})},[g]);function Ee(){const ne=E.x-k.x,J=E.y-k.y;return{transition:x?"none":void 0,transform:x?`translateX(${E.x}px) translateY(${E.y}px) scale(${k.scale})`:void 0,"--toast-swipe-movement-x":`${ne}px`,"--toast-swipe-movement-y":`${J}px`}}const _e=r.priority==="high",Me={role:_e?"alertdialog":"dialog",tabIndex:0,"aria-modal":!1,"aria-labelledby":A,"aria-describedby":L,"aria-hidden":_e&&!Y?!0:void 0,onPointerDown:g?Te:void 0,onPointerMove:g?Ie:void 0,onPointerUp:g?pe:void 0,onPointerCancel:g?pe:void 0,onKeyDown:De,inert:Xc(r.limited),style:{...Ee(),"--toast-index":r.transitionStatus==="ending"?ie:ee,"--toast-offset-y":`${ae}px`,"--toast-height":r.height?`${r.height}px`:void 0}},oe=R.useMemo(()=>({toast:r,setTitleId:I,setDescriptionId:j,recalculateHeight:ve,visibleIndex:ee,expanded:se}),[r,I,j,ve,ee,se]),xe={transitionStatus:r.transitionStatus,expanded:se,limited:r.limited||!1,type:r.type,swiping:x,swipeDirection:y},Pe=ot("div",e,{ref:[n,H],state:xe,stateAttributesMapping:i9,props:[Me,c]});return O.jsx(Hz.Provider,{value:oe,children:Pe})}),u9=R.forwardRef(function(e,n){const{render:r,className:i,style:s,...a}=e,{visibleIndex:u,expanded:c,recalculateHeight:d}=y1(),h=R.useRef(null);Ae(()=>{d();const y=h.current;if(!y||typeof ResizeObserver!="function"||typeof MutationObserver!="function")return;const b=new ResizeObserver(()=>d(!0)),x=new MutationObserver(()=>d(!0));return b.observe(y),x.observe(y,{childList:!0,subtree:!0,characterData:!0}),()=>{b.disconnect(),x.disconnect()}},[d]);const g=u>0;return ot("div",e,{ref:[n,h],state:{expanded:c,behind:g},props:a})});function Vz(t){return t==null||typeof t=="boolean"||t===""?!1:Array.isArray(t)?t.some(Vz):!0}function c9(t){return R.isValidElement(t)&&Vz(t.props.children)}function Fz(t,e,n){const{toast:r,setTitleId:i,setDescriptionId:s}=y1(),a=n==="title"?i:s,u=e??(n==="title"?r.title:r.description);return{id:ha(t),children:u,type:r.type,setId:a}}function Uz(t,e,n){const r=c9(t);return Ae(()=>{if(r)return n(e),()=>{n(i=>i===e?void 0:i)}},[r,e,n]),r?t:null}const f9=R.forwardRef(function(e,n){const{render:r,className:i,style:s,id:a,children:u,...c}=e,{id:d,children:h,type:g,setId:m}=Fz(a,u,"description"),b=ot("p",e,{ref:n,state:{type:g},props:{...c,id:d,children:h}});return Uz(b,d,m)}),d9=R.forwardRef(function(e,n){const{render:r,className:i,style:s,id:a,children:u,...c}=e,{id:d,children:h,type:g,setId:m}=Fz(a,u,"title"),b=ot("h2",e,{ref:n,state:{type:g},props:{...c,id:d,children:h}});return Uz(b,d,m)}),h9=R.forwardRef(function(e,n){const{render:r,className:i,style:s,disabled:a,nativeButton:u=!0,...c}=e,d=ry(),{toast:h,expanded:g}=y1(),[m,y]=R.useState(!1),{getButtonProps:b,buttonRef:x}=yo({disabled:a,native:u}),w={type:h.type};return ot("button",e,{ref:[n,x],state:w,props:[{"aria-hidden":!g&&!m,onClick(){d.closeToast(h.id)},onFocus(){y(!0)},onBlur(){y(!1)}},c,b]})}),p9=R.forwardRef(function(e,n){return O.jsx(GP,{ref:n,...e})});function g9(){const t=ry(),e=t.useState("toasts");return R.useMemo(()=>({toasts:e,add:t.addToast,close:t.closeToast,update:t.updateToast,promise:t.promiseToast}),[e,t])}function $z(t){const e=R.useRef(!0);e.current&&(e.current=!1,t())}const qz=R.createContext(null);function gl(){const t=R.useContext(qz);if(t===null)throw new Error(Jt(60));return t}const Nd={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},Gz={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},m9={disabled:!1,...Gz},Tu={valid(t){return t===null?null:t?{"data-valid":""}:{"data-invalid":""}}},Wz={invalid:void 0,name:void 0,validityData:{state:Nd,errors:[],error:"",value:"",initialValue:null},setValidityData:On,disabled:void 0,setTouched:On,setDirty:On,setFilled:On,setFocused:On,validationMode:"onSubmit",shouldValidateOnChange:()=>!1,state:m9,registerFieldControl:On,validation:{getValidationProps:(t,e=gn)=>e,inputRef:{current:null},registeredInputs:new Map,registerInput:On,getInputControl:()=>null,commit:async()=>{},change:On}},v1=R.createContext(Wz);function $o(t=!0){const e=R.useContext(v1);if(e.setValidityData===On&&!t)throw new Error(Jt(28));return e}function b1(t,e,n,r,i=!0,s){const{registerFieldControl:a}=$o(),u=Qn(()=>Symbol());Ae(()=>{const c=u.current;if(!i){a(c,void 0);return}a(c,{controlRef:t,getValue:r,id:e,name:s,value:n})},[t,i,r,e,s,a,u,n]),Ae(()=>{const c=u.current;return()=>{a(c,void 0)}},[a,u])}const Kz=R.createContext({controlId:void 0,registerControlId:On,labelId:void 0,setLabelId:On,messageIds:[],setMessageIds:On,getDescriptionProps:t=>t});function Rs(){return R.useContext(Kz)}function iy(t={}){const{id:e,implicit:n=!1,controlRef:r}=t,{controlId:i,registerControlId:s}=Rs(),a=ei(e),u=n?i:void 0,c=Qn(()=>Symbol()),d=R.useRef(!1),h=R.useRef(e!=null),g=ke(()=>{!d.current||s===On||(d.current=!1,s(c.current,void 0))});return Ae(()=>{if(s===On)return;let m;if(n){const y=r?.current;It(y)&&y.closest("label")!=null?m=e??null:m=u??a}else if(e!=null)h.current=!0,m=e;else if(h.current)m=a;else{g();return}if(m===void 0){g();return}d.current=!0,s(c.current,m)},[e,r,u,s,n,a,c,g]),R.useEffect(()=>g,[g]),i??a}const Yz=(t,e)=>Object.is(t,e);function go(t,e,n){return t==null||e==null?Object.is(t,e):n(t,e)}function y9(t,e,n){return!t||t.length===0?!1:t.some(r=>r===void 0?!1:go(e,r,n))}function bc(t,e,n){return!t||t.length===0?-1:t.findIndex(r=>r===void 0?!1:go(r,e,n))}function yb(t,e,n,r){const i=r&&Array.isArray(e)?e[e.length-1]:e,s=bc(t,i,n);return s===-1?null:s}function Xz(t,e,n){return t.filter(r=>!go(e,r,n))}function Jx(t){if(t==null)return"";if(typeof t=="string")return t;try{return JSON.stringify(t)}catch{return String(t)}}function x1(t){return t!=null&&t.length>0&&typeof t[0]=="object"&&t[0]!=null&&"items"in t[0]}function v9(t){if(!Array.isArray(t))return t!=null&&"null"in t;const e=t;if(x1(e)){for(const n of e)for(const r of n.items)if(r&&r.value==null&&r.label!=null)return!0;return!1}for(const n of e)if(n&&n.value==null&&n.label!=null)return!0;return!1}function no(t,e){if(e&&t!=null)return e(t)??"";if(t&&typeof t=="object"){if("label"in t&&t.label!=null)return String(t.label);if("value"in t)return String(t.value)}return Jx(t)}function ko(t,e){return e&&t!=null?e(t)??"":t&&typeof t=="object"&&"value"in t&&"label"in t?Jx(t.value):Jx(t)}function Qz(t,e,n){function r(){return no(t,n)}if(n&&t!=null)return n(t);if(t&&typeof t=="object"&&"label"in t&&t.label!=null)return t.label;if(e&&!Array.isArray(e))return e[t]??r();if(Array.isArray(e)){const i=e,s=x1(i)?i.flatMap(a=>a.items):i;if(t==null||typeof t!="object"){const a=s.find(u=>u.value===t);return a&&a.label!=null?a.label:r()}if("value"in t){const a=s.find(u=>u&&u.value===t.value);if(a&&a.label!=null)return a.label}}return r()}function b9(t,e,n){return t.reduce((r,i,s)=>(s>0&&r.push(", "),r.push(O.jsx(R.Fragment,{children:Qz(i,e,n)},s)),r),[])}const dt={id:t=>t.id,labelId:t=>t.labelId,modal:t=>t.modal,items:t=>t.items,itemToStringLabel:t=>t.itemToStringLabel,isItemEqualToValue:t=>t.isItemEqualToValue,value:t=>t.value,hasSelectedValue:t=>{const{value:e,multiple:n,itemToStringValue:r}=t;return e==null?!1:n&&Array.isArray(e)?e.length>0:ko(e,r)!==""},hasNullItemLabel:(t,e)=>e?v9(t.items):!1,open:t=>t.open,mounted:t=>t.mounted,forceMount:t=>t.forceMount,transitionStatus:t=>t.transitionStatus,openMethod:t=>t.openMethod,activeIndex:t=>t.activeIndex,selectedIndex:t=>t.selectedIndex,isActive:(t,e)=>t.activeIndex===e,isSelected:(t,e)=>{const n=t.isItemEqualToValue,r=t.value;return t.multiple?Array.isArray(r)&&r.some(i=>go(e,i,n)):go(e,r,n)},isSelectedByFocus:(t,e)=>t.selectedIndex===e,popupProps:t=>t.popupProps,triggerProps:t=>t.triggerProps,triggerElement:t=>t.triggerElement,positionerElement:t=>t.positionerElement,listElement:t=>t.listElement,popupSide:t=>t.popupSide,scrollUpArrowVisible:t=>t.scrollUpArrowVisible,scrollDownArrowVisible:t=>t.scrollDownArrowVisible,hasScrollArrows:t=>t.hasScrollArrows},x9=R.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:On,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});function Eu(){return R.useContext(x9)}function Zz(t,e,n=(r,i)=>r===i){return t.length===e.length&&t.every((r,i)=>n(r,e[i]))}const Qs=1;function Jz(t,e){return Math.max(0,t-e)}function S9(t,e){if(e<=0)return 0;const n=sd(t,0,e),r=n,i=e-n,s=r<=Qs,a=i<=Qs;return s&&a?r<=i?0:e:s?0:a?e:n}function w9(t){const{id:e,value:n,defaultValue:r=null,onValueChange:i,open:s,defaultOpen:a=!1,onOpenChange:u,name:c,form:d,autoComplete:h,disabled:g=!1,readOnly:m=!1,required:y=!1,modal:b=!0,actionsRef:x,inputRef:w,onOpenChangeComplete:C,items:T,multiple:E=!1,itemToStringLabel:M,itemToStringValue:k,isItemEqualToValue:P=Yz,highlightItemOnHover:A=!0,children:I}=t,{clearErrors:L}=Eu(),{setDirty:j,setTouched:N,setFocused:_,validityData:H,setFilled:F,name:G,disabled:B,validation:q,validationMode:U}=$o(),X=iy({id:e}),Z=B||g,z=G??c,[$,W]=la({controlled:n,default:E?r??Si:r,name:"Select",state:"value"}),[K,ie]=la({controlled:s,default:a,name:"Select",state:"open"}),ee=R.useRef([]),ae=R.useRef([]),Y=R.useRef(null),se=R.useRef(null),ve=R.useRef(0),ye=R.useRef(null),he=R.useRef([]),pe=R.useRef(!1),Te=R.useRef(null),Ie=R.useRef(null),De=R.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0}),Ee=R.useRef(!1),{mounted:_e,setMounted:Me,transitionStatus:oe}=hl(K),{openMethod:xe,triggerProps:Pe}=a1(K),ne=Qn(()=>new Kc({id:X,labelId:void 0,modal:b,multiple:E,itemToStringLabel:M,itemToStringValue:k,isItemEqualToValue:P,value:$,open:K,mounted:_e,transitionStatus:oe,items:T,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:{},triggerProps:{},triggerElement:null,positionerElement:null,listElement:null,popupSide:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1})).current,J=Se(ne,dt.activeIndex),le=Se(ne,dt.selectedIndex),we=Se(ne,dt.triggerElement),de=Se(ne,dt.positionerElement),me=c2(xe),Be=xe??me,Ke=R.useMemo(()=>E?"":ko($,k),[E,$,k]),wt=R.useMemo(()=>E&&Array.isArray($)?$.map(rt=>ko(rt,k)):ko($,k),[E,$,k]),xt=$n(we),st=ke(()=>wt);b1(xt,X,$,st,!Z,c);const Ct=R.useRef($),Wt=E?Array.isArray($)&&$.length>0:$!=null&&Ke!=="";Ae(()=>{F(Wt)},[Wt,F]),Ae(function(){let qt=$,qn=!1;if(E){const ln=Array.isArray($)?$:[];qn=ln.length===0,qt=ln[ln.length-1]}const jn=qn?-1:bc(he.current,qt,P),Tr=jn===-1?null:jn;Tr===null&&(Ie.current=null),!K&&ne.set("selectedIndex",Tr)},[E,K,$,P,ne]);function at(rt){const qt=H.initialValue;return Array.isArray(rt)&&Array.isArray(qt)?!Zz(rt,qt,(qn,jn)=>go(qn,jn,P)):rt!==qt}cc($,()=>{L(z),j(at($)),q.change($)});const Tn=ke((rt,qt)=>{u?.(rt,qt),!qt.isCanceled&&(ie(rt),!rt&&(qt.reason===ca||qt.reason===nh)&&(N(!0),_(!1),U==="onBlur"&&q.commit($)))}),Kt=ke(()=>{Me(!1),ne.update({activeIndex:null,openMethod:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1}),C?.(!1)});ui({enabled:!x,open:K,ref:Y,onComplete(){K||Kt()}}),R.useImperativeHandle(x,()=>({unmount:Kt}),[Kt]);const tn=ke((rt,qt)=>{i?.(rt,qt),!qt.isCanceled&&W(rt)}),Vt=ke(rt=>{const qt=Jz(rt.scrollHeight,rt.clientHeight),qn=S9(rt.scrollTop,qt),jn=qn>0,Tr=qn<qt;ne.set("scrollUpArrowVisible",jn),ne.set("scrollDownArrowVisible",Tr)}),$t=LP({open:K,onOpenChange:Tn,elements:{reference:we,floating:de}}),lt=qm($t,{enabled:!m&&!Z,event:"mousedown"}),gt=ih($t),nt=r1($t,{enabled:!m&&!Z,listRef:ee,activeIndex:J,selectedIndex:le,disabledIndices:Si,onNavigate(rt){rt===null&&!K||ne.set("activeIndex",rt)},focusItemOnHover:A}),nn=VP($t,{enabled:!m&&!Z&&(K||!E),listRef:ae,activeIndex:J,selectedIndex:le,disabledIndices:rt=>gz(ee.current[rt]),onMatch(rt){K?ne.set("activeIndex",rt):tn(he.current[rt],$e(xr))},onTyping(rt){pe.current=rt}}),Vn=R.useMemo(()=>Zr(nn.reference,nt.reference,gt.reference,lt.reference,Pe),[lt.reference,nn.reference,nt.reference,gt.reference,Pe]),Fn=R.useMemo(()=>Zr(oh,nn.floating,nt.floating,gt.floating),[nn.floating,nt.floating,gt.floating]),rn=nt.item??gn;$z(()=>{ne.update({popupProps:Fn,triggerProps:Vn})}),ne.useSyncedValues({id:X,modal:b,multiple:E,value:$,open:K,mounted:_e,transitionStatus:oe,popupProps:Fn,triggerProps:Vn,items:T,itemToStringLabel:M,itemToStringValue:k,isItemEqualToValue:P,openMethod:Be});const kn=R.useMemo(()=>({store:ne,floatingContext:$t,required:y,disabled:Z,readOnly:m,multiple:E,highlightItemOnHover:A,setValue:tn,setOpen:Tn,listRef:ee,popupRef:Y,scrollHandlerRef:se,handleScrollArrowVisibility:Vt,scrollArrowsMountedCountRef:ve,itemProps:rn,valueRef:ye,valuesRef:he,labelsRef:ae,typingRef:pe,selectionRef:De,firstItemTextRef:Te,selectedItemTextRef:Ie,validation:q,onOpenChangeComplete:C,alignItemWithTriggerActiveRef:Ee,initialValueRef:Ct}),[ne,$t,y,Z,m,E,A,tn,Tn,rn,q,C,Vt]),Pt=ws(w,q.inputRef),Hr=E?void 0:z,ar=R.useMemo(()=>!E||!Array.isArray($)||!z?null:$.map(rt=>{const qt=ko(rt,k);return O.jsx("input",{type:"hidden",form:d,name:z,value:qt,disabled:Z},qt)}),[E,$,d,z,k,Z]);return O.jsxs(qz.Provider,{value:kn,children:[I,O.jsx("input",{...q.getValidationProps(Z,{onFocus(){ne.state.triggerElement?.focus({focusVisible:!0})},onChange(rt){if(rt.nativeEvent.defaultPrevented||Z||m)return;const qt=rt.currentTarget.value,qn=$e(xr,rt.nativeEvent);function jn(){if(E)return;const Tr=qt.toLowerCase();let ln=he.current.findIndex(Nt=>ko(Nt,k).toLowerCase()===Tr||no(Nt,M).toLowerCase()===Tr);ln===-1&&(ln=he.current.findIndex((Nt,et)=>{const Er=ae.current[et];return Er!=null&&Er.toLowerCase()===Tr}));const zt=he.current[ln];zt!=null&&tn(zt,qn)}ne.set("forceMount",!0),queueMicrotask(jn)}}),id:X&&Hr==null?`${X}-hidden-input`:void 0,form:d,name:Hr,autoComplete:h,value:Ke,disabled:Z,required:y&&!(E&&Wt),readOnly:m,ref:Pt,style:z?zw:Vm,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),ar]})}function C9(t,e){const n=ei(t);return Ae(()=>(e(n),()=>{e(r=>r===n?void 0:r)}),[n,e]),n}function R9(t={}){const{id:e,fallbackControlId:n,native:r=!1,setLabelId:i,focusControl:s}=t,{controlId:a,setLabelId:u}=Rs(),c=ke(y=>{u(y),i?.(y)}),d=C9(e,c),h=a??n;function g(y){if(s){s(y,h);return}if(!h)return;const b=vt(y.currentTarget).getElementById(h);cn(b)&&T9(b)}function m(y){mn(y.nativeEvent)?.closest("button,input,select,textarea")||(!y.defaultPrevented&&y.detail>1&&y.preventDefault(),!r&&g(y))}return r?{id:d,htmlFor:h??void 0,onMouseDown:m}:{id:d,onClick:m,onPointerDown(y){y.preventDefault()}}}function T9(t){t.focus({focusVisible:!0})}function E9(t,e){return t??e}const M9=400,A9={...om,...Tu,popupSide:t=>t?{"data-popup-side":t}:null,value:()=>null},O9=R.forwardRef(function(e,n){const{render:r,className:i,id:s,disabled:a=!1,nativeButton:u=!0,style:c,...d}=e,{setTouched:h,setFocused:g,validationMode:m,state:y,disabled:b}=$o(),{labelId:x}=Rs(),{store:w,setOpen:C,selectionRef:T,validation:E,readOnly:M,required:k,alignItemWithTriggerActiveRef:P,disabled:A}=gl(),I=b||A||a,L=Se(w,dt.open),j=Se(w,dt.mounted),N=Se(w,dt.value),_=Se(w,dt.triggerProps),H=Se(w,dt.positionerElement),F=Se(w,dt.listElement),G=Se(w,dt.popupSide),B=Se(w,dt.id),q=Se(w,dt.labelId),U=Se(w,dt.hasSelectedValue),X=j&&H?G:null,Z=s??B,z=E9(x,q);iy({id:Z});const $=$n(H),W=R.useRef(null),{getButtonProps:K,buttonRef:ie}=yo({disabled:I,native:u}),ee=w.useStateSetter("triggerElement"),ae=lr(),Y=lr(),se=lr();R.useEffect(()=>{if(L)return se.start(M9,()=>{T.current.allowUnselectedMouseUp=!0,T.current.allowSelectedMouseUp=!0}),()=>{se.clear()};T.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0},Y.clear()},[L,T,Y,se]);const ve=Zr(_,{id:Z,role:"combobox","aria-expanded":L,"aria-haspopup":"listbox","aria-controls":L?F?.id??Jg(H)?.id:void 0,"aria-labelledby":z,"aria-readonly":M||void 0,"aria-required":k||void 0,tabIndex:I?-1:0,onFocus(pe){g(!0),L&&P.current&&C(!1,$e(xr,pe.nativeEvent)),ae.start(0,()=>{w.set("forceMount",!0)})},onBlur(pe){Ge(H,pe.relatedTarget)||(h(!0),g(!1),m==="onBlur"&&E.commit(N))},onMouseDown(pe){if(L)return;const Te=vt(pe.currentTarget);function Ie(De){if(!W.current)return;const Ee=De.target;Ge(W.current,Ee)||Ge($.current,Ee)||cz(De,W.current)||C(!1,$e(KD,De))}Y.start(0,()=>{Te.addEventListener("mouseup",Ie,{once:!0})})}},d,K),ye=E.getValidationProps(I,ve);ye.role="combobox";const he={...y,open:L,disabled:I,value:N,readOnly:M,popupSide:X,placeholder:!U};return ot("button",e,{ref:[n,W,ie,ee],state:he,stateAttributesMapping:A9,props:ye})}),k9={value:()=>null},I9=R.forwardRef(function(e,n){const{className:r,render:i,children:s,placeholder:a,style:u,...c}=e,{store:d,valueRef:h}=gl(),g=Se(d,dt.value),m=Se(d,dt.items),y=Se(d,dt.itemToStringLabel),b=Se(d,dt.hasSelectedValue),x=!b&&a!=null&&s==null,w=Se(d,dt.hasNullItemLabel,x),C={value:g,placeholder:!b};let T=null;return typeof s=="function"?T=s(g):s!=null?T=s:x&&!w?T=a:Array.isArray(g)?T=b9(g,m,y):T=Qz(g,m,y),ot("span",e,{state:C,ref:[n,h],props:[{children:T},c],stateAttributesMapping:k9})}),D9=R.forwardRef(function(e,n){const{render:r,className:i,style:s,...a}=e,{store:u}=gl(),d={open:Se(u,dt.open)};return ot("span",e,{state:d,ref:n,props:[{"aria-hidden":!0,children:"▼"},a],stateAttributesMapping:Ym})}),P9=R.forwardRef(function(e,n){const{store:r}=gl(),i=Se(r,dt.mounted),s=Se(r,dt.forceMount);return i||s?O.jsx(Um,{ref:n,...e}):null}),eN=R.createContext(void 0);function tN(){const t=R.useContext(eN);if(!t)throw new Error(Jt(59));return t}function sm(t,e){t&&Object.assign(t.style,e)}const nN={position:"relative",maxHeight:"100%",overflowX:"hidden",overflowY:"auto"},z9={position:"fixed"},N9=R.forwardRef(function(e,n){const{anchor:r,className:i,render:s,positionMethod:a,side:u,align:c,sideOffset:d,alignOffset:h,collisionBoundary:g="clipping-ancestors",collisionPadding:m,arrowPadding:y,sticky:b,disableAnchorTracking:x,alignItemWithTrigger:w=!0,collisionAvoidance:C=Hw,style:T,...E}=e,{store:M,listRef:k,labelsRef:P,alignItemWithTriggerActiveRef:A,selectedItemTextRef:I,valuesRef:L,initialValueRef:j,popupRef:N,setValue:_,floatingContext:H}=gl(),F=Se(M,dt.open),G=Se(M,dt.mounted),B=Se(M,dt.modal),q=Se(M,dt.value),U=Se(M,dt.openMethod),X=Se(M,dt.positionerElement),Z=Se(M,dt.triggerElement),z=Se(M,dt.isItemEqualToValue),$=Se(M,dt.transitionStatus),W=R.useRef(null),K=R.useRef(null),[ie,ee]=R.useState(w),ae=G&&ie&&U!=="touch";!G&&ie!==w&&ee(w),R.useImperativeHandle(A,()=>ae),l1((ae||B)&&F,U==="touch",X,Z);const Y=Xm({anchor:r,floatingRootContext:H,positionMethod:a,mounted:G,side:u,sideOffset:d,align:c,alignOffset:h,arrowPadding:y,collisionBoundary:g,collisionPadding:m,sticky:b,disableAnchorTracking:x??ae,collisionAvoidance:C,keepMounted:!0}),se=ae?"none":Y.side,ve=ae?z9:Y.positionerStyles,ye={open:F,side:se,align:Y.align,anchorHidden:Y.anchorHidden};Ae(()=>{M.set("popupSide",Y.side)},[M,Y.side]);const he=M.useStateSetter("positionerElement"),pe=Qm(e,ye,{styles:ve,transitionStatus:$,props:E,refs:[n,he],hidden:!G,inert:!F}),Te=R.useRef(0),Ie=ke(Ee=>{if(L.current.length===0)return;const _e=Te.current;if(Te.current=Ee.size,Ee.size===_e)return;const Me=$e(xr);if(_e!==0&&!M.state.multiple&&q!==null&&bc(L.current,q,z)===-1){const xe=j.current,ne=xe!=null&&bc(L.current,xe,z)!==-1?xe:null;_(ne,Me),ne===null&&(M.set("selectedIndex",null),I.current=null)}if(_e!==0&&M.state.multiple&&Array.isArray(q)){const oe=q.filter(xe=>bc(L.current,xe,z)!==-1);oe.length!==q.length&&(_(oe,Me),oe.length===0&&(M.set("selectedIndex",null),I.current=null))}if(F&&ae){M.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});const oe={height:""};sm(X,oe),sm(N.current,oe)}}),De=R.useMemo(()=>({...Y,side:se,alignItemWithTriggerActive:ae,setControlledAlignItemWithTrigger:ee,scrollUpArrowRef:W,scrollDownArrowRef:K}),[Y,se,ae,ee]);return O.jsx(uh,{elementsRef:k,labelsRef:P,onMapChange:Ie,children:O.jsxs(eN.Provider,{value:De,children:[G&&B&&O.jsx(ty,{inert:Xc(!F),cutout:Z}),pe]})})}),Qp="base-ui-disable-scrollbar",eS={className:Qp,getElement(t){return O.jsx("style",{nonce:t,href:Qp,precedence:"base-ui:low",children:`.${Qp}{scrollbar-width:none}.${Qp}::-webkit-scrollbar{display:none}`})}},L9=R.createContext(void 0),B9={disableStyleElements:!1};function j9(){return R.useContext(L9)??B9}const _9={...lh,...Uo},H9=R.forwardRef(function(e,n){const{render:r,className:i,style:s,finalFocus:a,...u}=e,{store:c,popupRef:d,onOpenChangeComplete:h,setOpen:g,valueRef:m,firstItemTextRef:y,selectedItemTextRef:b,multiple:x,handleScrollArrowVisibility:w,scrollHandlerRef:C,listRef:T,highlightItemOnHover:E,floatingContext:M}=gl(),{side:k,align:P,alignItemWithTriggerActive:A,isPositioned:I,setControlledAlignItemWithTrigger:L}=tN(),j=Jm(!0)!=null,N=Yc(),{nonce:_,disableStyleElements:H}=j9(),F=Se(c,dt.id),G=Se(c,dt.open),B=Se(c,dt.openMethod),q=Se(c,dt.mounted),U=Se(c,dt.popupProps),X=Se(c,dt.transitionStatus),Z=Se(c,dt.triggerElement),z=Se(c,dt.positionerElement),$=Se(c,dt.listElement),W=R.useRef(!1),K=R.useRef(!1),ie=R.useRef({}),ee=kc(),ae=ke(ye=>{if(!z||!d.current||!K.current)return;const he=z.style.top==="0px",pe=z.style.bottom==="0px";if(W.current||!A||!he&&!pe){w(ye);return}const Te=IO(z),Ie=ld(z.getBoundingClientRect().height,"y",Te),De=vt(z),Ee=Rn(z),_e=Ee.getComputedStyle(z),Me=parseFloat(_e.marginTop),oe=parseFloat(_e.marginBottom),xe=kO(Ee.getComputedStyle(d.current)),Pe=Math.min(De.documentElement.clientHeight-Me-oe,xe),ne=ye.scrollTop,J=Zp(ye);let le=null;const we=Ke=>{z.style.height=`${Ke}px`},de=he?J-ne:ne,me=Math.min(Ie+de,Pe);if(de<=Qs){const Ke=sd(de,0,Pe-Ie);Ke>0&&we(Ie+Ke),ye.scrollTop=he?J:0,Pe-(Ie+Ke)<=Qs&&(W.current=!0),w(ye);return}if(Pe-me>Qs)le=he?1/0:0;else if(pe&&ne<J){const Ke=Ie+de-Pe;le=ne-(de-Ke)}const Be=Math.ceil(me);if(Be!==0&&we(Be),le!=null){const Ke=sd(le,0,Zp(ye));Math.abs(ye.scrollTop-Ke)>Qs&&(ye.scrollTop=Ke)}Be>=Pe-Qs&&(W.current=!0),w(ye)});R.useImperativeHandle(C,()=>ae,[ae]),ui({open:G,ref:d,onComplete(){G&&h?.(!0)}});const Y={open:G,transitionStatus:X,side:k,align:P};Ae(()=>{!z||!d.current||Object.keys(ie.current).length||(ie.current={top:z.style.top||"0",left:z.style.left||"0",right:z.style.right,height:z.style.height,bottom:z.style.bottom,minHeight:z.style.minHeight,maxHeight:z.style.maxHeight,marginTop:z.style.marginTop,marginBottom:z.style.marginBottom})},[d,z]),Ae(()=>{G||A||(K.current=!1,W.current=!1,sm(z,ie.current))},[G,A,z,d]),Ae(()=>{const ye=d.current;if(!G||!Z||!z||!ye||A&&!I||c.state.transitionStatus==="ending")return;if(K.current=!0,ye.style.removeProperty("--transform-origin"),!A){ee.request(()=>w($||ye));return}const he=V9(ye);try{let pe=b.current;pe?.isConnected||(pe=!dt.hasSelectedValue(c.state)&&y.current?.isConnected?y.current:null);const Te=m.current,Ie=Rn(z),De=Ie.getComputedStyle(z),Ee=Ie.getComputedStyle(ye),_e=vt(Z),Me=IO(Z),oe=Jp(Z.getBoundingClientRect(),Me),xe=Jp(z.getBoundingClientRect(),Me),Pe=oe.height,ne=$||ye,J=ne.scrollHeight,le=parseFloat(Ee.borderBottomWidth),we=parseFloat(De.marginTop)||10,de=parseFloat(De.marginBottom)||10,me=parseFloat(De.minHeight)||100,Be=kO(Ee),Ke=5,wt=5,xt=20,st=_e.documentElement.clientHeight-we-de,Ct=_e.documentElement.clientWidth,Wt=st-oe.bottom+Pe;let at,Tn=N==="rtl"?oe.right-xe.width:oe.left,Kt=0;if(pe&&Te){const kn=Jp(Te.getBoundingClientRect(),Me);at=Jp(pe.getBoundingClientRect(),Me),Tn=xe.left+(N==="rtl"?kn.right-at.right:kn.left-at.left);const Pt=kn.top-oe.top+kn.height/2;Kt=at.top-xe.top+at.height/2-Pt}const tn=Wt+Kt+de+le;let Vt=Math.min(st,tn);const $t=st-we-de,lt=tn-Vt,gt=Ct-wt;z.style.left=`${sd(Tn,Ke,gt-xe.width)}px`,z.style.height=`${Vt}px`,z.style.maxHeight="none",z.style.marginTop=`${we}px`,z.style.marginBottom=`${de}px`,ye.style.height="100%";const nt=Zp(ne),nn=lt>=nt-Qs;nn&&(Vt=Math.min(st,xe.height)-(lt-nt));const Vn=oe.top<xt||oe.bottom>st-xt||Math.ceil(Vt)+Qs<Math.min(J,me),Fn=(Ie.visualViewport?.scale??1)!==1&&fl;if(Vn||Fn){sm(z,ie.current),L(!1);return}const rn=Math.max(me,Vt);if(nn){const kn=Math.max(0,st-tn);z.style.top=xe.height>=$t?"0":`${kn}px`,z.style.height=`${Vt}px`,ne.scrollTop=Zp(ne)}else z.style.bottom="0",ne.scrollTop=lt;if(at){const kn=xe.top,Pt=xe.height,Hr=at.top+at.height/2,ar=sd(Pt>0?(Hr-kn)/Pt*100:50,0,100);ye.style.setProperty("--transform-origin",`50% ${ar}%`)}(rn===st||Vt>=Be)&&(W.current=!0),w(ne),E&&c.state.selectedIndex===null&&c.state.activeIndex===null&&T.current[0]!=null&&c.set("activeIndex",0)}finally{he()}},[c,G,z,Z,m,y,b,d,w,A,L,ee,$,T,E,N,I]),R.useEffect(()=>{if(!A||!z||!G)return;const ye=Rn(z);function he(pe){g(!1,$e(z6,pe))}return yt(ye,"resize",he)},[g,A,z,G]);const se={...$?{role:"presentation","aria-orientation":void 0}:{role:"listbox","aria-multiselectable":x||void 0,id:`${F}-list`},onKeyDown(ye){j&&ey.has(ye.key)&&ye.stopPropagation()},onScroll(ye){$||ae(ye.currentTarget)},...A&&{style:$?{height:"100%"}:nN},className:!$&&A?eS.className:void 0},ve=ot("div",e,{ref:[n,d],state:Y,stateAttributesMapping:_9,props:[U,se,ah(X),u]});return O.jsxs(R.Fragment,{children:[!H&&eS.getElement(_),O.jsx($m,{context:M,modal:!1,disabled:!q,openInteractionType:B,returnFocus:a,restoreFocus:!0,children:ve})]})});function kO(t){const e=t.maxHeight;return e.endsWith("px")&&parseFloat(e)||1/0}function Zp(t){return Jz(t.scrollHeight,t.clientHeight)}function IO(t){return TP.getScale(t)}function ld(t,e,n){return t/n[e]}function Jp(t,e){return Dd({x:ld(t.x,"x",e),y:ld(t.y,"y",e),width:ld(t.width,"x",e),height:ld(t.height,"y",e)})}const DO=[["transform","none"],["scale","1"],["translate","0 0"]];function V9(t){const{style:e}=t,n={};for(const[r,i]of DO)n[r]=e.getPropertyValue(r),e.setProperty(r,i,"important");return()=>{for(const[r]of DO){const i=n[r];i?e.setProperty(r,i):e.removeProperty(r)}}}const F9=R.forwardRef(function(e,n){const{render:r,className:i,style:s,...a}=e,{store:u,scrollHandlerRef:c,multiple:d}=gl(),{alignItemWithTriggerActive:h}=tN(),g=Se(u,dt.hasScrollArrows),m=Se(u,dt.openMethod),b={id:`${Se(u,dt.id)}-list`,role:"listbox","aria-multiselectable":d||void 0,onScroll(w){c.current?.(w.currentTarget)},...h&&{style:nN},className:g&&m!=="touch"?eS.className:void 0},x=u.useStateSetter("listElement");return ot("div",e,{ref:[n,x],props:[b,a]})}),rN=R.createContext(void 0);function S1(){const t=R.useContext(rN);if(!t)throw new Error(Jt(57));return t}const U9=R.memo(R.forwardRef(function(e,n){const{render:r,className:i,style:s,value:a=null,label:u,disabled:c=!1,nativeButton:d=!1,...h}=e,g=R.useRef(null),m=Qc({guess:!0,label:u,textRef:g}),{store:y,itemProps:b,setOpen:x,setValue:w,selectionRef:C,typingRef:T,valuesRef:E,multiple:M,selectedItemTextRef:k,disabled:P,readOnly:A}=gl(),I=P||c,L=Se(y,dt.isActive,m.index),j=Se(y,dt.open),N=Se(y,dt.isSelected,a),_=Se(y,dt.isSelectedByFocus,m.index),H=Se(y,dt.isItemEqualToValue),F=m.index,G=R.useRef(null);Ae(()=>{const ee=E.current;return ee[F]=a,()=>{delete ee[F]}},[F,a,E]),Ae(()=>{const ee=y.state.value;let ae=ee;M&&Array.isArray(ee)&&(ae=ee.length>0?ee[ee.length-1]:void 0),ae!==void 0&&go(a,ae,H)&&(y.set("selectedIndex",F),g.current&&(k.current=g.current))},[F,M,H,y,a,k]);const B=R.useRef("mouse"),q=R.useRef(!1),{getButtonProps:U,buttonRef:X}=yo({disabled:I,focusableWhenDisabled:!0,native:d,composite:!0}),Z={disabled:I,selected:N,highlighted:L};function z(ee){if(P||A)return;const ae=y.state.value;if(M){const Y=Array.isArray(ae)?ae:[],se=N?Xz(Y,a,H):[...Y,a];w(se,$e(au,ee))}else w(a,$e(au,ee)),x(!1,$e(au,ee))}function $(){C.current.dragY=0}const W={role:"option","aria-selected":N,tabIndex:j&&L?0:-1,onKeyDown(ee){y.set("activeIndex",F),ee.key===" "&&T.current&&ee.preventDefault()},onClick(ee){const ae=B.current!=="touch",Y=ee.nativeEvent.pointerType,se=ae&&Rw(ee.nativeEvent)&&(Y!==void 0||L),ve=ae&&!se&&!q.current;q.current=!1,!(I||ve)&&z(ee.nativeEvent)},onPointerEnter(ee){B.current=ee.pointerType},onPointerMove(ee){if(ee.pointerType==="mouse"&&ee.buttons===1){const ae=C.current;ae.dragY+=ee.movementY,ae.dragY**2>=64&&(ae.allowUnselectedMouseUp=!0)}},onPointerDown(ee){B.current=ee.pointerType,q.current=!0,$()},onMouseUp(){if($(),I||B.current==="touch"||q.current)return;const ee=!C.current.allowSelectedMouseUp&&N,ae=!C.current.allowUnselectedMouseUp&&!N;ee||ae||(q.current=!0,G.current?.click(),q.current=!1)}},K=ot("div",e,{ref:[X,n,m.ref,G],state:Z,props:[b,W,h,U]}),ie=R.useMemo(()=>({selected:N,index:F,textRef:g,selectedByFocus:_}),[N,F,g,_]);return O.jsx(rN.Provider,{value:ie,children:K})})),$9=R.forwardRef(function(e,n){const{selected:r}=S1();return e.keepMounted||r?O.jsx(q9,{...e,ref:n}):null}),q9=R.memo(R.forwardRef((t,e)=>{const{render:n,className:r,style:i,keepMounted:s,...a}=t,{selected:u}=S1(),c=R.useRef(null),{transitionStatus:d,setMounted:h}=hl(u),m=ot("span",t,{ref:[e,c],state:{selected:u,transitionStatus:d},props:[{"aria-hidden":!0,children:"✔️"},a],stateAttributesMapping:Uo});return ui({open:u,ref:c,onComplete(){u||h(!1)}}),m})),G9=R.memo(R.forwardRef(function(e,n){const{index:r,textRef:i,selectedByFocus:s}=S1(),{firstItemTextRef:a,selectedItemTextRef:u}=gl(),{render:c,className:d,style:h,...g}=e,m=R.useCallback(b=>{b&&(r===0&&(a.current=b),s&&(u.current=b))},[a,u,r,s]);return ot("div",e,{ref:[m,n,i],props:g})}));function W9(t,e,n,r,i,s,a,u,c,d=2){const h=Z6(n.current,{event:t,orientation:r,loopFocus:i,rtl:s,cols:d,disabledIndices:a,minIndex:u,maxIndex:c,prevIndex:e>c?u:e,stopEvent:!0});return sa(n.current,h)?void 0:h}const iN=R.createContext(void 0),oN=R.createContext(void 0),sN=R.createContext(void 0),lN=R.createContext(!1),aN=R.createContext("");function vo(){const t=R.useContext(iN);if(!t)throw new Error(Jt(22));return t}function w1(){const t=R.useContext(oN);if(!t)throw new Error(Jt(23));return t}function ch(){const t=R.useContext(sN);if(!t)throw new Error(Jt(24));return t}function uN(){return R.useContext(aN)}function K9(){return R.useContext(lN)}const Ue={id:t=>t.id,selectedValue:t=>t.selectedValue,hasSelectionChips:t=>{const e=t.selectedValue;return Array.isArray(e)&&e.length>0},hasSelectedValue:t=>{const{selectedValue:e,selectionMode:n}=t;return e==null?!1:n==="multiple"&&Array.isArray(e)?e.length>0:!0},open:t=>t.open,mounted:t=>t.mounted,forceMounted:t=>t.forceMounted,inline:t=>t.inline,activeIndex:t=>t.activeIndex,selectedIndex:t=>t.selectedIndex,isActive:(t,e)=>t.activeIndex===e,isSelected:(t,e)=>{const n=t.isItemEqualToValue,r=t.selectedValue;return Array.isArray(r)?r.some(i=>go(e,i,n)):go(e,r,n)},transitionStatus:t=>t.transitionStatus,popupProps:t=>t.popupProps,listProps:t=>t.listProps,inputProps:t=>t.inputProps,triggerProps:t=>t.triggerProps,itemProps:t=>t.itemProps,positionerElement:t=>t.positionerElement,listElement:t=>t.listElement,triggerElement:t=>t.triggerElement,inputElement:t=>t.inputElement,inputGroupElement:t=>t.inputGroupElement,popupSide:t=>t.popupSide,openMethod:t=>t.openMethod,inputInsidePopup:t=>t.inputInsidePopup,inputOwnsFormValue:t=>t.inputOwnsFormValue,selectionMode:t=>t.selectionMode,name:t=>t.name,form:t=>t.form,disabled:t=>t.disabled,readOnly:t=>t.readOnly,required:t=>t.required,grid:t=>t.grid,virtualized:t=>t.virtualized,isItemEqualToValue:t=>t.isItemEqualToValue,modal:t=>t.modal,autoHighlight:t=>t.autoHighlight};function Y9(t){return t==null?void 0:`${t}-popup`}function X9(t,e){return(n,r)=>n==null?!1:t.contains(n,r,e)}function cN(t){return Array.isArray(t)?t.map(e=>cN(e)).join(","):t==null?"":String(t)}const PO=new Map;function Q9(t={}){const e={usage:"search",sensitivity:"base",ignorePunctuation:!0,...t},n=`${cN(t.locale)}|${JSON.stringify(e)}`,r=PO.get(n);if(r)return r;const i=new Intl.Collator(t.locale,e),s={contains(a,u,c){if(!u)return!0;const d=no(a,c);for(let h=0;h<=d.length-u.length;h+=1)if(i.compare(d.slice(h,h+u.length),u)===0)return!0;return!1},startsWith(a,u,c){if(!u)return!0;const d=no(a,c);return i.compare(d.slice(0,u.length),u)===0},endsWith(a,u,c){if(!u)return!0;const d=no(a,c),h=u.length;return d.length>=h&&i.compare(d.slice(d.length-h),u)===0}};return PO.set(n,s),s}const Z9=Q9,fN=Symbol("none"),vb={value:fN,index:-1};function J9(t){const{id:e,onOpenChangeComplete:n,defaultSelectedValue:r=null,selectedValue:i,onSelectedValueChange:s,defaultInputValue:a,inputValue:u,open:c,defaultOpen:d=!1,selectionMode:h,onItemHighlighted:g,name:m,form:y,disabled:b=!1,readOnly:x=!1,required:w=!1,inputRef:C,grid:T=!1,items:E,filteredItems:M,filter:k,openOnInputClick:P=!0,autoHighlight:A=!1,keepHighlight:I=!1,highlightItemOnHover:L=!0,loopFocus:j=!0,itemToStringLabel:N,itemToStringValue:_,isItemEqualToValue:H=Yz,virtualized:F=!1,inline:G=!1,fillInputOnItemPress:B=!0,modal:q=!1,limit:U=-1,autoComplete:X="list",formAutoComplete:Z,locale:z,submitOnItemClick:$=!1}=t,{clearErrors:W}=Eu(),{setDirty:K,validityData:ie,setFilled:ee,name:ae,disabled:Y,setTouched:se,setFocused:ve,validationMode:ye,validation:he}=$o(),pe=Yc(),Te=iy({id:e}),Ie=Z9({locale:z}),[De,Ee]=R.useState(!1),[_e,Me]=R.useState(null),oe=R.useRef([]),xe=R.useRef([]),Pe=R.useRef(null),ne=R.useRef(null),J=R.useRef(null),le=R.useRef(null),we=R.useRef(null),de=R.useRef(!0),me=R.useRef(!1),Be=R.useRef(null),Ke=R.useRef(null),wt=R.useRef(null),xt=R.useRef(vb),st=R.useRef(null),Ct=R.useRef([]),Wt=R.useRef(null),at=Y||b,Tn=ae??m,Kt=h==="multiple",tn=h==="single",Vt=u!==void 0||a!==void 0,$t=E!==void 0,lt=M!==void 0;let gt;A==="always"?gt="always":gt=A?"input-change":!1;const[nt,nn]=la({controlled:i,default:Kt?r??Si:r,name:"Combobox",state:"selectedValue"}),Vn=R.useMemo(()=>k===null?()=>!0:k!==void 0?k:X9(Ie,N),[k,Ie,N]),Fn=Qn(()=>Vt?a??"":tn?no(nt,N):"").current,[rn,kn]=la({controlled:u,default:Fn,name:"Combobox",state:"inputValue"}),[Pt,Hr]=la({controlled:c,default:d,name:"Combobox",state:"open"}),ar=x1(E),rt=_e??String(rn).trim(),qt=tn?no(nt,N):"",qn=tn&&!De&&rt!==""&&qt.length===rt.length&&Ie.contains(qt,rt),jn=qn?"":rt,Tr=$t&<&&qn,ln=R.useMemo(()=>E?ar?E.flatMap(je=>je.items):E:Si,[E,ar]),zt=R.useMemo(()=>{if(M&&!Tr)return M;if(!E)return Si;if(ar){const He=E,Gt=[];let jt=0;for(const on of He){if(U>-1&&jt>=U)break;const er=U>-1?U-jt:1/0,yn=jn===""?on.items.slice(0,er):[];if(jn!=="")for(const Or of on.items){if(yn.length>=er)break;Vn(Or,jn,N)&&yn.push(Or)}if(yn.length>0){const Or={...on,items:yn};Gt.push(Or),jt+=yn.length}}return Gt}if(jn==="")return U>-1?ln.slice(0,U):ln;const je=[];for(const He of ln){if(U>-1&&je.length>=U)break;Vn(He,jn,N)&&je.push(He)}return je},[M,Tr,E,ar,jn,U,Vn,N,ln]),Nt=R.useMemo(()=>ar?zt.flatMap(He=>He.items):zt,[zt,ar]),et=Qn(()=>{let je=null;return G&&Pt&&$t&&h!=="none"&&(je=yb(Nt,nt,H,Kt)),new OP({id:Te,labelId:void 0,selectedValue:nt,open:Pt,items:E,selectionMode:h,listRef:oe,labelsRef:xe,popupRef:Pe,emptyRef:we,inputRef:ne,startDismissRef:J,endDismissRef:le,keyboardActiveRef:de,chipsContainerRef:Be,clearRef:Ke,valuesRef:Ct,pointerDownItemRef:Wt,selectionEventRef:wt,name:Tn,form:y,disabled:at,readOnly:x,required:w,grid:T,virtualized:F,openOnInputClick:P,itemToStringLabel:N,isItemEqualToValue:H,modal:q,autoHighlight:gt,submitOnItemClick:$,hasInputValue:Vt,mounted:!1,forceMounted:!1,transitionStatus:"idle",inline:G,activeIndex:null,selectedIndex:je,popupProps:{},listProps:{},inputProps:{},triggerProps:{},itemProps:gn,positionerElement:null,listElement:null,popupId:void 0,triggerElement:null,inputElement:null,inputGroupElement:null,popupSide:null,openMethod:null,inputInsidePopup:!0,inputOwnsFormValue:h==="none",onOpenChangeComplete:On,setOpen:On,setInputValue:On,setSelectedValue:On,setIndices:On,handleSelection:On,forceMount:On,requestSubmit:On})}).current,Er=h==="none"?rn:nt,nf=R.useMemo(()=>h==="none"?Er:Array.isArray(nt)?nt.map(je=>ko(je,_)):ko(nt,_),[Er,_,h,nt]),Es=ke(g),ml=ke(n),qe=Se(et,Ue.activeIndex),Aa=Se(et,Ue.selectedIndex),Jn=Se(et,Ue.positionerElement),Vi=Se(et,Ue.listElement),fi=Se(et,Ue.triggerElement),di=Se(et,Ue.inputElement),Un=Se(et,Ue.inputGroupElement),ur=Se(et,Ue.inline),Vr=Se(et,Ue.inputInsidePopup),Fi=Se(et,Ue.inputOwnsFormValue),xo=$n(fi),{mounted:Oa,setMounted:ka,transitionStatus:Ms}=hl(Pt),{openMethod:Ia,triggerProps:So}=a1(Pt),As=ke(()=>nf);b1(Vr?xo:ne,Te,Er,As,!at,m);const ni=ke(()=>{E?xe.current=Nt.map(je=>no(je,N)):et.set("forceMounted",!0)}),Gn=ke((je,He,Gt)=>{if(He===-1){if(xt.current===vb)return;xt.current=vb}else xt.current={value:je,index:He};Es(je,N6(Gt,void 0,{index:He}))}),Fr=ke(je=>{et.update(je);const He=je.activeIndex;if(He===void 0)return;const Gt=je.type||xr;He===null?Gn(void 0,-1,Gt):Gn(Ct.current[He],He,Gt)}),ri=ke((je,He)=>{if(me.current=He.reason===as,t.onInputValueChange?.(je,He),!He.isCanceled){if(He.reason===dd){Pt&&_e!==null&&Me(null);const Gt=He.event,jt=Gt.inputType;if(Gt.type==="compositionend"||jt!=null&&jt!==""&&jt!=="insertReplacementText"){const er=je.trim()!=="";er&&Ee(!0),st.current={hasQuery:er};const yn=et.state.listElement;if(!et.state.virtualized&&yn){const Or=Pe.current;for(const $r of Oc(yn.firstElementChild??yn)){if(!cn($r)||(Or?!Ge(Or,$r):$r.getAttribute("role")==="dialog"))break;if(n9($r)){$r.scrollTop=0;break}}}er&>&&et.state.activeIndex==null&&(Pt||ur)&&et.set("activeIndex",0)}}else He.reason===as&&je===""&&et.state.inputInsidePopup&&(st.current={hasQuery:!1,selection:!0});kn(je)}}),Ui=ke((je,He)=>{if(Pt!==je&&(He.reason===Wc&&$t&&Nt.length===0&&!we.current&&He.allowPropagation(),t.onOpenChange?.(je,He),!He.isCanceled&&(je&&Vr&&!ur&&_e!==null&&(Ee(!1),Me(null),rn!==""&&He.reason!==dd&&ri("",$e(as,He.event))),!je&&De&&(tn?(ur||Me(rt),rt===""&&Ee(!1)):Kt&&(ur||Me(rt),Vr&&Fr({activeIndex:null}),(!Vr||ur)&&ri("",$e(as,He.event)))),Hr(je),!je&&Vr&&(He.reason===ca||He.reason===nh)&&(se(!0),ve(!1),ye==="onBlur")))){const Gt=h==="none"?rn:nt;he.commit(Gt)}}),Wo=ke((je,He)=>{if(s?.(je,He),He.isCanceled)return;nn(je),(h==="none"&&Pe.current&&B||tn&&!et.state.inputInsidePopup)&&ri(no(je,N),$e(He.reason,He.event))}),Os=ke((je,He)=>{const Gt=mn(je),jt=wt.current??je;wt.current=null;const on=$e(au,jt),er=Gt?.closest("a")?.getAttribute("href");if(er){er.startsWith("#")&&Ui(!1,on);return}if(Kt){const yn=Array.isArray(nt)?nt:[],$r=y9(yn,He,H)?Xz(yn,He,H):[...yn,He];if(Wo($r,on),on.isCanceled||!(ne.current?ne.current.value.trim()!=="":!1))return;et.state.inputInsidePopup?ri("",$e(as,on.event)):Ui(!1,on)}else{if(Wo(He,on),on.isCanceled)return;Ui(!1,on)}}),Au=ke(()=>{const je=he.inputRef.current?.form??et.state.inputElement?.form;je&&typeof je.requestSubmit=="function"&&je.requestSubmit()}),cr=ke(()=>{if(ka(!1),ml?.(!1),Ee(!1),Me(null),Fr(h==="none"?{activeIndex:null,selectedIndex:null}:{activeIndex:null}),Kt&&ne.current&&ne.current.value!==""&&!me.current&&ri("",$e(as)),tn)if(et.state.inputInsidePopup)ne.current&&ne.current.value!==""&&ri("",$e(as));else{const je=no(nt,N);ne.current&&ne.current.value!==je&&ri(je,$e(je===""?as:xr))}}),yl=R.useMemo(()=>ur&&Jn?{current:Jn.closest('[role="dialog"]')}:Pe,[ur,Jn]);ui({enabled:!t.actionsRef,open:Pt,ref:yl,onComplete(){Pt||cr()}}),R.useImperativeHandle(t.actionsRef,()=>({unmount:cr}),[cr]),Ae(function(){if(Pt||(Wt.current=null,h==="none"))return;const He=$t?ln:Ct.current;Fr({selectedIndex:yb(He,nt,H,Kt)})},[Pt,nt,h,Kt,$t,ln,H,Fr]),Ae(()=>{E&&(Ct.current=Nt,oe.current.length=Nt.length)},[E,Nt]),Ae(()=>{const je=st.current;if(je){const Or=Pt||ur||et.state.positionerElement?.hidden===!1;if(je.hasQuery)gt&&Or&&et.set("activeIndex",0),st.current=null;else if(String(rn).trim()===""&&(st.current=null,Or)){const $r=je.selection;gt==="always"&&!$r&&et.state.selectionMode==="none"&&et.set("activeIndex",0),queueMicrotask(()=>{if(!et.state.open&&!et.state.inline||ne.current&&ne.current.value.trim()!=="")return;const Ei=et.state.selectedValue,El=et.state.selectionMode==="multiple",qr=El&&Array.isArray(Ei)?Ei[Ei.length-1]:Ei,Xo=et.state.selectionMode!=="none"&&qr!=null;if(Xo||$r){const Ou=$t||lt?Nt:Ct.current;et.set("activeIndex",Xo?yb(Ou,Ei,et.state.isItemEqualToValue,El):null)}else gt==="always"&&et.set("activeIndex",0)})}}if(!Pt&&!ur)return;const Gt=$t||lt?Nt:Ct.current,jt=et.state.activeIndex;if(jt==null){if(gt==="always"&&Gt.length>0){et.set("activeIndex",0);return}Gn(void 0,-1,xr);return}if(jt>=Gt.length){Gn(void 0,-1,xr),et.set("activeIndex",null);return}const on=Gt[jt],er=xt.current.value,yn=er!==fN&&go(on,er,et.state.isItemEqualToValue);(xt.current.index!==jt||!yn)&&Gn(on,jt,xr)},[qe,gt,Gn,lt,$t,Nt,ur,Pt,et,rn]),Ae(()=>{if(h==="none"){ee(String(rn)!=="");return}ee(Kt?Array.isArray(nt)&&nt.length>0:nt!=null)},[ee,h,rn,nt,Kt]),R.useEffect(()=>{$t&>&&Nt.length===0&&Fr({activeIndex:null})},[$t,gt,Nt.length,Fr]);function Da(je){const He=ie.initialValue;return Array.isArray(je)&&Array.isArray(He)?!Zz(je,He,(Gt,jt)=>go(Gt,jt,H)):je!==He}cc(rt,()=>{!Pt||rt===""||rt===String(Fn)||Ee(!0)});function ks(){const je=no(nt,N);rn!==je&&ri(je,$e(xr))}cc(nt,()=>{h!=="none"&&(W(Tn),K(Da(nt)),he.change(nt),tn&&!Vt&&!Vr&&ks())}),cc(rn,()=>{h==="none"&&(W(Tn),K(rn!==ie.initialValue),he.change(rn))}),cc(E,()=>{!tn||Vt||Vr||De||ks()});const hi=LP({open:ur?!0:Pt,onOpenChange:Ui,elements:{reference:Vr?fi:di,floating:Jn}}),vl=T?"grid":"listbox",Ko=Pt||ur,$i=Ko?"true":"false",Is=R.useMemo(()=>{const je=di?.tagName==="INPUT",He=di==null||je,Gt=He||Ko,jt=He?{autoComplete:"off",spellCheck:"false",autoCorrect:"off",autoCapitalize:"none"}:{};return Gt&&(jt.role="combobox",jt["aria-expanded"]=$i,jt["aria-haspopup"]=vl,jt["aria-controls"]=Ko?Vi?.id:void 0,jt["aria-autocomplete"]=X),{reference:jt,floating:{role:"presentation"}}},[di,Ko,$i,vl,Vi?.id,X]),bl=qm(hi,{enabled:!x&&!at&&P,event:"mousedown-only",toggle:!1,touchOpenDelay:Vr?0:100,reason:WD}),Yo=ih(hi,{enabled:!x&&!at&&!ur,outsidePressEvent:{mouse:"sloppy",touch:"intentional"},bubbles:ur?!0:void 0,outsidePress(je){const He=mn(je);return!Ge(fi,He)&&!Ge(Ke.current,He)&&!Ge(Be.current,He)&&!Ge(Un,He)}}),Ti=r1(hi,{enabled:!x&&!at,id:Te,listRef:oe,activeIndex:qe,selectedIndex:Aa,virtual:!0,loopFocus:j,allowEscape:j&&!gt,focusItemOnOpen:De||h==="none"&&!gt?!1:"auto",focusItemOnHover:L,resetOnPointerLeave:!I,orientation:T?"horizontal":void 0,rtl:pe==="rtl",disabledIndices:Si,grid:T?W9:void 0,onNavigate(je,He){!He&&!Pt||Ms==="ending"||Fr(He?{activeIndex:je,type:de.current?kw:Iw}:{activeIndex:je})}}),xl=R.useMemo(()=>Zr(Ti.reference,{onKeyDown(je){T&&et.state.activeIndex==null&&(je.key==="ArrowLeft"||je.key==="ArrowRight")&&je.preventBaseUIHandler()}},Yo.reference,bl.reference,Is.reference),[Ti.reference,Yo.reference,bl.reference,Is.reference,T,et]),Sl=R.useMemo(()=>Zr(oh,Yo.floating),[Yo.floating]),wo=R.useMemo(()=>Zr(Ti.floating,Is.floating),[Ti.floating,Is.floating]),Ur=R.useMemo(()=>{const je=Ti.item;return je?{...je,onFocus:void 0}:gn},[Ti.item]);$z(()=>{et.update({inline:G,popupProps:Sl,listProps:wo,inputProps:xl,triggerProps:So,itemProps:Ur,setOpen:Ui,setInputValue:ri,setSelectedValue:Wo,setIndices:Fr,handleSelection:Os,forceMount:ni,requestSubmit:Au,onOpenChangeComplete:ml})}),Ae(()=>{et.update({id:Te,selectedValue:nt,open:Pt,mounted:Oa,transitionStatus:Ms,items:E,inline:G,popupProps:Sl,listProps:wo,inputProps:xl,triggerProps:So,openMethod:Ia,itemProps:Ur,selectionMode:h,name:Tn,form:y,disabled:at,readOnly:x,required:w,grid:T,virtualized:F,openOnInputClick:P,itemToStringLabel:N,modal:q,autoHighlight:gt,isItemEqualToValue:H,submitOnItemClick:$,hasInputValue:Vt,inputOwnsFormValue:h==="none"&&(G||!et.state.inputInsidePopup)})},[et,Te,nt,Pt,Oa,Ms,E,Sl,wo,xl,Ur,Ia,So,h,Tn,at,x,w,T,F,P,N,q,H,$,Vt,G,gt,y]);const wl=ws(C,he.inputRef),Cl=R.useMemo(()=>({query:rt,hasItems:$t,filteredItems:zt,flatFilteredItems:Nt}),[rt,$t,zt,Nt]),Co=R.useMemo(()=>Array.isArray(Er)?"":ko(Er,_),[Er,_]),Ro=Kt&&Array.isArray(nt)&&nt.length>0,Ds=Kt||h==="none"&&Fi?void 0:Tn,Rl=R.useMemo(()=>!Kt||!Array.isArray(nt)||!Tn?null:nt.map(je=>{const He=ko(je,_);return O.jsx("input",{type:"hidden",form:y,name:Tn,value:He,disabled:at},He)}),[Kt,nt,y,Tn,_,at]),Tl=O.jsxs(R.Fragment,{children:[t.children,O.jsx("input",{...he.getValidationProps(at,{onFocus(){if(Vr){fi?.focus();return}(ne.current||fi)?.focus()},onChange(je){if(je.nativeEvent.defaultPrevented||at||x)return;const He=je.currentTarget.value,Gt=He.toLowerCase(),jt=$e(xr,je.nativeEvent),on=()=>Ct.current.findIndex(yn=>ko(yn,_).toLowerCase()===Gt||no(yn,N).toLowerCase()===Gt);function er(){if(Kt)return;if(h==="none"){ri(He,jt);return}let yn=on();yn===-1&&(yn=Ct.current.findIndex(($r,Ei)=>{const El=xe.current[Ei];return El!=null&&El.toLowerCase()===Gt}));const Or=yn===-1?void 0:Ct.current[yn];Or!=null&&Wo?.(Or,jt)}tn&&(ni(),E&&on()===-1&&et.set("forceMounted",!0)),queueMicrotask(er)}}),id:Te&&Ds==null?`${Te}-hidden-input`:void 0,form:y,name:Ds,autoComplete:Z,disabled:at,required:w&&!Ro,readOnly:x,value:Co,ref:wl,style:Ds?zw:Vm,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),Rl]});return O.jsx(iN.Provider,{value:et,children:O.jsx(oN.Provider,{value:hi,children:O.jsx(lN.Provider,{value:$t,children:O.jsx(sN.Provider,{value:Cl,children:O.jsx(aN.Provider,{value:rn,children:Tl})})})})})}function eG(t){const{multiple:e=!1,defaultValue:n,value:r,onValueChange:i,autoComplete:s,...a}=t;return O.jsx(J9,{...a,selectionMode:e?"multiple":"single",selectedValue:r,defaultSelectedValue:n,onSelectedValueChange:i,formAutoComplete:s})}const dN={...om,...Tu,popupSide:t=>t?{"data-popup-side":t}:null,listEmpty:t=>t?{"data-list-empty":""}:null},tG=R.createContext(void 0);function nG(){return R.useContext(tG)}const hN=R.createContext(void 0);function C1(t){const e=R.useContext(hN);if(e===void 0&&!t)throw new Error(Jt(21));return e}const pN=R.forwardRef(function(e,n){const r=vo(),{buttonRef:i,getButtonProps:s}=yo({native:!1}),a=ws(n,i);function u(d){r.state.setOpen(!1,$e(GD,d.nativeEvent,d.currentTarget))}const c=s({onClick:u});return O.jsx("span",{ref:a,...c,"aria-label":"Dismiss",tabIndex:void 0,style:zw})});function gN(t){const e=Se(t,Ue.mounted),n=Se(t,Ue.popupSide),r=Se(t,Ue.positionerElement);return e&&r?n:null}function oy(){return ch().filteredItems.length===0}function rG(t){return t==="rtl"?["ArrowRight","ArrowLeft"]:["ArrowLeft","ArrowRight"]}function iG(t,e){const n=t>=e-1?e-2:t;return n>=0?n:void 0}function mN(t,e,n){const r=t.state.listRef.current[e];r&&(t.state.selectionEventRef.current=n,r.click(),t.state.selectionEventRef.current=null)}const oG=R.forwardRef(function(e,n){const{render:r,className:i,disabled:s=!1,id:a,style:u,...c}=e,{state:d,disabled:h,setTouched:g,setFocused:m,validationMode:y,validation:b}=$o(),{labelId:x}=Rs(),w=nG(),T=!!C1(!0),E=vo(),M=uN(),k=Yc(),P=Se(E,Ue.required),A=Se(E,Ue.disabled),I=Se(E,Ue.readOnly),L=Se(E,Ue.name),j=Se(E,Ue.form),N=Se(E,Ue.selectionMode),_=Se(E,Ue.autoHighlight),H=Se(E,Ue.inputProps),F=Se(E,Ue.triggerProps),G=Se(E,Ue.open),B=Se(E,Ue.mounted),q=Se(E,Ue.selectedValue),U=Se(E,Ue.id),X=Se(E,Ue.inline),Z=Se(E,Ue.modal),z=!!_,$=gN(E),W=h||A||s,K=oy(),ie=T||X,ee=!ie||Z,ae=ei(a??(ie?void 0:U)),Y=T?Gz:d,[se,ve]=R.useState(null),ye=R.useRef(!1),he=R.useRef(null),pe=R.useRef(!1),Te=N==="none"&&!T,Ie=ke(ne=>{const J=T||E.state.inline;J&&!E.state.hasInputValue&&E.state.setInputValue("",$e(xr)),E.update({inputElement:ne,inputInsidePopup:J,inputOwnsFormValue:Te})}),De=T?c:b.getValidationProps(W,c);function Ee(){E.state.setIndices({activeIndex:null,selectedIndex:null,type:E.state.keyboardActiveRef.current?kw:Iw})}function _e(){E.state.keyboardActiveRef.current=!1}const Me={...Y,open:G,disabled:W,readOnly:I,popupSide:$,listEmpty:K};function oe(ne){if(!w)return;let J;const{highlightedChipIndex:le}=w,we=w.chipsRef.current.length,[de,me]=rG(k);return le!==void 0?(ne.key===de?(ne.preventDefault(),le>0?J=le-1:J=void 0):ne.key===me?(ne.preventDefault(),le<we-1?J=le+1:J=void 0):(ne.key==="Backspace"||ne.key==="Delete")&&(ne.preventDefault(),J=iG(le,q.length),Ee()),J):(ne.key===de&&(ne.currentTarget.selectionStart??0)===0&&q.length>0&&(ne.preventDefault(),J=we>0?we-1:void 0),J)}const xe=ot("input",e,{state:Me,ref:[n,E.state.inputRef,Ie],props:[H,F,{value:se??M,"aria-readonly":I||void 0,"aria-required":P||void 0,"aria-labelledby":x,disabled:W,readOnly:I,required:N==="none"?P:void 0,form:j,...Te&&L&&{name:L},id:ae,onFocus(){if(m(!0),!X||!pe.current)return;pe.current=!1;const ne=he.current;ne==null||!Object.hasOwn(E.state.valuesRef.current,ne)||E.state.setIndices({activeIndex:ne})},onBlur(){g(!0),m(!1);const ne=E.state.activeIndex;if(X&&ne!==null&&_!=="always"&&(he.current=ne,pe.current=!0,E.state.setIndices({activeIndex:null})),y==="onBlur"){const J=N==="none"?M:q;b.commit(J)}},onCompositionStart(ne){Xg||(ye.current=!0,ve(ne.currentTarget.value))},onCompositionEnd(ne){ye.current=!1;const J=ne.currentTarget.value;ve(null),E.state.setInputValue(J,$e(dd,ne.nativeEvent))},onChange(ne){const J=ne.nativeEvent,le=J.inputType,we=!le||le==="insertReplacementText",de=ye.current||!we;function me(xt){I||W||!xt||!de||(E.state.setOpen(!0,$e(dd,J)),z||Ee())}if(ye.current){const xt=ne.currentTarget.value;ve(xt),xt===""&&!E.state.openOnInputClick&&!E.state.inputInsidePopup&&E.state.setOpen(!1,$e(as,J));const st=xt.trim(),Ct=z&&st!=="";me(st),G&&E.state.activeIndex!==null&&!Ct&&Ee();return}const Be=$e(dd,J);if(E.state.setInputValue(ne.currentTarget.value,Be),Be.isCanceled)return;const Ke=ne.currentTarget.value==="",wt=$e(as,J);Ke&&!E.state.inputInsidePopup&&(N==="single"&&E.state.setSelectedValue(null,wt),E.state.openOnInputClick||E.state.setOpen(!1,wt)),me(ne.currentTarget.value.trim()),G&&E.state.activeIndex!==null&&!z&&Ee()},onKeyDown(ne){if(W||I||ne.ctrlKey||ne.shiftKey||ne.altKey||ne.metaKey)return;E.state.keyboardActiveRef.current=!0;const J=ne.currentTarget,le=J.scrollWidth-J.clientWidth,we=k==="rtl";if(ne.key==="Home"){Nr(ne);const Be=mA&&we?J.value.length:0;J.setSelectionRange(Be,Be),J.scrollLeft=0;return}if(ne.key==="End"){Nr(ne);const Be=mA&&we?0:J.value.length;J.setSelectionRange(Be,Be),J.scrollLeft=we?-le:le;return}if(!B&&ne.key==="Escape"){const Be=N==="multiple"&&Array.isArray(q)?q.length===0:q===null,Ke=$e(Wc,ne.nativeEvent),wt=N==="multiple"?[]:null;E.state.setInputValue("",Ke),E.state.setSelectedValue(wt,Ke),!Be&&!E.state.inline&&!Ke.isPropagationAllowed&&ne.stopPropagation();return}if(w&&ne.key==="Backspace"&&J.value===""&&w.highlightedChipIndex===void 0&&Array.isArray(q)&&q.length>0){const Be=w.chipsRef.current.length,Ke=Be>0?Be-1:q.length-1,wt=q.filter((xt,st)=>st!==Ke);Ee(),E.state.setSelectedValue(wt,$e(xr,ne.nativeEvent));return}const de=w?.highlightedChipIndex!==void 0,me=oe(ne);if(w?.setHighlightedChipIndex(me),me!==void 0?w?.chipsRef.current[me]?.focus():de&&E.state.inputRef.current?.focus(),ne.which!==229&&ne.key==="Enter"&&G){const Be=E.state.activeIndex,Ke=ne.nativeEvent;if(Be===null){if(X)return;E.state.setOpen(!1,$e(xr,Ke));return}Nr(ne),mN(E,Be,Ke)}},onPointerMove:_e,onPointerDown:_e},De],stateAttributesMapping:dN}),Pe=T?O.jsx(v1.Provider,{value:Wz,children:xe}):xe;return O.jsxs(R.Fragment,{children:[G&&ee&&O.jsx(pN,{ref:E.state.startDismissRef}),Pe]})});function sG(t,e,n,r,i){if(t.baseUIHandlerPrevented||r)return;const s=mn(t.nativeEvent),a=It(s)?s:null;a!==t.currentTarget&&(i?.(a)||$D(a))||(t.preventDefault(),!n&&(e.state.inputRef.current?.focus(),e.state.openOnInputClick&&e.state.setOpen(!0,$e(WD,t.nativeEvent))))}const lG=R.forwardRef(function(e,n){const{render:r,className:i,style:s,...a}=e,{state:u}=$o(),c=vo(),d=Se(c,Ue.open),h=Se(c,Ue.disabled),g=Se(c,Ue.readOnly),m=Se(c,Ue.hasSelectedValue),y=Se(c,Ue.selectionMode),b=gN(c),x=h,w=oy(),T={...u,open:d,disabled:x,readOnly:g,popupSide:b,listEmpty:w,placeholder:y==="none"?!1:!m},E=ke(M=>{c.set("inputGroupElement",M)});return ot("div",e,{ref:[n,E],props:[{role:"group",onMouseDown(M){sG(M,c,x,g,k=>Ge(c.state.chipsContainerRef.current,k))}},a],state:T,stateAttributesMapping:dN})}),aG=R.createContext(null);function uG(){return R.useContext(aG)}function cG(t){const{children:e}=t,{filteredItems:n}=ch(),r=uG(),i=r?r.items:n;return O.jsx(R.Fragment,{children:i.map(e)})}const fG=R.forwardRef(function(e,n){var r;const{render:i,className:s,style:a,children:u,...c}=e,d=vo(),h=w1(),g=!!C1(!0),{filteredItems:m,hasItems:y}=ch(),b=Se(d,Ue.selectionMode),x=Se(d,Ue.grid),w=Se(d,Ue.listProps),C=Se(d,Ue.virtualized),T=Se(d,Ue.forceMounted),E=b==="multiple",M=m.length===0,k=ke(_=>{d.set("positionerElement",_)}),P=ke(_=>{d.set("listElement",_)}),A=R.useMemo(()=>typeof u=="function"?r||(r=O.jsx(cG,{children:u})):u,[u]),I={empty:M},L=h.useState("floatingId"),j=ot("div",e,{state:I,ref:[n,P,g?null:k],props:[w,{children:A,tabIndex:-1,id:L,role:x?"grid":"listbox","aria-multiselectable":E?"true":void 0,onKeyDown(_){if(!(d.state.disabled||d.state.readOnly)&&_.key==="Enter"){const H=d.state.activeIndex;if(H==null)return;Nr(_),mN(d,H,_.nativeEvent)}},onKeyDownCapture(){d.state.keyboardActiveRef.current=!0},onPointerMoveCapture(){d.state.keyboardActiveRef.current=!1}},c]});if(C)return j;const N=y&&!T?void 0:d.state.labelsRef;return O.jsx(uh,{elementsRef:d.state.listRef,labelsRef:N,children:j})}),dG="",hG=200;function pG(t){const e=t.ownerDocument.createTreeWalker(t,NodeFilter.SHOW_TEXT);let n=null;for(;e.nextNode();){const r=e.currentNode;r.nodeValue!==""&&(n=r)}return n}function gG(){const t=lr(),e=R.useRef(null);return R.useEffect(()=>{if(eh)return;const n=e.current;if(n==null)return;const r=pG(n);if(r==null)return;const i=r.data,s=`${i}${dG}`;return r.nodeValue=s,t.start(hG,()=>{r.nodeValue===s&&(r.nodeValue=i)}),()=>{t.clear(),r.nodeValue===s&&(r.nodeValue=i)}},[e,t]),e}const yN=R.createContext(void 0);function mG(){const t=R.useContext(yN);if(t===void 0)throw new Error(Jt(20));return t}const yG=R.forwardRef(function(e,n){const{keepMounted:r=!1,...i}=e,s=vo(),a=Se(s,Ue.mounted),u=Se(s,Ue.forceMounted);return a||r||u?O.jsx(yN.Provider,{value:r,children:O.jsx(Um,{ref:n,...i})}):null}),vG=R.forwardRef(function(e,n){const{render:r,className:i,anchor:s,positionMethod:a,side:u,align:c,sideOffset:d,alignOffset:h,collisionBoundary:g="clipping-ancestors",collisionPadding:m,arrowPadding:y,sticky:b,disableAnchorTracking:x=!1,collisionAvoidance:w=Hw,style:C,...T}=e,E=vo(),M=w1(),k=mG(),P=Se(E,Ue.modal),A=Se(E,Ue.open),I=Se(E,Ue.mounted),L=Se(E,Ue.openMethod),j=Se(E,Ue.positionerElement),N=Se(E,Ue.triggerElement),_=Se(E,Ue.inputElement),H=Se(E,Ue.inputGroupElement),F=Se(E,Ue.inputInsidePopup),G=Se(E,Ue.transitionStatus),B=oy(),U=Xm({anchor:s??(F?N:H??_),floatingRootContext:M,positionMethod:a,mounted:I,side:u,sideOffset:d,align:c,alignOffset:h,arrowPadding:y,collisionBoundary:g,collisionPadding:m,sticky:b,disableAnchorTracking:x,keepMounted:k,collisionAvoidance:w,lazyFlip:!0});l1(A&&P,L==="touch",j,N);const X={open:A,side:U.side,align:U.align,anchorHidden:U.anchorHidden,empty:B};Ae(()=>{E.set("popupSide",U.side)},[E,U.side]);const Z=ke($=>{E.set("positionerElement",$)}),z=Qm(e,X,{styles:U.positionerStyles,transitionStatus:G,props:T,refs:[n,Z],hidden:!I,inert:!A});return O.jsxs(hN.Provider,{value:U,children:[I&&P&&O.jsx(ty,{inert:Xc(!A),cutout:H??_??N}),z]})}),bG={...lh,...Uo},xG=R.forwardRef(function(e,n){const{render:r,className:i,style:s,initialFocus:a,finalFocus:u,...c}=e,d=vo(),h=C1(),g=w1(),m=Se(d,Ue.mounted),y=Se(d,Ue.open),b=Se(d,Ue.openMethod),x=Se(d,Ue.popupProps),w=Se(d,Ue.transitionStatus),C=Se(d,Ue.inputInsidePopup),T=Se(d,Ue.inputElement),E=Se(d,Ue.modal),M=Se(d,Ue.id),k=oy(),P=c.id??(C?Y9(M):void 0);Ae(()=>(d.set("popupId",d.state.popupRef.current?.id||P),()=>{d.set("popupId",void 0)}),[d,P]),ui({open:y,ref:d.state.popupRef,onComplete(){y&&d.state.onOpenChangeComplete(!0)}});const A={open:y,side:h.side,align:h.align,anchorHidden:h.anchorHidden,transitionStatus:w,empty:k},I=ot("div",e,{state:A,ref:[n,d.state.popupRef],props:[x,{id:P,role:C?"dialog":"presentation",onFocus(H){const F=mn(H.nativeEvent);b!=="touch"&&(Ge(d.state.listElement,F)||F===H.currentTarget)&&d.state.inputRef.current?.focus()}},ah(w),c],stateAttributesMapping:bG}),j=a===void 0?C?H=>H==="touch"?d.state.popupRef.current:T:!1:a;let N;u!=null?N=u:N=C?void 0:!1;const _=!C||E;return O.jsx($m,{context:g,disabled:!m,modal:_,openInteractionType:b,initialFocus:j,returnFocus:N,getInsideElements:()=>[d.state.startDismissRef.current,d.state.endDismissRef.current],children:O.jsxs(R.Fragment,{children:[I,_&&O.jsx(pN,{ref:d.state.endDismissRef})]})})}),SG=R.forwardRef(function(e,n){const{render:r,className:i,style:s,...a}=e;return ot("span",e,{ref:n,props:[{"aria-hidden":!0,children:"▼"},a]})}),vN=R.createContext(void 0);function bN(){const t=R.useContext(vN);if(!t)throw new Error(Jt(19));return t}const wG=R.createContext(!1);function CG(){return R.useContext(wG)}function xN(t){const{componentProps:e,forwardedRef:n,virtualized:r,indexFromFilter:i}=t,{render:s,className:a,style:u,value:c=null,index:d,disabled:h=!1,nativeButton:g=!1,...m}=e,y=R.useRef(null),b=Qc({guess:!0,index:d,textRef:y}),x=vo(),w=CG(),C=K9(),T=Se(x,Ue.selectionMode),E=Se(x,Ue.disabled),M=Se(x,Ue.readOnly),k=Se(x,Ue.isItemEqualToValue),P=E||h,A=T!=="none",I=d??i??b.index,L=I!==-1,j=Se(x,Ue.id),N=Se(x,Ue.isActive,I),_=Se(x,Ue.isSelected,c),H=Se(x,Ue.itemProps),F=R.useRef(null),G=j!=null&&L?`${j}-${I}`:void 0,B=_&&A;Ae(()=>{if(!(L&&(r||d!=null)))return;const ie=x.state.listRef.current;return ie[I]=F.current,()=>{delete ie[I]}},[L,r,I,d,x]),Ae(()=>{if(!L||C)return;const K=x.state.valuesRef.current;return K[I]=c,()=>{delete K[I]}},[L,C,I,c,x]),Ae(()=>{if(!L||C)return;const K=x.state.selectedValue,ie=Array.isArray(K)?K[K.length-1]:K;go(c,ie,k)&&x.set("selectedIndex",I)},[L,C,x,I,c,k]);const{getButtonProps:q,buttonRef:U}=yo({disabled:P,focusableWhenDisabled:!0,native:g,composite:!0}),X={disabled:P,selected:B,highlighted:N};function Z(K){function ie(){x.state.handleSelection(K,c)}x.state.submitOnItemClick?(po.flushSync(ie),x.state.requestSubmit()):ie()}const z={id:G,role:w?"gridcell":"option","aria-selected":A?B:void 0,tabIndex:void 0,onPointerDownCapture(K){K.isPrimary&&(x.state.pointerDownItemRef.current=K.currentTarget),K.preventDefault()},onMouseDown(K){K.preventDefault()},onClick(K){P||M||Z(K.nativeEvent)},onMouseUp(K){const ie=x.state.pointerDownItemRef.current===K.currentTarget;x.state.pointerDownItemRef.current=null,!(P||M||K.button!==0||ie||!N)&&Z(K.nativeEvent)}},$=ot("div",e,{ref:[U,n,b.ref,F],state:X,props:[H,z,m,q]}),W=R.useMemo(()=>({selected:B,textRef:y}),[B,y]);return O.jsx(vN.Provider,{value:W,children:$})}function RG(t){const{componentProps:e,forwardedRef:n}=t,r=vo(),i=Se(r,Ue.isItemEqualToValue),{flatFilteredItems:s}=ch(),a=bc(s,e.value??null,i);return O.jsx(xN,{componentProps:e,forwardedRef:n,virtualized:!0,indexFromFilter:a})}const TG=R.memo(R.forwardRef(function(e,n){const r=vo(),i=Se(r,Ue.virtualized);return i&&e.index==null?O.jsx(RG,{componentProps:e,forwardedRef:n}):O.jsx(xN,{componentProps:e,forwardedRef:n,virtualized:i,indexFromFilter:void 0})})),EG=R.forwardRef(function(e,n){const{selected:r}=bN();return e.keepMounted||r?O.jsx(MG,{...e,ref:n}):null}),MG=R.memo(R.forwardRef((t,e)=>{const{render:n,className:r,style:i,keepMounted:s,...a}=t,{selected:u}=bN(),c=R.useRef(null),{transitionStatus:d,setMounted:h}=hl(u),m=ot("span",t,{ref:[e,c],state:{selected:u,transitionStatus:d},props:[{"aria-hidden":!0,children:"✔️"},a],stateAttributesMapping:Uo});return ui({open:u,ref:c,onComplete(){u||h(!1)}}),m})),AG=R.forwardRef(function(e,n){const{render:r,className:i,style:s,children:a,...u}=e,{filteredItems:c}=ch(),d=vo(),h=gG(),g=c.length===0?a:null;return ot("div",e,{ref:[n,d.state.emptyRef,h],props:[{children:g,role:"status","aria-live":"polite","aria-atomic":!0},u]})}),OG={...Uo,...Ym},kG=R.forwardRef(function(e,n){const{render:r,className:i,disabled:s=!1,nativeButton:a=!0,keepMounted:u=!1,style:c,...d}=e,{disabled:h}=$o(),g=vo(),m=Se(g,Ue.selectionMode),y=Se(g,Ue.disabled),b=Se(g,Ue.readOnly),x=Se(g,Ue.open),w=Se(g,Ue.selectedValue),C=Se(g,Ue.hasSelectionChips),T=uN();let E=!1;m==="none"?E=T!=="":m==="single"?E=w!=null:E=C;const M=h||y||s,{buttonRef:k,getButtonProps:P}=yo({native:a,disabled:M}),{mounted:A,transitionStatus:I,setMounted:L}=hl(E),j={disabled:M,visible:E,open:x,transitionStatus:I};ui({open:E,ref:g.state.clearRef,onComplete(){E||L(!1)}});const N=ot("button",e,{state:j,ref:[n,k,g.state.clearRef],props:[{tabIndex:-1,children:"x",onMouseDown(H){H.preventDefault()},onClick(H){if(M||b)return;const F=g.state.keyboardActiveRef.current?kw:Iw;g.state.setInputValue("",$e(vA,H.nativeEvent)),m!=="none"?(g.state.setSelectedValue(Array.isArray(w)?[]:null,$e(vA,H.nativeEvent)),g.state.setIndices({activeIndex:null,selectedIndex:null,type:F})):g.state.setIndices({activeIndex:null,type:F}),g.state.inputRef.current?.focus()}},d,P],stateAttributesMapping:OG});return u||A?N:null}),SN=R.createContext(void 0);function R1(){const t=R.useContext(SN);if(t===void 0)throw new Error(Jt(64));return t}const sy={tabActivationDirection:t=>({"data-activation-direction":t})},IG=R.forwardRef(function(e,n){const{className:r,defaultValue:i=0,onValueChange:s,orientation:a="horizontal",render:u,value:c,style:d,...h}=e,g=e.defaultValue!==void 0,m=R.useRef([]),[y,b]=R.useState(()=>new Map),[x,w]=la({controlled:c,default:i,name:"Tabs",state:"value"}),C=c!==void 0,[T,E]=R.useState(()=>new Map),M=R.useRef(void 0),k=R.useCallback(Y=>tS(T,Y),[T]),[P,A]=R.useState(()=>({previousValue:x,tabActivationDirection:"none"})),{previousValue:I,tabActivationDirection:L}=P;let j=L,N=!1;I!==x&&(j=zO(I,x,a,T),N=I!=null&&x!=null&&k(x)==null);const _=N?I:x,H=I!==_||L!==j;Ae(()=>{H&&A({previousValue:_,tabActivationDirection:j})},[_,H,j]);const F=ke((Y,se)=>{const ve=zO(x,Y,a,T);se.activationDirection=ve,s?.(Y,se),!se.isCanceled&&w(Y)}),G=ke((Y,se)=>{s?.(Y,$e(se,void 0,void 0,{activationDirection:"none"}))}),B=ke((Y,se)=>(b(ve=>{const ye=new Map(ve);return ye.set(Y,se),ye}),()=>{b(ve=>{if(ve.get(Y)!==se)return ve;const ye=new Map(ve);return ye.delete(Y),ye})})),q=R.useCallback(Y=>y.get(Y),[y]),U=R.useCallback(Y=>{for(const se of T.values())if(Y===se.value)return se.id},[T]),X=R.useMemo(()=>({getTabElementBySelectedValue:k,getTabIdByPanelValue:U,getTabPanelIdByValue:q,onValueChange:F,orientation:a,registerMountedTabPanel:B,setTabMap:E,tabActivationDirection:j,value:x}),[k,U,q,F,a,B,E,j,x]),Z=R.useMemo(()=>{for(const Y of T.values())if(Y.value===x)return Y},[T,x]),z=R.useMemo(()=>{for(const Y of T.values())if(!Y.disabled)return Y.value},[T]),$=R.useRef(!g),W=R.useRef(i),K=R.useRef(g),ie=R.useRef(!1);Ae(()=>{if(C)return;function Y(he,pe){w(he),A({previousValue:he,tabActivationDirection:"none"}),G(he,pe),$.current=!1}if(T.size===0){ie.current&&x!==null&&!M.current?.isConnected&&Y(null,bA);return}ie.current=!0,M.current=T.keys().next().value;const se=Z?.disabled,ve=Z==null&&x!==null;if(!se&&x===W.current&&(K.current=!1),K.current&&se&&x===W.current)return;const ye=$.current;if(se||ve){const he=z??null;if(x===he){$.current=!1;return}let pe=bA;ye?pe=xA:se&&(pe=YD),Y(he,pe);return}ye&&Z!=null&&(G(x,xA),$.current=!1)},[z,C,G,Z,w,T,x]);const ae=ot("div",e,{state:{orientation:a,tabActivationDirection:j},ref:n,props:h,stateAttributesMapping:sy});return O.jsx(SN.Provider,{value:X,children:O.jsx(uh,{elementsRef:m,children:ae})})});function tS(t,e){for(const[n,r]of t.entries())if(e===r.value)return n;return null}function zO(t,e,n,r){if(t==null||e==null)return"none";const[i,s,a]=n==="horizontal"?["left","left","right"]:["top","up","down"],u=tS(r,t),c=tS(r,e);if(u==null||c==null)return u!==c&&(typeof t=="number"||typeof t=="string")&&typeof t==typeof e?e>t?a:s:"none";const d=u.getBoundingClientRect()[i],h=c.getBoundingClientRect()[i];return h<d?s:h>d?a:"none"}const wN="data-composite-item-active",CN=R.createContext(void 0);function DG(){const t=R.useContext(CN);if(t===void 0)throw new Error(Jt(65));return t}const PG=R.forwardRef(function(e,n){const{className:r,disabled:i=!1,render:s,value:a,id:u,nativeButton:c=!0,style:d,...h}=e,{value:g,getTabPanelIdByValue:m,onValueChange:y,orientation:b,tabActivationDirection:x}=R1(),{activateOnFocus:w,registerTabResizeObserverElement:C,tabsListElement:T}=DG(),{highlightedIndex:E,onHighlightedIndexChange:M}=Zm(),k=ei(u),P=R.useMemo(()=>({disabled:i,id:k,value:a}),[i,k,a]),{compositeProps:A,compositeRef:I,index:L}=fz({metadata:P}),j=a===g,N=R.useRef(!1),_=R.useRef(null),H=ke(ie=>{_.current?.(),_.current=ie?C(ie):null});Ae(()=>{if(N.current){N.current=!1;return}if(!(j&&L>-1&&E!==L))return;const ie=T;if(ie!=null){const ee=ir(vt(ie));if(ee&&Ge(ie,ee))return}i||M(L)},[j,L,E,M,i,T]);const{getButtonProps:F,buttonRef:G}=yo({disabled:i,native:c,focusableWhenDisabled:!0}),B=m(a),q=R.useRef(!1),U=R.useRef(!1);function X(ie){y(a,$e(xr,ie.nativeEvent,void 0,{activationDirection:"none"}))}function Z(ie){j||i||X(ie)}function z(ie){j||i||w&&(!q.current||U.current)&&X(ie)}function $(ie){if(j||i)return;q.current=!0,U.current=ie.button===0;const ee=vt(ie.currentTarget);function ae(){q.current=!1,U.current=!1,ee.removeEventListener("pointerup",ae),ee.removeEventListener("pointercancel",ae)}ee.addEventListener("pointerup",ae),ee.addEventListener("pointercancel",ae)}return ot("button",e,{state:{disabled:i,active:j,orientation:b,tabActivationDirection:x},ref:[n,G,I,H],props:[A,{role:"tab","aria-controls":B,"aria-selected":j,id:k,onClick:Z,onFocus:z,onPointerDown:$,[wN]:j?"":void 0,onKeyDownCapture(){N.current=!0}},h,F],stateAttributesMapping:sy})}),zG={...sy,...Uo},NG=R.forwardRef(function(e,n){const{className:r,value:i,render:s,keepMounted:a=!1,style:u,...c}=e,{value:d,getTabIdByPanelValue:h,orientation:g,tabActivationDirection:m,registerMountedTabPanel:y}=R1(),b=ei(),{ref:x,index:w}=Qc(),C=i===d,{mounted:T,transitionStatus:E,setMounted:M}=hl(C),k=!T,P=h(i),A={hidden:k,orientation:g,tabActivationDirection:m,transitionStatus:E},I=R.useRef(null),L=ot("div",e,{state:A,ref:[n,x,I],props:[{"aria-labelledby":P,hidden:k,id:b,role:"tabpanel",tabIndex:C?0:-1,inert:Xc(!C),"data-index":w},c],stateAttributesMapping:zG});return ui({open:C,ref:I,onComplete(){C||M(!1)}}),Ae(()=>{if(!(b==null||k&&!a))return y(i,b)},[k,a,i,b,y]),a||T?L:null}),LG=[];function BG(t){const{loopFocus:e=!0,orientation:n="both",grid:r,onLoop:i,direction:s,highlightedIndex:a,onHighlightedIndexChange:u,rootRef:c,enableHomeAndEndKeys:d=!1,stopEventPropagation:h,disabledIndices:g,modifierKeys:m=LG}=t,[y,b]=R.useState(0),x=r!=null,w=R.useRef(null),C=ws(w,c),T=R.useRef([]),E=R.useRef(!1),M=a??y,k=ke((j,N=!1)=>{if((u??b)(j),N){const _=T.current[j];iO(w.current,_,s,n)}}),P=ke(j=>{if(j.size===0||E.current)return;E.current=!0;const N=Array.from(j.keys()),_=N.find(F=>F?.hasAttribute(wN))??null,H=_?j.get(_)?.index??-1:-1;if(H!==-1)k(H);else if(Dc(N,M,g)){const F=Ar(N,{disabledIndices:g});sa(N,F)||k(F)}iO(w.current,_,s,n)});Ae(()=>{if(g==null||a!=null||!E.current)return;const j=T.current;if(Dc(j,M,g)){const N=Ar(j,{disabledIndices:g});sa(j,N)||k(N)}},[g,a,M,T,k]);const A=ke((j,N,_)=>i?i(j,N,_,T):_),I=ke(j=>{const N=j.key===Yx||j.key===Xx;if(!ey.has(j.key)||!d&&N||jG(j,m)||!w.current)return;const H=s==="rtl",F=H?Wx:Kx,G=H?Kx:Wx,B=n==="vertical"?Gx:F,q=n==="vertical"?qx:G,U=mn(j.nativeEvent);if(U!=null&&rO(U)&&!gz(U)){const K=U.selectionStart,ie=U.selectionEnd,ee=U.value;if(K==null||j.shiftKey||K!==ie||j.key!==q&&K<ee.length||j.key!==B&&K>0)return}let X=M;const Z=Og(T,g),z=Fx(T,g);r!=null&&(X=r({disabledIndices:g,elementsRef:T,event:j,highlightedIndex:M,loopFocus:e,maxIndex:z,minIndex:Z,onLoop:A,orientation:n,rtl:H}));const $=n!=="vertical"&&j.key===F||n!=="horizontal"&&j.key===Gx,W=n!=="vertical"&&j.key===G||n!=="horizontal"&&j.key===qx;d&&(j.key===Yx?X=Z:j.key===Xx&&(X=z)),X===M&&($||W)&&(e&&X===z&&$?(X=Z,i&&(X=i(j,M,X,T))):e&&X===Z&&W?(X=z,i&&(X=i(j,M,X,T))):X=Ar(T.current,{startingIndex:X,decrement:W,disabledIndices:g})),X!==M&&!sa(T.current,X)&&(h&&j.stopPropagation(),(x||N||$||W)&&j.preventDefault(),k(X,!0),queueMicrotask(()=>{T.current[X]?.focus()}))});return{props:{ref:C,onFocus(j){const N=w.current,_=mn(j.nativeEvent);!N||_==null||!rO(_)||_.setSelectionRange(0,_.value.length)},onKeyDown:I},highlightedIndex:M,onHighlightedIndexChange:k,elementsRef:T,onMapChange:P,relayKeyboardEvent:I}}function jG(t,e){for(const n of R2)if(!e.includes(n)&&t.getModifierState(n))return!0;return!1}function RN(t){const{render:e,className:n,style:r,refs:i=Si,props:s=Si,state:a=gn,stateAttributesMapping:u,highlightedIndex:c,onHighlightedIndexChange:d,orientation:h,grid:g,loopFocus:m,onLoop:y,enableHomeAndEndKeys:b,onMapChange:x,stopEventPropagation:w=!0,rootRef:C,disabledIndices:T,modifierKeys:E,highlightItemOnHover:M=!1,tag:k="div",...P}=t,A=Yc(),{props:I,highlightedIndex:L,onHighlightedIndexChange:j,elementsRef:N,onMapChange:_,relayKeyboardEvent:H}=BG({grid:g,loopFocus:m,onLoop:y,orientation:h,highlightedIndex:c,onHighlightedIndexChange:d,rootRef:C,stopEventPropagation:w,enableHomeAndEndKeys:b,direction:A,disabledIndices:T,modifierKeys:E}),F=ot(k,t,{state:a,ref:i,props:[I,...s,P],stateAttributesMapping:u}),G=R.useMemo(()=>({highlightedIndex:L,onHighlightedIndexChange:j,highlightItemOnHover:M,relayKeyboardEvent:H}),[L,j,M,H]);return O.jsx(ZP.Provider,{value:G,children:O.jsx(uh,{elementsRef:N,onMapChange:B=>{x?.(B),_(B)},children:F})})}const _G=R.forwardRef(function(e,n){const{activateOnFocus:r=!1,className:i,loopFocus:s=!0,render:a,style:u,...c}=e,{orientation:d,setTabMap:h,tabActivationDirection:g}=R1(),[m,y]=R.useState(0),[b,x]=R.useState(null),w=R.useRef(new Set),C=R.useRef(new Set),T=R.useRef(null);Ae(()=>{if(typeof ResizeObserver>"u")return;const I=new ResizeObserver(()=>{w.current.forEach(L=>{L()})});return T.current=I,b&&I.observe(b),C.current.forEach(L=>{I.observe(L)}),()=>{I.disconnect(),T.current=null}},[b]);const E=ke(I=>(w.current.add(I),()=>{w.current.delete(I)})),M=ke(I=>(C.current.add(I),T.current?.observe(I),()=>{C.current.delete(I),T.current?.unobserve(I)})),k={orientation:d,tabActivationDirection:g},P={"aria-orientation":d==="vertical"?"vertical":void 0,role:"tablist"},A=R.useMemo(()=>({activateOnFocus:r,registerIndicatorUpdateListener:E,registerTabResizeObserverElement:M,tabsListElement:b}),[r,E,M,b]);return O.jsx(CN.Provider,{value:A,children:O.jsx(RN,{render:a,className:i,style:u,state:k,refs:[n,x],props:[P,c],stateAttributesMapping:sy,highlightedIndex:m,enableHomeAndEndKeys:!0,loopFocus:s,orientation:d,onHighlightedIndexChange:y,onMapChange:h,disabledIndices:Si})})}),HG=R.createContext(void 0);function VG(t=!1){const e=R.useContext(HG);if(!e&&!t)throw new Error(Jt(86));return e}const FG=function(e){const n=ei(),r=e.controlId===void 0?n:e.controlId,[i,s]=R.useState(r),[a,u]=R.useState(e.labelId),[c,d]=R.useState([]),h=Qn(()=>new Map),{messageIds:g}=Rs(),m=ke((x,w)=>{const C=h.current;if(w===void 0){C.delete(x);return}C.set(x,w),s(T=>{if(C.size===0)return;let E;for(const M of C.values()){if(T!==void 0&&M===T)return T;E===void 0&&(E=M)}return E})}),y=R.useCallback(x=>{const w=x["aria-describedby"]?x["aria-describedby"].split(" "):[];return w.push(...g,...c),{...x,"aria-describedby":Array.from(new Set(w)).join(" ")||void 0}},[g,c]),b=R.useMemo(()=>({controlId:i,registerControlId:m,labelId:a,setLabelId:u,messageIds:c,setMessageIds:d,getDescriptionProps:y}),[i,m,a,u,c,d,y]);return O.jsx(Kz.Provider,{value:b,children:e.children})};function nS(t,e){return{...t,state:{...t.state,valid:!e&&t.state.valid}}}const bb=Object.keys(Nd);function UG(t,e){return t.matches(":disabled")?!1:!e||t.form===e?!0:t.form===null&&!t.hasAttribute("form")}function NO(t,e){let n=null;for(const r of t.keys())if(UG(r,e)){if(!r.validity.valid)return r;n??=r}return n}function LO(t,e){for(const n of e.keys())n.setCustomValidity("");t?.setCustomValidity("")}function $G(t){const{elementRef:e,formRef:n}=Eu(),{setValidityData:r,validate:i,validityData:s,validationDebounceTime:a,invalid:u,markedDirtyRef:c,state:d,shouldValidateOnChange:h,registeredFieldIdRef:g}=t,{controlId:m,getDescriptionProps:y}=Rs(),b=lr(),x=R.useRef(null),w=Qn(()=>new Map).current,C=R.useRef(0),T=R.useCallback((A,I)=>(w.set(A,I),()=>{w.delete(A)}),[w]),E=ke(()=>{const A=NO(w,e.current);return A&&w.get(A)?.controlRef.current||null}),M=ke(async(A,I=!1)=>{C.current+=1;const L=C.current;function j(Z,z=u){const $=g.current??m;if($==null)return;const W=n.current.fields.get($);if(!W)return;const K=nS(Z,z);n.current.fields.set($,{...W,validityData:K})}function N(Z,z){const $={value:A,state:{...Nd,valid:!0},error:"",errors:[],initialValue:s.initialValue};LO(Z,w),j($,z),r($)}const _=w.size>0?NO(w,e.current):x.current;if(I){if(d.valid!==!1||!_)return;const Z=_.validity;if(!Z.valueMissing){N(_,!1);return}for(const z of bb)if(z!=="valid"&&z!=="valueMissing"&&z!=="customError"&&Z[z])return}function H(Z){const z=bb.reduce((W,K)=>(W[K]=Z.validity[K],W),{});let $=!1;for(const W of bb)if(W!=="valid"){if(W==="valueMissing"&&z[W])$=!0;else if(z[W])return z}return $&&!c.current&&(z.valid=!0,z.valueMissing=!1),z}b.clear();let F=null,G=[];const B=_?H(_):{...Nd,valid:!0};let q;const U=h();if(_&&_.validationMessage&&!U)q=_.validationMessage,G=[_.validationMessage];else{const Z=Array.from(n.current.fields.values()).reduce(($,W)=>(W.name&&($[W.name]=W.getValue()),$),{}),z=i(A,Z);if(typeof z=="object"&&z!==null&&"then"in z){if(F=await z,L!==C.current)return}else F=z;F!==null?(B.valid=!1,B.customError=!0,Array.isArray(F)?(G=F,_?.setCustomValidity(F.join(`
|
|
18
|
+
`))):F&&(G=[F],_?.setCustomValidity(F))):U&&(LO(_,w),B.customError=!1,_&&_.validationMessage?(q=_.validationMessage,G=[_.validationMessage]):(!_||_.validity.valid)&&!B.valid&&(B.valid=!0))}const X={value:A,state:B,error:q??(Array.isArray(F)?F[0]:F??""),errors:G,initialValue:s.initialValue};j(X),r(X)}),k=ke(A=>{b.clear();const I=h();I&&A!==""&&a?(C.current+=1,b.start(a,()=>{M(A)})):M(A,!I)}),P=R.useCallback((A,I={})=>Zr(y(I),d.valid===!1&&!d.disabled&&!A?{"aria-invalid":!0}:gn),[y,d.disabled,d.valid]);return R.useMemo(()=>({getValidationProps:P,inputRef:x,registeredInputs:w,registerInput:T,getInputControl:E,commit:M,change:k}),[P,w,T,E,M,k])}function qG(t){const{commit:e,invalid:n,markedDirtyRef:r,name:i,setRegisteredFieldName:s,registeredFieldIdRef:a,setValidityData:u,validityData:c}=t,{formRef:d}=Eu(),h=R.useRef(null),g=R.useRef(null),m=R.useRef(!1),y=ke(()=>{const M=g.current;if(M)return M.getValue?M.getValue():M.value});function b(M){return M.value===void 0?y():M.value}const x=ke(()=>{const M=g.current;if(r.current=!0,!M){e(c.value);return}e(b(M))});function w(){const M=g.current;!M||!M.id||d.current.fields.set(M.id,{getValue:y,name:i??M.name,controlRef:M.controlRef,validityData:nS(c,n),validate:x})}function C(M=g.current?.id){M&&d.current.fields.delete(M)}function T(M){if(m.current)return;m.current=!0;const k=b(M);u(P=>P.initialValue===k?P:{...P,initialValue:k})}Ae(()=>{const M=g.current;!M||!M.id||(s(i?void 0:M.name),d.current.fields.set(M.id,{getValue:y,name:i??M.name,controlRef:M.controlRef,validityData:nS(c,n),validate:x}))},[d,y,n,i,s,x,c]),Ae(()=>{const M=d.current.fields;return()=>{const k=g.current?.id;k&&M.delete(k)}},[d]);const E=ke((M,k)=>{if(!k){h.current===M&&(h.current=null,C(),g.current=null,s(void 0),a.current=void 0);return}const P=g.current?.id;h.current=M,g.current=k,i||s(k.name),a.current=k.id,P&&P!==k.id&&C(P),T(k),w()});return[x,E]}const GG=R.forwardRef(function(e,n){const{errors:r,validationMode:i,submitAttemptedRef:s}=Eu(),{render:a,className:u,validate:c,validationDebounceTime:d=0,validationMode:h=i,name:g,disabled:m=!1,invalid:y,dirty:b,touched:x,actionsRef:w,style:C,...T}=e,E=VG(!0)?.disabled,M=ke(c||(()=>null)),k=E||m,[P,A]=R.useState(!1),[I,L]=R.useState(!1),[j,N]=R.useState(!1),[_,H]=R.useState(!1),F=b??I,G=x??P,B=R.useRef(F),q=R.useRef(void 0),[U,X]=R.useState(),Z=g??U;Ae(()=>{b!==void 0&&(B.current=b)},[b]);const z=ke(De=>{b===void 0&&(De&&(B.current=!0),L(De))}),$=ke(De=>{x===void 0&&A(De)}),W=ke(()=>h==="onChange"||h==="onSubmit"&&s.current),K=Z&&Object.hasOwn(r,Z)?r[Z]:null,ie=!!(Array.isArray(K)?K.length:K),ee=y===!0||ie,[ae,Y]=R.useState({state:Nd,error:"",errors:[],value:null,initialValue:null}),se=!ee&&(k?null:ae.state.valid),ve=R.useMemo(()=>({disabled:k,touched:G,dirty:F,valid:se,filled:j,focused:_}),[k,G,F,se,j,_]),ye=$G({setValidityData:Y,validate:M,validityData:ae,validationDebounceTime:d,invalid:ee,markedDirtyRef:B,state:ve,shouldValidateOnChange:W,registeredFieldIdRef:q}),[he,pe]=qG({commit:ye.commit,invalid:ee,markedDirtyRef:B,name:g,setRegisteredFieldName:X,registeredFieldIdRef:q,setValidityData:Y,validityData:ae});R.useImperativeHandle(w,()=>({validate:he}),[he]);const Te=R.useMemo(()=>({invalid:ee,name:Z,validityData:ae,setValidityData:Y,disabled:k,setTouched:$,setDirty:z,setFilled:N,setFocused:H,validationMode:h,shouldValidateOnChange:W,state:ve,registerFieldControl:pe,validation:ye}),[ee,Z,ae,k,$,z,N,H,h,W,ve,pe,ye]),Ie=ot("div",e,{ref:n,state:ve,props:T,stateAttributesMapping:Tu});return O.jsx(v1.Provider,{value:Te,children:Ie})}),WG=R.forwardRef(function(e,n){return O.jsx(FG,{children:O.jsx(GG,{...e,ref:n})})}),KG=R.createContext({disabled:!1});function TN(){return R.useContext(KG)}const YG=R.forwardRef(function(e,n){const{render:r,className:i,style:s,id:a,nativeLabel:u=!0,...c}=e,d=$o(!1),h=TN(),{labelId:g}=Rs(),m={...d.state,disabled:d.disabled||h.disabled},y=R.useRef(null),b=R9({id:g??a,native:u});return ot("label",e,{ref:[n,y],state:m,props:[b,c],stateAttributesMapping:Tu})}),XG={...Tu,...Uo},QG=R.forwardRef(function(e,n){const{render:r,id:i,className:s,match:a,style:u,...c}=e,d=ei(i),{validityData:h,state:g,name:m}=$o(!1),{setMessageIds:y}=Rs(),{errors:b}=Eu(),x=m&&Object.hasOwn(b,m)?b[m]:null,w=!!(Array.isArray(x)?x.length:x),C=typeof a=="string";let T=!1;a===!0?T=!0:g.disabled?T=!1:C?T=!!h.state[a]:T=w||h.state.valid===!1;const{mounted:E,transitionStatus:M,setMounted:k}=hl(T);Ae(()=>{if(!(!T||!d))return y(B=>B.concat(d)),()=>{y(B=>B.filter(q=>q!==d))}},[T,d,y]);const P=R.useRef(null),[A,I]=R.useState(null),[L,j]=R.useState(null);let N=h.error;!C&&w?N=x:h.errors.length>1&&(N=h.errors);let _=N;Array.isArray(N)&&(_=N.length>1?O.jsx("ul",{children:N.map(B=>O.jsx("li",{children:B},B))}):N[0]);const H=Array.isArray(N)?JSON.stringify(N):N;T&&H!==L&&(j(H),I(_)),ui({open:T,ref:P,onComplete(){T||k(!1)}});const F={...g,transitionStatus:M},G=ot("div",e,{ref:[n,P],state:F,props:[{id:d,children:T?_:A},c],stateAttributesMapping:XG,enabled:E});return E?G:null}),ZG=R.forwardRef(function(e,n){const{render:r,id:i,className:s,style:a,...u}=e,c=ei(i),d=$o(!1),h=TN(),{setMessageIds:g}=Rs(),m={...d.state,disabled:d.disabled||h.disabled};return Ae(()=>{if(c)return g(b=>b.concat(c)),()=>{g(b=>b.filter(x=>x!==c))}},[c,g]),ot("p",e,{ref:n,state:m,props:[{id:c},u],stateAttributesMapping:Tu})}),JG=R.forwardRef(function(e,n){const{render:r,className:i,id:s,name:a,value:u,disabled:c=!1,onValueChange:d,defaultValue:h,autoFocus:g=!1,style:m,...y}=e,{state:b,name:x,disabled:w,setTouched:C,setDirty:T,validityData:E,setFocused:M,setFilled:k,validationMode:P,validation:A}=$o(),{clearErrors:I}=Eu(),L=w||c,j=x??a,N={...b,disabled:L},{labelId:_}=Rs(),H=iy({id:s});Ae(()=>{const Z=u!=null;A.inputRef.current?.value||Z&&u!==""?k(!0):Z&&u===""&&k(!1)},[A.inputRef,k,u]);const F=R.useRef(null);Ae(()=>{g&&F.current===ir(vt(F.current))&&M(!0)},[g,M]);const[G]=la({controlled:u,default:h,name:"FieldControl",state:"value"}),B=u!==void 0,q=B?G:void 0,U=ke(()=>A.inputRef.current?.value);return b1(A.inputRef,H,q,U,!L,a),ot("input",e,{ref:[n,F],state:N,props:[{id:H,disabled:L,name:j,ref:A.inputRef,"aria-labelledby":_,autoFocus:g,...B?{value:q}:{defaultValue:h},onChange(Z){const z=Z.currentTarget.value;d?.(z,$e(xr,Z.nativeEvent)),T(z!==(E.initialValue??"")),k(z!==""),Z.nativeEvent.defaultPrevented||(I(j),A.change(z))},onFocus(){M(!0)},onBlur(Z){C(!0),M(!1),P==="onBlur"&&A.commit(Z.currentTarget.value)},onKeyDown(Z){Z.currentTarget.tagName==="INPUT"&&Z.key==="Enter"&&(C(!0),A.commit(Z.currentTarget.value))}},y,Z=>A.getValidationProps(L,Z)],stateAttributesMapping:Tu})}),e7=R.forwardRef(function(e,n){const{disabled:r=!1,loopFocus:i,orientation:s="horizontal",className:a,render:u,style:c,...d}=e,[h,g]=R.useState(()=>new Map),m=R.useMemo(()=>{const w=[];for(const C of h.values())C.disabled&&!C.focusableWhenDisabled&&w.push(C.index);return w},[h]),y=R.useMemo(()=>({disabled:r,orientation:s}),[r,s]),b={disabled:r,orientation:s},x={"aria-orientation":s,role:"toolbar"};return O.jsx(iz.Provider,{value:y,children:O.jsx(RN,{render:u,className:a,style:c,state:b,refs:[n],props:[x,d],disabledIndices:m,loopFocus:i,onMapChange:g,orientation:s})})}),EN=R.createContext(void 0);function t7(){return R.useContext(EN)}const n7=R.forwardRef(function(e,n){const{className:r,disabled:i=!1,render:s,style:a,...u}=e,{orientation:c,disabled:d}=Jm(),h=d||i,g=R.useMemo(()=>({disabled:h}),[h]),y=ot("div",e,{state:{disabled:h,orientation:c},ref:n,props:[{role:"group"},u]});return O.jsx(EN.Provider,{value:g,children:y})}),r7=R.forwardRef(function(e,n){const{className:r,disabled:i=!1,focusableWhenDisabled:s=!0,render:a,nativeButton:u,style:c,...d}=e,{disabled:h,orientation:g}=Jm(),m=t7(),y=h||(m?.disabled??!1)||i,b=R.useMemo(()=>({disabled:y,focusableWhenDisabled:s}),[y,s]),{getButtonProps:x,buttonRef:w}=yo({disabled:y,focusableWhenDisabled:s,native:u}),C={disabled:y,orientation:g,focusable:s};return O.jsx(dz,{tag:"button",render:a,className:r,style:c,metadata:b,state:C,refs:[n,w],props:[d,a?{disabled:y}:gn,x]})});function ta(t,e){return typeof t=="function"?t(e):t}function _i(t,e){return n=>{e.setState(r=>({...r,[t]:ta(n,r[t])}))}}function ly(t){return t instanceof Function}function i7(t){return Array.isArray(t)&&t.every(e=>typeof e=="number")}function o7(t,e){const n=[],r=i=>{i.forEach(s=>{n.push(s);const a=e(s);a!=null&&a.length&&r(a)})};return r(t),n}function ht(t,e,n){let r=[],i;return s=>{let a;n.key&&n.debug&&(a=Date.now());const u=t(s);if(!(u.length!==r.length||u.some((h,g)=>r[g]!==h)))return i;r=u;let d;if(n.key&&n.debug&&(d=Date.now()),i=e(...u),n==null||n.onChange==null||n.onChange(i),n.key&&n.debug&&n!=null&&n.debug()){const h=Math.round((Date.now()-a)*100)/100,g=Math.round((Date.now()-d)*100)/100,m=g/16,y=(b,x)=>{for(b=String(b);b.length<x;)b=" "+b;return b};console.info(`%c⏱ ${y(g,5)} /${y(h,5)} ms`,`
|
|
19
|
+
font-size: .6rem;
|
|
20
|
+
font-weight: bold;
|
|
21
|
+
color: hsl(${Math.max(0,Math.min(120-120*m,120))}deg 100% 31%);`,n?.key)}return i}}function pt(t,e,n,r){return{debug:()=>{var i;return(i=t?.debugAll)!=null?i:t[e]},key:!1,onChange:r}}function s7(t,e,n,r){const i=()=>{var a;return(a=s.getValue())!=null?a:t.options.renderFallbackValue},s={id:`${e.id}_${n.id}`,row:e,column:n,getValue:()=>e.getValue(r),renderValue:i,getContext:ht(()=>[t,n,e,s],(a,u,c,d)=>({table:a,column:u,row:c,cell:d,getValue:d.getValue,renderValue:d.renderValue}),pt(t.options,"debugCells"))};return t._features.forEach(a=>{a.createCell==null||a.createCell(s,n,e,t)},{}),s}function l7(t,e,n,r){var i,s;const u={...t._getDefaultColumnDef(),...e},c=u.accessorKey;let d=(i=(s=u.id)!=null?s:c?typeof String.prototype.replaceAll=="function"?c.replaceAll(".","_"):c.replace(/\./g,"_"):void 0)!=null?i:typeof u.header=="string"?u.header:void 0,h;if(u.accessorFn?h=u.accessorFn:c&&(c.includes(".")?h=m=>{let y=m;for(const x of c.split(".")){var b;y=(b=y)==null?void 0:b[x]}return y}:h=m=>m[u.accessorKey]),!d)throw new Error;let g={id:`${String(d)}`,accessorFn:h,parent:r,depth:n,columnDef:u,columns:[],getFlatColumns:ht(()=>[!0],()=>{var m;return[g,...(m=g.columns)==null?void 0:m.flatMap(y=>y.getFlatColumns())]},pt(t.options,"debugColumns")),getLeafColumns:ht(()=>[t._getOrderColumnsFn()],m=>{var y;if((y=g.columns)!=null&&y.length){let b=g.columns.flatMap(x=>x.getLeafColumns());return m(b)}return[g]},pt(t.options,"debugColumns"))};for(const m of t._features)m.createColumn==null||m.createColumn(g,t);return g}const Wr="debugHeaders";function BO(t,e,n){var r;let s={id:(r=n.id)!=null?r:e.id,column:e,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const a=[],u=c=>{c.subHeaders&&c.subHeaders.length&&c.subHeaders.map(u),a.push(c)};return u(s),a},getContext:()=>({table:t,header:s,column:e})};return t._features.forEach(a=>{a.createHeader==null||a.createHeader(s,t)}),s}const a7={createTable:t=>{t.getHeaderGroups=ht(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.left,t.getState().columnPinning.right],(e,n,r,i)=>{var s,a;const u=(s=r?.map(g=>n.find(m=>m.id===g)).filter(Boolean))!=null?s:[],c=(a=i?.map(g=>n.find(m=>m.id===g)).filter(Boolean))!=null?a:[],d=n.filter(g=>!(r!=null&&r.includes(g.id))&&!(i!=null&&i.includes(g.id)));return eg(e,[...u,...d,...c],t)},pt(t.options,Wr)),t.getCenterHeaderGroups=ht(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.left,t.getState().columnPinning.right],(e,n,r,i)=>(n=n.filter(s=>!(r!=null&&r.includes(s.id))&&!(i!=null&&i.includes(s.id))),eg(e,n,t,"center")),pt(t.options,Wr)),t.getLeftHeaderGroups=ht(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.left],(e,n,r)=>{var i;const s=(i=r?.map(a=>n.find(u=>u.id===a)).filter(Boolean))!=null?i:[];return eg(e,s,t,"left")},pt(t.options,Wr)),t.getRightHeaderGroups=ht(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.right],(e,n,r)=>{var i;const s=(i=r?.map(a=>n.find(u=>u.id===a)).filter(Boolean))!=null?i:[];return eg(e,s,t,"right")},pt(t.options,Wr)),t.getFooterGroups=ht(()=>[t.getHeaderGroups()],e=>[...e].reverse(),pt(t.options,Wr)),t.getLeftFooterGroups=ht(()=>[t.getLeftHeaderGroups()],e=>[...e].reverse(),pt(t.options,Wr)),t.getCenterFooterGroups=ht(()=>[t.getCenterHeaderGroups()],e=>[...e].reverse(),pt(t.options,Wr)),t.getRightFooterGroups=ht(()=>[t.getRightHeaderGroups()],e=>[...e].reverse(),pt(t.options,Wr)),t.getFlatHeaders=ht(()=>[t.getHeaderGroups()],e=>e.map(n=>n.headers).flat(),pt(t.options,Wr)),t.getLeftFlatHeaders=ht(()=>[t.getLeftHeaderGroups()],e=>e.map(n=>n.headers).flat(),pt(t.options,Wr)),t.getCenterFlatHeaders=ht(()=>[t.getCenterHeaderGroups()],e=>e.map(n=>n.headers).flat(),pt(t.options,Wr)),t.getRightFlatHeaders=ht(()=>[t.getRightHeaderGroups()],e=>e.map(n=>n.headers).flat(),pt(t.options,Wr)),t.getCenterLeafHeaders=ht(()=>[t.getCenterFlatHeaders()],e=>e.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),pt(t.options,Wr)),t.getLeftLeafHeaders=ht(()=>[t.getLeftFlatHeaders()],e=>e.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),pt(t.options,Wr)),t.getRightLeafHeaders=ht(()=>[t.getRightFlatHeaders()],e=>e.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),pt(t.options,Wr)),t.getLeafHeaders=ht(()=>[t.getLeftHeaderGroups(),t.getCenterHeaderGroups(),t.getRightHeaderGroups()],(e,n,r)=>{var i,s,a,u,c,d;return[...(i=(s=e[0])==null?void 0:s.headers)!=null?i:[],...(a=(u=n[0])==null?void 0:u.headers)!=null?a:[],...(c=(d=r[0])==null?void 0:d.headers)!=null?c:[]].map(h=>h.getLeafHeaders()).flat()},pt(t.options,Wr))}};function eg(t,e,n,r){var i,s;let a=0;const u=function(m,y){y===void 0&&(y=1),a=Math.max(a,y),m.filter(b=>b.getIsVisible()).forEach(b=>{var x;(x=b.columns)!=null&&x.length&&u(b.columns,y+1)},0)};u(t);let c=[];const d=(m,y)=>{const b={depth:y,id:[r,`${y}`].filter(Boolean).join("_"),headers:[]},x=[];m.forEach(w=>{const C=[...x].reverse()[0],T=w.column.depth===b.depth;let E,M=!1;if(T&&w.column.parent?E=w.column.parent:(E=w.column,M=!0),C&&C?.column===E)C.subHeaders.push(w);else{const k=BO(n,E,{id:[r,y,E.id,w?.id].filter(Boolean).join("_"),isPlaceholder:M,placeholderId:M?`${x.filter(P=>P.column===E).length}`:void 0,depth:y,index:x.length});k.subHeaders.push(w),x.push(k)}b.headers.push(w),w.headerGroup=b}),c.push(b),y>0&&d(x,y-1)},h=e.map((m,y)=>BO(n,m,{depth:a,index:y}));d(h,a-1),c.reverse();const g=m=>m.filter(b=>b.column.getIsVisible()).map(b=>{let x=0,w=0,C=[0];b.subHeaders&&b.subHeaders.length?(C=[],g(b.subHeaders).forEach(E=>{let{colSpan:M,rowSpan:k}=E;x+=M,C.push(k)})):x=1;const T=Math.min(...C);return w=w+T,b.colSpan=x,b.rowSpan=w,{colSpan:x,rowSpan:w}});return g((i=(s=c[0])==null?void 0:s.headers)!=null?i:[]),c}const u7=(t,e,n,r,i,s,a)=>{let u={id:e,index:r,original:n,depth:i,parentId:a,_valuesCache:{},_uniqueValuesCache:{},getValue:c=>{if(u._valuesCache.hasOwnProperty(c))return u._valuesCache[c];const d=t.getColumn(c);if(d!=null&&d.accessorFn)return u._valuesCache[c]=d.accessorFn(u.original,r),u._valuesCache[c]},getUniqueValues:c=>{if(u._uniqueValuesCache.hasOwnProperty(c))return u._uniqueValuesCache[c];const d=t.getColumn(c);if(d!=null&&d.accessorFn)return d.columnDef.getUniqueValues?(u._uniqueValuesCache[c]=d.columnDef.getUniqueValues(u.original,r),u._uniqueValuesCache[c]):(u._uniqueValuesCache[c]=[u.getValue(c)],u._uniqueValuesCache[c])},renderValue:c=>{var d;return(d=u.getValue(c))!=null?d:t.options.renderFallbackValue},subRows:[],getLeafRows:()=>o7(u.subRows,c=>c.subRows),getParentRow:()=>u.parentId?t.getRow(u.parentId,!0):void 0,getParentRows:()=>{let c=[],d=u;for(;;){const h=d.getParentRow();if(!h)break;c.push(h),d=h}return c.reverse()},getAllCells:ht(()=>[t.getAllLeafColumns()],c=>c.map(d=>s7(t,u,d,d.id)),pt(t.options,"debugRows")),_getAllCellsByColumnId:ht(()=>[u.getAllCells()],c=>c.reduce((d,h)=>(d[h.column.id]=h,d),{}),pt(t.options,"debugRows"))};for(let c=0;c<t._features.length;c++){const d=t._features[c];d==null||d.createRow==null||d.createRow(u,t)}return u},c7={createColumn:(t,e)=>{t._getFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,t.id),t.getFacetedRowModel=()=>t._getFacetedRowModel?t._getFacetedRowModel():e.getPreFilteredRowModel(),t._getFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,t.id),t.getFacetedUniqueValues=()=>t._getFacetedUniqueValues?t._getFacetedUniqueValues():new Map,t._getFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,t.id),t.getFacetedMinMaxValues=()=>{if(t._getFacetedMinMaxValues)return t._getFacetedMinMaxValues()}}},MN=(t,e,n)=>{var r,i;const s=n==null||(r=n.toString())==null?void 0:r.toLowerCase();return!!(!((i=t.getValue(e))==null||(i=i.toString())==null||(i=i.toLowerCase())==null)&&i.includes(s))};MN.autoRemove=t=>No(t);const AN=(t,e,n)=>{var r;return!!(!((r=t.getValue(e))==null||(r=r.toString())==null)&&r.includes(n))};AN.autoRemove=t=>No(t);const ON=(t,e,n)=>{var r;return((r=t.getValue(e))==null||(r=r.toString())==null?void 0:r.toLowerCase())===n?.toLowerCase()};ON.autoRemove=t=>No(t);const kN=(t,e,n)=>{var r;return(r=t.getValue(e))==null?void 0:r.includes(n)};kN.autoRemove=t=>No(t);const IN=(t,e,n)=>!n.some(r=>{var i;return!((i=t.getValue(e))!=null&&i.includes(r))});IN.autoRemove=t=>No(t)||!(t!=null&&t.length);const DN=(t,e,n)=>n.some(r=>{var i;return(i=t.getValue(e))==null?void 0:i.includes(r)});DN.autoRemove=t=>No(t)||!(t!=null&&t.length);const PN=(t,e,n)=>t.getValue(e)===n;PN.autoRemove=t=>No(t);const zN=(t,e,n)=>t.getValue(e)==n;zN.autoRemove=t=>No(t);const T1=(t,e,n)=>{let[r,i]=n;const s=t.getValue(e);return s>=r&&s<=i};T1.resolveFilterValue=t=>{let[e,n]=t,r=typeof e!="number"?parseFloat(e):e,i=typeof n!="number"?parseFloat(n):n,s=e===null||Number.isNaN(r)?-1/0:r,a=n===null||Number.isNaN(i)?1/0:i;if(s>a){const u=s;s=a,a=u}return[s,a]};T1.autoRemove=t=>No(t)||No(t[0])&&No(t[1]);const Zs={includesString:MN,includesStringSensitive:AN,equalsString:ON,arrIncludes:kN,arrIncludesAll:IN,arrIncludesSome:DN,equals:PN,weakEquals:zN,inNumberRange:T1};function No(t){return t==null||t===""}const f7={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:t=>({columnFilters:[],...t}),getDefaultOptions:t=>({onColumnFiltersChange:_i("columnFilters",t),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(t,e)=>{t.getAutoFilterFn=()=>{const n=e.getCoreRowModel().flatRows[0],r=n?.getValue(t.id);return typeof r=="string"?Zs.includesString:typeof r=="number"?Zs.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?Zs.equals:Array.isArray(r)?Zs.arrIncludes:Zs.weakEquals},t.getFilterFn=()=>{var n,r;return ly(t.columnDef.filterFn)?t.columnDef.filterFn:t.columnDef.filterFn==="auto"?t.getAutoFilterFn():(n=(r=e.options.filterFns)==null?void 0:r[t.columnDef.filterFn])!=null?n:Zs[t.columnDef.filterFn]},t.getCanFilter=()=>{var n,r,i;return((n=t.columnDef.enableColumnFilter)!=null?n:!0)&&((r=e.options.enableColumnFilters)!=null?r:!0)&&((i=e.options.enableFilters)!=null?i:!0)&&!!t.accessorFn},t.getIsFiltered=()=>t.getFilterIndex()>-1,t.getFilterValue=()=>{var n;return(n=e.getState().columnFilters)==null||(n=n.find(r=>r.id===t.id))==null?void 0:n.value},t.getFilterIndex=()=>{var n,r;return(n=(r=e.getState().columnFilters)==null?void 0:r.findIndex(i=>i.id===t.id))!=null?n:-1},t.setFilterValue=n=>{e.setColumnFilters(r=>{const i=t.getFilterFn(),s=r?.find(h=>h.id===t.id),a=ta(n,s?s.value:void 0);if(jO(i,a,t)){var u;return(u=r?.filter(h=>h.id!==t.id))!=null?u:[]}const c={id:t.id,value:a};if(s){var d;return(d=r?.map(h=>h.id===t.id?c:h))!=null?d:[]}return r!=null&&r.length?[...r,c]:[c]})}},createRow:(t,e)=>{t.columnFilters={},t.columnFiltersMeta={}},createTable:t=>{t.setColumnFilters=e=>{const n=t.getAllLeafColumns(),r=i=>{var s;return(s=ta(e,i))==null?void 0:s.filter(a=>{const u=n.find(c=>c.id===a.id);if(u){const c=u.getFilterFn();if(jO(c,a.value,u))return!1}return!0})};t.options.onColumnFiltersChange==null||t.options.onColumnFiltersChange(r)},t.resetColumnFilters=e=>{var n,r;t.setColumnFilters(e?[]:(n=(r=t.initialState)==null?void 0:r.columnFilters)!=null?n:[])},t.getPreFilteredRowModel=()=>t.getCoreRowModel(),t.getFilteredRowModel=()=>(!t._getFilteredRowModel&&t.options.getFilteredRowModel&&(t._getFilteredRowModel=t.options.getFilteredRowModel(t)),t.options.manualFiltering||!t._getFilteredRowModel?t.getPreFilteredRowModel():t._getFilteredRowModel())}};function jO(t,e,n){return(t&&t.autoRemove?t.autoRemove(e,n):!1)||typeof e>"u"||typeof e=="string"&&!e}const d7=(t,e,n)=>n.reduce((r,i)=>{const s=i.getValue(t);return r+(typeof s=="number"?s:0)},0),h7=(t,e,n)=>{let r;return n.forEach(i=>{const s=i.getValue(t);s!=null&&(r>s||r===void 0&&s>=s)&&(r=s)}),r},p7=(t,e,n)=>{let r;return n.forEach(i=>{const s=i.getValue(t);s!=null&&(r<s||r===void 0&&s>=s)&&(r=s)}),r},g7=(t,e,n)=>{let r,i;return n.forEach(s=>{const a=s.getValue(t);a!=null&&(r===void 0?a>=a&&(r=i=a):(r>a&&(r=a),i<a&&(i=a)))}),[r,i]},m7=(t,e)=>{let n=0,r=0;if(e.forEach(i=>{let s=i.getValue(t);s!=null&&(s=+s)>=s&&(++n,r+=s)}),n)return r/n},y7=(t,e)=>{if(!e.length)return;const n=e.map(s=>s.getValue(t));if(!i7(n))return;if(n.length===1)return n[0];const r=Math.floor(n.length/2),i=n.sort((s,a)=>s-a);return n.length%2!==0?i[r]:(i[r-1]+i[r])/2},v7=(t,e)=>Array.from(new Set(e.map(n=>n.getValue(t))).values()),b7=(t,e)=>new Set(e.map(n=>n.getValue(t))).size,x7=(t,e)=>e.length,xb={sum:d7,min:h7,max:p7,extent:g7,mean:m7,median:y7,unique:v7,uniqueCount:b7,count:x7},S7={getDefaultColumnDef:()=>({aggregatedCell:t=>{var e,n;return(e=(n=t.getValue())==null||n.toString==null?void 0:n.toString())!=null?e:null},aggregationFn:"auto"}),getInitialState:t=>({grouping:[],...t}),getDefaultOptions:t=>({onGroupingChange:_i("grouping",t),groupedColumnMode:"reorder"}),createColumn:(t,e)=>{t.toggleGrouping=()=>{e.setGrouping(n=>n!=null&&n.includes(t.id)?n.filter(r=>r!==t.id):[...n??[],t.id])},t.getCanGroup=()=>{var n,r;return((n=t.columnDef.enableGrouping)!=null?n:!0)&&((r=e.options.enableGrouping)!=null?r:!0)&&(!!t.accessorFn||!!t.columnDef.getGroupingValue)},t.getIsGrouped=()=>{var n;return(n=e.getState().grouping)==null?void 0:n.includes(t.id)},t.getGroupedIndex=()=>{var n;return(n=e.getState().grouping)==null?void 0:n.indexOf(t.id)},t.getToggleGroupingHandler=()=>{const n=t.getCanGroup();return()=>{n&&t.toggleGrouping()}},t.getAutoAggregationFn=()=>{const n=e.getCoreRowModel().flatRows[0],r=n?.getValue(t.id);if(typeof r=="number")return xb.sum;if(Object.prototype.toString.call(r)==="[object Date]")return xb.extent},t.getAggregationFn=()=>{var n,r;if(!t)throw new Error;return ly(t.columnDef.aggregationFn)?t.columnDef.aggregationFn:t.columnDef.aggregationFn==="auto"?t.getAutoAggregationFn():(n=(r=e.options.aggregationFns)==null?void 0:r[t.columnDef.aggregationFn])!=null?n:xb[t.columnDef.aggregationFn]}},createTable:t=>{t.setGrouping=e=>t.options.onGroupingChange==null?void 0:t.options.onGroupingChange(e),t.resetGrouping=e=>{var n,r;t.setGrouping(e?[]:(n=(r=t.initialState)==null?void 0:r.grouping)!=null?n:[])},t.getPreGroupedRowModel=()=>t.getFilteredRowModel(),t.getGroupedRowModel=()=>(!t._getGroupedRowModel&&t.options.getGroupedRowModel&&(t._getGroupedRowModel=t.options.getGroupedRowModel(t)),t.options.manualGrouping||!t._getGroupedRowModel?t.getPreGroupedRowModel():t._getGroupedRowModel())},createRow:(t,e)=>{t.getIsGrouped=()=>!!t.groupingColumnId,t.getGroupingValue=n=>{if(t._groupingValuesCache.hasOwnProperty(n))return t._groupingValuesCache[n];const r=e.getColumn(n);return r!=null&&r.columnDef.getGroupingValue?(t._groupingValuesCache[n]=r.columnDef.getGroupingValue(t.original),t._groupingValuesCache[n]):t.getValue(n)},t._groupingValuesCache={}},createCell:(t,e,n,r)=>{t.getIsGrouped=()=>e.getIsGrouped()&&e.id===n.groupingColumnId,t.getIsPlaceholder=()=>!t.getIsGrouped()&&e.getIsGrouped(),t.getIsAggregated=()=>{var i;return!t.getIsGrouped()&&!t.getIsPlaceholder()&&!!((i=n.subRows)!=null&&i.length)}}};function w7(t,e,n){if(!(e!=null&&e.length)||!n)return t;const r=t.filter(s=>!e.includes(s.id));return n==="remove"?r:[...e.map(s=>t.find(a=>a.id===s)).filter(Boolean),...r]}const C7={getInitialState:t=>({columnOrder:[],...t}),getDefaultOptions:t=>({onColumnOrderChange:_i("columnOrder",t)}),createColumn:(t,e)=>{t.getIndex=ht(n=>[gd(e,n)],n=>n.findIndex(r=>r.id===t.id),pt(e.options,"debugColumns")),t.getIsFirstColumn=n=>{var r;return((r=gd(e,n)[0])==null?void 0:r.id)===t.id},t.getIsLastColumn=n=>{var r;const i=gd(e,n);return((r=i[i.length-1])==null?void 0:r.id)===t.id}},createTable:t=>{t.setColumnOrder=e=>t.options.onColumnOrderChange==null?void 0:t.options.onColumnOrderChange(e),t.resetColumnOrder=e=>{var n;t.setColumnOrder(e?[]:(n=t.initialState.columnOrder)!=null?n:[])},t._getOrderColumnsFn=ht(()=>[t.getState().columnOrder,t.getState().grouping,t.options.groupedColumnMode],(e,n,r)=>i=>{let s=[];if(!(e!=null&&e.length))s=i;else{const a=[...e],u=[...i];for(;u.length&&a.length;){const c=a.shift(),d=u.findIndex(h=>h.id===c);d>-1&&s.push(u.splice(d,1)[0])}s=[...s,...u]}return w7(s,n,r)},pt(t.options,"debugTable"))}},Sb=()=>({left:[],right:[]}),R7={getInitialState:t=>({columnPinning:Sb(),...t}),getDefaultOptions:t=>({onColumnPinningChange:_i("columnPinning",t)}),createColumn:(t,e)=>{t.pin=n=>{const r=t.getLeafColumns().map(i=>i.id).filter(Boolean);e.setColumnPinning(i=>{var s,a;if(n==="right"){var u,c;return{left:((u=i?.left)!=null?u:[]).filter(g=>!(r!=null&&r.includes(g))),right:[...((c=i?.right)!=null?c:[]).filter(g=>!(r!=null&&r.includes(g))),...r]}}if(n==="left"){var d,h;return{left:[...((d=i?.left)!=null?d:[]).filter(g=>!(r!=null&&r.includes(g))),...r],right:((h=i?.right)!=null?h:[]).filter(g=>!(r!=null&&r.includes(g)))}}return{left:((s=i?.left)!=null?s:[]).filter(g=>!(r!=null&&r.includes(g))),right:((a=i?.right)!=null?a:[]).filter(g=>!(r!=null&&r.includes(g)))}})},t.getCanPin=()=>t.getLeafColumns().some(r=>{var i,s,a;return((i=r.columnDef.enablePinning)!=null?i:!0)&&((s=(a=e.options.enableColumnPinning)!=null?a:e.options.enablePinning)!=null?s:!0)}),t.getIsPinned=()=>{const n=t.getLeafColumns().map(u=>u.id),{left:r,right:i}=e.getState().columnPinning,s=n.some(u=>r?.includes(u)),a=n.some(u=>i?.includes(u));return s?"left":a?"right":!1},t.getPinnedIndex=()=>{var n,r;const i=t.getIsPinned();return i?(n=(r=e.getState().columnPinning)==null||(r=r[i])==null?void 0:r.indexOf(t.id))!=null?n:-1:0}},createRow:(t,e)=>{t.getCenterVisibleCells=ht(()=>[t._getAllVisibleCells(),e.getState().columnPinning.left,e.getState().columnPinning.right],(n,r,i)=>{const s=[...r??[],...i??[]];return n.filter(a=>!s.includes(a.column.id))},pt(e.options,"debugRows")),t.getLeftVisibleCells=ht(()=>[t._getAllVisibleCells(),e.getState().columnPinning.left],(n,r)=>(r??[]).map(s=>n.find(a=>a.column.id===s)).filter(Boolean).map(s=>({...s,position:"left"})),pt(e.options,"debugRows")),t.getRightVisibleCells=ht(()=>[t._getAllVisibleCells(),e.getState().columnPinning.right],(n,r)=>(r??[]).map(s=>n.find(a=>a.column.id===s)).filter(Boolean).map(s=>({...s,position:"right"})),pt(e.options,"debugRows"))},createTable:t=>{t.setColumnPinning=e=>t.options.onColumnPinningChange==null?void 0:t.options.onColumnPinningChange(e),t.resetColumnPinning=e=>{var n,r;return t.setColumnPinning(e?Sb():(n=(r=t.initialState)==null?void 0:r.columnPinning)!=null?n:Sb())},t.getIsSomeColumnsPinned=e=>{var n;const r=t.getState().columnPinning;if(!e){var i,s;return!!((i=r.left)!=null&&i.length||(s=r.right)!=null&&s.length)}return!!((n=r[e])!=null&&n.length)},t.getLeftLeafColumns=ht(()=>[t.getAllLeafColumns(),t.getState().columnPinning.left],(e,n)=>(n??[]).map(r=>e.find(i=>i.id===r)).filter(Boolean),pt(t.options,"debugColumns")),t.getRightLeafColumns=ht(()=>[t.getAllLeafColumns(),t.getState().columnPinning.right],(e,n)=>(n??[]).map(r=>e.find(i=>i.id===r)).filter(Boolean),pt(t.options,"debugColumns")),t.getCenterLeafColumns=ht(()=>[t.getAllLeafColumns(),t.getState().columnPinning.left,t.getState().columnPinning.right],(e,n,r)=>{const i=[...n??[],...r??[]];return e.filter(s=>!i.includes(s.id))},pt(t.options,"debugColumns"))}};function T7(t){return t||(typeof document<"u"?document:null)}const tg={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},wb=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),E7={getDefaultColumnDef:()=>tg,getInitialState:t=>({columnSizing:{},columnSizingInfo:wb(),...t}),getDefaultOptions:t=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:_i("columnSizing",t),onColumnSizingInfoChange:_i("columnSizingInfo",t)}),createColumn:(t,e)=>{t.getSize=()=>{var n,r,i;const s=e.getState().columnSizing[t.id];return Math.min(Math.max((n=t.columnDef.minSize)!=null?n:tg.minSize,(r=s??t.columnDef.size)!=null?r:tg.size),(i=t.columnDef.maxSize)!=null?i:tg.maxSize)},t.getStart=ht(n=>[n,gd(e,n),e.getState().columnSizing],(n,r)=>r.slice(0,t.getIndex(n)).reduce((i,s)=>i+s.getSize(),0),pt(e.options,"debugColumns")),t.getAfter=ht(n=>[n,gd(e,n),e.getState().columnSizing],(n,r)=>r.slice(t.getIndex(n)+1).reduce((i,s)=>i+s.getSize(),0),pt(e.options,"debugColumns")),t.resetSize=()=>{e.setColumnSizing(n=>{let{[t.id]:r,...i}=n;return i})},t.getCanResize=()=>{var n,r;return((n=t.columnDef.enableResizing)!=null?n:!0)&&((r=e.options.enableColumnResizing)!=null?r:!0)},t.getIsResizing=()=>e.getState().columnSizingInfo.isResizingColumn===t.id},createHeader:(t,e)=>{t.getSize=()=>{let n=0;const r=i=>{if(i.subHeaders.length)i.subHeaders.forEach(r);else{var s;n+=(s=i.column.getSize())!=null?s:0}};return r(t),n},t.getStart=()=>{if(t.index>0){const n=t.headerGroup.headers[t.index-1];return n.getStart()+n.getSize()}return 0},t.getResizeHandler=n=>{const r=e.getColumn(t.column.id),i=r?.getCanResize();return s=>{if(!r||!i||(s.persist==null||s.persist(),Cb(s)&&s.touches&&s.touches.length>1))return;const a=t.getSize(),u=t?t.getLeafHeaders().map(C=>[C.column.id,C.column.getSize()]):[[r.id,r.getSize()]],c=Cb(s)?Math.round(s.touches[0].clientX):s.clientX,d={},h=(C,T)=>{typeof T=="number"&&(e.setColumnSizingInfo(E=>{var M,k;const P=e.options.columnResizeDirection==="rtl"?-1:1,A=(T-((M=E?.startOffset)!=null?M:0))*P,I=Math.max(A/((k=E?.startSize)!=null?k:0),-.999999);return E.columnSizingStart.forEach(L=>{let[j,N]=L;d[j]=Math.round(Math.max(N+N*I,0)*100)/100}),{...E,deltaOffset:A,deltaPercentage:I}}),(e.options.columnResizeMode==="onChange"||C==="end")&&e.setColumnSizing(E=>({...E,...d})))},g=C=>h("move",C),m=C=>{h("end",C),e.setColumnSizingInfo(T=>({...T,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},y=T7(n),b={moveHandler:C=>g(C.clientX),upHandler:C=>{y?.removeEventListener("mousemove",b.moveHandler),y?.removeEventListener("mouseup",b.upHandler),m(C.clientX)}},x={moveHandler:C=>(C.cancelable&&(C.preventDefault(),C.stopPropagation()),g(C.touches[0].clientX),!1),upHandler:C=>{var T;y?.removeEventListener("touchmove",x.moveHandler),y?.removeEventListener("touchend",x.upHandler),C.cancelable&&(C.preventDefault(),C.stopPropagation()),m((T=C.touches[0])==null?void 0:T.clientX)}},w=M7()?{passive:!1}:!1;Cb(s)?(y?.addEventListener("touchmove",x.moveHandler,w),y?.addEventListener("touchend",x.upHandler,w)):(y?.addEventListener("mousemove",b.moveHandler,w),y?.addEventListener("mouseup",b.upHandler,w)),e.setColumnSizingInfo(C=>({...C,startOffset:c,startSize:a,deltaOffset:0,deltaPercentage:0,columnSizingStart:u,isResizingColumn:r.id}))}}},createTable:t=>{t.setColumnSizing=e=>t.options.onColumnSizingChange==null?void 0:t.options.onColumnSizingChange(e),t.setColumnSizingInfo=e=>t.options.onColumnSizingInfoChange==null?void 0:t.options.onColumnSizingInfoChange(e),t.resetColumnSizing=e=>{var n;t.setColumnSizing(e?{}:(n=t.initialState.columnSizing)!=null?n:{})},t.resetHeaderSizeInfo=e=>{var n;t.setColumnSizingInfo(e?wb():(n=t.initialState.columnSizingInfo)!=null?n:wb())},t.getTotalSize=()=>{var e,n;return(e=(n=t.getHeaderGroups()[0])==null?void 0:n.headers.reduce((r,i)=>r+i.getSize(),0))!=null?e:0},t.getLeftTotalSize=()=>{var e,n;return(e=(n=t.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((r,i)=>r+i.getSize(),0))!=null?e:0},t.getCenterTotalSize=()=>{var e,n;return(e=(n=t.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((r,i)=>r+i.getSize(),0))!=null?e:0},t.getRightTotalSize=()=>{var e,n;return(e=(n=t.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((r,i)=>r+i.getSize(),0))!=null?e:0}}};let ng=null;function M7(){if(typeof ng=="boolean")return ng;let t=!1;try{const e={get passive(){return t=!0,!1}},n=()=>{};window.addEventListener("test",n,e),window.removeEventListener("test",n)}catch{t=!1}return ng=t,ng}function Cb(t){return t.type==="touchstart"}const A7={getInitialState:t=>({columnVisibility:{},...t}),getDefaultOptions:t=>({onColumnVisibilityChange:_i("columnVisibility",t)}),createColumn:(t,e)=>{t.toggleVisibility=n=>{t.getCanHide()&&e.setColumnVisibility(r=>({...r,[t.id]:n??!t.getIsVisible()}))},t.getIsVisible=()=>{var n,r;const i=t.columns;return(n=i.length?i.some(s=>s.getIsVisible()):(r=e.getState().columnVisibility)==null?void 0:r[t.id])!=null?n:!0},t.getCanHide=()=>{var n,r;return((n=t.columnDef.enableHiding)!=null?n:!0)&&((r=e.options.enableHiding)!=null?r:!0)},t.getToggleVisibilityHandler=()=>n=>{t.toggleVisibility==null||t.toggleVisibility(n.target.checked)}},createRow:(t,e)=>{t._getAllVisibleCells=ht(()=>[t.getAllCells(),e.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),pt(e.options,"debugRows")),t.getVisibleCells=ht(()=>[t.getLeftVisibleCells(),t.getCenterVisibleCells(),t.getRightVisibleCells()],(n,r,i)=>[...n,...r,...i],pt(e.options,"debugRows"))},createTable:t=>{const e=(n,r)=>ht(()=>[r(),r().filter(i=>i.getIsVisible()).map(i=>i.id).join("_")],i=>i.filter(s=>s.getIsVisible==null?void 0:s.getIsVisible()),pt(t.options,"debugColumns"));t.getVisibleFlatColumns=e("getVisibleFlatColumns",()=>t.getAllFlatColumns()),t.getVisibleLeafColumns=e("getVisibleLeafColumns",()=>t.getAllLeafColumns()),t.getLeftVisibleLeafColumns=e("getLeftVisibleLeafColumns",()=>t.getLeftLeafColumns()),t.getRightVisibleLeafColumns=e("getRightVisibleLeafColumns",()=>t.getRightLeafColumns()),t.getCenterVisibleLeafColumns=e("getCenterVisibleLeafColumns",()=>t.getCenterLeafColumns()),t.setColumnVisibility=n=>t.options.onColumnVisibilityChange==null?void 0:t.options.onColumnVisibilityChange(n),t.resetColumnVisibility=n=>{var r;t.setColumnVisibility(n?{}:(r=t.initialState.columnVisibility)!=null?r:{})},t.toggleAllColumnsVisible=n=>{var r;n=(r=n)!=null?r:!t.getIsAllColumnsVisible(),t.setColumnVisibility(t.getAllLeafColumns().reduce((i,s)=>({...i,[s.id]:n||!(s.getCanHide!=null&&s.getCanHide())}),{}))},t.getIsAllColumnsVisible=()=>!t.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),t.getIsSomeColumnsVisible=()=>t.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),t.getToggleAllColumnsVisibilityHandler=()=>n=>{var r;t.toggleAllColumnsVisible((r=n.target)==null?void 0:r.checked)}}};function gd(t,e){return e?e==="center"?t.getCenterVisibleLeafColumns():e==="left"?t.getLeftVisibleLeafColumns():t.getRightVisibleLeafColumns():t.getVisibleLeafColumns()}const O7={createTable:t=>{t._getGlobalFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,"__global__"),t.getGlobalFacetedRowModel=()=>t.options.manualFiltering||!t._getGlobalFacetedRowModel?t.getPreFilteredRowModel():t._getGlobalFacetedRowModel(),t._getGlobalFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,"__global__"),t.getGlobalFacetedUniqueValues=()=>t._getGlobalFacetedUniqueValues?t._getGlobalFacetedUniqueValues():new Map,t._getGlobalFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,"__global__"),t.getGlobalFacetedMinMaxValues=()=>{if(t._getGlobalFacetedMinMaxValues)return t._getGlobalFacetedMinMaxValues()}}},k7={getInitialState:t=>({globalFilter:void 0,...t}),getDefaultOptions:t=>({onGlobalFilterChange:_i("globalFilter",t),globalFilterFn:"auto",getColumnCanGlobalFilter:e=>{var n;const r=(n=t.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[e.id])==null?void 0:n.getValue();return typeof r=="string"||typeof r=="number"}}),createColumn:(t,e)=>{t.getCanGlobalFilter=()=>{var n,r,i,s;return((n=t.columnDef.enableGlobalFilter)!=null?n:!0)&&((r=e.options.enableGlobalFilter)!=null?r:!0)&&((i=e.options.enableFilters)!=null?i:!0)&&((s=e.options.getColumnCanGlobalFilter==null?void 0:e.options.getColumnCanGlobalFilter(t))!=null?s:!0)&&!!t.accessorFn}},createTable:t=>{t.getGlobalAutoFilterFn=()=>Zs.includesString,t.getGlobalFilterFn=()=>{var e,n;const{globalFilterFn:r}=t.options;return ly(r)?r:r==="auto"?t.getGlobalAutoFilterFn():(e=(n=t.options.filterFns)==null?void 0:n[r])!=null?e:Zs[r]},t.setGlobalFilter=e=>{t.options.onGlobalFilterChange==null||t.options.onGlobalFilterChange(e)},t.resetGlobalFilter=e=>{t.setGlobalFilter(e?void 0:t.initialState.globalFilter)}}},I7={getInitialState:t=>({expanded:{},...t}),getDefaultOptions:t=>({onExpandedChange:_i("expanded",t),paginateExpandedRows:!0}),createTable:t=>{let e=!1,n=!1;t._autoResetExpanded=()=>{var r,i;if(!e){t._queue(()=>{e=!0});return}if((r=(i=t.options.autoResetAll)!=null?i:t.options.autoResetExpanded)!=null?r:!t.options.manualExpanding){if(n)return;n=!0,t._queue(()=>{t.resetExpanded(),n=!1})}},t.setExpanded=r=>t.options.onExpandedChange==null?void 0:t.options.onExpandedChange(r),t.toggleAllRowsExpanded=r=>{r??!t.getIsAllRowsExpanded()?t.setExpanded(!0):t.setExpanded({})},t.resetExpanded=r=>{var i,s;t.setExpanded(r?{}:(i=(s=t.initialState)==null?void 0:s.expanded)!=null?i:{})},t.getCanSomeRowsExpand=()=>t.getPrePaginationRowModel().flatRows.some(r=>r.getCanExpand()),t.getToggleAllRowsExpandedHandler=()=>r=>{r.persist==null||r.persist(),t.toggleAllRowsExpanded()},t.getIsSomeRowsExpanded=()=>{const r=t.getState().expanded;return r===!0||Object.values(r).some(Boolean)},t.getIsAllRowsExpanded=()=>{const r=t.getState().expanded;return typeof r=="boolean"?r===!0:!(!Object.keys(r).length||t.getRowModel().flatRows.some(i=>!i.getIsExpanded()))},t.getExpandedDepth=()=>{let r=0;return(t.getState().expanded===!0?Object.keys(t.getRowModel().rowsById):Object.keys(t.getState().expanded)).forEach(s=>{const a=s.split(".");r=Math.max(r,a.length)}),r},t.getPreExpandedRowModel=()=>t.getSortedRowModel(),t.getExpandedRowModel=()=>(!t._getExpandedRowModel&&t.options.getExpandedRowModel&&(t._getExpandedRowModel=t.options.getExpandedRowModel(t)),t.options.manualExpanding||!t._getExpandedRowModel?t.getPreExpandedRowModel():t._getExpandedRowModel())},createRow:(t,e)=>{t.toggleExpanded=n=>{e.setExpanded(r=>{var i;const s=r===!0?!0:!!(r!=null&&r[t.id]);let a={};if(r===!0?Object.keys(e.getRowModel().rowsById).forEach(u=>{a[u]=!0}):a=r,n=(i=n)!=null?i:!s,!s&&n)return{...a,[t.id]:!0};if(s&&!n){const{[t.id]:u,...c}=a;return c}return r})},t.getIsExpanded=()=>{var n;const r=e.getState().expanded;return!!((n=e.options.getIsRowExpanded==null?void 0:e.options.getIsRowExpanded(t))!=null?n:r===!0||r?.[t.id])},t.getCanExpand=()=>{var n,r,i;return(n=e.options.getRowCanExpand==null?void 0:e.options.getRowCanExpand(t))!=null?n:((r=e.options.enableExpanding)!=null?r:!0)&&!!((i=t.subRows)!=null&&i.length)},t.getIsAllParentsExpanded=()=>{let n=!0,r=t;for(;n&&r.parentId;)r=e.getRow(r.parentId,!0),n=r.getIsExpanded();return n},t.getToggleExpandedHandler=()=>{const n=t.getCanExpand();return()=>{n&&t.toggleExpanded()}}}},rS=0,iS=10,Rb=()=>({pageIndex:rS,pageSize:iS}),D7={getInitialState:t=>({...t,pagination:{...Rb(),...t?.pagination}}),getDefaultOptions:t=>({onPaginationChange:_i("pagination",t)}),createTable:t=>{let e=!1,n=!1;t._autoResetPageIndex=()=>{var r,i;if(!e){t._queue(()=>{e=!0});return}if((r=(i=t.options.autoResetAll)!=null?i:t.options.autoResetPageIndex)!=null?r:!t.options.manualPagination){if(n)return;n=!0,t._queue(()=>{t.resetPageIndex(),n=!1})}},t.setPagination=r=>{const i=s=>ta(r,s);return t.options.onPaginationChange==null?void 0:t.options.onPaginationChange(i)},t.resetPagination=r=>{var i;t.setPagination(r?Rb():(i=t.initialState.pagination)!=null?i:Rb())},t.setPageIndex=r=>{t.setPagination(i=>{let s=ta(r,i.pageIndex);const a=typeof t.options.pageCount>"u"||t.options.pageCount===-1?Number.MAX_SAFE_INTEGER:t.options.pageCount-1;return s=Math.max(0,Math.min(s,a)),{...i,pageIndex:s}})},t.resetPageIndex=r=>{var i,s;t.setPageIndex(r?rS:(i=(s=t.initialState)==null||(s=s.pagination)==null?void 0:s.pageIndex)!=null?i:rS)},t.resetPageSize=r=>{var i,s;t.setPageSize(r?iS:(i=(s=t.initialState)==null||(s=s.pagination)==null?void 0:s.pageSize)!=null?i:iS)},t.setPageSize=r=>{t.setPagination(i=>{const s=Math.max(1,ta(r,i.pageSize)),a=i.pageSize*i.pageIndex,u=Math.floor(a/s);return{...i,pageIndex:u,pageSize:s}})},t.setPageCount=r=>t.setPagination(i=>{var s;let a=ta(r,(s=t.options.pageCount)!=null?s:-1);return typeof a=="number"&&(a=Math.max(-1,a)),{...i,pageCount:a}}),t.getPageOptions=ht(()=>[t.getPageCount()],r=>{let i=[];return r&&r>0&&(i=[...new Array(r)].fill(null).map((s,a)=>a)),i},pt(t.options,"debugTable")),t.getCanPreviousPage=()=>t.getState().pagination.pageIndex>0,t.getCanNextPage=()=>{const{pageIndex:r}=t.getState().pagination,i=t.getPageCount();return i===-1?!0:i===0?!1:r<i-1},t.previousPage=()=>t.setPageIndex(r=>r-1),t.nextPage=()=>t.setPageIndex(r=>r+1),t.firstPage=()=>t.setPageIndex(0),t.lastPage=()=>t.setPageIndex(t.getPageCount()-1),t.getPrePaginationRowModel=()=>t.getExpandedRowModel(),t.getPaginationRowModel=()=>(!t._getPaginationRowModel&&t.options.getPaginationRowModel&&(t._getPaginationRowModel=t.options.getPaginationRowModel(t)),t.options.manualPagination||!t._getPaginationRowModel?t.getPrePaginationRowModel():t._getPaginationRowModel()),t.getPageCount=()=>{var r;return(r=t.options.pageCount)!=null?r:Math.ceil(t.getRowCount()/t.getState().pagination.pageSize)},t.getRowCount=()=>{var r;return(r=t.options.rowCount)!=null?r:t.getPrePaginationRowModel().rows.length}}},Tb=()=>({top:[],bottom:[]}),P7={getInitialState:t=>({rowPinning:Tb(),...t}),getDefaultOptions:t=>({onRowPinningChange:_i("rowPinning",t)}),createRow:(t,e)=>{t.pin=(n,r,i)=>{const s=r?t.getLeafRows().map(c=>{let{id:d}=c;return d}):[],a=i?t.getParentRows().map(c=>{let{id:d}=c;return d}):[],u=new Set([...a,t.id,...s]);e.setRowPinning(c=>{var d,h;if(n==="bottom"){var g,m;return{top:((g=c?.top)!=null?g:[]).filter(x=>!(u!=null&&u.has(x))),bottom:[...((m=c?.bottom)!=null?m:[]).filter(x=>!(u!=null&&u.has(x))),...Array.from(u)]}}if(n==="top"){var y,b;return{top:[...((y=c?.top)!=null?y:[]).filter(x=>!(u!=null&&u.has(x))),...Array.from(u)],bottom:((b=c?.bottom)!=null?b:[]).filter(x=>!(u!=null&&u.has(x)))}}return{top:((d=c?.top)!=null?d:[]).filter(x=>!(u!=null&&u.has(x))),bottom:((h=c?.bottom)!=null?h:[]).filter(x=>!(u!=null&&u.has(x)))}})},t.getCanPin=()=>{var n;const{enableRowPinning:r,enablePinning:i}=e.options;return typeof r=="function"?r(t):(n=r??i)!=null?n:!0},t.getIsPinned=()=>{const n=[t.id],{top:r,bottom:i}=e.getState().rowPinning,s=n.some(u=>r?.includes(u)),a=n.some(u=>i?.includes(u));return s?"top":a?"bottom":!1},t.getPinnedIndex=()=>{var n,r;const i=t.getIsPinned();if(!i)return-1;const s=(n=i==="top"?e.getTopRows():e.getBottomRows())==null?void 0:n.map(a=>{let{id:u}=a;return u});return(r=s?.indexOf(t.id))!=null?r:-1}},createTable:t=>{t.setRowPinning=e=>t.options.onRowPinningChange==null?void 0:t.options.onRowPinningChange(e),t.resetRowPinning=e=>{var n,r;return t.setRowPinning(e?Tb():(n=(r=t.initialState)==null?void 0:r.rowPinning)!=null?n:Tb())},t.getIsSomeRowsPinned=e=>{var n;const r=t.getState().rowPinning;if(!e){var i,s;return!!((i=r.top)!=null&&i.length||(s=r.bottom)!=null&&s.length)}return!!((n=r[e])!=null&&n.length)},t._getPinnedRows=(e,n,r)=>{var i;return((i=t.options.keepPinnedRows)==null||i?(n??[]).map(a=>{const u=t.getRow(a,!0);return u.getIsAllParentsExpanded()?u:null}):(n??[]).map(a=>e.find(u=>u.id===a))).filter(Boolean).map(a=>({...a,position:r}))},t.getTopRows=ht(()=>[t.getRowModel().rows,t.getState().rowPinning.top],(e,n)=>t._getPinnedRows(e,n,"top"),pt(t.options,"debugRows")),t.getBottomRows=ht(()=>[t.getRowModel().rows,t.getState().rowPinning.bottom],(e,n)=>t._getPinnedRows(e,n,"bottom"),pt(t.options,"debugRows")),t.getCenterRows=ht(()=>[t.getRowModel().rows,t.getState().rowPinning.top,t.getState().rowPinning.bottom],(e,n,r)=>{const i=new Set([...n??[],...r??[]]);return e.filter(s=>!i.has(s.id))},pt(t.options,"debugRows"))}},z7={getInitialState:t=>({rowSelection:{},...t}),getDefaultOptions:t=>({onRowSelectionChange:_i("rowSelection",t),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:t=>{t.setRowSelection=e=>t.options.onRowSelectionChange==null?void 0:t.options.onRowSelectionChange(e),t.resetRowSelection=e=>{var n;return t.setRowSelection(e?{}:(n=t.initialState.rowSelection)!=null?n:{})},t.toggleAllRowsSelected=e=>{t.setRowSelection(n=>{e=typeof e<"u"?e:!t.getIsAllRowsSelected();const r={...n},i=t.getPreGroupedRowModel().flatRows;return e?i.forEach(s=>{s.getCanSelect()&&(r[s.id]=!0)}):i.forEach(s=>{delete r[s.id]}),r})},t.toggleAllPageRowsSelected=e=>t.setRowSelection(n=>{const r=typeof e<"u"?e:!t.getIsAllPageRowsSelected(),i={...n};return t.getRowModel().rows.forEach(s=>{oS(i,s.id,r,!0,t)}),i}),t.getPreSelectedRowModel=()=>t.getCoreRowModel(),t.getSelectedRowModel=ht(()=>[t.getState().rowSelection,t.getCoreRowModel()],(e,n)=>Object.keys(e).length?Eb(t,n):{rows:[],flatRows:[],rowsById:{}},pt(t.options,"debugTable")),t.getFilteredSelectedRowModel=ht(()=>[t.getState().rowSelection,t.getFilteredRowModel()],(e,n)=>Object.keys(e).length?Eb(t,n):{rows:[],flatRows:[],rowsById:{}},pt(t.options,"debugTable")),t.getGroupedSelectedRowModel=ht(()=>[t.getState().rowSelection,t.getSortedRowModel()],(e,n)=>Object.keys(e).length?Eb(t,n):{rows:[],flatRows:[],rowsById:{}},pt(t.options,"debugTable")),t.getIsAllRowsSelected=()=>{const e=t.getFilteredRowModel().flatRows,{rowSelection:n}=t.getState();let r=!!(e.length&&Object.keys(n).length);return r&&e.some(i=>i.getCanSelect()&&!n[i.id])&&(r=!1),r},t.getIsAllPageRowsSelected=()=>{const e=t.getPaginationRowModel().flatRows.filter(i=>i.getCanSelect()),{rowSelection:n}=t.getState();let r=!!e.length;return r&&e.some(i=>!n[i.id])&&(r=!1),r},t.getIsSomeRowsSelected=()=>{var e;const n=Object.keys((e=t.getState().rowSelection)!=null?e:{}).length;return n>0&&n<t.getFilteredRowModel().flatRows.length},t.getIsSomePageRowsSelected=()=>{const e=t.getPaginationRowModel().flatRows;return t.getIsAllPageRowsSelected()?!1:e.filter(n=>n.getCanSelect()).some(n=>n.getIsSelected()||n.getIsSomeSelected())},t.getToggleAllRowsSelectedHandler=()=>e=>{t.toggleAllRowsSelected(e.target.checked)},t.getToggleAllPageRowsSelectedHandler=()=>e=>{t.toggleAllPageRowsSelected(e.target.checked)}},createRow:(t,e)=>{t.toggleSelected=(n,r)=>{const i=t.getIsSelected();e.setRowSelection(s=>{var a;if(n=typeof n<"u"?n:!i,t.getCanSelect()&&i===n)return s;const u={...s};return oS(u,t.id,n,(a=r?.selectChildren)!=null?a:!0,e),u})},t.getIsSelected=()=>{const{rowSelection:n}=e.getState();return E1(t,n)},t.getIsSomeSelected=()=>{const{rowSelection:n}=e.getState();return sS(t,n)==="some"},t.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=e.getState();return sS(t,n)==="all"},t.getCanSelect=()=>{var n;return typeof e.options.enableRowSelection=="function"?e.options.enableRowSelection(t):(n=e.options.enableRowSelection)!=null?n:!0},t.getCanSelectSubRows=()=>{var n;return typeof e.options.enableSubRowSelection=="function"?e.options.enableSubRowSelection(t):(n=e.options.enableSubRowSelection)!=null?n:!0},t.getCanMultiSelect=()=>{var n;return typeof e.options.enableMultiRowSelection=="function"?e.options.enableMultiRowSelection(t):(n=e.options.enableMultiRowSelection)!=null?n:!0},t.getToggleSelectedHandler=()=>{const n=t.getCanSelect();return r=>{var i;n&&t.toggleSelected((i=r.target)==null?void 0:i.checked)}}}},oS=(t,e,n,r,i)=>{var s;const a=i.getRow(e,!0);n?(a.getCanMultiSelect()||Object.keys(t).forEach(u=>delete t[u]),a.getCanSelect()&&(t[e]=!0)):delete t[e],r&&(s=a.subRows)!=null&&s.length&&a.getCanSelectSubRows()&&a.subRows.forEach(u=>oS(t,u.id,n,r,i))};function Eb(t,e){const n=t.getState().rowSelection,r=[],i={},s=function(a,u){return a.map(c=>{var d;const h=E1(c,n);if(h&&(r.push(c),i[c.id]=c),(d=c.subRows)!=null&&d.length&&(c={...c,subRows:s(c.subRows)}),h)return c}).filter(Boolean)};return{rows:s(e.rows),flatRows:r,rowsById:i}}function E1(t,e){var n;return(n=e[t.id])!=null?n:!1}function sS(t,e,n){var r;if(!((r=t.subRows)!=null&&r.length))return!1;let i=!0,s=!1;return t.subRows.forEach(a=>{if(!(s&&!i)&&(a.getCanSelect()&&(E1(a,e)?s=!0:i=!1),a.subRows&&a.subRows.length)){const u=sS(a,e);u==="all"?s=!0:(u==="some"&&(s=!0),i=!1)}}),i?"all":s?"some":!1}const lS=/([0-9]+)/gm,N7=(t,e,n)=>NN(pa(t.getValue(n)).toLowerCase(),pa(e.getValue(n)).toLowerCase()),L7=(t,e,n)=>NN(pa(t.getValue(n)),pa(e.getValue(n))),B7=(t,e,n)=>M1(pa(t.getValue(n)).toLowerCase(),pa(e.getValue(n)).toLowerCase()),j7=(t,e,n)=>M1(pa(t.getValue(n)),pa(e.getValue(n))),_7=(t,e,n)=>{const r=t.getValue(n),i=e.getValue(n);return r>i?1:r<i?-1:0},H7=(t,e,n)=>M1(t.getValue(n),e.getValue(n));function M1(t,e){return t===e?0:t>e?1:-1}function pa(t){return typeof t=="number"?isNaN(t)||t===1/0||t===-1/0?"":String(t):typeof t=="string"?t:""}function NN(t,e){const n=t.split(lS).filter(Boolean),r=e.split(lS).filter(Boolean);for(;n.length&&r.length;){const i=n.shift(),s=r.shift(),a=parseInt(i,10),u=parseInt(s,10),c=[a,u].sort();if(isNaN(c[0])){if(i>s)return 1;if(s>i)return-1;continue}if(isNaN(c[1]))return isNaN(a)?-1:1;if(a>u)return 1;if(u>a)return-1}return n.length-r.length}const Qf={alphanumeric:N7,alphanumericCaseSensitive:L7,text:B7,textCaseSensitive:j7,datetime:_7,basic:H7},V7={getInitialState:t=>({sorting:[],...t}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:t=>({onSortingChange:_i("sorting",t),isMultiSortEvent:e=>e.shiftKey}),createColumn:(t,e)=>{t.getAutoSortingFn=()=>{const n=e.getFilteredRowModel().flatRows.slice(10);let r=!1;for(const i of n){const s=i?.getValue(t.id);if(Object.prototype.toString.call(s)==="[object Date]")return Qf.datetime;if(typeof s=="string"&&(r=!0,s.split(lS).length>1))return Qf.alphanumeric}return r?Qf.text:Qf.basic},t.getAutoSortDir=()=>{const n=e.getFilteredRowModel().flatRows[0];return typeof n?.getValue(t.id)=="string"?"asc":"desc"},t.getSortingFn=()=>{var n,r;if(!t)throw new Error;return ly(t.columnDef.sortingFn)?t.columnDef.sortingFn:t.columnDef.sortingFn==="auto"?t.getAutoSortingFn():(n=(r=e.options.sortingFns)==null?void 0:r[t.columnDef.sortingFn])!=null?n:Qf[t.columnDef.sortingFn]},t.toggleSorting=(n,r)=>{const i=t.getNextSortingOrder(),s=typeof n<"u"&&n!==null;e.setSorting(a=>{const u=a?.find(y=>y.id===t.id),c=a?.findIndex(y=>y.id===t.id);let d=[],h,g=s?n:i==="desc";if(a!=null&&a.length&&t.getCanMultiSort()&&r?u?h="toggle":h="add":a!=null&&a.length&&c!==a.length-1?h="replace":u?h="toggle":h="replace",h==="toggle"&&(s||i||(h="remove")),h==="add"){var m;d=[...a,{id:t.id,desc:g}],d.splice(0,d.length-((m=e.options.maxMultiSortColCount)!=null?m:Number.MAX_SAFE_INTEGER))}else h==="toggle"?d=a.map(y=>y.id===t.id?{...y,desc:g}:y):h==="remove"?d=a.filter(y=>y.id!==t.id):d=[{id:t.id,desc:g}];return d})},t.getFirstSortDir=()=>{var n,r;return((n=(r=t.columnDef.sortDescFirst)!=null?r:e.options.sortDescFirst)!=null?n:t.getAutoSortDir()==="desc")?"desc":"asc"},t.getNextSortingOrder=n=>{var r,i;const s=t.getFirstSortDir(),a=t.getIsSorted();return a?a!==s&&((r=e.options.enableSortingRemoval)==null||r)&&(!(n&&(i=e.options.enableMultiRemove)!=null)||i)?!1:a==="desc"?"asc":"desc":s},t.getCanSort=()=>{var n,r;return((n=t.columnDef.enableSorting)!=null?n:!0)&&((r=e.options.enableSorting)!=null?r:!0)&&!!t.accessorFn},t.getCanMultiSort=()=>{var n,r;return(n=(r=t.columnDef.enableMultiSort)!=null?r:e.options.enableMultiSort)!=null?n:!!t.accessorFn},t.getIsSorted=()=>{var n;const r=(n=e.getState().sorting)==null?void 0:n.find(i=>i.id===t.id);return r?r.desc?"desc":"asc":!1},t.getSortIndex=()=>{var n,r;return(n=(r=e.getState().sorting)==null?void 0:r.findIndex(i=>i.id===t.id))!=null?n:-1},t.clearSorting=()=>{e.setSorting(n=>n!=null&&n.length?n.filter(r=>r.id!==t.id):[])},t.getToggleSortingHandler=()=>{const n=t.getCanSort();return r=>{n&&(r.persist==null||r.persist(),t.toggleSorting==null||t.toggleSorting(void 0,t.getCanMultiSort()?e.options.isMultiSortEvent==null?void 0:e.options.isMultiSortEvent(r):!1))}}},createTable:t=>{t.setSorting=e=>t.options.onSortingChange==null?void 0:t.options.onSortingChange(e),t.resetSorting=e=>{var n,r;t.setSorting(e?[]:(n=(r=t.initialState)==null?void 0:r.sorting)!=null?n:[])},t.getPreSortedRowModel=()=>t.getGroupedRowModel(),t.getSortedRowModel=()=>(!t._getSortedRowModel&&t.options.getSortedRowModel&&(t._getSortedRowModel=t.options.getSortedRowModel(t)),t.options.manualSorting||!t._getSortedRowModel?t.getPreSortedRowModel():t._getSortedRowModel())}},F7=[a7,A7,C7,R7,c7,f7,O7,k7,V7,S7,I7,D7,P7,z7,E7];function U7(t){var e,n;const r=[...F7,...(e=t._features)!=null?e:[]];let i={_features:r};const s=i._features.reduce((m,y)=>Object.assign(m,y.getDefaultOptions==null?void 0:y.getDefaultOptions(i)),{}),a=m=>i.options.mergeOptions?i.options.mergeOptions(s,m):{...s,...m};let c={...{},...(n=t.initialState)!=null?n:{}};i._features.forEach(m=>{var y;c=(y=m.getInitialState==null?void 0:m.getInitialState(c))!=null?y:c});const d=[];let h=!1;const g={_features:r,options:{...s,...t},initialState:c,_queue:m=>{d.push(m),h||(h=!0,Promise.resolve().then(()=>{for(;d.length;)d.shift()();h=!1}).catch(y=>setTimeout(()=>{throw y})))},reset:()=>{i.setState(i.initialState)},setOptions:m=>{const y=ta(m,i.options);i.options=a(y)},getState:()=>i.options.state,setState:m=>{i.options.onStateChange==null||i.options.onStateChange(m)},_getRowId:(m,y,b)=>{var x;return(x=i.options.getRowId==null?void 0:i.options.getRowId(m,y,b))!=null?x:`${b?[b.id,y].join("."):y}`},getCoreRowModel:()=>(i._getCoreRowModel||(i._getCoreRowModel=i.options.getCoreRowModel(i)),i._getCoreRowModel()),getRowModel:()=>i.getPaginationRowModel(),getRow:(m,y)=>{let b=(y?i.getPrePaginationRowModel():i.getRowModel()).rowsById[m];if(!b&&(b=i.getCoreRowModel().rowsById[m],!b))throw new Error;return b},_getDefaultColumnDef:ht(()=>[i.options.defaultColumn],m=>{var y;return m=(y=m)!=null?y:{},{header:b=>{const x=b.header.column.columnDef;return x.accessorKey?x.accessorKey:x.accessorFn?x.id:null},cell:b=>{var x,w;return(x=(w=b.renderValue())==null||w.toString==null?void 0:w.toString())!=null?x:null},...i._features.reduce((b,x)=>Object.assign(b,x.getDefaultColumnDef==null?void 0:x.getDefaultColumnDef()),{}),...m}},pt(t,"debugColumns")),_getColumnDefs:()=>i.options.columns,getAllColumns:ht(()=>[i._getColumnDefs()],m=>{const y=function(b,x,w){return w===void 0&&(w=0),b.map(C=>{const T=l7(i,C,w,x),E=C;return T.columns=E.columns?y(E.columns,T,w+1):[],T})};return y(m)},pt(t,"debugColumns")),getAllFlatColumns:ht(()=>[i.getAllColumns()],m=>m.flatMap(y=>y.getFlatColumns()),pt(t,"debugColumns")),_getAllFlatColumnsById:ht(()=>[i.getAllFlatColumns()],m=>m.reduce((y,b)=>(y[b.id]=b,y),{}),pt(t,"debugColumns")),getAllLeafColumns:ht(()=>[i.getAllColumns(),i._getOrderColumnsFn()],(m,y)=>{let b=m.flatMap(x=>x.getLeafColumns());return y(b)},pt(t,"debugColumns")),getColumn:m=>i._getAllFlatColumnsById()[m]};Object.assign(i,g);for(let m=0;m<i._features.length;m++){const y=i._features[m];y==null||y.createTable==null||y.createTable(i)}return i}function $7(){return t=>ht(()=>[t.options.data],e=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(i,s,a){s===void 0&&(s=0);const u=[];for(let d=0;d<i.length;d++){const h=u7(t,t._getRowId(i[d],d,a),i[d],d,s,void 0,a?.id);if(n.flatRows.push(h),n.rowsById[h.id]=h,u.push(h),t.options.getSubRows){var c;h.originalSubRows=t.options.getSubRows(i[d],d),(c=h.originalSubRows)!=null&&c.length&&(h.subRows=r(h.originalSubRows,s+1,h))}}return u};return n.rows=r(e),n},pt(t.options,"debugTable","getRowModel",()=>t._autoResetPageIndex()))}function q7(){return t=>ht(()=>[t.getState().sorting,t.getPreSortedRowModel()],(e,n)=>{if(!n.rows.length||!(e!=null&&e.length))return n;const r=t.getState().sorting,i=[],s=r.filter(c=>{var d;return(d=t.getColumn(c.id))==null?void 0:d.getCanSort()}),a={};s.forEach(c=>{const d=t.getColumn(c.id);d&&(a[c.id]={sortUndefined:d.columnDef.sortUndefined,invertSorting:d.columnDef.invertSorting,sortingFn:d.getSortingFn()})});const u=c=>{const d=c.map(h=>({...h}));return d.sort((h,g)=>{for(let y=0;y<s.length;y+=1){var m;const b=s[y],x=a[b.id],w=x.sortUndefined,C=(m=b?.desc)!=null?m:!1;let T=0;if(w){const E=h.getValue(b.id),M=g.getValue(b.id),k=E===void 0,P=M===void 0;if(k||P){if(w==="first")return k?-1:1;if(w==="last")return k?1:-1;T=k&&P?0:k?w:-w}}if(T===0&&(T=x.sortingFn(h,g,b.id)),T!==0)return C&&(T*=-1),x.invertSorting&&(T*=-1),T}return h.index-g.index}),d.forEach(h=>{var g;i.push(h),(g=h.subRows)!=null&&g.length&&(h.subRows=u(h.subRows))}),d};return{rows:u(n.rows),flatRows:i,rowsById:n.rowsById}},pt(t.options,"debugTable","getSortedRowModel",()=>t._autoResetPageIndex()))}function Mb(t,e){return t?G7(t)?R.createElement(t,e):t:null}function G7(t){return W7(t)||typeof t=="function"||K7(t)}function W7(t){return typeof t=="function"&&(()=>{const e=Object.getPrototypeOf(t);return e.prototype&&e.prototype.isReactComponent})()}function K7(t){return typeof t=="object"&&typeof t.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(t.$$typeof.description)}function Y7(t){const e={state:{},onStateChange:()=>{},renderFallbackValue:null,...t},[n]=R.useState(()=>({current:U7(e)})),[r,i]=R.useState(()=>n.current.initialState);return n.current.setOptions(s=>({...s,...t,state:{...r,...t.state},onStateChange:a=>{i(a),t.onStateChange==null||t.onStateChange(a)}})),n.current}const ay=0,wa=1,Zc=2,LN=4;function _O(t){return()=>t}function X7(t){t()}function Ld(t,e){return n=>t(e(n))}function HO(t,e){return()=>t(e)}function Q7(t,e){return n=>t(e,n)}function A1(t){return t!==void 0}function Z7(...t){return()=>{t.map(X7)}}function Jc(){}function uy(t,e){return e(t),t}function J7(t,e){return e(t)}function Bn(...t){return t}function fn(t,e){return t(wa,e)}function Mt(t,e){t(ay,e)}function O1(t){t(Zc)}function Hn(t){return t(LN)}function tt(t,e){return fn(t,Q7(e,ay))}function Lo(t,e){const n=t(wa,r=>{n(),e(r)});return n}function VO(t){let e,n;return r=>i=>{e=i,n&&clearTimeout(n),n=setTimeout(()=>{r(e)},t)}}function BN(t,e){return t===e}function Nn(t=BN){let e;return n=>r=>{t(e,r)||(e=r,n(r))}}function ft(t){return e=>n=>{t(n)&&e(n)}}function We(t){return e=>Ld(e,t)}function fs(t){return e=>()=>{e(t)}}function Oe(t,...e){const n=eW(...e);return((r,i)=>{switch(r){case Zc:O1(t);return;case wa:return fn(t,n(i))}})}function ys(t,e){return n=>r=>{n(e=t(e,r))}}function mu(t){return e=>n=>{t>0?t--:e(n)}}function el(t){let e=null,n;return r=>i=>{e=i,!n&&(n=setTimeout(()=>{n=void 0,r(e)},t))}}function kt(...t){const e=new Array(t.length);let n=0,r=null;const i=2**t.length-1;return t.forEach((s,a)=>{const u=2**a;fn(s,c=>{const d=n;n|=u,e[a]=c,d!==i&&n===i&&r&&(r(),r=null)})}),s=>a=>{const u=()=>{s([a].concat(e))};n===i?u():r=u}}function eW(...t){return e=>t.reduceRight(J7,e)}function tW(t){let e,n;const r=()=>e?.();return function(i,s){switch(i){case wa:return s?n===s?void 0:(r(),n=s,e=fn(t,s),e):(r(),Jc);case Zc:r(),n=null;return}}}function Ne(t){let e=t;const n=Ut();return((r,i)=>{switch(r){case ay:e=i;break;case wa:{i(e);break}case LN:return e}return n(r,i)})}function Xr(t,e){return uy(Ne(e),n=>tt(t,n))}function Ut(){const t=[];return((e,n)=>{switch(e){case ay:t.slice().forEach(r=>{r(n)});return;case Zc:t.splice(0,t.length);return;case wa:return t.push(n),()=>{const r=t.indexOf(n);r>-1&&t.splice(r,1)}}})}function Bi(t){return uy(Ut(),e=>tt(t,e))}function en(t,e=[],{singleton:n}={singleton:!0}){return{constructor:t,dependencies:e,id:nW(),singleton:n}}const nW=()=>Symbol();function rW(t){const e=new Map,n=({constructor:r,dependencies:i,id:s,singleton:a})=>{if(a&&e.has(s))return e.get(s);const u=r(i.map(c=>n(c)));return a&&e.set(s,u),u};return n(t)}function gr(...t){const e=Ut(),n=new Array(t.length);let r=0;const i=2**t.length-1;return t.forEach((s,a)=>{const u=2**a;fn(s,c=>{n[a]=c,r|=u,r===i&&Mt(e,n)})}),function(s,a){switch(s){case Zc:{O1(e);return}case wa:return r===i&&a(n),fn(e,a)}}}function ct(t,e=BN){return Oe(t,Nn(e))}function aS(...t){return function(e,n){switch(e){case Zc:return;case wa:return Z7(...t.map(r=>fn(r,n)))}}}const Cr={DEBUG:0,INFO:1,WARN:2,ERROR:3},iW={[Cr.DEBUG]:"debug",[Cr.ERROR]:"error",[Cr.INFO]:"log",[Cr.WARN]:"warn"},oW=()=>typeof globalThis>"u"?window:globalThis,Ca=en(()=>{const t=Ne(Cr.ERROR);return{log:Ne((e,n,r=Cr.INFO)=>{const i=oW().VIRTUOSO_LOG_LEVEL??Hn(t);r>=i&&console[iW[r]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",e,n)}),logLevel:t}},[],{singleton:!0}),uS=new WeakMap;function jN(t){return"self"in t?t.document.documentElement:t}function sW(t){const e=jN(t),n=uS.get(e);if(n!==void 0)return n;const r=e.ownerDocument.defaultView.getComputedStyle(e).direction==="rtl";return uS.set(e,r),r}function FO(t){uS.delete(jN(t))}function _N(t,e){return sW(t)?-e:e}const tu=_N;function UO(t,e){return _N(t,e)}function Cs(t,e,n){return k1(t,e,n).callbackRef}function k1(t,e,n){const r=Ve.useRef(null);let i=a=>{};const s=Ve.useMemo(()=>typeof ResizeObserver<"u"?new ResizeObserver(a=>{const u=()=>{const c=a[0].target;c.offsetParent!==null&&t(c)};n?u():requestAnimationFrame(u)}):null,[t,n]);return i=a=>{a&&e?(s?.observe(a),r.current=a):(r.current&&s?.unobserve(r.current),r.current=null)},{callbackRef:i,ref:r}}function HN(t,e,n,r,i,s,a,u,c){const d=Ve.useCallback(h=>{const g=lW(h.children,e,u?"offsetWidth":"offsetHeight",i);let m=h.parentElement;for(;m.dataset.virtuosoScroller===void 0;)m=m.parentElement;const y=m.lastElementChild.dataset.viewportType==="window";let b;y&&(b=m.ownerDocument.defaultView);const x=a?u?a.scrollWidth:a.scrollHeight:y?u?b.document.documentElement.scrollWidth:b.document.documentElement.scrollHeight:u?m.scrollWidth:m.scrollHeight,w=a?u?a.offsetWidth:a.offsetHeight:y?u?b.innerWidth:b.innerHeight:u?m.offsetWidth:m.offsetHeight,C=a?u?tu(a,a.scrollLeft):a.scrollTop:y?u?tu(b,b.scrollX||b.document.documentElement.scrollLeft):b.scrollY||b.document.documentElement.scrollTop:u?tu(m,m.scrollLeft):m.scrollTop;r({scrollHeight:x,scrollTop:Math.max(C,0),viewportHeight:w}),s?.(u?$O("column-gap",getComputedStyle(h).columnGap,i):$O("row-gap",getComputedStyle(h).rowGap,i)),g!==null&&t(g)},[t,e,i,s,a,r,u]);return k1(d,n,c)}function lW(t,e,n,r){const i=t.length;if(i===0)return null;const s=[];for(let a=0;a<i;a++){const u=t.item(a);if(u.dataset.index===void 0)continue;const c=parseInt(u.dataset.index),d=parseFloat(u.dataset.knownSize),h=e(u,n);if(h===0&&r("Zero-sized element, this should not happen",{child:u},Cr.ERROR),h===d)continue;const g=s[s.length-1];s.length===0||g.size!==h||g.endIndex!==c-1?s.push({endIndex:c,size:h,startIndex:c}):s[s.length-1].endIndex++}return s}function $O(t,e,n){return e!=="normal"&&e?.endsWith("px")!==!0&&n(`${t} was not resolved to pixel value correctly`,e,Cr.WARN),e==="normal"?0:parseInt(e??"0",10)}function I1(t,e,n){const r=Ve.useRef(null),i=Ve.useCallback(c=>{if(!c?.offsetParent)return;const d=c.getBoundingClientRect(),h=d.width;let g,m;if(e){const y=e.getBoundingClientRect(),b=d.top-y.top;m=y.height-Math.max(0,b),g=b+e.scrollTop}else{const y=a.current.ownerDocument.defaultView;m=y.innerHeight-Math.max(0,d.top),g=d.top+y.scrollY}r.current={listHeight:d.height,offsetTop:g,visibleHeight:m,visibleWidth:h},t(r.current)},[t,e]),{callbackRef:s,ref:a}=k1(i,!0,n),u=Ve.useCallback(()=>{i(a.current)},[i,a]);return Ve.useEffect(()=>{if(e){e.addEventListener("scroll",u);const d=new ResizeObserver(()=>{requestAnimationFrame(u)});return d.observe(e),()=>{e.removeEventListener("scroll",u),d.unobserve(e)}}const c=a.current?.ownerDocument.defaultView;return c?.addEventListener("scroll",u),c?.addEventListener("resize",u),()=>{c?.removeEventListener("scroll",u),c?.removeEventListener("resize",u)}},[u,e,a]),s}const ci=en(()=>{const t=Ut(),e=Ut(),n=Ne(0),r=Ut(),i=Ne(0),s=Ut(),a=Ut(),u=Ne(0),c=Ne(0),d=Ne(0),h=Ne(0),g=Ut(),m=Ut(),y=Ne(!1),b=Ne(!1),x=Ne(!1);return tt(Oe(t,We(({scrollTop:w})=>w)),e),tt(Oe(t,We(({scrollHeight:w})=>w)),a),tt(e,i),{deviation:n,fixedFooterHeight:d,fixedHeaderHeight:c,footerHeight:h,headerHeight:u,horizontalDirection:b,scrollBy:m,scrollContainerState:t,scrollHeight:a,scrollingInProgress:y,scrollTo:g,scrollTop:e,skipAnimationFrameInResizeObserver:x,smoothScrollTargetReached:r,statefulScrollTop:i,viewportHeight:s}},[],{singleton:!0}),Bd={lvl:0};function VN(t,e){const n=t.length;if(n===0)return[];let{index:r,value:i}=e(t[0]);const s=[];for(let a=1;a<n;a++){const{index:u,value:c}=e(t[a]);s.push({end:u-1,start:r,value:i}),r=u,i=c}return s.push({end:1/0,start:r,value:i}),s}function Cn(t){return t===Bd}function jd(t,e){if(!Cn(t))return e===t.k?t.v:e<t.k?jd(t.l,e):jd(t.r,e)}function jo(t,e,n="k"){if(Cn(t))return[-1/0,void 0];if(Number(t[n])===e)return[t.k,t.v];if(Number(t[n])<e){const r=jo(t.r,e,n);return r[0]===-1/0?[t.k,t.v]:r}return jo(t.l,e,n)}function Ni(t,e,n){return Cn(t)?$N(e,n,1):e===t.k?br(t,{k:e,v:n}):e<t.k?qO(br(t,{l:Ni(t.l,e,n)})):qO(br(t,{r:Ni(t.r,e,n)}))}function xc(){return Bd}function Sc(t,e,n){if(Cn(t))return[];const r=jo(t,e)[0];return aW(fS(t,r,n))}function cS(t,e){if(Cn(t))return Bd;const{k:n,l:r,r:i}=t;if(e===n){if(Cn(r))return i;if(Cn(i))return r;const[s,a]=UN(r);return zg(br(t,{k:s,l:FN(r),v:a}))}return e<n?zg(br(t,{l:cS(r,e)})):zg(br(t,{r:cS(i,e)}))}function nu(t){return Cn(t)?[]:[...nu(t.l),{k:t.k,v:t.v},...nu(t.r)]}function fS(t,e,n){if(Cn(t))return[];const{k:r,l:i,r:s,v:a}=t;let u=[];return r>e&&(u=u.concat(fS(i,e,n))),r>=e&&r<=n&&u.push({k:r,v:a}),r<=n&&(u=u.concat(fS(s,e,n))),u}function zg(t){const{l:e,lvl:n,r}=t;if(r.lvl>=n-1&&e.lvl>=n-1)return t;if(n>r.lvl+1){if(Ab(e))return qN(br(t,{lvl:n-1}));if(!Cn(e)&&!Cn(e.r))return br(e.r,{l:br(e,{r:e.r.l}),lvl:n,r:br(t,{l:e.r.r,lvl:n-1})});throw new Error("Unexpected empty nodes")}if(Ab(t))return dS(br(t,{lvl:n-1}));if(!Cn(r)&&!Cn(r.l)){const i=r.l,s=Ab(i)?r.lvl-1:r.lvl;return br(i,{l:br(t,{lvl:n-1,r:i.l}),lvl:i.lvl+1,r:dS(br(r,{l:i.r,lvl:s}))})}throw new Error("Unexpected empty nodes")}function br(t,e){return $N(e.k!==void 0?e.k:t.k,e.v!==void 0?e.v:t.v,e.lvl!==void 0?e.lvl:t.lvl,e.l!==void 0?e.l:t.l,e.r!==void 0?e.r:t.r)}function FN(t){return Cn(t.r)?t.l:zg(br(t,{r:FN(t.r)}))}function Ab(t){return Cn(t)||t.lvl>t.r.lvl}function UN(t){return Cn(t.r)?[t.k,t.v]:UN(t.r)}function $N(t,e,n,r=Bd,i=Bd){return{k:t,l:r,lvl:n,r:i,v:e}}function qO(t){return dS(qN(t))}function qN(t){const{l:e}=t;return!Cn(e)&&e.lvl===t.lvl?br(e,{r:br(t,{l:e.r})}):t}function dS(t){const{lvl:e,r:n}=t;return!Cn(n)&&!Cn(n.r)&&n.lvl===e&&n.r.lvl===e?br(n,{l:br(t,{r:n.l}),lvl:e+1}):t}function aW(t){return VN(t,({k:e,v:n})=>({index:e,value:n}))}function GN(t,e){return!!(t&&t.startIndex===e.startIndex&&t.endIndex===e.endIndex)}function _d(t,e){return!!(t&&t[0]===e[0]&&t[1]===e[1])}const D1=en(()=>({recalcInProgress:Ne(!1)}),[],{singleton:!0});function WN(t,e,n){return t[lm(t,e,n)]}function lm(t,e,n,r=0){let i=t.length-1;for(;r<=i;){const s=Math.floor((r+i)/2),a=t[s],u=n(a,e);if(u===0)return s;if(u===-1){if(i-r<2)return s-1;i=s-1}else{if(i===r)return s;r=s+1}}throw new Error(`Failed binary finding record in array - ${t.join(",")}, searched for ${e}`)}function uW(t,e,n,r){const i=lm(t,e,r),s=lm(t,n,r,i);return t.slice(i,s+1)}function _o(t,e){return Math.round(t.getBoundingClientRect()[e])}function cy(t){return!Cn(t.groupOffsetTree)}function P1({index:t},e){return e===t?0:e<t?-1:1}function cW(){return{groupIndices:[],groupOffsetTree:xc(),lastIndex:0,lastOffset:0,lastSize:0,offsetTree:[],sizeTree:xc()}}function fW(t,e){let n=Cn(t)?0:1/0;for(const r of e){const{endIndex:i,size:s,startIndex:a}=r;if(n=Math.min(n,a),Cn(t)){t=Ni(t,0,s);continue}const u=Sc(t,a-1,i+1);if(u.some(vW(r)))continue;let c=!1,d=!1;for(const{end:h,start:g,value:m}of u)c?(i>=g||s===m)&&(t=cS(t,g)):(d=m!==s,c=!0),h>i&&i>=g&&m!==s&&(t=Ni(t,i+1,m));d&&(t=Ni(t,a,s))}return[t,n]}function dW(t){return typeof t.groupIndex<"u"}function hW({offset:t},e){return e===t?0:e<t?-1:1}function Hd(t,e,n){if(e.length===0)return 0;const{index:r,offset:i,size:s}=WN(e,t,P1),a=t-r,u=s*a+(a-1)*n+i;return u>0?u+n:u}function KN(t,e){if(!cy(e))return t;let n=0;for(;e.groupIndices[n]<=t+n;)n++;return t+n}function YN(t,e,n){if(dW(t))return e.groupIndices[t.groupIndex]+1;const r=t.index==="LAST"?n:t.index;let i=KN(r,e);return i=Math.max(0,i,Math.min(n,i)),i}function pW(t,e,n,r=0){return r>0&&(e=Math.max(e,WN(t,r,P1).offset)),VN(uW(t,e,n,hW),yW)}function gW(t,[e,n,r,i]){e.length>0&&r("received item sizes",e,Cr.DEBUG);const s=t.sizeTree;let a=s,u=0;if(n.length>0&&Cn(s)&&e.length===2){const m=e[0].size,y=e[1].size;a=n.reduce((b,x)=>Ni(Ni(b,x,m),x+1,y),a)}else[a,u]=fW(a,e);if(a===s)return t;const{lastIndex:c,lastOffset:d,lastSize:h,offsetTree:g}=hS(t.offsetTree,u,a,i);return{groupIndices:n,groupOffsetTree:n.reduce((m,y)=>Ni(m,y,Hd(y,g,i)),xc()),lastIndex:c,lastOffset:d,lastSize:h,offsetTree:g,sizeTree:a}}function mW(t){return nu(t).map(({k:e,v:n},r,i)=>{const s=i[r+1];return{endIndex:s!==void 0?s.k-1:1/0,size:n,startIndex:e}})}function GO(t,e){let n=0,r=0;for(;n<t;)n+=e[r+1]-e[r]-1,r++;return r-(n===t?0:1)}function hS(t,e,n,r){let i=t,s=0,a=0,u=0,c=0;if(e!==0){c=lm(i,e-1,P1),u=i[c].offset;const d=jo(n,e-1);s=d[0],a=d[1],i.length&&i[c].size===jo(n,e)[1]&&(c-=1),i=i.slice(0,c+1)}else i=[];for(const{start:d,value:h}of Sc(n,e,1/0)){const g=d-s,m=g*a+u+g*r;i.push({index:d,offset:m,size:h}),s=d,u=m,a=h}return{lastIndex:s,lastOffset:u,lastSize:a,offsetTree:i}}function yW(t){return{index:t.index,value:t}}function vW(t){const{endIndex:e,size:n,startIndex:r}=t;return i=>i.start===r&&(i.end===e||i.end===1/0)&&i.value===n}const bW={offsetHeight:"height",offsetWidth:"width"},Ts=en(([{log:t},{recalcInProgress:e}])=>{const n=Ut(),r=Ut(),i=Xr(r,0),s=Ut(),a=Ut(),u=Ne(0),c=Ne([]),d=Ne(void 0),h=Ne(void 0),g=Ne(void 0),m=Ne(void 0),y=Ne((A,I)=>_o(A,bW[I])),b=Ne(void 0),x=Ne(0),w=cW(),C=Xr(Oe(n,kt(c,t,x),ys(gW,w),Nn()),w),T=Xr(Oe(c,Nn(),ys((A,I)=>({current:I,prev:A.current}),{current:[],prev:[]}),We(({prev:A})=>A)),[]);tt(Oe(c,ft(A=>A.length>0),kt(C,x),We(([A,I,L])=>{const j=A.reduce((N,_,H)=>Ni(N,_,Hd(_,I.offsetTree,L)||H),xc());return{...I,groupIndices:A,groupOffsetTree:j}})),C),tt(Oe(r,kt(C),ft(([A,{lastIndex:I}])=>A<I),We(([A,{lastIndex:I,lastSize:L}])=>[{endIndex:I,size:L,startIndex:A}])),n),tt(d,h);const E=Xr(Oe(d,We(A=>A===void 0)),!0);tt(Oe(h,ft(A=>A!==void 0&&Cn(Hn(C).sizeTree)),We(A=>{const I=Hn(g),L=Hn(c).length>0;return I!==void 0&&I!==0?L?[{endIndex:0,size:I,startIndex:0},{endIndex:1,size:A,startIndex:1}]:[]:[{endIndex:0,size:A,startIndex:0}]})),n),tt(Oe(m,ft(A=>A!==void 0&&A.length>0&&Cn(Hn(C).sizeTree)),We(A=>{const I=[];let L=A[0],j=0;for(let N=1;N<A.length;N++){const _=A[N];_!==L&&(I.push({endIndex:N-1,size:L,startIndex:j}),L=_,j=N)}return I.push({endIndex:A.length-1,size:L,startIndex:j}),I})),n),tt(Oe(c,kt(g,h),ft(([,A,I])=>A!==void 0&&I!==void 0),We(([A,I,L])=>{const j=[];for(let N=0;N<A.length;N++){const _=A[N],H=A[N+1];j.push({startIndex:_,endIndex:_,size:I}),H!==void 0&&j.push({startIndex:_+1,endIndex:H-1,size:L})}return j})),n);const M=Bi(Oe(n,kt(C),ys(({sizes:A},[I,L])=>({changed:L!==A,sizes:L}),{changed:!1,sizes:w}),We(A=>A.changed)));fn(Oe(u,ys((A,I)=>({diff:A.prev-I,prev:I}),{diff:0,prev:0}),We(A=>A.diff)),A=>{const{groupIndices:I}=Hn(C);if(A>0)Mt(e,!0),Mt(s,A+GO(A,I));else if(A<0){const L=Hn(T);L.length>0&&(A-=GO(-A,L)),Mt(a,A)}}),fn(Oe(u,kt(t)),([A,I])=>{A<0&&I("`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",{firstItemIndex:u},Cr.ERROR)});const k=Bi(s);tt(Oe(s,kt(C),We(([A,I])=>{const L=I.groupIndices.length>0,j=[],N=I.lastSize;if(L){const _=jd(I.sizeTree,0);let H=0,F=0;for(;H<A;){const B=I.groupIndices[F],q=I.groupIndices.length===F+1?1/0:I.groupIndices[F+1]-B-1;j.push({endIndex:B,size:_,startIndex:B}),j.push({endIndex:B+1+q-1,size:N,startIndex:B+1}),F++,H+=q+1}const G=nu(I.sizeTree);return H!==A&&G.shift(),G.reduce((B,{k:q,v:U})=>{let X=B.ranges;return B.prevSize!==0&&(X=[...B.ranges,{endIndex:q+A-1,size:B.prevSize,startIndex:B.prevIndex}]),{prevIndex:q+A,prevSize:U,ranges:X}},{prevIndex:A,prevSize:0,ranges:j}).ranges}return nu(I.sizeTree).reduce((_,{k:H,v:F})=>({prevIndex:H+A,prevSize:F,ranges:[..._.ranges,{endIndex:H+A-1,size:_.prevSize,startIndex:_.prevIndex}]}),{prevIndex:0,prevSize:N,ranges:[]}).ranges})),n);const P=Bi(Oe(a,kt(C,x),We(([A,{offsetTree:I},L])=>{const j=-A;return Hd(j,I,L)})));return tt(Oe(a,kt(C,x),We(([A,I,L])=>{if(I.groupIndices.length>0){if(Cn(I.sizeTree))return I;let N=xc();const _=Hn(T);let H=0,F=0,G=0;for(;H<-A;){G=_[F];const B=_[F+1]-G-1;F++,H+=B+1}if(N=nu(I.sizeTree).reduce((B,{k:q,v:U})=>Ni(B,Math.max(0,q+A),U),N),H!==-A){const B=jd(I.sizeTree,G);N=Ni(N,0,B);const q=jo(I.sizeTree,-A+1)[1];N=Ni(N,1,q)}return{...I,sizeTree:N,...hS(I.offsetTree,0,N,L)}}const j=nu(I.sizeTree).reduce((N,{k:_,v:H})=>Ni(N,Math.max(0,_+A),H),xc());return{...I,sizeTree:j,...hS(I.offsetTree,0,j,L)}})),C),{beforeUnshiftWith:k,data:b,defaultItemSize:h,firstItemIndex:u,fixedItemSize:d,fixedGroupSize:g,gap:x,groupIndices:c,heightEstimates:m,itemSize:y,listRefresh:M,shiftWith:a,shiftWithOffset:P,sizeRanges:n,sizes:C,statefulTotalCount:i,totalCount:r,trackItemSizes:E,unshiftWith:s}},Bn(Ca,D1),{singleton:!0});function xW(t){return t.reduce((e,n)=>(e.groupIndices.push(e.totalCount),e.totalCount+=n+1,e),{groupIndices:[],totalCount:0})}const XN=en(([{groupIndices:t,sizes:e,totalCount:n},{headerHeight:r,scrollTop:i}])=>{const s=Ut(),a=Ut(),u=Bi(Oe(s,We(xW)));return tt(Oe(u,We(c=>c.totalCount)),n),tt(Oe(u,We(c=>c.groupIndices)),t),tt(Oe(gr(i,e,r),ft(([c,d])=>cy(d)),We(([c,d,h])=>jo(d.groupOffsetTree,Math.max(c-h,0),"v")[0]),Nn(),We(c=>[c])),a),{groupCounts:s,topItemsIndexes:a}},Bn(Ts,ci)),Ra=en(([{log:t}])=>{const e=Ne(!1),n=Bi(Oe(e,ft(r=>r),Nn()));return fn(e,r=>{r&&Hn(t)("props updated",{},Cr.DEBUG)}),{didMount:n,propsReady:e}},Bn(Ca),{singleton:!0}),SW=typeof document<"u"&&"scrollBehavior"in document.documentElement.style;function QN(t){const e=typeof t=="number"?{index:t}:t;return e.align||(e.align="start"),(!e.behavior||!SW)&&(e.behavior="auto"),e.offset===void 0&&(e.offset=0),e}const fh=en(([{gap:t,listRefresh:e,sizes:n,totalCount:r},{fixedFooterHeight:i,fixedHeaderHeight:s,footerHeight:a,headerHeight:u,scrollingInProgress:c,scrollTo:d,smoothScrollTargetReached:h,viewportHeight:g},{log:m}])=>{const y=Ut(),b=Ut(),x=Ne(0);let w=null,C=null,T=null;function E(){w!==null&&(w(),w=null),T!==null&&(T(),T=null),C&&(clearTimeout(C),C=null),Mt(c,!1)}return tt(Oe(y,kt(n,g,r,x,u,a,m),kt(t,s,i),We(([[M,k,P,A,I,L,j,N],_,H,F])=>{const G=QN(M),{align:B,behavior:q,offset:U}=G,X=A-1,Z=YN(G,k,X);let z=Hd(Z,k.offsetTree,_)+L;B==="end"?(z+=H+jo(k.sizeTree,Z)[1]-P+F,Z===X&&(z+=j)):B==="center"?z+=(H+jo(k.sizeTree,Z)[1]-P+F)/2:z-=I,U!==void 0&&U!==0&&(z+=U);const $=W=>{E(),W?(N("retrying to scroll to",{location:M},Cr.DEBUG),Mt(y,M)):(Mt(b,!0),N("list did not change, scroll successful",{},Cr.DEBUG))};if(E(),q==="smooth"){let W=!1;T=fn(e,K=>{W=W||K}),w=Lo(h,()=>{$(W)})}else w=Lo(Oe(e,wW(150)),$);return C=setTimeout(()=>{E()},1200),Mt(c,!0),N("scrolling from index to",{behavior:q,index:Z,top:z},Cr.DEBUG),{behavior:q,top:z}})),d),{scrollTargetReached:b,scrollToIndex:y,topListHeight:x}},Bn(Ts,ci,Ca),{singleton:!0});function wW(t){return e=>{const n=setTimeout(()=>{e(!1)},t);return r=>{r&&(e(!0),clearTimeout(n))}}}function z1(t,e){t===0?e():requestAnimationFrame(()=>{z1(t-1,e)})}function N1(t,e){const n=e-1;return typeof t=="number"?t:t.index==="LAST"?n:t.index}const dh=en(([{defaultItemSize:t,listRefresh:e,sizes:n},{scrollTop:r},{scrollTargetReached:i,scrollToIndex:s},{didMount:a}])=>{const u=Ne(!0),c=Ne(0),d=Ne(!0);return tt(Oe(a,kt(c),ft(([h,g])=>g!==0),fs(!1)),u),tt(Oe(a,kt(c),ft(([h,g])=>g!==0),fs(!1)),d),fn(Oe(gr(e,a),kt(u,n,t,d),ft(([[,h],g,{sizeTree:m},y,b])=>h&&(!Cn(m)||A1(y))&&!g&&!b),kt(c)),([,h])=>{Lo(i,()=>{Mt(d,!0)}),z1(4,()=>{Lo(r,()=>{Mt(u,!0)}),Mt(s,h)})}),{initialItemFinalLocationReached:d,initialTopMostItemIndex:c,scrolledToInitialItem:u}},Bn(Ts,ci,fh,Ra),{singleton:!0});function ZN(t,e){return Math.abs(t-e)<1.01}const Vd="up",md="down",CW="none",RW={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollHeight:0,scrollTop:0,viewportHeight:0}},TW=0,hh=en(([{footerHeight:t,headerHeight:e,scrollBy:n,scrollContainerState:r,scrollTop:i,viewportHeight:s}])=>{const a=Ne(!1),u=Ne(!0),c=Ut(),d=Ut(),h=Ne(4),g=Ne(TW),m=Xr(Oe(aS(Oe(ct(i),mu(1),fs(!0)),Oe(ct(i),mu(1),fs(!1),VO(100))),Nn()),!1),y=Xr(Oe(aS(Oe(n,fs(!0)),Oe(n,fs(!1),VO(200))),Nn()),!1);tt(Oe(gr(ct(i),ct(g)),We(([T,E])=>T<=E),Nn()),u),tt(Oe(u,el(50)),d);const b=Bi(Oe(gr(r,ct(s),ct(e),ct(t),ct(h)),ys((T,[{scrollHeight:E,scrollTop:M},k,P,A,I])=>{const L=M+k-E>-I,j={scrollHeight:E,scrollTop:M,viewportHeight:k};if(L){let _,H;return M>T.state.scrollTop?(_="SCROLLED_DOWN",H=T.state.scrollTop-M):(_="SIZE_DECREASED",H=T.state.scrollTop-M||T.scrollTopDelta),{atBottom:!0,atBottomBecause:_,scrollTopDelta:H,state:j}}let N;return j.scrollHeight>T.state.scrollHeight?N="SIZE_INCREASED":k<T.state.viewportHeight?N="VIEWPORT_HEIGHT_DECREASING":M<T.state.scrollTop?N="SCROLLING_UPWARDS":N="NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM",{atBottom:!1,notAtBottomBecause:N,state:j}},RW),Nn((T,E)=>T!==void 0&&T.atBottom===E.atBottom))),x=Xr(Oe(r,ys((T,{scrollHeight:E,scrollTop:M,viewportHeight:k})=>{if(!ZN(T.scrollHeight,E)){const P=E-(M+k)<1;return T.scrollTop!==M&&P?{changed:!0,jump:T.scrollTop-M,scrollHeight:E,scrollTop:M}:{changed:!0,jump:0,scrollHeight:E,scrollTop:M}}return{changed:!1,jump:0,scrollHeight:E,scrollTop:M}},{changed:!1,jump:0,scrollHeight:0,scrollTop:0}),ft(T=>T.changed),We(T=>T.jump)),0);tt(Oe(b,We(T=>T.atBottom)),a),tt(Oe(a,el(50)),c);const w=Ne(md);tt(Oe(r,We(({scrollTop:T})=>T),Nn(),ys((T,E)=>Hn(y)?{direction:T.direction,prevScrollTop:E}:{direction:E<T.prevScrollTop?Vd:md,prevScrollTop:E},{direction:md,prevScrollTop:0}),We(T=>T.direction)),w),tt(Oe(r,el(50),fs(CW)),w);const C=Ne(0);return tt(Oe(m,ft(T=>!T),fs(0)),C),tt(Oe(i,el(100),kt(m),ft(([T,E])=>E),ys(([T,E],[M])=>[E,M],[0,0]),We(([T,E])=>E-T)),C),{atBottomState:b,atBottomStateChange:c,atBottomThreshold:h,atTopStateChange:d,atTopThreshold:g,isAtBottom:a,isAtTop:u,isScrolling:m,lastJumpDueToItemResize:x,scrollDirection:w,scrollVelocity:C}},Bn(ci)),Fd="top",Ud="bottom",WO="none";function KO(t,e,n){return typeof t=="number"?n===Vd&&e===Fd||n===md&&e===Ud?t:0:n===Vd?e===Fd?t.main:t.reverse:e===Ud?t.main:t.reverse}function YO(t,e){return typeof t=="number"?t:t[e]??0}const L1=en(([{deviation:t,fixedHeaderHeight:e,headerHeight:n,scrollTop:r,viewportHeight:i}])=>{const s=Ut(),a=Ne(0),u=Ne(0),c=Ne(0),d=Xr(Oe(gr(ct(r),ct(i),ct(n),ct(s,_d),ct(c),ct(a),ct(e),ct(t),ct(u)),We(([h,g,m,[y,b],x,w,C,T,E])=>{const M=h-T,k=w+C,P=Math.max(m-M,0);let A=WO;const I=YO(E,Fd),L=YO(E,Ud);return y-=T,y+=m+C,b+=m+C,b-=T,y>h+k-I&&(A=Vd),b<h-P+g+L&&(A=md),A!==WO?[Math.max(M-m-KO(x,Fd,A)-I,0),M-P-C+g+KO(x,Ud,A)+L]:null}),ft(h=>h!==null),Nn(_d)),[0,0]);return{increaseViewportBy:u,listBoundary:s,overscan:c,topListHeight:a,visibleRange:d}},Bn(ci),{singleton:!0});function EW(t,e,n){if(cy(e)){const r=KN(t,e);return[{index:jo(e.groupOffsetTree,r)[0],offset:0,size:0},{data:n?.[0],index:r,offset:0,size:0}]}return[{data:n?.[0],index:t,offset:0,size:0}]}const Ob={bottom:0,firstItemIndex:0,items:[],offsetBottom:0,offsetTop:0,top:0,topItems:[],topListHeight:0,totalCount:0};function Ng(t,e,n,r,i,s){const{lastIndex:a,lastOffset:u,lastSize:c}=i;let d=0,h=0;if(t.length>0){d=t[0].offset;const x=t[t.length-1];h=x.offset+x.size}const g=n-a,m=u+g*c+(g-1)*r,y=d,b=m-h;return{bottom:h,firstItemIndex:s,items:XO(t,i,s),offsetBottom:b,offsetTop:d,top:y,topItems:XO(e,i,s),topListHeight:e.reduce((x,w)=>w.size+x,0),totalCount:n}}function JN(t,e,n,r,i,s){let a=0;if(n.groupIndices.length>0)for(const h of n.groupIndices){if(h-a>=t)break;a++}const u=t+a,c=N1(e,u),d=Array.from({length:u}).map((h,g)=>({data:s[g+c],index:g+c,offset:0,size:0}));return Ng(d,[],u,i,n,r)}function XO(t,e,n){if(t.length===0)return[];if(!cy(e))return t.map(d=>({...d,index:d.index+n,originalIndex:d.index}));const r=t[0].index,i=t[t.length-1].index,s=[],a=Sc(e.groupOffsetTree,r,i);let u,c=0;for(const d of t){(!u||u.end<d.index)&&(u=a.shift(),c=e.groupIndices.indexOf(u.start));let h;d.index===u.start?h={index:c,type:"group"}:h={groupIndex:c,index:d.index-(c+1)+n},s.push({...h,data:d.data,offset:d.offset,originalIndex:d.index,size:d.size})}return s}function QO(t,e){return t===void 0?0:typeof t=="number"?t:t[e]??0}const Mu=en(([{data:t,firstItemIndex:e,gap:n,sizes:r,totalCount:i},s,{listBoundary:a,topListHeight:u,visibleRange:c},{initialTopMostItemIndex:d,scrolledToInitialItem:h},{topListHeight:g},m,{didMount:y},{recalcInProgress:b}])=>{const x=Ne([]),w=Ne(0),C=Ut(),T=Ne(0);tt(s.topItemsIndexes,x);const E=Xr(Oe(gr(y,b,ct(c,_d),ct(i),ct(r),ct(d),h,ct(x),ct(e),ct(n),ct(T),t),ft(([A,I,,L,,,,,,,,j])=>{const N=j!==void 0&&j.length!==L;return A&&!I&&!N}),We(([,,[A,I],L,j,N,_,H,F,G,B,q])=>{const U=j,{offsetTree:X,sizeTree:Z}=U,z=Hn(w);if(L===0)return{...Ob,totalCount:L};if(A===0&&I===0)return z===0?{...Ob,totalCount:L}:JN(z,N,j,F,G,q||[]);if(Cn(Z))return z>0?null:Ng(EW(N1(N,L),U,q),[],L,G,U,F);const $=[];if(H.length>0){const se=H[0],ve=H[H.length-1];let ye=0;for(const he of Sc(Z,se,ve)){const pe=he.value,Te=Math.max(he.start,se),Ie=Math.min(he.end,ve);for(let De=Te;De<=Ie;De++)$.push({data:q?.[De],index:De,offset:ye,size:pe}),ye+=pe}}if(!_)return Ng([],$,L,G,U,F);const W=H.length>0?H[H.length-1]+1:0,K=pW(X,A,I,W);if(K.length===0)return null;const ie=L-1,ee=uy([],se=>{for(const ve of K){const ye=ve.value;let he=ye.offset,pe=ve.start;const Te=ye.size;if(ye.offset<A){pe+=Math.floor((A-ye.offset+G)/(Te+G));const De=pe-ve.start;he+=De*Te+De*G}pe<W&&(he+=(W-pe)*Te,pe=W);const Ie=Math.min(ve.end,ie);for(let De=pe;De<=Ie&&!(he>=I);De++)se.push({data:q?.[De],index:De,offset:he,size:Te}),he+=Te+G}}),ae=QO(B,Fd),Y=QO(B,Ud);if(ee.length>0&&(ae>0||Y>0)){const se=ee[0],ve=ee[ee.length-1];if(ae>0&&se.index>W){const ye=Math.min(ae,se.index-W),he=[];let pe=se.offset;for(let Te=se.index-1;Te>=se.index-ye;Te--){const Ie=Sc(Z,Te,Te)[0]?.value??se.size;pe-=Ie+G,he.unshift({data:q?.[Te],index:Te,offset:pe,size:Ie})}ee.unshift(...he)}if(Y>0&&ve.index<ie){const ye=Math.min(Y,ie-ve.index);let he=ve.offset+ve.size+G;for(let pe=ve.index+1;pe<=ve.index+ye;pe++){const Te=Sc(Z,pe,pe)[0]?.value??ve.size;ee.push({data:q?.[pe],index:pe,offset:he,size:Te}),he+=Te+G}}}return Ng(ee,$,L,G,U,F)}),ft(A=>A!==null),Nn()),Ob);tt(Oe(t,ft(A1),We(A=>A?.length)),i),tt(Oe(E,We(A=>A.topListHeight)),g),tt(g,u),tt(Oe(E,We(A=>[A.top,A.bottom])),a),tt(Oe(E,We(A=>A.items)),C);const M=Bi(Oe(E,ft(({items:A})=>A.length>0),kt(i,t),ft(([{items:A},I])=>A[A.length-1].originalIndex===I-1),We(([,A,I])=>[A-1,I]),Nn(_d),We(([A])=>A))),k=Bi(Oe(E,el(200),ft(({items:A,topItems:I})=>A.length>0&&A[0].originalIndex===I.length),We(({items:A})=>A[0].index),Nn())),P=Bi(Oe(E,ft(({items:A})=>A.length>0),We(({items:A})=>{let I=0,L=A.length-1;for(;A[I].type==="group"&&I<L;)I++;for(;A[L].type==="group"&&L>I;)L--;return{endIndex:A[L].index,startIndex:A[I].index}}),Nn(GN)));return{endReached:M,initialItemCount:w,itemsRendered:C,listState:E,minOverscanItemCount:T,rangeChanged:P,startReached:k,topItemsIndexes:x,...m}},Bn(Ts,XN,L1,dh,fh,hh,Ra,D1),{singleton:!0}),eL=en(([{fixedFooterHeight:t,fixedHeaderHeight:e,footerHeight:n,headerHeight:r},{listState:i}])=>{const s=Ut(),a=Xr(Oe(gr(n,t,r,e,i),We(([u,c,d,h,g])=>u+c+d+h+g.offsetBottom+g.bottom)),0);return tt(ct(a),s),{totalListHeight:a,totalListHeightChanged:s}},Bn(ci,Mu),{singleton:!0}),MW=en(([{viewportHeight:t},{totalListHeight:e}])=>{const n=Ne(!1),r=Xr(Oe(gr(n,t,e),ft(([i])=>i),We(([,i,s])=>Math.max(0,i-s)),el(0),Nn()),0);return{alignToBottom:n,paddingTopAddition:r}},Bn(ci,eL),{singleton:!0}),tL=en(()=>({context:Ne(null)})),AW=({itemBottom:t,itemTop:e,locationParams:{align:n,behavior:r,...i},viewportBottom:s,viewportTop:a})=>e<a?{...i,align:n??"start",...r!==void 0?{behavior:r}:{}}:t>s?{...i,align:n??"end",...r!==void 0?{behavior:r}:{}}:null,nL=en(([{gap:t,sizes:e,totalCount:n},{fixedFooterHeight:r,fixedHeaderHeight:i,headerHeight:s,scrollingInProgress:a,scrollTop:u,viewportHeight:c},{scrollToIndex:d}])=>{const h=Ut();return tt(Oe(h,kt(e,c,n,s,i,r,u),kt(t),We(([[g,m,y,b,x,w,C,T],E])=>{const{calculateViewLocation:M=AW,done:k,...P}=g,A=YN(g,m,b-1),I=Hd(A,m.offsetTree,E)+x+w,L=I+jo(m.sizeTree,A)[1],j=T+w,N=T+y-C,_=M({itemBottom:L,itemTop:I,locationParams:P,viewportBottom:N,viewportTop:j});return _!==null?k&&Lo(Oe(a,ft(H=>!H),mu(Hn(a)?1:2)),k):k?.(),_}),ft(g=>g!==null)),d),{scrollIntoView:h}},Bn(Ts,ci,fh,Mu,Ca),{singleton:!0});function ZO(t){return t===!1?!1:t==="smooth"?"smooth":"auto"}const OW=(t,e)=>typeof t=="function"?ZO(t(e)):e&&ZO(t),kW=en(([{listRefresh:t,totalCount:e,fixedItemSize:n,data:r},{atBottomState:i,isAtBottom:s},{scrollToIndex:a},{scrolledToInitialItem:u},{didMount:c,propsReady:d},{log:h},{scrollingInProgress:g},{context:m},{scrollIntoView:y}])=>{const b=Ne(!1),x=Ut();let w=null;function C(k){Mt(a,{align:"end",behavior:k,index:"LAST"})}fn(Oe(gr(Oe(ct(e),mu(1)),c),kt(ct(b),s,u,g),We(([[k,P],A,I,L,j])=>{let N=P&&L,_="auto";return N&&(_=OW(A,I||j),N=N&&_!==!1),{followOutputBehavior:_,shouldFollow:N,totalCount:k}}),ft(({shouldFollow:k})=>k)),({followOutputBehavior:k,totalCount:P})=>{w!==null&&(w(),w=null),Hn(n)!==void 0?requestAnimationFrame(()=>{Hn(h)("following output to ",{totalCount:P},Cr.DEBUG),C(k)}):w=Lo(t,()=>{Hn(h)("following output to ",{totalCount:P},Cr.DEBUG),C(k),w=null})});function T(k){const P=Lo(i,A=>{k&&!A.atBottom&&A.notAtBottomBecause==="SIZE_INCREASED"&&w===null&&(Hn(h)("scrolling to bottom due to increased size",{},Cr.DEBUG),C("auto"))});setTimeout(P,100)}fn(Oe(gr(ct(b),e,d),ft(([k,,P])=>k!==!1&&P),ys(({value:k},[,P])=>({refreshed:k===P,value:P}),{refreshed:!1,value:0}),ft(({refreshed:k})=>k),kt(b,e)),([,k])=>{Hn(u)&&T(k!==!1)}),fn(x,()=>{T(Hn(b)!==!1)}),fn(gr(ct(b),i),([k,P])=>{k!==!1&&!P.atBottom&&P.notAtBottomBecause==="VIEWPORT_HEIGHT_DECREASING"&&C("auto")});const E=Ne(null),M=Ut();return tt(aS(Oe(ct(r),We(k=>k?.length??0)),Oe(ct(e))),M),fn(Oe(gr(Oe(M,mu(1)),c),kt(ct(E),u,g,m),We(([[k,P],A,I,L,j])=>P&&I&&A?.({context:j,totalCount:k,scrollingInProgress:L})),ft(k=>!!k),el(0)),k=>{w!==null&&(w(),w=null),Hn(n)!==void 0?requestAnimationFrame(()=>{Hn(h)("scrolling into view",{}),Mt(y,k)}):w=Lo(t,()=>{Hn(h)("scrolling into view",{}),Mt(y,k),w=null})}),{autoscrollToBottom:x,followOutput:b,scrollIntoViewOnChange:E}},Bn(Ts,hh,fh,dh,Ra,Ca,ci,tL,nL)),IW=en(([{data:t,firstItemIndex:e,gap:n,sizes:r},{initialTopMostItemIndex:i},{initialItemCount:s,listState:a},{didMount:u}])=>(tt(Oe(u,kt(s),ft(([,c])=>c!==0),kt(i,r,e,n,t),We(([[,c],d,h,g,m,y=[]])=>JN(c,d,h,g,m,y))),a),{}),Bn(Ts,dh,Mu,Ra),{singleton:!0}),DW=en(([{didMount:t},{scrollTo:e},{listState:n}])=>{const r=Ne(0);return fn(Oe(t,kt(r),ft(([,i])=>i!==0),We(([,i])=>({top:i}))),i=>{Lo(Oe(n,mu(1),ft(s=>s.items.length>1)),()=>{requestAnimationFrame(()=>{Mt(e,i)})})}),{initialScrollTop:r}},Bn(Ra,ci,Mu),{singleton:!0}),rL=en(([{scrollVelocity:t}])=>{const e=Ne(!1),n=Ut(),r=Ne(!1);return tt(Oe(t,kt(r,e,n),ft(([i,s])=>s!==!1&&s!==void 0),We(([i,s,a,u])=>{const{enter:c,exit:d}=s;if(a){if(d(i,u))return!1}else if(c(i,u))return!0;return a}),Nn()),e),fn(Oe(gr(e,t,n),kt(r)),([[i,s,a],u])=>{i&&u!==!1&&u!==void 0&&u.change&&u.change(s,a)}),{isSeeking:e,scrollSeekConfiguration:r,scrollSeekRangeChanged:n,scrollVelocity:t}},Bn(hh),{singleton:!0}),B1=en(([{scrollContainerState:t,scrollTo:e}])=>{const n=Ut(),r=Ut(),i=Ut(),s=Ne(!1),a=Ne(void 0);return tt(Oe(gr(n,r),We(([{scrollTop:u,viewportHeight:c},{offsetTop:d,listHeight:h}])=>({scrollHeight:h,scrollTop:Math.max(0,u-d),viewportHeight:c}))),t),tt(Oe(e,kt(r),We(([u,{offsetTop:c}])=>({...u,top:u.top+c}))),i),{customScrollParent:a,useWindowScroll:s,windowScrollContainerState:n,windowScrollTo:i,windowViewportRect:r}},Bn(ci)),PW=en(([{sizeRanges:t,sizes:e},{headerHeight:n,scrollTop:r},{initialTopMostItemIndex:i},{didMount:s},{useWindowScroll:a,windowScrollContainerState:u,windowViewportRect:c}])=>{const d=Ut(),h=Ne(void 0),g=Ne(null),m=Ne(null);return tt(u,g),tt(c,m),fn(Oe(d,kt(e,r,a,g,m,n)),([y,b,x,w,C,T,E])=>{const M=mW(b.sizeTree);w&&C!==null&&T!==null&&(x=C.scrollTop-T.offsetTop),x-=E,y({ranges:M,scrollTop:x})}),tt(Oe(h,ft(A1),We(zW)),i),tt(Oe(s,kt(h),ft(([,y])=>y!==void 0),Nn(),We(([,y])=>y.ranges)),t),{getState:d,restoreStateFrom:h}},Bn(Ts,ci,dh,Ra,B1));function zW(t){return{align:"start",index:0,offset:t.scrollTop}}const NW=en(([{topItemsIndexes:t}])=>{const e=Ne(0);return tt(Oe(e,ft(n=>n>=0),We(n=>Array.from({length:n}).map((r,i)=>i))),t),{topItemCount:e}},Bn(Mu));function iL(t){let e=!1,n;return(()=>(e||(e=!0,n=t()),n))}const LW=iL(()=>/iP(ad|od|hone)/i.test(navigator.userAgent)&&/WebKit/i.test(navigator.userAgent)),BW=en(([{deviation:t,scrollBy:e,scrollingInProgress:n,scrollTop:r},{isAtBottom:i,isScrolling:s,lastJumpDueToItemResize:a,scrollDirection:u},{listState:c},{beforeUnshiftWith:d,gap:h,shiftWithOffset:g,sizes:m},{log:y},{recalcInProgress:b}])=>{const x=Bi(Oe(c,kt(a),ys(([,C,T,E],[{bottom:M,items:k,offsetBottom:P,totalCount:A},I])=>{const L=M+P;let j=0;return T===A&&C.length>0&&k.length>0&&(k[0].originalIndex===0&&C[0].originalIndex===0||(j=L-E,j!==0&&(j+=I))),[j,k,A,L]},[0,[],0,0]),ft(([C])=>C!==0),kt(r,u,n,i,y,b),ft(([,C,T,E,,,M])=>!M&&!E&&C!==0&&T===Vd),We(([[C],,,,,T])=>(T("Upward scrolling compensation",{amount:C},Cr.DEBUG),C))));function w(C){C>0?(Mt(e,{behavior:"auto",top:-C}),Mt(t,0)):(Mt(t,0),Mt(e,{behavior:"auto",top:-C}))}return fn(Oe(x,kt(t,s)),([C,T,E])=>{E&&LW()?Mt(t,T-C):w(-C)}),fn(Oe(gr(Xr(s,!1),t,b),ft(([C,T,E])=>!C&&!E&&T!==0),We(([C,T])=>T),el(1)),w),tt(Oe(g,We(C=>({top:-C}))),e),fn(Oe(d,kt(m,h),We(([C,{groupIndices:T,lastSize:E,sizeTree:M},k])=>{function P(N){return N*(E+k)}if(T.length===0)return P(C);let A=0;const I=jd(M,0);let L=0,j=0;for(;L<C;){L++,A+=I;let N=T.length===j+1?1/0:T[j+1]-T[j]-1;L+N>C&&(A-=I,N=C-L+1),L+=N,A+=P(N),j++}return A})),C=>{Mt(t,C),requestAnimationFrame(()=>{Mt(e,{top:C}),requestAnimationFrame(()=>{Mt(t,0),Mt(b,!1)})})}),{deviation:t}},Bn(ci,hh,Mu,Ts,Ca,D1)),jW=en(([t,e,n,r,i,s,a,u,c,d,h])=>({...t,...e,...n,...r,...i,...s,...a,...u,...c,...d,...h}),Bn(L1,IW,Ra,rL,eL,DW,MW,B1,nL,Ca,tL)),oL=en(([{data:t,defaultItemSize:e,firstItemIndex:n,fixedItemSize:r,fixedGroupSize:i,gap:s,groupIndices:a,heightEstimates:u,itemSize:c,sizeRanges:d,sizes:h,statefulTotalCount:g,totalCount:m,trackItemSizes:y},{initialItemFinalLocationReached:b,initialTopMostItemIndex:x,scrolledToInitialItem:w},C,T,E,M,{scrollToIndex:k},P,{topItemCount:A},{groupCounts:I},L])=>{const{listState:j,minOverscanItemCount:N,topItemsIndexes:_,rangeChanged:H,...F}=M;return tt(H,L.scrollSeekRangeChanged),tt(Oe(L.windowViewportRect,We(G=>G.visibleHeight)),C.viewportHeight),{data:t,defaultItemHeight:e,firstItemIndex:n,fixedItemHeight:r,fixedGroupHeight:i,gap:s,groupCounts:I,heightEstimates:u,initialItemFinalLocationReached:b,initialTopMostItemIndex:x,scrolledToInitialItem:w,sizeRanges:d,topItemCount:A,topItemsIndexes:_,totalCount:m,...E,groupIndices:a,itemSize:c,listState:j,minOverscanItemCount:N,scrollToIndex:k,statefulTotalCount:g,trackItemSizes:y,rangeChanged:H,...F,...L,...C,sizes:h,...T}},Bn(Ts,dh,ci,PW,kW,Mu,fh,BW,NW,XN,jW));function _W(t,e){const n={},r={};let i=0;const s=t.length;for(;i<s;)r[t[i]]=1,i+=1;for(const a in e)Object.hasOwn(r,a)||(n[a]=e[a]);return n}const rg=typeof document<"u"?Ve.useLayoutEffect:Ve.useEffect;function j1(t,e,n){const r=Object.keys(e.required||{}),i=Object.keys(e.optional||{}),s=Object.keys(e.methods||{}),a=Object.keys(e.events||{}),u=Ve.createContext({});function c(w,C){w.propsReady!==void 0&&Mt(w.propsReady,!1);for(const T of r){const E=w[e.required[T]];Mt(E,C[T])}for(const T of i)if(T in C){const E=w[e.optional[T]];Mt(E,C[T])}w.propsReady!==void 0&&Mt(w.propsReady,!0)}function d(w){return s.reduce((C,T)=>(C[T]=E=>{const M=w[e.methods[T]];Mt(M,E)},C),{})}function h(w){return a.reduce((C,T)=>(C[T]=tW(w[e.events[T]]),C),{})}const g=Ve.forwardRef(function(w,C){const{children:T,...E}=w,[M]=Ve.useState(()=>uy(rW(t),A=>{c(A,E)})),[k]=Ve.useState(HO(h,M));rg(()=>{for(const A of a)A in E&&fn(k[A],E[A]);return()=>{Object.values(k).map(O1)}},[E,k,M]),rg(()=>{c(M,E)}),Ve.useImperativeHandle(C,_O(d(M)));const P=n;return O.jsx(u.Provider,{value:M,children:n!==void 0?O.jsx(P,{..._W([...r,...i,...a],E),children:T}):T})}),m=w=>{const C=Ve.useContext(u);return Ve.useCallback(T=>{Mt(C[w],T)},[C,w])},y=w=>{const C=Ve.useContext(u)[w],T=Ve.useCallback(E=>fn(C,E),[C]);return Ve.useSyncExternalStore(T,()=>Hn(C),()=>Hn(C))},b=w=>{const C=Ve.useContext(u)[w],[T,E]=Ve.useState(HO(Hn,C));return rg(()=>fn(C,M=>{M!==T&&E(_O(M))}),[C,T]),T},x=parseInt(Ve.version)>=18?y:b;return{Component:g,useEmitter:(w,C)=>{const T=Ve.useContext(u)[w];rg(()=>fn(T,C),[C,T])},useEmitterValue:x,usePublisher:m}}const fy=Ve.createContext(void 0),sL=Ve.createContext(void 0),kb="-webkit-sticky",JO="sticky",_1=iL(()=>{if(typeof document>"u")return JO;const t=document.createElement("div");return t.style.position=kb,t.style.position===kb?kb:JO}),lL=typeof document<"u"?Ve.useLayoutEffect:Ve.useEffect;function Ib(t){return"self"in t}function HW(t){return"body"in t}function aL(t,e,n,r=Jc,i,s){const a=Ve.useRef(null),u=Ve.useRef(null),c=Ve.useRef(null),d=Ve.useCallback(m=>{let y,b,x;const w=m.target;if(HW(w)||Ib(w)){const T=Ib(w)?w:w.defaultView;x=s===!0?tu(T,T.scrollX):T.scrollY,y=s===!0?T.document.documentElement.scrollWidth:T.document.documentElement.scrollHeight,b=s===!0?T.innerWidth:T.innerHeight}else x=s===!0?tu(w,w.scrollLeft):w.scrollTop,y=s===!0?w.scrollWidth:w.scrollHeight,b=s===!0?w.offsetWidth:w.offsetHeight;const C=()=>{t({scrollHeight:y,scrollTop:Math.max(x,0),viewportHeight:b})};m.suppressFlushSync===!0?C():q5.flushSync(C),u.current!==null&&(x===u.current||x<=0||x===y-b)&&(u.current=null,e(!0),c.current&&(clearTimeout(c.current),c.current=null))},[t,e,s]);Ve.useEffect(()=>{const m=i||a.current;return FO(m),r(i||a.current),d({suppressFlushSync:!0,target:m}),m.addEventListener("scroll",d,{passive:!0}),()=>{FO(m),r(null),m.removeEventListener("scroll",d)}},[a,d,n,r,i]);function h(m){const y=a.current;if(!y||(s===!0?"offsetWidth"in y&&y.offsetWidth===0:"offsetHeight"in y&&y.offsetHeight===0))return;const b=m.behavior==="smooth";let x,w,C;Ib(y)?(w=Math.max(_o(y.document.documentElement,s===!0?"width":"height"),s===!0?y.document.documentElement.scrollWidth:y.document.documentElement.scrollHeight),x=s===!0?y.innerWidth:y.innerHeight,C=s===!0?tu(y,y.scrollX):y.scrollY):(w=y[s===!0?"scrollWidth":"scrollHeight"],x=_o(y,s===!0?"width":"height"),C=s===!0?tu(y,y.scrollLeft):y.scrollTop);const T=w-x;if(m.top===void 0){y.scrollTo(m);return}const E=Math.ceil(Math.max(Math.min(T,m.top),0));if(m.top=E,ZN(x,w)||E===C){t({scrollHeight:w,scrollTop:C,viewportHeight:x}),b&&e(!0);return}b?(u.current=E,c.current&&clearTimeout(c.current),c.current=setTimeout(()=>{c.current=null,u.current=null,e(!0)},1e3)):u.current=null,s===!0&&(m={...m.behavior!==void 0?{behavior:m.behavior}:{},left:UO(y,E)}),y.scrollTo(m)}function g(m){s===!0&&(m={...m.behavior!==void 0?{behavior:m.behavior}:{},...m.top!==void 0?{left:UO(a.current,m.top)}:{}}),a.current.scrollBy(m)}return{scrollByCallback:g,scrollerRef:a,scrollToCallback:h}}function H1(t){return t}const VW=en(()=>{const t=Ne(u=>`Item ${u}`),e=Ne(u=>`Group ${u}`),n=Ne({}),r=Ne(H1),i=Ne("div"),s=Ne(Jc),a=(u,c=null)=>Xr(Oe(n,We(d=>d[u]),Nn()),c);return{components:n,computeItemKey:r,EmptyPlaceholder:a("EmptyPlaceholder"),FooterComponent:a("Footer"),GroupComponent:a("Group","div"),groupContent:e,HeaderComponent:a("Header"),HeaderFooterTag:i,ItemComponent:a("Item","div"),itemContent:t,ListComponent:a("List","div"),ScrollerComponent:a("Scroller","div"),scrollerRef:s,ScrollSeekPlaceholder:a("ScrollSeekPlaceholder"),TopItemListComponent:a("TopItemList")}}),FW=en(([t,e])=>({...t,...e}),Bn(oL,VW)),UW=({height:t})=>O.jsx("div",{style:{height:t}}),$W={overflowAnchor:"none",position:_1(),zIndex:1},uL={overflowAnchor:"none"},qW={...uL,display:"inline-block",height:"100%"},ek=Ve.memo(function({showTopList:t=!1}){const e=mt("listState"),n=oo("sizeRanges"),r=mt("useWindowScroll"),i=mt("customScrollParent"),s=oo("windowScrollContainerState"),a=oo("scrollContainerState"),u=i||r?s:a,c=mt("itemContent"),d=mt("context"),h=mt("groupContent"),g=mt("trackItemSizes"),m=mt("itemSize"),y=mt("log"),b=oo("gap"),x=mt("horizontalDirection"),{callbackRef:w}=HN(n,m,g,t?Jc:u,y,b,i,x,mt("skipAnimationFrameInResizeObserver")),[C,T]=Ve.useState(0);$1("deviation",F=>{C!==F&&T(F)});const E=mt("EmptyPlaceholder"),M=mt("ScrollSeekPlaceholder")??UW,k=mt("ListComponent"),P=mt("ItemComponent"),A=mt("GroupComponent"),I=mt("computeItemKey"),L=mt("isSeeking"),j=mt("groupIndices").length>0,N=mt("alignToBottom"),_=mt("initialItemFinalLocationReached"),H=t?{}:{boxSizing:"border-box",...x?{display:"inline-block",height:"100%",marginInlineStart:C!==0?C:N?"auto":0,paddingInlineEnd:e.offsetBottom,paddingInlineStart:e.offsetTop,whiteSpace:"nowrap"}:{marginTop:C!==0?C:N?"auto":0,paddingBottom:e.offsetBottom,paddingTop:e.offsetTop},..._?{}:{visibility:"hidden"}};return!t&&e.totalCount===0&&E!==null&&E!==void 0?O.jsx(E,{...Ln(E,d)}):O.jsx(k,{...Ln(k,d),"data-testid":t?"virtuoso-top-item-list":"virtuoso-item-list",ref:w,style:H,children:(t?e.topItems:e.items).map(F=>{const G=F.originalIndex,B=I(G+e.firstItemIndex,F.data,d);return L?R.createElement(M,{...Ln(M,d),height:F.size,index:F.index,key:B,type:F.type||"item",...F.type==="group"?{}:{groupIndex:F.groupIndex}}):F.type==="group"?R.createElement(A,{...Ln(A,d),"data-index":G,"data-item-index":F.index,"data-known-size":F.size,key:B,style:$W},h(F.index,d)):R.createElement(P,{...Ln(P,d),...cL(P,F.data),"data-index":G,"data-item-group-index":F.groupIndex,"data-item-index":F.index,"data-known-size":F.size,key:B,style:x?qW:uL},j?c(F.index,F.groupIndex,F.data,d):c(F.index,F.data,d))})})}),GW={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},WW={outline:"none",overflowX:"auto",position:"relative"},dy=t=>({height:"100%",position:"absolute",top:0,width:"100%",...t?{display:"flex",flexDirection:"column"}:void 0}),V1=(t,e,n=0)=>({...dy(t),position:e?"relative":"absolute",top:e?-n:0}),KW={position:_1(),top:0,width:"100%",zIndex:1};function Ln(t,e){if(typeof t!="string")return{context:e}}function cL(t,e){return{item:typeof t=="string"?void 0:e}}const YW=Ve.memo(function(){const t=mt("HeaderComponent"),e=oo("headerHeight"),n=mt("HeaderFooterTag"),r=Cs(Ve.useMemo(()=>s=>{e(_o(s,"height"))},[e]),!0,mt("skipAnimationFrameInResizeObserver")),i=mt("context");return t!=null?O.jsx(n,{ref:r,children:O.jsx(t,{...Ln(t,i)})}):null}),XW=Ve.memo(function(){const t=mt("FooterComponent"),e=oo("footerHeight"),n=mt("HeaderFooterTag"),r=Cs(Ve.useMemo(()=>s=>{e(_o(s,"height"))},[e]),!0,mt("skipAnimationFrameInResizeObserver")),i=mt("context");return t!=null?O.jsx(n,{ref:r,children:O.jsx(t,{...Ln(t,i)})}):null});function F1({useEmitter:t,useEmitterValue:e,usePublisher:n}){return Ve.memo(function({children:r,style:i,context:s,...a}){const u=n("scrollContainerState"),c=e("ScrollerComponent"),d=n("smoothScrollTargetReached"),h=e("scrollerRef"),g=e("horizontalDirection")||!1,{scrollByCallback:m,scrollerRef:y,scrollToCallback:b}=aL(u,d,c,h,void 0,g);return t("scrollTo",b),t("scrollBy",m),O.jsx(c,{"data-testid":"virtuoso-scroller","data-virtuoso-scroller":!0,ref:y,style:{...g?WW:GW,...i},tabIndex:0,...a,...Ln(c,s),children:r})})}function U1({useEmitter:t,useEmitterValue:e,usePublisher:n}){return Ve.memo(function({children:r,style:i,context:s,...a}){const u=n("windowScrollContainerState"),c=e("ScrollerComponent"),d=n("smoothScrollTargetReached"),h=e("totalListHeight"),g=e("deviation"),m=e("customScrollParent"),y=Ve.useRef(null),b=e("scrollerRef"),{scrollByCallback:x,scrollerRef:w,scrollToCallback:C}=aL(u,d,c,b,m);return lL(()=>(w.current=m||y.current?.ownerDocument.defaultView,()=>{w.current=null}),[w,m]),t("windowScrollTo",C),t("scrollBy",x),O.jsx(c,{ref:y,"data-virtuoso-scroller":!0,style:{position:"relative",...i,...h!==0?{height:h+g}:void 0},...a,...Ln(c,s),children:r})})}const QW=({children:t})=>{const e=Ve.useContext(fy),n=oo("viewportHeight"),r=oo("fixedItemHeight"),i=mt("alignToBottom"),s=mt("horizontalDirection"),a=Ve.useMemo(()=>Ld(n,c=>_o(c,s?"width":"height")),[n,s]),u=Cs(a,!0,mt("skipAnimationFrameInResizeObserver"));return Ve.useEffect(()=>{e&&(n(e.viewportHeight),r(e.itemHeight))},[e,n,r]),O.jsx("div",{"data-viewport-type":"element",ref:u,style:dy(i),children:t})},ZW=({children:t})=>{const e=Ve.useContext(fy),n=oo("windowViewportRect"),r=oo("fixedItemHeight"),i=mt("customScrollParent"),s=mt("useWindowScroll"),a=mt("topListHeight"),u=I1(n,i,mt("skipAnimationFrameInResizeObserver")),c=mt("alignToBottom");return Ve.useEffect(()=>{e&&(r(e.itemHeight),n({listHeight:0,offsetTop:0,visibleHeight:e.viewportHeight,visibleWidth:100}))},[e,n,r]),O.jsx("div",{"data-viewport-type":"window",ref:u,style:V1(c,s,a),children:t})},JW=({children:t})=>{const e=mt("TopItemListComponent")??"div",n=mt("headerHeight"),r={...KW,marginTop:`${n}px`},i=mt("context");return O.jsx(e,{style:r,...Ln(e,i),children:t})},eK=Ve.memo(function(t){const e=mt("useWindowScroll"),n=mt("topItemsIndexes").length>0,r=mt("customScrollParent"),i=mt("context");return O.jsxs(r||e?rK:nK,{...t,context:i,children:[n&&O.jsx(JW,{children:O.jsx(ek,{showTopList:!0})}),O.jsxs(r||e?ZW:QW,{children:[O.jsx(YW,{}),O.jsx(ek,{}),O.jsx(XW,{})]})]})}),{Component:tK,useEmitter:$1,useEmitterValue:mt,usePublisher:oo}=j1(FW,{optional:{restoreStateFrom:"restoreStateFrom",context:"context",followOutput:"followOutput",scrollIntoViewOnChange:"scrollIntoViewOnChange",itemContent:"itemContent",groupContent:"groupContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",minOverscanItemCount:"minOverscanItemCount",totalCount:"totalCount",groupCounts:"groupCounts",topItemCount:"topItemCount",firstItemIndex:"firstItemIndex",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedGroupHeight:"fixedGroupHeight",fixedItemHeight:"fixedItemHeight",heightEstimates:"heightEstimates",itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"HeaderFooterTag",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",horizontalDirection:"horizontalDirection",skipAnimationFrameInResizeObserver:"skipAnimationFrameInResizeObserver"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",autoscrollToBottom:"autoscrollToBottom",getState:"getState"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},eK),nK=F1({useEmitter:$1,useEmitterValue:mt,usePublisher:oo}),rK=U1({useEmitter:$1,useEmitterValue:mt,usePublisher:oo}),fL=tK,iK=en(()=>{const t=Ne(d=>O.jsxs("td",{children:["Item $",d]})),e=Ne(null),n=Ne(d=>O.jsxs("td",{colSpan:1e3,children:["Group ",d]})),r=Ne(null),i=Ne(null),s=Ne({}),a=Ne(H1),u=Ne(Jc),c=(d,h=null)=>Xr(Oe(s,We(g=>g[d]),Nn()),h);return{components:s,computeItemKey:a,context:e,EmptyPlaceholder:c("EmptyPlaceholder"),FillerRow:c("FillerRow"),fixedFooterContent:i,fixedHeaderContent:r,itemContent:t,groupContent:n,ScrollerComponent:c("Scroller","div"),scrollerRef:u,ScrollSeekPlaceholder:c("ScrollSeekPlaceholder"),TableBodyComponent:c("TableBody","tbody"),TableComponent:c("Table","table"),TableFooterComponent:c("TableFoot","tfoot"),TableHeadComponent:c("TableHead","thead"),TableRowComponent:c("TableRow","tr"),GroupComponent:c("Group","tr")}}),oK=en(([t,e])=>({...t,...e}),Bn(oL,iK)),sK=({height:t})=>O.jsx("tr",{children:O.jsx("td",{style:{height:t}})}),lK=({height:t})=>O.jsx("tr",{children:O.jsx("td",{style:{border:0,height:t,padding:0}})}),aK={overflowAnchor:"none"},tk={position:_1(),zIndex:2,overflowAnchor:"none"},nk=Ve.memo(function({showTopList:t=!1}){const e=Tt("listState"),n=Tt("computeItemKey"),r=Tt("firstItemIndex"),i=Tt("context"),s=Tt("isSeeking"),a=Tt("fixedHeaderHeight"),u=Tt("groupIndices").length>0,c=Tt("itemContent"),d=Tt("groupContent"),h=Tt("ScrollSeekPlaceholder")??sK,g=Tt("GroupComponent"),m=Tt("TableRowComponent"),y=(t?e.topItems:[]).reduce((b,x,w)=>(w===0?b.push(x.size):b.push(b[w-1]+x.size),b),[]);return(t?e.topItems:e.items).map(b=>{const x=b.originalIndex,w=n(x+r,b.data,i),C=t?x===0?0:y[x-1]:0;return s?R.createElement(h,{...Ln(h,i),height:b.size,index:b.index,key:w,type:b.type||"item"}):b.type==="group"?R.createElement(g,{...Ln(g,i),"data-index":x,"data-item-index":b.index,"data-known-size":b.size,key:w,style:{...tk,top:a}},d(b.index,i)):R.createElement(m,{...Ln(m,i),...cL(m,b.data),"data-index":x,"data-item-index":b.index,"data-known-size":b.size,"data-item-group-index":b.groupIndex,key:w,style:t?{...tk,top:a+C}:aK},u?c(b.index,b.groupIndex,b.data,i):c(b.index,b.data,i))})}),uK=Ve.memo(function(){const t=Tt("listState"),e=Tt("topItemsIndexes").length>0,n=Bo("sizeRanges"),r=Tt("useWindowScroll"),i=Tt("customScrollParent"),s=Bo("windowScrollContainerState"),a=Bo("scrollContainerState"),u=i||r?s:a,c=Tt("trackItemSizes"),d=Tt("itemSize"),h=Tt("log"),{callbackRef:g,ref:m}=HN(n,d,c,u,h,void 0,i,!1,Tt("skipAnimationFrameInResizeObserver")),[y,b]=Ve.useState(0);q1("deviation",j=>{y!==j&&(m.current.style.marginTop=`${j}px`,b(j))});const x=Tt("EmptyPlaceholder"),w=Tt("FillerRow")??lK,C=Tt("TableBodyComponent"),T=Tt("paddingTopAddition"),E=Tt("statefulTotalCount"),M=Tt("context");if(E===0&&x!==null&&x!==void 0)return O.jsx(x,{...Ln(x,M)});const k=(e?t.topItems:[]).reduce((j,N)=>j+N.size,0),P=t.offsetTop+T+y-k,A=t.offsetBottom,I=P>0?O.jsx(w,{context:M,height:P},"padding-top"):null,L=A>0?O.jsx(w,{context:M,height:A},"padding-bottom"):null;return O.jsxs(C,{"data-testid":"virtuoso-item-list",ref:g,...Ln(C,M),children:[I,e&&O.jsx(nk,{showTopList:!0}),O.jsx(nk,{}),L]})}),cK=({children:t})=>{const e=Ve.useContext(fy),n=Bo("viewportHeight"),r=Bo("fixedItemHeight"),i=Cs(Ve.useMemo(()=>Ld(n,s=>_o(s,"height")),[n]),!0,Tt("skipAnimationFrameInResizeObserver"));return Ve.useEffect(()=>{e&&(n(e.viewportHeight),r(e.itemHeight))},[e,n,r]),O.jsx("div",{"data-viewport-type":"element",ref:i,style:dy(!1),children:t})},fK=({children:t})=>{const e=Ve.useContext(fy),n=Bo("windowViewportRect"),r=Bo("fixedItemHeight"),i=Tt("customScrollParent"),s=Tt("useWindowScroll"),a=I1(n,i,Tt("skipAnimationFrameInResizeObserver"));return Ve.useEffect(()=>{e&&(r(e.itemHeight),n({listHeight:0,offsetTop:0,visibleHeight:e.viewportHeight,visibleWidth:100}))},[e,n,r]),O.jsx("div",{"data-viewport-type":"window",ref:a,style:V1(!1,s),children:t})},dK=Ve.memo(function(t){const e=Tt("useWindowScroll"),n=Tt("customScrollParent"),r=Bo("fixedHeaderHeight"),i=Bo("fixedFooterHeight"),s=Tt("fixedHeaderContent"),a=Tt("fixedFooterContent"),u=Tt("context"),c=Cs(Ve.useMemo(()=>Ld(r,C=>_o(C,"height")),[r]),!0,Tt("skipAnimationFrameInResizeObserver")),d=Cs(Ve.useMemo(()=>Ld(i,C=>_o(C,"height")),[i]),!0,Tt("skipAnimationFrameInResizeObserver")),h=n||e?gK:pK,g=n||e?fK:cK,m=Tt("TableComponent"),y=Tt("TableHeadComponent"),b=Tt("TableFooterComponent"),x=s?O.jsx(y,{ref:c,style:{position:"sticky",top:0,zIndex:2},...Ln(y,u),children:s()},"TableHead"):null,w=a?O.jsx(b,{ref:d,style:{bottom:0,position:"sticky",zIndex:1},...Ln(b,u),children:a()},"TableFoot"):null;return O.jsx(h,{...t,...Ln(h,u),children:O.jsx(g,{children:O.jsxs(m,{style:{borderSpacing:0,overflowAnchor:"none"},...Ln(m,u),children:[x,O.jsx(uK,{},"TableBody"),w]})})})}),{Component:hK,useEmitter:q1,useEmitterValue:Tt,usePublisher:Bo}=j1(oK,{optional:{restoreStateFrom:"restoreStateFrom",context:"context",followOutput:"followOutput",firstItemIndex:"firstItemIndex",itemContent:"itemContent",groupContent:"groupContent",fixedHeaderContent:"fixedHeaderContent",fixedFooterContent:"fixedFooterContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",minOverscanItemCount:"minOverscanItemCount",totalCount:"totalCount",topItemCount:"topItemCount",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",groupCounts:"groupCounts",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedGroupHeight:"fixedGroupHeight",fixedItemHeight:"fixedItemHeight",itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",getState:"getState"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},dK),pK=F1({useEmitter:q1,useEmitterValue:Tt,usePublisher:Bo}),gK=U1({useEmitter:q1,useEmitterValue:Tt,usePublisher:Bo}),mK=hK,rk={bottom:0,itemHeight:0,items:[],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},yK={bottom:0,itemHeight:0,items:[{index:0}],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},{ceil:ik,floor:am,max:yd,min:Db,round:ok}=Math;function sk(t,e,n){return Array.from({length:e-t+1}).map((r,i)=>({data:n===null?null:n[i+t],index:i+t}))}function vK(t){return{...yK,items:t}}function ig(t,e){return t!==void 0&&t.width===e.width&&t.height===e.height}function bK(t,e){return t!==void 0&&t.column===e.column&&t.row===e.row}const xK=en(([{increaseViewportBy:t,listBoundary:e,overscan:n,visibleRange:r},{footerHeight:i,headerHeight:s,scrollBy:a,scrollContainerState:u,scrollTo:c,scrollTop:d,smoothScrollTargetReached:h,viewportHeight:g},m,y,{didMount:b,propsReady:x},{customScrollParent:w,useWindowScroll:C,windowScrollContainerState:T,windowScrollTo:E,windowViewportRect:M},k])=>{const P=Ne(0),A=Ne(0),I=Ne(rk),L=Ne({height:0,width:0}),j=Ne({height:0,width:0}),N=Ut(),_=Ut(),H=Ne(0),F=Ne(null),G=Ne({column:0,row:0}),B=Ut(),q=Ut(),U=Ne(!1),X=Ne(0),Z=Ne(!0),z=Ne(!1),$=Ne(!1);fn(Oe(b,kt(X),ft(([Y,se])=>se!==0)),()=>{Mt(Z,!1)}),fn(Oe(gr(b,Z,j,L,X,z),ft(([Y,se,ve,ye,,he])=>Y&&!se&&ve.height!==0&&ye.height!==0&&!he)),([,,,,Y])=>{Mt(z,!0),z1(1,()=>{Mt(N,Y)}),Lo(Oe(d),()=>{Mt(e,[0,0]),Mt(Z,!0)})}),tt(Oe(q,ft(Y=>Y!=null&&Y.scrollTop>0),fs(0)),A),fn(Oe(b,kt(q),ft(([,Y])=>Y!=null)),([,Y])=>{Y&&(Mt(L,Y.viewport),Mt(j,Y.item),Mt(G,Y.gap),Y.scrollTop>0&&(Mt(U,!0),Lo(Oe(d,mu(1)),se=>{Mt(U,!1)}),Mt(c,{top:Y.scrollTop})))}),tt(Oe(L,We(({height:Y})=>Y)),g),tt(Oe(gr(ct(L,ig),ct(j,ig),ct(G,(Y,se)=>Y!==void 0&&Y.column===se.column&&Y.row===se.row),ct(d)),We(([Y,se,ve,ye])=>({gap:ve,item:se,scrollTop:ye,viewport:Y}))),B),tt(Oe(gr(ct(P),r,ct(G,bK),ct(j,ig),ct(L,ig),ct(F),ct(A),ct(U),ct(Z),ct(X)),ft(([,,,,,,,Y])=>!Y),We(([Y,[se,ve],ye,he,pe,Te,Ie,,De,Ee])=>{const{column:_e,row:Me}=ye,{height:oe,width:xe}=he,{width:Pe}=pe;if(Ie===0&&(Y===0||Pe===0))return rk;if(xe===0){const wt=N1(Ee,Y),xt=wt+Math.max(Ie-1,0);return vK(sk(wt,xt,Te))}const ne=dL(Pe,xe,_e);let J,le;De?se===0&&ve===0&&Ie>0?(J=0,le=Ie-1):(J=ne*am((se+Me)/(oe+Me)),le=ne*ik((ve+Me)/(oe+Me))-1,le=Db(Y-1,yd(le,ne-1)),J=Db(le,yd(0,J))):(J=0,le=-1);const we=sk(J,le,Te),{bottom:de,top:me}=lk(pe,ye,he,we),Be=ik(Y/ne),Ke=Be*oe+(Be-1)*Me-de;return{bottom:de,itemHeight:oe,items:we,itemWidth:xe,offsetBottom:Ke,offsetTop:me,top:me}})),I),tt(Oe(F,ft(Y=>Y!==null),We(Y=>Y.length)),P),tt(Oe(gr(L,j,I,G),ft(([Y,se,{items:ve}])=>ve.length>0&&se.height!==0&&Y.height!==0),We(([Y,se,{items:ve},ye])=>{const{bottom:he,top:pe}=lk(Y,ye,se,ve);return[pe,he]}),Nn(_d)),e);const W=Ne(!1);tt(Oe(d,kt(W),We(([Y,se])=>se||Y!==0)),W);const K=Bi(Oe(gr(I,P),ft(([{items:Y}])=>Y.length>0),kt(W),ft(([[Y,se],ve])=>{const ye=Y.items[Y.items.length-1].index===se-1;return(ve||Y.bottom>0&&Y.itemHeight>0&&Y.offsetBottom===0&&Y.items.length===se)&&ye}),We(([[,Y]])=>Y-1),Nn())),ie=Bi(Oe(ct(I),ft(({items:Y})=>Y.length>0&&Y[0].index===0),fs(0),Nn())),ee=Bi(Oe(ct(I),kt(U),ft(([{items:Y},se])=>Y.length>0&&!se),We(([{items:Y}])=>({endIndex:Y[Y.length-1].index,startIndex:Y[0].index})),Nn(GN),el(0)));tt(ee,y.scrollSeekRangeChanged),tt(Oe(N,kt(L,j,P,G),We(([Y,se,ve,ye,he])=>{const pe=QN(Y),{align:Te,behavior:Ie,offset:De}=pe;let Ee=pe.index;Ee==="LAST"&&(Ee=ye-1),Ee=yd(0,Ee,Db(ye-1,Ee));let _e=pS(se,he,ve,Ee);return Te==="end"?_e=ok(_e-se.height+ve.height):Te==="center"&&(_e=ok(_e-se.height/2+ve.height/2)),De!==void 0&&De!==0&&(_e+=De),{behavior:Ie,top:_e}})),c);const ae=Xr(Oe(I,We(Y=>Y.offsetBottom+Y.bottom)),0);return tt(Oe(M,We(Y=>({height:Y.visibleHeight,width:Y.visibleWidth}))),L),{customScrollParent:w,data:F,deviation:H,footerHeight:i,gap:G,headerHeight:s,increaseViewportBy:t,initialItemCount:A,itemDimensions:j,overscan:n,restoreStateFrom:q,scrollBy:a,scrollContainerState:u,scrollHeight:_,scrollTo:c,scrollToIndex:N,scrollTop:d,smoothScrollTargetReached:h,totalCount:P,useWindowScroll:C,viewportDimensions:L,windowScrollContainerState:T,windowScrollTo:E,windowViewportRect:M,...y,gridState:I,horizontalDirection:$,initialTopMostItemIndex:X,totalListHeight:ae,...m,endReached:K,propsReady:x,rangeChanged:ee,startReached:ie,stateChanged:B,stateRestoreInProgress:U,...k}},Bn(L1,ci,hh,rL,Ra,B1,Ca));function dL(t,e,n){return yd(1,am((t+n)/(am(e)+n)))}function lk(t,e,n,r){const{height:i}=n;if(i===void 0||r.length===0)return{bottom:0,top:0};const s=pS(t,e,n,r[0].index);return{bottom:pS(t,e,n,r[r.length-1].index)+i,top:s}}function pS(t,e,n,r){const i=dL(t.width,n.width,e.column),s=am(r/i),a=s*n.height+yd(0,s-1)*e.row;return a>0?a+e.row:a}const SK=en(()=>{const t=Ne(g=>`Item ${g}`),e=Ne({}),n=Ne(null),r=Ne("virtuoso-grid-item"),i=Ne("virtuoso-grid-list"),s=Ne(H1),a=Ne("div"),u=Ne(Jc),c=(g,m=null)=>Xr(Oe(e,We(y=>y[g]),Nn()),m),d=Ne(!1),h=Ne(!1);return tt(ct(h),d),{components:e,computeItemKey:s,context:n,FooterComponent:c("Footer"),HeaderComponent:c("Header"),headerFooterTag:a,itemClassName:r,ItemComponent:c("Item","div"),itemContent:t,listClassName:i,ListComponent:c("List","div"),readyStateChanged:d,reportReadyState:h,ScrollerComponent:c("Scroller","div"),scrollerRef:u,ScrollSeekPlaceholder:c("ScrollSeekPlaceholder","div")}}),wK=en(([t,e])=>({...t,...e}),Bn(xK,SK)),CK=Ve.memo(function(){const t=zn("gridState"),e=zn("listClassName"),n=zn("itemClassName"),r=zn("itemContent"),i=zn("computeItemKey"),s=zn("isSeeking"),a=so("scrollHeight"),u=zn("ItemComponent"),c=zn("ListComponent"),d=zn("ScrollSeekPlaceholder"),h=zn("context"),g=so("itemDimensions"),m=so("gap"),y=zn("log"),b=zn("stateRestoreInProgress"),x=so("reportReadyState"),w=Cs(Ve.useMemo(()=>C=>{const T=C.parentElement.parentElement.scrollHeight;a(T);const E=C.firstChild;if(E!==null){const{height:M,width:k}=E.getBoundingClientRect();g({height:M,width:k})}m({column:ak("column-gap",getComputedStyle(C).columnGap,y),row:ak("row-gap",getComputedStyle(C).rowGap,y)})},[a,g,m,y]),!0,!1);return lL(()=>{t.itemHeight>0&&t.itemWidth>0&&x(!0)},[t]),b?null:O.jsx(c,{className:e,ref:w,...Ln(c,h),"data-testid":"virtuoso-item-list",style:{paddingBottom:t.offsetBottom,paddingTop:t.offsetTop},children:t.items.map(C=>{const T=i(C.index,C.data,h);return s?O.jsx(d,{...Ln(d,h),height:t.itemHeight,index:C.index,width:t.itemWidth},T):R.createElement(u,{...Ln(u,h),className:n,"data-index":C.index,key:T},r(C.index,C.data,h))})})}),RK=Ve.memo(function(){const t=zn("HeaderComponent"),e=so("headerHeight"),n=zn("headerFooterTag"),r=Cs(Ve.useMemo(()=>s=>{e(_o(s,"height"))},[e]),!0,!1),i=zn("context");return t!=null?O.jsx(n,{ref:r,children:O.jsx(t,{...Ln(t,i)})}):null}),TK=Ve.memo(function(){const t=zn("FooterComponent"),e=so("footerHeight"),n=zn("headerFooterTag"),r=Cs(Ve.useMemo(()=>s=>{e(_o(s,"height"))},[e]),!0,!1),i=zn("context");return t!=null?O.jsx(n,{ref:r,children:O.jsx(t,{...Ln(t,i)})}):null}),EK=({children:t})=>{const e=Ve.useContext(sL),n=so("itemDimensions"),r=so("viewportDimensions"),i=Cs(Ve.useMemo(()=>s=>{r(s.getBoundingClientRect())},[r]),!0,!1);return Ve.useEffect(()=>{e&&(r({height:e.viewportHeight,width:e.viewportWidth}),n({height:e.itemHeight,width:e.itemWidth}))},[e,r,n]),O.jsx("div",{ref:i,style:dy(!1),children:t})},MK=({children:t})=>{const e=Ve.useContext(sL),n=so("windowViewportRect"),r=so("itemDimensions"),i=zn("customScrollParent"),s=zn("useWindowScroll"),a=I1(n,i,!1);return Ve.useEffect(()=>{e&&(r({height:e.itemHeight,width:e.itemWidth}),n({listHeight:0,offsetTop:0,visibleHeight:e.viewportHeight,visibleWidth:e.viewportWidth}))},[e,n,r]),O.jsx("div",{ref:a,style:V1(!1,s),children:t})},AK=Ve.memo(function({...t}){const e=zn("useWindowScroll"),n=zn("customScrollParent"),r=n||e?kK:OK,i=n||e?MK:EK,s=zn("context");return O.jsx(r,{...t,...Ln(r,s),children:O.jsxs(i,{children:[O.jsx(RK,{}),O.jsx(CK,{}),O.jsx(TK,{})]})})}),{useEmitter:hL,useEmitterValue:zn,usePublisher:so}=j1(wK,{optional:{context:"context",totalCount:"totalCount",overscan:"overscan",itemContent:"itemContent",components:"components",computeItemKey:"computeItemKey",data:"data",initialItemCount:"initialItemCount",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"headerFooterTag",listClassName:"listClassName",itemClassName:"itemClassName",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",restoreStateFrom:"restoreStateFrom",initialTopMostItemIndex:"initialTopMostItemIndex",increaseViewportBy:"increaseViewportBy"},methods:{scrollTo:"scrollTo",scrollBy:"scrollBy",scrollToIndex:"scrollToIndex"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",stateChanged:"stateChanged",readyStateChanged:"readyStateChanged"}},AK),OK=F1({useEmitter:hL,useEmitterValue:zn,usePublisher:so}),kK=U1({useEmitter:hL,useEmitterValue:zn,usePublisher:so});function ak(t,e,n){return e!=="normal"&&e?.endsWith("px")!==!0&&n(`${t} was not resolved to pixel value correctly`,e,Cr.WARN),e==="normal"?0:parseInt(e??"0",10)}function Le(...t){return z8(vD(t))}const IK={neutral:"",primary:"",success:"",warning:"",danger:"",info:""},hy=qc("",{variants:{tone:IK,variant:{solid:"",soft:"",outline:"",ghost:""},interactive:{true:"",false:""}},compoundVariants:[{tone:"neutral",variant:"solid",class:"bg-secondary text-secondary-foreground"},{tone:"neutral",variant:"soft",class:"bg-muted text-foreground"},{tone:"neutral",variant:"outline",class:"border border-border text-foreground"},{tone:"neutral",variant:"ghost",class:"text-foreground"},{tone:"primary",variant:"solid",class:"bg-primary text-primary-foreground"},{tone:"primary",variant:"soft",class:"bg-accent text-accent-foreground"},{tone:"primary",variant:"outline",class:"border border-primary text-primary"},{tone:"primary",variant:"ghost",class:"text-primary"},{tone:"success",variant:"solid",class:"bg-success text-success-foreground"},{tone:"success",variant:"soft",class:"bg-success-soft text-success"},{tone:"success",variant:"outline",class:"border border-success text-success"},{tone:"success",variant:"ghost",class:"text-success"},{tone:"warning",variant:"solid",class:"bg-warning text-warning-foreground"},{tone:"warning",variant:"soft",class:"bg-warning-soft text-warning"},{tone:"warning",variant:"outline",class:"border border-warning text-warning"},{tone:"warning",variant:"ghost",class:"text-warning"},{tone:"danger",variant:"solid",class:"bg-danger text-danger-foreground"},{tone:"danger",variant:"soft",class:"bg-danger-soft text-danger"},{tone:"danger",variant:"outline",class:"border border-danger text-danger"},{tone:"danger",variant:"ghost",class:"text-danger"},{tone:"info",variant:"solid",class:"bg-info text-info-foreground"},{tone:"info",variant:"soft",class:"bg-info-soft text-info"},{tone:"info",variant:"outline",class:"border border-info text-info"},{tone:"info",variant:"ghost",class:"text-info"},{tone:"neutral",variant:"solid",interactive:!0,class:"hover:bg-secondary/80"},{tone:"neutral",variant:"soft",interactive:!0,class:"hover:bg-muted/80"},{tone:"neutral",variant:"outline",interactive:!0,class:"hover:bg-accent hover:text-accent-foreground"},{tone:"neutral",variant:"ghost",interactive:!0,class:"hover:bg-accent hover:text-accent-foreground"},{tone:"primary",variant:"solid",interactive:!0,class:"hover:bg-primary/90"},{tone:"primary",variant:"soft",interactive:!0,class:"hover:bg-accent/80"},{tone:"primary",variant:"outline",interactive:!0,class:"hover:bg-accent"},{tone:"primary",variant:"ghost",interactive:!0,class:"hover:bg-accent"},{tone:"success",variant:"solid",interactive:!0,class:"hover:bg-success/90"},{tone:"success",variant:"soft",interactive:!0,class:"hover:bg-success-soft/70"},{tone:"success",variant:"outline",interactive:!0,class:"hover:bg-success-soft"},{tone:"success",variant:"ghost",interactive:!0,class:"hover:bg-success-soft"},{tone:"warning",variant:"solid",interactive:!0,class:"hover:bg-warning/90"},{tone:"warning",variant:"soft",interactive:!0,class:"hover:bg-warning-soft/70"},{tone:"warning",variant:"outline",interactive:!0,class:"hover:bg-warning-soft"},{tone:"warning",variant:"ghost",interactive:!0,class:"hover:bg-warning-soft"},{tone:"danger",variant:"solid",interactive:!0,class:"hover:bg-danger/90"},{tone:"danger",variant:"soft",interactive:!0,class:"hover:bg-danger-soft/70"},{tone:"danger",variant:"outline",interactive:!0,class:"hover:bg-danger-soft"},{tone:"danger",variant:"ghost",interactive:!0,class:"hover:bg-danger-soft"},{tone:"info",variant:"solid",interactive:!0,class:"hover:bg-info/90"},{tone:"info",variant:"soft",interactive:!0,class:"hover:bg-info-soft/70"},{tone:"info",variant:"outline",interactive:!0,class:"hover:bg-info-soft"},{tone:"info",variant:"ghost",interactive:!0,class:"hover:bg-info-soft"}],defaultVariants:{tone:"neutral",variant:"solid",interactive:!1}});function DK(t,e){return t==="light"||t==="dark"?t:e?"dark":"light"}const pL="@rozenite/ui:theme";function uk(){try{return localStorage.getItem(pL)}catch{return null}}function PK(t){try{localStorage.setItem(pL,t)}catch{}}function zK(){try{return window.matchMedia("(prefers-color-scheme: dark)").matches}catch{return!1}}const gL=R.createContext(null);function NK({children:t}){const[e,n]=R.useState(()=>DK(uk(),zK()));R.useEffect(()=>{if(uk()!==null)return;let a;try{a=window.matchMedia("(prefers-color-scheme: dark)")}catch{return}const u=()=>n(a.matches?"dark":"light");return u(),a.addEventListener("change",u),()=>a.removeEventListener("change",u)},[]);const r=R.useCallback(a=>{n(a),PK(a)},[]),i=R.useCallback(()=>{r(e==="dark"?"light":"dark")},[r,e]),s=R.useMemo(()=>({theme:e,setTheme:r,toggleTheme:i}),[e,r,i]);return O.jsx(gL.Provider,{value:s,children:t})}function mL(){const t=R.useContext(gL);if(!t)throw new Error("usePluginTheme must be used within a PluginShell");return t}const yL=R.createContext(null);function ef(){return R.useContext(yL)}function LK(t){return O.jsx(u2,{"data-slot":"tooltip-provider",...t})}function BK(t){return O.jsx(H$,{"data-slot":"tooltip",...t})}function jK(t){return O.jsx(Q$,{"data-slot":"tooltip-trigger",...t})}function _K({className:t,side:e="top",sideOffset:n=6,align:r="center",alignOffset:i=0,children:s,...a}){const u=ef();return O.jsx(J$,{container:u,children:O.jsx(l2,{side:e,sideOffset:n,align:r,alignOffset:i,className:"z-50",children:O.jsx(a2,{"data-slot":"tooltip-content",className:Le("z-50 w-fit max-w-xs rounded-md bg-foreground px-2.5 py-1.5 text-xs text-background","origin-(--transform-origin) transition-[transform,scale,opacity] data-[ending-style]:scale-90 data-[ending-style]:opacity-0 data-[starting-style]:scale-90 data-[starting-style]:opacity-0",t),...a,children:s})})})}const Pb=Object.assign(BK,{Provider:LK,Trigger:jK,Content:_K}),HK={sm:"size-6 p-0 [&_svg]:size-3.5",md:"size-8 p-0 [&_svg]:size-4",lg:"size-10 p-0 [&_svg]:size-5"};function ck({className:t,tone:e="primary",variant:n,size:r="md",label:i,type:s="button",children:a,render:u,ref:c,...d}){const h=Hi({render:u??O.jsx("button",{type:s}),ref:c,props:{"aria-label":i,"data-slot":"icon-button",className:Le("relative inline-flex shrink-0 items-center justify-center rounded-md transition-colors","outline-none focus-visible:ring-2 focus-visible:ring-ring","disabled:pointer-events-none disabled:opacity-50","[&_svg]:pointer-events-none [&_svg]:shrink-0",hy({tone:e,variant:n,interactive:!0}),HK[r],t),children:a,...d}});return O.jsxs(Pb,{children:[O.jsx(Pb.Trigger,{render:h}),O.jsx(Pb.Content,{children:i})]})}function VK(t){return O.jsx(X2,{"data-slot":"menu",...t})}function FK(t){return O.jsx(tq,{"data-slot":"menu-trigger",...t})}function UK({className:t,side:e="bottom",sideOffset:n=4,align:r="start",alignOffset:i=0,children:s,...a}){const u=ef();return O.jsx(A2,{container:u,children:O.jsx(V2,{side:e,sideOffset:n,align:r,alignOffset:i,className:"z-50",children:O.jsx(E2,{"data-slot":"menu-content",className:Le("max-h-(--available-height) min-w-40 overflow-y-auto rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-md","origin-(--transform-origin) transition-[transform,scale,opacity] data-[ending-style]:scale-95 data-[ending-style]:opacity-0 data-[starting-style]:scale-95 data-[starting-style]:opacity-0",t),...a,children:s})})})}function $K({className:t,...e}){return O.jsx(w2,{"data-slot":"menu-item",className:Le("flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm text-foreground select-none","data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...e})}function qK({className:t,children:e,...n}){return O.jsxs(y2,{"data-slot":"menu-checkbox-item",className:Le("flex cursor-default items-center justify-between gap-2 rounded-sm px-2 py-1.5 text-sm text-foreground select-none","data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...n,children:[e,O.jsx(v2,{children:O.jsx(vw,{className:"size-3.5"})})]})}function GK({className:t,...e}){return O.jsx(pz,{"data-slot":"menu-separator",className:Le("-mx-1 my-1 h-px bg-border",t),...e})}function WK(t){return O.jsx(x2,{"data-slot":"menu-group",...t})}function KK({className:t,...e}){return O.jsx(S2,{"data-slot":"menu-group-label",className:Le("px-2 py-1.5 text-xs font-medium text-muted-foreground",t),...e})}Object.assign(VK,{Trigger:FK,Content:UK,Item:$K,CheckboxItem:qK,Separator:GK,Group:WK,GroupLabel:KK});function YK({tone:t="neutral",className:e,render:n,ref:r,...i}){return Hi({render:n??O.jsx("div",{}),ref:r,props:{role:t==="danger"?"alert":"status","data-slot":"alert",className:Le(hy({tone:t,variant:"soft",class:"flex flex-col gap-1 rounded-md border border-current/15 p-3 text-sm"}),e),...i}})}function XK({className:t,...e}){return O.jsx("div",{"data-slot":"alert-title",className:Le("font-medium",t),...e})}function QK({className:t,...e}){return O.jsx("div",{"data-slot":"alert-description",className:Le("opacity-80",t),...e})}Object.assign(YK,{Title:XK,Description:QK});function ZK({direction:t="horizontal",autoSaveId:e,id:n,className:r,disableCursor:i=!0,...s}){return O.jsx(Iz,{"data-slot":"split",orientation:t,id:n??e,disableCursor:i,className:Le("flex h-full w-full",r),...s})}function og(t){return typeof t=="number"?`${t}%`:t}function JK({className:t,defaultSize:e,minSize:n,maxSize:r,collapsedSize:i,...s}){return O.jsx(Dz,{"data-slot":"split-pane",className:Le("min-h-0 min-w-0",t),defaultSize:og(e),minSize:og(n),maxSize:og(r),collapsedSize:og(i),...s})}function eY({className:t,withHandle:e=!1,children:n,...r}){return O.jsxs(Pz,{"data-slot":"split-handle",className:Le("group/split-handle relative flex items-center justify-center bg-border","aria-[orientation=vertical]:w-px aria-[orientation=vertical]:cursor-col-resize","aria-[orientation=horizontal]:h-px aria-[orientation=horizontal]:cursor-row-resize","after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2","outline-none",t),...r,children:[e&&O.jsx("div",{className:Le("z-10 flex items-center justify-center rounded-sm border border-border bg-background","group-aria-[orientation=vertical]/split-handle:h-4 group-aria-[orientation=vertical]/split-handle:w-3","group-aria-[orientation=horizontal]/split-handle:h-3 group-aria-[orientation=horizontal]/split-handle:w-4 group-aria-[orientation=horizontal]/split-handle:rotate-90"),children:O.jsx(s6,{className:"h-2.5 w-2.5 text-muted-foreground"})}),n]})}const sg=Object.assign(ZK,{Pane:JK,Handle:eY}),vL=R.createContext(null);function tY(t){const[e,n]=R.useState(t.defaultOpen??!1),r=t.open??e;return O.jsx(vL.Provider,{value:r,children:O.jsx(Wq,{...t,onOpenChange:(i,s)=>{t.open===void 0&&n(i),t.onOpenChange?.(i,s)}})})}function nY(t){return O.jsx(Xq,{"data-slot":"dialog-trigger",...t})}function rY(t){return O.jsx(Nz,{"data-slot":"dialog-close",...t})}function iY({className:t,children:e,showCloseButton:n=!0,closeLabel:r="Close",...i}){const s=ef(),a=R.useContext(vL),u=R.useRef(e);return O.jsxs(Hq,{container:s,children:[O.jsx(Bq,{"data-slot":"dialog-backdrop",className:Le("fixed inset-0 z-50 bg-background/70","transition-opacity data-[ending-style]:opacity-0 data-[starting-style]:opacity-0")}),O.jsx(Kq,{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:O.jsxs(_q,{"data-slot":"dialog-content",className:Le("relative flex w-full max-w-md flex-col gap-4 rounded-lg border border-border bg-card p-6 text-card-foreground shadow-lg","transition-[transform,scale,opacity] data-[ending-style]:scale-95 data-[ending-style]:opacity-0 data-[starting-style]:scale-95 data-[starting-style]:opacity-0",t),render:c=>{const{children:d,...h}=c;return a&&(u.current=d),O.jsx("div",{...h,children:u.current})},...i,children:[e,n&&O.jsx(Nz,{"data-slot":"dialog-close","aria-label":r,className:Le("absolute top-4 right-4 inline-flex h-6 w-6 items-center justify-center rounded-sm text-muted-foreground","hover:bg-accent hover:text-accent-foreground","outline-none focus-visible:ring-2 focus-visible:ring-ring"),children:O.jsx(Dm,{className:"h-4 w-4"})})]})})]})}function oY({className:t,...e}){return O.jsx("div",{"data-slot":"dialog-header",className:Le("flex flex-col gap-1.5",t),...e})}function sY({className:t,...e}){return O.jsx("div",{"data-slot":"dialog-footer",className:Le("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),...e})}function lY({className:t,...e}){return O.jsx(Yq,{"data-slot":"dialog-title",className:Le("text-sm font-semibold text-foreground",t),...e})}function aY({className:t,...e}){return O.jsx(jq,{"data-slot":"dialog-description",className:Le("text-sm text-muted-foreground",t),...e})}const un=Object.assign(tY,{Trigger:nY,Close:rY,Content:iY,Header:oY,Footer:sY,Title:lY,Description:aY}),uY=qc(Le("relative inline-flex shrink-0 items-center justify-center gap-1.5 whitespace-nowrap rounded-md text-sm font-medium transition-colors","outline-none focus-visible:ring-2 focus-visible:ring-ring","disabled:pointer-events-none disabled:opacity-50","[&_svg]:pointer-events-none [&_svg]:shrink-0"),{variants:{size:{sm:"h-6 px-2 text-xs [&_svg]:size-3.5",md:"h-8 px-3 [&_svg]:size-4",lg:"h-10 px-4 [&_svg]:size-5"}},defaultVariants:{size:"md"}});function Ho({className:t,tone:e="primary",variant:n,size:r,type:i="button",trailing:s,children:a,render:u,ref:c,...d}){return Hi({render:u??O.jsx("button",{type:i}),ref:c,props:{"data-slot":"button",className:Le(uY({size:r}),hy({tone:e,variant:n,interactive:!0}),t),children:O.jsxs(O.Fragment,{children:[a,s]}),...d}})}function bL({open:t,onOpenChange:e,title:n,description:r,className:i,variant:s="confirm",tone:a="primary",confirmLabel:u,cancelLabel:c="Cancel",onConfirm:d}){const h=s==="alert";return O.jsx(un,{open:t,onOpenChange:e,children:O.jsxs(un.Content,{showCloseButton:!1,className:i,children:[O.jsxs(un.Header,{children:[O.jsx(un.Title,{children:n}),r&&O.jsx(un.Description,{children:r})]}),O.jsxs(un.Footer,{children:[!h&&O.jsx(un.Close,{render:O.jsx(Ho,{tone:"neutral",variant:"outline"}),children:c}),O.jsx(un.Close,{render:O.jsx(Ho,{tone:a}),onClick:d,children:u??(h?"OK":"Confirm")})]})]})})}const xL=R.createContext(null);function cY({children:t}){const[e,n]=R.useState([]),r=R.useRef(e);r.current=e;const i=R.useRef(0),s=R.useCallback(c=>new Promise(d=>{const h=i.current++;n(g=>[...g,{id:h,options:c,resolve:d}])}),[]);R.useEffect(()=>()=>{r.current.forEach(c=>c.resolve(!1))},[]);const a=e[0]??null,u=c=>{a&&(a.resolve(c),n(d=>d.filter(h=>h.id!==a.id)))};return O.jsxs(xL.Provider,{value:s,children:[t,a&&O.jsx(bL,{...a.options,open:!0,onOpenChange:c=>{c||u(!1)},onConfirm:()=>u(!0)},a.id)]})}function G1(){const t=R.useContext(xL);if(!t)throw new Error("useConfirmDialog must be used within a ConfirmDialog.Provider");return t}const SL=Object.assign(bL,{Provider:cY});function fk({children:t,dismissLabel:e="Dismiss",viewportClassName:n,...r}){return O.jsxs(Jq,{"data-slot":"toast-provider",...r,children:[t,O.jsx(fY,{dismissLabel:e,viewportClassName:n})]})}function fY({dismissLabel:t,viewportClassName:e}){const{toasts:n}=g9(),r=ef();return O.jsx(p9,{container:r,children:O.jsx(t9,{"data-slot":"toast-viewport",className:Le("fixed right-4 bottom-4 z-50 flex w-80 flex-col gap-2",e),children:n.map(i=>O.jsxs(a9,{toast:i,"data-slot":"toast",className:Le("relative flex items-start gap-2 rounded-md border border-border bg-card p-3 text-card-foreground shadow-md","transition-[transform,opacity] data-[ending-style]:opacity-0 data-[starting-style]:opacity-0",i.type==="error"&&"border-danger/50 text-danger"),children:[O.jsxs(u9,{"data-slot":"toast-content",className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[i.title&&O.jsx(d9,{"data-slot":"toast-title",className:"text-sm font-medium"}),i.description&&O.jsx(f9,{"data-slot":"toast-description",className:"text-xs text-muted-foreground"})]}),O.jsx(h9,{"data-slot":"toast-close","aria-label":t,className:"inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-sm text-muted-foreground hover:text-foreground",children:O.jsx(Dm,{className:"h-3.5 w-3.5"})})]},i.id))})})}const wL=Object.assign(fk,{Provider:fk});function dY({unstyled:t=!1,className:e,children:n,...r}){return t?O.jsx("div",{"data-slot":"plugin-shell",className:Le("flex h-screen min-h-0 flex-col",e),...r,children:O.jsx(wL,{children:O.jsx(SL.Provider,{children:n})})}):O.jsx(NK,{children:O.jsx(hY,{className:e,...r,children:n})})}function hY({className:t,children:e,...n}){const{theme:r}=mL(),[i,s]=R.useState(null);return O.jsx("div",{ref:s,"data-slot":"plugin-shell",className:Le(r==="dark"&&"dark","flex h-screen min-h-0 flex-col bg-background text-foreground",t),...n,children:O.jsx(yL.Provider,{value:i,children:O.jsx(wL,{children:O.jsx(SL.Provider,{children:e})})})})}function pY({className:t,...e}){return O.jsx("div",{"data-slot":"plugin-shell-body",className:Le("flex min-h-0 flex-1 flex-col overflow-auto",t),...e})}const CL=Object.assign(dY,{Body:pY});function gY({className:t,render:e,ref:n,...r}){return Hi({render:e??O.jsx("header",{}),ref:n,props:{"data-slot":"plugin-header",className:Le("flex shrink-0 items-center justify-between gap-3 border-b border-border bg-card px-4 py-3",t),...r}})}function mY({className:t,render:e,ref:n,...r}){return Hi({render:e??O.jsx("h1",{}),ref:n,props:{"data-slot":"plugin-header-title",className:Le("text-sm font-semibold text-foreground",t),...r}})}function yY({className:t,render:e,ref:n,...r}){return Hi({render:e??O.jsx("p",{}),ref:n,props:{"data-slot":"plugin-header-subtitle",className:Le("text-xs text-muted-foreground",t),...r}})}function vY({className:t,render:e,ref:n,...r}){return Hi({render:e??O.jsx("div",{}),ref:n,props:{"data-slot":"plugin-header-actions",className:Le("flex items-center gap-2",t),...r}})}function bY({className:t,lightLabel:e="Switch to light theme",darkLabel:n="Switch to dark theme",render:r,ref:i,children:s,...a}){const{theme:u,toggleTheme:c}=mL();return Hi({render:r??O.jsx("button",{type:"button"}),ref:i,props:{"data-slot":"plugin-header-theme-switcher","aria-label":u==="dark"?e:n,onClick:c,className:Le("inline-flex h-6 w-6 items-center justify-center rounded-md text-muted-foreground","hover:bg-accent hover:text-accent-foreground","outline-none focus-visible:ring-2 focus-visible:ring-ring","transition-colors",t),children:u==="dark"?O.jsx(h6,{className:"h-3.5 w-3.5"}):O.jsx(u6,{className:"h-3.5 w-3.5"}),...a}})}Object.assign(gY,{Title:mY,Subtitle:yY,Actions:vY,ThemeSwitcher:bY});const xY=Le("w-full rounded-md border border-input bg-transparent text-foreground shadow-xs transition-colors","outline-none focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/50","placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50"),ph=qc(xY,{variants:{size:{sm:"h-6 px-2 text-xs",md:"h-8 px-3 text-sm",lg:"h-10 px-4 text-base"}},defaultVariants:{size:"md"}}),RL=qc(Le("max-h-64 min-w-[--anchor-width] overflow-y-auto rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-md","origin-(--transform-origin) transition-[transform,scale,opacity] data-[ending-style]:scale-95 data-[ending-style]:opacity-0 data-[starting-style]:scale-95 data-[starting-style]:opacity-0")),TL=qc(Le("flex cursor-default items-center justify-between gap-2 rounded-sm px-2 py-1.5 text-sm text-foreground select-none","data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground","data-[disabled]:pointer-events-none data-[disabled]:opacity-50"));function SY(t){return O.jsx(w9,{...t})}function wY({className:t,children:e,size:n="md",...r}){return O.jsxs(O9,{"data-slot":"select-trigger",className:Le(ph({size:n}),"flex items-center justify-between gap-2",t),...r,children:[e,O.jsx(D9,{children:O.jsx(xw,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"})})]})}function CY({className:t,...e}){return O.jsx(I9,{"data-slot":"select-value",className:Le("truncate",t),...e})}function RY({className:t,side:e="bottom",sideOffset:n=4,align:r="start",children:i,...s}){const a=ef();return O.jsx(P9,{container:a,children:O.jsx(N9,{side:e,sideOffset:n,align:r,className:"z-50",children:O.jsx(H9,{"data-slot":"select-content",className:Le(RL(),t),...s,children:O.jsx(F9,{children:i})})})})}function TY({className:t,children:e,...n}){return O.jsxs(U9,{"data-slot":"select-item",className:Le(TL(),t),...n,children:[O.jsx(G9,{children:e}),O.jsx($9,{children:O.jsx(vw,{className:"h-3.5 w-3.5"})})]})}const ac=Object.assign(SY,{Trigger:wY,Value:CY,Content:RY,Item:TY});function EY(t){return O.jsx(eG,{...t})}const MY={sm:{pad:"pr-11",cluster:"right-1",control:"size-4",icon:"size-3"},md:{pad:"pr-14",cluster:"right-1.5",control:"size-5",icon:"size-3.5"},lg:{pad:"pr-16",cluster:"right-2",control:"size-6",icon:"size-4"}};function AY({className:t,size:e="md",...n}){const r=MY[e];return O.jsxs(lG,{"data-slot":"combobox-input-group",className:"relative flex items-center",children:[O.jsx(oG,{"data-slot":"combobox-input",className:Le(ph({size:e}),r.pad,t),...n}),O.jsxs("div",{className:Le("absolute flex items-center gap-0.5",r.cluster),children:[O.jsx(kG,{"data-slot":"combobox-clear",className:Le("inline-flex items-center justify-center rounded-sm text-muted-foreground hover:text-foreground",r.control),children:O.jsx(Dm,{className:r.icon})}),O.jsx(SG,{"data-slot":"combobox-icon",children:O.jsx(xw,{className:Le("text-muted-foreground",r.icon)})})]})]})}function OY({className:t,side:e="bottom",sideOffset:n=4,align:r="start",emptyMessage:i="No results found.",children:s,...a}){const u=ef();return O.jsx(yG,{container:u,children:O.jsx(vG,{side:e,sideOffset:n,align:r,className:"z-50",children:O.jsxs(xG,{"data-slot":"combobox-content",className:Le(RL(),t),...a,children:[O.jsx(AG,{"data-slot":"combobox-empty",className:"px-2 py-1.5 text-sm text-muted-foreground",children:i}),O.jsx(fG,{children:s})]})})})}function kY({className:t,children:e,...n}){return O.jsxs(TG,{"data-slot":"combobox-item",className:Le(TL(),t),...n,children:[e,O.jsx(EG,{children:O.jsx(vw,{className:"h-3.5 w-3.5"})})]})}Object.assign(EY,{Input:AY,Content:OY,Item:kY});const IY={sm:"h-6 p-0.5",md:"h-8 p-1",lg:"h-10 p-1"},DY={sm:"h-5 px-2 text-xs",md:"h-6 px-2.5 text-sm",lg:"h-8 px-3 text-base"};function PY(t){return O.jsx(IG,{"data-slot":"tabs",...t})}function zY({className:t,size:e="md",...n}){return O.jsx(_G,{"data-slot":"tabs-list",className:Le("inline-flex items-center gap-1 rounded-md bg-muted text-muted-foreground",IY[e],t),...n})}function NY({className:t,size:e="md",...n}){return O.jsx(PG,{"data-slot":"tabs-tab",className:Le("inline-flex items-center justify-center rounded-sm font-medium whitespace-nowrap text-muted-foreground","outline-none focus-visible:ring-2 focus-visible:ring-ring","data-[selected]:bg-background data-[selected]:text-foreground data-[selected]:shadow-xs","disabled:pointer-events-none disabled:opacity-50",DY[e],t),...n})}function LY({className:t,...e}){return O.jsx(NG,{"data-slot":"tabs-panel",className:Le("flex-1 outline-none",t),...e})}Object.assign(PY,{List:zY,Tab:NY,Panel:LY});function BY({className:t,...e}){return O.jsx(WG,{"data-slot":"field",className:Le("flex flex-col gap-1.5",t),...e})}function jY({className:t,...e}){return O.jsx(YG,{"data-slot":"field-label",className:Le("text-sm font-medium text-foreground",t),...e})}function _Y({className:t,size:e="md",...n}){return O.jsx(JG,{"data-slot":"field-control",className:Le(ph({size:e}),t),...n})}function HY({className:t,...e}){return O.jsx(ZG,{"data-slot":"field-description",className:Le("text-xs text-muted-foreground",t),...e})}function VY({className:t,...e}){return O.jsx(QG,{"data-slot":"field-error",className:Le("text-xs text-danger",t),...e})}const Oo=Object.assign(BY,{Label:jY,Control:_Y,Description:HY,Error:VY});function FY({orientation:t="horizontal",className:e,...n}){return O.jsx(pz,{"data-slot":"separator",orientation:t,className:Le("shrink-0 bg-border",t==="vertical"?"h-4 w-px":"h-px w-full",e),...n})}const UY={sm:"h-6 px-2 text-xs [&_svg]:size-3.5",md:"h-8 px-3 text-sm [&_svg]:size-4",lg:"h-10 px-4 text-base [&_svg]:size-5"};function $Y({className:t,...e}){return O.jsx(e7,{"data-slot":"toolbar",className:Le("flex items-center gap-1 border-b border-border bg-card px-2 py-1.5",t),...e})}function qY({className:t,size:e="sm",...n}){return O.jsx(r7,{"data-slot":"toolbar-button",className:Le("inline-flex items-center justify-center gap-1.5 rounded-md font-medium text-foreground","hover:bg-accent hover:text-accent-foreground","outline-none focus-visible:ring-2 focus-visible:ring-ring","aria-disabled:pointer-events-none aria-disabled:opacity-50",UY[e],t),...n})}function GY({orientation:t="vertical",className:e,...n}){return O.jsx(FY,{"data-slot":"toolbar-separator",orientation:t,className:e,...n})}function WY({className:t,...e}){return O.jsx(n7,{"data-slot":"toolbar-group",className:Le("flex items-center gap-1",t),...e})}const Ji=Object.assign($Y,{Button:qY,Separator:GY,Group:WY});function KY({className:t,...e}){return O.jsx("div",{"data-slot":"description-list",className:Le("grid grid-cols-[minmax(7rem,25%)_minmax(3rem,1fr)] gap-x-2 gap-y-2 text-sm",t),...e})}function YY({label:t,className:e,children:n,...r}){return O.jsxs("div",{"data-slot":"description-list-item",className:Le("contents",e),...r,children:[O.jsx("span",{className:"text-muted-foreground",children:t}),O.jsx("span",{className:"min-w-0",children:n})]})}Object.assign(KY,{Item:YY});const W1=R.createContext(null);function XY({collapsible:t=!1,defaultOpen:e=!0,collapseLabel:n="Collapse",expandLabel:r="Expand",className:i,render:s,ref:a,...u}){const[c,d]=R.useState(e),h=Hi({render:s??O.jsx("div",{}),ref:a,props:{"data-slot":"card",className:Le("rounded-lg border border-border bg-card text-card-foreground",i),...u}});return O.jsx(W1.Provider,{value:{collapsible:t,open:c,toggle:()=>d(g=>!g),collapseLabel:n,expandLabel:r},children:h})}function QY({className:t,children:e,...n}){const r=R.useContext(W1);return O.jsxs("div",{"data-slot":"card-header",className:Le("flex items-center gap-2 p-3",t),...n,children:[r?.collapsible&&O.jsx("button",{type:"button","data-slot":"card-collapse-toggle","aria-expanded":r.open,"aria-label":r.open?r.collapseLabel:r.expandLabel,className:Le("flex size-5 shrink-0 items-center justify-center rounded outline-none","text-muted-foreground hover:bg-accent hover:text-accent-foreground","focus-visible:ring-2 focus-visible:ring-ring"),onClick:r.toggle,children:O.jsx(bw,{"aria-hidden":"true",className:Le("size-4 transition-transform",r.open&&"rotate-90")})}),O.jsx("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:e})]})}function ZY({className:t,...e}){const n=R.useContext(W1);return n?.collapsible&&!n.open?null:O.jsx("div",{"data-slot":"card-body",className:Le("border-t border-border p-3",t),...e})}Object.assign(XY,{Header:QY,Body:ZY});const JY=qc("inline-flex w-fit shrink-0 items-center justify-center rounded-sm font-medium whitespace-nowrap",{variants:{size:{sm:"px-1.5 py-0 text-xs",md:"px-2 py-0.5 text-xs",lg:"px-2.5 py-1 text-sm"}},defaultVariants:{size:"md"}});function um({className:t,tone:e="primary",variant:n,size:r,render:i,ref:s,...a}){return Hi({render:i??O.jsx("span",{}),ref:s,props:{"data-slot":"badge",className:Le(JY({size:r}),hy({tone:e,variant:n}),t),...a}})}function gS({className:t,type:e="text",size:n="md",...r}){return O.jsx("input",{type:e,"data-slot":"input",className:Le(ph({size:n}),"min-w-0",t),...r})}const eX={sm:{icon:"left-1.5 size-3",input:"pl-6",inputPad:{withClear:"pr-6",bare:"pr-2"},clear:"right-1 size-3.5",clearIcon:"size-3"},md:{icon:"left-2.5 size-3.5",input:"pl-8",inputPad:{withClear:"pr-8",bare:"pr-3"},clear:"right-2 size-4",clearIcon:"size-3.5"},lg:{icon:"left-3 size-4",input:"pl-10",inputPad:{withClear:"pr-10",bare:"pr-4"},clear:"right-2.5 size-5",clearIcon:"size-4"}};function tX({className:t,value:e,onClear:n,clearLabel:r="Clear search",size:i="md",...s}){const a=!!n&&!!e,u=eX[i];return O.jsxs("div",{"data-slot":"search-field",className:"relative flex items-center",children:[O.jsx(d6,{className:Le("pointer-events-none absolute text-muted-foreground",u.icon)}),O.jsx("input",{type:"search",value:e,className:Le(ph({size:i}),"min-w-0",u.input,a?u.inputPad.withClear:u.inputPad.bare,"[&::-webkit-search-cancel-button]:appearance-none",t),...s}),a&&O.jsx("button",{type:"button",onClick:n,"aria-label":r,className:Le("absolute inline-flex items-center justify-center rounded-sm text-muted-foreground hover:text-foreground",u.clear),children:O.jsx(Dm,{className:u.clearIcon})})]})}function nX({direction:t}){return t==="asc"?O.jsx(i6,{className:"h-3 w-3"}):t==="desc"?O.jsx(r6,{className:"h-3 w-3"}):O.jsx(xw,{className:"h-3 w-3 text-muted-foreground/60"})}const rX="w-full border-collapse text-sm",iX="h-full w-full overflow-auto",dk={height:400},oX=({children:t,context:e,style:n})=>O.jsx("table",{"aria-label":e.ariaLabel,className:e.tableClassName,style:n,children:t}),sX=({children:t,context:e,item:n,...r})=>{const i=n,s=!!e.onRowClick,a=()=>{e.onRowClick?.(i.original)},u=c=>{!s||c.key!=="Enter"&&c.key!==" "||(c.preventDefault(),a())};return O.jsx("tr",{...r,"aria-label":e.getRowTextValue?.(i.original,i.index)??String(i.id),className:Le("border-b border-border last:border-0 transition-colors hover:bg-accent/50",s&&"cursor-pointer"),onClick:s?a:void 0,onKeyDown:u,tabIndex:s?0:void 0,children:t})},lX=({context:t})=>O.jsx("tr",{children:O.jsx("td",{colSpan:t.columnCount,children:t.renderEmptyState?.()??O.jsx("div",{className:"flex min-h-56 w-full items-center justify-center px-4 py-10 text-center",children:O.jsx("span",{className:"text-sm text-muted-foreground",children:t.isLoading?"Loading…":t.emptyMessage})})})}),aX={EmptyPlaceholder:lX,Table:oX,TableRow:sX},uX=({ariaLabel:t,data:e,columns:n,getRowId:r,getRowTextValue:i,onRowClick:s,onStartReached:a,onEndReached:u,sorting:c,onSortingChange:d,manualSorting:h=!1,loading:g=!1,emptyMessage:m="No data.",renderEmptyState:y,className:b,scrollClassName:x,style:w})=>{const[C,T]=R.useState([]),E=c??C,M=R.useCallback(N=>{const _=typeof N=="function"?N(E):N;c===void 0&&T(_),d?.(_)},[c,d,E]),k=Y7({columns:n,data:e,getCoreRowModel:$7(),getRowId:r,getSortedRowModel:q7(),manualSorting:h,onSortingChange:M,state:{sorting:E}}),P=k.getRowModel().rows,A=R.useMemo(()=>({ariaLabel:t,columnCount:k.getVisibleLeafColumns().length,emptyMessage:m,getRowTextValue:i,isLoading:g,onRowClick:s,renderEmptyState:y,tableClassName:Le(rX,b)}),[t,b,m,i,g,s,y,k]),I=R.useCallback((N,_)=>_.getVisibleCells().map(H=>O.jsx("td",{className:"px-3 py-1.5 text-foreground",children:Mb(H.column.columnDef.cell,H.getContext())},H.id)),[]),L=R.useCallback(()=>k.getHeaderGroups().map(N=>O.jsx("tr",{className:"border-b border-border",children:N.headers.map(_=>{const H=_.column.getCanSort(),F=_.column.getIsSorted();return O.jsx("th",{"aria-sort":H?F==="asc"?"ascending":F==="desc"?"descending":"none":void 0,colSpan:_.colSpan,className:"h-8 px-3 text-left text-xs font-medium text-muted-foreground",scope:"col",children:_.isPlaceholder?null:H?O.jsxs("button",{className:"inline-flex items-center gap-1 hover:text-foreground",onClick:_.column.getToggleSortingHandler(),type:"button",children:[Mb(_.column.columnDef.header,_.getContext()),O.jsx("span",{"aria-hidden":"true",children:O.jsx(nX,{direction:F})})]}):Mb(_.column.columnDef.header,_.getContext())},_.id)})},N.id)),[k]),j=R.useCallback((N,_)=>_.id,[]);return O.jsx(mK,{className:Le(iX,x),components:aX,computeItemKey:j,context:A,data:P,endReached:u,fixedHeaderContent:L,itemContent:I,startReached:a,style:w?{...dk,...w}:dk})},cX={sm:"h-6 text-xs",md:"h-8 text-sm",lg:"h-10 text-base"};function fX({className:t,...e}){return O.jsx("div",{"data-slot":"list",className:Le("flex flex-col gap-4",t),...e})}function dX({className:t,label:e,children:n,...r}){return O.jsxs("div",{"data-slot":"list-group",className:Le("flex flex-col gap-0.5",t),...r,children:[e&&O.jsx("div",{"data-slot":"list-group-label",className:"px-2 py-1 text-xs font-medium text-sidebar-foreground/60",children:e}),n]})}function hX({className:t,selected:e=!1,leading:n,trailing:r,size:i="md",children:s,type:a="button",render:u,ref:c,...d}){return Hi({render:u??O.jsx("button",{type:a}),ref:c,props:{"data-slot":"list-item","data-selected":e||void 0,"aria-current":e||void 0,className:Le("flex w-full items-center gap-2 rounded-md px-2 text-left text-sidebar-foreground","hover:bg-sidebar-accent hover:text-sidebar-accent-foreground","outline-none focus-visible:ring-2 focus-visible:ring-sidebar-ring","data-[selected]:bg-sidebar-accent data-[selected]:text-sidebar-accent-foreground data-[selected]:font-medium",cX[i],t),children:O.jsxs(O.Fragment,{children:[n&&O.jsx("span",{"data-slot":"list-item-leading",className:"flex h-3.5 w-3.5 shrink-0 items-center justify-center [&_svg]:h-3.5 [&_svg]:w-3.5",children:n}),O.jsx("span",{className:"min-w-0 flex-1 truncate",children:s}),r]}),...d}})}Object.assign(fX,{Group:dX,Item:hX});const mS=R.createContext(0),pX=16,gX=8,mX={sm:"h-6 text-xs",md:"h-8 text-sm",lg:"h-10 text-base"};function yX({className:t,children:e,...n}){return O.jsx("div",{"data-slot":"nested-list",className:Le("flex flex-col gap-0.5",t),...n,children:O.jsx(mS.Provider,{value:0,children:e})})}function vX({className:t,label:e,leading:n,trailing:r,selected:i=!1,size:s="md",defaultExpanded:a=!1,expanded:u,onExpandedChange:c,children:d,onClick:h,type:g="button",...m}){const y=R.useContext(mS),b=R.Children.count(d)>0,[x,w]=R.useState(a),C=u??x,T=E=>{const M=!C;w(M),c?.(M),h?.(E)};return O.jsxs("div",{"data-slot":"nested-list-item",children:[O.jsxs("button",{type:g,"data-slot":"nested-list-item-row","data-selected":i||void 0,"data-expanded":C||void 0,"aria-current":i||void 0,"aria-expanded":b?C:void 0,style:{paddingLeft:gX+y*pX},className:Le("flex min-w-full items-center gap-1.5 rounded-md pr-2 text-left text-sidebar-foreground","hover:bg-sidebar-accent hover:text-sidebar-accent-foreground","outline-none focus-visible:ring-2 focus-visible:ring-sidebar-ring","data-[selected]:bg-sidebar-accent data-[selected]:text-sidebar-accent-foreground data-[selected]:font-medium",mX[s],t),onClick:b?T:h,...m,children:[b?O.jsx(bw,{"data-slot":"nested-list-item-chevron",className:Le("h-3.5 w-3.5 shrink-0 text-sidebar-foreground/60 transition-transform",C&&"rotate-90")}):O.jsx("span",{className:"h-3.5 w-3.5 shrink-0"}),n&&O.jsx("span",{"data-slot":"list-item-leading",className:"flex h-3.5 w-3.5 shrink-0 items-center justify-center [&_svg]:h-3.5 [&_svg]:w-3.5",children:n}),O.jsx("span",{className:"flex-1 whitespace-nowrap",children:e}),r]}),b&&C&&O.jsx(mS.Provider,{value:y+1,children:O.jsx("div",{"data-slot":"nested-list-children",className:"flex flex-col gap-0.5",children:d})})]})}Object.assign(yX,{Item:vX});const bX={sm:"h-6 text-xs",md:"h-8 text-sm",lg:"h-10 text-base"};function xX({className:t,...e}){return O.jsx("nav",{"data-slot":"sidebar",className:Le("flex h-full shrink-0 flex-col gap-4 overflow-y-auto border-r border-sidebar-border bg-sidebar p-2 text-sidebar-foreground",t),...e})}function SX({className:t,label:e,children:n,...r}){return O.jsxs("div",{"data-slot":"sidebar-group",className:Le("flex flex-col gap-0.5",t),...r,children:[e&&O.jsx("div",{"data-slot":"sidebar-group-label",className:"px-2 py-1 text-xs font-medium text-sidebar-foreground/60",children:e}),n]})}function wX({className:t,selected:e=!1,leading:n,trailing:r,size:i="md",children:s,type:a="button",render:u,ref:c,...d}){return Hi({render:u??O.jsx("button",{type:a}),ref:c,props:{"data-slot":"sidebar-item","data-selected":e||void 0,"aria-current":e||void 0,className:Le("flex w-full items-center gap-2 rounded-md px-2 text-left text-sidebar-foreground","hover:bg-sidebar-accent hover:text-sidebar-accent-foreground","outline-none focus-visible:ring-2 focus-visible:ring-sidebar-ring","data-[selected]:bg-sidebar-accent data-[selected]:text-sidebar-accent-foreground data-[selected]:font-medium",bX[i],t),children:O.jsxs(O.Fragment,{children:[n&&O.jsx("span",{"data-slot":"sidebar-item-leading",className:"flex h-3.5 w-3.5 shrink-0 items-center justify-center [&_svg]:h-3.5 [&_svg]:w-3.5",children:n}),O.jsx("span",{className:"min-w-0 flex-1 truncate",children:s}),r]}),...d}})}function CX({className:t,...e}){return O.jsx("header",{"data-slot":"sidebar-header",className:Le("sticky top-0 z-10 flex h-12 shrink-0 items-center border-b border-sidebar-border bg-sidebar px-3",t),...e})}function RX({className:t,...e}){return O.jsx("footer",{"data-slot":"sidebar-footer",className:Le("flex shrink-0 gap-1 border-t border-sidebar-border p-2",t),...e})}const zb=Object.assign(xX,{Group:SX,Item:wX,Header:CX,Footer:RX});function TX({className:t,icon:e,title:n,description:r,action:i,render:s,ref:a,children:u,...c}){return Hi({render:s??O.jsx("div",{}),ref:a,props:{"data-slot":"empty-state",className:Le("flex flex-1 flex-col items-center justify-center gap-3 p-8 text-center",t),children:O.jsxs(O.Fragment,{children:[e&&O.jsx(e,{className:"h-8 w-8 text-muted-foreground"}),O.jsx("p",{className:"text-sm font-medium text-foreground",children:n}),r&&O.jsx("p",{className:"max-w-sm text-sm text-muted-foreground",children:r}),i]}),...c}})}const EX=new Set(["object","array"]);function K1(t){if(t===null)return"null";if(Array.isArray(t))return"array";const e=typeof t;return e==="object"?"object":e}function MX(t){return EX.has(K1(t))}function EL(t){if(Array.isArray(t))return t.map((e,n)=>String(n));if(K1(t)==="object")return Object.keys(t)}function AX(t){const e=EL(t)??[];return Array.isArray(t)?`[${e.length}]`:`{${e.length}}`}function OX({data:t,className:e,defaultExpandedDepth:n=1}){return O.jsx("div",{"data-slot":"json-inspector",className:Le("font-mono text-xs",e),children:O.jsx(ML,{label:null,value:t,depth:0,defaultExpandedDepth:n})})}function ML({label:t,value:e,depth:n,defaultExpandedDepth:r}){const[i,s]=R.useState(n<r);if(!MX(e))return O.jsxs("div",{"data-slot":"json-inspector-leaf",className:"flex gap-1",children:[t!==null&&O.jsxs("span",{className:"text-muted-foreground",children:[t,":"]}),O.jsx(IX,{value:e})]});const a=EL(e)??[];return O.jsxs("div",{"data-slot":"json-inspector-node",children:[O.jsxs("button",{type:"button",onClick:()=>s(u=>!u),className:"inline-flex items-center gap-1 text-foreground hover:text-primary",children:[O.jsx(bw,{className:Le("h-3 w-3 shrink-0 text-muted-foreground transition-transform",i&&"rotate-90")}),t!==null&&O.jsxs("span",{className:"text-muted-foreground",children:[t,":"]}),O.jsx("span",{className:"text-muted-foreground",children:AX(e)})]}),i&&O.jsx("div",{className:"ml-3.5 border-l border-border pl-2",children:a.map(u=>O.jsx(ML,{label:u,value:e[u],depth:n+1,defaultExpandedDepth:r},u))})]})}const kX={string:"text-primary",number:"text-accent-foreground",boolean:"text-secondary-foreground",null:"text-danger",undefined:"text-danger"};function IX({value:t}){const e=K1(t),n=e==="string"?`"${t}"`:String(t);return O.jsx("span",{className:kX[e]??"text-foreground",children:n})}const hk=["string","number","boolean","buffer"],lg=({adapterId:t,storageId:e})=>`${t}:${e}`,Nb=1;class Io extends Error{constructor(e,n){super(n),this.path=e}}const hs=t=>t===null?"null":Array.isArray(t)?"array":typeof t,DX=t=>typeof t=="object"&&t!==null&&!Array.isArray(t),py=(t,e)=>{if(!DX(t))throw new Io(e,`Expected object, got ${hs(t)}`);return t},ru=(t,e)=>{if(typeof t!="string")throw new Io(e,`Expected string, got ${hs(t)}`);return t},AL=(t,e)=>{if(!Array.isArray(t))throw new Io(e,`Expected array, got ${hs(t)}`);return t},OL=(t,e)=>{if(typeof t!="string"||!hk.includes(t))throw new Io(e,`Expected one of ${hk.join(", ")}, got ${hs(t)}`);return t},PX=(t,e)=>{const n=py(t,e);return{supportedTypes:AL(n.supportedTypes,`${e}.supportedTypes`).map((s,a)=>OL(s,`${e}.supportedTypes[${a}]`))}},zX=t=>{const e=py(t,"storage");return{adapterId:ru(e.adapterId,"storage.adapterId"),storageId:ru(e.storageId,"storage.storageId"),adapterName:ru(e.adapterName,"storage.adapterName"),storageName:ru(e.storageName,"storage.storageName"),capabilities:PX(e.capabilities,"storage.capabilities")}},NX=(t,e)=>{const n=py(t,e),r=ru(n.key,`${e}.key`),i=OL(n.type,`${e}.type`),s=`${e}.value`;switch(i){case"string":{const a=n.value;if(typeof a!="string")throw new Io(s,`Expected string for type "string", got ${hs(a)}`);return{key:r,type:"string",value:a}}case"number":{const a=n.value;if(typeof a!="number"||!Number.isFinite(a))throw new Io(s,`Expected finite number for type "number", got ${hs(a)}`);return{key:r,type:"number",value:a}}case"boolean":{const a=n.value;if(typeof a!="boolean")throw new Io(s,`Expected boolean for type "boolean", got ${hs(a)}`);return{key:r,type:"boolean",value:a}}case"buffer":{const a=n.value;if(!Array.isArray(a))throw new Io(s,`Expected number[] for type "buffer", got ${hs(a)}`);const u=a.map((c,d)=>{if(typeof c!="number"||!Number.isInteger(c)||c<0||c>255)throw new Io(`${s}[${d}]`,`Expected uint8 (integer 0-255), got ${hs(c)}`);return c});return{key:r,type:"buffer",value:u}}}},LX=t=>{try{const e=py(t,"$"),n=e.version;if(n!==Nb)throw new Io("version",`Unsupported snapshot version: ${hs(n)} (this build supports version ${Nb})`);const r=ru(e.plugin,"plugin"),i=ru(e.createdAt,"createdAt"),s=zX(e.storage),u=AL(e.entries,"entries").map((c,d)=>NX(c,`entries[${d}]`));return{ok:!0,snapshot:{version:Nb,plugin:r,createdAt:i,storage:s,entries:u}}}catch(e){if(e instanceof Io)return{ok:!1,error:{path:e.path,message:e.message}};throw e}};let yS=[],kL=[];(()=>{let t="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,n=0;e<t.length;e++)(e%2?kL:yS).push(n=n+t[e])})();function BX(t){if(t<768)return!1;for(let e=0,n=yS.length;;){let r=e+n>>1;if(t<yS[r])n=r;else if(t>=kL[r])e=r+1;else return!0;if(e==n)return!1}}function pk(t){return t>=127462&&t<=127487}const gk=8205;function jX(t,e,n=!0,r=!0){return(n?IL:_X)(t,e,r)}function IL(t,e,n){if(e==t.length)return e;e&&DL(t.charCodeAt(e))&&PL(t.charCodeAt(e-1))&&e--;let r=Lb(t,e);for(e+=mk(r);e<t.length;){let i=Lb(t,e);if(r==gk||i==gk||n&&BX(i))e+=mk(i),r=i;else if(pk(i)){let s=0,a=e-2;for(;a>=0&&pk(Lb(t,a));)s++,a-=2;if(s%2==0)break;e+=2}else break}return e}function _X(t,e,n){for(;e>0;){let r=IL(t,e-2,n);if(r<e)return r;e--}return 0}function Lb(t,e){let n=t.charCodeAt(e);if(!PL(n)||e+1==t.length)return n;let r=t.charCodeAt(e+1);return DL(r)?(n-55296<<10)+(r-56320)+65536:n}function DL(t){return t>=56320&&t<57344}function PL(t){return t>=55296&&t<56320}function mk(t){return t<65536?1:2}class Yt{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,n,r){[e,n]=zc(this,e,n);let i=[];return this.decompose(0,e,i,2),r.length&&r.decompose(0,r.length,i,3),this.decompose(n,this.length,i,1),ps.from(i,this.length-(n-e)+r.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,n=this.length){[e,n]=zc(this,e,n);let r=[];return this.decompose(e,n,r,0),ps.from(r,n-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let n=this.scanIdentical(e,1),r=this.length-this.scanIdentical(e,-1),i=new vd(this),s=new vd(e);for(let a=n,u=n;;){if(i.next(a),s.next(a),a=0,i.lineBreak!=s.lineBreak||i.done!=s.done||i.value!=s.value)return!1;if(u+=i.value.length,i.done||u>=r)return!0}}iter(e=1){return new vd(this,e)}iterRange(e,n=this.length){return new zL(this,e,n)}iterLines(e,n){let r;if(e==null)r=this.iter();else{n==null&&(n=this.lines+1);let i=this.line(e).from;r=this.iterRange(i,Math.max(i,n==this.lines+1?this.length:n<=1?0:this.line(n-1).to))}return new NL(r)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?Yt.empty:e.length<=32?new rr(e):ps.from(rr.split(e,[]))}}class rr extends Yt{constructor(e,n=HX(e)){super(),this.text=e,this.length=n}get lines(){return this.text.length}get children(){return null}lineInner(e,n,r,i){for(let s=0;;s++){let a=this.text[s],u=i+a.length;if((n?r:u)>=e)return new VX(i,u,r,a);i=u+1,r++}}decompose(e,n,r,i){let s=e<=0&&n>=this.length?this:new rr(yk(this.text,e,n),Math.min(n,this.length)-Math.max(0,e));if(i&1){let a=r.pop(),u=Lg(s.text,a.text.slice(),0,s.length);if(u.length<=32)r.push(new rr(u,a.length+s.length));else{let c=u.length>>1;r.push(new rr(u.slice(0,c)),new rr(u.slice(c)))}}else r.push(s)}replace(e,n,r){if(!(r instanceof rr))return super.replace(e,n,r);[e,n]=zc(this,e,n);let i=Lg(this.text,Lg(r.text,yk(this.text,0,e)),n),s=this.length+r.length-(n-e);return i.length<=32?new rr(i,s):ps.from(rr.split(i,[]),s)}sliceString(e,n=this.length,r=`
|
|
22
|
+
`){[e,n]=zc(this,e,n);let i="";for(let s=0,a=0;s<=n&&a<this.text.length;a++){let u=this.text[a],c=s+u.length;s>e&&a&&(i+=r),e<c&&n>s&&(i+=u.slice(Math.max(0,e-s),n-s)),s=c+1}return i}flatten(e){for(let n of this.text)e.push(n)}scanIdentical(){return 0}static split(e,n){let r=[],i=-1;for(let s of e)r.push(s),i+=s.length+1,r.length==32&&(n.push(new rr(r,i)),r=[],i=-1);return i>-1&&n.push(new rr(r,i)),n}}class ps extends Yt{constructor(e,n){super(),this.children=e,this.length=n,this.lines=0;for(let r of e)this.lines+=r.lines}lineInner(e,n,r,i){for(let s=0;;s++){let a=this.children[s],u=i+a.length,c=r+a.lines-1;if((n?c:u)>=e)return a.lineInner(e,n,r,i);i=u+1,r=c+1}}decompose(e,n,r,i){for(let s=0,a=0;a<=n&&s<this.children.length;s++){let u=this.children[s],c=a+u.length;if(e<=c&&n>=a){let d=i&((a<=e?1:0)|(c>=n?2:0));a>=e&&c<=n&&!d?r.push(u):u.decompose(e-a,n-a,r,d)}a=c+1}}replace(e,n,r){if([e,n]=zc(this,e,n),r.lines<this.lines)for(let i=0,s=0;i<this.children.length;i++){let a=this.children[i],u=s+a.length;if(e>=s&&n<=u){let c=a.replace(e-s,n-s,r),d=this.lines-a.lines+c.lines;if(c.lines<d>>4&&c.lines>d>>6){let h=this.children.slice();return h[i]=c,new ps(h,this.length-(n-e)+r.length)}return super.replace(s,u,c)}s=u+1}return super.replace(e,n,r)}sliceString(e,n=this.length,r=`
|
|
23
|
+
`){[e,n]=zc(this,e,n);let i="";for(let s=0,a=0;s<this.children.length&&a<=n;s++){let u=this.children[s],c=a+u.length;a>e&&s&&(i+=r),e<c&&n>a&&(i+=u.sliceString(e-a,n-a,r)),a=c+1}return i}flatten(e){for(let n of this.children)n.flatten(e)}scanIdentical(e,n){if(!(e instanceof ps))return 0;let r=0,[i,s,a,u]=n>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;i+=n,s+=n){if(i==a||s==u)return r;let c=this.children[i],d=e.children[s];if(c!=d)return r+c.scanIdentical(d,n);r+=c.length+1}}static from(e,n=e.reduce((r,i)=>r+i.length+1,-1)){let r=0;for(let y of e)r+=y.lines;if(r<32){let y=[];for(let b of e)b.flatten(y);return new rr(y,n)}let i=Math.max(32,r>>5),s=i<<1,a=i>>1,u=[],c=0,d=-1,h=[];function g(y){let b;if(y.lines>s&&y instanceof ps)for(let x of y.children)g(x);else y.lines>a&&(c>a||!c)?(m(),u.push(y)):y instanceof rr&&c&&(b=h[h.length-1])instanceof rr&&y.lines+b.lines<=32?(c+=y.lines,d+=y.length+1,h[h.length-1]=new rr(b.text.concat(y.text),b.length+1+y.length)):(c+y.lines>i&&m(),c+=y.lines,d+=y.length+1,h.push(y))}function m(){c!=0&&(u.push(h.length==1?h[0]:ps.from(h,d)),d=-1,c=h.length=0)}for(let y of e)g(y);return m(),u.length==1?u[0]:new ps(u,n)}}Yt.empty=new rr([""],0);function HX(t){let e=-1;for(let n of t)e+=n.length+1;return e}function Lg(t,e,n=0,r=1e9){for(let i=0,s=0,a=!0;s<t.length&&i<=r;s++){let u=t[s],c=i+u.length;c>=n&&(c>r&&(u=u.slice(0,r-i)),i<n&&(u=u.slice(n-i)),a?(e[e.length-1]+=u,a=!1):e.push(u)),i=c+1}return e}function yk(t,e,n){return Lg(t,[""],e,n)}class vd{constructor(e,n=1){this.dir=n,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[n>0?1:(e instanceof rr?e.text.length:e.children.length)<<1]}nextInner(e,n){for(this.done=this.lineBreak=!1;;){let r=this.nodes.length-1,i=this.nodes[r],s=this.offsets[r],a=s>>1,u=i instanceof rr?i.text.length:i.children.length;if(a==(n>0?u:0)){if(r==0)return this.done=!0,this.value="",this;n>0&&this.offsets[r-1]++,this.nodes.pop(),this.offsets.pop()}else if((s&1)==(n>0?0:1)){if(this.offsets[r]+=n,e==0)return this.lineBreak=!0,this.value=`
|
|
24
|
+
`,this;e--}else if(i instanceof rr){let c=i.text[a+(n<0?-1:0)];if(this.offsets[r]+=n,c.length>Math.max(0,e))return this.value=e==0?c:n>0?c.slice(e):c.slice(0,c.length-e),this;e-=c.length}else{let c=i.children[a+(n<0?-1:0)];e>c.length?(e-=c.length,this.offsets[r]+=n):(n<0&&this.offsets[r]--,this.nodes.push(c),this.offsets.push(n>0?1:(c instanceof rr?c.text.length:c.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class zL{constructor(e,n,r){this.value="",this.done=!1,this.cursor=new vd(e,n>r?-1:1),this.pos=n>r?e.length:0,this.from=Math.min(n,r),this.to=Math.max(n,r)}nextInner(e,n){if(n<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,n<0?this.pos-this.to:this.from-this.pos);let r=n<0?this.pos-this.from:this.to-this.pos;e>r&&(e=r),r-=e;let{value:i}=this.cursor.next(e);return this.pos+=(i.length+e)*n,this.value=i.length<=r?i:n<0?i.slice(i.length-r):i.slice(0,r),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class NL{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:n,lineBreak:r,value:i}=this.inner.next(e);return n&&this.afterBreak?(this.value="",this.afterBreak=!1):n?(this.done=!0,this.value=""):r?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=i,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(Yt.prototype[Symbol.iterator]=function(){return this.iter()},vd.prototype[Symbol.iterator]=zL.prototype[Symbol.iterator]=NL.prototype[Symbol.iterator]=function(){return this});class VX{constructor(e,n,r,i){this.from=e,this.to=n,this.number=r,this.text=i}get length(){return this.to-this.from}}function zc(t,e,n){return e=Math.max(0,Math.min(t.length,e)),[e,Math.max(e,Math.min(t.length,n))]}function Qr(t,e,n=!0,r=!0){return jX(t,e,n,r)}function FX(t){return t>=56320&&t<57344}function UX(t){return t>=55296&&t<56320}function $X(t,e){let n=t.charCodeAt(e);if(!UX(n)||e+1==t.length)return n;let r=t.charCodeAt(e+1);return FX(r)?(n-55296<<10)+(r-56320)+65536:n}function qX(t){return t<65536?1:2}const vS=/\r\n?|\n/;var Li=(function(t){return t[t.Simple=0]="Simple",t[t.TrackDel=1]="TrackDel",t[t.TrackBefore=2]="TrackBefore",t[t.TrackAfter=3]="TrackAfter",t})(Li||(Li={}));class Ss{constructor(e){this.sections=e}get length(){let e=0;for(let n=0;n<this.sections.length;n+=2)e+=this.sections[n];return e}get newLength(){let e=0;for(let n=0;n<this.sections.length;n+=2){let r=this.sections[n+1];e+=r<0?this.sections[n]:r}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let n=0,r=0,i=0;n<this.sections.length;){let s=this.sections[n++],a=this.sections[n++];a<0?(e(r,i,s),i+=s):i+=a,r+=s}}iterChangedRanges(e,n=!1){bS(this,e,n)}get invertedDesc(){let e=[];for(let n=0;n<this.sections.length;){let r=this.sections[n++],i=this.sections[n++];i<0?e.push(r,i):e.push(i,r)}return new Ss(e)}composeDesc(e){return this.empty?e:e.empty?this:LL(this,e)}mapDesc(e,n=!1){return e.empty?this:xS(this,e,n)}mapPos(e,n=-1,r=Li.Simple){let i=0,s=0;for(let a=0;a<this.sections.length;){let u=this.sections[a++],c=this.sections[a++],d=i+u;if(c<0){if(d>e)return s+(e-i);s+=u}else{if(r!=Li.Simple&&d>=e&&(r==Li.TrackDel&&i<e&&d>e||r==Li.TrackBefore&&i<e||r==Li.TrackAfter&&d>e))return null;if(d>e||d==e&&n<0&&!u)return e==i||n<0?s:s+c;s+=c}i=d}if(e>i)throw new RangeError(`Position ${e} is out of range for changeset of length ${i}`);return s}touchesRange(e,n=e){for(let r=0,i=0;r<this.sections.length&&i<=n;){let s=this.sections[r++],a=this.sections[r++],u=i+s;if(a>=0&&i<=n&&u>=e)return i<e&&u>n?"cover":!0;i=u}return!1}toString(){let e="";for(let n=0;n<this.sections.length;){let r=this.sections[n++],i=this.sections[n++];e+=(e?" ":"")+r+(i>=0?":"+i:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(n=>typeof n!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new Ss(e)}static create(e){return new Ss(e)}}class wr extends Ss{constructor(e,n){super(e),this.inserted=n}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return bS(this,(n,r,i,s,a)=>e=e.replace(i,i+(r-n),a),!1),e}mapDesc(e,n=!1){return xS(this,e,n,!0)}invert(e){let n=this.sections.slice(),r=[];for(let i=0,s=0;i<n.length;i+=2){let a=n[i],u=n[i+1];if(u>=0){n[i]=u,n[i+1]=a;let c=i>>1;for(;r.length<c;)r.push(Yt.empty);r.push(a?e.slice(s,s+a):Yt.empty)}s+=a}return new wr(n,r)}compose(e){return this.empty?e:e.empty?this:LL(this,e,!0)}map(e,n=!1){return e.empty?this:xS(this,e,n,!0)}iterChanges(e,n=!1){bS(this,e,n)}get desc(){return Ss.create(this.sections)}filter(e){let n=[],r=[],i=[],s=new $d(this);e:for(let a=0,u=0;;){let c=a==e.length?1e9:e[a++];for(;u<c||u==c&&s.len==0;){if(s.done)break e;let h=Math.min(s.len,c-u);Yr(i,h,-1);let g=s.ins==-1?-1:s.off==0?s.ins:0;Yr(n,h,g),g>0&&na(r,n,s.text),s.forward(h),u+=h}let d=e[a++];for(;u<d;){if(s.done)break e;let h=Math.min(s.len,d-u);Yr(n,h,-1),Yr(i,h,s.ins==-1?-1:s.off==0?s.ins:0),s.forward(h),u+=h}}return{changes:new wr(n,r),filtered:Ss.create(i)}}toJSON(){let e=[];for(let n=0;n<this.sections.length;n+=2){let r=this.sections[n],i=this.sections[n+1];i<0?e.push(r):i==0?e.push([r]):e.push([r].concat(this.inserted[n>>1].toJSON()))}return e}static of(e,n,r){let i=[],s=[],a=0,u=null;function c(h=!1){if(!h&&!i.length)return;a<n&&Yr(i,n-a,-1);let g=new wr(i,s);u=u?u.compose(g.map(u)):g,i=[],s=[],a=0}function d(h){if(Array.isArray(h))for(let g of h)d(g);else if(h instanceof wr){if(h.length!=n)throw new RangeError(`Mismatched change set length (got ${h.length}, expected ${n})`);c(),u=u?u.compose(h.map(u)):h}else{let{from:g,to:m=g,insert:y}=h;if(g>m||g<0||m>n)throw new RangeError(`Invalid change range ${g} to ${m} (in doc of length ${n})`);let b=y?typeof y=="string"?Yt.of(y.split(r||vS)):y:Yt.empty,x=b.length;if(g==m&&x==0)return;g<a&&c(),g>a&&Yr(i,g-a,-1),Yr(i,m-g,x),na(s,i,b),a=m}}return d(e),c(!u),u}static empty(e){return new wr(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let n=[],r=[];for(let i=0;i<e.length;i++){let s=e[i];if(typeof s=="number")n.push(s,-1);else{if(!Array.isArray(s)||typeof s[0]!="number"||s.some((a,u)=>u&&typeof a!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(s.length==1)n.push(s[0],0);else{for(;r.length<i;)r.push(Yt.empty);r[i]=Yt.of(s.slice(1)),n.push(s[0],r[i].length)}}}return new wr(n,r)}static createSet(e,n){return new wr(e,n)}}function Yr(t,e,n,r=!1){if(e==0&&n<=0)return;let i=t.length-2;i>=0&&n<=0&&n==t[i+1]?t[i]+=e:i>=0&&e==0&&t[i]==0?t[i+1]+=n:r?(t[i]+=e,t[i+1]+=n):t.push(e,n)}function na(t,e,n){if(n.length==0)return;let r=e.length-2>>1;if(r<t.length)t[t.length-1]=t[t.length-1].append(n);else{for(;t.length<r;)t.push(Yt.empty);t.push(n)}}function bS(t,e,n){let r=t.inserted;for(let i=0,s=0,a=0;a<t.sections.length;){let u=t.sections[a++],c=t.sections[a++];if(c<0)i+=u,s+=u;else{let d=i,h=s,g=Yt.empty;for(;d+=u,h+=c,c&&r&&(g=g.append(r[a-2>>1])),!(n||a==t.sections.length||t.sections[a+1]<0);)u=t.sections[a++],c=t.sections[a++];e(i,d,s,h,g),i=d,s=h}}}function xS(t,e,n,r=!1){let i=[],s=r?[]:null,a=new $d(t),u=new $d(e);for(let c=-1;;){if(a.done&&u.len||u.done&&a.len)throw new Error("Mismatched change set lengths");if(a.ins==-1&&u.ins==-1){let d=Math.min(a.len,u.len);Yr(i,d,-1),a.forward(d),u.forward(d)}else if(u.ins>=0&&(a.ins<0||c==a.i||a.off==0&&(u.len<a.len||u.len==a.len&&!n))){let d=u.len;for(Yr(i,u.ins,-1);d;){let h=Math.min(a.len,d);a.ins>=0&&c<a.i&&a.len<=h&&(Yr(i,0,a.ins),s&&na(s,i,a.text),c=a.i),a.forward(h),d-=h}u.next()}else if(a.ins>=0){let d=0,h=a.len;for(;h;)if(u.ins==-1){let g=Math.min(h,u.len);d+=g,h-=g,u.forward(g)}else if(u.ins==0&&u.len<h)h-=u.len,u.next();else break;Yr(i,d,c<a.i?a.ins:0),s&&c<a.i&&na(s,i,a.text),c=a.i,a.forward(a.len-h)}else{if(a.done&&u.done)return s?wr.createSet(i,s):Ss.create(i);throw new Error("Mismatched change set lengths")}}}function LL(t,e,n=!1){let r=[],i=n?[]:null,s=new $d(t),a=new $d(e);for(let u=!1;;){if(s.done&&a.done)return i?wr.createSet(r,i):Ss.create(r);if(s.ins==0)Yr(r,s.len,0,u),s.next();else if(a.len==0&&!a.done)Yr(r,0,a.ins,u),i&&na(i,r,a.text),a.next();else{if(s.done||a.done)throw new Error("Mismatched change set lengths");{let c=Math.min(s.len2,a.len),d=r.length;if(s.ins==-1){let h=a.ins==-1?-1:a.off?0:a.ins;Yr(r,c,h,u),i&&h&&na(i,r,a.text)}else a.ins==-1?(Yr(r,s.off?0:s.len,c,u),i&&na(i,r,s.textBit(c))):(Yr(r,s.off?0:s.len,a.off?0:a.ins,u),i&&!a.off&&na(i,r,a.text));u=(s.ins>c||a.ins>=0&&a.len>c)&&(u||r.length>d),s.forward2(c),a.forward(c)}}}}class $d{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,n=this.i-2>>1;return n>=e.length?Yt.empty:e[n]}textBit(e){let{inserted:n}=this.set,r=this.i-2>>1;return r>=n.length&&!e?Yt.empty:n[r].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class iu{constructor(e,n,r){this.from=e,this.to=n,this.flags=r}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(e,n=-1){let r,i;return this.empty?r=i=e.mapPos(this.from,n):(r=e.mapPos(this.from,1),i=e.mapPos(this.to,-1)),r==this.from&&i==this.to?this:new iu(r,i,this.flags)}extend(e,n=e,r=0){if(e<=this.anchor&&n>=this.anchor)return ze.range(e,n,void 0,void 0,r);let i=Math.abs(e-this.anchor)>Math.abs(n-this.anchor)?e:n;return ze.range(this.anchor,i,void 0,void 0,r)}eq(e,n=!1){return this.anchor==e.anchor&&this.head==e.head&&this.goalColumn==e.goalColumn&&(!n||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return ze.range(e.anchor,e.head)}static create(e,n,r){return new iu(e,n,r)}}class ze{constructor(e,n){this.ranges=e,this.mainIndex=n}map(e,n=-1){return e.empty?this:ze.create(this.ranges.map(r=>r.map(e,n)),this.mainIndex)}eq(e,n=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let r=0;r<this.ranges.length;r++)if(!this.ranges[r].eq(e.ranges[r],n))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new ze([this.main],0)}addRange(e,n=!0){return ze.create([e].concat(this.ranges),n?0:this.mainIndex+1)}replaceRange(e,n=this.mainIndex){let r=this.ranges.slice();return r[n]=e,ze.create(r,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new ze(e.ranges.map(n=>iu.fromJSON(n)),e.main)}static single(e,n=e){return new ze([ze.range(e,n)],0)}static create(e,n=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let r=0,i=0;i<e.length;i++){let s=e[i];if(s.empty?s.from<=r:s.from<r)return ze.normalized(e.slice(),n);r=s.to}return new ze(e,n)}static cursor(e,n=0,r,i){return iu.create(e,e,(n==0?0:n<0?8:16)|(r==null?7:Math.min(6,r))|(i??16777215)<<6)}static range(e,n,r,i,s){let a=(r??16777215)<<6|(i==null?7:Math.min(6,i));return!s&&e!=n&&(s=n<e?1:-1),n<e?iu.create(n,e,48|a):iu.create(e,n,(s?s<0?8:16:0)|a)}static normalized(e,n=0){let r=e[n];e.sort((i,s)=>i.from-s.from),n=e.indexOf(r);for(let i=1;i<e.length;i++){let s=e[i],a=e[i-1];if(s.empty?s.from<=a.to:s.from<a.to){let u=a.from,c=Math.max(s.to,a.to);i<=n&&n--,e.splice(--i,2,s.anchor>s.head?ze.range(c,u):ze.range(u,c))}}return new ze(e,n)}}function BL(t,e){for(let n of t.ranges)if(n.to>e)throw new RangeError("Selection points outside of document")}let Y1=0;class bt{constructor(e,n,r,i,s){this.combine=e,this.compareInput=n,this.compare=r,this.isStatic=i,this.id=Y1++,this.default=e([]),this.extensions=typeof s=="function"?s(this):s}get reader(){return this}static define(e={}){return new bt(e.combine||(n=>n),e.compareInput||((n,r)=>n===r),e.compare||(e.combine?(n,r)=>n===r:X1),!!e.static,e.enables)}of(e){return new Bg([],this,0,e)}compute(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new Bg(e,this,1,n)}computeN(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new Bg(e,this,2,n)}from(e,n){return n||(n=r=>r),this.compute([e],r=>n(r.field(e)))}}function X1(t,e){return t==e||t.length==e.length&&t.every((n,r)=>n===e[r])}class Bg{constructor(e,n,r,i){this.dependencies=e,this.facet=n,this.type=r,this.value=i,this.id=Y1++}dynamicSlot(e){var n;let r=this.value,i=this.facet.compareInput,s=this.id,a=e[s]>>1,u=this.type==2,c=!1,d=!1,h=[];for(let g of this.dependencies)g=="doc"?c=!0:g=="selection"?d=!0:(((n=e[g.id])!==null&&n!==void 0?n:1)&1)==0&&h.push(e[g.id]);return{create(g){return g.values[a]=r(g),1},update(g,m){if(c&&m.docChanged||d&&(m.docChanged||m.selection)||SS(g,h)){let y=r(g);if(u?!vk(y,g.values[a],i):!i(y,g.values[a]))return g.values[a]=y,1}return 0},reconfigure:(g,m)=>{let y,b=m.config.address[s];if(b!=null){let x=fm(m,b);if(this.dependencies.every(w=>w instanceof bt?m.facet(w)===g.facet(w):w instanceof Ta?m.field(w,!1)==g.field(w,!1):!0)||(u?vk(y=r(g),x,i):i(y=r(g),x)))return g.values[a]=x,0}else y=r(g);return g.values[a]=y,1}}}}function vk(t,e,n){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!n(t[r],e[r]))return!1;return!0}function SS(t,e){let n=!1;for(let r of e)bd(t,r)&1&&(n=!0);return n}function GX(t,e,n){let r=n.map(c=>t[c.id]),i=n.map(c=>c.type),s=r.filter(c=>!(c&1)),a=t[e.id]>>1;function u(c){let d=[];for(let h=0;h<r.length;h++){let g=fm(c,r[h]);if(i[h]==2)for(let m of g)d.push(m);else d.push(g)}return e.combine(d)}return{create(c){for(let d of r)bd(c,d);return c.values[a]=u(c),1},update(c,d){if(!SS(c,s))return 0;let h=u(c);return e.compare(h,c.values[a])?0:(c.values[a]=h,1)},reconfigure(c,d){let h=SS(c,r),g=d.config.facets[e.id],m=d.facet(e);if(g&&!h&&X1(n,g))return c.values[a]=m,0;let y=u(c);return e.compare(y,m)?(c.values[a]=m,0):(c.values[a]=y,1)}}}const ag=bt.define({static:!0});class Ta{constructor(e,n,r,i,s){this.id=e,this.createF=n,this.updateF=r,this.compareF=i,this.spec=s,this.provides=void 0}static define(e){let n=new Ta(Y1++,e.create,e.update,e.compare||((r,i)=>r===i),e);return e.provide&&(n.provides=e.provide(n)),n}create(e){let n=e.facet(ag).find(r=>r.field==this);return(n?.create||this.createF)(e)}slot(e){let n=e[this.id]>>1;return{create:r=>(r.values[n]=this.create(r),1),update:(r,i)=>{let s=r.values[n],a=this.updateF(s,i);return this.compareF(s,a)?0:(r.values[n]=a,1)},reconfigure:(r,i)=>{let s=r.facet(ag),a=i.facet(ag),u;return(u=s.find(c=>c.field==this))&&u!=a.find(c=>c.field==this)?(r.values[n]=u.create(r),1):i.config.address[this.id]!=null?(r.values[n]=i.field(this),0):(r.values[n]=this.create(r),1)}}}init(e){return[this,ag.of({field:this,create:e})]}get extension(){return this}}const Ja={lowest:4,low:3,default:2,high:1,highest:0};function Zf(t){return e=>new _L(e,t)}const jL={highest:Zf(Ja.highest),high:Zf(Ja.high),default:Zf(Ja.default),low:Zf(Ja.low),lowest:Zf(Ja.lowest)};class _L{constructor(e,n){this.inner=e,this.prec=n}}class gy{of(e){return new wS(this,e)}reconfigure(e){return gy.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class wS{constructor(e,n){this.compartment=e,this.inner=n}}class cm{constructor(e,n,r,i,s,a){for(this.base=e,this.compartments=n,this.dynamicSlots=r,this.address=i,this.staticValues=s,this.facets=a,this.statusTemplate=[];this.statusTemplate.length<r.length;)this.statusTemplate.push(0)}staticFacet(e){let n=this.address[e.id];return n==null?e.default:this.staticValues[n>>1]}static resolve(e,n,r){let i=[],s=Object.create(null),a=new Map;for(let m of WX(e,n,a))m instanceof Ta?i.push(m):(s[m.facet.id]||(s[m.facet.id]=[])).push(m);let u=Object.create(null),c=[],d=[];for(let m of i)u[m.id]=d.length<<1,d.push(y=>m.slot(y));let h=r?.config.facets;for(let m in s){let y=s[m],b=y[0].facet,x=h&&h[m]||[];if(y.every(w=>w.type==0))if(u[b.id]=c.length<<1|1,X1(x,y))c.push(r.facet(b));else{let w=b.combine(y.map(C=>C.value));c.push(r&&b.compare(w,r.facet(b))?r.facet(b):w)}else{for(let w of y)w.type==0?(u[w.id]=c.length<<1|1,c.push(w.value)):(u[w.id]=d.length<<1,d.push(C=>w.dynamicSlot(C)));u[b.id]=d.length<<1,d.push(w=>GX(w,b,y))}}let g=d.map(m=>m(u));return new cm(e,a,g,u,c,s)}}function WX(t,e,n){let r=[[],[],[],[],[]],i=new Map;function s(a,u){let c=i.get(a);if(c!=null){if(c<=u)return;let d=r[c].indexOf(a);d>-1&&r[c].splice(d,1),a instanceof wS&&n.delete(a.compartment)}if(i.set(a,u),Array.isArray(a))for(let d of a)s(d,u);else if(a instanceof wS){if(n.has(a.compartment))throw new RangeError("Duplicate use of compartment in extensions");let d=e.get(a.compartment)||a.inner;n.set(a.compartment,d),s(d,u)}else if(a instanceof _L)s(a.inner,a.prec);else if(a instanceof Ta)r[u].push(a),a.provides&&s(a.provides,u);else if(a instanceof Bg)r[u].push(a),a.facet.extensions&&s(a.facet.extensions,Ja.default);else{let d=a.extension;if(!d)throw new Error(`Unrecognized extension value in extension set (${a}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);s(d,u)}}return s(t,Ja.default),r.reduce((a,u)=>a.concat(u))}function bd(t,e){if(e&1)return 2;let n=e>>1,r=t.status[n];if(r==4)throw new Error("Cyclic dependency between fields and/or facets");if(r&2)return r;t.status[n]=4;let i=t.computeSlot(t,t.config.dynamicSlots[n]);return t.status[n]=2|i}function fm(t,e){return e&1?t.config.staticValues[e>>1]:t.values[e>>1]}const HL=bt.define(),CS=bt.define({combine:t=>t.some(e=>e),static:!0}),VL=bt.define({combine:t=>t.length?t[0]:void 0,static:!0}),FL=bt.define(),UL=bt.define(),$L=bt.define(),qL=bt.define({combine:t=>t.length?t[0]:!1});class Ea{constructor(e,n){this.type=e,this.value=n}static define(){return new KX}}class KX{of(e){return new Ea(this,e)}}class YX{constructor(e){this.map=e}of(e){return new sr(this,e)}}class sr{constructor(e,n){this.type=e,this.value=n}map(e){let n=this.type.map(this.value,e);return n===void 0?void 0:n==this.value?this:new sr(this.type,n)}is(e){return this.type==e}static define(e={}){return new YX(e.map||(n=>n))}static mapEffects(e,n){if(!e.length)return e;let r=[];for(let i of e){let s=i.map(n);s&&r.push(s)}return r}}sr.reconfigure=sr.define();sr.appendConfig=sr.define();class Rr{constructor(e,n,r,i,s,a){this.startState=e,this.changes=n,this.selection=r,this.effects=i,this.annotations=s,this.scrollIntoView=a,this._doc=null,this._state=null,r&&BL(r,n.newLength),s.some(u=>u.type==Rr.time)||(this.annotations=s.concat(Rr.time.of(Date.now())))}static create(e,n,r,i,s,a){return new Rr(e,n,r,i,s,a)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let n of this.annotations)if(n.type==e)return n.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let n=this.annotation(Rr.userEvent);return!!(n&&(n==e||n.length>e.length&&n.slice(0,e.length)==e&&n[e.length]=="."))}}Rr.time=Ea.define();Rr.userEvent=Ea.define();Rr.addToHistory=Ea.define();Rr.remote=Ea.define();function XX(t,e){let n=[];for(let r=0,i=0;;){let s,a;if(r<t.length&&(i==e.length||e[i]>=t[r]))s=t[r++],a=t[r++];else if(i<e.length)s=e[i++],a=e[i++];else return n;!n.length||n[n.length-1]<s?n.push(s,a):n[n.length-1]<a&&(n[n.length-1]=a)}}function GL(t,e,n){var r;let i,s,a;return n?(i=e.changes,s=wr.empty(e.changes.length),a=t.changes.compose(e.changes)):(i=e.changes.map(t.changes),s=t.changes.mapDesc(e.changes,!0),a=t.changes.compose(i)),{changes:a,selection:e.selection?e.selection.map(s):(r=t.selection)===null||r===void 0?void 0:r.map(i),effects:sr.mapEffects(t.effects,i).concat(sr.mapEffects(e.effects,s)),annotations:t.annotations.length?t.annotations.concat(e.annotations):e.annotations,scrollIntoView:t.scrollIntoView||e.scrollIntoView}}function RS(t,e,n){let r=e.selection,i=wc(e.annotations);return e.userEvent&&(i=i.concat(Rr.userEvent.of(e.userEvent))),{changes:e.changes instanceof wr?e.changes:wr.of(e.changes||[],n,t.facet(VL)),selection:r&&(r instanceof ze?r:ze.single(r.anchor,r.head)),effects:wc(e.effects),annotations:i,scrollIntoView:!!e.scrollIntoView}}function WL(t,e,n){let r=RS(t,e.length?e[0]:{},t.doc.length);e.length&&e[0].filter===!1&&(n=!1);for(let s=1;s<e.length;s++){e[s].filter===!1&&(n=!1);let a=!!e[s].sequential;r=GL(r,RS(t,e[s],a?r.changes.newLength:t.doc.length),a)}let i=Rr.create(t,r.changes,r.selection,r.effects,r.annotations,r.scrollIntoView);return ZX(n?QX(i):i)}function QX(t){let e=t.startState,n=!0;for(let i of e.facet(FL)){let s=i(t);if(s===!1){n=!1;break}Array.isArray(s)&&(n=n===!0?s:XX(n,s))}if(n!==!0){let i,s;if(n===!1)s=t.changes.invertedDesc,i=wr.empty(e.doc.length);else{let a=t.changes.filter(n);i=a.changes,s=a.filtered.mapDesc(a.changes).invertedDesc}t=Rr.create(e,i,t.selection&&t.selection.map(s),sr.mapEffects(t.effects,s),t.annotations,t.scrollIntoView)}let r=e.facet(UL);for(let i=r.length-1;i>=0;i--){let s=r[i](t);s instanceof Rr?t=s:Array.isArray(s)&&s.length==1&&s[0]instanceof Rr?t=s[0]:t=WL(e,wc(s),!1)}return t}function ZX(t){let e=t.startState,n=e.facet($L),r=t;for(let i=n.length-1;i>=0;i--){let s=n[i](t);s&&Object.keys(s).length&&(r=GL(r,RS(e,s,t.changes.newLength),!0))}return r==t?t:Rr.create(e,t.changes,t.selection,r.effects,r.annotations,r.scrollIntoView)}const JX=[];function wc(t){return t==null?JX:Array.isArray(t)?t:[t]}var tl=(function(t){return t[t.Word=0]="Word",t[t.Space=1]="Space",t[t.Other=2]="Other",t})(tl||(tl={}));const eQ=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let TS;try{TS=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function tQ(t){if(TS)return TS.test(t);for(let e=0;e<t.length;e++){let n=t[e];if(/\w/.test(n)||n>""&&(n.toUpperCase()!=n.toLowerCase()||eQ.test(n)))return!0}return!1}function nQ(t){return e=>{if(!/\S/.test(e))return tl.Space;if(tQ(e))return tl.Word;for(let n=0;n<t.length;n++)if(e.indexOf(t[n])>-1)return tl.Word;return tl.Other}}class an{constructor(e,n,r,i,s,a){this.config=e,this.doc=n,this.selection=r,this.values=i,this.status=e.statusTemplate.slice(),this.computeSlot=s,a&&(a._state=this);for(let u=0;u<this.config.dynamicSlots.length;u++)bd(this,u<<1);this.computeSlot=null}field(e,n=!0){let r=this.config.address[e.id];if(r==null){if(n)throw new RangeError("Field is not present in this state");return}return bd(this,r),fm(this,r)}update(...e){return WL(this,e,!0)}applyTransaction(e){let n=this.config,{base:r,compartments:i}=n;for(let u of e.effects)u.is(gy.reconfigure)?(n&&(i=new Map,n.compartments.forEach((c,d)=>i.set(d,c)),n=null),i.set(u.value.compartment,u.value.extension)):u.is(sr.reconfigure)?(n=null,r=u.value):u.is(sr.appendConfig)&&(n=null,r=wc(r).concat(u.value));let s;n?s=e.startState.values.slice():(n=cm.resolve(r,i,this),s=new an(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(c,d)=>d.reconfigure(c,this),null).values);let a=e.startState.facet(CS)?e.newSelection:e.newSelection.asSingle();new an(n,e.newDoc,a,s,(u,c)=>c.update(u,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:e},range:ze.cursor(n.from+e.length)}))}changeByRange(e){let n=this.selection,r=e(n.ranges[0]),i=this.changes(r.changes),s=[r.range],a=wc(r.effects);for(let u=1;u<n.ranges.length;u++){let c=e(n.ranges[u]),d=this.changes(c.changes),h=d.map(i);for(let m=0;m<u;m++)s[m]=s[m].map(h);let g=i.mapDesc(d,!0);s.push(c.range.map(g)),i=i.compose(h),a=sr.mapEffects(a,h).concat(sr.mapEffects(wc(c.effects),g))}return{changes:i,selection:ze.create(s,n.mainIndex),effects:a}}changes(e=[]){return e instanceof wr?e:wr.of(e,this.doc.length,this.facet(an.lineSeparator))}toText(e){return Yt.of(e.split(this.facet(an.lineSeparator)||vS))}sliceDoc(e=0,n=this.doc.length){return this.doc.sliceString(e,n,this.lineBreak)}facet(e){let n=this.config.address[e.id];return n==null?e.default:(bd(this,n),fm(this,n))}toJSON(e){let n={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let r in e){let i=e[r];i instanceof Ta&&this.config.address[i.id]!=null&&(n[r]=i.spec.toJSON(this.field(e[r]),this))}return n}static fromJSON(e,n={},r){if(!e||typeof e.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let i=[];if(r){for(let s in r)if(Object.prototype.hasOwnProperty.call(e,s)){let a=r[s],u=e[s];i.push(a.init(c=>a.spec.fromJSON(u,c)))}}return an.create({doc:e.doc,selection:ze.fromJSON(e.selection),extensions:n.extensions?i.concat([n.extensions]):i})}static create(e={}){let n=cm.resolve(e.extensions||[],new Map),r=e.doc instanceof Yt?e.doc:Yt.of((e.doc||"").split(n.staticFacet(an.lineSeparator)||vS)),i=e.selection?e.selection instanceof ze?e.selection:ze.single(e.selection.anchor,e.selection.head):ze.single(0);return BL(i,r.length),n.staticFacet(CS)||(i=i.asSingle()),new an(n,r,i,n.dynamicSlots.map(()=>null),(s,a)=>a.create(s),null)}get tabSize(){return this.facet(an.tabSize)}get lineBreak(){return this.facet(an.lineSeparator)||`
|
|
25
|
+
`}get readOnly(){return this.facet(qL)}phrase(e,...n){for(let r of this.facet(an.phrases))if(Object.prototype.hasOwnProperty.call(r,e)){e=r[e];break}return n.length&&(e=e.replace(/\$(\$|\d*)/g,(r,i)=>{if(i=="$")return"$";let s=+(i||1);return!s||s>n.length?r:n[s-1]})),e}languageDataAt(e,n,r=-1){let i=[];for(let s of this.facet(HL))for(let a of s(this,n,r))Object.prototype.hasOwnProperty.call(a,e)&&i.push(a[e]);return i}charCategorizer(e){let n=this.languageDataAt("wordChars",e);return nQ(n.length?n[0]:"")}wordAt(e){let{text:n,from:r,length:i}=this.doc.lineAt(e),s=this.charCategorizer(e),a=e-r,u=e-r;for(;a>0;){let c=Qr(n,a,!1);if(s(n.slice(c,a))!=tl.Word)break;a=c}for(;u<i;){let c=Qr(n,u);if(s(n.slice(u,c))!=tl.Word)break;u=c}return a==u?null:ze.range(a+r,u+r)}}an.allowMultipleSelections=CS;an.tabSize=bt.define({combine:t=>t.length?t[0]:4});an.lineSeparator=VL;an.readOnly=qL;an.phrases=bt.define({compare(t,e){let n=Object.keys(t),r=Object.keys(e);return n.length==r.length&&n.every(i=>t[i]==e[i])}});an.languageData=HL;an.changeFilter=FL;an.transactionFilter=UL;an.transactionExtender=$L;gy.reconfigure=sr.define();function rQ(t,e,n={}){let r={};for(let i of t)for(let s of Object.keys(i)){let a=i[s],u=r[s];if(u===void 0)r[s]=a;else if(!(u===a||a===void 0))if(Object.hasOwnProperty.call(n,s))r[s]=n[s](u,a);else throw new Error("Config merge conflict for field "+s)}for(let i in e)r[i]===void 0&&(r[i]=e[i]);return r}class yu{eq(e){return this==e}range(e,n=e){return ES.create(e,n,this)}}yu.prototype.startSide=yu.prototype.endSide=0;yu.prototype.point=!1;yu.prototype.mapMode=Li.TrackDel;function Q1(t,e){return t==e||t.constructor==e.constructor&&t.eq(e)}let ES=class KL{constructor(e,n,r){this.from=e,this.to=n,this.value=r}static create(e,n,r){return new KL(e,n,r)}};function MS(t,e){return t.from-e.from||t.value.startSide-e.value.startSide}class Z1{constructor(e,n,r,i){this.from=e,this.to=n,this.value=r,this.maxPoint=i}get length(){return this.to[this.to.length-1]}findIndex(e,n,r,i=0){let s=r?this.to:this.from;for(let a=i,u=s.length;;){if(a==u)return a;let c=a+u>>1,d=s[c]-e||(r?this.value[c].endSide:this.value[c].startSide)-n;if(c==a)return d>=0?a:u;d>=0?u=c:a=c+1}}between(e,n,r,i){for(let s=this.findIndex(n,-1e9,!0),a=this.findIndex(r,1e9,!1,s);s<a;s++)if(i(this.from[s]+e,this.to[s]+e,this.value[s])===!1)return!1}map(e,n){let r=[],i=[],s=[],a=-1,u=-1;for(let c=0;c<this.value.length;c++){let d=this.value[c],h=this.from[c]+e,g=this.to[c]+e,m,y;if(h==g){let b=n.mapPos(h,d.startSide,d.mapMode);if(b==null||(m=y=b,d.startSide!=d.endSide&&(y=n.mapPos(h,d.endSide),y<m)))continue}else if(m=n.mapPos(h,d.startSide),y=n.mapPos(g,d.endSide),m>y||m==y&&d.startSide>0&&d.endSide<=0)continue;(y-m||d.endSide-d.startSide)<0||(a<0&&(a=m),d.point&&(u=Math.max(u,y-m)),r.push(d),i.push(m-a),s.push(y-a))}return{mapped:r.length?new Z1(i,s,r,u):null,pos:a}}}class pn{constructor(e,n,r,i){this.chunkPos=e,this.chunk=n,this.nextLayer=r,this.maxPoint=i}static create(e,n,r,i){return new pn(e,n,r,i)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let n of this.chunk)e+=n.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:n=[],sort:r=!1,filterFrom:i=0,filterTo:s=this.length}=e,a=e.filter;if(n.length==0&&!a)return this;if(r&&(n=n.slice().sort(MS)),this.isEmpty)return n.length?pn.of(n):this;let u=new YL(this,null,-1).goto(0),c=0,d=[],h=new dm;for(;u.value||c<n.length;)if(c<n.length&&(u.from-n[c].from||u.startSide-n[c].value.startSide)>=0){let g=n[c++];h.addInner(g.from,g.to,g.value)||d.push(g)}else u.rangeIndex==1&&u.chunkIndex<this.chunk.length&&(c==n.length||this.chunkEnd(u.chunkIndex)<n[c].from)&&(!a||i>this.chunkEnd(u.chunkIndex)||s<this.chunkPos[u.chunkIndex])&&h.addChunk(this.chunkPos[u.chunkIndex],this.chunk[u.chunkIndex])?u.nextChunk():((!a||i>u.to||s<u.from||a(u.from,u.to,u.value))&&(h.addInner(u.from,u.to,u.value)||d.push(ES.create(u.from,u.to,u.value))),u.next());return h.finishInner(this.nextLayer.isEmpty&&!d.length?pn.empty:this.nextLayer.update({add:d,filter:a,filterFrom:i,filterTo:s}))}map(e){if(e.empty||this.isEmpty)return this;let n=[],r=[],i=-1;for(let a=0;a<this.chunk.length;a++){let u=this.chunkPos[a],c=this.chunk[a],d=e.touchesRange(u,u+c.length);if(d===!1)i=Math.max(i,c.maxPoint),n.push(c),r.push(e.mapPos(u));else if(d===!0){let{mapped:h,pos:g}=c.map(u,e);h&&(i=Math.max(i,h.maxPoint),n.push(h),r.push(g))}}let s=this.nextLayer.map(e);return n.length==0?s:new pn(r,n,s||pn.empty,i)}between(e,n,r){if(!this.isEmpty){for(let i=0;i<this.chunk.length;i++){let s=this.chunkPos[i],a=this.chunk[i];if(n>=s&&e<=s+a.length&&a.between(s,e-s,n-s,r)===!1)return}this.nextLayer.between(e,n,r)}}iter(e=0){return qd.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,n=0){return qd.from(e).goto(n)}static compare(e,n,r,i,s=-1){let a=e.filter(g=>g.maxPoint>0||!g.isEmpty&&g.maxPoint>=s),u=n.filter(g=>g.maxPoint>0||!g.isEmpty&&g.maxPoint>=s),c=bk(a,u,r),d=new Jf(a,c,s),h=new Jf(u,c,s);r.iterGaps((g,m,y)=>xk(d,g,h,m,y,i)),r.empty&&r.length==0&&xk(d,0,h,0,0,i)}static eq(e,n,r=0,i){i==null&&(i=999999999);let s=e.filter(h=>!h.isEmpty&&n.indexOf(h)<0),a=n.filter(h=>!h.isEmpty&&e.indexOf(h)<0);if(s.length!=a.length)return!1;if(!s.length)return!0;let u=bk(s,a),c=new Jf(s,u,0).goto(r),d=new Jf(a,u,0).goto(r);for(;;){if(c.to!=d.to||!AS(c.active,d.active)||c.point&&(!d.point||!Q1(c.point,d.point)))return!1;if(c.to>i)return!0;c.next(),d.next()}}static spans(e,n,r,i,s=-1){let a=new Jf(e,null,s).goto(n),u=n,c=a.openStart;for(;;){let d=Math.min(a.to,r);if(a.point){let h=a.activeForPoint(a.to),g=a.pointFrom<n?h.length+1:a.point.startSide<0?h.length:Math.min(h.length,c);i.point(u,d,a.point,h,g,a.pointRank),c=Math.min(a.openEnd(d),h.length)}else d>u&&(i.span(u,d,a.active,c),c=a.openEnd(d));if(a.to>r)return c+(a.point&&a.to>r?1:0);u=a.to,a.next()}}static of(e,n=!1){let r=new dm;for(let i of e instanceof ES?[e]:n?iQ(e):e)r.add(i.from,i.to,i.value);return r.finish()}static join(e){if(!e.length)return pn.empty;let n=e[e.length-1];for(let r=e.length-2;r>=0;r--)for(let i=e[r];i!=pn.empty;i=i.nextLayer)n=new pn(i.chunkPos,i.chunk,n,Math.max(i.maxPoint,n.maxPoint));return n}}pn.empty=new pn([],[],null,-1);function iQ(t){if(t.length>1)for(let e=t[0],n=1;n<t.length;n++){let r=t[n];if(MS(e,r)>0)return t.slice().sort(MS);e=r}return t}pn.empty.nextLayer=pn.empty;class dm{finishChunk(e){this.chunks.push(new Z1(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,n,r){this.addInner(e,n,r)||(this.nextLayer||(this.nextLayer=new dm)).add(e,n,r)}addInner(e,n,r){let i=e-this.lastTo||r.startSide-this.last.endSide;if(i<=0&&(e-this.lastFrom||r.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return i<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(n-this.chunkStart),this.last=r,this.lastFrom=e,this.lastTo=n,this.value.push(r),r.point&&(this.maxPoint=Math.max(this.maxPoint,n-e)),!0)}addChunk(e,n){if((e-this.lastTo||n.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,n.maxPoint),this.chunks.push(n),this.chunkPos.push(e);let r=n.value.length-1;return this.last=n.value[r],this.lastFrom=n.from[r]+e,this.lastTo=n.to[r]+e,!0}finish(){return this.finishInner(pn.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let n=pn.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,n}}function bk(t,e,n){let r=new Map;for(let s of t)for(let a=0;a<s.chunk.length;a++)s.chunk[a].maxPoint<=0&&r.set(s.chunk[a],s.chunkPos[a]);let i=new Set;for(let s of e)for(let a=0;a<s.chunk.length;a++){let u=r.get(s.chunk[a]);u!=null&&(n?n.mapPos(u):u)==s.chunkPos[a]&&!n?.touchesRange(u,u+s.chunk[a].length)&&i.add(s.chunk[a])}return i}class YL{constructor(e,n,r,i=0){this.layer=e,this.skip=n,this.minPoint=r,this.rank=i}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(e,n=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,n,!1),this}gotoInner(e,n,r){for(;this.chunkIndex<this.layer.chunk.length;){let i=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(i)||this.layer.chunkEnd(this.chunkIndex)<e||i.maxPoint<this.minPoint))break;this.chunkIndex++,r=!1}if(this.chunkIndex<this.layer.chunk.length){let i=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],n,!0);(!r||this.rangeIndex<i)&&this.setRangeIndex(i)}this.next()}forward(e,n){(this.to-e||this.endSide-n)<0&&this.gotoInner(e,n,!0)}next(){for(;;)if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}else{let e=this.layer.chunkPos[this.chunkIndex],n=this.layer.chunk[this.chunkIndex],r=e+n.from[this.rangeIndex];if(this.from=r,this.to=e+n.to[this.rangeIndex],this.value=n.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=e}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(e){return this.from-e.from||this.startSide-e.startSide||this.rank-e.rank||this.to-e.to||this.endSide-e.endSide}}class qd{constructor(e){this.heap=e}static from(e,n=null,r=-1){let i=[];for(let s=0;s<e.length;s++)for(let a=e[s];!a.isEmpty;a=a.nextLayer)a.maxPoint>=r&&i.push(new YL(a,n,r,s));return i.length==1?i[0]:new qd(i)}get startSide(){return this.value?this.value.startSide:0}goto(e,n=-1e9){for(let r of this.heap)r.goto(e,n);for(let r=this.heap.length>>1;r>=0;r--)Bb(this.heap,r);return this.next(),this}forward(e,n){for(let r of this.heap)r.forward(e,n);for(let r=this.heap.length>>1;r>=0;r--)Bb(this.heap,r);(this.to-e||this.value.endSide-n)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),Bb(this.heap,0)}}}function Bb(t,e){for(let n=t[e];;){let r=(e<<1)+1;if(r>=t.length)break;let i=t[r];if(r+1<t.length&&i.compare(t[r+1])>=0&&(i=t[r+1],r++),n.compare(i)<0)break;t[r]=n,t[e]=i,e=r}}class Jf{constructor(e,n,r){this.minPoint=r,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=qd.from(e,n,r)}goto(e,n=-1e9){return this.cursor.goto(e,n),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=n,this.openStart=-1,this.next(),this}forward(e,n){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-n)<0;)this.removeActive(this.minActive);this.cursor.forward(e,n)}removeActive(e){ug(this.active,e),ug(this.activeTo,e),ug(this.activeRank,e),this.minActive=Sk(this.active,this.activeTo)}addActive(e){let n=0,{value:r,to:i,rank:s}=this.cursor;for(;n<this.activeRank.length&&(s-this.activeRank[n]||i-this.activeTo[n])>0;)n++;cg(this.active,n,r),cg(this.activeTo,n,i),cg(this.activeRank,n,s),e&&cg(e,n,this.cursor.from),this.minActive=Sk(this.active,this.activeTo)}next(){let e=this.to,n=this.point;this.point=null;let r=this.openStart<0?[]:null;for(;;){let i=this.minActive;if(i>-1&&(this.activeTo[i]-this.cursor.from||this.active[i].endSide-this.cursor.startSide)<0){if(this.activeTo[i]>e){this.to=this.activeTo[i],this.endSide=this.active[i].endSide;break}this.removeActive(i),r&&ug(r,i)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let s=this.cursor.value;if(!s.point)this.addActive(r),this.cursor.next();else if(n&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=s,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=s.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}}else{this.to=this.endSide=1e9;break}}if(r){this.openStart=0;for(let i=r.length-1;i>=0&&r[i]<e;i--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let n=[];for(let r=this.active.length-1;r>=0&&!(this.activeRank[r]<this.pointRank);r--)(this.activeTo[r]>e||this.activeTo[r]==e&&this.active[r].endSide>=this.point.endSide)&&n.push(this.active[r]);return n.reverse()}openEnd(e){let n=0;for(let r=this.activeTo.length-1;r>=0&&this.activeTo[r]>e;r--)n++;return n}}function xk(t,e,n,r,i,s){t.goto(e),n.goto(r);let a=r+i,u=r,c=r-e,d=!!s.boundChange;for(let h=!1;;){let g=t.to+c-n.to,m=g||t.endSide-n.endSide,y=m<0?t.to+c:n.to,b=Math.min(y,a);if(t.point||n.point?(t.point&&n.point&&Q1(t.point,n.point)&&AS(t.activeForPoint(t.to),n.activeForPoint(n.to))||s.comparePoint(u,b,t.point,n.point),h=!1):(h&&s.boundChange(u),b>u&&!AS(t.active,n.active)&&s.compareRange(u,b,t.active,n.active),d&&b<a&&(g||t.openEnd(y)!=n.openEnd(y))&&(h=!0)),y>a)break;u=y,m<=0&&t.next(),m>=0&&n.next()}}function AS(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!=e[n]&&!Q1(t[n],e[n]))return!1;return!0}function ug(t,e){for(let n=e,r=t.length-1;n<r;n++)t[n]=t[n+1];t.pop()}function cg(t,e,n){for(let r=t.length-1;r>=e;r--)t[r+1]=t[r];t[e]=n}function Sk(t,e){let n=-1,r=1e9;for(let i=0;i<e.length;i++)(e[i]-r||t[i].endSide-t[n].endSide)<0&&(n=i,r=e[i]);return n}function my(t,e,n=t.length){let r=0;for(let i=0;i<n&&i<t.length;)t.charCodeAt(i)==9?(r+=e-r%e,i++):(r++,i=Qr(t,i));return r}function oQ(t,e,n,r){for(let i=0,s=0;;){if(s>=e)return i;if(i==t.length)break;s+=t.charCodeAt(i)==9?n-s%n:1,i=Qr(t,i)}return t.length}const OS="ͼ",wk=typeof Symbol>"u"?"__"+OS:Symbol.for(OS),kS=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),Ck=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class Nc{constructor(e,n){this.rules=[];let{finish:r}=n||{};function i(a){return/^@/.test(a)?[a]:a.split(/,\s*/)}function s(a,u,c,d){let h=[],g=/^@(\w+)\b/.exec(a[0]),m=g&&g[1]=="keyframes";if(g&&u==null)return c.push(a[0]+";");for(let y in u){let b=u[y];if(/&/.test(y))s(y.split(/,\s*/).map(x=>a.map(w=>x.replace(/&/,w))).reduce((x,w)=>x.concat(w)),b,c);else if(b&&typeof b=="object"){if(!g)throw new RangeError("The value of a property ("+y+") should be a primitive value.");s(i(y),b,h,m)}else b!=null&&h.push(y.replace(/_.*/,"").replace(/[A-Z]/g,x=>"-"+x.toLowerCase())+": "+b+";")}(h.length||m)&&c.push((r&&!g&&!d?a.map(r):a).join(", ")+" {"+h.join(" ")+"}")}for(let a in e)s(i(a),e[a],this.rules)}getRules(){return this.rules.join(`
|
|
26
|
+
`)}static newName(){let e=Ck[wk]||1;return Ck[wk]=e+1,OS+e.toString(36)}static mount(e,n,r){let i=e[kS],s=r&&r.nonce;i?s&&i.setNonce(s):i=new sQ(e,s),i.mount(Array.isArray(n)?n:[n],e)}}let Rk=new Map;class sQ{constructor(e,n){let r=e.ownerDocument||e,i=r.defaultView;if(!e.head&&e.adoptedStyleSheets&&i.CSSStyleSheet){let s=Rk.get(r);if(s)return e[kS]=s;this.sheet=new i.CSSStyleSheet,Rk.set(r,this)}else this.styleTag=r.createElement("style"),n&&this.styleTag.setAttribute("nonce",n);this.modules=[],e[kS]=this}mount(e,n){let r=this.sheet,i=0,s=0;for(let a=0;a<e.length;a++){let u=e[a],c=this.modules.indexOf(u);if(c<s&&c>-1&&(this.modules.splice(c,1),s--,c=-1),c==-1){if(this.modules.splice(s++,0,u),r)for(let d=0;d<u.rules.length;d++)r.insertRule(u.rules[d],i++)}else{for(;s<c;)i+=this.modules[s++].rules.length;i+=u.rules.length,s++}}if(r)n.adoptedStyleSheets.indexOf(this.sheet)<0&&(n.adoptedStyleSheets=[this.sheet,...n.adoptedStyleSheets]);else{let a="";for(let c=0;c<this.modules.length;c++)a+=this.modules[c].getRules()+`
|
|
27
|
+
`;this.styleTag.textContent=a;let u=n.head||n;this.styleTag.parentNode!=u&&u.insertBefore(this.styleTag,u.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}}var ga={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},Gd={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},lQ=typeof navigator<"u"&&/Mac/.test(navigator.platform),aQ=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Br=0;Br<10;Br++)ga[48+Br]=ga[96+Br]=String(Br);for(var Br=1;Br<=24;Br++)ga[Br+111]="F"+Br;for(var Br=65;Br<=90;Br++)ga[Br]=String.fromCharCode(Br+32),Gd[Br]=String.fromCharCode(Br);for(var jb in ga)Gd.hasOwnProperty(jb)||(Gd[jb]=ga[jb]);function uQ(t){var e=lQ&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||aQ&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?Gd:ga)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}let oi=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},IS=typeof document<"u"?document:{documentElement:{style:{}}};const DS=/Edge\/(\d+)/.exec(oi.userAgent),XL=/MSIE \d/.test(oi.userAgent),PS=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(oi.userAgent),yy=!!(XL||PS||DS),Tk=!yy&&/gecko\/(\d+)/i.test(oi.userAgent),_b=!yy&&/Chrome\/(\d+)/.exec(oi.userAgent),cQ="webkitFontSmoothing"in IS.documentElement.style,zS=!yy&&/Apple Computer/.test(oi.vendor),Ek=zS&&(/Mobile\/\w+/.test(oi.userAgent)||oi.maxTouchPoints>2);var Ye={mac:Ek||/Mac/.test(oi.platform),windows:/Win/.test(oi.platform),linux:/Linux|X11/.test(oi.platform),ie:yy,ie_version:XL?IS.documentMode||6:PS?+PS[1]:DS?+DS[1]:0,gecko:Tk,gecko_version:Tk?+(/Firefox\/(\d+)/.exec(oi.userAgent)||[0,0])[1]:0,chrome:!!_b,chrome_version:_b?+_b[1]:0,ios:Ek,android:/Android\b/.test(oi.userAgent),webkit_version:cQ?+(/\bAppleWebKit\/(\d+)/.exec(oi.userAgent)||[0,0])[1]:0,safari:zS,safari_version:zS?+(/\bVersion\/(\d+(\.\d+)?)/.exec(oi.userAgent)||[0,0])[1]:0,tabSize:IS.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function J1(t,e){for(let n in t)n=="class"&&e.class?e.class+=" "+t.class:n=="style"&&e.style?e.style+=";"+t.style:e[n]=t[n];return e}const hm=Object.create(null);function eC(t,e,n){if(t==e)return!0;t||(t=hm),e||(e=hm);let r=Object.keys(t),i=Object.keys(e);if(r.length-0!=i.length-0)return!1;for(let s of r)if(s!=n&&(i.indexOf(s)==-1||t[s]!==e[s]))return!1;return!0}function fQ(t,e){for(let n=t.attributes.length-1;n>=0;n--){let r=t.attributes[n].name;e[r]==null&&t.removeAttribute(r)}for(let n in e){let r=e[n];n=="style"?t.style.cssText=r:t.getAttribute(n)!=r&&t.setAttribute(n,r)}}function Mk(t,e,n){let r=!1;if(e)for(let i in e)n&&i in n||(r=!0,i=="style"?t.style.cssText="":t.removeAttribute(i));if(n)for(let i in n)e&&e[i]==n[i]||(r=!0,i=="style"?t.style.cssText=n[i]:t.setAttribute(i,n[i]));return r}function dQ(t){let e=Object.create(null);for(let n=0;n<t.attributes.length;n++){let r=t.attributes[n];e[r.name]=r.value}return e}class vy{eq(e){return!1}updateDOM(e,n,r){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,n,r){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}}var fo=(function(t){return t[t.Text=0]="Text",t[t.WidgetBefore=1]="WidgetBefore",t[t.WidgetAfter=2]="WidgetAfter",t[t.WidgetRange=3]="WidgetRange",t})(fo||(fo={}));class Jr extends yu{constructor(e,n,r,i){super(),this.startSide=e,this.endSide=n,this.widget=r,this.spec=i}get heightRelevant(){return!1}static mark(e){return new gh(e)}static widget(e){let n=Math.max(-1e4,Math.min(1e4,e.side||0)),r=!!e.block;return n+=r&&!e.inlineOrder?n>0?3e8:-4e8:n>0?1e8:-1e8,new vu(e,n,n,r,e.widget||null,!1)}static replace(e){let n=!!e.block,r,i;if(e.isBlockGap)r=-5e8,i=4e8;else{let{start:s,end:a}=QL(e,n);r=(s?n?-3e8:-1:5e8)-1,i=(a?n?2e8:1:-6e8)+1}return new vu(e,r,i,n,e.widget||null,!0)}static line(e){return new mh(e)}static set(e,n=!1){return pn.of(e,n)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}Jr.none=pn.empty;class gh extends Jr{constructor(e){let{start:n,end:r}=QL(e);super(n?-1:5e8,r?1:-6e8,null,e),this.tagName=e.tagName||"span",this.attrs=e.class&&e.attributes?J1(e.attributes,{class:e.class}):e.class?{class:e.class}:e.attributes||hm}eq(e){return this==e||e instanceof gh&&this.tagName==e.tagName&&eC(this.attrs,e.attrs)}range(e,n=e){if(e>=n)throw new RangeError("Mark decorations may not be empty");return super.range(e,n)}}gh.prototype.point=!1;class mh extends Jr{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof mh&&this.spec.class==e.spec.class&&eC(this.spec.attributes,e.spec.attributes)}range(e,n=e){if(n!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,n)}}mh.prototype.mapMode=Li.TrackBefore;mh.prototype.point=!0;class vu extends Jr{constructor(e,n,r,i,s,a){super(n,r,s,e),this.block=i,this.isReplace=a,this.mapMode=i?n<=0?Li.TrackBefore:Li.TrackAfter:Li.TrackDel}get type(){return this.startSide!=this.endSide?fo.WidgetRange:this.startSide<=0?fo.WidgetBefore:fo.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof vu&&hQ(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,n=e){if(this.isReplace&&(e>n||e==n&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&n!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,n)}}vu.prototype.point=!0;function QL(t,e=!1){let{inclusiveStart:n,inclusiveEnd:r}=t;return n==null&&(n=t.inclusive),r==null&&(r=t.inclusive),{start:n??e,end:r??e}}function hQ(t,e){return t==e||!!(t&&e&&t.compare(e))}function Cc(t,e,n,r=0){let i=n.length-1;i>=0&&n[i]+r>=t?n[i]=Math.max(n[i],e):n.push(t,e)}class Wd extends yu{constructor(e,n){super(),this.tagName=e,this.attributes=n}eq(e){return e==this||e instanceof Wd&&this.tagName==e.tagName&&eC(this.attributes,e.attributes)}static create(e){return new Wd(e.tagName,e.attributes||hm)}static set(e,n=!1){return pn.of(e,n)}}Wd.prototype.startSide=Wd.prototype.endSide=-1;function Kd(t){let e;return t.nodeType==11?e=t.getSelection?t:t.ownerDocument:e=t,e.getSelection()}function NS(t,e){return e?t==e||t.contains(e.nodeType!=1?e.parentNode:e):!1}function xd(t,e){if(!e.anchorNode)return!1;try{return NS(t,e.anchorNode)}catch{return!1}}function jg(t){return t.nodeType==3?Yd(t,0,t.nodeValue.length).getClientRects():t.nodeType==1?t.getClientRects():[]}function Sd(t,e,n,r){return n?Ak(t,e,n,r,-1)||Ak(t,e,n,r,1):!1}function ma(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e}function pm(t){return t.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(t.nodeName)}function Ak(t,e,n,r,i){for(;;){if(t==n&&e==r)return!0;if(e==(i<0?0:ul(t))){if(t.nodeName=="DIV")return!1;let s=t.parentNode;if(!s||s.nodeType!=1)return!1;e=ma(t)+(i<0?0:1),t=s}else if(t.nodeType==1){if(t=t.childNodes[e+(i<0?-1:0)],t.nodeType==1&&t.contentEditable=="false")return!1;e=i<0?ul(t):0}else return!1}}function ul(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function gm(t,e){let n=e?t.left:t.right;return{left:n,right:n,top:t.top,bottom:t.bottom}}function pQ(t){let e=t.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.innerWidth,top:0,bottom:t.innerHeight}}function ZL(t,e){let n=e.width/t.offsetWidth,r=e.height/t.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||Math.abs(e.width-t.offsetWidth)<1)&&(n=1),(r>.995&&r<1.005||!isFinite(r)||Math.abs(e.height-t.offsetHeight)<1)&&(r=1),{scaleX:n,scaleY:r}}function gQ(t,e,n,r,i,s,a,u){let c=t.ownerDocument,d=c.defaultView||window;for(let h=t,g=!1;h&&!g;)if(h.nodeType==1){let m,y=h==c.body,b=1,x=1;if(y)m=pQ(d);else{if(/^(fixed|sticky)$/.test(getComputedStyle(h).position)&&(g=!0),h.scrollHeight<=h.clientHeight&&h.scrollWidth<=h.clientWidth){h=h.assignedSlot||h.parentNode;continue}let T=h.getBoundingClientRect();({scaleX:b,scaleY:x}=ZL(h,T)),m={left:T.left,right:T.left+h.clientWidth*b,top:T.top,bottom:T.top+h.clientHeight*x}}let w=0,C=0;if(i=="nearest")e.top<m.top?(C=e.top-(m.top+a),n>0&&e.bottom>m.bottom+C&&(C=e.bottom-m.bottom+a)):e.bottom>m.bottom&&(C=e.bottom-m.bottom+a,n<0&&e.top-C<m.top&&(C=e.top-(m.top+a)));else{let T=e.bottom-e.top,E=m.bottom-m.top;C=(i=="center"&&T<=E?e.top+T/2-E/2:i=="start"||i=="center"&&n<0?e.top-a:e.bottom-E+a)-m.top}if(r=="nearest"?e.left<m.left?(w=e.left-(m.left+s),n>0&&e.right>m.right+w&&(w=e.right-m.right+s)):e.right>m.right&&(w=e.right-m.right+s,n<0&&e.left<m.left+w&&(w=e.left-(m.left+s))):w=(r=="center"?e.left+(e.right-e.left)/2-(m.right-m.left)/2:r=="start"==u?e.left-s:e.right-(m.right-m.left)+s)-m.left,w||C)if(y)d.scrollBy(w,C);else{let T=0,E=0;if(C){let M=h.scrollTop;h.scrollTop+=C/x,E=(h.scrollTop-M)*x}if(w){let M=h.scrollLeft;h.scrollLeft+=w/b,T=(h.scrollLeft-M)*b}e={left:e.left-T,top:e.top-E,right:e.right-T,bottom:e.bottom-E},T&&Math.abs(T-w)<1&&(r="nearest"),E&&Math.abs(E-C)<1&&(i="nearest")}if(y)break;(e.top<m.top||e.bottom>m.bottom||e.left<m.left||e.right>m.right)&&(e={left:Math.max(e.left,m.left),right:Math.min(e.right,m.right),top:Math.max(e.top,m.top),bottom:Math.min(e.bottom,m.bottom)}),h=h.assignedSlot||h.parentNode}else if(h.nodeType==11)h=h.host;else break}function JL(t,e=!0){let n=t.ownerDocument,r=null,i=null;for(let s=t.parentNode;s&&!(s==n.body||(!e||r)&&i);)if(s.nodeType==1)!i&&s.scrollHeight>s.clientHeight&&(i=s),e&&!r&&s.scrollWidth>s.clientWidth&&(r=s),s=s.assignedSlot||s.parentNode;else if(s.nodeType==11)s=s.host;else break;return{x:r,y:i}}class mQ{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:n,focusNode:r}=e;this.set(n,Math.min(e.anchorOffset,n?ul(n):0),r,Math.min(e.focusOffset,r?ul(r):0))}set(e,n,r,i){this.anchorNode=e,this.anchorOffset=n,this.focusNode=r,this.focusOffset=i}}let Za=null;Ye.safari&&Ye.safari_version>=26&&(Za=!1);function eB(t){if(t.setActive)return t.setActive();if(Za)return t.focus(Za);let e=[];for(let n=t;n&&(e.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(t.focus(Za==null?{get preventScroll(){return Za={preventScroll:!0},!0}}:void 0),!Za){Za=!1;for(let n=0;n<e.length;){let r=e[n++],i=e[n++],s=e[n++];r.scrollTop!=i&&(r.scrollTop=i),r.scrollLeft!=s&&(r.scrollLeft=s)}}}let Ok;function Yd(t,e,n=e){let r=Ok||(Ok=document.createRange());return r.setEnd(t,n),r.setStart(t,e),r}function Rc(t,e,n,r){let i={key:e,code:e,keyCode:n,which:n,cancelable:!0};r&&({altKey:i.altKey,ctrlKey:i.ctrlKey,shiftKey:i.shiftKey,metaKey:i.metaKey}=r);let s=new KeyboardEvent("keydown",i);s.synthetic=!0,t.dispatchEvent(s);let a=new KeyboardEvent("keyup",i);return a.synthetic=!0,t.dispatchEvent(a),s.defaultPrevented||a.defaultPrevented}function yQ(t){for(;t;){if(t&&(t.nodeType==9||t.nodeType==11&&t.host))return t;t=t.assignedSlot||t.parentNode}return null}function vQ(t,e){let n=e.focusNode,r=e.focusOffset;if(!n||e.anchorNode!=n||e.anchorOffset!=r)return!1;for(r=Math.min(r,ul(n));;)if(r){if(n.nodeType!=1)return!1;let i=n.childNodes[r-1];i.contentEditable=="false"?r--:(n=i,r=ul(n))}else{if(n==t)return!0;r=ma(n),n=n.parentNode}}function tB(t){return t instanceof Window?t.pageYOffset>Math.max(0,t.document.documentElement.scrollHeight-t.innerHeight-4):t.scrollTop>Math.max(1,t.scrollHeight-t.clientHeight-4)}function nB(t,e){for(let n=t,r=e;;){if(n.nodeType==3&&r>0)return{node:n,offset:r};if(n.nodeType==1&&r>0){if(n.contentEditable=="false")return null;n=n.childNodes[r-1],r=ul(n)}else if(n.parentNode&&!pm(n))r=ma(n),n=n.parentNode;else return null}}function rB(t,e){for(let n=t,r=e;;){if(n.nodeType==3&&r<n.nodeValue.length)return{node:n,offset:r};if(n.nodeType==1&&r<n.childNodes.length){if(n.contentEditable=="false")return null;n=n.childNodes[r],r=0}else if(n.parentNode&&!pm(n))r=ma(n)+1,n=n.parentNode;else return null}}class Po{constructor(e,n,r=!0){this.node=e,this.offset=n,this.precise=r}static before(e,n){return new Po(e.parentNode,ma(e),n)}static after(e,n){return new Po(e.parentNode,ma(e)+1,n)}}var mr=(function(t){return t[t.LTR=0]="LTR",t[t.RTL=1]="RTL",t})(mr||(mr={}));const bu=mr.LTR,tC=mr.RTL;function iB(t){let e=[];for(let n=0;n<t.length;n++)e.push(1<<+t[n]);return e}const bQ=iB("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),xQ=iB("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),LS=Object.create(null),ns=[];for(let t of["()","[]","{}"]){let e=t.charCodeAt(0),n=t.charCodeAt(1);LS[e]=n,LS[n]=-e}function oB(t){return t<=247?bQ[t]:1424<=t&&t<=1524?2:1536<=t&&t<=1785?xQ[t-1536]:1774<=t&&t<=2220?4:8192<=t&&t<=8204?256:64336<=t&&t<=65023?4:1}const SQ=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class vs{get dir(){return this.level%2?tC:bu}constructor(e,n,r){this.from=e,this.to=n,this.level=r}side(e,n){return this.dir==n==e?this.to:this.from}forward(e,n){return e==(this.dir==n)}static find(e,n,r,i){let s=-1;for(let a=0;a<e.length;a++){let u=e[a];if(u.from<=n&&u.to>=n){if(u.level==r)return a;(s<0||(i!=0?i<0?u.from<n:u.to>n:e[s].level>u.level))&&(s=a)}}if(s<0)throw new RangeError("Index out of range");return s}}function sB(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++){let r=t[n],i=e[n];if(r.from!=i.from||r.to!=i.to||r.direction!=i.direction||!sB(r.inner,i.inner))return!1}return!0}const An=[];function wQ(t,e,n,r,i){for(let s=0;s<=r.length;s++){let a=s?r[s-1].to:e,u=s<r.length?r[s].from:n,c=s?256:i;for(let d=a,h=c,g=c;d<u;d++){let m=oB(t.charCodeAt(d));m==512?m=h:m==8&&g==4&&(m=16),An[d]=m==4?2:m,m&7&&(g=m),h=m}for(let d=a,h=c,g=c;d<u;d++){let m=An[d];if(m==128)d<u-1&&h==An[d+1]&&h&24?m=An[d]=h:An[d]=256;else if(m==64){let y=d+1;for(;y<u&&An[y]==64;)y++;let b=d&&h==8||y<n&&An[y]==8?g==1?1:8:256;for(let x=d;x<y;x++)An[x]=b;d=y-1}else m==8&&g==1&&(An[d]=1);h=m,m&7&&(g=m)}}}function CQ(t,e,n,r,i){let s=i==1?2:1;for(let a=0,u=0,c=0;a<=r.length;a++){let d=a?r[a-1].to:e,h=a<r.length?r[a].from:n;for(let g=d,m,y,b;g<h;g++)if(y=LS[m=t.charCodeAt(g)])if(y<0){for(let x=u-3;x>=0;x-=3)if(ns[x+1]==-y){let w=ns[x+2],C=w&2?i:w&4?w&1?s:i:0;C&&(An[g]=An[ns[x]]=C),u=x;break}}else{if(ns.length==189)break;ns[u++]=g,ns[u++]=m,ns[u++]=c}else if((b=An[g])==2||b==1){let x=b==i;c=x?0:1;for(let w=u-3;w>=0;w-=3){let C=ns[w+2];if(C&2)break;if(x)ns[w+2]|=2;else{if(C&4)break;ns[w+2]|=4}}}}}function RQ(t,e,n,r){for(let i=0,s=r;i<=n.length;i++){let a=i?n[i-1].to:t,u=i<n.length?n[i].from:e;for(let c=a;c<u;){let d=An[c];if(d==256){let h=c+1;for(;;)if(h==u){if(i==n.length)break;h=n[i++].to,u=i<n.length?n[i].from:e}else if(An[h]==256)h++;else break;let g=s==1,m=(h<e?An[h]:r)==1,y=g==m?g?1:2:r;for(let b=h,x=i,w=x?n[x-1].to:t;b>c;)b==w&&(b=n[--x].from,w=x?n[x-1].to:t),An[--b]=y;c=h}else s=d,c++}}}function BS(t,e,n,r,i,s,a){let u=r%2?2:1;if(r%2==i%2)for(let c=e,d=0;c<n;){let h=!0,g=!1;if(d==s.length||c<s[d].from){let x=An[c];x!=u&&(h=!1,g=x==16)}let m=!h&&u==1?[]:null,y=h?r:r+1,b=c;e:for(;;)if(d<s.length&&b==s[d].from){if(g)break e;let x=s[d];if(!h)for(let w=x.to,C=d+1;;){if(w==n)break e;if(C<s.length&&s[C].from==w)w=s[C++].to;else{if(An[w]==u)break e;break}}if(d++,m)m.push(x);else{x.from>c&&a.push(new vs(c,x.from,y));let w=x.direction==bu!=!(y%2);jS(t,w?r+1:r,i,x.inner,x.from,x.to,a),c=x.to}b=x.to}else{if(b==n||(h?An[b]!=u:An[b]==u))break;b++}m?BS(t,c,b,r+1,i,m,a):c<b&&a.push(new vs(c,b,y)),c=b}else for(let c=n,d=s.length;c>e;){let h=!0,g=!1;if(!d||c>s[d-1].to){let x=An[c-1];x!=u&&(h=!1,g=x==16)}let m=!h&&u==1?[]:null,y=h?r:r+1,b=c;e:for(;;)if(d&&b==s[d-1].to){if(g)break e;let x=s[--d];if(!h)for(let w=x.from,C=d;;){if(w==e)break e;if(C&&s[C-1].to==w)w=s[--C].from;else{if(An[w-1]==u)break e;break}}if(m)m.push(x);else{x.to<c&&a.push(new vs(x.to,c,y));let w=x.direction==bu!=!(y%2);jS(t,w?r+1:r,i,x.inner,x.from,x.to,a),c=x.from}b=x.from}else{if(b==e||(h?An[b-1]!=u:An[b-1]==u))break;b--}m?BS(t,b,c,r+1,i,m,a):b<c&&a.push(new vs(b,c,y)),c=b}}function jS(t,e,n,r,i,s,a){let u=e%2?2:1;wQ(t,i,s,r,u),CQ(t,i,s,r,u),RQ(i,s,r,u),BS(t,i,s,e,n,r,a)}function TQ(t,e,n){if(!t)return[new vs(0,0,e==tC?1:0)];if(e==bu&&!n.length&&!SQ.test(t))return lB(t.length);if(n.length)for(;t.length>An.length;)An[An.length]=256;let r=[],i=e==bu?0:1;return jS(t,i,i,n,0,t.length,r),r}function lB(t){return[new vs(0,t,0)]}let aB="";function EQ(t,e,n,r,i){var s;let a=r.head-t.from,u=vs.find(e,a,(s=r.bidiLevel)!==null&&s!==void 0?s:-1,r.assoc),c=e[u],d=c.side(i,n);if(a==d){let m=u+=i?1:-1;if(m<0||m>=e.length)return null;c=e[u=m],a=c.side(!i,n),d=c.side(i,n)}let h=Qr(t.text,a,c.forward(i,n));(h<c.from||h>c.to)&&(h=d),aB=t.text.slice(Math.min(a,h),Math.max(a,h));let g=u==(i?e.length-1:0)?null:e[u+(i?1:-1)];return g&&h==d&&g.level+(i?0:1)<c.level?ze.cursor(g.side(!i,n)+t.from,g.forward(i,n)?1:-1,g.level):ze.cursor(h+t.from,c.forward(i,n)?-1:1,c.level)}function MQ(t,e,n){for(let r=e;r<n;r++){let i=oB(t.charCodeAt(r));if(i==1)return bu;if(i==2||i==4)return tC}return bu}const uB=bt.define(),cB=bt.define(),fB=bt.define(),dB=bt.define(),_S=bt.define(),hB=bt.define(),pB=bt.define(),nC=bt.define(),rC=bt.define(),gB=bt.define({combine:t=>t.some(e=>e)}),AQ=bt.define({combine:t=>t.some(e=>e)}),mB=bt.define();class Tc{constructor(e,n="nearest",r="nearest",i=5,s=5,a=!1){this.range=e,this.y=n,this.x=r,this.yMargin=i,this.xMargin=s,this.isSnapshot=a}map(e){return e.empty?this:new Tc(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new Tc(ze.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const fg=sr.define({map:(t,e)=>t.map(e)}),yB=sr.define();function bs(t,e,n){let r=t.facet(dB);r.length?r[0](e):window.onerror&&window.onerror(String(e),n,void 0,void 0,e)||(n?console.error(n+":",e):console.error(e))}const Js=bt.define({combine:t=>t.length?t[0]:!0});let OQ=0;const dc=bt.define({combine(t){return t.filter((e,n)=>{for(let r=0;r<n;r++)if(t[r].plugin==e.plugin)return!1;return!0})}});class Lc{constructor(e,n,r,i,s){this.id=e,this.create=n,this.domEventHandlers=r,this.domEventObservers=i,this.baseExtensions=s(this),this.extension=this.baseExtensions.concat(dc.of({plugin:this,arg:void 0}))}of(e){return this.baseExtensions.concat(dc.of({plugin:this,arg:e}))}static define(e,n){const{eventHandlers:r,eventObservers:i,provide:s,decorations:a}=n||{};return new Lc(OQ++,e,r,i,u=>{let c=[];return a&&c.push(by.of(d=>{let h=d.plugin(u);return h?a(h):Jr.none})),s&&c.push(s(u)),c})}static fromClass(e,n){return Lc.define((r,i)=>new e(r,i),n)}}class Hb{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(e){if(this.value){if(this.mustUpdate){let n=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(n)}catch(r){if(bs(n.state,r,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.plugin.create(e,this.spec.arg)}catch(n){bs(e.state,n,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var n;if(!((n=this.value)===null||n===void 0)&&n.destroy)try{this.value.destroy()}catch(r){bs(e.state,r,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const vB=bt.define(),iC=bt.define(),by=bt.define(),bB=bt.define(),oC=bt.define(),yh=bt.define(),xB=bt.define();function kk(t,e){let n=t.state.facet(xB);if(!n.length)return n;let r=n.map(s=>s instanceof Function?s(t):s),i=[];return pn.spans(r,e.from,e.to,{point(){},span(s,a,u,c){let d=s-e.from,h=a-e.from,g=i;for(let m=u.length-1;m>=0;m--,c--){let y=u[m].spec.bidiIsolate,b;if(y==null&&(y=MQ(e.text,d,h)),c>0&&g.length&&(b=g[g.length-1]).to==d&&b.direction==y)b.to=h,g=b.inner;else{let x={from:d,to:h,direction:y,inner:[]};g.push(x),g=x.inner}}}}),i}const SB=bt.define();function wB(t){let e=0,n=0,r=0,i=0;for(let s of t.state.facet(SB)){let a=s(t);a&&(a.left!=null&&(e=Math.max(e,a.left)),a.right!=null&&(n=Math.max(n,a.right)),a.top!=null&&(r=Math.max(r,a.top)),a.bottom!=null&&(i=Math.max(i,a.bottom)))}return{left:e,right:n,top:r,bottom:i}}const ad=bt.define();class lo{constructor(e,n,r,i){this.fromA=e,this.toA=n,this.fromB=r,this.toB=i}join(e){return new lo(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let n=e.length,r=this;for(;n>0;n--){let i=e[n-1];if(!(i.fromA>r.toA)){if(i.toA<r.fromA)break;r=r.join(i),e.splice(n-1,1)}}return e.splice(n,0,r),e}static extendWithRanges(e,n){if(n.length==0)return e;let r=[];for(let i=0,s=0,a=0;;){let u=i<e.length?e[i].fromB:1e9,c=s<n.length?n[s]:1e9,d=Math.min(u,c);if(d==1e9)break;let h=d+a,g=d,m=h;for(;;)if(s<n.length&&n[s]<=g){let y=n[s+1];s+=2,g=Math.max(g,y);for(let b=i;b<e.length&&e[b].fromB<=g;b++)a=e[b].toA-e[b].toB;m=Math.max(m,y+a)}else if(i<e.length&&e[i].fromB<=g){let y=e[i++];g=Math.max(g,y.toB),m=Math.max(m,y.toA),a=y.toA-y.toB}else break;r.push(new lo(h,m,d,g))}return r}}class mm{constructor(e,n,r){this.view=e,this.state=n,this.transactions=r,this.flags=0,this.startState=e.state,this.changes=wr.empty(this.startState.doc.length);for(let s of r)this.changes=this.changes.compose(s.changes);let i=[];this.changes.iterChangedRanges((s,a,u,c)=>i.push(new lo(s,a,u,c))),this.changedRanges=i}static create(e,n,r){return new mm(e,n,r)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}const kQ=[];class Xn{constructor(e,n,r=0){this.dom=e,this.length=n,this.flags=r,this.parent=null,e.cmTile=this}get breakAfter(){return this.flags&1}get children(){return kQ}isWidget(){return!1}get isHidden(){return!1}isComposite(){return!1}isLine(){return!1}isText(){return!1}isBlock(){return!1}get domAttrs(){return null}sync(e){if(this.flags|=2,this.flags&4){this.flags&=-5;let n=this.domAttrs;n&&fQ(this.dom,n)}}toString(){return this.constructor.name+(this.children.length?`(${this.children})`:"")+(this.breakAfter?"#":"")}destroy(){this.parent=null}setDOM(e){this.dom=e,e.cmTile=this}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e,n=this.posAtStart){let r=n;for(let i of this.children){if(i==e)return r;r+=i.length+i.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}covers(e){return!0}coordsIn(e,n){return null}domPosFor(e,n){let r=ma(this.dom),i=this.length?e>0:n>0;return new Po(this.parent.dom,r+(i?1:0),e==0||e==this.length)}markDirty(e){this.flags&=-3,e&&(this.flags|=4),this.parent&&this.parent.flags&2&&this.parent.markDirty(!1)}get overrideDOMText(){return null}get root(){for(let e=this;e;e=e.parent)if(e instanceof Sy)return e;return null}static get(e){return e.cmTile}}class xy extends Xn{constructor(e){super(e,0),this._children=[]}isComposite(){return!0}get children(){return this._children}get lastChild(){return this.children.length?this.children[this.children.length-1]:null}append(e){this.children.push(e),e.parent=this}sync(e){if(this.flags&2)return;super.sync(e);let n=this.dom,r=null,i,s=e?.node==n?e:null,a=0;for(let u of this.children){if(u.sync(e),a+=u.length+u.breakAfter,i=r?r.nextSibling:n.firstChild,s&&i!=u.dom&&(s.written=!0),u.dom.parentNode==n)for(;i&&i!=u.dom;)i=Ik(i);else n.insertBefore(u.dom,i);r=u.dom}for(i=r?r.nextSibling:n.firstChild,s&&i&&(s.written=!0);i;)i=Ik(i);this.length=a}}function Ik(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class Sy extends xy{constructor(e,n){super(n),this.view=e}owns(e){for(;e;e=e.parent)if(e==this)return!0;return!1}isBlock(){return!0}nearest(e){for(;;){if(!e)return null;let n=Xn.get(e);if(n&&this.owns(n))return n;e=e.parentNode}}blockTiles(e){for(let n=[],r=this,i=0,s=0;;)if(i==r.children.length){if(!n.length)return;r=r.parent,r.breakAfter&&s++,i=n.pop()}else{let a=r.children[i++];if(a instanceof sl)n.push(i),r=a,i=0;else{let u=s+a.length,c=e(a,s);if(c!==void 0)return c;s=u+a.breakAfter}}}resolveBlock(e,n){let r,i=-1,s,a=-1;if(this.blockTiles((u,c)=>{let d=c+u.length;if(e>=c&&e<=d){if(u.isWidget()&&n>=-1&&n<=1){if(u.flags&32)return!0;u.flags&16&&(r=void 0)}(c<e||e==d&&(n<-1?u.length:u.covers(1)))&&(!r||!u.isWidget()&&r.isWidget())&&(r=u,i=e-c),(d>e||e==c&&(n>1?u.length:u.covers(-1)))&&(!s||!u.isWidget()&&s.isWidget())&&(s=u,a=e-c)}}),!r&&!s)throw new Error("No tile at position "+e);return r&&n<0||!s?{tile:r,offset:i}:{tile:s,offset:a}}}class sl extends xy{constructor(e,n){super(e),this.wrapper=n}isBlock(){return!0}covers(e){return this.children.length?e<0?this.children[0].covers(-1):this.lastChild.covers(1):!1}get domAttrs(){return this.wrapper.attributes}static of(e,n){let r=new sl(n||document.createElement(e.tagName),e);return n||(r.flags|=4),r}}class Bc extends xy{constructor(e,n){super(e),this.attrs=n}isLine(){return!0}static start(e,n,r){let i=new Bc(n||document.createElement("div"),e);return(!n||!r)&&(i.flags|=4),i}get domAttrs(){return this.attrs}resolveInline(e,n,r){let i=null,s=-1,a=null,u=-1;function c(h,g){for(let m=0,y=0;m<h.children.length&&y<=g;m++){let b=h.children[m],x=y+b.length;x>=g&&(b.isComposite()?c(b,g-y):(!a||a.isHidden&&(n>0||r&&DQ(a,b)))&&(x>g||b.flags&32)?(a=b,u=g-y):(y<g||b.flags&16&&!b.isHidden)&&(i=b,s=g-y)),y=x}}c(this,e);let d=(n<0?i:a)||i||a;return d?{tile:d,offset:d==i?s:u}:null}coordsIn(e,n){let r=this.resolveInline(e,n,!0);return r?r.tile.coordsIn(Math.max(0,r.offset),n):IQ(this)}domIn(e,n){let r=this.resolveInline(e,n);if(r){let{tile:i,offset:s}=r;if(this.dom.contains(i.dom))return i.isText()?new Po(i.dom,Math.min(i.dom.nodeValue.length,s)):i.domPosFor(s,i.flags&16?1:i.flags&32?-1:n);let a=r.tile.parent,u=!1;for(let c of a.children){if(u)return new Po(c.dom,0);c==r.tile&&(u=!0)}}return new Po(this.dom,0)}}function IQ(t){let e=t.dom.lastChild;if(!e)return t.dom.getBoundingClientRect();let n=jg(e);return n[n.length-1]||null}function DQ(t,e){let n=t.coordsIn(0,1),r=e.coordsIn(0,1);return n&&r&&r.top<n.bottom}class xi extends xy{constructor(e,n){super(e),this.mark=n}get domAttrs(){return this.mark.attrs}static of(e,n){let r=new xi(n||document.createElement(e.tagName),e);return n||(r.flags|=4),r}}class ou extends Xn{constructor(e,n){super(e,n.length),this.text=n}sync(e){this.flags&2||(super.sync(e),this.dom.nodeValue!=this.text&&(e&&e.node==this.dom&&(e.written=!0),this.dom.nodeValue=this.text))}isText(){return!0}toString(){return JSON.stringify(this.text)}coordsIn(e,n){let r=this.dom.nodeValue.length;e>r&&(e=r);let i=e,s=e,a=0;e==0&&n<0||e==r&&n>=0?Ye.chrome||Ye.gecko||(e?(i--,a=1):s<r&&(s++,a=-1)):n<0?i--:s<r&&s++;let u=Yd(this.dom,i,s).getClientRects();if(!u.length)return null;let c=u[(a?a<0:n>=0)?0:u.length-1];return Ye.safari&&!a&&c.width==0&&(c=Array.prototype.find.call(u,d=>d.width)||c),a?gm(c,a<0):c||null}static of(e,n){let r=new ou(n||document.createTextNode(e),e);return n||(r.flags|=2),r}}class xu extends Xn{constructor(e,n,r,i){super(e,n,i),this.widget=r}isWidget(){return!0}get isHidden(){return this.widget.isHidden}covers(e){return this.flags&48?!1:(this.flags&(e<0?64:128))>0}coordsIn(e,n){return this.coordsInWidget(e,n,!1)}coordsInWidget(e,n,r){let i=this.widget.coordsAt(this.dom,e,n);if(i)return i;if(r)return gm(this.dom.getBoundingClientRect(),this.length?e==0:n<=0);{let s=this.dom.getClientRects(),a=null;if(!s.length)return null;let u=this.flags&16?!0:this.flags&32?!1:e>0;for(let c=u?s.length-1:0;a=s[c],!(e>0?c==0:c==s.length-1||a.top<a.bottom);c+=u?-1:1);return gm(a,!u)}}get overrideDOMText(){if(!this.length)return Yt.empty;let{root:e}=this;if(!e)return Yt.empty;let n=this.posAtStart;return e.view.state.doc.slice(n,n+this.length)}destroy(){super.destroy(),this.widget.destroy(this.dom)}static of(e,n,r,i,s){return s||(s=e.toDOM(n),e.editable||(s.contentEditable="false")),new xu(s,r,e,i)}}class ym extends Xn{constructor(e){let n=document.createElement("img");n.className="cm-widgetBuffer",n.setAttribute("aria-hidden","true"),super(n,0,e)}get isHidden(){return!0}get overrideDOMText(){return Yt.empty}coordsIn(e){return this.dom.getBoundingClientRect()}}class PQ{constructor(e){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=e}advance(e,n,r){let{tile:i,index:s,beforeBreak:a,parents:u}=this;for(;e||n>0;)if(i.isComposite())if(a){if(!e)break;r&&r.break(),e--,a=!1}else if(s==i.children.length){if(!e&&!u.length)break;r&&r.leave(i),a=!!i.breakAfter,{tile:i,index:s}=u.pop(),s++}else{let c=i.children[s],d=c.breakAfter;(n>0?c.length<=e:c.length<e)&&(!r||r.skip(c,0,c.length)!==!1||!c.isComposite)?(a=!!d,s++,e-=c.length):(u.push({tile:i,index:s}),i=c,s=0,r&&c.isComposite()&&r.enter(c))}else if(s==i.length)a=!!i.breakAfter,{tile:i,index:s}=u.pop(),s++;else if(e){let c=Math.min(e,i.length-s);r&&r.skip(i,s,s+c),e-=c,s+=c}else break;return this.tile=i,this.index=s,this.beforeBreak=a,this}get root(){return this.parents.length?this.parents[0].tile:this.tile}}class zQ{constructor(e,n,r,i){this.from=e,this.to=n,this.wrapper=r,this.rank=i}}class NQ{constructor(e,n,r){this.cache=e,this.root=n,this.blockWrappers=r,this.curLine=null,this.lastBlock=null,this.afterWidget=null,this.pos=0,this.wrappers=[],this.wrapperPos=0}addText(e,n,r,i){var s;this.flushBuffer();let a=this.ensureMarks(n,r),u=a.lastChild;if(u&&u.isText()&&!(u.flags&8)&&u.length+e.length<512){this.cache.reused.set(u,2);let c=a.children[a.children.length-1]=new ou(u.dom,u.text+e);c.parent=a}else a.append(i||ou.of(e,(s=this.cache.find(ou))===null||s===void 0?void 0:s.dom));this.pos+=e.length,this.afterWidget=null}addComposition(e,n){let r=this.curLine;r.dom!=n.line.dom&&(r.setDOM(this.cache.reused.has(n.line)?Vb(n.line.dom):n.line.dom),this.cache.reused.set(n.line,2));let i=r;for(let u=n.marks.length-1;u>=0;u--){let c=n.marks[u],d=i.lastChild;if(d instanceof xi&&d.mark.eq(c.mark))d.dom!=c.dom&&d.setDOM(Vb(c.dom)),i=d;else{if(this.cache.reused.get(c)){let g=Xn.get(c.dom);g&&g.setDOM(Vb(c.dom))}let h=xi.of(c.mark,c.dom);i.append(h),i=h}this.cache.reused.set(c,2)}let s=Xn.get(e.text);s&&this.cache.reused.set(s,2);let a=new ou(e.text,e.text.nodeValue);a.flags|=8,i.append(a)}addInlineWidget(e,n,r){let i=this.afterWidget&&e.flags&48&&(this.afterWidget.flags&48)==(e.flags&48);i||this.flushBuffer();let s=this.ensureMarks(n,r);!i&&!(e.flags&16)&&s.append(this.getBuffer(1)),s.append(e),this.pos+=e.length,this.afterWidget=e}addMark(e,n,r){this.flushBuffer(),this.ensureMarks(n,r).append(e),this.pos+=e.length,this.afterWidget=null}addBlockWidget(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}continueWidget(e){let n=this.afterWidget||this.lastBlock;n.length+=e,this.pos+=e}addLineStart(e,n){var r;e||(e=CB);let i=Bc.start(e,n||((r=this.cache.find(Bc))===null||r===void 0?void 0:r.dom),!!n);this.getBlockPos().append(this.lastBlock=this.curLine=i)}addLine(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}addBreak(){this.lastBlock.flags|=1,this.endLine(),this.pos++}addLineStartIfNotCovered(e){this.blockPosCovered()||this.addLineStart(e)}ensureLine(e){this.curLine||this.addLineStart(e)}ensureMarks(e,n){var r;let i=this.curLine;for(let s=e.length-1;s>=0;s--){let a=e[s],u;if(n>0&&(u=i.lastChild)&&u instanceof xi&&u.mark.eq(a))i=u,n--;else{let c=xi.of(a,(r=this.cache.find(xi,d=>d.mark.eq(a)))===null||r===void 0?void 0:r.dom);i.append(c),i=c,n=0}}return i}endLine(){if(this.curLine){this.flushBuffer();let e=this.curLine.lastChild;(!e||!Dk(this.curLine,!1)||e.dom.nodeName!="BR"&&e.isWidget()&&!(Ye.ios&&Dk(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(Fb,0,32)||new xu(Fb.toDOM(),0,Fb,32)),this.curLine=this.afterWidget=null}}updateBlockWrappers(){this.wrapperPos>this.pos+1e4&&(this.blockWrappers.goto(this.pos),this.wrappers.length=0);for(let e=this.wrappers.length-1;e>=0;e--)this.wrappers[e].to<this.pos&&this.wrappers.splice(e,1);for(let e=this.blockWrappers;e.value&&e.from<=this.pos;e.next())if(e.to>=this.pos){let n=new zQ(e.from,e.to,e.value,e.rank),r=this.wrappers.length;for(;r>0&&(this.wrappers[r-1].rank-n.rank||this.wrappers[r-1].to-n.to)<0;)r--;this.wrappers.splice(r,0,n)}this.wrapperPos=this.pos}getBlockPos(){var e;this.updateBlockWrappers();let n=this.root;for(let r of this.wrappers){let i=n.lastChild;if(r.from<this.pos&&i instanceof sl&&i.wrapper.eq(r.wrapper))n=i;else{let s=sl.of(r.wrapper,(e=this.cache.find(sl,a=>a.wrapper.eq(r.wrapper)))===null||e===void 0?void 0:e.dom);n.append(s),n=s}}return n}blockPosCovered(){let e=this.lastBlock;return e!=null&&!e.breakAfter&&(!e.isWidget()||(e.flags&160)>0)}getBuffer(e){let n=2|(e<0?16:32),r=this.cache.find(ym,void 0,1);return r&&(r.flags=n),r||new ym(n)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}}class LQ{constructor(e){this.skipCount=0,this.text="",this.textOff=0,this.cursor=e.iter()}skip(e){this.textOff+e<=this.text.length?this.textOff+=e:(this.skipCount+=e-(this.text.length-this.textOff),this.text="",this.textOff=0)}next(e){if(this.textOff==this.text.length){let{value:i,lineBreak:s,done:a}=this.cursor.next(this.skipCount);if(this.skipCount=0,a)throw new Error("Ran out of text content when drawing inline views");this.text=i;let u=this.textOff=Math.min(e,i.length);return s?null:i.slice(0,u)}let n=Math.min(this.text.length,this.textOff+e),r=this.text.slice(this.textOff,n);return this.textOff=n,r}}const vm=[xu,Bc,ou,xi,ym,sl,Sy];for(let t=0;t<vm.length;t++)vm[t].bucket=t;class BQ{constructor(e){this.view=e,this.buckets=vm.map(()=>[]),this.index=vm.map(()=>0),this.reused=new Map}add(e){let n=e.constructor.bucket,r=this.buckets[n];r.length<6?r.push(e):r[this.index[n]=(this.index[n]+1)%6]=e}find(e,n,r=2){let i=e.bucket,s=this.buckets[i],a=this.index[i];for(let u=s.length-1;u>=0;u--){let c=(u+a)%s.length,d=s[c];if((!n||n(d))&&!this.reused.has(d))return s.splice(c,1),c<a&&this.index[i]--,this.reused.set(d,r),d}return null}findWidget(e,n,r){let i=this.buckets[0];if(i.length)for(let s=0,a=0;;s++){if(s==i.length){if(a)return null;a=1,s=0}let u=i[s];if(!this.reused.has(u)&&(a==0?u.widget.compare(e):u.widget.constructor==e.constructor&&e.updateDOM(u.dom,this.view,u.widget)))return i.splice(s,1),s<this.index[0]&&this.index[0]--,u.widget==e&&u.length==n&&(u.flags&497)==r?(this.reused.set(u,1),u):(this.reused.set(u,2),new xu(u.dom,n,e,u.flags&-498|r))}}reuse(e){return this.reused.set(e,1),e}maybeReuse(e,n=2){if(!this.reused.has(e))return this.reused.set(e,n),e.dom}clear(){for(let e=0;e<this.buckets.length;e++)this.buckets[e].length=this.index[e]=0}}class jQ{constructor(e,n,r,i,s){this.view=e,this.decorations=i,this.disallowBlockEffectsFor=s,this.openWidget=!1,this.openMarks=0,this.cache=new BQ(e),this.text=new LQ(e.state.doc),this.builder=new NQ(this.cache,new Sy(e,e.contentDOM),pn.iter(r)),this.cache.reused.set(n,2),this.old=new PQ(n),this.reuseWalker={skip:(a,u,c)=>{if(this.cache.add(a),a.isComposite())return!1},enter:a=>this.cache.add(a),leave:()=>{},break:()=>{}}}run(e,n){let r=n&&this.getCompositionContext(n.text);for(let i=0,s=0,a=0;;){let u=a<e.length?e[a++]:null,c=u?u.fromA:this.old.root.length;if(c>i){let d=c-i;this.preserve(d,!a,!u),i=c,s+=d}if(!u)break;n&&u.fromA<=n.range.fromA&&u.toA>=n.range.toA?(this.forward(u.fromA,n.range.fromA,n.range.fromA<n.range.toA?1:-1),this.emit(s,n.range.fromB),this.cache.clear(),this.builder.addComposition(n,r),this.text.skip(n.range.toB-n.range.fromB),this.forward(n.range.fromA,u.toA),this.emit(n.range.toB,u.toB)):(this.forward(u.fromA,u.toA),this.emit(s,u.toB)),s=u.toB,i=u.toA}return this.builder.curLine&&this.builder.endLine(),this.builder.root}preserve(e,n,r){let i=VQ(this.old),s=this.openMarks;this.old.advance(e,r?1:-1,{skip:(a,u,c)=>{if(a.isWidget())if(this.openWidget)this.builder.continueWidget(c-u);else{let d=c>0||u<a.length?xu.of(a.widget,this.view,c-u,a.flags&496,this.cache.maybeReuse(a)):this.cache.reuse(a);d.flags&256?(d.flags&=-2,this.builder.addBlockWidget(d)):(this.builder.ensureLine(null),this.builder.addInlineWidget(d,i,s),s=i.length)}else if(a.isText())this.builder.ensureLine(null),!u&&c==a.length&&!this.cache.reused.has(a)?this.builder.addText(a.text,i,s,this.cache.reuse(a)):(this.cache.add(a),this.builder.addText(a.text.slice(u,c),i,s)),s=i.length;else if(a.isLine())a.flags&=-2,this.cache.reused.set(a,1),this.builder.addLine(a);else if(a instanceof ym)this.cache.add(a);else if(a instanceof xi)this.builder.ensureLine(null),this.builder.addMark(a,i,s),this.cache.reused.set(a,1),s=i.length;else return!1;this.openWidget=!1},enter:a=>{a.isLine()?this.builder.addLineStart(a.attrs,this.cache.maybeReuse(a)):(this.cache.add(a),a instanceof xi&&i.unshift(a.mark)),this.openWidget=!1},leave:a=>{a.isLine()?i.length&&(i.length=s=0):a instanceof xi&&(i.shift(),s=Math.min(s,i.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(e)}emit(e,n){let r=null,i=this.builder,s=0,a=pn.spans(this.decorations,e,n,{point:(u,c,d,h,g,m)=>{if(d instanceof vu){if(this.disallowBlockEffectsFor[m]){if(d.block)throw new RangeError("Block decorations may not be specified via plugins");if(c>this.view.state.doc.lineAt(u).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}if(s=h.length,g>h.length)i.continueWidget(c-u);else{let y=d.widget||(d.block?jc.block:jc.inline),b=_Q(d),x=this.cache.findWidget(y,c-u,b)||xu.of(y,this.view,c-u,b);d.block?(d.startSide>0&&i.addLineStartIfNotCovered(r),i.addBlockWidget(x)):(i.ensureLine(r),i.addInlineWidget(x,h,g))}r=null}else r=HQ(r,d);c>u&&this.text.skip(c-u)},span:(u,c,d,h)=>{for(let g=u;g<c;){let m=this.text.next(Math.min(512,c-g));m==null?(i.addLineStartIfNotCovered(r),i.addBreak(),g++):(i.ensureLine(r),i.addText(m,d,g==u?h:d.length),g+=m.length),r=null}}});i.addLineStartIfNotCovered(r),this.openWidget=a>s,this.openMarks=a}forward(e,n,r=1){n-e<=10?this.old.advance(n-e,r,this.reuseWalker):(this.old.advance(5,-1,this.reuseWalker),this.old.advance(n-e-10,-1),this.old.advance(5,r,this.reuseWalker))}getCompositionContext(e){let n=[],r=null;for(let i=e.parentNode;;i=i.parentNode){let s=Xn.get(i);if(i==this.view.contentDOM)break;s instanceof xi?n.push(s):s?.isLine()?r=s:s instanceof sl||(i.nodeName=="DIV"&&!r&&i!=this.view.contentDOM?r=new Bc(i,CB):r||n.push(xi.of(new gh({tagName:i.nodeName.toLowerCase(),attributes:dQ(i)}),i)))}return{line:r,marks:n}}}function Dk(t,e){let n=r=>{for(let i of r.children)if((e?i.isText():i.length)||n(i))return!0;return!1};return n(t)}function _Q(t){let e=t.isReplace?(t.startSide<0?64:0)|(t.endSide>0?128:0):t.startSide>0?32:16;return t.block&&(e|=256),e}const CB={class:"cm-line"};function HQ(t,e){let n=e.spec.attributes,r=e.spec.class;return!n&&!r||(t||(t={class:"cm-line"}),n&&J1(n,t),r&&(t.class+=" "+r)),t}function VQ(t){let e=[];for(let n=t.parents.length;n>1;n--){let r=n==t.parents.length?t.tile:t.parents[n].tile;r instanceof xi&&e.push(r.mark)}return e}function Vb(t){let e=Xn.get(t);return e&&e.setDOM(t.cloneNode()),t}class jc extends vy{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}jc.inline=new jc("span");jc.block=new jc("div");const Fb=new class extends vy{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}};class Pk{constructor(e){this.view=e,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=Jr.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.updateDeco(),this.tile=new Sy(e,e.contentDOM),this.updateInner([new lo(0,0,0,e.state.doc.length)],null)}update(e){var n;let r=e.changedRanges;this.minWidth>0&&r.length&&(r.every(({fromA:h,toA:g})=>g<this.minWidthFrom||h>this.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let i=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((n=this.domChanged)===null||n===void 0)&&n.newSel?i=this.domChanged.newSel.head:!XQ(e.changes,this.hasComposition)&&!e.selectionSet&&(i=e.state.selection.main.head));let s=i>-1?UQ(this.view,e.changes,i):null;if(this.domChanged=null,this.hasComposition){let{from:h,to:g}=this.hasComposition;r=new lo(h,g,e.changes.mapPos(h,-1),e.changes.mapPos(g,1)).addToSet(r.slice())}this.hasComposition=s?{from:s.range.fromB,to:s.range.toB}:null,(Ye.ie||Ye.chrome)&&!s&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let a=this.decorations,u=this.blockWrappers;this.updateDeco();let c=GQ(a,this.decorations,e.changes);c.length&&(r=lo.extendWithRanges(r,c));let d=KQ(u,this.blockWrappers,e.changes);return d.length&&(r=lo.extendWithRanges(r,d)),s&&!r.some(h=>h.fromA<=s.range.fromA&&h.toA>=s.range.toA)&&(r=s.range.addToSet(r.slice())),this.tile.flags&2&&r.length==0?!1:(this.updateInner(r,s),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,n){this.view.viewState.mustMeasureContent=!0;let{observer:r}=this.view;r.ignore(()=>{if(n||e.length){let a=this.tile,u=new jQ(this.view,a,this.blockWrappers,this.decorations,this.dynamicDecorationMap);n&&Xn.get(n.text)&&u.cache.reused.set(Xn.get(n.text),2),this.tile=u.run(e,n),HS(a,u.cache.reused)}this.tile.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.tile.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let s=Ye.chrome||Ye.ios?{node:r.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(s),s&&(s.written||r.selectionRange.focusNode!=s.node||!this.tile.dom.contains(s.node))&&(this.forceSelection=!0),this.tile.dom.style.height=""});let i=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let s of this.tile.children)s.isWidget()&&s.widget instanceof Ub&&i.push(s.dom);r.updateGaps(i)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let n of e.transactions)for(let r of n.effects)r.is(yB)&&(this.editContextFormatting=r.value)}updateSelection(e=!1,n=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let{dom:r}=this.tile,i=this.view.root.activeElement,s=i==r,a=!s&&!(this.view.state.facet(Js)||r.tabIndex>-1)&&xd(r,this.view.observer.selectionRange)&&!(i&&r.contains(i));if(!(s||n||a))return;let u=this.forceSelection;this.forceSelection=!1;let c=this.view.state.selection.main,d,h;if(c.empty?h=d=this.inlineDOMNearPos(c.anchor,c.assoc||1):(h=this.inlineDOMNearPos(c.head,c.head==c.from?1:-1),d=this.inlineDOMNearPos(c.anchor,c.anchor==c.from?1:-1)),Ye.gecko&&c.empty&&!this.hasComposition&&FQ(d)){let m=document.createTextNode("");this.view.observer.ignore(()=>d.node.insertBefore(m,d.node.childNodes[d.offset]||null)),d=h=new Po(m,0),u=!0}let g=this.view.observer.selectionRange;(u||!g.focusNode||(!Sd(d.node,d.offset,g.anchorNode,g.anchorOffset)||!Sd(h.node,h.offset,g.focusNode,g.focusOffset))&&!this.suppressWidgetCursorChange(g,c))&&(this.view.observer.ignore(()=>{Ye.android&&Ye.chrome&&r.contains(g.focusNode)&&YQ(g.focusNode,r)&&(r.blur(),r.focus({preventScroll:!0}));let m=Kd(this.view.root);if(m)if(c.empty){if(Ye.gecko){let y=$Q(d.node,d.offset);if(y&&y!=3){let b=(y==1?nB:rB)(d.node,d.offset);b&&(d=new Po(b.node,b.offset))}}m.collapse(d.node,d.offset),c.bidiLevel!=null&&m.caretBidiLevel!==void 0&&(m.caretBidiLevel=c.bidiLevel)}else if(m.extend){m.collapse(d.node,d.offset);try{m.extend(h.node,h.offset)}catch{}}else{let y=document.createRange();c.anchor>c.head&&([d,h]=[h,d]),y.setEnd(h.node,h.offset),y.setStart(d.node,d.offset),m.removeAllRanges(),m.addRange(y)}a&&this.view.root.activeElement==r&&(r.blur(),i&&i.focus())}),this.view.observer.setSelectionRange(d,h)),this.impreciseAnchor=d.precise?null:new Po(g.anchorNode,g.anchorOffset),this.impreciseHead=h.precise?null:new Po(g.focusNode,g.focusOffset)}suppressWidgetCursorChange(e,n){return this.hasComposition&&n.empty&&Sd(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==n.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,n=e.state.selection.main,r=Kd(e.root),{anchorNode:i,anchorOffset:s}=e.observer.selectionRange;if(!r||!n.empty||!n.assoc||!r.modify)return;let a=this.lineAt(n.head,n.assoc);if(!a)return;let u=a.posAtStart;if(n.head==u||n.head==u+a.length)return;let c=this.coordsAt(n.head,-1),d=this.coordsAt(n.head,1);if(!c||!d||c.bottom>d.top)return;let h=this.domAtPos(n.head+n.assoc,n.assoc);r.collapse(h.node,h.offset),r.modify("move",n.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let g=e.observer.selectionRange;e.docView.posFromDOM(g.anchorNode,g.anchorOffset)!=n.from&&r.collapse(i,s)}posFromDOM(e,n){let r=this.tile.nearest(e);if(!r)return this.tile.dom.compareDocumentPosition(e)&2?0:this.view.state.doc.length;let i=r.posAtStart;if(r.isComposite()){let s;if(e==r.dom)s=r.dom.childNodes[n];else{let a=ul(e)==0?0:n==0?-1:1;for(;;){let u=e.parentNode;if(u==r.dom)break;a==0&&u.firstChild!=u.lastChild&&(e==u.firstChild?a=-1:a=1),e=u}a<0?s=e:s=e.nextSibling}if(s==r.dom.firstChild)return i;for(;s&&!Xn.get(s);)s=s.nextSibling;if(!s)return i+r.length;for(let a=0,u=i;;a++){let c=r.children[a];if(c.dom==s)return u;u+=c.length+c.breakAfter}}else return r.isText()?e==r.dom?i+n:i+(n?r.length:0):i}domAtPos(e,n){let{tile:r,offset:i}=this.tile.resolveBlock(e,n);return r.isWidget()?r.domPosFor(e,n):r.domIn(i,n)}inlineDOMNearPos(e,n){let r,i=-1,s=!1,a,u=-1,c=!1;return this.tile.blockTiles((d,h)=>{if(d.isWidget()){if(d.flags&32&&h>=e)return!0;d.flags&16&&(s=!0)}else{let g=h+d.length;if(h<=e&&(r=d,i=e-h,s=g<e),g>=e&&!a&&(a=d,u=e-h,c=h>e),h>e&&a)return!0}}),!r&&!a?this.domAtPos(e,n):(s&&a?r=null:c&&r&&(a=null),r&&n<0||!a?r.domIn(i,n):a.domIn(u,n))}coordsAt(e,n){let{tile:r,offset:i}=this.tile.resolveBlock(e,n);return r.isWidget()?r.widget instanceof Ub?null:r.coordsInWidget(i,n,!0):r.coordsIn(i,n)}lineAt(e,n){let{tile:r}=this.tile.resolveBlock(e,n);return r.isLine()?r:null}coordsForChar(e){let{tile:n,offset:r}=this.tile.resolveBlock(e,1);if(!n.isLine())return null;function i(s,a){if(s.isComposite())for(let u of s.children){if(u.length>=a){let c=i(u,a);if(c)return c}if(a-=u.length,a<0)break}else if(s.isText()&&a<s.length){let u=Qr(s.text,a);if(u==a)return null;let c=Yd(s.dom,a,u).getClientRects();for(let d=0;d<c.length;d++){let h=c[d];if(d==c.length-1||h.top<h.bottom&&h.left<h.right)return h}}return null}return i(n,r)}measureVisibleLineHeights(e){let n=[],{from:r,to:i}=e,s=this.view.contentDOM.clientWidth,a=s>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,u=-1,c=this.view.textDirection==mr.LTR,d=0,h=(g,m,y)=>{for(let b=0;b<g.children.length&&!(m>i);b++){let x=g.children[b],w=m+x.length,C=x.dom.getBoundingClientRect(),{height:T}=C;if(y&&!b&&(d+=C.top-y.top),x instanceof sl)w>r&&h(x,m,C);else if(m>=r&&(d>0&&n.push(-d),n.push(T+d),d=0,a)){let E=x.dom.lastChild,M=E?jg(E):[];if(M.length){let k=M[M.length-1],P=c?k.right-C.left:C.right-k.left;P>u&&(u=P,this.minWidth=s,this.minWidthFrom=m,this.minWidthTo=w)}}y&&b==g.children.length-1&&(d+=y.bottom-C.bottom),m=w+x.breakAfter}};return h(this.tile,0,null),n}textDirectionAt(e){let{tile:n}=this.tile.resolveBlock(e,1);return getComputedStyle(n.dom).direction=="rtl"?mr.RTL:mr.LTR}measureTextSize(){let e=this.tile.blockTiles(a=>{if(a.isLine()&&a.children.length&&a.length<=20){let u=0,c;for(let d of a.children){if(!d.isText()||/[^ -~]/.test(d.text))return;let h=jg(d.dom);if(h.length!=1)return;u+=h[0].width,c=h[0].height}if(u)return{lineHeight:a.dom.getBoundingClientRect().height,charWidth:u/a.length,textHeight:c}}});if(e)return e;let n=document.createElement("div"),r,i,s;return n.className="cm-line",n.style.width="99999px",n.style.position="absolute",n.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.tile.dom.appendChild(n);let a=jg(n.firstChild)[0];r=n.getBoundingClientRect().height,i=a&&a.width?a.width/27:7,s=a&&a.height?a.height:r,n.remove()}),{lineHeight:r,charWidth:i,textHeight:s}}computeBlockGapDeco(){let e=[],n=this.view.viewState;for(let r=0,i=0;;i++){let s=i==n.viewports.length?null:n.viewports[i],a=s?s.from-1:this.view.state.doc.length;if(a>r){let u=(n.lineBlockAt(a).bottom-n.lineBlockAt(r).top)/this.view.scaleY;e.push(Jr.replace({widget:new Ub(u),block:!0,inclusive:!0,isBlockGap:!0}).range(r,a))}if(!s)break;r=s.to+1}return Jr.set(e)}updateDeco(){let e=1,n=this.view.state.facet(by).map(s=>(this.dynamicDecorationMap[e++]=typeof s=="function")?s(this.view):s),r=!1,i=this.view.state.facet(oC).map((s,a)=>{let u=typeof s=="function";return u&&(r=!0),u?s(this.view):s});for(i.length&&(this.dynamicDecorationMap[e++]=r,n.push(pn.join(i))),this.decorations=[this.editContextFormatting,...n,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];e<this.decorations.length;)this.dynamicDecorationMap[e++]=!1;this.blockWrappers=this.view.state.facet(bB).map(s=>typeof s=="function"?s(this.view):s)}scrollIntoView(e){var n;if(e.isSnapshot){let h=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=h.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let h of this.view.state.facet(mB))try{if(h(this.view,e.range,e))return!0}catch(g){bs(this.view.state,g,"scroll handler")}let{range:r}=e,i=this.coordsAt(r.head,(n=r.assoc)!==null&&n!==void 0?n:r.empty?0:r.head>r.anchor?-1:1),s;if(!i)return;!r.empty&&(s=this.coordsAt(r.anchor,r.anchor>r.head?-1:1))&&(i={left:Math.min(i.left,s.left),top:Math.min(i.top,s.top),right:Math.max(i.right,s.right),bottom:Math.max(i.bottom,s.bottom)});let a=wB(this.view),u={left:i.left-a.left,top:i.top-a.top,right:i.right+a.right,bottom:i.bottom+a.bottom},{offsetWidth:c,offsetHeight:d}=this.view.scrollDOM;if(gQ(this.view.scrollDOM,u,r.head<r.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,c),-c),Math.max(Math.min(e.yMargin,d),-d),this.view.textDirection==mr.LTR),window.visualViewport&&window.innerHeight-window.visualViewport.height>1&&(i.top>window.pageYOffset+window.visualViewport.offsetTop+window.visualViewport.height||i.bottom<window.pageYOffset+window.visualViewport.offsetTop)){let h=this.view.docView.lineAt(r.head,1);h&&h.dom.scrollIntoView({block:"nearest"})}}lineHasWidget(e){let n=r=>r.isWidget()||r.children.some(n);return n(this.tile.resolveBlock(e,1).tile)}destroy(){HS(this.tile)}}function HS(t,e){let n=e?.get(t);if(n!=1){n==null&&t.destroy();for(let r of t.children)HS(r,e)}}function FQ(t){return t.node.nodeType==1&&t.node.firstChild&&(t.offset==0||t.node.childNodes[t.offset-1].contentEditable=="false")&&(t.offset==t.node.childNodes.length||t.node.childNodes[t.offset].contentEditable=="false")}function RB(t,e){let n=t.observer.selectionRange;if(!n.focusNode)return null;let r=nB(n.focusNode,n.focusOffset),i=rB(n.focusNode,n.focusOffset),s=r||i;if(i&&r&&i.node!=r.node){let u=Xn.get(i.node);if(!u||u.isText()&&u.text!=i.node.nodeValue)s=i;else if(t.docView.lastCompositionAfterCursor){let c=Xn.get(r.node);!c||c.isText()&&c.text!=r.node.nodeValue||(s=i)}}if(t.docView.lastCompositionAfterCursor=s!=r,!s)return null;let a=e-s.offset;return{from:a,to:a+s.node.nodeValue.length,node:s.node}}function UQ(t,e,n){let r=RB(t,n);if(!r)return null;let{node:i,from:s,to:a}=r,u=i.nodeValue;if(/[\n\r]/.test(u)||t.state.doc.sliceString(r.from,r.to)!=u)return null;let c=e.invertedDesc;return{range:new lo(c.mapPos(s),c.mapPos(a),s,a),text:i}}function $Q(t,e){return t.nodeType!=1?0:(e&&t.childNodes[e-1].contentEditable=="false"?1:0)|(e<t.childNodes.length&&t.childNodes[e].contentEditable=="false"?2:0)}let qQ=class{constructor(){this.changes=[]}compareRange(e,n){Cc(e,n,this.changes)}comparePoint(e,n){Cc(e,n,this.changes)}boundChange(e){Cc(e,e,this.changes)}};function GQ(t,e,n){let r=new qQ;return pn.compare(t,e,n,r),r.changes}class WQ{constructor(){this.changes=[]}compareRange(e,n){Cc(e,n,this.changes)}comparePoint(){}boundChange(e){Cc(e,e,this.changes)}}function KQ(t,e,n){let r=new WQ;return pn.compare(t,e,n,r),r.changes}function YQ(t,e){for(let n=t;n&&n!=e;n=n.assignedSlot||n.parentNode)if(n.nodeType==1&&n.contentEditable=="false")return!0;return!1}function XQ(t,e){let n=!1;return e&&t.iterChangedRanges((r,i)=>{r<e.to&&i>e.from&&(n=!0)}),n}class Ub extends vy{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement("div");return e.className="cm-gap",this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}function QQ(t,e,n=1){let r=t.charCategorizer(e),i=t.doc.lineAt(e),s=e-i.from;if(i.length==0)return ze.cursor(e);s==0?n=1:s==i.length&&(n=-1);let a=s,u=s;n<0?a=Qr(i.text,s,!1):u=Qr(i.text,s);let c=r(i.text.slice(a,u));for(;a>0;){let d=Qr(i.text,a,!1);if(r(i.text.slice(d,a))!=c)break;a=d}for(;u<i.length;){let d=Qr(i.text,u);if(r(i.text.slice(u,d))!=c)break;u=d}return ze.range(a+i.from,u+i.from)}function ZQ(t,e,n,r,i){let s=Math.round((r-e.left)*t.defaultCharacterWidth);if(t.lineWrapping&&n.height>t.defaultLineHeight*1.5){let u=t.viewState.heightOracle.textHeight,c=Math.floor((i-n.top-(t.defaultLineHeight-u)*.5)/u);s+=c*t.viewState.heightOracle.lineLength}let a=t.state.sliceDoc(n.from,n.to);return n.from+oQ(a,s,t.state.tabSize)}function JQ(t,e,n){let r=t.lineBlockAt(e);if(Array.isArray(r.type)){let i;for(let s of r.type){if(s.from>e)break;if(!(s.to<e)){if(s.from<e&&s.to>e)return s;(!i||s.type==fo.Text&&(i.type!=s.type||(n<0?s.from<e:s.to>e)))&&(i=s)}}return i||r}return r}function eZ(t,e,n,r){let i=JQ(t,e.head,e.assoc||-1),s=!r||i.type!=fo.Text||!(t.lineWrapping||i.widgetLineBreaks)?null:t.coordsAtPos(e.assoc<0&&e.head>i.from?e.head-1:e.head);if(s){let a=t.dom.getBoundingClientRect(),u=t.textDirectionAt(i.from),c=t.posAtCoords({x:n==(u==mr.LTR)?a.right-1:a.left+1,y:(s.top+s.bottom)/2});if(c!=null)return ze.cursor(c,n?-1:1)}return ze.cursor(n?i.to:i.from,n?-1:1)}function zk(t,e,n,r){let i=t.state.doc.lineAt(e.head),s=t.bidiSpans(i),a=t.textDirectionAt(i.from);for(let u=e,c=null;;){let d=EQ(i,s,a,u,n),h=aB;if(!d){if(i.number==(n?t.state.doc.lines:1))return u;h=`
|
|
28
|
+
`,i=t.state.doc.line(i.number+(n?1:-1)),s=t.bidiSpans(i),d=t.visualLineSide(i,!n)}if(c){if(!c(h))return u}else{if(!r)return d;c=r(h)}u=d}}function tZ(t,e,n){let r=t.state.charCategorizer(e),i=r(n);return s=>{let a=r(s);return i==tl.Space&&(i=a),i==a}}function nZ(t,e,n,r){let i=e.head,s=n?1:-1;if(i==(n?t.state.doc.length:0))return ze.cursor(i,e.assoc);let a=e.goalColumn,u,c=t.contentDOM.getBoundingClientRect(),d=t.coordsAtPos(i,e.assoc||((e.empty?n:e.head==e.from)?1:-1)),h=t.documentTop;if(d)a==null&&(a=d.left-c.left),u=s<0?d.top:d.bottom;else{let b=t.viewState.lineBlockAt(i);a==null&&(a=Math.min(c.right-c.left,t.defaultCharacterWidth*(i-b.from))),u=(s<0?b.top:b.bottom)+h}let g=c.left+a,m=t.viewState.heightOracle.textHeight>>1,y=r??m;for(let b=0;;b+=m){let x=u+(y+b)*s,w=VS(t,{x:g,y:x},!1,s);if(n?x>c.bottom:x<c.top)return ze.cursor(w.pos,w.assoc);let C=t.coordsAtPos(w.pos,w.assoc),T=C?(C.top+C.bottom)/2:0;if(!C||(n?T>u:T<u))return ze.cursor(w.pos,w.assoc,void 0,a)}}function wd(t,e,n){for(;;){let r=0;for(let i of t)i.between(e-1,e+1,(s,a,u)=>{if(e>s&&e<a){let c=r||n||(e-s<a-e?-1:1);e=c<0?s:a,r=c}});if(!r)return e}}function TB(t,e){let n=null;for(let r=0;r<e.ranges.length;r++){let i=e.ranges[r],s=null;if(i.empty){let a=wd(t,i.from,0);a!=i.from&&(s=ze.cursor(a,-1))}else{let a=wd(t,i.from,-1),u=wd(t,i.to,1);(a!=i.from||u!=i.to)&&(s=ze.range(i.from==i.anchor?a:u,i.from==i.head?a:u))}s&&(n||(n=e.ranges.slice()),n[r]=s)}return n?ze.create(n,e.mainIndex):e}function $b(t,e,n){let r=wd(t.state.facet(yh).map(i=>i(t)),n.from,e.head>n.from?-1:1);return r==n.from?n:ze.cursor(r,r<n.from?1:-1)}class gs{constructor(e,n){this.pos=e,this.assoc=n}}function VS(t,e,n,r){let i=t.contentDOM.getBoundingClientRect(),s=i.top+t.viewState.paddingTop,{x:a,y:u}=e,c=u-s,d;for(;;){if(c<0)return new gs(0,1);if(c>t.viewState.docHeight)return new gs(t.state.doc.length,-1);if(d=t.elementAtHeight(c),r==null)break;if(d.type==fo.Text){if(r<0?d.to<t.viewport.from:d.from>t.viewport.to)break;let m=t.docView.coordsAt(r<0?d.from:d.to,r>0?-1:1);if(m&&(r<0?m.top<=c+s:m.bottom>=c+s))break}let g=t.viewState.heightOracle.textHeight/2;c=r>0?d.bottom+g:d.top-g}if(t.viewport.from>=d.to||t.viewport.to<=d.from){if(n)return null;if(d.type==fo.Text){let g=ZQ(t,i,d,a,u);return new gs(g,g==d.from?1:-1)}}if(d.type!=fo.Text)return c<(d.top+d.bottom)/2?new gs(d.from,1):new gs(d.to,-1);let h=t.docView.lineAt(d.from,2);return(!h||h.length!=d.length)&&(h=t.docView.lineAt(d.from,-2)),new rZ(t,a,u,t.textDirectionAt(d.from)).scanTile(h,d.from)}class rZ{constructor(e,n,r,i){this.view=e,this.x=n,this.y=r,this.baseDir=i,this.line=null,this.spans=null}bidiSpansAt(e){return(!this.line||this.line.from>e||this.line.to<e)&&(this.line=this.view.state.doc.lineAt(e),this.spans=this.view.bidiSpans(this.line)),this}baseDirAt(e,n){let{line:r,spans:i}=this.bidiSpansAt(e);return i[vs.find(i,e-r.from,-1,n)].level==this.baseDir}dirAt(e,n){let{line:r,spans:i}=this.bidiSpansAt(e);return i[vs.find(i,e-r.from,-1,n)].dir}bidiIn(e,n){let{spans:r,line:i}=this.bidiSpansAt(e);return r.length>1||r.length&&(r[0].level!=this.baseDir||r[0].to+i.from<n)}scan(e,n){let r=0,i=e.length-1,s=new Set,a=this.bidiIn(e[0],e[i]),u,c,d=-1,h=1e9,g;e:for(;r<i;){let y=i-r,b=r+i>>1;t:if(s.has(b)){let w=r+Math.floor(Math.random()*y);for(let C=0;C<y;C++){if(!s.has(w)){b=w;break t}w++,w==i&&(w=r)}break e}s.add(b);let x=n(b);if(x)for(let w=0;w<x.length;w++){let C=x[w],T=0;if(!(C.width==0&&x.length>1)){if(C.bottom<this.y)(!u||u.bottom<C.bottom)&&(u=C),T=1;else if(C.top>this.y)(!c||c.top>C.top)&&(c=C),T=-1;else{let E=C.left>this.x?this.x-C.left:C.right<this.x?this.x-C.right:0,M=Math.abs(E);M<h&&(d=b,h=M,g=C),E&&(T=E<0==(this.baseDir==mr.LTR)?-1:1)}T==-1&&(!a||this.baseDirAt(e[b],1))?i=b:T==1&&(!a||this.baseDirAt(e[b+1],-1))&&(r=b+1)}}}if(!g){let y=u&&(!c||this.y-u.bottom<c.top-this.y)?u:c;return this.y=(y.top+y.bottom)/2,this.scan(e,n)}let m=(a?this.dirAt(e[d],1):this.baseDir)==mr.LTR;return{i:d,after:this.x>(g.left+g.right)/2==m}}scanText(e,n){let r=[];for(let s=0;s<e.length;s=Qr(e.text,s))r.push(n+s);r.push(n+e.length);let i=this.scan(r,s=>{let a=r[s]-n,u=r[s+1]-n;return Yd(e.dom,a,u).getClientRects()});return i.after?new gs(r[i.i+1],-1):new gs(r[i.i],1)}scanTile(e,n){if(!e.length)return new gs(n,1);if(e.children.length==1){let u=e.children[0];if(u.isText())return this.scanText(u,n);if(u.isComposite())return this.scanTile(u,n)}let r=[n];for(let u=0,c=n;u<e.children.length;u++)r.push(c+=e.children[u].length);let i=this.scan(r,u=>{let c=e.children[u];return c.flags&48?null:(c.dom.nodeType==1?c.dom:Yd(c.dom,0,c.length)).getClientRects()}),s=e.children[i.i],a=r[i.i];return s.isText()?this.scanText(s,a):s.isComposite()?this.scanTile(s,a):i.after?new gs(r[i.i+1],-1):new gs(a,1)}}const uc="";class iZ{constructor(e,n){this.points=e,this.view=n,this.text="",this.lineSeparator=n.state.facet(an.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=uc}readRange(e,n){if(!e)return this;let r=e.parentNode;for(let i=e;;){this.findPointBefore(r,i);let s=this.text.length;this.readNode(i);let a=Xn.get(i),u=i.nextSibling;if(u==n){a?.breakAfter&&!u&&r!=this.view.contentDOM&&this.lineBreak();break}let c=Xn.get(u);(a&&c?a.breakAfter:(a?a.breakAfter:pm(i))||pm(u)&&(i.nodeName!="BR"||a?.isWidget())&&this.text.length>s)&&!sZ(u,n)&&this.lineBreak(),i=u}return this.findPointBefore(r,n),this}readTextNode(e){let n=e.nodeValue;for(let r of this.points)r.node==e&&(r.pos=this.text.length+Math.min(r.offset,n.length));for(let r=0,i=this.lineSeparator?null:/\r\n?|\n/g;;){let s=-1,a=1,u;if(this.lineSeparator?(s=n.indexOf(this.lineSeparator,r),a=this.lineSeparator.length):(u=i.exec(n))&&(s=u.index,a=u[0].length),this.append(n.slice(r,s<0?n.length:s)),s<0)break;if(this.lineBreak(),a>1)for(let c of this.points)c.node==e&&c.pos>this.text.length&&(c.pos-=a-1);r=s+a}}readNode(e){let n=Xn.get(e),r=n&&n.overrideDOMText;if(r!=null){this.findPointInside(e,r.length);for(let i=r.iter();!i.next().done;)i.lineBreak?this.lineBreak():this.append(i.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,n){for(let r of this.points)r.node==e&&e.childNodes[r.offset]==n&&(r.pos=this.text.length)}findPointInside(e,n){for(let r of this.points)(e.nodeType==3?r.node==e:e.contains(r.node))&&(r.pos=this.text.length+(oZ(e,r.node,r.offset)?n:0))}}function oZ(t,e,n){for(;;){if(!e||n<ul(e))return!1;if(e==t)return!0;n=ma(e)+1,e=e.parentNode}}function sZ(t,e){let n;for(;!(t==e||!t);t=t.nextSibling){let r=Xn.get(t);if(!r?.isWidget())return!1;r&&(n||(n=[])).push(r)}if(n)for(let r of n){let i=r.overrideDOMText;if(i?.length)return!1}return!0}class Nk{constructor(e,n){this.node=e,this.offset=n,this.pos=-1}}class lZ{constructor(e,n,r,i){this.typeOver=i,this.bounds=null,this.text="",this.domChanged=n>-1;let{impreciseHead:s,impreciseAnchor:a}=e.docView,u=e.state.selection;if(e.state.readOnly&&n>-1)this.newSel=null;else if(n>-1&&(this.bounds=EB(e.docView.tile,n,r,0))){let c=s||a?[]:uZ(e),d=new iZ(c,e);d.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=d.text,this.newSel=cZ(c,this.bounds.from)}else{let c=e.observer.selectionRange,d=s&&s.node==c.focusNode&&s.offset==c.focusOffset||!NS(e.contentDOM,c.focusNode)?u.main.head:e.docView.posFromDOM(c.focusNode,c.focusOffset),h=a&&a.node==c.anchorNode&&a.offset==c.anchorOffset||!NS(e.contentDOM,c.anchorNode)?u.main.anchor:e.docView.posFromDOM(c.anchorNode,c.anchorOffset),g=e.viewport;if((Ye.ios||Ye.chrome)&&u.main.empty&&d!=h&&(g.from>0||g.to<e.state.doc.length)){let m=Math.min(d,h),y=Math.max(d,h),b=g.from-m,x=g.to-y;(b==0||b==1||m==0)&&(x==0||x==-1||y==e.state.doc.length)&&(d=0,h=e.state.doc.length)}if(e.inputState.composing>-1&&u.ranges.length>1)this.newSel=u.replaceRange(ze.range(h,d));else if(e.lineWrapping&&h==d&&!(u.main.empty&&u.main.head==d)&&e.inputState.lastTouchTime>Date.now()-100){let m=e.coordsAtPos(d,-1),y=0;m&&(y=e.inputState.lastTouchY<=m.bottom?-1:1),this.newSel=ze.create([ze.cursor(d,y)])}else this.newSel=ze.single(h,d)}}}function EB(t,e,n,r){if(t.isComposite()){let i=-1,s=-1,a=-1,u=-1;for(let c=0,d=r,h=r;c<t.children.length;c++){let g=t.children[c],m=d+g.length;if(d<e&&m>n)return EB(g,e,n,d);if(m>=e&&i==-1&&(i=c,s=d),d>n&&g.dom.parentNode==t.dom){a=c,u=h;break}h=m,d=m+g.breakAfter}return{from:s,to:u<0?r+t.length:u,startDOM:(i?t.children[i-1].dom.nextSibling:null)||t.dom.firstChild,endDOM:a<t.children.length&&a>=0?t.children[a].dom:null}}else return t.isText()?{from:r,to:r+t.length,startDOM:t.dom,endDOM:t.dom.nextSibling}:null}function MB(t,e){let n,{newSel:r}=e,{state:i}=t,s=i.selection.main,a=t.inputState.lastKeyTime>Date.now()-100?t.inputState.lastKeyCode:-1;if(e.bounds){let{from:u,to:c}=e.bounds,d=s.from,h=null;(a===8||Ye.android&&e.text.length<c-u)&&(d=s.to,h="end");let g=i.doc.sliceString(u,c,uc),m,y;!s.empty&&s.from>=u&&s.to<=c&&(e.typeOver||g!=e.text)&&g.slice(0,s.from-u)==e.text.slice(0,s.from-u)&&g.slice(s.to-u)==e.text.slice(m=e.text.length-(g.length-(s.to-u)))?n={from:s.from,to:s.to,insert:Yt.of(e.text.slice(s.from-u,m).split(uc))}:(y=AB(g,e.text,d-u,h))&&(Ye.chrome&&a==13&&y.toB==y.from+2&&e.text.slice(y.from,y.toB)==uc+uc&&y.toB--,n={from:u+y.from,to:u+y.toA,insert:Yt.of(e.text.slice(y.from,y.toB).split(uc))})}else r&&(!t.hasFocus&&i.facet(Js)||bm(r,s))&&(r=null);if(!n&&!r)return!1;if((Ye.mac||Ye.android)&&n&&n.from==n.to&&n.from==s.head-1&&/^\. ?$/.test(n.insert.toString())&&t.contentDOM.getAttribute("autocorrect")=="off"?(r&&n.insert.length==2&&(r=ze.single(r.main.anchor-1,r.main.head-1)),n={from:n.from,to:n.to,insert:Yt.of([n.insert.toString().replace("."," ")])}):i.doc.lineAt(s.from).to<s.to&&t.docView.lineHasWidget(s.to)&&t.inputState.insertingTextAt>Date.now()-50?n={from:s.from,to:s.to,insert:i.toText(t.inputState.insertingText)}:Ye.chrome&&n&&n.from==n.to&&n.from==s.head&&n.insert.toString()==`
|
|
29
|
+
`&&t.lineWrapping&&(r&&(r=ze.single(r.main.anchor-1,r.main.head-1)),n={from:s.from,to:s.to,insert:Yt.of([" "])}),n)return sC(t,n,r,a);if(r&&!bm(r,s)){let u=!1,c="select";return t.inputState.lastSelectionTime>Date.now()-50&&(t.inputState.lastSelectionOrigin=="select"&&(u=!0),c=t.inputState.lastSelectionOrigin,c=="select.pointer"&&(r=TB(i.facet(yh).map(d=>d(t)),r))),t.dispatch({selection:r,scrollIntoView:u,userEvent:c}),!0}else return!1}function sC(t,e,n,r=-1){if(Ye.ios&&t.inputState.flushIOSKey(e))return!0;let i=t.state.selection.main;if(Ye.android&&(e.to==i.to&&(e.from==i.from||e.from==i.from-1&&t.state.sliceDoc(e.from,i.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&Rc(t.contentDOM,"Enter",13)||(e.from==i.from-1&&e.to==i.to&&e.insert.length==0||r==8&&e.insert.length<e.to-e.from&&e.to>i.head)&&Rc(t.contentDOM,"Backspace",8)||e.from==i.from&&e.to==i.to+1&&e.insert.length==0&&Rc(t.contentDOM,"Delete",46)))return!0;let s=e.insert.toString();t.inputState.composing>=0&&t.inputState.composing++;let a,u=()=>a||(a=aZ(t,e,n));return t.state.facet(hB).some(c=>c(t,e.from,e.to,s,u))||t.dispatch(u()),!0}function aZ(t,e,n){let r,i=t.state,s=i.selection.main,a=-1;if(e.from==e.to&&e.from<s.from||e.from>s.to){let c=e.from<s.from?-1:1,d=c<0?s.from:s.to,h=wd(i.facet(yh).map(g=>g(t)),d,c);e.from==h&&(a=h)}if(a>-1)r={changes:e,selection:ze.cursor(e.from+e.insert.length,-1)};else if(e.from>=s.from&&e.to<=s.to&&e.to-e.from>=(s.to-s.from)/3&&(!n||n.main.empty&&n.main.from==e.from+e.insert.length)&&t.inputState.composing<0){let c=s.from<e.from?i.sliceDoc(s.from,e.from):"",d=s.to>e.to?i.sliceDoc(e.to,s.to):"";r=i.replaceSelection(t.state.toText(c+e.insert.sliceString(0,void 0,t.state.lineBreak)+d))}else{let c=i.changes(e),d=n&&n.main.to<=c.newLength?n.main:void 0;if(i.selection.ranges.length>1&&(t.inputState.composing>=0||t.inputState.compositionPendingChange)&&e.to<=s.to+10&&e.to>=s.to-10){let h=t.state.sliceDoc(e.from,e.to),g,m=n&&RB(t,n.main.head);if(m){let b=e.insert.length-(e.to-e.from);g={from:m.from,to:m.to-b}}else g=t.state.doc.lineAt(s.head);let y=s.to-e.to;r=i.changeByRange(b=>{if(b.from==s.from&&b.to==s.to)return{changes:c,range:d||b.map(c)};let x=b.to-y,w=x-h.length;if(t.state.sliceDoc(w,x)!=h||x>=g.from&&w<=g.to)return{range:b};let C=i.changes({from:w,to:x,insert:e.insert}),T=b.to-s.to;return{changes:C,range:d?ze.range(Math.max(0,d.anchor+T),Math.max(0,d.head+T)):b.map(C)}})}else r={changes:c,selection:d&&i.selection.replaceRange(d)}}let u="input.type";return(t.composing||t.inputState.compositionPendingChange&&t.inputState.compositionEndedAt>Date.now()-50)&&(t.inputState.compositionPendingChange=!1,u+=".compose",t.inputState.compositionFirstChange&&(u+=".start",t.inputState.compositionFirstChange=!1)),i.update(r,{userEvent:u,scrollIntoView:!0})}function AB(t,e,n,r){let i=Math.min(t.length,e.length),s=0;for(;s<i&&t.charCodeAt(s)==e.charCodeAt(s);)s++;if(s==i&&t.length==e.length)return null;let a=t.length,u=e.length;for(;a>0&&u>0&&t.charCodeAt(a-1)==e.charCodeAt(u-1);)a--,u--;if(r=="end"){let c=Math.max(0,s-Math.min(a,u));n-=a+c-s}if(a<s&&t.length<e.length){let c=n<=s&&n>=a?s-n:0;s-=c,u=s+(u-a),a=s}else if(u<s){let c=n<=s&&n>=u?s-n:0;s-=c,a=s+(a-u),u=s}return{from:s,toA:a,toB:u}}function uZ(t){let e=[];if(t.root.activeElement!=t.contentDOM)return e;let{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:s}=t.observer.selectionRange;return n&&(e.push(new Nk(n,r)),(i!=n||s!=r)&&e.push(new Nk(i,s))),e}function cZ(t,e){if(t.length==0)return null;let n=t[0].pos,r=t.length==2?t[1].pos:n;return n>-1&&r>-1?ze.single(n+e,r+e):null}function bm(t,e){return e.head==t.main.head&&e.anchor==t.main.anchor}class fZ{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastTouchX=0,this.lastTouchY=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.lastWheelEvent=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText="",this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,Ye.safari&&e.contentDOM.addEventListener("input",()=>null),Ye.gecko&&EZ(e.contentDOM.ownerDocument)}handleEvent(e){!bZ(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||(this.view.updateState!=0?Promise.resolve().then(()=>this.runHandlers(e.type,e)):this.runHandlers(e.type,e))}runHandlers(e,n){let r=this.handlers[e];if(r){for(let i of r.observers)i(this.view,n);for(let i of r.handlers){if(n.defaultPrevented)break;if(i(this.view,n)){n.preventDefault();break}}}}ensureHandlers(e){let n=dZ(e),r=this.handlers,i=this.view.contentDOM;for(let s in n)if(s!="scroll"){let a=!n[s].handlers.length,u=r[s];u&&a!=!u.handlers.length&&(i.removeEventListener(s,this.handleEvent),u=null),u||i.addEventListener(s,this.handleEvent,{passive:a})}for(let s in r)s!="scroll"&&!n[s]&&i.removeEventListener(s,this.handleEvent);this.handlers=n}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&kB.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),Ye.android&&Ye.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let n;return Ye.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&!e.shiftKey&&((n=OB.find(r=>r.keyCode==e.keyCode))&&!e.ctrlKey||hZ.indexOf(e.key)>-1&&e.ctrlKey)?(this.pendingIOSKey=n||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(e){let n=this.pendingIOSKey;return!n||n.key=="Enter"&&e&&e.from<e.to&&/^\S+$/.test(e.insert.toString())?!1:(this.pendingIOSKey=void 0,Rc(this.view.contentDOM,n.key,n.keyCode,n instanceof KeyboardEvent?n:void 0))}ignoreDuringComposition(e){return!/^key/.test(e.type)||e.synthetic?!1:this.composing>0?!0:Ye.safari&&!Ye.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function Lk(t,e){return(n,r)=>{try{return e.call(t,r,n)}catch(i){bs(n.state,i)}}}function dZ(t){let e=Object.create(null);function n(r){return e[r]||(e[r]={observers:[],handlers:[]})}for(let r of t){let i=r.spec,s=i&&i.plugin.domEventHandlers,a=i&&i.plugin.domEventObservers;if(s)for(let u in s){let c=s[u];c&&n(u).handlers.push(Lk(r.value,c))}if(a)for(let u in a){let c=a[u];c&&n(u).observers.push(Lk(r.value,c))}}for(let r in Vo)n(r).handlers.push(Vo[r]);for(let r in Ri)n(r).observers.push(Ri[r]);return e}const OB=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],hZ="dthko",kB=[16,17,18,20,91,92,224,225],dg=6;function hg(t){return Math.max(0,t)*.7+8}function pZ(t,e){return Math.max(Math.abs(t.clientX-e.clientX),Math.abs(t.clientY-e.clientY))}class gZ{constructor(e,n,r,i){this.view=e,this.startEvent=n,this.style=r,this.mustSelect=i,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=n,this.scrollParents=JL(e.contentDOM),this.atoms=e.state.facet(yh).map(a=>a(e));let s=e.contentDOM.ownerDocument;s.addEventListener("mousemove",this.move=this.move.bind(this)),s.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=n.shiftKey,this.multiple=e.state.facet(an.allowMultipleSelections)&&mZ(e,n),this.dragging=vZ(e,n)&&PB(n)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&pZ(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let n=0,r=0,i=0,s=0,a=this.view.win.innerWidth,u=this.view.win.innerHeight;this.scrollParents.x&&({left:i,right:a}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:s,bottom:u}=this.scrollParents.y.getBoundingClientRect());let c=wB(this.view);e.clientX-c.left<=i+dg?n=-hg(i-e.clientX):e.clientX+c.right>=a-dg&&(n=hg(e.clientX-a)),e.clientY-c.top<=s+dg?r=-hg(s-e.clientY):e.clientY+c.bottom>=u-dg&&(r=hg(e.clientY-u)),this.setScrollSpeed(n,r)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,n){this.scrollSpeed={x:e,y:n},e||n?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:n}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),n&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=n,n=0),(e||n)&&this.view.win.scrollBy(e,n),this.dragging===!1&&this.select(this.lastEvent)}select(e){let{view:n}=this,r=TB(this.atoms,this.style.get(e,this.extend,this.multiple));(this.mustSelect||!r.eq(n.state.selection,this.dragging===!1))&&this.view.dispatch({selection:r,userEvent:"select.pointer"}),this.mustSelect=!1}update(e){e.transactions.some(n=>n.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}function mZ(t,e){let n=t.state.facet(uB);return n.length?n[0](e):Ye.mac?e.metaKey:e.ctrlKey}function yZ(t,e){let n=t.state.facet(cB);return n.length?n[0](e):Ye.mac?!e.altKey:!e.ctrlKey}function vZ(t,e){let{main:n}=t.state.selection;if(n.empty)return!1;let r=Kd(t.root);if(!r||r.rangeCount==0)return!0;let i=r.getRangeAt(0).getClientRects();for(let s=0;s<i.length;s++){let a=i[s];if(a.left<=e.clientX&&a.right>=e.clientX&&a.top<=e.clientY&&a.bottom>=e.clientY)return!0}return!1}function bZ(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target,r;n!=t.contentDOM;n=n.parentNode)if(!n||n.nodeType==11||(r=Xn.get(n))&&r.isWidget()&&!r.isHidden&&r.widget.ignoreEvent(e))return!1;return!0}const Vo=Object.create(null),Ri=Object.create(null),IB=Ye.ie&&Ye.ie_version<15||Ye.ios&&Ye.webkit_version<604;function xZ(t){let e=t.dom.parentNode;if(!e)return;let n=e.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus(),setTimeout(()=>{t.focus(),n.remove(),DB(t,n.value)},50)}function wy(t,e,n){for(let r of t.facet(e))n=r(n,t);return n}function DB(t,e){e=wy(t.state,nC,e);let{state:n}=t,r,i=1,s=n.toText(e),a=s.lines==n.selection.ranges.length;if(FS!=null&&n.selection.ranges.every(c=>c.empty)&&FS==s.toString()){let c=-1;r=n.changeByRange(d=>{let h=n.doc.lineAt(d.from);if(h.from==c)return{range:d};c=h.from;let g=n.toText((a?s.line(i++).text:e)+n.lineBreak);return{changes:{from:h.from,insert:g},range:ze.cursor(d.from+g.length)}})}else a?r=n.changeByRange(c=>{let d=s.line(i++);return{changes:{from:c.from,to:c.to,insert:d.text},range:ze.cursor(c.from+d.length)}}):r=n.replaceSelection(s);t.dispatch(r,{userEvent:"input.paste",scrollIntoView:!0})}Ri.scroll=t=>{t.inputState.lastScrollTop=t.scrollDOM.scrollTop,t.inputState.lastScrollLeft=t.scrollDOM.scrollLeft};Ri.wheel=Ri.mousewheel=t=>{t.inputState.lastWheelEvent=Date.now()};Vo.keydown=(t,e)=>(t.inputState.setSelectionOrigin("select"),e.keyCode==27&&t.inputState.tabFocusMode!=0&&(t.inputState.tabFocusMode=Date.now()+2e3),!1);Ri.touchstart=(t,e)=>{let n=t.inputState,r=e.targetTouches[0];n.lastTouchTime=Date.now(),r&&(n.lastTouchX=r.clientX,n.lastTouchY=r.clientY),n.setSelectionOrigin("select.pointer")};Ri.touchmove=t=>{t.inputState.setSelectionOrigin("select.pointer")};Vo.mousedown=(t,e)=>{if(t.observer.flush(),t.inputState.lastTouchTime>Date.now()-2e3)return!1;let n=null;for(let r of t.state.facet(fB))if(n=r(t,e),n)break;if(!n&&e.button==0&&(n=wZ(t,e)),n){let r=!t.hasFocus;t.inputState.startMouseSelection(new gZ(t,e,n,r)),r&&t.observer.ignore(()=>{eB(t.contentDOM);let s=t.root.activeElement;s&&!s.contains(t.contentDOM)&&s.blur()});let i=t.inputState.mouseSelection;if(i)return i.start(e),i.dragging===!1}else t.inputState.setSelectionOrigin("select.pointer");return!1};function Bk(t,e,n,r){if(r==1)return ze.cursor(e,n);if(r==2)return QQ(t.state,e,n);{let i=t.docView.lineAt(e,n),s=t.state.doc.lineAt(i?i.posAtEnd:e),a=i?i.posAtStart:s.from,u=i?i.posAtEnd:s.to;return u<t.state.doc.length&&u==s.to&&u++,ze.range(a,u)}}const SZ=Ye.ie&&Ye.ie_version<=11;let jk=null,_k=0,Hk=0;function PB(t){if(!SZ)return t.detail;let e=jk,n=Hk;return jk=t,Hk=Date.now(),_k=!e||n>Date.now()-400&&Math.abs(e.clientX-t.clientX)<2&&Math.abs(e.clientY-t.clientY)<2?(_k+1)%3:1}function wZ(t,e){let n=t.posAndSideAtCoords({x:e.clientX,y:e.clientY},!1),r=PB(e),i=t.state.selection;return{update(s){s.docChanged&&(n.pos=s.changes.mapPos(n.pos),i=i.map(s.changes))},get(s,a,u){let c=t.posAndSideAtCoords({x:s.clientX,y:s.clientY},!1),d,h=Bk(t,c.pos,c.assoc,r);if(n.pos!=c.pos&&!a){let g=Bk(t,n.pos,n.assoc,r),m=Math.min(g.from,h.from),y=Math.max(g.to,h.to);h=m<h.from?ze.range(m,y,h.assoc):ze.range(y,m,h.assoc)}return a?i.replaceRange(i.main.extend(h.from,h.to,h.assoc)):u&&r==1&&i.ranges.length>1&&(d=CZ(i,c.pos))?d:u?i.addRange(h):ze.create([h])}}}function CZ(t,e){for(let n=0;n<t.ranges.length;n++){let{from:r,to:i}=t.ranges[n];if(r<=e&&i>=e)return ze.create(t.ranges.slice(0,n).concat(t.ranges.slice(n+1)),t.mainIndex==n?0:t.mainIndex-(t.mainIndex>n?1:0))}return null}Vo.dragstart=(t,e)=>{let{selection:{main:n}}=t.state;if(e.target.draggable){let i=t.docView.tile.nearest(e.target);if(i&&i.isWidget()){let s=i.posAtStart,a=s+i.length;(s>=n.to||a<=n.from)&&(n=ze.range(s,a))}}let{inputState:r}=t;return r.mouseSelection&&(r.mouseSelection.dragging=!0),r.draggedContent=n,e.dataTransfer&&(e.dataTransfer.setData("Text",wy(t.state,rC,t.state.sliceDoc(n.from,n.to))),e.dataTransfer.effectAllowed="copyMove"),!1};Vo.dragend=t=>(t.inputState.draggedContent=null,!1);function Vk(t,e,n,r){if(n=wy(t.state,nC,n),!n)return;let i=t.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:s}=t.inputState,a=r&&s&&yZ(t,e)?{from:s.from,to:s.to}:null,u={from:i,insert:n},c=t.state.changes(a?[a,u]:u);t.focus(),t.dispatch({changes:c,selection:{anchor:c.mapPos(i,-1),head:c.mapPos(i,1)},userEvent:a?"move.drop":"input.drop"}),t.inputState.draggedContent=null}Vo.drop=(t,e)=>{if(!e.dataTransfer)return!1;if(t.state.readOnly)return!0;let n=e.dataTransfer.files;if(n&&n.length){let r=Array(n.length),i=0,s=()=>{++i==n.length&&Vk(t,e,r.filter(a=>a!=null).join(t.state.lineBreak),!1)};for(let a=0;a<n.length;a++){let u=new FileReader;u.onerror=s,u.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(u.result)||(r[a]=u.result),s()},u.readAsText(n[a])}return!0}else{let r=e.dataTransfer.getData("Text");if(r)return Vk(t,e,r,!0),!0}return!1};Vo.paste=(t,e)=>{if(t.state.readOnly)return!0;t.observer.flush();let n=IB?null:e.clipboardData;return n?(DB(t,n.getData("text/plain")||n.getData("text/uri-list")),!0):(xZ(t),!1)};function RZ(t,e){let n=t.dom.parentNode;if(!n)return;let r=n.appendChild(document.createElement("textarea"));r.style.cssText="position: fixed; left: -10000px; top: 10px",r.value=e,r.focus(),r.selectionEnd=e.length,r.selectionStart=0,setTimeout(()=>{r.remove(),t.focus()},50)}function TZ(t){let e=[],n=[],r=!1;for(let i of t.selection.ranges)i.empty||(e.push(t.sliceDoc(i.from,i.to)),n.push(i));if(!e.length){let i=-1;for(let{from:s}of t.selection.ranges){let a=t.doc.lineAt(s);a.number>i&&(e.push(a.text),n.push({from:a.from,to:Math.min(t.doc.length,a.to+1)})),i=a.number}r=!0}return{text:wy(t,rC,e.join(t.lineBreak)),ranges:n,linewise:r}}let FS=null;Vo.copy=Vo.cut=(t,e)=>{if(!xd(t.contentDOM,t.observer.selectionRange))return!1;let{text:n,ranges:r,linewise:i}=TZ(t.state);if(!n&&!i)return!1;FS=i?n:null,e.type=="cut"&&!t.state.readOnly&&t.dispatch({changes:r,scrollIntoView:!0,userEvent:"delete.cut"});let s=IB?null:e.clipboardData;return s?(s.clearData(),s.setData("text/plain",n),!0):(RZ(t,n),!1)};const zB=Ea.define();function NB(t,e){let n=[];for(let r of t.facet(pB)){let i=r(t,e);i&&n.push(i)}return n.length?t.update({effects:n,annotations:zB.of(!0)}):null}function LB(t){setTimeout(()=>{let e=t.hasFocus;if(e!=t.inputState.notifiedFocused){let n=NB(t.state,e);n?t.dispatch(n):t.update([])}},10)}Ri.focus=t=>{t.inputState.lastFocusTime=Date.now(),!t.scrollDOM.scrollTop&&(t.inputState.lastScrollTop||t.inputState.lastScrollLeft)&&(t.scrollDOM.scrollTop=t.inputState.lastScrollTop,t.scrollDOM.scrollLeft=t.inputState.lastScrollLeft),LB(t)};Ri.blur=t=>{t.observer.clearSelectionRange(),LB(t)};Ri.compositionstart=Ri.compositionupdate=t=>{t.observer.editContext||(t.inputState.compositionFirstChange==null&&(t.inputState.compositionFirstChange=!0),t.inputState.composing<0&&(t.inputState.composing=0))};Ri.compositionend=t=>{t.observer.editContext||(t.inputState.composing=-1,t.inputState.compositionEndedAt=Date.now(),t.inputState.compositionPendingKey=!0,t.inputState.compositionPendingChange=t.observer.pendingRecords().length>0,t.inputState.compositionFirstChange=null,Ye.chrome&&Ye.android?t.observer.flushSoon():t.inputState.compositionPendingChange?Promise.resolve().then(()=>t.observer.flush()):setTimeout(()=>{t.inputState.composing<0&&t.docView.hasComposition&&t.update([])},50))};Ri.contextmenu=t=>{t.inputState.lastContextMenu=Date.now()};Vo.beforeinput=(t,e)=>{var n,r;if((e.inputType=="insertText"||e.inputType=="insertCompositionText")&&(t.inputState.insertingText=e.data,t.inputState.insertingTextAt=Date.now()),e.inputType=="insertReplacementText"&&t.observer.editContext){let s=(n=e.dataTransfer)===null||n===void 0?void 0:n.getData("text/plain"),a=e.getTargetRanges();if(s&&a.length){let u=a[0],c=t.posAtDOM(u.startContainer,u.startOffset),d=t.posAtDOM(u.endContainer,u.endOffset);return sC(t,{from:c,to:d,insert:t.state.toText(s)},null),!0}}let i;if(Ye.chrome&&Ye.android&&(i=OB.find(s=>s.inputType==e.inputType))&&(t.observer.delayAndroidKey(i.key,i.keyCode),i.key=="Backspace"||i.key=="Delete")){let s=((r=window.visualViewport)===null||r===void 0?void 0:r.height)||0;setTimeout(()=>{var a;(((a=window.visualViewport)===null||a===void 0?void 0:a.height)||0)>s+10&&t.hasFocus&&(t.contentDOM.blur(),t.focus())},100)}return Ye.ios&&e.inputType=="deleteContentForward"&&t.observer.flushSoon(),Ye.safari&&e.inputType=="insertText"&&t.inputState.composing>=0&&setTimeout(()=>Ri.compositionend(t,e),20),!1};const Fk=new Set;function EZ(t){Fk.has(t)||(Fk.add(t),t.addEventListener("copy",()=>{}),t.addEventListener("cut",()=>{}))}const Uk=["pre-wrap","normal","pre-line","break-spaces"];let _c=!1;function $k(){_c=!1}class MZ{constructor(e){this.lineWrapping=e,this.doc=Yt.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,n){let r=this.doc.lineAt(n).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(r+=Math.max(0,Math.ceil((n-e-r*this.lineLength*.5)/this.lineLength))),this.lineHeight*r}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return Uk.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let n=!1;for(let r=0;r<e.length;r++){let i=e[r];i<0?r++:this.heightSamples[Math.floor(i*10)]||(n=!0,this.heightSamples[Math.floor(i*10)]=!0)}return n}refresh(e,n,r,i,s,a){let u=Uk.indexOf(e)>-1,c=Math.abs(n-this.lineHeight)>.3||this.lineWrapping!=u||Math.abs(r-this.charWidth)>.1;if(this.lineWrapping=u,this.lineHeight=n,this.charWidth=r,this.textHeight=i,this.lineLength=s,c){this.heightSamples={};for(let d=0;d<a.length;d++){let h=a[d];h<0?d++:this.heightSamples[Math.floor(h*10)]=!0}}return c}}class AZ{constructor(e,n){this.from=e,this.heights=n,this.index=0}get more(){return this.index<this.heights.length}}class Do{constructor(e,n,r,i,s){this.from=e,this.length=n,this.top=r,this.height=i,this._content=s}get type(){return typeof this._content=="number"?fo.Text:Array.isArray(this._content)?this._content:this._content.type}get to(){return this.from+this.length}get bottom(){return this.top+this.height}get widget(){return this._content instanceof vu?this._content.widget:null}get widgetLineBreaks(){return typeof this._content=="number"?this._content:0}join(e){let n=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(e._content)?e._content:[e]);return new Do(this.from,this.length+e.length,this.top,this.height+e.height,n)}}var In=(function(t){return t[t.ByPos=0]="ByPos",t[t.ByHeight=1]="ByHeight",t[t.ByPosNoHeight=2]="ByPosNoHeight",t})(In||(In={}));const _g=.001;class ai{constructor(e,n,r=2){this.length=e,this.height=n,this.flags=r}get outdated(){return(this.flags&2)>0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>_g&&(_c=!0),this.height=e)}replace(e,n,r){return ai.of(r)}decomposeLeft(e,n){n.push(this)}decomposeRight(e,n){n.push(this)}applyChanges(e,n,r,i){let s=this,a=r.doc;for(let u=i.length-1;u>=0;u--){let{fromA:c,toA:d,fromB:h,toB:g}=i[u],m=s.lineAt(c,In.ByPosNoHeight,r.setDoc(n),0,0),y=m.to>=d?m:s.lineAt(d,In.ByPosNoHeight,r,0,0);for(g+=y.to-d,d=y.to;u>0&&m.from<=i[u-1].toA;)c=i[u-1].fromA,h=i[u-1].fromB,u--,c<m.from&&(m=s.lineAt(c,In.ByPosNoHeight,r,0,0));h+=m.from-c,c=m.from;let b=lC.build(r.setDoc(a),e,h,g);s=xm(s,s.replace(c,d,b))}return s.updateHeight(r,0)}static empty(){return new zi(0,0,0)}static of(e){if(e.length==1)return e[0];let n=0,r=e.length,i=0,s=0;for(;;)if(n==r)if(i>s*2){let u=e[n-1];u.break?e.splice(--n,1,u.left,null,u.right):e.splice(--n,1,u.left,u.right),r+=1+u.break,i-=u.size}else if(s>i*2){let u=e[r];u.break?e.splice(r,1,u.left,null,u.right):e.splice(r,1,u.left,u.right),r+=2+u.break,s-=u.size}else break;else if(i<s){let u=e[n++];u&&(i+=u.size)}else{let u=e[--r];u&&(s+=u.size)}let a=0;return e[n-1]==null?(a=1,n--):e[n]==null&&(a=1,r++),new kZ(ai.of(e.slice(0,n)),a,ai.of(e.slice(r)))}}function xm(t,e){return t==e?t:(t.constructor!=e.constructor&&(_c=!0),e)}ai.prototype.size=1;const OZ=Jr.replace({});class BB extends ai{constructor(e,n,r){super(e,n),this.deco=r,this.spaceAbove=0}mainBlock(e,n){return new Do(n,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.deco||0)}blockAt(e,n,r,i){return this.spaceAbove&&e<r+this.spaceAbove?new Do(i,0,r,this.spaceAbove,OZ):this.mainBlock(r,i)}lineAt(e,n,r,i,s){let a=this.mainBlock(i,s);return this.spaceAbove?this.blockAt(0,r,i,s).join(a):a}forEachLine(e,n,r,i,s,a){e<=s+this.length&&n>=s&&a(this.lineAt(0,In.ByPos,r,i,s))}setMeasuredHeight(e){let n=e.heights[e.index++];n<0?(this.spaceAbove=-n,n=e.heights[e.index++]):this.spaceAbove=0,this.setHeight(n)}updateHeight(e,n=0,r=!1,i){return i&&i.from<=n&&i.more&&this.setMeasuredHeight(i),this.outdated=!1,this}toString(){return`block(${this.length})`}}class zi extends BB{constructor(e,n,r){super(e,n,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=r}mainBlock(e,n){return new Do(n,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(e,n,r){let i=r[0];return r.length==1&&(i instanceof zi||i instanceof zr&&i.flags&4)&&Math.abs(this.length-i.length)<10?(i instanceof zr?i=new zi(i.length,this.height,this.spaceAbove):i.height=this.height,this.outdated||(i.outdated=!1),i):ai.of(r)}updateHeight(e,n=0,r=!1,i){return i&&i.from<=n&&i.more?this.setMeasuredHeight(i):(r||this.outdated)&&(this.spaceAbove=0,this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight)),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class zr extends ai{constructor(e){super(e,0)}heightMetrics(e,n){let r=e.doc.lineAt(n).number,i=e.doc.lineAt(n+this.length).number,s=i-r+1,a,u=0;if(e.lineWrapping){let c=Math.min(this.height,e.lineHeight*s);a=c/s,this.length>s+1&&(u=(this.height-c)/(this.length-s-1))}else a=this.height/s;return{firstLine:r,lastLine:i,perLine:a,perChar:u}}blockAt(e,n,r,i){let{firstLine:s,lastLine:a,perLine:u,perChar:c}=this.heightMetrics(n,i);if(n.lineWrapping){let d=i+(e<n.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-r)/this.height))*this.length)),h=n.doc.lineAt(d),g=u+h.length*c,m=Math.max(r,e-g/2);return new Do(h.from,h.length,m,g,0)}else{let d=Math.max(0,Math.min(a-s,Math.floor((e-r)/u))),{from:h,length:g}=n.doc.line(s+d);return new Do(h,g,r+u*d,u,0)}}lineAt(e,n,r,i,s){if(n==In.ByHeight)return this.blockAt(e,r,i,s);if(n==In.ByPosNoHeight){let{from:y,to:b}=r.doc.lineAt(e);return new Do(y,b-y,0,0,0)}let{firstLine:a,perLine:u,perChar:c}=this.heightMetrics(r,s),d=r.doc.lineAt(e),h=u+d.length*c,g=d.number-a,m=i+u*g+c*(d.from-s-g);return new Do(d.from,d.length,Math.max(i,Math.min(m,i+this.height-h)),h,0)}forEachLine(e,n,r,i,s,a){e=Math.max(e,s),n=Math.min(n,s+this.length);let{firstLine:u,perLine:c,perChar:d}=this.heightMetrics(r,s);for(let h=e,g=i;h<=n;){let m=r.doc.lineAt(h);if(h==e){let b=m.number-u;g+=c*b+d*(e-s-b)}let y=c+d*m.length;a(new Do(m.from,m.length,g,y,0)),g+=y,h=m.to+1}}replace(e,n,r){let i=this.length-n;if(i>0){let s=r[r.length-1];s instanceof zr?r[r.length-1]=new zr(s.length+i):r.push(null,new zr(i-1))}if(e>0){let s=r[0];s instanceof zr?r[0]=new zr(e+s.length):r.unshift(new zr(e-1),null)}return ai.of(r)}decomposeLeft(e,n){n.push(new zr(e-1),null)}decomposeRight(e,n){n.push(null,new zr(this.length-e-1))}updateHeight(e,n=0,r=!1,i){let s=n+this.length;if(i&&i.from<=n+this.length&&i.more){let a=[],u=Math.max(n,i.from),c=-1;for(i.from>n&&a.push(new zr(i.from-n-1).updateHeight(e,n));u<=s&&i.more;){let h=e.doc.lineAt(u).length;a.length&&a.push(null);let g=i.heights[i.index++],m=0;g<0&&(m=-g,g=i.heights[i.index++]),c==-1?c=g:Math.abs(g-c)>=_g&&(c=-2);let y=new zi(h,g,m);y.outdated=!1,a.push(y),u+=h+1}u<=s&&a.push(null,new zr(s-u).updateHeight(e,u));let d=ai.of(a);return(c<0||Math.abs(d.height-this.height)>=_g||Math.abs(c-this.heightMetrics(e,n).perLine)>=_g)&&(_c=!0),xm(this,d)}else(r||this.outdated)&&(this.setHeight(e.heightForGap(n,n+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class kZ extends ai{constructor(e,n,r){super(e.length+n+r.length,e.height+r.height,n|(e.outdated||r.outdated?2:0)),this.left=e,this.right=r,this.size=e.size+r.size}get break(){return this.flags&1}blockAt(e,n,r,i){let s=r+this.left.height;return e<s?this.left.blockAt(e,n,r,i):this.right.blockAt(e,n,s,i+this.left.length+this.break)}lineAt(e,n,r,i,s){let a=i+this.left.height,u=s+this.left.length+this.break,c=n==In.ByHeight?e<a:e<u,d=c?this.left.lineAt(e,n,r,i,s):this.right.lineAt(e,n,r,a,u);if(this.break||(c?d.to<u:d.from>u))return d;let h=n==In.ByPosNoHeight?In.ByPosNoHeight:In.ByPos;return c?d.join(this.right.lineAt(u,h,r,a,u)):this.left.lineAt(u,h,r,i,s).join(d)}forEachLine(e,n,r,i,s,a){let u=i+this.left.height,c=s+this.left.length+this.break;if(this.break)e<c&&this.left.forEachLine(e,n,r,i,s,a),n>=c&&this.right.forEachLine(e,n,r,u,c,a);else{let d=this.lineAt(c,In.ByPos,r,i,s);e<d.from&&this.left.forEachLine(e,d.from-1,r,i,s,a),d.to>=e&&d.from<=n&&a(d),n>d.to&&this.right.forEachLine(d.to+1,n,r,u,c,a)}}replace(e,n,r){let i=this.left.length+this.break;if(n<i)return this.balanced(this.left.replace(e,n,r),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-i,n-i,r));let s=[];e>0&&this.decomposeLeft(e,s);let a=s.length;for(let u of r)s.push(u);if(e>0&&qk(s,a-1),n<this.length){let u=s.length;this.decomposeRight(n,s),qk(s,u)}return ai.of(s)}decomposeLeft(e,n){let r=this.left.length;if(e<=r)return this.left.decomposeLeft(e,n);n.push(this.left),this.break&&(r++,e>=r&&n.push(null)),e>r&&this.right.decomposeLeft(e-r,n)}decomposeRight(e,n){let r=this.left.length,i=r+this.break;if(e>=i)return this.right.decomposeRight(e-i,n);e<r&&this.left.decomposeRight(e,n),this.break&&e<i&&n.push(null),n.push(this.right)}balanced(e,n){return e.size>2*n.size||n.size>2*e.size?ai.of(this.break?[e,null,n]:[e,n]):(this.left=xm(this.left,e),this.right=xm(this.right,n),this.setHeight(e.height+n.height),this.outdated=e.outdated||n.outdated,this.size=e.size+n.size,this.length=e.length+this.break+n.length,this)}updateHeight(e,n=0,r=!1,i){let{left:s,right:a}=this,u=n+s.length+this.break,c=null;return i&&i.from<=n+s.length&&i.more?c=s=s.updateHeight(e,n,r,i):s.updateHeight(e,n,r),i&&i.from<=u+a.length&&i.more?c=a=a.updateHeight(e,u,r,i):a.updateHeight(e,u,r),c?this.balanced(s,a):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function qk(t,e){let n,r;t[e]==null&&(n=t[e-1])instanceof zr&&(r=t[e+1])instanceof zr&&t.splice(e-1,3,new zr(n.length+1+r.length))}const IZ=5;class lC{constructor(e,n){this.pos=e,this.oracle=n,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,n){if(this.lineStart>-1){let r=Math.min(n,this.lineEnd),i=this.nodes[this.nodes.length-1];i instanceof zi?i.length+=r-this.pos:(r>this.pos||!this.isCovered)&&this.nodes.push(new zi(r-this.pos,-1,0)),this.writtenTo=r,n>r&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=n}point(e,n,r){if(e<n||r.heightRelevant){let i=r.widget?r.widget.estimatedHeight:0,s=r.widget?r.widget.lineBreaks:0;i<0&&(i=this.oracle.lineHeight);let a=n-e;r.block?this.addBlock(new BB(a,i,r)):(a||s||i>=IZ)&&this.addLineDeco(i,s,a)}else n>e&&this.span(e,n);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:e,to:n}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=n,this.writtenTo<e&&((this.writtenTo<e-1||this.nodes[this.nodes.length-1]==null)&&this.nodes.push(this.blankContent(this.writtenTo,e-1)),this.nodes.push(null)),this.pos>e&&this.nodes.push(new zi(this.pos-e,-1,0)),this.writtenTo=this.pos}blankContent(e,n){let r=new zr(n-e);return this.oracle.doc.lineAt(e).to==n&&(r.flags|=4),r}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof zi)return e;let n=new zi(0,-1,0);return this.nodes.push(n),n}addBlock(e){this.enterLine();let n=e.deco;n&&n.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,n&&n.endSide>0&&(this.covering=e)}addLineDeco(e,n,r){let i=this.ensureLine();i.length+=r,i.collapsed+=r,i.widgetHeight=Math.max(i.widgetHeight,e),i.breaks+=n,this.writtenTo=this.pos=this.pos+r}finish(e){let n=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(n instanceof zi)&&!this.isCovered?this.nodes.push(new zi(0,-1,0)):(this.writtenTo<this.pos||n==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let r=e;for(let i of this.nodes)i instanceof zi&&i.updateHeight(this.oracle,r),r+=i?i.length:1;return this.nodes}static build(e,n,r,i){let s=new lC(r,e);return pn.spans(n,r,i,s,0),s.finish(r)}}function DZ(t,e,n){let r=new PZ;return pn.compare(t,e,n,r,0),r.changes}class PZ{constructor(){this.changes=[]}compareRange(){}comparePoint(e,n,r,i){(e<n||r&&r.heightRelevant||i&&i.heightRelevant)&&Cc(e,n,this.changes,5)}}function zZ(t,e){let n=t.getBoundingClientRect(),r=t.ownerDocument,i=r.defaultView||window,s=Math.max(0,n.left),a=Math.min(i.innerWidth,n.right),u=Math.max(0,n.top),c=Math.min(i.innerHeight,n.bottom);for(let d=t.parentNode;d&&d!=r.body;)if(d.nodeType==1){let h=d,g=window.getComputedStyle(h);if((h.scrollHeight>h.clientHeight||h.scrollWidth>h.clientWidth)&&g.overflow!="visible"){let m=h.getBoundingClientRect();s=Math.max(s,m.left),a=Math.min(a,m.right),u=Math.max(u,m.top),c=Math.min(d==t.parentNode?i.innerHeight:c,m.bottom)}d=g.position=="absolute"||g.position=="fixed"?h.offsetParent:h.parentNode}else if(d.nodeType==11)d=d.host;else break;return{left:s-n.left,right:Math.max(s,a)-n.left,top:u-(n.top+e),bottom:Math.max(u,c)-(n.top+e)}}function NZ(t){let e=t.getBoundingClientRect(),n=t.ownerDocument.defaultView||window;return e.left<n.innerWidth&&e.right>0&&e.top<n.innerHeight&&e.bottom>0}function LZ(t,e){let n=t.getBoundingClientRect();return{left:0,right:n.right-n.left,top:e,bottom:n.bottom-(n.top+e)}}class qb{constructor(e,n,r,i){this.from=e,this.to=n,this.size=r,this.displaySize=i}static same(e,n){if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++){let i=e[r],s=n[r];if(i.from!=s.from||i.to!=s.to||i.size!=s.size)return!1}return!0}draw(e,n){return Jr.replace({widget:new BZ(this.displaySize*(n?e.scaleY:e.scaleX),n)}).range(this.from,this.to)}}class BZ extends vy{constructor(e,n){super(),this.size=e,this.vertical=n}eq(e){return e.size==this.size&&e.vertical==this.vertical}toDOM(){let e=document.createElement("div");return this.vertical?e.style.height=this.size+"px":(e.style.width=this.size+"px",e.style.height="2px",e.style.display="inline-block"),e}get estimatedHeight(){return this.vertical?this.size:-1}}class Gk{constructor(e,n){this.view=e,this.state=n,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scaleX=1,this.scaleY=1,this.scrollOffset=0,this.scrolledToBottom=!1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=Wk,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=mr.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let r=n.facet(iC).some(i=>typeof i!="function"&&i.class=="cm-lineWrapping");this.heightOracle=new MZ(r),this.stateDeco=Kk(n),this.heightMap=ai.empty().applyChanges(this.stateDeco,Yt.empty,this.heightOracle.setDoc(n.doc),[new lo(0,0,0,n.doc.length)]);for(let i=0;i<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());i++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=Jr.set(this.lineGaps.map(i=>i.draw(this,!1))),this.scrollParent=e.scrollDOM,this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:n}=this.state.selection;for(let r=0;r<=1;r++){let i=r?n.head:n.anchor;if(!e.some(({from:s,to:a})=>i>=s&&i<=a)){let{from:s,to:a}=this.lineBlockAt(i);e.push(new pg(s,a))}}return this.viewports=e.sort((r,i)=>r.from-i.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?Wk:new aC(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(ud(e,this.scaler))})}update(e,n=null){this.state=e.state;let r=this.stateDeco;this.stateDeco=Kk(this.state);let i=e.changedRanges,s=lo.extendWithRanges(i,DZ(r,this.stateDeco,e?e.changes:wr.empty(this.state.doc.length))),a=this.heightMap.height,u=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollOffset);$k(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),s),(this.heightMap.height!=a||_c)&&(e.flags|=2),u?(this.scrollAnchorPos=e.changes.mapPos(u.from,-1),this.scrollAnchorHeight=u.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=a);let c=s.length?this.mapViewport(this.viewport,e.changes):this.viewport;(n&&(n.range.head<c.from||n.range.head>c.to)||!this.viewportIsAppropriate(c))&&(c=this.getViewport(0,n));let d=c.from!=this.viewport.from||c.to!=this.viewport.to;this.viewport=c,e.flags|=this.updateForViewport(),(d||!e.changes.empty||e.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),n&&(this.scrollTarget=n),!this.mustEnforceCursorAssoc&&(e.selectionSet||e.focusChanged)&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(AQ)&&(this.mustEnforceCursorAssoc=!0)}measure(){let{view:e}=this,n=e.contentDOM,r=window.getComputedStyle(n),i=this.heightOracle,s=r.whiteSpace;this.defaultTextDirection=r.direction=="rtl"?mr.RTL:mr.LTR;let a=this.heightOracle.mustRefreshForWrapping(s)||this.mustMeasureContent==="refresh",u=n.getBoundingClientRect(),c=a||this.mustMeasureContent||this.contentDOMHeight!=u.height;this.contentDOMHeight=u.height,this.mustMeasureContent=!1;let d=0,h=0;if(u.width&&u.height){let{scaleX:k,scaleY:P}=ZL(n,u);(k>.005&&Math.abs(this.scaleX-k)>.005||P>.005&&Math.abs(this.scaleY-P)>.005)&&(this.scaleX=k,this.scaleY=P,d|=16,a=c=!0)}let g=(parseInt(r.paddingTop)||0)*this.scaleY,m=(parseInt(r.paddingBottom)||0)*this.scaleY;(this.paddingTop!=g||this.paddingBottom!=m)&&(this.paddingTop=g,this.paddingBottom=m,d|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(i.lineWrapping&&(c=!0),this.editorWidth=e.scrollDOM.clientWidth,d|=16);let y=JL(this.view.contentDOM,!1).y;y!=this.scrollParent&&(this.scrollParent=y,this.scrollAnchorHeight=-1,this.scrollOffset=0);let b=this.getScrollOffset();this.scrollOffset!=b&&(this.scrollAnchorHeight=-1,this.scrollOffset=b),this.scrolledToBottom=tB(this.scrollParent||e.win);let x=(this.printing?LZ:zZ)(n,this.paddingTop),w=x.top-this.pixelViewport.top,C=x.bottom-this.pixelViewport.bottom;this.pixelViewport=x;let T=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(T!=this.inView&&(this.inView=T,T&&(c=!0)),!this.inView&&!this.scrollTarget&&!NZ(e.dom))return 0;let E=u.width;if((this.contentDOMWidth!=E||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=u.width,this.editorHeight=e.scrollDOM.clientHeight,d|=16),c){let k=e.docView.measureVisibleLineHeights(this.viewport);if(i.mustRefreshForHeights(k)&&(a=!0),a||i.lineWrapping&&Math.abs(E-this.contentDOMWidth)>i.charWidth){let{lineHeight:P,charWidth:A,textHeight:I}=e.docView.measureTextSize();a=P>0&&i.refresh(s,P,A,I,Math.max(5,E/A),k),a&&(e.docView.minWidth=0,d|=16)}w>0&&C>0?h=Math.max(w,C):w<0&&C<0&&(h=Math.min(w,C)),$k();for(let P of this.viewports){let A=P.from==this.viewport.from?k:e.docView.measureVisibleLineHeights(P);this.heightMap=(a?ai.empty().applyChanges(this.stateDeco,Yt.empty,this.heightOracle,[new lo(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(i,0,a,new AZ(P.from,A))}_c&&(d|=2)}let M=!this.viewportIsAppropriate(this.viewport,h)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return M&&(d&2&&(d|=this.updateScaler()),this.viewport=this.getViewport(h,this.scrollTarget),d|=this.updateForViewport()),(d&2||M)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(a?[]:this.lineGaps,e)),d|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),d}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,n){let r=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),i=this.heightMap,s=this.heightOracle,{visibleTop:a,visibleBottom:u}=this,c=new pg(i.lineAt(a-r*1e3,In.ByHeight,s,0,0).from,i.lineAt(u+(1-r)*1e3,In.ByHeight,s,0,0).to);if(n){let{head:d}=n.range;if(d<c.from||d>c.to){let h=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),g=i.lineAt(d,In.ByPos,s,0,0),m;n.y=="center"?m=(g.top+g.bottom)/2-h/2:n.y=="start"||n.y=="nearest"&&d<c.from?m=g.top:m=g.bottom-h,c=new pg(i.lineAt(m-1e3/2,In.ByHeight,s,0,0).from,i.lineAt(m+h+1e3/2,In.ByHeight,s,0,0).to)}}return c}mapViewport(e,n){let r=n.mapPos(e.from,-1),i=n.mapPos(e.to,1);return new pg(this.heightMap.lineAt(r,In.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(i,In.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:n},r=0){if(!this.inView)return!0;let{top:i}=this.heightMap.lineAt(e,In.ByPos,this.heightOracle,0,0),{bottom:s}=this.heightMap.lineAt(n,In.ByPos,this.heightOracle,0,0),{visibleTop:a,visibleBottom:u}=this;return(e==0||i<=a-Math.max(10,Math.min(-r,250)))&&(n==this.state.doc.length||s>=u+Math.max(10,Math.min(r,250)))&&i>a-2*1e3&&s<u+2*1e3}mapLineGaps(e,n){if(!e.length||n.empty)return e;let r=[];for(let i of e)n.touchesRange(i.from,i.to)||r.push(new qb(n.mapPos(i.from),n.mapPos(i.to),i.size,i.displaySize));return r}ensureLineGaps(e,n){let r=this.heightOracle.lineWrapping,i=r?1e4:2e3,s=i>>1,a=i<<1;if(this.defaultTextDirection!=mr.LTR&&!r)return[];let u=[],c=(h,g,m,y)=>{if(g-h<s)return;let b=this.state.selection.main,x=[b.from];b.empty||x.push(b.to);for(let C of x)if(C>h&&C<g){c(h,C-10,m,y),c(C+10,g,m,y);return}let w=_Z(e,C=>C.from>=m.from&&C.to<=m.to&&Math.abs(C.from-h)<s&&Math.abs(C.to-g)<s&&!x.some(T=>C.from<T&&C.to>T));if(!w){if(g<m.to&&n&&r&&n.visibleRanges.some(E=>E.from<=g&&E.to>=g)){let E=n.moveToLineBoundary(ze.cursor(g),!1,!0).head;E>h&&(g=E)}let C=this.gapSize(m,h,g,y),T=r||C<2e6?C:2e6;w=new qb(h,g,C,T)}u.push(w)},d=h=>{if(h.length<a||h.type!=fo.Text)return;let g=jZ(h.from,h.to,this.stateDeco);if(g.total<a)return;let m=this.scrollTarget?this.scrollTarget.range.head:null,y,b;if(r){let x=i/this.heightOracle.lineLength*this.heightOracle.lineHeight,w,C;if(m!=null){let T=mg(g,m),E=((this.visibleBottom-this.visibleTop)/2+x)/h.height;w=T-E,C=T+E}else w=(this.visibleTop-h.top-x)/h.height,C=(this.visibleBottom-h.top+x)/h.height;y=gg(g,w),b=gg(g,C)}else{let x=g.total*this.heightOracle.charWidth,w=i*this.heightOracle.charWidth,C=0;if(x>2e6)for(let P of e)P.from>=h.from&&P.from<h.to&&P.size!=P.displaySize&&P.from*this.heightOracle.charWidth+C<this.pixelViewport.left&&(C=P.size-P.displaySize);let T=this.pixelViewport.left+C,E=this.pixelViewport.right+C,M,k;if(m!=null){let P=mg(g,m),A=((E-T)/2+w)/x;M=P-A,k=P+A}else M=(T-w)/x,k=(E+w)/x;y=gg(g,M),b=gg(g,k)}y>h.from&&c(h.from,y,h,g),b<h.to&&c(b,h.to,h,g)};for(let h of this.viewportLines)Array.isArray(h.type)?h.type.forEach(d):d(h);return u}gapSize(e,n,r,i){let s=mg(i,r)-mg(i,n);return this.heightOracle.lineWrapping?e.height*s:i.total*this.heightOracle.charWidth*s}updateLineGaps(e){qb.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=Jr.set(e.map(n=>n.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let n=this.stateDeco;this.lineGaps.length&&(n=n.concat(this.lineGapDeco));let r=[];pn.spans(n,this.viewport.from,this.viewport.to,{span(s,a){r.push({from:s,to:a})},point(){}},20);let i=0;if(r.length!=this.visibleRanges.length)i=12;else for(let s=0;s<r.length&&!(i&8);s++){let a=this.visibleRanges[s],u=r[s];(a.from!=u.from||a.to!=u.to)&&(i|=4,e&&e.mapPos(a.from,-1)==u.from&&e.mapPos(a.to,1)==u.to||(i|=8))}return this.visibleRanges=r,i}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(n=>n.from<=e&&n.to>=e)||ud(this.heightMap.lineAt(e,In.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(n=>n.top<=e&&n.bottom>=e)||ud(this.heightMap.lineAt(this.scaler.fromDOM(e),In.ByHeight,this.heightOracle,0,0),this.scaler)}getScrollOffset(){return(this.scrollParent==this.view.scrollDOM?this.scrollParent.scrollTop:(this.scrollParent?this.scrollParent.getBoundingClientRect().top:0)-this.view.contentDOM.getBoundingClientRect().top)*this.scaleY}scrollAnchorAt(e){let n=this.lineBlockAtHeight(e+8);return n.from>=this.viewport.from||this.viewportLines[0].top-e>200?n:this.viewportLines[0]}elementAtHeight(e){return ud(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class pg{constructor(e,n){this.from=e,this.to=n}}function jZ(t,e,n){let r=[],i=t,s=0;return pn.spans(n,t,e,{span(){},point(a,u){a>i&&(r.push({from:i,to:a}),s+=a-i),i=u}},20),i<e&&(r.push({from:i,to:e}),s+=e-i),{total:s,ranges:r}}function gg({total:t,ranges:e},n){if(n<=0)return e[0].from;if(n>=1)return e[e.length-1].to;let r=Math.floor(t*n);for(let i=0;;i++){let{from:s,to:a}=e[i],u=a-s;if(r<=u)return s+r;r-=u}}function mg(t,e){let n=0;for(let{from:r,to:i}of t.ranges){if(e<=i){n+=e-r;break}n+=i-r}return n/t.total}function _Z(t,e){for(let n of t)if(e(n))return n}const Wk={toDOM(t){return t},fromDOM(t){return t},scale:1,eq(t){return t==this}};function Kk(t){let e=t.facet(by).filter(r=>typeof r!="function"),n=t.facet(oC).filter(r=>typeof r!="function");return n.length&&e.push(pn.join(n)),e}class aC{constructor(e,n,r){let i=0,s=0,a=0;this.viewports=r.map(({from:u,to:c})=>{let d=n.lineAt(u,In.ByPos,e,0,0).top,h=n.lineAt(c,In.ByPos,e,0,0).bottom;return i+=h-d,{from:u,to:c,top:d,bottom:h,domTop:0,domBottom:0}}),this.scale=(7e6-i)/(n.height-i);for(let u of this.viewports)u.domTop=a+(u.top-s)*this.scale,a=u.domBottom=u.domTop+(u.bottom-u.top),s=u.bottom}toDOM(e){for(let n=0,r=0,i=0;;n++){let s=n<this.viewports.length?this.viewports[n]:null;if(!s||e<s.top)return i+(e-r)*this.scale;if(e<=s.bottom)return s.domTop+(e-s.top);r=s.bottom,i=s.domBottom}}fromDOM(e){for(let n=0,r=0,i=0;;n++){let s=n<this.viewports.length?this.viewports[n]:null;if(!s||e<s.domTop)return r+(e-i)/this.scale;if(e<=s.domBottom)return s.top+(e-s.domTop);r=s.bottom,i=s.domBottom}}eq(e){return e instanceof aC?this.scale==e.scale&&this.viewports.length==e.viewports.length&&this.viewports.every((n,r)=>n.from==e.viewports[r].from&&n.to==e.viewports[r].to):!1}}function ud(t,e){if(e.scale==1)return t;let n=e.toDOM(t.top),r=e.toDOM(t.bottom);return new Do(t.from,t.length,n,r-n,Array.isArray(t._content)?t._content.map(i=>ud(i,e)):t._content)}const yg=bt.define({combine:t=>t.join(" ")}),US=bt.define({combine:t=>t.indexOf(!0)>-1}),$S=Nc.newName(),jB=Nc.newName(),_B=Nc.newName(),HB={"&light":"."+jB,"&dark":"."+_B};function qS(t,e,n){return new Nc(e,{finish(r){return/&/.test(r)?r.replace(/&\w*/,i=>{if(i=="&")return t;if(!n||!n[i])throw new RangeError(`Unsupported selector: ${i}`);return n[i]}):t+" "+r}})}const HZ=qS("."+$S,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-selectionHandle":{backgroundColor:"currentColor",width:"1.5px"},".cm-selectionHandle-start::before, .cm-selectionHandle-end::before":{content:'""',backgroundColor:"inherit",borderRadius:"50%",width:"8px",height:"8px",position:"absolute",left:"-3.25px"},".cm-selectionHandle-start::before":{top:"-8px"},".cm-selectionHandle-end::before":{bottom:"-8px"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",border:"0px solid #ddd","&.cm-gutters-before":{borderRightWidth:"1px"},"&.cm-gutters-after":{borderLeftWidth:"1px"}},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-dialog":{padding:"2px 19px 4px 6px",position:"relative","& label":{fontSize:"80%"}},".cm-dialog-close":{position:"absolute",top:"3px",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",fontSize:"14px",padding:"0"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top",userSelect:"none"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},HB),VZ={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},Gb=Ye.ie&&Ye.ie_version<=11;class FZ{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new mQ,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(n=>{for(let r of n)this.queue.push(r);(Ye.ie&&Ye.ie_version<=11||Ye.ios&&e.composing)&&n.some(r=>r.type=="childList"&&r.removedNodes.length||r.type=="characterData"&&r.oldValue.length>r.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&Ye.android&&e.constructor.EDIT_CONTEXT!==!1&&!(Ye.chrome&&Ye.chrome_version<126)&&(this.editContext=new $Z(e),e.state.facet(Js)&&(e.contentDOM.editContext=this.editContext.editContext)),Gb&&(this.onCharData=n=>{this.queue.push({target:n.target,type:"characterData",oldValue:n.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var n;((n=this.view.docView)===null||n===void 0?void 0:n.lastUpdate)<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(e.scrollDOM)),this.addWindowListeners(this.win=e.win),this.start(),typeof IntersectionObserver=="function"&&(this.intersection=new IntersectionObserver(n=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),n.length>0&&n[n.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(n=>{n.length>0&&n[n.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){(e.type=="change"||!e.type)&&!e.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((n,r)=>n!=e[r]))){this.gapIntersection.disconnect();for(let n of e)this.gapIntersection.observe(n);this.gaps=e}}onSelectionChange(e){let n=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:r}=this,i=this.selectionRange;if(r.state.facet(Js)?r.root.activeElement!=this.dom:!xd(this.dom,i))return;let s=i.anchorNode&&r.docView.tile.nearest(i.anchorNode);if(s&&s.isWidget()&&s.widget.ignoreEvent(e)){n||(this.selectionChanged=!1);return}(Ye.ie&&Ye.ie_version<=11||Ye.android&&Ye.chrome)&&!r.state.selection.main.empty&&i.focusNode&&Sd(i.focusNode,i.focusOffset,i.anchorNode,i.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,n=Kd(e.root);if(!n)return!1;let r=Ye.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&UZ(this.view,n)||n;if(!r||this.selectionRange.eq(r))return!1;let i=xd(this.dom,r);return i&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&vQ(this.dom,r)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(r),i&&(this.selectionChanged=!0),!0)}setSelectionRange(e,n){this.selectionRange.set(e.node,e.offset,n.node,n.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let e=0,n=null;for(let r=this.dom;r;)if(r.nodeType==1)!n&&e<this.scrollTargets.length&&this.scrollTargets[e]==r?e++:n||(n=this.scrollTargets.slice(0,e)),n&&n.push(r),r=r.assignedSlot||r.parentNode;else if(r.nodeType==11)r=r.host;else break;if(e<this.scrollTargets.length&&!n&&(n=this.scrollTargets.slice(0,e)),n){for(let r of this.scrollTargets)r.removeEventListener("scroll",this.onScroll);for(let r of this.scrollTargets=n)r.addEventListener("scroll",this.onScroll)}}ignore(e){if(!this.active)return e();try{return this.stop(),e()}finally{this.start(),this.clear()}}start(){this.active||(this.observer.observe(this.dom,VZ),Gb&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),Gb&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,n){var r;if(!this.delayedAndroidKey){let i=()=>{let s=this.delayedAndroidKey;s&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=s.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&s.force&&Rc(this.dom,s.key,s.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(i)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:n,force:this.lastChange<Date.now()-50||!!(!((r=this.delayedAndroidKey)===null||r===void 0)&&r.force)})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(()=>{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let n=-1,r=-1,i=!1;for(let s of e){let a=this.readMutation(s);a&&(a.typeOver&&(i=!0),n==-1?{from:n,to:r}=a:(n=Math.min(a.from,n),r=Math.max(a.to,r)))}return{from:n,to:r,typeOver:i}}readChange(){let{from:e,to:n,typeOver:r}=this.processRecords(),i=this.selectionChanged&&xd(this.dom,this.selectionRange);if(e<0&&!i)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let s=new lZ(this.view,e,n,r);return this.view.docView.domChanged={newSel:s.newSel?s.newSel.main:null},s}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let n=this.readChange();if(!n)return this.view.requestMeasure(),!1;let r=this.view.state,i=MB(this.view,n);return this.view.state==r&&(n.domChanged||n.newSel&&!bm(this.view.state.selection,n.newSel.main))&&this.view.update([]),i}readMutation(e){let n=this.view.docView.tile.nearest(e.target);if(!n||n.isWidget())return null;if(n.markDirty(e.type=="attributes"),e.type=="childList"){let r=Yk(n,e.previousSibling||e.target.previousSibling,-1),i=Yk(n,e.nextSibling||e.target.nextSibling,1);return{from:r?n.posAfter(r):n.posAtStart,to:i?n.posBefore(i):n.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(Js)!=e.state.facet(Js)&&(e.view.contentDOM.editContext=e.state.facet(Js)?this.editContext.editContext:null))}destroy(){var e,n,r;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(n=this.gapIntersection)===null||n===void 0||n.disconnect(),(r=this.resizeScroll)===null||r===void 0||r.disconnect();for(let i of this.scrollTargets)i.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function Yk(t,e,n){for(;e;){let r=Xn.get(e);if(r&&r.parent==t)return r;let i=e.parentNode;e=i!=t.dom?i:n>0?e.nextSibling:e.previousSibling}return null}function Xk(t,e){let n=e.startContainer,r=e.startOffset,i=e.endContainer,s=e.endOffset,a=t.docView.domAtPos(t.state.selection.main.anchor,1);return Sd(a.node,a.offset,i,s)&&([n,r,i,s]=[i,s,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:s}}function UZ(t,e){if(e.getComposedRanges){let i=e.getComposedRanges(t.root)[0];if(i)return Xk(t,i)}let n=null;function r(i){i.preventDefault(),i.stopImmediatePropagation(),n=i.getTargetRanges()[0]}return t.contentDOM.addEventListener("beforeinput",r,!0),t.dom.ownerDocument.execCommand("indent"),t.contentDOM.removeEventListener("beforeinput",r,!0),n?Xk(t,n):null}class $Z{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let n=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=r=>{let i=e.state.selection.main,{anchor:s,head:a}=i,u=this.toEditorPos(r.updateRangeStart),c=this.toEditorPos(r.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:r.updateRangeStart,editorBase:u,drifted:!1});let d=c-u>r.text.length;u==this.from&&s<this.from?u=s:c==this.to&&s>this.to&&(c=s);let h=AB(e.state.sliceDoc(u,c),r.text,(d?i.from:i.to)-u,d?"end":null);if(!h){let m=ze.single(this.toEditorPos(r.selectionStart),this.toEditorPos(r.selectionEnd));bm(m,i)||e.dispatch({selection:m,userEvent:"select"});return}let g={from:h.from+u,to:h.toA+u,insert:Yt.of(r.text.slice(h.from,h.toB).split(`
|
|
30
|
+
`))};if((Ye.mac||Ye.android)&&g.from==a-1&&/^\. ?$/.test(r.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(g={from:u,to:c,insert:Yt.of([r.text.replace("."," ")])}),this.pendingContextChange=g,!e.state.readOnly){let m=this.to-this.from+(g.to-g.from+g.insert.length);sC(e,g,ze.single(this.toEditorPos(r.selectionStart,m),this.toEditorPos(r.selectionEnd,m)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),g.from<g.to&&!g.insert.length&&e.inputState.composing>=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(n.text.slice(Math.max(0,r.updateRangeStart-1),Math.min(n.text.length,r.updateRangeStart+1)))&&this.handlers.compositionend(r)},this.handlers.characterboundsupdate=r=>{let i=[],s=null;for(let a=this.toEditorPos(r.rangeStart),u=this.toEditorPos(r.rangeEnd);a<u;a++){let c=e.coordsForChar(a);s=c&&new DOMRect(c.left,c.top,c.right-c.left,c.bottom-c.top)||s||new DOMRect,i.push(s)}n.updateCharacterBounds(r.rangeStart,i)},this.handlers.textformatupdate=r=>{let i=[];for(let s of r.getTextFormats()){let a=s.underlineStyle,u=s.underlineThickness;if(!/none/i.test(a)&&!/none/i.test(u)){let c=this.toEditorPos(s.rangeStart),d=this.toEditorPos(s.rangeEnd);if(c<d){let h=`text-decoration: underline ${/^[a-z]/.test(a)?a+" ":a=="Dashed"?"dashed ":a=="Squiggle"?"wavy ":""}${/thin/i.test(u)?1:2}px`;i.push(Jr.mark({attributes:{style:h}}).range(c,d))}}}e.dispatch({effects:yB.of(Jr.set(i))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:r}=this.composing;this.composing=null,r&&this.reset(e.state)}};for(let r in this.handlers)n.addEventListener(r,this.handlers[r]);this.measureReq={read:r=>{this.editContext.updateControlBounds(r.contentDOM.getBoundingClientRect());let i=Kd(r.root);i&&i.rangeCount&&this.editContext.updateSelectionBounds(i.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let n=0,r=!1,i=this.pendingContextChange;return e.changes.iterChanges((s,a,u,c,d)=>{if(r)return;let h=d.length-(a-s);if(i&&a>=i.to)if(i.from==s&&i.to==a&&i.insert.eq(d)){i=this.pendingContextChange=null,n+=h,this.to+=h;return}else i=null,this.revertPending(e.state);if(s+=n,a+=n,a<=this.from)this.from+=h,this.to+=h;else if(s<this.to){if(s<this.from||a>this.to||this.to-this.from+d.length>3e4){r=!0;return}this.editContext.updateText(this.toContextPos(s),this.toContextPos(a),d.toString()),this.to+=h}n+=h}),i&&!r&&this.revertPending(e.state),!r}update(e){let n=this.pendingContextChange,r=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(r.from,r.to)&&e.transactions.some(i=>!i.isUserEvent("input.type")&&i.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||n)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:n}=e.selection.main;this.from=Math.max(0,n-1e4),this.to=Math.min(e.doc.length,n+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let n=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(n.from),this.toContextPos(n.from+n.insert.length),e.doc.sliceString(n.from,n.to))}setSelection(e){let{main:n}=e.selection,r=this.toContextPos(Math.max(this.from,Math.min(this.to,n.anchor))),i=this.toContextPos(n.head);(this.editContext.selectionStart!=r||this.editContext.selectionEnd!=i)&&this.editContext.updateSelection(r,i)}rangeIsValid(e){let{head:n}=e.selection.main;return!(this.from>0&&n-this.from<500||this.to<e.doc.length&&this.to-n<500||this.to-this.from>1e4*3)}toEditorPos(e,n=this.to-this.from){e=Math.min(e,n);let r=this.composing;return r&&r.drifted?r.editorBase+(e-r.contextBase):e+this.from}toContextPos(e){let n=this.composing;return n&&n.drifted?n.contextBase+(e-n.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}class At{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var n;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:r}=e;this.dispatchTransactions=e.dispatchTransactions||r&&(i=>i.forEach(s=>r(s,this)))||(i=>this.update(i)),this.dispatch=this.dispatch.bind(this),this._root=e.root||yQ(e.parent)||document,this.viewState=new Gk(this,e.state||an.create(e)),e.scrollTo&&e.scrollTo.is(fg)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(dc).map(i=>new Hb(i));for(let i of this.plugins)i.update(this);this.observer=new FZ(this),this.inputState=new fZ(this),this.inputState.ensureHandlers(this.plugins),this.docView=new Pk(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((n=document.fonts)===null||n===void 0)&&n.ready&&document.fonts.ready.then(()=>{this.viewState.mustMeasureContent="refresh",this.requestMeasure()})}dispatch(...e){let n=e.length==1&&e[0]instanceof Rr?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(n,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let n=!1,r=!1,i,s=this.state;for(let m of e){if(m.startState!=s)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");s=m.state}if(this.destroyed){this.viewState.state=s;return}let a=this.hasFocus,u=0,c=null;e.some(m=>m.annotation(zB))?(this.inputState.notifiedFocused=a,u=1):a!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=a,c=NB(s,a),c||(u=1));let d=this.observer.delayedAndroidKey,h=null;if(d?(this.observer.clearDelayedAndroidKey(),h=this.observer.readChange(),(h&&!this.state.doc.eq(s.doc)||!this.state.selection.eq(s.selection))&&(h=null)):this.observer.clear(),s.facet(an.phrases)!=this.state.facet(an.phrases))return this.setState(s);i=mm.create(this,s,e),i.flags|=u;let g=this.viewState.scrollTarget;try{this.updateState=2;for(let m of e){if(g&&(g=g.map(m.changes)),m.scrollIntoView){let{main:y}=m.state.selection;g=new Tc(y.empty?y:ze.cursor(y.head,y.head>y.anchor?-1:1))}for(let y of m.effects)y.is(fg)&&(g=y.value.clip(this.state))}this.viewState.update(i,g),this.bidiCache=Sm.update(this.bidiCache,i.changes),i.empty||(this.updatePlugins(i),this.inputState.update(i)),n=this.docView.update(i),this.state.facet(ad)!=this.styleModules&&this.mountStyles(),r=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(n,e.some(m=>m.isUserEvent("select.pointer")))}finally{this.updateState=0}if(i.startState.facet(yg)!=i.state.facet(yg)&&(this.viewState.mustMeasureContent=!0),(n||r||g||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),n&&this.docViewUpdate(),!i.empty)for(let m of this.state.facet(_S))try{m(i)}catch(y){bs(this.state,y,"update listener")}(c||h)&&Promise.resolve().then(()=>{c&&this.state==c.startState&&this.dispatch(c),h&&!MB(this,h)&&d.force&&Rc(this.contentDOM,d.key,d.keyCode)})}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let n=this.hasFocus;try{for(let r of this.plugins)r.destroy(this);this.viewState=new Gk(this,e),this.plugins=e.facet(dc).map(r=>new Hb(r)),this.pluginMap.clear();for(let r of this.plugins)r.update(this);this.docView.destroy(),this.docView=new Pk(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}n&&this.focus(),this.requestMeasure()}updatePlugins(e){let n=e.startState.facet(dc),r=e.state.facet(dc);if(n!=r){let i=[];for(let s of r){let a=n.indexOf(s);if(a<0)i.push(new Hb(s));else{let u=this.plugins[a];u.mustUpdate=e,i.push(u)}}for(let s of this.plugins)s.mustUpdate!=e&&s.destroy(this);this.plugins=i,this.pluginMap.clear()}else for(let i of this.plugins)i.mustUpdate=e;for(let i=0;i<this.plugins.length;i++)this.plugins[i].update(this);n!=r&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let e of this.plugins){let n=e.value;if(n&&n.docViewUpdate)try{n.docViewUpdate(this)}catch(r){bs(this.state,r,"doc view update listener")}}}measure(e=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let n=null,r=this.viewState.scrollParent,i=this.viewState.getScrollOffset(),{scrollAnchorPos:s,scrollAnchorHeight:a}=this.viewState;Math.abs(i-this.viewState.scrollOffset)>1&&(a=-1),this.viewState.scrollAnchorHeight=-1;try{for(let u=0;;u++){if(a<0)if(tB(r||this.win))s=-1,a=this.viewState.heightMap.height;else{let y=this.viewState.scrollAnchorAt(i);s=y.from,a=y.top}this.updateState=1;let c=this.viewState.measure();if(!c&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(u>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let d=[];c&4||([this.measureRequests,d]=[d,this.measureRequests]);let h=d.map(y=>{try{return y.read(this)}catch(b){return bs(this.state,b),Qk}}),g=mm.create(this,this.state,[]),m=!1;g.flags|=c,n?n.flags|=c:n=g,this.updateState=2,g.empty||(this.updatePlugins(g),this.inputState.update(g),this.updateAttrs(),m=this.docView.update(g),m&&this.docViewUpdate());for(let y=0;y<d.length;y++)if(h[y]!=Qk)try{let b=d[y];b.write&&b.write(h[y],this)}catch(b){bs(this.state,b)}if(m&&this.docView.updateSelection(!0),!g.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,a=-1;continue}else{let b=((s<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(s).top)-a)/this.scaleY;if((b>1||b<-1)&&(r==this.scrollDOM||this.hasFocus||Math.max(this.inputState.lastWheelEvent,this.inputState.lastTouchTime)>Date.now()-100)){i=i+b,r?r.scrollTop+=b:this.win.scrollBy(0,b),a=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(n&&!n.empty)for(let u of this.state.facet(_S))u(n)}get themeClasses(){return $S+" "+(this.state.facet(US)?_B:jB)+" "+this.state.facet(yg)}updateAttrs(){let e=Zk(this,vB,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),n={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(Js)?"true":"false",class:"cm-content",style:`${Ye.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(n["aria-readonly"]="true"),Zk(this,iC,n);let r=this.observer.ignore(()=>{let i=Mk(this.contentDOM,this.contentAttrs,n),s=Mk(this.dom,this.editorAttrs,e);return i||s});return this.editorAttrs=e,this.contentAttrs=n,r}showAnnouncements(e){let n=!0;for(let r of e)for(let i of r.effects)if(i.is(At.announce)){n&&(this.announceDOM.textContent=""),n=!1;let s=this.announceDOM.appendChild(document.createElement("div"));s.textContent=i.value}}mountStyles(){this.styleModules=this.state.facet(ad);let e=this.state.facet(At.cspNonce);Nc.mount(this.root,this.styleModules.concat(HZ).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let n=0;n<this.measureRequests.length;n++)if(this.measureRequests[n].key===e.key){this.measureRequests[n]=e;return}}this.measureRequests.push(e)}}plugin(e){let n=this.pluginMap.get(e);return(n===void 0||n&&n.plugin!=e)&&this.pluginMap.set(e,n=this.plugins.find(r=>r.plugin==e)||null),n&&n.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,n,r){return $b(this,e,zk(this,e,n,r))}moveByGroup(e,n){return $b(this,e,zk(this,e,n,r=>tZ(this,e.head,r)))}visualLineSide(e,n){let r=this.bidiSpans(e),i=this.textDirectionAt(e.from),s=r[n?r.length-1:0];return ze.cursor(s.side(n,i)+e.from,s.forward(!n,i)?1:-1)}moveToLineBoundary(e,n,r=!0){return eZ(this,e,n,r)}moveVertically(e,n,r){return $b(this,e,nZ(this,e,n,r))}domAtPos(e,n=1){return this.docView.domAtPos(e,n)}posAtDOM(e,n=0){return this.docView.posFromDOM(e,n)}posAtCoords(e,n=!0){this.readMeasured();let r=VS(this,e,n);return r&&r.pos}posAndSideAtCoords(e,n=!0){return this.readMeasured(),VS(this,e,n)}coordsAtPos(e,n=1){this.readMeasured();let r=this.docView.coordsAt(e,n);if(!r||r.left==r.right)return r;let i=this.state.doc.lineAt(e),s=this.bidiSpans(i),a=s[vs.find(s,e-i.from,-1,n)];return gm(r,a.dir==mr.LTR==n>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(gB)||e<this.viewport.from||e>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>qZ)return lB(e.length);let n=this.textDirectionAt(e.from),r;for(let s of this.bidiCache)if(s.from==e.from&&s.dir==n&&(s.fresh||sB(s.isolates,r=kk(this,e))))return s.order;r||(r=kk(this,e));let i=TQ(e.text,n,r);return this.bidiCache.push(new Sm(e.from,e.to,n,r,!0,i)),i}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||Ye.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{eB(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,n={}){return fg.of(new Tc(typeof e=="number"?ze.cursor(e):e,n.y,n.x,n.yMargin,n.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:n}=this.scrollDOM,r=this.viewState.scrollAnchorAt(e);return fg.of(new Tc(ze.cursor(r.from),"start","start",r.top-e,n,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e=="boolean"?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return Lc.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return Lc.define(()=>({}),{eventObservers:e})}static theme(e,n){let r=Nc.newName(),i=[yg.of(r),ad.of(qS(`.${r}`,e))];return n&&n.dark&&i.push(US.of(!0)),i}static baseTheme(e){return jL.lowest(ad.of(qS("."+$S,e,HB)))}static findFromDOM(e){var n;let r=e.querySelector(".cm-content"),i=r&&Xn.get(r)||Xn.get(e);return((n=i?.root)===null||n===void 0?void 0:n.view)||null}}At.styleModule=ad;At.inputHandler=hB;At.clipboardInputFilter=nC;At.clipboardOutputFilter=rC;At.scrollHandler=mB;At.focusChangeEffect=pB;At.perLineTextDirection=gB;At.exceptionSink=dB;At.updateListener=_S;At.editable=Js;At.mouseSelectionStyle=fB;At.dragMovesSelection=cB;At.clickAddsSelectionRange=uB;At.decorations=by;At.blockWrappers=bB;At.outerDecorations=oC;At.atomicRanges=yh;At.bidiIsolatedRanges=xB;At.scrollMargins=SB;At.darkTheme=US;At.cspNonce=bt.define({combine:t=>t.length?t[0]:""});At.contentAttributes=iC;At.editorAttributes=vB;At.lineWrapping=At.contentAttributes.of({class:"cm-lineWrapping"});At.announce=sr.define();const qZ=4096,Qk={};class Sm{constructor(e,n,r,i,s,a){this.from=e,this.to=n,this.dir=r,this.isolates=i,this.fresh=s,this.order=a}static update(e,n){if(n.empty&&!e.some(s=>s.fresh))return e;let r=[],i=e.length?e[e.length-1].dir:mr.LTR;for(let s=Math.max(0,e.length-10);s<e.length;s++){let a=e[s];a.dir==i&&!n.touchesRange(a.from,a.to)&&r.push(new Sm(n.mapPos(a.from,1),n.mapPos(a.to,-1),a.dir,a.isolates,!1,a.order))}return r}}function Zk(t,e,n){for(let r=t.state.facet(e),i=r.length-1;i>=0;i--){let s=r[i],a=typeof s=="function"?s(t):s;a&&J1(a,n)}return n}const GZ=Ye.mac?"mac":Ye.windows?"win":Ye.linux?"linux":"key";function WZ(t,e){const n=t.split(/-(?!$)/);let r=n[n.length-1];r=="Space"&&(r=" ");let i,s,a,u;for(let c=0;c<n.length-1;++c){const d=n[c];if(/^(cmd|meta|m)$/i.test(d))u=!0;else if(/^a(lt)?$/i.test(d))i=!0;else if(/^(c|ctrl|control)$/i.test(d))s=!0;else if(/^s(hift)?$/i.test(d))a=!0;else if(/^mod$/i.test(d))e=="mac"?u=!0:s=!0;else throw new Error("Unrecognized modifier name: "+d)}return i&&(r="Alt-"+r),s&&(r="Ctrl-"+r),u&&(r="Meta-"+r),a&&(r="Shift-"+r),r}function vg(t,e,n){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n!==!1&&e.shiftKey&&(t="Shift-"+t),t}const KZ=jL.default(At.domEventHandlers({keydown(t,e){return ZZ(YZ(e.state),t,e,"editor")}})),VB=bt.define({enables:KZ}),Jk=new WeakMap;function YZ(t){let e=t.facet(VB),n=Jk.get(e);return n||Jk.set(e,n=QZ(e.reduce((r,i)=>r.concat(i),[]))),n}let Jl=null;const XZ=4e3;function QZ(t,e=GZ){let n=Object.create(null),r=Object.create(null),i=(a,u)=>{let c=r[a];if(c==null)r[a]=u;else if(c!=u)throw new Error("Key binding "+a+" is used both as a regular binding and as a multi-stroke prefix")},s=(a,u,c,d,h)=>{var g,m;let y=n[a]||(n[a]=Object.create(null)),b=u.split(/ (?!$)/).map(C=>WZ(C,e));for(let C=1;C<b.length;C++){let T=b.slice(0,C).join(" ");i(T,!0),y[T]||(y[T]={preventDefault:!0,stopPropagation:!1,run:[E=>{let M=Jl={view:E,prefix:T,scope:a};return setTimeout(()=>{Jl==M&&(Jl=null)},XZ),!0}]})}let x=b.join(" ");i(x,!1);let w=y[x]||(y[x]={preventDefault:!1,stopPropagation:!1,run:((m=(g=y._any)===null||g===void 0?void 0:g.run)===null||m===void 0?void 0:m.slice())||[]});c&&w.run.push(c),d&&(w.preventDefault=!0),h&&(w.stopPropagation=!0)};for(let a of t){let u=a.scope?a.scope.split(" "):["editor"];if(a.any)for(let d of u){let h=n[d]||(n[d]=Object.create(null));h._any||(h._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:g}=a;for(let m in h)h[m].run.push(y=>g(y,GS))}let c=a[e]||a.key;if(c)for(let d of u)s(d,c,a.run,a.preventDefault,a.stopPropagation),a.shift&&s(d,"Shift-"+c,a.shift,a.preventDefault,a.stopPropagation)}return n}let GS=null;function ZZ(t,e,n,r){GS=e;let i=uQ(e),s=$X(i,0),a=qX(s)==i.length&&i!=" ",u="",c=!1,d=!1,h=!1;Jl&&Jl.view==n&&Jl.scope==r&&(u=Jl.prefix+" ",kB.indexOf(e.keyCode)<0&&(d=!0,Jl=null));let g=new Set,m=w=>{if(w){for(let C of w.run)if(!g.has(C)&&(g.add(C),C(n)))return w.stopPropagation&&(h=!0),!0;w.preventDefault&&(w.stopPropagation&&(h=!0),d=!0)}return!1},y=t[r],b,x;return y&&(m(y[u+vg(i,e,!a)])?c=!0:a&&(e.altKey||e.metaKey||e.ctrlKey)&&!(Ye.windows&&e.ctrlKey&&e.altKey)&&!(Ye.mac&&e.altKey&&!(e.ctrlKey||e.metaKey))&&(b=ga[e.keyCode])&&b!=i?(m(y[u+vg(b,e,!0)])||e.shiftKey&&(x=Gd[e.keyCode])!=i&&x!=b&&m(y[u+vg(x,e,!1)]))&&(c=!0):a&&e.shiftKey&&m(y[u+vg(i,e,!0)])&&(c=!0),!c&&m(y._any)&&(c=!0)),d&&(c=!0),c&&h&&e.stopPropagation(),GS=null,c}class Hc extends yu{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}Hc.prototype.elementClass="";Hc.prototype.toDOM=void 0;Hc.prototype.mapMode=Li.TrackBefore;Hc.prototype.startSide=Hc.prototype.endSide=-1;Hc.prototype.point=!0;const JZ=1024;let eJ=0;class Wb{constructor(e,n){this.from=e,this.to=n}}class Xt{constructor(e={}){this.id=eJ++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=e.combine||null}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=mo.match(e)),n=>{let r=e(n);return r===void 0?null:[this,r]}}}Xt.closedBy=new Xt({deserialize:t=>t.split(" ")});Xt.openedBy=new Xt({deserialize:t=>t.split(" ")});Xt.group=new Xt({deserialize:t=>t.split(" ")});Xt.isolate=new Xt({deserialize:t=>{if(t&&t!="rtl"&&t!="ltr"&&t!="auto")throw new RangeError("Invalid value for isolate: "+t);return t||"auto"}});Xt.contextHash=new Xt({perNode:!0});Xt.lookAhead=new Xt({perNode:!0});Xt.mounted=new Xt({perNode:!0});class Cd{constructor(e,n,r,i=!1){this.tree=e,this.overlay=n,this.parser=r,this.bracketed=i}static get(e){return e&&e.props&&e.props[Xt.mounted.id]}}const tJ=Object.create(null);class mo{constructor(e,n,r,i=0){this.name=e,this.props=n,this.id=r,this.flags=i}static define(e){let n=e.props&&e.props.length?Object.create(null):tJ,r=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),i=new mo(e.name||"",n,e.id,r);if(e.props){for(let s of e.props)if(Array.isArray(s)||(s=s(i)),s){if(s[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");n[s[0].id]=s[1]}}return i}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let n=this.prop(Xt.group);return n?n.indexOf(e)>-1:!1}return this.id==e}static match(e){let n=Object.create(null);for(let r in e)for(let i of r.split(" "))n[i]=e[r];return r=>{for(let i=r.prop(Xt.group),s=-1;s<(i?i.length:0);s++){let a=n[s<0?r.name:i[s]];if(a)return a}}}}mo.none=new mo("",Object.create(null),0,8);const bg=new WeakMap,eI=new WeakMap;var or;(function(t){t[t.ExcludeBuffers=1]="ExcludeBuffers",t[t.IncludeAnonymous=2]="IncludeAnonymous",t[t.IgnoreMounts=4]="IgnoreMounts",t[t.IgnoreOverlays=8]="IgnoreOverlays",t[t.EnterBracketed=16]="EnterBracketed"})(or||(or={}));class jr{constructor(e,n,r,i,s){if(this.type=e,this.children=n,this.positions=r,this.length=i,this.props=null,s&&s.length){this.props=Object.create(null);for(let[a,u]of s)this.props[typeof a=="number"?a:a.id]=u}}toString(){let e=Cd.get(this);if(e&&!e.overlay)return e.tree.toString();let n="";for(let r of this.children){let i=r.toString();i&&(n&&(n+=","),n+=i)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(n.length?"("+n+")":""):n}cursor(e=0){return new KS(this.topNode,e)}cursorAt(e,n=0,r=0){let i=bg.get(this)||this.topNode,s=new KS(i);return s.moveTo(e,n),bg.set(this,s._tree),s}get topNode(){return new ho(this,0,0,null)}resolve(e,n=0){let r=Xd(bg.get(this)||this.topNode,e,n,!1);return bg.set(this,r),r}resolveInner(e,n=0){let r=Xd(eI.get(this)||this.topNode,e,n,!0);return eI.set(this,r),r}resolveStack(e,n=0){return iJ(this,e,n)}iterate(e){let{enter:n,leave:r,from:i=0,to:s=this.length}=e,a=e.mode||0,u=(a&or.IncludeAnonymous)>0;for(let c=this.cursor(a|or.IncludeAnonymous);;){let d=!1;if(c.from<=s&&c.to>=i&&(!u&&c.type.isAnonymous||n(c)!==!1)){if(c.firstChild())continue;d=!0}for(;d&&r&&(u||!c.type.isAnonymous)&&r(c),!c.nextSibling();){if(!c.parent())return;d=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let n in this.props)e.push([+n,this.props[n]]);return e}balance(e={}){return this.children.length<=8?this:fC(mo.none,this.children,this.positions,0,this.children.length,0,this.length,(n,r,i)=>new jr(this.type,n,r,i,this.propValues),e.makeTree||((n,r,i)=>new jr(mo.none,n,r,i)))}static build(e){return oJ(e)}}jr.empty=new jr(mo.none,[],[],0);class uC{constructor(e,n){this.buffer=e,this.index=n}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new uC(this.buffer,this.index)}}class ya{constructor(e,n,r){this.buffer=e,this.length=n,this.set=r}get type(){return mo.none}toString(){let e=[];for(let n=0;n<this.buffer.length;)e.push(this.childString(n)),n=this.buffer[n+3];return e.join(",")}childString(e){let n=this.buffer[e],r=this.buffer[e+3],i=this.set.types[n],s=i.name;if(/\W/.test(s)&&!i.isError&&(s=JSON.stringify(s)),e+=4,r==e)return s;let a=[];for(;e<r;)a.push(this.childString(e)),e=this.buffer[e+3];return s+"("+a.join(",")+")"}findChild(e,n,r,i,s){let{buffer:a}=this,u=-1;for(let c=e;c!=n&&!(FB(s,i,a[c+1],a[c+2])&&(u=c,r>0));c=a[c+3]);return u}slice(e,n,r){let i=this.buffer,s=new Uint16Array(n-e),a=0;for(let u=e,c=0;u<n;){s[c++]=i[u++],s[c++]=i[u++]-r;let d=s[c++]=i[u++]-r;s[c++]=i[u++]-e,a=Math.max(a,d)}return new ya(s,a,this.set)}}function FB(t,e,n,r){switch(t){case-2:return n<e;case-1:return r>=e&&n<e;case 0:return n<e&&r>e;case 1:return n<=e&&r>e;case 2:return r>e;case 4:return!0}}function Xd(t,e,n,r){for(var i;t.from==t.to||(n<1?t.from>=e:t.from>e)||(n>-1?t.to<=e:t.to<e);){let a=!r&&t instanceof ho&&t.index<0?null:t.parent;if(!a)return t;t=a}let s=r?0:or.IgnoreOverlays;if(r)for(let a=t,u=a.parent;u;a=u,u=a.parent)a instanceof ho&&a.index<0&&((i=u.enter(e,n,s))===null||i===void 0?void 0:i.from)!=a.from&&(t=u);for(;;){let a=t.enter(e,n,s);if(!a)return t;t=a}}class UB{cursor(e=0){return new KS(this,e)}getChild(e,n=null,r=null){let i=tI(this,e,n,r);return i.length?i[0]:null}getChildren(e,n=null,r=null){return tI(this,e,n,r)}resolve(e,n=0){return Xd(this,e,n,!1)}resolveInner(e,n=0){return Xd(this,e,n,!0)}matchContext(e){return WS(this.parent,e)}enterUnfinishedNodesBefore(e){let n=this.childBefore(e),r=this;for(;n;){let i=n.lastChild;if(!i||i.to!=n.to)break;i.type.isError&&i.from==i.to?(r=n,n=i.prevSibling):n=i}return r}get node(){return this}get next(){return this.parent}}class ho extends UB{constructor(e,n,r,i){super(),this._tree=e,this.from=n,this.index=r,this._parent=i}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,n,r,i,s=0){for(let a=this;;){for(let{children:u,positions:c}=a._tree,d=n>0?u.length:-1;e!=d;e+=n){let h=u[e],g=c[e]+a.from,m;if(!(!(s&or.EnterBracketed&&h instanceof jr&&(m=Cd.get(h))&&!m.overlay&&m.bracketed&&r>=g&&r<=g+h.length)&&!FB(i,r,g,g+h.length))){if(h instanceof ya){if(s&or.ExcludeBuffers)continue;let y=h.findChild(0,h.buffer.length,n,r-g,i);if(y>-1)return new ra(new nJ(a,h,e,g),null,y)}else if(s&or.IncludeAnonymous||!h.type.isAnonymous||cC(h)){let y;if(!(s&or.IgnoreMounts)&&(y=Cd.get(h))&&!y.overlay)return new ho(y.tree,g,e,a);let b=new ho(h,g,e,a);return s&or.IncludeAnonymous||!b.type.isAnonymous?b:b.nextChild(n<0?h.children.length-1:0,n,r,i,s)}}}if(s&or.IncludeAnonymous||!a.type.isAnonymous||(a.index>=0?e=a.index+n:e=n<0?-1:a._parent._tree.children.length,a=a._parent,!a))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}prop(e){return this._tree.prop(e)}enter(e,n,r=0){let i;if(!(r&or.IgnoreOverlays)&&(i=Cd.get(this._tree))&&i.overlay){let s=e-this.from,a=r&or.EnterBracketed&&i.bracketed;for(let{from:u,to:c}of i.overlay)if((n>0||a?u<=s:u<s)&&(n<0||a?c>=s:c>s))return new ho(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,n,r)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function tI(t,e,n,r){let i=t.cursor(),s=[];if(!i.firstChild())return s;if(n!=null){for(let a=!1;!a;)if(a=i.type.is(n),!i.nextSibling())return s}for(;;){if(r!=null&&i.type.is(r))return s;if(i.type.is(e)&&s.push(i.node),!i.nextSibling())return r==null?s:[]}}function WS(t,e,n=e.length-1){for(let r=t;n>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(e[n]&&e[n]!=r.name)return!1;n--}}return!0}class nJ{constructor(e,n,r,i){this.parent=e,this.buffer=n,this.index=r,this.start=i}}class ra extends UB{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,n,r){super(),this.context=e,this._parent=n,this.index=r,this.type=e.buffer.set.types[e.buffer.buffer[r]]}child(e,n,r){let{buffer:i}=this.context,s=i.findChild(this.index+4,i.buffer[this.index+3],e,n-this.context.start,r);return s<0?null:new ra(this.context,this,s)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}prop(e){return this.type.prop(e)}enter(e,n,r=0){if(r&or.ExcludeBuffers)return null;let{buffer:i}=this.context,s=i.findChild(this.index+4,i.buffer[this.index+3],n>0?1:-1,e-this.context.start,n);return s<0?null:new ra(this.context,this,s)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,n=e.buffer[this.index+3];return n<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new ra(this.context,this._parent,n):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,n=this._parent?this._parent.index+4:0;return this.index==n?this.externalSibling(-1):new ra(this.context,this._parent,e.findChild(n,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],n=[],{buffer:r}=this.context,i=this.index+4,s=r.buffer[this.index+3];if(s>i){let a=r.buffer[this.index+1];e.push(r.slice(i,s,a)),n.push(0)}return new jr(this.type,e,n,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function $B(t){if(!t.length)return null;let e=0,n=t[0];for(let s=1;s<t.length;s++){let a=t[s];(a.from>n.from||a.to<n.to)&&(n=a,e=s)}let r=n instanceof ho&&n.index<0?null:n.parent,i=t.slice();return r?i[e]=r:i.splice(e,1),new rJ(i,n)}class rJ{constructor(e,n){this.heads=e,this.node=n}get next(){return $B(this.heads)}}function iJ(t,e,n){let r=t.resolveInner(e,n),i=null;for(let s=r instanceof ho?r:r.context.parent;s;s=s.parent)if(s.index<0){let a=s.parent;(i||(i=[r])).push(a.resolve(e,n)),s=a}else{let a=Cd.get(s.tree);if(a&&a.overlay&&a.overlay[0].from<=e&&a.overlay[a.overlay.length-1].to>=e){let u=new ho(a.tree,a.overlay[0].from+s.from,-1,s);(i||(i=[r])).push(Xd(u,e,n,!1))}}return i?$B(i):r}class KS{get name(){return this.type.name}constructor(e,n=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=n&~or.EnterBracketed,e instanceof ho)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let r=e._parent;r;r=r._parent)this.stack.unshift(r.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,n){this.index=e;let{start:r,buffer:i}=this.buffer;return this.type=n||i.set.types[i.buffer[e]],this.from=r+i.buffer[e+1],this.to=r+i.buffer[e+2],!0}yield(e){return e?e instanceof ho?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,n,r){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,n,r,this.mode));let{buffer:i}=this.buffer,s=i.findChild(this.index+4,i.buffer[this.index+3],e,n-this.buffer.start,r);return s<0?!1:(this.stack.push(this.index),this.yieldBuf(s))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,n,r=this.mode){return this.buffer?r&or.ExcludeBuffers?!1:this.enterChild(1,e,n):this.yield(this._tree.enter(e,n,r))}parent(){if(!this.buffer)return this.yieldNode(this.mode&or.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&or.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:n}=this.buffer,r=this.stack.length-1;if(e<0){let i=r<0?0:this.stack[r]+4;if(this.index!=i)return this.yieldBuf(n.findChild(i,this.index,-1,0,4))}else{let i=n.buffer[this.index+3];if(i<(r<0?n.buffer.length:n.buffer[this.stack[r]+3]))return this.yieldBuf(i)}return r<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let n,r,{buffer:i}=this;if(i){if(e>0){if(this.index<i.buffer.buffer.length)return!1}else for(let s=0;s<this.index;s++)if(i.buffer.buffer[s+3]<this.index)return!1;({index:n,parent:r}=i)}else({index:n,_parent:r}=this._tree);for(;r;{index:n,_parent:r}=r)if(n>-1)for(let s=n+e,a=e<0?-1:r._tree.children.length;s!=a;s+=e){let u=r._tree.children[s];if(this.mode&or.IncludeAnonymous||u instanceof ya||!u.type.isAnonymous||cC(u))return!1}return!0}move(e,n){if(n&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,n=0){for(;(this.from==this.to||(n<1?this.from>=e:this.from>e)||(n>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,n););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,n=null,r=0;if(e&&e.context==this.buffer)e:for(let i=this.index,s=this.stack.length;s>=0;){for(let a=e;a;a=a._parent)if(a.index==i){if(i==this.index)return a;n=a,r=s+1;break e}i=this.stack[--s]}for(let i=r;i<this.stack.length;i++)n=new ra(this.buffer,n,this.stack[i]);return this.bufferNode=new ra(this.buffer,n,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,n){for(let r=0;;){let i=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){r++;continue}this.type.isAnonymous||(i=!0)}for(;;){if(i&&n&&n(this),i=this.type.isAnonymous,!r)return;if(this.nextSibling())break;this.parent(),r--,i=!0}}}matchContext(e){if(!this.buffer)return WS(this.node.parent,e);let{buffer:n}=this.buffer,{types:r}=n.set;for(let i=e.length-1,s=this.stack.length-1;i>=0;s--){if(s<0)return WS(this._tree,e,i);let a=r[n.buffer[this.stack[s]]];if(!a.isAnonymous){if(e[i]&&e[i]!=a.name)return!1;i--}}return!0}}function cC(t){return t.children.some(e=>e instanceof ya||!e.type.isAnonymous||cC(e))}function oJ(t){var e;let{buffer:n,nodeSet:r,maxBufferLength:i=JZ,reused:s=[],minRepeatType:a=r.types.length}=t,u=Array.isArray(n)?new uC(n,n.length):n,c=r.types,d=0,h=0;function g(k,P,A,I,L,j){let{id:N,start:_,end:H,size:F}=u,G=h,B=d;if(F<0)if(u.next(),F==-1){let z=s[N];A.push(z),I.push(_-k);return}else if(F==-3){d=N;return}else if(F==-4){h=N;return}else throw new RangeError(`Unrecognized record size: ${F}`);let q=c[N],U,X,Z=_-k;if(H-_<=i&&(X=w(u.pos-P,L))){let z=new Uint16Array(X.size-X.skip),$=u.pos-X.size,W=z.length;for(;u.pos>$;)W=C(X.start,z,W);U=new ya(z,H-X.start,r),Z=X.start-k}else{let z=u.pos-F;u.next();let $=[],W=[],K=N>=a?N:-1,ie=0,ee=H;for(;u.pos>z;)K>=0&&u.id==K&&u.size>=0?(u.end<=ee-i&&(b($,W,_,ie,u.end,ee,K,G,B),ie=$.length,ee=u.end),u.next()):j>2500?m(_,z,$,W):g(_,z,$,W,K,j+1);if(K>=0&&ie>0&&ie<$.length&&b($,W,_,ie,_,ee,K,G,B),$.reverse(),W.reverse(),K>-1&&ie>0){let ae=y(q,B);U=fC(q,$,W,0,$.length,0,H-_,ae,ae)}else U=x(q,$,W,H-_,G-H,B)}A.push(U),I.push(Z)}function m(k,P,A,I){let L=[],j=0,N=-1;for(;u.pos>P;){let{id:_,start:H,end:F,size:G}=u;if(G>4)u.next();else{if(N>-1&&H<N)break;N<0&&(N=F-i),L.push(_,H,F),j++,u.next()}}if(j){let _=new Uint16Array(j*4),H=L[L.length-2];for(let F=L.length-3,G=0;F>=0;F-=3)_[G++]=L[F],_[G++]=L[F+1]-H,_[G++]=L[F+2]-H,_[G++]=G;A.push(new ya(_,L[2]-H,r)),I.push(H-k)}}function y(k,P){return(A,I,L)=>{let j=0,N=A.length-1,_,H;if(N>=0&&(_=A[N])instanceof jr){if(!N&&_.type==k&&_.length==L)return _;(H=_.prop(Xt.lookAhead))&&(j=I[N]+_.length+H)}return x(k,A,I,L,j,P)}}function b(k,P,A,I,L,j,N,_,H){let F=[],G=[];for(;k.length>I;)F.push(k.pop()),G.push(P.pop()+A-L);k.push(x(r.types[N],F,G,j-L,_-j,H)),P.push(L-A)}function x(k,P,A,I,L,j,N){if(j){let _=[Xt.contextHash,j];N=N?[_].concat(N):[_]}if(L>25){let _=[Xt.lookAhead,L];N=N?[_].concat(N):[_]}return new jr(k,P,A,I,N)}function w(k,P){let A=u.fork(),I=0,L=0,j=0,N=A.end-i,_={size:0,start:0,skip:0};e:for(let H=A.pos-k;A.pos>H;){let F=A.size;if(A.id==P&&F>=0){_.size=I,_.start=L,_.skip=j,j+=4,I+=4,A.next();continue}let G=A.pos-F;if(F<0||G<H||A.start<N)break;let B=A.id>=a?4:0,q=A.start;for(A.next();A.pos>G;){if(A.size<0)if(A.size==-3||A.size==-4)B+=4;else break e;else A.id>=a&&(B+=4);A.next()}L=q,I+=F,j+=B}return(P<0||I==k)&&(_.size=I,_.start=L,_.skip=j),_.size>4?_:void 0}function C(k,P,A){let{id:I,start:L,end:j,size:N}=u;if(u.next(),N>=0&&I<a){let _=A;if(N>4){let H=u.pos-(N-4);for(;u.pos>H;)A=C(k,P,A)}P[--A]=_,P[--A]=j-k,P[--A]=L-k,P[--A]=I}else N==-3?d=I:N==-4&&(h=I);return A}let T=[],E=[];for(;u.pos>0;)g(t.start||0,t.bufferStart||0,T,E,-1,0);let M=(e=t.length)!==null&&e!==void 0?e:T.length?E[0]+T[0].length:0;return new jr(c[t.topID],T.reverse(),E.reverse(),M)}const nI=new WeakMap;function Hg(t,e){if(!t.isAnonymous||e instanceof ya||e.type!=t)return 1;let n=nI.get(e);if(n==null){n=1;for(let r of e.children){if(r.type!=t||!(r instanceof jr)){n=1;break}n+=Hg(t,r)}nI.set(e,n)}return n}function fC(t,e,n,r,i,s,a,u,c){let d=0;for(let b=r;b<i;b++)d+=Hg(t,e[b]);let h=Math.ceil(d*1.5/8),g=[],m=[];function y(b,x,w,C,T){for(let E=w;E<C;){let M=E,k=x[E],P=Hg(t,b[E]);for(E++;E<C;E++){let A=Hg(t,b[E]);if(P+A>=h)break;P+=A}if(E==M+1){if(P>h){let A=b[M];y(A.children,A.positions,0,A.children.length,x[M]+T);continue}g.push(b[M])}else{let A=x[E-1]+b[E-1].length-k;g.push(fC(t,b,x,M,E,k,A,null,c))}m.push(k+T-s)}}return y(e,n,r,i,0),(u||c)(g,m,a)}class uu{constructor(e,n,r,i,s=!1,a=!1){this.from=e,this.to=n,this.tree=r,this.offset=i,this.open=(s?1:0)|(a?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,n=[],r=!1){let i=[new uu(0,e.length,e,0,!1,r)];for(let s of n)s.to>e.length&&i.push(s);return i}static applyChanges(e,n,r=128){if(!n.length)return e;let i=[],s=1,a=e.length?e[0]:null;for(let u=0,c=0,d=0;;u++){let h=u<n.length?n[u]:null,g=h?h.fromA:1e9;if(g-c>=r)for(;a&&a.from<g;){let m=a;if(c>=m.from||g<=m.to||d){let y=Math.max(m.from,c)-d,b=Math.min(m.to,g)-d;m=y>=b?null:new uu(y,b,m.tree,m.offset+d,u>0,!!h)}if(m&&i.push(m),a.to>g)break;a=s<e.length?e[s++]:null}if(!h)break;c=h.toA,d=h.toA-h.toB}return i}}class sJ{startParse(e,n,r){return typeof e=="string"&&(e=new lJ(e)),r=r?r.length?r.map(i=>new Wb(i.from,i.to)):[new Wb(0,0)]:[new Wb(0,e.length)],this.createParse(e,n||[],r)}parse(e,n,r){let i=this.startParse(e,n,r);for(;;){let s=i.advance();if(s)return s}}}class lJ{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,n){return this.string.slice(e,n)}}new Xt({perNode:!0});let aJ=0;class ro{constructor(e,n,r,i){this.name=e,this.set=n,this.base=r,this.modified=i,this.id=aJ++}toString(){let{name:e}=this;for(let n of this.modified)n.name&&(e=`${n.name}(${e})`);return e}static define(e,n){let r=typeof e=="string"?e:"?";if(e instanceof ro&&(n=e),n?.base)throw new Error("Can not derive from a modified tag");let i=new ro(r,[],null,[]);if(i.set.push(i),n)for(let s of n.set)i.set.push(s);return i}static defineModifier(e){let n=new wm(e);return r=>r.modified.indexOf(n)>-1?r:wm.get(r.base||r,r.modified.concat(n).sort((i,s)=>i.id-s.id))}}let uJ=0;class wm{constructor(e){this.name=e,this.instances=[],this.id=uJ++}static get(e,n){if(!n.length)return e;let r=n[0].instances.find(u=>u.base==e&&cJ(n,u.modified));if(r)return r;let i=[],s=new ro(e.name,i,e,n);for(let u of n)u.instances.push(s);let a=fJ(n);for(let u of e.set)if(!u.modified.length)for(let c of a)i.push(wm.get(u,c));return s}}function cJ(t,e){return t.length==e.length&&t.every((n,r)=>n==e[r])}function fJ(t){let e=[[]];for(let n=0;n<t.length;n++)for(let r=0,i=e.length;r<i;r++)e.push(e[r].concat(t[n]));return e.sort((n,r)=>r.length-n.length)}function dJ(t){let e=Object.create(null);for(let n in t){let r=t[n];Array.isArray(r)||(r=[r]);for(let i of n.split(" "))if(i){let s=[],a=2,u=i;for(let g=0;;){if(u=="..."&&g>0&&g+3==i.length){a=1;break}let m=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(u);if(!m)throw new RangeError("Invalid path: "+i);if(s.push(m[0]=="*"?"":m[0][0]=='"'?JSON.parse(m[0]):m[0]),g+=m[0].length,g==i.length)break;let y=i[g++];if(g==i.length&&y=="!"){a=0;break}if(y!="/")throw new RangeError("Invalid path: "+i);u=i.slice(g)}let c=s.length-1,d=s[c];if(!d)throw new RangeError("Invalid path: "+i);let h=new Cm(r,a,c>0?s.slice(0,c):null);e[d]=h.sort(e[d])}}return hJ.add(e)}const hJ=new Xt({combine(t,e){let n,r,i;for(;t||e;){if(!t||e&&t.depth>=e.depth?(i=e,e=e.next):(i=t,t=t.next),n&&n.mode==i.mode&&!i.context&&!n.context)continue;let s=new Cm(i.tags,i.mode,i.context);n?n.next=s:r=s,n=s}return r}});class Cm{constructor(e,n,r,i){this.tags=e,this.mode=n,this.context=r,this.next=i}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}}Cm.empty=new Cm([],2,null);function pJ(t,e){let n=Object.create(null);for(let s of t)if(!Array.isArray(s.tag))n[s.tag.id]=s.class;else for(let a of s.tag)n[a.id]=s.class;let{scope:r,all:i=null}={};return{style:s=>{let a=i;for(let u of s)for(let c of u.set){let d=n[c.id];if(d){a=a?a+" "+d:d;break}}return a},scope:r}}const Fe=ro.define,xg=Fe(),Ql=Fe(),rI=Fe(Ql),iI=Fe(Ql),Zl=Fe(),Sg=Fe(Zl),Kb=Fe(Zl),ss=Fe(),Qa=Fe(ss),rs=Fe(),is=Fe(),YS=Fe(),ed=Fe(YS),wg=Fe(),Ot={comment:xg,lineComment:Fe(xg),blockComment:Fe(xg),docComment:Fe(xg),name:Ql,variableName:Fe(Ql),typeName:rI,tagName:Fe(rI),propertyName:iI,attributeName:Fe(iI),className:Fe(Ql),labelName:Fe(Ql),namespace:Fe(Ql),macroName:Fe(Ql),literal:Zl,string:Sg,docString:Fe(Sg),character:Fe(Sg),attributeValue:Fe(Sg),number:Kb,integer:Fe(Kb),float:Fe(Kb),bool:Fe(Zl),regexp:Fe(Zl),escape:Fe(Zl),color:Fe(Zl),url:Fe(Zl),keyword:rs,self:Fe(rs),null:Fe(rs),atom:Fe(rs),unit:Fe(rs),modifier:Fe(rs),operatorKeyword:Fe(rs),controlKeyword:Fe(rs),definitionKeyword:Fe(rs),moduleKeyword:Fe(rs),operator:is,derefOperator:Fe(is),arithmeticOperator:Fe(is),logicOperator:Fe(is),bitwiseOperator:Fe(is),compareOperator:Fe(is),updateOperator:Fe(is),definitionOperator:Fe(is),typeOperator:Fe(is),controlOperator:Fe(is),punctuation:YS,separator:Fe(YS),bracket:ed,angleBracket:Fe(ed),squareBracket:Fe(ed),paren:Fe(ed),brace:Fe(ed),content:ss,heading:Qa,heading1:Fe(Qa),heading2:Fe(Qa),heading3:Fe(Qa),heading4:Fe(Qa),heading5:Fe(Qa),heading6:Fe(Qa),contentSeparator:Fe(ss),list:Fe(ss),quote:Fe(ss),emphasis:Fe(ss),strong:Fe(ss),link:Fe(ss),monospace:Fe(ss),strikethrough:Fe(ss),inserted:Fe(),deleted:Fe(),changed:Fe(),invalid:Fe(),meta:wg,documentMeta:Fe(wg),annotation:Fe(wg),processingInstruction:Fe(wg),definition:ro.defineModifier("definition"),constant:ro.defineModifier("constant"),function:ro.defineModifier("function"),standard:ro.defineModifier("standard"),local:ro.defineModifier("local"),special:ro.defineModifier("special")};for(let t in Ot){let e=Ot[t];e instanceof ro&&(e.name=t)}pJ([{tag:Ot.link,class:"tok-link"},{tag:Ot.heading,class:"tok-heading"},{tag:Ot.emphasis,class:"tok-emphasis"},{tag:Ot.strong,class:"tok-strong"},{tag:Ot.keyword,class:"tok-keyword"},{tag:Ot.atom,class:"tok-atom"},{tag:Ot.bool,class:"tok-bool"},{tag:Ot.url,class:"tok-url"},{tag:Ot.labelName,class:"tok-labelName"},{tag:Ot.inserted,class:"tok-inserted"},{tag:Ot.deleted,class:"tok-deleted"},{tag:Ot.literal,class:"tok-literal"},{tag:Ot.string,class:"tok-string"},{tag:Ot.number,class:"tok-number"},{tag:[Ot.regexp,Ot.escape,Ot.special(Ot.string)],class:"tok-string2"},{tag:Ot.variableName,class:"tok-variableName"},{tag:Ot.local(Ot.variableName),class:"tok-variableName tok-local"},{tag:Ot.definition(Ot.variableName),class:"tok-variableName tok-definition"},{tag:Ot.special(Ot.variableName),class:"tok-variableName2"},{tag:Ot.definition(Ot.propertyName),class:"tok-propertyName tok-definition"},{tag:Ot.typeName,class:"tok-typeName"},{tag:Ot.namespace,class:"tok-namespace"},{tag:Ot.className,class:"tok-className"},{tag:Ot.macroName,class:"tok-macroName"},{tag:Ot.propertyName,class:"tok-propertyName"},{tag:Ot.operator,class:"tok-operator"},{tag:Ot.comment,class:"tok-comment"},{tag:Ot.meta,class:"tok-meta"},{tag:Ot.invalid,class:"tok-invalid"},{tag:Ot.punctuation,class:"tok-punctuation"}]);var Yb;const Cg=new Xt,gJ=new Xt;class nl{constructor(e,n,r=[],i=""){this.data=e,this.name=i,an.prototype.hasOwnProperty("tree")||Object.defineProperty(an.prototype,"tree",{get(){return va(this)}}),this.parser=n,this.extension=[Fc.of(this),an.languageData.of((s,a,u)=>{let c=oI(s,a,u),d=c.type.prop(Cg);if(!d)return[];let h=s.facet(d),g=c.type.prop(gJ);if(g){let m=c.resolve(a-c.from,u);for(let y of g)if(y.test(m,s)){let b=s.facet(y.facet);return y.type=="replace"?b:b.concat(h)}}return h})].concat(r)}isActiveAt(e,n,r=-1){return oI(e,n,r).type.prop(Cg)==this.data}findRegions(e){let n=e.facet(Fc);if(n?.data==this.data)return[{from:0,to:e.doc.length}];if(!n||!n.allowsNesting)return[];let r=[],i=(s,a)=>{if(s.prop(Cg)==this.data){r.push({from:a,to:a+s.length});return}let u=s.prop(Xt.mounted);if(u){if(u.tree.prop(Cg)==this.data){if(u.overlay)for(let c of u.overlay)r.push({from:c.from+a,to:c.to+a});else r.push({from:a,to:a+s.length});return}else if(u.overlay){let c=r.length;if(i(u.tree,u.overlay[0].from+a),r.length>c)return}}for(let c=0;c<s.children.length;c++){let d=s.children[c];d instanceof jr&&i(d,s.positions[c]+a)}};return i(va(e),0),r}get allowsNesting(){return!0}}nl.setState=sr.define();function oI(t,e,n){let r=t.facet(Fc),i=va(t).topNode;if(!r||r.allowsNesting)for(let s=i;s;s=s.enter(e,n,or.ExcludeBuffers|or.EnterBracketed))s.type.isTop&&(i=s);return i}function va(t){let e=t.field(nl.state,!1);return e?e.tree:jr.empty}class mJ{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,n){let r=this.cursorPos-this.string.length;return e<r||n>=this.cursorPos?this.doc.sliceString(e,n):this.string.slice(e-r,n-r)}}let td=null;class Rm{constructor(e,n,r=[],i,s,a,u,c){this.parser=e,this.state=n,this.fragments=r,this.tree=i,this.treeLen=s,this.viewport=a,this.skipped=u,this.scheduleOn=c,this.parse=null,this.tempSkipped=[]}static create(e,n,r){return new Rm(e,n,[],jr.empty,0,r,[],null)}startParse(){return this.parser.startParse(new mJ(this.state.doc),this.fragments)}work(e,n){return n!=null&&n>=this.state.doc.length&&(n=void 0),this.tree!=jr.empty&&this.isDone(n??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var r;if(typeof e=="number"){let i=Date.now()+e;e=()=>Date.now()>i}for(this.parse||(this.parse=this.startParse()),n!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>n)&&n<this.state.doc.length&&this.parse.stopAt(n);;){let i=this.parse.advance();if(i)if(this.fragments=this.withoutTempSkipped(uu.addTree(i,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=(r=this.parse.stoppedAt)!==null&&r!==void 0?r:this.state.doc.length,this.tree=i,this.parse=null,this.treeLen<(n??this.state.doc.length))this.parse=this.startParse();else return!0;if(e())return!1}})}takeTree(){let e,n;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(n=this.parse.advance()););}),this.treeLen=e,this.tree=n,this.fragments=this.withoutTempSkipped(uu.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let n=td;td=this;try{return e()}finally{td=n}}withoutTempSkipped(e){for(let n;n=this.tempSkipped.pop();)e=sI(e,n.from,n.to);return e}changes(e,n){let{fragments:r,tree:i,treeLen:s,viewport:a,skipped:u}=this;if(this.takeTree(),!e.empty){let c=[];if(e.iterChangedRanges((d,h,g,m)=>c.push({fromA:d,toA:h,fromB:g,toB:m})),r=uu.applyChanges(r,c),i=jr.empty,s=0,a={from:e.mapPos(a.from,-1),to:e.mapPos(a.to,1)},this.skipped.length){u=[];for(let d of this.skipped){let h=e.mapPos(d.from,1),g=e.mapPos(d.to,-1);h<g&&u.push({from:h,to:g})}}}return new Rm(this.parser,n,r,i,s,a,u,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let n=this.skipped.length;for(let r=0;r<this.skipped.length;r++){let{from:i,to:s}=this.skipped[r];i<e.to&&s>e.from&&(this.fragments=sI(this.fragments,i,s),this.skipped.splice(r--,1))}return this.skipped.length>=n?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,n){this.skipped.push({from:e,to:n})}static getSkippingParser(e){return new class extends sJ{createParse(n,r,i){let s=i[0].from,a=i[i.length-1].to;return{parsedPos:s,advance(){let c=td;if(c){for(let d of i)c.tempSkipped.push(d);e&&(c.scheduleOn=c.scheduleOn?Promise.all([c.scheduleOn,e]):e)}return this.parsedPos=a,new jr(mo.none,[],[],a-s)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let n=this.fragments;return this.treeLen>=e&&n.length&&n[0].from==0&&n[0].to>=e}static get(){return td}}function sI(t,e,n){return uu.applyChanges(t,[{fromA:e,toA:n,fromB:e,toB:n}])}class Vc{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let n=this.context.changes(e.changes,e.state),r=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),n.viewport.to);return n.work(20,r)||n.takeTree(),new Vc(n)}static init(e){let n=Math.min(3e3,e.doc.length),r=Rm.create(e.facet(Fc).parser,e,{from:0,to:n});return r.work(20,n)||r.takeTree(),new Vc(r)}}nl.state=Ta.define({create:Vc.init,update(t,e){for(let n of e.effects)if(n.is(nl.setState))return n.value;return e.startState.facet(Fc)!=e.state.facet(Fc)?Vc.init(e.state):t.apply(e)}});let qB=t=>{let e=setTimeout(()=>t(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(qB=t=>{let e=-1,n=setTimeout(()=>{e=requestIdleCallback(t,{timeout:400})},100);return()=>e<0?clearTimeout(n):cancelIdleCallback(e)});const Xb=typeof navigator<"u"&&(!((Yb=navigator.scheduling)===null||Yb===void 0)&&Yb.isInputPending)?()=>navigator.scheduling.isInputPending():null,yJ=Lc.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let n=this.view.state.field(nl.state).context;(n.updateViewport(e.view.viewport)||this.view.viewport.to>n.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(n)}scheduleWork(){if(this.working)return;let{state:e}=this.view,n=e.field(nl.state);(n.tree!=n.context.tree||!n.context.isDone(e.doc.length))&&(this.working=qB(this.work))}work(e){this.working=null;let n=Date.now();if(this.chunkEnd<n&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=n+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:r,viewport:{to:i}}=this.view,s=r.field(nl.state);if(s.tree==s.context.tree&&s.context.isDone(i+1e5))return;let a=Date.now()+Math.min(this.chunkBudget,100,e&&!Xb?Math.max(25,e.timeRemaining()-5):1e9),u=s.context.treeLen<i&&r.doc.length>i+1e3,c=s.context.work(()=>Xb&&Xb()||Date.now()>a,i+(u?0:1e5));this.chunkBudget-=Date.now()-n,(c||this.chunkBudget<=0)&&(s.context.takeTree(),this.view.dispatch({effects:nl.setState.of(new Vc(s.context))})),this.chunkBudget>0&&!(c&&!u)&&this.scheduleWork(),this.checkAsyncSchedule(s.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(n=>bs(this.view.state,n)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),Fc=bt.define({combine(t){return t.length?t[0]:null},enables:t=>[nl.state,yJ,At.contentAttributes.compute([t],e=>{let n=e.facet(t);return n&&n.name?{"data-language":n.name}:{}})]}),vJ=bt.define(),dC=bt.define({combine:t=>{if(!t.length)return" ";let e=t[0];if(!e||/\S/.test(e)||Array.from(e).some(n=>n!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(t[0]));return e}});function Tm(t){let e=t.facet(dC);return e.charCodeAt(0)==9?t.tabSize*e.length:e.length}function Em(t,e){let n="",r=t.tabSize,i=t.facet(dC)[0];if(i==" "){for(;e>=r;)n+=" ",e-=r;i=" "}for(let s=0;s<e;s++)n+=i;return n}function GB(t,e){t instanceof an&&(t=new Cy(t));for(let r of t.state.facet(vJ)){let i=r(t,e);if(i!==void 0)return i}let n=va(t.state);return n.length>=e?xJ(t,n,e):null}class Cy{constructor(e,n={}){this.state=e,this.options=n,this.unit=Tm(e)}lineAt(e,n=1){let r=this.state.doc.lineAt(e),{simulateBreak:i,simulateDoubleBreak:s}=this.options;return i!=null&&i>=r.from&&i<=r.to?s&&i==e?{text:"",from:e}:(n<0?i<e:i<=e)?{text:r.text.slice(i-r.from),from:i}:{text:r.text.slice(0,i-r.from),from:r.from}:r}textAfterPos(e,n=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";let{text:r,from:i}=this.lineAt(e,n);return r.slice(e-i,Math.min(r.length,e+100-i))}column(e,n=1){let{text:r,from:i}=this.lineAt(e,n),s=this.countColumn(r,e-i),a=this.options.overrideIndentation?this.options.overrideIndentation(i):-1;return a>-1&&(s+=a-this.countColumn(r,r.search(/\S|$/))),s}countColumn(e,n=e.length){return my(e,this.state.tabSize,n)}lineIndent(e,n=1){let{text:r,from:i}=this.lineAt(e,n),s=this.options.overrideIndentation;if(s){let a=s(i);if(a>-1)return a}return this.countColumn(r,r.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const bJ=new Xt;function xJ(t,e,n){let r=e.resolveStack(n),i=e.resolveInner(n,-1).resolve(n,0).enterUnfinishedNodesBefore(n);if(i!=r.node){let s=[];for(let a=i;a&&!(a.from<r.node.from||a.to>r.node.to||a.from==r.node.from&&a.type==r.node.type);a=a.parent)s.push(a);for(let a=s.length-1;a>=0;a--)r={node:s[a],next:r}}return WB(r,t,n)}function WB(t,e,n){for(let r=t;r;r=r.next){let i=wJ(r.node);if(i)return i(hC.create(e,n,r))}return 0}function SJ(t){return t.pos==t.options.simulateBreak&&t.options.simulateDoubleBreak}function wJ(t){let e=t.type.prop(bJ);if(e)return e;let n=t.firstChild,r;if(n&&(r=n.type.prop(Xt.closedBy))){let i=t.lastChild,s=i&&r.indexOf(i.name)>-1;return a=>EJ(a,!0,1,void 0,s&&!SJ(a)?i.from:void 0)}return t.parent==null?CJ:null}function CJ(){return 0}class hC extends Cy{constructor(e,n,r){super(e.state,e.options),this.base=e,this.pos=n,this.context=r}get node(){return this.context.node}static create(e,n,r){return new hC(e,n,r)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let n=this.state.doc.lineAt(e.from);for(;;){let r=e.resolve(n.from);for(;r.parent&&r.parent.from==r.from;)r=r.parent;if(RJ(r,e))break;n=this.state.doc.lineAt(r.from)}return this.lineIndent(n.from)}continue(){return WB(this.context.next,this.base,this.pos)}}function RJ(t,e){for(let n=e;n;n=n.parent)if(t==n)return!0;return!1}function TJ(t){let e=t.node,n=e.childAfter(e.from),r=e.lastChild;if(!n)return null;let i=t.options.simulateBreak,s=t.state.doc.lineAt(n.from),a=i==null||i<=s.from?s.to:Math.min(s.to,i);for(let u=n.to;;){let c=e.childAfter(u);if(!c||c==r)return null;if(!c.type.isSkipped){if(c.from>=a)return null;let d=/^ */.exec(s.text.slice(n.to-s.from))[0].length;return{from:n.from,to:n.to+d}}u=c.to}}function EJ(t,e,n,r,i){let s=t.textAfter,a=s.match(/^\s*/)[0].length,u=r&&s.slice(a,a+r.length)==r||i==t.pos+a,c=TJ(t);return c?u?t.column(c.from):t.column(c.to):t.baseIndent+(u?0:t.unit*n)}const MJ=1e4,AJ="()[]{}",OJ=new Xt;function XS(t,e,n){let r=t.prop(e<0?Xt.openedBy:Xt.closedBy);if(r)return r;if(t.name.length==1){let i=n.indexOf(t.name);if(i>-1&&i%2==(e<0?1:0))return[n[i+e]]}return null}function QS(t){let e=t.type.prop(OJ);return e?e(t.node):t}function hc(t,e,n,r={}){let i=r.maxScanDistance||MJ,s=r.brackets||AJ,a=va(t),u=a.resolveInner(e,n);for(let c=u;c;c=c.parent){let d=XS(c.type,n,s);if(d&&c.from<c.to){let h=QS(c);if(h&&(n>0?e>=h.from&&e<h.to:e>h.from&&e<=h.to))return kJ(t,e,n,c,h,d,s)}}return IJ(t,e,n,a,u.type,i,s)}function kJ(t,e,n,r,i,s,a){let u=r.parent,c={from:i.from,to:i.to},d=0,h=u?.cursor();if(h&&(n<0?h.childBefore(r.from):h.childAfter(r.to)))do if(n<0?h.to<=r.from:h.from>=r.to){if(d==0&&s.indexOf(h.type.name)>-1&&h.from<h.to){let g=QS(h);return{start:c,end:g?{from:g.from,to:g.to}:void 0,matched:!0}}else if(XS(h.type,n,a))d++;else if(XS(h.type,-n,a)){if(d==0){let g=QS(h);return{start:c,end:g&&g.from<g.to?{from:g.from,to:g.to}:void 0,matched:!1}}d--}}while(n<0?h.prevSibling():h.nextSibling());return{start:c,matched:!1}}function IJ(t,e,n,r,i,s,a){if(n<0?!e:e==t.doc.length)return null;let u=n<0?t.sliceDoc(e-1,e):t.sliceDoc(e,e+1),c=a.indexOf(u);if(c<0||c%2==0!=n>0)return null;let d={from:n<0?e-1:e,to:n>0?e+1:e},h=t.doc.iterRange(e,n>0?t.doc.length:0),g=0;for(let m=0;!h.next().done&&m<=s;){let y=h.value;n<0&&(m+=y.length);let b=e+m*n;for(let x=n>0?0:y.length-1,w=n>0?y.length:-1;x!=w;x+=n){let C=a.indexOf(y[x]);if(!(C<0||r.resolveInner(b+x,1).type!=i))if(C%2==0==n>0)g++;else{if(g==1)return{start:d,end:{from:b+x,to:b+x+1},matched:C>>1==c>>1};g--}}n>0&&(m+=y.length)}return h.done?{start:d,matched:!1}:null}const DJ=Object.create(null),lI=[mo.none],aI=[],uI=Object.create(null),PJ=Object.create(null);for(let[t,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])PJ[t]=zJ(DJ,e);function Qb(t,e){aI.indexOf(t)>-1||(aI.push(t),console.warn(e))}function zJ(t,e){let n=[];for(let u of e.split(" ")){let c=[];for(let d of u.split(".")){let h=t[d]||Ot[d];h?typeof h=="function"?c.length?c=c.map(h):Qb(d,`Modifier ${d} used at start of tag`):c.length?Qb(d,`Tag ${d} used as modifier`):c=Array.isArray(h)?h:[h]:Qb(d,`Unknown highlighting tag ${d}`)}for(let d of c)n.push(d)}if(!n.length)return 0;let r=e.replace(/ /g,"_"),i=r+" "+n.map(u=>u.id),s=uI[i];if(s)return s.id;let a=uI[i]=mo.define({id:lI.length,name:r,props:[dJ({[r]:n})]});return lI.push(a),a.id}mr.RTL,mr.LTR;const NJ=t=>{let{state:e}=t,n=e.doc.lineAt(e.selection.main.from),r=gC(t.state,n.from);return r.line?LJ(t):r.block?jJ(t):!1};function pC(t,e){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let i=t(e,n);return i?(r(n.update(i)),!0):!1}}const LJ=pC(VJ,0),BJ=pC(KB,0),jJ=pC((t,e)=>KB(t,e,HJ(e)),0);function gC(t,e){let n=t.languageDataAt("commentTokens",e,1);return n.length?n[0]:{}}const nd=50;function _J(t,{open:e,close:n},r,i){let s=t.sliceDoc(r-nd,r),a=t.sliceDoc(i,i+nd),u=/\s*$/.exec(s)[0].length,c=/^\s*/.exec(a)[0].length,d=s.length-u;if(s.slice(d-e.length,d)==e&&a.slice(c,c+n.length)==n)return{open:{pos:r-u,margin:u&&1},close:{pos:i+c,margin:c&&1}};let h,g;i-r<=2*nd?h=g=t.sliceDoc(r,i):(h=t.sliceDoc(r,r+nd),g=t.sliceDoc(i-nd,i));let m=/^\s*/.exec(h)[0].length,y=/\s*$/.exec(g)[0].length,b=g.length-y-n.length;return h.slice(m,m+e.length)==e&&g.slice(b,b+n.length)==n?{open:{pos:r+m+e.length,margin:/\s/.test(h.charAt(m+e.length))?1:0},close:{pos:i-y-n.length,margin:/\s/.test(g.charAt(b-1))?1:0}}:null}function HJ(t){let e=[];for(let n of t.selection.ranges){let r=t.doc.lineAt(n.from),i=n.to<=r.to?r:t.doc.lineAt(n.to);i.from>r.from&&i.from==n.to&&(i=n.to==r.to+1?r:t.doc.lineAt(n.to-1));let s=e.length-1;s>=0&&e[s].to>r.from?e[s].to=i.to:e.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:i.to})}return e}function KB(t,e,n=e.selection.ranges){let r=n.map(s=>gC(e,s.from).block);if(!r.every(s=>s))return null;let i=n.map((s,a)=>_J(e,r[a],s.from,s.to));if(t!=2&&!i.every(s=>s))return{changes:e.changes(n.map((s,a)=>i[a]?[]:[{from:s.from,insert:r[a].open+" "},{from:s.to,insert:" "+r[a].close}]))};if(t!=1&&i.some(s=>s)){let s=[];for(let a=0,u;a<i.length;a++)if(u=i[a]){let c=r[a],{open:d,close:h}=u;s.push({from:d.pos-c.open.length,to:d.pos+d.margin},{from:h.pos-h.margin,to:h.pos+c.close.length})}return{changes:s}}return null}function VJ(t,e,n=e.selection.ranges){let r=[],i=-1;e:for(let{from:s,to:a}of n){let u=r.length,c=1e9,d;for(let h=s;h<=a;){let g=e.doc.lineAt(h);if(d==null&&(d=gC(e,g.from).line,!d))continue e;if(g.from>i&&(s==a||a>g.from)){i=g.from;let m=/^\s*/.exec(g.text)[0].length,y=m==g.length,b=g.text.slice(m,m+d.length)==d?m:-1;m<g.text.length&&m<c&&(c=m),r.push({line:g,comment:b,token:d,indent:m,empty:y,single:!1})}h=g.to+1}if(c<1e9)for(let h=u;h<r.length;h++)r[h].indent<r[h].line.text.length&&(r[h].indent=c);r.length==u+1&&(r[u].single=!0)}if(t!=2&&r.some(s=>s.comment<0&&(!s.empty||s.single))){let s=[];for(let{line:u,token:c,indent:d,empty:h,single:g}of r)(g||!h)&&s.push({from:u.from+d,insert:c+" "});let a=e.changes(s);return{changes:a,selection:e.selection.map(a,1)}}else if(t!=1&&r.some(s=>s.comment>=0)){let s=[];for(let{line:a,comment:u,token:c}of r)if(u>=0){let d=a.from+u,h=d+c.length;a.text[h-a.from]==" "&&h++,s.push({from:d,to:h})}return{changes:s}}return null}const ZS=Ea.define(),FJ=Ea.define(),UJ=bt.define(),YB=bt.define({combine(t){return rQ(t,{minDepth:100,newGroupDelay:500,joinToEvent:(e,n)=>n},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,n)=>(r,i)=>e(r,i)||n(r,i)})}}),XB=Ta.define({create(){return xs.empty},update(t,e){let n=e.state.facet(YB),r=e.annotation(ZS);if(r){let c=wi.fromTransaction(e,r.selection),d=r.side,h=d==0?t.undone:t.done;return c?h=Mm(h,h.length,n.minDepth,c):h=JB(h,e.startState.selection),new xs(d==0?r.rest:h,d==0?h:r.rest)}let i=e.annotation(FJ);if((i=="full"||i=="before")&&(t=t.isolate()),e.annotation(Rr.addToHistory)===!1)return e.changes.empty?t:t.addMapping(e.changes.desc);let s=wi.fromTransaction(e),a=e.annotation(Rr.time),u=e.annotation(Rr.userEvent);return s?t=t.addChanges(s,a,u,n,e):e.selection&&(t=t.addSelection(e.startState.selection,a,u,n.newGroupDelay)),(i=="full"||i=="after")&&(t=t.isolate()),t},toJSON(t){return{done:t.done.map(e=>e.toJSON()),undone:t.undone.map(e=>e.toJSON())}},fromJSON(t){return new xs(t.done.map(wi.fromJSON),t.undone.map(wi.fromJSON))}});function $J(t={}){return[XB,YB.of(t),At.domEventHandlers({beforeinput(e,n){let r=e.inputType=="historyUndo"?QB:e.inputType=="historyRedo"?JS:null;return r?(e.preventDefault(),r(n)):!1}})]}function Ry(t,e){return function({state:n,dispatch:r}){if(!e&&n.readOnly)return!1;let i=n.field(XB,!1);if(!i)return!1;let s=i.pop(t,n,e);return s?(r(s),!0):!1}}const QB=Ry(0,!1),JS=Ry(1,!1),qJ=Ry(0,!0),GJ=Ry(1,!0);class wi{constructor(e,n,r,i,s){this.changes=e,this.effects=n,this.mapped=r,this.startSelection=i,this.selectionsAfter=s}setSelAfter(e){return new wi(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,n,r;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(n=this.mapped)===null||n===void 0?void 0:n.toJSON(),startSelection:(r=this.startSelection)===null||r===void 0?void 0:r.toJSON(),selectionsAfter:this.selectionsAfter.map(i=>i.toJSON())}}static fromJSON(e){return new wi(e.changes&&wr.fromJSON(e.changes),[],e.mapped&&Ss.fromJSON(e.mapped),e.startSelection&&ze.fromJSON(e.startSelection),e.selectionsAfter.map(ze.fromJSON))}static fromTransaction(e,n){let r=ao;for(let i of e.startState.facet(UJ)){let s=i(e);s.length&&(r=r.concat(s))}return!r.length&&e.changes.empty?null:new wi(e.changes.invert(e.startState.doc),r,void 0,n||e.startState.selection,ao)}static selection(e){return new wi(void 0,ao,void 0,void 0,e)}}function Mm(t,e,n,r){let i=e+1>n+20?e-n-1:0,s=t.slice(i,e);return s.push(r),s}function WJ(t,e){let n=[],r=!1;return t.iterChangedRanges((i,s)=>n.push(i,s)),e.iterChangedRanges((i,s,a,u)=>{for(let c=0;c<n.length;){let d=n[c++],h=n[c++];u>=d&&a<=h&&(r=!0)}}),r}function KJ(t,e){return t.ranges.length==e.ranges.length&&t.ranges.filter((n,r)=>n.empty!=e.ranges[r].empty).length===0}function ZB(t,e){return t.length?e.length?t.concat(e):t:e}const ao=[],YJ=200;function JB(t,e){if(t.length){let n=t[t.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-YJ));return r.length&&r[r.length-1].eq(e)?t:(r.push(e),Mm(t,t.length-1,1e9,n.setSelAfter(r)))}else return[wi.selection([e])]}function XJ(t){let e=t[t.length-1],n=t.slice();return n[t.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),n}function Zb(t,e){if(!t.length)return t;let n=t.length,r=ao;for(;n;){let i=QJ(t[n-1],e,r);if(i.changes&&!i.changes.empty||i.effects.length){let s=t.slice(0,n);return s[n-1]=i,s}else e=i.mapped,n--,r=i.selectionsAfter}return r.length?[wi.selection(r)]:ao}function QJ(t,e,n){let r=ZB(t.selectionsAfter.length?t.selectionsAfter.map(u=>u.map(e)):ao,n);if(!t.changes)return wi.selection(r);let i=t.changes.map(e),s=e.mapDesc(t.changes,!0),a=t.mapped?t.mapped.composeDesc(s):s;return new wi(i,sr.mapEffects(t.effects,e),a,t.startSelection.map(s),r)}const ZJ=/^(input\.type|delete)($|\.)/;class xs{constructor(e,n,r=0,i=void 0){this.done=e,this.undone=n,this.prevTime=r,this.prevUserEvent=i}isolate(){return this.prevTime?new xs(this.done,this.undone):this}addChanges(e,n,r,i,s){let a=this.done,u=a[a.length-1];return u&&u.changes&&!u.changes.empty&&e.changes&&(!r||ZJ.test(r))&&(!u.selectionsAfter.length&&n-this.prevTime<i.newGroupDelay&&i.joinToEvent(s,WJ(u.changes,e.changes))||r=="input.type.compose")?a=Mm(a,a.length-1,i.minDepth,new wi(e.changes.compose(u.changes),ZB(sr.mapEffects(e.effects,u.changes),u.effects),u.mapped,u.startSelection,ao)):a=Mm(a,a.length,i.minDepth,e),new xs(a,ao,n,r)}addSelection(e,n,r,i){let s=this.done.length?this.done[this.done.length-1].selectionsAfter:ao;return s.length>0&&n-this.prevTime<i&&r==this.prevUserEvent&&r&&/^select($|\.)/.test(r)&&KJ(s[s.length-1],e)?this:new xs(JB(this.done,e),this.undone,n,r)}addMapping(e){return new xs(Zb(this.done,e),Zb(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,n,r){let i=e==0?this.done:this.undone;if(i.length==0)return null;let s=i[i.length-1],a=s.selectionsAfter[0]||(s.startSelection?s.startSelection.map(s.changes.invertedDesc,1):n.selection);if(r&&s.selectionsAfter.length)return n.update({selection:s.selectionsAfter[s.selectionsAfter.length-1],annotations:ZS.of({side:e,rest:XJ(i),selection:a}),userEvent:e==0?"select.undo":"select.redo",scrollIntoView:!0});if(s.changes){let u=i.length==1?ao:i.slice(0,i.length-1);return s.mapped&&(u=Zb(u,s.mapped)),n.update({changes:s.changes,selection:s.startSelection,effects:s.effects,annotations:ZS.of({side:e,rest:u,selection:a}),filter:!1,userEvent:e==0?"undo":"redo",scrollIntoView:!0})}else return null}}xs.empty=new xs(ao,ao);const JJ=[{key:"Mod-z",run:QB,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:JS,preventDefault:!0},{linux:"Ctrl-Shift-z",run:JS,preventDefault:!0},{key:"Mod-u",run:qJ,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:GJ,preventDefault:!0}];function tf(t,e){return ze.create(t.ranges.map(e),t.mainIndex)}function qo(t,e){return t.update({selection:e,scrollIntoView:!0,userEvent:"select"})}function Go({state:t,dispatch:e},n){let r=tf(t.selection,n);return r.eq(t.selection,!0)?!1:(e(qo(t,r)),!0)}function Ty(t,e){return ze.cursor(e?t.to:t.from)}function ej(t,e){return Go(t,n=>n.empty?t.moveByChar(n,e):Ty(n,e))}function ti(t){return t.textDirectionAt(t.state.selection.main.head)==mr.LTR}const tj=t=>ej(t,!ti(t)),nj=t=>ej(t,ti(t));function rj(t,e){return Go(t,n=>n.empty?t.moveByGroup(n,e):Ty(n,e))}const eee=t=>rj(t,!ti(t)),tee=t=>rj(t,ti(t));function nee(t,e,n){if(e.type.prop(n))return!0;let r=e.to-e.from;return r&&(r>2||/[^\s,.;:]/.test(t.sliceDoc(e.from,e.to)))||e.firstChild}function Ey(t,e,n){let r=va(t).resolveInner(e.head),i=n?Xt.closedBy:Xt.openedBy;for(let c=e.head;;){let d=n?r.childAfter(c):r.childBefore(c);if(!d)break;nee(t,d,i)?r=d:c=n?d.to:d.from}let s=r.type.prop(i),a,u;return s&&(a=n?hc(t,r.from,1):hc(t,r.to,-1))&&a.matched?u=n?a.end.to:a.end.from:u=n?r.to:r.from,ze.cursor(u,n?-1:1)}const ree=t=>Go(t,e=>Ey(t.state,e,!ti(t))),iee=t=>Go(t,e=>Ey(t.state,e,ti(t)));function ij(t,e){return Go(t,n=>{if(!n.empty)return Ty(n,e);let r=t.moveVertically(n,e);return r.head!=n.head?r:t.moveToLineBoundary(n,e)})}const oj=t=>ij(t,!1),sj=t=>ij(t,!0);function lj(t){let e=t.scrollDOM.clientHeight<t.scrollDOM.scrollHeight-2,n=0,r=0,i;if(e){for(let s of t.state.facet(At.scrollMargins)){let a=s(t);a?.top&&(n=Math.max(a?.top,n)),a?.bottom&&(r=Math.max(a?.bottom,r))}i=t.scrollDOM.clientHeight-n-r}else i=(t.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:r,selfScroll:e,height:Math.max(t.defaultLineHeight,i-5)}}function aj(t,e){let n=lj(t),{state:r}=t,i=tf(r.selection,a=>a.empty?t.moveVertically(a,e,n.height):Ty(a,e));if(i.eq(r.selection))return!1;let s;if(n.selfScroll){let a=t.coordsAtPos(r.selection.main.head),u=t.scrollDOM.getBoundingClientRect(),c=u.top+n.marginTop,d=u.bottom-n.marginBottom;a&&a.top>c&&a.bottom<d&&(s=At.scrollIntoView(i.main.head,{y:"start",yMargin:a.top-c}))}return t.dispatch(qo(r,i),{effects:s}),!0}const cI=t=>aj(t,!1),ew=t=>aj(t,!0);function Ma(t,e,n){let r=t.lineBlockAt(e.head),i=t.moveToLineBoundary(e,n);if(i.head==e.head&&i.head!=(n?r.to:r.from)&&(i=t.moveToLineBoundary(e,n,!1)),!n&&i.head==r.from&&r.length){let s=/^\s*/.exec(t.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;s&&e.head!=r.from+s&&(i=ze.cursor(r.from+s))}return i}const oee=t=>Go(t,e=>Ma(t,e,!0)),see=t=>Go(t,e=>Ma(t,e,!1)),lee=t=>Go(t,e=>Ma(t,e,!ti(t))),aee=t=>Go(t,e=>Ma(t,e,ti(t))),uee=t=>Go(t,e=>ze.cursor(t.lineBlockAt(e.head).from,1)),cee=t=>Go(t,e=>ze.cursor(t.lineBlockAt(e.head).to,-1));function fee(t,e,n){let r=!1,i=tf(t.selection,s=>{let a=hc(t,s.head,-1)||hc(t,s.head,1)||s.head>0&&hc(t,s.head-1,1)||s.head<t.doc.length&&hc(t,s.head+1,-1);if(!a||!a.end)return s;r=!0;let u=a.start.from==s.head?a.end.to:a.end.from;return ze.cursor(u)});return r?(e(qo(t,i)),!0):!1}const dee=({state:t,dispatch:e})=>fee(t,e);function bo(t,e){let n=tf(t.state.selection,r=>{let i=e(r);return ze.range(r.anchor,i.head,i.goalColumn,i.bidiLevel||void 0,i.assoc)});return n.eq(t.state.selection)?!1:(t.dispatch(qo(t.state,n)),!0)}function uj(t,e){return bo(t,n=>t.moveByChar(n,e))}const cj=t=>uj(t,!ti(t)),fj=t=>uj(t,ti(t));function dj(t,e){return bo(t,n=>t.moveByGroup(n,e))}const hee=t=>dj(t,!ti(t)),pee=t=>dj(t,ti(t)),gee=t=>bo(t,e=>Ey(t.state,e,!ti(t))),mee=t=>bo(t,e=>Ey(t.state,e,ti(t)));function hj(t,e){return bo(t,n=>t.moveVertically(n,e))}const pj=t=>hj(t,!1),gj=t=>hj(t,!0);function mj(t,e){return bo(t,n=>t.moveVertically(n,e,lj(t).height))}const fI=t=>mj(t,!1),dI=t=>mj(t,!0),yee=t=>bo(t,e=>Ma(t,e,!0)),vee=t=>bo(t,e=>Ma(t,e,!1)),bee=t=>bo(t,e=>Ma(t,e,!ti(t))),xee=t=>bo(t,e=>Ma(t,e,ti(t))),See=t=>bo(t,e=>ze.cursor(t.lineBlockAt(e.head).from)),wee=t=>bo(t,e=>ze.cursor(t.lineBlockAt(e.head).to)),hI=({state:t,dispatch:e})=>(e(qo(t,{anchor:0})),!0),pI=({state:t,dispatch:e})=>(e(qo(t,{anchor:t.doc.length})),!0),gI=({state:t,dispatch:e})=>(e(qo(t,{anchor:t.selection.main.anchor,head:0})),!0),mI=({state:t,dispatch:e})=>(e(qo(t,{anchor:t.selection.main.anchor,head:t.doc.length})),!0),Cee=({state:t,dispatch:e})=>(e(t.update({selection:{anchor:0,head:t.doc.length},userEvent:"select"})),!0),Ree=({state:t,dispatch:e})=>{let n=My(t).map(({from:r,to:i})=>ze.range(r,Math.min(i+1,t.doc.length)));return e(t.update({selection:ze.create(n),userEvent:"select"})),!0},Tee=({state:t,dispatch:e})=>{let n=tf(t.selection,r=>{let i=va(t),s=i.resolveStack(r.from,1);if(r.empty){let a=i.resolveStack(r.from,-1);a.node.from>=s.node.from&&a.node.to<=s.node.to&&(s=a)}for(let a=s;a;a=a.next){let{node:u}=a;if((u.from<r.from&&u.to>=r.to||u.to>r.to&&u.from<=r.from)&&a.next)return ze.range(u.to,u.from)}return r});return n.eq(t.selection)?!1:(e(qo(t,n)),!0)};function yj(t,e){let{state:n}=t,r=n.selection,i=n.selection.ranges.slice();for(let s of n.selection.ranges){let a=n.doc.lineAt(s.head);if(e?a.to<t.state.doc.length:a.from>0)for(let u=s;;){let c=t.moveVertically(u,e);if(c.head<a.from||c.head>a.to){i.some(d=>d.head==c.head)||i.push(c);break}else{if(c.head==u.head)break;u=c}}}return i.length==r.ranges.length?!1:(t.dispatch(qo(n,ze.create(i,i.length-1))),!0)}const Eee=t=>yj(t,!1),Mee=t=>yj(t,!0),Aee=({state:t,dispatch:e})=>{let n=t.selection,r=null;return n.ranges.length>1?r=ze.create([n.main]):n.main.empty||(r=ze.create([ze.cursor(n.main.head)])),r?(e(qo(t,r)),!0):!1};function vh(t,e){if(t.state.readOnly)return!1;let n="delete.selection",{state:r}=t,i=r.changeByRange(s=>{let{from:a,to:u}=s;if(a==u){let c=e(s);c<a?(n="delete.backward",c=Rg(t,c,!1)):c>a&&(n="delete.forward",c=Rg(t,c,!0)),a=Math.min(a,c),u=Math.max(u,c)}else a=Rg(t,a,!1),u=Rg(t,u,!0);return a==u?{range:s}:{changes:{from:a,to:u},range:ze.cursor(a,a<s.head?-1:1)}});return i.changes.empty?!1:(t.dispatch(r.update(i,{scrollIntoView:!0,userEvent:n,effects:n=="delete.selection"?At.announce.of(r.phrase("Selection deleted")):void 0})),!0)}function Rg(t,e,n){if(t instanceof At)for(let r of t.state.facet(At.atomicRanges).map(i=>i(t)))r.between(e,e,(i,s)=>{i<e&&s>e&&(e=n?s:i)});return e}const vj=(t,e,n)=>vh(t,r=>{let i=r.from,{state:s}=t,a=s.doc.lineAt(i),u,c;if(n&&!e&&i>a.from&&i<a.from+200&&!/[^ \t]/.test(u=a.text.slice(0,i-a.from))){if(u[u.length-1]==" ")return i-1;let d=my(u,s.tabSize),h=d%Tm(s)||Tm(s);for(let g=0;g<h&&u[u.length-1-g]==" ";g++)i--;c=i}else c=Qr(a.text,i-a.from,e,e)+a.from,c==i&&a.number!=(e?s.doc.lines:1)?c+=e?1:-1:!e&&/[\ufe00-\ufe0f]/.test(a.text.slice(c-a.from,i-a.from))&&(c=Qr(a.text,c-a.from,!1,!1)+a.from);return c}),tw=t=>vj(t,!1,!0),bj=t=>vj(t,!0,!1),xj=(t,e)=>vh(t,n=>{let r=n.head,{state:i}=t,s=i.doc.lineAt(r),a=i.charCategorizer(r);for(let u=null;;){if(r==(e?s.to:s.from)){r==n.head&&s.number!=(e?i.doc.lines:1)&&(r+=e?1:-1);break}let c=Qr(s.text,r-s.from,e)+s.from,d=s.text.slice(Math.min(r,c)-s.from,Math.max(r,c)-s.from),h=a(d);if(u!=null&&h!=u)break;(d!=" "||r!=n.head)&&(u=h),r=c}return r}),Sj=t=>xj(t,!1),Oee=t=>xj(t,!0),kee=t=>vh(t,e=>{let n=t.lineBlockAt(e.head).to;return e.head<n?n:Math.min(t.state.doc.length,e.head+1)}),Iee=t=>vh(t,e=>{let n=t.moveToLineBoundary(e,!1).head;return e.head>n?n:Math.max(0,e.head-1)}),Dee=t=>vh(t,e=>{let n=t.moveToLineBoundary(e,!0).head;return e.head<n?n:Math.min(t.state.doc.length,e.head+1)}),Pee=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=t.changeByRange(r=>({changes:{from:r.from,to:r.to,insert:Yt.of(["",""])},range:ze.cursor(r.from)}));return e(t.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},zee=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=t.changeByRange(r=>{if(!r.empty||r.from==0||r.from==t.doc.length)return{range:r};let i=r.from,s=t.doc.lineAt(i),a=i==s.from?i-1:Qr(s.text,i-s.from,!1)+s.from,u=i==s.to?i+1:Qr(s.text,i-s.from,!0)+s.from;return{changes:{from:a,to:u,insert:t.doc.slice(i,u).append(t.doc.slice(a,i))},range:ze.cursor(u)}});return n.changes.empty?!1:(e(t.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function My(t){let e=[],n=-1;for(let r of t.selection.ranges){let i=t.doc.lineAt(r.from),s=t.doc.lineAt(r.to);if(!r.empty&&r.to==s.from&&(s=t.doc.lineAt(r.to-1)),n>=i.number){let a=e[e.length-1];a.to=s.to,a.ranges.push(r)}else e.push({from:i.from,to:s.to,ranges:[r]});n=s.number+1}return e}function wj(t,e,n){if(t.readOnly)return!1;let r=[],i=[];for(let s of My(t)){if(n?s.to==t.doc.length:s.from==0)continue;let a=t.doc.lineAt(n?s.to+1:s.from-1),u=a.length+1;if(n){r.push({from:s.to,to:a.to},{from:s.from,insert:a.text+t.lineBreak});for(let c of s.ranges)i.push(ze.range(Math.min(t.doc.length,c.anchor+u),Math.min(t.doc.length,c.head+u)))}else{r.push({from:a.from,to:s.from},{from:s.to,insert:t.lineBreak+a.text});for(let c of s.ranges)i.push(ze.range(c.anchor-u,c.head-u))}}return r.length?(e(t.update({changes:r,scrollIntoView:!0,selection:ze.create(i,t.selection.mainIndex),userEvent:"move.line"})),!0):!1}const Nee=({state:t,dispatch:e})=>wj(t,e,!1),Lee=({state:t,dispatch:e})=>wj(t,e,!0);function Cj(t,e,n){if(t.readOnly)return!1;let r=[];for(let s of My(t))n?r.push({from:s.from,insert:t.doc.slice(s.from,s.to)+t.lineBreak}):r.push({from:s.to,insert:t.lineBreak+t.doc.slice(s.from,s.to)});let i=t.changes(r);return e(t.update({changes:i,selection:t.selection.map(i,n?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const Bee=({state:t,dispatch:e})=>Cj(t,e,!1),jee=({state:t,dispatch:e})=>Cj(t,e,!0),_ee=t=>{if(t.state.readOnly)return!1;let{state:e}=t,n=e.changes(My(e).map(({from:i,to:s})=>(i>0?i--:s<e.doc.length&&s++,{from:i,to:s}))),r=tf(e.selection,i=>{let s;if(t.lineWrapping){let a=t.lineBlockAt(i.head),u=t.coordsAtPos(i.head,i.assoc||1);u&&(s=a.bottom+t.documentTop-u.bottom+t.defaultLineHeight/2)}return t.moveVertically(i,!0,s)}).map(n);return t.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:"delete.line"}),!0};function Hee(t,e){if(/\(\)|\[\]|\{\}/.test(t.sliceDoc(e-1,e+1)))return{from:e,to:e};let n=va(t).resolveInner(e),r=n.childBefore(e),i=n.childAfter(e),s;return r&&i&&r.to<=e&&i.from>=e&&(s=r.type.prop(Xt.closedBy))&&s.indexOf(i.name)>-1&&t.doc.lineAt(r.to).from==t.doc.lineAt(i.from).from&&!/\S/.test(t.sliceDoc(r.to,i.from))?{from:r.to,to:i.from}:null}const yI=Rj(!1),Vee=Rj(!0);function Rj(t){return({state:e,dispatch:n})=>{if(e.readOnly)return!1;let r=e.changeByRange(i=>{let{from:s,to:a}=i,u=e.doc.lineAt(s),c=!t&&s==a&&Hee(e,s);t&&(s=a=(a<=u.to?u:e.doc.lineAt(a)).to);let d=new Cy(e,{simulateBreak:s,simulateDoubleBreak:!!c}),h=GB(d,s);for(h==null&&(h=my(/^\s*/.exec(e.doc.lineAt(s).text)[0],e.tabSize));a<u.to&&/\s/.test(u.text[a-u.from]);)a++;c?{from:s,to:a}=c:s>u.from&&s<u.from+100&&!/\S/.test(u.text.slice(0,s))&&(s=u.from);let g=["",Em(e,h)];return c&&g.push(Em(e,d.lineIndent(u.from,-1))),{changes:{from:s,to:a,insert:Yt.of(g)},range:ze.cursor(s+1+g[1].length)}});return n(e.update(r,{scrollIntoView:!0,userEvent:"input"})),!0}}function mC(t,e){let n=-1;return t.changeByRange(r=>{let i=[];for(let a=r.from;a<=r.to;){let u=t.doc.lineAt(a);u.number>n&&(r.empty||r.to>u.from)&&(e(u,i,r),n=u.number),a=u.to+1}let s=t.changes(i);return{changes:i,range:ze.range(s.mapPos(r.anchor,1),s.mapPos(r.head,1))}})}const Fee=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=Object.create(null),r=new Cy(t,{overrideIndentation:s=>{let a=n[s];return a??-1}}),i=mC(t,(s,a,u)=>{let c=GB(r,s.from);if(c==null)return;/\S/.test(s.text)||(c=0);let d=/^\s*/.exec(s.text)[0],h=Em(t,c);(d!=h||u.from<s.from+d.length)&&(n[s.from]=c,a.push({from:s.from,to:s.from+d.length,insert:h}))});return i.changes.empty||e(t.update(i,{userEvent:"indent"})),!0},Uee=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(mC(t,(n,r)=>{r.push({from:n.from,insert:t.facet(dC)})}),{userEvent:"input.indent"})),!0),$ee=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(mC(t,(n,r)=>{let i=/^\s*/.exec(n.text)[0];if(!i)return;let s=my(i,t.tabSize),a=0,u=Em(t,Math.max(0,s-Tm(t)));for(;a<i.length&&a<u.length&&i.charCodeAt(a)==u.charCodeAt(a);)a++;r.push({from:n.from+a,to:n.from+i.length,insert:u.slice(a)})}),{userEvent:"delete.dedent"})),!0),qee=t=>(t.setTabFocusMode(),!0),Gee=[{key:"Ctrl-b",run:tj,shift:cj,preventDefault:!0},{key:"Ctrl-f",run:nj,shift:fj},{key:"Ctrl-p",run:oj,shift:pj},{key:"Ctrl-n",run:sj,shift:gj},{key:"Ctrl-a",run:uee,shift:See},{key:"Ctrl-e",run:cee,shift:wee},{key:"Ctrl-d",run:bj},{key:"Ctrl-h",run:tw},{key:"Ctrl-k",run:kee},{key:"Ctrl-Alt-h",run:Sj},{key:"Ctrl-o",run:Pee},{key:"Ctrl-t",run:zee},{key:"Ctrl-v",run:ew}],Wee=[{key:"ArrowLeft",run:tj,shift:cj,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:eee,shift:hee,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:lee,shift:bee,preventDefault:!0},{key:"ArrowRight",run:nj,shift:fj,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:tee,shift:pee,preventDefault:!0},{mac:"Cmd-ArrowRight",run:aee,shift:xee,preventDefault:!0},{key:"ArrowUp",run:oj,shift:pj,preventDefault:!0},{mac:"Cmd-ArrowUp",run:hI,shift:gI},{mac:"Ctrl-ArrowUp",run:cI,shift:fI},{key:"ArrowDown",run:sj,shift:gj,preventDefault:!0},{mac:"Cmd-ArrowDown",run:pI,shift:mI},{mac:"Ctrl-ArrowDown",run:ew,shift:dI},{key:"PageUp",run:cI,shift:fI},{key:"PageDown",run:ew,shift:dI},{key:"Home",run:see,shift:vee,preventDefault:!0},{key:"Mod-Home",run:hI,shift:gI},{key:"End",run:oee,shift:yee,preventDefault:!0},{key:"Mod-End",run:pI,shift:mI},{key:"Enter",run:yI,shift:yI},{key:"Mod-a",run:Cee},{key:"Backspace",run:tw,shift:tw,preventDefault:!0},{key:"Delete",run:bj,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:Sj,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:Oee,preventDefault:!0},{mac:"Mod-Backspace",run:Iee,preventDefault:!0},{mac:"Mod-Delete",run:Dee,preventDefault:!0}].concat(Gee.map(t=>({mac:t.key,run:t.run,shift:t.shift}))),Kee=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:ree,shift:gee},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:iee,shift:mee},{key:"Alt-ArrowUp",run:Nee},{key:"Shift-Alt-ArrowUp",run:Bee},{key:"Alt-ArrowDown",run:Lee},{key:"Shift-Alt-ArrowDown",run:jee},{key:"Mod-Alt-ArrowUp",run:Eee},{key:"Mod-Alt-ArrowDown",run:Mee},{key:"Escape",run:Aee},{key:"Mod-Enter",run:Vee},{key:"Alt-l",mac:"Ctrl-l",run:Ree},{key:"Mod-i",run:Tee,preventDefault:!0},{key:"Mod-[",run:$ee},{key:"Mod-]",run:Uee},{key:"Mod-Alt-\\",run:Fee},{key:"Shift-Mod-k",run:_ee},{key:"Shift-Mod-\\",run:dee},{key:"Mod-/",run:NJ},{key:"Alt-A",run:BJ},{key:"Ctrl-m",mac:"Shift-Alt-m",run:qee}].concat(Wee),nw=16,Am=8,Yee=8,Xee=32,Qee=126,Om=t=>t.toString(16).toUpperCase().padStart(2,"0"),Tj=t=>t>=Xee&&t<=Qee?String.fromCharCode(t):".",Zee=t=>{const e=t.slice(0,Am).map(Om).join(" "),n=t.slice(Am).map(Om).join(" ");return n?`${e} ${n}`:e},Jee=(t,e)=>{let n="",r="",i="";const s=Math.min(e+nw,t.length);for(let a=e;a<s;a++){const u=Om(t[a]);a<e+Am?n+=n?` ${u}`:u:r+=r?` ${u}`:u,i+=Tj(t[a])}return{offset:e.toString(16).padStart(Yee,"0"),hex:r?`${n} ${r}`:n,ascii:i}},ete=t=>{const e=[];for(let n=0;n<t.length;n+=nw)e.push(Zee(t.slice(n,n+nw)));return e.join(`
|
|
31
|
+
`)},tte=(t,e=64)=>{let n="";const r=Math.min(t.length,e);for(let i=0;i<r;i++)n+=Tj(t[i]);return t.length>e?`${n}…`:n},nte=t=>{const e=[];for(let r=0;r<t.length;r+=8192){let i="";const s=Math.min(r+8192,t.length);for(let a=r;a<s;a++)i+=String.fromCharCode(t[a]);e.push(i)}return btoa(e.join(""))},rte=(t,e={})=>{const n=e.maxBytes??Am,r=`${t.length} B`;if(t.length===0)return r;const i=t.slice(0,n).map(Om).join(" ");return t.length<=n?`${i} ${r}`:`${i} … ${r}`},ite=/^[0-9a-fA-F]{4,16}(?::\s+|\s{2,})/,ote=/\|[^|]*\|\s*$/,ste=t=>{const e=t.split(/\r?\n/).map(r=>r.replace(ote,"").replace(ite,"")).join("").replace(/0x/gi,"").replace(/\s+/g,"");if(e.length===0)return{ok:!1,error:"Enter at least one byte."};if(!/^[0-9a-fA-F]+$/.test(e))return{ok:!1,error:"Hex input contains invalid characters."};if(e.length%2!==0)return{ok:!1,error:"Hex input must contain complete bytes."};const n=[];for(let r=0;r<e.length;r+=2)n.push(parseInt(e.slice(r,r+2),16));return{ok:!0,value:n}},lte=t=>{const e=t.replace(/\s+/g,"");if(e.length===0)return{ok:!1,error:"Enter at least one byte."};let n;try{n=atob(e)}catch{return{ok:!1,error:"Base64 input is invalid."}}const r=[];for(let i=0;i<n.length;i++)r.push(n.charCodeAt(i));return{ok:!0,value:r}},Vg=(t,e)=>e==="hex"?ete(t):nte(t),Ej=(t,e)=>e==="hex"?ste(t):lte(t),ate=(t,e)=>{const n=Ej(t,e);return n.ok?{bytes:n.value,error:null}:{bytes:null,error:n.error}},ute=t=>{const e=t.mode??"hex";return t.initialBytes&&t.initialBytes.length>0?{mode:e,text:Vg(t.initialBytes,e),bytes:t.initialBytes,error:null}:{mode:e,text:"",bytes:null,error:null}},cte=(t,e)=>{switch(e.type){case"set-text":return{...t,text:e.text,...ate(e.text,t.mode)};case"normalize-paste":{const n=Ej(e.text,t.mode);return n.ok?{...t,text:Vg(n.value,t.mode),bytes:n.value,error:null}:{...t,text:e.text,bytes:null,error:n.error}}case"switch-mode":return t.mode===e.mode?t:t.bytes!==null?{mode:e.mode,text:Vg(t.bytes,e.mode),bytes:t.bytes,error:null}:{mode:e.mode,text:"",bytes:null,error:null};case"replace-bytes":return{mode:t.mode,text:Vg(e.bytes,t.mode),bytes:e.bytes,error:null}}},fte=At.theme({"&":{color:"var(--foreground)",backgroundColor:"transparent",fontSize:"12px"},".cm-content":{caretColor:"var(--ring)",fontFamily:'ui-monospace, "Cascadia Mono", "Fira Code", Menlo, monospace',padding:"8px"},".cm-focused":{outline:"none"},".cm-gutters":{display:"none"},".cm-scroller":{overflow:"auto"}}),vI=({label:t,active:e,onClick:n})=>O.jsx("button",{type:"button",onClick:n,className:Le("rounded-md px-2 py-1 text-xs font-medium transition-colors",e?"bg-primary text-primary-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:t}),dte=({initialBytes:t,onChange:e})=>{const[n,r]=R.useReducer(cte,void 0,()=>ute({})),i=R.useRef(t),[s,a]=R.useState(!!(i.current&&i.current.length>0)),u=R.useRef(null),c=R.useRef(null),d=R.useRef(n);d.current=n;const h=R.useRef(e);h.current=e,R.useEffect(()=>{const b=i.current;if(!b?.length)return;const x=window.setTimeout(()=>{r({type:"replace-bytes",bytes:b}),a(!1)},0);return()=>window.clearTimeout(x)},[]),R.useEffect(()=>{if(!u.current)return;const b=new At({state:an.create({doc:d.current.text,extensions:[$J(),VB.of([...Kee,...JJ]),fte,At.lineWrapping,At.updateListener.of(x=>{if(!x.docChanged)return;const w=x.state.doc.toString();if(w===d.current.text)return;const C=x.transactions.some(T=>T.isUserEvent("input.paste"));r({type:C?"normalize-paste":"set-text",text:w})})]}),parent:u.current});return c.current=b,()=>{b.destroy(),c.current=null}},[]),R.useEffect(()=>{const b=c.current;if(!b)return;const x=b.state.doc.toString();x!==n.text&&b.dispatch({changes:{from:0,to:x.length,insert:n.text}})},[n.text]),R.useEffect(()=>{h.current(n.bytes)},[n.bytes]);const g=n.bytes?.length??t?.length??0,m=n.bytes?tte(n.bytes):"",y=b=>{n.mode!==b&&r({type:"switch-mode",mode:b})};return O.jsxs("div",{className:"flex flex-col gap-2",children:[O.jsxs("div",{className:"flex items-center gap-1",children:[O.jsx(vI,{label:"Hex",active:n.mode==="hex",onClick:()=>y("hex")}),O.jsx(vI,{label:"Base64",active:n.mode==="base64",onClick:()=>y("base64")})]}),O.jsx("div",{ref:u,className:"min-h-[120px] max-h-[300px] overflow-auto rounded-md border border-input bg-muted"}),s?O.jsxs("div",{className:"text-xs text-muted-foreground",children:["Preparing editor for ",t?.length??0," bytes…"]}):null,O.jsxs("div",{className:"flex flex-col gap-1 text-xs",children:[O.jsxs("div",{className:"text-muted-foreground",children:[g," bytes"]}),m&&O.jsxs("div",{className:"overflow-hidden text-ellipsis whitespace-nowrap text-muted-foreground",children:["ASCII: ",O.jsx("span",{className:"font-mono text-foreground",children:m})]}),n.error&&O.jsx("div",{className:"text-danger",children:n.error})]})]})},hte={string:"Text",number:"Number",boolean:"Boolean",buffer:"Hex"},pte=["string","number","boolean","buffer"],gte=({supportedTypes:t,value:e,onChange:n})=>{const r=pte.filter(i=>t.includes(i));return r.length<=1?null:O.jsx("div",{role:"tablist","aria-label":"Edit as",className:"inline-flex overflow-hidden rounded-md border border-border",children:r.map(i=>O.jsx("button",{type:"button",role:"tab","aria-selected":e===i,onClick:()=>n(i),className:Le("px-3 py-1 text-xs font-medium transition-colors",e===i?"bg-primary text-primary-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:hte[i]},i))})},mte=new TextEncoder,yte=new TextDecoder("utf-8",{fatal:!0}),Jb=t=>{try{return yte.decode(new Uint8Array(t))}catch{return""}},ex=t=>Array.from(mte.encode(t)),vte=(t,e,n)=>{if(t===e)return n;if(t==="string"){const r=n;switch(e){case"number":{const i=Number(r);return Number.isNaN(i)?0:i}case"boolean":return r==="true";case"buffer":return ex(r)}}if(t==="number"){const r=n;switch(e){case"string":return String(r);case"boolean":return r!==0;case"buffer":return ex(String(r))}}if(t==="boolean"){const r=n;switch(e){case"string":return String(r);case"number":return r?1:0;case"buffer":return ex(String(r))}}if(t==="buffer"){const r=n;switch(e){case"string":return Jb(r);case"number":{const i=Jb(r),s=Number(i);return Number.isNaN(s)?0:s}case"boolean":return Jb(r)==="true"}}return n},Ec=t=>{switch(t){case"string":return"";case"number":return 0;case"boolean":return!1;case"buffer":return[]}},Mj=({supportedTypes:t,type:e,value:n,onChange:r,inputId:i,autoFocus:s})=>{const a=u=>{if(u!==e){if(n===null){r(u,Ec(u));return}r(u,vte(e,u,n))}};return O.jsxs("div",{className:"flex flex-col gap-2",children:[O.jsx(gte,{supportedTypes:t,value:e,onChange:a}),e==="buffer"?O.jsx(dte,{initialBytes:Array.isArray(n)?n:void 0,onChange:u=>r("buffer",u)}):e==="boolean"?O.jsxs(ac,{value:String(n??!1),onValueChange:u=>r("boolean",u==="true"),children:[O.jsx(ac.Trigger,{id:i,autoFocus:s,children:O.jsx(ac.Value,{})}),O.jsxs(ac.Content,{children:[O.jsx(ac.Item,{value:"true",children:"true"}),O.jsx(ac.Item,{value:"false",children:"false"})]})]}):e==="number"?O.jsx(gS,{id:i,type:"number",value:String(n??""),onChange:u=>{const c=u.target.value,d=c===""?0:Number(c);r("number",Number.isNaN(d)?0:d)},placeholder:"Enter number value",autoFocus:s}):O.jsx(gS,{id:i,type:"text",value:String(n??""),onChange:u=>r("string",u.target.value),placeholder:"Enter string value",autoFocus:s})]})},bte=(t,e,n)=>{switch(e){case"string":return{key:t,type:"string",value:n};case"number":return{key:t,type:"number",value:n};case"boolean":return{key:t,type:"boolean",value:n};case"buffer":return{key:t,type:"buffer",value:n}}},xte=({isOpen:t,onClose:e,onAddEntry:n,existingKeys:r,supportedTypes:i})=>{const s=i.includes("string")?"string":i[0]??"string",[a,u]=R.useState(""),[c,d]=R.useState(s),[h,g]=R.useState(Ec(s)),m=G1();R.useEffect(()=>{t&&(u(""),d(s),g(Ec(s)))},[t,s]);const y=i.includes(c),b=()=>{u(""),d(s),g(Ec(s)),e()},x=async()=>{if(!(!a.trim()||h===null)){if(!y){await m({variant:"alert",title:"Unsupported Type",description:"Selected type is not supported by this storage."});return}if(r.includes(a)){await m({variant:"alert",title:"Key Already Exists",description:"An entry with this key already exists."});return}n(bte(a,c,h)),b()}},w=T=>{T.key==="Enter"&&a.trim()&&c!=="buffer"&&x()},C=!a.trim()||!y||h===null;return O.jsx(un,{open:t,onOpenChange:T=>{T||b()},children:O.jsxs(un.Content,{onKeyDown:w,children:[O.jsx(un.Header,{children:O.jsx(un.Title,{children:"Add New Entry"})}),O.jsxs("div",{className:"flex flex-col gap-4",children:[O.jsxs(Oo,{children:[O.jsx(Oo.Label,{htmlFor:"new-entry-key",children:"Key"}),O.jsx(gS,{id:"new-entry-key",value:a,onChange:T=>u(T.target.value),placeholder:"Enter key name",autoFocus:!0})]}),O.jsxs(Oo,{children:[O.jsx(Oo.Label,{htmlFor:"new-entry-value",children:"Value"}),O.jsx(Mj,{supportedTypes:i,type:c,value:h,onChange:(T,E)=>{d(T),g(E)},inputId:"new-entry-value"}),!y&&O.jsx(Oo.Description,{className:"text-danger",children:"Selected type is not supported by this storage."})]})]}),O.jsxs(un.Footer,{children:[O.jsx(Ho,{tone:"neutral",variant:"outline",onClick:b,children:"Cancel"}),O.jsx(Ho,{onClick:()=>{x()},disabled:C,children:"Add Entry"})]})]})})},Ste=({isOpen:t,onClose:e,onEditEntry:n,entry:r,supportedTypes:i})=>{const s=R.useRef(r),[a,u]=R.useState("string"),[c,d]=R.useState(Ec("string")),h=G1();R.useEffect(()=>{r&&t&&(s.current=r,u(r.type),d(r.value))},[r,t]);const g=r??s.current,m=i.includes(a),y=()=>{u("string"),d(Ec("string")),e()},b=async()=>{if(!(!r||c===null)){if(!m){await h({variant:"alert",title:"Unsupported Type",description:"This storage does not support the selected type."});return}n(r.key,c),y()}},x=C=>{C.key==="Enter"&&a!=="buffer"&&b()};if(!g)return null;const w=!m||c===null;return O.jsx(un,{open:t,onOpenChange:C=>{C||y()},children:O.jsxs(un.Content,{onKeyDown:x,children:[O.jsx(un.Header,{children:O.jsx(un.Title,{children:"Edit Entry"})}),O.jsxs("div",{className:"flex flex-col gap-4",children:[O.jsxs(Oo,{children:[O.jsx(Oo.Label,{children:"Key"}),O.jsx("div",{className:"h-8 w-full truncate rounded-md border border-input bg-muted px-3 py-1.5 font-mono text-sm text-foreground",children:g.key}),O.jsx(Oo.Description,{children:"Key cannot be changed during editing"})]}),O.jsxs(Oo,{children:[O.jsx(Oo.Label,{htmlFor:"edit-entry-value",children:"Value"}),O.jsx(Mj,{supportedTypes:i,type:a,value:c,onChange:(C,T)=>{u(C),d(T)},inputId:"edit-entry-value",autoFocus:!0},g.key),!m&&O.jsxs(Oo.Description,{className:"text-danger",children:["This storage does not support ",a," values."]})]})]}),O.jsxs(un.Footer,{children:[O.jsx(Ho,{tone:"neutral",variant:"outline",onClick:y,children:"Cancel"}),O.jsx(Ho,{onClick:()=>{b()},disabled:w,children:"Save Changes"})]})]})})},wte=t=>t.type==="string"?O.jsxs("span",{className:"font-mono text-foreground",children:['"',t.value,'"']}):t.type==="number"?O.jsx("span",{className:"font-mono text-foreground",children:t.value}):t.type==="boolean"?O.jsx("span",{className:Le("font-mono",t.value?"text-primary":"text-danger"),children:t.value?"true":"false"}):O.jsx("span",{className:"font-mono text-muted-foreground",children:rte(t.value)}),Cte=5e4,bI=2e3,Rte=t=>{const e=[];let n=0;for(;n<t.length;){const r=t.indexOf(`
|
|
32
|
+
`,n),i=r===-1?t.length:r+1;for(let s=n;s<i;s+=bI)e.push([s,Math.min(s+bI,i)]);n=i}return e.length===0?[[0,0]]:e},Tte=({value:t})=>{const e=R.useMemo(()=>t.length>Cte?Rte(t):null,[t]);return e?O.jsx(fL,{"aria-label":"Large string value",className:"font-mono text-sm text-success",style:{height:384},totalCount:e.length,itemContent:n=>{const[r,i]=e[n];return O.jsxs("div",{className:"whitespace-pre-wrap wrap-anywhere",children:[n===0?'"':"",t.slice(r,i),n===e.length-1?'"':""]})}}):O.jsxs("pre",{className:"font-mono text-sm text-success whitespace-pre-wrap wrap-anywhere",children:['"',t,'"']})},Ete=({bytes:t})=>{const e=Math.ceil(t.length/16);return e===0?O.jsx("div",{className:"text-xs text-muted italic",children:"No bytes to display."}):O.jsx(fL,{"aria-label":"Buffer hexdump",className:"font-mono text-xs text-accent",style:{height:384},totalCount:e,itemContent:n=>{const r=Jee(t,n*16);return O.jsxs("div",{className:"flex gap-4 leading-snug whitespace-pre",children:[O.jsx("span",{className:"text-muted",children:r.offset}),O.jsx("span",{children:r.hex}),O.jsxs("span",{className:"text-muted",children:["|",r.ascii,"|"]})]})}})},Mte=5e4,Ate=t=>{try{const e=JSON.parse(t);return Array.isArray(e)||e&&typeof e=="object"?e:null}catch{return null}},Ote=({open:t,onOpenChange:e,onEdit:n,entry:r})=>{const i=r?.type==="string",s=i?r.value:"",a=R.useMemo(()=>!i||s.length>Mte?null:Ate(s),[i,s]);return O.jsx(un,{open:t,onOpenChange:e,children:O.jsxs(un.Content,{className:"max-w-2xl",children:[O.jsx(un.Header,{children:O.jsxs("div",{className:"flex items-center gap-2",children:[O.jsx(l6,{className:"h-4 w-4 text-muted-foreground"}),O.jsx(un.Title,{children:"Entry Details"})]})}),r&&O.jsxs("div",{className:"flex max-h-[70vh] flex-col gap-4 overflow-auto",children:[O.jsxs("div",{children:[O.jsx("div",{className:"mb-1 text-sm font-medium text-foreground",children:"Key"}),O.jsx("div",{className:"w-full break-all rounded-md border border-input bg-muted px-3 py-2 font-mono text-sm text-foreground",children:r.key})]}),O.jsxs("div",{children:[O.jsx("div",{className:"mb-1 text-sm font-medium text-foreground",children:"Type"}),O.jsx(um,{tone:"neutral",variant:"outline",children:r.type})]}),O.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[O.jsx("div",{className:"mb-1 text-sm font-medium text-foreground",children:"Value"}),O.jsx("div",{className:"max-h-96 overflow-auto rounded-md border border-input bg-muted p-3",children:a?O.jsx(OX,{data:a}):r.type==="buffer"?O.jsxs("div",{className:"flex flex-col gap-2",children:[O.jsxs("div",{className:"text-xs text-muted-foreground",children:[r.value.length," ",r.value.length===1?"byte":"bytes"]}),O.jsx(Ete,{bytes:r.value})]}):r.type==="string"?O.jsx(Tte,{value:r.value}):O.jsx("div",{className:"text-sm",children:wte(r)})})]})]}),O.jsxs(un.Footer,{children:[r&&n&&O.jsxs(Ho,{tone:"neutral",variant:"outline",onClick:()=>n(r),children:[O.jsx(jD,{className:"h-3.5 w-3.5"}),"Edit"]}),O.jsx(un.Close,{render:O.jsx(Ho,{}),children:"Close"})]})]})})},tx=({title:t,items:e})=>e.length===0?null:O.jsxs("div",{children:[O.jsxs("div",{className:"text-xs font-medium text-foreground",children:[t," (",e.length,")"]}),O.jsxs("div",{className:"mt-1 max-h-24 overflow-auto rounded-md bg-muted px-2 py-1 font-mono text-xs text-muted-foreground",children:[e.slice(0,50).join(", "),e.length>50?`, +${e.length-50} more`:""]})]}),nx=({label:t,value:e})=>O.jsxs("div",{className:"rounded-md bg-muted p-2",children:[O.jsx("div",{className:"text-muted-foreground",children:t}),O.jsx("div",{className:"text-base font-semibold text-foreground",children:e})]}),kte=({state:t,onApply:e,onCancel:n})=>{const{snapshot:r,preview:i,entriesToWrite:s,targetLabel:a}=t,u=i.unsupportedTypes.length>0,c=`${r.storage.adapterName} / ${r.storage.storageName}`;return O.jsxs(O.Fragment,{children:[O.jsxs("div",{className:"flex flex-col gap-3",children:[i.metadataMismatch&&O.jsxs("div",{className:"flex items-start gap-2 rounded-md border border-border bg-muted p-2 text-xs text-foreground",children:[O.jsx(t6,{className:"mt-0.5 h-4 w-4 shrink-0 text-muted-foreground"}),O.jsxs("div",{children:["This file was exported from ",O.jsx("strong",{children:c}),". You are importing into"," ",O.jsx("strong",{children:a}),"."]})]}),u&&O.jsxs("div",{className:"flex items-start gap-2 rounded-md border border-danger/40 bg-danger/10 p-2 text-xs text-danger",children:[O.jsx(_D,{className:"mt-0.5 h-4 w-4 shrink-0"}),O.jsxs("div",{children:[i.unsupportedTypes.length," ",i.unsupportedTypes.length===1?"entry has a type":"entries have types"," ","not supported by this storage. Remove them from the file and try again.",O.jsx("div",{className:"mt-1 max-h-20 overflow-auto rounded-md bg-muted px-2 py-1 font-mono text-xs",children:i.unsupportedTypes.map(d=>`${d.key} (${d.type})`).join(", ")})]})]}),O.jsxs("div",{className:"grid grid-cols-3 gap-2 text-xs",children:[O.jsx(nx,{label:"New",value:i.newKeys.length}),O.jsx(nx,{label:"Overwrite",value:i.overwriteKeys.length}),O.jsx(nx,{label:"Skipped",value:i.skippedKeys.length})]}),O.jsx(tx,{title:"New keys",items:i.newKeys}),O.jsx(tx,{title:"Overwrite keys",items:i.overwriteKeys}),O.jsx(tx,{title:"Skipped (filtered by storage)",items:i.skippedKeys.map(d=>d.key)})]}),O.jsxs(un.Footer,{children:[O.jsx(Ho,{tone:"neutral",variant:"outline",onClick:n,children:"Cancel"}),O.jsxs(Ho,{onClick:e,disabled:u,children:["Apply (",s.length,")"]})]})]})},Ite=({state:t})=>O.jsxs("div",{className:"flex flex-col items-center gap-3 py-6",children:[O.jsx(a6,{className:"h-6 w-6 animate-spin text-muted-foreground"}),O.jsxs("div",{className:"text-sm text-foreground",children:["Importing… ",t.written," / ",t.total]})]}),Dte=({state:t,onClose:e})=>O.jsxs(O.Fragment,{children:[t.ok?O.jsxs("div",{className:"flex flex-col items-center gap-3 py-4",children:[O.jsx(n6,{className:"h-8 w-8 text-primary"}),O.jsxs("div",{className:"text-sm text-foreground",children:["Imported ",t.written," ",t.written===1?"entry":"entries","."]})]}):O.jsxs("div",{className:"flex flex-col gap-2 py-2",children:[O.jsxs("div",{className:"flex items-center gap-2 text-danger",children:[O.jsx(_D,{className:"h-5 w-5"}),O.jsxs("div",{className:"text-sm font-medium",children:["Import failed after ",t.written," of ",t.total,"."]})]}),t.failedKey&&O.jsxs("div",{className:"text-xs text-muted-foreground",children:["Failed at key:"," ",O.jsx(um,{tone:"neutral",variant:"outline",className:"font-mono",children:t.failedKey})]}),O.jsx("div",{className:"rounded-md bg-muted px-2 py-1 font-mono text-xs text-danger",children:t.error})]}),O.jsx(un.Footer,{children:O.jsx(Ho,{onClick:e,autoFocus:!0,children:"Close"})})]}),Pte=({state:t,onApply:e,onCancel:n,onClose:r})=>{const i=t===null?"":t.phase==="preview"?"Import snapshot":t.phase==="importing"?"Importing…":t.ok?"Import complete":"Import failed",s=t!==null&&t.phase!=="importing";return O.jsx(un,{open:t!==null,onOpenChange:a=>{!a&&s&&r()},children:O.jsxs(un.Content,{showCloseButton:s,children:[O.jsx(un.Header,{children:O.jsx(un.Title,{children:i})}),t?.phase==="preview"&&O.jsx(kte,{state:t,onApply:e,onCancel:n}),t?.phase==="importing"&&O.jsx(Ite,{state:t}),t?.phase==="result"&&O.jsx(Dte,{state:t,onClose:r})]})})},zte={defaultOptions:{queries:{gcTime:0,refetchOnReconnect:!1,refetchOnWindowFocus:!1,retry:!1}}},Nte=()=>new h4(zte),Lte=({children:t})=>{const[e]=R.useState(Nte);return R.useEffect(()=>()=>e.clear(),[e]),O.jsx(y4,{client:e,children:t})},Bte=t=>{const e=new Map;for(const[n,r]of t){const{adapterId:i}=r.target;let s=e.get(i);s||(s={adapterId:i,adapterName:r.adapterName,items:[]},e.set(i,s)),s.items.push({viewId:n,storageName:r.storageName,entryCount:r.entryCount})}return[...e.values()]},jte=100,_te=5,Aj=t=>t.trim().toLowerCase(),yC=t=>["storage-entry-previews",t.adapterId,t.storageId],Hte=(t,e,n)=>[...yC(t),Aj(e),n],vC=t=>["storage-full-entry",t.adapterId,t.storageId],Oj=(t,e)=>[...vC(t),e],xI=async(t,e)=>{const n=yC(e),r=vC(e);await t.cancelQueries({queryKey:n}),await t.cancelQueries({queryKey:r}),t.removeQueries({queryKey:r}),await t.resetQueries({queryKey:n})},Vte=async(t,e)=>t.invalidateQueries({queryKey:yC(e)}),Fte=async(t,e,n)=>{const r=n==null?vC(e):Oj(e,n);await t.cancelQueries({queryKey:r,exact:n!=null}),t.removeQueries({queryKey:r,exact:n!=null})},Ute=({client:t,target:e,search:n,keySortDirection:r,pageSize:i=jte,maxPages:s=_te})=>{const a=Aj(n),u=R.useMemo(()=>e?Hte(e,a,r):["storage-entry-previews","no-target"],[r,a,e?.adapterId,e?.storageId]);return O4({queryKey:u,enabled:t!=null&&e!=null,initialPageParam:void 0,maxPages:Math.max(1,s),placeholderData:X5,queryFn:({pageParam:c,signal:d})=>{if(!t||!e)throw new Error("A storage target and request client are required.");return t.request({requestType:"list-entry-previews",responseType:"entry-previews",errorType:"storage-request-error",payload:{type:"list-entry-previews",target:e,search:a||void 0,keySortDirection:r,cursor:c,limit:i},signal:d})},getNextPageParam:c=>c.nextCursor,getPreviousPageParam:c=>c.previousCursor,refetchOnWindowFocus:!1})},$te=t=>t?.pages.flatMap(e=>e.items)??[],qte=({client:t,target:e,key:n,enabled:r=!0})=>{const i=dw(),s=R.useMemo(()=>e&&n!=null?Oj(e,n):["storage-full-entry","no-entry"],[n,e?.adapterId,e?.storageId]),a=A4({queryKey:s,enabled:r&&t!=null&&e!=null&&n!=null,gcTime:0,queryFn:({signal:c})=>{if(!t||!e||n==null)throw new Error("A storage target, key, and request client are required.");return t.request({requestType:"get-entry",responseType:"entry",errorType:"storage-request-error",payload:{type:"get-entry",target:e,key:n},signal:c})},refetchOnWindowFocus:!1});R.useEffect(()=>()=>{i.cancelQueries({queryKey:s}),i.removeQueries({queryKey:s})},[i,s]);const u=R.useCallback(()=>{i.cancelQueries({queryKey:s}),i.removeQueries({queryKey:s})},[i,s]);return{...a,entry:a.data?.entry,reset:u}},Gte=(t,e)=>{const n=JSON.stringify(t,null,2),r=new Blob([n],{type:"application/json"}),i=URL.createObjectURL(r),s=document.createElement("a");s.href=i,s.download=e,document.body.appendChild(s),s.click(),document.body.removeChild(s),URL.revokeObjectURL(i)},SI=t=>t.replace(/[^a-zA-Z0-9_-]/g,"-"),Wte=(t,e=new Date)=>{const n=e.getFullYear().toString().padStart(4,"0"),r=(e.getMonth()+1).toString().padStart(2,"0"),i=e.getDate().toString().padStart(2,"0"),s=e.getHours().toString().padStart(2,"0"),a=e.getMinutes().toString().padStart(2,"0"),u=e.getSeconds().toString().padStart(2,"0"),c=`${n}${r}${i}-${s}${a}${u}`;return`rozenite-storage-${SI(t.adapterId)}-${SI(t.storageId)}-${c}.json`},eo=(t,e)=>t.adapterId===e.adapterId&&t.storageId===e.storageId,wI=t=>typeof t=="string"?"string":typeof t=="number"?"number":typeof t=="boolean"?"boolean":"buffer",Kte=(t,e=250)=>{const[n,r]=R.useState(t);return R.useEffect(()=>{const i=window.setTimeout(()=>r(t),e);return()=>window.clearTimeout(i)},[e,t]),n};function Yte(){const[t,e]=R.useState([]),[n,r]=R.useState(null),[i,s]=R.useState(""),[a,u]=R.useState("ascending"),[c,d]=R.useState(null),[h,g]=R.useState(!1),[m,y]=R.useState(0),[b,x]=R.useState({status:"idle"}),[w,C]=R.useState(null),T=G1(),E=R.useRef(null),M=R.useRef(null),k=R.useRef(0),P=R.useRef(null),A=R.useRef(null),I=R.useRef(0),L=R.useRef(null),j=R.useRef(!1),N=R.useRef(!1),_=R.useRef(new Set),H=G4({pluginId:"@rozenite/storage-plugin"}),F=dw(),G=Kte(i),B=t.find(oe=>n&&eo(oe.target,n)),q=Ute({client:H,target:n,search:G,keySortDirection:a}),U=qte({client:H,target:n,key:c?.key,enabled:c!==null}),X=$te(q.data),Z=B?.capabilities.supportedTypes??[],z=R.useMemo(()=>{const oe=new Map(t.map(xe=>[lg(xe.target),xe]));return Bte(oe)},[t]),$=()=>{U.reset(),d(null)},W=async()=>{n&&($(),y(oe=>oe+1),await xI(F,n))};R.useEffect(()=>{if(!H)return;const oe=()=>{k.current+=1,H.send("discover-storages",{type:"discover-storages",requestId:`discovery-${k.current}`})},xe=H.onMessage("storage-descriptors",we=>{we.requestId===`discovery-${k.current}`&&(e(we.storages),r(de=>de&&we.storages.some(me=>eo(me.target,de))?de:we.storages[0]?.target??null))}),Pe=H.onMessage("import-progress",we=>{C(de=>de?.phase==="importing"&&de.requestId===we.requestId&&eo(de.target,we.target)?{...de,written:we.written,total:we.total}:de)}),ne=H.onMessage("import-result",we=>{L.current===we.requestId&&M.current&&eo(we.target,M.current)&&(L.current=null,$(),y(de=>de+1),xI(F,we.target)),C(de=>de?.phase!=="importing"||de.requestId!==we.requestId||!eo(de.target,we.target)?de:we.ok?{phase:"result",ok:!0,written:we.written}:{phase:"result",ok:!1,written:we.written,total:we.total,failedKey:we.failedKey,error:we.error??"Unknown error"})}),J=H.onMessage("storage-invalidated",we=>{Fte(F,we.target,we.key),e(me=>me.map(Be=>eo(Be.target,we.target)?{...Be,entryCount:we.entryCount}:Be)),M.current&&eo(we.target,M.current)&&d(me=>me&&(we.key==null||me.key===we.key)?null:me);const de=lg(we.target);_.current.has(de)||(_.current.add(de),queueMicrotask(()=>{_.current.delete(de),M.current&&eo(we.target,M.current)&&y(me=>me+1),Vte(F,we.target)}))}),le=H.onMessage("device-ready",()=>{F.resetQueries(),oe()});return oe(),()=>{xe.remove(),Pe.remove(),ne.remove(),J.remove(),le.remove()}},[H,F]),R.useEffect(()=>{M.current=n,P.current?.abort(),P.current=null,A.current?.abort(),A.current=null,L.current=null,x({status:"idle"}),d(null),C(null)},[n]),R.useEffect(()=>()=>{P.current?.abort(),A.current?.abort()},[]);const K=oe=>{oe()},ie=(oe,xe)=>{if(!H||!n||!Z.includes(wI(xe)))return;const Pe=wI(xe),ne=Pe==="string"?{key:oe,type:Pe,value:xe}:Pe==="number"?{key:oe,type:Pe,value:xe}:Pe==="boolean"?{key:oe,type:Pe,value:xe}:{key:oe,type:Pe,value:xe};K(()=>H.send("set-entry",{type:"set-entry",target:n,entry:ne}))},ee=oe=>{!H||!n||K(()=>H.send("set-entry",{type:"set-entry",target:n,entry:oe}))},ae=R.useCallback(async oe=>{!H||!n||!await T({title:"Delete Entry",description:`Are you sure you want to delete the entry "${oe}"?`,tone:"danger",confirmLabel:"Delete"})||K(()=>H.send("delete-entry",{type:"delete-entry",target:n,key:oe}))},[H,n,T]),Y=async()=>{!H||!n||!await T({title:"Purge Storage",description:B?`Are you sure you want to remove all entries from "${B.storageName}"? This action cannot be undone.`:"Are you sure you want to remove all entries from this storage? This action cannot be undone.",tone:"danger",confirmLabel:"Purge"})||H.send("purge-storage",{type:"purge-storage",target:n})},se=async(oe,xe)=>{await T({variant:"alert",title:oe,description:xe})},ve=()=>{E.current&&(E.current.value="",E.current.click())},ye=async oe=>{const xe=oe.target.files?.[0];if(!xe||!H||!n)return;let Pe;try{Pe=JSON.parse(await xe.text())}catch(we){se("Could not read file",we instanceof Error?we.message:String(we));return}const ne=LX(Pe);if(!ne.ok){se("Invalid snapshot",`${ne.error.path}: ${ne.error.message}`);return}A.current?.abort();const J=new AbortController;A.current=J;const le=n;try{const we=await H.request({requestType:"preview-import",responseType:"import-preview",errorType:"storage-request-error",payload:{type:"preview-import",target:le,snapshot:ne.snapshot},signal:J.signal});if(J.signal.aborted||!eo(le,M.current??le))return;C({phase:"preview",target:le,targetLabel:B?`${B.adapterName} / ${B.storageName}`:"selected storage",snapshot:ne.snapshot,preview:we.preview,entriesToWrite:we.preview.acceptedEntryIndexes.map(de=>ne.snapshot.entries[de])})}catch{!J.signal.aborted&&eo(le,M.current??le)&&se("Could not preview import","Could not inspect the selected storage. Please try again.")}finally{A.current===J&&(A.current=null)}},he=()=>{if(!H||w?.phase!=="preview")return;const oe=`import-${++I.current}`;L.current=oe,H.send("import-entries",{type:"import-entries",requestId:oe,target:w.target,entries:w.entriesToWrite}),C({phase:"importing",requestId:oe,target:w.target,total:w.entriesToWrite.length,written:0})},pe=async()=>{if(!H||!n||P.current)return;const oe=n,xe=new AbortController;P.current=xe,x({status:"loading"});try{const Pe=await H.request({requestType:"export-snapshot",responseType:"export-snapshot-result",errorType:"storage-request-error",payload:{type:"export-snapshot",target:oe},signal:xe.signal});!xe.signal.aborted&&eo(oe,M.current??oe)&&(Gte(Pe.snapshot,Wte(oe)),x({status:"idle"}))}catch{!xe.signal.aborted&&eo(oe,M.current??oe)&&x({status:"error",message:"Could not export the selected storage. Please try again."})}finally{P.current===xe&&(P.current=null)}},Te=R.useMemo(()=>[{id:"key",accessorKey:"key",header:"Key",enableSorting:!0,cell:({row:oe})=>O.jsx("span",{className:"font-mono text-sm text-foreground",children:oe.original.key})},{id:"type",accessorKey:"type",header:"Type",enableSorting:!1,cell:({row:oe})=>O.jsx(um,{tone:"neutral",variant:"outline",children:oe.original.type})},{id:"preview",accessorKey:"preview",header:"Value",enableSorting:!1,cell:({row:oe})=>O.jsxs("div",{className:"min-w-0",children:[O.jsx("span",{className:"break-all font-mono text-sm text-foreground",children:oe.original.preview}),O.jsx("span",{className:"ml-2 text-xs text-muted-foreground",title:oe.original.isTruncated?`Full value size: ${oe.original.valueSize}`:void 0,children:oe.original.isTruncated?`truncated · ${oe.original.valueSize}`:oe.original.valueSize})]})},{id:"actions",header:"",enableSorting:!1,cell:({row:oe})=>O.jsxs("div",{className:"flex items-center gap-1",onClick:xe=>xe.stopPropagation(),children:[O.jsx(ck,{tone:"neutral",variant:"ghost",onClick:()=>d({key:oe.original.key,mode:"edit"}),label:`Edit value for ${oe.original.key}`,children:O.jsx(jD,{className:"h-3.5 w-3.5"})}),O.jsx(ck,{tone:"neutral",variant:"ghost",className:"text-muted-foreground hover:text-danger",onClick:()=>{ae(oe.original.key)},label:`Delete entry ${oe.original.key}`,children:O.jsx(pA,{className:"h-3.5 w-3.5"})})]})}],[ae]),Ie=[{id:"key",desc:a==="descending"}],De=oe=>{const Pe=(typeof oe=="function"?oe(Ie):oe).find(ne=>ne.id==="key");u(Pe?.desc?"descending":"ascending")},Ee=()=>{!q.hasNextPage||q.isFetching||q.isFetchingNextPage||j.current||(j.current=!0,q.fetchNextPage().finally(()=>{j.current=!1}))},_e=()=>{!q.hasPreviousPage||q.isFetching||q.isFetchingPreviousPage||N.current||(N.current=!0,q.fetchPreviousPage().finally(()=>{N.current=!1}))},Me=n?lg(n):"";return O.jsxs(O.Fragment,{children:[O.jsx(CL.Body,{children:O.jsxs(sg,{direction:"horizontal",autoSaveId:"storage",children:[O.jsx(sg.Pane,{defaultSize:22,minSize:15,maxSize:40,children:O.jsx(zb,{className:"w-full border-r-0",children:z.length===0?O.jsx("div",{className:"flex flex-1 items-center justify-center p-4 text-center text-xs text-sidebar-foreground/60",children:"Waiting for storages…"}):z.map(oe=>O.jsx(zb.Group,{label:oe.adapterName,children:oe.items.map(xe=>O.jsx(zb.Item,{selected:xe.viewId===Me,leading:O.jsx(hA,{}),trailing:O.jsx(um,{tone:"neutral",children:xe.entryCount}),onClick:()=>{const Pe=t.find(ne=>lg(ne.target)===xe.viewId);Pe&&r(Pe.target)},children:xe.storageName},xe.viewId))},oe.adapterId))})}),O.jsx(sg.Handle,{}),O.jsx(sg.Pane,{children:O.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[O.jsxs(Ji,{children:[O.jsxs(Ji.Group,{children:[O.jsx(Ji.Button,{onClick:()=>g(!0),disabled:!B,"aria-label":"Add entry",title:"Add entry",className:"w-6 px-0",children:O.jsx(c6,{className:"h-3.5 w-3.5"})}),O.jsx(Ji.Button,{onClick:()=>{Y()},disabled:!H||!n||q.isFetching,"aria-label":"Purge storage",title:"Purge storage",className:"w-6 px-0 text-muted-foreground hover:text-danger",children:O.jsx(pA,{className:"h-3.5 w-3.5"})})]}),O.jsx(Ji.Separator,{}),O.jsx(Ji.Group,{children:O.jsx(Ji.Button,{onClick:()=>{W()},disabled:!n||q.isFetching,"aria-label":"Refresh storage",title:"Refresh storage",className:"w-6 px-0",children:O.jsx(f6,{className:"h-3.5 w-3.5"})})}),O.jsx(Ji.Separator,{}),O.jsxs(Ji.Group,{children:[O.jsx(Ji.Button,{onClick:ve,disabled:!B,"aria-label":"Import storage",title:"Import storage",className:"w-6 px-0",children:O.jsx(p6,{className:"h-3.5 w-3.5"})}),O.jsx(Ji.Button,{onClick:pe,disabled:!H||!n||b.status==="loading","aria-label":b.status==="loading"?"Exporting storage":"Export storage",title:b.status==="loading"?"Exporting storage":"Export storage",className:"w-6 px-0",children:O.jsx(o6,{className:"h-3.5 w-3.5"})})]}),O.jsx(Ji.Separator,{}),O.jsx("div",{className:"min-w-40 flex-1",children:O.jsx(tX,{placeholder:"Search keys…",value:i,onChange:oe=>s(oe.target.value),onClear:()=>s(""),disabled:!B})}),b.status==="error"?O.jsx("span",{role:"alert",className:"text-xs text-danger",children:b.message}):null,O.jsx("input",{ref:E,type:"file",accept:"application/json,.json",className:"hidden",onChange:ye})]}),O.jsx("div",{className:"min-h-0 flex-1 overflow-auto",children:B?O.jsx(uX,{ariaLabel:"Storage entries",columns:Te,data:X,getRowId:oe=>oe.key,getRowTextValue:oe=>oe.key,loading:q.isLoading,emptyMessage:G?"No entries match your search.":"This storage is empty.",manualSorting:!0,onEndReached:Ee,onRowClick:oe=>d({key:oe.key,mode:"detail"}),onSortingChange:De,onStartReached:_e,scrollClassName:"h-full w-full overflow-auto",style:{height:"100%"},sorting:Ie},m):O.jsx(TX,{icon:hA,title:"No storage selected",description:"Choose a storage from the sidebar to inspect its entries."})})]})})]})}),O.jsx(xte,{isOpen:h,onClose:()=>g(!1),onAddEntry:ee,existingKeys:X.map(oe=>oe.key),supportedTypes:Z}),O.jsx(Ote,{open:c?.mode==="detail"&&U.entry!=null,onOpenChange:oe=>{oe||$()},onEdit:()=>d(oe=>oe&&{...oe,mode:"edit"}),entry:U.entry??null}),O.jsx(Ste,{isOpen:c?.mode==="edit"&&U.entry!=null,onClose:$,onEditEntry:ie,entry:U.entry??null,supportedTypes:Z}),O.jsx(Pte,{state:w,onApply:he,onCancel:()=>C(null),onClose:()=>C(null)})]})}function Xte(){return O.jsx(Lte,{children:O.jsx(CL,{children:O.jsx(Yte,{})})})}const kj="panel";Ad.registerComponent(kj,()=>Xte);Ad.runApplication(kj,{initialProps:{},rootTag:document.getElementById("root")});
|