@rozenite/storage-plugin 2.2.0 → 2.3.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.
Files changed (90) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/devtools/assets/panel-CcThj-0Z.js +32 -0
  3. package/dist/devtools/assets/panel-DTYbHqnH.css +1 -0
  4. package/dist/devtools/panel.html +2 -2
  5. package/dist/react-native/cjs/package.json +3 -0
  6. package/dist/react-native/cjs/react-native.js +38 -0
  7. package/dist/react-native/cjs/src/react-native/adapters/async-storage.js +60 -0
  8. package/dist/react-native/cjs/src/react-native/adapters/index.js +10 -0
  9. package/dist/react-native/cjs/src/react-native/adapters/mmkv.js +143 -0
  10. package/dist/react-native/cjs/src/react-native/adapters/secure-storage.js +51 -0
  11. package/dist/react-native/cjs/src/react-native/entry-preview-pagination.js +198 -0
  12. package/dist/react-native/cjs/src/react-native/export-snapshot.js +70 -0
  13. package/dist/react-native/cjs/src/react-native/full-entry-request.js +72 -0
  14. package/dist/react-native/cjs/src/react-native/import.js +185 -0
  15. package/dist/react-native/cjs/src/react-native/storage-discovery.js +69 -0
  16. package/dist/react-native/cjs/src/react-native/storage-view.js +128 -0
  17. package/dist/react-native/cjs/src/react-native/useRozeniteStoragePlugin.js +145 -0
  18. package/dist/react-native/cjs/src/react-native/useStorageAgentTools.js +228 -0
  19. package/dist/react-native/cjs/src/shared/agent-tools.js +119 -0
  20. package/dist/react-native/cjs/src/shared/entry-preview.js +48 -0
  21. package/dist/react-native/cjs/src/shared/messaging.js +2 -0
  22. package/dist/react-native/cjs/src/shared/snapshot.js +185 -0
  23. package/dist/react-native/cjs/src/shared/types.js +13 -0
  24. package/dist/react-native/package.json +3 -0
  25. package/dist/react-native/react-native.d.ts +7 -0
  26. package/dist/react-native/react-native.js +40 -0
  27. package/dist/react-native/src/react-native/adapters/async-storage.d.ts +34 -0
  28. package/dist/react-native/src/react-native/adapters/async-storage.js +56 -0
  29. package/dist/react-native/src/react-native/adapters/index.d.ts +6 -0
  30. package/dist/react-native/src/react-native/adapters/index.js +3 -0
  31. package/dist/react-native/src/react-native/adapters/mmkv.d.ts +13 -0
  32. package/dist/react-native/src/react-native/adapters/mmkv.js +139 -0
  33. package/dist/react-native/src/react-native/adapters/secure-storage.d.ts +18 -0
  34. package/dist/react-native/src/react-native/adapters/secure-storage.js +47 -0
  35. package/dist/react-native/src/react-native/entry-preview-pagination.d.ts +7 -0
  36. package/dist/react-native/src/react-native/entry-preview-pagination.js +194 -0
  37. package/dist/react-native/src/react-native/export-snapshot.d.ts +5 -0
  38. package/dist/react-native/src/react-native/export-snapshot.js +66 -0
  39. package/dist/react-native/src/react-native/full-entry-request.d.ts +5 -0
  40. package/dist/react-native/src/react-native/full-entry-request.js +68 -0
  41. package/dist/react-native/src/react-native/import.d.ts +7 -0
  42. package/dist/react-native/src/react-native/import.js +180 -0
  43. package/dist/react-native/src/react-native/storage-discovery.d.ts +5 -0
  44. package/dist/react-native/src/react-native/storage-discovery.js +65 -0
  45. package/dist/react-native/src/react-native/storage-view.d.ts +19 -0
  46. package/dist/react-native/src/react-native/storage-view.js +123 -0
  47. package/dist/react-native/src/react-native/useRozeniteStoragePlugin.d.ts +6 -0
  48. package/dist/react-native/src/react-native/useRozeniteStoragePlugin.js +141 -0
  49. package/dist/react-native/src/react-native/useStorageAgentTools.d.ts +37 -0
  50. package/dist/react-native/src/react-native/useStorageAgentTools.js +223 -0
  51. package/dist/react-native/src/shared/agent-tools.d.ts +76 -0
  52. package/dist/react-native/src/shared/agent-tools.js +116 -0
  53. package/dist/react-native/src/shared/entry-preview.d.ts +4 -0
  54. package/dist/react-native/src/shared/entry-preview.js +44 -0
  55. package/dist/react-native/src/shared/messaging.d.ts +134 -0
  56. package/dist/react-native/src/shared/messaging.js +1 -0
  57. package/dist/react-native/src/shared/snapshot.d.ts +53 -0
  58. package/dist/react-native/src/shared/snapshot.js +179 -0
  59. package/dist/react-native/src/shared/types.d.ts +78 -0
  60. package/dist/react-native/src/shared/types.js +8 -0
  61. package/dist/rozenite.json +1 -1
  62. package/dist/sdk/package.json +3 -0
  63. package/dist/sdk/sdk.d.ts +44 -0
  64. package/dist/sdk/sdk.js +9 -0
  65. package/dist/sdk/src/shared/agent-tools.d.ts +76 -0
  66. package/dist/sdk/src/shared/agent-tools.js +119 -0
  67. package/dist/sdk/src/shared/types.d.ts +78 -0
  68. package/dist/sdk/src/shared/types.js +13 -0
  69. package/package.json +16 -16
  70. package/react-native.ts +8 -1
  71. package/rozenite.config.ts +1 -0
  72. package/src/__tests__/release-bundle.test.ts +32 -0
  73. package/dist/devtools/assets/panel-D5z1BY8U.js +0 -32
  74. package/dist/devtools/assets/panel-DVlWRg6d.css +0 -1
  75. package/dist/react-native/chunks/async-storage.require.cjs +0 -1
  76. package/dist/react-native/chunks/async-storage.require.js +0 -53
  77. package/dist/react-native/chunks/index.require.cjs +0 -1
  78. package/dist/react-native/chunks/index.require.js +0 -103
  79. package/dist/react-native/chunks/secure-storage.require.cjs +0 -1
  80. package/dist/react-native/chunks/secure-storage.require.js +0 -46
  81. package/dist/react-native/chunks/types.cjs +0 -1
  82. package/dist/react-native/chunks/types.js +0 -11
  83. package/dist/react-native/chunks/useRozeniteStoragePlugin.require.cjs +0 -1
  84. package/dist/react-native/chunks/useRozeniteStoragePlugin.require.js +0 -1037
  85. package/dist/react-native/index.cjs +0 -1
  86. package/dist/react-native/index.d.ts +0 -365
  87. package/dist/react-native/index.js +0 -28
  88. package/dist/sdk/index.cjs +0 -1
  89. package/dist/sdk/index.d.ts +0 -206
  90. package/dist/sdk/index.js +0 -122
@@ -0,0 +1,32 @@
1
+ function KH(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 YH=t=>t.disabled||Array.isArray(t.accessibilityStates)&&t.accessibilityStates.indexOf("disabled")>-1,XH={adjustable:"slider",button:"button",header:"heading",image:"img",imagebutton:null,keyboardkey:null,label:null,link:"link",none:"presentation",search:"search",summary:"region",text:null},kI=t=>{var e=t.accessibilityRole,n=t.role,r=n||e;if(r){var i=XH[r];if(i!==null)return i||r}},QH={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"},ZH={},JH=function(e){e===void 0&&(e=ZH);var n=e.role||e.accessibilityRole;if(n==="label")return"label";var r=kI(e);if(r){if(r==="heading"){var i=e.accessibilityLevel||e["aria-level"];return i!=null?"h"+i:"h1"}return QH[r]}},II={isDisabled:YH,propsToAccessibilityComponent:JH,propsToAriaRole:kI};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 eV(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 tV(t){var e=eV(t,"string");return Rd(e)=="symbol"?e:e+""}function nV(t,e,n){return(e=tV(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ZE(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 Ac(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?ZE(Object(n),!0).forEach(function(r){nV(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ZE(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Im(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 Eg={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},rV=["ms","Moz","O","Webkit"],iV=(t,e)=>t+e.charAt(0).toUpperCase()+e.substring(1);Object.keys(Eg).forEach(t=>{rV.forEach(e=>{Eg[iV(e,t)]=Eg[t]})});var oV=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 DI(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 M0,JE;function sV(){if(JE)return M0;JE=1;function t(S){if(typeof S=="number")return S>>>0===S&&S>=0&&S<=4294967295?S:null;if(typeof S!="string")return null;const C=h();let T;if(T=C.hex6.exec(S))return parseInt(T[1]+"ff",16)>>>0;const E=x(S);return E??((T=C.rgb.exec(S))?(g(T[1])<<24|g(T[2])<<16|g(T[3])<<8|255)>>>0:(T=C.rgba.exec(S))?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(S))?parseInt(T[1]+T[1]+T[2]+T[2]+T[3]+T[3]+"ff",16)>>>0:(T=C.hex8.exec(S))?parseInt(T[1],16)>>>0:(T=C.hex4.exec(S))?parseInt(T[1]+T[1]+T[2]+T[2]+T[3]+T[3]+T[4]+T[4],16)>>>0:(T=C.hsl.exec(S))?(n(m(T[1]),b(T[2]),b(T[3]))|255)>>>0:(T=C.hsla.exec(S))?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(S))?(r(m(T[1]),b(T[2]),b(T[3]))|255)>>>0:null)}function e(S,C,T){return T<0&&(T+=1),T>1&&(T-=1),T<1/6?S+(C-S)*6*T:T<1/2?C:T<2/3?S+(C-S)*(2/3-T)*6:S}function n(S,C,T){const E=T<.5?T*(1+C):T+C-T*C,M=2*T-E,k=e(M,E,S+1/3),D=e(M,E,S),O=e(M,E,S-1/3);return Math.round(k*255)<<24|Math.round(D*255)<<16|Math.round(O*255)<<8}function r(S,C,T){if(C+T>=1){const D=Math.round(C*255/(C+T));return D<<24|D<<16|D<<8}const E=e(0,1,S+1/3)*(1-C-T)+C,M=e(0,1,S)*(1-C-T)+C,k=e(0,1,S-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(...S){return"\\(\\s*("+S.join(")\\s*,?\\s*(")+")\\s*\\)"}function u(...S){return"\\(\\s*("+S.slice(0,S.length-1).join(")\\s*,?\\s*(")+")\\s*/\\s*("+S[S.length-1]+")\\s*\\)"}function c(...S){return"\\(\\s*("+S.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(S){const C=parseInt(S,10);return C<0?0:C>255?255:C}function m(S){return(parseFloat(S)%360+360)%360/360}function y(S){const C=parseFloat(S);return C<0?0:C>1?255:Math.round(C*255)}function b(S){const C=parseFloat(S);return C<0?0:C>100?1:C/100}function x(S){switch(S){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 M0=t,M0}var lV=sV();const aV=Fo(lV);var uV=t=>{if(t==null)return t;var e=aV(t);if(e!=null)return e=(e<<24|e>>>8)>>>0,e},ow=function(e,n){if(n===void 0&&(n=1),e!=null){if(typeof e=="string"&&oV(e))return e;var r=uV(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+")"}}},cV={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||!Eg[e])&&typeof t=="number"?n=t+"px":e!=null&&cV[e]&&(n=ow(t)),n}var wu=!!(typeof window<"u"&&window.document&&window.document.createElement),fV={},dV=!wu||window.CSS!=null&&window.CSS.supports!=null&&(window.CSS.supports("text-decoration-line","none")||window.CSS.supports("-webkit-text-decoration-line","none")),hV="monospace,monospace",eM='-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif',pV={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"]},PI=(t,e)=>{if(!t)return fV;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",eM);else if(i==="fontFamily")if(u.indexOf("System")>-1){var c=u.split(/,\s*/);c[c.indexOf("System")]=eM,n[i]=c.join(",")}else u==="monospace"?n[i]=hV:n[i]=u;else if(i==="textDecorationLine")dV?n.textDecorationLine=u:n.textDecoration=u;else if(i==="writingDirection")n.direction=u;else{var d=si(t[i],i),h=pV[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 gV(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 mV=t=>gV(t,1).toString(36),yV=/[A-Z]/g,vV=/^ms-/,A0={};function bV(t){return"-"+t.toLowerCase()}function xV(t){if(t in A0)return A0[t];var e=t.replace(yV,bV);return A0[t]=vV.test(e)?"-"+e:e}var Rp={},Tp={},Ep={},tM;function zI(){if(tM)return Ep;tM=1,Object.defineProperty(Ep,"__esModule",{value:!0}),Ep.default=t;function t(e){return e.charAt(0).toUpperCase()+e.slice(1)}return Ep}var nM;function SV(){if(nM)return Tp;nM=1,Object.defineProperty(Tp,"__esModule",{value:!0}),Tp.default=r;var t=zI(),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 Tp}var Mp={},rM;function wV(){if(rM)return Mp;rM=1,Object.defineProperty(Mp,"__esModule",{value:!0}),Mp.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 Mp}var Ap={},iM;function CV(){if(iM)return Ap;iM=1,Object.defineProperty(Ap,"__esModule",{value:!0}),Ap.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 Ap}var Op={},oM;function RV(){if(oM)return Op;oM=1,Object.defineProperty(Op,"__esModule",{value:!0}),Op.default=t;function t(e){return e instanceof Object&&!Array.isArray(e)}return Op}var sM;function TV(){if(sM)return Rp;sM=1,Object.defineProperty(Rp,"__esModule",{value:!0}),Rp.default=d;var t=SV(),e=c(t),n=wV(),r=c(n),i=CV(),s=c(i),a=RV(),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 S=b[x];if((0,u.default)(S))b[x]=y(S);else if(Array.isArray(S)){for(var C=[],T=0,E=S.length;T<E;++T){var M=(0,r.default)(m,x,S[T],b,g);(0,s.default)(C,M||S[T])}C.length>0&&(b[x]=C)}else{var k=(0,r.default)(m,x,S,b,g);k&&(b[x]=k),b=(0,e.default)(g,x,b)}}return b}}return Rp}var EV=TV();const MV=Fo(EV);var kp={};function Mg(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Mg=function(n){return typeof n}:Mg=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Mg(t)}function AV(t){return DV(t)||IV(t)||kV(t)||OV()}function OV(){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 kV(t,e){if(t){if(typeof t=="string")return ix(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 ix(t,e)}}function IV(t){if(typeof Symbol<"u"&&Symbol.iterator in Object(t))return Array.from(t)}function DV(t){if(Array.isArray(t))return ix(t)}function ix(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 lM(t){return t.filter(function(e,n){return t.lastIndexOf(e)===n})}function NI(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]=lM(a.concat(s));continue}if(Array.isArray(s)){t[i]=lM([a].concat(AV(s)));continue}if(Mg(s)==="object"){t[i]=NI({},a,s);continue}}t[i]=s}}return t}var PV=/-([a-z])/g,zV=/^Ms/g,O0={};function NV(t){return t[1].toUpperCase()}function LI(t){if(O0.hasOwnProperty(t))return O0[t];var e=t.replace(PV,NV).replace(zV,"ms");return O0[t]=e,e}var LV=/[A-Z]/g,BV=/^ms-/,k0={};function jV(t){return"-"+t.toLowerCase()}function BI(t){if(k0.hasOwnProperty(t))return k0[t];var e=t.replace(LV,jV);return k0[t]=BV.test(e)?"-"+e:e}const _V=Object.freeze(Object.defineProperty({__proto__:null,default:BI},Symbol.toStringTag,{value:"Module"}));function Dm(t){return BI(t)}function jI(t,e){return Dm(t)+":"+e}function HV(t){var e="";for(var n in t){var r=t[n];typeof r!="string"&&typeof r!="number"||(e&&(e+=";"),e+=jI(n,r))}return e}var VV=/^(Webkit|Moz|O|ms)/;function FV(t){return VV.test(t)}var $V=/-webkit-|-moz-|-ms-/;function UV(t){return typeof t=="string"&&$V.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},aM=["animationIterationCount","boxFlex","boxFlexGroup","boxOrdinalGroup","columnCount","flex","flexGrow","flexPositive","flexShrink","flexNegative","flexOrder","gridColumn","gridColumnEnd","gridColumnStart","gridRow","gridRowEnd","gridRowStart","lineClamp","order"],uM=["Webkit","ms","Moz","O"];function qV(t,e){return t+e.charAt(0).toUpperCase()+e.slice(1)}for(var I0=0,GV=aM.length;I0<GV;++I0){var cM=aM[I0];Td[cM]=!0;for(var D0=0,WV=uM.length;D0<WV;++D0)Td[qV(uM[D0],cM)]=!0}for(var KV in Td)Td[Dm(KV)]=!0;function YV(t){return Td.hasOwnProperty(t)}var XV=/^(ms|Webkit|Moz|O)/;function _I(t){var e=t.replace(XV,"");return e.charAt(0).toLowerCase()+e.slice(1)}function QV(t){return _I(LI(t))}function ZV(t,e){return e.join(";"+Dm(t)+":")}var JV=/(-ms-|-webkit-|-moz-|-o-)/g;function e3(t){return typeof t=="string"?t.replace(JV,""):t}const t3=Object.freeze(Object.defineProperty({__proto__:null,assignStyle:NI,camelCaseProperty:LI,cssifyDeclaration:jI,cssifyObject:HV,hyphenateProperty:Dm,isPrefixedProperty:FV,isPrefixedValue:UV,isUnitlessProperty:YV,normalizeProperty:QV,resolveArrayValue:ZV,unprefixProperty:_I,unprefixValue:e3},Symbol.toStringTag,{value:"Module"})),n3=DI(t3);var fM;function r3(){if(fM)return kp;fM=1,Object.defineProperty(kp,"__esModule",{value:!0}),kp.default=r;var t=n3,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 kp}var i3=r3();const o3=Fo(i3);var Ip={},P0={},dM;function HI(){return dM||(dM=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)}})(P0)),P0}var hM;function s3(){if(hM)return Ip;hM=1,Object.defineProperty(Ip,"__esModule",{value:!0}),Ip.default=i;var t=HI(),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 Ip}var l3=s3();const a3=Fo(l3);var Dp={},pM;function u3(){if(pM)return Dp;pM=1,Object.defineProperty(Dp,"__esModule",{value:!0}),Dp.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 Dp}var c3=u3();const f3=Fo(c3);var Pp={},gM;function d3(){if(gM)return Pp;gM=1,Object.defineProperty(Pp,"__esModule",{value:!0}),Pp.default=t;function t(e,n){if(e==="position"&&n==="sticky")return["-webkit-sticky","sticky"]}return Pp}var h3=d3();const p3=Fo(h3);var zp={},mM;function g3(){if(mM)return zp;mM=1,Object.defineProperty(zp,"__esModule",{value:!0}),zp.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 zp}var m3=g3();const y3=Fo(m3);var Np={},z0={};const v3=DI(_V);var yM;function b3(){return yM||(yM=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var e=v3,n=r(e);function r(s){return s&&s.__esModule?s:{default:s}}function i(s){return(0,n.default)(s)}})(z0)),z0}var vM;function x3(){if(vM)return Np;vM=1,Object.defineProperty(Np,"__esModule",{value:!0}),Np.default=h;var t=b3(),e=a(t),n=HI(),r=a(n),i=zI(),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 S=y[b],C=[S];for(var T in m){var E=(0,e.default)(T);if(S.indexOf(E)>-1&&E!=="order")for(var M=m[T],k=0,D=M.length;k<D;++k)C.unshift(S.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),S=x.split(/,(?![^()]*(?:\([^()]*\))?\))/g).filter(function(T){return!/-moz-|-ms-/.test(T)}).join(",");if(g.indexOf("Webkit")>-1)return S;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)]=S,y["Moz"+(0,s.default)(g)]=C,x)}}return Np}var S3=x3();const w3=Fo(S3);var Mn=["Webkit"],C3=["Moz"],R3=["Webkit","Moz"],Yn=["Webkit","ms"],T3=["Webkit","Moz","ms"];const E3={plugins:[o3,a3,f3,p3,y3,w3],prefixMap:{appearance:T3,userSelect:R3,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:C3,fontKerning:Mn,textSizeAdjust:Mn}};var M3=MV(E3),A3=["animationKeyframes"],bM=new Map,O3={},k3=1,I3=3,D3={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},ox="borderTopLeftRadius",sx="borderTopRightRadius",lx="borderBottomLeftRadius",ax="borderBottomRightRadius",ux="borderLeftColor",cx="borderLeftStyle",fx="borderLeftWidth",dx="borderRightColor",hx="borderRightStyle",px="borderRightWidth",gx="right",mx="marginLeft",yx="marginRight",vx="paddingLeft",bx="paddingRight",xx="left",$g={[ox]:sx,[sx]:ox,[lx]:ax,[ax]:lx,[ux]:dx,[cx]:hx,[fx]:px,[dx]:ux,[hx]:cx,[px]:fx,[xx]:gx,[mx]:yx,[yx]:mx,[vx]:bx,[bx]:vx,[gx]:xx},cd={borderStartStartRadius:ox,borderStartEndRadius:sx,borderEndStartRadius:lx,borderEndEndRadius:ax,borderInlineStartColor:ux,borderInlineStartStyle:cx,borderInlineStartWidth:fx,borderInlineEndColor:dx,borderInlineEndStyle:hx,borderInlineEndWidth:px,insetInlineEnd:gx,insetInlineStart:xx,marginInlineStart:mx,marginInlineEnd:yx,paddingInlineStart:vx,paddingInlineEnd:bx},VI=["clear","float","textAlign"];function P3(t){var e={$$css:!0},n=[];function r(i,s,a){var u=L3(a,s),c=s+u,d=bM.get(c),h;if(d!=null)h=d[0],n.push(d[1]);else{var g=i!==s?c:u;h=sw("r",i,g);var m=D3[i]||I3,y=B3(h,s,a),b=[y,m];n.push(b),bM.set(c,[h,b])}return h}return Object.keys(t).sort().forEach(i=>{var s=t[i];if(s!=null){var a;if(VI.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,$g[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 S=[...m],C=[...m];y.forEach(T=>{var E=S[T];if(typeof E=="string"){var M=cd[E],k=$g[M];S[T]=M,C[T]=k;var D=r(i,i,S),O=r(i,i,C);a=[D,O]}})}}a==null?a=r(i,i,s):e.$$css$localize=!0,e[i]=a}}),[e,n]}function z3(t,e){var n={$$css:!0},r=[],i=t.animationKeyframes,s=Im(t,A3),a=sw("css",e,JSON.stringify(t)),u="."+a,c;if(i!=null){var d=FI(i),h=d[0],g=d[1];c=h.join(","),r.push(...g)}var m=ls(Ac(Ac({},s),{},{animationName:c}));return r.push(""+u+m),n[a]=a,[n,[[r,k3]]]}function N3(t,e){var n=t||O3,r={},i={},s=function(){var d=n[a],h=a,g=d;if(!Object.prototype.hasOwnProperty.call(n,a)||d==null)return"continue";VI.indexOf(a)>-1&&(d==="start"?g=e?"right":"left":d==="end"&&(g=e?"left":"right"));var m=cd[a];if(m!=null&&(h=e?$g[m]:m),a==="transitionProperty"){var y=Array.isArray(d)?d:[d];y.forEach((b,x)=>{if(typeof b=="string"){var S=cd[b];S!=null&&(y[x]=e?$g[S]:S,g=y.join(" "))}})}r[h]||(i[h]=g),h===a&&(r[h]=!0)};for(var a in n)var u=s();return PI(i,!0)}function L3(t,e){var n=si(t,e);return typeof n!="string"?JSON.stringify(n||""):n}function B3(t,e,n){var r=[],i="."+t;switch(e){case"animationKeyframes":{var s=FI(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 S=ls({[e]:n});r.push(""+i+S);break}}return r}function ls(t){var e=M3(PI(t)),n=Object.keys(e).map(r=>{var i=e[r],s=xV(r);return Array.isArray(i)?i.map(a=>s+":"+a).join(";"):s+":"+i}).sort().join(";");return"{"+n+";}"}function sw(t,e,n){var r=mV(e+n);return t+"-"+r}function j3(t){var e=["-webkit-",""],n=sw("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 FI(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=j3(i),a=s[0],u=s[1];e.push(a),n.push(...u)}}),[e,n]}function N0(t,e,n){if(wu){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 _3=Array.prototype.slice;function L0(t){var e={},n={};if(t!=null){var r;_3.call(t.cssRules).forEach((a,u)=>{var c=a.cssText;if(c.indexOf("stylesheet-group")>-1)r=F3(a),e[r]={start:u,rules:[c]};else{var d=SM(c);d!=null&&(n[d]=!0,e[r].rules.push(c))}})}function i(a,u,c){var d=xM(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=U3(a,c,y);if(b){e[u].start==null&&(e[u].start=y);for(var x=g;x<d.length;x+=1){var S=d[x],C=e[S].start||0;e[S].start=C+1}}return b}var s={getTextContent(){return xM(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=H3(c);e[c]={start:null,rules:[d]},t!=null&&i(t,c,d)}var h=SM(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 H3(t){return'[stylesheet-group="'+t+'"]{}'}var V3=/["']/g;function F3(t){return Number(t.selectorText.split(V3)[1])}function xM(t){return Object.keys(t).map(Number).sort((e,n)=>e>n?1:-1)}var $3=/\s*([,])\s*/g;function SM(t){var e=t.split("{")[0].trim();return e!==""?e.replace($3,"$1"):null}function U3(t,e,n){try{return t.insertRule(e,n),!0}catch{return!1}}var q3="react-native-stylesheet",B0=new WeakMap,Ao=[],wM=["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 lw(t,e){e===void 0&&(e=q3);var n;if(wu){var r=t!=null?t.getRootNode():document;if(Ao.length===0)n=L0(N0(e)),wM.forEach(u=>{n.insert(u,0)}),B0.set(r,Ao.length),Ao.push(n);else{var i=B0.get(r);if(i==null){var s=Ao[0],a=s!=null?s.getTextContent():"";n=L0(N0(e,r,a)),B0.set(r,Ao.length),Ao.push(n)}else n=Ao[i]}}else Ao.length===0?(n=L0(N0(e)),wM.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 Lp={},CM;function G3(){if(CM)return Lp;CM=1,Object.defineProperty(Lp,"__esModule",{value:!0}),Lp.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 Lp}var j0,RM;function W3(){return RM||(RM=1,j0=G3()),j0}var K3=W3(),Y3={},$I={height:0,width:0},X3=t=>{var e=t.shadowColor,n=t.shadowOffset,r=t.shadowOpacity,i=t.shadowRadius,s=n||$I,a=s.height,u=s.width,c=si(u),d=si(a),h=si(i||0),g=ow(e||"black",r);if(g!=null&&c!=null&&d!=null&&h!=null)return c+" "+d+" "+h+" "+g},Q3=t=>{var e=t.textShadowColor,n=t.textShadowOffset,r=t.textShadowRadius,i=n||$I,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},Z3=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=ow(t.color)||"black",a=t.inset?"inset ":"";return""+a+e+" "+n+" "+r+" "+i+" "+s},J3=t=>t.map(Z3).join(", "),eF=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+")"},tF=t=>t.map(eF).join(" "),nF=t=>t.map(e=>si(e)).join(" "),rF={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"},iF={elevation:!0,overlayColor:!0,resizeMode:!0,tintColor:!0},UI=function(e,n){n===void 0&&(n={});var r=e||Y3,i={};if(n.shadow,r.shadowColor!=null||r.shadowOffset!=null||r.shadowOpacity!=null||r.shadowRadius!=null){var s=X3(r);s!=null&&(i.boxShadow=s)}if(n.textShadow,r.textShadowColor!=null||r.textShadowOffset!=null||r.textShadowRadius!=null){var a=Q3(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(!(iF[d]!=null||d==="shadowColor"||d==="shadowOffset"||d==="shadowOpacity"||d==="shadowRadius"||d==="textShadowColor"||d==="textShadowOffset"||d==="textShadowRadius")){var h=r[d],g=rF[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=tF(m)),i.transform=m):g==="transformOrigin"?(Array.isArray(m)&&(m=nF(m)),i.transformOrigin=m):i[g]=m}return i},$f={},TM;function oF(){if(TM)return $f;TM=1,Object.defineProperty($f,"__esModule",{value:!0}),$f.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 S=0;S<x.length;S++)y.push(x[S]);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 D=C[k];k!==e&&(typeof D=="string"||D===null?d.includes(k)||(d.push(k),m!=null&&M.push(k),typeof D=="string"&&(T+=T?" "+D:D)):console.error("styleq: ".concat(k," typeof ").concat(String(D),' is not "string" or "null".')))}if(m!=null){var O=new WeakMap;m.set(C,[T,M,O]),m=O}}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 _=C[L];_!==void 0&&(d.includes(L)||(_!=null&&(g==null&&(g={}),I==null&&(I={}),I[L]=_),d.push(L),m=null))}I!=null&&(g=Object.assign(I,g))}}}var N=[h,g];return N}}var r=n();return $f.styleq=r,r.factory=n,$f}var sF=oF(),lF=["writingDirection"],qI=new WeakMap,Ug=lw(),GI={shadow:!0,textShadow:!0};function aF(t,e){e===void 0&&(e={});var n=e,r=n.writingDirection,i=Im(n,lF),s=r==="rtl";return sF.styleq.factory({transform(a){var u=qI.get(a);return u!=null?K3.localizeStyle(u,s):UI(a,Ac(Ac({},GI),i))}})(t)}function WI(t){t.forEach(e=>{var n=e[0],r=e[1];Ug!=null&&n.forEach(i=>{Ug.insert(i,r)})})}function uF(t){var e=P3(UI(t,GI)),n=e[0],r=e[1];return WI(r),n}function cF(t,e){var n=z3(t,e),r=n[0],i=n[1];return WI(i),r}var KI={position:"absolute",left:0,right:0,top:0,bottom:0},fF=YI({x:Ac({},KI)}).x;function YI(t){return Object.keys(t).forEach(e=>{var n=t[e];if(n!=null&&n.$$css!==!0){var r;e.indexOf("$raw")>-1?r=cF(n,e.split("$raw")[0]):r=uF(n),qI.set(n,r)}}),t}function dF(t,e){return[t,e]}function hF(){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 pF(){return{id:Ug.id,textContent:Ug.getTextContent()}}function fl(t,e){e===void 0&&(e={});var n=e.writingDirection==="rtl",r=aF(t,e);return Array.isArray(r)&&r[1]!=null&&(r[1]=N3(r[1],n)),r}fl.absoluteFill=fF;fl.absoluteFillObject=KI;fl.create=YI;fl.compose=dF;fl.flatten=hF;fl.getSheet=pF;fl.hairlineWidth=1;wu&&window.__REACT_DEVTOOLS_GLOBAL_HOOK__&&(window.__REACT_DEVTOOLS_GLOBAL_HOOK__.resolveRNStyle=fl.flatten);var Qd=fl,gF=["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"],mF={},yF=Object.prototype.hasOwnProperty,vF=Array.isArray,bF=/[A-Z]/g;function xF(t){return"-"+t.toLowerCase()}function SF(t){return t.replace(bF,xF)}function sc(t){return vF(t)?t.join(" "):t}var wF=Qd.create({auto:{pointerEvents:"auto"},"box-none":{pointerEvents:"box-none"},"box-only":{pointerEvents:"box-only"},none:{pointerEvents:"none"}}),CF=(t,e,n)=>{e||(e=mF);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,S=r["aria-colindex"],C=r.accessibilityColumnIndex,T=r["aria-colspan"],E=r.accessibilityColumnSpan,M=r["aria-controls"],k=r.accessibilityControls,D=r["aria-current"],O=r.accessibilityCurrent,I=r["aria-describedby"],L=r.accessibilityDescribedBy,_=r["aria-details"],N=r.accessibilityDetails,B=r["aria-disabled"],H=r.accessibilityDisabled,F=r["aria-errormessage"],G=r.accessibilityErrorMessage,j=r["aria-expanded"],q=r.accessibilityExpanded,$=r["aria-flowto"],X=r.accessibilityFlowTo,Z=r["aria-haspopup"],z=r.accessibilityHasPopup,U=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"],De=r.accessibilityLiveRegion,Pe=r["aria-modal"],Ee=r.accessibilityModal,_e=r["aria-multiline"],Me=r.accessibilityMultiline,oe=r["aria-multiselectable"],xe=r.accessibilityMultiSelectable,ze=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"],Ut=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"],Vr=r.accessibilityValueMax,ar=r["aria-valuemin"],it=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,Ms=r.tabIndex,yl=r.testID,qe=Im(r,gF),Oa=B||H,Jn=II.propsToAriaRole(e),Fi=i??s;Fi!=null&&(qe["aria-activedescendant"]=Fi);var di=a!=null?i:u;di!=null&&(qe["aria-atomic"]=di);var hi=c??d;hi!=null&&(qe["aria-autocomplete"]=hi);var $n=h??g;$n!=null&&(qe["aria-busy"]=$n);var ur=m??y;ur!=null&&(qe["aria-checked"]=ur);var Fr=b??x;Fr!=null&&(qe["aria-colcount"]=Fr);var $i=S??C;$i!=null&&(qe["aria-colindex"]=$i);var xo=T??E;xo!=null&&(qe["aria-colspan"]=xo);var ka=M??k;ka!=null&&(qe["aria-controls"]=sc(ka));var Ia=D??O;Ia!=null&&(qe["aria-current"]=Ia);var As=I??L;As!=null&&(qe["aria-describedby"]=sc(As));var Da=_??N;Da!=null&&(qe["aria-details"]=Da),Oa===!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 Os=j??q;Os!=null&&(qe["aria-expanded"]=Os);var ni=$??X;ni!=null&&(qe["aria-flowto"]=sc(ni));var Gn=Z??z;Gn!=null&&(qe["aria-haspopup"]=Gn);var $r=U??W;$r===!0&&(qe["aria-hidden"]=$r);var ri=K??ie;ri!=null&&(qe["aria-invalid"]=ri);var Ui=ee??ae;Ui!=null&&(qe["aria-keyshortcuts"]=sc(Ui));var Wo=Y??se;Wo!=null&&(qe["aria-label"]=Wo);var ks=ve??ye;ks!=null&&(qe["aria-labelledby"]=sc(ks));var Ou=he??pe;Ou!=null&&(qe["aria-level"]=Ou);var cr=Te??De;cr!=null&&(qe["aria-live"]=cr==="none"?"off":cr);var vl=Pe??Ee;vl!=null&&(qe["aria-modal"]=vl);var Pa=_e??Me;Pa!=null&&(qe["aria-multiline"]=Pa);var Is=oe??xe;Is!=null&&(qe["aria-multiselectable"]=Is);var pi=ze??ne;pi!=null&&(qe["aria-orientation"]=pi);var bl=J??le;bl!=null&&(qe["aria-owns"]=sc(bl));var Ko=we??de;Ko!=null&&(qe["aria-placeholder"]=Ko);var qi=me??Be;qi!=null&&(qe["aria-posinset"]=qi);var Ds=Ke??wt;Ds!=null&&(qe["aria-pressed"]=Ds);var xl=xt??st;xl!=null&&(qe["aria-readonly"]=xl,(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 Ei=at??Tn;Ei!=null&&(qe["aria-roledescription"]=Ei);var Sl=Kt??tn;Sl!=null&&(qe["aria-rowcount"]=Sl);var wl=Vt??Ut;wl!=null&&(qe["aria-rowindex"]=wl);var wo=lt??gt;wo!=null&&(qe["aria-rowspan"]=wo);var Ur=nt??nn;Ur!=null&&(qe["aria-selected"]=Ur);var Cl=Vn??Fn;Cl!=null&&(qe["aria-setsize"]=Cl);var Rl=rn??kn;Rl!=null&&(qe["aria-sort"]=Rl);var Co=Pt??Vr;Co!=null&&(qe["aria-valuemax"]=Co);var Ro=ar??it;Ro!=null&&(qe["aria-valuemin"]=Ro);var Ps=qt??qn;Ps!=null&&(qe["aria-valuenow"]=Ps);var Tl=jn??Tr;if(Tl!=null&&(qe["aria-valuetext"]=Tl),ln!=null){for(var El in ln)if(yF.call(ln,El)){var je=SF(El),He=ln[El];He!=null&&(qe["data-"+je]=He)}}Ms===0||Ms==="0"||Ms===-1||Ms==="-1"?qe.tabIndex=Ms:(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&&wF[Er]],Ac({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),yl!=null&&(qe["data-testid"]=yl),qe.type==null&&t==="button"&&(qe.type="button"),qe},_0={exports:{}},St={};var EM;function RF(){if(EM)return St;EM=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,S={};function C(z,U,W){this.props=z,this.context=U,this.refs=S,this.updater=W||b}C.prototype.isReactComponent={},C.prototype.setState=function(z,U){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,U,"setState")},C.prototype.forceUpdate=function(z){this.updater.enqueueForceUpdate(this,z,"forceUpdate")};function T(){}T.prototype=C.prototype;function E(z,U,W){this.props=z,this.context=U,this.refs=S,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 D(){}var O={H:null,A:null,T:null,S:null},I=Object.prototype.hasOwnProperty;function L(z,U,W){var K=W.ref;return{$$typeof:t,type:z,key:U,ref:K!==void 0?K:null,props:W}}function _(z,U){return L(z.type,U,z.props)}function N(z){return typeof z=="object"&&z!==null&&z.$$typeof===t}function B(z){var U={"=":"=0",":":"=2"};return"$"+z.replace(/[=:]/g,function(W){return U[W]})}var H=/\/+/g;function F(z,U){return typeof z=="object"&&z!==null&&z.key!=null?B(""+z.key):U.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(D,D):(z.status="pending",z.then(function(U){z.status==="pending"&&(z.status="fulfilled",z.value=U)},function(U){z.status==="pending"&&(z.status="rejected",z.reason=U)})),z.status){case"fulfilled":return z.value;case"rejected":throw z.reason}}throw z}function j(z,U,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,j(ae(z._payload),U,W,K,ie)}}if(ae)return ie=ie(z),ae=K===""?"."+F(z,0):K,k(ie)?(W="",ae!=null&&(W=ae.replace(H,"$&/")+"/"),j(ie,U,W,"",function(ve){return ve})):ie!=null&&(N(ie)&&(ie=_(ie,W+(ie.key==null||z&&z.key===ie.key?"":(""+ie.key).replace(H,"$&/")+"/")+ae)),U.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+=j(K,U,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+=j(K,U,W,ee,ie);else if(ee==="object"){if(typeof z.then=="function")return j(G(z),U,W,K,ie);throw U=String(z),Error("Objects are not valid as a React child (found: "+(U==="[object Object]"?"object with keys {"+Object.keys(z).join(", ")+"}":U)+"). If you meant to render a collection of children, use an array instead.")}return ae}function q(z,U,W){if(z==null)return z;var K=[],ie=0;return j(z,K,"","",function(ee){return U.call(W,ee,ie++)}),K}function $(z){if(z._status===-1){var U=z._result;U=U(),U.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=U)}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 U=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(U))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",z);return}console.error(z)},Z={map:q,forEach:function(z,U,W){q(z,function(){U.apply(this,arguments)},W)},count:function(z){var U=0;return q(z,function(){U++}),U},toArray:function(z){return q(z,function(U){return U})||[]},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=O,St.__COMPILER_RUNTIME={__proto__:null,c:function(z){return O.H.useMemoCache(z)}},St.cache=function(z){return function(){return z.apply(null,arguments)}},St.cacheSignal=function(){return null},St.cloneElement=function(z,U,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(U!=null)for(ee in U.key!==void 0&&(ie=""+U.key),U)!I.call(U,ee)||ee==="key"||ee==="__self"||ee==="__source"||ee==="ref"&&U.ref===void 0||(K[ee]=U[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,U,W){var K,ie={},ee=null;if(U!=null)for(K in U.key!==void 0&&(ee=""+U.key),U)I.call(U,K)&&K!=="key"&&K!=="__self"&&K!=="__source"&&(ie[K]=U[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:$}},St.memo=function(z,U){return{$$typeof:d,type:z,compare:U===void 0?null:U}},St.startTransition=function(z){var U=O.T,W={};O.T=W;try{var K=z(),ie=O.S;ie!==null&&ie(W,K),typeof K=="object"&&K!==null&&typeof K.then=="function"&&K.then(D,X)}catch(ee){X(ee)}finally{U!==null&&W.types!==null&&(U.types=W.types),O.T=U}},St.unstable_useCacheRefresh=function(){return O.H.useCacheRefresh()},St.use=function(z){return O.H.use(z)},St.useActionState=function(z,U,W){return O.H.useActionState(z,U,W)},St.useCallback=function(z,U){return O.H.useCallback(z,U)},St.useContext=function(z){return O.H.useContext(z)},St.useDebugValue=function(){},St.useDeferredValue=function(z,U){return O.H.useDeferredValue(z,U)},St.useEffect=function(z,U){return O.H.useEffect(z,U)},St.useEffectEvent=function(z){return O.H.useEffectEvent(z)},St.useId=function(){return O.H.useId()},St.useImperativeHandle=function(z,U,W){return O.H.useImperativeHandle(z,U,W)},St.useInsertionEffect=function(z,U){return O.H.useInsertionEffect(z,U)},St.useLayoutEffect=function(z,U){return O.H.useLayoutEffect(z,U)},St.useMemo=function(z,U){return O.H.useMemo(z,U)},St.useOptimistic=function(z,U){return O.H.useOptimistic(z,U)},St.useReducer=function(z,U,W){return O.H.useReducer(z,U,W)},St.useRef=function(z){return O.H.useRef(z)},St.useState=function(z){return O.H.useState(z)},St.useSyncExternalStore=function(z,U,W){return O.H.useSyncExternalStore(z,U,W)},St.useTransition=function(){return O.H.useTransition()},St.version="19.2.3",St}var MM;function Zd(){return MM||(MM=1,_0.exports=RF()),_0.exports}var R=Zd();const Ve=Fo(R),TF=KH({__proto__:null,default:Ve},[R]);var EF=new Set(["Arab","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),AM=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"]),OM=new Map;function MF(t){var e=OM.get(t);if(e)return e;var n=!1;if(Intl.Locale)try{var r=new Intl.Locale(t).maximize().script;n=EF.has(r)}catch{var i=t.split("-")[0];n=AM.has(i)}else{var s=t.split("-")[0];n=AM.has(s)}return OM.set(t,n),n}var AF={direction:"ltr",locale:"en-US"},XI=R.createContext(AF);function QI(t){return MF(t)?"rtl":"ltr"}function OF(t){var e=t.direction,n=t.locale,r=t.children,i=e||n;return i?Ve.createElement(XI.Provider,{children:r,value:{direction:n?QI(n):e,locale:n}}):r}function kF(){return R.useContext(XI)}var IF=(t,e,n)=>{var r;t&&t.constructor===String&&(r=II.propsToAccessibilityComponent(e));var i=r||t,s=CF(i,e,n),a=Ve.createElement(i,s),u=s.dir?Ve.createElement(OF,{children:a,direction:s.dir,locale:s.lang}):a;return u},H0={exports:{}},Uf={},V0={exports:{}},F0={};var kM;function DF(){return kM||(kM=1,(function(t){function e(j,q){var $=j.length;j.push(q);e:for(;0<$;){var X=$-1>>>1,Z=j[X];if(0<i(Z,q))j[X]=q,j[$]=Z,$=X;else break e}}function n(j){return j.length===0?null:j[0]}function r(j){if(j.length===0)return null;var q=j[0],$=j.pop();if($!==q){j[0]=$;e:for(var X=0,Z=j.length,z=Z>>>1;X<z;){var U=2*(X+1)-1,W=j[U],K=U+1,ie=j[K];if(0>i(W,$))K<Z&&0>i(ie,W)?(j[X]=ie,j[K]=$,X=K):(j[X]=W,j[U]=$,X=U);else if(K<Z&&0>i(ie,$))j[X]=ie,j[K]=$,X=K;else break e}}return q}function i(j,q){var $=j.sortIndex-q.sortIndex;return $!==0?$:j.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,S=!1,C=typeof setTimeout=="function"?setTimeout:null,T=typeof clearTimeout=="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null;function M(j){for(var q=n(d);q!==null;){if(q.callback===null)r(d);else if(q.startTime<=j)r(d),q.sortIndex=q.expirationTime,e(c,q);else break;q=n(d)}}function k(j){if(x=!1,M(j),!b)if(n(c)!==null)b=!0,D||(D=!0,B());else{var q=n(d);q!==null&&G(k,q.startTime-j)}}var D=!1,O=-1,I=5,L=-1;function _(){return S?!0:!(t.unstable_now()-L<I)}function N(){if(S=!1,D){var j=t.unstable_now();L=j;var q=!0;try{e:{b=!1,x&&(x=!1,T(O),O=-1),y=!0;var $=m;try{t:{for(M(j),g=n(c);g!==null&&!(g.expirationTime>j&&_());){var X=g.callback;if(typeof X=="function"){g.callback=null,m=g.priorityLevel;var Z=X(g.expirationTime<=j);if(j=t.unstable_now(),typeof Z=="function"){g.callback=Z,M(j),q=!0;break t}g===n(c)&&r(c),M(j)}else r(c);g=n(c)}if(g!==null)q=!0;else{var z=n(d);z!==null&&G(k,z.startTime-j),q=!1}}break e}finally{g=null,m=$,y=!1}q=void 0}}finally{q?B():D=!1}}}var B;if(typeof E=="function")B=function(){E(N)};else if(typeof MessageChannel<"u"){var H=new MessageChannel,F=H.port2;H.port1.onmessage=N,B=function(){F.postMessage(null)}}else B=function(){C(N,0)};function G(j,q){O=C(function(){j(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(j){j.callback=null},t.unstable_forceFrameRate=function(j){0>j||125<j?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):I=0<j?Math.floor(1e3/j):5},t.unstable_getCurrentPriorityLevel=function(){return m},t.unstable_next=function(j){switch(m){case 1:case 2:case 3:var q=3;break;default:q=m}var $=m;m=q;try{return j()}finally{m=$}},t.unstable_requestPaint=function(){S=!0},t.unstable_runWithPriority=function(j,q){switch(j){case 1:case 2:case 3:case 4:case 5:break;default:j=3}var $=m;m=j;try{return q()}finally{m=$}},t.unstable_scheduleCallback=function(j,q,$){var X=t.unstable_now();switch(typeof $=="object"&&$!==null?($=$.delay,$=typeof $=="number"&&0<$?X+$:X):$=X,j){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=$+Z,j={id:h++,callback:q,priorityLevel:j,startTime:$,expirationTime:Z,sortIndex:-1},$>X?(j.sortIndex=$,e(d,j),n(c)===null&&j===n(d)&&(x?(T(O),O=-1):x=!0,G(k,$-X))):(j.sortIndex=Z,e(c,j),b||y||(b=!0,D||(D=!0,B()))),j},t.unstable_shouldYield=_,t.unstable_wrapCallback=function(j){var q=m;return function(){var $=m;m=q;try{return j.apply(this,arguments)}finally{m=$}}}})(F0)),F0}var IM;function PF(){return IM||(IM=1,V0.exports=DF()),V0.exports}var $0={exports:{}},Wr={};var DM;function zF(){if(DM)return Wr;DM=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 Wr.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Wr.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)},Wr.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()}},Wr.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))},Wr.prefetchDNS=function(c){typeof c=="string"&&r.d.D(c)},Wr.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})}},Wr.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)},Wr.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})}},Wr.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)},Wr.requestFormReset=function(c){r.d.r(c)},Wr.unstable_batchedUpdates=function(c,d){return c(d)},Wr.useFormState=function(c,d,h){return a.H.useFormState(c,d,h)},Wr.useFormStatus=function(){return a.H.useHostTransitionStatus()},Wr.version="19.2.3",Wr}var PM;function ZI(){if(PM)return $0.exports;PM=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=zF(),$0.exports}var zM;function NF(){if(zM)return Uf;zM=1;var t=PF(),e=Zd(),n=ZI();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 w=v.alternate;if(w===null){if(p=v.return,p!==null){f=p;continue}break}if(v.child===w.child){for(w=v.child;w;){if(w===f)return c(v),o;if(w===p)return c(v),l;w=w.sibling}throw Error(r(188))}if(f.return!==p.return)f=v,p=w;else{for(var P=!1,V=v.child;V;){if(V===f){P=!0,f=v,p=w;break}if(V===p){P=!0,p=v,f=w;break}V=V.sibling}if(!P){for(V=w.child;V;){if(V===f){P=!0,f=w,p=v;break}if(V===p){P=!0,p=w,f=v;break}V=V.sibling}if(!P)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"),S=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"),D=Symbol.for("react.suspense_list"),O=Symbol.for("react.memo"),I=Symbol.for("react.lazy"),L=Symbol.for("react.activity"),_=Symbol.for("react.memo_cache_sentinel"),N=Symbol.iterator;function B(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 S:return"StrictMode";case k:return"Suspense";case D: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 O: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,j=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,$={pending:!1,data:null,method:null,action:null},X=[],Z=-1;function z(o){return{current:o}}function U(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)?SE(o):0;break;default:if(o=l.tagName,l=l.namespaceURI)l=SE(l),o=wE(l,o);else switch(o){case"svg":o=1;break;case"math":o=2;break;default:o=0}}U(K),W(K,o)}function se(){U(K),U(ie),U(ee)}function ve(o){o.memoizedState!==null&&W(ae,o);var l=K.current,f=wE(l,o.type);l!==f&&(W(ie,o),W(K,f))}function ye(o){ie.current===o&&(U(K),U(ie)),ae.current===o&&(U(ae),_f._currentValue=$)}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 De=!1;function Pe(o,l){if(!o||De)return"";De=!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 w=p.DetermineComponentFrameRoot(),P=w[0],V=w[1];if(P&&V){var Q=P.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{De=!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 Pe(o.type,!1);case 11:return Pe(o.type.render,!1);case 1:return Pe(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,ze=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,Ut=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,w=o.suspendedLanes,P=o.pingedLanes;o=o.warmLanes;var V=p&134217727;return V!==0?(p=V&~w,p!==0?v=gt(p):(P&=V,P!==0?v=gt(P):f||(f=V&~o,f!==0&&(v=gt(f))))):(V=p&~w,V!==0?v=gt(V):P!==0?v=gt(P):f||(f=p&~o,f!==0&&(v=gt(f)))),v===0?0:l!==0&&l!==v&&(l&w)===0&&(w=v&-v,f=l&-l,w>=f||w===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,w){var P=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=P&~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&&Vr(o,p,0),w!==0&&v===0&&o.tag!==0&&(o.suspendedLanes|=w&~(P&~l))}function Vr(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 it(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:qE(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,Ms="__reactHandles$"+ln,yl="__reactResources$"+ln,qe="__reactMarker$"+ln;function Oa(o){delete o[zt],delete o[Nt],delete o[Er],delete o[nf],delete o[Ms]}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=OE(o);o!==null;){if(f=o[zt])return f;o=OE(o)}return l}o=f,f=o.parentNode}return null}function Fi(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 di(o){var l=o.tag;if(l===5||l===26||l===27||l===6)return o.stateNode;throw Error(r(33))}function hi(o){var l=o[yl];return l||(l=o[yl]={hoistableStyles:new Map,hoistableScripts:new Map}),l}function $n(o){o[qe]=!0}var ur=new Set,Fr={};function $i(o,l){xo(o,l),xo(o+"Capture",l)}function xo(o,l){for(Fr[o]=l,o=0;o<l.length;o++)ur.add(l[o])}var ka=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]*$"),Ia={},As={};function Da(o){return Me.call(As,o)?!0:Me.call(Ia,o)?!1:ka.test(o)?As[o]=!0:(Ia[o]=!0,!1)}function So(o,l,f){if(Da(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 Os(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 $r(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,w=p.set;return Object.defineProperty(o,l,{configurable:!0,get:function(){return v.call(this)},set:function(P){f=""+P,w.call(this,P)}}),Object.defineProperty(o,l,{enumerable:p.enumerable}),{getValue:function(){return f},setValue:function(P){f=""+P},stopTracking:function(){o._valueTracker=null,delete o[l]}}}}function Ui(o){if(!o._valueTracker){var l=$r(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=$r(o)?o.checked?"true":"false":o.value),o=p,o!==f?(l.setValue(o),!0):!1}function ks(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 Ou=/[\n"\\]/g;function cr(o){return o.replace(Ou,function(l){return"\\"+l.charCodeAt(0).toString(16)+" "})}function vl(o,l,f,p,v,w,P,V){o.name="",P!=null&&typeof P!="function"&&typeof P!="symbol"&&typeof P!="boolean"?o.type=P:o.removeAttribute("type"),l!=null?P==="number"?(l===0&&o.value===""||o.value!=l)&&(o.value=""+Gn(l)):o.value!==""+Gn(l)&&(o.value=""+Gn(l)):P!=="submit"&&P!=="reset"||o.removeAttribute("value"),l!=null?Is(o,P,Gn(l)):f!=null?Is(o,P,Gn(f)):p!=null&&o.removeAttribute("value"),v==null&&w!=null&&(o.defaultChecked=!!w),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 Pa(o,l,f,p,v,w,P,V){if(w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(o.type=w),l!=null||f!=null){if(!(w!=="submit"&&w!=="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,P!=null&&typeof P!="function"&&typeof P!="symbol"&&typeof P!="boolean"&&(o.name=P),Ui(o)}function Is(o,l,f){l==="number"&&ks(o.ownerDocument)===o||o.defaultValue===""+f||(o.defaultValue=""+f)}function pi(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 bl(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 qi(o,l){if(l){var f=o.firstChild;if(f&&f===o.lastChild&&f.nodeType===3){f.nodeValue=l;return}}o.textContent=l}var Ds=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 xl(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||Ds.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&&xl(o,v,p)}else for(var w in l)l.hasOwnProperty(w)&&xl(o,w,l[w])}function Ei(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 Sl=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"]]),wl=/^[\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 wl.test(""+o)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":o}function Ur(){}var Cl=null;function Rl(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 Ps(o){var l=Fi(o);if(l&&(o=l.stateNode)){var f=o[Nt]||null;e:switch(o=l.stateNode,l.type){case"input":if(vl(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));vl(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":bl(o,f.value,f.defaultValue);break e;case"select":l=f.value,l!=null&&pi(o,!!f.multiple,l,!1)}}}var Tl=!1;function El(o,l,f){if(Tl)return o(l,f);Tl=!0;try{var p=o(l);return p}finally{if(Tl=!1,(Co!==null||Ro!==null)&&(np(),Co&&(l=Co,o=Ro,Ro=Co=null,Ps(l),o)))for(l=0;l<o.length;l++)Ps(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,w=v.length;for(o=0;o<f&&l[o]===v[o];o++);var P=f-o;for(p=1;p<=P&&l[f-p]===v[w-p];p++);return yn=v.slice(o,1<p?1-p:void 0)}function qr(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 Mi(){return!0}function Ml(){return!1}function Gr(o){function l(f,p,v,w,P){this._reactName=f,this._targetInst=v,this.type=p,this.nativeEvent=w,this.target=P,this.currentTarget=null;for(var V in o)o.hasOwnProperty(V)&&(f=o[V],this[V]=f?f(w):w[V]);return this.isDefaultPrevented=(w.defaultPrevented!=null?w.defaultPrevented:w.returnValue===!1)?Mi:Ml,this.isPropagationStopped=Ml,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=Mi)},stopPropagation:function(){var f=this.nativeEvent;f&&(f.stopPropagation?f.stopPropagation():typeof f.cancelBubble!="unknown"&&(f.cancelBubble=!0),this.isPropagationStopped=Mi)},persist:function(){},isPersistent:Mi}),l}var Xo={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(o){return o.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ku=Gr(Xo),rf=g({},Xo,{view:0,detail:0}),Gj=Gr(rf),Oy,ky,of,xh=g({},rf,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Dy,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"?(Oy=o.screenX-of.screenX,ky=o.screenY-of.screenY):ky=Oy=0,of=o),Oy)},movementY:function(o){return"movementY"in o?o.movementY:ky}}),RC=Gr(xh),Wj=g({},xh,{dataTransfer:0}),Kj=Gr(Wj),Yj=g({},rf,{relatedTarget:0}),Iy=Gr(Yj),Xj=g({},Xo,{animationName:0,elapsedTime:0,pseudoElement:0}),Qj=Gr(Xj),Zj=g({},Xo,{clipboardData:function(o){return"clipboardData"in o?o.clipboardData:window.clipboardData}}),Jj=Gr(Zj),e_=g({},Xo,{data:0}),TC=Gr(e_),t_={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},n_={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"},r_={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function i_(o){var l=this.nativeEvent;return l.getModifierState?l.getModifierState(o):(o=r_[o])?!!l[o]:!1}function Dy(){return i_}var o_=g({},rf,{key:function(o){if(o.key){var l=t_[o.key]||o.key;if(l!=="Unidentified")return l}return o.type==="keypress"?(o=qr(o),o===13?"Enter":String.fromCharCode(o)):o.type==="keydown"||o.type==="keyup"?n_[o.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Dy,charCode:function(o){return o.type==="keypress"?qr(o):0},keyCode:function(o){return o.type==="keydown"||o.type==="keyup"?o.keyCode:0},which:function(o){return o.type==="keypress"?qr(o):o.type==="keydown"||o.type==="keyup"?o.keyCode:0}}),s_=Gr(o_),l_=g({},xh,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),EC=Gr(l_),a_=g({},rf,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Dy}),u_=Gr(a_),c_=g({},Xo,{propertyName:0,elapsedTime:0,pseudoElement:0}),f_=Gr(c_),d_=g({},xh,{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}),h_=Gr(d_),p_=g({},Xo,{newState:0,oldState:0}),g_=Gr(p_),m_=[9,13,27,32],Py=He&&"CompositionEvent"in window,sf=null;He&&"documentMode"in document&&(sf=document.documentMode);var y_=He&&"TextEvent"in window&&!sf,MC=He&&(!Py||sf&&8<sf&&11>=sf),AC=" ",OC=!1;function kC(o,l){switch(o){case"keyup":return m_.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function IC(o){return o=o.detail,typeof o=="object"&&"data"in o?o.data:null}var Iu=!1;function v_(o,l){switch(o){case"compositionend":return IC(l);case"keypress":return l.which!==32?null:(OC=!0,AC);case"textInput":return o=l.data,o===AC&&OC?null:o;default:return null}}function b_(o,l){if(Iu)return o==="compositionend"||!Py&&kC(o,l)?(o=Or(),yn=er=on=null,Iu=!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 MC&&l.locale!=="ko"?null:l.data;default:return null}}var x_={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 DC(o){var l=o&&o.nodeName&&o.nodeName.toLowerCase();return l==="input"?!!x_[o.type]:l==="textarea"}function PC(o,l,f,p){Co?Ro?Ro.push(p):Ro=[p]:Co=p,l=up(l,"onChange"),0<l.length&&(f=new ku("onChange","change",null,f,p),o.push({event:f,listeners:l}))}var lf=null,af=null;function S_(o){gE(o,0)}function Sh(o){var l=di(o);if(Wo(l))return o}function zC(o,l){if(o==="change")return l}var NC=!1;if(He){var zy;if(He){var Ny="oninput"in document;if(!Ny){var LC=document.createElement("div");LC.setAttribute("oninput","return;"),Ny=typeof LC.oninput=="function"}zy=Ny}else zy=!1;NC=zy&&(!document.documentMode||9<document.documentMode)}function BC(){lf&&(lf.detachEvent("onpropertychange",jC),af=lf=null)}function jC(o){if(o.propertyName==="value"&&Sh(af)){var l=[];PC(l,af,o,Rl(o)),El(S_,l)}}function w_(o,l,f){o==="focusin"?(BC(),lf=l,af=f,lf.attachEvent("onpropertychange",jC)):o==="focusout"&&BC()}function C_(o){if(o==="selectionchange"||o==="keyup"||o==="keydown")return Sh(af)}function R_(o,l){if(o==="click")return Sh(l)}function T_(o,l){if(o==="input"||o==="change")return Sh(l)}function E_(o,l){return o===l&&(o!==0||1/o===1/l)||o!==o&&l!==l}var Ai=typeof Object.is=="function"?Object.is:E_;function uf(o,l){if(Ai(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)||!Ai(o[v],l[v]))return!1}return!0}function _C(o){for(;o&&o.firstChild;)o=o.firstChild;return o}function HC(o,l){var f=_C(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=_C(f)}}function VC(o,l){return o&&l?o===l?!0:o&&o.nodeType===3?!1:l&&l.nodeType===3?VC(o,l.parentNode):"contains"in o?o.contains(l):o.compareDocumentPosition?!!(o.compareDocumentPosition(l)&16):!1:!1}function FC(o){o=o!=null&&o.ownerDocument!=null&&o.ownerDocument.defaultView!=null?o.ownerDocument.defaultView:window;for(var l=ks(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=ks(o.document)}return l}function Ly(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 M_=He&&"documentMode"in document&&11>=document.documentMode,Du=null,By=null,cf=null,jy=!1;function $C(o,l,f){var p=f.window===f?f.document:f.nodeType===9?f:f.ownerDocument;jy||Du==null||Du!==ks(p)||(p=Du,"selectionStart"in p&&Ly(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=up(By,"onSelect"),0<p.length&&(l=new ku("onSelect","select",null,l,f),o.push({event:l,listeners:p}),l.target=Du)))}function za(o,l){var f={};return f[o.toLowerCase()]=l.toLowerCase(),f["Webkit"+o]="webkit"+l,f["Moz"+o]="moz"+l,f}var Pu={animationend:za("Animation","AnimationEnd"),animationiteration:za("Animation","AnimationIteration"),animationstart:za("Animation","AnimationStart"),transitionrun:za("Transition","TransitionRun"),transitionstart:za("Transition","TransitionStart"),transitioncancel:za("Transition","TransitionCancel"),transitionend:za("Transition","TransitionEnd")},_y={},UC={};He&&(UC=document.createElement("div").style,"AnimationEvent"in window||(delete Pu.animationend.animation,delete Pu.animationiteration.animation,delete Pu.animationstart.animation),"TransitionEvent"in window||delete Pu.transitionend.transition);function Na(o){if(_y[o])return _y[o];if(!Pu[o])return o;var l=Pu[o],f;for(f in l)if(l.hasOwnProperty(f)&&f in UC)return _y[o]=l[f];return o}var qC=Na("animationend"),GC=Na("animationiteration"),WC=Na("animationstart"),A_=Na("transitionrun"),O_=Na("transitionstart"),k_=Na("transitioncancel"),KC=Na("transitionend"),YC=new Map,Hy="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(" ");Hy.push("scrollEnd");function To(o,l){YC.set(o,l),$i(l,[o])}var wh=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)},Gi=[],zu=0,Vy=0;function Ch(){for(var o=zu,l=Vy=zu=0;l<o;){var f=Gi[l];Gi[l++]=null;var p=Gi[l];Gi[l++]=null;var v=Gi[l];Gi[l++]=null;var w=Gi[l];if(Gi[l++]=null,p!==null&&v!==null){var P=p.pending;P===null?v.next=v:(v.next=P.next,P.next=v),p.pending=v}w!==0&&XC(f,v,w)}}function Rh(o,l,f,p){Gi[zu++]=o,Gi[zu++]=l,Gi[zu++]=f,Gi[zu++]=p,Vy|=p,o.lanes|=p,o=o.alternate,o!==null&&(o.lanes|=p)}function Fy(o,l,f,p){return Rh(o,l,f,p),Th(o)}function La(o,l){return Rh(o,null,null,l),Th(o)}function XC(o,l,f){o.lanes|=f;var p=o.alternate;p!==null&&(p.lanes|=f);for(var v=!1,w=o.return;w!==null;)w.childLanes|=f,p=w.alternate,p!==null&&(p.childLanes|=f),w.tag===22&&(o=w.stateNode,o===null||o._visibility&1||(v=!0)),o=w,w=w.return;return o.tag===3?(w=o.stateNode,v&&l!==null&&(v=31-at(f),o=w.hiddenUpdates,p=o[v],p===null?o[v]=[l]:p.push(l),l.lane=f|536870912),w):null}function Th(o){if(50<Df)throw Df=0,Qv=null,Error(r(185));for(var l=o.return;l!==null;)o=l,l=o.return;return o.tag===3?o.stateNode:null}var Nu={};function I_(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 Oi(o,l,f,p){return new I_(o,l,f,p)}function $y(o){return o=o.prototype,!(!o||!o.isReactComponent)}function zs(o,l){var f=o.alternate;return f===null?(f=Oi(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 QC(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 Eh(o,l,f,p,v,w){var P=0;if(p=o,typeof o=="function")$y(o)&&(P=1);else if(typeof o=="string")P=LH(o,f,K.current)?26:o==="html"||o==="head"||o==="body"?27:5;else e:switch(o){case L:return o=Oi(31,f,l,v),o.elementType=L,o.lanes=w,o;case x:return Ba(f.children,v,w,l);case S:P=8,v|=24;break;case C:return o=Oi(12,f,l,v|2),o.elementType=C,o.lanes=w,o;case k:return o=Oi(13,f,l,v),o.elementType=k,o.lanes=w,o;case D:return o=Oi(19,f,l,v),o.elementType=D,o.lanes=w,o;default:if(typeof o=="object"&&o!==null)switch(o.$$typeof){case E:P=10;break e;case T:P=9;break e;case M:P=11;break e;case O:P=14;break e;case I:P=16,p=null;break e}P=29,f=Error(r(130,o===null?"null":typeof o,"")),p=null}return l=Oi(P,f,l,v),l.elementType=o,l.type=p,l.lanes=w,l}function Ba(o,l,f,p){return o=Oi(7,o,p,l),o.lanes=f,o}function Uy(o,l,f){return o=Oi(6,o,null,l),o.lanes=f,o}function ZC(o){var l=Oi(18,null,null,0);return l.stateNode=o,l}function qy(o,l,f){return l=Oi(4,o.children!==null?o.children:[],o.key,l),l.lanes=f,l.stateNode={containerInfo:o.containerInfo,pendingChildren:null,implementation:o.implementation},l}var JC=new WeakMap;function Wi(o,l){if(typeof o=="object"&&o!==null){var f=JC.get(o);return f!==void 0?f:(l={value:o,source:l,stack:_e(l)},JC.set(o,l),l)}return{value:o,source:l,stack:_e(l)}}var Lu=[],Bu=0,Mh=null,ff=0,Ki=[],Yi=0,Al=null,Qo=1,Zo="";function Ns(o,l){Lu[Bu++]=ff,Lu[Bu++]=Mh,Mh=o,ff=l}function eR(o,l,f){Ki[Yi++]=Qo,Ki[Yi++]=Zo,Ki[Yi++]=Al,Al=o;var p=Qo;o=Zo;var v=32-at(p)-1;p&=~(1<<v),f+=1;var w=32-at(l)+v;if(30<w){var P=v-v%5;w=(p&(1<<P)-1).toString(32),p>>=P,v-=P,Qo=1<<32-at(l)+v|f<<v|p,Zo=w+o}else Qo=1<<w|f<<v|p,Zo=o}function Gy(o){o.return!==null&&(Ns(o,1),eR(o,1,0))}function Wy(o){for(;o===Mh;)Mh=Lu[--Bu],Lu[Bu]=null,ff=Lu[--Bu],Lu[Bu]=null;for(;o===Al;)Al=Ki[--Yi],Ki[Yi]=null,Zo=Ki[--Yi],Ki[Yi]=null,Qo=Ki[--Yi],Ki[Yi]=null}function tR(o,l){Ki[Yi++]=Qo,Ki[Yi++]=Zo,Ki[Yi++]=Al,Qo=l.id,Zo=l.overflow,Al=o}var kr=null,Dn=null,Ft=!1,Ol=null,Xi=!1,Ky=Error(r(519));function kl(o){var l=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw df(Wi(l,o)),Ky}function nR(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),Pa(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||bE(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||kl(o,!0)}function rR(o){for(kr=o.return;kr;)switch(kr.tag){case 5:case 31:case 13:Xi=!1;return;case 27:case 3:Xi=!0;return;default:kr=kr.return}}function ju(o){if(o!==kr)return!1;if(!Ft)return rR(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")||d0(o.type,o.memoizedProps)),f=!f),f&&Dn&&kl(o),rR(o),l===13){if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(r(317));Dn=AE(o)}else if(l===31){if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(r(317));Dn=AE(o)}else l===27?(l=Dn,Ul(o.type)?(o=y0,y0=null,Dn=o):Dn=l):Dn=kr?Zi(o.stateNode.nextSibling):null;return!0}function ja(){Dn=kr=null,Ft=!1}function Yy(){var o=Ol;return o!==null&&(vi===null?vi=o:vi.push.apply(vi,o),Ol=null),o}function df(o){Ol===null?Ol=[o]:Ol.push(o)}var Xy=z(null),_a=null,Ls=null;function Il(o,l,f){W(Xy,l._currentValue),l._currentValue=f}function Bs(o){o._currentValue=Xy.current,U(Xy)}function Qy(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 Zy(o,l,f,p){var v=o.child;for(v!==null&&(v.return=o);v!==null;){var w=v.dependencies;if(w!==null){var P=v.child;w=w.firstContext;e:for(;w!==null;){var V=w;w=v;for(var Q=0;Q<l.length;Q++)if(V.context===l[Q]){w.lanes|=f,V=w.alternate,V!==null&&(V.lanes|=f),Qy(w.return,f,o),p||(P=null);break e}w=V.next}}else if(v.tag===18){if(P=v.return,P===null)throw Error(r(341));P.lanes|=f,w=P.alternate,w!==null&&(w.lanes|=f),Qy(P,f,o),P=null}else P=v.child;if(P!==null)P.return=v;else for(P=v;P!==null;){if(P===o){P=null;break}if(v=P.sibling,v!==null){v.return=P.return,P=v;break}P=P.return}v=P}}function _u(o,l,f,p){o=null;for(var v=l,w=!1;v!==null;){if(!w){if((v.flags&524288)!==0)w=!0;else if((v.flags&262144)!==0)break}if(v.tag===10){var P=v.alternate;if(P===null)throw Error(r(387));if(P=P.memoizedProps,P!==null){var V=v.type;Ai(v.pendingProps.value,P.value)||(o!==null?o.push(V):o=[V])}}else if(v===ae.current){if(P=v.alternate,P===null)throw Error(r(387));P.memoizedState.memoizedState!==v.memoizedState.memoizedState&&(o!==null?o.push(_f):o=[_f])}v=v.return}o!==null&&Zy(l,o,f,p),l.flags|=262144}function Ah(o){for(o=o.firstContext;o!==null;){if(!Ai(o.context._currentValue,o.memoizedValue))return!0;o=o.next}return!1}function Ha(o){_a=o,Ls=null,o=o.dependencies,o!==null&&(o.firstContext=null)}function Ir(o){return iR(_a,o)}function Oh(o,l){return _a===null&&Ha(o),iR(o,l)}function iR(o,l){var f=l._currentValue;if(l={context:l,memoizedValue:f,next:null},Ls===null){if(o===null)throw Error(r(308));Ls=l,o.dependencies={lanes:0,firstContext:l},o.flags|=524288}else Ls=Ls.next=l;return f}var D_=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()})}},P_=t.unstable_scheduleCallback,z_=t.unstable_NormalPriority,fr={$$typeof:E,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Jy(){return{controller:new D_,data:new Map,refCount:0}}function hf(o){o.refCount--,o.refCount===0&&P_(z_,function(){o.controller.abort()})}var pf=null,ev=0,Hu=0,Vu=null;function N_(o,l){if(pf===null){var f=pf=[];ev=0,Hu=r0(),Vu={status:"pending",value:void 0,then:function(p){f.push(p)}}}return ev++,l.then(oR,oR),l}function oR(){if(--ev===0&&pf!==null){Vu!==null&&(Vu.status="fulfilled");var o=pf;pf=null,Hu=0,Vu=null;for(var l=0;l<o.length;l++)(0,o[l])()}}function L_(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 sR=j.S;j.S=function(o,l){$T=J(),typeof l=="object"&&l!==null&&typeof l.then=="function"&&N_(o,l),sR!==null&&sR(o,l)};var Va=z(null);function tv(){var o=Va.current;return o!==null?o:En.pooledCache}function kh(o,l){l===null?W(Va,Va.current):W(Va,l.pool)}function lR(){var o=tv();return o===null?null:{parent:fr._currentValue,pool:o}}var Fu=Error(r(460)),nv=Error(r(474)),Ih=Error(r(542)),Dh={then:function(){}};function aR(o){return o=o.status,o==="fulfilled"||o==="rejected"}function uR(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,fR(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,fR(o),o}throw $a=l,Fu}}function Fa(o){try{var l=o._init;return l(o._payload)}catch(f){throw f!==null&&typeof f=="object"&&typeof f.then=="function"?($a=f,Fu):f}}var $a=null;function cR(){if($a===null)throw Error(r(459));var o=$a;return $a=null,o}function fR(o){if(o===Fu||o===Ih)throw Error(r(483))}var $u=null,gf=0;function Ph(o){var l=gf;return gf+=1,$u===null&&($u=[]),uR($u,o,l)}function mf(o,l){l=l.props.ref,o.ref=l!==void 0?l:null}function zh(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 dR(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=zs(re,te),re.index=0,re.sibling=null,re}function w(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 P(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 ot=ue.type;return ot===x?be(re,te,ue.props.children,Ce,ue.key):te!==null&&(te.elementType===ot||typeof ot=="object"&&ot!==null&&ot.$$typeof===I&&Fa(ot)===te.type)?(te=v(te,ue.props),mf(te,ue),te.return=re,te):(te=Eh(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=qy(ue,re.mode,Ce),te.return=re,te):(te=v(te,ue.children||[]),te.return=re,te)}function be(re,te,ue,Ce,ot){return te===null||te.tag!==7?(te=Ba(ue,re.mode,Ce,ot),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=Eh(te.type,te.key,te.props,null,re.mode,ue),mf(ue,te),ue.return=re,ue;case b:return te=qy(te,re.mode,ue),te.return=re,te;case I:return te=Fa(te),Re(re,te,ue)}if(G(te)||B(te))return te=Ba(te,re.mode,ue,null),te.return=re,te;if(typeof te.then=="function")return Re(re,Ph(te),ue);if(te.$$typeof===E)return Re(re,Oh(re,te),ue);zh(re,te)}return null}function fe(re,te,ue,Ce){var ot=te!==null?te.key:null;if(typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint")return ot!==null?null:V(re,te,""+ue,Ce);if(typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case y:return ue.key===ot?Q(re,te,ue,Ce):null;case b:return ue.key===ot?ce(re,te,ue,Ce):null;case I:return ue=Fa(ue),fe(re,te,ue,Ce)}if(G(ue)||B(ue))return ot!==null?null:be(re,te,ue,Ce,null);if(typeof ue.then=="function")return fe(re,te,Ph(ue),Ce);if(ue.$$typeof===E)return fe(re,te,Oh(re,ue),Ce);zh(re,ue)}return null}function ge(re,te,ue,Ce,ot){if(typeof Ce=="string"&&Ce!==""||typeof Ce=="number"||typeof Ce=="bigint")return re=re.get(ue)||null,V(te,re,""+Ce,ot);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,ot);case b:return re=re.get(Ce.key===null?ue:Ce.key)||null,ce(te,re,Ce,ot);case I:return Ce=Fa(Ce),ge(re,te,ue,Ce,ot)}if(G(Ce)||B(Ce))return re=re.get(ue)||null,be(te,re,Ce,ot,null);if(typeof Ce.then=="function")return ge(re,te,ue,Ph(Ce),ot);if(Ce.$$typeof===E)return ge(re,te,ue,Oh(te,Ce),ot);zh(te,Ce)}return null}function Xe(re,te,ue,Ce){for(var ot=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=w(Zt,te,Et),Qt===null?ot=Zt:Qt.sibling=Zt,Qt=Zt,Je=Ht}if(Et===ue.length)return f(re,Je),Ft&&Ns(re,Et),ot;if(Je===null){for(;Et<ue.length;Et++)Je=Re(re,ue[Et],Ce),Je!==null&&(te=w(Je,te,Et),Qt===null?ot=Je:Qt.sibling=Je,Qt=Je);return Ft&&Ns(re,Et),ot}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=w(Ht,te,Et),Qt===null?ot=Ht:Qt.sibling=Ht,Qt=Ht);return o&&Je.forEach(function(Yl){return l(re,Yl)}),Ft&&Ns(re,Et),ot}function ut(re,te,ue,Ce){if(ue==null)throw Error(r(151));for(var ot=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 Yl=fe(re,Je,Zt.value,Ce);if(Yl===null){Je===null&&(Je=Ht);break}o&&Je&&Yl.alternate===null&&l(re,Je),te=w(Yl,te,Et),Qt===null?ot=Yl:Qt.sibling=Yl,Qt=Yl,Je=Ht}if(Zt.done)return f(re,Je),Ft&&Ns(re,Et),ot;if(Je===null){for(;!Zt.done;Et++,Zt=ue.next())Zt=Re(re,Zt.value,Ce),Zt!==null&&(te=w(Zt,te,Et),Qt===null?ot=Zt:Qt.sibling=Zt,Qt=Zt);return Ft&&Ns(re,Et),ot}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=w(Zt,te,Et),Qt===null?ot=Zt:Qt.sibling=Zt,Qt=Zt);return o&&Je.forEach(function(WH){return l(re,WH)}),Ft&&Ns(re,Et),ot}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 ot=ue.key;te!==null;){if(te.key===ot){if(ot=ue.type,ot===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===ot||typeof ot=="object"&&ot!==null&&ot.$$typeof===I&&Fa(ot)===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=Ba(ue.props.children,re.mode,Ce,ue.key),Ce.return=re,re=Ce):(Ce=Eh(ue.type,ue.key,ue.props,null,re.mode,Ce),mf(Ce,ue),Ce.return=re,re=Ce)}return P(re);case b:e:{for(ot=ue.key;te!==null;){if(te.key===ot)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=qy(ue,re.mode,Ce),Ce.return=re,re=Ce}return P(re);case I:return ue=Fa(ue),xn(re,te,ue,Ce)}if(G(ue))return Xe(re,te,ue,Ce);if(B(ue)){if(ot=B(ue),typeof ot!="function")throw Error(r(150));return ue=ot.call(ue),ut(re,te,ue,Ce)}if(typeof ue.then=="function")return xn(re,te,Ph(ue),Ce);if(ue.$$typeof===E)return xn(re,te,Oh(re,ue),Ce);zh(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),P(re)):f(re,te)}return function(re,te,ue,Ce){try{gf=0;var ot=xn(re,te,ue,Ce);return $u=null,ot}catch(Je){if(Je===Fu||Je===Ih)throw Je;var Qt=Oi(29,Je,null,re.mode);return Qt.lanes=Ce,Qt.return=re,Qt}}}var Ua=dR(!0),hR=dR(!1),Dl=!1;function rv(o){o.updateQueue={baseState:o.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function iv(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 Pl(o){return{lane:o,tag:0,payload:null,callback:null,next:null}}function zl(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=Th(o),XC(o,null,f),l}return Rh(o,p,l,f),Th(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 ov(o,l){var f=o.updateQueue,p=o.alternate;if(p!==null&&(p=p.updateQueue,f===p)){var v=null,w=null;if(f=f.firstBaseUpdate,f!==null){do{var P={lane:f.lane,tag:f.tag,payload:f.payload,callback:null,next:null};w===null?v=w=P:w=w.next=P,f=f.next}while(f!==null);w===null?v=w=l:w=w.next=l}else v=w=l;f={baseState:p.baseState,firstBaseUpdate:v,lastBaseUpdate:w,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 sv=!1;function vf(){if(sv){var o=Vu;if(o!==null)throw o}}function bf(o,l,f,p){sv=!1;var v=o.updateQueue;Dl=!1;var w=v.firstBaseUpdate,P=v.lastBaseUpdate,V=v.shared.pending;if(V!==null){v.shared.pending=null;var Q=V,ce=Q.next;Q.next=null,P===null?w=ce:P.next=ce,P=Q;var be=o.alternate;be!==null&&(be=be.updateQueue,V=be.lastBaseUpdate,V!==P&&(V===null?be.firstBaseUpdate=ce:V.next=ce,be.lastBaseUpdate=Q))}if(w!==null){var Re=v.baseState;P=0,be=ce=Q=null,V=w;do{var fe=V.lane&-536870913,ge=fe!==V.lane;if(ge?(_t&fe)===fe:(p&fe)===fe){fe!==0&&fe===Hu&&(sv=!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:Dl=!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,P|=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,w===null&&(v.shared.lanes=0),_l|=P,o.lanes=P,o.memoizedState=Re}}function pR(o,l){if(typeof o!="function")throw Error(r(191,o));o.call(l)}function gR(o,l){var f=o.callbacks;if(f!==null)for(o.callbacks=null,o=0;o<f.length;o++)pR(f[o],l)}var Uu=z(null),Nh=z(0);function mR(o,l){o=Gs,W(Nh,o),W(Uu,l),Gs=o|l.baseLanes}function lv(){W(Nh,Gs),W(Uu,Uu.current)}function av(){Gs=Nh.current,U(Uu),U(Nh)}var ki=z(null),Qi=null;function Nl(o){var l=o.alternate;W(tr,tr.current&1),W(ki,o),Qi===null&&(l===null||Uu.current!==null||l.memoizedState!==null)&&(Qi=o)}function uv(o){W(tr,tr.current),W(ki,o),Qi===null&&(Qi=o)}function yR(o){o.tag===22?(W(tr,tr.current),W(ki,o),Qi===null&&(Qi=o)):Ll()}function Ll(){W(tr,tr.current),W(ki,ki.current)}function Ii(o){U(ki),Qi===o&&(Qi=null),U(tr)}var tr=z(0);function Lh(o){for(var l=o;l!==null;){if(l.tag===13){var f=l.memoizedState;if(f!==null&&(f=f.dehydrated,f===null||g0(f)||m0(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 js=0,Rt=null,vn=null,dr=null,Bh=!1,qu=!1,qa=!1,jh=0,xf=0,Gu=null,B_=0;function Wn(){throw Error(r(321))}function cv(o,l){if(l===null)return!1;for(var f=0;f<l.length&&f<o.length;f++)if(!Ai(o[f],l[f]))return!1;return!0}function fv(o,l,f,p,v,w){return js=w,Rt=l,l.memoizedState=null,l.updateQueue=null,l.lanes=0,j.H=o===null||o.memoizedState===null?eT:Ev,qa=!1,w=f(p,v),qa=!1,qu&&(w=bR(l,f,p,v)),vR(o),w}function vR(o){j.H=Cf;var l=vn!==null&&vn.next!==null;if(js=0,dr=vn=Rt=null,Bh=!1,xf=0,Gu=null,l)throw Error(r(300));o===null||hr||(o=o.dependencies,o!==null&&Ah(o)&&(hr=!0))}function bR(o,l,f,p){Rt=o;var v=0;do{if(qu&&(Gu=null),xf=0,qu=!1,25<=v)throw Error(r(301));if(v+=1,dr=vn=null,o.updateQueue!=null){var w=o.updateQueue;w.lastEffect=null,w.events=null,w.stores=null,w.memoCache!=null&&(w.memoCache.index=0)}j.H=tT,w=l(f,p)}while(qu);return w}function j_(){var o=j.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 dv(){var o=jh!==0;return jh=0,o}function hv(o,l,f){l.updateQueue=o.updateQueue,l.flags&=-2053,o.lanes&=~f}function pv(o){if(Bh){for(o=o.memoizedState;o!==null;){var l=o.queue;l!==null&&(l.pending=null),o=o.next}Bh=!1}js=0,dr=vn=Rt=null,qu=!1,xf=jh=0,Gu=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 _h(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Sf(o){var l=xf;return xf+=1,Gu===null&&(Gu=[]),o=uR(Gu,o,l),l=Rt,(dr===null?l.memoizedState:dr.next)===null&&(l=l.alternate,j.H=l===null||l.memoizedState===null?eT:Ev),o}function Hh(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 gv(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=_h(),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]=_;return l.index++,f}function _s(o,l){return typeof l=="function"?l(o):l}function Vh(o){var l=nr();return mv(l,vn,o)}function mv(o,l,f){var p=o.queue;if(p===null)throw Error(r(311));p.lastRenderedReducer=f;var v=o.baseQueue,w=p.pending;if(w!==null){if(v!==null){var P=v.next;v.next=w.next,w.next=P}l.baseQueue=v=w,p.pending=null}if(w=o.baseState,v===null)o.memoizedState=w;else{l=v.next;var V=P=null,Q=null,ce=l,be=!1;do{var Re=ce.lane&-536870913;if(Re!==ce.lane?(_t&Re)===Re:(js&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===Hu&&(be=!0);else if((js&fe)===fe){ce=ce.next,fe===Hu&&(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,P=w):Q=Q.next=Re,Rt.lanes|=fe,_l|=fe;Re=ce.action,qa&&f(w,Re),w=ce.hasEagerState?ce.eagerState:f(w,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,P=w):Q=Q.next=fe,Rt.lanes|=Re,_l|=Re;ce=ce.next}while(ce!==null&&ce!==l);if(Q===null?P=w:Q.next=V,!Ai(w,o.memoizedState)&&(hr=!0,be&&(f=Vu,f!==null)))throw f;o.memoizedState=w,o.baseState=P,o.baseQueue=Q,p.lastRenderedState=w}return v===null&&(p.lanes=0),[o.memoizedState,p.dispatch]}function yv(o){var l=nr(),f=l.queue;if(f===null)throw Error(r(311));f.lastRenderedReducer=o;var p=f.dispatch,v=f.pending,w=l.memoizedState;if(v!==null){f.pending=null;var P=v=v.next;do w=o(w,P.action),P=P.next;while(P!==v);Ai(w,l.memoizedState)||(hr=!0),l.memoizedState=w,l.baseQueue===null&&(l.baseState=w),f.lastRenderedState=w}return[w,p]}function xR(o,l,f){var p=Rt,v=nr(),w=Ft;if(w){if(f===void 0)throw Error(r(407));f=f()}else f=l();var P=!Ai((vn||v).memoizedState,f);if(P&&(v.memoizedState=f,hr=!0),v=v.queue,xv(CR.bind(null,p,v,o),[o]),v.getSnapshot!==l||P||dr!==null&&dr.memoizedState.tag&1){if(p.flags|=2048,Wu(9,{destroy:void 0},wR.bind(null,p,v,f,l),null),En===null)throw Error(r(349));w||(js&127)!==0||SR(p,l,f)}return f}function SR(o,l,f){o.flags|=16384,o={getSnapshot:l,value:f},l=Rt.updateQueue,l===null?(l=_h(),Rt.updateQueue=l,l.stores=[o]):(f=l.stores,f===null?l.stores=[o]:f.push(o))}function wR(o,l,f,p){l.value=f,l.getSnapshot=p,RR(l)&&TR(o)}function CR(o,l,f){return f(function(){RR(l)&&TR(o)})}function RR(o){var l=o.getSnapshot;o=o.value;try{var f=l();return!Ai(o,f)}catch{return!0}}function TR(o){var l=La(o,2);l!==null&&bi(l,o,2)}function vv(o){var l=ii();if(typeof o=="function"){var f=o;if(o=f(),qa){Wt(!0);try{f()}finally{Wt(!1)}}}return l.memoizedState=l.baseState=o,l.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:_s,lastRenderedState:o},l}function ER(o,l,f,p){return o.baseState=f,mv(o,vn,typeof p=="function"?p:_s)}function __(o,l,f,p,v){if(Uh(o))throw Error(r(485));if(o=l.action,o!==null){var w={payload:v,action:o,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(P){w.listeners.push(P)}};j.T!==null?f(!0):w.isTransition=!1,p(w),f=l.pending,f===null?(w.next=l.pending=w,MR(l,w)):(w.next=f.next,l.pending=f.next=w)}}function MR(o,l){var f=l.action,p=l.payload,v=o.state;if(l.isTransition){var w=j.T,P={};j.T=P;try{var V=f(v,p),Q=j.S;Q!==null&&Q(P,V),AR(o,l,V)}catch(ce){bv(o,l,ce)}finally{w!==null&&P.types!==null&&(w.types=P.types),j.T=w}}else try{w=f(v,p),AR(o,l,w)}catch(ce){bv(o,l,ce)}}function AR(o,l,f){f!==null&&typeof f=="object"&&typeof f.then=="function"?f.then(function(p){OR(o,l,p)},function(p){return bv(o,l,p)}):OR(o,l,f)}function OR(o,l,f){l.status="fulfilled",l.value=f,kR(l),o.state=f,l=o.pending,l!==null&&(f=l.next,f===l?o.pending=null:(f=f.next,l.next=f,MR(o,f)))}function bv(o,l,f){var p=o.pending;if(o.pending=null,p!==null){p=p.next;do l.status="rejected",l.reason=f,kR(l),l=l.next;while(l!==p)}o.action=null}function kR(o){o=o.listeners;for(var l=0;l<o.length;l++)(0,o[l])()}function IR(o,l){return l}function DR(o,l){if(Ft){var f=En.formState;if(f!==null){e:{var p=Rt;if(Ft){if(Dn){t:{for(var v=Dn,w=Xi;v.nodeType!==8;){if(!w){v=null;break t}if(v=Zi(v.nextSibling),v===null){v=null;break t}}w=v.data,v=w==="F!"||w==="F"?v:null}if(v){Dn=Zi(v.nextSibling),p=v.data==="F!";break e}}kl(p)}p=!1}p&&(l=f[0])}}return f=ii(),f.memoizedState=f.baseState=l,p={pending:null,lanes:0,dispatch:null,lastRenderedReducer:IR,lastRenderedState:l},f.queue=p,f=QR.bind(null,Rt,p),p.dispatch=f,p=vv(!1),w=Tv.bind(null,Rt,!1,p.queue),p=ii(),v={state:l,dispatch:null,action:o,pending:null},p.queue=v,f=__.bind(null,Rt,v,w,f),v.dispatch=f,p.memoizedState=o,[l,f,!1]}function PR(o){var l=nr();return zR(l,vn,o)}function zR(o,l,f){if(l=mv(o,l,IR)[0],o=Vh(_s)[0],typeof l=="object"&&l!==null&&typeof l.then=="function")try{var p=Sf(l)}catch(P){throw P===Fu?Ih:P}else p=l;l=nr();var v=l.queue,w=v.dispatch;return f!==l.memoizedState&&(Rt.flags|=2048,Wu(9,{destroy:void 0},H_.bind(null,v,f),null)),[p,w,o]}function H_(o,l){o.action=l}function NR(o){var l=nr(),f=vn;if(f!==null)return zR(l,f,o);nr(),l=l.memoizedState,f=nr();var p=f.queue.dispatch;return f.memoizedState=o,[l,p,!1]}function Wu(o,l,f,p){return o={tag:o,create:f,deps:p,inst:l,next:null},l=Rt.updateQueue,l===null&&(l=_h(),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 LR(){return nr().memoizedState}function Fh(o,l,f,p){var v=ii();Rt.flags|=o,v.memoizedState=Wu(1|l,{destroy:void 0},f,p===void 0?null:p)}function $h(o,l,f,p){var v=nr();p=p===void 0?null:p;var w=v.memoizedState.inst;vn!==null&&p!==null&&cv(p,vn.memoizedState.deps)?v.memoizedState=Wu(l,w,f,p):(Rt.flags|=o,v.memoizedState=Wu(1|l,w,f,p))}function BR(o,l){Fh(8390656,8,o,l)}function xv(o,l){$h(2048,8,o,l)}function V_(o){Rt.flags|=4;var l=Rt.updateQueue;if(l===null)l=_h(),Rt.updateQueue=l,l.events=[o];else{var f=l.events;f===null?l.events=[o]:f.push(o)}}function jR(o){var l=nr().memoizedState;return V_({ref:l,nextImpl:o}),function(){if((sn&2)!==0)throw Error(r(440));return l.impl.apply(void 0,arguments)}}function _R(o,l){return $h(4,2,o,l)}function HR(o,l){return $h(4,4,o,l)}function VR(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 FR(o,l,f){f=f!=null?f.concat([o]):null,$h(4,4,VR.bind(null,l,o),f)}function Sv(){}function $R(o,l){var f=nr();l=l===void 0?null:l;var p=f.memoizedState;return l!==null&&cv(l,p[1])?p[0]:(f.memoizedState=[o,l],o)}function UR(o,l){var f=nr();l=l===void 0?null:l;var p=f.memoizedState;if(l!==null&&cv(l,p[1]))return p[0];if(p=o(),qa){Wt(!0);try{o()}finally{Wt(!1)}}return f.memoizedState=[p,l],p}function wv(o,l,f){return f===void 0||(js&1073741824)!==0&&(_t&261930)===0?o.memoizedState=l:(o.memoizedState=f,o=qT(),Rt.lanes|=o,_l|=o,f)}function qR(o,l,f,p){return Ai(f,l)?f:Uu.current!==null?(o=wv(o,f,p),Ai(o,l)||(hr=!0),o):(js&42)===0||(js&1073741824)!==0&&(_t&261930)===0?(hr=!0,o.memoizedState=f):(o=qT(),Rt.lanes|=o,_l|=o,l)}function GR(o,l,f,p,v){var w=q.p;q.p=w!==0&&8>w?w:8;var P=j.T,V={};j.T=V,Tv(o,!1,l,f);try{var Q=v(),ce=j.S;if(ce!==null&&ce(V,Q),Q!==null&&typeof Q=="object"&&typeof Q.then=="function"){var be=L_(Q,p);wf(o,l,be,zi(o))}else wf(o,l,p,zi(o))}catch(Re){wf(o,l,{then:function(){},status:"rejected",reason:Re},zi())}finally{q.p=w,P!==null&&V.types!==null&&(P.types=V.types),j.T=P}}function F_(){}function Cv(o,l,f,p){if(o.tag!==5)throw Error(r(476));var v=WR(o).queue;GR(o,v,l,$,f===null?F_:function(){return KR(o),f(p)})}function WR(o){var l=o.memoizedState;if(l!==null)return l;l={memoizedState:$,baseState:$,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:_s,lastRenderedState:$},next:null};var f={};return l.next={memoizedState:f,baseState:f,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:_s,lastRenderedState:f},next:null},o.memoizedState=l,o=o.alternate,o!==null&&(o.memoizedState=l),l}function KR(o){var l=WR(o);l.next===null&&(l=o.alternate.memoizedState),wf(o,l.next.queue,{},zi())}function Rv(){return Ir(_f)}function YR(){return nr().memoizedState}function XR(){return nr().memoizedState}function $_(o){for(var l=o.return;l!==null;){switch(l.tag){case 24:case 3:var f=zi();o=Pl(f);var p=zl(l,o,f);p!==null&&(bi(p,l,f),yf(p,l,f)),l={cache:Jy()},o.payload=l;return}l=l.return}}function U_(o,l,f){var p=zi();f={lane:p,revertLane:0,gesture:null,action:f,hasEagerState:!1,eagerState:null,next:null},Uh(o)?ZR(l,f):(f=Fy(o,l,f,p),f!==null&&(bi(f,o,p),JR(f,l,p)))}function QR(o,l,f){var p=zi();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))ZR(l,v);else{var w=o.alternate;if(o.lanes===0&&(w===null||w.lanes===0)&&(w=l.lastRenderedReducer,w!==null))try{var P=l.lastRenderedState,V=w(P,f);if(v.hasEagerState=!0,v.eagerState=V,Ai(V,P))return Rh(o,l,v,0),En===null&&Ch(),!1}catch{}if(f=Fy(o,l,v,p),f!==null)return bi(f,o,p),JR(f,l,p),!0}return!1}function Tv(o,l,f,p){if(p={lane:2,revertLane:r0(),gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null},Uh(o)){if(l)throw Error(r(479))}else l=Fy(o,f,p,2),l!==null&&bi(l,o,2)}function Uh(o){var l=o.alternate;return o===Rt||l!==null&&l===Rt}function ZR(o,l){qu=Bh=!0;var f=o.pending;f===null?l.next=l:(l.next=f.next,f.next=l),o.pending=l}function JR(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:Hh,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 eT={readContext:Ir,use:Hh,useCallback:function(o,l){return ii().memoizedState=[o,l===void 0?null:l],o},useContext:Ir,useEffect:BR,useImperativeHandle:function(o,l,f){f=f!=null?f.concat([o]):null,Fh(4194308,4,VR.bind(null,l,o),f)},useLayoutEffect:function(o,l){return Fh(4194308,4,o,l)},useInsertionEffect:function(o,l){Fh(4,2,o,l)},useMemo:function(o,l){var f=ii();l=l===void 0?null:l;var p=o();if(qa){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(qa){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=U_.bind(null,Rt,o),[p.memoizedState,o]},useRef:function(o){var l=ii();return o={current:o},l.memoizedState=o},useState:function(o){o=vv(o);var l=o.queue,f=QR.bind(null,Rt,l);return l.dispatch=f,[o.memoizedState,f]},useDebugValue:Sv,useDeferredValue:function(o,l){var f=ii();return wv(f,o,l)},useTransition:function(){var o=vv(!1);return o=GR.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||SR(p,l,f)}v.memoizedState=f;var w={value:f,getSnapshot:l};return v.queue=w,BR(CR.bind(null,p,w,o),[o]),p.flags|=2048,Wu(9,{destroy:void 0},wR.bind(null,p,w,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=jh++,0<f&&(l+="H"+f.toString(32)),l+="_"}else f=B_++,l="_"+l+"r_"+f.toString(32)+"_";return o.memoizedState=l},useHostTransitionStatus:Rv,useFormState:DR,useActionState:DR,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=Tv.bind(null,Rt,!0,f),f.dispatch=l,[o,l]},useMemoCache:gv,useCacheRefresh:function(){return ii().memoizedState=$_.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)}}},Ev={readContext:Ir,use:Hh,useCallback:$R,useContext:Ir,useEffect:xv,useImperativeHandle:FR,useInsertionEffect:_R,useLayoutEffect:HR,useMemo:UR,useReducer:Vh,useRef:LR,useState:function(){return Vh(_s)},useDebugValue:Sv,useDeferredValue:function(o,l){var f=nr();return qR(f,vn.memoizedState,o,l)},useTransition:function(){var o=Vh(_s)[0],l=nr().memoizedState;return[typeof o=="boolean"?o:Sf(o),l]},useSyncExternalStore:xR,useId:YR,useHostTransitionStatus:Rv,useFormState:PR,useActionState:PR,useOptimistic:function(o,l){var f=nr();return ER(f,vn,o,l)},useMemoCache:gv,useCacheRefresh:XR};Ev.useEffectEvent=jR;var tT={readContext:Ir,use:Hh,useCallback:$R,useContext:Ir,useEffect:xv,useImperativeHandle:FR,useInsertionEffect:_R,useLayoutEffect:HR,useMemo:UR,useReducer:yv,useRef:LR,useState:function(){return yv(_s)},useDebugValue:Sv,useDeferredValue:function(o,l){var f=nr();return vn===null?wv(f,o,l):qR(f,vn.memoizedState,o,l)},useTransition:function(){var o=yv(_s)[0],l=nr().memoizedState;return[typeof o=="boolean"?o:Sf(o),l]},useSyncExternalStore:xR,useId:YR,useHostTransitionStatus:Rv,useFormState:NR,useActionState:NR,useOptimistic:function(o,l){var f=nr();return vn!==null?ER(f,vn,o,l):(f.baseState=o,[o,f.queue.dispatch])},useMemoCache:gv,useCacheRefresh:XR};tT.useEffectEvent=jR;function Mv(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 Av={enqueueSetState:function(o,l,f){o=o._reactInternals;var p=zi(),v=Pl(p);v.payload=l,f!=null&&(v.callback=f),l=zl(o,v,p),l!==null&&(bi(l,o,p),yf(l,o,p))},enqueueReplaceState:function(o,l,f){o=o._reactInternals;var p=zi(),v=Pl(p);v.tag=1,v.payload=l,f!=null&&(v.callback=f),l=zl(o,v,p),l!==null&&(bi(l,o,p),yf(l,o,p))},enqueueForceUpdate:function(o,l){o=o._reactInternals;var f=zi(),p=Pl(f);p.tag=2,l!=null&&(p.callback=l),l=zl(o,p,f),l!==null&&(bi(l,o,f),yf(l,o,f))}};function nT(o,l,f,p,v,w,P){return o=o.stateNode,typeof o.shouldComponentUpdate=="function"?o.shouldComponentUpdate(p,w,P):l.prototype&&l.prototype.isPureReactComponent?!uf(f,p)||!uf(v,w):!0}function rT(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&&Av.enqueueReplaceState(l,l.state,null)}function Ga(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 iT(o){wh(o)}function oT(o){console.error(o)}function sT(o){wh(o)}function qh(o,l){try{var f=o.onUncaughtError;f(l.value,{componentStack:l.stack})}catch(p){setTimeout(function(){throw p})}}function lT(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 Ov(o,l,f){return f=Pl(f),f.tag=3,f.payload={element:null},f.callback=function(){qh(o,l)},f}function aT(o){return o=Pl(o),o.tag=3,o}function uT(o,l,f,p){var v=f.type.getDerivedStateFromError;if(typeof v=="function"){var w=p.value;o.payload=function(){return v(w)},o.callback=function(){lT(l,f,p)}}var P=f.stateNode;P!==null&&typeof P.componentDidCatch=="function"&&(o.callback=function(){lT(l,f,p),typeof v!="function"&&(Hl===null?Hl=new Set([this]):Hl.add(this));var V=p.stack;this.componentDidCatch(p.value,{componentStack:V!==null?V:""})})}function q_(o,l,f,p,v){if(f.flags|=32768,p!==null&&typeof p=="object"&&typeof p.then=="function"){if(l=f.alternate,l!==null&&_u(l,f,v,!0),f=ki.current,f!==null){switch(f.tag){case 31:case 13:return Qi===null?rp():f.alternate===null&&Kn===0&&(Kn=3),f.flags&=-257,f.flags|=65536,f.lanes=v,p===Dh?f.flags|=16384:(l=f.updateQueue,l===null?f.updateQueue=new Set([p]):l.add(p),e0(o,p,v)),!1;case 22:return f.flags|=65536,p===Dh?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)),e0(o,p,v)),!1}throw Error(r(435,f.tag))}return e0(o,p,v),rp(),!1}if(Ft)return l=ki.current,l!==null?((l.flags&65536)===0&&(l.flags|=256),l.flags|=65536,l.lanes=v,p!==Ky&&(o=Error(r(422),{cause:p}),df(Wi(o,f)))):(p!==Ky&&(l=Error(r(423),{cause:p}),df(Wi(l,f))),o=o.current.alternate,o.flags|=65536,v&=-v,o.lanes|=v,p=Wi(p,f),v=Ov(o.stateNode,p,v),ov(o,v),Kn!==4&&(Kn=2)),!1;var w=Error(r(520),{cause:p});if(w=Wi(w,f),If===null?If=[w]:If.push(w),Kn!==4&&(Kn=2),l===null)return!0;p=Wi(p,f),f=l;do{switch(f.tag){case 3:return f.flags|=65536,o=v&-v,f.lanes|=o,o=Ov(f.stateNode,p,o),ov(f,o),!1;case 1:if(l=f.type,w=f.stateNode,(f.flags&128)===0&&(typeof l.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(Hl===null||!Hl.has(w))))return f.flags|=65536,v&=-v,f.lanes|=v,v=aT(v),uT(v,o,f,p),ov(f,v),!1}f=f.return}while(f!==null);return!1}var kv=Error(r(461)),hr=!1;function Dr(o,l,f,p){l.child=o===null?hR(l,null,f,p):Ua(l,o.child,f,p)}function cT(o,l,f,p,v){f=f.render;var w=l.ref;if("ref"in p){var P={};for(var V in p)V!=="ref"&&(P[V]=p[V])}else P=p;return Ha(l),p=fv(o,l,f,P,w,v),V=dv(),o!==null&&!hr?(hv(o,l,v),Hs(o,l,v)):(Ft&&V&&Gy(l),l.flags|=1,Dr(o,l,p,v),l.child)}function fT(o,l,f,p,v){if(o===null){var w=f.type;return typeof w=="function"&&!$y(w)&&w.defaultProps===void 0&&f.compare===null?(l.tag=15,l.type=w,dT(o,l,w,p,v)):(o=Eh(f.type,null,p,l,l.mode,v),o.ref=l.ref,o.return=l,l.child=o)}if(w=o.child,!jv(o,v)){var P=w.memoizedProps;if(f=f.compare,f=f!==null?f:uf,f(P,p)&&o.ref===l.ref)return Hs(o,l,v)}return l.flags|=1,o=zs(w,p),o.ref=l.ref,o.return=l,l.child=o}function dT(o,l,f,p,v){if(o!==null){var w=o.memoizedProps;if(uf(w,p)&&o.ref===l.ref)if(hr=!1,l.pendingProps=p=w,jv(o,v))(o.flags&131072)!==0&&(hr=!0);else return l.lanes=o.lanes,Hs(o,l,v)}return Iv(o,l,f,p,v)}function hT(o,l,f,p){var v=p.children,w=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(w=w!==null?w.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&~w}else p=0,l.child=null;return pT(o,l,w,f,p)}if((f&536870912)!==0)l.memoizedState={baseLanes:0,cachePool:null},o!==null&&kh(l,w!==null?w.cachePool:null),w!==null?mR(l,w):lv(),yR(l);else return p=l.lanes=536870912,pT(o,l,w!==null?w.baseLanes|f:f,f,p)}else w!==null?(kh(l,w.cachePool),mR(l,w),Ll(),l.memoizedState=null):(o!==null&&kh(l,null),lv(),Ll());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 pT(o,l,f,p,v){var w=tv();return w=w===null?null:{parent:fr._currentValue,pool:w},l.memoizedState={baseLanes:f,cachePool:w},o!==null&&kh(l,null),lv(),yR(l),o!==null&&_u(o,l,p,!0),l.childLanes=v,null}function Gh(o,l){return l=Kh({mode:l.mode,children:l.children},o.mode),l.ref=o.ref,o.child=l,l.return=o,l}function gT(o,l,f){return Ua(l,o.child,null,f),o=Gh(l,l.pendingProps),o.flags|=2,Ii(l),l.memoizedState=null,o}function G_(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=Gh(l,p),l.lanes=536870912,Rf(null,o);if(uv(l),(o=Dn)?(o=ME(o,Xi),o=o!==null&&o.data==="&"?o:null,o!==null&&(l.memoizedState={dehydrated:o,treeContext:Al!==null?{id:Qo,overflow:Zo}:null,retryLane:536870912,hydrationErrors:null},f=ZC(o),f.return=l,l.child=f,kr=l,Dn=null)):o=null,o===null)throw kl(l);return l.lanes=536870912,null}return Gh(l,p)}var w=o.memoizedState;if(w!==null){var P=w.dehydrated;if(uv(l),v)if(l.flags&256)l.flags&=-257,l=gT(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||_u(o,l,f,!1),v=(f&o.childLanes)!==0,hr||v){if(p=En,p!==null&&(P=it(p,f),P!==0&&P!==w.retryLane))throw w.retryLane=P,La(o,P),bi(p,o,P),kv;rp(),l=gT(o,l,f)}else o=w.treeContext,Dn=Zi(P.nextSibling),kr=l,Ft=!0,Ol=null,Xi=!1,o!==null&&tR(l,o),l=Gh(l,p),l.flags|=4096;return l}return o=zs(o.child,{mode:p.mode,children:p.children}),o.ref=l.ref,l.child=o,o.return=l,o}function Wh(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 Iv(o,l,f,p,v){return Ha(l),f=fv(o,l,f,p,void 0,v),p=dv(),o!==null&&!hr?(hv(o,l,v),Hs(o,l,v)):(Ft&&p&&Gy(l),l.flags|=1,Dr(o,l,f,v),l.child)}function mT(o,l,f,p,v,w){return Ha(l),l.updateQueue=null,f=bR(l,p,f,v),vR(o),p=dv(),o!==null&&!hr?(hv(o,l,w),Hs(o,l,w)):(Ft&&p&&Gy(l),l.flags|=1,Dr(o,l,f,w),l.child)}function yT(o,l,f,p,v){if(Ha(l),l.stateNode===null){var w=Nu,P=f.contextType;typeof P=="object"&&P!==null&&(w=Ir(P)),w=new f(p,w),l.memoizedState=w.state!==null&&w.state!==void 0?w.state:null,w.updater=Av,l.stateNode=w,w._reactInternals=l,w=l.stateNode,w.props=p,w.state=l.memoizedState,w.refs={},rv(l),P=f.contextType,w.context=typeof P=="object"&&P!==null?Ir(P):Nu,w.state=l.memoizedState,P=f.getDerivedStateFromProps,typeof P=="function"&&(Mv(l,f,P,p),w.state=l.memoizedState),typeof f.getDerivedStateFromProps=="function"||typeof w.getSnapshotBeforeUpdate=="function"||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(P=w.state,typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount(),P!==w.state&&Av.enqueueReplaceState(w,w.state,null),bf(l,p,w,v),vf(),w.state=l.memoizedState),typeof w.componentDidMount=="function"&&(l.flags|=4194308),p=!0}else if(o===null){w=l.stateNode;var V=l.memoizedProps,Q=Ga(f,V);w.props=Q;var ce=w.context,be=f.contextType;P=Nu,typeof be=="object"&&be!==null&&(P=Ir(be));var Re=f.getDerivedStateFromProps;be=typeof Re=="function"||typeof w.getSnapshotBeforeUpdate=="function",V=l.pendingProps!==V,be||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(V||ce!==P)&&rT(l,w,p,P),Dl=!1;var fe=l.memoizedState;w.state=fe,bf(l,p,w,v),vf(),ce=l.memoizedState,V||fe!==ce||Dl?(typeof Re=="function"&&(Mv(l,f,Re,p),ce=l.memoizedState),(Q=Dl||nT(l,f,Q,p,fe,ce,P))?(be||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount()),typeof w.componentDidMount=="function"&&(l.flags|=4194308)):(typeof w.componentDidMount=="function"&&(l.flags|=4194308),l.memoizedProps=p,l.memoizedState=ce),w.props=p,w.state=ce,w.context=P,p=Q):(typeof w.componentDidMount=="function"&&(l.flags|=4194308),p=!1)}else{w=l.stateNode,iv(o,l),P=l.memoizedProps,be=Ga(f,P),w.props=be,Re=l.pendingProps,fe=w.context,ce=f.contextType,Q=Nu,typeof ce=="object"&&ce!==null&&(Q=Ir(ce)),V=f.getDerivedStateFromProps,(ce=typeof V=="function"||typeof w.getSnapshotBeforeUpdate=="function")||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(P!==Re||fe!==Q)&&rT(l,w,p,Q),Dl=!1,fe=l.memoizedState,w.state=fe,bf(l,p,w,v),vf();var ge=l.memoizedState;P!==Re||fe!==ge||Dl||o!==null&&o.dependencies!==null&&Ah(o.dependencies)?(typeof V=="function"&&(Mv(l,f,V,p),ge=l.memoizedState),(be=Dl||nT(l,f,be,p,fe,ge,Q)||o!==null&&o.dependencies!==null&&Ah(o.dependencies))?(ce||typeof w.UNSAFE_componentWillUpdate!="function"&&typeof w.componentWillUpdate!="function"||(typeof w.componentWillUpdate=="function"&&w.componentWillUpdate(p,ge,Q),typeof w.UNSAFE_componentWillUpdate=="function"&&w.UNSAFE_componentWillUpdate(p,ge,Q)),typeof w.componentDidUpdate=="function"&&(l.flags|=4),typeof w.getSnapshotBeforeUpdate=="function"&&(l.flags|=1024)):(typeof w.componentDidUpdate!="function"||P===o.memoizedProps&&fe===o.memoizedState||(l.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||P===o.memoizedProps&&fe===o.memoizedState||(l.flags|=1024),l.memoizedProps=p,l.memoizedState=ge),w.props=p,w.state=ge,w.context=Q,p=be):(typeof w.componentDidUpdate!="function"||P===o.memoizedProps&&fe===o.memoizedState||(l.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||P===o.memoizedProps&&fe===o.memoizedState||(l.flags|=1024),p=!1)}return w=p,Wh(o,l),p=(l.flags&128)!==0,w||p?(w=l.stateNode,f=p&&typeof f.getDerivedStateFromError!="function"?null:w.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=w.state,o=l.child):o=Hs(o,l,v),o}function vT(o,l,f,p){return ja(),l.flags|=256,Dr(o,l,f,p),l.child}var Dv={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Pv(o){return{baseLanes:o,cachePool:lR()}}function zv(o,l,f){return o=o!==null?o.childLanes&~f:0,l&&(o|=Pi),o}function bT(o,l,f){var p=l.pendingProps,v=!1,w=(l.flags&128)!==0,P;if((P=w)||(P=o!==null&&o.memoizedState===null?!1:(tr.current&2)!==0),P&&(v=!0,l.flags&=-129),P=(l.flags&32)!==0,l.flags&=-33,o===null){if(Ft){if(v?Nl(l):Ll(),(o=Dn)?(o=ME(o,Xi),o=o!==null&&o.data!=="&"?o:null,o!==null&&(l.memoizedState={dehydrated:o,treeContext:Al!==null?{id:Qo,overflow:Zo}:null,retryLane:536870912,hydrationErrors:null},f=ZC(o),f.return=l,l.child=f,kr=l,Dn=null)):o=null,o===null)throw kl(l);return m0(o)?l.lanes=32:l.lanes=536870912,null}var V=p.children;return p=p.fallback,v?(Ll(),v=l.mode,V=Kh({mode:"hidden",children:V},v),p=Ba(p,v,f,null),V.return=l,p.return=l,V.sibling=p,l.child=V,p=l.child,p.memoizedState=Pv(f),p.childLanes=zv(o,P,f),l.memoizedState=Dv,Rf(null,p)):(Nl(l),Nv(l,V))}var Q=o.memoizedState;if(Q!==null&&(V=Q.dehydrated,V!==null)){if(w)l.flags&256?(Nl(l),l.flags&=-257,l=Lv(o,l,f)):l.memoizedState!==null?(Ll(),l.child=o.child,l.flags|=128,l=null):(Ll(),V=p.fallback,v=l.mode,p=Kh({mode:"visible",children:p.children},v),V=Ba(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=Pv(f),p.childLanes=zv(o,P,f),l.memoizedState=Dv,l=Rf(null,p));else if(Nl(l),m0(V)){if(P=V.nextSibling&&V.nextSibling.dataset,P)var ce=P.dgst;P=ce,p=Error(r(419)),p.stack="",p.digest=P,df({value:p,source:null,stack:null}),l=Lv(o,l,f)}else if(hr||_u(o,l,f,!1),P=(f&o.childLanes)!==0,hr||P){if(P=En,P!==null&&(p=it(P,f),p!==0&&p!==Q.retryLane))throw Q.retryLane=p,La(o,p),bi(P,o,p),kv;g0(V)||rp(),l=Lv(o,l,f)}else g0(V)?(l.flags|=192,l.child=o.child,l=null):(o=Q.treeContext,Dn=Zi(V.nextSibling),kr=l,Ft=!0,Ol=null,Xi=!1,o!==null&&tR(l,o),l=Nv(l,p.children),l.flags|=4096);return l}return v?(Ll(),V=p.fallback,v=l.mode,Q=o.child,ce=Q.sibling,p=zs(Q,{mode:"hidden",children:p.children}),p.subtreeFlags=Q.subtreeFlags&65011712,ce!==null?V=zs(ce,V):(V=Ba(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=Pv(f):(v=V.cachePool,v!==null?(Q=fr._currentValue,v=v.parent!==Q?{parent:Q,pool:Q}:v):v=lR(),V={baseLanes:V.baseLanes|f,cachePool:v}),p.memoizedState=V,p.childLanes=zv(o,P,f),l.memoizedState=Dv,Rf(o.child,p)):(Nl(l),f=o.child,o=f.sibling,f=zs(f,{mode:"visible",children:p.children}),f.return=l,f.sibling=null,o!==null&&(P=l.deletions,P===null?(l.deletions=[o],l.flags|=16):P.push(o)),l.child=f,l.memoizedState=null,f)}function Nv(o,l){return l=Kh({mode:"visible",children:l},o.mode),l.return=o,o.child=l}function Kh(o,l){return o=Oi(22,o,null,l),o.lanes=0,o}function Lv(o,l,f){return Ua(l,o.child,null,f),o=Nv(l,l.pendingProps.children),o.flags|=2,l.memoizedState=null,o}function xT(o,l,f){o.lanes|=l;var p=o.alternate;p!==null&&(p.lanes|=l),Qy(o.return,l,f)}function Bv(o,l,f,p,v,w){var P=o.memoizedState;P===null?o.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:p,tail:f,tailMode:v,treeForkCount:w}:(P.isBackwards=l,P.rendering=null,P.renderingStartTime=0,P.last=p,P.tail=f,P.tailMode=v,P.treeForkCount=w)}function ST(o,l,f){var p=l.pendingProps,v=p.revealOrder,w=p.tail;p=p.children;var P=tr.current,V=(P&2)!==0;if(V?(P=P&1|2,l.flags|=128):P&=1,W(tr,P),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&&xT(o,f,l);else if(o.tag===19)xT(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&&Lh(o)===null&&(v=f),f=f.sibling;f=v,f===null?(v=l.child,l.child=null):(v=f.sibling,f.sibling=null),Bv(l,!1,v,f,w,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&&Lh(o)===null){l.child=v;break}o=v.sibling,v.sibling=f,f=v,v=o}Bv(l,!0,f,null,w,p);break;case"together":Bv(l,!1,null,null,void 0,p);break;default:l.memoizedState=null}return l.child}function Hs(o,l,f){if(o!==null&&(l.dependencies=o.dependencies),_l|=l.lanes,(f&l.childLanes)===0)if(o!==null){if(_u(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=zs(o,o.pendingProps),l.child=f,f.return=l;o.sibling!==null;)o=o.sibling,f=f.sibling=zs(o,o.pendingProps),f.return=l;f.sibling=null}return l.child}function jv(o,l){return(o.lanes&l)!==0?!0:(o=o.dependencies,!!(o!==null&&Ah(o)))}function W_(o,l,f){switch(l.tag){case 3:Y(l,l.stateNode.containerInfo),Il(l,fr,o.memoizedState.cache),ja();break;case 27:case 5:ve(l);break;case 4:Y(l,l.stateNode.containerInfo);break;case 10:Il(l,l.type,l.memoizedProps.value);break;case 31:if(l.memoizedState!==null)return l.flags|=128,uv(l),null;break;case 13:var p=l.memoizedState;if(p!==null)return p.dehydrated!==null?(Nl(l),l.flags|=128,null):(f&l.child.childLanes)!==0?bT(o,l,f):(Nl(l),o=Hs(o,l,f),o!==null?o.sibling:null);Nl(l);break;case 19:var v=(o.flags&128)!==0;if(p=(f&l.childLanes)!==0,p||(_u(o,l,f,!1),p=(f&l.childLanes)!==0),v){if(p)return ST(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,hT(o,l,f,l.pendingProps);case 24:Il(l,fr,o.memoizedState.cache)}return Hs(o,l,f)}function wT(o,l,f){if(o!==null)if(o.memoizedProps!==l.pendingProps)hr=!0;else{if(!jv(o,f)&&(l.flags&128)===0)return hr=!1,W_(o,l,f);hr=(o.flags&131072)!==0}else hr=!1,Ft&&(l.flags&1048576)!==0&&eR(l,ff,l.index);switch(l.lanes=0,l.tag){case 16:e:{var p=l.pendingProps;if(o=Fa(l.elementType),l.type=o,typeof o=="function")$y(o)?(p=Ga(o,p),l.tag=1,l=yT(null,l,o,p,f)):(l.tag=0,l=Iv(null,l,o,p,f));else{if(o!=null){var v=o.$$typeof;if(v===M){l.tag=11,l=cT(null,l,o,p,f);break e}else if(v===O){l.tag=14,l=fT(null,l,o,p,f);break e}}throw l=F(o)||o,Error(r(306,l,""))}}return l;case 0:return Iv(o,l,l.type,l.pendingProps,f);case 1:return p=l.type,v=Ga(p,l.pendingProps),yT(o,l,p,v,f);case 3:e:{if(Y(l,l.stateNode.containerInfo),o===null)throw Error(r(387));p=l.pendingProps;var w=l.memoizedState;v=w.element,iv(o,l),bf(l,p,null,f);var P=l.memoizedState;if(p=P.cache,Il(l,fr,p),p!==w.cache&&Zy(l,[fr],f,!0),vf(),p=P.element,w.isDehydrated)if(w={element:p,isDehydrated:!1,cache:P.cache},l.updateQueue.baseState=w,l.memoizedState=w,l.flags&256){l=vT(o,l,p,f);break e}else if(p!==v){v=Wi(Error(r(424)),l),df(v),l=vT(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=Zi(o.firstChild),kr=l,Ft=!0,Ol=null,Xi=!0,f=hR(l,null,p,f),l.child=f;f;)f.flags=f.flags&-3|4096,f=f.sibling;else{if(ja(),p===v){l=Hs(o,l,f);break e}Dr(o,l,p,f)}l=l.child}return l;case 26:return Wh(o,l),o===null?(f=PE(l.type,null,l.pendingProps,null))?l.memoizedState=f:Ft||(f=l.type,o=l.pendingProps,p=cp(ee.current).createElement(f),p[zt]=l,p[Nt]=o,Pr(p,f,o),$n(p),l.stateNode=p):l.memoizedState=PE(l.type,o.memoizedProps,l.pendingProps,o.memoizedState),null;case 27:return ve(l),o===null&&Ft&&(p=l.stateNode=kE(l.type,l.pendingProps,ee.current),kr=l,Xi=!0,v=Dn,Ul(l.type)?(y0=v,Dn=Zi(p.firstChild)):Dn=v),Dr(o,l,l.pendingProps.children,f),Wh(o,l),o===null&&(l.flags|=4194304),l.child;case 5:return o===null&&Ft&&((v=p=Dn)&&(p=CH(p,l.type,l.pendingProps,Xi),p!==null?(l.stateNode=p,kr=l,Dn=Zi(p.firstChild),Xi=!1,v=!0):v=!1),v||kl(l)),ve(l),v=l.type,w=l.pendingProps,P=o!==null?o.memoizedProps:null,p=w.children,d0(v,w)?p=null:P!==null&&d0(v,P)&&(l.flags|=32),l.memoizedState!==null&&(v=fv(o,l,j_,null,null,f),_f._currentValue=v),Wh(o,l),Dr(o,l,p,f),l.child;case 6:return o===null&&Ft&&((o=f=Dn)&&(f=RH(f,l.pendingProps,Xi),f!==null?(l.stateNode=f,kr=l,Dn=null,o=!0):o=!1),o||kl(l)),null;case 13:return bT(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 cT(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,Il(l,l.type,p.value),Dr(o,l,p.children,f),l.child;case 9:return v=l.type._context,p=l.pendingProps.children,Ha(l),v=Ir(v),p=p(v),l.flags|=1,Dr(o,l,p,f),l.child;case 14:return fT(o,l,l.type,l.pendingProps,f);case 15:return dT(o,l,l.type,l.pendingProps,f);case 19:return ST(o,l,f);case 31:return G_(o,l,f);case 22:return hT(o,l,f,l.pendingProps);case 24:return Ha(l),p=Ir(fr),o===null?(v=tv(),v===null&&(v=En,w=Jy(),v.pooledCache=w,w.refCount++,w!==null&&(v.pooledCacheLanes|=f),v=w),l.memoizedState={parent:p,cache:v},rv(l),Il(l,fr,v)):((o.lanes&f)!==0&&(iv(o,l),bf(l,null,null,f),vf()),v=o.memoizedState,w=l.memoizedState,v.parent!==p?(v={parent:p,cache:p},l.memoizedState=v,l.lanes===0&&(l.memoizedState=l.updateQueue.baseState=v),Il(l,fr,p)):(p=w.cache,Il(l,fr,p),p!==v.cache&&Zy(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 Vs(o){o.flags|=4}function _v(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(YT())o.flags|=8192;else throw $a=Dh,nv}else o.flags&=-16777217}function CT(o,l){if(l.type!=="stylesheet"||(l.state.loading&4)!==0)o.flags&=-16777217;else if(o.flags|=16777216,!jE(l))if(YT())o.flags|=8192;else throw $a=Dh,nv}function Yh(o,l){l!==null&&(o.flags|=4),o.flags&16384&&(l=o.tag!==22?Fn():536870912,o.lanes|=l,Qu|=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 K_(o,l,f){var p=l.pendingProps;switch(Wy(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),Bs(fr),se(),f.pendingContext&&(f.context=f.pendingContext,f.pendingContext=null),(o===null||o.child===null)&&(ju(l)?Vs(l):o===null||o.memoizedState.isDehydrated&&(l.flags&256)===0||(l.flags|=1024,Yy())),Pn(l),null;case 26:var v=l.type,w=l.memoizedState;return o===null?(Vs(l),w!==null?(Pn(l),CT(l,w)):(Pn(l),_v(l,v,null,p,f))):w?w!==o.memoizedState?(Vs(l),Pn(l),CT(l,w)):(Pn(l),l.flags&=-16777217):(o=o.memoizedProps,o!==p&&Vs(l),Pn(l),_v(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&&Vs(l);else{if(!p){if(l.stateNode===null)throw Error(r(166));return Pn(l),null}o=K.current,ju(l)?nR(l):(o=kE(v,p,f),l.stateNode=o,Vs(l))}return Pn(l),null;case 5:if(ye(l),v=l.type,o!==null&&l.stateNode!=null)o.memoizedProps!==p&&Vs(l);else{if(!p){if(l.stateNode===null)throw Error(r(166));return Pn(l),null}if(w=K.current,ju(l))nR(l);else{var P=cp(ee.current);switch(w){case 1:w=P.createElementNS("http://www.w3.org/2000/svg",v);break;case 2:w=P.createElementNS("http://www.w3.org/1998/Math/MathML",v);break;default:switch(v){case"svg":w=P.createElementNS("http://www.w3.org/2000/svg",v);break;case"math":w=P.createElementNS("http://www.w3.org/1998/Math/MathML",v);break;case"script":w=P.createElement("div"),w.innerHTML="<script><\/script>",w=w.removeChild(w.firstChild);break;case"select":w=typeof p.is=="string"?P.createElement("select",{is:p.is}):P.createElement("select"),p.multiple?w.multiple=!0:p.size&&(w.size=p.size);break;default:w=typeof p.is=="string"?P.createElement(v,{is:p.is}):P.createElement(v)}}w[zt]=l,w[Nt]=p;e:for(P=l.child;P!==null;){if(P.tag===5||P.tag===6)w.appendChild(P.stateNode);else if(P.tag!==4&&P.tag!==27&&P.child!==null){P.child.return=P,P=P.child;continue}if(P===l)break e;for(;P.sibling===null;){if(P.return===null||P.return===l)break e;P=P.return}P.sibling.return=P.return,P=P.sibling}l.stateNode=w;e:switch(Pr(w,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&&Vs(l)}}return Pn(l),_v(l,l.type,o===null?null:o.memoizedProps,l.pendingProps,f),null;case 6:if(o&&l.stateNode!=null)o.memoizedProps!==p&&Vs(l);else{if(typeof p!="string"&&l.stateNode===null)throw Error(r(166));if(o=ee.current,ju(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||bE(o.nodeValue,f)),o||kl(l,!0)}else o=cp(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=ju(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 ja(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;Pn(l),o=!1}else f=Yy(),o!==null&&o.memoizedState!==null&&(o.memoizedState.hydrationErrors=f),o=!0;if(!o)return l.flags&256?(Ii(l),l):(Ii(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=ju(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 ja(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;Pn(l),v=!1}else v=Yy(),o!==null&&o.memoizedState!==null&&(o.memoizedState.hydrationErrors=v),v=!0;if(!v)return l.flags&256?(Ii(l),l):(Ii(l),null)}return Ii(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),w=null,p.memoizedState!==null&&p.memoizedState.cachePool!==null&&(w=p.memoizedState.cachePool.pool),w!==v&&(p.flags|=2048)),f!==o&&f&&(l.child.flags|=8192),Yh(l,l.updateQueue),Pn(l),null);case 4:return se(),o===null&&l0(l.stateNode.containerInfo),Pn(l),null;case 10:return Bs(l.type),Pn(l),null;case 19:if(U(tr),p=l.memoizedState,p===null)return Pn(l),null;if(v=(l.flags&128)!==0,w=p.rendering,w===null)if(v)Tf(p,!1);else{if(Kn!==0||o!==null&&(o.flags&128)!==0)for(o=l.child;o!==null;){if(w=Lh(o),w!==null){for(l.flags|=128,Tf(p,!1),o=w.updateQueue,l.updateQueue=o,Yh(l,o),l.subtreeFlags=0,o=f,f=l.child;f!==null;)QC(f,o),f=f.sibling;return W(tr,tr.current&1|2),Ft&&Ns(l,p.treeForkCount),l.child}o=o.sibling}p.tail!==null&&J()>ep&&(l.flags|=128,v=!0,Tf(p,!1),l.lanes=4194304)}else{if(!v)if(o=Lh(w),o!==null){if(l.flags|=128,v=!0,o=o.updateQueue,l.updateQueue=o,Yh(l,o),Tf(p,!0),p.tail===null&&p.tailMode==="hidden"&&!w.alternate&&!Ft)return Pn(l),null}else 2*J()-p.renderingStartTime>ep&&f!==536870912&&(l.flags|=128,v=!0,Tf(p,!1),l.lanes=4194304);p.isBackwards?(w.sibling=l.child,l.child=w):(o=p.last,o!==null?o.sibling=w:l.child=w,p.last=w)}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&&Ns(l,p.treeForkCount),o):(Pn(l),null);case 22:case 23:return Ii(l),av(),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&&Yh(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&&U(Va),null;case 24:return f=null,o!==null&&(f=o.memoizedState.cache),l.memoizedState.cache!==f&&(l.flags|=2048),Bs(fr),Pn(l),null;case 25:return null;case 30:return null}throw Error(r(156,l.tag))}function Y_(o,l){switch(Wy(l),l.tag){case 1:return o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 3:return Bs(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(Ii(l),l.alternate===null)throw Error(r(340));ja()}return o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 13:if(Ii(l),o=l.memoizedState,o!==null&&o.dehydrated!==null){if(l.alternate===null)throw Error(r(340));ja()}return o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 19:return U(tr),null;case 4:return se(),null;case 10:return Bs(l.type),null;case 22:case 23:return Ii(l),av(),o!==null&&U(Va),o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 24:return Bs(fr),null;case 25:return null;default:return null}}function RT(o,l){switch(Wy(l),l.tag){case 3:Bs(fr),se();break;case 26:case 27:case 5:ye(l);break;case 4:se();break;case 31:l.memoizedState!==null&&Ii(l);break;case 13:Ii(l);break;case 19:U(tr);break;case 10:Bs(l.type);break;case 22:case 23:Ii(l),av(),o!==null&&U(Va);break;case 24:Bs(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 w=f.create,P=f.inst;p=w(),P.destroy=p}f=f.next}while(f!==v)}}catch(V){hn(l,l.return,V)}}function Bl(o,l,f){try{var p=l.updateQueue,v=p!==null?p.lastEffect:null;if(v!==null){var w=v.next;p=w;do{if((p.tag&o)===o){var P=p.inst,V=P.destroy;if(V!==void 0){P.destroy=void 0,v=l;var Q=f,ce=V;try{ce()}catch(be){hn(v,Q,be)}}}p=p.next}while(p!==w)}}catch(be){hn(l,l.return,be)}}function TT(o){var l=o.updateQueue;if(l!==null){var f=o.stateNode;try{gR(l,f)}catch(p){hn(o,o.return,p)}}}function ET(o,l,f){f.props=Ga(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 MT(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 Hv(o,l,f){try{var p=o.stateNode;yH(p,o.type,f,l),p[Nt]=l}catch(v){hn(o,o.return,v)}}function AT(o){return o.tag===5||o.tag===3||o.tag===26||o.tag===27&&Ul(o.type)||o.tag===4}function Vv(o){e:for(;;){for(;o.sibling===null;){if(o.return===null||AT(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 Fv(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(Fv(o,l,f),o=o.sibling;o!==null;)Fv(o,l,f),o=o.sibling}function Xh(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(Xh(o,l,f),o=o.sibling;o!==null;)Xh(o,l,f),o=o.sibling}function OT(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(w){hn(o,o.return,w)}}var Fs=!1,pr=!1,$v=!1,kT=typeof WeakSet=="function"?WeakSet:Set,Mr=null;function X_(o,l){if(o=o.containerInfo,c0=yp,o=FC(o),Ly(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,w=p.focusNode;p=p.focusOffset;try{f.nodeType,w.nodeType}catch{f=null;break e}var P=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=P+v),Re!==w||p!==0&&Re.nodeType!==3||(Q=P+p),Re.nodeType===3&&(P+=Re.nodeValue.length),(ge=Re.firstChild)!==null;)fe=Re,Re=ge;for(;;){if(Re===o)break t;if(fe===f&&++ce===v&&(V=P),fe===w&&++be===p&&(Q=P),(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(f0={focusedElem:o,selectionRange:f},yp=!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,w=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&&w!==null){o=void 0,f=l,v=w.memoizedProps,w=w.memoizedState,p=f.stateNode;try{var Xe=Ga(f.type,v);o=p.getSnapshotBeforeUpdate(Xe,w),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)p0(o);else if(f===1)switch(o.nodeName){case"HEAD":case"HTML":case"BODY":p0(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 IT(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(P){hn(f,f.return,P)}else{var v=Ga(f.type,l.memoizedProps);l=l.memoizedState;try{o.componentDidUpdate(v,l,o.__reactInternalSnapshotBeforeUpdate)}catch(P){hn(f,f.return,P)}}p&64&&TT(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{gR(o,l)}catch(P){hn(f,f.return,P)}}break;case 27:l===null&&p&4&&OT(f);case 26:case 5:Us(o,f),l===null&&p&4&&MT(f),p&512&&Mf(f,f.return);break;case 12:Us(o,f);break;case 31:Us(o,f),p&4&&zT(o,f);break;case 13:Us(o,f),p&4&&NT(o,f),p&64&&(o=f.memoizedState,o!==null&&(o=o.dehydrated,o!==null&&(f=oH.bind(null,f),TH(o,f))));break;case 22:if(p=f.memoizedState!==null||Fs,!p){l=l!==null&&l.memoizedState!==null||pr,v=Fs;var w=pr;Fs=p,(pr=l)&&!w?qs(o,f,(f.subtreeFlags&8772)!==0):Us(o,f),Fs=v,pr=w}break;case 30:break;default:Us(o,f)}}function DT(o){var l=o.alternate;l!==null&&(o.alternate=null,DT(l)),o.child=null,o.deletions=null,o.sibling=null,o.tag===5&&(l=o.stateNode,l!==null&&Oa(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,gi=!1;function $s(o,l,f){for(f=f.child;f!==null;)PT(o,l,f),f=f.sibling}function PT(o,l,f){if(Ct&&typeof Ct.onCommitFiberUnmount=="function")try{Ct.onCommitFiberUnmount(st,f)}catch{}switch(f.tag){case 26:pr||Jo(f,l),$s(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=gi;Ul(f.type)&&(_n=f.stateNode,gi=!1),$s(o,l,f),Lf(f.stateNode),_n=p,gi=v;break;case 5:pr||Jo(f,l);case 6:if(p=_n,v=gi,_n=null,$s(o,l,f),_n=p,gi=v,_n!==null)if(gi)try{(_n.nodeType===9?_n.body:_n.nodeName==="HTML"?_n.ownerDocument.body:_n).removeChild(f.stateNode)}catch(w){hn(f,l,w)}else try{_n.removeChild(f.stateNode)}catch(w){hn(f,l,w)}break;case 18:_n!==null&&(gi?(o=_n,TE(o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,f.stateNode),oc(o)):TE(_n,f.stateNode));break;case 4:p=_n,v=gi,_n=f.stateNode.containerInfo,gi=!0,$s(o,l,f),_n=p,gi=v;break;case 0:case 11:case 14:case 15:Bl(2,f,l),pr||Bl(4,f,l),$s(o,l,f);break;case 1:pr||(Jo(f,l),p=f.stateNode,typeof p.componentWillUnmount=="function"&&ET(f,l,p)),$s(o,l,f);break;case 21:$s(o,l,f);break;case 22:pr=(p=pr)||f.memoizedState!==null,$s(o,l,f),pr=p;break;default:$s(o,l,f)}}function zT(o,l){if(l.memoizedState===null&&(o=l.alternate,o!==null&&(o=o.memoizedState,o!==null))){o=o.dehydrated;try{oc(o)}catch(f){hn(l,l.return,f)}}}function NT(o,l){if(l.memoizedState===null&&(o=l.alternate,o!==null&&(o=o.memoizedState,o!==null&&(o=o.dehydrated,o!==null))))try{oc(o)}catch(f){hn(l,l.return,f)}}function Q_(o){switch(o.tag){case 31:case 13:case 19:var l=o.stateNode;return l===null&&(l=o.stateNode=new kT),l;case 22:return o=o.stateNode,l=o._retryCache,l===null&&(l=o._retryCache=new kT),l;default:throw Error(r(435,o.tag))}}function Qh(o,l){var f=Q_(o);l.forEach(function(p){if(!f.has(p)){f.add(p);var v=sH.bind(null,o,p);p.then(v,v)}})}function mi(o,l){var f=l.deletions;if(f!==null)for(var p=0;p<f.length;p++){var v=f[p],w=o,P=l,V=P;e:for(;V!==null;){switch(V.tag){case 27:if(Ul(V.type)){_n=V.stateNode,gi=!1;break e}break;case 5:_n=V.stateNode,gi=!1;break e;case 3:case 4:_n=V.stateNode.containerInfo,gi=!0;break e}V=V.return}if(_n===null)throw Error(r(160));PT(w,P,v),_n=null,gi=!1,w=v.alternate,w!==null&&(w.return=null),v.return=null}if(l.subtreeFlags&13886)for(l=l.child;l!==null;)LT(l,o),l=l.sibling}var Eo=null;function LT(o,l){var f=o.alternate,p=o.flags;switch(o.tag){case 0:case 11:case 14:case 15:mi(l,o),yi(o),p&4&&(Bl(3,o,o.return),Ef(3,o),Bl(5,o,o.return));break;case 1:mi(l,o),yi(o),p&512&&(pr||f===null||Jo(f,f.return)),p&64&&Fs&&(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(mi(l,o),yi(o),p&512&&(pr||f===null||Jo(f,f.return)),p&4){var w=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":w=v.getElementsByTagName("title")[0],(!w||w[qe]||w[zt]||w.namespaceURI==="http://www.w3.org/2000/svg"||w.hasAttribute("itemprop"))&&(w=v.createElement(p),v.head.insertBefore(w,v.querySelector("head > title"))),Pr(w,p,f),w[zt]=o,$n(w),p=w;break e;case"link":var P=LE("link","href",v).get(p+(f.href||""));if(P){for(var V=0;V<P.length;V++)if(w=P[V],w.getAttribute("href")===(f.href==null||f.href===""?null:f.href)&&w.getAttribute("rel")===(f.rel==null?null:f.rel)&&w.getAttribute("title")===(f.title==null?null:f.title)&&w.getAttribute("crossorigin")===(f.crossOrigin==null?null:f.crossOrigin)){P.splice(V,1);break t}}w=v.createElement(p),Pr(w,p,f),v.head.appendChild(w);break;case"meta":if(P=LE("meta","content",v).get(p+(f.content||""))){for(V=0;V<P.length;V++)if(w=P[V],w.getAttribute("content")===(f.content==null?null:""+f.content)&&w.getAttribute("name")===(f.name==null?null:f.name)&&w.getAttribute("property")===(f.property==null?null:f.property)&&w.getAttribute("http-equiv")===(f.httpEquiv==null?null:f.httpEquiv)&&w.getAttribute("charset")===(f.charSet==null?null:f.charSet)){P.splice(V,1);break t}}w=v.createElement(p),Pr(w,p,f),v.head.appendChild(w);break;default:throw Error(r(468,p))}w[zt]=o,$n(w),p=w}o.stateNode=p}else BE(v,o.type,o.stateNode);else o.stateNode=NE(v,p,o.memoizedProps);else w!==p?(w===null?f.stateNode!==null&&(f=f.stateNode,f.parentNode.removeChild(f)):w.count--,p===null?BE(v,o.type,o.stateNode):NE(v,p,o.memoizedProps)):p===null&&o.stateNode!==null&&Hv(o,o.memoizedProps,f.memoizedProps)}break;case 27:mi(l,o),yi(o),p&512&&(pr||f===null||Jo(f,f.return)),f!==null&&p&4&&Hv(o,o.memoizedProps,f.memoizedProps);break;case 5:if(mi(l,o),yi(o),p&512&&(pr||f===null||Jo(f,f.return)),o.flags&32){v=o.stateNode;try{qi(v,"")}catch(Xe){hn(o,o.return,Xe)}}p&4&&o.stateNode!=null&&(v=o.memoizedProps,Hv(o,v,f!==null?f.memoizedProps:v)),p&1024&&($v=!0);break;case 6:if(mi(l,o),yi(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(hp=null,v=Eo,Eo=fp(l.containerInfo),mi(l,o),Eo=v,yi(o),p&4&&f!==null&&f.memoizedState.isDehydrated)try{oc(l.containerInfo)}catch(Xe){hn(o,o.return,Xe)}$v&&($v=!1,BT(o));break;case 4:p=Eo,Eo=fp(o.stateNode.containerInfo),mi(l,o),yi(o),Eo=p;break;case 12:mi(l,o),yi(o);break;case 31:mi(l,o),yi(o),p&4&&(p=o.updateQueue,p!==null&&(o.updateQueue=null,Qh(o,p)));break;case 13:mi(l,o),yi(o),o.child.flags&8192&&o.memoizedState!==null!=(f!==null&&f.memoizedState!==null)&&(Jh=J()),p&4&&(p=o.updateQueue,p!==null&&(o.updateQueue=null,Qh(o,p)));break;case 22:v=o.memoizedState!==null;var Q=f!==null&&f.memoizedState!==null,ce=Fs,be=pr;if(Fs=ce||v,pr=be||Q,mi(l,o),pr=be,Fs=ce,yi(o),p&8192)e:for(l=o.stateNode,l._visibility=v?l._visibility&-2:l._visibility|1,v&&(f===null||Q||Fs||pr||Wa(o)),f=null,l=o;;){if(l.tag===5||l.tag===26){if(f===null){Q=f=l;try{if(w=Q.stateNode,v)P=w.style,typeof P.setProperty=="function"?P.setProperty("display","none","important"):P.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?EE(ge,!0):EE(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,Qh(o,f))));break;case 19:mi(l,o),yi(o),p&4&&(p=o.updateQueue,p!==null&&(o.updateQueue=null,Qh(o,p)));break;case 30:break;case 21:break;default:mi(l,o),yi(o)}}function yi(o){var l=o.flags;if(l&2){try{for(var f,p=o.return;p!==null;){if(AT(p)){f=p;break}p=p.return}if(f==null)throw Error(r(160));switch(f.tag){case 27:var v=f.stateNode,w=Vv(o);Xh(o,w,v);break;case 5:var P=f.stateNode;f.flags&32&&(qi(P,""),f.flags&=-33);var V=Vv(o);Xh(o,V,P);break;case 3:case 4:var Q=f.stateNode.containerInfo,ce=Vv(o);Fv(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 BT(o){if(o.subtreeFlags&1024)for(o=o.child;o!==null;){var l=o;BT(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;)IT(o,l.alternate,l),l=l.sibling}function Wa(o){for(o=o.child;o!==null;){var l=o;switch(l.tag){case 0:case 11:case 14:case 15:Bl(4,l,l.return),Wa(l);break;case 1:Jo(l,l.return);var f=l.stateNode;typeof f.componentWillUnmount=="function"&&ET(l,l.return,f),Wa(l);break;case 27:Lf(l.stateNode);case 26:case 5:Jo(l,l.return),Wa(l);break;case 22:l.memoizedState===null&&Wa(l);break;case 30:Wa(l);break;default:Wa(l)}o=o.sibling}}function qs(o,l,f){for(f=f&&(l.subtreeFlags&8772)!==0,l=l.child;l!==null;){var p=l.alternate,v=o,w=l,P=w.flags;switch(w.tag){case 0:case 11:case 15:qs(v,w,f),Ef(4,w);break;case 1:if(qs(v,w,f),p=w,v=p.stateNode,typeof v.componentDidMount=="function")try{v.componentDidMount()}catch(ce){hn(p,p.return,ce)}if(p=w,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++)pR(Q[v],V)}catch(ce){hn(p,p.return,ce)}}f&&P&64&&TT(w),Mf(w,w.return);break;case 27:OT(w);case 26:case 5:qs(v,w,f),f&&p===null&&P&4&&MT(w),Mf(w,w.return);break;case 12:qs(v,w,f);break;case 31:qs(v,w,f),f&&P&4&&zT(v,w);break;case 13:qs(v,w,f),f&&P&4&&NT(v,w);break;case 22:w.memoizedState===null&&qs(v,w,f),Mf(w,w.return);break;case 30:break;default:qs(v,w,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 qv(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;)jT(o,l,f,p),l=l.sibling}function jT(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 w=l.memoizedProps,P=w.id,V=w.onPostCommit;typeof V=="function"&&V(P,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:w=l.stateNode,P=l.alternate,l.memoizedState!==null?w._visibility&2?Mo(o,l,f,p):Af(o,l):w._visibility&2?Mo(o,l,f,p):(w._visibility|=2,Ku(o,l,f,p,(l.subtreeFlags&10256)!==0||!1)),v&2048&&Uv(P,l);break;case 24:Mo(o,l,f,p),v&2048&&qv(l.alternate,l);break;default:Mo(o,l,f,p)}}function Ku(o,l,f,p,v){for(v=v&&((l.subtreeFlags&10256)!==0||!1),l=l.child;l!==null;){var w=o,P=l,V=f,Q=p,ce=P.flags;switch(P.tag){case 0:case 11:case 15:Ku(w,P,V,Q,v),Ef(8,P);break;case 23:break;case 22:var be=P.stateNode;P.memoizedState!==null?be._visibility&2?Ku(w,P,V,Q,v):Af(w,P):(be._visibility|=2,Ku(w,P,V,Q,v)),v&&ce&2048&&Uv(P.alternate,P);break;case 24:Ku(w,P,V,Q,v),v&&ce&2048&&qv(P.alternate,P);break;default:Ku(w,P,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&&qv(p.alternate,p);break;default:Af(f,p)}l=l.sibling}}var Of=8192;function Yu(o,l,f){if(o.subtreeFlags&Of)for(o=o.child;o!==null;)_T(o,l,f),o=o.sibling}function _T(o,l,f){switch(o.tag){case 26:Yu(o,l,f),o.flags&Of&&o.memoizedState!==null&&BH(f,Eo,o.memoizedState,o.memoizedProps);break;case 5:Yu(o,l,f);break;case 3:case 4:var p=Eo;Eo=fp(o.stateNode.containerInfo),Yu(o,l,f),Eo=p;break;case 22:o.memoizedState===null&&(p=o.alternate,p!==null&&p.memoizedState!==null?(p=Of,Of=16777216,Yu(o,l,f),Of=p):Yu(o,l,f));break;default:Yu(o,l,f)}}function HT(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,FT(p,o)}HT(o)}if(o.subtreeFlags&10256)for(o=o.child;o!==null;)VT(o),o=o.sibling}function VT(o){switch(o.tag){case 0:case 11:case 15:kf(o),o.flags&2048&&Bl(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,Zh(o)):kf(o);break;default:kf(o)}}function Zh(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,FT(p,o)}HT(o)}for(o=o.child;o!==null;){switch(l=o,l.tag){case 0:case 11:case 15:Bl(8,l,l.return),Zh(l);break;case 22:f=l.stateNode,f._visibility&2&&(f._visibility&=-3,Zh(l));break;default:Zh(l)}o=o.sibling}}function FT(o,l){for(;Mr!==null;){var f=Mr;switch(f.tag){case 0:case 11:case 15:Bl(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,w=p.return;if(DT(p),p===f){Mr=null;break e}if(v!==null){v.return=w,Mr=v;break e}Mr=w}}}var Z_={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,Di=null,jl=!1,Xu=!1,Gv=!1,Gs=0,Kn=0,_l=0,Ka=0,Wv=0,Pi=0,Qu=0,If=null,vi=null,Kv=!1,Jh=0,$T=0,ep=1/0,tp=null,Hl=null,vr=0,Vl=null,Zu=null,Ws=0,Yv=0,Xv=null,UT=null,Df=0,Qv=null;function zi(){return(sn&2)!==0&&_t!==0?_t&-_t:j.T!==null?r0():jn()}function qT(){if(Pi===0)if((_t&536870912)===0||Ft){var o=Ut;Ut<<=1,(Ut&3932160)===0&&(Ut=262144),Pi=o}else Pi=536870912;return o=ki.current,o!==null&&(o.flags|=32),Pi}function bi(o,l,f){(o===En&&(dn===2||dn===9)||o.cancelPendingCommit!==null)&&(Ju(o,0),Fl(o,_t,Pi,!1)),kn(o,f),((sn&2)===0||o!==En)&&(o===En&&((sn&2)===0&&(Ka|=f),Kn===4&&Fl(o,_t,Pi,!1)),es(o))}function GT(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?nH(o,l):Jv(o,l,!0),w=p;do{if(v===0){Xu&&!p&&Fl(o,l,0,!1);break}else{if(f=o.current.alternate,w&&!eH(f)){v=Jv(o,l,!1),w=!1;continue}if(v===2){if(w=l,o.errorRecoveryDisabledLanes&w)var P=0;else P=o.pendingLanes&-536870913,P=P!==0?P:P&536870912?536870912:0;if(P!==0){l=P;e:{var V=o;v=If;var Q=V.current.memoizedState.isDehydrated;if(Q&&(Ju(V,P).flags|=256),P=Jv(V,P,!1),P!==2){if(Gv&&!Q){V.errorRecoveryDisabledLanes|=w,Ka|=w,v=4;break e}w=vi,vi=v,w!==null&&(vi===null?vi=w:vi.push.apply(vi,w))}v=P}if(w=!1,v!==2)continue}}if(v===1){Ju(o,0),Fl(o,l,0,!0);break}e:{switch(p=o,w=v,w){case 0:case 1:throw Error(r(345));case 4:if((l&4194048)!==l)break;case 6:Fl(p,l,Pi,!jl);break e;case 2:vi=null;break;case 3:case 5:break;default:throw Error(r(329))}if((l&62914560)===l&&(v=Jh+300-J(),10<v)){if(Fl(p,l,Pi,!jl),nt(p,0,!0)!==0)break e;Ws=l,p.timeoutHandle=CE(WT.bind(null,p,f,vi,tp,Kv,l,Pi,Ka,Qu,jl,w,"Throttled",-0,0),v);break e}WT(p,f,vi,tp,Kv,l,Pi,Ka,Qu,jl,w,null,-0,0)}}break}while(!0);es(o)}function WT(o,l,f,p,v,w,P,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},_T(l,w,Re);var Xe=(w&62914560)===w?Jh-J():(w&4194048)===w?$T-J():0;if(Xe=jH(Re,Xe),Xe!==null){Ws=w,o.cancelPendingCommit=Xe(tE.bind(null,o,l,w,f,p,v,P,V,Q,be,Re,null,fe,ge)),Fl(o,w,P,!ce);return}}tE(o,l,w,f,p,v,P,V,Q)}function eH(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],w=v.getSnapshot;v=v.value;try{if(!Ai(w(),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 Fl(o,l,f,p){l&=~Wv,l&=~Ka,o.suspendedLanes|=l,o.pingedLanes&=~l,p&&(o.warmLanes|=l),p=o.expirationTimes;for(var v=l;0<v;){var w=31-at(v),P=1<<w;p[w]=-1,v&=~P}f!==0&&Vr(o,f,l)}function np(){return(sn&6)===0?(Pf(0),!1):!0}function Zv(){if(Lt!==null){if(dn===0)var o=Lt.return;else o=Lt,Ls=_a=null,pv(o),$u=null,gf=0,o=Lt;for(;o!==null;)RT(o.alternate,o),o=o.return;Lt=null}}function Ju(o,l){var f=o.timeoutHandle;f!==-1&&(o.timeoutHandle=-1,xH(f)),f=o.cancelPendingCommit,f!==null&&(o.cancelPendingCommit=null,f()),Ws=0,Zv(),En=o,Lt=f=zs(o.current,null),_t=l,dn=0,Di=null,jl=!1,Xu=nn(o,l),Gv=!1,Qu=Pi=Wv=Ka=_l=Kn=0,vi=If=null,Kv=!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),w=1<<v;l|=o[v],p&=~w}return Gs=l,Ch(),f}function KT(o,l){Rt=null,j.H=Cf,l===Fu||l===Ih?(l=cR(),dn=3):l===nv?(l=cR(),dn=4):dn=l===kv?8:l!==null&&typeof l=="object"&&typeof l.then=="function"?6:1,Di=l,Lt===null&&(Kn=1,qh(o,Wi(l,o.current)))}function YT(){var o=ki.current;return o===null?!0:(_t&4194048)===_t?Qi===null:(_t&62914560)===_t||(_t&536870912)!==0?o===Qi:!1}function XT(){var o=j.H;return j.H=Cf,o===null?Cf:o}function QT(){var o=j.A;return j.A=Z_,o}function rp(){Kn=4,jl||(_t&4194048)!==_t&&ki.current!==null||(Xu=!0),(_l&134217727)===0&&(Ka&134217727)===0||En===null||Fl(En,_t,Pi,!1)}function Jv(o,l,f){var p=sn;sn|=2;var v=XT(),w=QT();(En!==o||_t!==l)&&(tp=null,Ju(o,l)),l=!1;var P=Kn;e:do try{if(dn!==0&&Lt!==null){var V=Lt,Q=Di;switch(dn){case 8:Zv(),P=6;break e;case 3:case 2:case 9:case 6:ki.current===null&&(l=!0);var ce=dn;if(dn=0,Di=null,ec(o,V,Q,ce),f&&Xu){P=0;break e}break;default:ce=dn,dn=0,Di=null,ec(o,V,Q,ce)}}tH(),P=Kn;break}catch(be){KT(o,be)}while(!0);return l&&o.shellSuspendCounter++,Ls=_a=null,sn=p,j.H=v,j.A=w,Lt===null&&(En=null,_t=0,Ch()),P}function tH(){for(;Lt!==null;)ZT(Lt)}function nH(o,l){var f=sn;sn|=2;var p=XT(),v=QT();En!==o||_t!==l?(tp=null,ep=J()+500,Ju(o,l)):Xu=nn(o,l);e:do try{if(dn!==0&&Lt!==null){l=Lt;var w=Di;t:switch(dn){case 1:dn=0,Di=null,ec(o,l,w,1);break;case 2:case 9:if(aR(w)){dn=0,Di=null,JT(l);break}l=function(){dn!==2&&dn!==9||En!==o||(dn=7),es(o)},w.then(l,l);break e;case 3:dn=7;break e;case 4:dn=5;break e;case 7:aR(w)?(dn=0,Di=null,JT(l)):(dn=0,Di=null,ec(o,l,w,7));break;case 5:var P=null;switch(Lt.tag){case 26:P=Lt.memoizedState;case 5:case 27:var V=Lt;if(P?jE(P):V.stateNode.complete){dn=0,Di=null;var Q=V.sibling;if(Q!==null)Lt=Q;else{var ce=V.return;ce!==null?(Lt=ce,ip(ce)):Lt=null}break t}}dn=0,Di=null,ec(o,l,w,5);break;case 6:dn=0,Di=null,ec(o,l,w,6);break;case 8:Zv(),Kn=6;break e;default:throw Error(r(462))}}rH();break}catch(be){KT(o,be)}while(!0);return Ls=_a=null,j.H=p,j.A=v,sn=f,Lt!==null?0:(En=null,_t=0,Ch(),Kn)}function rH(){for(;Lt!==null&&!ze();)ZT(Lt)}function ZT(o){var l=wT(o.alternate,o,Gs);o.memoizedProps=o.pendingProps,l===null?ip(o):Lt=l}function JT(o){var l=o,f=l.alternate;switch(l.tag){case 15:case 0:l=mT(f,l,l.pendingProps,l.type,void 0,_t);break;case 11:l=mT(f,l,l.pendingProps,l.type.render,l.ref,_t);break;case 5:pv(l);default:RT(f,l),l=Lt=QC(l,Gs),l=wT(f,l,Gs)}o.memoizedProps=o.pendingProps,l===null?ip(o):Lt=l}function ec(o,l,f,p){Ls=_a=null,pv(l),$u=null,gf=0;var v=l.return;try{if(q_(o,v,l,f,_t)){Kn=1,qh(o,Wi(f,o.current)),Lt=null;return}}catch(w){if(v!==null)throw Lt=v,w;Kn=1,qh(o,Wi(f,o.current)),Lt=null;return}l.flags&32768?(Ft||p===1?o=!0:Xu||(_t&536870912)!==0?o=!1:(jl=o=!0,(p===2||p===9||p===3||p===6)&&(p=ki.current,p!==null&&p.tag===13&&(p.flags|=16384))),eE(l,o)):ip(l)}function ip(o){var l=o;do{if((l.flags&32768)!==0){eE(l,jl);return}o=l.return;var f=K_(l.alternate,l,Gs);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 eE(o,l){do{var f=Y_(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 tE(o,l,f,p,v,w,P,V,Q){o.cancelPendingCommit=null;do op();while(vr!==0);if((sn&6)!==0)throw Error(r(327));if(l!==null){if(l===o.current)throw Error(r(177));if(w=l.lanes|l.childLanes,w|=Vy,Pt(o,f,w,P,V,Q),o===En&&(Lt=En=null,_t=0),Zu=l,Vl=o,Ws=f,Yv=w,Xv=v,UT=p,(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?(o.callbackNode=null,o.callbackPriority=0,lH(me,function(){return sE(),null})):(o.callbackNode=null,o.callbackPriority=0),p=(l.flags&13878)!==0,(l.subtreeFlags&13878)!==0||p){p=j.T,j.T=null,v=q.p,q.p=2,P=sn,sn|=4;try{X_(o,l,f)}finally{sn=P,q.p=v,j.T=p}}vr=1,nE(),rE(),iE()}}function nE(){if(vr===1){vr=0;var o=Vl,l=Zu,f=(l.flags&13878)!==0;if((l.subtreeFlags&13878)!==0||f){f=j.T,j.T=null;var p=q.p;q.p=2;var v=sn;sn|=4;try{LT(l,o);var w=f0,P=FC(o.containerInfo),V=w.focusedElem,Q=w.selectionRange;if(P!==V&&V&&V.ownerDocument&&VC(V.ownerDocument.documentElement,V)){if(Q!==null&&Ly(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&&(P=xn,xn=ut,ut=P);var re=HC(V,ut),te=HC(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}}yp=!!c0,f0=c0=null}finally{sn=v,q.p=p,j.T=f}}o.current=l,vr=2}}function rE(){if(vr===2){vr=0;var o=Vl,l=Zu,f=(l.flags&8772)!==0;if((l.subtreeFlags&8772)!==0||f){f=j.T,j.T=null;var p=q.p;q.p=2;var v=sn;sn|=4;try{IT(o,l.alternate,l)}finally{sn=v,q.p=p,j.T=f}}vr=3}}function iE(){if(vr===4||vr===3){vr=0,ne();var o=Vl,l=Zu,f=Ws,p=UT;(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?vr=5:(vr=0,Zu=Vl=null,oE(o,o.pendingLanes));var v=o.pendingLanes;if(v===0&&(Hl=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=j.T,v=q.p,q.p=2,j.T=null;try{for(var w=o.onRecoverableError,P=0;P<p.length;P++){var V=p[P];w(V.value,{componentStack:V.stack})}}finally{j.T=l,q.p=v}}(Ws&3)!==0&&op(),es(o),v=o.pendingLanes,(f&261930)!==0&&(v&42)!==0?o===Qv?Df++:(Df=0,Qv=o):Df=0,Pf(0)}}function oE(o,l){(o.pooledCacheLanes&=l)===0&&(l=o.pooledCache,l!=null&&(o.pooledCache=null,hf(l)))}function op(){return nE(),rE(),iE(),sE()}function sE(){if(vr!==5)return!1;var o=Vl,l=Yv;Yv=0;var f=qn(Ws),p=j.T,v=q.p;try{q.p=32>f?32:f,j.T=null,f=Xv,Xv=null;var w=Vl,P=Ws;if(vr=0,Zu=Vl=null,Ws=0,(sn&6)!==0)throw Error(r(331));var V=sn;if(sn|=4,VT(w.current),jT(w,w.current,P,f),sn=V,Pf(0,!1),Ct&&typeof Ct.onPostCommitFiberRoot=="function")try{Ct.onPostCommitFiberRoot(st,w)}catch{}return!0}finally{q.p=v,j.T=p,oE(o,l)}}function lE(o,l,f){l=Wi(f,l),l=Ov(o.stateNode,l,2),o=zl(o,l,2),o!==null&&(kn(o,2),es(o))}function hn(o,l,f){if(o.tag===3)lE(o,o,f);else for(;l!==null;){if(l.tag===3){lE(l,o,f);break}else if(l.tag===1){var p=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof p.componentDidCatch=="function"&&(Hl===null||!Hl.has(p))){o=Wi(f,o),f=aT(2),p=zl(l,f,2),p!==null&&(uT(f,p,l,o),kn(p,2),es(p));break}}l=l.return}}function e0(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)||(Gv=!0,v.add(f),o=iH.bind(null,o,l,f),l.then(o,o))}function iH(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()-Jh?(sn&2)===0&&Ju(o,0):Wv|=f,Qu===_t&&(Qu=0)),es(o)}function aE(o,l){l===0&&(l=Fn()),o=La(o,l),o!==null&&(kn(o,l),es(o))}function oH(o){var l=o.memoizedState,f=0;l!==null&&(f=l.retryLane),aE(o,f)}function sH(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),aE(o,f)}function lH(o,l){return oe(o,l)}var sp=null,tc=null,t0=!1,lp=!1,n0=!1,$l=0;function es(o){o!==tc&&o.next===null&&(tc===null?sp=tc=o:tc=tc.next=o),lp=!0,t0||(t0=!0,uH())}function Pf(o,l){if(!n0&&lp){n0=!0;do for(var f=!1,p=sp;p!==null;){if(o!==0){var v=p.pendingLanes;if(v===0)var w=0;else{var P=p.suspendedLanes,V=p.pingedLanes;w=(1<<31-at(42|o)+1)-1,w&=v&~(P&~V),w=w&201326741?w&201326741|1:w?w|2:0}w!==0&&(f=!0,dE(p,w))}else w=_t,w=nt(p,p===En?w:0,p.cancelPendingCommit!==null||p.timeoutHandle!==-1),(w&3)===0||nn(p,w)||(f=!0,dE(p,w));p=p.next}while(f);n0=!1}}function aH(){uE()}function uE(){lp=t0=!1;var o=0;$l!==0&&bH()&&(o=$l);for(var l=J(),f=null,p=sp;p!==null;){var v=p.next,w=cE(p,l);w===0?(p.next=null,f===null?sp=v:f.next=v,v===null&&(tc=f)):(f=p,(o!==0||(w&3)!==0)&&(lp=!0)),p=v}vr!==0&&vr!==5||Pf(o),$l!==0&&($l=0)}function cE(o,l){for(var f=o.suspendedLanes,p=o.pingedLanes,v=o.expirationTimes,w=o.pendingLanes&-62914561;0<w;){var P=31-at(w),V=1<<P,Q=v[P];Q===-1?((V&f)===0||(V&p)!==0)&&(v[P]=Vn(V,l)):Q<=l&&(o.expiredLanes|=V),w&=~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=fE.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 fE(o,l){if(vr!==0&&vr!==5)return o.callbackNode=null,o.callbackPriority=0,null;var f=o.callbackNode;if(op()&&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:(GT(o,p,l),cE(o,J()),o.callbackNode!=null&&o.callbackNode===f?fE.bind(null,o):null)}function dE(o,l){if(op())return null;GT(o,l,!0)}function uH(){SH(function(){(sn&6)!==0?oe(we,aH):uE()})}function r0(){if($l===0){var o=Hu;o===0&&(o=Vt,Vt<<=1,(Vt&261888)===0&&(Vt=256)),$l=o}return $l}function hE(o){return o==null||typeof o=="symbol"||typeof o=="boolean"?null:typeof o=="function"?o:wo(""+o)}function pE(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 cH(o,l,f,p,v){if(l==="submit"&&f&&f.stateNode===v){var w=hE((v[Nt]||null).action),P=p.submitter;P&&(l=(l=P[Nt]||null)?hE(l.formAction):P.getAttribute("formAction"),l!==null&&(w=l,P=null));var V=new ku("action","action",null,p,v);o.push({event:V,listeners:[{instance:null,listener:function(){if(p.defaultPrevented){if($l!==0){var Q=P?pE(v,P):new FormData(v);Cv(f,{pending:!0,data:Q,method:v.method,action:w},null,Q)}}else typeof w=="function"&&(V.preventDefault(),Q=P?pE(v,P):new FormData(v),Cv(f,{pending:!0,data:Q,method:v.method,action:w},w,Q))},currentTarget:v}]})}}for(var i0=0;i0<Hy.length;i0++){var o0=Hy[i0],fH=o0.toLowerCase(),dH=o0[0].toUpperCase()+o0.slice(1);To(fH,"on"+dH)}To(qC,"onAnimationEnd"),To(GC,"onAnimationIteration"),To(WC,"onAnimationStart"),To("dblclick","onDoubleClick"),To("focusin","onFocus"),To("focusout","onBlur"),To(A_,"onTransitionRun"),To(O_,"onTransitionStart"),To(k_,"onTransitionCancel"),To(KC,"onTransitionEnd"),xo("onMouseEnter",["mouseout","mouseover"]),xo("onMouseLeave",["mouseout","mouseover"]),xo("onPointerEnter",["pointerout","pointerover"]),xo("onPointerLeave",["pointerout","pointerover"]),$i("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),$i("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),$i("onBeforeInput",["compositionend","keypress","textInput","paste"]),$i("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),$i("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),$i("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(" "),hH=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(zf));function gE(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 w=void 0;if(l)for(var P=p.length-1;0<=P;P--){var V=p[P],Q=V.instance,ce=V.currentTarget;if(V=V.listener,Q!==w&&v.isPropagationStopped())break e;w=V,v.currentTarget=ce;try{w(v)}catch(be){wh(be)}v.currentTarget=null,w=Q}else for(P=0;P<p.length;P++){if(V=p[P],Q=V.instance,ce=V.currentTarget,V=V.listener,Q!==w&&v.isPropagationStopped())break e;w=V,v.currentTarget=ce;try{w(v)}catch(be){wh(be)}v.currentTarget=null,w=Q}}}}function Bt(o,l){var f=l[Er];f===void 0&&(f=l[Er]=new Set);var p=o+"__bubble";f.has(p)||(mE(l,o,2,!1),f.add(p))}function s0(o,l,f){var p=0;l&&(p|=4),mE(f,o,p,l)}var ap="_reactListening"+Math.random().toString(36).slice(2);function l0(o){if(!o[ap]){o[ap]=!0,ur.forEach(function(f){f!=="selectionchange"&&(hH.has(f)||s0(f,!1,o),s0(f,!0,o))});var l=o.nodeType===9?o:o.ownerDocument;l===null||l[ap]||(l[ap]=!0,s0("selectionchange",!1,l))}}function mE(o,l,f,p){switch(qE(l)){case 2:var v=VH;break;case 8:v=FH;break;default:v=w0}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 a0(o,l,f,p,v){var w=p;if((l&1)===0&&(l&2)===0&&p!==null)e:for(;;){if(p===null)return;var P=p.tag;if(P===3||P===4){var V=p.stateNode.containerInfo;if(V===v)break;if(P===4)for(P=p.return;P!==null;){var Q=P.tag;if((Q===3||Q===4)&&P.stateNode.containerInfo===v)return;P=P.return}for(;V!==null;){if(P=Jn(V),P===null)return;if(Q=P.tag,Q===5||Q===6||Q===26||Q===27){p=w=P;continue e}V=V.parentNode}}p=p.return}El(function(){var ce=w,be=Rl(f),Re=[];e:{var fe=YC.get(o);if(fe!==void 0){var ge=ku,Xe=o;switch(o){case"keypress":if(qr(f)===0)break e;case"keydown":case"keyup":ge=s_;break;case"focusin":Xe="focus",ge=Iy;break;case"focusout":Xe="blur",ge=Iy;break;case"beforeblur":case"afterblur":ge=Iy;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=RC;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ge=Kj;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ge=u_;break;case qC:case GC:case WC:ge=Qj;break;case KC:ge=f_;break;case"scroll":case"scrollend":ge=Gj;break;case"wheel":ge=h_;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=EC;break;case"toggle":case"beforetoggle":ge=g_}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!==Cl&&(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=RC,Ce="onMouseLeave",re="onMouseEnter",te="mouse",(o==="pointerout"||o==="pointerover")&&(ut=EC,Ce="onPointerLeave",re="onPointerEnter",te="pointer"),xn=ge==null?fe:di(ge),ue=Xe==null?fe:di(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=pH,re=ge,te=Xe,ue=0,Ce=re;Ce;Ce=ut(Ce))ue++;Ce=0;for(var ot=te;ot;ot=ut(ot))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&&yE(Re,fe,ge,ut,!1),Xe!==null&&xn!==null&&yE(Re,xn,Xe,ut,!0)}}e:{if(fe=ce?di(ce):window,ge=fe.nodeName&&fe.nodeName.toLowerCase(),ge==="select"||ge==="input"&&fe.type==="file")var Qt=zC;else if(DC(fe))if(NC)Qt=T_;else{Qt=C_;var Je=w_}else ge=fe.nodeName,!ge||ge.toLowerCase()!=="input"||fe.type!=="checkbox"&&fe.type!=="radio"?ce&&Ei(ce.elementType)&&(Qt=zC):Qt=R_;if(Qt&&(Qt=Qt(o,ce))){PC(Re,Qt,f,be);break e}Je&&Je(o,fe,ce),o==="focusout"&&ce&&fe.type==="number"&&ce.memoizedProps.value!=null&&Is(fe,"number",fe.value)}switch(Je=ce?di(ce):window,o){case"focusin":(DC(Je)||Je.contentEditable==="true")&&(Du=Je,By=ce,cf=null);break;case"focusout":cf=By=Du=null;break;case"mousedown":jy=!0;break;case"contextmenu":case"mouseup":case"dragend":jy=!1,$C(Re,f,be);break;case"selectionchange":if(M_)break;case"keydown":case"keyup":$C(Re,f,be)}var Et;if(Py)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 Iu?kC(o,f)&&(Ht="onCompositionEnd"):o==="keydown"&&f.keyCode===229&&(Ht="onCompositionStart");Ht&&(MC&&f.locale!=="ko"&&(Iu||Ht!=="onCompositionStart"?Ht==="onCompositionEnd"&&Iu&&(Et=Or()):(on=be,er="value"in on?on.value:on.textContent,Iu=!0)),Je=up(ce,Ht),0<Je.length&&(Ht=new TC(Ht,o,null,f,be),Re.push({event:Ht,listeners:Je}),Et?Ht.data=Et:(Et=IC(f),Et!==null&&(Ht.data=Et)))),(Et=y_?v_(o,f):b_(o,f))&&(Ht=up(ce,"onBeforeInput"),0<Ht.length&&(Je=new TC("onBeforeInput","beforeinput",null,f,be),Re.push({event:Je,listeners:Ht}),Je.data=Et)),cH(Re,o,ce,f,be)}gE(Re,l)})}function Nf(o,l,f){return{instance:o,listener:l,currentTarget:f}}function up(o,l){for(var f=l+"Capture",p=[];o!==null;){var v=o,w=v.stateNode;if(v=v.tag,v!==5&&v!==26&&v!==27||w===null||(v=je(o,f),v!=null&&p.unshift(Nf(o,v,w)),v=je(o,l),v!=null&&p.push(Nf(o,v,w))),o.tag===3)return p;o=o.return}return[]}function pH(o){if(o===null)return null;do o=o.return;while(o&&o.tag!==5&&o.tag!==27);return o||null}function yE(o,l,f,p,v){for(var w=l._reactName,P=[];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,w),ce!=null&&P.unshift(Nf(f,ce,Q))):v||(ce=je(f,w),ce!=null&&P.push(Nf(f,ce,Q)))),f=f.return}P.length!==0&&o.push({event:l,listeners:P})}var gH=/\r\n?/g,mH=/\u0000|\uFFFD/g;function vE(o){return(typeof o=="string"?o:""+o).replace(gH,`
12
+ `).replace(mH,"")}function bE(o,l){return l=vE(l),vE(o)===l}function bn(o,l,f,p,v,w){switch(f){case"children":typeof p=="string"?l==="body"||l==="textarea"&&p===""||qi(o,p):(typeof p=="number"||typeof p=="bigint")&&l!=="body"&&qi(o,""+p);break;case"className":Os(o,"class",p);break;case"tabIndex":Os(o,"tabindex",p);break;case"dir":case"role":case"viewBox":case"width":case"height":Os(o,f,p);break;case"style":Yo(o,p,w);break;case"data":if(l!=="object"){Os(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 w=="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=Sl.get(f)||f,So(o,f,p))}}function u0(o,l,f,p,v,w){switch(f){case"style":Yo(o,p,w);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"?qi(o,p):(typeof p=="number"||typeof p=="bigint")&&qi(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(!Fr.hasOwnProperty(f))e:{if(f[0]==="o"&&f[1]==="n"&&(v=f.endsWith("Capture"),l=f.slice(2,v?f.length-7:void 0),w=o[Nt]||null,w=w!=null?w[f]:null,typeof w=="function"&&o.removeEventListener(l,w,v),typeof p=="function")){typeof w!="function"&&w!==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,w;for(w in f)if(f.hasOwnProperty(w)){var P=f[w];if(P!=null)switch(w){case"src":p=!0;break;case"srcSet":v=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,l));default:bn(o,l,w,P,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=w=P=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":P=be;break;case"checked":Q=be;break;case"defaultChecked":ce=be;break;case"value":w=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)}}Pa(o,w,V,Q,ce,P,v,!1);return;case"select":Bt("invalid",o),p=P=w=null;for(v in f)if(f.hasOwnProperty(v)&&(V=f[v],V!=null))switch(v){case"value":w=V;break;case"defaultValue":P=V;break;case"multiple":p=V;default:bn(o,l,v,V,f,null)}l=w,f=P,o.multiple=!!p,l!=null?pi(o,!!p,l,!1):f!=null&&pi(o,!!p,f,!0);return;case"textarea":Bt("invalid",o),w=v=p=null;for(P in f)if(f.hasOwnProperty(P)&&(V=f[P],V!=null))switch(P){case"value":p=V;break;case"defaultValue":v=V;break;case"children":w=V;break;case"dangerouslySetInnerHTML":if(V!=null)throw Error(r(91));break;default:bn(o,l,P,V,f,null)}Ko(o,p,v,w);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(Ei(l)){for(be in f)f.hasOwnProperty(be)&&(p=f[be],p!==void 0&&u0(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 yH(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,w=null,P=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":w=ge;break;case"name":v=ge;break;case"checked":ce=ge;break;case"defaultChecked":be=ge;break;case"value":P=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)}}vl(o,P,V,Q,ce,be,w,v);return;case"select":ge=P=V=fe=null;for(w in f)if(Q=f[w],f.hasOwnProperty(w)&&Q!=null)switch(w){case"value":break;case"multiple":ge=Q;default:p.hasOwnProperty(w)||bn(o,l,w,null,p,Q)}for(v in p)if(w=p[v],Q=f[v],p.hasOwnProperty(v)&&(w!=null||Q!=null))switch(v){case"value":fe=w;break;case"defaultValue":V=w;break;case"multiple":P=w;default:w!==Q&&bn(o,l,v,w,p,Q)}l=V,f=P,p=ge,fe!=null?pi(o,!!f,fe,!1):!!p!=!!f&&(l!=null?pi(o,!!f,l,!0):pi(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(P in p)if(v=p[P],w=f[P],p.hasOwnProperty(P)&&(v!=null||w!=null))switch(P){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!==w&&bn(o,l,P,v,p,w)}bl(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(Ei(l)){for(var xn in f)fe=f[xn],f.hasOwnProperty(xn)&&fe!==void 0&&!p.hasOwnProperty(xn)&&u0(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||u0(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 xE(o){switch(o){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function vH(){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],w=v.transferSize,P=v.initiatorType,V=v.duration;if(w&&V&&xE(P)){for(P=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&&xE(Re)&&(Q=Q.responseEnd,P+=be*(Q<V?1:(V-ce)/(Q-ce)))}if(--p,l+=8*(w+P)/(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 c0=null,f0=null;function cp(o){return o.nodeType===9?o:o.ownerDocument}function SE(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 wE(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 d0(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 h0=null;function bH(){var o=window.event;return o&&o.type==="popstate"?o===h0?!1:(h0=o,!0):(h0=null,!1)}var CE=typeof setTimeout=="function"?setTimeout:void 0,xH=typeof clearTimeout=="function"?clearTimeout:void 0,RE=typeof Promise=="function"?Promise:void 0,SH=typeof queueMicrotask=="function"?queueMicrotask:typeof RE<"u"?function(o){return RE.resolve(null).then(o).catch(wH)}:CE;function wH(o){setTimeout(function(){throw o})}function Ul(o){return o==="head"}function TE(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),oc(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 w=f.firstChild;w;){var P=w.nextSibling,V=w.nodeName;w[qe]||V==="SCRIPT"||V==="STYLE"||V==="LINK"&&w.rel.toLowerCase()==="stylesheet"||f.removeChild(w),w=P}}else f==="body"&&Lf(o.ownerDocument.body);f=v}while(f);oc(l)}function EE(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 p0(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":p0(f),Oa(f);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(f.rel.toLowerCase()==="stylesheet")continue}o.removeChild(f)}}function CH(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(w=o.getAttribute("rel"),w==="stylesheet"&&o.hasAttribute("data-precedence"))break;if(w!==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(w=o.getAttribute("src"),(w!==(v.src==null?null:v.src)||o.getAttribute("type")!==(v.type==null?null:v.type)||o.getAttribute("crossorigin")!==(v.crossOrigin==null?null:v.crossOrigin))&&w&&o.hasAttribute("async")&&!o.hasAttribute("itemprop"))break;return o;default:return o}}else if(l==="input"&&o.type==="hidden"){var w=v.name==null?null:""+v.name;if(v.type==="hidden"&&o.getAttribute("name")===w)return o}else return o;if(o=Zi(o.nextSibling),o===null)break}return null}function RH(o,l,f){if(l==="")return null;for(;o.nodeType!==3;)if((o.nodeType!==1||o.nodeName!=="INPUT"||o.type!=="hidden")&&!f||(o=Zi(o.nextSibling),o===null))return null;return o}function ME(o,l){for(;o.nodeType!==8;)if((o.nodeType!==1||o.nodeName!=="INPUT"||o.type!=="hidden")&&!l||(o=Zi(o.nextSibling),o===null))return null;return o}function g0(o){return o.data==="$?"||o.data==="$~"}function m0(o){return o.data==="$!"||o.data==="$?"&&o.ownerDocument.readyState!=="loading"}function TH(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 Zi(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 y0=null;function AE(o){o=o.nextSibling;for(var l=0;o;){if(o.nodeType===8){var f=o.data;if(f==="/$"||f==="/&"){if(l===0)return Zi(o.nextSibling);l--}else f!=="$"&&f!=="$!"&&f!=="$?"&&f!=="$~"&&f!=="&"||l++}o=o.nextSibling}return null}function OE(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 kE(o,l,f){switch(l=cp(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]);Oa(o)}var Ji=new Map,IE=new Set;function fp(o){return typeof o.getRootNode=="function"?o.getRootNode():o.nodeType===9?o:o.ownerDocument}var Ks=q.d;q.d={f:EH,r:MH,D:AH,C:OH,L:kH,m:IH,X:PH,S:DH,M:zH};function EH(){var o=Ks.f(),l=np();return o||l}function MH(o){var l=Fi(o);l!==null&&l.tag===5&&l.type==="form"?KR(l):Ks.r(o)}var nc=typeof document>"u"?null:document;function DE(o,l,f){var p=nc;if(p&&typeof l=="string"&&l){var v=cr(l);v='link[rel="'+o+'"][href="'+v+'"]',typeof f=="string"&&(v+='[crossorigin="'+f+'"]'),IE.has(v)||(IE.add(v),o={rel:o,crossOrigin:f,href:l},p.querySelector(v)===null&&(l=p.createElement("link"),Pr(l,"link",o),$n(l),p.head.appendChild(l)))}}function AH(o){Ks.D(o),DE("dns-prefetch",o,null)}function OH(o,l){Ks.C(o,l),DE("preconnect",o,l)}function kH(o,l,f){Ks.L(o,l,f);var p=nc;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 w=v;switch(l){case"style":w=rc(o);break;case"script":w=ic(o)}Ji.has(w)||(o=g({rel:"preload",href:l==="image"&&f&&f.imageSrcSet?void 0:o,as:l},f),Ji.set(w,o),p.querySelector(v)!==null||l==="style"&&p.querySelector(Bf(w))||l==="script"&&p.querySelector(jf(w))||(l=p.createElement("link"),Pr(l,"link",o),$n(l),p.head.appendChild(l)))}}function IH(o,l){Ks.m(o,l);var f=nc;if(f&&o){var p=l&&typeof l.as=="string"?l.as:"script",v='link[rel="modulepreload"][as="'+cr(p)+'"][href="'+cr(o)+'"]',w=v;switch(p){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":w=ic(o)}if(!Ji.has(w)&&(o=g({rel:"modulepreload",href:o},l),Ji.set(w,o),f.querySelector(v)===null)){switch(p){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(f.querySelector(jf(w)))return}p=f.createElement("link"),Pr(p,"link",o),$n(p),f.head.appendChild(p)}}}function DH(o,l,f){Ks.S(o,l,f);var p=nc;if(p&&o){var v=hi(p).hoistableStyles,w=rc(o);l=l||"default";var P=v.get(w);if(!P){var V={loading:0,preload:null};if(P=p.querySelector(Bf(w)))V.loading=5;else{o=g({rel:"stylesheet",href:o,"data-precedence":l},f),(f=Ji.get(w))&&v0(o,f);var Q=P=p.createElement("link");$n(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,dp(P,l,p)}P={type:"stylesheet",instance:P,count:1,state:V},v.set(w,P)}}}function PH(o,l){Ks.X(o,l);var f=nc;if(f&&o){var p=hi(f).hoistableScripts,v=ic(o),w=p.get(v);w||(w=f.querySelector(jf(v)),w||(o=g({src:o,async:!0},l),(l=Ji.get(v))&&b0(o,l),w=f.createElement("script"),$n(w),Pr(w,"link",o),f.head.appendChild(w)),w={type:"script",instance:w,count:1,state:null},p.set(v,w))}}function zH(o,l){Ks.M(o,l);var f=nc;if(f&&o){var p=hi(f).hoistableScripts,v=ic(o),w=p.get(v);w||(w=f.querySelector(jf(v)),w||(o=g({src:o,async:!0,type:"module"},l),(l=Ji.get(v))&&b0(o,l),w=f.createElement("script"),$n(w),Pr(w,"link",o),f.head.appendChild(w)),w={type:"script",instance:w,count:1,state:null},p.set(v,w))}}function PE(o,l,f,p){var v=(v=ee.current)?fp(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=rc(f.href),f=hi(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=rc(f.href);var w=hi(v).hoistableStyles,P=w.get(o);if(P||(v=v.ownerDocument||v,P={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},w.set(o,P),(w=v.querySelector(Bf(o)))&&!w._p&&(P.instance=w,P.state.loading=5),Ji.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},Ji.set(o,f),w||NH(v,o,f,P.state))),l&&p===null)throw Error(r(528,""));return P}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=ic(f),f=hi(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 rc(o){return'href="'+cr(o)+'"'}function Bf(o){return'link[rel="stylesheet"]['+o+"]"}function zE(o){return g({},o,{"data-precedence":o.precedence,precedence:null})}function NH(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),$n(l),o.head.appendChild(l))}function ic(o){return'[src="'+cr(o)+'"]'}function jf(o){return"script[async]"+o}function NE(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,$n(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"),$n(p),Pr(p,"style",v),dp(p,f.precedence,o),l.instance=p;case"stylesheet":v=rc(f.href);var w=o.querySelector(Bf(v));if(w)return l.state.loading|=4,l.instance=w,$n(w),w;p=zE(f),(v=Ji.get(v))&&v0(p,v),w=(o.ownerDocument||o).createElement("link"),$n(w);var P=w;return P._p=new Promise(function(V,Q){P.onload=V,P.onerror=Q}),Pr(w,"link",p),l.state.loading|=4,dp(w,f.precedence,o),l.instance=w;case"script":return w=ic(f.src),(v=o.querySelector(jf(w)))?(l.instance=v,$n(v),v):(p=f,(v=Ji.get(w))&&(p=g({},f),b0(p,v)),o=o.ownerDocument||o,v=o.createElement("script"),$n(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,dp(p,f.precedence,o));return l.instance}function dp(o,l,f){for(var p=f.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),v=p.length?p[p.length-1]:null,w=v,P=0;P<p.length;P++){var V=p[P];if(V.dataset.precedence===l)w=V;else if(w!==v)break}w?w.parentNode.insertBefore(o,w.nextSibling):(l=f.nodeType===9?f.head:f,l.insertBefore(o,l.firstChild))}function v0(o,l){o.crossOrigin==null&&(o.crossOrigin=l.crossOrigin),o.referrerPolicy==null&&(o.referrerPolicy=l.referrerPolicy),o.title==null&&(o.title=l.title)}function b0(o,l){o.crossOrigin==null&&(o.crossOrigin=l.crossOrigin),o.referrerPolicy==null&&(o.referrerPolicy=l.referrerPolicy),o.integrity==null&&(o.integrity=l.integrity)}var hp=null;function LE(o,l,f){if(hp===null){var p=new Map,v=hp=new Map;v.set(f,p)}else v=hp,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 w=f[v];if(!(w[qe]||w[zt]||o==="link"&&w.getAttribute("rel")==="stylesheet")&&w.namespaceURI!=="http://www.w3.org/2000/svg"){var P=w.getAttribute(l)||"";P=o+P;var V=p.get(P);V?V.push(w):p.set(P,[w])}}return p}function BE(o,l,f){o=o.ownerDocument||o,o.head.insertBefore(f,l==="title"?o.querySelector("head > title"):null)}function LH(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 jE(o){return!(o.type==="stylesheet"&&(o.state.loading&3)===0)}function BH(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=rc(p.href),w=l.querySelector(Bf(v));if(w){l=w._p,l!==null&&typeof l=="object"&&typeof l.then=="function"&&(o.count++,o=pp.bind(o),l.then(o,o)),f.state.loading|=4,f.instance=w,$n(w);return}w=l.ownerDocument||l,p=zE(p),(v=Ji.get(v))&&v0(p,v),w=w.createElement("link"),$n(w);var P=w;P._p=new Promise(function(V,Q){P.onload=V,P.onerror=Q}),Pr(w,"link",p),f.instance=w}o.stylesheets===null&&(o.stylesheets=new Map),o.stylesheets.set(f,l),(l=f.state.preload)&&(f.state.loading&3)===0&&(o.count++,f=pp.bind(o),l.addEventListener("load",f),l.addEventListener("error",f))}}var x0=0;function jH(o,l){return o.stylesheets&&o.count===0&&mp(o,o.stylesheets),0<o.count||0<o.imgCount?function(f){var p=setTimeout(function(){if(o.stylesheets&&mp(o,o.stylesheets),o.unsuspend){var w=o.unsuspend;o.unsuspend=null,w()}},6e4+l);0<o.imgBytes&&x0===0&&(x0=62500*vH());var v=setTimeout(function(){if(o.waitingForImages=!1,o.count===0&&(o.stylesheets&&mp(o,o.stylesheets),o.unsuspend)){var w=o.unsuspend;o.unsuspend=null,w()}},(o.imgBytes>x0?50:800)+l);return o.unsuspend=f,function(){o.unsuspend=null,clearTimeout(p),clearTimeout(v)}}:null}function pp(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)mp(this,this.stylesheets);else if(this.unsuspend){var o=this.unsuspend;this.unsuspend=null,o()}}}var gp=null;function mp(o,l){o.stylesheets=null,o.unsuspend!==null&&(o.count++,gp=new Map,l.forEach(_H,o),gp=null,pp.call(o))}function _H(o,l){if(!(l.state.loading&4)){var f=gp.get(o);if(f)var p=f.get(null);else{f=new Map,gp.set(o,f);for(var v=o.querySelectorAll("link[data-precedence],style[data-precedence]"),w=0;w<v.length;w++){var P=v[w];(P.nodeName==="LINK"||P.getAttribute("media")!=="not all")&&(f.set(P.dataset.precedence,P),p=P)}p&&f.set(null,p)}v=l.instance,P=v.getAttribute("data-precedence"),w=f.get(P)||p,w===p&&f.set(null,v),f.set(P,v),this.count++,p=pp.bind(this),v.addEventListener("load",p),v.addEventListener("error",p),w?w.parentNode.insertBefore(v,w.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:$,_currentValue2:$,_threadCount:0};function HH(o,l,f,p,v,w,P,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=w,this.onRecoverableError=P,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=Q,this.incompleteTransitions=new Map}function _E(o,l,f,p,v,w,P,V,Q,ce,be,Re){return o=new HH(o,l,f,P,Q,ce,be,Re,V),l=1,w===!0&&(l|=24),w=Oi(3,null,null,l),o.current=w,w.stateNode=o,l=Jy(),l.refCount++,o.pooledCache=l,l.refCount++,w.memoizedState={element:p,isDehydrated:f,cache:l},rv(w),o}function HE(o){return o?(o=Nu,o):Nu}function VE(o,l,f,p,v,w){v=HE(v),p.context===null?p.context=v:p.pendingContext=v,p=Pl(l),p.payload={element:f},w=w===void 0?null:w,w!==null&&(p.callback=w),f=zl(o,p,l),f!==null&&(bi(f,o,l),yf(f,o,l))}function FE(o,l){if(o=o.memoizedState,o!==null&&o.dehydrated!==null){var f=o.retryLane;o.retryLane=f!==0&&f<l?f:l}}function S0(o,l){FE(o,l),(o=o.alternate)&&FE(o,l)}function $E(o){if(o.tag===13||o.tag===31){var l=La(o,67108864);l!==null&&bi(l,o,67108864),S0(o,67108864)}}function UE(o){if(o.tag===13||o.tag===31){var l=zi();l=qt(l);var f=La(o,l);f!==null&&bi(f,o,l),S0(o,l)}}var yp=!0;function VH(o,l,f,p){var v=j.T;j.T=null;var w=q.p;try{q.p=2,w0(o,l,f,p)}finally{q.p=w,j.T=v}}function FH(o,l,f,p){var v=j.T;j.T=null;var w=q.p;try{q.p=8,w0(o,l,f,p)}finally{q.p=w,j.T=v}}function w0(o,l,f,p){if(yp){var v=C0(p);if(v===null)a0(o,l,p,vp,f),GE(o,p);else if(UH(v,o,l,f,p))p.stopPropagation();else if(GE(o,p),l&4&&-1<$H.indexOf(o)){for(;v!==null;){var w=Fi(v);if(w!==null)switch(w.tag){case 3:if(w=w.stateNode,w.current.memoizedState.isDehydrated){var P=gt(w.pendingLanes);if(P!==0){var V=w;for(V.pendingLanes|=2,V.entangledLanes|=2;P;){var Q=1<<31-at(P);V.entanglements[1]|=Q,P&=~Q}es(w),(sn&6)===0&&(ep=J()+500,Pf(0))}}break;case 31:case 13:V=La(w,2),V!==null&&bi(V,w,2),np(),S0(w,2)}if(w=C0(p),w===null&&a0(o,l,p,vp,f),w===v)break;v=w}v!==null&&p.stopPropagation()}else a0(o,l,p,null,f)}}function C0(o){return o=Rl(o),R0(o)}var vp=null;function R0(o){if(vp=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 vp=o,null}function qE(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 T0=!1,ql=null,Gl=null,Wl=null,Hf=new Map,Vf=new Map,Kl=[],$H="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 GE(o,l){switch(o){case"focusin":case"focusout":ql=null;break;case"dragenter":case"dragleave":Gl=null;break;case"mouseover":case"mouseout":Wl=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,w){return o===null||o.nativeEvent!==w?(o={blockedOn:l,domEventName:f,eventSystemFlags:p,nativeEvent:w,targetContainers:[v]},l!==null&&(l=Fi(l),l!==null&&$E(l)),o):(o.eventSystemFlags|=p,l=o.targetContainers,v!==null&&l.indexOf(v)===-1&&l.push(v),o)}function UH(o,l,f,p,v){switch(l){case"focusin":return ql=Ff(ql,o,l,f,p,v),!0;case"dragenter":return Gl=Ff(Gl,o,l,f,p,v),!0;case"mouseover":return Wl=Ff(Wl,o,l,f,p,v),!0;case"pointerover":var w=v.pointerId;return Hf.set(w,Ff(Hf.get(w)||null,o,l,f,p,v)),!0;case"gotpointercapture":return w=v.pointerId,Vf.set(w,Ff(Vf.get(w)||null,o,l,f,p,v)),!0}return!1}function WE(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(){UE(f)});return}}else if(l===31){if(l=u(f),l!==null){o.blockedOn=l,Tr(o.priority,function(){UE(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 bp(o){if(o.blockedOn!==null)return!1;for(var l=o.targetContainers;0<l.length;){var f=C0(o.nativeEvent);if(f===null){f=o.nativeEvent;var p=new f.constructor(f.type,f);Cl=p,f.target.dispatchEvent(p),Cl=null}else return l=Fi(f),l!==null&&$E(l),o.blockedOn=f,!1;l.shift()}return!0}function KE(o,l,f){bp(o)&&f.delete(l)}function qH(){T0=!1,ql!==null&&bp(ql)&&(ql=null),Gl!==null&&bp(Gl)&&(Gl=null),Wl!==null&&bp(Wl)&&(Wl=null),Hf.forEach(KE),Vf.forEach(KE)}function xp(o,l){o.blockedOn===l&&(o.blockedOn=null,T0||(T0=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,qH)))}var Sp=null;function YE(o){Sp!==o&&(Sp=o,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Sp===o&&(Sp=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(R0(p||f)===null)continue;break}var w=Fi(f);w!==null&&(o.splice(l,3),l-=3,Cv(w,{pending:!0,data:v,method:f.method,action:p},p,v))}}))}function oc(o){function l(Q){return xp(Q,o)}ql!==null&&xp(ql,o),Gl!==null&&xp(Gl,o),Wl!==null&&xp(Wl,o),Hf.forEach(l),Vf.forEach(l);for(var f=0;f<Kl.length;f++){var p=Kl[f];p.blockedOn===o&&(p.blockedOn=null)}for(;0<Kl.length&&(f=Kl[0],f.blockedOn===null);)WE(f),f.blockedOn===null&&Kl.shift();if(f=(o.ownerDocument||o).$$reactFormReplay,f!=null)for(p=0;p<f.length;p+=3){var v=f[p],w=f[p+1],P=v[Nt]||null;if(typeof w=="function")P||YE(f);else if(P){var V=null;if(w&&w.hasAttribute("formAction")){if(v=w,P=w[Nt]||null)V=P.formAction;else if(R0(v)!==null)continue}else V=P.action;typeof V=="function"?f[p+1]=V:(f.splice(p,3),p-=3),YE(f)}}}function XE(){function o(w){w.canIntercept&&w.info==="react-transition"&&w.intercept({handler:function(){return new Promise(function(P){return v=P})},focusReset:"manual",scroll:"manual"})}function l(){v!==null&&(v(),v=null),p||setTimeout(f,20)}function f(){if(!p&&!navigation.transition){var w=navigation.currentEntry;w&&w.url!=null&&navigation.navigate(w.url,{state:w.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 E0(o){this._internalRoot=o}wp.prototype.render=E0.prototype.render=function(o){var l=this._internalRoot;if(l===null)throw Error(r(409));var f=l.current,p=zi();VE(f,p,o,l,null,null)},wp.prototype.unmount=E0.prototype.unmount=function(){var o=this._internalRoot;if(o!==null){this._internalRoot=null;var l=o.containerInfo;VE(o.current,2,null,o,null,null),np(),l[et]=null}};function wp(o){this._internalRoot=o}wp.prototype.unstable_scheduleHydration=function(o){if(o){var l=jn();o={blockedOn:null,target:o,priority:l};for(var f=0;f<Kl.length&&l!==0&&l<Kl[f].priority;f++);Kl.splice(f,0,o),f===0&&WE(o)}};var QE=e.version;if(QE!=="19.2.3")throw Error(r(527,QE,"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 GH={bundleType:0,version:"19.2.3",rendererPackageName:"react-dom",currentDispatcherRef:j,reconcilerVersion:"19.2.3"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Cp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Cp.isDisabled&&Cp.supportsFiber)try{st=Cp.inject(GH),Ct=Cp}catch{}}return Uf.createRoot=function(o,l){if(!i(o))throw Error(r(299));var f=!1,p="",v=iT,w=oT,P=sT;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&&(w=l.onCaughtError),l.onRecoverableError!==void 0&&(P=l.onRecoverableError)),l=_E(o,1,!1,null,null,f,p,null,v,w,P,XE),o[et]=l.current,l0(o),new E0(l)},Uf.hydrateRoot=function(o,l,f){if(!i(o))throw Error(r(299));var p=!1,v="",w=iT,P=oT,V=sT,Q=null;return f!=null&&(f.unstable_strictMode===!0&&(p=!0),f.identifierPrefix!==void 0&&(v=f.identifierPrefix),f.onUncaughtError!==void 0&&(w=f.onUncaughtError),f.onCaughtError!==void 0&&(P=f.onCaughtError),f.onRecoverableError!==void 0&&(V=f.onRecoverableError),f.formState!==void 0&&(Q=f.formState)),l=_E(o,1,!0,l,f??null,p,v,Q,w,P,V,XE),l.context=HE(null),f=l.current,p=zi(),p=qt(p),v=Pl(p),v.callback=null,zl(f,v,p),f=p,l.current.lanes=f,kn(l,f),es(l),o[et]=l.current,l0(o),new wp(l)},Uf.version="19.2.3",Uf}var NM;function LF(){if(NM)return H0.exports;NM=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(),H0.exports=NF(),H0.exports}var JI=LF();function BF(t,e){return lw(e),JI.hydrateRoot(e,t)}function jF(t,e){lw(e);var n=JI.createRoot(e);return n.render(t),n}function _F(t){return t.unmount(),!0}var Sx=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},HF=["ms","Moz","O","Webkit"],VF=(t,e)=>t+e.charAt(0).toUpperCase()+e.substring(1);Object.keys(fd).forEach(t=>{HF.forEach(e=>{fd[VF(e,t)]=fd[t]})});function FF(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 $F(t,e){var n=t.style;for(var r in e)if(e.hasOwnProperty(r)){var i=r.indexOf("--")===0,s=FF(r,e[r],i);r==="float"&&(r="cssFloat"),i?n.setProperty(r,s):n[r]=s}}var LM=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}},BM=(t,e,n)=>{var r=e||t&&t.parentNode;t&&r&&setTimeout(()=>{if(t.isConnected&&r.isConnected){var i=LM(r),s=LM(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)},UF={A:!0,BODY:!0,INPUT:!0,SELECT:!0,TEXTAREA:!0},Ag={blur(t){try{t.blur()}catch{}},focus(t){try{var e=t.nodeName;t.getAttribute("tabIndex")==null&&t.isContentEditable!==!0&&UF[e]==null&&t.setAttribute("tabIndex","-1"),t.focus()}catch{}},measure(t,e){BM(t,null,e)},measureInWindow(t,e){t&&setTimeout(()=>{var n=Sx(t),r=n.height,i=n.left,s=n.top,a=n.width;e(i,s,a,r)},0)},measureLayout(t,e,n,r){BM(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":{$F(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 wx(){return wx=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},wx.apply(null,arguments)}var qF={children:!0,dataSet:!0,dir:!0,id:!0,ref:!0,suppressHydrationWarning:!0,tabIndex:!0,testID:!0,focusable:!0,nativeID:!0},GF={"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},WF={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},KF={onBlur:!0,onFocus:!0},YF={onKeyDown:!0,onKeyDownCapture:!0,onKeyUp:!0,onKeyUpCapture:!0},XF={onMouseDown:!0,onMouseEnter:!0,onMouseLeave:!0,onMouseMove:!0,onMouseOver:!0,onMouseOut:!0,onMouseUp:!0},QF={onTouchCancel:!0,onTouchCancelCapture:!0,onTouchEnd:!0,onTouchEndCapture:!0,onTouchMove:!0,onTouchMoveCapture:!0,onTouchStart:!0,onTouchStartCapture:!0},ZF={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 jM=wu?R.useLayoutEffect:R.useEffect,Cx="__reactLayoutHandler",U0=null;function e5(){return wu&&typeof window.ResizeObserver<"u"&&U0==null&&(U0=new window.ResizeObserver(function(t){t.forEach(e=>{var n=e.target,r=n[Cx];typeof r=="function"&&Ag.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 t5(t,e){var n=e5();jM(()=>{var r=t.current;r!=null&&(r[Cx]=e)},[t,e]),jM(()=>{var r=t.current;return r!=null&&n!=null&&(typeof r[Cx]=="function"?n.observe(r):n.unobserve(r)),()=>{r!=null&&n!=null&&n.unobserve(r)}},[t,n])}function n5(){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 r5(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return R.useMemo(()=>n5(...e),[...e])}var _M=typeof Symbol=="function"&&typeof Symbol()=="symbol"?Symbol():Object.freeze({});function i5(t){var e=R.useRef(_M);return e.current===_M&&(e.current=t()),e.current}function o5(t){t.pointerEvents,t.style;var e=i5(()=>n=>{n!=null&&(n.measure=r=>Ag.measure(n,r),n.measureLayout=(r,i,s)=>Ag.measureLayout(n,r,s,i),n.measureInWindow=r=>Ag.measureInWindow(n,r))});return e}var HM=()=>{},s5={},l5=[];function VM(t){return t>20?t%20:t}function eD(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=VM(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,S=typeof t.preventDefault=="function"?t.preventDefault.bind(t):HM,C=t.timeStamp;function T(O){return Array.prototype.slice.call(O).map(I=>({force:I.force,identifier:VM(I.identifier),get locationX(){return k(I.clientX)},get locationY(){return D(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 D(y)},pageX:b,pageY:x,target:t.target,timestamp:C}];i=E,s=u==="mouseup"||u==="dragstart"?l5:E}var M={bubbles:!0,cancelable:!0,currentTarget:null,defaultPrevented:t.defaultPrevented,dispatchConfig:s5,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 D(y)},pageX:b,pageY:x,target:t.target,timestamp:C,touches:s,type:u},persist:HM,preventDefault:S,stopPropagation(){r=!0},target:t.target,timeStamp:C,touchHistory:e.touchHistory};function k(O){if(n=n||Sx(M.currentTarget),n)return O-n.left}function D(O){if(n=n||Sx(M.currentTarget),n)return O-n.top}return M}var a5="mousedown",u5="mousemove",c5="mouseup",f5="dragstart",d5="touchstart",h5="touchmove",p5="touchend",g5="touchcancel",m5="scroll",y5="select",v5="selectionchange";function tD(t){return t===d5||t===a5}function nD(t){return t===h5||t===u5}function rD(t){return t===p5||t===c5||iD(t)}function iD(t){return t===g5||t===f5}function b5(t){return t===m5}function x5(t){return t===y5||t===v5}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 oD="__reactResponderId";function w5(t){if(t.type==="selectionchange"){var e=window.getSelection().anchorNode;return FM(e)}else{var n=t.composedPath!=null?t.composedPath():FM(t.target);return n}}function FM(t){for(var e=[];t!=null&&t!==document.body;)e.push(t),t=t.parentNode;return e}function C5(t){return t!=null?t[oD]:null}function R5(t,e){t!=null&&(t[oD]=e)}function T5(t){for(var e=[],n=[],r=w5(t),i=0;i<r.length;i++){var s=r[i],a=C5(s);a!=null&&(e.push(a),n.push(s))}return{idPath:e,nodePath:n}}function E5(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 M5(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 A5(t){return t.type==="selectionchange"?S5():t.type==="select"}function O5(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 $M=20;function co(t){return t.timeStamp||t.timestamp}function k5(t){return{touchActive:!0,startPageX:t.pageX,startPageY:t.pageY,startTimeStamp:co(t),currentPageX:t.pageX,currentPageY:t.pageY,currentTimeStamp:co(t),previousPageX:t.pageX,previousPageY:t.pageY,previousTimeStamp:co(t)}}function I5(t,e){t.touchActive=!0,t.startPageX=e.pageX,t.startPageY=e.pageY,t.startTimeStamp=co(e),t.currentPageX=e.pageX,t.currentPageY=e.pageY,t.currentTimeStamp=co(e),t.previousPageX=e.pageX,t.previousPageY=e.pageY,t.previousTimeStamp=co(e)}function aw(t){var e=t.identifier;return e==null&&console.error("Touch object is missing identifier."),e}function D5(t,e){var n=aw(t),r=e.touchBank[n];r?I5(r,t):e.touchBank[n]=k5(t),e.mostRecentTimeStamp=co(t)}function P5(t,e){var n=e.touchBank[aw(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=co(t),e.mostRecentTimeStamp=co(t)):console.warn(`Cannot record touch move without a touch start.
14
+ `,"Touch Move: "+sD(t)+`
15
+ `,"Touch Bank: "+lD(e))}function z5(t,e){var n=e.touchBank[aw(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=co(t),e.mostRecentTimeStamp=co(t)):console.warn(`Cannot record touch end without a touch start.
16
+ `,"Touch End: "+sD(t)+`
17
+ `,"Touch Bank: "+lD(e))}function sD(t){return JSON.stringify({identifier:t.identifier,pageX:t.pageX,pageY:t.pageY,timestamp:co(t)})}function lD(t){var e=t.touchBank,n=JSON.stringify(e.slice(0,$M));return e.length>$M&&(n+=" (original size: "+e.length+")"),n}class N5{constructor(){this._touchHistory={touchBank:[],numberActiveTouches:0,indexOfSingleActiveTouch:-1,mostRecentTimeStamp:0}}recordTouchTrack(e,n){var r=this._touchHistory;if(nD(e))n.changedTouches.forEach(u=>P5(u,r));else if(tD(e))n.changedTouches.forEach(u=>D5(u,r)),r.numberActiveTouches=n.touches.length,r.numberActiveTouches===1&&(r.indexOfSingleActiveTouch=n.touches[0].identifier);else if(rD(e)&&(n.changedTouches.forEach(u=>z5(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 L5={},UM=["onStartShouldSetResponderCapture","onStartShouldSetResponder",{bubbles:!0}],qM=["onMoveShouldSetResponderCapture","onMoveShouldSetResponder",{bubbles:!0}],B5=["onScrollShouldSetResponderCapture","onScrollShouldSetResponder",{bubbles:!1}],j5={touchstart:UM,mousedown:UM,touchmove:qM,mousemove:qM,scroll:B5},Rx={id:null,idPath:null,node:null},qg=new Map,Ql=!1,os=0,ds={id:null,node:null,idPath:null},Tx=new N5;function Ed(t){ds=t}function Md(t){var e=qg.get(t);return e??L5}function q0(t){var e=t.type,n=t.target;if(e==="touchstart"&&(Ql=!0),(e==="touchmove"||os>1)&&(Ql=!1),!(e==="mousedown"&&Ql||e==="mousemove"&&Ql||e==="mousemove"&&os<1)){if(Ql&&e==="mouseup"){os===0&&(Ql=!1);return}var r=tD(e)&&O5(t),i=nD(e),s=rD(e),a=b5(e),u=x5(e),c=eD(t,Tx);(r||i||s)&&(t.touches?os=t.touches.length:r?os=1:s&&(os=0),Tx.recordTouchTrack(e,c.nativeEvent));var d=T5(t),h=!1,g;if(r||i||a&&os>0){var m=ds.idPath,y=d.idPath;if(m!=null&&y!=null){var b=E5(m,y);if(b!=null){var x=y.indexOf(b),S=x+(b===ds.id?1:0);d={idPath:y.slice(S),nodePath:d.nodePath.slice(S)}}else d=null}d!=null&&(g=_5(d,t,c),g!=null&&(H5(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,D=M.onResponderMove,O=M.onResponderEnd,I=M.onResponderRelease,L=M.onResponderTerminate,_=M.onResponderTerminationRequest;if(c.bubbles=!1,c.cancelable=!1,c.currentTarget=E,r)k!=null&&(c.dispatchConfig.registrationName="onResponderStart",k(c));else if(i)D!=null&&(c.dispatchConfig.registrationName="onResponderMove",D(c));else{var N=iD(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&&A5(t),B=s&&!N&&!M5(E,t.touches);if(s&&O!=null&&(c.dispatchConfig.registrationName="onResponderEnd",O(c)),B&&(I!=null&&(c.dispatchConfig.registrationName="onResponderRelease",I(c)),Ed(Rx)),N){var H=!0;(e==="contextmenu"||e==="scroll"||e==="selectionchange")&&(h?H=!1:_!=null&&(c.dispatchConfig.registrationName="onResponderTerminationRequest",_(c)===!1&&(H=!1))),H&&(L!=null&&(c.dispatchConfig.registrationName="onResponderTerminate",L(c)),Ed(Rx),Ql=!1,os=0)}}}}}function _5(t,e,n){var r=j5[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(D,O,I){var L=Md(D),_=L[I];if(_!=null&&(n.currentTarget=O,_(n)===!0)){var N=i.slice(i.indexOf(D));return{id:D,node:O,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],S=s[b],C=d(x,S,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 H5(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 V5=["blur","scroll"],F5=["mousedown","mousemove","mouseup","dragstart","touchstart","touchmove","touchend","touchcancel","contextmenu","select","selectionchange"];function $5(){wu&&window.__reactResponderSystemActive==null&&(window.addEventListener("blur",q0),F5.forEach(t=>{document.addEventListener(t,q0)}),V5.forEach(t=>{document.addEventListener(t,q0,!0)}),window.__reactResponderSystemActive=!0)}function U5(t,e,n){R5(e,t),qg.set(t,n)}function GM(t){ds.id===t&&q5(),qg.has(t)&&qg.delete(t)}function q5(){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=eD({},Tx);s.currentTarget=n,i(s)}Ed(Rx)}Ql=!1,os=0}function G5(){return ds.node}var W5={},K5=0;function Y5(t){var e=R.useRef(null);return e.current==null&&(e.current=t()),e.current}function X5(t,e){e===void 0&&(e=W5);var n=Y5(()=>K5++),r=R.useRef(!1);R.useEffect(()=>($5(),()=>{GM(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?(U5(n,b,e),r.current=!0):r.current&&(GM(n),r.current=!1)},[e,t,n]),R.useDebugValue({isResponder:t.current===G5()}),R.useDebugValue(e)}var Q5=R.createContext(!1),Z5=["hrefAttrs","onLayout","onMoveShouldSetResponder","onMoveShouldSetResponderCapture","onResponderEnd","onResponderGrant","onResponderMove","onResponderReject","onResponderRelease","onResponderStart","onResponderTerminate","onResponderTerminationRequest","onScrollShouldSetResponder","onScrollShouldSetResponderCapture","onSelectionChangeShouldSetResponder","onSelectionChangeShouldSetResponderCapture","onStartShouldSetResponder","onStartShouldSetResponderCapture"],J5=Object.assign({},qF,GF,WF,KF,YF,XF,QF,ZF,{href:!0,lang:!0,onScroll:!0,onWheel:!0,pointerEvents:!0}),e4=t=>JF(t,J5),Ex=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,S=t.onSelectionChangeShouldSetResponder,C=t.onSelectionChangeShouldSetResponderCapture,T=t.onStartShouldSetResponder,E=t.onStartShouldSetResponderCapture,M=Im(t,Z5),k=R.useContext(Q5),D=R.useRef(null),O=kF(),I=O.direction;t5(D,r),X5(D,{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:S,onSelectionChangeShouldSetResponderCapture:C,onStartShouldSetResponder:T,onStartShouldSetResponderCapture:E});var L="div",_=t.lang!=null?QI(t.lang):null,N=t.dir||_,B=N||I,H=e4(M);if(H.dir=N,H.style=[WM.view$raw,k&&WM.inline,t.style],t.href!=null&&(L="a",n!=null)){var F=n.download,G=n.rel,j=n.target;F!=null&&(H.download=F),G!=null&&(H.rel=G),typeof j=="string"&&(H.target=j.charAt(0)!=="_"?"_"+j:j)}var q=o5(H),$=r5(D,q,e);return H.ref=$,IF(L,H,{writingDirection:B})});Ex.displayName="View";var WM=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"}}),G0,KM;function t4(){if(KM)return G0;KM=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 G0=t,G0}var n4=t4();const Og=Fo(n4);var r4=R.createContext(null),uw=R.forwardRef((t,e)=>{var n=t.children,r=t.WrapperComponent,i=R.createElement(Ex,{children:n,key:1,style:YM.appContainer});return r&&(i=R.createElement(r,null,i)),R.createElement(r4.Provider,{value:t.rootTag},R.createElement(Ex,{ref:e,style:YM.appContainer},i))});uw.displayName="AppContainer";var YM=Qd.create({appContainer:{flex:1,pointerEvents:"box-none"}});function i4(t,e,n,r){var i=r.hydrate,s=r.initialProps,a=r.rootTag,u=i?BF:jF;return Og(a,"Expect to have a valid rootTag, instead got ",a),u(Ve.createElement(uw,{WrapperComponent:e,ref:n,rootTag:a},Ve.createElement(t,s)),a)}function o4(t,e,n){var r=Ve.createElement(uw,{WrapperComponent:n,rootTag:{}},Ve.createElement(t,e)),i=s=>{var a=Qd.getSheet();return Ve.createElement("style",wx({},s,{dangerouslySetInnerHTML:{__html:a.textContent},id:a.id}))};return{element:r,getStyleElement:i}}var XM={},Ys={},W0=t=>t(),qf;class Ad{static getAppKeys(){return Object.keys(Ys)}static getApplication(e,n){return Og(Ys[e]&&Ys[e].getApplication,"Application "+e+" has not been registered. This is either due to an import error during initialization or failure to call AppRegistry.registerComponent."),Ys[e].getApplication(n)}static registerComponent(e,n){return Ys[e]={getApplication:r=>o4(W0(n),r?r.initialProps:XM,qf&&qf(r)),run:r=>i4(W0(n),qf&&qf(r),r.callback,{hydrate:r.hydrate||!1,initialProps:r.initialProps||XM,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):(Og(i,"No component provider passed in"),Ad.registerComponent(r,i))})}static registerRunnable(e,n){return Ys[e]={run:n},e}static runApplication(e,n){return Og(Ys[e]&&Ys[e].run,'Application "'+e+'" has not been registered. This is either due to an import error during initialization or failure to call AppRegistry.registerComponent.'),Ys[e].run(n)}static setComponentProviderInstrumentationHook(e){W0=e}static setWrapperComponentProvider(e){qf=e}static unmountApplicationComponentAtRootTag(e){_F(e)}}var go=ZI();const s4=Fo(go);var K0={exports:{}},Gf={};var QM;function l4(){if(QM)return Gf;QM=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 ZM;function a4(){return ZM||(ZM=1,K0.exports=l4()),K0.exports}var A=a4(),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(){}},fu=typeof window>"u"||"Deno"in globalThis;function xi(){}function u4(t,e){return typeof t=="function"?t(e):t}function Mx(t){return typeof t=="number"&&t>=0&&t!==1/0}function aD(t,e){return Math.max(t+(e||0)-Date.now(),0)}function oa(t,e){return typeof t=="function"?t(e):t}function no(t,e){return typeof t=="function"?t(e):t}function JM(t,e){const{type:n="all",exact:r,fetchStatus:i,predicate:s,queryKey:a,stale:u}=t;if(a){if(r){if(e.queryHash!==cw(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 eA(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 cw(t,e){return(e?.queryKeyHashFn||Od)(t)}function Od(t){return JSON.stringify(t,(e,n)=>Ox(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 uD(t,e){if(t===e)return t;const n=tA(t)&&tA(e);if(n||Ox(t)&&Ox(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]=uD(t[g],e[g]),u[g]===t[g]&&t[g]!==void 0&&d++)}return i===a&&d===i?t:u}return e}function Ax(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 tA(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function Ox(t){if(!nA(t))return!1;const e=t.constructor;if(e===void 0)return!0;const n=e.prototype;return!(!nA(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function nA(t){return Object.prototype.toString.call(t)==="[object Object]"}function c4(t){return new Promise(e=>{setTimeout(e,t)})}function kx(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?uD(t,e):e}function f4(t){return t}function d4(t,e,n=0){const r=[...t,e];return n&&r.length>n?r.slice(1):r}function h4(t,e,n=0){const r=[e,...t];return n&&r.length>n?r.slice(0,-1):r}var fw=Symbol();function cD(t,e){return!t.queryFn&&e?.initialPromise?()=>e.initialPromise:!t.queryFn||t.queryFn===fw?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function p4(t,e){return typeof t=="function"?t(...e):!!t}var g4=class extends Jd{#e;#t;#n;constructor(){super(),this.#n=t=>{if(!fu&&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"}},dw=new g4,m4=class extends Jd{#e=!0;#t;#n;constructor(){super(),this.#n=t=>{if(!fu&&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}},Gg=new m4;function Ix(){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 y4(t){return Math.min(1e3*2**t,3e4)}function fD(t){return(t??"online")==="online"?Gg.isOnline():!0}var dD=class extends Error{constructor(t){super("CancelledError"),this.revert=t?.revert,this.silent=t?.silent}};function Y0(t){return t instanceof dD}function hD(t){let e=!1,n=0,r=!1,i;const s=Ix(),a=x=>{r||(m(new dD(x)),t.abort?.())},u=()=>{e=!0},c=()=>{e=!1},d=()=>dw.isFocused()&&(t.networkMode==="always"||Gg.isOnline())&&t.canRun(),h=()=>fD(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=S=>{(r||d())&&x(S)},t.onPause?.()}).then(()=>{i=void 0,r||t.onContinue?.()}),b=()=>{if(r)return;let x;const S=n===0?t.initialPromise:void 0;try{x=S??t.fn()}catch(C){x=Promise.reject(C)}Promise.resolve(x).then(g).catch(C=>{if(r)return;const T=t.retry??(fu?0:3),E=t.retryDelay??y4,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),c4(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 v4=t=>setTimeout(t,0);function b4(){let t=[],e=0,n=u=>{u()},r=u=>{u()},i=v4;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=b4(),pD=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Mx(this.gcTime)&&(this.#e=setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(fu?1/0:300*1e3))}clearGcTimeout(){this.#e&&(clearTimeout(this.#e),this.#e=void 0)}},x4=class extends pD{#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=kx(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(xi).catch(xi):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(t=>no(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===fw||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>oa(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:!aD(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=cD(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=>{Y0(c)&&c.silent||this.#o({type:"error",error:c}),Y0(c)||(this.#n.config.onError?.(c,this),this.#n.config.onSettled?.(this.state.data,c,this)),this.scheduleGc()};return this.#i=hD({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,...gD(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 Y0(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 gD(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:fD(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 w4=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??cw(r,e);let s=this.get(i);return s||(s=new x4({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=>JM(e,n))}findAll(t={}){const e=this.getAll();return Object.keys(t).length>0?e.filter(n=>JM(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()})})}},C4=class extends pD{#e;#t;#n;constructor(t){super(),this.mutationId=t.mutationId,this.#t=t.mutationCache,this.#e=[],this.state=t.state||R4(),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=hD({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 R4(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var T4=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 C4({mutationCache:this,mutationId:++this.#n,options:t.defaultMutationOptions(e),state:n});return this.add(r),r}add(t){this.#e.add(t);const e=Bp(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=Bp(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=Bp(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=Bp(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=>eA(e,n))}findAll(t={}){return this.getAll().filter(e=>eA(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(xi))))}};function Bp(t){return t.options.scope?.id}function Wg(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=cD(e.options,e.fetchOptions),y=async(b,x,S)=>{if(h)return Promise.reject();if(x==null&&b.pages.length)return Promise.resolve(b);const T=(()=>{const D={client:e.client,queryKey:e.queryKey,pageParam:x,direction:S?"backward":"forward",meta:e.options.meta};return g(D),D})(),E=await m(T),{maxPages:M}=e.options,k=S?h4:d4;return{pages:k(b.pages,E,M),pageParams:k(b.pageParams,x,M)}};if(i&&s.length){const b=i==="backward",x=b?mD:Dx,S={pages:s,pageParams:a},C=x(r,S);u=await y(S,C,b)}else{const b=t??s.length;do{const x=c===0?a[0]??r.initialPageParam:Dx(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 Dx(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 mD(t,{pages:e,pageParams:n}){return e.length>0?t.getPreviousPageParam?.(e[0],e,n[0],n):void 0}function E4(t,e){return e?Dx(t,e)!=null:!1}function M4(t,e){return!e||!t.getPreviousPageParam?!1:mD(t,e)!=null}var A4=class{#e;#t;#n;#r;#i;#l;#s;#o;constructor(t={}){this.#e=t.queryCache||new w4,this.#t=t.mutationCache||new T4,this.#n=t.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#l=0}mount(){this.#l++,this.#l===1&&(this.#s=dw.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#o=Gg.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(oa(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=u4(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(xi).catch(xi)}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(xi)),i.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(xi)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=this.#e.build(this,e);return n.isStaleByTime(oa(e.staleTime,n))?n.fetch(e):Promise.resolve(n.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(xi).catch(xi)}fetchInfiniteQuery(t){return t.behavior=Wg(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(xi).catch(xi)}ensureInfiniteQueryData(t){return t.behavior=Wg(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return Gg.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=cw(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===fw&&(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()}},yD=class extends Jd{constructor(t,e){super(),this.options=e,this.#e=t,this.#o=null,this.#s=Ix(),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),rA(this.#t,this.options)?this.#f():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Px(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Px(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 no(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&&!Ax(this.options,e)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const r=this.hasListeners();r&&iA(this.#t,n,this.options,e)&&this.#f(),this.updateResult(),r&&(this.#t!==n||no(this.options.enabled,this.#t)!==no(e.enabled,this.#t)||oa(this.options.staleTime,this.#t)!==oa(e.staleTime,this.#t))&&this.#m();const i=this.#y();r&&(this.#t!==n||no(this.options.enabled,this.#t)!==no(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 k4(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(xi)),e}#m(){this.#x();const t=oa(this.options.staleTime,this.#t);if(fu||this.#r.isStale||!Mx(t))return;const n=aD(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,!(fu||no(this.options.enabled,this.#t)===!1||!Mx(this.#a)||this.#a===0)&&(this.#c=setInterval(()=>{(this.options.refetchIntervalInBackground||dw.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&&rA(t,e),_=I&&iA(t,n,e,r);(L||_)&&(h={...h,...gD(d.data,t.options)}),e._optimisticResults==="isRestoring"&&(h.fetchStatus="idle")}let{error:y,errorUpdatedAt:b,status:x}=h;m=h.data;let S=!1;if(e.placeholderData!==void 0&&m===void 0&&x==="pending"){let I;i?.isPlaceholderData&&e.placeholderData===a?.placeholderData?(I=i.data,S=!0):I=typeof e.placeholderData=="function"?e.placeholderData(this.#h?.state.data,this.#h):e.placeholderData,I!==void 0&&(x="success",m=kx(i?.data,I,e),g=!0)}if(e.select&&m!==void 0&&!S)if(i&&m===s?.data&&e.select===this.#g)m=this.#d;else try{this.#g=e.select,m=e.select(m),m=kx(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,O={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:hw(t,e),refetch:this.refetch,promise:this.#s,isEnabled:no(e.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const I=N=>{O.status==="error"?N.reject(O.error):O.data!==void 0&&N.resolve(O.data)},L=()=>{const N=this.#s=O.promise=Ix();I(N)},_=this.#s;switch(_.status){case"pending":t.queryHash===n.queryHash&&I(_);break;case"fulfilled":(O.status==="error"||O.data!==_.value)&&L();break;case"rejected":(O.status!=="error"||O.error!==_.reason)&&L();break}}return O}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),Ax(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 O4(t,e){return no(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&e.retryOnMount===!1)}function rA(t,e){return O4(t,e)||t.state.data!==void 0&&Px(t,e,e.refetchOnMount)}function Px(t,e,n){if(no(e.enabled,t)!==!1&&oa(e.staleTime,t)!=="static"){const r=typeof n=="function"?n(t):n;return r==="always"||r!==!1&&hw(t,e)}return!1}function iA(t,e,n,r){return(t!==e||no(r.enabled,t)===!1)&&(!n.suspense||t.state.status!=="error")&&hw(t,n)}function hw(t,e){return no(e.enabled,t)!==!1&&t.isStaleByTime(oa(e.staleTime,t))}function k4(t,e){return!Ax(t.getCurrentResult(),e)}var I4=class extends yD{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:Wg()})}getOptimisticResult(t){return t.behavior=Wg(),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:E4(e,n.data),hasPreviousPage:M4(e,n.data),isFetchNextPageError:d,isFetchingNextPage:h,isFetchPreviousPageError:g,isFetchingPreviousPage:m,isRefetchError:u&&!d&&!g,isRefetching:s&&!h&&!m}}},vD=R.createContext(void 0),pw=t=>{const e=R.useContext(vD);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},D4=({client:t,children:e})=>(R.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),A.jsx(vD.Provider,{value:t,children:e})),bD=R.createContext(!1),P4=()=>R.useContext(bD);bD.Provider;function z4(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var N4=R.createContext(z4()),L4=()=>R.useContext(N4),B4=(t,e)=>{(t.suspense||t.throwOnError||t.experimental_prefetchInRender)&&(e.isReset()||(t.retryOnMount=!1))},j4=t=>{R.useEffect(()=>{t.clearReset()},[t])},_4=({result:t,errorResetBoundary:e,throwOnError:n,query:r,suspense:i})=>t.isError&&!e.isReset()&&!t.isFetching&&r&&(i&&t.data===void 0||p4(n,[t.error,r])),H4=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))}},V4=(t,e)=>t.isLoading&&t.isFetching&&!e,F4=(t,e)=>t?.suspense&&e.isPending,oA=(t,e,n)=>e.fetchOptimistic(t).catch(()=>{n.clearReset()});function xD(t,e,n){const r=P4(),i=L4(),s=pw(),a=s.defaultQueryOptions(t);s.getDefaultOptions().queries?._experimental_beforeQuery?.(a),a._optimisticResults=r?"isRestoring":"optimistic",H4(a),B4(a,i),j4(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)):xi;return c.updateResult(),m},[c,h]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),R.useEffect(()=>{c.setOptions(a)},[a,c]),F4(a,d))throw oA(a,c,i);if(_4({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&&!fu&&V4(d,r)&&(u?oA(a,c,i):s.getQueryCache().get(a.queryHash)?.promise)?.catch(xi).finally(()=>{c.updateResult()}),a.notifyOnChangeProps?d:c.trackResult(d)}function $4(t,e){return xD(t,yD)}function U4(t,e){return xD(t,I4)}const q4=R.createContext(null),G4=()=>R.useContext(q4),SD=()=>typeof window<"u"&&typeof window.document<"u",W4=()=>SD()&&typeof window.__ROZENITE_WEB__<"u",K4=()=>typeof window>"u",wD=()=>{const t=typeof lynx<"u"?lynx:globalThis.lynx;return typeof t=="object"&&t!==null&&typeof t.getDevtool=="function"},CD=()=>{if(typeof __BACKGROUND__<"u")return __BACKGROUND__===!0;const t=globalThis.__BACKGROUND__;return typeof t=="boolean"?t:!0},Y4=()=>wD()&&CD(),X4=()=>wD()&&!CD();let zx=class extends Error{constructor(e){super(`Unsupported platform: ${e}`),this.name="UnsupportedPlatformError"}},RD=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 gw="rozenite",Q4=()=>{const t=globalThis.__FUSEBOX_REACT_DEVTOOLS_DISPATCHER__,e=t.BINDING_NAME;return globalThis[e]!=null?t.initializeDomain(gw):null},Z4=()=>new Promise(t=>{const e=n=>{n.name===gw&&(globalThis.__FUSEBOX_REACT_DEVTOOLS_DISPATCHER__.onDomainInitialization.removeEventListener(e),setTimeout(()=>t(n)))};globalThis.__FUSEBOX_REACT_DEVTOOLS_DISPATCHER__.onDomainInitialization.addEventListener(e)}),sA=async()=>{const t=new Set;let e=Q4();e||(e=await Z4());const n=()=>{if(!e)throw new Error("Domain not initialized");return e},r=i=>{i.name===gw&&(e&&t.forEach(s=>{e.onMessage.removeEventListener(s)}),e=i,t.forEach(s=>{i.onMessage.addEventListener(s)}))};return globalThis.__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:()=>{globalThis.__FUSEBOX_REACT_DEVTOOLS_DISPATCHER__.onDomainInitialization.removeEventListener(r)}}},J4=async()=>{if(Y4())return sA();if(X4())throw new zx("lynx-main-thread");if(SD()&&!W4())throw new RD;if(K4())throw new zx("server");return sA()},e8=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 t8=async()=>{if(Wf)return Wf;const t="__ROZENITE_PANEL__"in globalThis?e8():J4();Wf=t;try{const e=await t;return Wf=e,e}catch(e){throw Wf=null,e}},n8=t=>typeof t!="object"||t===null||typeof t.pluginId!="string"||!("type"in t)||!("payload"in t)?null:t;class lA extends Error{constructor(e){super(`Request "${e}" was aborted.`),this.requestId=e,this.name="RozeniteDevToolsRequestAbortedError"}}let r8=class extends Error{constructor(e,n){super(`Request "${e}" timed out after ${n}ms.`),this.requestId=e,this.timeoutMs=n,this.name="RozeniteDevToolsRequestTimeoutError"}},aA=class extends Error{constructor(e){super(`Request "${e}" was cancelled because the client closed.`),this.requestId=e,this.name="RozeniteDevToolsRequestClientClosedError"}},i8=class extends Error{constructor(e){super(`Request "${e.requestId}" received an error response.`),this.payload=e,this.name="RozeniteDevToolsRequestResponseError"}};const o8=3e4;let uA=0;const s8=()=>typeof globalThis.crypto?.randomUUID=="function"?globalThis.crypto.randomUUID():(uA+=1,`rozenite-${Date.now()}-${uA}`),l8=async(t,e={})=>{const n=e.channel??await t8(),r=new Map,i=new Set;let s=!1;const a=async h=>{const g=n8(h);if(!g||g.pluginId!==t)return;r.get(g.type)?.forEach(y=>{y(g.payload)})},u=(h,g)=>{n.send({pluginId:t,type:h,payload:g})},c=n.onMessage(a),d={send:u,onMessage:(h,g)=>{const m=r.get(h)??new Set;return m.add(g),r.set(h,m),{remove:()=>{m.delete(g),m.size===0&&r.delete(h)}}},request:h=>{const g=h.requestId??s8(),m=h.timeoutMs??o8;return!Number.isFinite(m)||m<0?Promise.reject(new RangeError("timeoutMs must be a finite, non-negative number.")):s?Promise.reject(new aA(g)):h.signal?.aborted?Promise.reject(new lA(g)):new Promise((y,b)=>{let x=!1;const S=()=>{E(new lA(g))},C=()=>{k.remove(),D?.remove(),clearTimeout(O),h.signal?.removeEventListener("abort",S),i.delete(M)},T=I=>{x||(x=!0,C(),I())},E=I=>{T(()=>{b(I)})},M=()=>{E(new aA(g))},k=d.onMessage(h.responseType,I=>{I.requestId===g&&T(()=>{y(I)})}),D=h.errorType!=null?d.onMessage(h.errorType,I=>{I.requestId===g&&T(()=>{b(new i8(I))})}):void 0;h.signal?.addEventListener("abort",S,{once:!0}),i.add(M);const O=setTimeout(()=>{E(new r8(g,m))},m);try{d.send(h.requestType,{...h.payload,requestId:g})}catch(I){E(I instanceof Error?I:new Error(String(I)))}})},close:()=>{s||(s=!0,i.forEach(h=>{h()}),r.clear(),c.remove(),n.close())}};return d},cA=async(t,e={})=>l8(t,e),a8=()=>"__ROZENITE_PANEL__"in globalThis,u8=({pluginId:t,channel:e})=>{const n=G4(),r=e??n?.channel,i=n?.role,[s,a]=R.useState(null),[u,c]=R.useState(null);if(R.useEffect(()=>{let d=!0,h=null;const g=async()=>{try{h=r?await cA(t,{channel:r}):await cA(t),d&&a(h)}catch(y){if(y instanceof RD){console.warn(`[Rozenite, ${t}] Rozenite for web is not configured. A separate integration is required for web. Consult Rozenite docs for details.`);return}if(y instanceof zx){console.warn(`[Rozenite, ${t}] Unsupported platform, skipping setup.`);return}console.error(`[Rozenite, ${t}] Error setting up client.`,y),d&&c(y)}},m=async()=>{try{h?.close()}catch{}};return g(),()=>{d=!1,m()}},[t,r]),u!=null)throw u;return R.useEffect(()=>{const d=i!=null?i==="panel":a8();if(!s||d)return;const h=s,g=setTimeout(()=>{h.send("plugin-mounted",{pluginId:t})},0);return()=>{clearTimeout(g)}},[s,t,i]),s};function TD(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=TD(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function ED(){for(var t,e,n=0,r="",i=arguments.length;n<i;n++)(t=arguments[n])&&(e=TD(t))&&(r&&(r+=" "),r+=e);return r}const c8=(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},f8=(t,e)=>({classGroupId:t,validator:e}),MD=(t=new Map,e=null,n)=>({nextPart:t,validators:e,classGroupId:n}),Kg="-",fA=[],d8="arbitrary..",h8=t=>{const e=g8(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:a=>{if(a.startsWith("[")&&a.endsWith("]"))return p8(a);const u=a.split(Kg),c=u[0]===""&&u.length>1?1:0;return AD(u,c,e)},getConflictingClassGroupIds:(a,u)=>{if(u){const c=r[a],d=n[a];return c?d?c8(d,c):c:d||fA}return n[a]||fA}}},AD=(t,e,n)=>{if(t.length-e===0)return n.classGroupId;const i=t[e],s=n.nextPart.get(i);if(s){const d=AD(t,e+1,s);if(d)return d}const a=n.validators;if(a===null)return;const u=e===0?t.join(Kg):t.slice(e).join(Kg),c=a.length;for(let d=0;d<c;d++){const h=a[d];if(h.validator(u))return h.classGroupId}},p8=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?d8+r:void 0})(),g8=t=>{const{theme:e,classGroups:n}=t;return m8(n,e)},m8=(t,e)=>{const n=MD();for(const r in t){const i=t[r];mw(i,n,r,e)}return n},mw=(t,e,n,r)=>{const i=t.length;for(let s=0;s<i;s++){const a=t[s];y8(a,e,n,r)}},y8=(t,e,n,r)=>{if(typeof t=="string"){v8(t,e,n);return}if(typeof t=="function"){b8(t,e,n,r);return}x8(t,e,n,r)},v8=(t,e,n)=>{const r=t===""?e:OD(e,t);r.classGroupId=n},b8=(t,e,n,r)=>{if(S8(t)){mw(t(r),e,n,r);return}e.validators===null&&(e.validators=[]),e.validators.push(f8(n,t))},x8=(t,e,n,r)=>{const i=Object.entries(t),s=i.length;for(let a=0;a<s;a++){const[u,c]=i[a];mw(c,OD(e,u),n,r)}},OD=(t,e)=>{let n=t;const r=e.split(Kg),i=r.length;for(let s=0;s<i;s++){const a=r[s];let u=n.nextPart.get(a);u||(u=MD(),n.nextPart.set(a,u)),n=u}return n},S8=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,w8=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)}}},Nx="!",dA=":",C8=[],hA=(t,e,n,r,i)=>({modifiers:t,hasImportantModifier:e,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),R8=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 S=i[x];if(a===0&&u===0){if(S===dA){s.push(i.slice(c,x)),c=x+1;continue}if(S==="/"){d=x;continue}}S==="["?a++:S==="]"?a--:S==="("?u++:S===")"&&u--}const g=s.length===0?i:i.slice(c);let m=g,y=!1;g.endsWith(Nx)?(m=g.slice(0,-1),y=!0):g.startsWith(Nx)&&(m=g.slice(1),y=!0);const b=d&&d>c?d-c:void 0;return hA(s,y,m,b)};if(e){const i=e+dA,s=r;r=a=>a.startsWith(i)?s(a.slice(i.length)):hA(C8,!1,a,void 0,!0)}if(n){const i=r;r=s=>n({className:s,parseClassName:i})}return r},T8=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}},E8=t=>({cache:w8(t.cacheSize),parseClassName:R8(t),sortModifiers:T8(t),...h8(t)}),M8=/\s+/,A8=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:s}=e,a=[],u=t.trim().split(M8);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 S=!!x,C=r(S?b.substring(0,x):b);if(!C){if(!S){c=h+(c.length>0?" "+c:c);continue}if(C=r(b),!C){c=h+(c.length>0?" "+c:c);continue}S=!1}const T=m.length===0?"":m.length===1?m[0]:s(m).join(":"),E=y?T+Nx:T,M=E+C;if(a.indexOf(M)>-1)continue;a.push(M);const k=i(C,S);for(let D=0;D<k.length;++D){const O=k[D];a.push(E+O)}c=h+(c.length>0?" "+c:c)}return c},O8=(...t)=>{let e=0,n,r,i="";for(;e<t.length;)(n=t[e++])&&(r=kD(n))&&(i&&(i+=" "),i+=r);return i},kD=t=>{if(typeof t=="string")return t;let e,n="";for(let r=0;r<t.length;r++)t[r]&&(e=kD(t[r]))&&(n&&(n+=" "),n+=e);return n},k8=(t,...e)=>{let n,r,i,s;const a=c=>{const d=e.reduce((h,g)=>g(h),t());return n=E8(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=A8(c,n);return i(c,h),h};return s=a,(...c)=>s(O8(...c))},I8=[],br=t=>{const e=n=>n[t]||I8;return e.isThemeGetter=!0,e},ID=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,DD=/^\((?:(\w[\w-]*):)?(.+)\)$/i,D8=/^\d+\/\d+$/,P8=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,z8=/\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$/,N8=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,L8=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,B8=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,lc=t=>D8.test(t),Dt=t=>!!t&&!Number.isNaN(Number(t)),Xl=t=>!!t&&Number.isInteger(Number(t)),X0=t=>t.endsWith("%")&&Dt(t.slice(0,-1)),Xs=t=>P8.test(t),j8=()=>!0,_8=t=>z8.test(t)&&!N8.test(t),PD=()=>!1,H8=t=>L8.test(t),V8=t=>B8.test(t),F8=t=>!Qe(t)&&!Ze(t),$8=t=>Uc(t,LD,PD),Qe=t=>ID.test(t),Ya=t=>Uc(t,BD,_8),Q0=t=>Uc(t,K8,Dt),pA=t=>Uc(t,zD,PD),U8=t=>Uc(t,ND,V8),jp=t=>Uc(t,jD,H8),Ze=t=>DD.test(t),Kf=t=>qc(t,BD),q8=t=>qc(t,Y8),gA=t=>qc(t,zD),G8=t=>qc(t,LD),W8=t=>qc(t,ND),_p=t=>qc(t,jD,!0),Uc=(t,e,n)=>{const r=ID.exec(t);return r?r[1]?e(r[1]):n(r[2]):!1},qc=(t,e,n=!1)=>{const r=DD.exec(t);return r?r[1]?e(r[1]):n:!1},zD=t=>t==="position"||t==="percentage",ND=t=>t==="image"||t==="url",LD=t=>t==="length"||t==="size"||t==="bg-size",BD=t=>t==="length",K8=t=>t==="number",Y8=t=>t==="family-name",jD=t=>t==="shadow",X8=()=>{const t=br("color"),e=br("font"),n=br("text"),r=br("font-weight"),i=br("tracking"),s=br("leading"),a=br("breakpoint"),u=br("container"),c=br("spacing"),d=br("radius"),h=br("shadow"),g=br("inset-shadow"),m=br("text-shadow"),y=br("drop-shadow"),b=br("blur"),x=br("perspective"),S=br("aspect"),C=br("ease"),T=br("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],D=()=>["auto","hidden","clip","visible","scroll"],O=()=>["auto","contain","none"],I=()=>[Ze,Qe,c],L=()=>[lc,"full","auto",...I()],_=()=>[Xl,"none","subgrid",Ze,Qe],N=()=>["auto",{span:["full",Xl,Ze,Qe]},Xl,Ze,Qe],B=()=>[Xl,"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"],j=()=>["auto",...I()],q=()=>[lc,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...I()],$=()=>[t,Ze,Qe],X=()=>[...M(),gA,pA,{position:[Ze,Qe]}],Z=()=>["no-repeat",{repeat:["","x","y","space","round"]}],z=()=>["auto","cover","contain",G8,$8,{size:[Ze,Qe]}],U=()=>[X0,Kf,Ya],W=()=>["","none","full",d,Ze,Qe],K=()=>["",Dt,Kf,Ya],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,X0,gA,pA],Y=()=>["","none",b,Ze,Qe],se=()=>["none",Dt,Ze,Qe],ve=()=>["none",Dt,Ze,Qe],ye=()=>[Dt,Ze,Qe],he=()=>[lc,"full",...I()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Xs],breakpoint:[Xs],color:[j8],container:[Xs],"drop-shadow":[Xs],ease:["in","out","in-out"],font:[F8],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Xs],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Xs],shadow:[Xs],spacing:["px",Dt],text:[Xs],"text-shadow":[Xs],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",lc,Qe,Ze,S]}],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:D()}],"overflow-x":[{"overflow-x":D()}],"overflow-y":[{"overflow-y":D()}],overscroll:[{overscroll:O()}],"overscroll-x":[{"overscroll-x":O()}],"overscroll-y":[{"overscroll-y":O()}],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:[Xl,"auto",Ze,Qe]}],basis:[{basis:[lc,"full","auto",u,...I()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Dt,lc,"auto","initial","none",Qe]}],grow:[{grow:["",Dt,Ze,Qe]}],shrink:[{shrink:["",Dt,Ze,Qe]}],order:[{order:[Xl,"first","last","none",Ze,Qe]}],"grid-cols":[{"grid-cols":_()}],"col-start-end":[{col:N()}],"col-start":[{"col-start":B()}],"col-end":[{"col-end":B()}],"grid-rows":[{"grid-rows":_()}],"row-start-end":[{row:N()}],"row-start":[{"row-start":B()}],"row-end":[{"row-end":B()}],"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:j()}],mx:[{mx:j()}],my:[{my:j()}],ms:[{ms:j()}],me:[{me:j()}],mt:[{mt:j()}],mr:[{mr:j()}],mb:[{mb:j()}],ml:[{ml:j()}],"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,Ya]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Ze,Q0]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",X0,Qe]}],"font-family":[{font:[q8,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,Q0]}],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:$()}],"text-color":[{text:$()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ie(),"wavy"]}],"text-decoration-thickness":[{decoration:[Dt,"from-font","auto",Ze,Ya]}],"text-decoration-color":[{decoration:$()}],"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"]},Xl,Ze,Qe],radial:["",Ze,Qe],conic:[Xl,Ze,Qe]},W8,U8]}],"bg-color":[{bg:$()}],"gradient-from-pos":[{from:U()}],"gradient-via-pos":[{via:U()}],"gradient-to-pos":[{to:U()}],"gradient-from":[{from:$()}],"gradient-via":[{via:$()}],"gradient-to":[{to:$()}],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:$()}],"border-color-x":[{"border-x":$()}],"border-color-y":[{"border-y":$()}],"border-color-s":[{"border-s":$()}],"border-color-e":[{"border-e":$()}],"border-color-t":[{"border-t":$()}],"border-color-r":[{"border-r":$()}],"border-color-b":[{"border-b":$()}],"border-color-l":[{"border-l":$()}],"divide-color":[{divide:$()}],"outline-style":[{outline:[...ie(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Dt,Ze,Qe]}],"outline-w":[{outline:["",Dt,Kf,Ya]}],"outline-color":[{outline:$()}],shadow:[{shadow:["","none",h,_p,jp]}],"shadow-color":[{shadow:$()}],"inset-shadow":[{"inset-shadow":["none",g,_p,jp]}],"inset-shadow-color":[{"inset-shadow":$()}],"ring-w":[{ring:K()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:$()}],"ring-offset-w":[{"ring-offset":[Dt,Ya]}],"ring-offset-color":[{"ring-offset":$()}],"inset-ring-w":[{"inset-ring":K()}],"inset-ring-color":[{"inset-ring":$()}],"text-shadow":[{"text-shadow":["none",m,_p,jp]}],"text-shadow-color":[{"text-shadow":$()}],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":$()}],"mask-image-linear-to-color":[{"mask-linear-to":$()}],"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":$()}],"mask-image-t-to-color":[{"mask-t-to":$()}],"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":$()}],"mask-image-r-to-color":[{"mask-r-to":$()}],"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":$()}],"mask-image-b-to-color":[{"mask-b-to":$()}],"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":$()}],"mask-image-l-to-color":[{"mask-l-to":$()}],"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":$()}],"mask-image-x-to-color":[{"mask-x-to":$()}],"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":$()}],"mask-image-y-to-color":[{"mask-y-to":$()}],"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":$()}],"mask-image-radial-to-color":[{"mask-radial-to":$()}],"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":$()}],"mask-image-conic-to-color":[{"mask-conic-to":$()}],"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,_p,jp]}],"drop-shadow-color":[{"drop-shadow":$()}],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:$()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:$()}],"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",...$()]}],"stroke-w":[{stroke:[Dt,Kf,Ya,Q0]}],stroke:[{stroke:["none",...$()]}],"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"]}},Q8=k8(X8),mA=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,yA=ED,ba=(t,e)=>n=>{var r;if(e?.variants==null)return yA(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=mA(h)||mA(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,S]=b;return Array.isArray(S)?S.includes({...s,...u}[x]):{...s,...u}[x]===S})?[...d,g,m]:d},[]);return yA(t,a,c,n?.class,n?.className)};function Z8(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=Z8("https://base-ui.com/production-error","Base UI"),vA={};function Qn(t,e){const n=R.useRef(vA);return n.current===vA&&(n.current=t(e)),n}function Cs(t,e,n,r){const i=Qn(_D).current;return e6(i,t,e,n,r)&&HD(i,[t,e,n,r]),i.callback}function J8(t){const e=Qn(_D).current;return t6(e,t)&&HD(e,t),e.callback}function _D(){return{callback:null,cleanup:null,refs:[]}}function e6(t,e,n,r,i){return t.refs[0]!==e||t.refs[1]!==n||t.refs[2]!==r||t.refs[3]!==i}function t6(t,e){return t.refs.length!==e.length||t.refs.some((n,r)=>n!==e[r])}function HD(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 n6=parseInt(R.version,10);function yw(t){return n6>=t}function bA(t){if(!R.isValidElement(t))return null;const e=t,n=e.props;return(yw(19)?n?.ref:e.ref)??null}function Lx(t,e){if(t&&!e)return t;if(!t&&e)return e;if(t||e)return{...t,...e}}function On(){}const li=Object.freeze([]),gn=Object.freeze({});function r6(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 i6(t,e){return typeof t=="function"?t(e):t}function o6(t,e){return typeof t=="function"?t(e):t}const vw={};function Jr(t,e,n,r,i){if(!n&&!r&&!i&&!t)return Yg(e);let s=Yg(t);return e&&(s=rd(s,e)),n&&(s=rd(s,n)),r&&(s=rd(s,r)),i&&(s=rd(s,i)),s}function s6(t){if(t.length===0)return vw;if(t.length===1)return Yg(t[0]);let e=Yg(t[0]);for(let n=1;n<t.length;n+=1)e=rd(e,t[n]);return e}function Yg(t){return bw(t)?{...FD(t,vw)}:l6(t)}function rd(t,e){return bw(e)?FD(e,t):a6(t,e)}function l6(t){const e={...t};for(const n in e){const r=e[n];VD(n,r)&&(e[n]=$D(r))}return e}function a6(t,e){if(!e)return t;for(const n in e){const r=e[n];switch(n){case"style":{t[n]=Lx(t.style,r);break}case"className":{t[n]=UD(t.className,r);break}default:VD(n,r)?t[n]=u6(t[n],r):t[n]=r}}return t}function VD(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 bw(t){return typeof t=="function"}function FD(t,e){return bw(t)?t(e):t??vw}function u6(t,e){return e?t?(...n)=>{const r=n[0];if(qD(r)){const s=r;Xg(s);const a=e(...n);return s.baseUIHandlerPrevented||t?.(...n),a}const i=e(...n);return t?.(...n),i}:$D(e):t}function $D(t){return t&&((...e)=>{const n=e[0];return qD(n)&&Xg(n),t(...e)})}function Xg(t){return t.preventBaseUIHandler=()=>{t.baseUIHandlerPrevented=!0},t}function UD(t,e){return e?t?e+" "+t:e:t}function qD(t){return t!=null&&typeof t=="object"&&"nativeEvent"in t}function rt(t,e,n={}){const r=e.render,i=c6(e,n);if(n.enabled===!1)return null;const s=n.state??gn;return h6(t,r,i,s)}function c6(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?i6(n,s):void 0,g=d?o6(r,s):void 0,m=d?r6(s,c):gn,y=d&&u?f6(u):void 0,b=d?Lx(m,y)??{}:gn;return typeof document<"u"&&(d?Array.isArray(a)?b.ref=J8([b.ref,bA(i),...a]):b.ref=Cs(b.ref,bA(i),a):Cs(null,null)),d?(h!==void 0&&(b.className=UD(b.className,h)),g!==void 0&&(b.style=Lx(b.style,g)),b):gn}function f6(t){return Array.isArray(t)?s6(t):Jr(void 0,t)}const d6=Symbol.for("react.lazy");function h6(t,e,n,r){if(e){if(typeof e=="function")return e(n,r);const i=Jr(n,e.props);i.ref=n.ref;let s=e;return s?.$$typeof===d6&&(s=R.Children.toArray(e)[0]),R.cloneElement(s,i)}if(t&&typeof t=="string")return p6(t,n);throw new Error(Jt(8))}function p6(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 Ti(t){return rt(t.defaultTagName??"div",t,t)}var g6={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 m6=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),y6=(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,...g6,width:i,height:i,stroke:r,strokeWidth:a?Number(s)*24/Number(i):s,className:`lucide lucide-${m6(t)}`,...c},[...e.map(([h,g])=>R.createElement(h,g)),...(Array.isArray(u)?u:[u])||[]]));return n.displayName=`${t}`,n};var Zn=y6;const v6=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"}]]),b6=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"}]]),xw=Zn("Check",[["polyline",{points:"20 6 9 17 4 12",key:"10jjfj"}]]),x6=Zn("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),Sw=Zn("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]),S6=Zn("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]),ww=Zn("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]),xA=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"}]]),w6=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"}]]),C6=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"}]]),R6=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"}]]),T6=Zn("Loader2",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),E6=Zn("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]),GD=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"}]]),M6=Zn("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]),A6=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"}]]),O6=Zn("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]),k6=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"}]]),SA=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"}]]),I6=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"}]]),WD=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"}]]),Pm=Zn("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Bx=[];let jx;function D6(){return jx}function P6(t){Bx.push(t)}function Cw(t){const e=(n,r)=>{const i=Qn(z6).current;let s;try{jx=i;for(const a of Bx)a.before(i);s=t(n,r);for(const a of Bx)a.after(i);i.didInitialize=!0}finally{jx=void 0}return s};return e.displayName=t.displayName||t.name,e}function KD(t){return R.forwardRef(Cw(t))}function z6(){return{didInitialize:!1}}const N6=()=>{},Oe=typeof document<"u"?R.useLayoutEffect:N6,YD=R.createContext(void 0);function zm(t){const e=R.useContext(YD);if(e===void 0&&!t)throw new Error(Jt(72));return e}function Nm(t){R.useEffect(t,li)}const Yf=0;class _i{static create(){return new _i}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(_i.create).current;return Nm(t.disposeEffect),t}function L6(){return typeof navigator>"u"?{userAgent:"",platform:"",maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??0}}const{userAgent:B6,platform:j6,maxTouchPoints:_6}=L6(),Lm=B6.toLowerCase(),Id=j6.toLowerCase(),eh=/^i(os$|p)/.test(Id)||Id==="macintel"&&_6>1,wA="android",Qg=Id===wA||Lm.includes(wA),Rw=!eh&&Id.startsWith("mac");Id.startsWith("win");const H6=Rw||eh,dl=typeof CSS<"u"&&!!CSS.supports?.("-webkit-backdrop-filter:none"),CA=!dl&&Lm.includes("firefox");!dl&&Lm.includes("chrom");const V6=H6,Tw=/jsdom|happydom/.test(Lm);function Nr(t){t.preventDefault(),t.stopPropagation()}function F6(t){return"nativeEvent"in t}function Ew(t){return t.pointerType===""&&t.isTrusted?!0:Qg&&t.pointerType?t.type==="click"&&t.buttons===1:t.detail===0&&!t.pointerType}function Mw(t){return Tw?!1:!Qg&&t.width===0&&t.height===0||Qg&&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 sa(t,e){const n=["mouse","pen"];return e||n.push("",void 0),n.includes(t)}function $6(t){const e=t.type;return e==="click"||e==="mousedown"||e==="keydown"||e==="keyup"}function Bm(){return typeof window<"u"}function _r(t){return Aw(t)?(t.nodeName||"").toLowerCase():"#document"}function Rn(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function hl(t){var e;return(e=(Aw(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Aw(t){return Bm()?t instanceof Node||t instanceof Rn(t).Node:!1}function It(t){return Bm()?t instanceof Element||t instanceof Rn(t).Element:!1}function cn(t){return Bm()?t instanceof HTMLElement||t instanceof Rn(t).HTMLElement:!1}function Oc(t){return!Bm()||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 U6(t){return/^(table|td|th)$/.test(_r(t))}function jm(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const q6=/transform|translate|scale|rotate|perspective|filter/,G6=/paint|layout|strict|content/,Xa=t=>!!t&&t!=="none";let Z0;function Ow(t){const e=It(t)?Ci(t):t;return Xa(e.transform)||Xa(e.translate)||Xa(e.scale)||Xa(e.rotate)||Xa(e.perspective)||!kw()&&(Xa(e.backdropFilter)||Xa(e.filter))||q6.test(e.willChange||"")||G6.test(e.contain||"")}function W6(t){let e=al(t);for(;cn(e)&&!il(e);){if(Ow(e))return e;if(jm(e))return null;e=al(e)}return null}function kw(){return Z0==null&&(Z0=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Z0}function il(t){return/^(html|body|#document)$/.test(_r(t))}function Ci(t){return Rn(t).getComputedStyle(t)}function _m(t){return It(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function al(t){if(_r(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Oc(t)&&t.host||hl(t);return Oc(e)?e.host:e}function XD(t){const e=al(t);return il(e)?(t.ownerDocument||t).body:cn(e)&&th(e)?e:XD(e)}function kc(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=XD(t),s=i===((r=t.ownerDocument)==null?void 0:r.body),a=Rn(i);if(s){const u=_x(a);return e.concat(a,a.visualViewport||[],th(i)?i:[],u&&n?kc(u):[])}else return e.concat(i,kc(i,[],n))}function _x(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}const Hx="data-base-ui-focusable",QD="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",lu="ArrowLeft",au="ArrowRight",Iw="ArrowUp",Hm="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&&Oc(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 Zg(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 J0(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 K6(t){return t.matches("html,body")}function Vm(t){return cn(t)&&t.matches(QD)}function ZD(t){return t?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${QD}`)!=null}function Vx(t){return t?t.getAttribute("role")==="combobox"&&Vm(t):!1}function Jg(t){if(!t||Tw)return!0;try{return t.matches(":focus-visible")}catch{return!0}}function em(t){return t?t.hasAttribute(Hx)?t:t.querySelector(`[${Hx}]`)||t:null}function Y6(t,e){return e!=null&&!sa(e)?0:typeof t=="function"?t():t}function ua(t,e,n){const r=Y6(t,n);return typeof r=="number"?r:r?.[e]}function RA(t){return typeof t=="function"?t():t}function JD(t,e){return e||t==="click"||t==="mousedown"}function X6(t){return t?.includes("mouse")&&t!=="mousedown"}const gr="none",Gc="trigger-press",Sr="trigger-hover",gc="trigger-focus",nh="outside-press",uu="item-press",eP="close-press",TA="clear-press",dd="input-change",as="input-clear",tP="input-press",ca="focus-out",Wc="escape-key",Fx="list-navigation",Dw="keyboard",Pw="pointer",nP="cancel-open",id="sibling-open",rP="disabled",EA="missing",MA="initial",zw="imperative-action",Q6="window-resize";function Ue(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 Z6(t,e,n){const r=n??gn;return{reason:t,event:e??new Event("base-ui"),...r}}const iP=R.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new _i,currentIdRef:{current:null},currentContextRef:{current:null}});function J6(t,e){t.current=e.current}function e$(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 Oe(()=>{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]),A.jsx(iP.Provider,{value:R.useMemo(()=>({hasProvider:!0,delayRef:i,initialDelayRef:s,currentIdRef:a,timeoutMs:r,currentContextRef:u,timeout:c}),[r,c]),children:e})}function t$(t,e={open:!1}){const{open:n}=e,r="rootStore"in t?t.rootStore:t,i=r.useState("floatingId"),s=R.useContext(iP),{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 Oe(()=>{x.current=n},[n]),Oe(()=>{function S(){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||S()}),()=>{(x.current||a.current!==C)&&m.clear()}}S()}},[n,i,a,u,c,d,h,m,r]),Oe(()=>{if(!n)return;const S=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),S?.setIsInstantPhase(!0),S?.onOpenChange(!1,Ue(gr))):(b(!1),S?.setIsInstantPhase(!1))},[n,i,r,a,u,d,h,m]),Oe(()=>()=>{if(a.current===i){if(h.current=null,!x.current)return;a.current=null,J6(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 Un(t){const e=Qn(n$,t).current;return e.next=t,Oe(e.effect),e}function n$(t){const e={current:t,next:t,effect:()=>{e.current=e.next}};return e}const Nw={...TF},eb=Nw.useInsertionEffect,r$=eb&&eb!==Nw.useLayoutEffect?eb:t=>t();function Ae(t){const e=Qn(i$).current;return e.next=t,r$(e.effect),e.trampoline}function i$(){const t={next:void 0,callback:o$,trampoline:(...e)=>t.callback?.(...e),effect:()=>{t.callback=t.next}};return t}function o$(){}const Hp=null;class s${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 Vp=new s$;class cs{static create(){return new cs}static request(e){return Vp.request(e)}static cancel(e){return Vp.cancel(e)}currentId=Hp;request(e){this.cancel(),this.currentId=Vp.request(()=>{this.currentId=Hp,e()})}cancel=()=>{this.currentId!==Hp&&(Vp.cancel(this.currentId),this.currentId=Hp)};disposeEffect=()=>this.cancel}function Ic(){const t=Qn(cs.create).current;return Nm(t.disposeEffect),t}function vt(t){return t?.ownerDocument||document}const oP={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},Fm={...oP,position:"fixed",top:0,left:0},Lw={...oP,position:"absolute"},du=R.forwardRef(function(e,n){const[r,i]=R.useState();Oe(()=>{V6&&dl&&i("button")},[]);const s={tabIndex:0,role:r};return A.jsx("span",{...e,ref:n,style:Fm,"aria-hidden":r?void 0:!0,...s,"data-base-ui-focus-guard":""})}),Dc=Math.min,ol=Math.max,tm=Math.round,tu=Math.floor,sl=t=>({x:t,y:t}),l$={left:"right",right:"left",bottom:"top",top:"bottom"};function sP(t,e,n){return ol(t,Dc(e,n))}function fa(t,e){return typeof t=="function"?t(e):t}function fo(t){return t.split("-")[0]}function xa(t){return t.split("-")[1]}function Bw(t){return t==="x"?"y":"x"}function jw(t){return t==="y"?"height":"width"}function oo(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function _w(t){return Bw(oo(t))}function a$(t,e,n){n===void 0&&(n=!1);const r=xa(t),i=_w(t),s=jw(i);let a=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(a=nm(a)),[a,nm(a)]}function u$(t){const e=nm(t);return[$x(t),e,$x(e)]}function $x(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const AA=["left","right"],OA=["right","left"],c$=["top","bottom"],f$=["bottom","top"];function d$(t,e,n){switch(t){case"top":case"bottom":return n?e?OA:AA:e?AA:OA;case"left":case"right":return e?c$:f$;default:return[]}}function h$(t,e,n,r){const i=xa(t);let s=d$(fo(t),n==="start",r);return i&&(s=s.map(a=>a+"-"+i),e&&(s=s.concat(s.map($x)))),s}function nm(t){const e=fo(t);return l$[e]+t.slice(e.length)}function p$(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 lP(t){return typeof t!="number"?p$(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 Fp(t,e,n){return Math.floor(t/e)!==n}function la(t,e){return e<0||e>=t.length}function kg(t,e){return Ar(t.current,{disabledIndices:e})}function Ux(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&&Pc(t,s,r));return s}function g$(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===Iw?y="up":e.key===Hm&&(y="down"),y){const b=[],x=[];let S=!1,C=0;{let L=null,_=-1;t.forEach((N,B)=>{if(N==null)return;C+=1;const H=N.closest('[role="row"]');H&&(S=!0),(H!==L||_===-1)&&(L=H,_+=1,b[_]=[]),b[_].push(B),x[B]=_})}let T=!1,E=0;if(S)for(const L of b){const _=L.length;_>E&&(E=_),_!==a&&(T=!0)}const M=T&&C<t.length,k=E||a,D=L=>{if(!T||h===-1)return;const _=x[h];if(_==null)return;const N=b[_].indexOf(h),B=L==="up"?-1:1;for(let H=_+B,F=0;F<b.length;F+=1,H+=B){if(H<0||H>=b.length){if(!r||M)return;if(H=H<0?b.length-1:0,i){const j=Math.min(N,b[H].length-1),q=b[H][j]??b[H][0],$=i(e,h,q);H=x[$]??H}}const G=b[H];for(let j=Math.min(N,G.length-1);j>=0;j-=1){const q=G[j];if(!Pc(t,q,u))return q}}},O=L=>{if(!M||h===-1)return;const _=h%k,N=L==="up"?-k:k,B=d-d%k,H=tu(d/k)+1;for(let F=h-_+N,G=0;G<H;G+=1,F+=N){if(F<0||F>d){if(!r)return;F=F<0?B:0}const j=Math.min(F+k-1,d);for(let q=Math.min(F+_,j);q>=F;q-=1)if(!Pc(t,q,u))return q}};g&&Nr(e);const I=D(y)??O(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,_=d%k,N=d-(_-L);_===L?m=d:m=_>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)))}la(t,m)&&(m=h)}if(n==="both"){const b=tu(h/a);e.key===(s?lu:au)&&(g&&Nr(e),h%a!==a-1?(m=Ar(t,{startingIndex:h,disabledIndices:u}),r&&Fp(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))),Fp(m,a,b)&&(m=h)),e.key===(s?au:lu)&&(g&&Nr(e),h%a!==0?(m=Ar(t,{startingIndex:h,decrement:!0,disabledIndices:u}),r&&Fp(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))),Fp(m,a,b)&&(m=h));const x=tu(d/a)===b;la(t,m)&&(r&&x?(m=e.key===(s?au:lu)?d:Ar(t,{startingIndex:h-h%a-1,disabledIndices:u}),i&&(m=i(e,h,m))):m=h)}return m}function Pc(t,e,n){if(typeof n=="function"?n(e):n?.includes(e)??!1)return!0;const i=t[e];return i?!$m(i)||i.matches(":disabled")?!0:!n&&(i.hasAttribute("disabled")||i.getAttribute("aria-disabled")==="true"):!1}function m$(t){return t.visibility==="hidden"||t.visibility==="collapse"}function $m(t,e=t?Ci(t):null){return!t||!t.isConnected||!e||m$(e)?!1:typeof t.checkVisibility=="function"?t.checkVisibility():e.display!=="none"&&e.display!=="contents"}const y$='a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]';function v$(t){const e=t.assignedSlot;if(e)return e;if(t.parentElement)return t.parentElement;const n=t.getRootNode();return Oc(n)?n.host:null}function qx(t){for(const e of Array.from(t.children))if(_r(e)==="summary")return e;return null}function b$(t,e){const n=qx(e);return!!n&&(t===n||Ge(n,t))}function aP(t){const e=t?_r(t):"";return t!=null&&t.matches(y$)&&(e!=="summary"||t.parentElement!=null&&_r(t.parentElement)==="details"&&qx(t.parentElement)===t)&&(e!=="details"||qx(t)==null)&&(e!=="input"||t.type!=="hidden")}function uP(t){if(!aP(t)||!t.isConnected||t.matches(":disabled"))return!1;for(let e=t;e;e=v$(e)){const n=e!==t,r=_r(e)==="slot";if(e.hasAttribute("inert")||n&&_r(e)==="details"&&!e.open&&!b$(t,e)||e.hasAttribute("hidden")||!r&&!x$(e,n))return!1}return!0}function x$(t,e){const n=Ci(t);return e?n.display!=="none":$m(t,n)}function cP(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 tb(t){if(_r(t)!=="input")return null;const e=t;return e.type==="radio"&&e.name!==""?e:null}function S$(t,e){const n=tb(t);if(!n)return!0;const r=e.find(i=>{const s=tb(i);return s?.name===n.name&&s.form===n.form&&s.checked});return r?r===n:e.find(i=>{const s=tb(i);return s?.name===n.name&&s.form===n.form})===n}function fP(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 dP(t,e){fP(t).forEach(n=>{aP(n)&&e.push(n),dP(n,e)})}function hP(t,e,n){fP(t).forEach(r=>{cn(r)&&r.matches(e)&&n.push(r),hP(r,e,n)})}function Hw(t){return uP(t)&&cP(t)>=0}function pP(t){const e=[];return dP(t,e),e.filter(uP)}function rh(t){const e=pP(t);return e.filter(n=>cP(n)>=0&&S$(n,e))}function gP(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 Vw(t){return gP(vt(t).body,1)||t}function mP(t){return gP(vt(t).body,-1)||t}function yP(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 w$(t){return yP(t,1)}function C$(t){return yP(t,-1)}function mc(t,e){const n=e||t.currentTarget,r=t.relatedTarget;return!r||!Ge(n,r)}function R$(t){rh(t).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function kA(t){const e=[];hP(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 IA(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 $p=0;function Ig(t,e={}){const{preventScroll:n=!1,sync:r=!1,shouldFocus:i}=e;cancelAnimationFrame($p);function s(){i&&!i()||t?.focus({preventScroll:n})}if(r)return s(),On;const a=requestAnimationFrame(s);return $p=a,()=>{$p===a&&(cancelAnimationFrame(a),$p=0)}}const nb={inert:new WeakMap,"aria-hidden":new WeakMap},DA="data-base-ui-inert",Gx={inert:new WeakSet,"aria-hidden":new WeakSet};let Xf=new WeakMap,rb=0;function T$(t){return Gx[t]}function vP(t){return t?Oc(t)?t.host:vP(t.parentNode):null}const PA=(t,e)=>e.map(n=>{if(t.contains(n))return n;const r=vP(n);return t.contains(r)?r:null}).filter(n=>n!=null),zA=t=>{const e=new Set;return t.forEach(n=>{let r=n;for(;r&&!e.has(r);)e.add(r),r=r.parentNode}),e},NA=(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 E$(t,e,n,r,{mark:i=!0}){let s=null;r?s="inert":n&&(s="aria-hidden");let a=null,u=null;const c=PA(e,t),d=i?NA(e,zA(c),new Set(c)):[],h=[],g=[];if(s){const m=nb[s],y=T$(s);u=y,a=m;const b=PA(e,Array.from(e.querySelectorAll("[aria-live]"))),x=c.concat(b);NA(e,zA(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(DA,"")}),rb+=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(DA)}),rb-=1,rb||(nb.inert=new WeakMap,nb["aria-hidden"]=new WeakMap,Gx.inert=new WeakSet,Gx["aria-hidden"]=new WeakSet,Xf=new WeakMap)}}function LA(t,e={}){const{ariaHidden:n=!1,inert:r=!1,mark:i=!0}=e,s=vt(t[0]).body;return E$(t,s,n,r,{mark:i})}let BA=0;function M$(t,e="mui"){const[n,r]=R.useState(t),i=t||n;return R.useEffect(()=>{n==null&&(BA+=1,r(`${e}-${BA}`))},[n,e]),i}const jA=Nw.useId;function ha(t,e){if(jA!==void 0){const n=jA();return t??(e?`${e}-${n}`:n)}return M$(t,e)}const A$=500,O$=500,k$={style:{transition:"none"}},bP="data-base-ui-click-trigger",I$="data-base-ui-swipe-ignore",D$="data-swipe-ignore",P$=`[${I$}]`,z$=`[${D$}]`,Fw={fallbackAxisSide:"none"},xP={fallbackAxisSide:"end"},N$={clipPath:"inset(50%)",position:"fixed",top:0,left:0},SP=R.createContext(null),wP=()=>R.useContext(SP),L$=Pd("portal");function CP(t={}){const{ref:e,container:n,componentProps:r=gn,elementProps:i}=t,s=ha(),u=wP()?.portalNode,[c,d]=R.useState(null),[h,g]=R.useState(null),m=Ae(S=>{S!==null&&g(S)}),y=R.useRef(null);Oe(()=>{if(n===null){y.current&&(y.current=null,g(null),d(null));return}const S=(n&&(Aw(n)?n:n.current))??u??document.body;if(S==null){y.current&&(y.current=null,g(null),d(null));return}y.current!==S&&(y.current=S,g(null),d(S))},[n,u]);const b=rt("div",r,{ref:[e,m],props:[{id:s,[L$]:""},i]}),x=c&&b?go.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}=CP({container:u,ref:n,componentProps:e,elementProps:c}),m=R.useRef(null),y=R.useRef(null),b=R.useRef(null),x=R.useRef(null),[S,C]=R.useState(null),T=R.useRef(!1),E=S?.modal,M=S?.open,k=!!S&&!S.modal&&S.open&&!!d;R.useEffect(()=>{if(!d||E)return;function O(I){d&&I.relatedTarget&&mc(I)&&(I.type==="focusin"?T.current&&(kA(d),T.current=!1):(R$(d),T.current=!0))}return zo(yt(d,"focusin",O,!0),yt(d,"focusout",O,!0))},[d,E]),Oe(()=>{!d||M!==!0||!T.current||(kA(d),T.current=!1)},[M,d]);const D=R.useMemo(()=>({beforeOutsideRef:m,afterOutsideRef:y,beforeInsideRef:b,afterInsideRef:x,portalNode:d,setFocusManagerState:C}),[d]);return A.jsxs(R.Fragment,{children:[g,A.jsxs(SP.Provider,{value:D,children:[k&&d&&A.jsx(du,{"data-type":"outside",ref:m,onFocus:O=>{if(mc(O,d))b.current?.focus();else{const I=S?S.domReference:null;mP(I)?.focus()}}}),k&&d&&A.jsx("span",{"aria-owns":h,style:N$}),d&&go.createPortal(a,d),k&&d&&A.jsx(du,{"data-type":"outside",ref:y,onFocus:O=>{if(mc(O,d))x.current?.focus();else{const I=S?S.domReference:null;Vw(I)?.focus(),S?.closeOnFocusOut&&S?.onOpenChange(!1,Ue(ca,O.nativeEvent))}}})]})]})});function RP(){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 $w{nodesRef={current:[]};events=RP();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 TP=R.createContext(null),EP=R.createContext(null),Sa=()=>R.useContext(TP)?.id||null,wa=t=>{const e=R.useContext(EP);return t??e};function MP(t){const e=ha(),n=wa(t),r=Sa();return Oe(()=>{if(!e)return;const i={id:e,parentId:r};return n?.addNode(i),()=>{n?.removeNode(i)}},[n,e,r]),e}function B$(t){const{children:e,id:n}=t,r=Sa();return A.jsx(TP.Provider,{value:R.useMemo(()=>({id:n,parentId:r}),[n,r]),children:e})}function j$(t){const{children:e,externalTree:n}=t,r=Qn(()=>n??new $w).current;return A.jsx(EP.Provider,{value:r,children:e})}function Qs(t){return t==null?t:"current"in t?t.current:t}function _$(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 _A=20;let ta=[];function Uw(){ta=ta.filter(t=>t.deref()?.isConnected)}function HA(t){Uw(),t&&_r(t)!=="body"&&(ta.push(new WeakRef(t)),ta.length>_A&&(ta=ta.slice(-_A)))}function VA(){return Uw(),ta[ta.length-1]?.deref()}function H$(t){return t?Hw(t)?t:rh(t)[0]||t:null}function FA(t){if(t.hasAttribute("tabindex")&&!t.hasAttribute("data-tabindex")||!t.getAttribute("role")?.includes("dialog"))return;const n=pP(t).filter(i=>{const s=i.getAttribute("data-tabindex")||"";return Hw(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 qm(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,S=x.useState("open"),C=x.useState("domReferenceElement"),T=x.useState("floatingElement"),{events:E,dataRef:M}=x.context,k=Ae(()=>M.current.floatingContext?.nodeId),D=i===!1,O=Vx(C)&&D,I=Un(i),L=Un(s),_=Un(d),N=Un(S),B=wa(y),H=wP(),F=R.useRef(!1),G=R.useRef(!1),j=R.useRef(!1),q=R.useRef(null),$=R.useRef(""),X=R.useRef(""),Z=R.useRef(null),z=R.useRef(null),U=Cs(Z,m,H?.beforeInsideRef),W=Cs(z,H?.afterInsideRef),K=lr(),ie=lr(),ee=Ic(),ae=H!=null,Y=em(T),se=Ae((he=Y)=>he?rh(he):[]),ve=Ae(()=>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&&!O&&Nr(Te)}const pe=vt(Y);return yt(pe,"keydown",he)},[r,Y,u,O,se]),R.useEffect(()=>{if(r||!S)return;const he=vt(Y);function pe(){j.current=!1}function Te(Pe){const Ee=mn(Pe),_e=ve(),Me=Ge(T,Ee)||Ge(C,Ee)||Ge(H?.portalNode,Ee)||_e.some(oe=>oe===Ee||Ge(oe,Ee));j.current=!Me,X.current=Pe.pointerType||"keyboard",Ee?.closest(`[${bP}]`)&&(G.current=!0,ie.start(0,()=>{G.current=!1}))}function De(){X.current="keyboard"}return zo(yt(he,"pointerdown",Te,!0),yt(he,"pointerup",pe,!0),yt(he,"pointercancel",pe,!0),yt(he,"keydown",De,!0),pe)},[r,T,C,Y,S,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);Hw(Me)&&(q.current=Me)}function De(_e){const Me=_e.relatedTarget,oe=_e.currentTarget,xe=mn(_e);u&&Me==null&&xe!=null&&Ge(T,xe)&&HA(xe),queueMicrotask(()=>{const ze=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,Qs(g),Qs(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||B&&(da(B.nodesRef.current,ze).find(de=>Ge(de.context?.elements.floating,Me)||Ge(de.context?.elements.domReference,Me))||IA(B.nodesRef.current,ze).find(de=>[de.context?.elements.floating,em(de.context?.elements.floating)].includes(Me)||de.context?.elements.domReference===Me)));if(oe===C&&Y&&FA(Y),a&&oe!==C&&!$m(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}(O||!u)&&Me&&we&&!G.current&&(O||Me!==VA())&&(F.current=!0,x.setOpen(!1,Ue(ca,_e)))})}function Pe(){j.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",De),Ee&&yt(Ee,"pointerdown",pe),T&&yt(T,"focusin",Te),T&&yt(T,"focusout",De),T&&H&&yt(T,"focusout",Pe,!0))},[r,C,T,Y,u,B,H,x,c,a,se,O,k,M,K,ie,ee,h,g,ve]),R.useEffect(()=>{if(r||!T||!S)return;const he=Array.from(H?.portalNode?.querySelectorAll(`[${Pd("portal")}]`)||[]),Te=(B?IA(B.nodesRef.current,k()):[]).find(oe=>Vx(oe.context?.elements.domReference||null))?.context?.elements.domReference,Pe=[...[T,...he,Z.current,z.current,H?.beforeOutsideRef.current,H?.afterOutsideRef.current,...ve()],Te,Qs(g),Qs(h),O?C:null].filter(oe=>oe!=null),Ee=LA(Pe,{ariaHidden:u||O,mark:!1}),_e=[T,...he].filter(oe=>oe!=null),Me=LA(_e);return()=>{Me(),Ee()}},[S,r,C,T,u,H,O,B,k,h,g,ve]),Oe(()=>{if(!S||r||!cn(Y))return;$.current="",X.current="";const he=vt(Y),pe=ir(he);queueMicrotask(()=>{const Te=I.current,De=typeof Te=="function"?Te(_.current||""):Te;if(De===void 0||De===!1||Ge(Y,pe))return;let Ee=null;const _e=()=>(Ee==null&&(Ee=se(Y)),Ee[0]||Y);let Me;De===!0||De===null?Me=_e():Me=Qs(De),Me=Me||_e();const oe=Ge(Y,ir(he));Ig(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,S,Y,se,I,_,N]),Oe(()=>{if(r||!Y)return;const he=vt(Y),pe=ir(he),Te=_.current==null;HA(pe);function De(Ee){if(Ee.open||($.current=_$(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(Ew(Ee.nativeEvent)||Mw(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",De);function Pe(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 ze=Te?xe||oe:oe||xe;return ze||(ze=VA()||null),typeof Me=="boolean"?ze:Qs(Me)||ze||null}return()=>{E.off("openchange",De);const Ee=ir(he),_e=ve(),Me=Ge(T,Ee)||_e.some(ne=>ne===Ee||Ge(ne,Ee))||B&&da(B.nodesRef.current,k(),!1).some(ne=>Ge(ne.context?.elements.floating,Ee)),oe=L.current,xe=$.current,ze=Pe(xe);queueMicrotask(()=>{const ne=H$(ze),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,_,E,B,C,k,ve]),Oe(()=>{if(!dl||S||!T)return;const he=ir(vt(T));!cn(he)||!Vm(he)||Ge(T,he)&&he.blur()},[S,T]),Oe(()=>{if(!(r||!H))return H.setFocusManagerState({modal:u,closeOnFocusOut:c,open:S,onOpenChange:x.setOpen,domReference:C}),()=>{H.setFocusManagerState(null)}},[r,H,u,S,x,c,C]),Oe(()=>{if(!(r||!Y))return FA(Y),()=>{queueMicrotask(Uw)}},[r,Y]);const ye=!r&&(u?!O:!0)&&(ae||u);return A.jsxs(R.Fragment,{children:[ye&&A.jsx(du,{"data-type":"inside",ref:U,onFocus:he=>{if(u){const pe=se();Ig(pe[pe.length-1])}else H?.portalNode&&(F.current=!1,mc(he,H.portalNode)?Vw(C)?.focus():Qs(g??H.beforeOutsideRef)?.focus())}}),n,ye&&A.jsx(du,{"data-type":"inside",ref:W,onFocus:he=>{u?Ig(se()[0]):H?.portalNode&&(c&&(F.current=!0),mc(he,H.portalNode)?mP(C)?.focus():Qs(h??H.afterOutsideRef)?.focus())}})]})}function Gm(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=Ic(),y=lr(),b=R.useMemo(()=>{function x(C,T,E,M){const k=Ue(c,T,E);C&&M==="touch"&&u>0?y.start(u,()=>{d.setOpen(!0,k)}):d.setOpen(C,k)}function S(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=sa(C.pointerType,!0)&&Mw(C.nativeEvent)?"virtual":C.pointerType},onMouseDown(C){const T=g.current,E=C.nativeEvent,M=d.select("open");if(C.button!==0||r==="click"||sa(T,!0)&&s)return;const k=S(M,C.currentTarget,I=>I==="click"||I==="mousedown"),D=mn(E);if(Vm(D)){x(k,E,D,T);return}const O=C.currentTarget;m.request(()=>{x(k,E,O,T)})},onClick(C){if(r==="mousedown-only")return;const T=g.current;if(r==="mousedown"&&T){g.current=void 0;return}if(sa(T,!0)&&s)return;const E=d.select("open"),M=S(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 V$(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 $A(t){return t!=null&&t.clientX!=null}function F$(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=Ae(M=>{i.set("positionReference",M)}),S=Ae((M,k,D)=>{d.current||c.current.openEvent&&!$A(c.current.openEvent)||i.set("positionReference",V$(D??u,{x:M,y:k,axis:r,dataRef:c,pointerType:g}))}),C=Ae(M=>{s?h.current||(S(M.clientX,M.clientY,M.currentTarget),b([])):S(M.clientX,M.clientY,M.currentTarget)}),T=sa(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 D(O){const I=mn(O);Ge(a,I)?M():S(O.clientX,O.clientY)}return!c.current.openEvent||$A(c.current.openEvent)?h.current=yt(k,"mousemove",D):x(u),M},[T,n,a,c,u,i,S,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 $$(){return!1}function U$(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=$$,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=wa(c),b=Ae(typeof i=="function"?i:()=>!1),x=typeof i=="function"?b:i,S=x!==!1,C=Ae(()=>s),{escapeKey:T,outsidePress:E}=U$(u),M=R.useRef(!1),k=R.useRef(!1),D=R.useRef(!1),O=R.useRef(!1),I=R.useRef(""),L=R.useRef(null),_=lr(),N=lr(),B=Ae(()=>{N.clear(),m.current.insideReactTree=!1}),H=Ae(U=>{const W=m.current.floatingContext?.nodeId;return(y?da(y.nodesRef.current,W):[]).some(ie=>ie.context?.open&&!ie.context.dataRef.current[U])}),F=Ae(U=>J0(U,d.select("floatingElement"))||J0(U,d.select("domReferenceElement"))),G=Ae(U=>{a()&&d.setOpen(!1,Ue(Gc,U.nativeEvent))}),j=Ae(U=>{if(!h||!n||!r||U.key!=="Escape"||O.current||!T&&H("__escapeKeyBubbles"))return;const W=F6(U)?U.nativeEvent:U,K=Ue(Wc,W);d.setOpen(!1,K),K.isCanceled||U.preventDefault(),!T&&!K.isPropagationAllowed&&U.stopPropagation()}),q=Ae(()=>{m.current.insideReactTree=!0,N.start(0,B)}),$=Ae(U=>{if(!h||!n||U.button!==0)return;const W=mn(U.nativeEvent);Ge(d.select("floatingElement"),W)&&(M.current||(M.current=!0,k.current=!1))}),X=Ae(U=>{!h||!n||(U.defaultPrevented||U.nativeEvent.defaultPrevented)&&M.current&&(k.current=!0)});R.useEffect(()=>{if(!h||!n)return B;m.current.__escapeKeyBubbles=T,m.current.__outsidePressBubbles=E;const U=new _i,W=new _i;function K(){U.clear(),O.current=!0}function ie(){U.start(dl?5:0,()=>{O.current=!1})}function ee(){D.current=!0,W.start(0,()=>{D.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=>J0(J,de.context?.elements.floating));return F(J)||we}function ye(J){if(se(J)){J.type!=="click"&&!F(J)&&(W.clear(),D.current=!1),B();return}if(m.current.insideReactTree){B();return}const le=mn(J),we=`[${Pd("inert")}]`,de=It(le)?le.getRootNode():null,me=Array.from((Oc(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&&!il(Ke);){const wt=al(Ke);if(il(wt)||!It(wt))break;Ke=wt}if(!(me.length&&It(le)&&!K6(le)&&!Ge(le,d.select("floatingElement"))&&me.every(wt=>!Ge(Ke,wt)))){if(cn(le)&&!("touches"in J)){const wt=il(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"&&D.current){W.clear(),D.current=!1;return}typeof x=="function"&&!x(J)||H("__outsidePressBubbles")||(d.setOpen(!1,Ue(nh,J)),B())}}}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},_.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 De(J){I.current="touch",Te(J,pe)}function Pe(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(),D.current=!0,B())}}}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),_.clear(),L.current=null)}function Me(J){Te(J,_e)}function oe(J){Y()!=="sloppy"||!L.current||F(J)||(L.current.dismissOnTouchEnd&&ye(J),_.clear(),L.current=null)}function xe(J){Te(J,oe)}const ze=vt(g),ne=zo(r&&zo(yt(ze,"keydown",j),yt(ze,"compositionstart",K),yt(ze,"compositionend",ie)),S&&zo(yt(ze,"click",Pe,!0),yt(ze,"pointerdown",Pe,!0),yt(ze,"pointerup",Ee,!0),yt(ze,"pointercancel",Ee,!0),yt(ze,"mousedown",Pe,!0),yt(ze,"mouseup",Ee,!0),yt(ze,"touchstart",De,!0),yt(ze,"touchmove",Me,!0),yt(ze,"touchend",xe,!0)));return()=>{ne(),U.clear(),W.clear(),ae(),D.current=!1,B()}},[m,g,r,S,x,h,n,T,E,j,B,C,H,F,y,d,_]);const Z=R.useMemo(()=>({onKeyDown:j,onPointerDown:G,onClick:G}),[j,G]),z=R.useMemo(()=>({onKeyDown:j,onPointerDown:X,onMouseDown:X,onClickCapture:q,onMouseDownCapture(U){q(),$(U)},onPointerDownCapture(U){q(),$(U)},onMouseUpCapture:q,onTouchEndCapture:q,onTouchMoveCapture:q}),[j,q,$,X]);return R.useMemo(()=>n?{reference:Z,floating:z,trigger:Z}:{},[n,Z,z])}function UA(t,e,n){let{reference:r,floating:i}=t;const s=oo(e),a=_w(e),u=jw(a),c=fo(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=xa(e);return b&&(y[a]+=m*(b==="end"?1:-1)*(n&&d?-1:1)),y}async function q$(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=lP(y),S=u[m?g==="floating"?"reference":"floating":g],C=Dd(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(S)))==null||n?S:S.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 G$=50,W$=async(t,e,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:s=[],platform:a}=n,u=a.detectOverflow?a:{...a,detectOverflow:q$},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}=UA(d,r,c),m=r,y=0;const b={};for(let x=0;x<s.length;x++){const S=s[x];if(!S)continue;const{name:C,fn:T}=S,{x:E,y:M,data:k,reset:D}=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},D&&y<G$&&(y++,typeof D=="object"&&(D.placement&&(m=D.placement),D.rects&&(d=D.rects===!0?await a.getElementRects({reference:t,floating:e,strategy:i}):D.rects),{x:h,y:g}=UA(d,m,c)),x=-1)}return{x:h,y:g,placement:m,strategy:i,middlewareData:b}},K$=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,...S}=fa(t,e);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const C=fo(i),T=oo(u),E=fo(u)===u,M=await(c.isRTL==null?void 0:c.isRTL(d.floating)),k=m||(E||!x?[nm(u)]:u$(u)),D=b!=="none";!m&&D&&k.push(...h$(u,x,b,M));const O=[u,...k],I=await c.detectOverflow(e,S),L=[];let _=((r=s.flip)==null?void 0:r.overflows)||[];if(h&&L.push(I[C]),g){const F=a$(i,a,M);L.push(I[F[0]],I[F[1]])}if(_=[..._,{placement:i,overflows:L}],!L.every(F=>F<=0)){var N,B;const F=(((N=s.flip)==null?void 0:N.index)||0)+1,G=O[F];if(G&&(!(g==="alignment"?T!==oo(G):!1)||_.every($=>oo($.placement)===T?$.overflows[0]>0:!0)))return{data:{index:F,overflows:_},reset:{placement:G}};let j=(B=_.filter(q=>q.overflows[0]<=0).sort((q,$)=>q.overflows[1]-$.overflows[1])[0])==null?void 0:B.placement;if(!j)switch(y){case"bestFit":{var H;const q=(H=_.filter($=>{if(D){const X=oo($.placement);return X===T||X==="y"}return!0}).map($=>[$.placement,$.overflows.filter(X=>X>0).reduce((X,Z)=>X+Z,0)]).sort(($,X)=>$[1]-X[1])[0])==null?void 0:H[0];q&&(j=q);break}case"initialPlacement":j=u;break}if(i!==j)return{reset:{placement:j}}}return{}}}},AP=new Set(["left","top"]);async function Y$(t,e){const{placement:n,platform:r,elements:i}=t,s=await(r.isRTL==null?void 0:r.isRTL(i.floating)),a=fo(n),u=xa(n),c=oo(n)==="y",d=AP.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 X$=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 Y$(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}}}}},Q$=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=oo(i),y=Bw(m);let b=h[y],x=h[m];const S=(T,E)=>sP(E+g[T==="y"?"top":"left"],E,E-g[T==="y"?"bottom":"right"]);a&&(b=S(y,b)),u&&(x=S(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}}}}}},Z$=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=oo(a),b=Bw(y);let x=m[b],S=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",D=u.reference[b]-u.floating[k]+T.mainAxis,O=u.reference[b]+u.reference[k]-T.mainAxis;x<D?x=D:x>O&&(x=O)}if(g){var E,M;const k=b==="y"?"width":"height",D=AP.has(fo(a)),O=u.reference[y]-u.floating[k]+(D&&((E=c.offset)==null?void 0:E[y])||0)+(D?0:T.crossAxis),I=u.reference[y]+u.reference[k]+(D?0:((M=c.offset)==null?void 0:M[y])||0)-(D?T.crossAxis:0);S<O?S=O:S>I&&(S=I)}return{[b]:x,[y]:S}}}},J$=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=fo(n),h=xa(n),g=oo(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 S=y-c.top-c.bottom,C=m-c.left-c.right,T=Dc(y-c[b],S),E=Dc(m-c[x],C),M=e.middlewareData.shift,k=!M;let D=T,O=E;M!=null&&M.enabled.x&&(O=C),M!=null&&M.enabled.y&&(D=S),k&&!h&&(g?O=m-2*ol(c.left,c.right):D=y-2*ol(c.top,c.bottom)),await a({...e,availableWidth:O,availableHeight:D});const I=await i.getDimensions(s.floating);return m!==I.width||y!==I.height?{reset:{rects:!0}}:{}}}};function OP(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=tm(n)!==s||tm(r)!==a;return u&&(n=s,r=a),{width:n,height:r,$:u}}function qw(t){return It(t)?t:t.contextElement}function yc(t){const e=qw(t);if(!cn(e))return sl(1);const n=e.getBoundingClientRect(),{width:r,height:i,$:s}=OP(e);let a=(s?tm(n.width):n.width)/r,u=(s?tm(n.height):n.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!u||!Number.isFinite(u))&&(u=1),{x:a,y:u}}const eU=sl(0);function kP(t){const e=Rn(t);return!kw()||!e.visualViewport?eU:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function tU(t,e,n){return e===void 0&&(e=!1),!!n&&e&&n===Rn(t)}function hu(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),s=qw(t);let a=sl(1);e&&(r?It(r)&&(a=yc(r)):a=yc(t));const u=tU(s,n,r)?kP(s):sl(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=_x(b);for(;x&&y!==b;){const S=yc(x),C=x.getBoundingClientRect(),T=Ci(x),E=C.left+(x.clientLeft+parseFloat(T.paddingLeft))*S.x,M=C.top+(x.clientTop+parseFloat(T.paddingTop))*S.y;c*=S.x,d*=S.y,h*=S.x,g*=S.y,c+=E,d+=M,b=Rn(x),x=_x(b)}}return Dd({width:h,height:g,x:c,y:d})}function Wm(t,e){const n=_m(t).scrollLeft;return e?e.left+n:hu(hl(t)).left+n}function IP(t,e){const n=t.getBoundingClientRect(),r=n.left+e.scrollLeft-Wm(t,n),i=n.top+e.scrollTop;return{x:r,y:i}}function nU(t){let{elements:e,rect:n,offsetParent:r,strategy:i}=t;const s=i==="fixed",a=hl(r),u=e?jm(e.floating):!1;if(r===a||u&&s)return n;let c={scrollLeft:0,scrollTop:0},d=sl(1);const h=sl(0),g=cn(r);if((g||!s)&&((_r(r)!=="body"||th(a))&&(c=_m(r)),g)){const y=hu(r);d=yc(r),h.x=y.x+r.clientLeft,h.y=y.y+r.clientTop}const m=a&&!g&&!s?IP(a,c):sl(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 rU(t){return t.getClientRects?Array.from(t.getClientRects()):[]}function iU(t){const e=_m(t),n=t.ownerDocument.body,r=ol(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),i=ol(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let s=-e.scrollLeft+Wm(t);const a=-e.scrollTop;return Ci(n).direction==="rtl"&&(s+=ol(t.clientWidth,n.clientWidth)-r),{width:r,height:i,x:s,y:a}}const oU=25;function sU(t,e,n){n===void 0&&(n="viewport");const r=n==="layoutViewport",i=Rn(t),s=hl(t),a=i.visualViewport;let u=s.clientWidth,c=s.clientHeight,d=0,h=0;if(a){const m=!kw()||e==="fixed";r?m||(d=-a.offsetLeft,h=-a.offsetTop):(u=a.width,c=a.height,m&&(d=a.offsetLeft,h=a.offsetTop))}if(Wm(s)<=0){const m=s.ownerDocument,y=m.body,b=getComputedStyle(y),x=m.compatMode==="CSS1Compat"&&parseFloat(b.marginLeft)+parseFloat(b.marginRight)||0,S=Math.abs(s.clientWidth-y.clientWidth-x),C=getComputedStyle(s).scrollbarGutter==="stable both-edges"?S/2:S;C<=oU&&(u-=C)}return{width:u,height:c,x:d,y:h}}function lU(t,e){const n=hu(t,!0,e==="fixed"),r=n.top+t.clientTop,i=n.left+t.clientLeft,s=yc(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 qA(t,e,n){let r;if(e==="viewport"||e==="layoutViewport")r=sU(t,n,e);else if(e==="document")r=iU(hl(t));else if(It(e))r=lU(e,n);else{const i=kP(t);r={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return Dd(r)}function aU(t,e){const n=e.get(t);if(n)return n;let r=kc(t,[],!1).filter(u=>It(u)&&_r(u)!=="body"),i=null;const s=Ci(t).position==="fixed";let a=s?al(t):t;for(;It(a)&&!il(a);){const u=Ci(a),c=Ow(a),d=i?i.position:s?"fixed":"";!c&&(d==="fixed"||d==="absolute"&&u.position==="static")?r=r.filter(g=>g!==a):i=u,a=al(a)}return e.set(t,r),r}function uU(t){let{element:e,boundary:n,rootBoundary:r,strategy:i}=t;const a=[...n==="clippingAncestors"?jm(e)?[]:aU(e,this._c):[].concat(n),r],u=qA(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=qA(e,a[m],i);c=ol(y.top,c),d=Dc(y.right,d),h=Dc(y.bottom,h),g=ol(y.left,g)}return{width:d-g,height:h-c,x:g,y:c}}function cU(t){const{width:e,height:n}=OP(t);return{width:e,height:n}}function fU(t,e,n){const r=cn(e),i=hl(e),s=n==="fixed",a=hu(t,!0,s,e);let u={scrollLeft:0,scrollTop:0};const c=sl(0);if((r||!s)&&((_r(e)!=="body"||th(i))&&(u=_m(e)),r)){const m=hu(e,!0,s,e);c.x=m.x+e.clientLeft,c.y=m.y+e.clientTop}!r&&i&&(c.x=Wm(i));const d=i&&!r&&!s?IP(i,u):sl(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 ib(t){return Ci(t).position==="static"}function GA(t,e){if(!cn(t)||Ci(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return hl(t)===n&&(n=n.ownerDocument.body),n}function DP(t,e){const n=Rn(t);if(jm(t))return n;if(!cn(t)){let i=al(t);for(;i&&!il(i);){if(It(i)&&!ib(i))return i;i=al(i)}return n}let r=GA(t,e);for(;r&&U6(r)&&ib(r);)r=GA(r,e);return r&&il(r)&&ib(r)&&!Ow(r)?n:r||W6(t)||n}const dU=async function(t){const e=this.getOffsetParent||DP,n=this.getDimensions,r=await n(t.floating);return{reference:fU(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function hU(t){return Ci(t).direction==="rtl"}const PP={convertOffsetParentRelativeRectToViewportRelativeRect:nU,getDocumentElement:hl,getClippingRect:uU,getOffsetParent:DP,getElementRects:dU,getClientRects:rU,getDimensions:cU,getScale:yc,isElement:It,isRTL:hU};function zP(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function pU(t,e,n){let r=null,i;const s=hl(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:S}=m;if(h||e(),!x||!S)return;const C=tu(b),T=tu(s.clientWidth-(y+x)),E=tu(s.clientHeight-(b+S)),M=tu(y),D={rootMargin:-C+"px "+-T+"px "+-E+"px "+-M+"px",threshold:ol(0,Dc(1,g))||1};let O=!0;function I(L){const _=L[0].intersectionRatio;if(!zP(m,t.getBoundingClientRect()))return u();if(_!==g){if(!O)return u();_?u(!1,_):i=setTimeout(()=>{u(!1,1e-7)},1e3)}O=!1}try{r=new IntersectionObserver(I,{...D,root:s.ownerDocument})}catch{r=new IntersectionObserver(I,D)}r.observe(t)}const c=Rn(t),d=()=>u(n);return c.addEventListener("resize",d),u(!0),()=>{c.removeEventListener("resize",d),a()}}function WA(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=qw(t),h=i||s?[...d?kc(d):[],...e?kc(e):[]]:[];h.forEach(C=>{i&&C.addEventListener("scroll",n),s&&C.addEventListener("resize",n)});const g=d&&u?pU(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?hu(t):null;c&&S();function S(){const C=hu(t);x&&!zP(x,C)&&n(),x=C,b=requestAnimationFrame(S)}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 gU=X$,mU=Q$,yU=K$,vU=J$,bU=Z$,xU=(t,e,n)=>{const r=new Map,i=n??{},s={...PP,...i.platform,_c:r};return W$(t,e,{...i,platform:s})};var SU=typeof document<"u",wU=function(){},Dg=SU?R.useLayoutEffect:wU;function rm(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(!rm(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)&&!rm(t[s],e[s]))return!1}return!0}return t!==t&&e!==e}function NP(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function KA(t,e){const n=NP(t);return Math.round(e*n)/n}function ob(t){const e=R.useRef(t);return Dg(()=>{e.current=t}),e}function CU(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);rm(m,r)||y(r);const[b,x]=R.useState(null),[S,C]=R.useState(null),T=R.useCallback($=>{$!==D.current&&(D.current=$,x($))},[]),E=R.useCallback($=>{$!==O.current&&(O.current=$,C($))},[]),M=s||b,k=a||S,D=R.useRef(null),O=R.useRef(null),I=R.useRef(h),L=c!=null,_=ob(c),N=ob(i),B=ob(d),H=R.useCallback(()=>{if(!D.current||!O.current)return;const $={placement:e,strategy:n,middleware:m};N.current&&($.platform=N.current),xU(D.current,O.current,$).then(X=>{const Z={...X,isPositioned:B.current!==!1};F.current&&!rm(I.current,Z)&&(I.current=Z,go.flushSync(()=>{g(Z)}))})},[m,e,n,N,B]);Dg(()=>{d===!1&&I.current.isPositioned&&(I.current.isPositioned=!1,g($=>({...$,isPositioned:!1})))},[d]);const F=R.useRef(!1);Dg(()=>(F.current=!0,()=>{F.current=!1}),[]),Dg(()=>{if(M&&(D.current=M),k&&(O.current=k),M&&k){if(_.current)return _.current(M,k,H);H()}},[M,k,H,_,L]);const G=R.useMemo(()=>({reference:D,floating:O,setReference:T,setFloating:E}),[T,E]),j=R.useMemo(()=>({reference:M,floating:k}),[M,k]),q=R.useMemo(()=>{const $={position:n,left:0,top:0};if(!j.floating)return $;const X=KA(j.floating,h.x),Z=KA(j.floating,h.y);return u?{...$,transform:"translate("+X+"px, "+Z+"px)",...NP(j.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:X,top:Z}},[n,u,j.floating,h.x,h.y]);return R.useMemo(()=>({...h,update:H,refs:G,elements:j,floatingStyles:q}),[h,H,G,j,q])}const RU=(t,e)=>{const n=gU(t);return{name:n.name,fn:n.fn,options:[t,e]}},TU=(t,e)=>{const n=mU(t);return{name:n.name,fn:n.fn,options:[t,e]}},EU=(t,e)=>({fn:bU(t).fn,options:[t,e]}),MU=(t,e)=>{const n=yU(t);return{name:n.name,fn:n.fn,options:[t,e]}},AU=(t,e)=>{const n=vU(t);return{name:n.name,fn:n.fn,options:[t,e]}};var sb={exports:{}},lb={};var YA;function OU(){if(YA)return lb;YA=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,S=b[1];return s(function(){x.value=y,x.getSnapshot=m,c(x)&&S({inst:x})},[g,y,m]),i(function(){return c(x)&&S({inst:x}),g(function(){c(x)&&S({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 lb.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:h,lb}var XA;function LP(){return XA||(XA=1,sb.exports=OU()),sb.exports}var Gw=LP(),ab={exports:{}},ub={};var QA;function kU(){if(QA)return ub;QA=1;var t=Zd(),e=LP();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 ub.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(D){if(!T){if(T=!0,E=D,D=m(D),y!==void 0&&x.hasValue){var O=x.value;if(y(O,D))return M=O}return M=D}if(O=M,r(E,D))return O;var I=m(D);return y!==void 0&&y(O,I)?(E=D,O):(E=D,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 S=i(d,b[0],b[1]);return a(function(){x.hasValue=!0,x.value=S},[S]),c(S),S},ub}var ZA;function IU(){return ZA||(ZA=1,ab.exports=kU()),ab.exports}var DU=IU();const PU=yw(19),zU=PU?LU:BU;function Se(t,e,n,r,i){return zU(t,e,n,r,i)}function NU(t,e,n,r,i){const s=R.useCallback(()=>e(t.getSnapshot(),n,r,i),[t,e,n,r,i]);return Gw.useSyncExternalStore(t.subscribe,s,s)}P6({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()}}),Gw.useSyncExternalStore(t.subscribe,t.getSnapshot,t.getSnapshot))}});function LU(t,e,n,r,i){const s=D6();if(!s)return NU(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 BU(t,e,n,r,i){return DU.useSyncExternalStoreWithSelector(t.subscribe,t.getSnapshot,t.getSnapshot,s=>e(s,n,r,i))}class BP{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 BP{constructor(e,n={},r){super(e),this.context=n,this.selectors=r}useSyncedValue(e,n){R.useDebugValue(e);const r=this;Oe(()=>{r.state[e]!==n&&r.set(e,n)},[r,e,n])}useSyncedValueWithCleanup(e,n){const r=this;Oe(()=>(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);Oe(()=>{n.update(e)},[n,...r])}useControlledProp(e,n){R.useDebugValue(e);const r=this,i=n!==void 0;Oe(()=>{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=Ae(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 jU={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 Km 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:RP(),nested:r,triggerElements:s},jU),this.syncOnly=n}syncOpenEvent=(e,n)=>{(!e||!this.state.open||n!=null&&$6(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 jP(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 Km({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),Oe(()=>{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 pl(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),Oe(()=>{if(!t&&s&&r!=="ending"&&n){const u=cs.request(()=>{i("ending")});return()=>{cs.cancel(u)}}},[t,s,r,n]),Oe(()=>{if(!t||e)return;const u=cs.request(()=>{i(void 0)});return()=>{cs.cancel(u)}},[e,t]),Oe(()=>{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 _P(t,e=!1){const n=Ic();return Ae((r,i=null)=>{n.cancel();const s=Qs(t);if(s==null)return;const a=s,u=()=>{go.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 ci(t){const{enabled:e=!0,open:n,ref:r,onComplete:i}=t,s=Ae(i),a=_P(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,[Hx]:""};function _U(t){return e=>e==="touch"?t.current:!0}function HP(t,e=!1){const n=ha(),r=Sa()!=null,i=Qn(()=>t(n,r)).current;return jP({popupStore:i,treatPopupAsFloatingElement:e,floatingRootContext:i.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:i.setOpen}),i}function Ww({handle:t,store:e}){return Oe(()=>t.attachStore(e),[t,e]),null}function HU(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 Kw(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 VP(t){let e=!1;return t.preventUnmountOnClose=()=>{e=!0},()=>e}function VU(t,e,n,r={}){const i=n.reason,s=i===Sr,a=e&&i===gc,u=!e&&(i===Gc||i===Wc),c=VP(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),Kw(h,e,n.trigger,c()),t.update(h)};s?go.flushSync(d):d()}function Yw(t,e,n,r){const i=n.useState("isMountedByTrigger",t),s=HU(t,n),a=Ae(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 Oe(()=>{i&&n.update({activeTriggerElement:e.current,...r})},[i,n,e,...Object.values(r)]),{registerTrigger:u,isMountedByThisTrigger:i}}function Xw(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");Oe(()=>{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=Ue(gr);t.setOpen(!1,m),m.isCanceled||t.update({activeTriggerId:null,activeTriggerElement:null})}})},[i,t,s,a,u,n])}function Qw(t,e,n){const{mounted:r,setMounted:i,transitionStatus:s}=pl(t),a=e.useState("preventUnmountingOnClose"),u=t?!1:a;e.useSyncedValues({mounted:r,transitionStatus:s,preventUnmountingOnClose:u});const c=Ae(()=>{i(!1),e.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),e.context.onOpenChangeComplete?.(!1)});return ci({enabled:r&&!t&&!u,open:t,ref:e.context.popupRef,onComplete(){t||c()}}),{forceUnmount:c,transitionStatus:s}}function Zw(t,e){t.useSyncedValues(e),Oe(()=>()=>{t.update({activeTriggerProps:gn,inactiveTriggerProps:gn,popupProps:gn})},[t])}function FU(t,e){Oe(()=>{!e&&t.state.openMethod!==null&&t.set("openMethod",null)},[e,t]),Oe(()=>()=>{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 $U(){return new Km({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:new sh,floatingId:void 0,syncOnly:!1,nested:!1,onOpenChange:void 0})}function Jw(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:$U(),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 FP(t,e,n=!1){return new Km({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,e1=t=>t.openProp??t.open,JA=t=>(t.popupElement?.id??t.floatingId)||void 0;function $P(t,e){return e!==void 0&&e1(t)&&hd(t)===e}function UU(t,e){return $P(t,e)?!0:e!==void 0&&e1(t)&&hd(t)==null&&t.triggerCount===1}const t1={open:e1,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:JA,isTriggerActive:(t,e)=>e!==void 0&&hd(t)===e,isOpenedByTrigger:(t,e)=>$P(t,e),isMountedByTrigger:(t,e)=>e!==void 0&&hd(t)===e&&t.mounted,triggerProps:(t,e)=>e?t.activeTriggerProps:t.inactiveTriggerProps,triggerPopupId:(t,e)=>UU(t,e)?JA(t):void 0,popupProps:t=>t.popupProps,popupElement:t=>t.popupElement,positionerElement:t=>t.positionerElement};function n1(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 Gw.useSyncExternalStore(e,n,()=>t?.serverStore)}function UP(t){const{open:e=!1,onOpenChange:n,elements:r={}}=t,i=ha(),s=Sa()!=null,a=Qn(()=>new Km({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 Oe(()=>{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 qU(t){return GU(t,t.rootContext)}function GU(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),S=wa(r),C=R.useMemo(()=>({reference:i,floating:s,domReference:a}),[i,s,a]),T=CU({...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 B=It(N)?{getBoundingClientRect:()=>N.getBoundingClientRect(),getClientRects:()=>N.getClientRects(),contextElement:N}:N;h(B),T.refs.setReference(B)},[T.refs]),D=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]),O=R.useCallback(N=>{b(N),T.refs.setFloating(N)},[T.refs]),I=R.useMemo(()=>({...T.refs,setReference:D,setFloating:O,setPositionReference:k,domReference:x}),[T.refs,D,O,k]),L=R.useMemo(()=>({...T.elements,domReference:a}),[T.elements,a]),_=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 Oe(()=>{a&&(x.current=a)},[a]),Oe(()=>{e.context.dataRef.current.floatingContext=_;const N=S?.nodesRef.current.find(B=>B.id===n);N&&(N.context=_)}),R.useMemo(()=>({...T,context:_,refs:I,elements:L,rootStore:e}),[T,I,L,_,e])}const cb=Rw&&dl;function qP(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 S(){d.current=!1}return zo(yt(y,"blur",b),cb&&yt(y,"keydown",x,!0),cb&&yt(y,"pointerdown",S,!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(cb&&!y.relatedTarget){if(!d.current&&!Vm(x))return}else if(!Jg(x))return}const S=Zg(y.relatedTarget,i.context.triggerElements),{nativeEvent:C,currentTarget:T}=y,E=typeof r=="function"?r():r;if(i.select("open")&&S||E===0||E===void 0){i.setOpen(!0,Ue(gc,C,T));return}h.start(E,()=>{u.current||i.setOpen(!0,Ue(gc,C,T))})},onBlur(y){m();const b=y.relatedTarget,x=y.nativeEvent,S=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)||S||Zg(b??T,i.context.triggerElements)||i.setOpen(!1,Ue(gc,x))})}}},[a,r,i,h]);return R.useMemo(()=>n?{reference:g,trigger:g}:{},[n,g])}class r1{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 _i,this.restTimeout=new _i,this.handleCloseOptions=void 0}static create(){return new r1}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose}const im=new WeakMap;function om(t){if(!t.performedPointerEventsMutation)return;const e=t.pointerEventsScopeElement;e&&im.get(e)===t&&(t.pointerEventsScopeElement?.style.removeProperty("pointer-events"),t.pointerEventsReferenceElement?.style.removeProperty("pointer-events"),t.pointerEventsFloatingElement?.style.removeProperty("pointer-events"),im.delete(e)),t.performedPointerEventsMutation=!1,t.pointerEventsScopeElement=null,t.pointerEventsReferenceElement=null,t.pointerEventsFloatingElement=null}function GP(t,e){const{scopeElement:n,referenceElement:r,floatingElement:i}=e,s=im.get(n);s&&s!==t&&om(s),om(t),t.performedPointerEventsMutation=!0,t.pointerEventsScopeElement=n,t.pointerEventsReferenceElement=r,t.pointerEventsFloatingElement=i,im.set(n,t),n.style.pointerEvents="none",r.style.pointerEvents="auto",i.style.pointerEvents="auto"}function i1(t){const e=t.context.dataRef.current,n=Qn(()=>e.hoverInteractionState??r1.create()).current;return e.hoverInteractionState||(e.hoverInteractionState=n),Nm(e.hoverInteractionState.disposeEffect),e.hoverInteractionState}function WP(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=wa(),g=Sa(),m=i1(s),y=lr(),b=Ae(()=>JD(d.current.openEvent?.type,m.interactedInside)),x=Ae(()=>X6(d.current.openEvent?.type)),S=Ae(()=>{om(m)});Oe(()=>{a||(m.pointerType=void 0,m.restTimeoutPending=!1,m.interactedInside=!1,S())},[a,m,S]),R.useEffect(()=>S,[S]),Oe(()=>{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,D=M!==T?M:null,O=m.handleCloseOptions?.getScope?.()??k??D??C.closest("[data-rootownerid]")??E.body;return GP(m,{scopeElement:O,referenceElement:C,floatingElement:T}),()=>{S()}}},[n,a,c,u,m,x,h,g,S]),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),_=()=>{s.setOpen(!1,Ue(Sr,I)),h?.events.emit("floating.closed",I)};L?m.openChangeTimeout.start(L,_):(m.openChangeTimeout.clear(),_())}function E(I){const L=mn(I);if(!ZD(L)){m.interactedInside=!1;return}m.interactedInside=L?.closest("[aria-haspopup]")!=null}function M(){m.openChangeTimeout.clear(),y.clear(),h?.events.off("floating.closed",D),S()}function k(I){if(C()&&h){h.events.on("floating.closed",D);return}if(Zg(I.relatedTarget,s.context.triggerElements))return;const L=d.current.floatingContext?.nodeId??i,_=I.relatedTarget;if(!(h&&L&&It(_)&&da(h.nodesRef.current,L,!1).some(B=>Ge(B.context?.elements.floating,_)))){if(m.handler){m.handler(I);return}S(),x()&&!b()&&T(I)}}function D(I){!h||!g||C()||y.start(0,()=>{h.events.off("floating.closed",D),s.setOpen(!1,Ue(Sr,I)),h.events.emit("floating.closed",I)})}const O=u;return zo(O&&yt(O,"mouseenter",M),O&&yt(O,"mouseleave",k),O&&yt(O,"pointerdown",E,!0),()=>{h?.events.off("floating.closed",D)})},[n,u,s,d,r,i,x,b,S,m,h,g,y])}const WU={current:null};function KP(t,e={}){const{enabled:n=!0,delay:r=0,handleClose:i=null,mouseOnly:s=!1,restMs:a=0,move:u=!0,triggerElementRef:c=WU,externalTree:d,isActiveTrigger:h=!0,getHandleCloseContext:g,isClosing:m,shouldOpen:y,guardStaleOpen:b=!1}=e,x="rootStore"in t?t.rootStore:t,{dataRef:S,events:C}=x.context,T=wa(d),E=i1(x),M=R.useRef(!1),k=Un(i),D=Un(r),O=Un(a),I=Un(n),L=Un(y),_=Un(m),N=Ae(()=>JD(S.current.openEvent?.type,E.interactedInside)),B=Ae(()=>L.current?.()!==!1),H=Ae((j,q,$)=>{const X=x.context.triggerElements;if(X.hasElement(q))return!j||!Ge(j,q);if(!It($))return!1;const Z=$;return X.hasMatchingElement(z=>Ge(z,Z))&&(!j||!Ge(j,Z))}),F=Ae(()=>{if(!E.handler)return;vt(x.select("domReferenceElement")).removeEventListener("mousemove",E.handler),E.handler=void 0}),G=Ae(()=>{om(E)});return h&&(E.handleCloseOptions=k.current?.__options),R.useEffect(()=>F,[F]),R.useEffect(()=>{if(!n)return;function j(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",j),()=>{C.off("openchange",j)}},[n,C,E,F]),R.useEffect(()=>{if(!n)return;function j(U,W=!0){const K=ua(D.current,"close",E.pointerType);K?E.openChangeTimeout.start(K,()=>{x.setOpen(!1,Ue(Sr,U)),T?.events.emit("floating.closed",U)}):W&&(E.openChangeTimeout.clear(),x.setOpen(!1,Ue(Sr,U)),T?.events.emit("floating.closed",U))}const q=c.current??(h?x.select("domReferenceElement"):null);if(!It(q))return;function $(U){if(E.openChangeTimeout.clear(),E.blockMouseMove=!1,s&&!sa(E.pointerType))return;const W=RA(O.current),K=ua(D.current,"open",E.pointerType),ie=mn(U),ee=U.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=_.current?.()??x.select("transitionStatus")==="ending",he=!ve&&ye&&M.current,pe=!se&&It(Y)&&It(ae)&&Ge(ae,Y)&&he,Te=W>0&&!K,De=se&&(ve||he)||pe,Pe=!ve||se;if(De){B()&&x.setOpen(!0,Ue(Sr,U,Y));return}Te||(K?E.openChangeTimeout.start(K,()=>{Pe&&B()&&x.setOpen(!0,Ue(Sr,U,Y))}):Pe&&B()&&x.setOpen(!0,Ue(Sr,U,Y)))}function X(U){if(N()){G();return}F();const W=x.select("domReferenceElement"),K=vt(W);E.restTimeout.clear(),E.restTimeoutPending=!1;const ie=S.current.floatingContext??g?.();if(Zg(U.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:U.clientX,y:U.clientY,onClose(){G(),F(),I.current&&!N()&&ae===x.select("domReferenceElement")&&j(U,!0)}}),K.addEventListener("mousemove",E.handler),E.handler(U);return}(E.pointerType!=="touch"||!Ge(x.select("floatingElement"),U.relatedTarget))&&j(U)}function Z(U){Ge(q,U.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",$,{once:!0}),yt(q,"mouseenter",$),yt(q,"mouseleave",X),z):zo(yt(q,"mouseenter",$),yt(q,"mouseleave",X),z)},[F,G,S,D,x,n,k,E,h,H,N,s,u,O,c,T,I,g,_,B,b]),R.useMemo(()=>{if(!n)return;function j(q){E.pointerType=q.pointerType}return{onPointerDown:j,onPointerEnter:j,onMouseMove(q){const{nativeEvent:$}=q,X=q.currentTarget,Z=x.select("domReferenceElement"),z=x.select("open"),U=H(Z,X,q.target);if(s&&!sa(E.pointerType))return;if(z&&U&&E.handleCloseOptions?.blockPointerEvents){const ie=x.select("floatingElement");if(ie){const ee=E.handleCloseOptions?.getScope?.()??X.ownerDocument.body;GP(E,{scopeElement:ee,referenceElement:X,floatingElement:ie})}}const W=RA(O.current);if(z&&!U||W===0||!U&&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||U)&&B()&&x.setOpen(!0,Ue(Sr,$,X))}E.pointerType==="touch"?go.flushSync(()=>{K()}):U&&z?K():(E.restTimeoutPending=!0,E.restTimeout.start(W,K))}}},[n,E,N,H,s,x,O,B])}const KU="Escape";function eO(t){return dl&&t.movementX===0&&t.movementY===0}function Ym(t,e,n){switch(t){case"vertical":return e;case"horizontal":return n;default:return e||n}}function Up(t,e){return Ym(e,t===Iw||t===Hm,t===lu||t===au)}function fb(t,e,n){return Ym(e,t===Hm,n?t===lu:t===au)||t==="Enter"||t===" "||t===""}function YU(t,e,n){return Ym(e,n?t===lu:t===au,t===Hm)}function XU(t,e,n,r){const i=n?t===au:t===lu,s=t===Iw;return e==="both"||e==="horizontal"&&r?t===KU:Ym(e,i,s)}function o1(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:S="vertical",parentOrientation:C,id:T,resetOnPointerLeave:E=!0,externalTree:M,grid:k}=e,D=k!=null,O="rootStore"in t?t.rootStore:t,I=O.useState("open"),L=O.useState("floatingElement"),_=O.useState("domReferenceElement"),N=O.context.dataRef,B=em(L),H=Vx(_),F=Un(B),G=Sa(),j=wa(M),q=R.useRef(m),$=R.useRef(a??-1),X=R.useRef(null),Z=R.useRef(!0),z=Ae(J=>{i($.current===-1?null:$.current,J)}),U=R.useRef(!!L),W=R.useRef(I),K=R.useRef(!1),ie=R.useRef(!1),ee=R.useRef(null),ae=Un(x),Y=Un(I),se=Un(a),ve=Un(E),ye=Ic(),he=Ic(),pe=Ae(()=>{function J(me){g?j?.events.emit("virtualfocus",me):ee.current=Ig(me,{sync:K.current,preventScroll:!0})}const le=n.current[$.current],we=ie.current;le&&J(le),(K.current?me=>me():me=>ye.request(me))(()=>{const me=n.current[$.current]||le;if(!me)return;le||J(me),Me&&(we||!Z.current)&&me.scrollIntoView?.({block:"nearest",inline:"nearest"})})});Oe(()=>{N.current.orientation=S},[N,S]),Oe(()=>{s&&(I&&L?($.current=a??-1,q.current&&a!=null&&(ie.current=!0,z())):U.current&&($.current=-1,z()))},[s,I,L,a,z]),Oe(()=>{if(s){if(!I){K.current=!1;return}if(L)if(r==null){if(K.current=!1,se.current!=null)return;if(U.current&&($.current=-1,pe()),(!W.current||!U.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):($.current=X.current==null||fb(X.current,S,h)||d?kg(n):Ux(n),X.current=null,z())};le()}}else la(n.current,r)||($.current=r,pe(),ie.current=!1)}},[s,I,L,r,se,d,n,S,h,z,pe,he]),Oe(()=>{if(!s||L||!j||g||!U.current)return;const J=j.nodesRef.current,le=J.find(me=>me.id===G)?.context?.elements.floating,we=ir(vt(_??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,G,g]),Oe(()=>{W.current=I,U.current=!!L}),Oe(()=>{I||(X.current=null,q.current=m)},[I,m]);const Te=r!=null,De=Ae(J=>{if(!Y.current)return;const le=n.current.indexOf(J.currentTarget);le!==-1&&($.current!==le||r!==le)&&($.current=le,z(J))}),Pe=Ae(()=>C??j?.nodesRef.current.find(J=>J.id===G)?.context?.dataRef?.current.orientation),Ee=Ae(()=>kg(n,ae.current)),_e=Ae(J=>{if(Z.current=!1,K.current=!0,J.which===229||!Y.current&&J.currentTarget===F.current)return;if(d&&XU(J.key,S,h,D)){Up(J.key,Pe())||Nr(J),O.setOpen(!1,Ue(Fx,J.nativeEvent)),cn(_)&&(g?j?.events.emit("virtualfocus",_):_.focus());return}const le=$.current,we=kg(n,x),de=Ux(n,x);if(H||(J.key==="Home"&&(Nr(J),$.current=we,z(J)),J.key==="End"&&(Nr(J),$.current=de,z(J))),k!=null){const me=k(J,$.current,n,S,c,h,x,we,de);if(me!=null&&($.current=me,z(J)),S==="both")return}if(Up(J.key,S)){if(Nr(J),I&&!g&&ir(J.currentTarget.ownerDocument)===J.currentTarget){$.current=fb(J.key,S,h)?we:de,z(J);return}fb(J.key,S,h)?c?le>=de?u&&le!==n.current.length?$.current=-1:(K.current=!1,$.current=we):$.current=Ar(n.current,{startingIndex:le,disabledIndices:x}):$.current=Math.min(de,Ar(n.current,{startingIndex:le,disabledIndices:x})):c?le<=we?u&&le!==-1?$.current=n.current.length:(K.current=!1,$.current=de):$.current=Ar(n.current,{startingIndex:le,decrement:!0,disabledIndices:x}):$.current=Math.max(we,Ar(n.current,{startingIndex:le,decrement:!0,disabledIndices:x})),la(n.current,$.current)&&($.current=-1),z(J)}}),Me=R.useMemo(()=>({onFocus(le){K.current=!0,De(le)},onClick:({currentTarget:le})=>le.focus({preventScroll:!0}),onMouseMove(le){eO(le)||(K.current=!0,ie.current=!1,y&&De(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,$.current=-1,z(le),!g)){const de=F.current,me=ir(vt(de));de&&Ge(de,me)&&de.focus({preventScroll:!0})}}}),[De,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":S==="both"?void 0:S,...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),O.setOpen(!1,Ue(ca,J.nativeEvent)),cn(_)&&_.focus();return}_e(J)},onPointerMove(J){eO(J)||(Z.current=!0)}}),[oe,_e,F,S,H,O,I,g,_]),ze=R.useMemo(()=>{function J(de){O.setOpen(!0,Ue(Fx,de.nativeEvent,de.currentTarget))}function le(de){m==="auto"&&Ew(de.nativeEvent)&&(q.current=!g)}function we(de){q.current=m,m==="auto"&&Mw(de.nativeEvent)&&(q.current=!0)}return{onKeyDown(de){const me=O.select("open");Z.current=!1;const Be=de.key.startsWith("Arrow"),Ke=YU(de.key,Pe(),h),wt=Up(de.key,S),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,Pe());X.current=d&&st?null:de.key}if(d){Ke&&(Nr(de),me?($.current=Ee(),z(de)):J(de));return}wt&&(se.current!=null&&($.current=se.current),Nr(de),!me&&b?J(de):_e(de),me&&z(de))}},onFocus(de){O.select("open")&&!g&&($.current=-1,z(de))},onPointerDown:we,onPointerEnter:we,onMouseDown:le,onClick:le}},[_e,m,Ee,d,z,O,b,S,Pe,h,se,g]),ne=R.useMemo(()=>({...oe,...ze}),[oe,ze]);return R.useMemo(()=>s?{reference:ne,floating:xe,item:Me,trigger:ze}:{},[s,ne,xe,ze,Me])}function YP(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),S=R.useRef(null),C=Ae(M=>{function k(F){return r?.current[F]}function D(F){const G=k(F);return G&&!$m(G)||G?.matches(":disabled")?!1:a==null||!Pc(li,F,a)}function O(F,G,j=0){if(F.length===0)return-1;const q=(j%F.length+F.length)%F.length,$=G.toLowerCase();for(let X=0;X<F.length;X+=1){const Z=(q+X)%F.length;if(!(!F[Z]?.toLowerCase().startsWith($)||!D(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]!==" "&&O(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&&D(G)?F[0]?.toLowerCase()!==F[1]?.toLowerCase():!0)&&b.current===M.key&&(b.current="",x.current=S.current),b.current+=M.key,y.start(d,()=>{b.current="",x.current=S.current,u?.(!1)});const B=((L?h??i??-1:x.current)??0)+1,H=O(I,b.current,B);H!==-1?(s?.(H),S.current=H):M.key!==" "&&(b.current="",u?.(!1))}),T=Ae(M=>{const k=M.relatedTarget,D=g.select("domReferenceElement"),O=g.select("floatingElement");Ge(D,k)||Ge(O,k)||(y.clear(),b.current="",x.current=S.current,u?.(!1))});Oe(()=>{!m&&h!==null||(y.clear(),S.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 tO=.1,QU=tO*tO,Sn=.5;function qp(t,e,n,r,i,s){return r>=e!=s>=e&&t<=(i-n)*(e-r)/(s-r)+n}function Gp(t,e,n,r,i,s,a,u,c,d){let h=!1;return qp(t,e,n,r,i,s)&&(h=!h),qp(t,e,i,s,a,u)&&(h=!h),qp(t,e,a,u,c,d)&&(h=!h),qp(t,e,c,d,n,r)&&(h=!h),h}function ZU(t,e,n){return t>=n.x&&t<=n.x+n.width&&e>=n.y&&e<=n.y+n.height}function Wp(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 XP(t={}){const{blockPointerEvents:e=!1}=t,n=new _i,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 S(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 D=T-y,O=E-b,I=D*D+O*O,L=k*k*QU;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:D,clientY:O}=E,I=mn(E),L=E.type==="mouseleave",_=Ge(k,I),N=Ge(M,I);if(_&&(m=!0,!L))return;if(N&&(m=!1,!L)){m=!0;return}if(L&&It(E.relatedTarget)&&Ge(k,E.relatedTarget))return;function B(){return!!(h&&da(h.nodesRef.current,d).length>0)}function H(){B()||C()}if(B())return;const F=M.getBoundingClientRect(),G=k.getBoundingClientRect(),j=i>G.right-G.width/2,q=s>G.bottom-G.height/2,$=G.width>F.width,X=G.height>F.height,Z=($?F:G).left,z=($?F:G).right,U=(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=Wp(D,O,Z,F.top+1,z,G.bottom-1);break;case"bottom":K=Wp(D,O,Z,G.top+1,z,F.bottom-1);break;case"left":K=Wp(D,O,G.right-1,W,F.left+1,U);break;case"right":K=Wp(D,O,F.right-1,W,G.left+1,U);break}if(K)return;if(m&&!ZU(D,O,F)){H();return}if(!L&&S(D,O)){H();return}let ie=!1;switch(g){case"top":{const ee=$?Sn/2:Sn*4,ae=$||j?i+ee:i-ee,Y=$?i-ee:j?i+ee:i-ee,se=s+Sn+1,ve=j||$?G.bottom-Sn:G.top,ye=j?$?G.bottom-Sn:G.top:G.bottom-Sn;ie=Gp(D,O,ae,se,Y,se,G.left,ve,G.right,ye);break}case"bottom":{const ee=$?Sn/2:Sn*4,ae=$||j?i+ee:i-ee,Y=$?i-ee:j?i+ee:i-ee,se=s-Sn,ve=j||$?G.top+Sn:G.bottom,ye=j?$?G.top+Sn:G.bottom:G.top+Sn;ie=Gp(D,O,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=Gp(D,O,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=Gp(D,O,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 JU={...t1,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 e2 extends Kc{constructor(e,n,r){const i=new sh;super(t2(e,i,n,r),n2(i),JU)}setOpen=(e,n)=>{VU(this,e,n,{extraState:{openChangeReason:n.reason}})};cancelPendingOpen(e){this.state.floatingRootContext.dispatchOpenChange(!1,Ue(Gc,e))}}function t2(t,e,n,r=!1){const i={...Jw(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,adaptiveOrigin:void 0,...t};return i.floatingRootContext=FP(e,n,r),i}function n2(t){return{popupRef:R.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:t}}const r2=Cw(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=HP((N,B)=>new e2({open:r,openProp:i,activeTriggerId:m,triggerIdProp:g},N,B));b.useControlledProp("openProp",i),b.useControlledProp("triggerIdProp",g),b.useContextCallback("onOpenChange",c),b.useContextCallback("onOpenChangeComplete",d);const x=b.useState("open"),S=!n&&x,C=b.useState("activeTriggerId"),T=b.useState("mounted"),E=b.useState("payload");b.useSyncedValues({trackCursorAxis:a,disableHoverablePopup:s,disabled:n}),Xw(b,{closeOnActiveTriggerUnmount:!0});const{forceUnmount:M,transitionStatus:k}=Qw(S,b),D=b.useState("isInstantPhase"),O=b.useState("instantType"),I=b.useState("lastOpenChangeReason"),L=R.useRef(null);Oe(()=>{x&&n&&b.setOpen(!1,Ue(rP))},[x,n,b]),Oe(()=>{k==="ending"&&I===gr||k!=="ending"&&D?(O!=="delay"&&(L.current=O),b.set("instantType","delay")):L.current!==null&&(b.set("instantType",L.current),L.current=null)},[k,D,I,O,b]),Oe(()=>{S&&C==null&&b.set("payload",void 0)},[b,C,S]),R.useImperativeHandle(u,()=>({unmount:M,close:()=>b.setOpen(!1,Ue(zw))}),[M,b]);const _=S||T||!n&&a!=="none";return A.jsxs(YD.Provider,{value:b,children:[h&&A.jsx(Ww,{handle:h,store:b}),_&&A.jsx(i2,{store:b,disabled:n,trackCursorAxis:a}),typeof y=="function"?y({payload:E}):y]})});function i2({store:t,disabled:e,trackCursorAxis:n}){const r=t.useState("floatingRootContext"),i=ih(r,{enabled:!e,referencePress:()=>t.select("closeOnClick")}),s=F$(r,{enabled:!e&&n!=="none",axis:n==="none"?void 0:n}),a=R.useMemo(()=>Jr(s.reference,i.reference),[s.reference,i.reference]);return Zw(t,{activeTriggerProps:a,inactiveTriggerProps:a,popupProps:i.floating??gn}),null}let nO=(function(t){return t.startingStyle="data-starting-style",t.endingStyle="data-ending-style",t})({});const o2={"data-starting-style":""},s2={"data-ending-style":""},$o={transitionStatus(t){return t==="starting"?o2:t==="ending"?s2:null}};(function(t){return t.open="data-open",t.closed="data-closed",t[t.startingStyle=nO.startingStyle]="startingStyle",t[t.endingStyle=nO.endingStyle]="endingStyle",t.anchorHidden="data-anchor-hidden",t.side="data-side",t.align="data-align",t})({});const l2={"data-popup-open":""},a2={"data-popup-open":"","data-pressed":""},u2={"data-open":""},c2={"data-closed":""},f2={"data-anchor-hidden":""},Xm={open(t){return t?l2:null}},sm={open(t){return t?a2:null}},lh={open(t){return t?u2:c2},anchorHidden(t){return t?f2:null}},s1={...lh,...$o};function Hr(t){return ha(t,"base-ui")}const QP=R.createContext(void 0);function d2(){return R.useContext(QP)}const rO=600,ZP="data-base-ui-tooltip-trigger";function iO(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 h2(t){let e=t;for(;e;){const n=e.closest(`[${ZP}]`);if(n)return n;const r=e.getRootNode();e="host"in r&&It(r.host)?r.host:null}return null}const p2=KD(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=zm(!0),S=n1(a)??b;if(!S)throw new Error(Jt(82));const C=Hr(m),T=S.useState("isTriggerActive",C),E=S.useState("isOpenedByTrigger",C),M=S.useState("floatingRootContext"),k=R.useRef(null),D=d??rO,O=g??0,{registerTrigger:I,isMountedByThisTrigger:L}=Yw(C,k,S,{payload:u,closeOnClick:h,closeDelay:O}),_=d2(),{delayRef:N,isInstantPhase:B,hasProvider:H}=t$(M,{open:E}),F=i1(M);S.useSyncedValue("isInstantPhase",B);const G=S.useState("disabled"),j=c??G,q=Un(j),$=S.useState("trackCursorAxis"),X=S.useState("disableHoverablePopup"),Z=R.useRef(!1),z=lr(),U=R.useRef(void 0);function W(){return H?ua(N.current,"open")===0?0:d??_??rO:D}function K(pe){const Te=k.current;if(!Te||!pe)return!1;const De=h2(pe);return De!==null&&De!==Te&&Ge(Te,De)}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=KP(M,{enabled:!j,mouseOnly:!0,move:!1,handleClose:!X&&$!=="both"?XP():null,restMs:W,delay(){return g==null&&H?{close:ua(N.current,"close")}:{close:O}},triggerElementRef:k,isActiveTrigger:T,isClosing:()=>S.select("transitionStatus")==="ending",shouldOpen(){return!Z.current}}),ae=qP(M,{enabled:!j}).reference,Y=pe=>{const Te=Z.current,De=iO(pe),Pe=ie(De),Ee=k.current,_e=Ee&&De&&Ge(Ee,De);if(Pe&&S.select("open")&&S.select("lastOpenChangeReason")===Sr){S.setOpen(!1,Ue(Sr,pe));return}if(Te&&!Pe&&_e&&!q.current&&!S.select("open")&&Ee&&sa(U.current)){const Me=()=>{!Z.current&&!q.current&&!S.select("open")&&S.setOpen(!0,Ue(Sr,pe,Ee))},oe=W();oe===0?(z.clear(),Me()):z.start(oe,Me)}},se=S.useState("triggerProps",L);return rt("button",e,{state:{open:E},ref:[n,I,k],props:[ee,ae,L||$!=="none"?se:void 0,{onMouseOver(pe){Y(pe.nativeEvent)},onFocus(pe){K(iO(pe.nativeEvent))&&pe.preventBaseUIHandler()},onMouseLeave(){Z.current=!1,z.clear(),U.current=void 0},onPointerEnter(pe){U.current=pe.pointerType},onPointerDown(pe){U.current=pe.pointerType,S.set("closeOnClick",h),h&&!S.select("open")&&S.cancelPendingOpen(pe.nativeEvent)},onClick(pe){h&&!S.select("open")&&S.cancelPendingOpen(pe.nativeEvent)},id:C,"data-trigger-disabled":j?"":void 0,[ZP]:j?void 0:""},y],stateAttributesMapping:Xm})}),JP=R.createContext(void 0);function g2(){const t=R.useContext(JP);if(t===void 0)throw new Error(Jt(70));return t}const ez=R.forwardRef(function(e,n){const{children:r,container:i,className:s,render:a,style:u,...c}=e,{node:d,subtree:h}=CP({container:i,ref:n,componentProps:e,elementProps:c});return!h&&!d?null:A.jsxs(R.Fragment,{children:[h,d&&go.createPortal(r,d)]})}),m2=R.forwardRef(function(e,n){const{keepMounted:r=!1,...i}=e;return zm().useState("mounted")||r?A.jsx(JP.Provider,{value:r,children:A.jsx(ez,{ref:n,...i})}):null}),tz=R.createContext(void 0);function y2(){const t=R.useContext(tz);if(t===void 0)throw new Error(Jt(71));return t}const v2=R.createContext(void 0);function Yc(){return R.useContext(v2)?.direction??"ltr"}const b2=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=lP(h),y={x:n,y:r},b=_w(i),x=jw(b),S=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],D=y[b]-s.reference[b],O=g==="real"?await a.getOffsetParent?.(d):u.floating;let I=u.floating[M]||s.floating[x];(!I||!await a.isElement?.(O))&&(I=u.floating[M]||s.floating[x]);const L=k/2-D/2,_=I/2-S[x]/2-1,N=Math.min(m[T],_),B=Math.min(m[E],_),H=N,F=I-S[x]-B,G=I/2-S[x]/2+L,j=sP(H,G,F),q=!c.arrow&&xa(i)!=null&&G!==j&&s.reference[x]/2-(G<H?N:B)-S[x]/2<0,$=q?G<H?G-H:G-F:0;return{[b]:y[b]+$,data:{[b]:j,centerOffset:G-j-$,...q&&{alignmentOffset:$}},reset:q}}}),x2=(t,e)=>({...b2(t),options:[t,e]}),S2={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}}}},w2={sideX:"left",sideY:"top"},oO="--available-width",sO="--available-height";function nz(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 lO(t,e,n){const{rects:r,placement:i}=t;return{side:nz(e,fo(i),n),align:xa(i)||"center",anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function Qm(t){return C2(t,qU)}function C2(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:S,collisionAvoidance:C,shift:T,nodeId:E,adaptiveOrigin:M,lazyFlip:k=!1,externalTree:D}=t,[O,I]=R.useState(null);!S&&O!==null&&I(null);const L=C.side||"flip",_=C.align||"flip",N=C.fallbackAxisSide||"end",B=T?.crossAxis??!1,H=T?.rootBoundary,F=typeof n=="function"?n:void 0,G=Ae(F),j=F?G:n,q=Un(n),$=Un(S),Z=Yc()==="rtl",z=O||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":Z?"left":"right","inline-start":Z?"right":"left"}[i],U=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=Un(s),he=Un(u),pe=typeof s!="function"?s:0,Te=typeof u!="function"?u:0,De=[];y&&De.push(y),De.push(RU(lt=>{const gt=lO(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 Pe=_==="none"&&L!=="shift",Ee=!Pe&&(h||B||L==="shift"),_e=L==="none"?null:MU({...se,padding:{top:W.top+K+ie,right:W.right+K+Y,bottom:W.bottom+K+ee,left:W.left+K+ae},mainAxis:!B&&L==="flip",crossAxis:_==="flip"?"alignment":!1,fallbackAxisSideDirection:N}),Me=Pe?null:TU({...se,rootBoundary:H,mainAxis:_!=="none",crossAxis:Ee,limiter:h||B?void 0:EU(lt=>{if(!ve.current)return{};const{width:gt,height:nt}=ve.current.getBoundingClientRect(),nn=oo(fo(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,B,H,W,_]);L==="shift"||_==="shift"||a==="center"?De.push(Me,_e):De.push(_e,Me),De.push(AU({...se,apply({elements:{floating:lt},availableWidth:gt,availableHeight:nt,rects:nn}){if(!$.current)return;const Vn=lt.style;Vn.setProperty(oO,`${gt}px`),Vn.setProperty(sO,`${nt}px`);const Fn=Rn(lt).devicePixelRatio||1,{x:rn,y:kn,width:Pt,height:Vr}=nn.reference,ar=(Math.round((rn+Pt)*Fn)-Math.round(rn*Fn))/Fn,it=(Math.round((kn+Vr)*Fn)-Math.round(kn*Fn))/Fn;Vn.setProperty("--anchor-width",`${ar}px`),Vn.setProperty("--anchor-height",`${it}px`)}}),x2(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=fo(nn),kn=oo(rn),Pt=ve.current,Vr=nt.arrow?.x||0,ar=nt.arrow?.y||0,it=Pt?.clientWidth||0,qt=Pt?.clientHeight||0,qn=Vr+it/2,jn=ar+qt/2,Tr=Math.abs(nt.shift?.y||0),ln=Vn.reference.height/2,zt=typeof s=="function"?s(lO(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),{}}},S2,M),Oe(()=>{!S&&x&&x.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[S,x]);const oe=R.useMemo(()=>({elementResize:!m&&typeof ResizeObserver<"u",layoutShift:!m&&typeof IntersectionObserver<"u"}),[m]),{refs:xe,elements:ze,x:ne,y:J,middlewareData:le,update:we,placement:de,context:me,isPositioned:Be,floatingStyles:Ke}=e({rootContext:x,open:b?S:void 0,placement:U,middleware:De,strategy:r,whileElementsMounted:b?void 0:(...lt)=>WA(...lt,oe),nodeId:E,externalTree:D}),{sideX:wt,sideY:xt}=le.adaptiveOrigin||w2,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[oO]="100vw",lt[sO]="100vh",Be||(lt.opacity=0),lt},[M,st,wt,ne,xt,J,Ke,Be]),Wt=R.useRef(null);Oe(()=>{if(!S)return;const lt=q.current,gt=typeof lt=="function"?lt():lt,nn=(aO(gt)?gt.current:gt)||null||null;nn!==Wt.current&&(xe.setPositionReference(nn),Wt.current=nn)},[S,xe,j,q]),R.useEffect(()=>{if(!S)return;const lt=q.current;typeof lt!="function"&&aO(lt)&&lt.current!==Wt.current&&(xe.setPositionReference(lt.current),Wt.current=lt.current)},[S,xe,j,q]),R.useEffect(()=>{if(b&&S&&ze.reference&&ze.floating)return WA(ze.reference,ze.floating,we,oe)},[b,S,ze,we,oe]);const at=fo(de),Tn=nz(i,at,Z),Kt=xa(de)||"center",tn=!!le.hide?.referenceHidden;Oe(()=>{k&&S&&Be&&at!==z&&I(at)},[k,S,Be,at,z]);const Vt=R.useMemo(()=>({position:"absolute",top:le.arrow?.y,left:le.arrow?.x}),[le.arrow]),Ut=le.arrow?.centerOffset!==0;return R.useMemo(()=>({positionerStyles:Ct,arrowStyles:Vt,arrowRef:ve,arrowUncentered:Ut,side:Tn,align:Kt,physicalSide:at,anchorHidden:tn,refs:xe,context:me,isPositioned:Be,update:we}),[Ct,Vt,ve,Ut,Tn,Kt,at,tn,xe,me,Be,we])}function aO(t){return t!=null&&"current"in t}function ah(t){return t==="starting"?k$:gn}function Zm(t,e,{styles:n,transitionStatus:r,props:i,refs:s,hidden:a,inert:u=!1}){const c={...n};return u&&(c.pointerEvents="none"),rt("div",t,{state:e,ref:s,props:[{role:"presentation",hidden:a,style:c},ah(r),i],stateAttributesMapping:lh})}const R2=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:S=xP,style:C,...T}=e,E=zm(),M=g2(),k=E.useState("open"),D=E.useState("mounted"),O=E.useState("trackCursorAxis"),I=E.useState("disableHoverablePopup"),L=E.useState("floatingRootContext"),_=E.useState("instantType"),N=E.useState("transitionStatus"),B=E.useState("adaptiveOrigin"),H=Qm({anchor:s,positionMethod:a,floatingRootContext:L,mounted:D,side:u,sideOffset:d,align:c,alignOffset:h,collisionBoundary:g,collisionPadding:m,sticky:b,arrowPadding:y,disableAnchorTracking:x,keepMounted:M,collisionAvoidance:S,adaptiveOrigin:B}),F=R.useMemo(()=>({open:k,side:H.side,align:H.align,anchorHidden:H.anchorHidden,instant:O!=="none"?"tracking-cursor":_}),[k,H.side,H.align,H.anchorHidden,O,_]),G=Zm(e,F,{styles:H.positionerStyles,transitionStatus:N,props:T,refs:[n,E.useStateSetter("positionerElement")],hidden:!D,inert:!k||O==="both"||I});return A.jsx(tz.Provider,{value:H,children:G})}),T2=R.forwardRef(function(e,n){const{render:r,className:i,style:s,...a}=e,u=zm(),{side:c,align:d}=y2(),h=u.useState("open"),g=u.useState("instantType"),m=u.useState("transitionStatus"),y=u.useState("popupProps"),b=u.useState("floatingRootContext"),x=u.useState("disabled"),S=u.useState("closeDelay");ci({open:h,ref:u.context.popupRef,onComplete(){h&&u.context.onOpenChangeComplete?.(!0)}}),WP(b,{enabled:!x,closeDelay:S});const C=u.useStateSetter("popupElement");return rt("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:s1})}),E2=function(e){const{delay:n,closeDelay:r,timeout:i=400}=e,s=R.useMemo(()=>({open:n,close:r}),[n,r]);return A.jsx(QP.Provider,{value:n,children:A.jsx(e$,{delay:s,timeoutMs:i,children:e.children})})};function Xc(t){return yw(19)?t:t?"true":void 0}function M2(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 rz=R.createContext(void 0);function l1(t){const e=R.useContext(rz);if(e===void 0&&!t)throw new Error(Jt(33));return e}const iz=R.createContext(void 0);function Cu(t){const e=R.useContext(iz);if(e===void 0&&!t)throw new Error(Jt(36));return e}const A2=R.createContext(void 0);function a1(t=!0){const e=R.useContext(A2);if(e===void 0&&!t)throw new Error(Jt(25));return e}function Ss({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 oz=R.createContext(void 0);function O2(){const t=R.useContext(oz);if(t===void 0)throw new Error(Jt(30));return t}const sz=R.createContext(void 0);function Jm(t=!1){const e=R.useContext(sz);if(e===void 0&&!t)throw new Error(Jt(16));return e}function k2(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 Pg(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 Vi(t={}){const{disabled:e=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0,composite:s}=t,a=R.useRef(null),u=Jm(!0),c=s??u!==void 0,{props:d}=k2({focusableWhenDisabled:n,disabled:e,composite:c,tabIndex:r,isNativeButton:i}),h=R.useCallback(()=>{const y=a.current;db(y)&&c&&e&&d.disabled===void 0&&y.disabled&&(y.disabled=!1)},[e,d.disabled,c]);Oe(h,[h]);const g=R.useCallback((y={})=>{const{onClick:b,onMouseDown:x,onKeyUp:S,onKeyDown:C,onPointerDown:T,...E}=y;return Jr({onClick(M){if(e){M.preventDefault();return}b?.(M)},onMouseDown(M){e||x?.(M)},onKeyDown(M){if(e||(Xg(M),C?.(M),M.baseUIHandlerPrevented))return;const k=M.target===M.currentTarget,D=M.currentTarget,O=db(D),I=!i&&I2(D),L=k&&(i?O:!I),_=M.key==="Enter",N=M.key===" ",B=D.getAttribute("role"),H=B?.startsWith("menuitem")||B==="option"||B==="gridcell";if(k&&c&&N){if(M.defaultPrevented&&H)return;M.preventDefault(),(!i||O)&&(M.preventBaseUIHandler(),Pg(D,M));return}if(!L||i||!N&&!_){k&&I&&N&&M.preventDefault();return}M.defaultPrevented||(M.preventDefault(),_&&(M.preventBaseUIHandler(),Pg(D,M)))},onKeyUp(M){if(!e){if(Xg(M),S?.(M),M.target===M.currentTarget&&i&&c&&db(M.currentTarget)&&M.key===" "){M.preventDefault();return}M.baseUIHandlerPrevented||M.target===M.currentTarget&&!i&&!c&&!M.defaultPrevented&&M.key===" "&&(M.preventBaseUIHandler(),Pg(M.currentTarget,M))}},onPointerDown(M){if(e){M.preventDefault();return}T?.(M)}},i?{type:"button"}:{role:"button"},d,E)},[e,d,c,i]),m=Ae(y=>{a.current=y,h()});return{getButtonProps:g,buttonRef:m}}function db(t){return cn(t)&&t.tagName==="BUTTON"}function I2(t){return cn(t)&&t.tagName==="A"&&!!t.href}function D2(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=a1(!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:uu})},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&&!Rw&&y.button===2)return}u.current&&s.context.allowMouseUpTriggerRef.current&&(!m||y.button===2)&&c.type==="regular-item"&&Pg(u.current,y,{detail:1})}}),[e,n,r,d,i,h,s,a,u,g,m,c])}const lz={type:"regular-item"};function az(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}=Vi({disabled:n,focusableWhenDisabled:!0,native:u,composite:!0}),y=D2({closeOnClick:e,highlighted:r,id:i,nodeId:d,store:s,typingRef:a,itemRef:h,itemMetadata:c}),b=R.useCallback(S=>Jr(y,{onMouseEnter(){c.type==="submenu-trigger"&&c.setActive()}},S,g),[y,g,c]),x=Cs(h,m);return R.useMemo(()=>({getItemProps:b,itemRef:x}),[b,x])}const uz=R.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function P2(){return R.useContext(uz)}function Qc(t={}){const{guess:e,label:n,metadata:r,textRef:i,index:s}=t,{register:a,unregister:u,subscribeMapChange:c,nextIndexRef:d}=P2(),h=R.useRef(-1),[g,m]=R.useState(s==null&&e?()=>{if(h.current===-1){const S=d.current;d.current+=1,h.current=S}return h.current}:-1),y=s??g,b=R.useRef(null),x=R.useCallback(S=>{const C=b.current;C&&u(C),b.current=S,S&&a(S,{metadata:r??null,index:s??null,label:n,textRef:i})},[s,a,u,r,n,i]);return Oe(()=>{if(s==null)return c(S=>{const C=b.current?S.get(b.current)?.index:null;C!=null&&m(C)})},[s,c]),{ref:x,index:y}}let uO=(function(t){return t.checked="data-checked",t.unchecked="data-unchecked",t.disabled="data-disabled",t.highlighted="data-highlighted",t})({});const cz={checked(t){return t?{[uO.checked]:""}:{[uO.unchecked]:""}},...$o},z2=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}),S=l1(!0),C=Hr(s),{store:T}=Cu(),E=T.useState("disabled"),M=c||E,k=T.useState("isActive",x.index),D=T.useState("itemProps"),[O,I]=Ss({controlled:h,default:g??!1,name:"MenuCheckboxItem",state:"checked"}),{getItemProps:L,itemRef:_}=az({closeOnClick:d,disabled:M,highlighted:k,id:C,store:T,nativeButton:u,nodeId:S?.context.nodeId,itemMetadata:lz}),N=R.useMemo(()=>({disabled:M,highlighted:k,checked:O}),[M,k,O]);function B(F){const G=Ue(uu,F.nativeEvent,void 0,{preventUnmountOnClose:On});m?.(!O,G),!G.isCanceled&&I(j=>!j)}const H=rt("div",e,{state:N,stateAttributesMapping:cz,props:[D,{role:"menuitemcheckbox","aria-checked":O,onClick:B},b,L],ref:[_,n,x.ref]});return A.jsx(oz.Provider,{value:N,children:H})}),N2=R.forwardRef(function(e,n){const{render:r,className:i,style:s,keepMounted:a=!1,...u}=e,c=O2(),d=R.useRef(null),{transitionStatus:h,mounted:g,setMounted:m}=pl(c.checked);ci({open:c.checked,ref:d,onComplete(){c.checked||m(!1)}});const y={checked:c.checked,disabled:c.disabled,highlighted:c.highlighted,transitionStatus:h};return rt("span",e,{state:y,ref:[n,d],stateAttributesMapping:cz,props:{"aria-hidden":!0,...u},enabled:a||g})}),fz=R.createContext(void 0);function L2(){const t=R.useContext(fz);if(t===void 0)throw new Error(Jt(31));return t}const B2=R.forwardRef(function(e,n){const{render:r,className:i,style:s,...a}=e,[u,c]=R.useState(void 0),d=rt("div",e,{ref:n,props:{role:"group","aria-labelledby":u,...a}});return A.jsx(fz.Provider,{value:c,children:d})}),j2=R.forwardRef(function(e,n){const{render:r,className:i,style:s,id:a,...u}=e,c=Hr(a),d=L2();return Oe(()=>(d(c),()=>{d(h=>h===c?void 0:h)}),[d,c]),rt("div",e,{ref:n,props:{id:c,role:"presentation",...u}})}),_2=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=l1(!0),b=Hr(s),{store:x}=Cu(),S=x.useState("disabled"),C=c||S,T=x.useState("isActive",m.index),E=x.useState("itemProps"),{getItemProps:M,itemRef:k}=az({closeOnClick:d,disabled:C,highlighted:T,id:b,store:x,nativeButton:u,nodeId:y?.context.nodeId,itemMetadata:lz});return rt("div",e,{state:{disabled:C,highlighted:T},props:[E,g,M],ref:[k,n,m.ref]})}),dz=R.createContext(void 0);function uh(t){const e=R.useContext(dz);if(e===void 0&&!t)throw new Error(Jt(69));return e}const Wx="ArrowUp",Kx="ArrowDown",Yx="ArrowLeft",Xx="ArrowRight",Qx="Home",Zx="End",ey=new Set([Wx,Kx,Yx,Xx,Qx,Zx]),H2="Shift",V2=[H2,"Control","Alt","Meta"];function F2(t){return cn(t)&&t.tagName==="INPUT"}function cO(t){return!!(F2(t)&&t.selectionStart!=null||cn(t)&&t.tagName==="TEXTAREA")}function fO(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=dO(t,e,"left"),d=Kp(t),h=Kp(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=dO(t,e,"top"),d=Kp(t),h=Kp(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 dO(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 Kp(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 $2=R.forwardRef(function(e,n){const{render:r,className:i,style:s,finalFocus:a,...u}=e,{store:c}=Cu(),{side:d,align:h}=l1(),g=uh(!0)!=null,m=c.useState("open"),y=c.useState("transitionStatus"),b=c.useState("popupProps"),x=c.useState("mounted"),S=c.useState("instantType"),C=c.useState("activeTriggerElement"),T=c.useState("parent"),E=c.useState("lastOpenChangeReason"),M=c.useState("rootId"),k=c.useState("floatingRootContext"),D=c.useState("floatingTreeRoot"),O=c.useState("closeDelay"),I=c.useState("hoverEnabled"),L=c.useState("disabled"),_=c.useState("openMethod"),N=T.type==="context-menu";ci({open:m,ref:c.context.popupRef,onComplete(){m&&c.context.onOpenChangeComplete?.(!0)}}),R.useEffect(()=>{function j(q){c.setOpen(!1,Ue(q.reason,q.domEvent))}return D.events.on("close",j),()=>{D.events.off("close",j)}},[D.events,c]),WP(k,{enabled:I&&!L&&!N&&T.type!=="menubar",closeDelay:O});const B=c.useStateSetter("popupElement"),H={transitionStatus:y,side:d,align:h,open:m,nested:T.type==="menu",instant:S},F=rt("div",e,{state:H,ref:[n,c.context.popupRef,B],stateAttributesMapping:s1,props:[b,{onKeyDown(j){g&&ey.has(j.key)&&j.stopPropagation()}},ah(y),u,{"data-rootownerid":M}]});let G=T.type===void 0||N;return(C||T.type==="menubar"&&E!==nh)&&(G=!0),A.jsx(qm,{context:k,openInteractionType:_,modal:N,disabled:!x,returnFocus:a===void 0?G:a,initialFocus:T.type!=="menu",restoreFocus:!0,externalTree:T.type!=="menubar"?D: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})}),hz=R.createContext(void 0);function U2(){const t=R.useContext(hz);if(t===void 0)throw new Error(Jt(32));return t}const q2=R.forwardRef(function(e,n){const{keepMounted:r=!1,...i}=e,{store:s}=Cu();return s.useState("mounted")||r?A.jsx(hz.Provider,{value:r,children:A.jsx(Um,{ref:n,...i})}):null});function ch(t){const{children:e,elementsRef:n,labelsRef:r,onMapChange:i}=t,s=Ae(i),[,a]=R.useState(!1),u=Qn(W2).current,c=Qn(G2).current,d=R.useRef(0),h=R.useRef(!0),g=R.useRef([]),m=R.useRef(null),y=Ae(()=>{h.current||(h.current=!0,a(k=>!k))}),b=Ae((k,D)=>{c.set(k,D),y()}),x=Ae(k=>{c.delete(k),y()}),S=Ae(k=>{const D=new Map;return n.current.length=0,r&&(r.current.length=0),k.forEach(O=>{D.set(O.element,{...O.registration.metadata??{},index:O.index}),n.current[O.index]=O.element,r&&(r.current[O.index]=O.registration.label!==void 0?O.registration.label:O.registration.textRef?.current?.textContent??O.element.textContent)}),d.current=n.current.length,D});function C(k){if(m.current?.disconnect(),m.current=null,typeof MutationObserver!="function"||k.length<2)return;const D=new MutationObserver(I=>{if(!X2(I))return;let L=null;for(const _ of k)if(_.isConnected){if(L&&pz(L,_)>0){D.disconnect(),y();return}L=_}});m.current=D;const O=new Set;for(let I=1;I<k.length;I+=1){const L=Y2(k[I-1],k[I]);L&&O.add(L)}O.forEach(I=>D.observe(I,{childList:!0}))}const T=Ae(()=>{const[k,D]=K2(c),O=S(k);C(D),g.current=k,h.current=!1,u.forEach(I=>I(O)),s(O)});Oe(()=>(h.current||S(g.current),()=>{n.current=[],r&&(r.current=[])}),[n,r,S]),Oe(()=>{h.current&&T()}),Oe(()=>()=>{m.current?.disconnect(),h.current=!0},[]);const E=Ae(k=>(u.add(k),()=>{u.delete(k)})),M=R.useMemo(()=>({register:b,unregister:x,subscribeMapChange:E,nextIndexRef:d}),[b,x,E,d]);return A.jsx(uz.Provider,{value:M,children:e})}function G2(){return new Map}function W2(){return new Set}function K2(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)=>pz(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 Y2(t,e){let n=t.parentElement;for(;n&&!n.contains(e);)n=n.parentElement;return n}function X2(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 pz(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 A.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...i,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:s}})});let hO={},pO={},gO="";function ny(t,e){return th(t)?t:e}function mO(t,e,n){return/hidden|clip/.test(t.getComputedStyle(ny(e,n)).overflowY)}function Q2(t){if(typeof document>"u")return!1;const e=vt(t);return Rn(e).innerWidth-e.documentElement.clientWidth>0}function Z2(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 J2(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 eq(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(dl&&(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,hO={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},gO=n.style.scrollBehavior,pO={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",D=Math.max(0,i.innerWidth-r.clientWidth),O=Math.max(0,i.innerHeight-r.clientHeight),I=parseFloat(b.marginTop)+parseFloat(b.marginBottom),L=parseFloat(b.marginLeft)+parseFloat(b.marginRight),_=ny(n,r);if(u=Z2(t),u){n.style.scrollbarGutter=C,_.style.overflowY="hidden",_.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||O?`calc(100dvh - ${I+O}px)`:"100dvh",width:L||D?`calc(100vw - ${L+D}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,hO),Object.assign(r.style,pO),u||(n.scrollTop=s,n.scrollLeft=a,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=gO)}function g(){h(),c.request(d)}d();const m=yt(i,"resize",g);return()=>{c.cancel(),h(),typeof i.removeEventListener=="function"&&m()}}class tq{lockCount=0;restore=null;timeoutLock=_i.create();timeoutUnlock=_i.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(mO(s,r,i)){const u=new s.MutationObserver(()=>{mO(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||!Q2(e);this.restore=a?J2(e):eq(e)}}const nq=new tq;function gz(t=!0,e=null){Oe(()=>{if(t)return nq.acquire(e)},[t,e])}const rq=20;function u1(t,e,n,r){const[i,s]=R.useState(!1);Oe(()=>{if(!t||!e||n==null){s(!1);return}const a=vt(n).documentElement.clientWidth,u=n.offsetWidth;s(a>0&&u>0&&u>=a-rq)},[t,e,n]),gz(t&&(!e||i),r)}const iq=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:S=Fw,style:C,...T}=e,{store:E}=Cu(),M=U2(),k=a1(!0),D=E.useState("parent"),O=E.useState("floatingRootContext"),I=E.useState("floatingTreeRoot"),L=E.useState("mounted"),_=E.useState("open"),N=E.useState("modal"),B=E.useState("openMethod"),H=E.useState("activeTriggerElement"),F=E.useState("transitionStatus"),G=E.useState("positionerElement"),j=E.useState("instantType"),q=E.useState("adaptiveOrigin"),$=E.useState("lastOpenChangeReason"),X=E.useState("floatingNodeId"),Z=E.useState("floatingParentNodeId"),z=O.useState("domReferenceElement"),U=R.useRef(null),W=_P(G);let K=r,ie=d,ee=h,ae=c,Y=S;D.type==="context-menu"&&(K=r??D.context?.anchor,ae=ae??"start",!u&&ae!=="center"&&(ee=e.alignOffset??2,ie=e.sideOffset??-5));let se=u,ve=ae;D.type==="menu"?(se=se??"inline-end",ve=ve??"start",Y=e.collisionAvoidance??xP):D.type==="menubar"&&(se=se??(D.context.orientation==="vertical"?"inline-end":"bottom"),ve=ve??"start");const ye=D.type==="context-menu",he=Qm({anchor:K,floatingRootContext:O,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,Ue(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 ze=xe.reason??id;E.setOpen(!1,Ue(ze))}return I.events.on("menuopenchange",oe),()=>{I.events.off("menuopenchange",oe)}},[I.events,E]);const pe=lr();R.useEffect(()=>{_||pe.clear()},[_,pe]),R.useEffect(()=>{function oe(xe){if(!(!_||xe.nodeId!==E.select("floatingParentNodeId")))if(xe.target&&H&&H!==xe.target){const ze=E.select("closeDelay");ze>0?pe.isStarted()||pe.start(ze,()=>{E.setOpen(!1,Ue(id))}):E.setOpen(!1,Ue(id))}else pe.clear()}return I.events.on("itemhover",oe),()=>{I.events.off("itemhover",oe)}},[I.events,_,H,E,pe]),R.useEffect(()=>{const oe={open:_,nodeId:X,parentNodeId:Z,reason:E.select("lastOpenChangeReason")};I.events.emit("menuopenchange",oe)},[I.events,_,E,X,Z]),Oe(()=>{const oe=z,xe=U.current;if(oe&&(U.current=oe),xe&&oe&&oe!==xe){E.set("instantType",void 0);const ze=new AbortController;return W(()=>{E.set("instantType","trigger-change")},ze.signal),()=>{ze.abort()}}},[z,W,E]);const Te={open:_,side:he.side,align:he.align,anchorHidden:he.anchorHidden,nested:D.type==="menu",instant:j},De=D.type==="menubar"&&D.context.modal;u1(_&&(De||N&&$!==Sr),B==="touch",G,H);const Ee=Zm(e,Te,{styles:he.positionerStyles,transitionStatus:F,props:T,refs:[n,E.useStateSetter("positionerElement")],hidden:!L,inert:!_}),_e=L&&D.type!=="menu"&&(D.type!=="menubar"&&N&&$!==Sr||D.type==="menubar"&&D.context.modal);let Me=null;return D.type==="menubar"?Me=D.context.contentElement:D.type===void 0&&(Me=H),A.jsxs(rz.Provider,{value:he,children:[_e&&A.jsx(ty,{ref:D.type==="context-menu"||D.type==="nested-context-menu"?D.context.internalBackdropRef:null,inert:Xc(!_),cutout:Me}),A.jsx(B$,{id:X,children:A.jsx(ch,{elementsRef:E.context.itemDomElements,labelsRef:E.context.itemLabels,children:Ee})})]})}),oq=R.createContext(null);function mz(t){return R.useContext(oq)}function sq(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 fc(t,e){const n=R.useRef(t),r=Ae(e);Oe(()=>{n.current!==t&&r(n.current),n.current=t},[t,r])}function yz(t,e){const n=Ae((s,a)=>{(typeof t=="function"?t():t)||e(a||(eh?"touch":""))}),{onClick:r,onPointerDown:i}=sq(n);return R.useMemo(()=>({onClick:r,onPointerDown:i}),[r,i])}function c1(t){const[e,n]=R.useState(null),r=yz(t,n);return fc(t,i=>{i&&!t&&n(null)}),R.useMemo(()=>({openMethod:e,triggerProps:r}),[e,r])}const lq={...t1,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 aq extends Kc{constructor(e){super({...cq(),...e},uq(),lq),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 uq(){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 cq(){return{...Jw(),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 $w,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:gn,keyboardEventRelay:void 0,closeDelay:0,adaptiveOrigin:void 0}}const fq=R.createContext(void 0);function dq(){return R.useContext(fq)}const hq=Cw(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:S=!0}=e,C=a1(!0),T=Cu(!0),E=mz(!0),M=dq(),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]),D=pq({open:a,openProp:r,activeTriggerId:x,triggerIdProp:b,parent:k});D.useControlledProp("openProp",r),D.useControlledProp("triggerIdProp",b),D.useContextCallback("onOpenChangeComplete",s);const O=ha(),I=ha(),L=D.useState("floatingTreeRoot"),_=MP(L),N=Sa(),B=D.useState("open"),H=D.useState("activeTriggerElement"),F=D.useState("positionerElement"),G=D.useState("hoverEnabled"),j=D.useState("disabled"),q=D.useState("lastOpenChangeReason"),$=D.useState("parent"),X=D.useState("activeIndex"),Z=D.useState("payload"),z=D.useState("floatingParentNodeId"),U=R.useRef(null),W=R.useRef($.type!=="context-menu"),K=lr(),ie=R.useRef(!0),ee=lr(),ae=z!=null,{openMethod:Y,triggerProps:se}=c1(B);D.useSyncedValues({disabled:u,highlightItemOnHover:S,modal:$.type===void 0?c:void 0,openMethod:Y,rootId:O}),Xw(D);const{forceUnmount:ve}=Qw(B,D,()=>{D.set("allowMouseEnter",!1)});Oe(()=>{C&&!T?D.update({parent:{type:"context-menu",context:C},floatingNodeId:_,floatingParentNodeId:N}):T&&D.update({floatingNodeId:_,floatingParentNodeId:N})},[C,T,_,N,D]),R.useEffect(()=>{if(B||(U.current=null),$.type==="context-menu"){if(!B){K.clear(),W.current=!1;return}K.start(500,()=>{W.current=!0})}},[K,B,$.type]),Oe(()=>{!B&&!G&&D.set("hoverEnabled",!0)},[B,G,D]);const ye=Ae((me,Be)=>{const Ke=Be.reason;if(!me&&!D.select("open")||B===me&&Be.trigger===H&&q===Ke)return;const wt=VP(Be);if(!me&&Be.trigger==null&&(Be.trigger=H??void 0),i?.(me,Be),Be.isCanceled)return;D.state.floatingRootContext.dispatchOpenChange(me,Be);const xt=Be.event;if(me===!1&&xt?.type==="click"&&xt.pointerType==="touch"&&!ie.current)return;me&&Ke===gc?(ie.current=!1,ee.start(300,()=>{ie.current=!0})):(ie.current=!0,ee.clear());const st=(Ke===Gc||Ke===uu)&&xt.detail===0,Ct=!me&&(Ke===Wc||Ke==null),Wt={open:me,openChangeReason:Ke};U.current=Be.event,Kw(Wt,me,Be.trigger,wt()),D.update(Wt),$.type==="menubar"&&(Ke===gc||Ke===ca||Ke===Sr||Ke===Fx||Ke===id)?D.set("instantType","group"):st||Ct?D.set("instantType",st?"click":"dismiss"):D.set("instantType",void 0)}),he=jP({popupStore:D,floatingId:I,nested:N!=null,onOpenChange:ye}),pe=he.context.events;Oe(()=>{const me=({open:Be,eventDetails:Ke})=>ye(Be,Ke);return pe.on("setOpen",me),()=>{pe?.off("setOpen",me)}},[pe,ye]);const Te=R.useCallback(()=>{D.setOpen(!1,Ue(zw))},[D]);R.useImperativeHandle(g,()=>({unmount:ve,close:Te}),[ve,Te]);let De;$.type==="context-menu"&&(De=$.context),R.useImperativeHandle(De?.positionerRef,()=>F,[F]),R.useImperativeHandle(De?.actionsRef,()=>({setOpen:ye}),[ye]);const Pe=ih(he,{enabled:!j,bubbles:{escapeKey:m&&$.type==="menu"},outsidePress(){return $.type!=="context-menu"||U.current?.type==="contextmenu"?!0:W.current},externalTree:ae?L:void 0}),Ee=Yc(),_e=R.useCallback(me=>{D.select("activeIndex")!==me&&D.set("activeIndex",me)},[D]),Me=o1(he,{enabled:!j,listRef:D.context.itemDomElements,activeIndex:X,nested:$.type!==void 0,loopFocus:d,orientation:h,parentOrientation:$.type==="menubar"?$.context.orientation:void 0,rtl:Ee==="rtl",disabledIndices:li,onNavigate:_e,openOnArrowKeyDown:$.type!=="context-menu",externalTree:ae?L:void 0,focusItemOnHover:S}),oe=R.useCallback(me=>{D.context.typingRef.current=me},[D]),xe=YP(he,{enabled:!j,listRef:D.context.itemLabels,elementsRef:D.context.itemDomElements,activeIndex:X,resetMs:A$,onMatch:me=>{B&&me!==X&&D.set("activeIndex",me)},onTyping:oe}),ze=R.useMemo(()=>{const me=Jr(xe.reference,Me.reference,Pe.reference,{onMouseMove(){D.set("allowMouseEnter",!0)}},se);return me["aria-haspopup"]="menu",me["aria-expanded"]=B,me},[D,xe.reference,Me.reference,Pe.reference,se,B]),ne=R.useMemo(()=>{const me=Jr(Me.trigger,Pe.trigger,se);return me["aria-haspopup"]="menu",me["aria-expanded"]=!1,me},[Me.trigger,Pe.trigger,se]),J=R.useMemo(()=>Jr(oh,{id:I,role:"menu","aria-labelledby":H?.id,onMouseMove(){D.set("allowMouseEnter",!0),$.type==="menu"&&D.set("hoverEnabled",!1)},onClick(){D.select("hoverEnabled")&&D.set("hoverEnabled",!1)},onKeyDown(me){const Be=D.select("keyboardEventRelay");Be&&!me.isPropagationStopped()&&Be(me)}},xe.floating,Me.floating,Pe.floating),[H,I,$.type,D,xe.floating,Me.floating,Pe.floating]),le=Me.item??gn;Zw(D,{floatingRootContext:he,activeTriggerProps:ze,inactiveTriggerProps:ne,popupProps:J,itemProps:le});const we=R.useMemo(()=>({store:D,parent:k}),[D,k]),de=A.jsxs(iz.Provider,{value:we,children:[y&&A.jsx(Ww,{handle:y,store:D}),typeof n=="function"?n({payload:Z}):n]});return $.type===void 0||$.type==="context-menu"?A.jsx(j$,{externalTree:L,children:de}):de});function pq(t){return Qn(()=>new aq(t)).current}const Yp=5;function vz(t,e){const n=gq(e);return t.clientX>=n.left-Yp&&t.clientX<=n.right+Yp&&t.clientY>=n.top-Yp&&t.clientY<=n.bottom+Yp}function gq(t){const e=t.getBoundingClientRect(),n=Rn(t);if(Tw)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 bz(t={}){const{highlightItemOnHover:e,highlightedIndex:n,onHighlightedIndexChange:r}=Jm(),{ref:i,index:s}=Qc(t),a=n===s,u=R.useRef(null),c=Cs(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 f1(t){const{render:e,className:n,style:r,state:i=gn,props:s=li,refs:a=li,metadata:u,stateAttributesMapping:c,tag:d="div",...h}=t,{compositeProps:g,compositeRef:m}=bz({metadata:u});return rt(d,t,{state:i,ref:[m,...a],props:[g,...s,h],stateAttributesMapping:c})}function xz(t){if(cn(t)&&t.hasAttribute("data-rootownerid"))return t.getAttribute("data-rootownerid");if(!il(t))return xz(al(t))}function mq(t,e){const n=R.useRef(null);function r(s){go.flushSync(()=>{t.setOpen(!1,Ue(ca,s.nativeEvent,s.currentTarget))}),C$(n.current)?.focus()}function i(s){const a=t.select("positionerElement");if(a&&mc(s,a))t.context.beforeContentFocusGuardRef.current?.focus();else{go.flushSync(()=>{t.setOpen(!1,Ue(ca,s.nativeEvent,s.currentTarget))});let u=w$(t.context.triggerFocusTargetRef.current||e.current);for(;u!==null&&Ge(a,u);){const c=u;if(u=Vw(u),u===c)break}u?.focus()}}return{preFocusGuardRef:n,handlePreFocusGuardFocus:r,handleFocusTargetFocus:i}}function yq(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 vq=KD(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=Cu(!0),C=n1(m)??x?.store;if(!C)throw new Error(Jt(85));const T=Hr(c),E=C.useState("isTriggerActive",T),M=C.useState("floatingRootContext"),k=C.useState("isOpenedByTrigger",T),D=C.useState("triggerPopupId",T),O=R.useRef(null),I=xq(),L=Jm(!0),_=wa(),N=R.useMemo(()=>_??new $w,[_]),B=MP(N),H=Sa(),{registerTrigger:F,isMountedByThisTrigger:G}=Yw(T,O,C,{payload:y,closeDelay:g,parent:I,floatingTreeRoot:N,floatingNodeId:B,floatingParentNodeId:H,keyboardEventRelay:L?.relayKeyboardEvent}),j=I.type==="menubar",q=C.useState("disabled"),$=a||q||j&&I.context.disabled,{getButtonProps:X,buttonRef:Z}=Vi({disabled:$,native:u});R.useEffect(()=>{!k&&I.type===void 0&&(C.context.allowMouseUpTriggerRef.current=!1)},[C,k,I.type]);const z=R.useRef(null),U=lr(),W=Ae(oe=>{if(!z.current)return;U.clear(),C.context.allowMouseUpTriggerRef.current=!1;const xe=oe.target;Ge(z.current,xe)||Ge(C.select("positionerElement"),xe)||xe===z.current||xe!=null&&xz(xe)===C.select("rootId")||vz(oe,z.current)||N.events.emit("close",{domEvent:oe,reason:nP})});R.useEffect(()=>{k&&C.select("lastOpenChangeReason")===Sr&&vt(z.current).addEventListener("mouseup",W,{once:!0})},[k,W,C]);const K=j&&I.context.hasSubmenuOpen,ee=KP(M,{enabled:(d??K)&&!$&&(!j||K&&!G),handleClose:XP({blockPointerEvents:!j}),mouseOnly:!0,move:!1,restMs:I.type===void 0?h:void 0,delay:{close:g},triggerElementRef:O,externalTree:N,isActiveTrigger:E,isClosing:()=>C.select("transitionStatus")==="ending"}),ae=bq(k,C.select("lastOpenChangeReason")),Y=Gm(M,{enabled:!$,event:k&&j?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:I.type===void 0?ae:!1}),se=qP(M,{enabled:!$&&K}),ve=yq({open:k,enabled:j,mouseDownAction:"open"}),ye=R.useMemo(()=>Jr(se.reference,Y.reference),[se.reference,Y.reference]),he=C.useState("triggerProps",G),{preFocusGuardRef:pe,handlePreFocusGuardFocus:Te,handleFocusTargetFocus:De}=mq(C,O),Pe={disabled:$,open:k},Ee=[z,n,Z,F,O],_e=[ye,ee??gn,he,{"aria-haspopup":"menu","aria-controls":D,id:T,onMouseDown:oe=>{if(C.select("open"))return;U.start(200,()=>{C.context.allowMouseUpTriggerRef.current=!0}),vt(oe.currentTarget).addEventListener("mouseup",W,{once:!0})}},j?{role:"menuitem"}:{},ve,b,X],Me=rt("button",e,{enabled:!j,stateAttributesMapping:sm,state:Pe,ref:Ee,props:_e});return j?A.jsx(f1,{tag:"button",render:r,className:i,style:s,state:Pe,refs:Ee,props:_e,stateAttributesMapping:sm}):k?A.jsxs(R.Fragment,{children:[A.jsx(du,{ref:pe,onFocus:Te},`${T}-pre-focus-guard`),A.jsx(R.Fragment,{children:Me},T),A.jsx(du,{ref:C.context.triggerFocusTargetRef,onFocus:De},`${T}-post-focus-guard`)]}):A.jsx(R.Fragment,{children:Me},T)});function bq(t,e){const n=lr(),[r,i]=R.useState(!1);return Oe(()=>{t&&e===Sr?(i(!0),n.start(O$,()=>{i(!1)})):t||(n.clear(),i(!1))},[t,e,n]),r}function xq(){const t=mz();return R.useMemo(()=>t?{type:"menubar",context:t}:{type:void 0},[t])}const Sz=R.forwardRef(function(e,n){const{className:r,render:i,orientation:s="horizontal",style:a,...u}=e;return rt("div",e,{state:{orientation:s},ref:n,props:[{role:"separator","aria-orientation":s},u]})});function wz(t){return t==null||t.hasAttribute("disabled")||t.getAttribute("aria-disabled")==="true"}function Sq(t,e){const n=getComputedStyle(t),r=parseFloat(n.fontSize);return e*r}function wq(t,e){const n=getComputedStyle(t.ownerDocument.documentElement),r=parseFloat(n.fontSize);return e*r}function Cq(t){return t/100*window.innerHeight}function Rq(t){return t/100*window.innerWidth}function Tq(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]=Tq(n);switch(s){case"%":{r=i/100*t;break}case"px":{r=i;break}case"rem":{r=wq(e,i);break}case"em":{r=Sq(e,i);break}case"vh":{r=Cq(i);break}case"vw":{r=Rq(i);break}}return r}function ai(t){return parseFloat(t.toFixed(3))}function zc({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 Jx(t){const{panels:e}=t,n=zc({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=ai(h/n*100)}let u;if(s.defaultSize!==void 0){const h=od({groupSize:n,panelElement:i,styleProp:s.defaultSize});u=ai(h/n*100)}let c=0;if(s.minSize!==void 0){const h=od({groupSize:n,panelElement:i,styleProp:s.minSize});c=ai(h/n*100)}let d=100;if(s.maxSize!==void 0){const h=od({groupSize:n,panelElement:i,styleProp:s.maxSize});d=ai(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 eS(t,e){return Array.from(e).sort(t==="horizontal"?Eq:Mq)}function Eq(t,e){const n=t.element.offsetLeft-e.element.offsetLeft;return n!==0?n:t.element.offsetWidth-e.element.offsetWidth}function Mq(t,e){const n=t.element.offsetTop-e.element.offsetTop;return n!==0?n:t.element.offsetHeight-e.element.offsetHeight}function Cz(t){return t!==null&&typeof t=="object"&&"nodeType"in t&&t.nodeType===Node.ELEMENT_NODE}function Rz(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 Aq({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}=Rz(r,a),d=t==="horizontal"?u:c;d<s&&(s=d,i=a)}return wn(i,"No rect found"),i}let Xp;function Oq(){return Xp===void 0&&(typeof matchMedia=="function"?Xp=!!matchMedia("(pointer:coarse)").matches:Xp=!1),Xp}function Tz(t){const{element:e,orientation:n,panels:r,separators:i}=t,s=eS(n,Array.from(e.children).filter(Cz).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 S=r.find(C=>C.element===x);if(S){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 D=y[0],O=Aq({orientation:n,rects:[C,T],targetRect:D.element.getBoundingClientRect()});E=[D,O===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 D=Oq()?t.resizeTargetMinimumSize.coarse:t.resizeTargetMinimumSize.fine;if(k.width<D){const I=D-k.width;k=new DOMRect(k.x-I/2,k.y,k.width+I,k.height)}if(k.height<D){const I=D-k.height;k=new DOMRect(k.x,k.y-I/2,k.width,k.height+I)}const O=b<=d||b>h;!u&&!O&&a.push({group:t,groupSize:zc({group:t}),panels:[m,S],separator:"width"in M?void 0:M,rect:k}),u=!1}}c=!1,m=S,y=[]}}else if(x.hasAttribute("data-separator")){x.ariaDisabled!==null&&(u=!0);const S=i.find(C=>C.element===x);S?y.push(S):(m=void 0,y=[])}else c=!0}return a}let Ez=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)}}},vc={cursorFlags:0,state:"inactive"};const d1=new Ez;function pu(){return vc}function kq(t){return d1.addListener("change",t)}function Iq(t){const e=vc,n={...vc};n.cursorFlags=t,vc=n,d1.emit("change",{prev:e,next:n})}function bc(t){const e=vc;vc=t,d1.emit("change",{prev:e,next:t})}const Dq=t=>t,hb=()=>{},Mz=1,Az=2,Oz=4,kz=8,yO=3,vO=12;let Qp;function bO(){return Qp===void 0&&(Qp=!1,typeof window<"u"&&(window.navigator.userAgent.includes("Chrome")||window.navigator.userAgent.includes("Firefox"))&&(Qp=!0)),Qp}function Pq({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&&bO()){const s=(t&Mz)!==0,a=(t&Az)!==0,u=(t&Oz)!==0,c=(t&kz)!==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 bO()?r>0&&i>0?"move":r>0?"ew-resize":"ns-resize":r>0&&i>0?"grab":r>0?"col-resize":"row-resize"}}const xO=new WeakMap;function h1(t){if(t.defaultView===null||t.defaultView===void 0)return;let{prevStyle:e,styleSheet:n}=xO.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=pu();switch(r.state){case"active":case"hover":{const i=Pq({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}}xO.set(t,{prevStyle:e,styleSheet:n})}let ms=new Map;const Iz=new Ez;function zq(t){ms=new Map(ms),ms.delete(t)}function SO(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 Ru(){return ms}function p1(t,e){return Iz.addListener("groupChange",n=>{n.group.id===t&&e(n)})}function ul(t,e,n){const r=ms.get(t);ms=new Map(ms),ms.set(t,e),Iz.emit("groupChange",{group:t,isUserInteraction:n?.isUserInteraction===!0,prev:r,next:e})}function Dz(t){const e=pu();let n=!1;return e.state==="active"&&(bc({cursorFlags:0,state:"inactive"}),e.hitRegions.length>0&&(h1(t),n=!0,e.hitRegions.forEach(r=>{const i=aa(r.group.id,!0);ul(r.group,i,{isUserInteraction:!0})}))),n}function wO(t){t.defaultPrevented||Dz(t.currentTarget)}function Nq(t,e,n){let r,i={x:1/0,y:1/0};for(const s of e){const a=Rz(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 Lq(t){return t!==null&&typeof t=="object"&&"nodeType"in t&&t.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function Bq(t,e){if(t===e)throw new Error("Cannot compare node with itself");const n={a:TO(t),b:TO(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:RO(CO(n.a)),b:RO(CO(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 jq=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function _q(t){const e=getComputedStyle(Pz(t)??t).display;return e==="flex"||e==="inline-flex"}function Hq(t){const e=getComputedStyle(t);return!!(e.position==="fixed"||e.zIndex!=="auto"&&(e.position!=="static"||_q(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"||jq.test(e.willChange)||e.webkitOverflowScrolling==="touch")}function CO(t){let e=t.length;for(;e--;){const n=t[e];if(wn(n,"Missing node"),Hq(n))return n}return null}function RO(t){return t&&Number(getComputedStyle(t).zIndex)||0}function TO(t){const e=[];for(;t;)e.push(t),t=Pz(t);return e}function Pz(t){const{parentNode:e}=t;return Lq(e)?e.host:e}function Vq(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 Fq({groupElement:t,hitRegion:e,pointerEventTarget:n}){if(!Cz(n)||n.contains(t)||t.contains(n))return!0;if(Bq(n,t)>0){let r=n;for(;r;){if(r.contains(t))return!0;if(Vq(r.getBoundingClientRect(),e))return!1;r=r.parentElement}}return!0}function g1(t,e){const n=[];return e.forEach((r,i)=>{if(i.disabled)return;const s=Tz(i),a=Nq(i.orientation,s,{x:t.clientX,y:t.clientY});a&&a.distance.x<=0&&a.distance.y<=0&&Fq({groupElement:i.element,hitRegion:a.hitRegion.rect,pointerEventTarget:t.target})&&n.push(a.hitRegion)}),n}function $q(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 Yr(t,e,n=0){return Math.abs(ai(t)-ai(e))<=n}function us(t,e){return Yr(t,e)?0:t>e?1:-1}function dc({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=ai(r),r}function zd({delta:t,initialLayout:e,panelConstraints:n,pivotIndices:r,prevLayout:i,trigger:s}){if(Yr(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,S=n[x];wn(S,`Panel constraints not found for index ${x}`);const{collapsedSize:C=0,collapsible:T,minSize:E=0}=S;if(T){const M=u[x];if(wn(M!=null,`Previous layout not found for panel index ${x}`),Yr(M,C)){const k=E-M;us(k,Math.abs(t))>0&&(t=t<0?0-k:k)}}}{const x=t<0?h:g,S=n[x];wn(S,`No panel constraints found for index ${x}`);const{collapsedSize:C=0,collapsible:T,minSize:E=0}=S;if(T){const M=u[x];if(wn(M!=null,`Previous layout not found for panel index ${x}`),Yr(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,S=n[x];wn(S,`Panel constraints not found for index ${x}`);const C=u[x],{collapsible:T,collapsedSize:E,minSize:M}=S;if(T&&us(C,M)<0)if(t>0){const k=M-E,D=k/2,O=C+t;us(O,M)<0&&(t=us(t,D)<=0?0:k)}else{const k=M-E,D=100-k/2,O=C-t;us(O,M)<0&&(t=us(100+t,D)>0?0:-k)}break}}{const x=t<0?1:-1;let S=t<0?g:h,C=0;for(;;){const E=u[S];wn(E!=null,`Previous layout not found for panel index ${S}`);const M=dc({overrideDisabledPanels:a,panelConstraints:n[S],prevSize:E,size:100})-E;if(C+=M,S+=x,S<0||S>=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 S=Math.abs(t)-Math.abs(m),C=u[x];wn(C!=null,`Previous layout not found for panel index ${x}`);const T=C-S,E=dc({overrideDisabledPanels:a,panelConstraints:n[x],prevSize:C,size:T});if(!Yr(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($q(c,d))return i;{const x=t<0?g:h,S=u[x];wn(S!=null,`Previous layout not found for panel index ${x}`);const C=S+m,T=dc({overrideDisabledPanels:a,panelConstraints:n[x],prevSize:S,size:C});if(d[x]=T,!Yr(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 D=k+E,O=dc({overrideDisabledPanels:a,panelConstraints:n[M],prevSize:k,size:D});if(Yr(k,O)||(E-=O-k,d[M]=O),Yr(E,0))break;t>0?M--:M++}}}const y=Object.values(d).reduce((x,S)=>S+x,0);if(!Yr(y,100,.1))return i;const b=Object.keys(i);return d.reduce((x,S,C)=>(x[b[C]]=S,x),{})}function gu(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 mu({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(!Yr(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=dc({overrideDisabledPanels:!0,panelConstraints:e[u],prevSize:c,size:d});d!=h&&(s+=d-h,r[u]=h)}if(!Yr(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=dc({overrideDisabledPanels:!0,panelConstraints:e[u],prevSize:c,size:d});if(c!==h&&(s-=h-c,r[u]=h,Yr(s,0)))break}const a=Object.keys(t);return r.reduce((u,c,d)=>(u[a[d]]=c,u),{})}function zz({groupId:t,panelId:e}){const n=()=>{const c=Ru();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(S=>S.id===e),b=y===0,x=y===d.length-1;if(x&&c<m&&(b||d.slice(0,y).every((S,C)=>{const T=g[C];return T?.collapsible&&Yr(T.collapsedSize,h[T.panelId])}))){const S=d.slice(0,y).reduce((C,T)=>C+h[T.id],0);return{...h,[e]:ai(100-S)}}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(),S=a({nextSize:c,panels:m.panels,prevLayout:b,derivedPanelConstraints:g}),C=mu({layout:S,panelConstraints:g});gu(b,C)||ul(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&&Yr(d,h)},resize:c=>{const{group:d}=n(),{element:h}=i(),g=zc({group:d}),m=od({groupSize:g,panelElement:h,styleProp:c}),y=ai(m/g*100);u(y)}}}function EO(t){if(t.defaultPrevented)return;const e=Ru();g1(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=zz({groupId:n.group.id,panelId:r.id});s&&i!==void 0&&(s.resize(i),t.preventDefault())}}})}function zg(t){const e=Ru();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 Nz({groupId:t}){const e=()=>{const n=Ru();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=mu({layout:n,panelConstraints:i});return r?u:(gu(u,d)||ul(s,{defaultLayoutDeferred:r,derivedPanelConstraints:i,groupSize:a,layout:d,separatorToPanels:c}),d)}}}function Qa(t,e){const n=zg(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=Nz({groupId:n.id}).getLayout(),c=zd({delta:e,initialLayout:u,panelConstraints:r.derivedPanelConstraints,pivotIndices:a,prevLayout:u,trigger:"keyboard"}),d=mu({layout:c,panelConstraints:r.derivedPanelConstraints});gu(u,d)||ul(n,{defaultLayoutDeferred:r.defaultLayoutDeferred,derivedPanelConstraints:r.derivedPanelConstraints,groupSize:r.groupSize,layout:d,separatorToPanels:r.separatorToPanels},{isUserInteraction:!0})}function MO(t){if(t.defaultPrevented)return;const e=t.currentTarget,n=zg(e);if(!n.disabled)switch(t.key){case"ArrowDown":{t.preventDefault(),n.orientation==="vertical"&&Qa(e,5);break}case"ArrowLeft":{t.preventDefault(),n.orientation==="horizontal"&&Qa(e,-5);break}case"ArrowRight":{t.preventDefault(),n.orientation==="horizontal"&&Qa(e,5);break}case"ArrowUp":{t.preventDefault(),n.orientation==="vertical"&&Qa(e,-5);break}case"End":{t.preventDefault(),Qa(e,100);break}case"Enter":{t.preventDefault();const r=zg(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;Qa(e,y-m)}break}case"F6":{t.preventDefault();const r=zg(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(),Qa(e,-100);break}}}function AO(t){if(t.defaultPrevented||t.pointerType==="mouse"&&t.button>0)return;const e=Ru(),n=g1(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)}),bc({cursorFlags:0,hitRegions:n,initialLayoutMap:r,pointerDownAtPoint:{x:t.clientX,y:t.clientY},state:"active"}),n.length&&t.preventDefault()}function Lz({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 S=r.get(h),C=i.get(h);if(!S||!C)return;const{defaultLayoutDeferred:T,derivedPanelConstraints:E,groupSize:M,layout:k,separatorToPanels:D}=C;if(E&&k&&D){const O=zd({delta:x,initialLayout:S,panelConstraints:E,pivotIndices:d.panels.map(I=>y.indexOf(I)),prevLayout:k,trigger:"mouse-or-touch"});if(gu(O,k)){if(x!==0&&!b)switch(m){case"horizontal":{u|=x<0?Mz:Az;break}case"vertical":{u|=x<0?Oz:kz;break}}}else ul(d.group,{defaultLayoutDeferred:T,derivedPanelConstraints:E,groupSize:M,layout:O,separatorToPanels:D})}});let c=0;e.movementX===0?c|=a&yO:c|=u&yO,e.movementY===0?c|=a&vO:c|=u&vO,Iq(c),h1(t)}function OO(t){const e=Ru(),n=pu();n.state==="active"&&Lz({document:t.currentTarget,event:t,hitRegions:n.hitRegions,initialLayoutMap:n.initialLayoutMap,mountedGroups:e,prevCursorFlags:n.cursorFlags})}function kO(t){if(t.defaultPrevented)return;const e=pu(),n=Ru();switch(e.state){case"active":{if(t.buttons===0){bc({cursorFlags:0,state:"inactive"}),e.hitRegions.forEach(r=>{const i=aa(r.group.id,!0);ul(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)}Lz({document:t.currentTarget,event:t,hitRegions:e.hitRegions,initialLayoutMap:e.initialLayoutMap,mountedGroups:n,pointerDownAtPoint:e.pointerDownAtPoint,prevCursorFlags:e.cursorFlags});break}default:{const r=g1(t,n);r.length===0?e.state!=="inactive"&&bc({cursorFlags:0,state:"inactive"}):bc({cursorFlags:0,hitRegions:r,state:"hover"}),h1(t.currentTarget);break}}}function IO(t){t.relatedTarget instanceof HTMLIFrameElement&&pu().state==="hover"&&bc({cursorFlags:0,state:"inactive"})}function DO(t){t.defaultPrevented||t.pointerType==="mouse"&&t.button>0||Dz(t.currentTarget)&&t.preventDefault()}function PO(t){let e=0,n=0;const r={};for(const s of t)if(s.defaultSize!==void 0){e++;const a=ai(s.defaultSize);n+=a,r[s.panelId]=a}else r[s.panelId]=void 0;const i=t.length-e;if(i!==0){const s=ai((100-n)/i);for(const a of t)a.defaultSize===void 0&&(r[a.panelId]=s)}return r}function Uq(t,e,n){if(!n[0])return;const r=t.panels.find(c=>c.element===e);if(!r||!r.onResize)return;const i=zc({group:t}),s=t.orientation==="horizontal"?r.element.offsetWidth:r.element.offsetHeight,a=r.mutableValues.prevSize,u={asPercentage:ai(s/i*100),inPixels:s};r.mutableValues.prevSize=u,r.onResize(u,r.id,a)}function qq(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 Gq({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=ai(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]=ai(m/s*d)}else{const g=ai(d/c.length);for(const m of c)h[m]=g}return h}function Wq(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 ac=new Map;function Kq(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:S,target:C}=x;if(C===t.element){if(e){const T=zc({group:t});if(T===0)return;const E=aa(t.id);if(!E)return;const M=Jx(t),k=E.defaultLayoutDeferred?PO(M):E.layout,D=Gq({group:t,nextGroupSize:T,prevGroupSize:E.groupSize,prevLayout:k}),O=mu({layout:D,panelConstraints:M});if(!E.defaultLayoutDeferred&&gu(E.layout,O)&&qq(E.derivedPanelConstraints,M)&&E.groupSize===T)return;ul(t,{defaultLayoutDeferred:!1,derivedPanelConstraints:M,groupSize:T,layout:O,separatorToPanels:E.separatorToPanels})}}else Uq(t,C,S)}});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=zc({group:t}),u=Jx(t),c=t.panels.map(({id:b})=>b).join(",");let d=t.mutableState.defaultLayout;d&&(Wq(t.panels,d)||(d=void 0));const h=t.mutableState.layouts[c]??d??PO(u),g=mu({layout:h,panelConstraints:u}),m=t.element.ownerDocument;ac.set(m,(ac.get(m)??0)+1);const y=new Map;return Tz(t).forEach(b=>{b.separator&&y.set(b.separator,b.panels)}),ul(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",MO)}),ac.get(m)===1&&(m.addEventListener("contextmenu",wO,!0),m.addEventListener("dblclick",EO,!0),m.addEventListener("pointerdown",AO,!0),m.addEventListener("pointerleave",OO),m.addEventListener("pointermove",kO),m.addEventListener("pointerout",IO),m.addEventListener("pointerup",DO,!0)),function(){e=!1,ac.set(m,Math.max(0,(ac.get(m)??0)-1)),zq(t),t.separators.forEach(b=>{b.element.removeEventListener("keydown",MO)}),ac.get(m)||(m.removeEventListener("contextmenu",wO,!0),m.removeEventListener("dblclick",EO,!0),m.removeEventListener("pointerdown",AO,!0),m.removeEventListener("pointerleave",OO),m.removeEventListener("pointermove",kO),m.removeEventListener("pointerout",IO),m.removeEventListener("pointerup",DO,!0)),s.disconnect()}}function Yq(){const[t,e]=R.useState({}),n=R.useCallback(()=>e({}),[]);return[t,n]}function m1(t){const e=R.useId();return`${t??e}`}const Tu=typeof window<"u"?R.useLayoutEffect:R.useEffect;function pd(t){const e=R.useRef(t);return Tu(()=>{e.current=t},[t]),R.useCallback((...n)=>e.current?.(...n),[e])}function y1(...t){return pd(e=>{t.forEach(n=>{if(n)switch(typeof n){case"function":{n(e);break}case"object":{n.current=e;break}}})})}function v1(t){const e=R.useRef({...t});return Tu(()=>{for(const n in t)e.current[n]=t[n]},[t]),e.current}const Bz=R.createContext(null);function Xq(t,e){const n=R.useRef({getLayout:()=>({}),setLayout:Dq});R.useImperativeHandle(e,()=>n.current,[]),Tu(()=>{Object.assign(n.current,Nz({groupId:t}))})}function jz({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=>{gu(b.current.onLayoutChange,N)||(b.current.onLayoutChange=N,c?.(N))}),S=pd((N,B)=>{gu(b.current.onLayoutChanged,N)||(b.current.onLayoutChanged=N,d?.(N,{isUserInteraction:B}))}),C=m1(u),T=R.useRef(null),[E,M]=Yq(),k=R.useRef({lastExpandedPanelSizes:{},layouts:{},panels:[],resizeTargetMinimumSize:g,separators:[]}),D=y1(T,s);Xq(C,a);const O=pd((N,B)=>{const H=pu(),F=SO(N),G=aa(N);if(G){let j=!1;return H.state==="active"&&(j=H.hitRegions.some(q=>q.group===F)),{flexGrow:G.layout[B]??1,pointerEvents:j?"none":void 0}}if(n?.[B])return{flexGrow:n?.[B]}}),I=v1({defaultLayout:n,disableCursor:r}),L=R.useMemo(()=>({get disableCursor(){return!!I.disableCursor},getPanelStyles:O,id:C,orientation:h,registerPanel:N=>{const B=k.current;return B.panels=eS(h,[...B.panels,N]),M(),()=>{B.panels=B.panels.filter(H=>H!==N),M()}},registerSeparator:N=>{const B=k.current;return B.separators=eS(h,[...B.separators,N]),M(),()=>{B.separators=B.separators.filter(H=>H!==N),M()}},updatePanelProps:(N,{disabled:B})=>{const H=k.current.panels.find(j=>j.id===N);H&&(H.panelConstraints.disabled=B);const F=SO(C),G=aa(C);F&&G&&ul(F,{...G,derivedPanelConstraints:Jx(F)})},updateSeparatorProps:(N,{disabled:B,disableDoubleClick:H})=>{const F=k.current.separators.find(G=>G.id===N);F&&(F.disabled=B,F.disableDoubleClick=H)}}),[O,C,M,h,I]),_=R.useRef(null);return Tu(()=>{const N=T.current;if(N===null)return;const B=k.current;let H;if(I.defaultLayout!==void 0&&Object.keys(I.defaultLayout).length===B.panels.length){H={};for(const Z of B.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:B.panels,resizeTargetMinimumSize:B.resizeTargetMinimumSize,separators:B.separators};_.current=F;const G=Kq(F),{defaultLayoutDeferred:j,derivedPanelConstraints:q,layout:$}=aa(F.id,!0);!j&&q.length>0&&(x($),S($,!1));const X=p1(C,Z=>{const{defaultLayoutDeferred:z,derivedPanelConstraints:U,layout:W}=Z.next;if(z||U.length===0)return;const K=F.panels.map(({id:ee})=>ee).join(",");F.mutableState.layouts[K]=W,U.forEach(ee=>{if(ee.collapsible){const{layout:ae}=Z.prev??{};if(ae){const Y=Yr(ee.collapsedSize,W[ee.panelId]),se=Yr(ee.collapsedSize,ae[ee.panelId]);Y&&!se&&(F.mutableState.expandedPanelSizes[ee.panelId]=ae[ee.panelId])}}});const ie=pu().state!=="active";x(W),ie&&S(W,Z.isUserInteraction)});return()=>{_.current=null,G(),X()}},[i,C,S,x,h,E,I]),R.useEffect(()=>{const N=_.current;N&&(N.mutableState.defaultLayout=n,N.mutableState.disableCursor=!!r)}),A.jsx(Bz.Provider,{value:L,children:A.jsx("div",{...y,className:e,"data-group":!0,"data-testid":C,id:C,ref:D,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})})}jz.displayName="Group";function b1(){const t=R.useContext(Bz);return wn(t,"Group Context not found; did you render a Panel or Separator outside of a Group?"),t}function Qq(t,e){const{id:n}=b1(),r=R.useRef({collapse:hb,expand:hb,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:hb});R.useImperativeHandle(e,()=>r.current,[]),Tu(()=>{Object.assign(r.current,zz({groupId:n,panelId:t}))})}function _z({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,S=m1(c),C=v1({disabled:s}),T=R.useRef(null),E=y1(T,a),{getPanelStyles:M,id:k,orientation:D,registerPanel:O,updatePanelProps:I}=b1(),L=g!==null,_=pd((F,G,j)=>{g?.(F,c,j)});Tu(()=>{const F=T.current;if(F!==null){const G={element:F,id:S,idIsStable:x,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:L?_:void 0,panelConstraints:{groupResizeBehavior:u,collapsedSize:n,collapsible:r,defaultSize:i,disabled:C.disabled,maxSize:d,minSize:h}};return O(G)}},[u,n,r,i,L,S,x,d,h,_,O,C]),R.useEffect(()=>{I(S,{disabled:s})},[s,S,I]),Qq(S,m);const N=()=>{const F=M(k,S);if(F)return JSON.stringify(F)},B=R.useSyncExternalStore(F=>p1(k,F),N,N);let H;return B?H=JSON.parse(B):i!==void 0?H={flexGrow:void 0,flexShrink:void 0,flexBasis:i}:H={flexGrow:1},A.jsx("div",{...b,"data-disabled":s||void 0,"data-panel":!0,"data-testid":S,id:S,ref:E,style:{...Zq,display:"flex",flexBasis:0,flexShrink:1,overflow:"visible",...H},children:A.jsx("div",{className:e,style:{maxHeight:"100%",maxWidth:"100%",flexGrow:1,overflow:"auto",...y,touchAction:D==="horizontal"?"pan-y":"pan-x"},children:t})})}_z.displayName="Panel";const Zq={minHeight:0,maxHeight:"100%",height:"auto",minWidth:0,maxWidth:"100%",width:"auto",border:"none",borderWidth:0,padding:0,margin:0};function Jq({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=mu({layout:zd({delta:d-a,initialLayout:t,panelConstraints:e,pivotIndices:h,prevLayout:t}),panelConstraints:e})[n],i=mu({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 Hz({children:t,className:e,disabled:n,disableDoubleClick:r,elementRef:i,id:s,style:a,...u}){const c=m1(s),d=v1({disabled:n,disableDoubleClick:r}),[h,g]=R.useState({}),[m,y]=R.useState("inactive"),[b,x]=R.useState(!1),S=R.useRef(null),C=y1(S,i),{disableCursor:T,id:E,orientation:M,registerSeparator:k,updateSeparatorProps:D}=b1(),O=M==="horizontal"?"vertical":"horizontal";Tu(()=>{const _=S.current;if(_!==null){const N={disabled:d.disabled,disableDoubleClick:d.disableDoubleClick,element:_,id:c},B=k(N),H=kq(G=>{y(G.next.state!=="inactive"&&G.next.hitRegions.some(j=>j.separator===N)?G.next.state:"inactive")}),F=p1(E,G=>{const{derivedPanelConstraints:j,layout:q,separatorToPanels:$}=G.next,X=$.get(N);if(X){const Z=X[0],z=X.indexOf(Z);g(Jq({layout:q,panelConstraints:j,panelId:Z.id,panelIndex:z}))}});return()=>{H(),F(),B()}}},[E,c,k,d]),R.useEffect(()=>{D(c,{disabled:n,disableDoubleClick:r})},[n,r,c,D]);let I;n&&!T&&(I="not-allowed");let L;return n?L="disabled":m==="active"?L="active":b?L="focus":L=m,A.jsx("div",{...u,"aria-controls":h.valueControls,"aria-disabled":n||void 0,"aria-orientation":O,"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})}Hz.displayName="Separator";const Vz=R.createContext(void 0);function gl(t){const e=R.useContext(Vz);if(!t&&e===void 0)throw new Error(Jt(27));return e}const e9=R.forwardRef(function(e,n){const{render:r,className:i,style:s,forceRender:a=!1,...u}=e,c=gl(),d=c.useState("open"),h=c.useState("nested"),g=c.useState("mounted"),m=c.useState("transitionStatus");return rt("div",e,{state:{open:d,transitionStatus:m},ref:[c.context.backdropRef,n],stateAttributesMapping:s1,props:[{role:"presentation",hidden:!g,style:{userSelect:"none",WebkitUserSelect:"none"}},u],enabled:a||!h})}),Fz=R.forwardRef(function(e,n){const{render:r,className:i,style:s,disabled:a=!1,nativeButton:u=!0,...c}=e,d=gl(),h=d.useState("open"),{getButtonProps:g,buttonRef:m}=Vi({disabled:a,native:u}),y={disabled:a};function b(x){h&&d.setOpen(!1,Ue(eP,x.nativeEvent))}return rt("button",e,{state:y,ref:[n,m],props:[{onClick:b},c,g]})}),t9=R.forwardRef(function(e,n){const{render:r,className:i,style:s,id:a,...u}=e,c=gl(),d=Hr(a);return c.useSyncedValueWithCleanup("descriptionElementId",d),rt("p",e,{ref:n,props:[{id:d},u]})}),$z=R.createContext(void 0);function Uz(){const t=R.useContext($z);if(t===void 0)throw new Error(Jt(26));return t}const qz={...lh,...$o,nestedDialogOpen(t){return t?{"data-nested-dialog-open":""}:null}},n9=R.forwardRef(function(e,n){const{render:r,className:i,style:s,finalFocus:a,initialFocus:u,...c}=e,d=gl(),h=d.useState("descriptionElementId"),g=d.useState("disablePointerDismissal"),m=d.useState("floatingRootContext"),y=d.useState("popupProps"),b=d.useState("modal"),x=d.useState("mounted"),S=d.useState("nested"),C=d.useState("nestedOpenDialogCount"),T=d.useState("open"),E=d.useState("openMethod"),M=d.useState("titleElementId"),k=d.useState("transitionStatus"),D=d.useState("role"),O=m.useState("floatingId");Uz(),ci({open:T,ref:d.context.popupRef,onComplete(){T&&d.context.onOpenChangeComplete?.(!0)}});const I=u===void 0?_U(d.context.popupRef):u,L=C>0,_=d.useStateSetter("popupElement"),B=rt("div",e,{state:{open:T,nested:S,transitionStatus:k,nestedDialogOpen:L},props:[y,{id:O,"aria-labelledby":M,"aria-describedby":h,role:D,...oh,hidden:!x,onKeyDown(H){ey.has(H.key)&&H.stopPropagation()},style:{"--nested-dialogs":C}},c],ref:[n,d.context.popupRef,_],stateAttributesMapping:qz});return A.jsx(qm,{context:m,openInteractionType:E,disabled:!x,closeOnFocusOut:!g,initialFocus:I,returnFocus:a,modal:b!==!1,restoreFocus:"popup",children:B})}),r9=R.forwardRef(function(e,n){const{keepMounted:r=!1,...i}=e,s=gl(),a=s.useState("mounted"),u=s.useState("modal"),c=s.useState("open");return a||r?A.jsx($z.Provider,{value:r,children:A.jsxs(Um,{ref:n,...i,children:[a&&u===!0&&A.jsx(ty,{ref:s.context.internalBackdropRef,inert:Xc(!c)}),e.children]})}):null});function i9({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 S=t.context.internalBackdropRef.current,C=t.context.backdropRef.current;return S||C?S===x||C===x||Ge(x,a)&&!x?.hasAttribute("data-base-ui-portal"):!0}return!0}return!1},escapeKey:m});return gz(r&&s===!0,a),t.useContextCallback("onNestedDialogOpen",(b,x)=>{d(b),g(x)}),Oe(()=>(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]),Zw(t,{activeTriggerProps:y.reference,inactiveTriggerProps:y.trigger,popupProps:y.floating,nestedOpenDialogCount:c,nestedOpenDrawerCount:h}),null}const o9={...t1,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 s9 extends Kc{constructor(e,n,r){const i=new sh,s=l9(e,i,n,r);super(s,a9(i),o9)}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};Kw(r,e,n.trigger),this.update(r)}}function l9(t,e,n,r=!1){const i={...Jw(),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=FP(e,n,r),i}function a9(t){return{popupRef:R.createRef(),backdropRef:R.createRef(),internalBackdropRef:R.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:t,onOpenChange:void 0,onOpenChangeComplete:void 0}}function u9(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,S="dialog",C=gl(!0),T=C!=null,E={modal:b,disablePointerDismissal:x,nested:T,role:S},M=HP((_,N)=>new s9({open:i,openProp:r,activeTriggerId:m,triggerIdProp:g,...E},_,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"),D=M.useState("mounted"),O=M.useState("payload");FU(M,k),Xw(M);const{forceUnmount:I}=Qw(k,M);R.useImperativeHandle(d,()=>({unmount:I,close:()=>M.setOpen(!1,Ue(zw))}),[I,M]);const L=k||D;return A.jsxs(Vz.Provider,{value:M,children:[h&&A.jsx(Ww,{handle:h,store:M}),L&&A.jsx(i9,{store:M,parentContext:C?.context,isDrawer:y}),typeof n=="function"?n({payload:O}):n]})}function c9(t){return u9("dialog",t)}const f9=R.forwardRef(function(e,n){const{render:r,className:i,style:s,children:a,...u}=e,c=Uz(),d=gl(),h=d.useState("open"),g=d.useState("nested"),m=d.useState("transitionStatus"),y=d.useState("nestedOpenDialogCount"),b=d.useState("mounted"),x=d.useStateSetter("viewportElement"),S=y>0;return rt("div",e,{enabled:c||b,state:{open:h,nested:g,transitionStatus:m,nestedDialogOpen:S},ref:[n,x],stateAttributesMapping:qz,props:[{role:"presentation",hidden:!b,style:{pointerEvents:h?void 0:"none"},children:a},u]})}),d9=R.forwardRef(function(e,n){const{render:r,className:i,style:s,id:a,...u}=e,c=gl(),d=Hr(a);return c.useSyncedValueWithCleanup("titleElementId",d),rt("h2",e,{ref:n,props:[{id:d},u]})}),h9=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=gl(!0),b=n1(h)??m;if(!b)throw new Error(Jt(79));const x=Hr(c),S=b.useState("floatingRootContext"),C=b.useState("isOpenedByTrigger",x),T=b.useState("triggerPopupId",x),E=R.useRef(null),{registerTrigger:M,isMountedByThisTrigger:k}=Yw(x,E,b,{payload:d}),{getButtonProps:D,buttonRef:O}=Vi({disabled:a,native:u}),I=Gm(S),L=yz(()=>b.select("open"),B=>{b.set("openMethod",B)}),_={disabled:a,open:C},N=b.useState("triggerProps",k);return rt("button",e,{state:_,ref:[O,n,M,E],props:[I.reference,N,L,{[bP]:"",id:x,"aria-haspopup":"dialog","aria-expanded":C,"aria-controls":T},g,D],stateAttributesMapping:Xm})}),Gz=R.createContext(void 0);function ry(){const t=R.useContext(Gz);if(!t)throw new Error(Jt(73));return t}let zO=0;function p9(t){return zO+=1,`${t}-${Math.random().toString(36).slice(2,6)}-${zO}`}function pb(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 gb(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 mb(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 g9 extends Kc{timers=new Map;areTimersPaused=!1;constructor(e){super({...e,toastMetadata:gb(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=mb(this.state.toasts,n);i.toasts=s,i.toastMetadata=gb(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||p9("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(mb(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(S=>S.id===e?c:S));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=mb(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=pb(n.loading),i=this.addToast({...r,type:"loading"}),s=e.then(a=>{const u=pb(n.success,a);return this.updateToast(i,{...u,type:"success",timeout:u.timeout}),a}).catch(a=>{const u=pb(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??=_i.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)?_i.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:gb(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)||!Jg(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 m9=function(e){const{children:n,timeout:r=5e3,limit:i=3,toastManager:s}=e,a=Qn(()=>new g9({timeout:r,limit:i,viewport:null,toasts:[],hovering:!1,focused:!1,isWindowFocused:!0,prevFocusElement:null})).current;return Nm(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]),A.jsxs(Gz.Provider,{value:a,children:[A.jsx(y9,{store:a,timeout:r,limit:i}),n]})};function y9(t){const{store:e,timeout:n,limit:r}=t;return Oe(()=>{e.syncProviderProps(n,r)},[e,n,r]),null}const v9=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"),S=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 U(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)||!Jg(ae))&&c.resumeTimers(),d.start(0,()=>c.set("isWindowFocused",!0))}return zo(yt(Z,"keydown",U),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 D(X){X.key==="Tab"&&X.shiftKey&&mn(X.nativeEvent)===c.state.viewport&&(X.preventDefault(),c.restoreFocusToPrevElement())}function O(){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(O,[E,c]);function I(){c.pauseTimers(),c.set("hovering",!0),g.current=!1}function L(){c.state.isWindowFocused&&c.resumeTimers()}function _(){g.current=!0,O()}function N(X){X.pointerType==="touch"&&(m.current=!0)}function B(X){X.pointerType==="touch"&&(m.current=!1,O())}function H(){if(h.current){h.current=!1;return}x||Jg(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:_,onFocus:H,onBlur:F,onKeyDown:D,onClick:H,onPointerDown:N,onPointerUp:B,onPointerCancel:B,style:{"--toast-frontmost-height":T?`${T}px`:void 0}},j={expanded:S},q=!y&&C&&A.jsx(du,{onFocus:k}),$=rt("div",e,{ref:[n,c.setViewport],state:j,props:[G,u,{children:A.jsxs(R.Fragment,{children:[q,a,q]})}]});return A.jsxs(R.Fragment,{children:[q,$,!x&&M.length>0&&A.jsx("div",{style:Fm,children:M.map(X=>A.jsxs("div",{role:"alert","aria-atomic":!0,children:[A.jsx("div",{children:X.title}),A.jsx("div",{children:X.description})]},X.id))})]})}),Wz=R.createContext(void 0);function x1(){const t=R.useContext(Wz);if(!t)throw new Error(Jt(66));return t}function b9(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 yb(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 x9(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 S9={...$o,swipeDirection(t){return t?{"data-swipe-direction":t}:null}},NO=40,w9=10,LO=.5,C9=1,R9=`${P$},${z$}`,T9=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,S]=R.useState(!1),[C,T]=R.useState(!1),[E,M]=R.useState({x:0,y:0}),[k,D]=R.useState({x:0,y:0,scale:1}),[O,I]=R.useState(),[L,_]=R.useState(),[N,B]=R.useState(null),H=R.useRef(null),F=R.useRef(void 0),G=R.useRef({x:0,y:0}),j=R.useRef({x:0,y:0,scale:1}),q=R.useRef(void 0),$=R.useRef(0),X=R.useRef(!1),Z=R.useRef({x:0,y:0}),z=R.useRef(!1),U=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");ci({open:r.transitionStatus!=="ending",ref:H,onComplete(){r.transitionStatus==="ending"&&m.removeToast(r.id)}});const ve=Ae((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?go.flushSync(de):de()});Oe(()=>{const ne=F.current;r.transitionStatus!=="starting"&&ne===r.id||(ne!==void 0&&(b(void 0),D({x:0,y:0,scale:1}),ye({x:0,y:0})),F.current=r.id,ve())},[ve,r.id,r.transitionStatus]);function ye(ne){U.current=ne,M(ne)}Oe(()=>()=>{K.current?.abort()},[]);function he(ne,J){const le=me=>me>0?me**LO:-(Math.abs(me)**LO),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=Ae(ne=>{if(ne.pointerId!==W.current)return;W.current=null,K.current?.abort(),K.current=null,S(!1),T(!1),B(null);const J=j.current;if(ne.type==="pointercancel"||X.current){ye({x:J.x,y:J.y}),b(void 0);return}const le=U.current,we=le.x-J.x,de=le.y-J.y;let me;for(const Be of h)if(yb(Be,we,de)>NO){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"],${R9}`)))return;X.current=!1,q.current=void 0,$.current=0,W.current=ne.pointerId,G.current={x:ne.clientX,y:ne.clientY},Z.current=G.current;const we=ne.currentTarget,de=x9(we);j.current=de,D(de),ye({x:de.x,y:de.y}),m.set("hovering",!0),S(!0),T(!1),B(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 De(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)>=C9){T(!0);const Vt=h.includes("left")||h.includes("right"),Ut=h.includes("up")||h.includes("down");if(Vt&&Ut){const lt=Math.abs(me),gt=Math.abs(Be);xt=lt>gt?"horizontal":"vertical",B(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,$.current=yb(st,me,Be),b(st));else{const tn=q.current,Vt=yb(tn,wt,Ke);Vt>NO?(X.current=!1,b(tn)):!(h.includes("left")&&h.includes("right"))&&!(h.includes("up")&&h.includes("down"))&&$.current-Vt>=w9&&(X.current=!0)}const Ct=he(me,Be);let Wt=j.current.x,at=j.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 Pe(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":O,"aria-describedby":L,"aria-hidden":_e&&!Y?!0:void 0,onPointerDown:g?Te:void 0,onPointerMove:g?De:void 0,onPointerUp:g?pe:void 0,onPointerCancel:g?pe:void 0,onKeyDown:Pe,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:_,recalculateHeight:ve,visibleIndex:ee,expanded:se}),[r,I,_,ve,ee,se]),xe={transitionStatus:r.transitionStatus,expanded:se,limited:r.limited||!1,type:r.type,swiping:x,swipeDirection:y},ze=rt("div",e,{ref:[n,H],state:xe,stateAttributesMapping:S9,props:[Me,c]});return A.jsx(Wz.Provider,{value:oe,children:ze})}),E9=R.forwardRef(function(e,n){const{render:r,className:i,style:s,...a}=e,{visibleIndex:u,expanded:c,recalculateHeight:d}=x1(),h=R.useRef(null);Oe(()=>{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 rt("div",e,{ref:[n,h],state:{expanded:c,behind:g},props:a})});function Kz(t){return t==null||typeof t=="boolean"||t===""?!1:Array.isArray(t)?t.some(Kz):!0}function M9(t){return R.isValidElement(t)&&Kz(t.props.children)}function Yz(t,e,n){const{toast:r,setTitleId:i,setDescriptionId:s}=x1(),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 Xz(t,e,n){const r=M9(t);return Oe(()=>{if(r)return n(e),()=>{n(i=>i===e?void 0:i)}},[r,e,n]),r?t:null}const A9=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}=Yz(a,u,"description"),b=rt("p",e,{ref:n,state:{type:g},props:{...c,id:d,children:h}});return Xz(b,d,m)}),O9=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}=Yz(a,u,"title"),b=rt("h2",e,{ref:n,state:{type:g},props:{...c,id:d,children:h}});return Xz(b,d,m)}),k9=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}=x1(),[m,y]=R.useState(!1),{getButtonProps:b,buttonRef:x}=Vi({disabled:a,native:u}),S={type:h.type};return rt("button",e,{ref:[n,x],state:S,props:[{"aria-hidden":!g&&!m,onClick(){d.closeToast(h.id)},onFocus(){y(!0)},onBlur(){y(!1)}},c,b]})}),I9=R.forwardRef(function(e,n){return A.jsx(ez,{ref:n,...e})});function D9(){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 Qz(t){const e=R.useRef(!0);e.current&&(e.current=!1,t())}const Zz=R.createContext(null);function ml(){const t=R.useContext(Zz);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},Jz={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},P9={disabled:!1,...Jz},Eu={valid(t){return t===null?null:t?{"data-valid":""}:{"data-invalid":""}}},eN={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:P9,registerFieldControl:On,validation:{getValidationProps:(t,e=gn)=>e,inputRef:{current:null},registeredInputs:new Map,registerInput:On,getInputControl:()=>null,commit:async()=>{},change:On}},S1=R.createContext(eN);function Uo(t=!0){const e=R.useContext(S1);if(e.setValidityData===On&&!t)throw new Error(Jt(28));return e}function w1(t,e,n,r,i=!0,s){const{registerFieldControl:a}=Uo(),u=Qn(()=>Symbol());Oe(()=>{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]),Oe(()=>{const c=u.current;return()=>{a(c,void 0)}},[a,u])}const tN=R.createContext({controlId:void 0,registerControlId:On,labelId:void 0,setLabelId:On,messageIds:[],setMessageIds:On,getDescriptionProps:t=>t});function Ts(){return R.useContext(tN)}function iy(t={}){const{id:e,implicit:n=!1,controlRef:r}=t,{controlId:i,registerControlId:s}=Ts(),a=Hr(e),u=n?i:void 0,c=Qn(()=>Symbol()),d=R.useRef(!1),h=R.useRef(e!=null),g=Ae(()=>{!d.current||s===On||(d.current=!1,s(c.current,void 0))});return Oe(()=>{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 nN=(t,e)=>Object.is(t,e);function mo(t,e,n){return t==null||e==null?Object.is(t,e):n(t,e)}function z9(t,e,n){return!t||t.length===0?!1:t.some(r=>r===void 0?!1:mo(e,r,n))}function xc(t,e,n){return!t||t.length===0?-1:t.findIndex(r=>r===void 0?!1:mo(r,e,n))}function vb(t,e,n,r){const i=r&&Array.isArray(e)?e[e.length-1]:e,s=xc(t,i,n);return s===-1?null:s}function rN(t,e,n){return t.filter(r=>!mo(e,r,n))}function tS(t){if(t==null)return"";if(typeof t=="string")return t;try{return JSON.stringify(t)}catch{return String(t)}}function C1(t){return t!=null&&t.length>0&&typeof t[0]=="object"&&t[0]!=null&&"items"in t[0]}function N9(t){if(!Array.isArray(t))return t!=null&&"null"in t;const e=t;if(C1(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 ro(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 tS(t)}function ko(t,e){return e&&t!=null?e(t)??"":t&&typeof t=="object"&&"value"in t&&"label"in t?tS(t.value):tS(t)}function iN(t,e,n){function r(){return ro(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=C1(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 L9(t,e,n){return t.reduce((r,i,s)=>(s>0&&r.push(", "),r.push(A.jsx(R.Fragment,{children:iN(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?N9(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=>mo(e,i,n)):mo(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},B9=R.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:On,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});function Mu(){return R.useContext(B9)}function oN(t,e,n=(r,i)=>r===i){return t.length===e.length&&t.every((r,i)=>n(r,e[i]))}const Zs=1;function sN(t,e){return Math.max(0,t-e)}function j9(t,e){if(e<=0)return 0;const n=sd(t,0,e),r=n,i=e-n,s=r<=Zs,a=i<=Zs;return s&&a?r<=i?0:e:s?0:a?e:n}function _9(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:S,onOpenChangeComplete:C,items:T,multiple:E=!1,itemToStringLabel:M,itemToStringValue:k,isItemEqualToValue:D=nN,highlightItemOnHover:O=!0,children:I}=t,{clearErrors:L}=Mu(),{setDirty:_,setTouched:N,setFocused:B,validityData:H,setFilled:F,name:G,disabled:j,validation:q,validationMode:$}=Uo(),X=iy({id:e}),Z=j||g,z=G??c,[U,W]=Ss({controlled:n,default:E?r??li:r,name:"Select",state:"value"}),[K,ie]=Ss({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),De=R.useRef(null),Pe=R.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0}),Ee=R.useRef(!1),{mounted:_e,setMounted:Me,transitionStatus:oe}=pl(K),{openMethod:xe,triggerProps:ze}=c1(K),ne=Qn(()=>new Kc({id:X,labelId:void 0,modal:b,multiple:E,itemToStringLabel:M,itemToStringValue:k,isItemEqualToValue:D,value:U,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=M2(xe),Be=xe??me,Ke=R.useMemo(()=>E?"":ko(U,k),[E,U,k]),wt=R.useMemo(()=>E&&Array.isArray(U)?U.map(it=>ko(it,k)):ko(U,k),[E,U,k]),xt=Un(we),st=Ae(()=>wt);w1(xt,X,U,st,!Z,c);const Ct=R.useRef(U),Wt=E?Array.isArray(U)&&U.length>0:U!=null&&Ke!=="";Oe(()=>{F(Wt)},[Wt,F]),Oe(function(){let qt=U,qn=!1;if(E){const ln=Array.isArray(U)?U:[];qn=ln.length===0,qt=ln[ln.length-1]}const jn=qn?-1:xc(he.current,qt,D),Tr=jn===-1?null:jn;Tr===null&&(De.current=null),!K&&ne.set("selectedIndex",Tr)},[E,K,U,D,ne]);function at(it){const qt=H.initialValue;return Array.isArray(it)&&Array.isArray(qt)?!oN(it,qt,(qn,jn)=>mo(qn,jn,D)):it!==qt}fc(U,()=>{L(z),_(at(U)),q.change(U)});const Tn=Ae((it,qt)=>{u?.(it,qt),!qt.isCanceled&&(ie(it),!it&&(qt.reason===ca||qt.reason===nh)&&(N(!0),B(!1),$==="onBlur"&&q.commit(U)))}),Kt=Ae(()=>{Me(!1),ne.update({activeIndex:null,openMethod:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1}),C?.(!1)});ci({enabled:!x,open:K,ref:Y,onComplete(){K||Kt()}}),R.useImperativeHandle(x,()=>({unmount:Kt}),[Kt]);const tn=Ae((it,qt)=>{i?.(it,qt),!qt.isCanceled&&W(it)}),Vt=Ae(it=>{const qt=sN(it.scrollHeight,it.clientHeight),qn=j9(it.scrollTop,qt),jn=qn>0,Tr=qn<qt;ne.set("scrollUpArrowVisible",jn),ne.set("scrollDownArrowVisible",Tr)}),Ut=UP({open:K,onOpenChange:Tn,elements:{reference:we,floating:de}}),lt=Gm(Ut,{enabled:!m&&!Z,event:"mousedown"}),gt=ih(Ut),nt=o1(Ut,{enabled:!m&&!Z,listRef:ee,activeIndex:J,selectedIndex:le,disabledIndices:li,onNavigate(it){it===null&&!K||ne.set("activeIndex",it)},focusItemOnHover:O}),nn=YP(Ut,{enabled:!m&&!Z&&(K||!E),listRef:ae,activeIndex:J,selectedIndex:le,disabledIndices:it=>wz(ee.current[it]),onMatch(it){K?ne.set("activeIndex",it):tn(he.current[it],Ue(gr))},onTyping(it){pe.current=it}}),Vn=R.useMemo(()=>Jr(nn.reference,nt.reference,gt.reference,lt.reference,ze),[lt.reference,nn.reference,nt.reference,gt.reference,ze]),Fn=R.useMemo(()=>Jr(oh,nn.floating,nt.floating,gt.floating),[nn.floating,nt.floating,gt.floating]),rn=nt.item??gn;Qz(()=>{ne.update({popupProps:Fn,triggerProps:Vn})}),ne.useSyncedValues({id:X,modal:b,multiple:E,value:U,open:K,mounted:_e,transitionStatus:oe,popupProps:Fn,triggerProps:Vn,items:T,itemToStringLabel:M,itemToStringValue:k,isItemEqualToValue:D,openMethod:Be});const kn=R.useMemo(()=>({store:ne,floatingContext:Ut,required:y,disabled:Z,readOnly:m,multiple:E,highlightItemOnHover:O,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:Pe,firstItemTextRef:Te,selectedItemTextRef:De,validation:q,onOpenChangeComplete:C,alignItemWithTriggerActiveRef:Ee,initialValueRef:Ct}),[ne,Ut,y,Z,m,E,O,tn,Tn,rn,q,C,Vt]),Pt=Cs(S,q.inputRef),Vr=E?void 0:z,ar=R.useMemo(()=>!E||!Array.isArray(U)||!z?null:U.map(it=>{const qt=ko(it,k);return A.jsx("input",{type:"hidden",form:d,name:z,value:qt,disabled:Z},qt)}),[E,U,d,z,k,Z]);return A.jsxs(Zz.Provider,{value:kn,children:[I,A.jsx("input",{...q.getValidationProps(Z,{onFocus(){ne.state.triggerElement?.focus({focusVisible:!0})},onChange(it){if(it.nativeEvent.defaultPrevented||Z||m)return;const qt=it.currentTarget.value,qn=Ue(gr,it.nativeEvent);function jn(){if(E)return;const Tr=qt.toLowerCase();let ln=he.current.findIndex(Nt=>ko(Nt,k).toLowerCase()===Tr||ro(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&&Vr==null?`${X}-hidden-input`:void 0,form:d,name:Vr,autoComplete:h,value:Ke,disabled:Z,required:y&&!(E&&Wt),readOnly:m,ref:Pt,style:z?Lw:Fm,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),ar]})}function H9(t,e){const n=Hr(t);return Oe(()=>(e(n),()=>{e(r=>r===n?void 0:r)}),[n,e]),n}function V9(t={}){const{id:e,fallbackControlId:n,native:r=!1,setLabelId:i,focusControl:s}=t,{controlId:a,setLabelId:u}=Ts(),c=Ae(y=>{u(y),i?.(y)}),d=H9(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)&&F9(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 F9(t){t.focus({focusVisible:!0})}function $9(t,e){return t??e}const U9=400,q9={...sm,...Eu,popupSide:t=>t?{"data-popup-side":t}:null,value:()=>null},G9=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}=Uo(),{labelId:x}=Ts(),{store:S,setOpen:C,selectionRef:T,validation:E,readOnly:M,required:k,alignItemWithTriggerActiveRef:D,disabled:O}=ml(),I=b||O||a,L=Se(S,dt.open),_=Se(S,dt.mounted),N=Se(S,dt.value),B=Se(S,dt.triggerProps),H=Se(S,dt.positionerElement),F=Se(S,dt.listElement),G=Se(S,dt.popupSide),j=Se(S,dt.id),q=Se(S,dt.labelId),$=Se(S,dt.hasSelectedValue),X=_&&H?G:null,Z=s??j,z=$9(x,q);iy({id:Z});const U=Un(H),W=R.useRef(null),{getButtonProps:K,buttonRef:ie}=Vi({disabled:I,native:u}),ee=S.useStateSetter("triggerElement"),ae=lr(),Y=lr(),se=lr();R.useEffect(()=>{if(L)return se.start(U9,()=>{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=Jr(B,{id:Z,role:"combobox","aria-expanded":L,"aria-haspopup":"listbox","aria-controls":L?F?.id??em(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&&D.current&&C(!1,Ue(gr,pe.nativeEvent)),ae.start(0,()=>{S.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 De(Pe){if(!W.current)return;const Ee=Pe.target;Ge(W.current,Ee)||Ge(U.current,Ee)||vz(Pe,W.current)||C(!1,Ue(nP,Pe))}Y.start(0,()=>{Te.addEventListener("mouseup",De,{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:!$};return rt("button",e,{ref:[n,W,ie,ee],state:he,stateAttributesMapping:q9,props:ye})}),W9={value:()=>null},K9=R.forwardRef(function(e,n){const{className:r,render:i,children:s,placeholder:a,style:u,...c}=e,{store:d,valueRef:h}=ml(),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,S=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&&!S?T=a:Array.isArray(g)?T=L9(g,m,y):T=iN(g,m,y),rt("span",e,{state:C,ref:[n,h],props:[{children:T},c],stateAttributesMapping:W9})}),Y9=R.forwardRef(function(e,n){const{render:r,className:i,style:s,...a}=e,{store:u}=ml(),d={open:Se(u,dt.open)};return rt("span",e,{state:d,ref:n,props:[{"aria-hidden":!0,children:"▼"},a],stateAttributesMapping:Xm})}),X9=R.forwardRef(function(e,n){const{store:r}=ml(),i=Se(r,dt.mounted),s=Se(r,dt.forceMount);return i||s?A.jsx(Um,{ref:n,...e}):null}),lN=R.createContext(void 0);function aN(){const t=R.useContext(lN);if(!t)throw new Error(Jt(59));return t}function lm(t,e){t&&Object.assign(t.style,e)}const uN={position:"relative",maxHeight:"100%",overflowX:"hidden",overflowY:"auto"},Q9={position:"fixed"},Z9=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:S=!0,collisionAvoidance:C=Fw,style:T,...E}=e,{store:M,listRef:k,labelsRef:D,alignItemWithTriggerActiveRef:O,selectedItemTextRef:I,valuesRef:L,initialValueRef:_,popupRef:N,setValue:B,floatingContext:H}=ml(),F=Se(M,dt.open),G=Se(M,dt.mounted),j=Se(M,dt.modal),q=Se(M,dt.value),$=Se(M,dt.openMethod),X=Se(M,dt.positionerElement),Z=Se(M,dt.triggerElement),z=Se(M,dt.isItemEqualToValue),U=Se(M,dt.transitionStatus),W=R.useRef(null),K=R.useRef(null),[ie,ee]=R.useState(S),ae=G&&ie&&$!=="touch";!G&&ie!==S&&ee(S),R.useImperativeHandle(O,()=>ae),u1((ae||j)&&F,$==="touch",X,Z);const Y=Qm({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?Q9:Y.positionerStyles,ye={open:F,side:se,align:Y.align,anchorHidden:Y.anchorHidden};Oe(()=>{M.set("popupSide",Y.side)},[M,Y.side]);const he=M.useStateSetter("positionerElement"),pe=Zm(e,ye,{styles:ve,transitionStatus:U,props:E,refs:[n,he],hidden:!G,inert:!F}),Te=R.useRef(0),De=Ae(Ee=>{if(L.current.length===0)return;const _e=Te.current;if(Te.current=Ee.size,Ee.size===_e)return;const Me=Ue(gr);if(_e!==0&&!M.state.multiple&&q!==null&&xc(L.current,q,z)===-1){const xe=_.current,ne=xe!=null&&xc(L.current,xe,z)!==-1?xe:null;B(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=>xc(L.current,xe,z)!==-1);oe.length!==q.length&&(B(oe,Me),oe.length===0&&(M.set("selectedIndex",null),I.current=null))}if(F&&ae){M.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});const oe={height:""};lm(X,oe),lm(N.current,oe)}}),Pe=R.useMemo(()=>({...Y,side:se,alignItemWithTriggerActive:ae,setControlledAlignItemWithTrigger:ee,scrollUpArrowRef:W,scrollDownArrowRef:K}),[Y,se,ae,ee]);return A.jsx(ch,{elementsRef:k,labelsRef:D,onMapChange:De,children:A.jsxs(lN.Provider,{value:Pe,children:[G&&j&&A.jsx(ty,{inert:Xc(!F),cutout:Z}),pe]})})}),Zp="base-ui-disable-scrollbar",nS={className:Zp,getElement(t){return A.jsx("style",{nonce:t,href:Zp,precedence:"base-ui:low",children:`.${Zp}{scrollbar-width:none}.${Zp}::-webkit-scrollbar{display:none}`})}},J9=R.createContext(void 0),eG={disableStyleElements:!1};function tG(){return R.useContext(J9)??eG}const nG={...lh,...$o},rG=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:S,scrollHandlerRef:C,listRef:T,highlightItemOnHover:E,floatingContext:M}=ml(),{side:k,align:D,alignItemWithTriggerActive:O,isPositioned:I,setControlledAlignItemWithTrigger:L}=aN(),_=uh(!0)!=null,N=Yc(),{nonce:B,disableStyleElements:H}=tG(),F=Se(c,dt.id),G=Se(c,dt.open),j=Se(c,dt.openMethod),q=Se(c,dt.mounted),$=Se(c,dt.popupProps),X=Se(c,dt.transitionStatus),Z=Se(c,dt.triggerElement),z=Se(c,dt.positionerElement),U=Se(c,dt.listElement),W=R.useRef(!1),K=R.useRef(!1),ie=R.useRef({}),ee=Ic(),ae=Ae(ye=>{if(!z||!d.current||!K.current)return;const he=z.style.top==="0px",pe=z.style.bottom==="0px";if(W.current||!O||!he&&!pe){S(ye);return}const Te=jO(z),De=ld(z.getBoundingClientRect().height,"y",Te),Pe=vt(z),Ee=Rn(z),_e=Ee.getComputedStyle(z),Me=parseFloat(_e.marginTop),oe=parseFloat(_e.marginBottom),xe=BO(Ee.getComputedStyle(d.current)),ze=Math.min(Pe.documentElement.clientHeight-Me-oe,xe),ne=ye.scrollTop,J=Jp(ye);let le=null;const we=Ke=>{z.style.height=`${Ke}px`},de=he?J-ne:ne,me=Math.min(De+de,ze);if(de<=Zs){const Ke=sd(de,0,ze-De);Ke>0&&we(De+Ke),ye.scrollTop=he?J:0,ze-(De+Ke)<=Zs&&(W.current=!0),S(ye);return}if(ze-me>Zs)le=he?1/0:0;else if(pe&&ne<J){const Ke=De+de-ze;le=ne-(de-Ke)}const Be=Math.ceil(me);if(Be!==0&&we(Be),le!=null){const Ke=sd(le,0,Jp(ye));Math.abs(ye.scrollTop-Ke)>Zs&&(ye.scrollTop=Ke)}Be>=ze-Zs&&(W.current=!0),S(ye)});R.useImperativeHandle(C,()=>ae,[ae]),ci({open:G,ref:d,onComplete(){G&&h?.(!0)}});const Y={open:G,transitionStatus:X,side:k,align:D};Oe(()=>{!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]),Oe(()=>{G||O||(K.current=!1,W.current=!1,lm(z,ie.current))},[G,O,z,d]),Oe(()=>{const ye=d.current;if(!G||!Z||!z||!ye||O&&!I||c.state.transitionStatus==="ending")return;if(K.current=!0,ye.style.removeProperty("--transform-origin"),!O){ee.request(()=>S(U||ye));return}const he=iG(ye);try{let pe=b.current;pe?.isConnected||(pe=!dt.hasSelectedValue(c.state)&&y.current?.isConnected?y.current:null);const Te=m.current,De=Rn(z),Pe=De.getComputedStyle(z),Ee=De.getComputedStyle(ye),_e=vt(Z),Me=jO(Z),oe=eg(Z.getBoundingClientRect(),Me),xe=eg(z.getBoundingClientRect(),Me),ze=oe.height,ne=U||ye,J=ne.scrollHeight,le=parseFloat(Ee.borderBottomWidth),we=parseFloat(Pe.marginTop)||10,de=parseFloat(Pe.marginBottom)||10,me=parseFloat(Pe.minHeight)||100,Be=BO(Ee),Ke=5,wt=5,xt=20,st=_e.documentElement.clientHeight-we-de,Ct=_e.documentElement.clientWidth,Wt=st-oe.bottom+ze;let at,Tn=N==="rtl"?oe.right-xe.width:oe.left,Kt=0;if(pe&&Te){const kn=eg(Te.getBoundingClientRect(),Me);at=eg(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 Ut=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=Jp(ne),nn=lt>=nt-Zs;nn&&(Vt=Math.min(st,xe.height)-(lt-nt));const Vn=oe.top<xt||oe.bottom>st-xt||Math.ceil(Vt)+Zs<Math.min(J,me),Fn=(De.visualViewport?.scale??1)!==1&&dl;if(Vn||Fn){lm(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>=Ut?"0":`${kn}px`,z.style.height=`${Vt}px`,ne.scrollTop=Jp(ne)}else z.style.bottom="0",ne.scrollTop=lt;if(at){const kn=xe.top,Pt=xe.height,Vr=at.top+at.height/2,ar=sd(Pt>0?(Vr-kn)/Pt*100:50,0,100);ye.style.setProperty("--transform-origin",`50% ${ar}%`)}(rn===st||Vt>=Be)&&(W.current=!0),S(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,S,O,L,ee,U,T,E,N,I]),R.useEffect(()=>{if(!O||!z||!G)return;const ye=Rn(z);function he(pe){g(!1,Ue(Q6,pe))}return yt(ye,"resize",he)},[g,O,z,G]);const se={...U?{role:"presentation","aria-orientation":void 0}:{role:"listbox","aria-multiselectable":x||void 0,id:`${F}-list`},onKeyDown(ye){_&&ey.has(ye.key)&&ye.stopPropagation()},onScroll(ye){U||ae(ye.currentTarget)},...O&&{style:U?{height:"100%"}:uN},className:!U&&O?nS.className:void 0},ve=rt("div",e,{ref:[n,d],state:Y,stateAttributesMapping:nG,props:[$,se,ah(X),u]});return A.jsxs(R.Fragment,{children:[!H&&nS.getElement(B),A.jsx(qm,{context:M,modal:!1,disabled:!q,openInteractionType:j,returnFocus:a,restoreFocus:!0,children:ve})]})});function BO(t){const e=t.maxHeight;return e.endsWith("px")&&parseFloat(e)||1/0}function Jp(t){return sN(t.scrollHeight,t.clientHeight)}function jO(t){return PP.getScale(t)}function ld(t,e,n){return t/n[e]}function eg(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 _O=[["transform","none"],["scale","1"],["translate","0 0"]];function iG(t){const{style:e}=t,n={};for(const[r,i]of _O)n[r]=e.getPropertyValue(r),e.setProperty(r,i,"important");return()=>{for(const[r]of _O){const i=n[r];i?e.setProperty(r,i):e.removeProperty(r)}}}const oG=R.forwardRef(function(e,n){const{render:r,className:i,style:s,...a}=e,{store:u,scrollHandlerRef:c,multiple:d}=ml(),{alignItemWithTriggerActive:h}=aN(),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(S){c.current?.(S.currentTarget)},...h&&{style:uN},className:g&&m!=="touch"?nS.className:void 0},x=u.useStateSetter("listElement");return rt("div",e,{ref:[n,x],props:[b,a]})}),cN=R.createContext(void 0);function R1(){const t=R.useContext(cN);if(!t)throw new Error(Jt(57));return t}const sG=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:S,selectionRef:C,typingRef:T,valuesRef:E,multiple:M,selectedItemTextRef:k,disabled:D,readOnly:O}=ml(),I=D||c,L=Se(y,dt.isActive,m.index),_=Se(y,dt.open),N=Se(y,dt.isSelected,a),B=Se(y,dt.isSelectedByFocus,m.index),H=Se(y,dt.isItemEqualToValue),F=m.index,G=R.useRef(null);Oe(()=>{const ee=E.current;return ee[F]=a,()=>{delete ee[F]}},[F,a,E]),Oe(()=>{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&&mo(a,ae,H)&&(y.set("selectedIndex",F),g.current&&(k.current=g.current))},[F,M,H,y,a,k]);const j=R.useRef("mouse"),q=R.useRef(!1),{getButtonProps:$,buttonRef:X}=Vi({disabled:I,focusableWhenDisabled:!0,native:d,composite:!0}),Z={disabled:I,selected:N,highlighted:L};function z(ee){if(D||O)return;const ae=y.state.value;if(M){const Y=Array.isArray(ae)?ae:[],se=N?rN(Y,a,H):[...Y,a];S(se,Ue(uu,ee))}else S(a,Ue(uu,ee)),x(!1,Ue(uu,ee))}function U(){C.current.dragY=0}const W={role:"option","aria-selected":N,tabIndex:_&&L?0:-1,onKeyDown(ee){y.set("activeIndex",F),ee.key===" "&&T.current&&ee.preventDefault()},onClick(ee){const ae=j.current!=="touch",Y=ee.nativeEvent.pointerType,se=ae&&Ew(ee.nativeEvent)&&(Y!==void 0||L),ve=ae&&!se&&!q.current;q.current=!1,!(I||ve)&&z(ee.nativeEvent)},onPointerEnter(ee){j.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){j.current=ee.pointerType,q.current=!0,U()},onMouseUp(){if(U(),I||j.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=rt("div",e,{ref:[X,n,m.ref,G],state:Z,props:[b,W,h,$]}),ie=R.useMemo(()=>({selected:N,index:F,textRef:g,selectedByFocus:B}),[N,F,g,B]);return A.jsx(cN.Provider,{value:ie,children:K})})),lG=R.forwardRef(function(e,n){const{selected:r}=R1();return e.keepMounted||r?A.jsx(aG,{...e,ref:n}):null}),aG=R.memo(R.forwardRef((t,e)=>{const{render:n,className:r,style:i,keepMounted:s,...a}=t,{selected:u}=R1(),c=R.useRef(null),{transitionStatus:d,setMounted:h}=pl(u),m=rt("span",t,{ref:[e,c],state:{selected:u,transitionStatus:d},props:[{"aria-hidden":!0,children:"✔️"},a],stateAttributesMapping:$o});return ci({open:u,ref:c,onComplete(){u||h(!1)}}),m})),uG=R.memo(R.forwardRef(function(e,n){const{index:r,textRef:i,selectedByFocus:s}=R1(),{firstItemTextRef:a,selectedItemTextRef:u}=ml(),{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 rt("div",e,{ref:[m,n,i],props:g})}));function cG(t,e,n,r,i,s,a,u,c,d=2){const h=g$(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 la(n.current,h)?void 0:h}const fN=R.createContext(void 0),dN=R.createContext(void 0),hN=R.createContext(void 0),pN=R.createContext(!1),gN=R.createContext("");function vo(){const t=R.useContext(fN);if(!t)throw new Error(Jt(22));return t}function T1(){const t=R.useContext(dN);if(!t)throw new Error(Jt(23));return t}function fh(){const t=R.useContext(hN);if(!t)throw new Error(Jt(24));return t}function mN(){return R.useContext(gN)}function fG(){return R.useContext(pN)}const $e={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=>mo(e,i,n)):mo(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 dG(t){return t==null?void 0:`${t}-popup`}function hG(t,e){return(n,r)=>n==null?!1:t.contains(n,r,e)}function yN(t){return Array.isArray(t)?t.map(e=>yN(e)).join(","):t==null?"":String(t)}const HO=new Map;function pG(t={}){const e={usage:"search",sensitivity:"base",ignorePunctuation:!0,...t},n=`${yN(t.locale)}|${JSON.stringify(e)}`,r=HO.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=ro(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=ro(a,c);return i.compare(d.slice(0,u.length),u)===0},endsWith(a,u,c){if(!u)return!0;const d=ro(a,c),h=u.length;return d.length>=h&&i.compare(d.slice(d.length-h),u)===0}};return HO.set(n,s),s}const gG=pG,vN=Symbol("none"),bb={value:vN,index:-1};function mG(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:S=!1,inputRef:C,grid:T=!1,items:E,filteredItems:M,filter:k,openOnInputClick:D=!0,autoHighlight:O=!1,keepHighlight:I=!1,highlightItemOnHover:L=!0,loopFocus:_=!0,itemToStringLabel:N,itemToStringValue:B,isItemEqualToValue:H=nN,virtualized:F=!1,inline:G=!1,fillInputOnItemPress:j=!0,modal:q=!1,limit:$=-1,autoComplete:X="list",formAutoComplete:Z,locale:z,submitOnItemClick:U=!1}=t,{clearErrors:W}=Mu(),{setDirty:K,validityData:ie,setFilled:ee,name:ae,disabled:Y,setTouched:se,setFocused:ve,validationMode:ye,validation:he}=Uo(),pe=Yc(),Te=iy({id:e}),De=gG({locale:z}),[Pe,Ee]=R.useState(!1),[_e,Me]=R.useState(null),oe=R.useRef([]),xe=R.useRef([]),ze=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(bb),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,Ut=E!==void 0,lt=M!==void 0;let gt;O==="always"?gt="always":gt=O?"input-change":!1;const[nt,nn]=Ss({controlled:i,default:Kt?r??li:r,name:"Combobox",state:"selectedValue"}),Vn=R.useMemo(()=>k===null?()=>!0:k!==void 0?k:hG(De,N),[k,De,N]),Fn=Qn(()=>Vt?a??"":tn?ro(nt,N):"").current,[rn,kn]=Ss({controlled:u,default:Fn,name:"Combobox",state:"inputValue"}),[Pt,Vr]=Ss({controlled:c,default:d,name:"Combobox",state:"open"}),ar=C1(E),it=_e??String(rn).trim(),qt=tn?ro(nt,N):"",qn=tn&&!Pe&&it!==""&&qt.length===it.length&&De.contains(qt,it),jn=qn?"":it,Tr=Ut&&lt&&qn,ln=R.useMemo(()=>E?ar?E.flatMap(je=>je.items):E:li,[E,ar]),zt=R.useMemo(()=>{if(M&&!Tr)return M;if(!E)return li;if(ar){const He=E,Gt=[];let jt=0;for(const on of He){if($>-1&&jt>=$)break;const er=$>-1?$-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 $>-1?ln.slice(0,$):ln;const je=[];for(const He of ln){if($>-1&&je.length>=$)break;Vn(He,jn,N)&&je.push(He)}return je},[M,Tr,E,ar,jn,$,Vn,N,ln]),Nt=R.useMemo(()=>ar?zt.flatMap(He=>He.items):zt,[zt,ar]),et=Qn(()=>{let je=null;return G&&Pt&&Ut&&h!=="none"&&(je=vb(Nt,nt,H,Kt)),new BP({id:Te,labelId:void 0,selectedValue:nt,open:Pt,items:E,selectionMode:h,listRef:oe,labelsRef:xe,popupRef:ze,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:S,grid:T,virtualized:F,openOnInputClick:D,itemToStringLabel:N,isItemEqualToValue:H,modal:q,autoHighlight:gt,submitOnItemClick:U,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,B)):ko(nt,B),[Er,B,h,nt]),Ms=Ae(g),yl=Ae(n),qe=Se(et,$e.activeIndex),Oa=Se(et,$e.selectedIndex),Jn=Se(et,$e.positionerElement),Fi=Se(et,$e.listElement),di=Se(et,$e.triggerElement),hi=Se(et,$e.inputElement),$n=Se(et,$e.inputGroupElement),ur=Se(et,$e.inline),Fr=Se(et,$e.inputInsidePopup),$i=Se(et,$e.inputOwnsFormValue),xo=Un(di),{mounted:ka,setMounted:Ia,transitionStatus:As}=pl(Pt),{openMethod:Da,triggerProps:So}=c1(Pt),Os=Ae(()=>nf);w1(Fr?xo:ne,Te,Er,Os,!at,m);const ni=Ae(()=>{E?xe.current=Nt.map(je=>ro(je,N)):et.set("forceMounted",!0)}),Gn=Ae((je,He,Gt)=>{if(He===-1){if(xt.current===bb)return;xt.current=bb}else xt.current={value:je,index:He};Ms(je,Z6(Gt,void 0,{index:He}))}),$r=Ae(je=>{et.update(je);const He=je.activeIndex;if(He===void 0)return;const Gt=je.type||gr;He===null?Gn(void 0,-1,Gt):Gn(Ct.current[He],He,Gt)}),ri=Ae((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=ze.current;for(const qr of kc(yn.firstElementChild??yn)){if(!cn(qr)||(Or?!Ge(Or,qr):qr.getAttribute("role")==="dialog"))break;if(b9(qr)){qr.scrollTop=0;break}}}er&&gt&&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=Ae((je,He)=>{if(Pt!==je&&(He.reason===Wc&&Ut&&Nt.length===0&&!we.current&&He.allowPropagation(),t.onOpenChange?.(je,He),!He.isCanceled&&(je&&Fr&&!ur&&_e!==null&&(Ee(!1),Me(null),rn!==""&&He.reason!==dd&&ri("",Ue(as,He.event))),!je&&Pe&&(tn?(ur||Me(it),it===""&&Ee(!1)):Kt&&(ur||Me(it),Fr&&$r({activeIndex:null}),(!Fr||ur)&&ri("",Ue(as,He.event)))),Vr(je),!je&&Fr&&(He.reason===ca||He.reason===nh)&&(se(!0),ve(!1),ye==="onBlur")))){const Gt=h==="none"?rn:nt;he.commit(Gt)}}),Wo=Ae((je,He)=>{if(s?.(je,He),He.isCanceled)return;nn(je),(h==="none"&&ze.current&&j||tn&&!et.state.inputInsidePopup)&&ri(ro(je,N),Ue(He.reason,He.event))}),ks=Ae((je,He)=>{const Gt=mn(je),jt=wt.current??je;wt.current=null;const on=Ue(uu,jt),er=Gt?.closest("a")?.getAttribute("href");if(er){er.startsWith("#")&&Ui(!1,on);return}if(Kt){const yn=Array.isArray(nt)?nt:[],qr=z9(yn,He,H)?rN(yn,He,H):[...yn,He];if(Wo(qr,on),on.isCanceled||!(ne.current?ne.current.value.trim()!=="":!1))return;et.state.inputInsidePopup?ri("",Ue(as,on.event)):Ui(!1,on)}else{if(Wo(He,on),on.isCanceled)return;Ui(!1,on)}}),Ou=Ae(()=>{const je=he.inputRef.current?.form??et.state.inputElement?.form;je&&typeof je.requestSubmit=="function"&&je.requestSubmit()}),cr=Ae(()=>{if(Ia(!1),yl?.(!1),Ee(!1),Me(null),$r(h==="none"?{activeIndex:null,selectedIndex:null}:{activeIndex:null}),Kt&&ne.current&&ne.current.value!==""&&!me.current&&ri("",Ue(as)),tn)if(et.state.inputInsidePopup)ne.current&&ne.current.value!==""&&ri("",Ue(as));else{const je=ro(nt,N);ne.current&&ne.current.value!==je&&ri(je,Ue(je===""?as:gr))}}),vl=R.useMemo(()=>ur&&Jn?{current:Jn.closest('[role="dialog"]')}:ze,[ur,Jn]);ci({enabled:!t.actionsRef,open:Pt,ref:vl,onComplete(){Pt||cr()}}),R.useImperativeHandle(t.actionsRef,()=>({unmount:cr}),[cr]),Oe(function(){if(Pt||(Wt.current=null,h==="none"))return;const He=Ut?ln:Ct.current;$r({selectedIndex:vb(He,nt,H,Kt)})},[Pt,nt,h,Kt,Ut,ln,H,$r]),Oe(()=>{E&&(Ct.current=Nt,oe.current.length=Nt.length)},[E,Nt]),Oe(()=>{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 qr=je.selection;gt==="always"&&!qr&&et.state.selectionMode==="none"&&et.set("activeIndex",0),queueMicrotask(()=>{if(!et.state.open&&!et.state.inline||ne.current&&ne.current.value.trim()!=="")return;const Mi=et.state.selectedValue,Ml=et.state.selectionMode==="multiple",Gr=Ml&&Array.isArray(Mi)?Mi[Mi.length-1]:Mi,Xo=et.state.selectionMode!=="none"&&Gr!=null;if(Xo||qr){const ku=Ut||lt?Nt:Ct.current;et.set("activeIndex",Xo?vb(ku,Mi,et.state.isItemEqualToValue,Ml):null)}else gt==="always"&&et.set("activeIndex",0)})}}if(!Pt&&!ur)return;const Gt=Ut||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,gr);return}if(jt>=Gt.length){Gn(void 0,-1,gr),et.set("activeIndex",null);return}const on=Gt[jt],er=xt.current.value,yn=er!==vN&&mo(on,er,et.state.isItemEqualToValue);(xt.current.index!==jt||!yn)&&Gn(on,jt,gr)},[qe,gt,Gn,lt,Ut,Nt,ur,Pt,et,rn]),Oe(()=>{if(h==="none"){ee(String(rn)!=="");return}ee(Kt?Array.isArray(nt)&&nt.length>0:nt!=null)},[ee,h,rn,nt,Kt]),R.useEffect(()=>{Ut&&gt&&Nt.length===0&&$r({activeIndex:null})},[Ut,gt,Nt.length,$r]);function Pa(je){const He=ie.initialValue;return Array.isArray(je)&&Array.isArray(He)?!oN(je,He,(Gt,jt)=>mo(Gt,jt,H)):je!==He}fc(it,()=>{!Pt||it===""||it===String(Fn)||Ee(!0)});function Is(){const je=ro(nt,N);rn!==je&&ri(je,Ue(gr))}fc(nt,()=>{h!=="none"&&(W(Tn),K(Pa(nt)),he.change(nt),tn&&!Vt&&!Fr&&Is())}),fc(rn,()=>{h==="none"&&(W(Tn),K(rn!==ie.initialValue),he.change(rn))}),fc(E,()=>{!tn||Vt||Fr||Pe||Is()});const pi=UP({open:ur?!0:Pt,onOpenChange:Ui,elements:{reference:Fr?di:hi,floating:Jn}}),bl=T?"grid":"listbox",Ko=Pt||ur,qi=Ko?"true":"false",Ds=R.useMemo(()=>{const je=hi?.tagName==="INPUT",He=hi==null||je,Gt=He||Ko,jt=He?{autoComplete:"off",spellCheck:"false",autoCorrect:"off",autoCapitalize:"none"}:{};return Gt&&(jt.role="combobox",jt["aria-expanded"]=qi,jt["aria-haspopup"]=bl,jt["aria-controls"]=Ko?Fi?.id:void 0,jt["aria-autocomplete"]=X),{reference:jt,floating:{role:"presentation"}}},[hi,Ko,qi,bl,Fi?.id,X]),xl=Gm(pi,{enabled:!x&&!at&&D,event:"mousedown-only",toggle:!1,touchOpenDelay:Fr?0:100,reason:tP}),Yo=ih(pi,{enabled:!x&&!at&&!ur,outsidePressEvent:{mouse:"sloppy",touch:"intentional"},bubbles:ur?!0:void 0,outsidePress(je){const He=mn(je);return!Ge(di,He)&&!Ge(Ke.current,He)&&!Ge(Be.current,He)&&!Ge($n,He)}}),Ei=o1(pi,{enabled:!x&&!at,id:Te,listRef:oe,activeIndex:qe,selectedIndex:Oa,virtual:!0,loopFocus:_,allowEscape:_&&!gt,focusItemOnOpen:Pe||h==="none"&&!gt?!1:"auto",focusItemOnHover:L,resetOnPointerLeave:!I,orientation:T?"horizontal":void 0,rtl:pe==="rtl",disabledIndices:li,grid:T?cG:void 0,onNavigate(je,He){!He&&!Pt||As==="ending"||$r(He?{activeIndex:je,type:de.current?Dw:Pw}:{activeIndex:je})}}),Sl=R.useMemo(()=>Jr(Ei.reference,{onKeyDown(je){T&&et.state.activeIndex==null&&(je.key==="ArrowLeft"||je.key==="ArrowRight")&&je.preventBaseUIHandler()}},Yo.reference,xl.reference,Ds.reference),[Ei.reference,Yo.reference,xl.reference,Ds.reference,T,et]),wl=R.useMemo(()=>Jr(oh,Yo.floating),[Yo.floating]),wo=R.useMemo(()=>Jr(Ei.floating,Ds.floating),[Ei.floating,Ds.floating]),Ur=R.useMemo(()=>{const je=Ei.item;return je?{...je,onFocus:void 0}:gn},[Ei.item]);Qz(()=>{et.update({inline:G,popupProps:wl,listProps:wo,inputProps:Sl,triggerProps:So,itemProps:Ur,setOpen:Ui,setInputValue:ri,setSelectedValue:Wo,setIndices:$r,handleSelection:ks,forceMount:ni,requestSubmit:Ou,onOpenChangeComplete:yl})}),Oe(()=>{et.update({id:Te,selectedValue:nt,open:Pt,mounted:ka,transitionStatus:As,items:E,inline:G,popupProps:wl,listProps:wo,inputProps:Sl,triggerProps:So,openMethod:Da,itemProps:Ur,selectionMode:h,name:Tn,form:y,disabled:at,readOnly:x,required:S,grid:T,virtualized:F,openOnInputClick:D,itemToStringLabel:N,modal:q,autoHighlight:gt,isItemEqualToValue:H,submitOnItemClick:U,hasInputValue:Vt,inputOwnsFormValue:h==="none"&&(G||!et.state.inputInsidePopup)})},[et,Te,nt,Pt,ka,As,E,wl,wo,Sl,Ur,Da,So,h,Tn,at,x,S,T,F,D,N,q,H,U,Vt,G,gt,y]);const Cl=Cs(C,he.inputRef),Rl=R.useMemo(()=>({query:it,hasItems:Ut,filteredItems:zt,flatFilteredItems:Nt}),[it,Ut,zt,Nt]),Co=R.useMemo(()=>Array.isArray(Er)?"":ko(Er,B),[Er,B]),Ro=Kt&&Array.isArray(nt)&&nt.length>0,Ps=Kt||h==="none"&&$i?void 0:Tn,Tl=R.useMemo(()=>!Kt||!Array.isArray(nt)||!Tn?null:nt.map(je=>{const He=ko(je,B);return A.jsx("input",{type:"hidden",form:y,name:Tn,value:He,disabled:at},He)}),[Kt,nt,y,Tn,B,at]),El=A.jsxs(R.Fragment,{children:[t.children,A.jsx("input",{...he.getValidationProps(at,{onFocus(){if(Fr){di?.focus();return}(ne.current||di)?.focus()},onChange(je){if(je.nativeEvent.defaultPrevented||at||x)return;const He=je.currentTarget.value,Gt=He.toLowerCase(),jt=Ue(gr,je.nativeEvent),on=()=>Ct.current.findIndex(yn=>ko(yn,B).toLowerCase()===Gt||ro(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((qr,Mi)=>{const Ml=xe.current[Mi];return Ml!=null&&Ml.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&&Ps==null?`${Te}-hidden-input`:void 0,form:y,name:Ps,autoComplete:Z,disabled:at,required:S&&!Ro,readOnly:x,value:Co,ref:Cl,style:Ps?Lw:Fm,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),Tl]});return A.jsx(fN.Provider,{value:et,children:A.jsx(dN.Provider,{value:pi,children:A.jsx(pN.Provider,{value:Ut,children:A.jsx(hN.Provider,{value:Rl,children:A.jsx(gN.Provider,{value:rn,children:El})})})})})}function yG(t){const{multiple:e=!1,defaultValue:n,value:r,onValueChange:i,autoComplete:s,...a}=t;return A.jsx(mG,{...a,selectionMode:e?"multiple":"single",selectedValue:r,defaultSelectedValue:n,onSelectedValueChange:i,formAutoComplete:s})}const bN={...sm,...Eu,popupSide:t=>t?{"data-popup-side":t}:null,listEmpty:t=>t?{"data-list-empty":""}:null},vG=R.createContext(void 0);function bG(){return R.useContext(vG)}const xN=R.createContext(void 0);function E1(t){const e=R.useContext(xN);if(e===void 0&&!t)throw new Error(Jt(21));return e}const SN=R.forwardRef(function(e,n){const r=vo(),{buttonRef:i,getButtonProps:s}=Vi({native:!1}),a=Cs(n,i);function u(d){r.state.setOpen(!1,Ue(eP,d.nativeEvent,d.currentTarget))}const c=s({onClick:u});return A.jsx("span",{ref:a,...c,"aria-label":"Dismiss",tabIndex:void 0,style:Lw})});function wN(t){const e=Se(t,$e.mounted),n=Se(t,$e.popupSide),r=Se(t,$e.positionerElement);return e&&r?n:null}function oy(){return fh().filteredItems.length===0}function xG(t){return t==="rtl"?["ArrowRight","ArrowLeft"]:["ArrowLeft","ArrowRight"]}function SG(t,e){const n=t>=e-1?e-2:t;return n>=0?n:void 0}function CN(t,e,n){const r=t.state.listRef.current[e];r&&(t.state.selectionEventRef.current=n,r.click(),t.state.selectionEventRef.current=null)}const wG=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}=Uo(),{labelId:x}=Ts(),S=bG(),T=!!E1(!0),E=vo(),M=mN(),k=Yc(),D=Se(E,$e.required),O=Se(E,$e.disabled),I=Se(E,$e.readOnly),L=Se(E,$e.name),_=Se(E,$e.form),N=Se(E,$e.selectionMode),B=Se(E,$e.autoHighlight),H=Se(E,$e.inputProps),F=Se(E,$e.triggerProps),G=Se(E,$e.open),j=Se(E,$e.mounted),q=Se(E,$e.selectedValue),$=Se(E,$e.id),X=Se(E,$e.inline),Z=Se(E,$e.modal),z=!!B,U=wN(E),W=h||O||s,K=oy(),ie=T||X,ee=!ie||Z,ae=Hr(a??(ie?void 0:$)),Y=T?Jz:d,[se,ve]=R.useState(null),ye=R.useRef(!1),he=R.useRef(null),pe=R.useRef(!1),Te=N==="none"&&!T,De=Ae(ne=>{const J=T||E.state.inline;J&&!E.state.hasInputValue&&E.state.setInputValue("",Ue(gr)),E.update({inputElement:ne,inputInsidePopup:J,inputOwnsFormValue:Te})}),Pe=T?c:b.getValidationProps(W,c);function Ee(){E.state.setIndices({activeIndex:null,selectedIndex:null,type:E.state.keyboardActiveRef.current?Dw:Pw})}function _e(){E.state.keyboardActiveRef.current=!1}const Me={...Y,open:G,disabled:W,readOnly:I,popupSide:U,listEmpty:K};function oe(ne){if(!S)return;let J;const{highlightedChipIndex:le}=S,we=S.chipsRef.current.length,[de,me]=xG(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=SG(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=rt("input",e,{state:Me,ref:[n,E.state.inputRef,De],props:[H,F,{value:se??M,"aria-readonly":I||void 0,"aria-required":D||void 0,"aria-labelledby":x,disabled:W,readOnly:I,required:N==="none"?D:void 0,form:_,...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&&B!=="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){Qg||(ye.current=!0,ve(ne.currentTarget.value))},onCompositionEnd(ne){ye.current=!1;const J=ne.currentTarget.value;ve(null),E.state.setInputValue(J,Ue(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,Ue(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,Ue(as,J));const st=xt.trim(),Ct=z&&st!=="";me(st),G&&E.state.activeIndex!==null&&!Ct&&Ee();return}const Be=Ue(dd,J);if(E.state.setInputValue(ne.currentTarget.value,Be),Be.isCanceled)return;const Ke=ne.currentTarget.value==="",wt=Ue(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=CA&&we?J.value.length:0;J.setSelectionRange(Be,Be),J.scrollLeft=0;return}if(ne.key==="End"){Nr(ne);const Be=CA&&we?0:J.value.length;J.setSelectionRange(Be,Be),J.scrollLeft=we?-le:le;return}if(!j&&ne.key==="Escape"){const Be=N==="multiple"&&Array.isArray(q)?q.length===0:q===null,Ke=Ue(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(S&&ne.key==="Backspace"&&J.value===""&&S.highlightedChipIndex===void 0&&Array.isArray(q)&&q.length>0){const Be=S.chipsRef.current.length,Ke=Be>0?Be-1:q.length-1,wt=q.filter((xt,st)=>st!==Ke);Ee(),E.state.setSelectedValue(wt,Ue(gr,ne.nativeEvent));return}const de=S?.highlightedChipIndex!==void 0,me=oe(ne);if(S?.setHighlightedChipIndex(me),me!==void 0?S?.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,Ue(gr,Ke));return}Nr(ne),CN(E,Be,Ke)}},onPointerMove:_e,onPointerDown:_e},Pe],stateAttributesMapping:bN}),ze=T?A.jsx(S1.Provider,{value:eN,children:xe}):xe;return A.jsxs(R.Fragment,{children:[G&&ee&&A.jsx(SN,{ref:E.state.startDismissRef}),ze]})});function CG(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)||ZD(a))||(t.preventDefault(),!n&&(e.state.inputRef.current?.focus(),e.state.openOnInputClick&&e.state.setOpen(!0,Ue(tP,t.nativeEvent))))}const RG=R.forwardRef(function(e,n){const{render:r,className:i,style:s,...a}=e,{state:u}=Uo(),c=vo(),d=Se(c,$e.open),h=Se(c,$e.disabled),g=Se(c,$e.readOnly),m=Se(c,$e.hasSelectedValue),y=Se(c,$e.selectionMode),b=wN(c),x=h,S=oy(),T={...u,open:d,disabled:x,readOnly:g,popupSide:b,listEmpty:S,placeholder:y==="none"?!1:!m},E=Ae(M=>{c.set("inputGroupElement",M)});return rt("div",e,{ref:[n,E],props:[{role:"group",onMouseDown(M){CG(M,c,x,g,k=>Ge(c.state.chipsContainerRef.current,k))}},a],state:T,stateAttributesMapping:bN})}),TG=R.createContext(null);function EG(){return R.useContext(TG)}function MG(t){const{children:e}=t,{filteredItems:n}=fh(),r=EG(),i=r?r.items:n;return A.jsx(R.Fragment,{children:i.map(e)})}const AG=R.forwardRef(function(e,n){var r;const{render:i,className:s,style:a,children:u,...c}=e,d=vo(),h=T1(),g=!!E1(!0),{filteredItems:m,hasItems:y}=fh(),b=Se(d,$e.selectionMode),x=Se(d,$e.grid),S=Se(d,$e.listProps),C=Se(d,$e.virtualized),T=Se(d,$e.forceMounted),E=b==="multiple",M=m.length===0,k=Ae(B=>{d.set("positionerElement",B)}),D=Ae(B=>{d.set("listElement",B)}),O=R.useMemo(()=>typeof u=="function"?r||(r=A.jsx(MG,{children:u})):u,[u]),I={empty:M},L=h.useState("floatingId"),_=rt("div",e,{state:I,ref:[n,D,g?null:k],props:[S,{children:O,tabIndex:-1,id:L,role:x?"grid":"listbox","aria-multiselectable":E?"true":void 0,onKeyDown(B){if(!(d.state.disabled||d.state.readOnly)&&B.key==="Enter"){const H=d.state.activeIndex;if(H==null)return;Nr(B),CN(d,H,B.nativeEvent)}},onKeyDownCapture(){d.state.keyboardActiveRef.current=!0},onPointerMoveCapture(){d.state.keyboardActiveRef.current=!1}},c]});if(C)return _;const N=y&&!T?void 0:d.state.labelsRef;return A.jsx(ch,{elementsRef:d.state.listRef,labelsRef:N,children:_})}),OG="⁠",kG=200;function IG(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 DG(){const t=lr(),e=R.useRef(null);return R.useEffect(()=>{if(eh)return;const n=e.current;if(n==null)return;const r=IG(n);if(r==null)return;const i=r.data,s=`${i}${OG}`;return r.nodeValue=s,t.start(kG,()=>{r.nodeValue===s&&(r.nodeValue=i)}),()=>{t.clear(),r.nodeValue===s&&(r.nodeValue=i)}},[e,t]),e}const RN=R.createContext(void 0);function PG(){const t=R.useContext(RN);if(t===void 0)throw new Error(Jt(20));return t}const zG=R.forwardRef(function(e,n){const{keepMounted:r=!1,...i}=e,s=vo(),a=Se(s,$e.mounted),u=Se(s,$e.forceMounted);return a||r||u?A.jsx(RN.Provider,{value:r,children:A.jsx(Um,{ref:n,...i})}):null}),NG=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:S=Fw,style:C,...T}=e,E=vo(),M=T1(),k=PG(),D=Se(E,$e.modal),O=Se(E,$e.open),I=Se(E,$e.mounted),L=Se(E,$e.openMethod),_=Se(E,$e.positionerElement),N=Se(E,$e.triggerElement),B=Se(E,$e.inputElement),H=Se(E,$e.inputGroupElement),F=Se(E,$e.inputInsidePopup),G=Se(E,$e.transitionStatus),j=oy(),$=Qm({anchor:s??(F?N:H??B),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:S,lazyFlip:!0});u1(O&&D,L==="touch",_,N);const X={open:O,side:$.side,align:$.align,anchorHidden:$.anchorHidden,empty:j};Oe(()=>{E.set("popupSide",$.side)},[E,$.side]);const Z=Ae(U=>{E.set("positionerElement",U)}),z=Zm(e,X,{styles:$.positionerStyles,transitionStatus:G,props:T,refs:[n,Z],hidden:!I,inert:!O});return A.jsxs(xN.Provider,{value:$,children:[I&&D&&A.jsx(ty,{inert:Xc(!O),cutout:H??B??N}),z]})}),LG={...lh,...$o},BG=R.forwardRef(function(e,n){const{render:r,className:i,style:s,initialFocus:a,finalFocus:u,...c}=e,d=vo(),h=E1(),g=T1(),m=Se(d,$e.mounted),y=Se(d,$e.open),b=Se(d,$e.openMethod),x=Se(d,$e.popupProps),S=Se(d,$e.transitionStatus),C=Se(d,$e.inputInsidePopup),T=Se(d,$e.inputElement),E=Se(d,$e.modal),M=Se(d,$e.id),k=oy(),D=c.id??(C?dG(M):void 0);Oe(()=>(d.set("popupId",d.state.popupRef.current?.id||D),()=>{d.set("popupId",void 0)}),[d,D]),ci({open:y,ref:d.state.popupRef,onComplete(){y&&d.state.onOpenChangeComplete(!0)}});const O={open:y,side:h.side,align:h.align,anchorHidden:h.anchorHidden,transitionStatus:S,empty:k},I=rt("div",e,{state:O,ref:[n,d.state.popupRef],props:[x,{id:D,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(S),c],stateAttributesMapping:LG}),_=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 B=!C||E;return A.jsx(qm,{context:g,disabled:!m,modal:B,openInteractionType:b,initialFocus:_,returnFocus:N,getInsideElements:()=>[d.state.startDismissRef.current,d.state.endDismissRef.current],children:A.jsxs(R.Fragment,{children:[I,B&&A.jsx(SN,{ref:d.state.endDismissRef})]})})}),jG=R.forwardRef(function(e,n){const{render:r,className:i,style:s,...a}=e;return rt("span",e,{ref:n,props:[{"aria-hidden":!0,children:"▼"},a]})}),TN=R.createContext(void 0);function EN(){const t=R.useContext(TN);if(!t)throw new Error(Jt(19));return t}const _G=R.createContext(!1);function HG(){return R.useContext(_G)}function MN(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(),S=HG(),C=fG(),T=Se(x,$e.selectionMode),E=Se(x,$e.disabled),M=Se(x,$e.readOnly),k=Se(x,$e.isItemEqualToValue),D=E||h,O=T!=="none",I=d??i??b.index,L=I!==-1,_=Se(x,$e.id),N=Se(x,$e.isActive,I),B=Se(x,$e.isSelected,c),H=Se(x,$e.itemProps),F=R.useRef(null),G=_!=null&&L?`${_}-${I}`:void 0,j=B&&O;Oe(()=>{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]),Oe(()=>{if(!L||C)return;const K=x.state.valuesRef.current;return K[I]=c,()=>{delete K[I]}},[L,C,I,c,x]),Oe(()=>{if(!L||C)return;const K=x.state.selectedValue,ie=Array.isArray(K)?K[K.length-1]:K;mo(c,ie,k)&&x.set("selectedIndex",I)},[L,C,x,I,c,k]);const{getButtonProps:q,buttonRef:$}=Vi({disabled:D,focusableWhenDisabled:!0,native:g,composite:!0}),X={disabled:D,selected:j,highlighted:N};function Z(K){function ie(){x.state.handleSelection(K,c)}x.state.submitOnItemClick?(go.flushSync(ie),x.state.requestSubmit()):ie()}const z={id:G,role:S?"gridcell":"option","aria-selected":O?j:void 0,tabIndex:void 0,onPointerDownCapture(K){K.isPrimary&&(x.state.pointerDownItemRef.current=K.currentTarget),K.preventDefault()},onMouseDown(K){K.preventDefault()},onClick(K){D||M||Z(K.nativeEvent)},onMouseUp(K){const ie=x.state.pointerDownItemRef.current===K.currentTarget;x.state.pointerDownItemRef.current=null,!(D||M||K.button!==0||ie||!N)&&Z(K.nativeEvent)}},U=rt("div",e,{ref:[$,n,b.ref,F],state:X,props:[H,z,m,q]}),W=R.useMemo(()=>({selected:j,textRef:y}),[j,y]);return A.jsx(TN.Provider,{value:W,children:U})}function VG(t){const{componentProps:e,forwardedRef:n}=t,r=vo(),i=Se(r,$e.isItemEqualToValue),{flatFilteredItems:s}=fh(),a=xc(s,e.value??null,i);return A.jsx(MN,{componentProps:e,forwardedRef:n,virtualized:!0,indexFromFilter:a})}const FG=R.memo(R.forwardRef(function(e,n){const r=vo(),i=Se(r,$e.virtualized);return i&&e.index==null?A.jsx(VG,{componentProps:e,forwardedRef:n}):A.jsx(MN,{componentProps:e,forwardedRef:n,virtualized:i,indexFromFilter:void 0})})),$G=R.forwardRef(function(e,n){const{selected:r}=EN();return e.keepMounted||r?A.jsx(UG,{...e,ref:n}):null}),UG=R.memo(R.forwardRef((t,e)=>{const{render:n,className:r,style:i,keepMounted:s,...a}=t,{selected:u}=EN(),c=R.useRef(null),{transitionStatus:d,setMounted:h}=pl(u),m=rt("span",t,{ref:[e,c],state:{selected:u,transitionStatus:d},props:[{"aria-hidden":!0,children:"✔️"},a],stateAttributesMapping:$o});return ci({open:u,ref:c,onComplete(){u||h(!1)}}),m})),qG=R.forwardRef(function(e,n){const{render:r,className:i,style:s,children:a,...u}=e,{filteredItems:c}=fh(),d=vo(),h=DG(),g=c.length===0?a:null;return rt("div",e,{ref:[n,d.state.emptyRef,h],props:[{children:g,role:"status","aria-live":"polite","aria-atomic":!0},u]})}),GG={...$o,...Xm},WG=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}=Uo(),g=vo(),m=Se(g,$e.selectionMode),y=Se(g,$e.disabled),b=Se(g,$e.readOnly),x=Se(g,$e.open),S=Se(g,$e.selectedValue),C=Se(g,$e.hasSelectionChips),T=mN();let E=!1;m==="none"?E=T!=="":m==="single"?E=S!=null:E=C;const M=h||y||s,{buttonRef:k,getButtonProps:D}=Vi({native:a,disabled:M}),{mounted:O,transitionStatus:I,setMounted:L}=pl(E),_={disabled:M,visible:E,open:x,transitionStatus:I};ci({open:E,ref:g.state.clearRef,onComplete(){E||L(!1)}});const N=rt("button",e,{state:_,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?Dw:Pw;g.state.setInputValue("",Ue(TA,H.nativeEvent)),m!=="none"?(g.state.setSelectedValue(Array.isArray(S)?[]:null,Ue(TA,H.nativeEvent)),g.state.setIndices({activeIndex:null,selectedIndex:null,type:F})):g.state.setIndices({activeIndex:null,type:F}),g.state.inputRef.current?.focus()}},d,D],stateAttributesMapping:GG});return u||O?N:null}),AN=R.createContext(void 0);function M1(){const t=R.useContext(AN);if(t===void 0)throw new Error(Jt(64));return t}const sy={tabActivationDirection:t=>({"data-activation-direction":t})},KG=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,S]=Ss({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=>rS(T,Y),[T]),[D,O]=R.useState(()=>({previousValue:x,tabActivationDirection:"none"})),{previousValue:I,tabActivationDirection:L}=D;let _=L,N=!1;I!==x&&(_=VO(I,x,a,T),N=I!=null&&x!=null&&k(x)==null);const B=N?I:x,H=I!==B||L!==_;Oe(()=>{H&&O({previousValue:B,tabActivationDirection:_})},[B,H,_]);const F=Ae((Y,se)=>{const ve=VO(x,Y,a,T);se.activationDirection=ve,s?.(Y,se),!se.isCanceled&&S(Y)}),G=Ae((Y,se)=>{s?.(Y,Ue(se,void 0,void 0,{activationDirection:"none"}))}),j=Ae((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]),$=R.useCallback(Y=>{for(const se of T.values())if(Y===se.value)return se.id},[T]),X=R.useMemo(()=>({getTabElementBySelectedValue:k,getTabIdByPanelValue:$,getTabPanelIdByValue:q,onValueChange:F,orientation:a,registerMountedTabPanel:j,setTabMap:E,tabActivationDirection:_,value:x}),[k,$,q,F,a,j,E,_,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]),U=R.useRef(!g),W=R.useRef(i),K=R.useRef(g),ie=R.useRef(!1);Oe(()=>{if(C)return;function Y(he,pe){S(he),O({previousValue:he,tabActivationDirection:"none"}),G(he,pe),U.current=!1}if(T.size===0){ie.current&&x!==null&&!M.current?.isConnected&&Y(null,EA);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=U.current;if(se||ve){const he=z??null;if(x===he){U.current=!1;return}let pe=EA;ye?pe=MA:se&&(pe=rP),Y(he,pe);return}ye&&Z!=null&&(G(x,MA),U.current=!1)},[z,C,G,Z,S,T,x]);const ae=rt("div",e,{state:{orientation:a,tabActivationDirection:_},ref:n,props:h,stateAttributesMapping:sy});return A.jsx(AN.Provider,{value:X,children:A.jsx(ch,{elementsRef:m,children:ae})})});function rS(t,e){for(const[n,r]of t.entries())if(e===r.value)return n;return null}function VO(t,e,n,r){if(t==null||e==null)return"none";const[i,s,a]=n==="horizontal"?["left","left","right"]:["top","up","down"],u=rS(r,t),c=rS(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 ON="data-composite-item-active",kN=R.createContext(void 0);function YG(){const t=R.useContext(kN);if(t===void 0)throw new Error(Jt(65));return t}const XG=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}=M1(),{activateOnFocus:S,registerTabResizeObserverElement:C,tabsListElement:T}=YG(),{highlightedIndex:E,onHighlightedIndexChange:M}=Jm(),k=Hr(u),D=R.useMemo(()=>({disabled:i,id:k,value:a}),[i,k,a]),{compositeProps:O,compositeRef:I,index:L}=bz({metadata:D}),_=a===g,N=R.useRef(!1),B=R.useRef(null),H=Ae(ie=>{B.current?.(),B.current=ie?C(ie):null});Oe(()=>{if(N.current){N.current=!1;return}if(!(_&&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)},[_,L,E,M,i,T]);const{getButtonProps:F,buttonRef:G}=Vi({disabled:i,native:c,focusableWhenDisabled:!0}),j=m(a),q=R.useRef(!1),$=R.useRef(!1);function X(ie){y(a,Ue(gr,ie.nativeEvent,void 0,{activationDirection:"none"}))}function Z(ie){_||i||X(ie)}function z(ie){_||i||S&&(!q.current||$.current)&&X(ie)}function U(ie){if(_||i)return;q.current=!0,$.current=ie.button===0;const ee=vt(ie.currentTarget);function ae(){q.current=!1,$.current=!1,ee.removeEventListener("pointerup",ae),ee.removeEventListener("pointercancel",ae)}ee.addEventListener("pointerup",ae),ee.addEventListener("pointercancel",ae)}return rt("button",e,{state:{disabled:i,active:_,orientation:b,tabActivationDirection:x},ref:[n,G,I,H],props:[O,{role:"tab","aria-controls":j,"aria-selected":_,id:k,onClick:Z,onFocus:z,onPointerDown:U,[ON]:_?"":void 0,onKeyDownCapture(){N.current=!0}},h,F],stateAttributesMapping:sy})}),QG={...sy,...$o},ZG=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}=M1(),b=Hr(),{ref:x,index:S}=Qc(),C=i===d,{mounted:T,transitionStatus:E,setMounted:M}=pl(C),k=!T,D=h(i),O={hidden:k,orientation:g,tabActivationDirection:m,transitionStatus:E},I=R.useRef(null),L=rt("div",e,{state:O,ref:[n,x,I],props:[{"aria-labelledby":D,hidden:k,id:b,role:"tabpanel",tabIndex:C?0:-1,inert:Xc(!C),"data-index":S},c],stateAttributesMapping:QG});return ci({open:C,ref:I,onComplete(){C||M(!1)}}),Oe(()=>{if(!(b==null||k&&!a))return y(i,b)},[k,a,i,b,y]),a||T?L:null}),JG=[];function eW(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=JG}=t,[y,b]=R.useState(0),x=r!=null,S=R.useRef(null),C=Cs(S,c),T=R.useRef([]),E=R.useRef(!1),M=a??y,k=Ae((_,N=!1)=>{if((u??b)(_),N){const B=T.current[_];fO(S.current,B,s,n)}}),D=Ae(_=>{if(_.size===0||E.current)return;E.current=!0;const N=Array.from(_.keys()),B=N.find(F=>F?.hasAttribute(ON))??null,H=B?_.get(B)?.index??-1:-1;if(H!==-1)k(H);else if(Pc(N,M,g)){const F=Ar(N,{disabledIndices:g});la(N,F)||k(F)}fO(S.current,B,s,n)});Oe(()=>{if(g==null||a!=null||!E.current)return;const _=T.current;if(Pc(_,M,g)){const N=Ar(_,{disabledIndices:g});la(_,N)||k(N)}},[g,a,M,T,k]);const O=Ae((_,N,B)=>i?i(_,N,B,T):B),I=Ae(_=>{const N=_.key===Qx||_.key===Zx;if(!ey.has(_.key)||!d&&N||tW(_,m)||!S.current)return;const H=s==="rtl",F=H?Yx:Xx,G=H?Xx:Yx,j=n==="vertical"?Kx:F,q=n==="vertical"?Wx:G,$=mn(_.nativeEvent);if($!=null&&cO($)&&!wz($)){const K=$.selectionStart,ie=$.selectionEnd,ee=$.value;if(K==null||_.shiftKey||K!==ie||_.key!==q&&K<ee.length||_.key!==j&&K>0)return}let X=M;const Z=kg(T,g),z=Ux(T,g);r!=null&&(X=r({disabledIndices:g,elementsRef:T,event:_,highlightedIndex:M,loopFocus:e,maxIndex:z,minIndex:Z,onLoop:O,orientation:n,rtl:H}));const U=n!=="vertical"&&_.key===F||n!=="horizontal"&&_.key===Kx,W=n!=="vertical"&&_.key===G||n!=="horizontal"&&_.key===Wx;d&&(_.key===Qx?X=Z:_.key===Zx&&(X=z)),X===M&&(U||W)&&(e&&X===z&&U?(X=Z,i&&(X=i(_,M,X,T))):e&&X===Z&&W?(X=z,i&&(X=i(_,M,X,T))):X=Ar(T.current,{startingIndex:X,decrement:W,disabledIndices:g})),X!==M&&!la(T.current,X)&&(h&&_.stopPropagation(),(x||N||U||W)&&_.preventDefault(),k(X,!0),queueMicrotask(()=>{T.current[X]?.focus()}))});return{props:{ref:C,onFocus(_){const N=S.current,B=mn(_.nativeEvent);!N||B==null||!cO(B)||B.setSelectionRange(0,B.value.length)},onKeyDown:I},highlightedIndex:M,onHighlightedIndexChange:k,elementsRef:T,onMapChange:D,relayKeyboardEvent:I}}function tW(t,e){for(const n of V2)if(!e.includes(n)&&t.getModifierState(n))return!0;return!1}function A1(t){const{render:e,className:n,style:r,refs:i=li,props:s=li,state:a=gn,stateAttributesMapping:u,highlightedIndex:c,onHighlightedIndexChange:d,orientation:h,grid:g,loopFocus:m,onLoop:y,enableHomeAndEndKeys:b,onMapChange:x,stopEventPropagation:S=!0,rootRef:C,disabledIndices:T,modifierKeys:E,highlightItemOnHover:M=!1,tag:k="div",...D}=t,O=Yc(),{props:I,highlightedIndex:L,onHighlightedIndexChange:_,elementsRef:N,onMapChange:B,relayKeyboardEvent:H}=eW({grid:g,loopFocus:m,onLoop:y,orientation:h,highlightedIndex:c,onHighlightedIndexChange:d,rootRef:C,stopEventPropagation:S,enableHomeAndEndKeys:b,direction:O,disabledIndices:T,modifierKeys:E}),F=rt(k,t,{state:a,ref:i,props:[I,...s,D],stateAttributesMapping:u}),G=R.useMemo(()=>({highlightedIndex:L,onHighlightedIndexChange:_,highlightItemOnHover:M,relayKeyboardEvent:H}),[L,_,M,H]);return A.jsx(sz.Provider,{value:G,children:A.jsx(ch,{elementsRef:N,onMapChange:j=>{x?.(j),B(j)},children:F})})}const nW=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}=M1(),[m,y]=R.useState(0),[b,x]=R.useState(null),S=R.useRef(new Set),C=R.useRef(new Set),T=R.useRef(null);Oe(()=>{if(typeof ResizeObserver>"u")return;const I=new ResizeObserver(()=>{S.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=Ae(I=>(S.current.add(I),()=>{S.current.delete(I)})),M=Ae(I=>(C.current.add(I),T.current?.observe(I),()=>{C.current.delete(I),T.current?.unobserve(I)})),k={orientation:d,tabActivationDirection:g},D={"aria-orientation":d==="vertical"?"vertical":void 0,role:"tablist"},O=R.useMemo(()=>({activateOnFocus:r,registerIndicatorUpdateListener:E,registerTabResizeObserverElement:M,tabsListElement:b}),[r,E,M,b]);return A.jsx(kN.Provider,{value:O,children:A.jsx(A1,{render:a,className:i,style:u,state:k,refs:[n,x],props:[D,c],stateAttributesMapping:sy,highlightedIndex:m,enableHomeAndEndKeys:!0,loopFocus:s,orientation:d,onHighlightedIndexChange:y,onMapChange:h,disabledIndices:li})})}),IN=R.createContext(void 0);function DN(){return R.useContext(IN)}const PN=R.createContext(void 0);function rW(){return R.useContext(PN)}const iW=R.forwardRef(function(e,n){const{defaultValue:r,disabled:i=!1,loopFocus:s=!0,onValueChange:a,orientation:u="horizontal",multiple:c=!1,value:d,className:h,render:g,style:m,...y}=e,b=uh(!0),x=DN(),S=d!==void 0||r!==void 0,C=(b?.disabled??!1)||(x?.disabled??!1)||i,[T,E]=Ss({controlled:d,default:d===void 0?r??li:void 0,name:"ToggleGroup",state:"value"}),M=Ae((L,_,N)=>{let B;c?(B=T.slice(),_?B.push(L):B.splice(T.indexOf(L),1)):B=_?[L]:[],a?.(B,N),!N.isCanceled&&E(B)}),k={disabled:C,multiple:c,orientation:u},D=R.useMemo(()=>({disabled:C,setGroupValue:M,value:T,isValueInitialized:S}),[C,M,T,S]),O={role:"group"},I=rt("div",e,{enabled:!!b,state:k,ref:n,props:[O,y]});return A.jsx(PN.Provider,{value:D,children:b?I:A.jsx(A1,{render:g,className:h,style:m,state:k,refs:[n],props:[O,y],loopFocus:s,enableHomeAndEndKeys:!0,orientation:u})})}),oW=R.forwardRef(function(e,n){const{className:r,defaultPressed:i=!1,disabled:s=!1,form:a,onPressedChange:u,pressed:c,render:d,type:h,value:g,nativeButton:m=!0,style:y,...b}=e,x=Hr(g||void 0),S=rW(),C=S?.value??[],T=S?void 0:i,E=(s||S?.disabled)??!1,[M,k]=Ss({controlled:S?x!==void 0&&C.indexOf(x)>-1:c,default:T,name:"Toggle",state:"pressed"}),{getButtonProps:D,buttonRef:O}=Vi({disabled:E,native:m}),I={disabled:E,pressed:M},L=[O,n],_=[{"aria-pressed":M,onClick(H){const F=!M,G=Ue(gr,H.nativeEvent);u?.(F,G),!G.isCanceled&&(x&&S?.setGroupValue?.(x,F,G),!G.isCanceled&&k(F))}},b,D],N=rt("button",e,{enabled:!S,state:I,ref:L,props:_}),B=R.useMemo(()=>({disabled:E,focusableWhenDisabled:!1}),[E]);return S?A.jsx(f1,{tag:"button",render:d,className:r,style:y,metadata:B,state:I,refs:L,props:_}):N}),sW=R.createContext(void 0);function lW(t=!1){const e=R.useContext(sW);if(!e&&!t)throw new Error(Jt(86));return e}const aW=function(e){const n=Hr(),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}=Ts(),m=Ae((x,S)=>{const C=h.current;if(S===void 0){C.delete(x);return}C.set(x,S),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 S=x["aria-describedby"]?x["aria-describedby"].split(" "):[];return S.push(...g,...c),{...x,"aria-describedby":Array.from(new Set(S)).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 A.jsx(tN.Provider,{value:b,children:e.children})};function iS(t,e){return{...t,state:{...t.state,valid:!e&&t.state.valid}}}const xb=Object.keys(Nd);function uW(t,e){return t.matches(":disabled")?!1:!e||t.form===e?!0:t.form===null&&!t.hasAttribute("form")}function FO(t,e){let n=null;for(const r of t.keys())if(uW(r,e)){if(!r.validity.valid)return r;n??=r}return n}function $O(t,e){for(const n of e.keys())n.setCustomValidity("");t?.setCustomValidity("")}function cW(t){const{elementRef:e,formRef:n}=Mu(),{setValidityData:r,validate:i,validityData:s,validationDebounceTime:a,invalid:u,markedDirtyRef:c,state:d,shouldValidateOnChange:h,registeredFieldIdRef:g}=t,{controlId:m,getDescriptionProps:y}=Ts(),b=lr(),x=R.useRef(null),S=Qn(()=>new Map).current,C=R.useRef(0),T=R.useCallback((O,I)=>(S.set(O,I),()=>{S.delete(O)}),[S]),E=Ae(()=>{const O=FO(S,e.current);return O&&S.get(O)?.controlRef.current||null}),M=Ae(async(O,I=!1)=>{C.current+=1;const L=C.current;function _(Z,z=u){const U=g.current??m;if(U==null)return;const W=n.current.fields.get(U);if(!W)return;const K=iS(Z,z);n.current.fields.set(U,{...W,validityData:K})}function N(Z,z){const U={value:O,state:{...Nd,valid:!0},error:"",errors:[],initialValue:s.initialValue};$O(Z,S),_(U,z),r(U)}const B=S.size>0?FO(S,e.current):x.current;if(I){if(d.valid!==!1||!B)return;const Z=B.validity;if(!Z.valueMissing){N(B,!1);return}for(const z of xb)if(z!=="valid"&&z!=="valueMissing"&&z!=="customError"&&Z[z])return}function H(Z){const z=xb.reduce((W,K)=>(W[K]=Z.validity[K],W),{});let U=!1;for(const W of xb)if(W!=="valid"){if(W==="valueMissing"&&z[W])U=!0;else if(z[W])return z}return U&&!c.current&&(z.valid=!0,z.valueMissing=!1),z}b.clear();let F=null,G=[];const j=B?H(B):{...Nd,valid:!0};let q;const $=h();if(B&&B.validationMessage&&!$)q=B.validationMessage,G=[B.validationMessage];else{const Z=Array.from(n.current.fields.values()).reduce((U,W)=>(W.name&&(U[W.name]=W.getValue()),U),{}),z=i(O,Z);if(typeof z=="object"&&z!==null&&"then"in z){if(F=await z,L!==C.current)return}else F=z;F!==null?(j.valid=!1,j.customError=!0,Array.isArray(F)?(G=F,B?.setCustomValidity(F.join(`
18
+ `))):F&&(G=[F],B?.setCustomValidity(F))):$&&($O(B,S),j.customError=!1,B&&B.validationMessage?(q=B.validationMessage,G=[B.validationMessage]):(!B||B.validity.valid)&&!j.valid&&(j.valid=!0))}const X={value:O,state:j,error:q??(Array.isArray(F)?F[0]:F??""),errors:G,initialValue:s.initialValue};_(X),r(X)}),k=Ae(O=>{b.clear();const I=h();I&&O!==""&&a?(C.current+=1,b.start(a,()=>{M(O)})):M(O,!I)}),D=R.useCallback((O,I={})=>Jr(y(I),d.valid===!1&&!d.disabled&&!O?{"aria-invalid":!0}:gn),[y,d.disabled,d.valid]);return R.useMemo(()=>({getValidationProps:D,inputRef:x,registeredInputs:S,registerInput:T,getInputControl:E,commit:M,change:k}),[D,S,T,E,M,k])}function fW(t){const{commit:e,invalid:n,markedDirtyRef:r,name:i,setRegisteredFieldName:s,registeredFieldIdRef:a,setValidityData:u,validityData:c}=t,{formRef:d}=Mu(),h=R.useRef(null),g=R.useRef(null),m=R.useRef(!1),y=Ae(()=>{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=Ae(()=>{const M=g.current;if(r.current=!0,!M){e(c.value);return}e(b(M))});function S(){const M=g.current;!M||!M.id||d.current.fields.set(M.id,{getValue:y,name:i??M.name,controlRef:M.controlRef,validityData:iS(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(D=>D.initialValue===k?D:{...D,initialValue:k})}Oe(()=>{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:iS(c,n),validate:x}))},[d,y,n,i,s,x,c]),Oe(()=>{const M=d.current.fields;return()=>{const k=g.current?.id;k&&M.delete(k)}},[d]);const E=Ae((M,k)=>{if(!k){h.current===M&&(h.current=null,C(),g.current=null,s(void 0),a.current=void 0);return}const D=g.current?.id;h.current=M,g.current=k,i||s(k.name),a.current=k.id,D&&D!==k.id&&C(D),T(k),S()});return[x,E]}const dW=R.forwardRef(function(e,n){const{errors:r,validationMode:i,submitAttemptedRef:s}=Mu(),{render:a,className:u,validate:c,validationDebounceTime:d=0,validationMode:h=i,name:g,disabled:m=!1,invalid:y,dirty:b,touched:x,actionsRef:S,style:C,...T}=e,E=lW(!0)?.disabled,M=Ae(c||(()=>null)),k=E||m,[D,O]=R.useState(!1),[I,L]=R.useState(!1),[_,N]=R.useState(!1),[B,H]=R.useState(!1),F=b??I,G=x??D,j=R.useRef(F),q=R.useRef(void 0),[$,X]=R.useState(),Z=g??$;Oe(()=>{b!==void 0&&(j.current=b)},[b]);const z=Ae(Pe=>{b===void 0&&(Pe&&(j.current=!0),L(Pe))}),U=Ae(Pe=>{x===void 0&&O(Pe)}),W=Ae(()=>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:_,focused:B}),[k,G,F,se,_,B]),ye=cW({setValidityData:Y,validate:M,validityData:ae,validationDebounceTime:d,invalid:ee,markedDirtyRef:j,state:ve,shouldValidateOnChange:W,registeredFieldIdRef:q}),[he,pe]=fW({commit:ye.commit,invalid:ee,markedDirtyRef:j,name:g,setRegisteredFieldName:X,registeredFieldIdRef:q,setValidityData:Y,validityData:ae});R.useImperativeHandle(S,()=>({validate:he}),[he]);const Te=R.useMemo(()=>({invalid:ee,name:Z,validityData:ae,setValidityData:Y,disabled:k,setTouched:U,setDirty:z,setFilled:N,setFocused:H,validationMode:h,shouldValidateOnChange:W,state:ve,registerFieldControl:pe,validation:ye}),[ee,Z,ae,k,U,z,N,H,h,W,ve,pe,ye]),De=rt("div",e,{ref:n,state:ve,props:T,stateAttributesMapping:Eu});return A.jsx(S1.Provider,{value:Te,children:De})}),hW=R.forwardRef(function(e,n){return A.jsx(aW,{children:A.jsx(dW,{...e,ref:n})})}),pW=R.createContext({disabled:!1});function zN(){return R.useContext(pW)}const gW=R.forwardRef(function(e,n){const{render:r,className:i,style:s,id:a,nativeLabel:u=!0,...c}=e,d=Uo(!1),h=zN(),{labelId:g}=Ts(),m={...d.state,disabled:d.disabled||h.disabled},y=R.useRef(null),b=V9({id:g??a,native:u});return rt("label",e,{ref:[n,y],state:m,props:[b,c],stateAttributesMapping:Eu})}),mW={...Eu,...$o},yW=R.forwardRef(function(e,n){const{render:r,id:i,className:s,match:a,style:u,...c}=e,d=Hr(i),{validityData:h,state:g,name:m}=Uo(!1),{setMessageIds:y}=Ts(),{errors:b}=Mu(),x=m&&Object.hasOwn(b,m)?b[m]:null,S=!!(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=S||h.state.valid===!1;const{mounted:E,transitionStatus:M,setMounted:k}=pl(T);Oe(()=>{if(!(!T||!d))return y(j=>j.concat(d)),()=>{y(j=>j.filter(q=>q!==d))}},[T,d,y]);const D=R.useRef(null),[O,I]=R.useState(null),[L,_]=R.useState(null);let N=h.error;!C&&S?N=x:h.errors.length>1&&(N=h.errors);let B=N;Array.isArray(N)&&(B=N.length>1?A.jsx("ul",{children:N.map(j=>A.jsx("li",{children:j},j))}):N[0]);const H=Array.isArray(N)?JSON.stringify(N):N;T&&H!==L&&(_(H),I(B)),ci({open:T,ref:D,onComplete(){T||k(!1)}});const F={...g,transitionStatus:M},G=rt("div",e,{ref:[n,D],state:F,props:[{id:d,children:T?B:O},c],stateAttributesMapping:mW,enabled:E});return E?G:null}),vW=R.forwardRef(function(e,n){const{render:r,id:i,className:s,style:a,...u}=e,c=Hr(i),d=Uo(!1),h=zN(),{setMessageIds:g}=Ts(),m={...d.state,disabled:d.disabled||h.disabled};return Oe(()=>{if(c)return g(b=>b.concat(c)),()=>{g(b=>b.filter(x=>x!==c))}},[c,g]),rt("p",e,{ref:n,state:m,props:[{id:c},u],stateAttributesMapping:Eu})}),bW=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:S,setTouched:C,setDirty:T,validityData:E,setFocused:M,setFilled:k,validationMode:D,validation:O}=Uo(),{clearErrors:I}=Mu(),L=S||c,_=x??a,N={...b,disabled:L},{labelId:B}=Ts(),H=iy({id:s});Oe(()=>{const Z=u!=null;O.inputRef.current?.value||Z&&u!==""?k(!0):Z&&u===""&&k(!1)},[O.inputRef,k,u]);const F=R.useRef(null);Oe(()=>{g&&F.current===ir(vt(F.current))&&M(!0)},[g,M]);const[G]=Ss({controlled:u,default:h,name:"FieldControl",state:"value"}),j=u!==void 0,q=j?G:void 0,$=Ae(()=>O.inputRef.current?.value);return w1(O.inputRef,H,q,$,!L,a),rt("input",e,{ref:[n,F],state:N,props:[{id:H,disabled:L,name:_,ref:O.inputRef,"aria-labelledby":B,autoFocus:g,...j?{value:q}:{defaultValue:h},onChange(Z){const z=Z.currentTarget.value;d?.(z,Ue(gr,Z.nativeEvent)),T(z!==(E.initialValue??"")),k(z!==""),Z.nativeEvent.defaultPrevented||(I(_),O.change(z))},onFocus(){M(!0)},onBlur(Z){C(!0),M(!1),D==="onBlur"&&O.commit(Z.currentTarget.value)},onKeyDown(Z){Z.currentTarget.tagName==="INPUT"&&Z.key==="Enter"&&(C(!0),O.commit(Z.currentTarget.value))}},y,Z=>O.getValidationProps(L,Z)],stateAttributesMapping:Eu})}),xW=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 S=[];for(const C of h.values())C.disabled&&!C.focusableWhenDisabled&&S.push(C.index);return S},[h]),y=R.useMemo(()=>({disabled:r,orientation:s}),[r,s]),b={disabled:r,orientation:s},x={"aria-orientation":s,role:"toolbar"};return A.jsx(dz.Provider,{value:y,children:A.jsx(A1,{render:u,className:a,style:c,state:b,refs:[n],props:[x,d],disabledIndices:m,loopFocus:i,onMapChange:g,orientation:s})})}),SW=R.forwardRef(function(e,n){const{className:r,disabled:i=!1,render:s,style:a,...u}=e,{orientation:c,disabled:d}=uh(),h=d||i,g=R.useMemo(()=>({disabled:h}),[h]),y=rt("div",e,{state:{disabled:h,orientation:c},ref:n,props:[{role:"group"},u]});return A.jsx(IN.Provider,{value:g,children:y})}),wW=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}=uh(),m=DN(),y=h||(m?.disabled??!1)||i,b=R.useMemo(()=>({disabled:y,focusableWhenDisabled:s}),[y,s]),{getButtonProps:x,buttonRef:S}=Vi({disabled:y,focusableWhenDisabled:s,native:u}),C={disabled:y,orientation:g,focusable:s};return A.jsx(f1,{tag:"button",render:a,className:r,style:c,metadata:b,state:C,refs:[n,S],props:[d,a?{disabled:y}:gn,x]})});function na(t,e){return typeof t=="function"?t(e):t}function Hi(t,e){return n=>{e.setState(r=>({...r,[t]:na(n,r[t])}))}}function ly(t){return t instanceof Function}function CW(t){return Array.isArray(t)&&t.every(e=>typeof e=="number")}function RW(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 TW(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 EW(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 Kr="debugHeaders";function UO(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 MW={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 tg(e,[...u,...d,...c],t)},pt(t.options,Kr)),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))),tg(e,n,t,"center")),pt(t.options,Kr)),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 tg(e,s,t,"left")},pt(t.options,Kr)),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 tg(e,s,t,"right")},pt(t.options,Kr)),t.getFooterGroups=ht(()=>[t.getHeaderGroups()],e=>[...e].reverse(),pt(t.options,Kr)),t.getLeftFooterGroups=ht(()=>[t.getLeftHeaderGroups()],e=>[...e].reverse(),pt(t.options,Kr)),t.getCenterFooterGroups=ht(()=>[t.getCenterHeaderGroups()],e=>[...e].reverse(),pt(t.options,Kr)),t.getRightFooterGroups=ht(()=>[t.getRightHeaderGroups()],e=>[...e].reverse(),pt(t.options,Kr)),t.getFlatHeaders=ht(()=>[t.getHeaderGroups()],e=>e.map(n=>n.headers).flat(),pt(t.options,Kr)),t.getLeftFlatHeaders=ht(()=>[t.getLeftHeaderGroups()],e=>e.map(n=>n.headers).flat(),pt(t.options,Kr)),t.getCenterFlatHeaders=ht(()=>[t.getCenterHeaderGroups()],e=>e.map(n=>n.headers).flat(),pt(t.options,Kr)),t.getRightFlatHeaders=ht(()=>[t.getRightHeaderGroups()],e=>e.map(n=>n.headers).flat(),pt(t.options,Kr)),t.getCenterLeafHeaders=ht(()=>[t.getCenterFlatHeaders()],e=>e.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),pt(t.options,Kr)),t.getLeftLeafHeaders=ht(()=>[t.getLeftFlatHeaders()],e=>e.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),pt(t.options,Kr)),t.getRightLeafHeaders=ht(()=>[t.getRightFlatHeaders()],e=>e.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),pt(t.options,Kr)),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,Kr))}};function tg(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(S=>{const C=[...x].reverse()[0],T=S.column.depth===b.depth;let E,M=!1;if(T&&S.column.parent?E=S.column.parent:(E=S.column,M=!0),C&&C?.column===E)C.subHeaders.push(S);else{const k=UO(n,E,{id:[r,y,E.id,S?.id].filter(Boolean).join("_"),isPlaceholder:M,placeholderId:M?`${x.filter(D=>D.column===E).length}`:void 0,depth:y,index:x.length});k.subHeaders.push(S),x.push(k)}b.headers.push(S),S.headerGroup=b}),c.push(b),y>0&&d(x,y-1)},h=e.map((m,y)=>UO(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,S=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 S=S+T,b.colSpan=x,b.rowSpan=S,{colSpan:x,rowSpan:S}});return g((i=(s=c[0])==null?void 0:s.headers)!=null?i:[]),c}const AW=(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:()=>RW(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=>TW(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},OW={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()}}},NN=(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))};NN.autoRemove=t=>No(t);const LN=(t,e,n)=>{var r;return!!(!((r=t.getValue(e))==null||(r=r.toString())==null)&&r.includes(n))};LN.autoRemove=t=>No(t);const BN=(t,e,n)=>{var r;return((r=t.getValue(e))==null||(r=r.toString())==null?void 0:r.toLowerCase())===n?.toLowerCase()};BN.autoRemove=t=>No(t);const jN=(t,e,n)=>{var r;return(r=t.getValue(e))==null?void 0:r.includes(n)};jN.autoRemove=t=>No(t);const _N=(t,e,n)=>!n.some(r=>{var i;return!((i=t.getValue(e))!=null&&i.includes(r))});_N.autoRemove=t=>No(t)||!(t!=null&&t.length);const HN=(t,e,n)=>n.some(r=>{var i;return(i=t.getValue(e))==null?void 0:i.includes(r)});HN.autoRemove=t=>No(t)||!(t!=null&&t.length);const VN=(t,e,n)=>t.getValue(e)===n;VN.autoRemove=t=>No(t);const FN=(t,e,n)=>t.getValue(e)==n;FN.autoRemove=t=>No(t);const O1=(t,e,n)=>{let[r,i]=n;const s=t.getValue(e);return s>=r&&s<=i};O1.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]};O1.autoRemove=t=>No(t)||No(t[0])&&No(t[1]);const Js={includesString:NN,includesStringSensitive:LN,equalsString:BN,arrIncludes:jN,arrIncludesAll:_N,arrIncludesSome:HN,equals:VN,weakEquals:FN,inNumberRange:O1};function No(t){return t==null||t===""}const kW={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:t=>({columnFilters:[],...t}),getDefaultOptions:t=>({onColumnFiltersChange:Hi("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"?Js.includesString:typeof r=="number"?Js.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?Js.equals:Array.isArray(r)?Js.arrIncludes:Js.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:Js[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=na(n,s?s.value:void 0);if(qO(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=na(e,i))==null?void 0:s.filter(a=>{const u=n.find(c=>c.id===a.id);if(u){const c=u.getFilterFn();if(qO(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 qO(t,e,n){return(t&&t.autoRemove?t.autoRemove(e,n):!1)||typeof e>"u"||typeof e=="string"&&!e}const IW=(t,e,n)=>n.reduce((r,i)=>{const s=i.getValue(t);return r+(typeof s=="number"?s:0)},0),DW=(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},PW=(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},zW=(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]},NW=(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},LW=(t,e)=>{if(!e.length)return;const n=e.map(s=>s.getValue(t));if(!CW(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},BW=(t,e)=>Array.from(new Set(e.map(n=>n.getValue(t))).values()),jW=(t,e)=>new Set(e.map(n=>n.getValue(t))).size,_W=(t,e)=>e.length,Sb={sum:IW,min:DW,max:PW,extent:zW,mean:NW,median:LW,unique:BW,uniqueCount:jW,count:_W},HW={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:Hi("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 Sb.sum;if(Object.prototype.toString.call(r)==="[object Date]")return Sb.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:Sb[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 VW(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 FW={getInitialState:t=>({columnOrder:[],...t}),getDefaultOptions:t=>({onColumnOrderChange:Hi("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 VW(s,n,r)},pt(t.options,"debugTable"))}},wb=()=>({left:[],right:[]}),$W={getInitialState:t=>({columnPinning:wb(),...t}),getDefaultOptions:t=>({onColumnPinningChange:Hi("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?wb():(n=(r=t.initialState)==null?void 0:r.columnPinning)!=null?n:wb())},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 UW(t){return t||(typeof document<"u"?document:null)}const ng={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},Cb=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),qW={getDefaultColumnDef:()=>ng,getInitialState:t=>({columnSizing:{},columnSizingInfo:Cb(),...t}),getDefaultOptions:t=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Hi("columnSizing",t),onColumnSizingInfoChange:Hi("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:ng.minSize,(r=s??t.columnDef.size)!=null?r:ng.size),(i=t.columnDef.maxSize)!=null?i:ng.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(),Rb(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=Rb(s)?Math.round(s.touches[0].clientX):s.clientX,d={},h=(C,T)=>{typeof T=="number"&&(e.setColumnSizingInfo(E=>{var M,k;const D=e.options.columnResizeDirection==="rtl"?-1:1,O=(T-((M=E?.startOffset)!=null?M:0))*D,I=Math.max(O/((k=E?.startSize)!=null?k:0),-.999999);return E.columnSizingStart.forEach(L=>{let[_,N]=L;d[_]=Math.round(Math.max(N+N*I,0)*100)/100}),{...E,deltaOffset:O,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=UW(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)}},S=GW()?{passive:!1}:!1;Rb(s)?(y?.addEventListener("touchmove",x.moveHandler,S),y?.addEventListener("touchend",x.upHandler,S)):(y?.addEventListener("mousemove",b.moveHandler,S),y?.addEventListener("mouseup",b.upHandler,S)),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?Cb():(n=t.initialState.columnSizingInfo)!=null?n:Cb())},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 rg=null;function GW(){if(typeof rg=="boolean")return rg;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 rg=t,rg}function Rb(t){return t.type==="touchstart"}const WW={getInitialState:t=>({columnVisibility:{},...t}),getDefaultOptions:t=>({onColumnVisibilityChange:Hi("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 KW={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()}}},YW={getInitialState:t=>({globalFilter:void 0,...t}),getDefaultOptions:t=>({onGlobalFilterChange:Hi("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=()=>Js.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:Js[r]},t.setGlobalFilter=e=>{t.options.onGlobalFilterChange==null||t.options.onGlobalFilterChange(e)},t.resetGlobalFilter=e=>{t.setGlobalFilter(e?void 0:t.initialState.globalFilter)}}},XW={getInitialState:t=>({expanded:{},...t}),getDefaultOptions:t=>({onExpandedChange:Hi("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()}}}},oS=0,sS=10,Tb=()=>({pageIndex:oS,pageSize:sS}),QW={getInitialState:t=>({...t,pagination:{...Tb(),...t?.pagination}}),getDefaultOptions:t=>({onPaginationChange:Hi("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=>na(r,s);return t.options.onPaginationChange==null?void 0:t.options.onPaginationChange(i)},t.resetPagination=r=>{var i;t.setPagination(r?Tb():(i=t.initialState.pagination)!=null?i:Tb())},t.setPageIndex=r=>{t.setPagination(i=>{let s=na(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?oS:(i=(s=t.initialState)==null||(s=s.pagination)==null?void 0:s.pageIndex)!=null?i:oS)},t.resetPageSize=r=>{var i,s;t.setPageSize(r?sS:(i=(s=t.initialState)==null||(s=s.pagination)==null?void 0:s.pageSize)!=null?i:sS)},t.setPageSize=r=>{t.setPagination(i=>{const s=Math.max(1,na(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=na(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}}},Eb=()=>({top:[],bottom:[]}),ZW={getInitialState:t=>({rowPinning:Eb(),...t}),getDefaultOptions:t=>({onRowPinningChange:Hi("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?Eb():(n=(r=t.initialState)==null?void 0:r.rowPinning)!=null?n:Eb())},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"))}},JW={getInitialState:t=>({rowSelection:{},...t}),getDefaultOptions:t=>({onRowSelectionChange:Hi("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=>{lS(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?Mb(t,n):{rows:[],flatRows:[],rowsById:{}},pt(t.options,"debugTable")),t.getFilteredSelectedRowModel=ht(()=>[t.getState().rowSelection,t.getFilteredRowModel()],(e,n)=>Object.keys(e).length?Mb(t,n):{rows:[],flatRows:[],rowsById:{}},pt(t.options,"debugTable")),t.getGroupedSelectedRowModel=ht(()=>[t.getState().rowSelection,t.getSortedRowModel()],(e,n)=>Object.keys(e).length?Mb(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 lS(u,t.id,n,(a=r?.selectChildren)!=null?a:!0,e),u})},t.getIsSelected=()=>{const{rowSelection:n}=e.getState();return k1(t,n)},t.getIsSomeSelected=()=>{const{rowSelection:n}=e.getState();return aS(t,n)==="some"},t.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=e.getState();return aS(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)}}}},lS=(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=>lS(t,u.id,n,r,i))};function Mb(t,e){const n=t.getState().rowSelection,r=[],i={},s=function(a,u){return a.map(c=>{var d;const h=k1(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 k1(t,e){var n;return(n=e[t.id])!=null?n:!1}function aS(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()&&(k1(a,e)?s=!0:i=!1),a.subRows&&a.subRows.length)){const u=aS(a,e);u==="all"?s=!0:(u==="some"&&(s=!0),i=!1)}}),i?"all":s?"some":!1}const uS=/([0-9]+)/gm,e7=(t,e,n)=>$N(pa(t.getValue(n)).toLowerCase(),pa(e.getValue(n)).toLowerCase()),t7=(t,e,n)=>$N(pa(t.getValue(n)),pa(e.getValue(n))),n7=(t,e,n)=>I1(pa(t.getValue(n)).toLowerCase(),pa(e.getValue(n)).toLowerCase()),r7=(t,e,n)=>I1(pa(t.getValue(n)),pa(e.getValue(n))),i7=(t,e,n)=>{const r=t.getValue(n),i=e.getValue(n);return r>i?1:r<i?-1:0},o7=(t,e,n)=>I1(t.getValue(n),e.getValue(n));function I1(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 $N(t,e){const n=t.split(uS).filter(Boolean),r=e.split(uS).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:e7,alphanumericCaseSensitive:t7,text:n7,textCaseSensitive:r7,datetime:i7,basic:o7},s7={getInitialState:t=>({sorting:[],...t}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:t=>({onSortingChange:Hi("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(uS).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())}},l7=[MW,WW,FW,$W,OW,kW,KW,YW,s7,HW,XW,QW,ZW,JW,qW];function a7(t){var e,n;const r=[...l7,...(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=na(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,S;return(x=(S=b.renderValue())==null||S.toString==null?void 0:S.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,S){return S===void 0&&(S=0),b.map(C=>{const T=EW(i,C,S,x),E=C;return T.columns=E.columns?y(E.columns,T,S+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 u7(){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=AW(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 c7(){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],S=x.sortUndefined,C=(m=b?.desc)!=null?m:!1;let T=0;if(S){const E=h.getValue(b.id),M=g.getValue(b.id),k=E===void 0,D=M===void 0;if(k||D){if(S==="first")return k?-1:1;if(S==="last")return k?1:-1;T=k&&D?0:k?S:-S}}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 Ab(t,e){return t?f7(t)?R.createElement(t,e):t:null}function f7(t){return d7(t)||typeof t=="function"||h7(t)}function d7(t){return typeof t=="function"&&(()=>{const e=Object.getPrototypeOf(t);return e.prototype&&e.prototype.isReactComponent})()}function h7(t){return typeof t=="object"&&typeof t.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(t.$$typeof.description)}function p7(t){const e={state:{},onStateChange:()=>{},renderFallbackValue:null,...t},[n]=R.useState(()=>({current:a7(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,Ca=1,Zc=2,UN=4;function GO(t){return()=>t}function g7(t){t()}function Ld(t,e){return n=>t(e(n))}function WO(t,e){return()=>t(e)}function m7(t,e){return n=>t(e,n)}function D1(t){return t!==void 0}function y7(...t){return()=>{t.map(g7)}}function Jc(){}function uy(t,e){return e(t),t}function v7(t,e){return e(t)}function Bn(...t){return t}function fn(t,e){return t(Ca,e)}function Mt(t,e){t(ay,e)}function P1(t){t(Zc)}function Hn(t){return t(UN)}function tt(t,e){return fn(t,m7(e,ay))}function Lo(t,e){const n=t(Ca,r=>{n(),e(r)});return n}function KO(t){let e,n;return r=>i=>{e=i,n&&clearTimeout(n),n=setTimeout(()=>{r(e)},t)}}function qN(t,e){return t===e}function Nn(t=qN){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 ke(t,...e){const n=b7(...e);return((r,i)=>{switch(r){case Zc:P1(t);return;case Ca:return fn(t,n(i))}})}function ys(t,e){return n=>r=>{n(e=t(e,r))}}function yu(t){return e=>n=>{t>0?t--:e(n)}}function tl(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 b7(...t){return e=>t.reduceRight(v7,e)}function x7(t){let e,n;const r=()=>e?.();return function(i,s){switch(i){case Ca:return s?n===s?void 0:(r(),n=s,e=fn(t,s),e):(r(),Jc);case Zc:r(),n=null;return}}}function Le(t){let e=t;const n=$t();return((r,i)=>{switch(r){case ay:e=i;break;case Ca:{i(e);break}case UN:return e}return n(r,i)})}function Qr(t,e){return uy(Le(e),n=>tt(t,n))}function $t(){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 Ca:return t.push(n),()=>{const r=t.indexOf(n);r>-1&&t.splice(r,1)}}})}function ji(t){return uy($t(),e=>tt(t,e))}function en(t,e=[],{singleton:n}={singleton:!0}){return{constructor:t,dependencies:e,id:S7(),singleton:n}}const S7=()=>Symbol();function w7(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 mr(...t){const e=$t(),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:{P1(e);return}case Ca:return r===i&&a(n),fn(e,a)}}}function ct(t,e=qN){return ke(t,Nn(e))}function cS(...t){return function(e,n){switch(e){case Zc:return;case Ca:return y7(...t.map(r=>fn(r,n)))}}}const Cr={DEBUG:0,INFO:1,WARN:2,ERROR:3},C7={[Cr.DEBUG]:"debug",[Cr.ERROR]:"error",[Cr.INFO]:"log",[Cr.WARN]:"warn"},R7=()=>typeof globalThis>"u"?window:globalThis,Ra=en(()=>{const t=Le(Cr.ERROR);return{log:Le((e,n,r=Cr.INFO)=>{const i=R7().VIRTUOSO_LOG_LEVEL??Hn(t);r>=i&&console[C7[r]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",e,n)}),logLevel:t}},[],{singleton:!0}),fS=new WeakMap;function GN(t){return"self"in t?t.document.documentElement:t}function T7(t){const e=GN(t),n=fS.get(e);if(n!==void 0)return n;const r=e.ownerDocument.defaultView.getComputedStyle(e).direction==="rtl";return fS.set(e,r),r}function YO(t){fS.delete(GN(t))}function WN(t,e){return T7(t)?-e:e}const nu=WN;function XO(t,e){return WN(t,e)}function Rs(t,e,n){return z1(t,e,n).callbackRef}function z1(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 KN(t,e,n,r,i,s,a,u,c){const d=Ve.useCallback(h=>{const g=E7(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,S=a?u?a.offsetWidth:a.offsetHeight:y?u?b.innerWidth:b.innerHeight:u?m.offsetWidth:m.offsetHeight,C=a?u?nu(a,a.scrollLeft):a.scrollTop:y?u?nu(b,b.scrollX||b.document.documentElement.scrollLeft):b.scrollY||b.document.documentElement.scrollTop:u?nu(m,m.scrollLeft):m.scrollTop;r({scrollHeight:x,scrollTop:Math.max(C,0),viewportHeight:S}),s?.(u?QO("column-gap",getComputedStyle(h).columnGap,i):QO("row-gap",getComputedStyle(h).rowGap,i)),g!==null&&t(g)},[t,e,i,s,a,r,u]);return z1(d,n,c)}function E7(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 QO(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 N1(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}=z1(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 fi=en(()=>{const t=$t(),e=$t(),n=Le(0),r=$t(),i=Le(0),s=$t(),a=$t(),u=Le(0),c=Le(0),d=Le(0),h=Le(0),g=$t(),m=$t(),y=Le(!1),b=Le(!1),x=Le(!1);return tt(ke(t,We(({scrollTop:S})=>S)),e),tt(ke(t,We(({scrollHeight:S})=>S)),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 YN(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 Li(t,e,n){return Cn(t)?ZN(e,n,1):e===t.k?xr(t,{k:e,v:n}):e<t.k?ZO(xr(t,{l:Li(t.l,e,n)})):ZO(xr(t,{r:Li(t.r,e,n)}))}function Sc(){return Bd}function wc(t,e,n){if(Cn(t))return[];const r=jo(t,e)[0];return M7(hS(t,r,n))}function dS(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]=QN(r);return Ng(xr(t,{k:s,l:XN(r),v:a}))}return e<n?Ng(xr(t,{l:dS(r,e)})):Ng(xr(t,{r:dS(i,e)}))}function ru(t){return Cn(t)?[]:[...ru(t.l),{k:t.k,v:t.v},...ru(t.r)]}function hS(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(hS(i,e,n))),r>=e&&r<=n&&u.push({k:r,v:a}),r<=n&&(u=u.concat(hS(s,e,n))),u}function Ng(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(Ob(e))return JN(xr(t,{lvl:n-1}));if(!Cn(e)&&!Cn(e.r))return xr(e.r,{l:xr(e,{r:e.r.l}),lvl:n,r:xr(t,{l:e.r.r,lvl:n-1})});throw new Error("Unexpected empty nodes")}if(Ob(t))return pS(xr(t,{lvl:n-1}));if(!Cn(r)&&!Cn(r.l)){const i=r.l,s=Ob(i)?r.lvl-1:r.lvl;return xr(i,{l:xr(t,{lvl:n-1,r:i.l}),lvl:i.lvl+1,r:pS(xr(r,{l:i.r,lvl:s}))})}throw new Error("Unexpected empty nodes")}function xr(t,e){return ZN(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 XN(t){return Cn(t.r)?t.l:Ng(xr(t,{r:XN(t.r)}))}function Ob(t){return Cn(t)||t.lvl>t.r.lvl}function QN(t){return Cn(t.r)?[t.k,t.v]:QN(t.r)}function ZN(t,e,n,r=Bd,i=Bd){return{k:t,l:r,lvl:n,r:i,v:e}}function ZO(t){return pS(JN(t))}function JN(t){const{l:e}=t;return!Cn(e)&&e.lvl===t.lvl?xr(e,{r:xr(t,{l:e.r})}):t}function pS(t){const{lvl:e,r:n}=t;return!Cn(n)&&!Cn(n.r)&&n.lvl===e&&n.r.lvl===e?xr(n,{l:xr(t,{r:n.l}),lvl:e+1}):t}function M7(t){return YN(t,({k:e,v:n})=>({index:e,value:n}))}function eL(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 L1=en(()=>({recalcInProgress:Le(!1)}),[],{singleton:!0});function tL(t,e,n){return t[am(t,e,n)]}function am(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 A7(t,e,n,r){const i=am(t,e,r),s=am(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 B1({index:t},e){return e===t?0:e<t?-1:1}function O7(){return{groupIndices:[],groupOffsetTree:Sc(),lastIndex:0,lastOffset:0,lastSize:0,offsetTree:[],sizeTree:Sc()}}function k7(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=Li(t,0,s);continue}const u=wc(t,a-1,i+1);if(u.some(B7(r)))continue;let c=!1,d=!1;for(const{end:h,start:g,value:m}of u)c?(i>=g||s===m)&&(t=dS(t,g)):(d=m!==s,c=!0),h>i&&i>=g&&m!==s&&(t=Li(t,i+1,m));d&&(t=Li(t,a,s))}return[t,n]}function I7(t){return typeof t.groupIndex<"u"}function D7({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}=tL(e,t,B1),a=t-r,u=s*a+(a-1)*n+i;return u>0?u+n:u}function nL(t,e){if(!cy(e))return t;let n=0;for(;e.groupIndices[n]<=t+n;)n++;return t+n}function rL(t,e,n){if(I7(t))return e.groupIndices[t.groupIndex]+1;const r=t.index==="LAST"?n:t.index;let i=nL(r,e);return i=Math.max(0,i,Math.min(n,i)),i}function P7(t,e,n,r=0){return r>0&&(e=Math.max(e,tL(t,r,B1).offset)),YN(A7(t,e,n,D7),L7)}function z7(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)=>Li(Li(b,x,m),x+1,y),a)}else[a,u]=k7(a,e);if(a===s)return t;const{lastIndex:c,lastOffset:d,lastSize:h,offsetTree:g}=gS(t.offsetTree,u,a,i);return{groupIndices:n,groupOffsetTree:n.reduce((m,y)=>Li(m,y,Hd(y,g,i)),Sc()),lastIndex:c,lastOffset:d,lastSize:h,offsetTree:g,sizeTree:a}}function N7(t){return ru(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 JO(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 gS(t,e,n,r){let i=t,s=0,a=0,u=0,c=0;if(e!==0){c=am(i,e-1,B1),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 wc(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 L7(t){return{index:t.index,value:t}}function B7(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 j7={offsetHeight:"height",offsetWidth:"width"},Es=en(([{log:t},{recalcInProgress:e}])=>{const n=$t(),r=$t(),i=Qr(r,0),s=$t(),a=$t(),u=Le(0),c=Le([]),d=Le(void 0),h=Le(void 0),g=Le(void 0),m=Le(void 0),y=Le((O,I)=>_o(O,j7[I])),b=Le(void 0),x=Le(0),S=O7(),C=Qr(ke(n,kt(c,t,x),ys(z7,S),Nn()),S),T=Qr(ke(c,Nn(),ys((O,I)=>({current:I,prev:O.current}),{current:[],prev:[]}),We(({prev:O})=>O)),[]);tt(ke(c,ft(O=>O.length>0),kt(C,x),We(([O,I,L])=>{const _=O.reduce((N,B,H)=>Li(N,B,Hd(B,I.offsetTree,L)||H),Sc());return{...I,groupIndices:O,groupOffsetTree:_}})),C),tt(ke(r,kt(C),ft(([O,{lastIndex:I}])=>O<I),We(([O,{lastIndex:I,lastSize:L}])=>[{endIndex:I,size:L,startIndex:O}])),n),tt(d,h);const E=Qr(ke(d,We(O=>O===void 0)),!0);tt(ke(h,ft(O=>O!==void 0&&Cn(Hn(C).sizeTree)),We(O=>{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:O,startIndex:1}]:[]:[{endIndex:0,size:O,startIndex:0}]})),n),tt(ke(m,ft(O=>O!==void 0&&O.length>0&&Cn(Hn(C).sizeTree)),We(O=>{const I=[];let L=O[0],_=0;for(let N=1;N<O.length;N++){const B=O[N];B!==L&&(I.push({endIndex:N-1,size:L,startIndex:_}),L=B,_=N)}return I.push({endIndex:O.length-1,size:L,startIndex:_}),I})),n),tt(ke(c,kt(g,h),ft(([,O,I])=>O!==void 0&&I!==void 0),We(([O,I,L])=>{const _=[];for(let N=0;N<O.length;N++){const B=O[N],H=O[N+1];_.push({startIndex:B,endIndex:B,size:I}),H!==void 0&&_.push({startIndex:B+1,endIndex:H-1,size:L})}return _})),n);const M=ji(ke(n,kt(C),ys(({sizes:O},[I,L])=>({changed:L!==O,sizes:L}),{changed:!1,sizes:S}),We(O=>O.changed)));fn(ke(u,ys((O,I)=>({diff:O.prev-I,prev:I}),{diff:0,prev:0}),We(O=>O.diff)),O=>{const{groupIndices:I}=Hn(C);if(O>0)Mt(e,!0),Mt(s,O+JO(O,I));else if(O<0){const L=Hn(T);L.length>0&&(O-=JO(-O,L)),Mt(a,O)}}),fn(ke(u,kt(t)),([O,I])=>{O<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=ji(s);tt(ke(s,kt(C),We(([O,I])=>{const L=I.groupIndices.length>0,_=[],N=I.lastSize;if(L){const B=jd(I.sizeTree,0);let H=0,F=0;for(;H<O;){const j=I.groupIndices[F],q=I.groupIndices.length===F+1?1/0:I.groupIndices[F+1]-j-1;_.push({endIndex:j,size:B,startIndex:j}),_.push({endIndex:j+1+q-1,size:N,startIndex:j+1}),F++,H+=q+1}const G=ru(I.sizeTree);return H!==O&&G.shift(),G.reduce((j,{k:q,v:$})=>{let X=j.ranges;return j.prevSize!==0&&(X=[...j.ranges,{endIndex:q+O-1,size:j.prevSize,startIndex:j.prevIndex}]),{prevIndex:q+O,prevSize:$,ranges:X}},{prevIndex:O,prevSize:0,ranges:_}).ranges}return ru(I.sizeTree).reduce((B,{k:H,v:F})=>({prevIndex:H+O,prevSize:F,ranges:[...B.ranges,{endIndex:H+O-1,size:B.prevSize,startIndex:B.prevIndex}]}),{prevIndex:0,prevSize:N,ranges:[]}).ranges})),n);const D=ji(ke(a,kt(C,x),We(([O,{offsetTree:I},L])=>{const _=-O;return Hd(_,I,L)})));return tt(ke(a,kt(C,x),We(([O,I,L])=>{if(I.groupIndices.length>0){if(Cn(I.sizeTree))return I;let N=Sc();const B=Hn(T);let H=0,F=0,G=0;for(;H<-O;){G=B[F];const j=B[F+1]-G-1;F++,H+=j+1}if(N=ru(I.sizeTree).reduce((j,{k:q,v:$})=>Li(j,Math.max(0,q+O),$),N),H!==-O){const j=jd(I.sizeTree,G);N=Li(N,0,j);const q=jo(I.sizeTree,-O+1)[1];N=Li(N,1,q)}return{...I,sizeTree:N,...gS(I.offsetTree,0,N,L)}}const _=ru(I.sizeTree).reduce((N,{k:B,v:H})=>Li(N,Math.max(0,B+O),H),Sc());return{...I,sizeTree:_,...gS(I.offsetTree,0,_,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:D,sizeRanges:n,sizes:C,statefulTotalCount:i,totalCount:r,trackItemSizes:E,unshiftWith:s}},Bn(Ra,L1),{singleton:!0});function _7(t){return t.reduce((e,n)=>(e.groupIndices.push(e.totalCount),e.totalCount+=n+1,e),{groupIndices:[],totalCount:0})}const iL=en(([{groupIndices:t,sizes:e,totalCount:n},{headerHeight:r,scrollTop:i}])=>{const s=$t(),a=$t(),u=ji(ke(s,We(_7)));return tt(ke(u,We(c=>c.totalCount)),n),tt(ke(u,We(c=>c.groupIndices)),t),tt(ke(mr(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(Es,fi)),Ta=en(([{log:t}])=>{const e=Le(!1),n=ji(ke(e,ft(r=>r),Nn()));return fn(e,r=>{r&&Hn(t)("props updated",{},Cr.DEBUG)}),{didMount:n,propsReady:e}},Bn(Ra),{singleton:!0}),H7=typeof document<"u"&&"scrollBehavior"in document.documentElement.style;function oL(t){const e=typeof t=="number"?{index:t}:t;return e.align||(e.align="start"),(!e.behavior||!H7)&&(e.behavior="auto"),e.offset===void 0&&(e.offset=0),e}const dh=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=$t(),b=$t(),x=Le(0);let S=null,C=null,T=null;function E(){S!==null&&(S(),S=null),T!==null&&(T(),T=null),C&&(clearTimeout(C),C=null),Mt(c,!1)}return tt(ke(y,kt(n,g,r,x,u,a,m),kt(t,s,i),We(([[M,k,D,O,I,L,_,N],B,H,F])=>{const G=oL(M),{align:j,behavior:q,offset:$}=G,X=O-1,Z=rL(G,k,X);let z=Hd(Z,k.offsetTree,B)+L;j==="end"?(z+=H+jo(k.sizeTree,Z)[1]-D+F,Z===X&&(z+=_)):j==="center"?z+=(H+jo(k.sizeTree,Z)[1]-D+F)/2:z-=I,$!==void 0&&$!==0&&(z+=$);const U=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}),S=Lo(h,()=>{U(W)})}else S=Lo(ke(e,V7(150)),U);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(Es,fi,Ra),{singleton:!0});function V7(t){return e=>{const n=setTimeout(()=>{e(!1)},t);return r=>{r&&(e(!0),clearTimeout(n))}}}function j1(t,e){t===0?e():requestAnimationFrame(()=>{j1(t-1,e)})}function _1(t,e){const n=e-1;return typeof t=="number"?t:t.index==="LAST"?n:t.index}const hh=en(([{defaultItemSize:t,listRefresh:e,sizes:n},{scrollTop:r},{scrollTargetReached:i,scrollToIndex:s},{didMount:a}])=>{const u=Le(!0),c=Le(0),d=Le(!0);return tt(ke(a,kt(c),ft(([h,g])=>g!==0),fs(!1)),u),tt(ke(a,kt(c),ft(([h,g])=>g!==0),fs(!1)),d),fn(ke(mr(e,a),kt(u,n,t,d),ft(([[,h],g,{sizeTree:m},y,b])=>h&&(!Cn(m)||D1(y))&&!g&&!b),kt(c)),([,h])=>{Lo(i,()=>{Mt(d,!0)}),j1(4,()=>{Lo(r,()=>{Mt(u,!0)}),Mt(s,h)})}),{initialItemFinalLocationReached:d,initialTopMostItemIndex:c,scrolledToInitialItem:u}},Bn(Es,fi,dh,Ta),{singleton:!0});function sL(t,e){return Math.abs(t-e)<1.01}const Vd="up",md="down",F7="none",$7={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollHeight:0,scrollTop:0,viewportHeight:0}},U7=0,ph=en(([{footerHeight:t,headerHeight:e,scrollBy:n,scrollContainerState:r,scrollTop:i,viewportHeight:s}])=>{const a=Le(!1),u=Le(!0),c=$t(),d=$t(),h=Le(4),g=Le(U7),m=Qr(ke(cS(ke(ct(i),yu(1),fs(!0)),ke(ct(i),yu(1),fs(!1),KO(100))),Nn()),!1),y=Qr(ke(cS(ke(n,fs(!0)),ke(n,fs(!1),KO(200))),Nn()),!1);tt(ke(mr(ct(i),ct(g)),We(([T,E])=>T<=E),Nn()),u),tt(ke(u,tl(50)),d);const b=ji(ke(mr(r,ct(s),ct(e),ct(t),ct(h)),ys((T,[{scrollHeight:E,scrollTop:M},k,D,O,I])=>{const L=M+k-E>-I,_={scrollHeight:E,scrollTop:M,viewportHeight:k};if(L){let B,H;return M>T.state.scrollTop?(B="SCROLLED_DOWN",H=T.state.scrollTop-M):(B="SIZE_DECREASED",H=T.state.scrollTop-M||T.scrollTopDelta),{atBottom:!0,atBottomBecause:B,scrollTopDelta:H,state:_}}let N;return _.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:_}},$7),Nn((T,E)=>T!==void 0&&T.atBottom===E.atBottom))),x=Qr(ke(r,ys((T,{scrollHeight:E,scrollTop:M,viewportHeight:k})=>{if(!sL(T.scrollHeight,E)){const D=E-(M+k)<1;return T.scrollTop!==M&&D?{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(ke(b,We(T=>T.atBottom)),a),tt(ke(a,tl(50)),c);const S=Le(md);tt(ke(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)),S),tt(ke(r,tl(50),fs(F7)),S);const C=Le(0);return tt(ke(m,ft(T=>!T),fs(0)),C),tt(ke(i,tl(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:S,scrollVelocity:C}},Bn(fi)),Fd="top",$d="bottom",ek="none";function tk(t,e,n){return typeof t=="number"?n===Vd&&e===Fd||n===md&&e===$d?t:0:n===Vd?e===Fd?t.main:t.reverse:e===$d?t.main:t.reverse}function nk(t,e){return typeof t=="number"?t:t[e]??0}const H1=en(([{deviation:t,fixedHeaderHeight:e,headerHeight:n,scrollTop:r,viewportHeight:i}])=>{const s=$t(),a=Le(0),u=Le(0),c=Le(0),d=Qr(ke(mr(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,S,C,T,E])=>{const M=h-T,k=S+C,D=Math.max(m-M,0);let O=ek;const I=nk(E,Fd),L=nk(E,$d);return y-=T,y+=m+C,b+=m+C,b-=T,y>h+k-I&&(O=Vd),b<h-D+g+L&&(O=md),O!==ek?[Math.max(M-m-tk(x,Fd,O)-I,0),M-D-C+g+tk(x,$d,O)+L]:null}),ft(h=>h!==null),Nn(_d)),[0,0]);return{increaseViewportBy:u,listBoundary:s,overscan:c,topListHeight:a,visibleRange:d}},Bn(fi),{singleton:!0});function q7(t,e,n){if(cy(e)){const r=nL(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 kb={bottom:0,firstItemIndex:0,items:[],offsetBottom:0,offsetTop:0,top:0,topItems:[],topListHeight:0,totalCount:0};function Lg(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:rk(t,i,s),offsetBottom:b,offsetTop:d,top:y,topItems:rk(e,i,s),topListHeight:e.reduce((x,S)=>S.size+x,0),totalCount:n}}function lL(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=_1(e,u),d=Array.from({length:u}).map((h,g)=>({data:s[g+c],index:g+c,offset:0,size:0}));return Lg(d,[],u,i,n,r)}function rk(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=wc(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 ik(t,e){return t===void 0?0:typeof t=="number"?t:t[e]??0}const Au=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=Le([]),S=Le(0),C=$t(),T=Le(0);tt(s.topItemsIndexes,x);const E=Qr(ke(mr(y,b,ct(c,_d),ct(i),ct(r),ct(d),h,ct(x),ct(e),ct(n),ct(T),t),ft(([O,I,,L,,,,,,,,_])=>{const N=_!==void 0&&_.length!==L;return O&&!I&&!N}),We(([,,[O,I],L,_,N,B,H,F,G,j,q])=>{const $=_,{offsetTree:X,sizeTree:Z}=$,z=Hn(S);if(L===0)return{...kb,totalCount:L};if(O===0&&I===0)return z===0?{...kb,totalCount:L}:lL(z,N,_,F,G,q||[]);if(Cn(Z))return z>0?null:Lg(q7(_1(N,L),$,q),[],L,G,$,F);const U=[];if(H.length>0){const se=H[0],ve=H[H.length-1];let ye=0;for(const he of wc(Z,se,ve)){const pe=he.value,Te=Math.max(he.start,se),De=Math.min(he.end,ve);for(let Pe=Te;Pe<=De;Pe++)U.push({data:q?.[Pe],index:Pe,offset:ye,size:pe}),ye+=pe}}if(!B)return Lg([],U,L,G,$,F);const W=H.length>0?H[H.length-1]+1:0,K=P7(X,O,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<O){pe+=Math.floor((O-ye.offset+G)/(Te+G));const Pe=pe-ve.start;he+=Pe*Te+Pe*G}pe<W&&(he+=(W-pe)*Te,pe=W);const De=Math.min(ve.end,ie);for(let Pe=pe;Pe<=De&&!(he>=I);Pe++)se.push({data:q?.[Pe],index:Pe,offset:he,size:Te}),he+=Te+G}}),ae=ik(j,Fd),Y=ik(j,$d);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 De=wc(Z,Te,Te)[0]?.value??se.size;pe-=De+G,he.unshift({data:q?.[Te],index:Te,offset:pe,size:De})}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=wc(Z,pe,pe)[0]?.value??ve.size;ee.push({data:q?.[pe],index:pe,offset:he,size:Te}),he+=Te+G}}}return Lg(ee,U,L,G,$,F)}),ft(O=>O!==null),Nn()),kb);tt(ke(t,ft(D1),We(O=>O?.length)),i),tt(ke(E,We(O=>O.topListHeight)),g),tt(g,u),tt(ke(E,We(O=>[O.top,O.bottom])),a),tt(ke(E,We(O=>O.items)),C);const M=ji(ke(E,ft(({items:O})=>O.length>0),kt(i,t),ft(([{items:O},I])=>O[O.length-1].originalIndex===I-1),We(([,O,I])=>[O-1,I]),Nn(_d),We(([O])=>O))),k=ji(ke(E,tl(200),ft(({items:O,topItems:I})=>O.length>0&&O[0].originalIndex===I.length),We(({items:O})=>O[0].index),Nn())),D=ji(ke(E,ft(({items:O})=>O.length>0),We(({items:O})=>{let I=0,L=O.length-1;for(;O[I].type==="group"&&I<L;)I++;for(;O[L].type==="group"&&L>I;)L--;return{endIndex:O[L].index,startIndex:O[I].index}}),Nn(eL)));return{endReached:M,initialItemCount:S,itemsRendered:C,listState:E,minOverscanItemCount:T,rangeChanged:D,startReached:k,topItemsIndexes:x,...m}},Bn(Es,iL,H1,hh,dh,ph,Ta,L1),{singleton:!0}),aL=en(([{fixedFooterHeight:t,fixedHeaderHeight:e,footerHeight:n,headerHeight:r},{listState:i}])=>{const s=$t(),a=Qr(ke(mr(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(fi,Au),{singleton:!0}),G7=en(([{viewportHeight:t},{totalListHeight:e}])=>{const n=Le(!1),r=Qr(ke(mr(n,t,e),ft(([i])=>i),We(([,i,s])=>Math.max(0,i-s)),tl(0),Nn()),0);return{alignToBottom:n,paddingTopAddition:r}},Bn(fi,aL),{singleton:!0}),uL=en(()=>({context:Le(null)})),W7=({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,cL=en(([{gap:t,sizes:e,totalCount:n},{fixedFooterHeight:r,fixedHeaderHeight:i,headerHeight:s,scrollingInProgress:a,scrollTop:u,viewportHeight:c},{scrollToIndex:d}])=>{const h=$t();return tt(ke(h,kt(e,c,n,s,i,r,u),kt(t),We(([[g,m,y,b,x,S,C,T],E])=>{const{calculateViewLocation:M=W7,done:k,...D}=g,O=rL(g,m,b-1),I=Hd(O,m.offsetTree,E)+x+S,L=I+jo(m.sizeTree,O)[1],_=T+S,N=T+y-C,B=M({itemBottom:L,itemTop:I,locationParams:D,viewportBottom:N,viewportTop:_});return B!==null?k&&Lo(ke(a,ft(H=>!H),yu(Hn(a)?1:2)),k):k?.(),B}),ft(g=>g!==null)),d),{scrollIntoView:h}},Bn(Es,fi,dh,Au,Ra),{singleton:!0});function ok(t){return t===!1?!1:t==="smooth"?"smooth":"auto"}const K7=(t,e)=>typeof t=="function"?ok(t(e)):e&&ok(t),Y7=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=Le(!1),x=$t();let S=null;function C(k){Mt(a,{align:"end",behavior:k,index:"LAST"})}fn(ke(mr(ke(ct(e),yu(1)),c),kt(ct(b),s,u,g),We(([[k,D],O,I,L,_])=>{let N=D&&L,B="auto";return N&&(B=K7(O,I||_),N=N&&B!==!1),{followOutputBehavior:B,shouldFollow:N,totalCount:k}}),ft(({shouldFollow:k})=>k)),({followOutputBehavior:k,totalCount:D})=>{S!==null&&(S(),S=null),Hn(n)!==void 0?requestAnimationFrame(()=>{Hn(h)("following output to ",{totalCount:D},Cr.DEBUG),C(k)}):S=Lo(t,()=>{Hn(h)("following output to ",{totalCount:D},Cr.DEBUG),C(k),S=null})});function T(k){const D=Lo(i,O=>{k&&!O.atBottom&&O.notAtBottomBecause==="SIZE_INCREASED"&&S===null&&(Hn(h)("scrolling to bottom due to increased size",{},Cr.DEBUG),C("auto"))});setTimeout(D,100)}fn(ke(mr(ct(b),e,d),ft(([k,,D])=>k!==!1&&D),ys(({value:k},[,D])=>({refreshed:k===D,value:D}),{refreshed:!1,value:0}),ft(({refreshed:k})=>k),kt(b,e)),([,k])=>{Hn(u)&&T(k!==!1)}),fn(x,()=>{T(Hn(b)!==!1)}),fn(mr(ct(b),i),([k,D])=>{k!==!1&&!D.atBottom&&D.notAtBottomBecause==="VIEWPORT_HEIGHT_DECREASING"&&C("auto")});const E=Le(null),M=$t();return tt(cS(ke(ct(r),We(k=>k?.length??0)),ke(ct(e))),M),fn(ke(mr(ke(M,yu(1)),c),kt(ct(E),u,g,m),We(([[k,D],O,I,L,_])=>D&&I&&O?.({context:_,totalCount:k,scrollingInProgress:L})),ft(k=>!!k),tl(0)),k=>{S!==null&&(S(),S=null),Hn(n)!==void 0?requestAnimationFrame(()=>{Hn(h)("scrolling into view",{}),Mt(y,k)}):S=Lo(t,()=>{Hn(h)("scrolling into view",{}),Mt(y,k),S=null})}),{autoscrollToBottom:x,followOutput:b,scrollIntoViewOnChange:E}},Bn(Es,ph,dh,hh,Ta,Ra,fi,uL,cL)),X7=en(([{data:t,firstItemIndex:e,gap:n,sizes:r},{initialTopMostItemIndex:i},{initialItemCount:s,listState:a},{didMount:u}])=>(tt(ke(u,kt(s),ft(([,c])=>c!==0),kt(i,r,e,n,t),We(([[,c],d,h,g,m,y=[]])=>lL(c,d,h,g,m,y))),a),{}),Bn(Es,hh,Au,Ta),{singleton:!0}),Q7=en(([{didMount:t},{scrollTo:e},{listState:n}])=>{const r=Le(0);return fn(ke(t,kt(r),ft(([,i])=>i!==0),We(([,i])=>({top:i}))),i=>{Lo(ke(n,yu(1),ft(s=>s.items.length>1)),()=>{requestAnimationFrame(()=>{Mt(e,i)})})}),{initialScrollTop:r}},Bn(Ta,fi,Au),{singleton:!0}),fL=en(([{scrollVelocity:t}])=>{const e=Le(!1),n=$t(),r=Le(!1);return tt(ke(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(ke(mr(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(ph),{singleton:!0}),V1=en(([{scrollContainerState:t,scrollTo:e}])=>{const n=$t(),r=$t(),i=$t(),s=Le(!1),a=Le(void 0);return tt(ke(mr(n,r),We(([{scrollTop:u,viewportHeight:c},{offsetTop:d,listHeight:h}])=>({scrollHeight:h,scrollTop:Math.max(0,u-d),viewportHeight:c}))),t),tt(ke(e,kt(r),We(([u,{offsetTop:c}])=>({...u,top:u.top+c}))),i),{customScrollParent:a,useWindowScroll:s,windowScrollContainerState:n,windowScrollTo:i,windowViewportRect:r}},Bn(fi)),Z7=en(([{sizeRanges:t,sizes:e},{headerHeight:n,scrollTop:r},{initialTopMostItemIndex:i},{didMount:s},{useWindowScroll:a,windowScrollContainerState:u,windowViewportRect:c}])=>{const d=$t(),h=Le(void 0),g=Le(null),m=Le(null);return tt(u,g),tt(c,m),fn(ke(d,kt(e,r,a,g,m,n)),([y,b,x,S,C,T,E])=>{const M=N7(b.sizeTree);S&&C!==null&&T!==null&&(x=C.scrollTop-T.offsetTop),x-=E,y({ranges:M,scrollTop:x})}),tt(ke(h,ft(D1),We(J7)),i),tt(ke(s,kt(h),ft(([,y])=>y!==void 0),Nn(),We(([,y])=>y.ranges)),t),{getState:d,restoreStateFrom:h}},Bn(Es,fi,hh,Ta,V1));function J7(t){return{align:"start",index:0,offset:t.scrollTop}}const eK=en(([{topItemsIndexes:t}])=>{const e=Le(0);return tt(ke(e,ft(n=>n>=0),We(n=>Array.from({length:n}).map((r,i)=>i))),t),{topItemCount:e}},Bn(Au));function dL(t){let e=!1,n;return(()=>(e||(e=!0,n=t()),n))}const tK=dL(()=>/iP(ad|od|hone)/i.test(navigator.userAgent)&&/WebKit/i.test(navigator.userAgent)),nK=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=ji(ke(c,kt(a),ys(([,C,T,E],[{bottom:M,items:k,offsetBottom:D,totalCount:O},I])=>{const L=M+D;let _=0;return T===O&&C.length>0&&k.length>0&&(k[0].originalIndex===0&&C[0].originalIndex===0||(_=L-E,_!==0&&(_+=I))),[_,k,O,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 S(C){C>0?(Mt(e,{behavior:"auto",top:-C}),Mt(t,0)):(Mt(t,0),Mt(e,{behavior:"auto",top:-C}))}return fn(ke(x,kt(t,s)),([C,T,E])=>{E&&tK()?Mt(t,T-C):S(-C)}),fn(ke(mr(Qr(s,!1),t,b),ft(([C,T,E])=>!C&&!E&&T!==0),We(([C,T])=>T),tl(1)),S),tt(ke(g,We(C=>({top:-C}))),e),fn(ke(d,kt(m,h),We(([C,{groupIndices:T,lastSize:E,sizeTree:M},k])=>{function D(N){return N*(E+k)}if(T.length===0)return D(C);let O=0;const I=jd(M,0);let L=0,_=0;for(;L<C;){L++,O+=I;let N=T.length===_+1?1/0:T[_+1]-T[_]-1;L+N>C&&(O-=I,N=C-L+1),L+=N,O+=D(N),_++}return O})),C=>{Mt(t,C),requestAnimationFrame(()=>{Mt(e,{top:C}),requestAnimationFrame(()=>{Mt(t,0),Mt(b,!1)})})}),{deviation:t}},Bn(fi,ph,Au,Es,Ra,L1)),rK=en(([t,e,n,r,i,s,a,u,c,d,h])=>({...t,...e,...n,...r,...i,...s,...a,...u,...c,...d,...h}),Bn(H1,X7,Ta,fL,aL,Q7,G7,V1,cL,Ra,uL)),hL=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:S},C,T,E,M,{scrollToIndex:k},D,{topItemCount:O},{groupCounts:I},L])=>{const{listState:_,minOverscanItemCount:N,topItemsIndexes:B,rangeChanged:H,...F}=M;return tt(H,L.scrollSeekRangeChanged),tt(ke(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:S,sizeRanges:d,topItemCount:O,topItemsIndexes:B,totalCount:m,...E,groupIndices:a,itemSize:c,listState:_,minOverscanItemCount:N,scrollToIndex:k,statefulTotalCount:g,trackItemSizes:y,rangeChanged:H,...F,...L,...C,sizes:h,...T}},Bn(Es,hh,fi,Z7,Y7,Au,dh,nK,eK,iL,rK));function iK(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 ig=typeof document<"u"?Ve.useLayoutEffect:Ve.useEffect;function F1(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(S,C){S.propsReady!==void 0&&Mt(S.propsReady,!1);for(const T of r){const E=S[e.required[T]];Mt(E,C[T])}for(const T of i)if(T in C){const E=S[e.optional[T]];Mt(E,C[T])}S.propsReady!==void 0&&Mt(S.propsReady,!0)}function d(S){return s.reduce((C,T)=>(C[T]=E=>{const M=S[e.methods[T]];Mt(M,E)},C),{})}function h(S){return a.reduce((C,T)=>(C[T]=x7(S[e.events[T]]),C),{})}const g=Ve.forwardRef(function(S,C){const{children:T,...E}=S,[M]=Ve.useState(()=>uy(w7(t),O=>{c(O,E)})),[k]=Ve.useState(WO(h,M));ig(()=>{for(const O of a)O in E&&fn(k[O],E[O]);return()=>{Object.values(k).map(P1)}},[E,k,M]),ig(()=>{c(M,E)}),Ve.useImperativeHandle(C,GO(d(M)));const D=n;return A.jsx(u.Provider,{value:M,children:n!==void 0?A.jsx(D,{...iK([...r,...i,...a],E),children:T}):T})}),m=S=>{const C=Ve.useContext(u);return Ve.useCallback(T=>{Mt(C[S],T)},[C,S])},y=S=>{const C=Ve.useContext(u)[S],T=Ve.useCallback(E=>fn(C,E),[C]);return Ve.useSyncExternalStore(T,()=>Hn(C),()=>Hn(C))},b=S=>{const C=Ve.useContext(u)[S],[T,E]=Ve.useState(WO(Hn,C));return ig(()=>fn(C,M=>{M!==T&&E(GO(M))}),[C,T]),T},x=parseInt(Ve.version)>=18?y:b;return{Component:g,useEmitter:(S,C)=>{const T=Ve.useContext(u)[S];ig(()=>fn(T,C),[C,T])},useEmitterValue:x,usePublisher:m}}const fy=Ve.createContext(void 0),pL=Ve.createContext(void 0),Ib="-webkit-sticky",sk="sticky",$1=dL(()=>{if(typeof document>"u")return sk;const t=document.createElement("div");return t.style.position=Ib,t.style.position===Ib?Ib:sk}),gL=typeof document<"u"?Ve.useLayoutEffect:Ve.useEffect;function Db(t){return"self"in t}function oK(t){return"body"in t}function mL(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 S=m.target;if(oK(S)||Db(S)){const T=Db(S)?S:S.defaultView;x=s===!0?nu(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?nu(S,S.scrollLeft):S.scrollTop,y=s===!0?S.scrollWidth:S.scrollHeight,b=s===!0?S.offsetWidth:S.offsetHeight;const C=()=>{t({scrollHeight:y,scrollTop:Math.max(x,0),viewportHeight:b})};m.suppressFlushSync===!0?C():s4.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 YO(m),r(i||a.current),d({suppressFlushSync:!0,target:m}),m.addEventListener("scroll",d,{passive:!0}),()=>{YO(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,S,C;Db(y)?(S=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?nu(y,y.scrollX):y.scrollY):(S=y[s===!0?"scrollWidth":"scrollHeight"],x=_o(y,s===!0?"width":"height"),C=s===!0?nu(y,y.scrollLeft):y.scrollTop);const T=S-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,sL(x,S)||E===C){t({scrollHeight:S,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:XO(y,E)}),y.scrollTo(m)}function g(m){s===!0&&(m={...m.behavior!==void 0?{behavior:m.behavior}:{},...m.top!==void 0?{left:XO(a.current,m.top)}:{}}),a.current.scrollBy(m)}return{scrollByCallback:g,scrollerRef:a,scrollToCallback:h}}function U1(t){return t}const sK=en(()=>{const t=Le(u=>`Item ${u}`),e=Le(u=>`Group ${u}`),n=Le({}),r=Le(U1),i=Le("div"),s=Le(Jc),a=(u,c=null)=>Qr(ke(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")}}),lK=en(([t,e])=>({...t,...e}),Bn(hL,sK)),aK=({height:t})=>A.jsx("div",{style:{height:t}}),uK={overflowAnchor:"none",position:$1(),zIndex:1},yL={overflowAnchor:"none"},cK={...yL,display:"inline-block",height:"100%"},lk=Ve.memo(function({showTopList:t=!1}){const e=mt("listState"),n=so("sizeRanges"),r=mt("useWindowScroll"),i=mt("customScrollParent"),s=so("windowScrollContainerState"),a=so("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=so("gap"),x=mt("horizontalDirection"),{callbackRef:S}=KN(n,m,g,t?Jc:u,y,b,i,x,mt("skipAnimationFrameInResizeObserver")),[C,T]=Ve.useState(0);K1("deviation",F=>{C!==F&&T(F)});const E=mt("EmptyPlaceholder"),M=mt("ScrollSeekPlaceholder")??aK,k=mt("ListComponent"),D=mt("ItemComponent"),O=mt("GroupComponent"),I=mt("computeItemKey"),L=mt("isSeeking"),_=mt("groupIndices").length>0,N=mt("alignToBottom"),B=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},...B?{}:{visibility:"hidden"}};return!t&&e.totalCount===0&&E!==null&&E!==void 0?A.jsx(E,{...Ln(E,d)}):A.jsx(k,{...Ln(k,d),"data-testid":t?"virtuoso-top-item-list":"virtuoso-item-list",ref:S,style:H,children:(t?e.topItems:e.items).map(F=>{const G=F.originalIndex,j=I(G+e.firstItemIndex,F.data,d);return L?R.createElement(M,{...Ln(M,d),height:F.size,index:F.index,key:j,type:F.type||"item",...F.type==="group"?{}:{groupIndex:F.groupIndex}}):F.type==="group"?R.createElement(O,{...Ln(O,d),"data-index":G,"data-item-index":F.index,"data-known-size":F.size,key:j,style:uK},h(F.index,d)):R.createElement(D,{...Ln(D,d),...vL(D,F.data),"data-index":G,"data-item-group-index":F.groupIndex,"data-item-index":F.index,"data-known-size":F.size,key:j,style:x?cK:yL},_?c(F.index,F.groupIndex,F.data,d):c(F.index,F.data,d))})})}),fK={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},dK={outline:"none",overflowX:"auto",position:"relative"},dy=t=>({height:"100%",position:"absolute",top:0,width:"100%",...t?{display:"flex",flexDirection:"column"}:void 0}),q1=(t,e,n=0)=>({...dy(t),position:e?"relative":"absolute",top:e?-n:0}),hK={position:$1(),top:0,width:"100%",zIndex:1};function Ln(t,e){if(typeof t!="string")return{context:e}}function vL(t,e){return{item:typeof t=="string"?void 0:e}}const pK=Ve.memo(function(){const t=mt("HeaderComponent"),e=so("headerHeight"),n=mt("HeaderFooterTag"),r=Rs(Ve.useMemo(()=>s=>{e(_o(s,"height"))},[e]),!0,mt("skipAnimationFrameInResizeObserver")),i=mt("context");return t!=null?A.jsx(n,{ref:r,children:A.jsx(t,{...Ln(t,i)})}):null}),gK=Ve.memo(function(){const t=mt("FooterComponent"),e=so("footerHeight"),n=mt("HeaderFooterTag"),r=Rs(Ve.useMemo(()=>s=>{e(_o(s,"height"))},[e]),!0,mt("skipAnimationFrameInResizeObserver")),i=mt("context");return t!=null?A.jsx(n,{ref:r,children:A.jsx(t,{...Ln(t,i)})}):null});function G1({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}=mL(u,d,c,h,void 0,g);return t("scrollTo",b),t("scrollBy",m),A.jsx(c,{"data-testid":"virtuoso-scroller","data-virtuoso-scroller":!0,ref:y,style:{...g?dK:fK,...i},tabIndex:0,...a,...Ln(c,s),children:r})})}function W1({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:S,scrollToCallback:C}=mL(u,d,c,b,m);return gL(()=>(S.current=m||y.current?.ownerDocument.defaultView,()=>{S.current=null}),[S,m]),t("windowScrollTo",C),t("scrollBy",x),A.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 mK=({children:t})=>{const e=Ve.useContext(fy),n=so("viewportHeight"),r=so("fixedItemHeight"),i=mt("alignToBottom"),s=mt("horizontalDirection"),a=Ve.useMemo(()=>Ld(n,c=>_o(c,s?"width":"height")),[n,s]),u=Rs(a,!0,mt("skipAnimationFrameInResizeObserver"));return Ve.useEffect(()=>{e&&(n(e.viewportHeight),r(e.itemHeight))},[e,n,r]),A.jsx("div",{"data-viewport-type":"element",ref:u,style:dy(i),children:t})},yK=({children:t})=>{const e=Ve.useContext(fy),n=so("windowViewportRect"),r=so("fixedItemHeight"),i=mt("customScrollParent"),s=mt("useWindowScroll"),a=mt("topListHeight"),u=N1(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]),A.jsx("div",{"data-viewport-type":"window",ref:u,style:q1(c,s,a),children:t})},vK=({children:t})=>{const e=mt("TopItemListComponent")??"div",n=mt("headerHeight"),r={...hK,marginTop:`${n}px`},i=mt("context");return A.jsx(e,{style:r,...Ln(e,i),children:t})},bK=Ve.memo(function(t){const e=mt("useWindowScroll"),n=mt("topItemsIndexes").length>0,r=mt("customScrollParent"),i=mt("context");return A.jsxs(r||e?wK:SK,{...t,context:i,children:[n&&A.jsx(vK,{children:A.jsx(lk,{showTopList:!0})}),A.jsxs(r||e?yK:mK,{children:[A.jsx(pK,{}),A.jsx(lk,{}),A.jsx(gK,{})]})]})}),{Component:xK,useEmitter:K1,useEmitterValue:mt,usePublisher:so}=F1(lK,{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"}},bK),SK=G1({useEmitter:K1,useEmitterValue:mt,usePublisher:so}),wK=W1({useEmitter:K1,useEmitterValue:mt,usePublisher:so}),bL=xK,CK=en(()=>{const t=Le(d=>A.jsxs("td",{children:["Item $",d]})),e=Le(null),n=Le(d=>A.jsxs("td",{colSpan:1e3,children:["Group ",d]})),r=Le(null),i=Le(null),s=Le({}),a=Le(U1),u=Le(Jc),c=(d,h=null)=>Qr(ke(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")}}),RK=en(([t,e])=>({...t,...e}),Bn(hL,CK)),TK=({height:t})=>A.jsx("tr",{children:A.jsx("td",{style:{height:t}})}),EK=({height:t})=>A.jsx("tr",{children:A.jsx("td",{style:{border:0,height:t,padding:0}})}),MK={overflowAnchor:"none"},ak={position:$1(),zIndex:2,overflowAnchor:"none"},uk=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")??TK,g=Tt("GroupComponent"),m=Tt("TableRowComponent"),y=(t?e.topItems:[]).reduce((b,x,S)=>(S===0?b.push(x.size):b.push(b[S-1]+x.size),b),[]);return(t?e.topItems:e.items).map(b=>{const x=b.originalIndex,S=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:S,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:S,style:{...ak,top:a}},d(b.index,i)):R.createElement(m,{...Ln(m,i),...vL(m,b.data),"data-index":x,"data-item-index":b.index,"data-known-size":b.size,"data-item-group-index":b.groupIndex,key:S,style:t?{...ak,top:a+C}:MK},u?c(b.index,b.groupIndex,b.data,i):c(b.index,b.data,i))})}),AK=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}=KN(n,d,c,u,h,void 0,i,!1,Tt("skipAnimationFrameInResizeObserver")),[y,b]=Ve.useState(0);Y1("deviation",_=>{y!==_&&(m.current.style.marginTop=`${_}px`,b(_))});const x=Tt("EmptyPlaceholder"),S=Tt("FillerRow")??EK,C=Tt("TableBodyComponent"),T=Tt("paddingTopAddition"),E=Tt("statefulTotalCount"),M=Tt("context");if(E===0&&x!==null&&x!==void 0)return A.jsx(x,{...Ln(x,M)});const k=(e?t.topItems:[]).reduce((_,N)=>_+N.size,0),D=t.offsetTop+T+y-k,O=t.offsetBottom,I=D>0?A.jsx(S,{context:M,height:D},"padding-top"):null,L=O>0?A.jsx(S,{context:M,height:O},"padding-bottom"):null;return A.jsxs(C,{"data-testid":"virtuoso-item-list",ref:g,...Ln(C,M),children:[I,e&&A.jsx(uk,{showTopList:!0}),A.jsx(uk,{}),L]})}),OK=({children:t})=>{const e=Ve.useContext(fy),n=Bo("viewportHeight"),r=Bo("fixedItemHeight"),i=Rs(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]),A.jsx("div",{"data-viewport-type":"element",ref:i,style:dy(!1),children:t})},kK=({children:t})=>{const e=Ve.useContext(fy),n=Bo("windowViewportRect"),r=Bo("fixedItemHeight"),i=Tt("customScrollParent"),s=Tt("useWindowScroll"),a=N1(n,i,Tt("skipAnimationFrameInResizeObserver"));return Ve.useEffect(()=>{e&&(r(e.itemHeight),n({listHeight:0,offsetTop:0,visibleHeight:e.viewportHeight,visibleWidth:100}))},[e,n,r]),A.jsx("div",{"data-viewport-type":"window",ref:a,style:q1(!1,s),children:t})},IK=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=Rs(Ve.useMemo(()=>Ld(r,C=>_o(C,"height")),[r]),!0,Tt("skipAnimationFrameInResizeObserver")),d=Rs(Ve.useMemo(()=>Ld(i,C=>_o(C,"height")),[i]),!0,Tt("skipAnimationFrameInResizeObserver")),h=n||e?zK:PK,g=n||e?kK:OK,m=Tt("TableComponent"),y=Tt("TableHeadComponent"),b=Tt("TableFooterComponent"),x=s?A.jsx(y,{ref:c,style:{position:"sticky",top:0,zIndex:2},...Ln(y,u),children:s()},"TableHead"):null,S=a?A.jsx(b,{ref:d,style:{bottom:0,position:"sticky",zIndex:1},...Ln(b,u),children:a()},"TableFoot"):null;return A.jsx(h,{...t,...Ln(h,u),children:A.jsx(g,{children:A.jsxs(m,{style:{borderSpacing:0,overflowAnchor:"none"},...Ln(m,u),children:[x,A.jsx(AK,{},"TableBody"),S]})})})}),{Component:DK,useEmitter:Y1,useEmitterValue:Tt,usePublisher:Bo}=F1(RK,{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"}},IK),PK=G1({useEmitter:Y1,useEmitterValue:Tt,usePublisher:Bo}),zK=W1({useEmitter:Y1,useEmitterValue:Tt,usePublisher:Bo}),NK=DK,ck={bottom:0,itemHeight:0,items:[],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},LK={bottom:0,itemHeight:0,items:[{index:0}],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},{ceil:fk,floor:um,max:yd,min:Pb,round:dk}=Math;function hk(t,e,n){return Array.from({length:e-t+1}).map((r,i)=>({data:n===null?null:n[i+t],index:i+t}))}function BK(t){return{...LK,items:t}}function og(t,e){return t!==void 0&&t.width===e.width&&t.height===e.height}function jK(t,e){return t!==void 0&&t.column===e.column&&t.row===e.row}const _K=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:S,useWindowScroll:C,windowScrollContainerState:T,windowScrollTo:E,windowViewportRect:M},k])=>{const D=Le(0),O=Le(0),I=Le(ck),L=Le({height:0,width:0}),_=Le({height:0,width:0}),N=$t(),B=$t(),H=Le(0),F=Le(null),G=Le({column:0,row:0}),j=$t(),q=$t(),$=Le(!1),X=Le(0),Z=Le(!0),z=Le(!1),U=Le(!1);fn(ke(b,kt(X),ft(([Y,se])=>se!==0)),()=>{Mt(Z,!1)}),fn(ke(mr(b,Z,_,L,X,z),ft(([Y,se,ve,ye,,he])=>Y&&!se&&ve.height!==0&&ye.height!==0&&!he)),([,,,,Y])=>{Mt(z,!0),j1(1,()=>{Mt(N,Y)}),Lo(ke(d),()=>{Mt(e,[0,0]),Mt(Z,!0)})}),tt(ke(q,ft(Y=>Y!=null&&Y.scrollTop>0),fs(0)),O),fn(ke(b,kt(q),ft(([,Y])=>Y!=null)),([,Y])=>{Y&&(Mt(L,Y.viewport),Mt(_,Y.item),Mt(G,Y.gap),Y.scrollTop>0&&(Mt($,!0),Lo(ke(d,yu(1)),se=>{Mt($,!1)}),Mt(c,{top:Y.scrollTop})))}),tt(ke(L,We(({height:Y})=>Y)),g),tt(ke(mr(ct(L,og),ct(_,og),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}))),j),tt(ke(mr(ct(D),r,ct(G,jK),ct(_,og),ct(L,og),ct(F),ct(O),ct($),ct(Z),ct(X)),ft(([,,,,,,,Y])=>!Y),We(([Y,[se,ve],ye,he,pe,Te,De,,Pe,Ee])=>{const{column:_e,row:Me}=ye,{height:oe,width:xe}=he,{width:ze}=pe;if(De===0&&(Y===0||ze===0))return ck;if(xe===0){const wt=_1(Ee,Y),xt=wt+Math.max(De-1,0);return BK(hk(wt,xt,Te))}const ne=xL(ze,xe,_e);let J,le;Pe?se===0&&ve===0&&De>0?(J=0,le=De-1):(J=ne*um((se+Me)/(oe+Me)),le=ne*fk((ve+Me)/(oe+Me))-1,le=Pb(Y-1,yd(le,ne-1)),J=Pb(le,yd(0,J))):(J=0,le=-1);const we=hk(J,le,Te),{bottom:de,top:me}=pk(pe,ye,he,we),Be=fk(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(ke(F,ft(Y=>Y!==null),We(Y=>Y.length)),D),tt(ke(mr(L,_,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}=pk(Y,ye,se,ve);return[pe,he]}),Nn(_d)),e);const W=Le(!1);tt(ke(d,kt(W),We(([Y,se])=>se||Y!==0)),W);const K=ji(ke(mr(I,D),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=ji(ke(ct(I),ft(({items:Y})=>Y.length>0&&Y[0].index===0),fs(0),Nn())),ee=ji(ke(ct(I),kt($),ft(([{items:Y},se])=>Y.length>0&&!se),We(([{items:Y}])=>({endIndex:Y[Y.length-1].index,startIndex:Y[0].index})),Nn(eL),tl(0)));tt(ee,y.scrollSeekRangeChanged),tt(ke(N,kt(L,_,D,G),We(([Y,se,ve,ye,he])=>{const pe=oL(Y),{align:Te,behavior:De,offset:Pe}=pe;let Ee=pe.index;Ee==="LAST"&&(Ee=ye-1),Ee=yd(0,Ee,Pb(ye-1,Ee));let _e=mS(se,he,ve,Ee);return Te==="end"?_e=dk(_e-se.height+ve.height):Te==="center"&&(_e=dk(_e-se.height/2+ve.height/2)),Pe!==void 0&&Pe!==0&&(_e+=Pe),{behavior:De,top:_e}})),c);const ae=Qr(ke(I,We(Y=>Y.offsetBottom+Y.bottom)),0);return tt(ke(M,We(Y=>({height:Y.visibleHeight,width:Y.visibleWidth}))),L),{customScrollParent:S,data:F,deviation:H,footerHeight:i,gap:G,headerHeight:s,increaseViewportBy:t,initialItemCount:O,itemDimensions:_,overscan:n,restoreStateFrom:q,scrollBy:a,scrollContainerState:u,scrollHeight:B,scrollTo:c,scrollToIndex:N,scrollTop:d,smoothScrollTargetReached:h,totalCount:D,useWindowScroll:C,viewportDimensions:L,windowScrollContainerState:T,windowScrollTo:E,windowViewportRect:M,...y,gridState:I,horizontalDirection:U,initialTopMostItemIndex:X,totalListHeight:ae,...m,endReached:K,propsReady:x,rangeChanged:ee,startReached:ie,stateChanged:j,stateRestoreInProgress:$,...k}},Bn(H1,fi,ph,fL,Ta,V1,Ra));function xL(t,e,n){return yd(1,um((t+n)/(um(e)+n)))}function pk(t,e,n,r){const{height:i}=n;if(i===void 0||r.length===0)return{bottom:0,top:0};const s=mS(t,e,n,r[0].index);return{bottom:mS(t,e,n,r[r.length-1].index)+i,top:s}}function mS(t,e,n,r){const i=xL(t.width,n.width,e.column),s=um(r/i),a=s*n.height+yd(0,s-1)*e.row;return a>0?a+e.row:a}const HK=en(()=>{const t=Le(g=>`Item ${g}`),e=Le({}),n=Le(null),r=Le("virtuoso-grid-item"),i=Le("virtuoso-grid-list"),s=Le(U1),a=Le("div"),u=Le(Jc),c=(g,m=null)=>Qr(ke(e,We(y=>y[g]),Nn()),m),d=Le(!1),h=Le(!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")}}),VK=en(([t,e])=>({...t,...e}),Bn(_K,HK)),FK=Ve.memo(function(){const t=zn("gridState"),e=zn("listClassName"),n=zn("itemClassName"),r=zn("itemContent"),i=zn("computeItemKey"),s=zn("isSeeking"),a=lo("scrollHeight"),u=zn("ItemComponent"),c=zn("ListComponent"),d=zn("ScrollSeekPlaceholder"),h=zn("context"),g=lo("itemDimensions"),m=lo("gap"),y=zn("log"),b=zn("stateRestoreInProgress"),x=lo("reportReadyState"),S=Rs(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:gk("column-gap",getComputedStyle(C).columnGap,y),row:gk("row-gap",getComputedStyle(C).rowGap,y)})},[a,g,m,y]),!0,!1);return gL(()=>{t.itemHeight>0&&t.itemWidth>0&&x(!0)},[t]),b?null:A.jsx(c,{className:e,ref:S,...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?A.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))})})}),$K=Ve.memo(function(){const t=zn("HeaderComponent"),e=lo("headerHeight"),n=zn("headerFooterTag"),r=Rs(Ve.useMemo(()=>s=>{e(_o(s,"height"))},[e]),!0,!1),i=zn("context");return t!=null?A.jsx(n,{ref:r,children:A.jsx(t,{...Ln(t,i)})}):null}),UK=Ve.memo(function(){const t=zn("FooterComponent"),e=lo("footerHeight"),n=zn("headerFooterTag"),r=Rs(Ve.useMemo(()=>s=>{e(_o(s,"height"))},[e]),!0,!1),i=zn("context");return t!=null?A.jsx(n,{ref:r,children:A.jsx(t,{...Ln(t,i)})}):null}),qK=({children:t})=>{const e=Ve.useContext(pL),n=lo("itemDimensions"),r=lo("viewportDimensions"),i=Rs(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]),A.jsx("div",{ref:i,style:dy(!1),children:t})},GK=({children:t})=>{const e=Ve.useContext(pL),n=lo("windowViewportRect"),r=lo("itemDimensions"),i=zn("customScrollParent"),s=zn("useWindowScroll"),a=N1(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]),A.jsx("div",{ref:a,style:q1(!1,s),children:t})},WK=Ve.memo(function({...t}){const e=zn("useWindowScroll"),n=zn("customScrollParent"),r=n||e?YK:KK,i=n||e?GK:qK,s=zn("context");return A.jsx(r,{...t,...Ln(r,s),children:A.jsxs(i,{children:[A.jsx($K,{}),A.jsx(FK,{}),A.jsx(UK,{})]})})}),{useEmitter:SL,useEmitterValue:zn,usePublisher:lo}=F1(VK,{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"}},WK),KK=G1({useEmitter:SL,useEmitterValue:zn,usePublisher:lo}),YK=W1({useEmitter:SL,useEmitterValue:zn,usePublisher:lo});function gk(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 Ie(...t){return Q8(ED(t))}const XK={neutral:"",primary:"",success:"",warning:"",danger:"",info:""},hy=ba("",{variants:{tone:XK,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}}),QK=ba("",{variants:{tone:{neutral:"text-foreground",primary:"text-primary",success:"text-success",warning:"text-warning",danger:"text-danger",info:"text-info"}},defaultVariants:{tone:"neutral"}}),ZK=ba("text-foreground",{variants:{variant:{title:"text-base font-semibold",heading:"text-sm font-semibold",body:"text-sm font-normal",caption:"text-xs text-muted-foreground",code:"font-mono text-xs",numeric:"font-mono text-xs tabular-nums"}},defaultVariants:{variant:"body"}});function JK({className:t,variant:e,tone:n,render:r,ref:i,...s}){return Ti({render:r??A.jsx("span",{}),ref:i,props:{"data-slot":"text",className:Ie(ZK({variant:e}),n&&QK({tone:n}),t),...s}})}function eY(t,e){return t==="light"||t==="dark"?t:e?"dark":"light"}const wL="@rozenite/ui:theme";function mk(){try{return localStorage.getItem(wL)}catch{return null}}function tY(t){try{localStorage.setItem(wL,t)}catch{}}function nY(){try{return window.matchMedia("(prefers-color-scheme: dark)").matches}catch{return!1}}const CL=R.createContext(null);function rY({children:t}){const[e,n]=R.useState(()=>eY(mk(),nY()));R.useEffect(()=>{if(mk()!==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),tY(a)},[]),i=R.useCallback(()=>{r(e==="dark"?"light":"dark")},[r,e]),s=R.useMemo(()=>({theme:e,setTheme:r,toggleTheme:i}),[e,r,i]);return A.jsx(CL.Provider,{value:s,children:t})}function RL(){const t=R.useContext(CL);if(!t)throw new Error("usePluginTheme must be used within a PluginShell");return t}const TL=R.createContext(null);function ef(){return R.useContext(TL)}function iY(t){return A.jsx(E2,{"data-slot":"tooltip-provider",...t})}function oY(t){return A.jsx(r2,{"data-slot":"tooltip",...t})}function sY(t){return A.jsx(p2,{"data-slot":"tooltip-trigger",...t})}function lY({className:t,side:e="top",sideOffset:n=6,align:r="center",alignOffset:i=0,children:s,...a}){const u=ef();return A.jsx(m2,{container:u,children:A.jsx(R2,{side:e,sideOffset:n,align:r,alignOffset:i,className:"z-50",children:A.jsx(T2,{"data-slot":"tooltip-content",className:Ie("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 zb=Object.assign(oY,{Provider:iY,Trigger:sY,Content:lY}),aY={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 yk({className:t,tone:e="primary",variant:n,size:r="md",label:i,type:s="button",children:a,render:u,ref:c,...d}){const h=Ti({render:u??A.jsx("button",{type:s}),ref:c,props:{"aria-label":i,"data-slot":"icon-button",className:Ie("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}),aY[r],t),children:a,...d}});return A.jsxs(zb,{children:[A.jsx(zb.Trigger,{render:h}),A.jsx(zb.Content,{children:i})]})}function uY(t){return A.jsx(hq,{"data-slot":"menu",...t})}function cY(t){return A.jsx(vq,{"data-slot":"menu-trigger",...t})}function fY({className:t,side:e="bottom",sideOffset:n=4,align:r="start",alignOffset:i=0,children:s,...a}){const u=ef();return A.jsx(q2,{container:u,children:A.jsx(iq,{side:e,sideOffset:n,align:r,alignOffset:i,className:"z-50",children:A.jsx($2,{"data-slot":"menu-content",className:Ie("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 dY({className:t,...e}){return A.jsx(_2,{"data-slot":"menu-item",className:Ie("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 hY({className:t,children:e,...n}){return A.jsxs(z2,{"data-slot":"menu-checkbox-item",className:Ie("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,A.jsx(N2,{children:A.jsx(xw,{className:"size-3.5"})})]})}function pY({className:t,...e}){return A.jsx(Sz,{"data-slot":"menu-separator",className:Ie("-mx-1 my-1 h-px bg-border",t),...e})}function gY(t){return A.jsx(B2,{"data-slot":"menu-group",...t})}function mY({className:t,...e}){return A.jsx(j2,{"data-slot":"menu-group-label",className:Ie("px-2 py-1.5 text-xs font-medium text-muted-foreground",t),...e})}Object.assign(uY,{Trigger:cY,Content:fY,Item:dY,CheckboxItem:hY,Separator:pY,Group:gY,GroupLabel:mY});function yY({tone:t="neutral",className:e,render:n,ref:r,...i}){return Ti({render:n??A.jsx("div",{}),ref:r,props:{role:t==="danger"?"alert":"status","data-slot":"alert",className:Ie(hy({tone:t,variant:"soft",class:"flex flex-col gap-1 rounded-md border border-current/15 p-3 text-sm"}),e),...i}})}function vY({className:t,...e}){return A.jsx("div",{"data-slot":"alert-title",className:Ie("font-medium",t),...e})}function bY({className:t,...e}){return A.jsx("div",{"data-slot":"alert-description",className:Ie("opacity-80",t),...e})}Object.assign(yY,{Title:vY,Description:bY});function xY({direction:t="horizontal",autoSaveId:e,id:n,className:r,disableCursor:i=!0,...s}){return A.jsx(jz,{"data-slot":"split",orientation:t,id:n??e,disableCursor:i,className:Ie("flex h-full w-full",r),...s})}function sg(t){return typeof t=="number"?`${t}%`:t}function SY({className:t,defaultSize:e,minSize:n,maxSize:r,collapsedSize:i,...s}){return A.jsx(_z,{"data-slot":"split-pane",className:Ie("min-h-0 min-w-0",t),defaultSize:sg(e),minSize:sg(n),maxSize:sg(r),collapsedSize:sg(i),...s})}function wY({className:t,withHandle:e=!1,children:n,...r}){return A.jsxs(Hz,{"data-slot":"split-handle",className:Ie("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&&A.jsx("div",{className:Ie("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:A.jsx(C6,{className:"h-2.5 w-2.5 text-muted-foreground"})}),n]})}const lg=Object.assign(xY,{Pane:SY,Handle:wY}),EL=R.createContext(null);function CY(t){const[e,n]=R.useState(t.defaultOpen??!1),r=t.open??e;return A.jsx(EL.Provider,{value:r,children:A.jsx(c9,{...t,onOpenChange:(i,s)=>{t.open===void 0&&n(i),t.onOpenChange?.(i,s)}})})}function RY(t){return A.jsx(h9,{"data-slot":"dialog-trigger",...t})}function TY(t){return A.jsx(Fz,{"data-slot":"dialog-close",...t})}function EY({className:t,children:e,showCloseButton:n=!0,closeLabel:r="Close",...i}){const s=ef(),a=R.useContext(EL),u=R.useRef(e);return A.jsxs(r9,{container:s,children:[A.jsx(e9,{"data-slot":"dialog-backdrop",className:Ie("fixed inset-0 z-50 bg-background/70","transition-opacity data-[ending-style]:opacity-0 data-[starting-style]:opacity-0")}),A.jsx(f9,{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:A.jsxs(n9,{"data-slot":"dialog-content",className:Ie("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),A.jsx("div",{...h,children:u.current})},...i,children:[e,n&&A.jsx(Fz,{"data-slot":"dialog-close","aria-label":r,className:Ie("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:A.jsx(Pm,{className:"h-4 w-4"})})]})})]})}function MY({className:t,...e}){return A.jsx("div",{"data-slot":"dialog-header",className:Ie("flex flex-col gap-1.5",t),...e})}function AY({className:t,...e}){return A.jsx("div",{"data-slot":"dialog-footer",className:Ie("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),...e})}function OY({className:t,...e}){return A.jsx(d9,{"data-slot":"dialog-title",className:Ie("text-sm font-semibold text-foreground",t),...e})}function kY({className:t,...e}){return A.jsx(t9,{"data-slot":"dialog-description",className:Ie("text-sm text-muted-foreground",t),...e})}const un=Object.assign(CY,{Trigger:RY,Close:TY,Content:EY,Header:MY,Footer:AY,Title:OY,Description:kY}),IY=ba(Ie("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 Ti({render:u??A.jsx("button",{type:i}),ref:c,props:{"data-slot":"button",className:Ie(IY({size:r}),hy({tone:e,variant:n,interactive:!0}),t),children:A.jsxs(A.Fragment,{children:[a,s]}),...d}})}function ML({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 A.jsx(un,{open:t,onOpenChange:e,children:A.jsxs(un.Content,{showCloseButton:!1,className:i,children:[A.jsxs(un.Header,{children:[A.jsx(un.Title,{children:n}),r&&A.jsx(un.Description,{children:r})]}),A.jsxs(un.Footer,{children:[!h&&A.jsx(un.Close,{render:A.jsx(Ho,{tone:"neutral",variant:"outline"}),children:c}),A.jsx(un.Close,{render:A.jsx(Ho,{tone:a}),onClick:d,children:u??(h?"OK":"Confirm")})]})]})})}const AL=R.createContext(null);function DY({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 A.jsxs(AL.Provider,{value:s,children:[t,a&&A.jsx(ML,{...a.options,open:!0,onOpenChange:c=>{c||u(!1)},onConfirm:()=>u(!0)},a.id)]})}function X1(){const t=R.useContext(AL);if(!t)throw new Error("useConfirmDialog must be used within a ConfirmDialog.Provider");return t}const OL=Object.assign(ML,{Provider:DY});function vk({children:t,dismissLabel:e="Dismiss",viewportClassName:n,...r}){return A.jsxs(m9,{"data-slot":"toast-provider",...r,children:[t,A.jsx(PY,{dismissLabel:e,viewportClassName:n})]})}function PY({dismissLabel:t,viewportClassName:e}){const{toasts:n}=D9(),r=ef();return A.jsx(I9,{container:r,children:A.jsx(v9,{"data-slot":"toast-viewport",className:Ie("fixed right-4 bottom-4 z-50 flex w-80 flex-col gap-2",e),children:n.map(i=>A.jsxs(T9,{toast:i,"data-slot":"toast",className:Ie("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:[A.jsxs(E9,{"data-slot":"toast-content",className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[i.title&&A.jsx(O9,{"data-slot":"toast-title",className:"text-sm font-medium"}),i.description&&A.jsx(A9,{"data-slot":"toast-description",className:"text-xs text-muted-foreground"})]}),A.jsx(k9,{"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:A.jsx(Pm,{className:"h-3.5 w-3.5"})})]},i.id))})})}const kL=Object.assign(vk,{Provider:vk});function zY({unstyled:t=!1,className:e,children:n,...r}){return t?A.jsx("div",{"data-slot":"plugin-shell",className:Ie("flex h-screen min-h-0 flex-col",e),...r,children:A.jsx(kL,{children:A.jsx(OL.Provider,{children:n})})}):A.jsx(rY,{children:A.jsx(NY,{className:e,...r,children:n})})}function NY({className:t,children:e,...n}){const{theme:r}=RL(),[i,s]=R.useState(null);return A.jsx("div",{ref:s,"data-slot":"plugin-shell",className:Ie(r==="dark"&&"dark","flex h-screen min-h-0 flex-col bg-background text-foreground",t),...n,children:A.jsx(TL.Provider,{value:i,children:A.jsx(kL,{children:A.jsx(OL.Provider,{children:e})})})})}function LY({className:t,...e}){return A.jsx("div",{"data-slot":"plugin-shell-body",className:Ie("flex min-h-0 flex-1 flex-col overflow-auto",t),...e})}const IL=Object.assign(zY,{Body:LY});function BY({className:t,render:e,ref:n,...r}){return Ti({render:e??A.jsx("header",{}),ref:n,props:{"data-slot":"plugin-header",className:Ie("flex shrink-0 items-center justify-between gap-3 border-b border-border bg-card px-4 py-3",t),...r}})}function jY({className:t,render:e,ref:n,...r}){return Ti({render:e??A.jsx("h1",{}),ref:n,props:{"data-slot":"plugin-header-title",className:Ie("text-sm font-semibold text-foreground",t),...r}})}function _Y({className:t,render:e,ref:n,...r}){return Ti({render:e??A.jsx("p",{}),ref:n,props:{"data-slot":"plugin-header-subtitle",className:Ie("text-xs text-muted-foreground",t),...r}})}function HY({className:t,render:e,ref:n,...r}){return Ti({render:e??A.jsx("div",{}),ref:n,props:{"data-slot":"plugin-header-actions",className:Ie("flex items-center gap-2",t),...r}})}function VY({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}=RL();return Ti({render:r??A.jsx("button",{type:"button"}),ref:i,props:{"data-slot":"plugin-header-theme-switcher","aria-label":u==="dark"?e:n,onClick:c,className:Ie("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"?A.jsx(k6,{className:"h-3.5 w-3.5"}):A.jsx(E6,{className:"h-3.5 w-3.5"}),...a}})}Object.assign(BY,{Title:jY,Subtitle:_Y,Actions:HY,ThemeSwitcher:VY});const FY=Ie("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"),gh=ba(FY,{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"}}),DL=ba(Ie("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")),PL=ba(Ie("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 $Y(t){return A.jsx(_9,{...t})}function UY({className:t,children:e,size:n="md",...r}){return A.jsxs(G9,{"data-slot":"select-trigger",className:Ie(gh({size:n}),"flex items-center justify-between gap-2",t),...r,children:[e,A.jsx(Y9,{children:A.jsx(ww,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"})})]})}function qY({className:t,...e}){return A.jsx(K9,{"data-slot":"select-value",className:Ie("truncate",t),...e})}function GY({className:t,side:e="bottom",sideOffset:n=4,align:r="start",children:i,...s}){const a=ef();return A.jsx(X9,{container:a,children:A.jsx(Z9,{side:e,sideOffset:n,align:r,className:"z-50",children:A.jsx(rG,{"data-slot":"select-content",className:Ie(DL(),t),...s,children:A.jsx(oG,{children:i})})})})}function WY({className:t,children:e,...n}){return A.jsxs(sG,{"data-slot":"select-item",className:Ie(PL(),t),...n,children:[A.jsx(uG,{children:e}),A.jsx(lG,{children:A.jsx(xw,{className:"h-3.5 w-3.5"})})]})}const uc=Object.assign($Y,{Trigger:UY,Value:qY,Content:GY,Item:WY});function KY(t){return A.jsx(yG,{...t})}const YY={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 XY({className:t,size:e="md",...n}){const r=YY[e];return A.jsxs(RG,{"data-slot":"combobox-input-group",className:"relative flex items-center",children:[A.jsx(wG,{"data-slot":"combobox-input",className:Ie(gh({size:e}),r.pad,t),...n}),A.jsxs("div",{className:Ie("absolute flex items-center gap-0.5",r.cluster),children:[A.jsx(WG,{"data-slot":"combobox-clear",className:Ie("inline-flex items-center justify-center rounded-sm text-muted-foreground hover:text-foreground",r.control),children:A.jsx(Pm,{className:r.icon})}),A.jsx(jG,{"data-slot":"combobox-icon",children:A.jsx(ww,{className:Ie("text-muted-foreground",r.icon)})})]})]})}function QY({className:t,side:e="bottom",sideOffset:n=4,align:r="start",emptyMessage:i="No results found.",children:s,...a}){const u=ef();return A.jsx(zG,{container:u,children:A.jsx(NG,{side:e,sideOffset:n,align:r,className:"z-50",children:A.jsxs(BG,{"data-slot":"combobox-content",className:Ie(DL(),t),...a,children:[A.jsx(qG,{"data-slot":"combobox-empty",className:"px-2 py-1.5 text-sm text-muted-foreground",children:i}),A.jsx(AG,{children:s})]})})})}function ZY({className:t,children:e,...n}){return A.jsxs(FG,{"data-slot":"combobox-item",className:Ie(PL(),t),...n,children:[e,A.jsx($G,{children:A.jsx(xw,{className:"h-3.5 w-3.5"})})]})}Object.assign(KY,{Input:XY,Content:QY,Item:ZY});const JY={sm:"h-6 p-0.5",md:"h-8 p-1",lg:"h-10 p-1"},eX={sm:"h-5 px-2 text-xs",md:"h-6 px-2.5 text-sm",lg:"h-8 px-3 text-base"};function tX(t){return A.jsx(KG,{"data-slot":"tabs",...t})}function nX({className:t,size:e="md",...n}){return A.jsx(nW,{"data-slot":"tabs-list",className:Ie("inline-flex items-center gap-1 rounded-md bg-muted text-muted-foreground",JY[e],t),...n})}function rX({className:t,size:e="md",...n}){return A.jsx(XG,{"data-slot":"tabs-tab",className:Ie("inline-flex items-center justify-center rounded-sm border border-transparent font-medium whitespace-nowrap text-muted-foreground","outline-none focus-visible:ring-2 focus-visible:ring-ring","data-[active]:border-border data-[active]:bg-background data-[active]:text-foreground data-[active]:shadow-xs","disabled:pointer-events-none disabled:opacity-50",eX[e],t),...n})}function iX({className:t,...e}){return A.jsx(ZG,{"data-slot":"tabs-panel",className:Ie("flex-1 outline-none",t),...e})}Object.assign(tX,{List:nX,Tab:rX,Panel:iX});const oX={sm:"h-6 p-0.5",md:"h-8 p-1",lg:"h-10 p-1"},sX={sm:"h-5 px-2 text-xs [&_svg]:size-3.5",md:"h-6 px-2.5 text-sm [&_svg]:size-4",lg:"h-8 px-3 text-base [&_svg]:size-5"};function lX({className:t,size:e="md",...n}){return A.jsx(iW,{"data-slot":"toggle-group",className:Ie("inline-flex items-center gap-1 rounded-md bg-muted text-muted-foreground",oX[e],t),...n})}function aX({className:t,size:e="md",...n}){return A.jsx(oW,{"data-slot":"toggle-group-item",className:Ie("inline-flex items-center justify-center gap-1.5 rounded-sm font-medium whitespace-nowrap text-muted-foreground","outline-none focus-visible:ring-2 focus-visible:ring-ring","data-[pressed]:bg-background data-[pressed]:text-foreground data-[pressed]:shadow-xs","disabled:pointer-events-none disabled:opacity-50",sX[e],t),...n})}Object.assign(lX,{Item:aX});function uX({className:t,...e}){return A.jsx(hW,{"data-slot":"field",className:Ie("flex flex-col gap-1.5",t),...e})}function cX({className:t,...e}){return A.jsx(gW,{"data-slot":"field-label",className:Ie("text-sm font-medium text-foreground",t),...e})}function fX({className:t,size:e="md",...n}){return A.jsx(bW,{"data-slot":"field-control",className:Ie(gh({size:e}),t),...n})}function dX({className:t,...e}){return A.jsx(vW,{"data-slot":"field-description",className:Ie("text-xs text-muted-foreground",t),...e})}function hX({className:t,...e}){return A.jsx(yW,{"data-slot":"field-error",className:Ie("text-xs text-danger",t),...e})}const Oo=Object.assign(uX,{Label:cX,Control:fX,Description:dX,Error:hX});function pX({orientation:t="horizontal",className:e,...n}){return A.jsx(Sz,{"data-slot":"separator",orientation:t,className:Ie("shrink-0 bg-border",t==="vertical"?"h-4 w-px":"h-px w-full",e),...n})}const gX={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 mX({className:t,...e}){return A.jsx(xW,{"data-slot":"toolbar",className:Ie("flex items-center gap-1 border-b border-border bg-card px-2 py-1.5",t),...e})}function yX({className:t,size:e="sm",...n}){return A.jsx(wW,{"data-slot":"toolbar-button",className:Ie("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",gX[e],t),...n})}function vX({orientation:t="vertical",className:e,...n}){return A.jsx(pX,{"data-slot":"toolbar-separator",orientation:t,className:e,...n})}function bX({className:t,...e}){return A.jsx(SW,{"data-slot":"toolbar-group",className:Ie("flex items-center gap-1",t),...e})}const eo=Object.assign(mX,{Button:yX,Separator:vX,Group:bX});function xX({className:t,...e}){return A.jsx("div",{"data-slot":"description-list",className:Ie("grid grid-cols-[minmax(7rem,25%)_minmax(3rem,1fr)] gap-x-2 gap-y-2 text-sm",t),...e})}function SX({label:t,className:e,children:n,...r}){return A.jsxs("div",{"data-slot":"description-list-item",className:Ie("contents",e),...r,children:[A.jsx("span",{className:"text-muted-foreground",children:t}),A.jsx("span",{className:"min-w-0",children:n})]})}Object.assign(xX,{Item:SX});const Q1=R.createContext(null);function wX({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=Ti({render:s??A.jsx("div",{}),ref:a,props:{"data-slot":"card",className:Ie("rounded-lg border border-border bg-card text-card-foreground",i),...u}});return A.jsx(Q1.Provider,{value:{collapsible:t,open:c,toggle:()=>d(g=>!g),collapseLabel:n,expandLabel:r},children:h})}function CX({className:t,children:e,...n}){const r=R.useContext(Q1);return A.jsxs("div",{"data-slot":"card-header",className:Ie("flex items-center gap-2 p-3",t),...n,children:[r?.collapsible&&A.jsx("button",{type:"button","data-slot":"card-collapse-toggle","aria-expanded":r.open,"aria-label":r.open?r.collapseLabel:r.expandLabel,className:Ie("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:A.jsx(Sw,{"aria-hidden":"true",className:Ie("size-4 transition-transform",r.open&&"rotate-90")})}),A.jsx("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:e})]})}function RX({className:t,...e}){const n=R.useContext(Q1);return n?.collapsible&&!n.open?null:A.jsx("div",{"data-slot":"card-body",className:Ie("border-t border-border p-3",t),...e})}Object.assign(wX,{Header:CX,Body:RX});const TX=ba("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 cm({className:t,tone:e="primary",variant:n,size:r,render:i,ref:s,...a}){return Ti({render:i??A.jsx("span",{}),ref:s,props:{"data-slot":"badge",className:Ie(TX({size:r}),hy({tone:e,variant:n}),t),...a}})}function yS({className:t,type:e="text",size:n="md",...r}){return A.jsx("input",{type:e,"data-slot":"input",className:Ie(gh({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 MX({className:t,value:e,onClear:n,clearLabel:r="Clear search",size:i="md",...s}){const a=!!n&&!!e,u=EX[i];return A.jsxs("div",{"data-slot":"search-field",className:"relative flex items-center",children:[A.jsx(O6,{className:Ie("pointer-events-none absolute text-muted-foreground",u.icon)}),A.jsx("input",{type:"search",value:e,className:Ie(gh({size:i}),"min-w-0",u.input,a?u.inputPad.withClear:u.inputPad.bare,"[&::-webkit-search-cancel-button]:appearance-none",t),...s}),a&&A.jsx("button",{type:"button",onClick:n,"aria-label":r,className:Ie("absolute inline-flex items-center justify-center rounded-sm text-muted-foreground hover:text-foreground",u.clear),children:A.jsx(Pm,{className:u.clearIcon})})]})}function AX({direction:t}){return t==="asc"?A.jsx(S6,{className:"h-3 w-3"}):t==="desc"?A.jsx(x6,{className:"h-3 w-3"}):A.jsx(ww,{className:"h-3 w-3 text-muted-foreground/60"})}const OX="w-full border-collapse text-sm",kX="h-full w-full overflow-auto",bk={height:400},IX=({children:t,context:e,style:n})=>A.jsx("table",{"aria-label":e.ariaLabel,className:e.tableClassName,style:n,children:t}),DX=({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 A.jsx("tr",{...r,"aria-label":e.getRowTextValue?.(i.original,i.index)??String(i.id),className:Ie("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})},PX=({context:t})=>A.jsx("tr",{children:A.jsx("td",{colSpan:t.columnCount,children:t.renderEmptyState?.()??A.jsx("div",{className:"flex min-h-56 w-full items-center justify-center px-4 py-10 text-center",children:A.jsx("span",{className:"text-sm text-muted-foreground",children:t.isLoading?"Loading…":t.emptyMessage})})})}),zX={EmptyPlaceholder:PX,Table:IX,TableRow:DX},NX=({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:S})=>{const[C,T]=R.useState([]),E=c??C,M=R.useCallback(N=>{const B=typeof N=="function"?N(E):N;c===void 0&&T(B),d?.(B)},[c,d,E]),k=p7({columns:n,data:e,getCoreRowModel:u7(),getRowId:r,getSortedRowModel:c7(),manualSorting:h,onSortingChange:M,state:{sorting:E}}),D=k.getRowModel().rows,O=R.useMemo(()=>({ariaLabel:t,columnCount:k.getVisibleLeafColumns().length,emptyMessage:m,getRowTextValue:i,isLoading:g,onRowClick:s,renderEmptyState:y,tableClassName:Ie(OX,b)}),[t,b,m,i,g,s,y,k]),I=R.useCallback((N,B)=>B.getVisibleCells().map(H=>A.jsx("td",{className:"px-3 py-1.5 text-foreground",children:Ab(H.column.columnDef.cell,H.getContext())},H.id)),[]),L=R.useCallback(()=>k.getHeaderGroups().map(N=>A.jsx("tr",{className:"border-b border-border bg-card",children:N.headers.map(B=>{const H=B.column.getCanSort(),F=B.column.getIsSorted();return A.jsx("th",{"aria-sort":H?F==="asc"?"ascending":F==="desc"?"descending":"none":void 0,colSpan:B.colSpan,className:"h-8 px-3 text-left text-xs font-medium text-muted-foreground",scope:"col",children:B.isPlaceholder?null:H?A.jsxs("button",{className:"inline-flex items-center gap-1 hover:text-foreground",onClick:B.column.getToggleSortingHandler(),type:"button",children:[Ab(B.column.columnDef.header,B.getContext()),A.jsx("span",{"aria-hidden":"true",children:A.jsx(AX,{direction:F})})]}):Ab(B.column.columnDef.header,B.getContext())},B.id)})},N.id)),[k]),_=R.useCallback((N,B)=>B.id,[]);return A.jsx(NK,{className:Ie(kX,x),components:zX,computeItemKey:_,context:O,data:D,endReached:u,fixedHeaderContent:L,itemContent:I,startReached:a,style:S?{...bk,...S}:bk})},LX={sm:"h-6 text-xs",md:"h-8 text-sm",lg:"h-10 text-base"};function BX({className:t,...e}){return A.jsx("div",{"data-slot":"list",className:Ie("flex flex-col gap-4",t),...e})}function jX({className:t,label:e,children:n,...r}){return A.jsxs("div",{"data-slot":"list-group",className:Ie("flex flex-col gap-0.5",t),...r,children:[e&&A.jsx("div",{"data-slot":"list-group-label",className:"px-2 py-1 text-xs font-medium text-sidebar-foreground/60",children:e}),n]})}function _X({className:t,selected:e=!1,leading:n,trailing:r,size:i="md",children:s,type:a="button",render:u,ref:c,...d}){return Ti({render:u??A.jsx("button",{type:a}),ref:c,props:{"data-slot":"list-item","data-selected":e||void 0,"aria-current":e||void 0,className:Ie("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",LX[i],t),children:A.jsxs(A.Fragment,{children:[n&&A.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}),A.jsx("span",{className:"min-w-0 flex-1 truncate",children:s}),r]}),...d}})}Object.assign(BX,{Group:jX,Item:_X});const vS=R.createContext(0),HX=16,VX=8,FX={sm:"h-6 text-xs",md:"h-8 text-sm",lg:"h-10 text-base"};function $X({className:t,children:e,...n}){return A.jsx("div",{"data-slot":"nested-list",className:Ie("flex flex-col gap-0.5",t),...n,children:A.jsx(vS.Provider,{value:0,children:e})})}function UX({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(vS),b=R.Children.count(d)>0,[x,S]=R.useState(a),C=u??x,T=E=>{const M=!C;S(M),c?.(M),h?.(E)};return A.jsxs("div",{"data-slot":"nested-list-item",children:[A.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:VX+y*HX},className:Ie("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",FX[s],t),onClick:b?T:h,...m,children:[b?A.jsx(Sw,{"data-slot":"nested-list-item-chevron",className:Ie("h-3.5 w-3.5 shrink-0 text-sidebar-foreground/60 transition-transform",C&&"rotate-90")}):A.jsx("span",{className:"h-3.5 w-3.5 shrink-0"}),n&&A.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}),A.jsx("span",{className:"flex-1 whitespace-nowrap",children:e}),r]}),b&&C&&A.jsx(vS.Provider,{value:y+1,children:A.jsx("div",{"data-slot":"nested-list-children",className:"flex flex-col gap-0.5",children:d})})]})}Object.assign($X,{Item:UX});const qX={sm:"h-6 text-xs",md:"h-8 text-sm",lg:"h-10 text-base"};function GX({className:t,...e}){return A.jsx("nav",{"data-slot":"sidebar",className:Ie("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 WX({className:t,label:e,children:n,...r}){return A.jsxs("div",{"data-slot":"sidebar-group",className:Ie("flex flex-col gap-0.5",t),...r,children:[e&&A.jsx("div",{"data-slot":"sidebar-group-label",className:"px-2 py-1 text-xs font-medium text-sidebar-foreground/60",children:e}),n]})}function KX({className:t,selected:e=!1,leading:n,trailing:r,size:i="md",children:s,type:a="button",render:u,ref:c,...d}){return Ti({render:u??A.jsx("button",{type:a}),ref:c,props:{"data-slot":"sidebar-item","data-selected":e||void 0,"aria-current":e||void 0,className:Ie("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",qX[i],t),children:A.jsxs(A.Fragment,{children:[n&&A.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}),A.jsx("span",{className:"min-w-0 flex-1 truncate",children:s}),r]}),...d}})}function YX({className:t,...e}){return A.jsx("header",{"data-slot":"sidebar-header",className:Ie("sticky top-0 z-10 flex h-12 shrink-0 items-center border-b border-sidebar-border bg-sidebar px-3",t),...e})}function XX({className:t,...e}){return A.jsx("footer",{"data-slot":"sidebar-footer",className:Ie("flex shrink-0 gap-1 border-t border-sidebar-border p-2",t),...e})}const Nb=Object.assign(GX,{Group:WX,Item:KX,Header:YX,Footer:XX});function zL({className:t,icon:e,title:n,description:r,action:i,render:s,ref:a,children:u,...c}){return Ti({render:s??A.jsx("div",{}),ref:a,props:{"data-slot":"empty-state",className:Ie("flex flex-1 flex-col items-center justify-center gap-3 p-8 text-center",t),children:A.jsxs(A.Fragment,{children:[e&&A.jsx(e,{className:"h-8 w-8 text-muted-foreground"}),A.jsx("p",{className:"text-sm font-medium text-foreground",children:n}),r&&A.jsx("p",{className:"max-w-sm text-sm text-muted-foreground",children:r}),i]}),...c}})}const QX=new Set(["object","array"]);function Z1(t){if(t===null)return"null";if(Array.isArray(t))return"array";const e=typeof t;return e==="object"?"object":e}function ZX(t){return QX.has(Z1(t))}function NL(t){if(Array.isArray(t))return t.map((e,n)=>String(n));if(Z1(t)==="object")return Object.keys(t)}function JX(t){const e=NL(t)??[];return Array.isArray(t)?`[${e.length}]`:`{${e.length}}`}function eQ({data:t,className:e,defaultExpandedDepth:n=1}){return A.jsx("div",{"data-slot":"json-inspector",className:Ie("font-mono text-xs",e),children:A.jsx(LL,{label:null,value:t,depth:0,defaultExpandedDepth:n})})}function LL({label:t,value:e,depth:n,defaultExpandedDepth:r}){const[i,s]=R.useState(n<r);if(!ZX(e))return A.jsxs("div",{"data-slot":"json-inspector-leaf",className:"flex gap-1",children:[t!==null&&A.jsxs("span",{className:"text-muted-foreground",children:[t,":"]}),A.jsx(nQ,{value:e})]});const a=NL(e)??[];return A.jsxs("div",{"data-slot":"json-inspector-node",children:[A.jsxs("button",{type:"button",onClick:()=>s(u=>!u),className:"inline-flex items-center gap-1 text-foreground hover:text-primary",children:[A.jsx(Sw,{className:Ie("h-3 w-3 shrink-0 text-muted-foreground transition-transform",i&&"rotate-90")}),t!==null&&A.jsxs("span",{className:"text-muted-foreground",children:[t,":"]}),A.jsx("span",{className:"text-muted-foreground",children:JX(e)})]}),i&&A.jsx("div",{className:"ml-3.5 border-l border-border pl-2",children:a.map(u=>A.jsx(LL,{label:u,value:e[u],depth:n+1,defaultExpandedDepth:r},u))})]})}const tQ={string:"text-primary",number:"text-accent-foreground",boolean:"text-secondary-foreground",null:"text-danger",undefined:"text-danger"};function nQ({value:t}){const e=Z1(t),n=e==="string"?`"${t}"`:String(t);return A.jsx("span",{className:tQ[e]??"text-foreground",children:n})}function BL(t){if(t.selfValue!==void 0)return Math.max(0,t.selfValue);const e=(t.children??[]).reduce((n,r)=>n+r.value,0);return Math.max(0,t.value-e)}function py(t,e,n){return t.id!==void 0?t.id:e===null?`0:${t.name}`:`${e}/${n}:${t.name}`}function jL(t){let e=BL(t);for(const n of t.children??[])e=Math.max(e,jL(n));return e}function rQ(t){return t>.7?"heaviest":t>.4?"heavy":t>.2?"moderate":t>0?"light":"none"}const _L={heaviest:"bg-danger text-danger-foreground",heavy:"bg-warning text-warning-foreground",moderate:"bg-info text-info-foreground",light:"bg-success text-success-foreground",none:"bg-muted text-muted-foreground"},iQ={heaviest:"bg-danger/20 text-muted-foreground",heavy:"bg-warning/20 text-muted-foreground",moderate:"bg-info/20 text-muted-foreground",light:"bg-success/20 text-muted-foreground",none:"bg-muted/40 text-muted-foreground"};function oQ(t,e){if(!e)return!0;const n=e.toLowerCase();return t.name.toLowerCase().includes(n)||(t.tooltip?.toLowerCase().includes(n)??!1)}function sQ(t,e){return HL(t,null,0,0,e)}function HL(t,e,n,r,i){const s=py(t,e,n);if(s===i)return[{node:t,key:s,depth:r}];for(const[a,u]of(t.children??[]).entries()){const c=HL(u,s,a,r+1,i);if(c)return[{node:t,key:s,depth:r},...c]}return null}function J1(t,e,n,r,i,s){const a=BL(e);t.frames.push({key:n,node:e,depth:r,left:i,width:s,selfValue:a,heat:t.maxSelfValue>0?a/t.maxSelfValue:0}),t.maxDepth=Math.max(t.maxDepth,r)}function VL(t,e,n,r,i,s){const a=i/s*100,u=e.value/s*100;if(u<t.minFrameWidth)return;J1(t,e,n,r,a,u);let c=i;(e.children??[]).forEach((d,h)=>{const g=py(d,n,h);VL(t,d,g,r+1,c,s),c+=d.value})}function FL(t,e,n,r,i,s){if(s<t.minFrameWidth)return;J1(t,e,n,r,i,s);const a=e.children??[];if(a.length===0)return;const u=s/a.length;a.forEach((c,d)=>{const h=py(c,n,d);FL(t,c,h,r+1,i+d*u,u)})}function lQ(t,e={}){if(!t)return{frames:[],depthCount:0,focusedNode:null};const{focusedKey:n=null,minFrameWidth:r=0}=e,i=n?sQ(t,n):null,s=i?i.slice(0,-1):[],a=i?i[i.length-1]:null,u=a?a.node:null,c={frames:[],minFrameWidth:r,maxSelfValue:jL(t),maxDepth:0};for(const m of s)J1(c,m.node,m.key,m.depth,0,100);const d=u??t,h=a?a.key:py(t,null,0),g=s.length;return d.value>0?VL(c,d,h,g,0,d.value):FL(c,d,h,g,0,100),{frames:c.frames,depthCount:c.maxDepth+1,focusedNode:u}}const aQ=20,uQ=.08,cQ=3;function fQ(t){return String(t)}function dQ(t){return t?t.value>0||(t.children?.length??0)>0:!1}function hQ({className:t,data:e,focusedKey:n,onFocusedKeyChange:r,selectedKey:i,onSelect:s,rowHeight:a=aQ,formatValue:u=fQ,highlight:c,minFrameWidth:d=uQ,emptyState:h,onKeyDown:g,...m}){const[y,b]=R.useState(null),x=n??y??void 0,{frames:S,depthCount:C}=R.useMemo(()=>lQ(e,{focusedKey:x,minFrameWidth:d}),[e,x,d]),T=R.useMemo(()=>{const D=Array.from({length:C},()=>[]);for(const O of S)D[O.depth]?.push(O);return D},[S,C]),E=()=>{b(null),r?.(null,null)},M=D=>{b(D.key),r?.(D.key,D.node),s?.(D.key,D.node)},k=D=>{D.key==="Escape"&&E(),g?.(D)};return dQ(e)?A.jsx("div",{"data-slot":"flame-graph",className:Ie("overflow-auto",t),onKeyDown:k,...m,children:A.jsx("div",{style:{height:C*a},className:"relative w-full transition-[height] duration-150 ease-out motion-reduce:transition-none",children:T.map((D,O)=>A.jsx("div",{className:"relative",style:{height:a},children:D.map(I=>A.jsx(pQ,{frame:I,formatValue:u,highlight:c,selected:I.key===i,onClick:M},I.key))},O))})}):A.jsx("div",{"data-slot":"flame-graph",className:Ie("flex flex-col",t),...m,children:h??A.jsx(zL,{title:"No profiling data",description:"Once frames are captured, the flame graph will appear here."})})}function pQ({frame:t,formatValue:e,highlight:n,selected:r,onClick:i}){const{node:s,left:a,width:u,heat:c}=t,d=rQ(c),h=e(s.value),g=oQ(s,n);return A.jsx("button",{type:"button","data-slot":"flame-graph-frame",title:`${s.tooltip??s.name} — ${h}`,"aria-label":`${s.name}: ${h}`,onClick:()=>i(t),style:{left:`${a}%`,width:`${u}%`},className:Ie("absolute inset-y-0 overflow-hidden border-r border-background/50 px-1 text-left","transition-[left,width] duration-150 ease-out motion-reduce:transition-none","outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset",g?_L[d]:iQ[d],n&&g&&"ring-1 ring-primary ring-inset",r&&"ring-2 ring-ring ring-inset"),children:u>cQ&&A.jsx("span",{className:Ie("block truncate text-[11px] leading-none",n&&g&&"font-medium"),children:s.name})})}const gQ=[{bucket:"heaviest",label:"Heaviest (>70%)"},{bucket:"heavy",label:"Heavy (40-70%)"},{bucket:"moderate",label:"Moderate (20-40%)"},{bucket:"light",label:"Light (<20%)"},{bucket:"none",label:"No self time"}];function mQ({className:t,...e}){return A.jsx("div",{"data-slot":"flame-graph-legend",className:Ie("flex flex-wrap items-center gap-3",t),...e,children:gQ.map(({bucket:n,label:r})=>A.jsxs("div",{className:"flex items-center gap-1.5",children:[A.jsx("span",{className:Ie("h-3 w-3 shrink-0 rounded-sm",_L[n])}),A.jsx(JK,{variant:"caption",children:r})]},n))})}Object.assign(hQ,{Legend:mQ});const xk=["string","number","boolean","buffer"],ag=({adapterId:t,storageId:e})=>`${t}:${e}`,Lb=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,yQ=t=>typeof t=="object"&&t!==null&&!Array.isArray(t),gy=(t,e)=>{if(!yQ(t))throw new Io(e,`Expected object, got ${hs(t)}`);return t},iu=(t,e)=>{if(typeof t!="string")throw new Io(e,`Expected string, got ${hs(t)}`);return t},$L=(t,e)=>{if(!Array.isArray(t))throw new Io(e,`Expected array, got ${hs(t)}`);return t},UL=(t,e)=>{if(typeof t!="string"||!xk.includes(t))throw new Io(e,`Expected one of ${xk.join(", ")}, got ${hs(t)}`);return t},vQ=(t,e)=>{const n=gy(t,e);return{supportedTypes:$L(n.supportedTypes,`${e}.supportedTypes`).map((s,a)=>UL(s,`${e}.supportedTypes[${a}]`))}},bQ=t=>{const e=gy(t,"storage");return{adapterId:iu(e.adapterId,"storage.adapterId"),storageId:iu(e.storageId,"storage.storageId"),adapterName:iu(e.adapterName,"storage.adapterName"),storageName:iu(e.storageName,"storage.storageName"),capabilities:vQ(e.capabilities,"storage.capabilities")}},xQ=(t,e)=>{const n=gy(t,e),r=iu(n.key,`${e}.key`),i=UL(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}}}},SQ=t=>{try{const e=gy(t,"$"),n=e.version;if(n!==Lb)throw new Io("version",`Unsupported snapshot version: ${hs(n)} (this build supports version ${Lb})`);const r=iu(e.plugin,"plugin"),i=iu(e.createdAt,"createdAt"),s=bQ(e.storage),u=$L(e.entries,"entries").map((c,d)=>xQ(c,`entries[${d}]`));return{ok:!0,snapshot:{version:Lb,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 bS=[],qL=[];(()=>{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?qL:bS).push(n=n+t[e])})();function wQ(t){if(t<768)return!1;for(let e=0,n=bS.length;;){let r=e+n>>1;if(t<bS[r])n=r;else if(t>=qL[r])e=r+1;else return!0;if(e==n)return!1}}function Sk(t){return t>=127462&&t<=127487}const wk=8205;function CQ(t,e,n=!0,r=!0){return(n?GL:RQ)(t,e,r)}function GL(t,e,n){if(e==t.length)return e;e&&WL(t.charCodeAt(e))&&KL(t.charCodeAt(e-1))&&e--;let r=Bb(t,e);for(e+=Ck(r);e<t.length;){let i=Bb(t,e);if(r==wk||i==wk||n&&wQ(i))e+=Ck(i),r=i;else if(Sk(i)){let s=0,a=e-2;for(;a>=0&&Sk(Bb(t,a));)s++,a-=2;if(s%2==0)break;e+=2}else break}return e}function RQ(t,e,n){for(;e>0;){let r=GL(t,e-2,n);if(r<e)return r;e--}return 0}function Bb(t,e){let n=t.charCodeAt(e);if(!KL(n)||e+1==t.length)return n;let r=t.charCodeAt(e+1);return WL(r)?(n-55296<<10)+(r-56320)+65536:n}function WL(t){return t>=56320&&t<57344}function KL(t){return t>=55296&&t<56320}function Ck(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]=Nc(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]=Nc(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 YL(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 XL(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=TQ(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 EQ(i,u,r,a);i=u+1,r++}}decompose(e,n,r,i){let s=e<=0&&n>=this.length?this:new rr(Rk(this.text,e,n),Math.min(n,this.length)-Math.max(0,e));if(i&1){let a=r.pop(),u=Bg(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]=Nc(this,e,n);let i=Bg(this.text,Bg(r.text,Rk(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]=Nc(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]=Nc(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]=Nc(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 TQ(t){let e=-1;for(let n of t)e+=n.length+1;return e}function Bg(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 Rk(t,e,n){return Bg(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 YL{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 XL{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]=YL.prototype[Symbol.iterator]=XL.prototype[Symbol.iterator]=function(){return this});class EQ{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 Nc(t,e,n){return e=Math.max(0,Math.min(t.length,e)),[e,Math.max(e,Math.min(t.length,n))]}function Zr(t,e,n=!0,r=!0){return CQ(t,e,n,r)}function MQ(t){return t>=56320&&t<57344}function AQ(t){return t>=55296&&t<56320}function OQ(t,e){let n=t.charCodeAt(e);if(!AQ(n)||e+1==t.length)return n;let r=t.charCodeAt(e+1);return MQ(r)?(n-55296<<10)+(r-56320)+65536:n}function kQ(t){return t<65536?1:2}const xS=/\r\n?|\n/;var Bi=(function(t){return t[t.Simple=0]="Simple",t[t.TrackDel=1]="TrackDel",t[t.TrackBefore=2]="TrackBefore",t[t.TrackAfter=3]="TrackAfter",t})(Bi||(Bi={}));class ws{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){SS(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 ws(e)}composeDesc(e){return this.empty?e:e.empty?this:QL(this,e)}mapDesc(e,n=!1){return e.empty?this:wS(this,e,n)}mapPos(e,n=-1,r=Bi.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!=Bi.Simple&&d>=e&&(r==Bi.TrackDel&&i<e&&d>e||r==Bi.TrackBefore&&i<e||r==Bi.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 ws(e)}static create(e){return new ws(e)}}class wr extends ws{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 SS(this,(n,r,i,s,a)=>e=e.replace(i,i+(r-n),a),!1),e}mapDesc(e,n=!1){return wS(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:QL(this,e,!0)}map(e,n=!1){return e.empty?this:wS(this,e,n,!0)}iterChanges(e,n=!1){SS(this,e,n)}get desc(){return ws.create(this.sections)}filter(e){let n=[],r=[],i=[],s=new Ud(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);Xr(i,h,-1);let g=s.ins==-1?-1:s.off==0?s.ins:0;Xr(n,h,g),g>0&&ra(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);Xr(n,h,-1),Xr(i,h,s.ins==-1?-1:s.off==0?s.ins:0),s.forward(h),u+=h}}return{changes:new wr(n,r),filtered:ws.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&&Xr(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||xS)):y:Yt.empty,x=b.length;if(g==m&&x==0)return;g<a&&c(),g>a&&Xr(i,g-a,-1),Xr(i,m-g,x),ra(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 Xr(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 ra(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 SS(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 wS(t,e,n,r=!1){let i=[],s=r?[]:null,a=new Ud(t),u=new Ud(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);Xr(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(Xr(i,u.ins,-1);d;){let h=Math.min(a.len,d);a.ins>=0&&c<a.i&&a.len<=h&&(Xr(i,0,a.ins),s&&ra(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;Xr(i,d,c<a.i?a.ins:0),s&&c<a.i&&ra(s,i,a.text),c=a.i,a.forward(a.len-h)}else{if(a.done&&u.done)return s?wr.createSet(i,s):ws.create(i);throw new Error("Mismatched change set lengths")}}}function QL(t,e,n=!1){let r=[],i=n?[]:null,s=new Ud(t),a=new Ud(e);for(let u=!1;;){if(s.done&&a.done)return i?wr.createSet(r,i):ws.create(r);if(s.ins==0)Xr(r,s.len,0,u),s.next();else if(a.len==0&&!a.done)Xr(r,0,a.ins,u),i&&ra(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;Xr(r,c,h,u),i&&h&&ra(i,r,a.text)}else a.ins==-1?(Xr(r,s.off?0:s.len,c,u),i&&ra(i,r,s.textBit(c))):(Xr(r,s.off?0:s.len,a.off?0:a.ins,u),i&&!a.off&&ra(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 Ud{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 ou{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 ou(r,i,this.flags)}extend(e,n=e,r=0){if(e<=this.anchor&&n>=this.anchor)return Ne.range(e,n,void 0,void 0,r);let i=Math.abs(e-this.anchor)>Math.abs(n-this.anchor)?e:n;return Ne.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 Ne.range(e.anchor,e.head)}static create(e,n,r){return new ou(e,n,r)}}class Ne{constructor(e,n){this.ranges=e,this.mainIndex=n}map(e,n=-1){return e.empty?this:Ne.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 Ne([this.main],0)}addRange(e,n=!0){return Ne.create([e].concat(this.ranges),n?0:this.mainIndex+1)}replaceRange(e,n=this.mainIndex){let r=this.ranges.slice();return r[n]=e,Ne.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 Ne(e.ranges.map(n=>ou.fromJSON(n)),e.main)}static single(e,n=e){return new Ne([Ne.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 Ne.normalized(e.slice(),n);r=s.to}return new Ne(e,n)}static cursor(e,n=0,r,i){return ou.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?ou.create(n,e,48|a):ou.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?Ne.range(c,u):Ne.range(u,c))}}return new Ne(e,n)}}function ZL(t,e){for(let n of t.ranges)if(n.to>e)throw new RangeError("Selection points outside of document")}let eC=0;class bt{constructor(e,n,r,i,s){this.combine=e,this.compareInput=n,this.compare=r,this.isStatic=i,this.id=eC++,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:tC),!!e.static,e.enables)}of(e){return new jg([],this,0,e)}compute(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new jg(e,this,1,n)}computeN(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new jg(e,this,2,n)}from(e,n){return n||(n=r=>r),this.compute([e],r=>n(r.field(e)))}}function tC(t,e){return t==e||t.length==e.length&&t.every((n,r)=>n===e[r])}class jg{constructor(e,n,r,i){this.dependencies=e,this.facet=n,this.type=r,this.value=i,this.id=eC++}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)||CS(g,h)){let y=r(g);if(u?!Tk(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=dm(m,b);if(this.dependencies.every(S=>S instanceof bt?m.facet(S)===g.facet(S):S instanceof Ea?m.field(S,!1)==g.field(S,!1):!0)||(u?Tk(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 Tk(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 CS(t,e){let n=!1;for(let r of e)bd(t,r)&1&&(n=!0);return n}function IQ(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=dm(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(!CS(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=CS(c,r),g=d.config.facets[e.id],m=d.facet(e);if(g&&!h&&tC(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 ug=bt.define({static:!0});class Ea{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 Ea(eC++,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(ug).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(ug),a=i.facet(ug),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,ug.of({field:this,create:e})]}get extension(){return this}}const eu={lowest:4,low:3,default:2,high:1,highest:0};function Zf(t){return e=>new eB(e,t)}const JL={highest:Zf(eu.highest),high:Zf(eu.high),default:Zf(eu.default),low:Zf(eu.low),lowest:Zf(eu.lowest)};class eB{constructor(e,n){this.inner=e,this.prec=n}}class my{of(e){return new RS(this,e)}reconfigure(e){return my.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class RS{constructor(e,n){this.compartment=e,this.inner=n}}class fm{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 DQ(e,n,a))m instanceof Ea?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(S=>S.type==0))if(u[b.id]=c.length<<1|1,tC(x,y))c.push(r.facet(b));else{let S=b.combine(y.map(C=>C.value));c.push(r&&b.compare(S,r.facet(b))?r.facet(b):S)}else{for(let S of y)S.type==0?(u[S.id]=c.length<<1|1,c.push(S.value)):(u[S.id]=d.length<<1,d.push(C=>S.dynamicSlot(C)));u[b.id]=d.length<<1,d.push(S=>IQ(S,b,y))}}let g=d.map(m=>m(u));return new fm(e,a,g,u,c,s)}}function DQ(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 RS&&n.delete(a.compartment)}if(i.set(a,u),Array.isArray(a))for(let d of a)s(d,u);else if(a instanceof RS){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 eB)s(a.inner,a.prec);else if(a instanceof Ea)r[u].push(a),a.provides&&s(a.provides,u);else if(a instanceof jg)r[u].push(a),a.facet.extensions&&s(a.facet.extensions,eu.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,eu.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 dm(t,e){return e&1?t.config.staticValues[e>>1]:t.values[e>>1]}const tB=bt.define(),TS=bt.define({combine:t=>t.some(e=>e),static:!0}),nB=bt.define({combine:t=>t.length?t[0]:void 0,static:!0}),rB=bt.define(),iB=bt.define(),oB=bt.define(),sB=bt.define({combine:t=>t.length?t[0]:!1});class Ma{constructor(e,n){this.type=e,this.value=n}static define(){return new PQ}}class PQ{of(e){return new Ma(this,e)}}class zQ{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 zQ(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&&ZL(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=Ma.define();Rr.userEvent=Ma.define();Rr.addToHistory=Ma.define();Rr.remote=Ma.define();function NQ(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 lB(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 ES(t,e,n){let r=e.selection,i=Cc(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(nB)),selection:r&&(r instanceof Ne?r:Ne.single(r.anchor,r.head)),effects:Cc(e.effects),annotations:i,scrollIntoView:!!e.scrollIntoView}}function aB(t,e,n){let r=ES(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=lB(r,ES(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 BQ(n?LQ(i):i)}function LQ(t){let e=t.startState,n=!0;for(let i of e.facet(rB)){let s=i(t);if(s===!1){n=!1;break}Array.isArray(s)&&(n=n===!0?s:NQ(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(iB);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=aB(e,Cc(s),!1)}return t}function BQ(t){let e=t.startState,n=e.facet(oB),r=t;for(let i=n.length-1;i>=0;i--){let s=n[i](t);s&&Object.keys(s).length&&(r=lB(r,ES(e,s,t.changes.newLength),!0))}return r==t?t:Rr.create(e,t.changes,t.selection,r.effects,r.annotations,r.scrollIntoView)}const jQ=[];function Cc(t){return t==null?jQ:Array.isArray(t)?t:[t]}var nl=(function(t){return t[t.Word=0]="Word",t[t.Space=1]="Space",t[t.Other=2]="Other",t})(nl||(nl={}));const _Q=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let MS;try{MS=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function HQ(t){if(MS)return MS.test(t);for(let e=0;e<t.length;e++){let n=t[e];if(/\w/.test(n)||n>"€"&&(n.toUpperCase()!=n.toLowerCase()||_Q.test(n)))return!0}return!1}function VQ(t){return e=>{if(!/\S/.test(e))return nl.Space;if(HQ(e))return nl.Word;for(let n=0;n<t.length;n++)if(e.indexOf(t[n])>-1)return nl.Word;return nl.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),dm(this,r)}update(...e){return aB(this,e,!0)}applyTransaction(e){let n=this.config,{base:r,compartments:i}=n;for(let u of e.effects)u.is(my.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=Cc(r).concat(u.value));let s;n?s=e.startState.values.slice():(n=fm.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(TS)?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:Ne.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=Cc(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(Cc(c.effects),g))}return{changes:i,selection:Ne.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)||xS))}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),dm(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 Ea&&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:Ne.fromJSON(e.selection),extensions:n.extensions?i.concat([n.extensions]):i})}static create(e={}){let n=fm.resolve(e.extensions||[],new Map),r=e.doc instanceof Yt?e.doc:Yt.of((e.doc||"").split(n.staticFacet(an.lineSeparator)||xS)),i=e.selection?e.selection instanceof Ne?e.selection:Ne.single(e.selection.anchor,e.selection.head):Ne.single(0);return ZL(i,r.length),n.staticFacet(TS)||(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(sB)}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(tB))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 VQ(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=Zr(n,a,!1);if(s(n.slice(c,a))!=nl.Word)break;a=c}for(;u<i;){let c=Zr(n,u);if(s(n.slice(u,c))!=nl.Word)break;u=c}return a==u?null:Ne.range(a+r,u+r)}}an.allowMultipleSelections=TS;an.tabSize=bt.define({combine:t=>t.length?t[0]:4});an.lineSeparator=nB;an.readOnly=sB;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=tB;an.changeFilter=rB;an.transactionFilter=iB;an.transactionExtender=oB;my.reconfigure=sr.define();function FQ(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 vu{eq(e){return this==e}range(e,n=e){return AS.create(e,n,this)}}vu.prototype.startSide=vu.prototype.endSide=0;vu.prototype.point=!1;vu.prototype.mapMode=Bi.TrackDel;function nC(t,e){return t==e||t.constructor==e.constructor&&t.eq(e)}let AS=class uB{constructor(e,n,r){this.from=e,this.to=n,this.value=r}static create(e,n,r){return new uB(e,n,r)}};function OS(t,e){return t.from-e.from||t.value.startSide-e.value.startSide}class rC{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 rC(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(OS)),this.isEmpty)return n.length?pn.of(n):this;let u=new cB(this,null,-1).goto(0),c=0,d=[],h=new hm;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(AS.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=Ek(a,u,r),d=new Jf(a,c,s),h=new Jf(u,c,s);r.iterGaps((g,m,y)=>Mk(d,g,h,m,y,i)),r.empty&&r.length==0&&Mk(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=Ek(s,a),c=new Jf(s,u,0).goto(r),d=new Jf(a,u,0).goto(r);for(;;){if(c.to!=d.to||!kS(c.active,d.active)||c.point&&(!d.point||!nC(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 hm;for(let i of e instanceof AS?[e]:n?$Q(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 $Q(t){if(t.length>1)for(let e=t[0],n=1;n<t.length;n++){let r=t[n];if(OS(e,r)>0)return t.slice().sort(OS);e=r}return t}pn.empty.nextLayer=pn.empty;class hm{finishChunk(e){this.chunks.push(new rC(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 hm)).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 Ek(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 cB{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 cB(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--)jb(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--)jb(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(),jb(this.heap,0)}}}function jb(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){cg(this.active,e),cg(this.activeTo,e),cg(this.activeRank,e),this.minActive=Ak(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++;fg(this.active,n,r),fg(this.activeTo,n,i),fg(this.activeRank,n,s),e&&fg(e,n,this.cursor.from),this.minActive=Ak(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&&cg(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 Mk(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&&nC(t.point,n.point)&&kS(t.activeForPoint(t.to),n.activeForPoint(n.to))||s.comparePoint(u,b,t.point,n.point),h=!1):(h&&s.boundChange(u),b>u&&!kS(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 kS(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!=e[n]&&!nC(t[n],e[n]))return!1;return!0}function cg(t,e){for(let n=e,r=t.length-1;n<r;n++)t[n]=t[n+1];t.pop()}function fg(t,e,n){for(let r=t.length-1;r>=e;r--)t[r+1]=t[r];t[e]=n}function Ak(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 yy(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=Zr(t,i));return r}function UQ(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=Zr(t,i)}return t.length}const IS="ͼ",Ok=typeof Symbol>"u"?"__"+IS:Symbol.for(IS),DS=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),kk=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class Lc{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(S=>x.replace(/&/,S))).reduce((x,S)=>x.concat(S)),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=kk[Ok]||1;return kk[Ok]=e+1,IS+e.toString(36)}static mount(e,n,r){let i=e[DS],s=r&&r.nonce;i?s&&i.setNonce(s):i=new qQ(e,s),i.mount(Array.isArray(n)?n:[n],e)}}let Ik=new Map;class qQ{constructor(e,n){let r=e.ownerDocument||e,i=r.defaultView;if(!e.head&&e.adoptedStyleSheets&&i.CSSStyleSheet){let s=Ik.get(r);if(s)return e[DS]=s;this.sheet=new i.CSSStyleSheet,Ik.set(r,this)}else this.styleTag=r.createElement("style"),n&&this.styleTag.setAttribute("nonce",n);this.modules=[],e[DS]=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:'"'},GQ=typeof navigator<"u"&&/Mac/.test(navigator.platform),WQ=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 _b in ga)Gd.hasOwnProperty(_b)||(Gd[_b]=ga[_b]);function KQ(t){var e=GQ&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||WQ&&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:""},PS=typeof document<"u"?document:{documentElement:{style:{}}};const zS=/Edge\/(\d+)/.exec(oi.userAgent),fB=/MSIE \d/.test(oi.userAgent),NS=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(oi.userAgent),vy=!!(fB||NS||zS),Dk=!vy&&/gecko\/(\d+)/i.test(oi.userAgent),Hb=!vy&&/Chrome\/(\d+)/.exec(oi.userAgent),YQ="webkitFontSmoothing"in PS.documentElement.style,LS=!vy&&/Apple Computer/.test(oi.vendor),Pk=LS&&(/Mobile\/\w+/.test(oi.userAgent)||oi.maxTouchPoints>2);var Ye={mac:Pk||/Mac/.test(oi.platform),windows:/Win/.test(oi.platform),linux:/Linux|X11/.test(oi.platform),ie:vy,ie_version:fB?PS.documentMode||6:NS?+NS[1]:zS?+zS[1]:0,gecko:Dk,gecko_version:Dk?+(/Firefox\/(\d+)/.exec(oi.userAgent)||[0,0])[1]:0,chrome:!!Hb,chrome_version:Hb?+Hb[1]:0,ios:Pk,android:/Android\b/.test(oi.userAgent),webkit_version:YQ?+(/\bAppleWebKit\/(\d+)/.exec(oi.userAgent)||[0,0])[1]:0,safari:LS,safari_version:LS?+(/\bVersion\/(\d+(\.\d+)?)/.exec(oi.userAgent)||[0,0])[1]:0,tabSize:PS.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function iC(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 pm=Object.create(null);function oC(t,e,n){if(t==e)return!0;t||(t=pm),e||(e=pm);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 XQ(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 zk(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 QQ(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 by{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 ho=(function(t){return t[t.Text=0]="Text",t[t.WidgetBefore=1]="WidgetBefore",t[t.WidgetAfter=2]="WidgetAfter",t[t.WidgetRange=3]="WidgetRange",t})(ho||(ho={}));class ei extends vu{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 mh(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 bu(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}=dB(e,n);r=(s?n?-3e8:-1:5e8)-1,i=(a?n?2e8:1:-6e8)+1}return new bu(e,r,i,n,e.widget||null,!0)}static line(e){return new yh(e)}static set(e,n=!1){return pn.of(e,n)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}ei.none=pn.empty;class mh extends ei{constructor(e){let{start:n,end:r}=dB(e);super(n?-1:5e8,r?1:-6e8,null,e),this.tagName=e.tagName||"span",this.attrs=e.class&&e.attributes?iC(e.attributes,{class:e.class}):e.class?{class:e.class}:e.attributes||pm}eq(e){return this==e||e instanceof mh&&this.tagName==e.tagName&&oC(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)}}mh.prototype.point=!1;class yh extends ei{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof yh&&this.spec.class==e.spec.class&&oC(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)}}yh.prototype.mapMode=Bi.TrackBefore;yh.prototype.point=!0;class bu extends ei{constructor(e,n,r,i,s,a){super(n,r,s,e),this.block=i,this.isReplace=a,this.mapMode=i?n<=0?Bi.TrackBefore:Bi.TrackAfter:Bi.TrackDel}get type(){return this.startSide!=this.endSide?ho.WidgetRange:this.startSide<=0?ho.WidgetBefore:ho.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof bu&&ZQ(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)}}bu.prototype.point=!0;function dB(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 ZQ(t,e){return t==e||!!(t&&e&&t.compare(e))}function Rc(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 vu{constructor(e,n){super(),this.tagName=e,this.attributes=n}eq(e){return e==this||e instanceof Wd&&this.tagName==e.tagName&&oC(this.attributes,e.attributes)}static create(e){return new Wd(e.tagName,e.attributes||pm)}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 BS(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 BS(t,e.anchorNode)}catch{return!1}}function _g(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?Nk(t,e,n,r,-1)||Nk(t,e,n,r,1):!1}function ma(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e}function gm(t){return t.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(t.nodeName)}function Nk(t,e,n,r,i){for(;;){if(t==n&&e==r)return!0;if(e==(i<0?0:cl(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?cl(t):0}else return!1}}function cl(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function mm(t,e){let n=e?t.left:t.right;return{left:n,right:n,top:t.top,bottom:t.bottom}}function JQ(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 hB(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 eZ(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=JQ(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}=hB(h,T)),m={left:T.left,right:T.left+h.clientWidth*b,top:T.top,bottom:T.top+h.clientHeight*x}}let S=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?(S=e.left-(m.left+s),n>0&&e.right>m.right+S&&(S=e.right-m.right+s)):e.right>m.right&&(S=e.right-m.right+s,n<0&&e.left<m.left+S&&(S=e.left-(m.left+s))):S=(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,S||C)if(y)d.scrollBy(S,C);else{let T=0,E=0;if(C){let M=h.scrollTop;h.scrollTop+=C/x,E=(h.scrollTop-M)*x}if(S){let M=h.scrollLeft;h.scrollLeft+=S/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-S)<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 pB(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 tZ{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?cl(n):0),r,Math.min(e.focusOffset,r?cl(r):0))}set(e,n,r,i){this.anchorNode=e,this.anchorOffset=n,this.focusNode=r,this.focusOffset=i}}let Ja=null;Ye.safari&&Ye.safari_version>=26&&(Ja=!1);function gB(t){if(t.setActive)return t.setActive();if(Ja)return t.focus(Ja);let e=[];for(let n=t;n&&(e.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(t.focus(Ja==null?{get preventScroll(){return Ja={preventScroll:!0},!0}}:void 0),!Ja){Ja=!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 Lk;function Yd(t,e,n=e){let r=Lk||(Lk=document.createRange());return r.setEnd(t,n),r.setStart(t,e),r}function Tc(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 nZ(t){for(;t;){if(t&&(t.nodeType==9||t.nodeType==11&&t.host))return t;t=t.assignedSlot||t.parentNode}return null}function rZ(t,e){let n=e.focusNode,r=e.focusOffset;if(!n||e.anchorNode!=n||e.anchorOffset!=r)return!1;for(r=Math.min(r,cl(n));;)if(r){if(n.nodeType!=1)return!1;let i=n.childNodes[r-1];i.contentEditable=="false"?r--:(n=i,r=cl(n))}else{if(n==t)return!0;r=ma(n),n=n.parentNode}}function mB(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 yB(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=cl(n)}else if(n.parentNode&&!gm(n))r=ma(n),n=n.parentNode;else return null}}function vB(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&&!gm(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 yr=(function(t){return t[t.LTR=0]="LTR",t[t.RTL=1]="RTL",t})(yr||(yr={}));const xu=yr.LTR,sC=yr.RTL;function bB(t){let e=[];for(let n=0;n<t.length;n++)e.push(1<<+t[n]);return e}const iZ=bB("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),oZ=bB("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),jS=Object.create(null),ns=[];for(let t of["()","[]","{}"]){let e=t.charCodeAt(0),n=t.charCodeAt(1);jS[e]=n,jS[n]=-e}function xB(t){return t<=247?iZ[t]:1424<=t&&t<=1524?2:1536<=t&&t<=1785?oZ[t-1536]:1774<=t&&t<=2220?4:8192<=t&&t<=8204?256:64336<=t&&t<=65023?4:1}const sZ=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class vs{get dir(){return this.level%2?sC:xu}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 lZ(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=xB(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 aZ(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=jS[m=t.charCodeAt(g)])if(y<0){for(let x=u-3;x>=0;x-=3)if(ns[x+1]==-y){let S=ns[x+2],C=S&2?i:S&4?S&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 S=u-3;S>=0;S-=3){let C=ns[S+2];if(C&2)break;if(x)ns[S+2]|=2;else{if(C&4)break;ns[S+2]|=4}}}}}function uZ(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,S=x?n[x-1].to:t;b>c;)b==S&&(b=n[--x].from,S=x?n[x-1].to:t),An[--b]=y;c=h}else s=d,c++}}}function _S(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 S=x.to,C=d+1;;){if(S==n)break e;if(C<s.length&&s[C].from==S)S=s[C++].to;else{if(An[S]==u)break e;break}}if(d++,m)m.push(x);else{x.from>c&&a.push(new vs(c,x.from,y));let S=x.direction==xu!=!(y%2);HS(t,S?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?_S(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 S=x.from,C=d;;){if(S==e)break e;if(C&&s[C-1].to==S)S=s[--C].from;else{if(An[S-1]==u)break e;break}}if(m)m.push(x);else{x.to<c&&a.push(new vs(x.to,c,y));let S=x.direction==xu!=!(y%2);HS(t,S?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?_S(t,b,c,r+1,i,m,a):b<c&&a.push(new vs(b,c,y)),c=b}}function HS(t,e,n,r,i,s,a){let u=e%2?2:1;lZ(t,i,s,r,u),aZ(t,i,s,r,u),uZ(i,s,r,u),_S(t,i,s,e,n,r,a)}function cZ(t,e,n){if(!t)return[new vs(0,0,e==sC?1:0)];if(e==xu&&!n.length&&!sZ.test(t))return wB(t.length);if(n.length)for(;t.length>An.length;)An[An.length]=256;let r=[],i=e==xu?0:1;return HS(t,i,i,n,0,t.length,r),r}function wB(t){return[new vs(0,t,0)]}let CB="";function fZ(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=Zr(t.text,a,c.forward(i,n));(h<c.from||h>c.to)&&(h=d),CB=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?Ne.cursor(g.side(!i,n)+t.from,g.forward(i,n)?1:-1,g.level):Ne.cursor(h+t.from,c.forward(i,n)?-1:1,c.level)}function dZ(t,e,n){for(let r=e;r<n;r++){let i=xB(t.charCodeAt(r));if(i==1)return xu;if(i==2||i==4)return sC}return xu}const RB=bt.define(),TB=bt.define(),EB=bt.define(),MB=bt.define(),VS=bt.define(),AB=bt.define(),OB=bt.define(),lC=bt.define(),aC=bt.define(),kB=bt.define({combine:t=>t.some(e=>e)}),hZ=bt.define({combine:t=>t.some(e=>e)}),IB=bt.define();class Ec{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 Ec(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 Ec(Ne.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const dg=sr.define({map:(t,e)=>t.map(e)}),DB=sr.define();function bs(t,e,n){let r=t.facet(MB);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 el=bt.define({combine:t=>t.length?t[0]:!0});let pZ=0;const hc=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 Bc{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(hc.of({plugin:this,arg:void 0}))}of(e){return this.baseExtensions.concat(hc.of({plugin:this,arg:e}))}static define(e,n){const{eventHandlers:r,eventObservers:i,provide:s,decorations:a}=n||{};return new Bc(pZ++,e,r,i,u=>{let c=[];return a&&c.push(xy.of(d=>{let h=d.plugin(u);return h?a(h):ei.none})),s&&c.push(s(u)),c})}static fromClass(e,n){return Bc.define((r,i)=>new e(r,i),n)}}class Vb{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 PB=bt.define(),uC=bt.define(),xy=bt.define(),zB=bt.define(),cC=bt.define(),vh=bt.define(),NB=bt.define();function Bk(t,e){let n=t.state.facet(NB);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=dZ(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 LB=bt.define();function BB(t){let e=0,n=0,r=0,i=0;for(let s of t.state.facet(LB)){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 ao{constructor(e,n,r,i){this.fromA=e,this.toA=n,this.fromB=r,this.toB=i}join(e){return new ao(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 ao(h,m,d,g))}return r}}class ym{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 ao(s,a,u,c))),this.changedRanges=i}static create(e,n,r){return new ym(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 gZ=[];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 gZ}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&&XQ(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 wy)return e;return null}static get(e){return e.cmTile}}class Sy 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=jk(i);else n.insertBefore(u.dom,i);r=u.dom}for(i=r?r.nextSibling:n.firstChild,s&&i&&(s.written=!0);i;)i=jk(i);this.length=a}}function jk(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class wy extends Sy{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 ll)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 ll extends Sy{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 ll(n||document.createElement(e.tagName),e);return n||(r.flags|=4),r}}class jc extends Sy{constructor(e,n){super(e),this.attrs=n}isLine(){return!0}static start(e,n,r){let i=new jc(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&&yZ(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):mZ(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 mZ(t){let e=t.dom.lastChild;if(!e)return t.dom.getBoundingClientRect();let n=_g(e);return n[n.length-1]||null}function yZ(t,e){let n=t.coordsIn(0,1),r=e.coordsIn(0,1);return n&&r&&r.top<n.bottom}class Si extends Sy{constructor(e,n){super(e),this.mark=n}get domAttrs(){return this.mark.attrs}static of(e,n){let r=new Si(n||document.createElement(e.tagName),e);return n||(r.flags|=4),r}}class su 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?mm(c,a<0):c||null}static of(e,n){let r=new su(n||document.createTextNode(e),e);return n||(r.flags|=2),r}}class Su 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 mm(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 mm(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 Su(s,r,e,i)}}class vm 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 vZ{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 bZ{constructor(e,n,r,i){this.from=e,this.to=n,this.wrapper=r,this.rank=i}}class xZ{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 su(u.dom,u.text+e);c.parent=a}else a.append(i||su.of(e,(s=this.cache.find(su))===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)?Fb(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 Si&&d.mark.eq(c.mark))d.dom!=c.dom&&d.setDOM(Fb(c.dom)),i=d;else{if(this.cache.reused.get(c)){let g=Xn.get(c.dom);g&&g.setDOM(Fb(c.dom))}let h=Si.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 su(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=jB);let i=jc.start(e,n||((r=this.cache.find(jc))===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 Si&&u.mark.eq(a))i=u,n--;else{let c=Si.of(a,(r=this.cache.find(Si,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||!_k(this.curLine,!1)||e.dom.nodeName!="BR"&&e.isWidget()&&!(Ye.ios&&_k(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget($b,0,32)||new Su($b.toDOM(),0,$b,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 bZ(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 ll&&i.wrapper.eq(r.wrapper))n=i;else{let s=ll.of(r.wrapper,(e=this.cache.find(ll,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(vm,void 0,1);return r&&(r.flags=n),r||new vm(n)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}}class SZ{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 bm=[Su,jc,su,Si,vm,ll,wy];for(let t=0;t<bm.length;t++)bm[t].bucket=t;class wZ{constructor(e){this.view=e,this.buckets=bm.map(()=>[]),this.index=bm.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 Su(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 CZ{constructor(e,n,r,i,s){this.view=e,this.decorations=i,this.disallowBlockEffectsFor=s,this.openWidget=!1,this.openMarks=0,this.cache=new wZ(e),this.text=new SZ(e.state.doc),this.builder=new xZ(this.cache,new wy(e,e.contentDOM),pn.iter(r)),this.cache.reused.set(n,2),this.old=new vZ(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=EZ(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?Su.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 vm)this.cache.add(a);else if(a instanceof Si)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 Si&&i.unshift(a.mark)),this.openWidget=!1},leave:a=>{a.isLine()?i.length&&(i.length=s=0):a instanceof Si&&(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 bu){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?_c.block:_c.inline),b=RZ(d),x=this.cache.findWidget(y,c-u,b)||Su.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=TZ(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 Si?n.push(s):s?.isLine()?r=s:s instanceof ll||(i.nodeName=="DIV"&&!r&&i!=this.view.contentDOM?r=new jc(i,jB):r||n.push(Si.of(new mh({tagName:i.nodeName.toLowerCase(),attributes:QQ(i)}),i)))}return{line:r,marks:n}}}function _k(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 RZ(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 jB={class:"cm-line"};function TZ(t,e){let n=e.spec.attributes,r=e.spec.class;return!n&&!r||(t||(t={class:"cm-line"}),n&&iC(n,t),r&&(t.class+=" "+r)),t}function EZ(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 Si&&e.push(r.mark)}return e}function Fb(t){let e=Xn.get(t);return e&&e.setDOM(t.cloneNode()),t}class _c extends by{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}}_c.inline=new _c("span");_c.block=new _c("div");const $b=new class extends by{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}};class Hk{constructor(e){this.view=e,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=ei.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 wy(e,e.contentDOM),this.updateInner([new ao(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:!NZ(e.changes,this.hasComposition)&&!e.selectionSet&&(i=e.state.selection.main.head));let s=i>-1?AZ(this.view,e.changes,i):null;if(this.domChanged=null,this.hasComposition){let{from:h,to:g}=this.hasComposition;r=new ao(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=IZ(a,this.decorations,e.changes);c.length&&(r=ao.extendWithRanges(r,c));let d=PZ(u,this.blockWrappers,e.changes);return d.length&&(r=ao.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 CZ(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),FS(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(DB)&&(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(el)||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&&MZ(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)&&zZ(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=OZ(d.node,d.offset);if(y&&y!=3){let b=(y==1?yB:vB)(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=cl(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=Zr(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==yr.LTR,d=0,h=(g,m,y)=>{for(let b=0;b<g.children.length&&!(m>i);b++){let x=g.children[b],S=m+x.length,C=x.dom.getBoundingClientRect(),{height:T}=C;if(y&&!b&&(d+=C.top-y.top),x instanceof ll)S>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?_g(E):[];if(M.length){let k=M[M.length-1],D=c?k.right-C.left:C.right-k.left;D>u&&(u=D,this.minWidth=s,this.minWidthFrom=m,this.minWidthTo=S)}}y&&b==g.children.length-1&&(d+=y.bottom-C.bottom),m=S+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"?yr.RTL:yr.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=_g(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=_g(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(ei.replace({widget:new Ub(u),block:!0,inclusive:!0,isBlockGap:!0}).range(r,a))}if(!s)break;r=s.to+1}return ei.set(e)}updateDeco(){let e=1,n=this.view.state.facet(xy).map(s=>(this.dynamicDecorationMap[e++]=typeof s=="function")?s(this.view):s),r=!1,i=this.view.state.facet(cC).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(zB).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(IB))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=BB(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(eZ(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==yr.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(){FS(this.tile)}}function FS(t,e){let n=e?.get(t);if(n!=1){n==null&&t.destroy();for(let r of t.children)FS(r,e)}}function MZ(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 _B(t,e){let n=t.observer.selectionRange;if(!n.focusNode)return null;let r=yB(n.focusNode,n.focusOffset),i=vB(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 AZ(t,e,n){let r=_B(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 ao(c.mapPos(s),c.mapPos(a),s,a),text:i}}function OZ(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 kZ=class{constructor(){this.changes=[]}compareRange(e,n){Rc(e,n,this.changes)}comparePoint(e,n){Rc(e,n,this.changes)}boundChange(e){Rc(e,e,this.changes)}};function IZ(t,e,n){let r=new kZ;return pn.compare(t,e,n,r),r.changes}class DZ{constructor(){this.changes=[]}compareRange(e,n){Rc(e,n,this.changes)}comparePoint(){}boundChange(e){Rc(e,e,this.changes)}}function PZ(t,e,n){let r=new DZ;return pn.compare(t,e,n,r),r.changes}function zZ(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 NZ(t,e){let n=!1;return e&&t.iterChangedRanges((r,i)=>{r<e.to&&i>e.from&&(n=!0)}),n}class Ub extends by{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 LZ(t,e,n=1){let r=t.charCategorizer(e),i=t.doc.lineAt(e),s=e-i.from;if(i.length==0)return Ne.cursor(e);s==0?n=1:s==i.length&&(n=-1);let a=s,u=s;n<0?a=Zr(i.text,s,!1):u=Zr(i.text,s);let c=r(i.text.slice(a,u));for(;a>0;){let d=Zr(i.text,a,!1);if(r(i.text.slice(d,a))!=c)break;a=d}for(;u<i.length;){let d=Zr(i.text,u);if(r(i.text.slice(u,d))!=c)break;u=d}return Ne.range(a+i.from,u+i.from)}function BZ(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+UQ(a,s,t.state.tabSize)}function jZ(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==ho.Text&&(i.type!=s.type||(n<0?s.from<e:s.to>e)))&&(i=s)}}return i||r}return r}function _Z(t,e,n,r){let i=jZ(t,e.head,e.assoc||-1),s=!r||i.type!=ho.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==yr.LTR)?a.right-1:a.left+1,y:(s.top+s.bottom)/2});if(c!=null)return Ne.cursor(c,n?-1:1)}return Ne.cursor(n?i.to:i.from,n?-1:1)}function Vk(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=fZ(i,s,a,u,n),h=CB;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 HZ(t,e,n){let r=t.state.charCategorizer(e),i=r(n);return s=>{let a=r(s);return i==nl.Space&&(i=a),i==a}}function VZ(t,e,n,r){let i=e.head,s=n?1:-1;if(i==(n?t.state.doc.length:0))return Ne.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,S=$S(t,{x:g,y:x},!1,s);if(n?x>c.bottom:x<c.top)return Ne.cursor(S.pos,S.assoc);let C=t.coordsAtPos(S.pos,S.assoc),T=C?(C.top+C.bottom)/2:0;if(!C||(n?T>u:T<u))return Ne.cursor(S.pos,S.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 HB(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=Ne.cursor(a,-1))}else{let a=wd(t,i.from,-1),u=wd(t,i.to,1);(a!=i.from||u!=i.to)&&(s=Ne.range(i.from==i.anchor?a:u,i.from==i.head?a:u))}s&&(n||(n=e.ranges.slice()),n[r]=s)}return n?Ne.create(n,e.mainIndex):e}function qb(t,e,n){let r=wd(t.state.facet(vh).map(i=>i(t)),n.from,e.head>n.from?-1:1);return r==n.from?n:Ne.cursor(r,r<n.from?1:-1)}class gs{constructor(e,n){this.pos=e,this.assoc=n}}function $S(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==ho.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==ho.Text){let g=BZ(t,i,d,a,u);return new gs(g,g==d.from?1:-1)}}if(d.type!=ho.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 FZ(t,a,u,t.textDirectionAt(d.from)).scanTile(h,d.from)}class FZ{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 S=r+Math.floor(Math.random()*y);for(let C=0;C<y;C++){if(!s.has(S)){b=S;break t}S++,S==i&&(S=r)}break e}s.add(b);let x=n(b);if(x)for(let S=0;S<x.length;S++){let C=x[S],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==yr.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)==yr.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=Zr(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 cc="￿";class $Z{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+=cc}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:gm(i))||gm(u)&&(i.nodeName!="BR"||a?.isWidget())&&this.text.length>s)&&!qZ(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+(UZ(e,r.node,r.offset)?n:0))}}function UZ(t,e,n){for(;;){if(!e||n<cl(e))return!1;if(e==t)return!0;n=ma(e)+1,e=e.parentNode}}function qZ(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 Fk{constructor(e,n){this.node=e,this.offset=n,this.pos=-1}}class GZ{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=VB(e.docView.tile,n,r,0))){let c=s||a?[]:KZ(e),d=new $Z(c,e);d.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=d.text,this.newSel=YZ(c,this.bounds.from)}else{let c=e.observer.selectionRange,d=s&&s.node==c.focusNode&&s.offset==c.focusOffset||!BS(e.contentDOM,c.focusNode)?u.main.head:e.docView.posFromDOM(c.focusNode,c.focusOffset),h=a&&a.node==c.anchorNode&&a.offset==c.anchorOffset||!BS(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(Ne.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=Ne.create([Ne.cursor(d,y)])}else this.newSel=Ne.single(h,d)}}}function VB(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 VB(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 FB(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,cc),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(cc))}:(y=$B(g,e.text,d-u,h))&&(Ye.chrome&&a==13&&y.toB==y.from+2&&e.text.slice(y.from,y.toB)==cc+cc&&y.toB--,n={from:u+y.from,to:u+y.toA,insert:Yt.of(e.text.slice(y.from,y.toB).split(cc))})}else r&&(!t.hasFocus&&i.facet(el)||xm(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=Ne.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=Ne.single(r.main.anchor-1,r.main.head-1)),n={from:s.from,to:s.to,insert:Yt.of([" "])}),n)return fC(t,n,r,a);if(r&&!xm(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=HB(i.facet(vh).map(d=>d(t)),r))),t.dispatch({selection:r,scrollIntoView:u,userEvent:c}),!0}else return!1}function fC(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&&Tc(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)&&Tc(t.contentDOM,"Backspace",8)||e.from==i.from&&e.to==i.to+1&&e.insert.length==0&&Tc(t.contentDOM,"Delete",46)))return!0;let s=e.insert.toString();t.inputState.composing>=0&&t.inputState.composing++;let a,u=()=>a||(a=WZ(t,e,n));return t.state.facet(AB).some(c=>c(t,e.from,e.to,s,u))||t.dispatch(u()),!0}function WZ(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(vh).map(g=>g(t)),d,c);e.from==h&&(a=h)}if(a>-1)r={changes:e,selection:Ne.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&&_B(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,S=x-h.length;if(t.state.sliceDoc(S,x)!=h||x>=g.from&&S<=g.to)return{range:b};let C=i.changes({from:S,to:x,insert:e.insert}),T=b.to-s.to;return{changes:C,range:d?Ne.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 $B(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 KZ(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 Fk(n,r)),(i!=n||s!=r)&&e.push(new Fk(i,s))),e}function YZ(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?Ne.single(n+e,r+e):null}function xm(t,e){return e.head==t.main.head&&e.anchor==t.main.anchor}class XZ{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&&fJ(e.contentDOM.ownerDocument)}handleEvent(e){!iJ(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=QZ(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&&qB.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=UB.find(r=>r.keyCode==e.keyCode))&&!e.ctrlKey||ZZ.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,Tc(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 $k(t,e){return(n,r)=>{try{return e.call(t,r,n)}catch(i){bs(n.state,i)}}}function QZ(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($k(r.value,c))}if(a)for(let u in a){let c=a[u];c&&n(u).observers.push($k(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 UB=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],ZZ="dthko",qB=[16,17,18,20,91,92,224,225],hg=6;function pg(t){return Math.max(0,t)*.7+8}function JZ(t,e){return Math.max(Math.abs(t.clientX-e.clientX),Math.abs(t.clientY-e.clientY))}class eJ{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=pB(e.contentDOM),this.atoms=e.state.facet(vh).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)&&tJ(e,n),this.dragging=rJ(e,n)&&KB(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&&JZ(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=BB(this.view);e.clientX-c.left<=i+hg?n=-pg(i-e.clientX):e.clientX+c.right>=a-hg&&(n=pg(e.clientX-a)),e.clientY-c.top<=s+hg?r=-pg(s-e.clientY):e.clientY+c.bottom>=u-hg&&(r=pg(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=HB(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 tJ(t,e){let n=t.state.facet(RB);return n.length?n[0](e):Ye.mac?e.metaKey:e.ctrlKey}function nJ(t,e){let n=t.state.facet(TB);return n.length?n[0](e):Ye.mac?!e.altKey:!e.ctrlKey}function rJ(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 iJ(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),GB=Ye.ie&&Ye.ie_version<15||Ye.ios&&Ye.webkit_version<604;function oJ(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(),WB(t,n.value)},50)}function Cy(t,e,n){for(let r of t.facet(e))n=r(n,t);return n}function WB(t,e){e=Cy(t.state,lC,e);let{state:n}=t,r,i=1,s=n.toText(e),a=s.lines==n.selection.ranges.length;if(US!=null&&n.selection.ranges.every(c=>c.empty)&&US==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:Ne.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:Ne.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(EB))if(n=r(t,e),n)break;if(!n&&e.button==0&&(n=lJ(t,e)),n){let r=!t.hasFocus;t.inputState.startMouseSelection(new eJ(t,e,n,r)),r&&t.observer.ignore(()=>{gB(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 Uk(t,e,n,r){if(r==1)return Ne.cursor(e,n);if(r==2)return LZ(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++,Ne.range(a,u)}}const sJ=Ye.ie&&Ye.ie_version<=11;let qk=null,Gk=0,Wk=0;function KB(t){if(!sJ)return t.detail;let e=qk,n=Wk;return qk=t,Wk=Date.now(),Gk=!e||n>Date.now()-400&&Math.abs(e.clientX-t.clientX)<2&&Math.abs(e.clientY-t.clientY)<2?(Gk+1)%3:1}function lJ(t,e){let n=t.posAndSideAtCoords({x:e.clientX,y:e.clientY},!1),r=KB(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=Uk(t,c.pos,c.assoc,r);if(n.pos!=c.pos&&!a){let g=Uk(t,n.pos,n.assoc,r),m=Math.min(g.from,h.from),y=Math.max(g.to,h.to);h=m<h.from?Ne.range(m,y,h.assoc):Ne.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=aJ(i,c.pos))?d:u?i.addRange(h):Ne.create([h])}}}function aJ(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 Ne.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=Ne.range(s,a))}}let{inputState:r}=t;return r.mouseSelection&&(r.mouseSelection.dragging=!0),r.draggedContent=n,e.dataTransfer&&(e.dataTransfer.setData("Text",Cy(t.state,aC,t.state.sliceDoc(n.from,n.to))),e.dataTransfer.effectAllowed="copyMove"),!1};Vo.dragend=t=>(t.inputState.draggedContent=null,!1);function Kk(t,e,n,r){if(n=Cy(t.state,lC,n),!n)return;let i=t.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:s}=t.inputState,a=r&&s&&nJ(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&&Kk(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 Kk(t,e,r,!0),!0}return!1};Vo.paste=(t,e)=>{if(t.state.readOnly)return!0;t.observer.flush();let n=GB?null:e.clipboardData;return n?(WB(t,n.getData("text/plain")||n.getData("text/uri-list")),!0):(oJ(t),!1)};function uJ(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 cJ(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:Cy(t,aC,e.join(t.lineBreak)),ranges:n,linewise:r}}let US=null;Vo.copy=Vo.cut=(t,e)=>{if(!xd(t.contentDOM,t.observer.selectionRange))return!1;let{text:n,ranges:r,linewise:i}=cJ(t.state);if(!n&&!i)return!1;US=i?n:null,e.type=="cut"&&!t.state.readOnly&&t.dispatch({changes:r,scrollIntoView:!0,userEvent:"delete.cut"});let s=GB?null:e.clipboardData;return s?(s.clearData(),s.setData("text/plain",n),!0):(uJ(t,n),!1)};const YB=Ma.define();function XB(t,e){let n=[];for(let r of t.facet(OB)){let i=r(t,e);i&&n.push(i)}return n.length?t.update({effects:n,annotations:YB.of(!0)}):null}function QB(t){setTimeout(()=>{let e=t.hasFocus;if(e!=t.inputState.notifiedFocused){let n=XB(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),QB(t)};Ri.blur=t=>{t.observer.clearSelectionRange(),QB(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 fC(t,{from:c,to:d,insert:t.state.toText(s)},null),!0}}let i;if(Ye.chrome&&Ye.android&&(i=UB.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 Yk=new Set;function fJ(t){Yk.has(t)||(Yk.add(t),t.addEventListener("copy",()=>{}),t.addEventListener("cut",()=>{}))}const Xk=["pre-wrap","normal","pre-line","break-spaces"];let Hc=!1;function Qk(){Hc=!1}class dJ{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 Xk.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=Xk.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 hJ{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"?ho.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 bu?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 Hg=.001;class ui{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)>Hg&&(Hc=!0),this.height=e)}replace(e,n,r){return ui.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=dC.build(r.setDoc(a),e,h,g);s=Sm(s,s.replace(c,d,b))}return s.updateHeight(r,0)}static empty(){return new Ni(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 gJ(ui.of(e.slice(0,n)),a,ui.of(e.slice(r)))}}function Sm(t,e){return t==e?t:(t.constructor!=e.constructor&&(Hc=!0),e)}ui.prototype.size=1;const pJ=ei.replace({});class ZB extends ui{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,pJ):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 Ni extends ZB{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 Ni||i instanceof zr&&i.flags&4)&&Math.abs(this.length-i.length)<10?(i instanceof zr?i=new Ni(i.length,this.height,this.spaceAbove):i.height=this.height,this.outdated||(i.outdated=!1),i):ui.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 ui{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 ui.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)>=Hg&&(c=-2);let y=new Ni(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=ui.of(a);return(c<0||Math.abs(d.height-this.height)>=Hg||Math.abs(c-this.heightMetrics(e,n).perLine)>=Hg)&&(Hc=!0),Sm(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 gJ extends ui{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&&Zk(s,a-1),n<this.length){let u=s.length;this.decomposeRight(n,s),Zk(s,u)}return ui.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?ui.of(this.break?[e,null,n]:[e,n]):(this.left=Sm(this.left,e),this.right=Sm(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 Zk(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 mJ=5;class dC{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 Ni?i.length+=r-this.pos:(r>this.pos||!this.isCovered)&&this.nodes.push(new Ni(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 ZB(a,i,r)):(a||s||i>=mJ)&&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 Ni(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 Ni)return e;let n=new Ni(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 Ni)&&!this.isCovered?this.nodes.push(new Ni(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 Ni&&i.updateHeight(this.oracle,r),r+=i?i.length:1;return this.nodes}static build(e,n,r,i){let s=new dC(r,e);return pn.spans(n,r,i,s,0),s.finish(r)}}function yJ(t,e,n){let r=new vJ;return pn.compare(t,e,n,r,0),r.changes}class vJ{constructor(){this.changes=[]}compareRange(){}comparePoint(e,n,r,i){(e<n||r&&r.heightRelevant||i&&i.heightRelevant)&&Rc(e,n,this.changes,5)}}function bJ(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 xJ(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 SJ(t,e){let n=t.getBoundingClientRect();return{left:0,right:n.right-n.left,top:e,bottom:n.bottom-(n.top+e)}}class Gb{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 ei.replace({widget:new wJ(this.displaySize*(n?e.scaleY:e.scaleX),n)}).range(this.from,this.to)}}class wJ extends by{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 Jk{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=eI,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=yr.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let r=n.facet(uC).some(i=>typeof i!="function"&&i.class=="cm-lineWrapping");this.heightOracle=new dJ(r),this.stateDeco=tI(n),this.heightMap=ui.empty().applyChanges(this.stateDeco,Yt.empty,this.heightOracle.setDoc(n.doc),[new ao(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=ei.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 gg(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?eI:new hC(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=tI(this.state);let i=e.changedRanges,s=ao.extendWithRanges(i,yJ(r,this.stateDeco,e?e.changes:wr.empty(this.state.doc.length))),a=this.heightMap.height,u=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollOffset);Qk(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),s),(this.heightMap.height!=a||Hc)&&(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(hZ)&&(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"?yr.RTL:yr.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:D}=hB(n,u);(k>.005&&Math.abs(this.scaleX-k)>.005||D>.005&&Math.abs(this.scaleY-D)>.005)&&(this.scaleX=k,this.scaleY=D,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=pB(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=mB(this.scrollParent||e.win);let x=(this.printing?SJ:bJ)(n,this.paddingTop),S=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&&!xJ(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:D,charWidth:O,textHeight:I}=e.docView.measureTextSize();a=D>0&&i.refresh(s,D,O,I,Math.max(5,E/O),k),a&&(e.docView.minWidth=0,d|=16)}S>0&&C>0?h=Math.max(S,C):S<0&&C<0&&(h=Math.min(S,C)),Qk();for(let D of this.viewports){let O=D.from==this.viewport.from?k:e.docView.measureVisibleLineHeights(D);this.heightMap=(a?ui.empty().applyChanges(this.stateDeco,Yt.empty,this.heightOracle,[new ao(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(i,0,a,new hJ(D.from,O))}Hc&&(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 gg(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 gg(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 gg(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 Gb(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!=yr.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 S=RJ(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(!S){if(g<m.to&&n&&r&&n.visibleRanges.some(E=>E.from<=g&&E.to>=g)){let E=n.moveToLineBoundary(Ne.cursor(g),!1,!0).head;E>h&&(g=E)}let C=this.gapSize(m,h,g,y),T=r||C<2e6?C:2e6;S=new Gb(h,g,C,T)}u.push(S)},d=h=>{if(h.length<a||h.type!=ho.Text)return;let g=CJ(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,S,C;if(m!=null){let T=yg(g,m),E=((this.visibleBottom-this.visibleTop)/2+x)/h.height;S=T-E,C=T+E}else S=(this.visibleTop-h.top-x)/h.height,C=(this.visibleBottom-h.top+x)/h.height;y=mg(g,S),b=mg(g,C)}else{let x=g.total*this.heightOracle.charWidth,S=i*this.heightOracle.charWidth,C=0;if(x>2e6)for(let D of e)D.from>=h.from&&D.from<h.to&&D.size!=D.displaySize&&D.from*this.heightOracle.charWidth+C<this.pixelViewport.left&&(C=D.size-D.displaySize);let T=this.pixelViewport.left+C,E=this.pixelViewport.right+C,M,k;if(m!=null){let D=yg(g,m),O=((E-T)/2+S)/x;M=D-O,k=D+O}else M=(T-S)/x,k=(E+S)/x;y=mg(g,M),b=mg(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=yg(i,r)-yg(i,n);return this.heightOracle.lineWrapping?e.height*s:i.total*this.heightOracle.charWidth*s}updateLineGaps(e){Gb.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=ei.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 gg{constructor(e,n){this.from=e,this.to=n}}function CJ(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 mg({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 yg(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 RJ(t,e){for(let n of t)if(e(n))return n}const eI={toDOM(t){return t},fromDOM(t){return t},scale:1,eq(t){return t==this}};function tI(t){let e=t.facet(xy).filter(r=>typeof r!="function"),n=t.facet(cC).filter(r=>typeof r!="function");return n.length&&e.push(pn.join(n)),e}class hC{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 hC?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 vg=bt.define({combine:t=>t.join(" ")}),qS=bt.define({combine:t=>t.indexOf(!0)>-1}),GS=Lc.newName(),JB=Lc.newName(),ej=Lc.newName(),tj={"&light":"."+JB,"&dark":"."+ej};function WS(t,e,n){return new Lc(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 TJ=WS("."+GS,{"&":{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"}},tj),EJ={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},Wb=Ye.ie&&Ye.ie_version<=11;class MJ{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new tZ,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 OJ(e),e.state.facet(el)&&(e.contentDOM.editContext=this.editContext.editContext)),Wb&&(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(el)?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&&AJ(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&&rZ(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,EJ),Wb&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),Wb&&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&&Tc(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 GZ(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=FB(this.view,n);return this.view.state==r&&(n.domChanged||n.newSel&&!xm(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=nI(n,e.previousSibling||e.target.previousSibling,-1),i=nI(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(el)!=e.state.facet(el)&&(e.view.contentDOM.editContext=e.state.facet(el)?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 nI(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 rI(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 AJ(t,e){if(e.getComposedRanges){let i=e.getComposedRanges(t.root)[0];if(i)return rI(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?rI(t,n):null}class OJ{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=$B(e.state.sliceDoc(u,c),r.text,(d?i.from:i.to)-u,d?"end":null);if(!h){let m=Ne.single(this.toEditorPos(r.selectionStart),this.toEditorPos(r.selectionEnd));xm(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);fC(e,g,Ne.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(ei.mark({attributes:{style:h}}).range(c,d))}}}e.dispatch({effects:DB.of(ei.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||nZ(e.parent)||document,this.viewState=new Jk(this,e.state||an.create(e)),e.scrollTo&&e.scrollTo.is(dg)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(hc).map(i=>new Vb(i));for(let i of this.plugins)i.update(this);this.observer=new MJ(this),this.inputState=new XZ(this),this.inputState.ensureHandlers(this.plugins),this.docView=new Hk(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(YB))?(this.inputState.notifiedFocused=a,u=1):a!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=a,c=XB(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=ym.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 Ec(y.empty?y:Ne.cursor(y.head,y.head>y.anchor?-1:1))}for(let y of m.effects)y.is(dg)&&(g=y.value.clip(this.state))}this.viewState.update(i,g),this.bidiCache=wm.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(vg)!=i.state.facet(vg)&&(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(VS))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&&!FB(this,h)&&d.force&&Tc(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 Jk(this,e),this.plugins=e.facet(hc).map(r=>new Vb(r)),this.pluginMap.clear();for(let r of this.plugins)r.update(this);this.docView.destroy(),this.docView=new Hk(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(hc),r=e.state.facet(hc);if(n!=r){let i=[];for(let s of r){let a=n.indexOf(s);if(a<0)i.push(new Vb(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(mB(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),iI}}),g=ym.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]!=iI)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(VS))u(n)}get themeClasses(){return GS+" "+(this.state.facet(qS)?ej:JB)+" "+this.state.facet(vg)}updateAttrs(){let e=oI(this,PB,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),n={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(el)?"true":"false",class:"cm-content",style:`${Ye.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(n["aria-readonly"]="true"),oI(this,uC,n);let r=this.observer.ignore(()=>{let i=zk(this.contentDOM,this.contentAttrs,n),s=zk(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);Lc.mount(this.root,this.styleModules.concat(TJ).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 qb(this,e,Vk(this,e,n,r))}moveByGroup(e,n){return qb(this,e,Vk(this,e,n,r=>HZ(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 Ne.cursor(s.side(n,i)+e.from,s.forward(!n,i)?1:-1)}moveToLineBoundary(e,n,r=!0){return _Z(this,e,n,r)}moveVertically(e,n,r){return qb(this,e,VZ(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=$S(this,e,n);return r&&r.pos}posAndSideAtCoords(e,n=!0){return this.readMeasured(),$S(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 mm(r,a.dir==yr.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(kB)||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>kJ)return wB(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=Bk(this,e))))return s.order;r||(r=Bk(this,e));let i=cZ(e.text,n,r);return this.bidiCache.push(new wm(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(()=>{gB(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 dg.of(new Ec(typeof e=="number"?Ne.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 dg.of(new Ec(Ne.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 Bc.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return Bc.define(()=>({}),{eventObservers:e})}static theme(e,n){let r=Lc.newName(),i=[vg.of(r),ad.of(WS(`.${r}`,e))];return n&&n.dark&&i.push(qS.of(!0)),i}static baseTheme(e){return JL.lowest(ad.of(WS("."+GS,e,tj)))}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=AB;At.clipboardInputFilter=lC;At.clipboardOutputFilter=aC;At.scrollHandler=IB;At.focusChangeEffect=OB;At.perLineTextDirection=kB;At.exceptionSink=MB;At.updateListener=VS;At.editable=el;At.mouseSelectionStyle=EB;At.dragMovesSelection=TB;At.clickAddsSelectionRange=RB;At.decorations=xy;At.blockWrappers=zB;At.outerDecorations=cC;At.atomicRanges=vh;At.bidiIsolatedRanges=NB;At.scrollMargins=LB;At.darkTheme=qS;At.cspNonce=bt.define({combine:t=>t.length?t[0]:""});At.contentAttributes=uC;At.editorAttributes=PB;At.lineWrapping=At.contentAttributes.of({class:"cm-lineWrapping"});At.announce=sr.define();const kJ=4096,iI={};class wm{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:yr.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 wm(n.mapPos(a.from,1),n.mapPos(a.to,-1),a.dir,a.isolates,!1,a.order))}return r}}function oI(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&&iC(a,n)}return n}const IJ=Ye.mac?"mac":Ye.windows?"win":Ye.linux?"linux":"key";function DJ(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 bg(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 PJ=JL.default(At.domEventHandlers({keydown(t,e){return BJ(zJ(e.state),t,e,"editor")}})),nj=bt.define({enables:PJ}),sI=new WeakMap;function zJ(t){let e=t.facet(nj),n=sI.get(e);return n||sI.set(e,n=LJ(e.reduce((r,i)=>r.concat(i),[]))),n}let ea=null;const NJ=4e3;function LJ(t,e=IJ){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=>DJ(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=ea={view:E,prefix:T,scope:a};return setTimeout(()=>{ea==M&&(ea=null)},NJ),!0}]})}let x=b.join(" ");i(x,!1);let S=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&&S.run.push(c),d&&(S.preventDefault=!0),h&&(S.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,KS))}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 KS=null;function BJ(t,e,n,r){KS=e;let i=KQ(e),s=OQ(i,0),a=kQ(s)==i.length&&i!=" ",u="",c=!1,d=!1,h=!1;ea&&ea.view==n&&ea.scope==r&&(u=ea.prefix+" ",qB.indexOf(e.keyCode)<0&&(d=!0,ea=null));let g=new Set,m=S=>{if(S){for(let C of S.run)if(!g.has(C)&&(g.add(C),C(n)))return S.stopPropagation&&(h=!0),!0;S.preventDefault&&(S.stopPropagation&&(h=!0),d=!0)}return!1},y=t[r],b,x;return y&&(m(y[u+bg(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+bg(b,e,!0)])||e.shiftKey&&(x=Gd[e.keyCode])!=i&&x!=b&&m(y[u+bg(x,e,!1)]))&&(c=!0):a&&e.shiftKey&&m(y[u+bg(i,e,!0)])&&(c=!0),!c&&m(y._any)&&(c=!0)),d&&(c=!0),c&&h&&e.stopPropagation(),KS=null,c}class Vc extends vu{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}Vc.prototype.elementClass="";Vc.prototype.toDOM=void 0;Vc.prototype.mapMode=Bi.TrackBefore;Vc.prototype.startSide=Vc.prototype.endSide=-1;Vc.prototype.point=!0;const jJ=1024;let _J=0;class Kb{constructor(e,n){this.from=e,this.to=n}}class Xt{constructor(e={}){this.id=_J++,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=yo.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 HJ=Object.create(null);class yo{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):HJ,r=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),i=new yo(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}}}}yo.none=new yo("",Object.create(null),0,8);const xg=new WeakMap,lI=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 XS(this.topNode,e)}cursorAt(e,n=0,r=0){let i=xg.get(this)||this.topNode,s=new XS(i);return s.moveTo(e,n),xg.set(this,s._tree),s}get topNode(){return new po(this,0,0,null)}resolve(e,n=0){let r=Xd(xg.get(this)||this.topNode,e,n,!1);return xg.set(this,r),r}resolveInner(e,n=0){let r=Xd(lI.get(this)||this.topNode,e,n,!0);return lI.set(this,r),r}resolveStack(e,n=0){return $J(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:mC(yo.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(yo.none,n,r,i)))}static build(e){return UJ(e)}}jr.empty=new jr(yo.none,[],[],0);class pC{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 pC(this.buffer,this.index)}}class ya{constructor(e,n,r){this.buffer=e,this.length=n,this.set=r}get type(){return yo.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&&!(rj(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 rj(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 po&&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 po&&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 ij{cursor(e=0){return new XS(this,e)}getChild(e,n=null,r=null){let i=aI(this,e,n,r);return i.length?i[0]:null}getChildren(e,n=null,r=null){return aI(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 YS(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 po extends ij{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)&&!rj(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 ia(new VJ(a,h,e,g),null,y)}else if(s&or.IncludeAnonymous||!h.type.isAnonymous||gC(h)){let y;if(!(s&or.IgnoreMounts)&&(y=Cd.get(h))&&!y.overlay)return new po(y.tree,g,e,a);let b=new po(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 po(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 aI(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 YS(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 VJ{constructor(e,n,r,i){this.parent=e,this.buffer=n,this.index=r,this.start=i}}class ia extends ij{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 ia(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 ia(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 ia(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 ia(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 oj(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 po&&n.index<0?null:n.parent,i=t.slice();return r?i[e]=r:i.splice(e,1),new FJ(i,n)}class FJ{constructor(e,n){this.heads=e,this.node=n}get next(){return oj(this.heads)}}function $J(t,e,n){let r=t.resolveInner(e,n),i=null;for(let s=r instanceof po?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 po(a.tree,a.overlay[0].from+s.from,-1,s);(i||(i=[r])).push(Xd(u,e,n,!1))}}return i?oj(i):r}class XS{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 po)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 po?(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||gC(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 ia(this.buffer,n,this.stack[i]);return this.bufferNode=new ia(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 YS(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 YS(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 gC(t){return t.children.some(e=>e instanceof ya||!e.type.isAnonymous||gC(e))}function UJ(t){var e;let{buffer:n,nodeSet:r,maxBufferLength:i=jJ,reused:s=[],minRepeatType:a=r.types.length}=t,u=Array.isArray(n)?new pC(n,n.length):n,c=r.types,d=0,h=0;function g(k,D,O,I,L,_){let{id:N,start:B,end:H,size:F}=u,G=h,j=d;if(F<0)if(u.next(),F==-1){let z=s[N];O.push(z),I.push(B-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],$,X,Z=B-k;if(H-B<=i&&(X=S(u.pos-D,L))){let z=new Uint16Array(X.size-X.skip),U=u.pos-X.size,W=z.length;for(;u.pos>U;)W=C(X.start,z,W);$=new ya(z,H-X.start,r),Z=X.start-k}else{let z=u.pos-F;u.next();let U=[],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(U,W,B,ie,u.end,ee,K,G,j),ie=U.length,ee=u.end),u.next()):_>2500?m(B,z,U,W):g(B,z,U,W,K,_+1);if(K>=0&&ie>0&&ie<U.length&&b(U,W,B,ie,B,ee,K,G,j),U.reverse(),W.reverse(),K>-1&&ie>0){let ae=y(q,j);$=mC(q,U,W,0,U.length,0,H-B,ae,ae)}else $=x(q,U,W,H-B,G-H,j)}O.push($),I.push(Z)}function m(k,D,O,I){let L=[],_=0,N=-1;for(;u.pos>D;){let{id:B,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(B,H,F),_++,u.next()}}if(_){let B=new Uint16Array(_*4),H=L[L.length-2];for(let F=L.length-3,G=0;F>=0;F-=3)B[G++]=L[F],B[G++]=L[F+1]-H,B[G++]=L[F+2]-H,B[G++]=G;O.push(new ya(B,L[2]-H,r)),I.push(H-k)}}function y(k,D){return(O,I,L)=>{let _=0,N=O.length-1,B,H;if(N>=0&&(B=O[N])instanceof jr){if(!N&&B.type==k&&B.length==L)return B;(H=B.prop(Xt.lookAhead))&&(_=I[N]+B.length+H)}return x(k,O,I,L,_,D)}}function b(k,D,O,I,L,_,N,B,H){let F=[],G=[];for(;k.length>I;)F.push(k.pop()),G.push(D.pop()+O-L);k.push(x(r.types[N],F,G,_-L,B-_,H)),D.push(L-O)}function x(k,D,O,I,L,_,N){if(_){let B=[Xt.contextHash,_];N=N?[B].concat(N):[B]}if(L>25){let B=[Xt.lookAhead,L];N=N?[B].concat(N):[B]}return new jr(k,D,O,I,N)}function S(k,D){let O=u.fork(),I=0,L=0,_=0,N=O.end-i,B={size:0,start:0,skip:0};e:for(let H=O.pos-k;O.pos>H;){let F=O.size;if(O.id==D&&F>=0){B.size=I,B.start=L,B.skip=_,_+=4,I+=4,O.next();continue}let G=O.pos-F;if(F<0||G<H||O.start<N)break;let j=O.id>=a?4:0,q=O.start;for(O.next();O.pos>G;){if(O.size<0)if(O.size==-3||O.size==-4)j+=4;else break e;else O.id>=a&&(j+=4);O.next()}L=q,I+=F,_+=j}return(D<0||I==k)&&(B.size=I,B.start=L,B.skip=_),B.size>4?B:void 0}function C(k,D,O){let{id:I,start:L,end:_,size:N}=u;if(u.next(),N>=0&&I<a){let B=O;if(N>4){let H=u.pos-(N-4);for(;u.pos>H;)O=C(k,D,O)}D[--O]=B,D[--O]=_-k,D[--O]=L-k,D[--O]=I}else N==-3?d=I:N==-4&&(h=I);return O}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 uI=new WeakMap;function Vg(t,e){if(!t.isAnonymous||e instanceof ya||e.type!=t)return 1;let n=uI.get(e);if(n==null){n=1;for(let r of e.children){if(r.type!=t||!(r instanceof jr)){n=1;break}n+=Vg(t,r)}uI.set(e,n)}return n}function mC(t,e,n,r,i,s,a,u,c){let d=0;for(let b=r;b<i;b++)d+=Vg(t,e[b]);let h=Math.ceil(d*1.5/8),g=[],m=[];function y(b,x,S,C,T){for(let E=S;E<C;){let M=E,k=x[E],D=Vg(t,b[E]);for(E++;E<C;E++){let O=Vg(t,b[E]);if(D+O>=h)break;D+=O}if(E==M+1){if(D>h){let O=b[M];y(O.children,O.positions,0,O.children.length,x[M]+T);continue}g.push(b[M])}else{let O=x[E-1]+b[E-1].length-k;g.push(mC(t,b,x,M,E,k,O,null,c))}m.push(k+T-s)}}return y(e,n,r,i,0),(u||c)(g,m,a)}class cu{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 cu(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 cu(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 qJ{startParse(e,n,r){return typeof e=="string"&&(e=new GJ(e)),r=r?r.length?r.map(i=>new Kb(i.from,i.to)):[new Kb(0,0)]:[new Kb(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 GJ{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 WJ=0;class io{constructor(e,n,r,i){this.name=e,this.set=n,this.base=r,this.modified=i,this.id=WJ++}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 io&&(n=e),n?.base)throw new Error("Can not derive from a modified tag");let i=new io(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 Cm(e);return r=>r.modified.indexOf(n)>-1?r:Cm.get(r.base||r,r.modified.concat(n).sort((i,s)=>i.id-s.id))}}let KJ=0;class Cm{constructor(e){this.name=e,this.instances=[],this.id=KJ++}static get(e,n){if(!n.length)return e;let r=n[0].instances.find(u=>u.base==e&&YJ(n,u.modified));if(r)return r;let i=[],s=new io(e.name,i,e,n);for(let u of n)u.instances.push(s);let a=XJ(n);for(let u of e.set)if(!u.modified.length)for(let c of a)i.push(Cm.get(u,c));return s}}function YJ(t,e){return t.length==e.length&&t.every((n,r)=>n==e[r])}function XJ(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 QJ(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 Rm(r,a,c>0?s.slice(0,c):null);e[d]=h.sort(e[d])}}return ZJ.add(e)}const ZJ=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 Rm(i.tags,i.mode,i.context);n?n.next=s:r=s,n=s}return r}});class Rm{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}}Rm.empty=new Rm([],2,null);function JJ(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=io.define,Sg=Fe(),Zl=Fe(),cI=Fe(Zl),fI=Fe(Zl),Jl=Fe(),wg=Fe(Jl),Yb=Fe(Jl),ss=Fe(),Za=Fe(ss),rs=Fe(),is=Fe(),QS=Fe(),ed=Fe(QS),Cg=Fe(),Ot={comment:Sg,lineComment:Fe(Sg),blockComment:Fe(Sg),docComment:Fe(Sg),name:Zl,variableName:Fe(Zl),typeName:cI,tagName:Fe(cI),propertyName:fI,attributeName:Fe(fI),className:Fe(Zl),labelName:Fe(Zl),namespace:Fe(Zl),macroName:Fe(Zl),literal:Jl,string:wg,docString:Fe(wg),character:Fe(wg),attributeValue:Fe(wg),number:Yb,integer:Fe(Yb),float:Fe(Yb),bool:Fe(Jl),regexp:Fe(Jl),escape:Fe(Jl),color:Fe(Jl),url:Fe(Jl),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:QS,separator:Fe(QS),bracket:ed,angleBracket:Fe(ed),squareBracket:Fe(ed),paren:Fe(ed),brace:Fe(ed),content:ss,heading:Za,heading1:Fe(Za),heading2:Fe(Za),heading3:Fe(Za),heading4:Fe(Za),heading5:Fe(Za),heading6:Fe(Za),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:Cg,documentMeta:Fe(Cg),annotation:Fe(Cg),processingInstruction:Fe(Cg),definition:io.defineModifier("definition"),constant:io.defineModifier("constant"),function:io.defineModifier("function"),standard:io.defineModifier("standard"),local:io.defineModifier("local"),special:io.defineModifier("special")};for(let t in Ot){let e=Ot[t];e instanceof io&&(e.name=t)}JJ([{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 Xb;const Rg=new Xt,eee=new Xt;class rl{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=[$c.of(this),an.languageData.of((s,a,u)=>{let c=dI(s,a,u),d=c.type.prop(Rg);if(!d)return[];let h=s.facet(d),g=c.type.prop(eee);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 dI(e,n,r).type.prop(Rg)==this.data}findRegions(e){let n=e.facet($c);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(Rg)==this.data){r.push({from:a,to:a+s.length});return}let u=s.prop(Xt.mounted);if(u){if(u.tree.prop(Rg)==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}}rl.setState=sr.define();function dI(t,e,n){let r=t.facet($c),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(rl.state,!1);return e?e.tree:jr.empty}class tee{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 Tm{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 Tm(e,n,[],jr.empty,0,r,[],null)}startParse(){return this.parser.startParse(new tee(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(cu.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(cu.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=hI(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=cu.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 Tm(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=hI(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 qJ{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(yo.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 hI(t,e,n){return cu.applyChanges(t,[{fromA:e,toA:n,fromB:e,toB:n}])}class Fc{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 Fc(n)}static init(e){let n=Math.min(3e3,e.doc.length),r=Tm.create(e.facet($c).parser,e,{from:0,to:n});return r.work(20,n)||r.takeTree(),new Fc(r)}}rl.state=Ea.define({create:Fc.init,update(t,e){for(let n of e.effects)if(n.is(rl.setState))return n.value;return e.startState.facet($c)!=e.state.facet($c)?Fc.init(e.state):t.apply(e)}});let sj=t=>{let e=setTimeout(()=>t(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(sj=t=>{let e=-1,n=setTimeout(()=>{e=requestIdleCallback(t,{timeout:400})},100);return()=>e<0?clearTimeout(n):cancelIdleCallback(e)});const Qb=typeof navigator<"u"&&(!((Xb=navigator.scheduling)===null||Xb===void 0)&&Xb.isInputPending)?()=>navigator.scheduling.isInputPending():null,nee=Bc.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(rl.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(rl.state);(n.tree!=n.context.tree||!n.context.isDone(e.doc.length))&&(this.working=sj(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(rl.state);if(s.tree==s.context.tree&&s.context.isDone(i+1e5))return;let a=Date.now()+Math.min(this.chunkBudget,100,e&&!Qb?Math.max(25,e.timeRemaining()-5):1e9),u=s.context.treeLen<i&&r.doc.length>i+1e3,c=s.context.work(()=>Qb&&Qb()||Date.now()>a,i+(u?0:1e5));this.chunkBudget-=Date.now()-n,(c||this.chunkBudget<=0)&&(s.context.takeTree(),this.view.dispatch({effects:rl.setState.of(new Fc(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()}}}),$c=bt.define({combine(t){return t.length?t[0]:null},enables:t=>[rl.state,nee,At.contentAttributes.compute([t],e=>{let n=e.facet(t);return n&&n.name?{"data-language":n.name}:{}})]}),ree=bt.define(),yC=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 Em(t){let e=t.facet(yC);return e.charCodeAt(0)==9?t.tabSize*e.length:e.length}function Mm(t,e){let n="",r=t.tabSize,i=t.facet(yC)[0];if(i==" "){for(;e>=r;)n+=" ",e-=r;i=" "}for(let s=0;s<e;s++)n+=i;return n}function lj(t,e){t instanceof an&&(t=new Ry(t));for(let r of t.state.facet(ree)){let i=r(t,e);if(i!==void 0)return i}let n=va(t.state);return n.length>=e?oee(t,n,e):null}class Ry{constructor(e,n={}){this.state=e,this.options=n,this.unit=Em(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 yy(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 iee=new Xt;function oee(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 aj(r,t,n)}function aj(t,e,n){for(let r=t;r;r=r.next){let i=lee(r.node);if(i)return i(vC.create(e,n,r))}return 0}function see(t){return t.pos==t.options.simulateBreak&&t.options.simulateDoubleBreak}function lee(t){let e=t.type.prop(iee);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=>fee(a,!0,1,void 0,s&&!see(a)?i.from:void 0)}return t.parent==null?aee:null}function aee(){return 0}class vC extends Ry{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 vC(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(uee(r,e))break;n=this.state.doc.lineAt(r.from)}return this.lineIndent(n.from)}continue(){return aj(this.context.next,this.base,this.pos)}}function uee(t,e){for(let n=e;n;n=n.parent)if(t==n)return!0;return!1}function cee(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 fee(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=cee(t);return c?u?t.column(c.from):t.column(c.to):t.baseIndent+(u?0:t.unit*n)}const dee=1e4,hee="()[]{}",pee=new Xt;function ZS(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 JS(t){let e=t.type.prop(pee);return e?e(t.node):t}function pc(t,e,n,r={}){let i=r.maxScanDistance||dee,s=r.brackets||hee,a=va(t),u=a.resolveInner(e,n);for(let c=u;c;c=c.parent){let d=ZS(c.type,n,s);if(d&&c.from<c.to){let h=JS(c);if(h&&(n>0?e>=h.from&&e<h.to:e>h.from&&e<=h.to))return gee(t,e,n,c,h,d,s)}}return mee(t,e,n,a,u.type,i,s)}function gee(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=JS(h);return{start:c,end:g?{from:g.from,to:g.to}:void 0,matched:!0}}else if(ZS(h.type,n,a))d++;else if(ZS(h.type,-n,a)){if(d==0){let g=JS(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 mee(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,S=n>0?y.length:-1;x!=S;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 yee=Object.create(null),pI=[yo.none],gI=[],mI=Object.create(null),vee=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"]])vee[t]=bee(yee,e);function Zb(t,e){gI.indexOf(t)>-1||(gI.push(t),console.warn(e))}function bee(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):Zb(d,`Modifier ${d} used at start of tag`):c.length?Zb(d,`Tag ${d} used as modifier`):c=Array.isArray(h)?h:[h]:Zb(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=mI[i];if(s)return s.id;let a=mI[i]=yo.define({id:pI.length,name:r,props:[QJ({[r]:n})]});return pI.push(a),a.id}yr.RTL,yr.LTR;const xee=t=>{let{state:e}=t,n=e.doc.lineAt(e.selection.main.from),r=xC(t.state,n.from);return r.line?See(t):r.block?Cee(t):!1};function bC(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 See=bC(Eee,0),wee=bC(uj,0),Cee=bC((t,e)=>uj(t,e,Tee(e)),0);function xC(t,e){let n=t.languageDataAt("commentTokens",e,1);return n.length?n[0]:{}}const nd=50;function Ree(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 Tee(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 uj(t,e,n=e.selection.ranges){let r=n.map(s=>xC(e,s.from).block);if(!r.every(s=>s))return null;let i=n.map((s,a)=>Ree(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 Eee(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=xC(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 ew=Ma.define(),Mee=Ma.define(),Aee=bt.define(),cj=bt.define({combine(t){return FQ(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)})}}),fj=Ea.define({create(){return xs.empty},update(t,e){let n=e.state.facet(cj),r=e.annotation(ew);if(r){let c=wi.fromTransaction(e,r.selection),d=r.side,h=d==0?t.undone:t.done;return c?h=Am(h,h.length,n.minDepth,c):h=pj(h,e.startState.selection),new xs(d==0?r.rest:h,d==0?h:r.rest)}let i=e.annotation(Mee);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 Oee(t={}){return[fj,cj.of(t),At.domEventHandlers({beforeinput(e,n){let r=e.inputType=="historyUndo"?dj:e.inputType=="historyRedo"?tw:null;return r?(e.preventDefault(),r(n)):!1}})]}function Ty(t,e){return function({state:n,dispatch:r}){if(!e&&n.readOnly)return!1;let i=n.field(fj,!1);if(!i)return!1;let s=i.pop(t,n,e);return s?(r(s),!0):!1}}const dj=Ty(0,!1),tw=Ty(1,!1),kee=Ty(0,!0),Iee=Ty(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&&ws.fromJSON(e.mapped),e.startSelection&&Ne.fromJSON(e.startSelection),e.selectionsAfter.map(Ne.fromJSON))}static fromTransaction(e,n){let r=uo;for(let i of e.startState.facet(Aee)){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,uo)}static selection(e){return new wi(void 0,uo,void 0,void 0,e)}}function Am(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 Dee(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 Pee(t,e){return t.ranges.length==e.ranges.length&&t.ranges.filter((n,r)=>n.empty!=e.ranges[r].empty).length===0}function hj(t,e){return t.length?e.length?t.concat(e):t:e}const uo=[],zee=200;function pj(t,e){if(t.length){let n=t[t.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-zee));return r.length&&r[r.length-1].eq(e)?t:(r.push(e),Am(t,t.length-1,1e9,n.setSelAfter(r)))}else return[wi.selection([e])]}function Nee(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 Jb(t,e){if(!t.length)return t;let n=t.length,r=uo;for(;n;){let i=Lee(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)]:uo}function Lee(t,e,n){let r=hj(t.selectionsAfter.length?t.selectionsAfter.map(u=>u.map(e)):uo,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 Bee=/^(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||Bee.test(r))&&(!u.selectionsAfter.length&&n-this.prevTime<i.newGroupDelay&&i.joinToEvent(s,Dee(u.changes,e.changes))||r=="input.type.compose")?a=Am(a,a.length-1,i.minDepth,new wi(e.changes.compose(u.changes),hj(sr.mapEffects(e.effects,u.changes),u.effects),u.mapped,u.startSelection,uo)):a=Am(a,a.length,i.minDepth,e),new xs(a,uo,n,r)}addSelection(e,n,r,i){let s=this.done.length?this.done[this.done.length-1].selectionsAfter:uo;return s.length>0&&n-this.prevTime<i&&r==this.prevUserEvent&&r&&/^select($|\.)/.test(r)&&Pee(s[s.length-1],e)?this:new xs(pj(this.done,e),this.undone,n,r)}addMapping(e){return new xs(Jb(this.done,e),Jb(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:ew.of({side:e,rest:Nee(i),selection:a}),userEvent:e==0?"select.undo":"select.redo",scrollIntoView:!0});if(s.changes){let u=i.length==1?uo:i.slice(0,i.length-1);return s.mapped&&(u=Jb(u,s.mapped)),n.update({changes:s.changes,selection:s.startSelection,effects:s.effects,annotations:ew.of({side:e,rest:u,selection:a}),filter:!1,userEvent:e==0?"undo":"redo",scrollIntoView:!0})}else return null}}xs.empty=new xs(uo,uo);const jee=[{key:"Mod-z",run:dj,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:tw,preventDefault:!0},{linux:"Ctrl-Shift-z",run:tw,preventDefault:!0},{key:"Mod-u",run:kee,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:Iee,preventDefault:!0}];function tf(t,e){return Ne.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 Ey(t,e){return Ne.cursor(e?t.to:t.from)}function gj(t,e){return Go(t,n=>n.empty?t.moveByChar(n,e):Ey(n,e))}function ti(t){return t.textDirectionAt(t.state.selection.main.head)==yr.LTR}const mj=t=>gj(t,!ti(t)),yj=t=>gj(t,ti(t));function vj(t,e){return Go(t,n=>n.empty?t.moveByGroup(n,e):Ey(n,e))}const _ee=t=>vj(t,!ti(t)),Hee=t=>vj(t,ti(t));function Vee(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 My(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;Vee(t,d,i)?r=d:c=n?d.to:d.from}let s=r.type.prop(i),a,u;return s&&(a=n?pc(t,r.from,1):pc(t,r.to,-1))&&a.matched?u=n?a.end.to:a.end.from:u=n?r.to:r.from,Ne.cursor(u,n?-1:1)}const Fee=t=>Go(t,e=>My(t.state,e,!ti(t))),$ee=t=>Go(t,e=>My(t.state,e,ti(t)));function bj(t,e){return Go(t,n=>{if(!n.empty)return Ey(n,e);let r=t.moveVertically(n,e);return r.head!=n.head?r:t.moveToLineBoundary(n,e)})}const xj=t=>bj(t,!1),Sj=t=>bj(t,!0);function wj(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 Cj(t,e){let n=wj(t),{state:r}=t,i=tf(r.selection,a=>a.empty?t.moveVertically(a,e,n.height):Ey(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 yI=t=>Cj(t,!1),nw=t=>Cj(t,!0);function Aa(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=Ne.cursor(r.from+s))}return i}const Uee=t=>Go(t,e=>Aa(t,e,!0)),qee=t=>Go(t,e=>Aa(t,e,!1)),Gee=t=>Go(t,e=>Aa(t,e,!ti(t))),Wee=t=>Go(t,e=>Aa(t,e,ti(t))),Kee=t=>Go(t,e=>Ne.cursor(t.lineBlockAt(e.head).from,1)),Yee=t=>Go(t,e=>Ne.cursor(t.lineBlockAt(e.head).to,-1));function Xee(t,e,n){let r=!1,i=tf(t.selection,s=>{let a=pc(t,s.head,-1)||pc(t,s.head,1)||s.head>0&&pc(t,s.head-1,1)||s.head<t.doc.length&&pc(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 Ne.cursor(u)});return r?(e(qo(t,i)),!0):!1}const Qee=({state:t,dispatch:e})=>Xee(t,e);function bo(t,e){let n=tf(t.state.selection,r=>{let i=e(r);return Ne.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 Rj(t,e){return bo(t,n=>t.moveByChar(n,e))}const Tj=t=>Rj(t,!ti(t)),Ej=t=>Rj(t,ti(t));function Mj(t,e){return bo(t,n=>t.moveByGroup(n,e))}const Zee=t=>Mj(t,!ti(t)),Jee=t=>Mj(t,ti(t)),ete=t=>bo(t,e=>My(t.state,e,!ti(t))),tte=t=>bo(t,e=>My(t.state,e,ti(t)));function Aj(t,e){return bo(t,n=>t.moveVertically(n,e))}const Oj=t=>Aj(t,!1),kj=t=>Aj(t,!0);function Ij(t,e){return bo(t,n=>t.moveVertically(n,e,wj(t).height))}const vI=t=>Ij(t,!1),bI=t=>Ij(t,!0),nte=t=>bo(t,e=>Aa(t,e,!0)),rte=t=>bo(t,e=>Aa(t,e,!1)),ite=t=>bo(t,e=>Aa(t,e,!ti(t))),ote=t=>bo(t,e=>Aa(t,e,ti(t))),ste=t=>bo(t,e=>Ne.cursor(t.lineBlockAt(e.head).from)),lte=t=>bo(t,e=>Ne.cursor(t.lineBlockAt(e.head).to)),xI=({state:t,dispatch:e})=>(e(qo(t,{anchor:0})),!0),SI=({state:t,dispatch:e})=>(e(qo(t,{anchor:t.doc.length})),!0),wI=({state:t,dispatch:e})=>(e(qo(t,{anchor:t.selection.main.anchor,head:0})),!0),CI=({state:t,dispatch:e})=>(e(qo(t,{anchor:t.selection.main.anchor,head:t.doc.length})),!0),ate=({state:t,dispatch:e})=>(e(t.update({selection:{anchor:0,head:t.doc.length},userEvent:"select"})),!0),ute=({state:t,dispatch:e})=>{let n=Ay(t).map(({from:r,to:i})=>Ne.range(r,Math.min(i+1,t.doc.length)));return e(t.update({selection:Ne.create(n),userEvent:"select"})),!0},cte=({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 Ne.range(u.to,u.from)}return r});return n.eq(t.selection)?!1:(e(qo(t,n)),!0)};function Dj(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,Ne.create(i,i.length-1))),!0)}const fte=t=>Dj(t,!1),dte=t=>Dj(t,!0),hte=({state:t,dispatch:e})=>{let n=t.selection,r=null;return n.ranges.length>1?r=Ne.create([n.main]):n.main.empty||(r=Ne.create([Ne.cursor(n.main.head)])),r?(e(qo(t,r)),!0):!1};function bh(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=Tg(t,c,!1)):c>a&&(n="delete.forward",c=Tg(t,c,!0)),a=Math.min(a,c),u=Math.max(u,c)}else a=Tg(t,a,!1),u=Tg(t,u,!0);return a==u?{range:s}:{changes:{from:a,to:u},range:Ne.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 Tg(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 Pj=(t,e,n)=>bh(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=yy(u,s.tabSize),h=d%Em(s)||Em(s);for(let g=0;g<h&&u[u.length-1-g]==" ";g++)i--;c=i}else c=Zr(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=Zr(a.text,c-a.from,!1,!1)+a.from);return c}),rw=t=>Pj(t,!1,!0),zj=t=>Pj(t,!0,!1),Nj=(t,e)=>bh(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=Zr(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}),Lj=t=>Nj(t,!1),pte=t=>Nj(t,!0),gte=t=>bh(t,e=>{let n=t.lineBlockAt(e.head).to;return e.head<n?n:Math.min(t.state.doc.length,e.head+1)}),mte=t=>bh(t,e=>{let n=t.moveToLineBoundary(e,!1).head;return e.head>n?n:Math.max(0,e.head-1)}),yte=t=>bh(t,e=>{let n=t.moveToLineBoundary(e,!0).head;return e.head<n?n:Math.min(t.state.doc.length,e.head+1)}),vte=({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:Ne.cursor(r.from)}));return e(t.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},bte=({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:Zr(s.text,i-s.from,!1)+s.from,u=i==s.to?i+1:Zr(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:Ne.cursor(u)}});return n.changes.empty?!1:(e(t.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function Ay(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 Bj(t,e,n){if(t.readOnly)return!1;let r=[],i=[];for(let s of Ay(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(Ne.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(Ne.range(c.anchor-u,c.head-u))}}return r.length?(e(t.update({changes:r,scrollIntoView:!0,selection:Ne.create(i,t.selection.mainIndex),userEvent:"move.line"})),!0):!1}const xte=({state:t,dispatch:e})=>Bj(t,e,!1),Ste=({state:t,dispatch:e})=>Bj(t,e,!0);function jj(t,e,n){if(t.readOnly)return!1;let r=[];for(let s of Ay(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 wte=({state:t,dispatch:e})=>jj(t,e,!1),Cte=({state:t,dispatch:e})=>jj(t,e,!0),Rte=t=>{if(t.state.readOnly)return!1;let{state:e}=t,n=e.changes(Ay(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 Tte(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 RI=_j(!1),Ete=_j(!0);function _j(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&&Tte(e,s);t&&(s=a=(a<=u.to?u:e.doc.lineAt(a)).to);let d=new Ry(e,{simulateBreak:s,simulateDoubleBreak:!!c}),h=lj(d,s);for(h==null&&(h=yy(/^\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=["",Mm(e,h)];return c&&g.push(Mm(e,d.lineIndent(u.from,-1))),{changes:{from:s,to:a,insert:Yt.of(g)},range:Ne.cursor(s+1+g[1].length)}});return n(e.update(r,{scrollIntoView:!0,userEvent:"input"})),!0}}function SC(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:Ne.range(s.mapPos(r.anchor,1),s.mapPos(r.head,1))}})}const Mte=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=Object.create(null),r=new Ry(t,{overrideIndentation:s=>{let a=n[s];return a??-1}}),i=SC(t,(s,a,u)=>{let c=lj(r,s.from);if(c==null)return;/\S/.test(s.text)||(c=0);let d=/^\s*/.exec(s.text)[0],h=Mm(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},Ate=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(SC(t,(n,r)=>{r.push({from:n.from,insert:t.facet(yC)})}),{userEvent:"input.indent"})),!0),Ote=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(SC(t,(n,r)=>{let i=/^\s*/.exec(n.text)[0];if(!i)return;let s=yy(i,t.tabSize),a=0,u=Mm(t,Math.max(0,s-Em(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),kte=t=>(t.setTabFocusMode(),!0),Ite=[{key:"Ctrl-b",run:mj,shift:Tj,preventDefault:!0},{key:"Ctrl-f",run:yj,shift:Ej},{key:"Ctrl-p",run:xj,shift:Oj},{key:"Ctrl-n",run:Sj,shift:kj},{key:"Ctrl-a",run:Kee,shift:ste},{key:"Ctrl-e",run:Yee,shift:lte},{key:"Ctrl-d",run:zj},{key:"Ctrl-h",run:rw},{key:"Ctrl-k",run:gte},{key:"Ctrl-Alt-h",run:Lj},{key:"Ctrl-o",run:vte},{key:"Ctrl-t",run:bte},{key:"Ctrl-v",run:nw}],Dte=[{key:"ArrowLeft",run:mj,shift:Tj,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:_ee,shift:Zee,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:Gee,shift:ite,preventDefault:!0},{key:"ArrowRight",run:yj,shift:Ej,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:Hee,shift:Jee,preventDefault:!0},{mac:"Cmd-ArrowRight",run:Wee,shift:ote,preventDefault:!0},{key:"ArrowUp",run:xj,shift:Oj,preventDefault:!0},{mac:"Cmd-ArrowUp",run:xI,shift:wI},{mac:"Ctrl-ArrowUp",run:yI,shift:vI},{key:"ArrowDown",run:Sj,shift:kj,preventDefault:!0},{mac:"Cmd-ArrowDown",run:SI,shift:CI},{mac:"Ctrl-ArrowDown",run:nw,shift:bI},{key:"PageUp",run:yI,shift:vI},{key:"PageDown",run:nw,shift:bI},{key:"Home",run:qee,shift:rte,preventDefault:!0},{key:"Mod-Home",run:xI,shift:wI},{key:"End",run:Uee,shift:nte,preventDefault:!0},{key:"Mod-End",run:SI,shift:CI},{key:"Enter",run:RI,shift:RI},{key:"Mod-a",run:ate},{key:"Backspace",run:rw,shift:rw,preventDefault:!0},{key:"Delete",run:zj,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:Lj,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:pte,preventDefault:!0},{mac:"Mod-Backspace",run:mte,preventDefault:!0},{mac:"Mod-Delete",run:yte,preventDefault:!0}].concat(Ite.map(t=>({mac:t.key,run:t.run,shift:t.shift}))),Pte=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:Fee,shift:ete},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:$ee,shift:tte},{key:"Alt-ArrowUp",run:xte},{key:"Shift-Alt-ArrowUp",run:wte},{key:"Alt-ArrowDown",run:Ste},{key:"Shift-Alt-ArrowDown",run:Cte},{key:"Mod-Alt-ArrowUp",run:fte},{key:"Mod-Alt-ArrowDown",run:dte},{key:"Escape",run:hte},{key:"Mod-Enter",run:Ete},{key:"Alt-l",mac:"Ctrl-l",run:ute},{key:"Mod-i",run:cte,preventDefault:!0},{key:"Mod-[",run:Ote},{key:"Mod-]",run:Ate},{key:"Mod-Alt-\\",run:Mte},{key:"Shift-Mod-k",run:Rte},{key:"Shift-Mod-\\",run:Qee},{key:"Mod-/",run:xee},{key:"Alt-A",run:wee},{key:"Ctrl-m",mac:"Shift-Alt-m",run:kte}].concat(Dte),iw=16,Om=8,zte=8,Nte=32,Lte=126,km=t=>t.toString(16).toUpperCase().padStart(2,"0"),Hj=t=>t>=Nte&&t<=Lte?String.fromCharCode(t):".",Bte=t=>{const e=t.slice(0,Om).map(km).join(" "),n=t.slice(Om).map(km).join(" ");return n?`${e} ${n}`:e},jte=(t,e)=>{let n="",r="",i="";const s=Math.min(e+iw,t.length);for(let a=e;a<s;a++){const u=km(t[a]);a<e+Om?n+=n?` ${u}`:u:r+=r?` ${u}`:u,i+=Hj(t[a])}return{offset:e.toString(16).padStart(zte,"0"),hex:r?`${n} ${r}`:n,ascii:i}},_te=t=>{const e=[];for(let n=0;n<t.length;n+=iw)e.push(Bte(t.slice(n,n+iw)));return e.join(`
31
+ `)},Hte=(t,e=64)=>{let n="";const r=Math.min(t.length,e);for(let i=0;i<r;i++)n+=Hj(t[i]);return t.length>e?`${n}…`:n},Vte=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(""))},Fte=(t,e={})=>{const n=e.maxBytes??Om,r=`${t.length} B`;if(t.length===0)return r;const i=t.slice(0,n).map(km).join(" ");return t.length<=n?`${i} ${r}`:`${i} … ${r}`},$te=/^[0-9a-fA-F]{4,16}(?::\s+|\s{2,})/,Ute=/\|[^|]*\|\s*$/,qte=t=>{const e=t.split(/\r?\n/).map(r=>r.replace(Ute,"").replace($te,"")).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}},Gte=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}},Fg=(t,e)=>e==="hex"?_te(t):Vte(t),Vj=(t,e)=>e==="hex"?qte(t):Gte(t),Wte=(t,e)=>{const n=Vj(t,e);return n.ok?{bytes:n.value,error:null}:{bytes:null,error:n.error}},Kte=t=>{const e=t.mode??"hex";return t.initialBytes&&t.initialBytes.length>0?{mode:e,text:Fg(t.initialBytes,e),bytes:t.initialBytes,error:null}:{mode:e,text:"",bytes:null,error:null}},Yte=(t,e)=>{switch(e.type){case"set-text":return{...t,text:e.text,...Wte(e.text,t.mode)};case"normalize-paste":{const n=Vj(e.text,t.mode);return n.ok?{...t,text:Fg(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:Fg(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:Fg(e.bytes,t.mode),bytes:e.bytes,error:null}}},Xte=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"}}),TI=({label:t,active:e,onClick:n})=>A.jsx("button",{type:"button",onClick:n,className:Ie("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}),Qte=({initialBytes:t,onChange:e})=>{const[n,r]=R.useReducer(Yte,void 0,()=>Kte({})),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:[Oee(),nj.of([...Pte,...jee]),Xte,At.lineWrapping,At.updateListener.of(x=>{if(!x.docChanged)return;const S=x.state.doc.toString();if(S===d.current.text)return;const C=x.transactions.some(T=>T.isUserEvent("input.paste"));r({type:C?"normalize-paste":"set-text",text:S})})]}),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?Hte(n.bytes):"",y=b=>{n.mode!==b&&r({type:"switch-mode",mode:b})};return A.jsxs("div",{className:"flex flex-col gap-2",children:[A.jsxs("div",{className:"flex items-center gap-1",children:[A.jsx(TI,{label:"Hex",active:n.mode==="hex",onClick:()=>y("hex")}),A.jsx(TI,{label:"Base64",active:n.mode==="base64",onClick:()=>y("base64")})]}),A.jsx("div",{ref:u,className:"min-h-[120px] max-h-[300px] overflow-auto rounded-md border border-input bg-muted"}),s?A.jsxs("div",{className:"text-xs text-muted-foreground",children:["Preparing editor for ",t?.length??0," bytes…"]}):null,A.jsxs("div",{className:"flex flex-col gap-1 text-xs",children:[A.jsxs("div",{className:"text-muted-foreground",children:[g," bytes"]}),m&&A.jsxs("div",{className:"overflow-hidden text-ellipsis whitespace-nowrap text-muted-foreground",children:["ASCII: ",A.jsx("span",{className:"font-mono text-foreground",children:m})]}),n.error&&A.jsx("div",{className:"text-danger",children:n.error})]})]})},Zte={string:"Text",number:"Number",boolean:"Boolean",buffer:"Hex"},Jte=["string","number","boolean","buffer"],ene=({supportedTypes:t,value:e,onChange:n})=>{const r=Jte.filter(i=>t.includes(i));return r.length<=1?null:A.jsx("div",{role:"tablist","aria-label":"Edit as",className:"inline-flex overflow-hidden rounded-md border border-border",children:r.map(i=>A.jsx("button",{type:"button",role:"tab","aria-selected":e===i,onClick:()=>n(i),className:Ie("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:Zte[i]},i))})},tne=new TextEncoder,nne=new TextDecoder("utf-8",{fatal:!0}),ex=t=>{try{return nne.decode(new Uint8Array(t))}catch{return""}},tx=t=>Array.from(tne.encode(t)),rne=(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 tx(r)}}if(t==="number"){const r=n;switch(e){case"string":return String(r);case"boolean":return r!==0;case"buffer":return tx(String(r))}}if(t==="boolean"){const r=n;switch(e){case"string":return String(r);case"number":return r?1:0;case"buffer":return tx(String(r))}}if(t==="buffer"){const r=n;switch(e){case"string":return ex(r);case"number":{const i=ex(r),s=Number(i);return Number.isNaN(s)?0:s}case"boolean":return ex(r)==="true"}}return n},Mc=t=>{switch(t){case"string":return"";case"number":return 0;case"boolean":return!1;case"buffer":return[]}},Fj=({supportedTypes:t,type:e,value:n,onChange:r,inputId:i,autoFocus:s})=>{const a=u=>{if(u!==e){if(n===null){r(u,Mc(u));return}r(u,rne(e,u,n))}};return A.jsxs("div",{className:"flex flex-col gap-2",children:[A.jsx(ene,{supportedTypes:t,value:e,onChange:a}),e==="buffer"?A.jsx(Qte,{initialBytes:Array.isArray(n)?n:void 0,onChange:u=>r("buffer",u)}):e==="boolean"?A.jsxs(uc,{value:String(n??!1),onValueChange:u=>r("boolean",u==="true"),children:[A.jsx(uc.Trigger,{id:i,autoFocus:s,children:A.jsx(uc.Value,{})}),A.jsxs(uc.Content,{children:[A.jsx(uc.Item,{value:"true",children:"true"}),A.jsx(uc.Item,{value:"false",children:"false"})]})]}):e==="number"?A.jsx(yS,{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}):A.jsx(yS,{id:i,type:"text",value:String(n??""),onChange:u=>r("string",u.target.value),placeholder:"Enter string value",autoFocus:s})]})},ine=(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}}},one=({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(Mc(s)),m=X1();R.useEffect(()=>{t&&(u(""),d(s),g(Mc(s)))},[t,s]);const y=i.includes(c),b=()=>{u(""),d(s),g(Mc(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(ine(a,c,h)),b()}},S=T=>{T.key==="Enter"&&a.trim()&&c!=="buffer"&&x()},C=!a.trim()||!y||h===null;return A.jsx(un,{open:t,onOpenChange:T=>{T||b()},children:A.jsxs(un.Content,{onKeyDown:S,children:[A.jsx(un.Header,{children:A.jsx(un.Title,{children:"Add New Entry"})}),A.jsxs("div",{className:"flex flex-col gap-4",children:[A.jsxs(Oo,{children:[A.jsx(Oo.Label,{htmlFor:"new-entry-key",children:"Key"}),A.jsx(yS,{id:"new-entry-key",value:a,onChange:T=>u(T.target.value),placeholder:"Enter key name",autoFocus:!0})]}),A.jsxs(Oo,{children:[A.jsx(Oo.Label,{htmlFor:"new-entry-value",children:"Value"}),A.jsx(Fj,{supportedTypes:i,type:c,value:h,onChange:(T,E)=>{d(T),g(E)},inputId:"new-entry-value"}),!y&&A.jsx(Oo.Description,{className:"text-danger",children:"Selected type is not supported by this storage."})]})]}),A.jsxs(un.Footer,{children:[A.jsx(Ho,{tone:"neutral",variant:"outline",onClick:b,children:"Cancel"}),A.jsx(Ho,{onClick:()=>{x()},disabled:C,children:"Add Entry"})]})]})})},sne=({isOpen:t,onClose:e,onEditEntry:n,entry:r,supportedTypes:i})=>{const s=R.useRef(r),[a,u]=R.useState("string"),[c,d]=R.useState(Mc("string")),h=X1();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(Mc("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 S=!m||c===null;return A.jsx(un,{open:t,onOpenChange:C=>{C||y()},children:A.jsxs(un.Content,{onKeyDown:x,children:[A.jsx(un.Header,{children:A.jsx(un.Title,{children:"Edit Entry"})}),A.jsxs("div",{className:"flex flex-col gap-4",children:[A.jsxs(Oo,{children:[A.jsx(Oo.Label,{children:"Key"}),A.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}),A.jsx(Oo.Description,{children:"Key cannot be changed during editing"})]}),A.jsxs(Oo,{children:[A.jsx(Oo.Label,{htmlFor:"edit-entry-value",children:"Value"}),A.jsx(Fj,{supportedTypes:i,type:a,value:c,onChange:(C,T)=>{u(C),d(T)},inputId:"edit-entry-value",autoFocus:!0},g.key),!m&&A.jsxs(Oo.Description,{className:"text-danger",children:["This storage does not support ",a," values."]})]})]}),A.jsxs(un.Footer,{children:[A.jsx(Ho,{tone:"neutral",variant:"outline",onClick:y,children:"Cancel"}),A.jsx(Ho,{onClick:()=>{b()},disabled:S,children:"Save Changes"})]})]})})},lne=t=>t.type==="string"?A.jsxs("span",{className:"font-mono text-foreground",children:['"',t.value,'"']}):t.type==="number"?A.jsx("span",{className:"font-mono text-foreground",children:t.value}):t.type==="boolean"?A.jsx("span",{className:Ie("font-mono",t.value?"text-primary":"text-danger"),children:t.value?"true":"false"}):A.jsx("span",{className:"font-mono text-muted-foreground",children:Fte(t.value)}),ane=5e4,EI=2e3,une=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+=EI)e.push([s,Math.min(s+EI,i)]);n=i}return e.length===0?[[0,0]]:e},cne=({value:t})=>{const e=R.useMemo(()=>t.length>ane?une(t):null,[t]);return e?A.jsx(bL,{"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 A.jsxs("div",{className:"whitespace-pre-wrap wrap-anywhere",children:[n===0?'"':"",t.slice(r,i),n===e.length-1?'"':""]})}}):A.jsxs("pre",{className:"font-mono text-sm text-success whitespace-pre-wrap wrap-anywhere",children:['"',t,'"']})},fne=({bytes:t})=>{const e=Math.ceil(t.length/16);return e===0?A.jsx("div",{className:"text-xs text-muted italic",children:"No bytes to display."}):A.jsx(bL,{"aria-label":"Buffer hexdump",className:"font-mono text-xs text-accent",style:{height:384},totalCount:e,itemContent:n=>{const r=jte(t,n*16);return A.jsxs("div",{className:"flex gap-4 leading-snug whitespace-pre",children:[A.jsx("span",{className:"text-muted",children:r.offset}),A.jsx("span",{children:r.hex}),A.jsxs("span",{className:"text-muted",children:["|",r.ascii,"|"]})]})}})},dne=5e4,hne=t=>{try{const e=JSON.parse(t);return Array.isArray(e)||e&&typeof e=="object"?e:null}catch{return null}},pne=({open:t,onOpenChange:e,onEdit:n,entry:r})=>{const i=r?.type==="string",s=i?r.value:"",a=R.useMemo(()=>!i||s.length>dne?null:hne(s),[i,s]);return A.jsx(un,{open:t,onOpenChange:e,children:A.jsxs(un.Content,{className:"max-w-2xl",children:[A.jsx(un.Header,{children:A.jsxs("div",{className:"flex items-center gap-2",children:[A.jsx(R6,{className:"h-4 w-4 text-muted-foreground"}),A.jsx(un.Title,{children:"Entry Details"})]})}),r&&A.jsxs("div",{className:"flex max-h-[70vh] flex-col gap-4 overflow-auto",children:[A.jsxs("div",{children:[A.jsx("div",{className:"mb-1 text-sm font-medium text-foreground",children:"Key"}),A.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})]}),A.jsxs("div",{children:[A.jsx("div",{className:"mb-1 text-sm font-medium text-foreground",children:"Type"}),A.jsx(cm,{tone:"neutral",variant:"outline",children:r.type})]}),A.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[A.jsx("div",{className:"mb-1 text-sm font-medium text-foreground",children:"Value"}),A.jsx("div",{className:"max-h-96 overflow-auto rounded-md border border-input bg-muted p-3",children:a?A.jsx(eQ,{data:a}):r.type==="buffer"?A.jsxs("div",{className:"flex flex-col gap-2",children:[A.jsxs("div",{className:"text-xs text-muted-foreground",children:[r.value.length," ",r.value.length===1?"byte":"bytes"]}),A.jsx(fne,{bytes:r.value})]}):r.type==="string"?A.jsx(cne,{value:r.value}):A.jsx("div",{className:"text-sm",children:lne(r)})})]})]}),A.jsxs(un.Footer,{children:[r&&n&&A.jsxs(Ho,{tone:"neutral",variant:"outline",onClick:()=>n(r),children:[A.jsx(GD,{className:"h-3.5 w-3.5"}),"Edit"]}),A.jsx(un.Close,{render:A.jsx(Ho,{}),children:"Close"})]})]})})},nx=({title:t,items:e})=>e.length===0?null:A.jsxs("div",{children:[A.jsxs("div",{className:"text-xs font-medium text-foreground",children:[t," (",e.length,")"]}),A.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`:""]})]}),rx=({label:t,value:e})=>A.jsxs("div",{className:"rounded-md bg-muted p-2",children:[A.jsx("div",{className:"text-muted-foreground",children:t}),A.jsx("div",{className:"text-base font-semibold text-foreground",children:e})]}),gne=({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 A.jsxs(A.Fragment,{children:[A.jsxs("div",{className:"flex flex-col gap-3",children:[i.metadataMismatch&&A.jsxs("div",{className:"flex items-start gap-2 rounded-md border border-border bg-muted p-2 text-xs text-foreground",children:[A.jsx(v6,{className:"mt-0.5 h-4 w-4 shrink-0 text-muted-foreground"}),A.jsxs("div",{children:["This file was exported from ",A.jsx("strong",{children:c}),". You are importing into"," ",A.jsx("strong",{children:a}),"."]})]}),u&&A.jsxs("div",{className:"flex items-start gap-2 rounded-md border border-danger/40 bg-danger/10 p-2 text-xs text-danger",children:[A.jsx(WD,{className:"mt-0.5 h-4 w-4 shrink-0"}),A.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.",A.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(", ")})]})]}),A.jsxs("div",{className:"grid grid-cols-3 gap-2 text-xs",children:[A.jsx(rx,{label:"New",value:i.newKeys.length}),A.jsx(rx,{label:"Overwrite",value:i.overwriteKeys.length}),A.jsx(rx,{label:"Skipped",value:i.skippedKeys.length})]}),A.jsx(nx,{title:"New keys",items:i.newKeys}),A.jsx(nx,{title:"Overwrite keys",items:i.overwriteKeys}),A.jsx(nx,{title:"Skipped (filtered by storage)",items:i.skippedKeys.map(d=>d.key)})]}),A.jsxs(un.Footer,{children:[A.jsx(Ho,{tone:"neutral",variant:"outline",onClick:n,children:"Cancel"}),A.jsxs(Ho,{onClick:e,disabled:u,children:["Apply (",s.length,")"]})]})]})},mne=({state:t})=>A.jsxs("div",{className:"flex flex-col items-center gap-3 py-6",children:[A.jsx(T6,{className:"h-6 w-6 animate-spin text-muted-foreground"}),A.jsxs("div",{className:"text-sm text-foreground",children:["Importing… ",t.written," / ",t.total]})]}),yne=({state:t,onClose:e})=>A.jsxs(A.Fragment,{children:[t.ok?A.jsxs("div",{className:"flex flex-col items-center gap-3 py-4",children:[A.jsx(b6,{className:"h-8 w-8 text-primary"}),A.jsxs("div",{className:"text-sm text-foreground",children:["Imported ",t.written," ",t.written===1?"entry":"entries","."]})]}):A.jsxs("div",{className:"flex flex-col gap-2 py-2",children:[A.jsxs("div",{className:"flex items-center gap-2 text-danger",children:[A.jsx(WD,{className:"h-5 w-5"}),A.jsxs("div",{className:"text-sm font-medium",children:["Import failed after ",t.written," of ",t.total,"."]})]}),t.failedKey&&A.jsxs("div",{className:"text-xs text-muted-foreground",children:["Failed at key:"," ",A.jsx(cm,{tone:"neutral",variant:"outline",className:"font-mono",children:t.failedKey})]}),A.jsx("div",{className:"rounded-md bg-muted px-2 py-1 font-mono text-xs text-danger",children:t.error})]}),A.jsx(un.Footer,{children:A.jsx(Ho,{onClick:e,autoFocus:!0,children:"Close"})})]}),vne=({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 A.jsx(un,{open:t!==null,onOpenChange:a=>{!a&&s&&r()},children:A.jsxs(un.Content,{showCloseButton:s,children:[A.jsx(un.Header,{children:A.jsx(un.Title,{children:i})}),t?.phase==="preview"&&A.jsx(gne,{state:t,onApply:e,onCancel:n}),t?.phase==="importing"&&A.jsx(mne,{state:t}),t?.phase==="result"&&A.jsx(yne,{state:t,onClose:r})]})})},bne={defaultOptions:{queries:{gcTime:0,refetchOnReconnect:!1,refetchOnWindowFocus:!1,retry:!1}}},xne=()=>new A4(bne),Sne=({children:t})=>{const[e]=R.useState(xne);return R.useEffect(()=>()=>e.clear(),[e]),A.jsx(D4,{client:e,children:t})},wne=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()]},Cne=100,Rne=5,$j=t=>t.trim().toLowerCase(),wC=t=>["storage-entry-previews",t.adapterId,t.storageId],Tne=(t,e,n)=>[...wC(t),$j(e),n],CC=t=>["storage-full-entry",t.adapterId,t.storageId],Uj=(t,e)=>[...CC(t),e],MI=async(t,e)=>{const n=wC(e),r=CC(e);await t.cancelQueries({queryKey:n}),await t.cancelQueries({queryKey:r}),t.removeQueries({queryKey:r}),await t.resetQueries({queryKey:n})},Ene=async(t,e)=>t.invalidateQueries({queryKey:wC(e)}),Mne=async(t,e,n)=>{const r=n==null?CC(e):Uj(e,n);await t.cancelQueries({queryKey:r,exact:n!=null}),t.removeQueries({queryKey:r,exact:n!=null})},Ane=({client:t,target:e,search:n,keySortDirection:r,pageSize:i=Cne,maxPages:s=Rne})=>{const a=$j(n),u=R.useMemo(()=>e?Tne(e,a,r):["storage-entry-previews","no-target"],[r,a,e?.adapterId,e?.storageId]);return U4({queryKey:u,enabled:t!=null&&e!=null,initialPageParam:void 0,maxPages:Math.max(1,s),placeholderData:f4,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})},One=t=>t?.pages.flatMap(e=>e.items)??[],kne=({client:t,target:e,key:n,enabled:r=!0})=>{const i=pw(),s=R.useMemo(()=>e&&n!=null?Uj(e,n):["storage-full-entry","no-entry"],[n,e?.adapterId,e?.storageId]),a=$4({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}},Ine=(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)},AI=t=>t.replace(/[^a-zA-Z0-9_-]/g,"-"),Dne=(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-${AI(t.adapterId)}-${AI(t.storageId)}-${c}.json`},to=(t,e)=>t.adapterId===e.adapterId&&t.storageId===e.storageId,OI=t=>typeof t=="string"?"string":typeof t=="number"?"number":typeof t=="boolean"?"boolean":"buffer",Pne=(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 zne(){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"}),[S,C]=R.useState(null),T=X1(),E=R.useRef(null),M=R.useRef(null),k=R.useRef(0),D=R.useRef(null),O=R.useRef(null),I=R.useRef(0),L=R.useRef(null),_=R.useRef(!1),N=R.useRef(!1),B=R.useRef(new Set),H=u8({pluginId:"@rozenite/storage-plugin"}),F=pw(),G=Pne(i),j=t.find(oe=>n&&to(oe.target,n)),q=Ane({client:H,target:n,search:G,keySortDirection:a}),$=kne({client:H,target:n,key:c?.key,enabled:c!==null}),X=One(q.data),Z=j?.capabilities.supportedTypes??[],z=R.useMemo(()=>{const oe=new Map(t.map(xe=>[ag(xe.target),xe]));return wne(oe)},[t]),U=()=>{$.reset(),d(null)},W=async()=>{n&&(U(),y(oe=>oe+1),await MI(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=>to(me.target,de))?de:we.storages[0]?.target??null))}),ze=H.onMessage("import-progress",we=>{C(de=>de?.phase==="importing"&&de.requestId===we.requestId&&to(de.target,we.target)?{...de,written:we.written,total:we.total}:de)}),ne=H.onMessage("import-result",we=>{L.current===we.requestId&&M.current&&to(we.target,M.current)&&(L.current=null,U(),y(de=>de+1),MI(F,we.target)),C(de=>de?.phase!=="importing"||de.requestId!==we.requestId||!to(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=>{Mne(F,we.target,we.key),e(me=>me.map(Be=>to(Be.target,we.target)?{...Be,entryCount:we.entryCount}:Be)),M.current&&to(we.target,M.current)&&d(me=>me&&(we.key==null||me.key===we.key)?null:me);const de=ag(we.target);B.current.has(de)||(B.current.add(de),queueMicrotask(()=>{B.current.delete(de),M.current&&to(we.target,M.current)&&y(me=>me+1),Ene(F,we.target)}))}),le=H.onMessage("device-ready",()=>{F.resetQueries(),oe()});return oe(),()=>{xe.remove(),ze.remove(),ne.remove(),J.remove(),le.remove()}},[H,F]),R.useEffect(()=>{M.current=n,D.current?.abort(),D.current=null,O.current?.abort(),O.current=null,L.current=null,x({status:"idle"}),d(null),C(null)},[n]),R.useEffect(()=>()=>{D.current?.abort(),O.current?.abort()},[]);const K=oe=>{oe()},ie=(oe,xe)=>{if(!H||!n||!Z.includes(OI(xe)))return;const ze=OI(xe),ne=ze==="string"?{key:oe,type:ze,value:xe}:ze==="number"?{key:oe,type:ze,value:xe}:ze==="boolean"?{key:oe,type:ze,value:xe}:{key:oe,type:ze,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:j?`Are you sure you want to remove all entries from "${j.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 ze;try{ze=JSON.parse(await xe.text())}catch(we){se("Could not read file",we instanceof Error?we.message:String(we));return}const ne=SQ(ze);if(!ne.ok){se("Invalid snapshot",`${ne.error.path}: ${ne.error.message}`);return}O.current?.abort();const J=new AbortController;O.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||!to(le,M.current??le))return;C({phase:"preview",target:le,targetLabel:j?`${j.adapterName} / ${j.storageName}`:"selected storage",snapshot:ne.snapshot,preview:we.preview,entriesToWrite:we.preview.acceptedEntryIndexes.map(de=>ne.snapshot.entries[de])})}catch{!J.signal.aborted&&to(le,M.current??le)&&se("Could not preview import","Could not inspect the selected storage. Please try again.")}finally{O.current===J&&(O.current=null)}},he=()=>{if(!H||S?.phase!=="preview")return;const oe=`import-${++I.current}`;L.current=oe,H.send("import-entries",{type:"import-entries",requestId:oe,target:S.target,entries:S.entriesToWrite}),C({phase:"importing",requestId:oe,target:S.target,total:S.entriesToWrite.length,written:0})},pe=async()=>{if(!H||!n||D.current)return;const oe=n,xe=new AbortController;D.current=xe,x({status:"loading"});try{const ze=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&&to(oe,M.current??oe)&&(Ine(ze.snapshot,Dne(oe)),x({status:"idle"}))}catch{!xe.signal.aborted&&to(oe,M.current??oe)&&x({status:"error",message:"Could not export the selected storage. Please try again."})}finally{D.current===xe&&(D.current=null)}},Te=R.useMemo(()=>[{id:"key",accessorKey:"key",header:"Key",enableSorting:!0,cell:({row:oe})=>A.jsx("span",{className:"font-mono text-sm text-foreground",children:oe.original.key})},{id:"type",accessorKey:"type",header:"Type",enableSorting:!1,cell:({row:oe})=>A.jsx(cm,{tone:"neutral",variant:"outline",children:oe.original.type})},{id:"preview",accessorKey:"preview",header:"Value",enableSorting:!1,cell:({row:oe})=>A.jsxs("div",{className:"min-w-0",children:[A.jsx("span",{className:"break-all font-mono text-sm text-foreground",children:oe.original.preview}),A.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})=>A.jsxs("div",{className:"flex items-center gap-1",onClick:xe=>xe.stopPropagation(),children:[A.jsx(yk,{tone:"neutral",variant:"ghost",onClick:()=>d({key:oe.original.key,mode:"edit"}),label:`Edit value for ${oe.original.key}`,children:A.jsx(GD,{className:"h-3.5 w-3.5"})}),A.jsx(yk,{tone:"neutral",variant:"ghost",className:"text-muted-foreground hover:text-danger",onClick:()=>{ae(oe.original.key)},label:`Delete entry ${oe.original.key}`,children:A.jsx(SA,{className:"h-3.5 w-3.5"})})]})}],[ae]),De=[{id:"key",desc:a==="descending"}],Pe=oe=>{const ze=(typeof oe=="function"?oe(De):oe).find(ne=>ne.id==="key");u(ze?.desc?"descending":"ascending")},Ee=()=>{!q.hasNextPage||q.isFetching||q.isFetchingNextPage||_.current||(_.current=!0,q.fetchNextPage().finally(()=>{_.current=!1}))},_e=()=>{!q.hasPreviousPage||q.isFetching||q.isFetchingPreviousPage||N.current||(N.current=!0,q.fetchPreviousPage().finally(()=>{N.current=!1}))},Me=n?ag(n):"";return A.jsxs(A.Fragment,{children:[A.jsx(IL.Body,{children:A.jsxs(lg,{direction:"horizontal",autoSaveId:"storage",children:[A.jsx(lg.Pane,{defaultSize:22,minSize:15,maxSize:40,children:A.jsx(Nb,{className:"w-full border-r-0",children:z.length===0?A.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=>A.jsx(Nb.Group,{label:oe.adapterName,children:oe.items.map(xe=>A.jsx(Nb.Item,{selected:xe.viewId===Me,leading:A.jsx(xA,{}),trailing:A.jsx(cm,{tone:"neutral",children:xe.entryCount}),onClick:()=>{const ze=t.find(ne=>ag(ne.target)===xe.viewId);ze&&r(ze.target)},children:xe.storageName},xe.viewId))},oe.adapterId))})}),A.jsx(lg.Handle,{}),A.jsx(lg.Pane,{children:A.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[A.jsxs(eo,{children:[A.jsxs(eo.Group,{children:[A.jsx(eo.Button,{onClick:()=>g(!0),disabled:!j,"aria-label":"Add entry",title:"Add entry",className:"w-6 px-0",children:A.jsx(M6,{className:"h-3.5 w-3.5"})}),A.jsx(eo.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:A.jsx(SA,{className:"h-3.5 w-3.5"})})]}),A.jsx(eo.Separator,{}),A.jsx(eo.Group,{children:A.jsx(eo.Button,{onClick:()=>{W()},disabled:!n||q.isFetching,"aria-label":"Refresh storage",title:"Refresh storage",className:"w-6 px-0",children:A.jsx(A6,{className:"h-3.5 w-3.5"})})}),A.jsx(eo.Separator,{}),A.jsxs(eo.Group,{children:[A.jsx(eo.Button,{onClick:ve,disabled:!j,"aria-label":"Import storage",title:"Import storage",className:"w-6 px-0",children:A.jsx(I6,{className:"h-3.5 w-3.5"})}),A.jsx(eo.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:A.jsx(w6,{className:"h-3.5 w-3.5"})})]}),A.jsx(eo.Separator,{}),A.jsx("div",{className:"min-w-40 flex-1",children:A.jsx(MX,{placeholder:"Search keys…",value:i,onChange:oe=>s(oe.target.value),onClear:()=>s(""),disabled:!j})}),b.status==="error"?A.jsx("span",{role:"alert",className:"text-xs text-danger",children:b.message}):null,A.jsx("input",{ref:E,type:"file",accept:"application/json,.json",className:"hidden",onChange:ye})]}),A.jsx("div",{className:"min-h-0 flex-1 overflow-auto",children:j?A.jsx(NX,{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:Pe,onStartReached:_e,scrollClassName:"h-full w-full overflow-auto",style:{height:"100%"},sorting:De},m):A.jsx(zL,{icon:xA,title:"No storage selected",description:"Choose a storage from the sidebar to inspect its entries."})})]})})]})}),A.jsx(one,{isOpen:h,onClose:()=>g(!1),onAddEntry:ee,existingKeys:X.map(oe=>oe.key),supportedTypes:Z}),A.jsx(pne,{open:c?.mode==="detail"&&$.entry!=null,onOpenChange:oe=>{oe||U()},onEdit:()=>d(oe=>oe&&{...oe,mode:"edit"}),entry:$.entry??null}),A.jsx(sne,{isOpen:c?.mode==="edit"&&$.entry!=null,onClose:U,onEditEntry:ie,entry:$.entry??null,supportedTypes:Z}),A.jsx(vne,{state:S,onApply:he,onCancel:()=>C(null),onClose:()=>C(null)})]})}function Nne(){return A.jsx(Sne,{children:A.jsx(IL,{children:A.jsx(zne,{})})})}const qj="panel";Ad.registerComponent(qj,()=>Nne);Ad.runApplication(qj,{initialProps:{},rootTag:document.getElementById("root")});