@waifucave/discord-waifus 1.5.154

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 (138) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +230 -0
  3. package/THIRD_PARTY_NOTICES.md +26 -0
  4. package/assets/ocr/eng.traineddata +0 -0
  5. package/bin/waifus.mjs +36 -0
  6. package/dist/api/errors.d.ts +9 -0
  7. package/dist/api/errors.js +23 -0
  8. package/dist/api/errors.js.map +1 -0
  9. package/dist/api/server.d.ts +19 -0
  10. package/dist/api/server.js +1290 -0
  11. package/dist/api/server.js.map +1 -0
  12. package/dist/backend/logger.d.ts +20 -0
  13. package/dist/backend/logger.js +65 -0
  14. package/dist/backend/logger.js.map +1 -0
  15. package/dist/backend/migrations.d.ts +4 -0
  16. package/dist/backend/migrations.js +521 -0
  17. package/dist/backend/migrations.js.map +1 -0
  18. package/dist/backend/redaction.d.ts +1 -0
  19. package/dist/backend/redaction.js +22 -0
  20. package/dist/backend/redaction.js.map +1 -0
  21. package/dist/backend/runtime.d.ts +30 -0
  22. package/dist/backend/runtime.js +49 -0
  23. package/dist/backend/runtime.js.map +1 -0
  24. package/dist/backend/server.d.ts +18 -0
  25. package/dist/backend/server.js +581 -0
  26. package/dist/backend/server.js.map +1 -0
  27. package/dist/cli/commands.d.ts +35 -0
  28. package/dist/cli/commands.js +510 -0
  29. package/dist/cli/commands.js.map +1 -0
  30. package/dist/cli/main.d.ts +1 -0
  31. package/dist/cli/main.js +12 -0
  32. package/dist/cli/main.js.map +1 -0
  33. package/dist/cli/parser.d.ts +10 -0
  34. package/dist/cli/parser.js +64 -0
  35. package/dist/cli/parser.js.map +1 -0
  36. package/dist/config/appConfig.d.ts +3 -0
  37. package/dist/config/appConfig.js +27 -0
  38. package/dist/config/appConfig.js.map +1 -0
  39. package/dist/config/layout.d.ts +13 -0
  40. package/dist/config/layout.js +173 -0
  41. package/dist/config/layout.js.map +1 -0
  42. package/dist/config/paths.d.ts +5 -0
  43. package/dist/config/paths.js +20 -0
  44. package/dist/config/paths.js.map +1 -0
  45. package/dist/config/prebuiltWaifus.d.ts +3 -0
  46. package/dist/config/prebuiltWaifus.js +106 -0
  47. package/dist/config/prebuiltWaifus.js.map +1 -0
  48. package/dist/discord/client.d.ts +394 -0
  49. package/dist/discord/client.js +1196 -0
  50. package/dist/discord/client.js.map +1 -0
  51. package/dist/discord/contextBuilder.d.ts +15 -0
  52. package/dist/discord/contextBuilder.js +18 -0
  53. package/dist/discord/contextBuilder.js.map +1 -0
  54. package/dist/discord/intents.d.ts +5 -0
  55. package/dist/discord/intents.js +21 -0
  56. package/dist/discord/intents.js.map +1 -0
  57. package/dist/discord/memberCache.d.ts +12 -0
  58. package/dist/discord/memberCache.js +55 -0
  59. package/dist/discord/memberCache.js.map +1 -0
  60. package/dist/discord/normalization.d.ts +34 -0
  61. package/dist/discord/normalization.js +330 -0
  62. package/dist/discord/normalization.js.map +1 -0
  63. package/dist/discord/rateLimit.d.ts +9 -0
  64. package/dist/discord/rateLimit.js +11 -0
  65. package/dist/discord/rateLimit.js.map +1 -0
  66. package/dist/orchestration/context.d.ts +85 -0
  67. package/dist/orchestration/context.js +200 -0
  68. package/dist/orchestration/context.js.map +1 -0
  69. package/dist/orchestration/decisions.d.ts +52 -0
  70. package/dist/orchestration/decisions.js +61 -0
  71. package/dist/orchestration/decisions.js.map +1 -0
  72. package/dist/orchestration/messageSplit.d.ts +6 -0
  73. package/dist/orchestration/messageSplit.js +118 -0
  74. package/dist/orchestration/messageSplit.js.map +1 -0
  75. package/dist/orchestration/ocr.d.ts +43 -0
  76. package/dist/orchestration/ocr.js +504 -0
  77. package/dist/orchestration/ocr.js.map +1 -0
  78. package/dist/orchestration/ocrPackages.d.ts +24 -0
  79. package/dist/orchestration/ocrPackages.js +85 -0
  80. package/dist/orchestration/ocrPackages.js.map +1 -0
  81. package/dist/orchestration/promptBlocks.d.ts +28 -0
  82. package/dist/orchestration/promptBlocks.js +232 -0
  83. package/dist/orchestration/promptBlocks.js.map +1 -0
  84. package/dist/orchestration/replyQuote.d.ts +7 -0
  85. package/dist/orchestration/replyQuote.js +198 -0
  86. package/dist/orchestration/replyQuote.js.map +1 -0
  87. package/dist/orchestration/reviewer.d.ts +5 -0
  88. package/dist/orchestration/reviewer.js +5 -0
  89. package/dist/orchestration/reviewer.js.map +1 -0
  90. package/dist/orchestration/runtime.d.ts +152 -0
  91. package/dist/orchestration/runtime.js +3535 -0
  92. package/dist/orchestration/runtime.js.map +1 -0
  93. package/dist/orchestration/session.d.ts +30 -0
  94. package/dist/orchestration/session.js +41 -0
  95. package/dist/orchestration/session.js.map +1 -0
  96. package/dist/orchestration/stageManager.d.ts +42 -0
  97. package/dist/orchestration/stageManager.js +50 -0
  98. package/dist/orchestration/stageManager.js.map +1 -0
  99. package/dist/providers/catalog.d.ts +6 -0
  100. package/dist/providers/catalog.js +212 -0
  101. package/dist/providers/catalog.js.map +1 -0
  102. package/dist/providers/pipelines.d.ts +13 -0
  103. package/dist/providers/pipelines.js +2388 -0
  104. package/dist/providers/pipelines.js.map +1 -0
  105. package/dist/providers/types.d.ts +91 -0
  106. package/dist/providers/types.js +2 -0
  107. package/dist/providers/types.js.map +1 -0
  108. package/dist/shared/queryLog.d.ts +39 -0
  109. package/dist/shared/queryLog.js +80 -0
  110. package/dist/shared/queryLog.js.map +1 -0
  111. package/dist/shared/schemas/common.d.ts +21 -0
  112. package/dist/shared/schemas/common.js +27 -0
  113. package/dist/shared/schemas/common.js.map +1 -0
  114. package/dist/shared/schemas/config.d.ts +57 -0
  115. package/dist/shared/schemas/config.js +49 -0
  116. package/dist/shared/schemas/config.js.map +1 -0
  117. package/dist/shared/schemas/domain.d.ts +825 -0
  118. package/dist/shared/schemas/domain.js +444 -0
  119. package/dist/shared/schemas/domain.js.map +1 -0
  120. package/dist/storage/atomic.d.ts +6 -0
  121. package/dist/storage/atomic.js +60 -0
  122. package/dist/storage/atomic.js.map +1 -0
  123. package/dist/storage/errors.d.ts +12 -0
  124. package/dist/storage/errors.js +23 -0
  125. package/dist/storage/errors.js.map +1 -0
  126. package/dist/storage/locks.d.ts +9 -0
  127. package/dist/storage/locks.js +42 -0
  128. package/dist/storage/locks.js.map +1 -0
  129. package/dist/storage/storageService.d.ts +25 -0
  130. package/dist/storage/storageService.js +66 -0
  131. package/dist/storage/storageService.js.map +1 -0
  132. package/dist-frontend/assets/index-B2bB3_2r.js +39 -0
  133. package/dist-frontend/assets/index-B2bB3_2r.js.map +1 -0
  134. package/dist-frontend/assets/index-Dj1L8Px-.css +1 -0
  135. package/dist-frontend/index.html +14 -0
  136. package/docs/api.md +162 -0
  137. package/docs/old-orchestrator-prompt.md +123 -0
  138. package/package.json +81 -0
@@ -0,0 +1,39 @@
1
+ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,a)=>(a=n==null?{}:e(i(n)),s(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var l=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=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,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function ee(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function E(e,t){return ee(e.type,t,e.props)}function D(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function te(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var ne=/\/+/g;function re(e,t){return typeof e==`object`&&e&&e.key!=null?te(``+e.key):t.toString(36)}function ie(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function ae(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,ae(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+re(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(ne,`$&/`)+`/`),ae(o,r,i,``,function(e){return e})):o!=null&&(D(o)&&(o=E(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(ne,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+re(a,u),c+=ae(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+re(a,u++),c+=ae(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return ae(ie(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function oe(e,t,n){if(e==null)return e;var r=[],i=0;return ae(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function se(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var O=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},k={map:oe,forEach:function(e,t,n){oe(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return oe(e,function(){t++}),t},toArray:function(e){return oe(e,function(e){return e})||[]},only:function(e){if(!D(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=k,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return ee(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)T.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return ee(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=D,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:se}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,O)}catch(e){O(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.6`})),u=o(((e,t)=>{t.exports=l()})),d=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,D());else{var t=n(l);t!==null&&re(x,t.startTime-e)}}var S=!1,C=-1,w=5,T=-1;function ee(){return g?!0:!(e.unstable_now()-T<w)}function E(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&ee());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&re(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?D():S=!1}}}var D;if(typeof y==`function`)D=function(){y(E)};else if(typeof MessageChannel<`u`){var te=new MessageChannel,ne=te.port2;te.port1.onmessage=E,D=function(){ne.postMessage(null)}}else D=function(){_(E,0)};function re(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,re(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,D()))),r},e.unstable_shouldYield=ee,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),f=o(((e,t)=>{t.exports=d()})),p=o((e=>{var t=u();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return o(e,t,null,r)},e.flushSync=function(e){var t=s.T,n=i.p;try{if(s.T=null,i.p=2,e)return e()}finally{s.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`)if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=c(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??i.d.M(e)},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`)if(t){var n=c(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else i.d.m(e)},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return s.H.useFormState(e,t,n)},e.useFormStatus=function(){return s.H.useHostTransitionStatus()},e.version=`19.2.6`})),m=o(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=p()})),h=o((e=>{var t=f(),n=u(),r=m();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function d(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function p(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=p(e),t!==null)return t;e=e.sibling}return null}var h=Object.assign,g=Symbol.for(`react.element`),_=Symbol.for(`react.transitional.element`),v=Symbol.for(`react.portal`),y=Symbol.for(`react.fragment`),b=Symbol.for(`react.strict_mode`),x=Symbol.for(`react.profiler`),S=Symbol.for(`react.consumer`),C=Symbol.for(`react.context`),w=Symbol.for(`react.forward_ref`),T=Symbol.for(`react.suspense`),ee=Symbol.for(`react.suspense_list`),E=Symbol.for(`react.memo`),D=Symbol.for(`react.lazy`),te=Symbol.for(`react.activity`),ne=Symbol.for(`react.memo_cache_sentinel`),re=Symbol.iterator;function ie(e){return typeof e!=`object`||!e?null:(e=re&&e[re]||e[`@@iterator`],typeof e==`function`?e:null)}var ae=Symbol.for(`react.client.reference`);function oe(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===ae?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case y:return`Fragment`;case x:return`Profiler`;case b:return`StrictMode`;case T:return`Suspense`;case ee:return`SuspenseList`;case te:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case v:return`Portal`;case C:return e.displayName||`Context`;case S:return(e._context.displayName||`Context`)+`.Consumer`;case w:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case E:return t=e.displayName||null,t===null?oe(e.type)||`Memo`:t;case D:t=e._payload,e=e._init;try{return oe(e(t))}catch{}}return null}var se=Array.isArray,O=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,k=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ce={pending:!1,data:null,method:null,action:null},le=[],ue=-1;function A(e){return{current:e}}function de(e){0>ue||(e.current=le[ue],le[ue]=null,ue--)}function j(e,t){ue++,le[ue]=e.current,e.current=t}var fe=A(null),M=A(null),pe=A(null),me=A(null);function he(e,t){switch(j(pe,t),j(M,e),j(fe,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Vd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Vd(t),e=Hd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}de(fe),j(fe,e)}function ge(){de(fe),de(M),de(pe)}function _e(e){e.memoizedState!==null&&j(me,e);var t=fe.current,n=Hd(t,e.type);t!==n&&(j(M,e),j(fe,n))}function ve(e){M.current===e&&(de(fe),de(M)),me.current===e&&(de(me),Qf._currentValue=ce)}var ye,be;function xe(e){if(ye===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);ye=t&&t[1]||``,be=-1<e.stack.indexOf(`
2
+ at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
3
+ `+ye+e+be}var Se=!1;function Ce(e,t){if(!e||Se)return``;Se=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,`props`,{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,`name`,{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
4
+ `),l=s.split(`
5
+ `);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
6
+ `+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{Se=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?xe(n):``}function we(e,t){switch(e.tag){case 26:case 27:case 5:return xe(e.type);case 16:return xe(`Lazy`);case 13:return e.child!==t&&t!==null?xe(`Suspense Fallback`):xe(`Suspense`);case 19:return xe(`SuspenseList`);case 0:case 15:return Ce(e.type,!1);case 11:return Ce(e.type.render,!1);case 1:return Ce(e.type,!0);case 31:return xe(`Activity`);default:return``}}function Te(e){try{var t=``,n=null;do t+=we(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
7
+ Error generating stack: `+e.message+`
8
+ `+e.stack}}var Ee=Object.prototype.hasOwnProperty,De=t.unstable_scheduleCallback,Oe=t.unstable_cancelCallback,ke=t.unstable_shouldYield,Ae=t.unstable_requestPaint,je=t.unstable_now,Me=t.unstable_getCurrentPriorityLevel,Ne=t.unstable_ImmediatePriority,Pe=t.unstable_UserBlockingPriority,Fe=t.unstable_NormalPriority,Ie=t.unstable_LowPriority,Le=t.unstable_IdlePriority,Re=t.log,ze=t.unstable_setDisableYieldValue,Be=null,Ve=null;function He(e){if(typeof Re==`function`&&ze(e),Ve&&typeof Ve.setStrictMode==`function`)try{Ve.setStrictMode(Be,e)}catch{}}var Ue=Math.clz32?Math.clz32:Ke,We=Math.log,Ge=Math.LN2;function Ke(e){return e>>>=0,e===0?32:31-(We(e)/Ge|0)|0}var qe=256,Je=262144,Ye=4194304;function Xe(e){var t=e&42;if(t!==0)return t;switch(e&-e){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 e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Ze(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=Xe(n))):i=Xe(o):i=Xe(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Xe(n))):i=Xe(o)):i=Xe(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function Qe(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function $e(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+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 t+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 et(){var e=Ye;return Ye<<=1,!(Ye&62914560)&&(Ye=4194304),e}function N(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function P(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function tt(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-Ue(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&nt(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function nt(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Ue(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function rt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Ue(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function it(e,t){var n=t&-t;return n=n&42?1:F(n),(n&(e.suspendedLanes|t))===0?n:0}function F(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function I(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function L(){var e=k.p;return e===0?(e=window.event,e===void 0?32:mp(e.type)):e}function at(e,t){var n=k.p;try{return k.p=e,t()}finally{k.p=n}}var R=Math.random().toString(36).slice(2),z=`__reactFiber$`+R,ot=`__reactProps$`+R,st=`__reactContainer$`+R,ct=`__reactEvents$`+R,lt=`__reactListeners$`+R,ut=`__reactHandles$`+R,dt=`__reactResources$`+R,ft=`__reactMarker$`+R;function pt(e){delete e[z],delete e[ot],delete e[ct],delete e[lt],delete e[ut]}function mt(e){var t=e[z];if(t)return t;for(var n=e.parentNode;n;){if(t=n[st]||n[z]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=df(e);e!==null;){if(n=e[z])return n;e=df(e)}return t}e=n,n=e.parentNode}return null}function ht(e){if(e=e[z]||e[st]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function gt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function _t(e){var t=e[dt];return t||=e[dt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function B(e){e[ft]=!0}var vt=new Set,yt={};function bt(e,t){xt(e,t),xt(e+`Capture`,t)}function xt(e,t){for(yt[e]=t,e=0;e<t.length;e++)vt.add(t[e])}var St=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]*$`),Ct={},wt={};function Tt(e){return Ee.call(wt,e)?!0:Ee.call(Ct,e)?!1:St.test(e)?wt[e]=!0:(Ct[e]=!0,!1)}function Et(e,t,n){if(Tt(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,``+n)}}function Dt(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,``+n)}}function Ot(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,``+r)}}function kt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function At(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function jt(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Mt(e){if(!e._valueTracker){var t=At(e)?`checked`:`value`;e._valueTracker=jt(e,t,``+e[t])}}function Nt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=At(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function Pt(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var Ft=/[\n"\\]/g;function It(e){return e.replace(Ft,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Lt(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+kt(t)):e.value!==``+kt(t)&&(e.value=``+kt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):zt(e,o,kt(n)):zt(e,o,kt(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+kt(s):e.removeAttribute(`name`)}function Rt(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){Mt(e);return}n=n==null?``:``+kt(n),t=t==null?n:``+kt(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),Mt(e)}function zt(e,t,n){t===`number`&&Pt(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Bt(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+kt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Vt(e,t,n){if(t!=null&&(t=``+kt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+kt(n)}function Ht(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(se(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=kt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Mt(e)}function Ut(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Wt=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 Gt(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||Wt.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function Kt(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&Gt(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&Gt(e,o,t[o])}function qt(e){if(e.indexOf(`-`)===-1)return!1;switch(e){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 Jt=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`]]),Yt=/^[\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 Xt(e){return Yt.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function Zt(){}var Qt=null;function $t(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var en=null,tn=null;function nn(e){var t=ht(e);if(t&&(e=t.stateNode)){var n=e[ot]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Lt(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+It(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[ot]||null;if(!a)throw Error(i(90));Lt(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&Nt(r)}break a;case`textarea`:Vt(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Bt(e,!!n.multiple,t,!1)}}}var rn=!1;function an(e,t,n){if(rn)return e(t,n);rn=!0;try{return e(t)}finally{if(rn=!1,(en!==null||tn!==null)&&(bu(),en&&(t=en,e=tn,tn=en=null,nn(t),e)))for(t=0;t<e.length;t++)nn(e[t])}}function on(e,t){var n=e.stateNode;if(n===null)return null;var r=n[ot]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=!(e===`button`||e===`input`||e===`select`||e===`textarea`)),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var sn=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),cn=!1;if(sn)try{var ln={};Object.defineProperty(ln,`passive`,{get:function(){cn=!0}}),window.addEventListener(`test`,ln,ln),window.removeEventListener(`test`,ln,ln)}catch{cn=!1}var un=null,dn=null,fn=null;function pn(){if(fn)return fn;var e,t=dn,n=t.length,r,i=`value`in un?un.value:un.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return fn=i.slice(e,1<r?1-r:void 0)}function mn(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function hn(){return!0}function gn(){return!1}function _n(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?hn:gn,this.isPropagationStopped=gn,this}return h(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=hn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=hn)},persist:function(){},isPersistent:hn}),t}var vn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},yn=_n(vn),bn=h({},vn,{view:0,detail:0}),xn=_n(bn),Sn,Cn,wn,Tn=h({},bn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:In,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==wn&&(wn&&e.type===`mousemove`?(Sn=e.screenX-wn.screenX,Cn=e.screenY-wn.screenY):Cn=Sn=0,wn=e),Sn)},movementY:function(e){return`movementY`in e?e.movementY:Cn}}),En=_n(Tn),Dn=_n(h({},Tn,{dataTransfer:0})),On=_n(h({},bn,{relatedTarget:0})),kn=_n(h({},vn,{animationName:0,elapsedTime:0,pseudoElement:0})),An=_n(h({},vn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),jn=_n(h({},vn,{data:0})),Mn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Nn={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`},Pn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Fn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Pn[e])?!!t[e]:!1}function In(){return Fn}var Ln=_n(h({},bn,{key:function(e){if(e.key){var t=Mn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=mn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Nn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:In,charCode:function(e){return e.type===`keypress`?mn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?mn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Rn=_n(h({},Tn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),zn=_n(h({},bn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:In})),Bn=_n(h({},vn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Vn=_n(h({},Tn,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),Hn=_n(h({},vn,{newState:0,oldState:0})),Un=[9,13,27,32],Wn=sn&&`CompositionEvent`in window,Gn=null;sn&&`documentMode`in document&&(Gn=document.documentMode);var Kn=sn&&`TextEvent`in window&&!Gn,qn=sn&&(!Wn||Gn&&8<Gn&&11>=Gn),Jn=` `,Yn=!1;function Xn(e,t){switch(e){case`keyup`:return Un.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function Zn(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Qn=!1;function $n(e,t){switch(e){case`compositionend`:return Zn(t);case`keypress`:return t.which===32?(Yn=!0,Jn):null;case`textInput`:return e=t.data,e===Jn&&Yn?null:e;default:return null}}function er(e,t){if(Qn)return e===`compositionend`||!Wn&&Xn(e,t)?(e=pn(),fn=dn=un=null,Qn=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return qn&&t.locale!==`ko`?null:t.data;default:return null}}var tr={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 nr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!tr[e.type]:t===`textarea`}function rr(e,t,n,r){en?tn?tn.push(r):tn=[r]:en=r,t=Ed(t,`onChange`),0<t.length&&(n=new yn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var ir=null,ar=null;function or(e){yd(e,0)}function sr(e){if(Nt(gt(e)))return e}function cr(e,t){if(e===`change`)return t}var lr=!1;if(sn){var ur;if(sn){var dr=`oninput`in document;if(!dr){var fr=document.createElement(`div`);fr.setAttribute(`oninput`,`return;`),dr=typeof fr.oninput==`function`}ur=dr}else ur=!1;lr=ur&&(!document.documentMode||9<document.documentMode)}function pr(){ir&&(ir.detachEvent(`onpropertychange`,mr),ar=ir=null)}function mr(e){if(e.propertyName===`value`&&sr(ar)){var t=[];rr(t,ar,e,$t(e)),an(or,t)}}function hr(e,t,n){e===`focusin`?(pr(),ir=t,ar=n,ir.attachEvent(`onpropertychange`,mr)):e===`focusout`&&pr()}function gr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return sr(ar)}function _r(e,t){if(e===`click`)return sr(t)}function vr(e,t){if(e===`input`||e===`change`)return sr(t)}function yr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var br=typeof Object.is==`function`?Object.is:yr;function xr(e,t){if(br(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!Ee.call(t,i)||!br(e[i],t[i]))return!1}return!0}function Sr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Cr(e,t){var n=Sr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Sr(n)}}function V(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?V(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function wr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Pt(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Pt(e.document)}return t}function Tr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var Er=sn&&`documentMode`in document&&11>=document.documentMode,Dr=null,Or=null,kr=null,Ar=!1;function jr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ar||Dr==null||Dr!==Pt(r)||(r=Dr,`selectionStart`in r&&Tr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),kr&&xr(kr,r)||(kr=r,r=Ed(Or,`onSelect`),0<r.length&&(t=new yn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Dr)))}function Mr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Nr={animationend:Mr(`Animation`,`AnimationEnd`),animationiteration:Mr(`Animation`,`AnimationIteration`),animationstart:Mr(`Animation`,`AnimationStart`),transitionrun:Mr(`Transition`,`TransitionRun`),transitionstart:Mr(`Transition`,`TransitionStart`),transitioncancel:Mr(`Transition`,`TransitionCancel`),transitionend:Mr(`Transition`,`TransitionEnd`)},Pr={},Fr={};sn&&(Fr=document.createElement(`div`).style,`AnimationEvent`in window||(delete Nr.animationend.animation,delete Nr.animationiteration.animation,delete Nr.animationstart.animation),`TransitionEvent`in window||delete Nr.transitionend.transition);function Ir(e){if(Pr[e])return Pr[e];if(!Nr[e])return e;var t=Nr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Fr)return Pr[e]=t[n];return e}var Lr=Ir(`animationend`),Rr=Ir(`animationiteration`),zr=Ir(`animationstart`),Br=Ir(`transitionrun`),Vr=Ir(`transitionstart`),Hr=Ir(`transitioncancel`),Ur=Ir(`transitionend`),Wr=new Map,Gr=`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(` `);Gr.push(`scrollEnd`);function Kr(e,t){Wr.set(e,t),bt(t,[e])}var qr=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},Jr=[],Yr=0,Xr=0;function Zr(){for(var e=Yr,t=Xr=Yr=0;t<e;){var n=Jr[t];Jr[t++]=null;var r=Jr[t];Jr[t++]=null;var i=Jr[t];Jr[t++]=null;var a=Jr[t];if(Jr[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&ti(n,i,a)}}function Qr(e,t,n,r){Jr[Yr++]=e,Jr[Yr++]=t,Jr[Yr++]=n,Jr[Yr++]=r,Xr|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function $r(e,t,n,r){return Qr(e,t,n,r),ni(e)}function ei(e,t){return Qr(e,null,null,t),ni(e)}function ti(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-Ue(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function ni(e){if(50<du)throw du=0,fu=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ri={};function ii(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ai(e,t,n,r){return new ii(e,t,n,r)}function oi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function si(e,t){var n=e.alternate;return n===null?(n=ai(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function ci(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function li(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)oi(e)&&(s=1);else if(typeof e==`string`)s=Uf(e,n,fe.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case te:return e=ai(31,n,t,a),e.elementType=te,e.lanes=o,e;case y:return ui(n.children,a,o,t);case b:s=8,a|=24;break;case x:return e=ai(12,n,t,a|2),e.elementType=x,e.lanes=o,e;case T:return e=ai(13,n,t,a),e.elementType=T,e.lanes=o,e;case ee:return e=ai(19,n,t,a),e.elementType=ee,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case C:s=10;break a;case S:s=9;break a;case w:s=11;break a;case E:s=14;break a;case D:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=ai(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function ui(e,t,n,r){return e=ai(7,e,r,t),e.lanes=n,e}function di(e,t,n){return e=ai(6,e,null,t),e.lanes=n,e}function fi(e){var t=ai(18,null,null,0);return t.stateNode=e,t}function pi(e,t,n){return t=ai(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var mi=new WeakMap;function hi(e,t){if(typeof e==`object`&&e){var n=mi.get(e);return n===void 0?(t={value:e,source:t,stack:Te(t)},mi.set(e,t),t):n}return{value:e,source:t,stack:Te(t)}}var gi=[],_i=0,vi=null,yi=0,bi=[],xi=0,Si=null,Ci=1,wi=``;function Ti(e,t){gi[_i++]=yi,gi[_i++]=vi,vi=e,yi=t}function Ei(e,t,n){bi[xi++]=Ci,bi[xi++]=wi,bi[xi++]=Si,Si=e;var r=Ci;e=wi;var i=32-Ue(r)-1;r&=~(1<<i),n+=1;var a=32-Ue(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Ci=1<<32-Ue(t)+i|n<<i|r,wi=a+e}else Ci=1<<a|n<<i|r,wi=e}function Di(e){e.return!==null&&(Ti(e,1),Ei(e,1,0))}function Oi(e){for(;e===vi;)vi=gi[--_i],gi[_i]=null,yi=gi[--_i],gi[_i]=null;for(;e===Si;)Si=bi[--xi],bi[xi]=null,wi=bi[--xi],bi[xi]=null,Ci=bi[--xi],bi[xi]=null}function ki(e,t){bi[xi++]=Ci,bi[xi++]=wi,bi[xi++]=Si,Ci=t.id,wi=t.overflow,Si=e}var Ai=null,H=null,U=!1,ji=null,Mi=!1,Ni=Error(i(519));function Pi(e){throw Bi(hi(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Ni}function Fi(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[z]=e,t[ot]=r,n){case`dialog`:Q(`cancel`,t),Q(`close`,t);break;case`iframe`:case`object`:case`embed`:Q(`load`,t);break;case`video`:case`audio`:for(n=0;n<_d.length;n++)Q(_d[n],t);break;case`source`:Q(`error`,t);break;case`img`:case`image`:case`link`:Q(`error`,t),Q(`load`,t);break;case`details`:Q(`toggle`,t);break;case`input`:Q(`invalid`,t),Rt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Q(`invalid`,t);break;case`textarea`:Q(`invalid`,t),Ht(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||Md(t.textContent,n)?(r.popover!=null&&(Q(`beforetoggle`,t),Q(`toggle`,t)),r.onScroll!=null&&Q(`scroll`,t),r.onScrollEnd!=null&&Q(`scrollend`,t),r.onClick!=null&&(t.onclick=Zt),t=!0):t=!1,t||Pi(e,!0)}function Ii(e){for(Ai=e.return;Ai;)switch(Ai.tag){case 5:case 31:case 13:Mi=!1;return;case 27:case 3:Mi=!0;return;default:Ai=Ai.return}}function Li(e){if(e!==Ai)return!1;if(!U)return Ii(e),U=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!==`form`&&n!==`button`)||Ud(e.type,e.memoizedProps)),n=!n),n&&H&&Pi(e),Ii(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));H=uf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));H=uf(e)}else t===27?(t=H,Zd(e.type)?(e=lf,lf=null,H=e):H=t):H=Ai?cf(e.stateNode.nextSibling):null;return!0}function Ri(){H=Ai=null,U=!1}function zi(){var e=ji;return e!==null&&(Zl===null?Zl=e:Zl.push.apply(Zl,e),ji=null),e}function Bi(e){ji===null?ji=[e]:ji.push(e)}var Vi=A(null),Hi=null,Ui=null;function Wi(e,t,n){j(Vi,t._currentValue),t._currentValue=n}function Gi(e){e._currentValue=Vi.current,de(Vi)}function Ki(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function qi(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),Ki(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),Ki(s,n,e),s=null}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function Ji(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;br(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===me.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[Qf]:e.push(Qf))}a=a.return}e!==null&&qi(t,e,n,r),t.flags|=262144}function Yi(e){for(e=e.firstContext;e!==null;){if(!br(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Xi(e){Hi=e,Ui=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Zi(e){return $i(Hi,e)}function Qi(e,t){return Hi===null&&Xi(e),$i(e,t)}function $i(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Ui===null){if(e===null)throw Error(i(308));Ui=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Ui=Ui.next=t;return n}var ea=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},ta=t.unstable_scheduleCallback,na=t.unstable_NormalPriority,ra={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ia(){return{controller:new ea,data:new Map,refCount:0}}function aa(e){e.refCount--,e.refCount===0&&ta(na,function(){e.controller.abort()})}var oa=null,sa=0,ca=0,la=null;function ua(e,t){if(oa===null){var n=oa=[];sa=0,ca=dd(),la={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return sa++,t.then(da,da),t}function da(){if(--sa===0&&oa!==null){la!==null&&(la.status=`fulfilled`);var e=oa;oa=null,ca=0,la=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function fa(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var pa=O.S;O.S=function(e,t){eu=je(),typeof t==`object`&&t&&typeof t.then==`function`&&ua(e,t),pa!==null&&pa(e,t)};var ma=A(null);function ha(){var e=ma.current;return e===null?q.pooledCache:e}function ga(e,t){t===null?j(ma,ma.current):j(ma,t.pool)}function _a(){var e=ha();return e===null?null:{parent:ra._currentValue,pool:e}}var va=Error(i(460)),ya=Error(i(474)),ba=Error(i(542)),xa={then:function(){}};function Sa(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Ca(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Zt,Zt),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Da(e),e;default:if(typeof t.status==`string`)t.then(Zt,Zt);else{if(e=q,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Da(e),e}throw Ta=t,va}}function wa(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Ta=e,va):e}}var Ta=null;function Ea(){if(Ta===null)throw Error(i(459));var e=Ta;return Ta=null,e}function Da(e){if(e===va||e===ba)throw Error(i(483))}var Oa=null,ka=0;function Aa(e){var t=ka;return ka+=1,Oa===null&&(Oa=[]),Ca(Oa,e,t)}function ja(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function Ma(e,t){throw t.$$typeof===g?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function Na(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=si(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=di(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===y?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===D&&wa(i)===t.type)?(t=a(t,n.props),ja(t,n),t.return=e,t):(t=li(n.type,n.key,n.props,null,e.mode,r),ja(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=pi(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=ui(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=di(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case _:return n=li(t.type,t.key,t.props,null,e.mode,n),ja(n,t),n.return=e,n;case v:return t=pi(t,e.mode,n),t.return=e,t;case D:return t=wa(t),f(e,t,n)}if(se(t)||ie(t))return t=ui(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Aa(t),n);if(t.$$typeof===C)return f(e,Qi(e,t),n);Ma(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case _:return n.key===i?l(e,t,n,r):null;case v:return n.key===i?u(e,t,n,r):null;case D:return n=wa(n),p(e,t,n,r)}if(se(n)||ie(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,Aa(n),r);if(n.$$typeof===C)return p(e,t,Qi(e,n),r);Ma(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case _:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case v:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case D:return r=wa(r),m(e,t,n,r,i)}if(se(r)||ie(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,Aa(r),i);if(r.$$typeof===C)return m(e,t,n,Qi(t,r),i);Ma(t,r)}return null}function h(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),U&&Ti(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return U&&Ti(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&g.alternate!==null&&d.delete(g.key===null?h:g.key),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),U&&Ti(i,h),l}function g(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),U&&Ti(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return U&&Ti(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),U&&Ti(a,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===y&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case _:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===y){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===D&&wa(l)===r.type){n(e,r.sibling),c=a(r,o.props),ja(c,o),c.return=e,e=c;break a}n(e,r);break}else t(e,r);r=r.sibling}o.type===y?(c=ui(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=li(o.type,o.key,o.props,null,e.mode,c),ja(c,o),c.return=e,e=c)}return s(e);case v:a:{for(l=o.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}else{n(e,r);break}else t(e,r);r=r.sibling}c=pi(o,e.mode,c),c.return=e,e=c}return s(e);case D:return o=wa(o),b(e,r,o,c)}if(se(o))return h(e,r,o,c);if(ie(o)){if(l=ie(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,Aa(o),c);if(o.$$typeof===C)return b(e,r,Qi(e,o),c);Ma(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=di(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{ka=0;var i=b(e,t,n,r);return Oa=null,i}catch(t){if(t===va||t===ba)throw t;var a=ai(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Pa=Na(!0),Fa=Na(!1),Ia=!1;function La(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ra(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function za(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ba(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,K&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=ni(e),ti(e,null,n),t}return Qr(e,r,t,n),ni(e)}function Va(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,rt(e,n)}}function Ha(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Ua=!1;function Wa(){if(Ua){var e=la;if(e!==null)throw e}}function Ga(e,t,n,r){Ua=!1;var i=e.updateQueue;Ia=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(Y&f)===f:(r&f)===f){f!==0&&f===ca&&(Ua=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(m=g.payload,typeof m==`function`){d=m.call(_,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=g.payload,f=typeof m==`function`?m.call(_,d,f):m,f==null)break a;d=h({},d,f);break a;case 2:Ia=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),Gl|=o,e.lanes=o,e.memoizedState=d}}function Ka(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function qa(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Ka(n[e],t)}var Ja=A(null),Ya=A(0);function Xa(e,t){e=Ul,j(Ya,e),j(Ja,t),Ul=e|t.baseLanes}function Za(){j(Ya,Ul),j(Ja,Ja.current)}function Qa(){Ul=Ya.current,de(Ja),de(Ya)}var $a=A(null),eo=null;function to(e){var t=e.alternate;j(oo,oo.current&1),j($a,e),eo===null&&(t===null||Ja.current!==null||t.memoizedState!==null)&&(eo=e)}function no(e){j(oo,oo.current),j($a,e),eo===null&&(eo=e)}function ro(e){e.tag===22?(j(oo,oo.current),j($a,e),eo===null&&(eo=e)):io(e)}function io(){j(oo,oo.current),j($a,$a.current)}function ao(e){de($a),eo===e&&(eo=null),de(oo)}var oo=A(0);function so(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||af(n)||of(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===`forwards`||t.memoizedProps.revealOrder===`backwards`||t.memoizedProps.revealOrder===`unstable_legacy-backwards`||t.memoizedProps.revealOrder===`together`)){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var co=0,W=null,G=null,lo=null,uo=!1,fo=!1,po=!1,mo=0,ho=0,go=null,_o=0;function vo(){throw Error(i(321))}function yo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!br(e[n],t[n]))return!1;return!0}function bo(e,t,n,r,i,a){return co=a,W=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,O.H=e===null||e.memoizedState===null?Ls:Rs,po=!1,a=n(r,i),po=!1,fo&&(a=So(t,n,r,i)),xo(e),a}function xo(e){O.H=Is;var t=G!==null&&G.next!==null;if(co=0,lo=G=W=null,uo=!1,ho=0,go=null,t)throw Error(i(300));e===null||tc||(e=e.dependencies,e!==null&&Yi(e)&&(tc=!0))}function So(e,t,n,r){W=e;var a=0;do{if(fo&&(go=null),ho=0,fo=!1,25<=a)throw Error(i(301));if(a+=1,lo=G=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}O.H=zs,o=t(n,r)}while(fo);return o}function Co(){var e=O.H,t=e.useState()[0];return t=typeof t.then==`function`?Ao(t):t,e=e.useState()[0],(G===null?null:G.memoizedState)!==e&&(W.flags|=1024),t}function wo(){var e=mo!==0;return mo=0,e}function To(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Eo(e){if(uo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}uo=!1}co=0,lo=G=W=null,fo=!1,ho=mo=0,go=null}function Do(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return lo===null?W.memoizedState=lo=e:lo=lo.next=e,lo}function Oo(){if(G===null){var e=W.alternate;e=e===null?null:e.memoizedState}else e=G.next;var t=lo===null?W.memoizedState:lo.next;if(t!==null)lo=t,G=e;else{if(e===null)throw W.alternate===null?Error(i(467)):Error(i(310));G=e,e={memoizedState:G.memoizedState,baseState:G.baseState,baseQueue:G.baseQueue,queue:G.queue,next:null},lo===null?W.memoizedState=lo=e:lo=lo.next=e}return lo}function ko(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ao(e){var t=ho;return ho+=1,go===null&&(go=[]),e=Ca(go,e,t),t=W,(lo===null?t.memoizedState:lo.next)===null&&(t=t.alternate,O.H=t===null||t.memoizedState===null?Ls:Rs),e}function jo(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return Ao(e);if(e.$$typeof===C)return Zi(e)}throw Error(i(438,String(e)))}function Mo(e){var t=null,n=W.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=W.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=ko(),W.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=ne;return t.index++,n}function No(e,t){return typeof t==`function`?t(e):t}function Po(e){return Fo(Oo(),G,e)}function Fo(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(co&f)===f:(Y&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===ca&&(d=!0);else if((co&p)===p){u=u.next,p===ca&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,W.lanes|=p,Gl|=p;f=u.action,po&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,W.lanes|=f,Gl|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!br(o,e.memoizedState)&&(tc=!0,d&&(n=la,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Io(e){var t=Oo(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);br(o,t.memoizedState)||(tc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Lo(e,t,n){var r=W,a=Oo(),o=U;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!br((G||a).memoizedState,n);if(s&&(a.memoizedState=n,tc=!0),a=a.queue,cs(Bo.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||lo!==null&&lo.memoizedState.tag&1){if(r.flags|=2048,rs(9,{destroy:void 0},zo.bind(null,r,a,n,t),null),q===null)throw Error(i(349));o||co&127||Ro(r,t,n)}return n}function Ro(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=W.updateQueue,t===null?(t=ko(),W.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function zo(e,t,n,r){t.value=n,t.getSnapshot=r,Vo(t)&&Ho(e)}function Bo(e,t,n){return n(function(){Vo(t)&&Ho(e)})}function Vo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!br(e,n)}catch{return!0}}function Ho(e){var t=ei(e,2);t!==null&&hu(t,e,2)}function Uo(e){var t=Do();if(typeof e==`function`){var n=e;if(e=n(),po){He(!0);try{n()}finally{He(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:No,lastRenderedState:e},t}function Wo(e,t,n,r){return e.baseState=n,Fo(e,G,typeof r==`function`?r:No)}function Go(e,t,n,r,a){if(Ns(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};O.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Ko(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Ko(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=O.T,o={};O.T=o;try{var s=n(i,r),c=O.S;c!==null&&c(o,s),qo(e,t,s)}catch(n){Yo(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),O.T=a}}else try{a=n(i,r),qo(e,t,a)}catch(n){Yo(e,t,n)}}function qo(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Jo(e,t,n)},function(n){return Yo(e,t,n)}):Jo(e,t,n)}function Jo(e,t,n){t.status=`fulfilled`,t.value=n,Xo(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Ko(e,n)))}function Yo(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Xo(t),t=t.next;while(t!==r)}e.action=null}function Xo(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Zo(e,t){return t}function Qo(e,t){if(U){var n=q.formState;if(n!==null){a:{var r=W;if(U){if(H){b:{for(var i=H,a=Mi;i.nodeType!==8;){if(!a){i=null;break b}if(i=cf(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){H=cf(i.nextSibling),r=i.data===`F!`;break a}}Pi(r)}r=!1}r&&(t=n[0])}}return n=Do(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Zo,lastRenderedState:t},n.queue=r,n=As.bind(null,W,r),r.dispatch=n,r=Uo(!1),a=Ms.bind(null,W,!1,r.queue),r=Do(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Go.bind(null,W,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function $o(e){return es(Oo(),G,e)}function es(e,t,n){if(t=Fo(e,t,Zo)[0],e=Po(No)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=Ao(t)}catch(e){throw e===va?ba:e}else r=t;t=Oo();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(W.flags|=2048,rs(9,{destroy:void 0},ts.bind(null,i,n),null)),[r,a,e]}function ts(e,t){e.action=t}function ns(e){var t=Oo(),n=G;if(n!==null)return es(t,n,e);Oo(),t=t.memoizedState,n=Oo();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function rs(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=W.updateQueue,t===null&&(t=ko(),W.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function is(){return Oo().memoizedState}function as(e,t,n,r){var i=Do();W.flags|=e,i.memoizedState=rs(1|t,{destroy:void 0},n,r===void 0?null:r)}function os(e,t,n,r){var i=Oo();r=r===void 0?null:r;var a=i.memoizedState.inst;G!==null&&r!==null&&yo(r,G.memoizedState.deps)?i.memoizedState=rs(t,a,n,r):(W.flags|=e,i.memoizedState=rs(1|t,a,n,r))}function ss(e,t){as(8390656,8,e,t)}function cs(e,t){os(2048,8,e,t)}function ls(e){W.flags|=4;var t=W.updateQueue;if(t===null)t=ko(),W.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function us(e){var t=Oo().memoizedState;return ls({ref:t,nextImpl:e}),function(){if(K&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function ds(e,t){return os(4,2,e,t)}function fs(e,t){return os(4,4,e,t)}function ps(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function ms(e,t,n){n=n==null?null:n.concat([e]),os(4,4,ps.bind(null,t,e),n)}function hs(){}function gs(e,t){var n=Oo();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&yo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function _s(e,t){var n=Oo();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&yo(t,r[1]))return r[0];if(r=e(),po){He(!0);try{e()}finally{He(!1)}}return n.memoizedState=[r,t],r}function vs(e,t,n){return n===void 0||co&1073741824&&!(Y&261930)?e.memoizedState=t:(e.memoizedState=n,e=mu(),W.lanes|=e,Gl|=e,n)}function ys(e,t,n,r){return br(n,t)?n:Ja.current===null?!(co&42)||co&1073741824&&!(Y&261930)?(tc=!0,e.memoizedState=n):(e=mu(),W.lanes|=e,Gl|=e,t):(e=vs(e,n,r),br(e,t)||(tc=!0),e)}function bs(e,t,n,r,i){var a=k.p;k.p=a!==0&&8>a?a:8;var o=O.T,s={};O.T=s,Ms(e,!1,t,n);try{var c=i(),l=O.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?js(e,t,fa(c,r),pu(e)):js(e,t,r,pu(e))}catch(n){js(e,t,{then:function(){},status:`rejected`,reason:n},pu())}finally{k.p=a,o!==null&&s.types!==null&&(o.types=s.types),O.T=o}}function xs(){}function Ss(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=Cs(e).queue;bs(e,a,t,ce,n===null?xs:function(){return ws(e),n(r)})}function Cs(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ce,baseState:ce,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:No,lastRenderedState:ce},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:No,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function ws(e){var t=Cs(e);t.next===null&&(t=e.alternate.memoizedState),js(e,t.next.queue,{},pu())}function Ts(){return Zi(Qf)}function Es(){return Oo().memoizedState}function Ds(){return Oo().memoizedState}function Os(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=pu();e=za(n);var r=Ba(t,e,n);r!==null&&(hu(r,t,n),Va(r,t,n)),t={cache:ia()},e.payload=t;return}t=t.return}}function ks(e,t,n){var r=pu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Ns(e)?Ps(t,n):(n=$r(e,t,n,r),n!==null&&(hu(n,e,r),Fs(n,t,r)))}function As(e,t,n){js(e,t,n,pu())}function js(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ns(e))Ps(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,br(s,o))return Qr(e,t,i,0),q===null&&Zr(),!1}catch{}if(n=$r(e,t,i,r),n!==null)return hu(n,e,r),Fs(n,t,r),!0}return!1}function Ms(e,t,n,r){if(r={lane:2,revertLane:dd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Ns(e)){if(t)throw Error(i(479))}else t=$r(e,n,r,2),t!==null&&hu(t,e,2)}function Ns(e){var t=e.alternate;return e===W||t!==null&&t===W}function Ps(e,t){fo=uo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Fs(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,rt(e,n)}}var Is={readContext:Zi,use:jo,useCallback:vo,useContext:vo,useEffect:vo,useImperativeHandle:vo,useLayoutEffect:vo,useInsertionEffect:vo,useMemo:vo,useReducer:vo,useRef:vo,useState:vo,useDebugValue:vo,useDeferredValue:vo,useTransition:vo,useSyncExternalStore:vo,useId:vo,useHostTransitionStatus:vo,useFormState:vo,useActionState:vo,useOptimistic:vo,useMemoCache:vo,useCacheRefresh:vo};Is.useEffectEvent=vo;var Ls={readContext:Zi,use:jo,useCallback:function(e,t){return Do().memoizedState=[e,t===void 0?null:t],e},useContext:Zi,useEffect:ss,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),as(4194308,4,ps.bind(null,t,e),n)},useLayoutEffect:function(e,t){return as(4194308,4,e,t)},useInsertionEffect:function(e,t){as(4,2,e,t)},useMemo:function(e,t){var n=Do();t=t===void 0?null:t;var r=e();if(po){He(!0);try{e()}finally{He(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Do();if(n!==void 0){var i=n(t);if(po){He(!0);try{n(t)}finally{He(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=ks.bind(null,W,e),[r.memoizedState,e]},useRef:function(e){var t=Do();return e={current:e},t.memoizedState=e},useState:function(e){e=Uo(e);var t=e.queue,n=As.bind(null,W,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:hs,useDeferredValue:function(e,t){return vs(Do(),e,t)},useTransition:function(){var e=Uo(!1);return e=bs.bind(null,W,e.queue,!0,!1),Do().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=W,a=Do();if(U){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),q===null)throw Error(i(349));Y&127||Ro(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,ss(Bo.bind(null,r,o,e),[e]),r.flags|=2048,rs(9,{destroy:void 0},zo.bind(null,r,o,n,t),null),n},useId:function(){var e=Do(),t=q.identifierPrefix;if(U){var n=wi,r=Ci;n=(r&~(1<<32-Ue(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=mo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=_o++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:Ts,useFormState:Qo,useActionState:Qo,useOptimistic:function(e){var t=Do();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Ms.bind(null,W,!0,n),n.dispatch=t,[e,t]},useMemoCache:Mo,useCacheRefresh:function(){return Do().memoizedState=Os.bind(null,W)},useEffectEvent:function(e){var t=Do(),n={impl:e};return t.memoizedState=n,function(){if(K&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Rs={readContext:Zi,use:jo,useCallback:gs,useContext:Zi,useEffect:cs,useImperativeHandle:ms,useInsertionEffect:ds,useLayoutEffect:fs,useMemo:_s,useReducer:Po,useRef:is,useState:function(){return Po(No)},useDebugValue:hs,useDeferredValue:function(e,t){return ys(Oo(),G.memoizedState,e,t)},useTransition:function(){var e=Po(No)[0],t=Oo().memoizedState;return[typeof e==`boolean`?e:Ao(e),t]},useSyncExternalStore:Lo,useId:Es,useHostTransitionStatus:Ts,useFormState:$o,useActionState:$o,useOptimistic:function(e,t){return Wo(Oo(),G,e,t)},useMemoCache:Mo,useCacheRefresh:Ds};Rs.useEffectEvent=us;var zs={readContext:Zi,use:jo,useCallback:gs,useContext:Zi,useEffect:cs,useImperativeHandle:ms,useInsertionEffect:ds,useLayoutEffect:fs,useMemo:_s,useReducer:Io,useRef:is,useState:function(){return Io(No)},useDebugValue:hs,useDeferredValue:function(e,t){var n=Oo();return G===null?vs(n,e,t):ys(n,G.memoizedState,e,t)},useTransition:function(){var e=Io(No)[0],t=Oo().memoizedState;return[typeof e==`boolean`?e:Ao(e),t]},useSyncExternalStore:Lo,useId:Es,useHostTransitionStatus:Ts,useFormState:ns,useActionState:ns,useOptimistic:function(e,t){var n=Oo();return G===null?(n.baseState=e,[e,n.queue.dispatch]):Wo(n,G,e,t)},useMemoCache:Mo,useCacheRefresh:Ds};zs.useEffectEvent=us;function Bs(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:h({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Vs={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=pu(),i=za(r);i.payload=t,n!=null&&(i.callback=n),t=Ba(e,i,r),t!==null&&(hu(t,e,r),Va(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=pu(),i=za(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Ba(e,i,r),t!==null&&(hu(t,e,r),Va(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=pu(),r=za(n);r.tag=2,t!=null&&(r.callback=t),t=Ba(e,r,n),t!==null&&(hu(t,e,n),Va(t,e,n))}};function Hs(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!xr(n,r)||!xr(i,a):!0}function Us(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Vs.enqueueReplaceState(t,t.state,null)}function Ws(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=h({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Gs(e){qr(e)}function Ks(e){console.error(e)}function qs(e){qr(e)}function Js(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Ys(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function Xs(e,t,n){return n=za(n),n.tag=3,n.payload={element:null},n.callback=function(){Js(e,t)},n}function Zs(e){return e=za(e),e.tag=3,e}function Qs(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){Ys(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Ys(t,n,r),typeof i!=`function`&&(ru===null?ru=new Set([this]):ru.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function $s(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Ji(t,n,a,!0),n=$a.current,n!==null){switch(n.tag){case 31:case 13:return eo===null?Du():n.alternate===null&&Wl===0&&(Wl=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===xa?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Gu(e,r,a)),!1;case 22:return n.flags|=65536,r===xa?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),Gu(e,r,a)),!1}throw Error(i(435,n.tag))}return Gu(e,r,a),Du(),!1}if(U)return t=$a.current,t===null?(r!==Ni&&(t=Error(i(423),{cause:r}),Bi(hi(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=hi(r,n),a=Xs(e.stateNode,r,a),Ha(e,a),Wl!==4&&(Wl=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==Ni&&(e=Error(i(422),{cause:r}),Bi(hi(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=hi(o,n),Xl===null?Xl=[o]:Xl.push(o),Wl!==4&&(Wl=2),t===null)return!0;r=hi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Xs(n.stateNode,r,e),Ha(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(ru===null||!ru.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Zs(a),Qs(a,e,n,r),Ha(n,a),!1}n=n.return}while(n!==null);return!1}var ec=Error(i(461)),tc=!1;function nc(e,t,n,r){t.child=e===null?Fa(t,null,n,r):Pa(t,e.child,n,r)}function rc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return Xi(t),r=bo(e,t,n,o,a,i),s=wo(),e!==null&&!tc?(To(e,t,i),Dc(e,t,i)):(U&&s&&Di(t),t.flags|=1,nc(e,t,r,i),t.child)}function ic(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!oi(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,ac(e,t,a,r,i)):(e=li(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Oc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?xr:n,n(o,r)&&e.ref===t.ref)return Dc(e,t,i)}return t.flags|=1,e=si(a,r),e.ref=t.ref,e.return=t,t.child=e}function ac(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(xr(a,r)&&e.ref===t.ref)if(tc=!1,t.pendingProps=r=a,Oc(e,i))e.flags&131072&&(tc=!0);else return t.lanes=e.lanes,Dc(e,t,i)}return pc(e,t,n,r,i)}function oc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return cc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ga(t,a===null?null:a.cachePool),a===null?Za():Xa(t,a),ro(t);else return r=t.lanes=536870912,cc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&ga(t,null),Za(),io(t)):(ga(t,a.cachePool),Xa(t,a),io(t),t.memoizedState=null);return nc(e,t,i,n),t.child}function sc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function cc(e,t,n,r,i){var a=ha();return a=a===null?null:{parent:ra._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&ga(t,null),Za(),ro(t),e!==null&&Ji(e,t,r,!0),t.childLanes=i,null}function lc(e,t){return t=Sc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function uc(e,t,n){return Pa(t,e.child,null,n),e=lc(t,t.pendingProps),e.flags|=2,ao(t),t.memoizedState=null,e}function dc(e,t,n){var r=t.pendingProps,a=(t.flags&128)!=0;if(t.flags&=-129,e===null){if(U){if(r.mode===`hidden`)return e=lc(t,r),t.lanes=536870912,sc(null,e);if(no(t),(e=H)?(e=rf(e,Mi),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Si===null?null:{id:Ci,overflow:wi},retryLane:536870912,hydrationErrors:null},n=fi(e),n.return=t,t.child=n,Ai=t,H=null)):e=null,e===null)throw Pi(t);return t.lanes=536870912,null}return lc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(no(t),a)if(t.flags&256)t.flags&=-257,t=uc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if(tc||Ji(e,t,n,!1),a=(n&e.childLanes)!==0,tc||a){if(r=q,r!==null&&(s=it(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,ei(e,s),hu(r,e,s),ec;Du(),t=uc(e,t,n)}else e=o.treeContext,H=cf(s.nextSibling),Ai=t,U=!0,ji=null,Mi=!1,e!==null&&ki(t,e),t=lc(t,r),t.flags|=4096;return t}return e=si(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function fc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function pc(e,t,n,r,i){return Xi(t),n=bo(e,t,n,r,void 0,i),r=wo(),e!==null&&!tc?(To(e,t,i),Dc(e,t,i)):(U&&r&&Di(t),t.flags|=1,nc(e,t,n,i),t.child)}function mc(e,t,n,r,i,a){return Xi(t),t.updateQueue=null,n=So(t,r,n,i),xo(e),r=wo(),e!==null&&!tc?(To(e,t,a),Dc(e,t,a)):(U&&r&&Di(t),t.flags|=1,nc(e,t,n,a),t.child)}function hc(e,t,n,r,i){if(Xi(t),t.stateNode===null){var a=ri,o=n.contextType;typeof o==`object`&&o&&(a=Zi(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Vs,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},La(t),o=n.contextType,a.context=typeof o==`object`&&o?Zi(o):ri,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Bs(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&Vs.enqueueReplaceState(a,a.state,null),Ga(t,r,a,i),Wa(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=Ws(n,s);a.props=c;var l=a.context,u=n.contextType;o=ri,typeof u==`object`&&u&&(o=Zi(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&Us(t,a,r,o),Ia=!1;var f=t.memoizedState;a.state=f,Ga(t,r,a,i),Wa(),l=t.memoizedState,s||f!==l||Ia?(typeof d==`function`&&(Bs(t,n,d,r),l=t.memoizedState),(c=Ia||Hs(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Ra(e,t),o=t.memoizedProps,u=Ws(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=ri,typeof l==`object`&&l&&(c=Zi(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&Us(t,a,r,c),Ia=!1,f=t.memoizedState,a.state=f,Ga(t,r,a,i),Wa();var p=t.memoizedState;o!==d||f!==p||Ia||e!==null&&e.dependencies!==null&&Yi(e.dependencies)?(typeof s==`function`&&(Bs(t,n,s,r),p=t.memoizedState),(u=Ia||Hs(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Yi(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,fc(e,t),r=(t.flags&128)!=0,a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=Pa(t,e.child,null,i),t.child=Pa(t,null,n,i)):nc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Dc(e,t,i),e}function gc(e,t,n,r){return Ri(),t.flags|=256,nc(e,t,n,r),t.child}var _c={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function vc(e){return{baseLanes:e,cachePool:_a()}}function yc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=Jl),e}function bc(e,t,n){var r=t.pendingProps,a=!1,o=(t.flags&128)!=0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(oo.current&2)!=0),s&&(a=!0,t.flags&=-129),s=(t.flags&32)!=0,t.flags&=-33,e===null){if(U){if(a?to(t):io(t),(e=H)?(e=rf(e,Mi),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Si===null?null:{id:Ci,overflow:wi},retryLane:536870912,hydrationErrors:null},n=fi(e),n.return=t,t.child=n,Ai=t,H=null)):e=null,e===null)throw Pi(t);return of(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(io(t),a=t.mode,c=Sc({mode:`hidden`,children:c},a),r=ui(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=vc(n),r.childLanes=yc(e,s,n),t.memoizedState=_c,sc(null,r)):(to(t),xc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(to(t),t.flags&=-257,t=Cc(e,t,n)):t.memoizedState===null?(io(t),c=r.fallback,a=t.mode,r=Sc({mode:`visible`,children:r.children},a),c=ui(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,Pa(t,e.child,null,n),r=t.child,r.memoizedState=vc(n),r.childLanes=yc(e,s,n),t.memoizedState=_c,t=sc(null,r)):(io(t),t.child=e.child,t.flags|=128,t=null);else if(to(t),of(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,Bi({value:r,source:null,stack:null}),t=Cc(e,t,n)}else if(tc||Ji(e,t,n,!1),s=(n&e.childLanes)!==0,tc||s){if(s=q,s!==null&&(r=it(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,ei(e,r),hu(s,e,r),ec;af(c)||Du(),t=Cc(e,t,n)}else af(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,H=cf(c.nextSibling),Ai=t,U=!0,ji=null,Mi=!1,e!==null&&ki(t,e),t=xc(t,r.children),t.flags|=4096);return t}return a?(io(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=si(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=ui(c,a,n,null),c.flags|=2):c=si(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,sc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=vc(n):(a=c.cachePool,a===null?a=_a():(l=ra._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=yc(e,s,n),t.memoizedState=_c,sc(e.child,r)):(to(t),n=e.child,e=n.sibling,n=si(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function xc(e,t){return t=Sc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function Sc(e,t){return e=ai(22,e,null,t),e.lanes=0,e}function Cc(e,t,n){return Pa(t,e.child,null,n),e=xc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function wc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Ki(e.return,t,n)}function Tc(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function Ec(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=oo.current,s=(o&2)!=0;if(s?(o=o&1|2,t.flags|=128):o&=1,j(oo,o),nc(e,t,r,n),r=U?yi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&wc(e,n,t);else if(e.tag===19)wc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&so(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Tc(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&so(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Tc(t,!0,n,null,a,r);break;case`together`:Tc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Dc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Gl|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Ji(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=si(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=si(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Oc(e,t){return(e.lanes&t)===0?(e=e.dependencies,!!(e!==null&&Yi(e))):!0}function kc(e,t,n){switch(t.tag){case 3:he(t,t.stateNode.containerInfo),Wi(t,ra,e.memoizedState.cache),Ri();break;case 27:case 5:_e(t);break;case 4:he(t,t.stateNode.containerInfo);break;case 10:Wi(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,no(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(to(t),e=Dc(e,t,n),e===null?null:e.sibling):bc(e,t,n):(to(t),t.flags|=128,null);to(t);break;case 19:var i=(e.flags&128)!=0;if(r=(n&t.childLanes)!==0,r||=(Ji(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return Ec(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),j(oo,oo.current),r)break;return null;case 22:return t.lanes=0,oc(e,t,n,t.pendingProps);case 24:Wi(t,ra,e.memoizedState.cache)}return Dc(e,t,n)}function Ac(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)tc=!0;else{if(!Oc(e,n)&&!(t.flags&128))return tc=!1,kc(e,t,n);tc=!!(e.flags&131072)}else tc=!1,U&&t.flags&1048576&&Ei(t,yi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=wa(t.elementType),t.type=e,typeof e==`function`)oi(e)?(r=Ws(e,r),t.tag=1,t=hc(null,t,e,r,n)):(t.tag=0,t=pc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===w){t.tag=11,t=rc(null,t,e,r,n);break a}else if(a===E){t.tag=14,t=ic(null,t,e,r,n);break a}}throw t=oe(e)||e,Error(i(306,t,``))}}return t;case 0:return pc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Ws(r,t.pendingProps),hc(e,t,r,a,n);case 3:a:{if(he(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,Ra(e,t),Ga(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Wi(t,ra,r),r!==o.cache&&qi(t,[ra],n,!0),Wa(),r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=gc(e,t,r,n);break a}else if(r!==a){a=hi(Error(i(424)),t),Bi(a),t=gc(e,t,r,n);break a}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(H=cf(e.firstChild),Ai=t,U=!0,ji=null,Mi=!0,n=Fa(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Ri(),r===a){t=Dc(e,t,n);break a}nc(e,t,r,n)}t=t.child}return t;case 26:return fc(e,t),e===null?(n=kf(t.type,null,t.pendingProps,null))?t.memoizedState=n:U||(n=t.type,e=t.pendingProps,r=Bd(pe.current).createElement(n),r[z]=t,r[ot]=e,Pd(r,n,e),B(r),t.stateNode=r):t.memoizedState=kf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return _e(t),e===null&&U&&(r=t.stateNode=ff(t.type,t.pendingProps,pe.current),Ai=t,Mi=!0,a=H,Zd(t.type)?(lf=a,H=cf(r.firstChild)):H=a),nc(e,t,t.pendingProps.children,n),fc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&U&&((a=r=H)&&(r=tf(r,t.type,t.pendingProps,Mi),r===null?a=!1:(t.stateNode=r,Ai=t,H=cf(r.firstChild),Mi=!1,a=!0)),a||Pi(t)),_e(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,Ud(a,o)?r=null:s!==null&&Ud(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=bo(e,t,Co,null,null,n),Qf._currentValue=a),fc(e,t),nc(e,t,r,n),t.child;case 6:return e===null&&U&&((e=n=H)&&(n=nf(n,t.pendingProps,Mi),n===null?e=!1:(t.stateNode=n,Ai=t,H=null,e=!0)),e||Pi(t)),null;case 13:return bc(e,t,n);case 4:return he(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Pa(t,null,r,n):nc(e,t,r,n),t.child;case 11:return rc(e,t,t.type,t.pendingProps,n);case 7:return nc(e,t,t.pendingProps,n),t.child;case 8:return nc(e,t,t.pendingProps.children,n),t.child;case 12:return nc(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Wi(t,t.type,r.value),nc(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,Xi(t),a=Zi(a),r=r(a),t.flags|=1,nc(e,t,r,n),t.child;case 14:return ic(e,t,t.type,t.pendingProps,n);case 15:return ac(e,t,t.type,t.pendingProps,n);case 19:return Ec(e,t,n);case 31:return dc(e,t,n);case 22:return oc(e,t,n,t.pendingProps);case 24:return Xi(t),r=Zi(ra),e===null?(a=ha(),a===null&&(a=q,o=ia(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},La(t),Wi(t,ra,a)):((e.lanes&n)!==0&&(Ra(e,t),Ga(t,null,null,n),Wa()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Wi(t,ra,r),r!==a.cache&&qi(t,[ra],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Wi(t,ra,r))),nc(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function jc(e){e.flags|=4}function Mc(e,t,n,r,i){if((t=(e.mode&32)!=0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(wu())e.flags|=8192;else throw Ta=xa,ya}else e.flags&=-16777217}function Nc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Wf(t))if(wu())e.flags|=8192;else throw Ta=xa,ya}function Pc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:et(),e.lanes|=t,Yl|=t)}function Fc(e,t){if(!U)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Ic(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Lc(e,t,n){var r=t.pendingProps;switch(Oi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ic(t),null;case 1:return Ic(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Gi(ra),ge(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Li(t)?jc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,zi())),Ic(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(jc(t),o===null?(Ic(t),Mc(t,a,null,r,n)):(Ic(t),Nc(t,o))):o?o===e.memoizedState?(Ic(t),t.flags&=-16777217):(jc(t),Ic(t),Nc(t,o)):(e=e.memoizedProps,e!==r&&jc(t),Ic(t),Mc(t,a,e,r,n)),null;case 27:if(ve(t),n=pe.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&jc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Ic(t),null}e=fe.current,Li(t)?Fi(t,e):(e=ff(a,r,n),t.stateNode=e,jc(t))}return Ic(t),null;case 5:if(ve(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&jc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Ic(t),null}if(o=fe.current,Li(t))Fi(t,o);else{var s=Bd(pe.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[z]=t,o[ot]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(Pd(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&jc(t)}}return Ic(t),Mc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&jc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=pe.current,Li(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Ai,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[z]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Md(e.nodeValue,n)),e||Pi(t,!0)}else e=Bd(e).createTextNode(r),e[z]=t,t.stateNode=e}return Ic(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Li(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[z]=t}else Ri(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ic(t),e=!1}else n=zi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(ao(t),t):(ao(t),null);if(t.flags&128)throw Error(i(558))}return Ic(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Li(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[z]=t}else Ri(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ic(t),a=!1}else a=zi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(ao(t),t):(ao(t),null)}return ao(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Pc(t,t.updateQueue),Ic(t),null);case 4:return ge(),e===null&&Sd(t.stateNode.containerInfo),Ic(t),null;case 10:return Gi(t.type),Ic(t),null;case 19:if(de(oo),r=t.memoizedState,r===null)return Ic(t),null;if(a=(t.flags&128)!=0,o=r.rendering,o===null)if(a)Fc(r,!1);else{if(Wl!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=so(e),o!==null){for(t.flags|=128,Fc(r,!1),e=o.updateQueue,t.updateQueue=e,Pc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)ci(n,e),n=n.sibling;return j(oo,oo.current&1|2),U&&Ti(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&je()>tu&&(t.flags|=128,a=!0,Fc(r,!1),t.lanes=4194304)}else{if(!a)if(e=so(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Pc(t,e),Fc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!U)return Ic(t),null}else 2*je()-r.renderingStartTime>tu&&n!==536870912&&(t.flags|=128,a=!0,Fc(r,!1),t.lanes=4194304);r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(Ic(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=je(),e.sibling=null,n=oo.current,j(oo,a?n&1|2:n&1),U&&Ti(t,r.treeForkCount),e);case 22:case 23:return ao(t),Qa(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Ic(t),t.subtreeFlags&6&&(t.flags|=8192)):Ic(t),n=t.updateQueue,n!==null&&Pc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&de(ma),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Gi(ra),Ic(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Rc(e,t){switch(Oi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Gi(ra),ge(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ve(t),null;case 31:if(t.memoizedState!==null){if(ao(t),t.alternate===null)throw Error(i(340));Ri()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(ao(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Ri()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return de(oo),null;case 4:return ge(),null;case 10:return Gi(t.type),null;case 22:case 23:return ao(t),Qa(),e!==null&&de(ma),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Gi(ra),null;case 25:return null;default:return null}}function zc(e,t){switch(Oi(t),t.tag){case 3:Gi(ra),ge();break;case 26:case 27:case 5:ve(t);break;case 4:ge();break;case 31:t.memoizedState!==null&&ao(t);break;case 13:ao(t);break;case 19:de(oo);break;case 10:Gi(t.type);break;case 22:case 23:ao(t),Qa(),e!==null&&de(ma);break;case 24:Gi(ra)}}function Bc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Z(t,t.return,e)}}function Vc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Z(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Z(t,t.return,e)}}function Hc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{qa(t,n)}catch(t){Z(e,e.return,t)}}}function Uc(e,t,n){n.props=Ws(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Z(e,t,n)}}function Wc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Z(e,t,n)}}function Gc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){Z(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Z(e,t,n)}else n.current=null}function Kc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Z(e,e.return,t)}}function qc(e,t,n){try{var r=e.stateNode;Fd(r,e.type,n,t),r[ot]=t}catch(t){Z(e,e.return,t)}}function Jc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Zd(e.type)||e.tag===4}function Yc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Jc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Zd(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Xc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Zt));else if(r!==4&&(r===27&&Zd(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Xc(e,t,n),e=e.sibling;e!==null;)Xc(e,t,n),e=e.sibling}function Zc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&Zd(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Zc(e,t,n),e=e.sibling;e!==null;)Zc(e,t,n),e=e.sibling}function Qc(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Pd(t,r,n),t[z]=e,t[ot]=n}catch(t){Z(e,e.return,t)}}var $c=!1,el=!1,tl=!1,nl=typeof WeakSet==`function`?WeakSet:Set,rl=null;function il(e,t){if(e=e.containerInfo,Rd=sp,e=wr(e),Tr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(zd={focusedElem:e,selectionRange:n},sp=!1,rl=t;rl!==null;)if(t=rl,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,rl=e;else for(;rl!==null;){switch(t=rl,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)a=e[n],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,a=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=Ws(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){Z(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)ef(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:ef(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,rl=e;break}rl=t.return}}function al(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:bl(e,n),r&4&&Bc(5,n);break;case 1:if(bl(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Z(n,n.return,e)}else{var i=Ws(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Z(n,n.return,e)}}r&64&&Hc(n),r&512&&Wc(n,n.return);break;case 3:if(bl(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{qa(e,t)}catch(e){Z(n,n.return,e)}}break;case 27:t===null&&r&4&&Qc(n);case 26:case 5:bl(e,n),t===null&&r&4&&Kc(n),r&512&&Wc(n,n.return);break;case 12:bl(e,n);break;case 31:bl(e,n),r&4&&dl(e,n);break;case 13:bl(e,n),r&4&&fl(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Ju.bind(null,n),sf(e,n))));break;case 22:if(r=n.memoizedState!==null||$c,!r){t=t!==null&&t.memoizedState!==null||el,i=$c;var a=el;$c=r,(el=t)&&!a?Sl(e,n,(n.subtreeFlags&8772)!=0):bl(e,n),$c=i,el=a}break;case 30:break;default:bl(e,n)}}function ol(e){var t=e.alternate;t!==null&&(e.alternate=null,ol(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&pt(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var sl=null,cl=!1;function ll(e,t,n){for(n=n.child;n!==null;)ul(e,t,n),n=n.sibling}function ul(e,t,n){if(Ve&&typeof Ve.onCommitFiberUnmount==`function`)try{Ve.onCommitFiberUnmount(Be,n)}catch{}switch(n.tag){case 26:el||Gc(n,t),ll(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:el||Gc(n,t);var r=sl,i=cl;Zd(n.type)&&(sl=n.stateNode,cl=!1),ll(e,t,n),pf(n.stateNode),sl=r,cl=i;break;case 5:el||Gc(n,t);case 6:if(r=sl,i=cl,sl=null,ll(e,t,n),sl=r,cl=i,sl!==null)if(cl)try{(sl.nodeType===9?sl.body:sl.nodeName===`HTML`?sl.ownerDocument.body:sl).removeChild(n.stateNode)}catch(e){Z(n,t,e)}else try{sl.removeChild(n.stateNode)}catch(e){Z(n,t,e)}break;case 18:sl!==null&&(cl?(e=sl,Qd(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Np(e)):Qd(sl,n.stateNode));break;case 4:r=sl,i=cl,sl=n.stateNode.containerInfo,cl=!0,ll(e,t,n),sl=r,cl=i;break;case 0:case 11:case 14:case 15:Vc(2,n,t),el||Vc(4,n,t),ll(e,t,n);break;case 1:el||(Gc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Uc(n,t,r)),ll(e,t,n);break;case 21:ll(e,t,n);break;case 22:el=(r=el)||n.memoizedState!==null,ll(e,t,n),el=r;break;default:ll(e,t,n)}}function dl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Np(e)}catch(e){Z(t,t.return,e)}}}function fl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Np(e)}catch(e){Z(t,t.return,e)}}function pl(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new nl),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new nl),t;default:throw Error(i(435,e.tag))}}function ml(e,t){var n=pl(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Yu.bind(null,e,t);t.then(r,r)}})}function hl(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(Zd(c.type)){sl=c.stateNode,cl=!1;break a}break;case 5:sl=c.stateNode,cl=!1;break a;case 3:case 4:sl=c.stateNode.containerInfo,cl=!0;break a}c=c.return}if(sl===null)throw Error(i(160));ul(o,s,a),sl=null,cl=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)_l(t,e),t=t.sibling}var gl=null;function _l(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:hl(t,e),vl(e),r&4&&(Vc(3,e,e.return),Bc(3,e),Vc(5,e,e.return));break;case 1:hl(t,e),vl(e),r&512&&(el||n===null||Gc(n,n.return)),r&64&&$c&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var a=gl;if(hl(t,e),vl(e),r&512&&(el||n===null||Gc(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null)if(r===null)if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,a=a.ownerDocument||a;b:switch(r){case`title`:o=a.getElementsByTagName(`title`)[0],(!o||o[ft]||o[z]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head > title`))),Pd(o,r,n),o[z]=e,B(o),r=o;break a;case`link`:var s=Vf(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&o.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&o.getAttribute(`title`)===(n.title==null?null:n.title)&&o.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=a.createElement(r),Pd(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=Vf(`meta`,`content`,a).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`content`)===(n.content==null?null:``+n.content)&&o.getAttribute(`name`)===(n.name==null?null:n.name)&&o.getAttribute(`property`)===(n.property==null?null:n.property)&&o.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=a.createElement(r),Pd(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[z]=e,B(o),r=o}e.stateNode=r}else Hf(a,e.type,e.stateNode);else e.stateNode=If(a,r,e.memoizedProps);else o===r?r===null&&e.stateNode!==null&&qc(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?Hf(a,e.type,e.stateNode):If(a,r,e.memoizedProps))}break;case 27:hl(t,e),vl(e),r&512&&(el||n===null||Gc(n,n.return)),n!==null&&r&4&&qc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(hl(t,e),vl(e),r&512&&(el||n===null||Gc(n,n.return)),e.flags&32){a=e.stateNode;try{Ut(a,``)}catch(t){Z(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,qc(e,a,n===null?a:n.memoizedProps)),r&1024&&(tl=!0);break;case 6:if(hl(t,e),vl(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){Z(e,e.return,t)}}break;case 3:if(Bf=null,a=gl,gl=gf(t.containerInfo),hl(t,e),gl=a,vl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Np(t.containerInfo)}catch(t){Z(e,e.return,t)}tl&&(tl=!1,yl(e));break;case 4:r=gl,gl=gf(e.stateNode.containerInfo),hl(t,e),vl(e),gl=r;break;case 12:hl(t,e),vl(e);break;case 31:hl(t,e),vl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ml(e,r)));break;case 13:hl(t,e),vl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&($l=je()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ml(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=$c,d=el;if($c=u||a,el=d||l,hl(t,e),el=d,$c=u,vl(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||$c||el||xl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,a)s=o.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){Z(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){Z(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?$d(m,!0):$d(l.stateNode,!1)}catch(e){Z(l,l.return,e)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,ml(e,n))));break;case 19:hl(t,e),vl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ml(e,r)));break;case 30:break;case 21:break;default:hl(t,e),vl(e)}}function vl(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Jc(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;Zc(e,Yc(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(Ut(o,``),n.flags&=-33),Zc(e,Yc(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;Xc(e,Yc(e),s);break;default:throw Error(i(161))}}catch(t){Z(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function yl(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;yl(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function bl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)al(e,t.alternate,t),t=t.sibling}function xl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Vc(4,t,t.return),xl(t);break;case 1:Gc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Uc(t,t.return,n),xl(t);break;case 27:pf(t.stateNode);case 26:case 5:Gc(t,t.return),xl(t);break;case 22:t.memoizedState===null&&xl(t);break;case 30:xl(t);break;default:xl(t)}e=e.sibling}}function Sl(e,t,n){for(n&&=(t.subtreeFlags&8772)!=0,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:Sl(i,a,n),Bc(4,a);break;case 1:if(Sl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Z(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)Ka(c[i],s)}catch(e){Z(r,r.return,e)}}n&&o&64&&Hc(a),Wc(a,a.return);break;case 27:Qc(a);case 26:case 5:Sl(i,a,n),n&&r===null&&o&4&&Kc(a),Wc(a,a.return);break;case 12:Sl(i,a,n);break;case 31:Sl(i,a,n),n&&o&4&&dl(i,a);break;case 13:Sl(i,a,n),n&&o&4&&fl(i,a);break;case 22:a.memoizedState===null&&Sl(i,a,n),Wc(a,a.return);break;case 30:break;default:Sl(i,a,n)}t=t.sibling}}function Cl(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&aa(n))}function wl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&aa(e))}function Tl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)El(e,t,n,r),t=t.sibling}function El(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:Tl(e,t,n,r),i&2048&&Bc(9,t);break;case 1:Tl(e,t,n,r);break;case 3:Tl(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&aa(e)));break;case 12:if(i&2048){Tl(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){Z(t,t.return,e)}}else Tl(e,t,n,r);break;case 31:Tl(e,t,n,r);break;case 13:Tl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?Tl(e,t,n,r):(a._visibility|=2,Dl(e,t,n,r,(t.subtreeFlags&10256)!=0||!1)):a._visibility&2?Tl(e,t,n,r):Ol(e,t),i&2048&&Cl(o,t);break;case 24:Tl(e,t,n,r),i&2048&&wl(t.alternate,t);break;default:Tl(e,t,n,r)}}function Dl(e,t,n,r,i){for(i&&=(t.subtreeFlags&10256)!=0||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Dl(a,o,s,c,i),Bc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Dl(a,o,s,c,i)):u._visibility&2?Dl(a,o,s,c,i):Ol(a,o),i&&l&2048&&Cl(o.alternate,o);break;case 24:Dl(a,o,s,c,i),i&&l&2048&&wl(o.alternate,o);break;default:Dl(a,o,s,c,i)}t=t.sibling}}function Ol(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Ol(n,r),i&2048&&Cl(r.alternate,r);break;case 24:Ol(n,r),i&2048&&wl(r.alternate,r);break;default:Ol(n,r)}t=t.sibling}}var kl=8192;function Al(e,t,n){if(e.subtreeFlags&kl)for(e=e.child;e!==null;)jl(e,t,n),e=e.sibling}function jl(e,t,n){switch(e.tag){case 26:Al(e,t,n),e.flags&kl&&e.memoizedState!==null&&Gf(n,gl,e.memoizedState,e.memoizedProps);break;case 5:Al(e,t,n);break;case 3:case 4:var r=gl;gl=gf(e.stateNode.containerInfo),Al(e,t,n),gl=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=kl,kl=16777216,Al(e,t,n),kl=r):Al(e,t,n));break;default:Al(e,t,n)}}function Ml(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Nl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];rl=r,Il(r,e)}Ml(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Pl(e),e=e.sibling}function Pl(e){switch(e.tag){case 0:case 11:case 15:Nl(e),e.flags&2048&&Vc(9,e,e.return);break;case 3:Nl(e);break;case 12:Nl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Fl(e)):Nl(e);break;default:Nl(e)}}function Fl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];rl=r,Il(r,e)}Ml(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Vc(8,t,t.return),Fl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Fl(t));break;default:Fl(t)}e=e.sibling}}function Il(e,t){for(;rl!==null;){var n=rl;switch(n.tag){case 0:case 11:case 15:Vc(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:aa(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,rl=r;else a:for(n=e;rl!==null;){r=rl;var i=r.sibling,a=r.return;if(ol(r),r===n){rl=null;break a}if(i!==null){i.return=a,rl=i;break a}rl=a}}}var Ll={getCacheForType:function(e){var t=Zi(ra),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Zi(ra).controller.signal}},Rl=typeof WeakMap==`function`?WeakMap:Map,K=0,q=null,J=null,Y=0,X=0,zl=null,Bl=!1,Vl=!1,Hl=!1,Ul=0,Wl=0,Gl=0,Kl=0,ql=0,Jl=0,Yl=0,Xl=null,Zl=null,Ql=!1,$l=0,eu=0,tu=1/0,nu=null,ru=null,iu=0,au=null,ou=null,su=0,cu=0,lu=null,uu=null,du=0,fu=null;function pu(){return K&2&&Y!==0?Y&-Y:O.T===null?L():dd()}function mu(){if(Jl===0)if(!(Y&536870912)||U){var e=Je;Je<<=1,!(Je&3932160)&&(Je=262144),Jl=e}else Jl=536870912;return e=$a.current,e!==null&&(e.flags|=32),Jl}function hu(e,t,n){(e===q&&(X===2||X===9)||e.cancelPendingCommit!==null)&&(Su(e,0),yu(e,Y,Jl,!1)),P(e,n),(!(K&2)||e!==q)&&(e===q&&(!(K&2)&&(Kl|=n),Wl===4&&yu(e,Y,Jl,!1)),rd(e))}function gu(e,t,n){if(K&6)throw Error(i(327));var r=!n&&(t&127)==0&&(t&e.expiredLanes)===0||Qe(e,t),a=r?Au(e,t):Ou(e,t,!0),o=r;do{if(a===0){Vl&&!r&&yu(e,t,0,!1);break}else{if(n=e.current.alternate,o&&!vu(n)){a=Ou(e,t,!1),o=!1;continue}if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=Xl;var l=c.current.memoizedState.isDehydrated;if(l&&(Su(c,s).flags|=256),s=Ou(c,s,!1),s!==2){if(Hl&&!l){c.errorRecoveryDisabledLanes|=o,Kl|=o,a=4;break a}o=Zl,Zl=a,o!==null&&(Zl===null?Zl=o:Zl.push.apply(Zl,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Su(e,0),yu(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:yu(r,t,Jl,!Bl);break a;case 2:Zl=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=$l+300-je(),10<a)){if(yu(r,t,Jl,!Bl),Ze(r,0,!0)!==0)break a;su=t,r.timeoutHandle=Kd(_u.bind(null,r,n,Zl,nu,Ql,t,Jl,Kl,Yl,Bl,o,`Throttled`,-0,0),a);break a}_u(r,n,Zl,nu,Ql,t,Jl,Kl,Yl,Bl,o,null,-0,0)}}break}while(1);rd(e)}function _u(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Zt},jl(t,a,d);var m=(a&62914560)===a?$l-je():(a&4194048)===a?eu-je():0;if(m=qf(d,m),m!==null){su=a,e.cancelPendingCommit=m(Lu.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),yu(e,a,o,!l);return}}Lu(e,t,a,n,r,i,o,s,c)}function vu(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!br(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function yu(e,t,n,r){t&=~ql,t&=~Kl,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Ue(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&nt(e,n,t)}function bu(){return K&6?!0:(id(0,!1),!1)}function xu(){if(J!==null){if(X===0)var e=J.return;else e=J,Ui=Hi=null,Eo(e),Oa=null,ka=0,e=J;for(;e!==null;)zc(e.alternate,e),e=e.return;J=null}}function Su(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,qd(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),su=0,xu(),q=e,J=n=si(e.current,null),Y=t,X=0,zl=null,Bl=!1,Vl=Qe(e,t),Hl=!1,Yl=Jl=ql=Kl=Gl=Wl=0,Zl=Xl=null,Ql=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-Ue(r),a=1<<i;t|=e[i],r&=~a}return Ul=t,Zr(),n}function Cu(e,t){W=null,O.H=Is,t===va||t===ba?(t=Ea(),X=3):t===ya?(t=Ea(),X=4):X=t===ec?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,zl=t,J===null&&(Wl=1,Js(e,hi(t,e.current)))}function wu(){var e=$a.current;return e===null?!0:(Y&4194048)===Y?eo===null:(Y&62914560)===Y||Y&536870912?e===eo:!1}function Tu(){var e=O.H;return O.H=Is,e===null?Is:e}function Eu(){var e=O.A;return O.A=Ll,e}function Du(){Wl=4,Bl||(Y&4194048)!==Y&&$a.current!==null||(Vl=!0),!(Gl&134217727)&&!(Kl&134217727)||q===null||yu(q,Y,Jl,!1)}function Ou(e,t,n){var r=K;K|=2;var i=Tu(),a=Eu();(q!==e||Y!==t)&&(nu=null,Su(e,t)),t=!1;var o=Wl;a:do try{if(X!==0&&J!==null){var s=J,c=zl;switch(X){case 8:xu(),o=6;break a;case 3:case 2:case 9:case 6:$a.current===null&&(t=!0);var l=X;if(X=0,zl=null,Pu(e,s,c,l),n&&Vl){o=0;break a}break;default:l=X,X=0,zl=null,Pu(e,s,c,l)}}ku(),o=Wl;break}catch(t){Cu(e,t)}while(1);return t&&e.shellSuspendCounter++,Ui=Hi=null,K=r,O.H=i,O.A=a,J===null&&(q=null,Y=0,Zr()),o}function ku(){for(;J!==null;)Mu(J)}function Au(e,t){var n=K;K|=2;var r=Tu(),a=Eu();q!==e||Y!==t?(nu=null,tu=je()+500,Su(e,t)):Vl=Qe(e,t);a:do try{if(X!==0&&J!==null){t=J;var o=zl;b:switch(X){case 1:X=0,zl=null,Pu(e,t,o,1);break;case 2:case 9:if(Sa(o)){X=0,zl=null,Nu(t);break}t=function(){X!==2&&X!==9||q!==e||(X=7),rd(e)},o.then(t,t);break a;case 3:X=7;break a;case 4:X=5;break a;case 7:Sa(o)?(X=0,zl=null,Nu(t)):(X=0,zl=null,Pu(e,t,o,7));break;case 5:var s=null;switch(J.tag){case 26:s=J.memoizedState;case 5:case 27:var c=J;if(s?Wf(s):c.stateNode.complete){X=0,zl=null;var l=c.sibling;if(l!==null)J=l;else{var u=c.return;u===null?J=null:(J=u,Fu(u))}break b}}X=0,zl=null,Pu(e,t,o,5);break;case 6:X=0,zl=null,Pu(e,t,o,6);break;case 8:xu(),Wl=6;break a;default:throw Error(i(462))}}ju();break}catch(t){Cu(e,t)}while(1);return Ui=Hi=null,O.H=r,O.A=a,K=n,J===null?(q=null,Y=0,Zr(),Wl):0}function ju(){for(;J!==null&&!ke();)Mu(J)}function Mu(e){var t=Ac(e.alternate,e,Ul);e.memoizedProps=e.pendingProps,t===null?Fu(e):J=t}function Nu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=mc(n,t,t.pendingProps,t.type,void 0,Y);break;case 11:t=mc(n,t,t.pendingProps,t.type.render,t.ref,Y);break;case 5:Eo(t);default:zc(n,t),t=J=ci(t,Ul),t=Ac(n,t,Ul)}e.memoizedProps=e.pendingProps,t===null?Fu(e):J=t}function Pu(e,t,n,r){Ui=Hi=null,Eo(t),Oa=null,ka=0;var i=t.return;try{if($s(e,i,t,n,Y)){Wl=1,Js(e,hi(n,e.current)),J=null;return}}catch(t){if(i!==null)throw J=i,t;Wl=1,Js(e,hi(n,e.current)),J=null;return}t.flags&32768?(U||r===1?e=!0:Vl||Y&536870912?e=!1:(Bl=e=!0,(r===2||r===9||r===3||r===6)&&(r=$a.current,r!==null&&r.tag===13&&(r.flags|=16384))),Iu(t,e)):Fu(t)}function Fu(e){var t=e;do{if(t.flags&32768){Iu(t,Bl);return}e=t.return;var n=Lc(t.alternate,t,Ul);if(n!==null){J=n;return}if(t=t.sibling,t!==null){J=t;return}J=t=e}while(t!==null);Wl===0&&(Wl=5)}function Iu(e,t){do{var n=Rc(e.alternate,e);if(n!==null){n.flags&=32767,J=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){J=e;return}J=e=n}while(e!==null);Wl=6,J=null}function Lu(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do Hu();while(iu!==0);if(K&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=Xr,tt(e,n,o,s,c,l),e===q&&(J=q=null,Y=0),ou=t,au=e,su=n,cu=o,lu=a,uu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,Xu(Fe,function(){return Uu(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!=0,t.subtreeFlags&13878||r){r=O.T,O.T=null,a=k.p,k.p=2,s=K,K|=4;try{il(e,t,n)}finally{K=s,k.p=a,O.T=r}}iu=1,Ru(),zu(),Bu()}}function Ru(){if(iu===1){iu=0;var e=au,t=ou,n=(t.flags&13878)!=0;if(t.subtreeFlags&13878||n){n=O.T,O.T=null;var r=k.p;k.p=2;var i=K;K|=4;try{_l(t,e);var a=zd,o=wr(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&V(s.ownerDocument.documentElement,s)){if(c!==null&&Tr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=Cr(s,h),v=Cr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}sp=!!Rd,zd=Rd=null}finally{K=i,k.p=r,O.T=n}}e.current=t,iu=2}}function zu(){if(iu===2){iu=0;var e=au,t=ou,n=(t.flags&8772)!=0;if(t.subtreeFlags&8772||n){n=O.T,O.T=null;var r=k.p;k.p=2;var i=K;K|=4;try{al(e,t.alternate,t)}finally{K=i,k.p=r,O.T=n}}iu=3}}function Bu(){if(iu===4||iu===3){iu=0,Ae();var e=au,t=ou,n=su,r=uu;t.subtreeFlags&10256||t.flags&10256?iu=5:(iu=0,ou=au=null,Vu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(ru=null),I(n),t=t.stateNode,Ve&&typeof Ve.onCommitFiberRoot==`function`)try{Ve.onCommitFiberRoot(Be,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=O.T,i=k.p,k.p=2,O.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{O.T=t,k.p=i}}su&3&&Hu(),rd(e),i=e.pendingLanes,n&261930&&i&42?e===fu?du++:(du=0,fu=e):du=0,id(0,!1)}}function Vu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,aa(t)))}function Hu(){return Ru(),zu(),Bu(),Uu()}function Uu(){if(iu!==5)return!1;var e=au,t=cu;cu=0;var n=I(su),r=O.T,a=k.p;try{k.p=32>n?32:n,O.T=null,n=lu,lu=null;var o=au,s=su;if(iu=0,ou=au=null,su=0,K&6)throw Error(i(331));var c=K;if(K|=4,Pl(o.current),El(o,o.current,s,n),K=c,id(0,!1),Ve&&typeof Ve.onPostCommitFiberRoot==`function`)try{Ve.onPostCommitFiberRoot(Be,o)}catch{}return!0}finally{k.p=a,O.T=r,Vu(e,t)}}function Wu(e,t,n){t=hi(n,t),t=Xs(e.stateNode,t,2),e=Ba(e,t,2),e!==null&&(P(e,2),rd(e))}function Z(e,t,n){if(e.tag===3)Wu(e,e,n);else for(;t!==null;){if(t.tag===3){Wu(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(ru===null||!ru.has(r))){e=hi(n,e),n=Zs(2),r=Ba(t,n,2),r!==null&&(Qs(n,r,t,e),P(r,2),rd(r));break}}t=t.return}}function Gu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Rl;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(Hl=!0,i.add(n),e=Ku.bind(null,e,t,n),t.then(e,e))}function Ku(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,q===e&&(Y&n)===n&&(Wl===4||Wl===3&&(Y&62914560)===Y&&300>je()-$l?!(K&2)&&Su(e,0):ql|=n,Yl===Y&&(Yl=0)),rd(e)}function qu(e,t){t===0&&(t=et()),e=ei(e,t),e!==null&&(P(e,t),rd(e))}function Ju(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),qu(e,n)}function Yu(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),qu(e,n)}function Xu(e,t){return De(e,t)}var Zu=null,Qu=null,$u=!1,ed=!1,td=!1,nd=0;function rd(e){e!==Qu&&e.next===null&&(Qu===null?Zu=Qu=e:Qu=Qu.next=e),ed=!0,$u||($u=!0,ud())}function id(e,t){if(!td&&ed){td=!0;do for(var n=!1,r=Zu;r!==null;){if(!t)if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Ue(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,ld(r,a))}else a=Y,a=Ze(r,r===q?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Qe(r,a)||(n=!0,ld(r,a));r=r.next}while(n);td=!1}}function ad(){od()}function od(){ed=$u=!1;var e=0;nd!==0&&Gd()&&(e=nd);for(var t=je(),n=null,r=Zu;r!==null;){var i=r.next,a=sd(r,t);a===0?(r.next=null,n===null?Zu=i:n.next=i,i===null&&(Qu=n)):(n=r,(e!==0||a&3)&&(ed=!0)),r=i}iu!==0&&iu!==5||id(e,!1),nd!==0&&(nd=0)}function sd(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Ue(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=$e(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=q,n=Y,n=Ze(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(X===2||X===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Oe(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Qe(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Oe(r),I(n)){case 2:case 8:n=Pe;break;case 32:n=Fe;break;case 268435456:n=Le;break;default:n=Fe}return r=cd.bind(null,e),n=De(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Oe(r),e.callbackPriority=2,e.callbackNode=null,2}function cd(e,t){if(iu!==0&&iu!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Hu()&&e.callbackNode!==n)return null;var r=Y;return r=Ze(e,e===q?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(gu(e,r,t),sd(e,je()),e.callbackNode!=null&&e.callbackNode===n?cd.bind(null,e):null)}function ld(e,t){if(Hu())return null;gu(e,t,!0)}function ud(){Yd(function(){K&6?De(Ne,ad):od()})}function dd(){if(nd===0){var e=ca;e===0&&(e=qe,qe<<=1,!(qe&261888)&&(qe=256)),nd=e}return nd}function fd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:Xt(``+e)}function pd(e,t){var n=t.ownerDocument.createElement(`input`);return n.name=t.name,n.value=t.value,e.id&&n.setAttribute(`form`,e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function md(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=fd((i[ot]||null).action),o=r.submitter;o&&(t=(t=o[ot]||null)?fd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new yn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(nd!==0){var e=o?pd(i,o):new FormData(i);Ss(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?pd(i,o):new FormData(i),Ss(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var hd=0;hd<Gr.length;hd++){var gd=Gr[hd];Kr(gd.toLowerCase(),`on`+(gd[0].toUpperCase()+gd.slice(1)))}Kr(Lr,`onAnimationEnd`),Kr(Rr,`onAnimationIteration`),Kr(zr,`onAnimationStart`),Kr(`dblclick`,`onDoubleClick`),Kr(`focusin`,`onFocus`),Kr(`focusout`,`onBlur`),Kr(Br,`onTransitionRun`),Kr(Vr,`onTransitionStart`),Kr(Hr,`onTransitionCancel`),Kr(Ur,`onTransitionEnd`),xt(`onMouseEnter`,[`mouseout`,`mouseover`]),xt(`onMouseLeave`,[`mouseout`,`mouseover`]),xt(`onPointerEnter`,[`pointerout`,`pointerover`]),xt(`onPointerLeave`,[`pointerout`,`pointerover`]),bt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),bt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),bt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),bt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),bt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),bt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var _d=`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(` `),vd=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(_d));function yd(e,t){t=(t&4)!=0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){qr(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){qr(e)}i.currentTarget=null,a=c}}}}function Q(e,t){var n=t[ct];n===void 0&&(n=t[ct]=new Set);var r=e+`__bubble`;n.has(r)||(Cd(t,e,2,!1),n.add(r))}function bd(e,t,n){var r=0;t&&(r|=4),Cd(n,e,r,t)}var xd=`_reactListening`+Math.random().toString(36).slice(2);function Sd(e){if(!e[xd]){e[xd]=!0,vt.forEach(function(t){t!==`selectionchange`&&(vd.has(t)||bd(t,!1,e),bd(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[xd]||(t[xd]=!0,bd(`selectionchange`,!1,t))}}function Cd(e,t,n,r){switch(mp(t)){case 2:var i=cp;break;case 8:i=lp;break;default:i=up}n=i.bind(null,t,n,e),i=void 0,!cn||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function wd(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=mt(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}an(function(){var r=a,i=$t(n),s=[];a:{var c=Wr.get(e);if(c!==void 0){var l=yn,u=e;switch(e){case`keypress`:if(mn(n)===0)break a;case`keydown`:case`keyup`:l=Ln;break;case`focusin`:u=`focus`,l=On;break;case`focusout`:u=`blur`,l=On;break;case`beforeblur`:case`afterblur`:l=On;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=En;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Dn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=zn;break;case Lr:case Rr:case zr:l=kn;break;case Ur:l=Bn;break;case`scroll`:case`scrollend`:l=xn;break;case`wheel`:l=Vn;break;case`copy`:case`cut`:case`paste`:l=An;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Rn;break;case`toggle`:case`beforetoggle`:l=Hn}var d=(t&4)!=0,f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=on(m,p),g!=null&&d.push(Td(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(c=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,c&&n!==Qt&&(u=n.relatedTarget||n.fromElement)&&(mt(u)||u[st]))break a;if((l||c)&&(c=i.window===i?i:(c=i.ownerDocument)?c.defaultView||c.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?mt(u):null,u!==null&&(f=o(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=En,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Rn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:gt(l),h=u==null?c:gt(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,mt(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,l&&u)b:{for(d=Dd,p=l,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;l!==null&&Od(s,c,l,d,!1),u!==null&&f!==null&&Od(s,f,u,d,!0)}}a:{if(c=r?gt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=cr;else if(nr(c))if(lr)v=vr;else{v=gr;var y=hr}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&qt(r.elementType)&&(v=cr):v=_r;if(v&&=v(e,r)){rr(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&zt(c,`number`,c.value)}switch(y=r?gt(r):window,e){case`focusin`:(nr(y)||y.contentEditable===`true`)&&(Dr=y,Or=r,kr=null);break;case`focusout`:kr=Or=Dr=null;break;case`mousedown`:Ar=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Ar=!1,jr(s,n,i);break;case`selectionchange`:if(Er)break;case`keydown`:case`keyup`:jr(s,n,i)}var b;if(Wn)b:{switch(e){case`compositionstart`:var x=`onCompositionStart`;break b;case`compositionend`:x=`onCompositionEnd`;break b;case`compositionupdate`:x=`onCompositionUpdate`;break b}x=void 0}else Qn?Xn(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(qn&&n.locale!==`ko`&&(Qn||x!==`onCompositionStart`?x===`onCompositionEnd`&&Qn&&(b=pn()):(un=i,dn=`value`in un?un.value:un.textContent,Qn=!0)),y=Ed(r,x),0<y.length&&(x=new jn(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=Zn(n),b!==null&&(x.data=b)))),(b=Kn?$n(e,n):er(e,n))&&(x=Ed(r,`onBeforeInput`),0<x.length&&(y=new jn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:y,listeners:x}),y.data=b)),md(s,e,r,n,i)}yd(s,t)})}function Td(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ed(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=on(e,n),i!=null&&r.unshift(Td(e,i,a)),i=on(e,t),i!=null&&r.push(Td(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Dd(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Od(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=on(n,a),l!=null&&o.unshift(Td(n,l,c))):i||(l=on(n,a),l!=null&&o.push(Td(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var kd=/\r\n?/g,Ad=/\u0000|\uFFFD/g;function jd(e){return(typeof e==`string`?e:``+e).replace(kd,`
9
+ `).replace(Ad,``)}function Md(e,t){return t=jd(t),jd(e)===t}function $(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Ut(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Ut(e,``+r);break;case`className`:Dt(e,`class`,r);break;case`tabIndex`:Dt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Dt(e,n,r);break;case`style`:Kt(e,r,o);break;case`data`:if(t!==`object`){Dt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Xt(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`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 o==`function`&&(n===`formAction`?(t!==`input`&&$(e,t,`name`,a.name,a,null),$(e,t,`formEncType`,a.formEncType,a,null),$(e,t,`formMethod`,a.formMethod,a,null),$(e,t,`formTarget`,a.formTarget,a,null)):($(e,t,`encType`,a.encType,a,null),$(e,t,`method`,a.method,a,null),$(e,t,`target`,a.target,a,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Xt(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=Zt);break;case`onScroll`:r!=null&&Q(`scroll`,e);break;case`onScrollEnd`:r!=null&&Q(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=Xt(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);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`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:Q(`beforetoggle`,e),Q(`toggle`,e),Et(e,`popover`,r);break;case`xlinkActuate`:Ot(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Ot(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Ot(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Ot(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Ot(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Ot(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Ot(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Ot(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Ot(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Et(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=Jt.get(n)||n,Et(e,n,r))}}function Nd(e,t,n,r,a,o){switch(n){case`style`:Kt(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?Ut(e,r):(typeof r==`number`||typeof r==`bigint`)&&Ut(e,``+r);break;case`onScroll`:r!=null&&Q(`scroll`,e);break;case`onScrollEnd`:r!=null&&Q(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=Zt);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!yt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),t=n.slice(2,a?n.length-7:void 0),o=e[ot]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,a),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):Et(e,n,r)}}}function Pd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Q(`error`,e),Q(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:$(e,t,o,s,n,null)}}a&&$(e,t,`srcSet`,n.srcSet,n,null),r&&$(e,t,`src`,n.src,n,null);return;case`input`:Q(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:$(e,t,r,d,n,null)}}Rt(e,o,c,l,u,s,a,!1);return;case`select`:for(a in Q(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:$(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Bt(e,!!r,n,!0):Bt(e,!!r,t,!1);return;case`textarea`:for(s in Q(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:$(e,t,s,c,n,null)}Ht(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:$(e,t,l,r,n,null)}return;case`dialog`:Q(`beforetoggle`,e),Q(`toggle`,e),Q(`cancel`,e),Q(`close`,e);break;case`iframe`:case`object`:Q(`load`,e);break;case`video`:case`audio`:for(r=0;r<_d.length;r++)Q(_d[r],e);break;case`image`:Q(`error`,e),Q(`load`,e);break;case`details`:Q(`toggle`,e);break;case`embed`:case`source`:case`link`:Q(`error`,e),Q(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:$(e,t,u,r,n,null)}return;default:if(qt(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Nd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&$(e,t,c,r,n,null))}function Fd(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||$(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:o=m;break;case`name`:a=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&$(e,t,p,m,r,f)}}Lt(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||$(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&$(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Bt(e,!!n,n?[]:``,!1):Bt(e,!!n,t,!0)):Bt(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:$(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:p=a;break;case`defaultValue`:m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&$(e,t,s,a,r,o)}Vt(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:$(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:$(e,t,l,p,r,m)}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 g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&$(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:$(e,t,u,p,r,m)}return;default:if(qt(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Nd(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||Nd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&$(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||$(e,t,f,p,r,m)}function Id(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Ld(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&Id(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&Id(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var Rd=null,zd=null;function Bd(e){return e.nodeType===9?e:e.ownerDocument}function Vd(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function Hd(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function Ud(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Wd=null;function Gd(){var e=window.event;return e&&e.type===`popstate`?e===Wd?!1:(Wd=e,!0):(Wd=null,!1)}var Kd=typeof setTimeout==`function`?setTimeout:void 0,qd=typeof clearTimeout==`function`?clearTimeout:void 0,Jd=typeof Promise==`function`?Promise:void 0,Yd=typeof queueMicrotask==`function`?queueMicrotask:Jd===void 0?Kd:function(e){return Jd.resolve(null).then(e).catch(Xd)};function Xd(e){setTimeout(function(){throw e})}function Zd(e){return e===`head`}function Qd(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Np(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)pf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,pf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[ft]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&pf(e.ownerDocument.body);n=i}while(n);Np(t)}function $d(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8)if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++;n=r}while(n)}function ef(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:ef(n),pt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function tf(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r)if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e;else if(!e[ft])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=cf(e.nextSibling),e===null)break}return null}function nf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=cf(e.nextSibling),e===null))return null;return e}function rf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=cf(e.nextSibling),e===null))return null;return e}function af(e){return e.data===`$?`||e.data===`$~`}function of(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function sf(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function cf(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var lf=null;function uf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return cf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function df(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function ff(e,t,n){switch(t=Bd(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function pf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);pt(e)}var mf=new Map,hf=new Set;function gf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var _f=k.d;k.d={f:vf,r:yf,D:Sf,C:Cf,L:wf,m:Tf,X:Df,S:Ef,M:Of};function vf(){var e=_f.f(),t=bu();return e||t}function yf(e){var t=ht(e);t!==null&&t.tag===5&&t.type===`form`?ws(t):_f.r(e)}var bf=typeof document>`u`?null:document;function xf(e,t,n){var r=bf;if(r&&typeof t==`string`&&t){var i=It(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),hf.has(i)||(hf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Pd(t,`link`,e),B(t),r.head.appendChild(t)))}}function Sf(e){_f.D(e),xf(`dns-prefetch`,e,null)}function Cf(e,t){_f.C(e,t),xf(`preconnect`,e,t)}function wf(e,t,n){_f.L(e,t,n);var r=bf;if(r&&e&&t){var i=`link[rel="preload"][as="`+It(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+It(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+It(n.imageSizes)+`"]`)):i+=`[href="`+It(e)+`"]`;var a=i;switch(t){case`style`:a=Af(e);break;case`script`:a=Pf(e)}mf.has(a)||(e=h({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),mf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(jf(a))||t===`script`&&r.querySelector(Ff(a))||(t=r.createElement(`link`),Pd(t,`link`,e),B(t),r.head.appendChild(t)))}}function Tf(e,t){_f.m(e,t);var n=bf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+It(r)+`"][href="`+It(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Pf(e)}if(!mf.has(a)&&(e=h({rel:`modulepreload`,href:e},t),mf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Ff(a)))return}r=n.createElement(`link`),Pd(r,`link`,e),B(r),n.head.appendChild(r)}}}function Ef(e,t,n){_f.S(e,t,n);var r=bf;if(r&&e){var i=_t(r).hoistableStyles,a=Af(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(jf(a)))s.loading=5;else{e=h({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=mf.get(a))&&Rf(e,n);var c=o=r.createElement(`link`);B(c),Pd(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Lf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Df(e,t){_f.X(e,t);var n=bf;if(n&&e){var r=_t(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=h({src:e,async:!0},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),B(a),Pd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Of(e,t){_f.M(e,t);var n=bf;if(n&&e){var r=_t(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=h({src:e,async:!0,type:`module`},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),B(a),Pd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function kf(e,t,n,r){var a=(a=pe.current)?gf(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Af(n.href),n=_t(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Af(n.href);var o=_t(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(jf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),mf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},mf.set(e,n),o||Nf(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Pf(n),n=_t(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Af(e){return`href="`+It(e)+`"`}function jf(e){return`link[rel="stylesheet"][`+e+`]`}function Mf(e){return h({},e,{"data-precedence":e.precedence,precedence:null})}function Nf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Pd(t,`link`,n),B(t),e.head.appendChild(t))}function Pf(e){return`[src="`+It(e)+`"]`}function Ff(e){return`script[async]`+e}function If(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+It(n.href)+`"]`);if(r)return t.instance=r,B(r),r;var a=h({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),B(r),Pd(r,`style`,a),Lf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Af(n.href);var o=e.querySelector(jf(a));if(o)return t.state.loading|=4,t.instance=o,B(o),o;r=Mf(n),(a=mf.get(a))&&Rf(r,a),o=(e.ownerDocument||e).createElement(`link`),B(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Pd(o,`link`,r),t.state.loading|=4,Lf(o,n.precedence,e),t.instance=o;case`script`:return o=Pf(n.src),(a=e.querySelector(Ff(o)))?(t.instance=a,B(a),a):(r=n,(a=mf.get(o))&&(r=h({},n),zf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),B(a),Pd(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Lf(r,n.precedence,e));return t.instance}function Lf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Rf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function zf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Bf=null;function Vf(e,t,n){if(Bf===null){var r=new Map,i=Bf=new Map;i.set(n,r)}else i=Bf,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[ft]||a[z]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Hf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Uf(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Wf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Gf(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Af(r.href),a=t.querySelector(jf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=Jf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,B(a);return}a=t.ownerDocument||t,r=Mf(r),(i=mf.get(i))&&Rf(r,i),a=a.createElement(`link`),B(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Pd(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=Jf.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Kf=0;function qf(e,t){return e.stylesheets&&e.count===0&&Xf(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&Xf(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&Kf===0&&(Kf=62500*Ld());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Xf(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>Kf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Jf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Xf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Yf=null;function Xf(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Yf=new Map,t.forEach(Zf,e),Yf=null,Jf.call(e))}function Zf(e,t){if(!(t.state.loading&4)){var n=Yf.get(e);if(n)var r=n.get(null);else{n=new Map,Yf.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=Jf.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var Qf={$$typeof:C,Provider:null,Consumer:null,_currentValue:ce,_currentValue2:ce,_threadCount:0};function $f(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,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=N(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=N(0),this.hiddenUpdates=N(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function ep(e,t,n,r,i,a,o,s,c,l,u,d){return e=new $f(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=ai(3,null,null,t),e.current=a,a.stateNode=e,t=ia(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},La(a),e}function tp(e){return e?(e=ri,e):ri}function np(e,t,n,r,i,a){i=tp(i),r.context===null?r.context=i:r.pendingContext=i,r=za(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Ba(e,r,t),n!==null&&(hu(n,e,t),Va(n,e,t))}function rp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ip(e,t){rp(e,t),(e=e.alternate)&&rp(e,t)}function ap(e){if(e.tag===13||e.tag===31){var t=ei(e,67108864);t!==null&&hu(t,e,67108864),ip(e,67108864)}}function op(e){if(e.tag===13||e.tag===31){var t=pu();t=F(t);var n=ei(e,t);n!==null&&hu(n,e,t),ip(e,t)}}var sp=!0;function cp(e,t,n,r){var i=O.T;O.T=null;var a=k.p;try{k.p=2,up(e,t,n,r)}finally{k.p=a,O.T=i}}function lp(e,t,n,r){var i=O.T;O.T=null;var a=k.p;try{k.p=8,up(e,t,n,r)}finally{k.p=a,O.T=i}}function up(e,t,n,r){if(sp){var i=dp(r);if(i===null)wd(e,t,r,fp,n),Cp(e,r);else if(Tp(i,e,t,n,r))r.stopPropagation();else if(Cp(e,r),t&4&&-1<Sp.indexOf(e)){for(;i!==null;){var a=ht(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Xe(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Ue(o);s.entanglements[1]|=c,o&=~c}rd(a),!(K&6)&&(tu=je()+500,id(0,!1))}}break;case 31:case 13:s=ei(a,2),s!==null&&hu(s,a,2),bu(),ip(a,2)}if(a=dp(r),a===null&&wd(e,t,r,fp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else wd(e,t,r,null,n)}}function dp(e){return e=$t(e),pp(e)}var fp=null;function pp(e){if(fp=null,e=mt(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return fp=e,null}function mp(e){switch(e){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(Me()){case Ne:return 2;case Pe:return 8;case Fe:case Ie:return 32;case Le:return 268435456;default:return 32}default:return 32}}var hp=!1,gp=null,_p=null,vp=null,yp=new Map,bp=new Map,xp=[],Sp=`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 Cp(e,t){switch(e){case`focusin`:case`focusout`:gp=null;break;case`dragenter`:case`dragleave`:_p=null;break;case`mouseover`:case`mouseout`:vp=null;break;case`pointerover`:case`pointerout`:yp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:bp.delete(t.pointerId)}}function wp(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=ht(t),t!==null&&ap(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Tp(e,t,n,r,i){switch(t){case`focusin`:return gp=wp(gp,e,t,n,r,i),!0;case`dragenter`:return _p=wp(_p,e,t,n,r,i),!0;case`mouseover`:return vp=wp(vp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return yp.set(a,wp(yp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,bp.set(a,wp(bp.get(a)||null,e,t,n,r,i)),!0}return!1}function Ep(e){var t=mt(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,at(e.priority,function(){op(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,at(e.priority,function(){op(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Dp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=dp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Qt=r,n.target.dispatchEvent(r),Qt=null}else return t=ht(n),t!==null&&ap(t),e.blockedOn=n,!1;t.shift()}return!0}function Op(e,t,n){Dp(e)&&n.delete(t)}function kp(){hp=!1,gp!==null&&Dp(gp)&&(gp=null),_p!==null&&Dp(_p)&&(_p=null),vp!==null&&Dp(vp)&&(vp=null),yp.forEach(Op),bp.forEach(Op)}function Ap(e,n){e.blockedOn===n&&(e.blockedOn=null,hp||(hp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,kp)))}var jp=null;function Mp(e){jp!==e&&(jp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){jp===e&&(jp=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(pp(r||n)===null)continue;break}var a=ht(n);a!==null&&(e.splice(t,3),t-=3,Ss(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Np(e){function t(t){return Ap(t,e)}gp!==null&&Ap(gp,e),_p!==null&&Ap(_p,e),vp!==null&&Ap(vp,e),yp.forEach(t),bp.forEach(t);for(var n=0;n<xp.length;n++){var r=xp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<xp.length&&(n=xp[0],n.blockedOn===null);)Ep(n),n.blockedOn===null&&xp.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[ot]||null;if(typeof a==`function`)o||Mp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[ot]||null)s=o.formAction;else if(pp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Mp(n)}}}function Pp(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Fp(e){this._internalRoot=e}Ip.prototype.render=Fp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;np(n,pu(),e,t,null,null)},Ip.prototype.unmount=Fp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;np(e.current,2,null,e,null,null),bu(),t[st]=null}};function Ip(e){this._internalRoot=e}Ip.prototype.unstable_scheduleHydration=function(e){if(e){var t=L();e={blockedOn:null,target:e,priority:t};for(var n=0;n<xp.length&&t!==0&&t<xp[n].priority;n++);xp.splice(n,0,e),n===0&&Ep(e)}};var Lp=n.version;if(Lp!==`19.2.6`)throw Error(i(527,Lp,`19.2.6`));k.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=d(t),e=e===null?null:p(e),e=e===null?null:e.stateNode,e};var Rp={bundleType:0,version:`19.2.6`,rendererPackageName:`react-dom`,currentDispatcherRef:O,reconcilerVersion:`19.2.6`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var zp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!zp.isDisabled&&zp.supportsFiber)try{Be=zp.inject(Rp),Ve=zp}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Gs,s=Ks,c=qs;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=ep(e,1,!1,null,null,n,r,null,o,s,c,Pp),e[st]=t.current,Sd(e),new Fp(t)}})),g=o(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=h()})),_=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),v=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),y=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),b=e=>{let t=y(e);return t.charAt(0).toUpperCase()+t.slice(1)},x={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},S=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},C=c(u(),1),w=(0,C.createContext)({}),T=()=>(0,C.useContext)(w),ee=(0,C.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:f=`currentColor`,className:p=``}=T()??{},m=r??d?Number(n??u)*24/Number(t??l):n??u;return(0,C.createElement)(`svg`,{ref:c,...x,width:t??l??x.width,height:t??l??x.height,stroke:e??f,strokeWidth:m,className:_(`lucide`,p,i),...!a&&!S(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,C.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),E=(e,t)=>{let n=(0,C.forwardRef)(({className:n,...r},i)=>(0,C.createElement)(ee,{ref:i,iconNode:t,className:_(`lucide-${v(b(e))}`,`lucide-${e}`,n),...r}));return n.displayName=b(e),n},D=E(`activity`,[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]),te=E(`archive`,[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`,key:`1s80jp`}],[`path`,{d:`M10 12h4`,key:`a56b0p`}]]),ne=E(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),re=E(`arrow-right`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),ie=E(`boxes`,[[`path`,{d:`M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z`,key:`lc1i9w`}],[`path`,{d:`m7 16.5-4.74-2.85`,key:`1o9zyk`}],[`path`,{d:`m7 16.5 5-3`,key:`va8pkn`}],[`path`,{d:`M7 16.5v5.17`,key:`jnp8gn`}],[`path`,{d:`M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z`,key:`8zsnat`}],[`path`,{d:`m17 16.5-5-3`,key:`8arw3v`}],[`path`,{d:`m17 16.5 4.74-2.85`,key:`8rfmw`}],[`path`,{d:`M17 16.5v5.17`,key:`k6z78m`}],[`path`,{d:`M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z`,key:`1xygjf`}],[`path`,{d:`M12 8 7.26 5.15`,key:`1vbdud`}],[`path`,{d:`m12 8 4.74-2.85`,key:`3rx089`}],[`path`,{d:`M12 13.5V8`,key:`1io7kd`}]]),ae=E(`brain`,[[`path`,{d:`M12 18V5`,key:`adv99a`}],[`path`,{d:`M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4`,key:`1e3is1`}],[`path`,{d:`M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5`,key:`1gqd8o`}],[`path`,{d:`M17.997 5.125a4 4 0 0 1 2.526 5.77`,key:`iwvgf7`}],[`path`,{d:`M18 18a4 4 0 0 0 2-7.464`,key:`efp6ie`}],[`path`,{d:`M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517`,key:`1gq6am`}],[`path`,{d:`M6 18a4 4 0 0 1-2-7.464`,key:`k1g0md`}],[`path`,{d:`M6.003 5.125a4 4 0 0 0-2.526 5.77`,key:`q97ue3`}]]),oe=E(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),se=E(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),O=E(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),k=E(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),ce=E(`circle-alert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]),le=E(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),ue=E(`circle-play`,[[`path`,{d:`M9 9.003a1 1 0 0 1 1.517-.859l4.997 2.997a1 1 0 0 1 0 1.718l-4.997 2.997A1 1 0 0 1 9 14.996z`,key:`kmsa83`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),A=E(`circle-x`,[[`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`}]]),de=E(`circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),j=E(`clipboard-copy`,[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2`,key:`4jdomd`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v4`,key:`3hqy98`}],[`path`,{d:`M21 14H11`,key:`1bme5i`}],[`path`,{d:`m15 10-4 4 4 4`,key:`5dvupr`}]]),fe=E(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),M=E(`cog`,[[`path`,{d:`M11 10.27 7 3.34`,key:`16pf9h`}],[`path`,{d:`m11 13.73-4 6.93`,key:`794ttg`}],[`path`,{d:`M12 22v-2`,key:`1osdcq`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M14 12h8`,key:`4f43i9`}],[`path`,{d:`m17 20.66-1-1.73`,key:`eq3orb`}],[`path`,{d:`m17 3.34-1 1.73`,key:`2wel8s`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`m20.66 17-1.73-1`,key:`sg0v6f`}],[`path`,{d:`m20.66 7-1.73 1`,key:`1ow05n`}],[`path`,{d:`m3.34 17 1.73-1`,key:`nuk764`}],[`path`,{d:`m3.34 7 1.73 1`,key:`1ulond`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}],[`circle`,{cx:`12`,cy:`12`,r:`8`,key:`46899m`}]]),pe=E(`compass`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z`,key:`9ktpf1`}]]),me=E(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),he=E(`cpu`,[[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M17 20v2`,key:`1rnc9c`}],[`path`,{d:`M17 2v2`,key:`11trls`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M2 17h2`,key:`7oei6x`}],[`path`,{d:`M2 7h2`,key:`asdhe0`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`M20 17h2`,key:`1fpfkl`}],[`path`,{d:`M20 7h2`,key:`1o8tra`}],[`path`,{d:`M7 20v2`,key:`4gnj0m`}],[`path`,{d:`M7 2v2`,key:`1i4yhu`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`,key:`1vbyd7`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,key:`z9xiuo`}]]),ge=E(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),_e=E(`file-braces`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1`,key:`1oajmo`}],[`path`,{d:`M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1`,key:`mpwhp6`}]]),ve=E(`grip-vertical`,[[`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`}]]),ye=E(`hash`,[[`line`,{x1:`4`,x2:`20`,y1:`9`,y2:`9`,key:`4lhtct`}],[`line`,{x1:`4`,x2:`20`,y1:`15`,y2:`15`,key:`vyu0kd`}],[`line`,{x1:`10`,x2:`8`,y1:`3`,y2:`21`,key:`1ggp8o`}],[`line`,{x1:`16`,x2:`14`,y1:`3`,y2:`21`,key:`weycgp`}]]),be=E(`image`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]),xe=E(`inbox`,[[`polyline`,{points:`22 12 16 12 14 15 10 15 8 12 2 12`,key:`o97t9d`}],[`path`,{d:`M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`oot6mr`}]]),Se=E(`info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),Ce=E(`key-round`,[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]),we=E(`layers`,[[`path`,{d:`M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z`,key:`zw3jo`}],[`path`,{d:`M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12`,key:`1wduqc`}],[`path`,{d:`M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17`,key:`kqbvx6`}]]),Te=E(`menu`,[[`path`,{d:`M4 5h16`,key:`1tepv9`}],[`path`,{d:`M4 12h16`,key:`1lakjw`}],[`path`,{d:`M4 19h16`,key:`1djgab`}]]),Ee=E(`message-square-reply`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`m10 8-3 3 3 3`,key:`fp6dz7`}],[`path`,{d:`M17 14v-1a2 2 0 0 0-2-2H7`,key:`1tkjnz`}]]),De=E(`message-square`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]),Oe=E(`pause`,[[`rect`,{x:`14`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`kaeet6`}],[`rect`,{x:`5`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`1wsw3u`}]]),ke=E(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),Ae=E(`play`,[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]),je=E(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),Me=E(`refresh-cw`,[[`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`}]]),Ne=E(`save`,[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]]),Pe=E(`scroll-text`,[[`path`,{d:`M15 12h-5`,key:`r7krc0`}],[`path`,{d:`M15 8h-5`,key:`1khuty`}],[`path`,{d:`M19 17V5a2 2 0 0 0-2-2H4`,key:`zz82l3`}],[`path`,{d:`M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3`,key:`1ph1d7`}]]),Fe=E(`server`,[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]),Ie=E(`shield-alert`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M12 16h.01`,key:`1drbdi`}]]),Le=E(`shield-check`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),Re=E(`shield`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}]]),ze=E(`smile`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M8 14s1.5 2 4 2 4-2 4-2`,key:`1y1vjs`}],[`line`,{x1:`9`,x2:`9.01`,y1:`9`,y2:`9`,key:`yxxnd0`}],[`line`,{x1:`15`,x2:`15.01`,y1:`9`,y2:`9`,key:`1p4y9e`}]]),Be=E(`sparkles`,[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]]),Ve=E(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),He=E(`triangle-alert`,[[`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-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),Ue=E(`users`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`path`,{d:`M16 3.128a4 4 0 0 1 0 7.744`,key:`16gr8j`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]),We=E(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),Ge=g(),Ke=[{id:`dashboard`,label:`Dashboard`,icon:D,group:`operate`},{id:`setup`,label:`Setup`,icon:ue,group:`operate`},{id:`providers`,label:`Providers`,icon:ie,group:`configure`},{id:`waifus`,label:`Waifus`,icon:Be,group:`configure`},{id:`servers`,label:`Servers`,icon:Fe,group:`configure`},{id:`orchestrator`,label:`Orchestrator`,icon:pe,group:`configure`},{id:`reviewer`,label:`Reviewer`,icon:Le,group:`configure`},{id:`stage-manager`,label:`Stage Manager`,icon:we,group:`configure`},{id:`memories`,label:`Memories`,icon:ae,group:`configure`},{id:`logs`,label:`Logs`,icon:Pe,group:`diagnostics`},{id:`queries`,label:`Queries`,icon:_e,group:`diagnostics`},{id:`replies`,label:`Replies`,icon:Ee,group:`diagnostics`},{id:`settings`,label:`Settings`,icon:M,group:`diagnostics`}],qe=[{id:`operate`,label:`Operate`},{id:`configure`,label:`Configure`},{id:`diagnostics`,label:`Diagnostics`}],Je=`dashboard`,Ye=new Set([`dashboard`,`setup`,`providers`,`waifus`,`servers`,`orchestrator`,`reviewer`,`stage-manager`,`memories`,`logs`,`queries`,`replies`,`settings`]);function Xe(){let e=window.location.hash.replace(/^#\/?/,``).split(`?`)[0]??``;return Ye.has(e)?e:Je}function Ze(){let[e,t]=(0,C.useState)(Xe);return(0,C.useEffect)(()=>{let e=()=>t(Xe());return window.addEventListener(`hashchange`,e),()=>window.removeEventListener(`hashchange`,e)},[]),[e,e=>{window.location.hash===`#/${e}`?t(e):window.location.hash=`#/${e}`}]}var Qe=class extends Error{status;body;constructor(e,t,n){super(n??t.message??t.error??`HTTP ${e}`),this.status=e,this.body=t}},$e=class extends Qe{latest;constructor(e){super(409,e),this.latest=e.latest}},et=``;async function N(e,t,n){let r={...n?.headers},i;n?.body!==void 0&&(r[`content-type`]=`application/json`,i=JSON.stringify(n.body));let a;try{a=await fetch(`${et}${t}`,{method:e,headers:r,body:i,signal:n?.signal})}catch(e){throw e?.name===`AbortError`?e:new Qe(0,{error:`NetworkError`,message:e.message})}if(a.status===204)return;let o=await a.text(),s;try{s=o?JSON.parse(o):void 0}catch{s={error:`InvalidResponse`,message:o.slice(0,200)}}if(!a.ok){let e=s??{error:`HTTP ${a.status}`};throw a.status===409?new $e(e):new Qe(a.status,e)}return s}var P={health:e=>N(`GET`,`/api/health`,{signal:e}),status:e=>N(`GET`,`/api/status`,{signal:e}),runtime:e=>N(`GET`,`/api/runtime`,{signal:e}),pause:()=>N(`POST`,`/api/runtime/pause`),resume:()=>N(`POST`,`/api/runtime/resume`),reload:()=>N(`POST`,`/api/runtime/reload`),triggerOrchestrator:e=>N(`POST`,`/api/runtime/trigger/orchestrator`,e?{body:e}:void 0),triggerStageManager:e=>N(`POST`,`/api/runtime/trigger/stage-manager`,e?{body:e}:void 0),diagnosticsBundle:e=>N(`GET`,`/api/diagnostics/bundle`,{signal:e}),getConfig:e=>N(`GET`,`/api/config`,{signal:e}),putConfig:e=>N(`PUT`,`/api/config`,{body:e}),clearOcrCache:()=>N(`POST`,`/api/cache/ocr/clear`),discordBots:e=>N(`GET`,`/api/discord-bots`,{signal:e}),putDiscordBots:e=>N(`PUT`,`/api/discord-bots`,{body:e}),orchestratorConfig:e=>N(`GET`,`/api/orchestrator/config`,{signal:e}),putOrchestratorConfig:e=>N(`PUT`,`/api/orchestrator/config`,{body:e}),orchestratorHistory:e=>N(`GET`,`/api/orchestrator/history`,{signal:e}),stageManagerConfig:e=>N(`GET`,`/api/stage-manager/config`,{signal:e}),putStageManagerConfig:e=>N(`PUT`,`/api/stage-manager/config`,{body:e}),stageManagerHistory:e=>N(`GET`,`/api/stage-manager/history`,{signal:e}),reviewerConfig:e=>N(`GET`,`/api/reviewer/config`,{signal:e}),putReviewerConfig:e=>N(`PUT`,`/api/reviewer/config`,{body:e}),reviewerHistory:e=>N(`GET`,`/api/reviewer/history`,{signal:e}),providers:e=>N(`GET`,`/api/providers`,{signal:e}),putProviderCredentials:(e,t)=>N(`PUT`,`/api/providers/${e}/credentials`,{body:t}),models:e=>N(`GET`,`/api/models`,{signal:e}),waifus:e=>N(`GET`,`/api/waifus`,{signal:e}),waifu:(e,t)=>N(`GET`,`/api/waifus/${encodeURIComponent(e)}`,{signal:t}),createWaifu:e=>N(`POST`,`/api/waifus`,{body:e}),updateWaifu:(e,t)=>N(`PUT`,`/api/waifus/${encodeURIComponent(e)}`,{body:t}),deleteWaifu:(e,t)=>N(`DELETE`,`/api/waifus/${encodeURIComponent(e)}`,{body:{revision:t}}),servers:e=>N(`GET`,`/api/servers`,{signal:e}),updateServer:(e,t)=>N(`PUT`,`/api/servers/${encodeURIComponent(e)}`,{body:t}),members:(e,t)=>N(`GET`,`/api/servers/${encodeURIComponent(e)}/members`,{signal:t}),refreshMembers:e=>N(`POST`,`/api/servers/${encodeURIComponent(e)}/members/refresh`),emojis:(e,t)=>N(`GET`,`/api/servers/${encodeURIComponent(e)}/emojis`,{signal:t}),refreshEmojis:e=>N(`POST`,`/api/servers/${encodeURIComponent(e)}/emojis/refresh`),roles:(e,t)=>N(`GET`,`/api/servers/${encodeURIComponent(e)}/roles`,{signal:t}),refreshRoles:e=>N(`POST`,`/api/servers/${encodeURIComponent(e)}/roles/refresh`),updateChannel:(e,t,n)=>N(`PUT`,`/api/servers/${encodeURIComponent(e)}/channels/${encodeURIComponent(t)}`,{body:n}),memories:e=>N(`GET`,`/api/memories`,{signal:e}),createMemory:e=>N(`POST`,`/api/memories`,{body:e}),updateMemory:(e,t)=>N(`PUT`,`/api/memories/${encodeURIComponent(e)}`,{body:t}),deleteMemory:(e,t)=>N(`DELETE`,`/api/memories/${encodeURIComponent(e)}`,{body:{revision:t}}),shortTermMemories:e=>N(`GET`,`/api/short-term-memories`,{signal:e}),updateShortTermMemory:(e,t)=>N(`PUT`,`/api/short-term-memories/${encodeURIComponent(e)}`,{body:t}),deleteShortTermMemory:(e,t)=>N(`DELETE`,`/api/short-term-memories/${encodeURIComponent(e)}`,{body:{revision:t}})};function tt(){return new EventSource(`${et}/api/events`)}var nt=new class{current;listeners=new Set;es;pollTimer;started=!1;start(){if(!this.started){this.started=!0,this.refresh();try{this.es=tt(),this.es.addEventListener(`runtime`,e=>{try{let t=JSON.parse(e.data);t&&typeof t==`object`&&(this.current={running:!0,paused:!!t.paused,httpUrl:`http://127.0.0.1:${t.port??3888}`,dataRoot:t.dataRoot??``,discord:t.discord??{connected:!1,orchestratorConnected:!1,waifuBotCount:0,warnings:[]},queues:t.queues??{active:0,configuredGuilds:0}},this.emit())}catch{}}),this.es.onerror=()=>{}}catch{}this.pollTimer=window.setInterval(()=>void this.refresh(),5e3)}}stop(){this.started=!1,this.es?.close(),this.es=void 0,this.pollTimer!==void 0&&(window.clearInterval(this.pollTimer),this.pollTimer=void 0)}async refresh(){try{let e=await P.status();this.current=e,this.emit()}catch{}}get(){return this.current}subscribe(e){return this.listeners.add(e),e(this.current),()=>this.listeners.delete(e)}emit(){for(let e of this.listeners)e(this.current)}};function rt(){let[e,t]=(0,C.useState)(nt.get());return(0,C.useEffect)(()=>(nt.start(),nt.subscribe(t)),[]),e}var it=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),F=o(((e,t)=>{t.exports=it()}))();function I({tone:e=`neutral`,dot:t=!1,children:n}){return(0,F.jsx)(`span`,{className:[`pill`,e===`neutral`?``:e,t?`dot`:``].filter(Boolean).join(` `),children:n})}function L(e,t=[]){let[n,r]=(0,C.useState)(void 0),[i,a]=(0,C.useState)(!0),[o,s]=(0,C.useState)(void 0),[c,l]=(0,C.useState)(0),u=(0,C.useRef)(e);return u.current=e,(0,C.useEffect)(()=>{let e=new AbortController,t=!0;return a(!0),s(void 0),u.current(e.signal).then(e=>{t&&(r(e),a(!1))}).catch(e=>{t&&e?.name!==`AbortError`&&(s(e),a(!1))}),()=>{t=!1,e.abort()}},[...t,c]),{data:n,loading:i,error:o,reload:(0,C.useCallback)(()=>l(e=>e+1),[]),setData:r}}var at={ok:le,warn:He,err:ce,info:Se};function R({tone:e=`info`,title:t,children:n}){let r=at[e];return(0,F.jsxs)(`div`,{className:`notice `+e,children:[(0,F.jsx)(r,{className:`icon`}),(0,F.jsxs)(`div`,{children:[t&&(0,F.jsx)(`div`,{style:{fontWeight:600,marginBottom:2},children:t}),(0,F.jsx)(`div`,{children:n})]})]})}function z({icon:e,title:t,children:n,action:r}){return(0,F.jsxs)(`div`,{className:`empty`,children:[e??(0,F.jsx)(xe,{className:`icon-lg`}),(0,F.jsx)(`div`,{className:`empty-title`,children:t}),n&&(0,F.jsx)(`div`,{className:`empty-help`,children:n}),r&&(0,F.jsx)(`div`,{style:{marginTop:12},children:r})]})}function ot({height:e=14,width:t=`100%`}){return(0,F.jsx)(`div`,{className:`skeleton`,style:{height:e,width:t}})}function st({rows:e=3,height:t=14}){return(0,F.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:8},children:Array.from({length:e}).map((e,n)=>(0,F.jsx)(ot,{height:t,width:`${60+n*7%40}%`},n))})}function ct(e,t=Date.now()){if(!e)return`—`;let n=new Date(e).getTime();if(Number.isNaN(n))return`—`;let r=Math.max(0,Math.round((t-n)/1e3));if(r<5)return`just now`;if(r<60)return`${r}s ago`;let i=Math.round(r/60);if(i<60)return`${i}m ago`;let a=Math.round(i/60);if(a<24)return`${a}h ago`;let o=Math.round(a/24);if(o<30)return`${o}d ago`;let s=Math.round(o/30);return s<12?`${s}mo ago`:`${Math.round(s/12)}y ago`}function lt(e){if(!e)return`—`;let t=new Date(e);return Number.isNaN(t.getTime())?`—`:t.toLocaleTimeString(void 0,{hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hour12:!1})}function ut(e,t=Date.now()){if(!e)return`—`;let n=new Date(e).getTime();if(Number.isNaN(n))return`—`;let r=Math.max(0,Math.round((t-n)/1e3));if(r<60)return`${r}s`;let i=Math.floor(r/3600),a=Math.floor(r%3600/60),o=r%60;return i>0?`${i}h ${a}m`:a>0?`${a}m ${o}s`:`${o}s`}function dt(e){return e.trim().toLowerCase().replace(/[^a-z0-9._:-]+/g,`-`).replace(/^-+|-+$/g,``)}function ft(e){try{return JSON.stringify(e,null,2)}catch{return String(e)}}var pt=0;function mt(){return++pt}function ht(){let e=rt(),t=L(e=>P.runtime(e),[]),n=L(e=>P.providers(e),[]),r=L(e=>P.servers(e),[]),[i,a]=(0,C.useState)([]),[o,s]=(0,C.useState)(void 0),[c,l]=(0,C.useState)(void 0);(0,C.useEffect)(()=>{let e;try{e=tt()}catch{return}return e.addEventListener(`runtime`,e=>{a(t=>[{id:mt(),time:new Date().toISOString(),type:`runtime`,message:gt(e.data)},...t].slice(0,100))}),e.addEventListener(`log`,e=>{try{let t=JSON.parse(e.data);a(e=>[{id:mt(),time:t.time??new Date().toISOString(),type:t.level,message:t.context===void 0?t.message:`${t.message} ${ft(t.context)}`},...e].slice(0,100))}catch{}}),e.onerror=()=>{a(e=>[{id:mt(),time:new Date().toISOString(),type:`error`,message:`Event stream disconnected; will retry.`},...e].slice(0,100))},()=>e?.close()},[]);let u=(0,C.useCallback)(async e=>{s(e),l(void 0);try{e===`pause`?await P.pause():e===`resume`?await P.resume():l((await P.reload()).message),await nt.refresh(),t.reload()}catch(e){l(e.message)}finally{s(void 0)}},[t]),d=e?.paused??t.data?.paused??!1,f=e?.discord.connected??!1,p=e?.discord.connecting??!1,m=e?.discord.orchestratorConnected??!1,h=e?.discord.retrying??!1,g=e?.discord.retryAttempt??0,_=e?.discord.nextRetryAt,v=g>0?` after ${g} failed attempt${g===1?``:`s`}`:``,y=_?`; next retry at ${lt(_)}`:``;return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`div`,{className:`view-header`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`h2`,{className:`view-title`,children:`Dashboard`}),(0,F.jsx)(`p`,{className:`view-subtitle`,children:`Runtime, Discord, providers, and live activity.`})]}),(0,F.jsxs)(`div`,{className:`view-actions`,children:[d?(0,F.jsxs)(`button`,{className:`btn primary`,onClick:()=>u(`resume`),disabled:o!==void 0,children:[(0,F.jsx)(Ae,{className:`icon`}),` Resume`]}):(0,F.jsxs)(`button`,{className:`btn`,onClick:()=>u(`pause`),disabled:o!==void 0,children:[(0,F.jsx)(Oe,{className:`icon`}),` Pause`]}),(0,F.jsxs)(`button`,{className:`btn`,onClick:()=>u(`reload`),disabled:o!==void 0,children:[(0,F.jsx)(Me,{className:`icon`}),` Reload`]}),(0,F.jsx)(`button`,{className:`btn`,onClick:()=>{nt.refresh(),t.reload(),n.reload(),r.reload()},children:`Refresh`})]})]}),c&&(0,F.jsx)(`div`,{style:{marginBottom:16},children:(0,F.jsx)(R,{tone:`info`,children:c})}),(0,F.jsxs)(`div`,{className:`stat-row`,children:[(0,F.jsxs)(`div`,{className:`stat`,children:[(0,F.jsx)(`span`,{className:`stat-label`,children:`Status`}),(0,F.jsx)(`span`,{className:`stat-value`,style:{display:`flex`,alignItems:`center`,gap:8},children:e?(0,F.jsx)(F.Fragment,{children:(0,F.jsx)(I,{tone:d?`warn`:`ok`,dot:!0,children:d?`Paused`:`Running`})}):(0,F.jsx)(ot,{width:80})}),(0,F.jsx)(`span`,{className:`stat-foot`,children:t.data?`up ${ut(t.data.startedAt)} · pid ${t.data.pid}`:`—`})]}),(0,F.jsxs)(`div`,{className:`stat`,children:[(0,F.jsx)(`span`,{className:`stat-label`,children:`Discord`}),(0,F.jsx)(`span`,{className:`stat-value`,style:{display:`flex`,alignItems:`center`,gap:8},children:(0,F.jsx)(I,{tone:f?`ok`:p?`info`:`neutral`,dot:!0,children:f?`Connected`:p?`Connecting`:`Offline`})}),(0,F.jsxs)(`span`,{className:`stat-foot`,children:[`orchestrator `,p?`connecting`:m?`online`:`offline`,` ·`,` `,e?.discord.waifuBotCount??0,` waifu bots`]})]}),(0,F.jsxs)(`div`,{className:`stat`,children:[(0,F.jsx)(`span`,{className:`stat-label`,children:`Active queues`}),(0,F.jsx)(`span`,{className:`stat-value`,children:e?.queues.active??0}),(0,F.jsxs)(`span`,{className:`stat-foot`,children:[e?.queues.configuredGuilds??0,` configured guilds`]})]}),(0,F.jsxs)(`div`,{className:`stat`,children:[(0,F.jsx)(`span`,{className:`stat-label`,children:`Providers configured`}),(0,F.jsxs)(`span`,{className:`stat-value`,children:[n.data?n.data.providers.filter(e=>e.credentials.configured).length:`—`,(0,F.jsxs)(`span`,{style:{color:`var(--text-muted)`,fontSize:`var(--fs-sm)`,marginLeft:4},children:[`/ `,n.data?.providers.length??0]})]}),(0,F.jsx)(`span`,{className:`stat-foot`,children:n.data?n.data.providers.filter(e=>e.credentials.configured).map(e=>e.displayName).join(`, `)||`None yet`:`—`})]})]}),e?.discord.warnings&&e.discord.warnings.length>0&&(0,F.jsx)(`div`,{style:{marginBottom:16},children:(0,F.jsxs)(R,{tone:`warn`,title:`Discord runtime warnings`,children:[h&&(0,F.jsxs)(`p`,{style:{marginTop:0},children:[`Auto-retry is active`,v,y,`.`]}),(0,F.jsx)(`ul`,{style:{paddingLeft:18,margin:0},children:e.discord.warnings.map((e,t)=>(0,F.jsx)(`li`,{children:e},t))})]})}),(0,F.jsxs)(`div`,{className:`grid grid-2`,children:[(0,F.jsxs)(`section`,{className:`section`,style:{marginBottom:0},children:[(0,F.jsxs)(`div`,{className:`section-header`,children:[(0,F.jsx)(`h3`,{className:`section-title`,children:`Provider health`}),(0,F.jsx)(`span`,{className:`section-description`,children:n.loading?`Loading…`:`Credential status only — secrets never leave backend.`})]}),n.loading&&(0,F.jsx)(st,{rows:3}),n.error&&(0,F.jsxs)(R,{tone:`err`,children:[`Failed to load providers: `,n.error.message]}),n.data&&(0,F.jsx)(`div`,{className:`table-wrap`,children:(0,F.jsxs)(`table`,{className:`data-table`,children:[(0,F.jsx)(`thead`,{children:(0,F.jsxs)(`tr`,{children:[(0,F.jsx)(`th`,{children:`Provider`}),(0,F.jsx)(`th`,{children:`Status`}),(0,F.jsx)(`th`,{children:`Key hint`}),(0,F.jsx)(`th`,{children:`Models`})]})}),(0,F.jsx)(`tbody`,{children:n.data.providers.map(e=>(0,F.jsxs)(`tr`,{children:[(0,F.jsxs)(`td`,{children:[(0,F.jsx)(`div`,{style:{fontWeight:600},children:e.displayName}),(0,F.jsx)(`div`,{style:{color:`var(--text-muted)`,fontSize:`var(--fs-xs)`},children:e.id})]}),(0,F.jsx)(`td`,{children:e.credentials.configured?(0,F.jsx)(I,{tone:`ok`,dot:!0,children:`Configured`}):(0,F.jsx)(I,{tone:`warn`,dot:!0,children:`No key`})}),(0,F.jsx)(`td`,{children:e.credentials.configured?(0,F.jsx)(`span`,{style:{fontFamily:`var(--font-mono)`},children:e.credentials.keyHint}):`—`}),(0,F.jsx)(`td`,{children:e.models.length})]},e.id))})]})})]}),(0,F.jsxs)(`section`,{className:`section`,style:{marginBottom:0},children:[(0,F.jsxs)(`div`,{className:`section-header`,children:[(0,F.jsx)(`h3`,{className:`section-title`,children:`Configured servers`}),(0,F.jsx)(`span`,{className:`section-description`,children:r.data?`${r.data.servers.length} guild${r.data.servers.length===1?``:`s`}`:``})]}),r.loading&&(0,F.jsx)(st,{rows:3}),r.error&&(0,F.jsxs)(R,{tone:`err`,children:[`Failed to load servers: `,r.error.message]}),r.data&&r.data.servers.length===0&&(0,F.jsx)(z,{title:`No servers configured`,icon:(0,F.jsx)(pe,{className:`icon-lg`}),children:`Add a guild from the Servers page, or run the orchestrator bot in a guild it has been invited to.`}),r.data&&r.data.servers.length>0&&(0,F.jsx)(`div`,{className:`table-wrap`,children:(0,F.jsxs)(`table`,{className:`data-table`,children:[(0,F.jsx)(`thead`,{children:(0,F.jsxs)(`tr`,{children:[(0,F.jsx)(`th`,{children:`Guild`}),(0,F.jsx)(`th`,{children:`Status`}),(0,F.jsx)(`th`,{children:`Channels`})]})}),(0,F.jsx)(`tbody`,{children:r.data.servers.map(e=>{let t=Object.values(e.channels??{}).filter(e=>(e.enabledWaifuIds?.length??0)>0).length,n=Object.keys(e.channels??{}).length;return(0,F.jsxs)(`tr`,{children:[(0,F.jsxs)(`td`,{children:[(0,F.jsx)(`div`,{style:{fontWeight:600},children:e.name||e.guildId}),(0,F.jsx)(`div`,{style:{color:`var(--text-muted)`,fontSize:`var(--fs-xs)`,fontFamily:`var(--font-mono)`},children:e.guildId})]}),(0,F.jsx)(`td`,{children:t>0?(0,F.jsx)(I,{tone:`ok`,dot:!0,children:`Active`}):(0,F.jsx)(I,{tone:`neutral`,dot:!0,children:`Inactive`})}),(0,F.jsxs)(`td`,{children:[t,`/`,n,` active`]})]},e.guildId)})})]})})]})]}),(0,F.jsxs)(`section`,{className:`section`,style:{marginTop:32},children:[(0,F.jsxs)(`div`,{className:`section-header`,children:[(0,F.jsx)(`h3`,{className:`section-title`,children:`Live events`}),(0,F.jsxs)(`span`,{className:`section-description`,children:[`From `,(0,F.jsx)(`code`,{children:`/api/events`}),` (SSE). Last `,i.length,` events.`]})]}),i.length===0?(0,F.jsx)(z,{title:`Waiting for events`,icon:(0,F.jsx)(D,{className:`icon-lg`}),children:`Backend runtime and log events will appear here.`}):(0,F.jsx)(`div`,{className:`log-list`,children:i.map(e=>(0,F.jsxs)(`div`,{className:`log-line`,children:[(0,F.jsx)(`span`,{className:`ts`,children:lt(e.time)}),(0,F.jsx)(`span`,{className:`lvl `+_t(e.type),children:e.type}),(0,F.jsx)(`span`,{className:`src`,children:`stream`}),(0,F.jsx)(`span`,{className:`msg`,children:e.message})]},e.id))})]}),(0,F.jsxs)(`section`,{className:`section`,style:{marginTop:32},children:[(0,F.jsxs)(`div`,{className:`section-header`,children:[(0,F.jsx)(`h3`,{className:`section-title`,children:`Runtime triggers`}),(0,F.jsx)(`span`,{className:`section-description`,children:`Manual control surfaces (advanced).`})]}),(0,F.jsxs)(`div`,{className:`row`,children:[(0,F.jsxs)(`button`,{className:`btn`,onClick:async()=>{try{l((await P.triggerOrchestrator()).message)}catch(e){l(e.message)}},children:[(0,F.jsx)(pe,{className:`icon`}),` Trigger orchestrator`]}),(0,F.jsxs)(`button`,{className:`btn`,onClick:async()=>{try{l((await P.triggerStageManager()).message)}catch(e){l(e.message)}},children:[(0,F.jsx)(we,{className:`icon`}),` Trigger stage manager`]})]})]}),t.data&&(0,F.jsxs)(`section`,{className:`section`,style:{marginTop:32},children:[(0,F.jsxs)(`div`,{className:`section-header`,children:[(0,F.jsx)(`h3`,{className:`section-title`,children:`Runtime details`}),(0,F.jsxs)(`span`,{className:`section-description`,children:[`updated `,ct(t.data.updatedAt)]})]}),(0,F.jsxs)(`div`,{className:`kv`,children:[(0,F.jsx)(`span`,{className:`k`,children:`Package version`}),(0,F.jsx)(`span`,{className:`v`,children:t.data.packageVersion}),(0,F.jsx)(`span`,{className:`k`,children:`Mode`}),(0,F.jsx)(`span`,{className:`v`,children:t.data.mode}),(0,F.jsx)(`span`,{className:`k`,children:`HTTP`}),(0,F.jsx)(`span`,{className:`v`,children:`http://127.0.0.1:${t.data.port}`}),(0,F.jsx)(`span`,{className:`k`,children:`Data root`}),(0,F.jsx)(`span`,{className:`v`,style:{fontFamily:`var(--font-mono)`,fontSize:`var(--fs-xs)`},children:t.data.dataRoot}),(0,F.jsx)(`span`,{className:`k`,children:`Started`}),(0,F.jsx)(`span`,{className:`v`,children:new Date(t.data.startedAt).toLocaleString()}),(0,F.jsx)(`span`,{className:`k`,children:`Discord`}),(0,F.jsx)(`span`,{className:`v`,children:t.data.discord.connected?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(le,{className:`icon`,style:{width:14,height:14,color:`var(--ok)`,verticalAlign:`-2px`}}),` connected`]}):t.data.discord.connecting?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(Me,{className:`icon`,style:{width:14,height:14,color:`var(--info)`,verticalAlign:`-2px`}}),` connecting`]}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(A,{className:`icon`,style:{width:14,height:14,color:`var(--text-muted)`,verticalAlign:`-2px`}}),` offline`]})}),t.data.discord.warnings.length>0&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`span`,{className:`k`,children:`Warnings`}),(0,F.jsxs)(`span`,{className:`v`,children:[(0,F.jsx)(He,{className:`icon`,style:{width:14,height:14,color:`var(--warn)`,verticalAlign:`-2px`}}),` `,t.data.discord.warnings.join(`; `)]})]})]})]})]})}function gt(e){try{let t=JSON.parse(e);return`${t?.paused?`paused`:`running`} · ${t?.discord?.connected?`discord-online`:`discord-offline`} · ${t?.queues?.active??0} active queues`}catch{return e.slice(0,200)}}function _t(e){return e===`error`?`err`:e===`warn`?`warn`:e===`runtime`?`ok`:`info`}var B={ADMINISTRATOR:8,VIEW_CHANNEL:1024,SEND_MESSAGES:2048,READ_MESSAGE_HISTORY:65536,ADD_REACTIONS:64,USE_EXTERNAL_EMOJIS:262144,EMBED_LINKS:16384,ATTACH_FILES:32768,USE_APPLICATION_COMMANDS:2147483648};function vt(e){return e===`orchestrator`?Number(BigInt(B.ADMINISTRATOR)|BigInt(B.USE_APPLICATION_COMMANDS)):B.VIEW_CHANNEL|B.SEND_MESSAGES|B.READ_MESSAGE_HISTORY|B.ADD_REACTIONS|B.USE_EXTERNAL_EMOJIS|B.EMBED_LINKS|B.ATTACH_FILES}function yt(e){return e===`orchestrator`?[`Administrator`,`Use Application Commands (slash)`]:[`View Channel`,`Send Messages`,`Read Message History`,`Add Reactions`,`Use External Emojis`,`Embed Links`,`Attach Files`]}function bt(e){return[{name:`GUILDS`,privileged:!1,required:!0},{name:`GUILD_MESSAGES`,privileged:!1,required:!0},{name:`GUILD_MESSAGE_REACTIONS`,privileged:!1,required:!0},{name:`MESSAGE_CONTENT`,privileged:!0,required:!0,note:`Without this, the bot receives empty message content except for DMs, mentions, and message-context targets.`},{name:`GUILD_MEMBERS`,privileged:!0,required:!1,note:`Only required if you want full member list refreshes for mention resolution. Member cache also works opportunistically from recent messages.`}]}function xt(e,t,n){let r=new URLSearchParams;return r.set(`client_id`,e),r.set(`scope`,t===`orchestrator`?`bot applications.commands`:`bot`),r.set(`permissions`,String(vt(t))),n&&(r.set(`guild_id`,n),r.set(`disable_guild_select`,`true`)),`https://discord.com/oauth2/authorize?${r.toString()}`}function St(e){return/^\d{17,20}$/.test(e.trim())}function Ct({kind:e,applicationId:t,guildId:n,collapsedByDefault:r=!0,botDisplayName:i}){let[a,o]=(0,C.useState)(!r),s=bt(e),c=yt(e),l=(0,C.useMemo)(()=>{if(!(!t||!St(t)))return xt(t,e,n)},[t,e,n]),u=e===`orchestrator`?`orchestrator`:`waifu`,d=i?`"${i}"`:`this ${u} bot`;return(0,F.jsxs)(`div`,{className:`panel`,style:{marginTop:8},children:[(0,F.jsxs)(`button`,{className:`btn ghost`,onClick:()=>o(e=>!e),style:{width:`100%`,justifyContent:`space-between`,height:36,padding:`0 4px`},"aria-expanded":a,children:[(0,F.jsxs)(`span`,{style:{display:`inline-flex`,alignItems:`center`,gap:8},children:[a?(0,F.jsx)(se,{className:`icon`}):(0,F.jsx)(O,{className:`icon`}),(0,F.jsx)(Se,{className:`icon`,style:{color:`var(--info)`}}),(0,F.jsxs)(`strong`,{style:{fontWeight:600},children:[`How to set up the `,u,` bot in Discord`]})]}),(0,F.jsx)(I,{tone:`info`,children:`portal walkthrough`})]}),a&&(0,F.jsxs)(`div`,{style:{marginTop:12,display:`flex`,flexDirection:`column`,gap:12},children:[(0,F.jsx)(wt,{num:1,title:`Create a Discord application`,body:(0,F.jsxs)(F.Fragment,{children:[`Open the`,` `,(0,F.jsxs)(`a`,{href:`https://discord.com/developers/applications`,target:`_blank`,rel:`noreferrer`,children:[`Discord Developer Portal `,(0,F.jsx)(ge,{className:`icon`,style:Et})]}),` `,`and click `,(0,F.jsx)(`strong`,{children:`New Application`}),`. Use the name you want to appear in Discord for `,d,` — e.g.`,` `,(0,F.jsx)(`em`,{children:e===`orchestrator`?`Orchestrator`:i||`Aria`}),`.`]})}),(0,F.jsx)(wt,{num:2,title:`Set name, avatar, and (optional) banner`,body:(0,F.jsxs)(F.Fragment,{children:[`On the `,(0,F.jsx)(`strong`,{children:`General Information`}),` page set:`,(0,F.jsxs)(`ul`,{style:Dt,children:[(0,F.jsxs)(`li`,{children:[(0,F.jsx)(`strong`,{children:`NAME`}),` — what Discord shows next to the bot's messages.`]}),(0,F.jsxs)(`li`,{children:[(0,F.jsx)(`strong`,{children:`APP ICON`}),` — square image. Becomes the bot's avatar.`]}),(0,F.jsxs)(`li`,{children:[(0,F.jsx)(`strong`,{children:`DESCRIPTION`}),` — shown on the bot's profile.`]})]}),`Discord stores avatars and banners on its side. Uploading via this UI is reserved for our local cache.`]})}),(0,F.jsx)(wt,{num:3,title:`Copy the Application ID`,body:(0,F.jsxs)(F.Fragment,{children:[`Still on `,(0,F.jsx)(`strong`,{children:`General Information`}),`, click`,` `,(0,F.jsx)(`strong`,{children:`Copy`}),` under `,(0,F.jsx)(`code`,{children:`APPLICATION ID`}),` and paste it into the`,` `,(0,F.jsx)(`em`,{children:`Application ID`}),` field `,e===`orchestrator`?`on the Orchestrator page`:`on this waifu`,`. It's a 17–20 digit number used to build the invite URL and to register slash commands.`,t&&!St(t)&&(0,F.jsx)(`div`,{style:{marginTop:6},children:(0,F.jsxs)(R,{tone:`warn`,children:[`The current value `,(0,F.jsx)(`code`,{children:t}),` doesn't look like a valid Discord application ID (expect 17–20 digits).`]})})]})}),(0,F.jsx)(wt,{num:4,title:`Reset and copy the bot token`,body:(0,F.jsxs)(F.Fragment,{children:[`Open the `,(0,F.jsx)(`strong`,{children:`Bot`}),` tab → click `,(0,F.jsx)(`strong`,{children:`Reset Token`}),` →`,` `,(0,F.jsx)(`strong`,{children:`Yes, do it!`}),` → `,(0,F.jsx)(`strong`,{children:`Copy`}),`. Paste that token into the`,` `,(0,F.jsx)(`em`,{children:`Bot token`}),` field below.`,(0,F.jsx)(`div`,{style:{marginTop:6},children:(0,F.jsxs)(R,{tone:`warn`,children:[(0,F.jsx)(Ie,{className:`icon`,style:Et}),` The token is shown`,` `,(0,F.jsx)(`strong`,{children:`once`}),`. Treat it like a password — anyone with it can act as the bot. Our backend redacts it from logs and never returns it via the API.`]})})]})}),(0,F.jsx)(wt,{num:5,title:`Enable Privileged Gateway Intents`,body:(0,F.jsxs)(F.Fragment,{children:[`On the `,(0,F.jsx)(`strong`,{children:`Bot`}),` tab, scroll to`,` `,(0,F.jsx)(`strong`,{children:`Privileged Gateway Intents`}),` and toggle:`,(0,F.jsx)(`ul`,{style:Dt,children:s.map(e=>(0,F.jsxs)(`li`,{children:[(0,F.jsx)(`code`,{children:e.name}),` `,e.privileged&&(0,F.jsx)(I,{tone:`warn`,children:`privileged`}),` `,e.required?(0,F.jsx)(I,{tone:`ok`,children:`required`}):(0,F.jsx)(I,{tone:`neutral`,children:`optional`}),e.note&&(0,F.jsx)(`div`,{style:{color:`var(--text-muted)`,fontSize:`var(--fs-xs)`},children:e.note})]},e.name))}),`Leave `,(0,F.jsx)(`code`,{children:`PRESENCE INTENT`}),` off — we don't use it.`,` `,(0,F.jsxs)(`a`,{href:`https://docs.discord.com/developers/events/gateway#privileged-intents`,target:`_blank`,rel:`noreferrer`,children:[`Discord intent docs `,(0,F.jsx)(ge,{className:`icon`,style:Et})]})]})}),(0,F.jsx)(wt,{num:6,title:`Set bot-tab toggles`,body:(0,F.jsxs)(F.Fragment,{children:[`Still on the `,(0,F.jsx)(`strong`,{children:`Bot`}),` tab:`,(0,F.jsxs)(`ul`,{style:Dt,children:[(0,F.jsxs)(`li`,{children:[(0,F.jsx)(`strong`,{children:`PUBLIC BOT`}),` — turn `,(0,F.jsx)(`em`,{children:`off`}),` if you don't want anyone else inviting your bot.`]}),(0,F.jsxs)(`li`,{children:[(0,F.jsx)(`strong`,{children:`REQUIRES OAUTH2 CODE GRANT`}),` — leave `,(0,F.jsx)(`em`,{children:`off`}),`.`]}),e===`orchestrator`&&(0,F.jsxs)(`li`,{children:[(0,F.jsx)(`strong`,{children:`SERVER MEMBERS INTENT`}),` only matters if you also want full member fetches; otherwise the orchestrator falls back to opportunistic caching.`]})]})]})}),(0,F.jsx)(wt,{num:7,title:`Generate an invite link and add the bot to a server`,body:(0,F.jsxs)(F.Fragment,{children:[`Either use the link below (already filled in with the right scopes and permissions) or build one yourself via`,` `,(0,F.jsx)(`strong`,{children:`OAuth2 → URL Generator`}),`:`,(0,F.jsxs)(`ul`,{style:Dt,children:[(0,F.jsxs)(`li`,{children:[(0,F.jsx)(`strong`,{children:`SCOPES:`}),` `,(0,F.jsx)(`code`,{children:`bot`}),e===`orchestrator`&&(0,F.jsxs)(F.Fragment,{children:[` `,`+ `,(0,F.jsx)(`code`,{children:`applications.commands`})]})]}),(0,F.jsxs)(`li`,{children:[(0,F.jsx)(`strong`,{children:`BOT PERMISSIONS:`}),(0,F.jsx)(`ul`,{style:Dt,children:c.map(e=>(0,F.jsx)(`li`,{children:e},e))})]})]}),`Open the generated URL, pick the server, click `,(0,F.jsx)(`strong`,{children:`Authorize`}),`. You need`,(0,F.jsx)(`em`,{children:` Manage Server`}),` on the target guild.`,(0,F.jsx)(Tt,{url:l,applicationId:t,guildId:n,kind:e}),(0,F.jsxs)(`div`,{style:{marginTop:6},children:[(0,F.jsxs)(`a`,{href:`https://docs.discord.com/developers/topics/oauth2#bot-authorization-flow`,target:`_blank`,rel:`noreferrer`,children:[`OAuth2 bot-authorization docs `,(0,F.jsx)(ge,{className:`icon`,style:Et})]}),` `,`·`,` `,(0,F.jsxs)(`a`,{href:`https://docs.discord.com/developers/topics/permissions`,target:`_blank`,rel:`noreferrer`,children:[`Permission reference `,(0,F.jsx)(ge,{className:`icon`,style:Et})]})]})]})}),(0,F.jsx)(wt,{num:8,title:`Verify in Discord`,body:(0,F.jsxs)(F.Fragment,{children:[`In the target server, give the bot's role access to the channel(s) you want it to operate in (right-click the channel → `,(0,F.jsx)(`strong`,{children:`Edit Channel → Permissions`}),` `,`or via a role). Confirm`,` `,(0,F.jsx)(`em`,{children:`View Channel, Send Messages, Read Message History, Add Reactions`}),` are allowed. Then come back here and choose at least one waifu for that channel on the`,` `,(0,F.jsx)(`strong`,{children:`Servers`}),` page.`]})})]})]})}function wt({num:e,title:t,body:n}){return(0,F.jsxs)(`div`,{className:`step`,children:[(0,F.jsx)(`span`,{className:`num`,children:e}),(0,F.jsxs)(`div`,{className:`body`,children:[(0,F.jsx)(`div`,{className:`step-title`,children:t}),(0,F.jsx)(`div`,{className:`step-desc`,style:{color:`var(--text-secondary)`},children:n})]})]})}function Tt({url:e,applicationId:t,guildId:n,kind:r}){let[i,a]=(0,C.useState)(!1);return t?e?(0,F.jsxs)(`div`,{className:`row`,style:{marginTop:8,gap:8},children:[(0,F.jsx)(`input`,{className:`input code`,readOnly:!0,value:e,style:{flex:1,minWidth:0}}),(0,F.jsxs)(`button`,{className:`btn`,onClick:async()=>{try{await navigator.clipboard.writeText(e),a(!0),setTimeout(()=>a(!1),1500)}catch{}},children:[i?(0,F.jsx)(oe,{className:`icon`}):(0,F.jsx)(me,{className:`icon`}),i?`Copied`:`Copy URL`]}),(0,F.jsxs)(`a`,{className:`btn primary`,href:e,target:`_blank`,rel:`noreferrer`,children:[`Open invite `,(0,F.jsx)(ge,{className:`icon`})]}),n&&(0,F.jsxs)(I,{tone:`info`,children:[`targets guild `,(0,F.jsx)(`code`,{children:n})]}),r===`orchestrator`&&(0,F.jsx)(I,{tone:`info`,children:`includes slash commands`})]}):(0,F.jsx)(R,{tone:`warn`,children:`That Application ID doesn't look valid yet — Discord IDs are 17–20 digits.`}):(0,F.jsx)(R,{tone:`info`,children:`Paste the Application ID above and an invite link will be generated here automatically.`})}var Et={width:12,height:12,verticalAlign:`-2px`},Dt={margin:`4px 0 4px 18px`,padding:0};function Ot({onNavigate:e}){let t=L(e=>P.runtime(e),[]),n=L(e=>P.providers(e),[]),r=L(e=>P.waifus(e),[]),i=L(e=>P.servers(e),[]),a=L(e=>P.discordBots(e),[]),[o,s]=(0,C.useState)(!1),c=t.data?.dataRoot,l=!!c,u=t.data?.discord.orchestratorConnected??!1,d=n.data?.providers.some(e=>e.credentials.configured)??!1,f=(r.data?.waifus.length??0)>0,p=(0,C.useMemo)(()=>(i.data?.servers??[]).some(e=>Object.values(e.channels??{}).some(e=>(e.enabledWaifuIds?.length??0)>0)),[i.data]),m=[{key:`data`,title:`Data directory`,desc:c?`Backend reports ${c}.`:`Data directory not detected yet.`,done:l,action:()=>e(`settings`),actionLabel:`View settings`},{key:`orchestrator`,title:`Orchestrator bot`,desc:u?`Orchestrator bot is connected to Discord.`:a.data?.orchestrator?.tokenConfigured?`Token is saved but the runtime hasn't connected yet. Verify the token and intents.`:`Create a Discord application in the Developer Portal, copy its Application ID and bot token into Orchestrator, then invite the bot to your server.`,done:u,action:()=>e(`orchestrator`),actionLabel:`Configure bot`},{key:`intent`,title:`Message Content Intent`,desc:`Enable MESSAGE_CONTENT in the Discord Developer Portal for both orchestrator and waifu bots.`,done:o,action:()=>s(!0),actionLabel:o?`Acknowledged`:`Mark as enabled`},{key:`providers`,title:`Provider API key`,desc:d?`At least one provider has credentials configured.`:`Add at least one provider API key (x.ai, DeepSeek, Anthropic, OpenAI, Z.AI).`,done:d,action:()=>e(`providers`),actionLabel:`Open providers`},{key:`waifu`,title:`First waifu`,desc:f?`Waifus exist - pick a model, persona, and link each one to its Discord bot in Waifus.`:`Create your first waifu. Each waifu posts as its own Discord application — register it the same way as the orchestrator (separate token + intents).`,done:f,action:()=>e(`waifus`),actionLabel:`Open waifus`},{key:`server`,title:`Server / channel enablement`,desc:p?`At least one channel has a waifu selected.`:`Invite the orchestrator and waifu bots to your Discord server, then choose which waifus are allowed in each channel.`,done:p,action:()=>e(`servers`),actionLabel:`Open servers`}],h=m.filter(e=>e.done).length;return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`div`,{className:`view-header`,children:(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`h2`,{className:`view-title`,children:`Setup`}),(0,F.jsxs)(`p`,{className:`view-subtitle`,children:[h,` of `,m.length,` steps complete.`]})]})}),(0,F.jsxs)(R,{tone:`warn`,title:`Message Content Intent is required`,children:[`Discord's `,(0,F.jsx)(`code`,{children:`MESSAGE_CONTENT`}),` intent is privileged. Without it, waifu bots receive empty channel context except for DMs, mentions, and message-context targets. Enable it in the Discord Developer Portal under `,(0,F.jsx)(`em`,{children:`Bot → Privileged Gateway Intents`}),` for every bot (orchestrator + each waifu).`]}),(0,F.jsxs)(`section`,{className:`section`,style:{marginTop:16},children:[(0,F.jsxs)(`div`,{className:`section-header`,children:[(0,F.jsx)(`h3`,{className:`section-title`,children:`Discord setup walkthrough`}),(0,F.jsx)(`span`,{className:`section-description`,children:`Same steps apply to the orchestrator and each waifu bot — they're separate Discord applications.`})]}),(0,F.jsx)(Ct,{kind:`orchestrator`,applicationId:a.data?.orchestrator?.applicationId,botDisplayName:a.data?.orchestrator?.displayName??`Orchestrator`,collapsedByDefault:!!a.data?.orchestrator?.tokenConfigured}),(a.data?.waifus?.length??0)>0&&(0,F.jsx)(`div`,{style:{marginTop:12},children:(0,F.jsxs)(R,{tone:`info`,children:[`Repeat the same steps for every waifu bot in the `,(0,F.jsx)(`strong`,{children:`Waifus`}),` editor. Each waifu can have its own avatar, banner, and Discord display name.`]})})]}),(0,F.jsx)(`div`,{className:`stepper`,style:{marginTop:16},children:m.map((e,t)=>(0,F.jsxs)(`div`,{className:`step`+(e.done?` complete`:``),children:[(0,F.jsx)(`span`,{className:`num`,children:e.done?(0,F.jsx)(le,{className:`icon`,style:{color:`var(--ok)`}}):(0,F.jsx)(de,{className:`icon`})}),(0,F.jsxs)(`div`,{className:`body`,children:[(0,F.jsxs)(`div`,{className:`head`,children:[(0,F.jsxs)(`span`,{className:`step-title`,children:[t+1,`. `,e.title]}),e.done?(0,F.jsx)(I,{tone:`ok`,dot:!0,children:`Done`}):(0,F.jsx)(I,{tone:`warn`,dot:!0,children:`Pending`})]}),(0,F.jsx)(`div`,{className:`step-desc`,children:e.desc}),(0,F.jsx)(`div`,{children:(0,F.jsxs)(`button`,{className:`btn sm`,onClick:e.action,children:[e.actionLabel,(0,F.jsx)(re,{className:`icon`})]})})]})]},e.key))}),(0,F.jsxs)(`section`,{className:`section`,style:{marginTop:32},children:[(0,F.jsxs)(`div`,{className:`section-header`,children:[(0,F.jsx)(`h3`,{className:`section-title`,children:`Required intents and permissions`}),(0,F.jsx)(`span`,{className:`section-description`,children:`From Discord developer docs.`})]}),(0,F.jsxs)(`div`,{className:`kv`,children:[(0,F.jsx)(`span`,{className:`k`,children:`Gateway intents`}),(0,F.jsx)(`span`,{className:`v`,children:`GUILDS · GUILD_MESSAGES · GUILD_MESSAGE_REACTIONS · MESSAGE_CONTENT (privileged) · GUILD_MEMBERS (optional, privileged)`}),(0,F.jsx)(`span`,{className:`k`,children:`Bot permissions`}),(0,F.jsx)(`span`,{className:`v`,children:`Orchestrator: ADMINISTRATOR · Waifus: VIEW_CHANNEL · SEND_MESSAGES · READ_MESSAGE_HISTORY · ADD_REACTIONS`}),(0,F.jsx)(`span`,{className:`k`,children:`Application commands`}),(0,F.jsx)(`span`,{className:`v`,children:`Slash commands for setup, enable channel, pause/resume, trigger.`})]})]}),(0,F.jsxs)(`section`,{className:`section`,children:[(0,F.jsxs)(`div`,{className:`section-header`,children:[(0,F.jsx)(`h3`,{className:`section-title`,children:`Runtime snapshot`}),(0,F.jsx)(`span`,{className:`section-description`,children:`Live values from the backend.`})]}),t.loading&&(0,F.jsx)(ot,{height:60}),t.data&&(0,F.jsxs)(`div`,{className:`kv`,children:[(0,F.jsx)(`span`,{className:`k`,children:`Data root`}),(0,F.jsx)(`span`,{className:`v`,style:{fontFamily:`var(--font-mono)`,fontSize:`var(--fs-xs)`},children:t.data.dataRoot}),(0,F.jsx)(`span`,{className:`k`,children:`HTTP port`}),(0,F.jsx)(`span`,{className:`v`,children:t.data.port}),(0,F.jsx)(`span`,{className:`k`,children:`Discord`}),(0,F.jsxs)(`span`,{className:`v`,children:[t.data.discord.connected?`connected`:t.data.discord.connecting?`connecting`:`offline`,` · orchestrator`,` `,t.data.discord.connecting?`connecting`:t.data.discord.orchestratorConnected?`online`:`offline`,` ·`,` `,t.data.discord.waifuBotCount,` waifu bots`]}),t.data.discord.warnings.length>0&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`span`,{className:`k`,children:`Warnings`}),(0,F.jsxs)(`span`,{className:`v`,style:{color:`var(--warn)`},children:[(0,F.jsx)(He,{className:`icon`,style:{width:12,height:12,verticalAlign:`-2px`,marginRight:4}}),t.data.discord.warnings.join(`; `)]})]})]})]})]})}function kt({open:e,onClose:t,title:n,children:r,footer:i,wide:a}){return(0,C.useEffect)(()=>{if(!e)return;let n=e=>{e.key===`Escape`&&t()};return window.addEventListener(`keydown`,n),()=>window.removeEventListener(`keydown`,n)},[e,t]),e?(0,F.jsx)(`div`,{className:`modal-backdrop`,onClick:t,children:(0,F.jsxs)(`div`,{className:`modal`+(a?` wide`:``),onClick:e=>e.stopPropagation(),children:[(0,F.jsxs)(`div`,{className:`modal-header`,children:[(0,F.jsx)(`span`,{children:n}),(0,F.jsx)(`button`,{className:`btn ghost sm`,onClick:t,"aria-label":`Close`,children:(0,F.jsx)(We,{className:`icon`})})]}),(0,F.jsx)(`div`,{className:`modal-body`,children:r}),i&&(0,F.jsx)(`div`,{className:`modal-footer`,children:i})]})}):null}function At(){let e=L(e=>P.providers(e),[]),[t,n]=(0,C.useState)(void 0),[r,i]=(0,C.useState)(void 0);return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`div`,{className:`view-header`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`h2`,{className:`view-title`,children:`Providers`}),(0,F.jsx)(`p`,{className:`view-subtitle`,children:`API keys, model catalog, and per-provider capability flags.`})]}),(0,F.jsx)(`div`,{className:`view-actions`,children:(0,F.jsx)(`button`,{className:`btn`,onClick:e.reload,children:`Refresh`})})]}),(0,F.jsxs)(R,{tone:`info`,children:[`Secrets are never returned by the API. Saved keys appear only as a hint such as`,(0,F.jsx)(`code`,{children:` ****abcd`}),`.`]}),e.loading&&(0,F.jsx)(`div`,{style:{marginTop:16},children:(0,F.jsx)(st,{rows:5,height:36})}),e.error&&(0,F.jsxs)(R,{tone:`err`,children:[`Failed to load providers: `,e.error.message]}),e.data&&(0,F.jsx)(`div`,{className:`table-wrap`,style:{marginTop:16},children:e.data.providers.map(e=>(0,F.jsx)(jt,{provider:e,expanded:r===e.id,onToggle:()=>i(r===e.id?void 0:e.id),onEdit:()=>n(e)},e.id))}),(0,F.jsx)(Pt,{provider:t,onClose:()=>n(void 0),onSaved:()=>{n(void 0),e.reload()}})]})}function jt({provider:e,expanded:t,onToggle:n,onEdit:r}){let i=e.credentials.configured?(0,F.jsxs)(I,{tone:`ok`,dot:!0,children:[`Configured · `,e.credentials.keyHint]}):(0,F.jsx)(I,{tone:`warn`,dot:!0,children:`No API key`});return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`div`,{className:`provider-row`,children:[(0,F.jsxs)(`div`,{className:`meta`,children:[(0,F.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,flexWrap:`wrap`},children:[(0,F.jsx)(`span`,{className:`name`,children:e.displayName}),i,(0,F.jsx)(`span`,{className:`tag`,children:e.id})]}),(0,F.jsxs)(`div`,{className:`sub`,children:[e.models.length,` model`,e.models.length===1?``:`s`,` · `,e.baseUrl,e.credentials.configured&&(0,F.jsxs)(F.Fragment,{children:[` · updated `,` `,ct(e.credentials.updatedAt)]})]})]}),(0,F.jsxs)(`div`,{className:`actions`,children:[(0,F.jsxs)(`a`,{className:`btn ghost sm`,href:e.docsUrl,target:`_blank`,rel:`noreferrer`,children:[`Docs `,(0,F.jsx)(ge,{className:`icon`})]}),(0,F.jsxs)(`button`,{className:`btn sm`,onClick:n,children:[(0,F.jsx)(he,{className:`icon`}),t?`Hide models`:`Models`]}),(0,F.jsxs)(`button`,{className:`btn primary sm`,onClick:r,children:[(0,F.jsx)(Ce,{className:`icon`}),e.credentials.configured?`Update key`:`Add key`]})]})]}),t&&(0,F.jsx)(`div`,{style:{padding:`var(--sp-3) var(--sp-4)`,borderBottom:`1px solid var(--border-subtle)`},children:(0,F.jsx)(`div`,{className:`model-grid`,children:e.models.map(e=>(0,F.jsx)(Mt,{model:e},e.modelId))})})]})}function Mt({model:e}){let t=Nt(e);return(0,F.jsxs)(`div`,{className:`model-card`,children:[(0,F.jsxs)(`div`,{className:`row1`,children:[(0,F.jsx)(`h4`,{className:`title`,children:e.displayName}),(0,F.jsx)(`span`,{className:`id`,children:e.modelId})]}),(0,F.jsxs)(`div`,{className:`sub`,style:{color:`var(--text-muted)`,fontSize:`var(--fs-xs)`},children:[e.client,` · endpoint `,e.endpoint]}),(0,F.jsxs)(`div`,{className:`caps`,children:[e.supportsTools&&(0,F.jsx)(I,{tone:`info`,children:`tools`}),e.supportsStructuredOutput&&(0,F.jsx)(I,{tone:`info`,children:`structured`}),e.supportsStreaming&&(0,F.jsx)(I,{tone:`info`,children:`stream`}),e.supportsImageInput&&(0,F.jsx)(I,{tone:`info`,children:`vision`}),t&&(0,F.jsx)(I,{tone:`warn`,children:t})]}),(0,F.jsxs)(`div`,{className:`sub`,style:{fontSize:`var(--fs-xs)`,color:`var(--text-muted)`},children:[`Safe defaults: `,e.safeDefaultRoles.join(`, `)]})]})}function Nt(e){if(e.reasoningControls.length===0)return;if(e.modelId.includes(`multi-agent`))return`agent count`;let t=[];return e.reasoningControls.includes(`reasoning.enabled`)&&t.push(`thinking`),e.reasoningControls.includes(`reasoning.effort`)&&t.push(`effort`),e.reasoningControls.includes(`reasoning.budget_tokens`)&&t.push(`budget`),t.length?t.join(` + `):e.reasoningControls.join(`, `)}function Pt({provider:e,onClose:t,onSaved:n}){let[r,i]=(0,C.useState)(``),[a,o]=(0,C.useState)(``),[s,c]=(0,C.useState)(!1),[l,u]=(0,C.useState)(void 0),d=async()=>{if(e){if(!r.trim()){u(`API key is required.`);return}c(!0),u(void 0);try{await P.putProviderCredentials(e.id,{apiKey:r.trim(),label:a.trim()||void 0}),i(``),o(``),n()}catch(e){u(e.message)}finally{c(!1)}}},f=e!==void 0;return(0,C.useMemo)(()=>{i(``),o(``),u(void 0)},[e?.id]),(0,F.jsx)(kt,{open:f,onClose:()=>{s||t()},title:e?`${e.displayName} credentials`:``,footer:(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`button`,{className:`btn`,onClick:t,disabled:s,children:`Cancel`}),(0,F.jsxs)(`button`,{className:`btn primary`,onClick:d,disabled:s,children:[(0,F.jsx)(Le,{className:`icon`}),s?`Saving…`:`Save key`]})]}),children:e&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`div`,{className:`field`,children:[(0,F.jsxs)(`label`,{className:`field-label`,htmlFor:`api-key`,children:[`API key for `,e.credentialName]}),(0,F.jsx)(`input`,{id:`api-key`,className:`input code`,type:`password`,autoComplete:`off`,autoFocus:!0,value:r,onChange:e=>i(e.target.value),placeholder:e.credentials.configured?`Existing: ${e.credentials.keyHint}`:`sk-...`}),(0,F.jsxs)(`span`,{className:`field-hint`,children:[`Stored under `,(0,F.jsx)(`code`,{children:`~/.dc-waifus/user/providers.json`}),`. Never sent to other providers.`]})]}),(0,F.jsxs)(`div`,{className:`field`,children:[(0,F.jsx)(`label`,{className:`field-label`,htmlFor:`label`,children:`Label (optional)`}),(0,F.jsx)(`input`,{id:`label`,className:`input`,value:a,onChange:e=>o(e.target.value),placeholder:`prod, personal, …`})]}),l&&(0,F.jsx)(R,{tone:`err`,children:l})]})})}function Ft({checked:e,onChange:t,label:n,disabled:r}){return(0,F.jsxs)(`label`,{className:`toggle`,style:r?{opacity:.5,cursor:`not-allowed`}:void 0,children:[(0,F.jsx)(`input`,{type:`checkbox`,checked:e,disabled:r,onChange:e=>t(e.target.checked)}),n&&(0,F.jsx)(`span`,{children:n})]})}function It(e){return e?e.reasoningControls.includes(`reasoning.enabled`)||e.reasoningControls.includes(`reasoning.effort`)||e.reasoningControls.includes(`reasoning.budget_tokens`):!1}function Lt({model:e,value:t,onChange:n}){if(!It(e))return null;let r=new Set(e.reasoningControls),i=r.has(`reasoning.enabled`),a=r.has(`reasoning.effort`),o=r.has(`reasoning.budget_tokens`),s=Bt(e);return(0,F.jsxs)(F.Fragment,{children:[i&&(0,F.jsxs)(`div`,{className:`field`,children:[(0,F.jsx)(`label`,{className:`field-label`,children:`Reasoning`}),(0,F.jsx)(Ft,{checked:!!t.enabled,onChange:e=>n({...t,enabled:e}),label:t.enabled?`Thinking enabled`:`Thinking disabled`}),(0,F.jsx)(`span`,{className:`field-hint`,children:Rt(e)})]}),a&&(0,F.jsxs)(`div`,{className:`field`,children:[(0,F.jsx)(`label`,{className:`field-label`,children:`Reasoning effort`}),(0,F.jsxs)(`select`,{className:`select`,value:t.effort??``,onChange:e=>n({...t,effort:e.target.value||void 0}),children:[(0,F.jsx)(`option`,{value:``,children:`— Provider default —`}),s.map(e=>(0,F.jsx)(`option`,{value:e.value,children:e.label},e.value))]}),(0,F.jsx)(`span`,{className:`field-hint`,children:zt(e)})]}),o&&(0,F.jsxs)(`div`,{className:`field`,children:[(0,F.jsx)(`label`,{className:`field-label`,children:`Thinking budget tokens`}),(0,F.jsx)(`input`,{className:`input`,type:`number`,min:Vt(e),step:256,value:t.budgetTokens??``,onChange:r=>n({...t,budgetTokens:r.target.value===``?void 0:Math.max(Vt(e),Number(r.target.value)||Vt(e))}),placeholder:String(Vt(e)),disabled:i&&!t.enabled}),(0,F.jsx)(`span`,{className:`field-hint`,children:`Anthropic requires at least 1024 and less than max output tokens.`})]})]})}function Rt(e){return e.providerId===`anthropic`?`Turns adaptive/manual thinking on or off for compatible Claude models.`:e.providerId===`deepseek`?`When enabled, DeepSeek ignores temperature and top_p.`:e.providerId===`zai`?`Toggles GLM thinking mode per call.`:e.providerId===`google-ai-studio`?`Off sets thinkingBudget=0 where supported. Flash Lite uses -1 for dynamic thinking when enabled.`:`Toggle the model's thinking / chain-of-thought.`}function zt(e){return e.providerId===`anthropic`?e.modelId===`claude-opus-4-7`?`Opus 4.7 uses adaptive thinking when enabled. Effort guides depth.`:`Adaptive thinking effort. Higher = deeper reasoning.`:e.providerId===`xai`&&e.modelId===`grok-4.3`?`Grok 4.3 accepts none/low/medium/high. Pick low or unset for fast replies.`:e.providerId===`deepseek`?`DeepSeek only honors high and max; low/medium are mapped to high.`:e.providerId===`google-ai-studio`?`Maps to Gemini's thinkingLevel. Low ≈ minimal latency, High ≈ deepest reasoning.`:`Higher effort spends more thinking tokens per call.`}function Bt(e){if(e.providerId===`openai`)return[{value:`none`,label:`None`},{value:`low`,label:`Low`},{value:`medium`,label:`Medium`},{value:`high`,label:`High`},{value:`xhigh`,label:`XHigh`}];if(e.providerId===`xai`&&e.modelId===`grok-4.3`)return[{value:`none`,label:`None`},{value:`low`,label:`Low`},{value:`medium`,label:`Medium`},{value:`high`,label:`High`}];if(e.providerId===`deepseek`)return[{value:`high`,label:`High`},{value:`max`,label:`Max`}];if(e.providerId===`anthropic`){let t=[{value:`low`,label:`Low`},{value:`medium`,label:`Medium`},{value:`high`,label:`High`},{value:`max`,label:`Max`}];return e.modelId===`claude-opus-4-7`&&t.push({value:`xhigh`,label:`XHigh`}),t}return e.providerId===`google-ai-studio`&&e.modelId.startsWith(`gemini-3`)?[{value:`minimal`,label:`Minimal`},{value:`low`,label:`Low`},{value:`medium`,label:`Medium`},{value:`high`,label:`High`}]:[{value:`low`,label:`Low`},{value:`medium`,label:`Medium`},{value:`high`,label:`High`}]}function Vt(e){return e.providerId===`google-ai-studio`?512:1024}var Ht=m();function Ut(){var e=[...arguments];return(0,C.useMemo)(()=>t=>{e.forEach(e=>e(t))},e)}var Wt=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function Gt(e){let t=Object.prototype.toString.call(e);return t===`[object Window]`||t===`[object global]`}function Kt(e){return`nodeType`in e}function qt(e){return e?Gt(e)?e:Kt(e)?e.ownerDocument?.defaultView??window:window:window}function Jt(e){let{Document:t}=qt(e);return e instanceof t}function Yt(e){return Gt(e)?!1:e instanceof qt(e).HTMLElement}function Xt(e){return e instanceof qt(e).SVGElement}function Zt(e){return e?Gt(e)?e.document:Kt(e)?Jt(e)?e:Yt(e)||Xt(e)?e.ownerDocument:document:document:document}var Qt=Wt?C.useLayoutEffect:C.useEffect;function $t(e){let t=(0,C.useRef)(e);return Qt(()=>{t.current=e}),(0,C.useCallback)(function(){var e=[...arguments];return t.current==null?void 0:t.current(...e)},[])}function en(){let e=(0,C.useRef)(null);return[(0,C.useCallback)((t,n)=>{e.current=setInterval(t,n)},[]),(0,C.useCallback)(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[])]}function tn(e,t){t===void 0&&(t=[e]);let n=(0,C.useRef)(e);return Qt(()=>{n.current!==e&&(n.current=e)},t),n}function nn(e,t){let n=(0,C.useRef)();return(0,C.useMemo)(()=>{let t=e(n.current);return n.current=t,t},[...t])}function rn(e){let t=$t(e),n=(0,C.useRef)(null);return[n,(0,C.useCallback)(e=>{e!==n.current&&t?.(e,n.current),n.current=e},[])]}function an(e){let t=(0,C.useRef)();return(0,C.useEffect)(()=>{t.current=e},[e]),t.current}var on={};function sn(e,t){return(0,C.useMemo)(()=>{if(t)return t;let n=on[e]==null?0:on[e]+1;return on[e]=n,e+`-`+n},[e,t])}function cn(e){return function(t){return[...arguments].slice(1).reduce((t,n)=>{let r=Object.entries(n);for(let[n,i]of r){let r=t[n];r!=null&&(t[n]=r+e*i)}return t},{...t})}}var ln=cn(1),un=cn(-1);function dn(e){return`clientX`in e&&`clientY`in e}function fn(e){if(!e)return!1;let{KeyboardEvent:t}=qt(e.target);return t&&e instanceof t}function pn(e){if(!e)return!1;let{TouchEvent:t}=qt(e.target);return t&&e instanceof t}function mn(e){if(pn(e)){if(e.touches&&e.touches.length){let{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){let{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return dn(e)?{x:e.clientX,y:e.clientY}:null}var hn=Object.freeze({Translate:{toString(e){if(!e)return;let{x:t,y:n}=e;return`translate3d(`+(t?Math.round(t):0)+`px, `+(n?Math.round(n):0)+`px, 0)`}},Scale:{toString(e){if(!e)return;let{scaleX:t,scaleY:n}=e;return`scaleX(`+t+`) scaleY(`+n+`)`}},Transform:{toString(e){if(e)return[hn.Translate.toString(e),hn.Scale.toString(e)].join(` `)}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+` `+n+`ms `+r}}}),gn=`a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]`;function _n(e){return e.matches(gn)?e:e.querySelector(gn)}var vn={display:`none`};function yn(e){let{id:t,value:n}=e;return C.createElement(`div`,{id:t,style:vn},n)}function bn(e){let{id:t,announcement:n,ariaLiveType:r=`assertive`}=e;return C.createElement(`div`,{id:t,style:{position:`fixed`,top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:`hidden`,clip:`rect(0 0 0 0)`,clipPath:`inset(100%)`,whiteSpace:`nowrap`},role:`status`,"aria-live":r,"aria-atomic":!0},n)}function xn(){let[e,t]=(0,C.useState)(``);return{announce:(0,C.useCallback)(e=>{e!=null&&t(e)},[]),announcement:e}}var Sn=(0,C.createContext)(null);function Cn(e){let t=(0,C.useContext)(Sn);(0,C.useEffect)(()=>{if(!t)throw Error(`useDndMonitor must be used within a children of <DndContext>`);return t(e)},[e,t])}function wn(){let[e]=(0,C.useState)(()=>new Set),t=(0,C.useCallback)(t=>(e.add(t),()=>e.delete(t)),[e]);return[(0,C.useCallback)(t=>{let{type:n,event:r}=t;e.forEach(e=>e[n]?.call(e,r))},[e]),t]}var Tn={draggable:`
10
+ To pick up a draggable item, press the space bar.
11
+ While dragging, use the arrow keys to move the item.
12
+ Press space again to drop the item in its new position, or press escape to cancel.
13
+ `},En={onDragStart(e){let{active:t}=e;return`Picked up draggable item `+t.id+`.`},onDragOver(e){let{active:t,over:n}=e;return n?`Draggable item `+t.id+` was moved over droppable area `+n.id+`.`:`Draggable item `+t.id+` is no longer over a droppable area.`},onDragEnd(e){let{active:t,over:n}=e;return n?`Draggable item `+t.id+` was dropped over droppable area `+n.id:`Draggable item `+t.id+` was dropped.`},onDragCancel(e){let{active:t}=e;return`Dragging was cancelled. Draggable item `+t.id+` was dropped.`}};function Dn(e){let{announcements:t=En,container:n,hiddenTextDescribedById:r,screenReaderInstructions:i=Tn}=e,{announce:a,announcement:o}=xn(),s=sn(`DndLiveRegion`),[c,l]=(0,C.useState)(!1);if((0,C.useEffect)(()=>{l(!0)},[]),Cn((0,C.useMemo)(()=>({onDragStart(e){let{active:n}=e;a(t.onDragStart({active:n}))},onDragMove(e){let{active:n,over:r}=e;t.onDragMove&&a(t.onDragMove({active:n,over:r}))},onDragOver(e){let{active:n,over:r}=e;a(t.onDragOver({active:n,over:r}))},onDragEnd(e){let{active:n,over:r}=e;a(t.onDragEnd({active:n,over:r}))},onDragCancel(e){let{active:n,over:r}=e;a(t.onDragCancel({active:n,over:r}))}}),[a,t])),!c)return null;let u=C.createElement(C.Fragment,null,C.createElement(yn,{id:r,value:i.draggable}),C.createElement(bn,{id:s,announcement:o}));return n?(0,Ht.createPortal)(u,n):u}var On;(function(e){e.DragStart=`dragStart`,e.DragMove=`dragMove`,e.DragEnd=`dragEnd`,e.DragCancel=`dragCancel`,e.DragOver=`dragOver`,e.RegisterDroppable=`registerDroppable`,e.SetDroppableDisabled=`setDroppableDisabled`,e.UnregisterDroppable=`unregisterDroppable`})(On||={});function kn(){}function An(e,t){return(0,C.useMemo)(()=>({sensor:e,options:t??{}}),[e,t])}function jn(){var e=[...arguments];return(0,C.useMemo)(()=>[...e].filter(e=>e!=null),[...e])}var Mn=Object.freeze({x:0,y:0});function Nn(e,t){return Math.sqrt((e.x-t.x)**2+(e.y-t.y)**2)}function Pn(e,t){let n=mn(e);if(!n)return`0 0`;let r={x:(n.x-t.left)/t.width*100,y:(n.y-t.top)/t.height*100};return r.x+`% `+r.y+`%`}function Fn(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function In(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function Ln(e){let{left:t,top:n,height:r,width:i}=e;return[{x:t,y:n},{x:t+i,y:n},{x:t,y:n+r},{x:t+i,y:n+r}]}function Rn(e,t){if(!e||e.length===0)return null;let[n]=e;return t?n[t]:n}var zn=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,i=Ln(t),a=[];for(let e of r){let{id:t}=e,r=n.get(t);if(r){let n=Ln(r),o=i.reduce((e,t,r)=>e+Nn(n[r],t),0),s=Number((o/4).toFixed(4));a.push({id:t,data:{droppableContainer:e,value:s}})}}return a.sort(Fn)};function Bn(e,t){let n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),i=Math.min(t.left+t.width,e.left+e.width),a=Math.min(t.top+t.height,e.top+e.height),o=i-r,s=a-n;if(r<i&&n<a){let n=t.width*t.height,r=e.width*e.height,i=o*s,a=i/(n+r-i);return Number(a.toFixed(4))}return 0}var Vn=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,i=[];for(let e of r){let{id:r}=e,a=n.get(r);if(a){let n=Bn(a,t);n>0&&i.push({id:r,data:{droppableContainer:e,value:n}})}}return i.sort(In)};function Hn(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function Un(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Mn}function Wn(e){return function(t){return[...arguments].slice(1).reduce((t,n)=>({...t,top:t.top+e*n.y,bottom:t.bottom+e*n.y,left:t.left+e*n.x,right:t.right+e*n.x}),{...t})}}var Gn=Wn(1);function Kn(e){if(e.startsWith(`matrix3d(`)){let t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith(`matrix(`)){let t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function qn(e,t,n){let r=Kn(t);if(!r)return e;let{scaleX:i,scaleY:a,x:o,y:s}=r,c=e.left-o-(1-i)*parseFloat(n),l=e.top-s-(1-a)*parseFloat(n.slice(n.indexOf(` `)+1)),u=i?e.width/i:e.width,d=a?e.height/a:e.height;return{width:u,height:d,top:l,right:c+u,bottom:l+d,left:c}}var Jn={ignoreTransform:!1};function Yn(e,t){t===void 0&&(t=Jn);let n=e.getBoundingClientRect();if(t.ignoreTransform){let{transform:t,transformOrigin:r}=qt(e).getComputedStyle(e);t&&(n=qn(n,t,r))}let{top:r,left:i,width:a,height:o,bottom:s,right:c}=n;return{top:r,left:i,width:a,height:o,bottom:s,right:c}}function Xn(e){return Yn(e,{ignoreTransform:!0})}function Zn(e){let t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function Qn(e,t){return t===void 0&&(t=qt(e).getComputedStyle(e)),t.position===`fixed`}function $n(e,t){t===void 0&&(t=qt(e).getComputedStyle(e));let n=/(auto|scroll|overlay)/;return[`overflow`,`overflowX`,`overflowY`].some(e=>{let r=t[e];return typeof r==`string`?n.test(r):!1})}function er(e,t){let n=[];function r(i){if(t!=null&&n.length>=t||!i)return n;if(Jt(i)&&i.scrollingElement!=null&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!Yt(i)||Xt(i)||n.includes(i))return n;let a=qt(e).getComputedStyle(i);return i!==e&&$n(i,a)&&n.push(i),Qn(i,a)?n:r(i.parentNode)}return e?r(e):n}function tr(e){let[t]=er(e,1);return t??null}function nr(e){return!Wt||!e?null:Gt(e)?e:Kt(e)?Jt(e)||e===Zt(e).scrollingElement?window:Yt(e)?e:null:null}function rr(e){return Gt(e)?e.scrollX:e.scrollLeft}function ir(e){return Gt(e)?e.scrollY:e.scrollTop}function ar(e){return{x:rr(e),y:ir(e)}}var or;(function(e){e[e.Forward=1]=`Forward`,e[e.Backward=-1]=`Backward`})(or||={});function sr(e){return!Wt||!e?!1:e===document.scrollingElement}function cr(e){let t={x:0,y:0},n=sr(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=r.y,isRight:e.scrollLeft>=r.x,maxScroll:r,minScroll:t}}var lr={x:.2,y:.2};function ur(e,t,n,r,i){let{top:a,left:o,right:s,bottom:c}=n;r===void 0&&(r=10),i===void 0&&(i=lr);let{isTop:l,isBottom:u,isLeft:d,isRight:f}=cr(e),p={x:0,y:0},m={x:0,y:0},h={height:t.height*i.y,width:t.width*i.x};return!l&&a<=t.top+h.height?(p.y=or.Backward,m.y=r*Math.abs((t.top+h.height-a)/h.height)):!u&&c>=t.bottom-h.height&&(p.y=or.Forward,m.y=r*Math.abs((t.bottom-h.height-c)/h.height)),!f&&s>=t.right-h.width?(p.x=or.Forward,m.x=r*Math.abs((t.right-h.width-s)/h.width)):!d&&o<=t.left+h.width&&(p.x=or.Backward,m.x=r*Math.abs((t.left+h.width-o)/h.width)),{direction:p,speed:m}}function dr(e){if(e===document.scrollingElement){let{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}let{top:t,left:n,right:r,bottom:i}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:i,width:e.clientWidth,height:e.clientHeight}}function fr(e){return e.reduce((e,t)=>ln(e,ar(t)),Mn)}function pr(e){return e.reduce((e,t)=>e+rr(t),0)}function mr(e){return e.reduce((e,t)=>e+ir(t),0)}function hr(e,t){if(t===void 0&&(t=Yn),!e)return;let{top:n,left:r,bottom:i,right:a}=t(e);tr(e)&&(i<=0||a<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:`center`,inline:`center`})}var gr=[[`x`,[`left`,`right`],pr],[`y`,[`top`,`bottom`],mr]],_r=class{constructor(e,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;let n=er(t),r=fr(n);this.rect={...e},this.width=e.width,this.height=e.height;for(let[e,t,i]of gr)for(let a of t)Object.defineProperty(this,a,{get:()=>{let t=i(n),o=r[e]-t;return this.rect[a]+o},enumerable:!0});Object.defineProperty(this,`rect`,{enumerable:!1})}},vr=class{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(e=>this.target?.removeEventListener(...e))},this.target=e}add(e,t,n){var r;(r=this.target)==null||r.addEventListener(e,t,n),this.listeners.push([e,t,n])}};function yr(e){let{EventTarget:t}=qt(e);return e instanceof t?e:Zt(e)}function br(e,t){let n=Math.abs(e.x),r=Math.abs(e.y);return typeof t==`number`?Math.sqrt(n**2+r**2)>t:`x`in t&&`y`in t?n>t.x&&r>t.y:`x`in t?n>t.x:`y`in t?r>t.y:!1}var xr;(function(e){e.Click=`click`,e.DragStart=`dragstart`,e.Keydown=`keydown`,e.ContextMenu=`contextmenu`,e.Resize=`resize`,e.SelectionChange=`selectionchange`,e.VisibilityChange=`visibilitychange`})(xr||={});function Sr(e){e.preventDefault()}function Cr(e){e.stopPropagation()}var V;(function(e){e.Space=`Space`,e.Down=`ArrowDown`,e.Right=`ArrowRight`,e.Left=`ArrowLeft`,e.Up=`ArrowUp`,e.Esc=`Escape`,e.Enter=`Enter`,e.Tab=`Tab`})(V||={});var wr={start:[V.Space,V.Enter],cancel:[V.Esc],end:[V.Space,V.Enter,V.Tab]},Tr=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case V.Right:return{...n,x:n.x+25};case V.Left:return{...n,x:n.x-25};case V.Down:return{...n,y:n.y+25};case V.Up:return{...n,y:n.y-25}}},Er=class{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;let{event:{target:t}}=e;this.props=e,this.listeners=new vr(Zt(t)),this.windowListeners=new vr(qt(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(xr.Resize,this.handleCancel),this.windowListeners.add(xr.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(xr.Keydown,this.handleKeyDown))}handleStart(){let{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&hr(n),t(Mn)}handleKeyDown(e){if(fn(e)){let{active:t,context:n,options:r}=this.props,{keyboardCodes:i=wr,coordinateGetter:a=Tr,scrollBehavior:o=`smooth`}=r,{code:s}=e;if(i.end.includes(s)){this.handleEnd(e);return}if(i.cancel.includes(s)){this.handleCancel(e);return}let{collisionRect:c}=n.current,l=c?{x:c.left,y:c.top}:Mn;this.referenceCoordinates||=l;let u=a(e,{active:t,context:n.current,currentCoordinates:l});if(u){let t=un(u,l),r={x:0,y:0},{scrollableAncestors:i}=n.current;for(let n of i){let i=e.code,{isTop:a,isRight:s,isLeft:c,isBottom:l,maxScroll:d,minScroll:f}=cr(n),p=dr(n),m={x:Math.min(i===V.Right?p.right-p.width/2:p.right,Math.max(i===V.Right?p.left:p.left+p.width/2,u.x)),y:Math.min(i===V.Down?p.bottom-p.height/2:p.bottom,Math.max(i===V.Down?p.top:p.top+p.height/2,u.y))},h=i===V.Right&&!s||i===V.Left&&!c,g=i===V.Down&&!l||i===V.Up&&!a;if(h&&m.x!==u.x){let e=n.scrollLeft+t.x,a=i===V.Right&&e<=d.x||i===V.Left&&e>=f.x;if(a&&!t.y){n.scrollTo({left:e,behavior:o});return}a?r.x=n.scrollLeft-e:r.x=i===V.Right?n.scrollLeft-d.x:n.scrollLeft-f.x,r.x&&n.scrollBy({left:-r.x,behavior:o});break}else if(g&&m.y!==u.y){let e=n.scrollTop+t.y,a=i===V.Down&&e<=d.y||i===V.Up&&e>=f.y;if(a&&!t.x){n.scrollTo({top:e,behavior:o});return}a?r.y=n.scrollTop-e:r.y=i===V.Down?n.scrollTop-d.y:n.scrollTop-f.y,r.y&&n.scrollBy({top:-r.y,behavior:o});break}}this.handleMove(e,ln(un(u,this.referenceCoordinates),r))}}}handleMove(e,t){let{onMove:n}=this.props;e.preventDefault(),n(t)}handleEnd(e){let{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){let{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}};Er.activators=[{eventName:`onKeyDown`,handler:(e,t,n)=>{let{keyboardCodes:r=wr,onActivation:i}=t,{active:a}=n,{code:o}=e.nativeEvent;if(r.start.includes(o)){let t=a.activatorNode.current;return t&&e.target!==t?!1:(e.preventDefault(),i?.({event:e.nativeEvent}),!0)}return!1}}];function Dr(e){return!!(e&&`distance`in e)}function Or(e){return!!(e&&`delay`in e)}var kr=class{constructor(e,t,n){n===void 0&&(n=yr(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=t;let{event:r}=e,{target:i}=r;this.props=e,this.events=t,this.document=Zt(i),this.documentListeners=new vr(this.document),this.listeners=new vr(n),this.windowListeners=new vr(qt(i)),this.initialCoordinates=mn(r)??Mn,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){let{events:e,props:{options:{activationConstraint:t,bypassActivationConstraint:n}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(xr.Resize,this.handleCancel),this.windowListeners.add(xr.DragStart,Sr),this.windowListeners.add(xr.VisibilityChange,this.handleCancel),this.windowListeners.add(xr.ContextMenu,Sr),this.documentListeners.add(xr.Keydown,this.handleKeydown),t){if(n!=null&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Or(t)){this.timeoutId=setTimeout(this.handleStart,t.delay),this.handlePending(t);return}if(Dr(t)){this.handlePending(t);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,t){let{active:n,onPending:r}=this.props;r(n,e,this.initialCoordinates,t)}handleStart(){let{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(xr.Click,Cr,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(xr.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){let{activated:t,initialCoordinates:n,props:r}=this,{onMove:i,options:{activationConstraint:a}}=r;if(!n)return;let o=mn(e)??Mn,s=un(n,o);if(!t&&a){if(Dr(a)){if(a.tolerance!=null&&br(s,a.tolerance))return this.handleCancel();if(br(s,a.distance))return this.handleStart()}if(Or(a)&&br(s,a.tolerance))return this.handleCancel();this.handlePending(a,s);return}e.cancelable&&e.preventDefault(),i(o)}handleEnd(){let{onAbort:e,onEnd:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleCancel(){let{onAbort:e,onCancel:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleKeydown(e){e.code===V.Esc&&this.handleCancel()}removeTextSelection(){var e;(e=this.document.getSelection())==null||e.removeAllRanges()}},Ar={cancel:{name:`pointercancel`},move:{name:`pointermove`},end:{name:`pointerup`}},jr=class extends kr{constructor(e){let{event:t}=e,n=Zt(t.target);super(e,Ar,n)}};jr.activators=[{eventName:`onPointerDown`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r?.({event:n}),!0)}}];var Mr={move:{name:`mousemove`},end:{name:`mouseup`}},Nr;(function(e){e[e.RightClick=2]=`RightClick`})(Nr||={});var Pr=class extends kr{constructor(e){super(e,Mr,Zt(e.event.target))}};Pr.activators=[{eventName:`onMouseDown`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===Nr.RightClick?!1:(r?.({event:n}),!0)}}];var Fr={cancel:{name:`touchcancel`},move:{name:`touchmove`},end:{name:`touchend`}},Ir=class extends kr{constructor(e){super(e,Fr)}static setup(){return window.addEventListener(Fr.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(Fr.move.name,e)};function e(){}}};Ir.activators=[{eventName:`onTouchStart`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t,{touches:i}=n;return i.length>1?!1:(r?.({event:n}),!0)}}];var Lr;(function(e){e[e.Pointer=0]=`Pointer`,e[e.DraggableRect=1]=`DraggableRect`})(Lr||={});var Rr;(function(e){e[e.TreeOrder=0]=`TreeOrder`,e[e.ReversedTreeOrder=1]=`ReversedTreeOrder`})(Rr||={});function zr(e){let{acceleration:t,activator:n=Lr.Pointer,canScroll:r,draggingRect:i,enabled:a,interval:o=5,order:s=Rr.TreeOrder,pointerCoordinates:c,scrollableAncestors:l,scrollableAncestorRects:u,delta:d,threshold:f}=e,p=Vr({delta:d,disabled:!a}),[m,h]=en(),g=(0,C.useRef)({x:0,y:0}),_=(0,C.useRef)({x:0,y:0}),v=(0,C.useMemo)(()=>{switch(n){case Lr.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case Lr.DraggableRect:return i}},[n,i,c]),y=(0,C.useRef)(null),b=(0,C.useCallback)(()=>{let e=y.current;if(!e)return;let t=g.current.x*_.current.x,n=g.current.y*_.current.y;e.scrollBy(t,n)},[]),x=(0,C.useMemo)(()=>s===Rr.TreeOrder?[...l].reverse():l,[s,l]);(0,C.useEffect)(()=>{if(!a||!l.length||!v){h();return}for(let e of x){if(r?.(e)===!1)continue;let n=u[l.indexOf(e)];if(!n)continue;let{direction:i,speed:a}=ur(e,n,v,t,f);for(let e of[`x`,`y`])p[e][i[e]]||(a[e]=0,i[e]=0);if(a.x>0||a.y>0){h(),y.current=e,m(b,o),g.current=a,_.current=i;return}}g.current={x:0,y:0},_.current={x:0,y:0},h()},[t,b,r,h,a,o,JSON.stringify(v),JSON.stringify(p),m,l,x,u,JSON.stringify(f)])}var Br={x:{[or.Backward]:!1,[or.Forward]:!1},y:{[or.Backward]:!1,[or.Forward]:!1}};function Vr(e){let{delta:t,disabled:n}=e,r=an(t);return nn(e=>{if(n||!r||!e)return Br;let i={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[or.Backward]:e.x[or.Backward]||i.x===-1,[or.Forward]:e.x[or.Forward]||i.x===1},y:{[or.Backward]:e.y[or.Backward]||i.y===-1,[or.Forward]:e.y[or.Forward]||i.y===1}}},[n,t,r])}function Hr(e,t){let n=t==null?void 0:e.get(t),r=n?n.node.current:null;return nn(e=>t==null?null:r??e??null,[r,t])}function Ur(e,t){return(0,C.useMemo)(()=>e.reduce((e,n)=>{let{sensor:r}=n,i=r.activators.map(e=>({eventName:e.eventName,handler:t(e.handler,n)}));return[...e,...i]},[]),[e,t])}var Wr;(function(e){e[e.Always=0]=`Always`,e[e.BeforeDragging=1]=`BeforeDragging`,e[e.WhileDragging=2]=`WhileDragging`})(Wr||={});var Gr;(function(e){e.Optimized=`optimized`})(Gr||={});var Kr=new Map;function qr(e,t){let{dragging:n,dependencies:r,config:i}=t,[a,o]=(0,C.useState)(null),{frequency:s,measure:c,strategy:l}=i,u=(0,C.useRef)(e),d=g(),f=tn(d),p=(0,C.useCallback)(function(e){e===void 0&&(e=[]),!f.current&&o(t=>t===null?e:t.concat(e.filter(e=>!t.includes(e))))},[f]),m=(0,C.useRef)(null),h=nn(t=>{if(d&&!n)return Kr;if(!t||t===Kr||u.current!==e||a!=null){let t=new Map;for(let n of e){if(!n)continue;if(a&&a.length>0&&!a.includes(n.id)&&n.rect.current){t.set(n.id,n.rect.current);continue}let e=n.node.current,r=e?new _r(c(e),e):null;n.rect.current=r,r&&t.set(n.id,r)}return t}return t},[e,a,n,d,c]);return(0,C.useEffect)(()=>{u.current=e},[e]),(0,C.useEffect)(()=>{d||p()},[n,d]),(0,C.useEffect)(()=>{a&&a.length>0&&o(null)},[JSON.stringify(a)]),(0,C.useEffect)(()=>{d||typeof s!=`number`||m.current!==null||(m.current=setTimeout(()=>{p(),m.current=null},s))},[s,d,p,...r]),{droppableRects:h,measureDroppableContainers:p,measuringScheduled:a!=null};function g(){switch(l){case Wr.Always:return!1;case Wr.BeforeDragging:return n;default:return!n}}}function Jr(e,t){return nn(n=>e?n||(typeof t==`function`?t(e):e):null,[t,e])}function Yr(e,t){return Jr(e,t)}function Xr(e){let{callback:t,disabled:n}=e,r=$t(t),i=(0,C.useMemo)(()=>{if(n||typeof window>`u`||window.MutationObserver===void 0)return;let{MutationObserver:e}=window;return new e(r)},[r,n]);return(0,C.useEffect)(()=>()=>i?.disconnect(),[i]),i}function Zr(e){let{callback:t,disabled:n}=e,r=$t(t),i=(0,C.useMemo)(()=>{if(n||typeof window>`u`||window.ResizeObserver===void 0)return;let{ResizeObserver:e}=window;return new e(r)},[n]);return(0,C.useEffect)(()=>()=>i?.disconnect(),[i]),i}function Qr(e){return new _r(Yn(e),e)}function $r(e,t,n){t===void 0&&(t=Qr);let[r,i]=(0,C.useState)(null);function a(){i(r=>{if(!e)return null;if(e.isConnected===!1)return r??n??null;let i=t(e);return JSON.stringify(r)===JSON.stringify(i)?r:i})}let o=Xr({callback(t){if(e)for(let n of t){let{type:t,target:r}=n;if(t===`childList`&&r instanceof HTMLElement&&r.contains(e)){a();break}}}}),s=Zr({callback:a});return Qt(()=>{a(),e?(s?.observe(e),o?.observe(document.body,{childList:!0,subtree:!0})):(s?.disconnect(),o?.disconnect())},[e]),r}function ei(e){return Un(e,Jr(e))}var ti=[];function ni(e){let t=(0,C.useRef)(e),n=nn(n=>e?n&&n!==ti&&e&&t.current&&e.parentNode===t.current.parentNode?n:er(e):ti,[e]);return(0,C.useEffect)(()=>{t.current=e},[e]),n}function ri(e){let[t,n]=(0,C.useState)(null),r=(0,C.useRef)(e),i=(0,C.useCallback)(e=>{let t=nr(e.target);t&&n(e=>e?(e.set(t,ar(t)),new Map(e)):null)},[]);return(0,C.useEffect)(()=>{let t=r.current;if(e!==t){a(t);let o=e.map(e=>{let t=nr(e);return t?(t.addEventListener(`scroll`,i,{passive:!0}),[t,ar(t)]):null}).filter(e=>e!=null);n(o.length?new Map(o):null),r.current=e}return()=>{a(e),a(t)};function a(e){e.forEach(e=>{nr(e)?.removeEventListener(`scroll`,i)})}},[i,e]),(0,C.useMemo)(()=>e.length?t?Array.from(t.values()).reduce((e,t)=>ln(e,t),Mn):fr(e):Mn,[e,t])}function ii(e,t){t===void 0&&(t=[]);let n=(0,C.useRef)(null);return(0,C.useEffect)(()=>{n.current=null},t),(0,C.useEffect)(()=>{let t=e!==Mn;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)},[e]),n.current?un(e,n.current):Mn}function ai(e){(0,C.useEffect)(()=>{if(!Wt)return;let t=e.map(e=>{let{sensor:t}=e;return t.setup==null?void 0:t.setup()});return()=>{for(let e of t)e?.()}},e.map(e=>{let{sensor:t}=e;return t}))}function oi(e,t){return(0,C.useMemo)(()=>e.reduce((e,n)=>{let{eventName:r,handler:i}=n;return e[r]=e=>{i(e,t)},e},{}),[e,t])}function si(e){return(0,C.useMemo)(()=>e?Zn(e):null,[e])}var ci=[];function li(e,t){t===void 0&&(t=Yn);let[n]=e,r=si(n?qt(n):null),[i,a]=(0,C.useState)(ci);function o(){a(()=>e.length?e.map(e=>sr(e)?r:new _r(t(e),e)):ci)}let s=Zr({callback:o});return Qt(()=>{s?.disconnect(),o(),e.forEach(e=>s?.observe(e))},[e]),i}function ui(e){if(!e)return null;if(e.children.length>1)return e;let t=e.children[0];return Yt(t)?t:e}function di(e){let{measure:t}=e,[n,r]=(0,C.useState)(null),i=Zr({callback:(0,C.useCallback)(e=>{for(let{target:n}of e)if(Yt(n)){r(e=>{let r=t(n);return e?{...e,width:r.width,height:r.height}:r});break}},[t])}),[a,o]=rn((0,C.useCallback)(e=>{let n=ui(e);i?.disconnect(),n&&i?.observe(n),r(n?t(n):null)},[t,i]));return(0,C.useMemo)(()=>({nodeRef:a,rect:n,setRef:o}),[n,a,o])}var fi=[{sensor:jr,options:{}},{sensor:Er,options:{}}],pi={current:{}},mi={draggable:{measure:Xn},droppable:{measure:Xn,strategy:Wr.WhileDragging,frequency:Gr.Optimized},dragOverlay:{measure:Yn}},hi=class extends Map{get(e){return e==null?void 0:super.get(e)??void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:t}=e;return!t})}getNodeFor(e){return this.get(e)?.node.current??void 0}},gi={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new hi,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:kn},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:mi,measureDroppableContainers:kn,windowRect:null,measuringScheduled:!1},_i={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:``},dispatch:kn,draggableNodes:new Map,over:null,measureDroppableContainers:kn},vi=(0,C.createContext)(_i),yi=(0,C.createContext)(gi);function bi(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new hi}}}function xi(e,t){switch(t.type){case On.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case On.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case On.DragEnd:case On.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case On.RegisterDroppable:{let{element:n}=t,{id:r}=n,i=new hi(e.droppable.containers);return i.set(r,n),{...e,droppable:{...e.droppable,containers:i}}}case On.SetDroppableDisabled:{let{id:n,key:r,disabled:i}=t,a=e.droppable.containers.get(n);if(!a||r!==a.key)return e;let o=new hi(e.droppable.containers);return o.set(n,{...a,disabled:i}),{...e,droppable:{...e.droppable,containers:o}}}case On.UnregisterDroppable:{let{id:n,key:r}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;let a=new hi(e.droppable.containers);return a.delete(n),{...e,droppable:{...e.droppable,containers:a}}}default:return e}}function Si(e){let{disabled:t}=e,{active:n,activatorEvent:r,draggableNodes:i}=(0,C.useContext)(vi),a=an(r),o=an(n?.id);return(0,C.useEffect)(()=>{if(!t&&!r&&a&&o!=null){if(!fn(a)||document.activeElement===a.target)return;let e=i.get(o);if(!e)return;let{activatorNode:t,node:n}=e;if(!t.current&&!n.current)return;requestAnimationFrame(()=>{for(let e of[t.current,n.current]){if(!e)continue;let t=_n(e);if(t){t.focus();break}}})}},[r,t,i,o,a]),null}function Ci(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((e,t)=>t({transform:e,...r}),n):n}function wi(e){return(0,C.useMemo)(()=>({draggable:{...mi.draggable,...e?.draggable},droppable:{...mi.droppable,...e?.droppable},dragOverlay:{...mi.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function Ti(e){let{activeNode:t,measure:n,initialRect:r,config:i=!0}=e,a=(0,C.useRef)(!1),{x:o,y:s}=typeof i==`boolean`?{x:i,y:i}:i;Qt(()=>{if(!o&&!s||!t){a.current=!1;return}if(a.current||!r)return;let e=t?.node.current;if(!e||e.isConnected===!1)return;let i=Un(n(e),r);if(o||(i.x=0),s||(i.y=0),a.current=!0,Math.abs(i.x)>0||Math.abs(i.y)>0){let t=tr(e);t&&t.scrollBy({top:i.y,left:i.x})}},[t,o,s,r,n])}var Ei=(0,C.createContext)({...Mn,scaleX:1,scaleY:1}),Di;(function(e){e[e.Uninitialized=0]=`Uninitialized`,e[e.Initializing=1]=`Initializing`,e[e.Initialized=2]=`Initialized`})(Di||={});var Oi=(0,C.memo)(function(e){let{id:t,accessibility:n,autoScroll:r=!0,children:i,sensors:a=fi,collisionDetection:o=Vn,measuring:s,modifiers:c,...l}=e,[u,d]=(0,C.useReducer)(xi,void 0,bi),[f,p]=wn(),[m,h]=(0,C.useState)(Di.Uninitialized),g=m===Di.Initialized,{draggable:{active:_,nodes:v,translate:y},droppable:{containers:b}}=u,x=_==null?null:v.get(_),S=(0,C.useRef)({initial:null,translated:null}),w=(0,C.useMemo)(()=>_==null?null:{id:_,data:x?.data??pi,rect:S},[_,x]),T=(0,C.useRef)(null),[ee,E]=(0,C.useState)(null),[D,te]=(0,C.useState)(null),ne=tn(l,Object.values(l)),re=sn(`DndDescribedBy`,t),ie=(0,C.useMemo)(()=>b.getEnabled(),[b]),ae=wi(s),{droppableRects:oe,measureDroppableContainers:se,measuringScheduled:O}=qr(ie,{dragging:g,dependencies:[y.x,y.y],config:ae.droppable}),k=Hr(v,_),ce=(0,C.useMemo)(()=>D?mn(D):null,[D]),le=Le(),ue=Yr(k,ae.draggable.measure);Ti({activeNode:_==null?null:v.get(_),config:le.layoutShiftCompensation,initialRect:ue,measure:ae.draggable.measure});let A=$r(k,ae.draggable.measure,ue),de=$r(k?k.parentElement:null),j=(0,C.useRef)({activatorEvent:null,active:null,activeNode:k,collisionRect:null,collisions:null,droppableRects:oe,draggableNodes:v,draggingNode:null,draggingNodeRect:null,droppableContainers:b,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),fe=b.getNodeFor(j.current.over?.id),M=di({measure:ae.dragOverlay.measure}),pe=M.nodeRef.current??k,me=g?M.rect??A:null,he=!!(M.nodeRef.current&&M.rect),ge=ei(he?null:A),_e=si(pe?qt(pe):null),ve=ni(g?fe??k:null),ye=li(ve),be=Ci(c,{transform:{x:y.x-ge.x,y:y.y-ge.y,scaleX:1,scaleY:1},activatorEvent:D,active:w,activeNodeRect:A,containerNodeRect:de,draggingNodeRect:me,over:j.current.over,overlayNodeRect:M.rect,scrollableAncestors:ve,scrollableAncestorRects:ye,windowRect:_e}),xe=ce?ln(ce,y):null,Se=ri(ve),Ce=ii(Se),we=ii(Se,[A]),Te=ln(be,Ce),Ee=me?Gn(me,be):null,De=w&&Ee?o({active:w,collisionRect:Ee,droppableRects:oe,droppableContainers:ie,pointerCoordinates:xe}):null,Oe=Rn(De,`id`),[ke,Ae]=(0,C.useState)(null),je=Hn(he?be:ln(be,we),ke?.rect??null,A),Me=(0,C.useRef)(null),Ne=(0,C.useCallback)((e,t)=>{let{sensor:n,options:r}=t;if(T.current==null)return;let i=v.get(T.current);if(!i)return;let a=e.nativeEvent;Me.current=new n({active:T.current,activeNode:i,event:a,options:r,context:j,onAbort(e){if(!v.get(e))return;let{onDragAbort:t}=ne.current,n={id:e};t?.(n),f({type:`onDragAbort`,event:n})},onPending(e,t,n,r){if(!v.get(e))return;let{onDragPending:i}=ne.current,a={id:e,constraint:t,initialCoordinates:n,offset:r};i?.(a),f({type:`onDragPending`,event:a})},onStart(e){let t=T.current;if(t==null)return;let n=v.get(t);if(!n)return;let{onDragStart:r}=ne.current,i={activatorEvent:a,active:{id:t,data:n.data,rect:S}};(0,Ht.unstable_batchedUpdates)(()=>{r?.(i),h(Di.Initializing),d({type:On.DragStart,initialCoordinates:e,active:t}),f({type:`onDragStart`,event:i}),E(Me.current),te(a)})},onMove(e){d({type:On.DragMove,coordinates:e})},onEnd:o(On.DragEnd),onCancel:o(On.DragCancel)});function o(e){return async function(){let{active:t,collisions:n,over:r,scrollAdjustedTranslate:i}=j.current,o=null;if(t&&i){let{cancelDrop:s}=ne.current;o={activatorEvent:a,active:t,collisions:n,delta:i,over:r},e===On.DragEnd&&typeof s==`function`&&await Promise.resolve(s(o))&&(e=On.DragCancel)}T.current=null,(0,Ht.unstable_batchedUpdates)(()=>{d({type:e}),h(Di.Uninitialized),Ae(null),E(null),te(null),Me.current=null;let t=e===On.DragEnd?`onDragEnd`:`onDragCancel`;if(o){let e=ne.current[t];e?.(o),f({type:t,event:o})}})}}},[v]),Pe=Ur(a,(0,C.useCallback)((e,t)=>(n,r)=>{let i=n.nativeEvent,a=v.get(r);if(T.current!==null||!a||i.dndKit||i.defaultPrevented)return;let o={active:a};e(n,t.options,o)===!0&&(i.dndKit={capturedBy:t.sensor},T.current=r,Ne(n,t))},[v,Ne]));ai(a),Qt(()=>{A&&m===Di.Initializing&&h(Di.Initialized)},[A,m]),(0,C.useEffect)(()=>{let{onDragMove:e}=ne.current,{active:t,activatorEvent:n,collisions:r,over:i}=j.current;if(!t||!n)return;let a={active:t,activatorEvent:n,collisions:r,delta:{x:Te.x,y:Te.y},over:i};(0,Ht.unstable_batchedUpdates)(()=>{e?.(a),f({type:`onDragMove`,event:a})})},[Te.x,Te.y]),(0,C.useEffect)(()=>{let{active:e,activatorEvent:t,collisions:n,droppableContainers:r,scrollAdjustedTranslate:i}=j.current;if(!e||T.current==null||!t||!i)return;let{onDragOver:a}=ne.current,o=r.get(Oe),s=o&&o.rect.current?{id:o.id,rect:o.rect.current,data:o.data,disabled:o.disabled}:null,c={active:e,activatorEvent:t,collisions:n,delta:{x:i.x,y:i.y},over:s};(0,Ht.unstable_batchedUpdates)(()=>{Ae(s),a?.(c),f({type:`onDragOver`,event:c})})},[Oe]),Qt(()=>{j.current={activatorEvent:D,active:w,activeNode:k,collisionRect:Ee,collisions:De,droppableRects:oe,draggableNodes:v,draggingNode:pe,draggingNodeRect:me,droppableContainers:b,over:ke,scrollableAncestors:ve,scrollAdjustedTranslate:Te},S.current={initial:me,translated:Ee}},[w,k,De,Ee,v,pe,me,oe,b,ke,ve,Te]),zr({...le,delta:y,draggingRect:Ee,pointerCoordinates:xe,scrollableAncestors:ve,scrollableAncestorRects:ye});let Fe=(0,C.useMemo)(()=>({active:w,activeNode:k,activeNodeRect:A,activatorEvent:D,collisions:De,containerNodeRect:de,dragOverlay:M,draggableNodes:v,droppableContainers:b,droppableRects:oe,over:ke,measureDroppableContainers:se,scrollableAncestors:ve,scrollableAncestorRects:ye,measuringConfiguration:ae,measuringScheduled:O,windowRect:_e}),[w,k,A,D,De,de,M,v,b,oe,ke,se,ve,ye,ae,O,_e]),Ie=(0,C.useMemo)(()=>({activatorEvent:D,activators:Pe,active:w,activeNodeRect:A,ariaDescribedById:{draggable:re},dispatch:d,draggableNodes:v,over:ke,measureDroppableContainers:se}),[D,Pe,w,A,d,re,v,ke,se]);return C.createElement(Sn.Provider,{value:p},C.createElement(vi.Provider,{value:Ie},C.createElement(yi.Provider,{value:Fe},C.createElement(Ei.Provider,{value:je},i)),C.createElement(Si,{disabled:n?.restoreFocus===!1})),C.createElement(Dn,{...n,hiddenTextDescribedById:re}));function Le(){let e=ee?.autoScrollEnabled===!1,t=typeof r==`object`?r.enabled===!1:r===!1,n=g&&!e&&!t;return typeof r==`object`?{...r,enabled:n}:{enabled:n}}}),ki=(0,C.createContext)(null),Ai=`button`,H=`Draggable`;function U(e){let{id:t,data:n,disabled:r=!1,attributes:i}=e,a=sn(H),{activators:o,activatorEvent:s,active:c,activeNodeRect:l,ariaDescribedById:u,draggableNodes:d,over:f}=(0,C.useContext)(vi),{role:p=Ai,roleDescription:m=`draggable`,tabIndex:h=0}=i??{},g=c?.id===t,_=(0,C.useContext)(g?Ei:ki),[v,y]=rn(),[b,x]=rn(),S=oi(o,t),w=tn(n);return Qt(()=>(d.set(t,{id:t,key:a,node:v,activatorNode:b,data:w}),()=>{let e=d.get(t);e&&e.key===a&&d.delete(t)}),[d,t]),{active:c,activatorEvent:s,activeNodeRect:l,attributes:(0,C.useMemo)(()=>({role:p,tabIndex:h,"aria-disabled":r,"aria-pressed":g&&p===Ai?!0:void 0,"aria-roledescription":m,"aria-describedby":u.draggable}),[r,p,h,g,m,u.draggable]),isDragging:g,listeners:r?void 0:S,node:v,over:f,setNodeRef:y,setActivatorNodeRef:x,transform:_}}function ji(){return(0,C.useContext)(yi)}var Mi=`Droppable`,Ni={timeout:25};function Pi(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:i}=e,a=sn(Mi),{active:o,dispatch:s,over:c,measureDroppableContainers:l}=(0,C.useContext)(vi),u=(0,C.useRef)({disabled:n}),d=(0,C.useRef)(!1),f=(0,C.useRef)(null),p=(0,C.useRef)(null),{disabled:m,updateMeasurementsFor:h,timeout:g}={...Ni,...i},_=tn(h??r),v=Zr({callback:(0,C.useCallback)(()=>{if(!d.current){d.current=!0;return}p.current!=null&&clearTimeout(p.current),p.current=setTimeout(()=>{l(Array.isArray(_.current)?_.current:[_.current]),p.current=null},g)},[g]),disabled:m||!o}),[y,b]=rn((0,C.useCallback)((e,t)=>{v&&(t&&(v.unobserve(t),d.current=!1),e&&v.observe(e))},[v])),x=tn(t);return(0,C.useEffect)(()=>{!v||!y.current||(v.disconnect(),d.current=!1,v.observe(y.current))},[y,v]),(0,C.useEffect)(()=>(s({type:On.RegisterDroppable,element:{id:r,key:a,disabled:n,node:y,rect:f,data:x}}),()=>s({type:On.UnregisterDroppable,key:a,id:r})),[r]),(0,C.useEffect)(()=>{n!==u.current.disabled&&(s({type:On.SetDroppableDisabled,id:r,key:a,disabled:n}),u.current.disabled=n)},[r,a,n,s]),{active:o,rect:f,isOver:c?.id===r,node:y,over:c,setNodeRef:b}}function Fi(e){let{animation:t,children:n}=e,[r,i]=(0,C.useState)(null),[a,o]=(0,C.useState)(null),s=an(n);return!n&&!r&&s&&i(s),Qt(()=>{if(!a)return;let e=r?.key,n=r?.props.id;if(e==null||n==null){i(null);return}Promise.resolve(t(n,a)).then(()=>{i(null)})},[t,r,a]),C.createElement(C.Fragment,null,n,r?(0,C.cloneElement)(r,{ref:o}):null)}var Ii={x:0,y:0,scaleX:1,scaleY:1};function Li(e){let{children:t}=e;return C.createElement(vi.Provider,{value:_i},C.createElement(Ei.Provider,{value:Ii},t))}var Ri={position:`fixed`,touchAction:`none`},zi=e=>fn(e)?`transform 250ms ease`:void 0,Bi=(0,C.forwardRef)((e,t)=>{let{as:n,activatorEvent:r,adjustScale:i,children:a,className:o,rect:s,style:c,transform:l,transition:u=zi}=e;if(!s)return null;let d=i?l:{...l,scaleX:1,scaleY:1},f={...Ri,width:s.width,height:s.height,top:s.top,left:s.left,transform:hn.Transform.toString(d),transformOrigin:i&&r?Pn(r,s):void 0,transition:typeof u==`function`?u(r):u,...c};return C.createElement(n,{className:o,style:f,ref:t},a)}),Vi={duration:250,easing:`ease`,keyframes:e=>{let{transform:{initial:t,final:n}}=e;return[{transform:hn.Transform.toString(t)},{transform:hn.Transform.toString(n)}]},sideEffects:(e=>t=>{let{active:n,dragOverlay:r}=t,i={},{styles:a,className:o}=e;if(a!=null&&a.active)for(let[e,t]of Object.entries(a.active))t!==void 0&&(i[e]=n.node.style.getPropertyValue(e),n.node.style.setProperty(e,t));if(a!=null&&a.dragOverlay)for(let[e,t]of Object.entries(a.dragOverlay))t!==void 0&&r.node.style.setProperty(e,t);return o!=null&&o.active&&n.node.classList.add(o.active),o!=null&&o.dragOverlay&&r.node.classList.add(o.dragOverlay),function(){for(let[e,t]of Object.entries(i))n.node.style.setProperty(e,t);o!=null&&o.active&&n.node.classList.remove(o.active)}})({styles:{active:{opacity:`0`}}})};function Hi(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:i}=e;return $t((e,a)=>{if(t===null)return;let o=n.get(e);if(!o)return;let s=o.node.current;if(!s)return;let c=ui(a);if(!c)return;let{transform:l}=qt(a).getComputedStyle(a),u=Kn(l);if(!u)return;let d=typeof t==`function`?t:Ui(t);return hr(s,i.draggable.measure),d({active:{id:e,data:o.data,node:s,rect:i.draggable.measure(s)},draggableNodes:n,dragOverlay:{node:a,rect:i.dragOverlay.measure(c)},droppableContainers:r,measuringConfiguration:i,transform:u})})}function Ui(e){let{duration:t,easing:n,sideEffects:r,keyframes:i}={...Vi,...e};return e=>{let{active:a,dragOverlay:o,transform:s,...c}=e;if(!t)return;let l={x:o.rect.left-a.rect.left,y:o.rect.top-a.rect.top},u={scaleX:s.scaleX===1?1:a.rect.width*s.scaleX/o.rect.width,scaleY:s.scaleY===1?1:a.rect.height*s.scaleY/o.rect.height},d={x:s.x-l.x,y:s.y-l.y,...u},f=i({...c,active:a,dragOverlay:o,transform:{initial:s,final:d}}),[p]=f,m=f[f.length-1];if(JSON.stringify(p)===JSON.stringify(m))return;let h=r?.({active:a,dragOverlay:o,...c}),g=o.node.animate(f,{duration:t,easing:n,fill:`forwards`});return new Promise(e=>{g.onfinish=()=>{h?.(),e()}})}}var Wi=0;function Gi(e){return(0,C.useMemo)(()=>{if(e!=null)return Wi++,Wi},[e])}var Ki=C.memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:r,style:i,transition:a,modifiers:o,wrapperElement:s=`div`,className:c,zIndex:l=999}=e,{activatorEvent:u,active:d,activeNodeRect:f,containerNodeRect:p,draggableNodes:m,droppableContainers:h,dragOverlay:g,over:_,measuringConfiguration:v,scrollableAncestors:y,scrollableAncestorRects:b,windowRect:x}=ji(),S=(0,C.useContext)(Ei),w=Gi(d?.id),T=Ci(o,{activatorEvent:u,active:d,activeNodeRect:f,containerNodeRect:p,draggingNodeRect:g.rect,over:_,overlayNodeRect:g.rect,scrollableAncestors:y,scrollableAncestorRects:b,transform:S,windowRect:x}),ee=Jr(f),E=Hi({config:r,draggableNodes:m,droppableContainers:h,measuringConfiguration:v}),D=ee?g.setRef:void 0;return C.createElement(Li,null,C.createElement(Fi,{animation:E},d&&w?C.createElement(Bi,{key:w,id:d.id,ref:D,as:s,activatorEvent:u,adjustScale:t,className:c,transition:a,rect:ee,style:{zIndex:l,...i},transform:T},n):null))});function qi(e,t,n){let r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function Ji(e,t){return e.reduce((e,n,r)=>{let i=t.get(n);return i&&(e[r]=i),e},Array(e.length))}function Yi(e){return e!==null&&e>=0}function Xi(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function Zi(e){return typeof e==`boolean`?{draggable:e,droppable:e}:e}var Qi=e=>{let{rects:t,activeIndex:n,overIndex:r,index:i}=e,a=qi(t,r,n),o=t[i],s=a[i];return!s||!o?null:{x:s.left-o.left,y:s.top-o.top,scaleX:s.width/o.width,scaleY:s.height/o.height}},$i={scaleX:1,scaleY:1},ea=e=>{let{activeIndex:t,activeNodeRect:n,index:r,rects:i,overIndex:a}=e,o=i[t]??n;if(!o)return null;if(r===t){let e=i[a];return e?{x:0,y:t<a?e.top+e.height-(o.top+o.height):e.top-o.top,...$i}:null}let s=ta(i,r,t);return r>t&&r<=a?{x:0,y:-o.height-s,...$i}:r<t&&r>=a?{x:0,y:o.height+s,...$i}:{x:0,y:0,...$i}};function ta(e,t,n){let r=e[t],i=e[t-1],a=e[t+1];return r?n<t?i?r.top-(i.top+i.height):a?a.top-(r.top+r.height):0:a?a.top-(r.top+r.height):i?r.top-(i.top+i.height):0:0}var na=`Sortable`,ra=C.createContext({activeIndex:-1,containerId:na,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Qi,disabled:{draggable:!1,droppable:!1}});function ia(e){let{children:t,id:n,items:r,strategy:i=Qi,disabled:a=!1}=e,{active:o,dragOverlay:s,droppableRects:c,over:l,measureDroppableContainers:u}=ji(),d=sn(na,n),f=s.rect!==null,p=(0,C.useMemo)(()=>r.map(e=>typeof e==`object`&&`id`in e?e.id:e),[r]),m=o!=null,h=o?p.indexOf(o.id):-1,g=l?p.indexOf(l.id):-1,_=(0,C.useRef)(p),v=!Xi(p,_.current),y=g!==-1&&h===-1||v,b=Zi(a);Qt(()=>{v&&m&&u(p)},[v,p,m,u]),(0,C.useEffect)(()=>{_.current=p},[p]);let x=(0,C.useMemo)(()=>({activeIndex:h,containerId:d,disabled:b,disableTransforms:y,items:p,overIndex:g,useDragOverlay:f,sortedRects:Ji(p,c),strategy:i}),[h,d,b.draggable,b.droppable,y,p,g,c,f,i]);return C.createElement(ra.Provider,{value:x},t)}var aa=e=>{let{id:t,items:n,activeIndex:r,overIndex:i}=e;return qi(n,r,i).indexOf(t)},oa=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:i,items:a,newIndex:o,previousItems:s,previousContainerId:c,transition:l}=e;return!l||!r||s!==a&&i===o?!1:n?!0:o!==i&&t===c},sa={duration:200,easing:`ease`},ca=`transform`,la=hn.Transition.toString({property:ca,duration:0,easing:`linear`}),ua={roleDescription:`sortable`};function da(e){let{disabled:t,index:n,node:r,rect:i}=e,[a,o]=(0,C.useState)(null),s=(0,C.useRef)(n);return Qt(()=>{if(!t&&n!==s.current&&r.current){let e=i.current;if(e){let t=Yn(r.current,{ignoreTransform:!0}),n={x:e.left-t.left,y:e.top-t.top,scaleX:e.width/t.width,scaleY:e.height/t.height};(n.x||n.y)&&o(n)}}n!==s.current&&(s.current=n)},[t,n,r,i]),(0,C.useEffect)(()=>{a&&o(null)},[a]),a}function fa(e){let{animateLayoutChanges:t=oa,attributes:n,disabled:r,data:i,getNewIndex:a=aa,id:o,strategy:s,resizeObserverConfig:c,transition:l=sa}=e,{items:u,containerId:d,activeIndex:f,disabled:p,disableTransforms:m,sortedRects:h,overIndex:g,useDragOverlay:_,strategy:v}=(0,C.useContext)(ra),y=pa(r,p),b=u.indexOf(o),x=(0,C.useMemo)(()=>({sortable:{containerId:d,index:b,items:u},...i}),[d,i,b,u]),S=(0,C.useMemo)(()=>u.slice(u.indexOf(o)),[u,o]),{rect:w,node:T,isOver:ee,setNodeRef:E}=Pi({id:o,data:x,disabled:y.droppable,resizeObserverConfig:{updateMeasurementsFor:S,...c}}),{active:D,activatorEvent:te,activeNodeRect:ne,attributes:re,setNodeRef:ie,listeners:ae,isDragging:oe,over:se,setActivatorNodeRef:O,transform:k}=U({id:o,data:x,attributes:{...ua,...n},disabled:y.draggable}),ce=Ut(E,ie),le=!!D,ue=le&&!m&&Yi(f)&&Yi(g),A=!_&&oe,de=ue?(A&&ue?k:null)??(s??v)({rects:h,activeNodeRect:ne,activeIndex:f,overIndex:g,index:b}):null,j=Yi(f)&&Yi(g)?a({id:o,items:u,activeIndex:f,overIndex:g}):b,fe=D?.id,M=(0,C.useRef)({activeId:fe,items:u,newIndex:j,containerId:d}),pe=u!==M.current.items,me=t({active:D,containerId:d,isDragging:oe,isSorting:le,id:o,index:b,items:u,newIndex:M.current.newIndex,previousItems:M.current.items,previousContainerId:M.current.containerId,transition:l,wasDragging:M.current.activeId!=null}),he=da({disabled:!me,index:b,node:T,rect:w});return(0,C.useEffect)(()=>{le&&M.current.newIndex!==j&&(M.current.newIndex=j),d!==M.current.containerId&&(M.current.containerId=d),u!==M.current.items&&(M.current.items=u)},[le,j,d,u]),(0,C.useEffect)(()=>{if(fe===M.current.activeId)return;if(fe!=null&&M.current.activeId==null){M.current.activeId=fe;return}let e=setTimeout(()=>{M.current.activeId=fe},50);return()=>clearTimeout(e)},[fe]),{active:D,activeIndex:f,attributes:re,data:x,rect:w,index:b,newIndex:j,items:u,isOver:ee,isSorting:le,isDragging:oe,listeners:ae,node:T,overIndex:g,over:se,setNodeRef:ce,setActivatorNodeRef:O,setDroppableNodeRef:E,setDraggableNodeRef:ie,transform:he??de,transition:ge()};function ge(){if(he||pe&&M.current.newIndex===b)return la;if(!(A&&!fn(te)||!l)&&(le||me))return hn.Transition.toString({...l,property:ca})}}function pa(e,t){return typeof e==`boolean`?{draggable:e,droppable:!1}:{draggable:e?.draggable??t.draggable,droppable:e?.droppable??t.droppable}}function ma(e){if(!e)return!1;let t=e.data.current;return!!(t&&`sortable`in t&&typeof t.sortable==`object`&&`containerId`in t.sortable&&`items`in t.sortable&&`index`in t.sortable)}var ha=[V.Down,V.Right,V.Up,V.Left],ga=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:i,droppableContainers:a,over:o,scrollableAncestors:s}}=t;if(ha.includes(e.code)){if(e.preventDefault(),!n||!r)return;let t=[];a.getEnabled().forEach(n=>{if(!n||n!=null&&n.disabled)return;let a=i.get(n.id);if(a)switch(e.code){case V.Down:r.top<a.top&&t.push(n);break;case V.Up:r.top>a.top&&t.push(n);break;case V.Left:r.left>a.left&&t.push(n);break;case V.Right:r.left<a.left&&t.push(n);break}});let c=zn({active:n,collisionRect:r,droppableRects:i,droppableContainers:t,pointerCoordinates:null}),l=Rn(c,`id`);if(l===o?.id&&c.length>1&&(l=c[1].id),l!=null){let e=a.get(n.id),t=a.get(l),o=t?i.get(t.id):null,c=t?.node.current;if(c&&o&&e&&t){let n=er(c).some((e,t)=>s[t]!==e),i=_a(e,t),a=va(e,t),l=n||!i?{x:0,y:0}:{x:a?r.width-o.width:0,y:a?r.height-o.height:0},u={x:o.left,y:o.top};return l.x&&l.y?u:un(u,l)}}}};function _a(e,t){return!ma(e)||!ma(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function va(e,t){return!ma(e)||!ma(t)||!_a(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}var ya=[`top`,`mid`,`trailing`],ba={top:{title:`Top system prompt`,hint:`First system message, before the conversation.`},mid:{title:`Mid system block`,hint:`Injected two messages before the end of the chat context.`},trailing:{title:`Trailing system block`,hint:`Appended after the conversation, right before the model replies.`}},xa=[{id:`identity`,label:`<{name}_identity>`,hint:`Who the waifu is and the Discord setting.`,defaultSection:`top`},{id:`personality`,label:`<{name}_personality>`,hint:`The persona / character definition.`,defaultSection:`top`},{id:`schedule`,label:`<{name}_shedule>`,hint:`The configured routine used for energy and timing.`,defaultSection:`top`},{id:`contextStructure`,label:`<context_message_structure>`,hint:`Explains the incoming transcript framing.`,defaultSection:`top`},{id:`environment`,label:`<environment_instructions>`,hint:`Live Discord channel, no-narration instructions.`,defaultSection:`top`},{id:`replyTargeting`,label:`<replying_to_message>`,hint:`replying to > syntax for targeting a specific reply.`,defaultSection:`top`},{id:`mentionPolicy`,label:`<mention_policy>`,hint:`Display-name ping rules and quiet-user guidance.`,defaultSection:`top`},{id:`styleConstraints`,label:`<style_constraints>`,hint:`Short-reply and one-sentence constraints.`,defaultSection:`top`},{id:`hardRules`,label:`<hard_rules>`,hint:`Invalid-output constraints.`,defaultSection:`top`},{id:`toolUse`,label:`<tool_use>`,hint:`Tool instructions; only render when tools are active.`,defaultSection:`top`},{id:`directorNotes`,label:`<director_notes>`,hint:`Shared director notes.`,defaultSection:`mid`},{id:`activeParticipants`,label:`<active_chat_participants>`,hint:`Who is currently active in chat.`,defaultSection:`mid`},{id:`serverEmojis`,label:`<server_emojis>`,hint:`Available server emoji list.`,defaultSection:`mid`},{id:`relevantMemories`,label:`<{name}_relevant_memories>`,hint:`Long/short-term memories, when present.`,defaultSection:`trailing`},{id:`personalityReminder`,label:`<{name}_personality>`,hint:`Trailing personality reminder.`,defaultSection:`trailing`},{id:`currentlyDoing`,label:`<currently_doing>`,hint:`Schedule-derived current activity, when active.`,defaultSection:`trailing`},{id:`sceneDirection`,label:`<scene_direction>`,hint:`Per-turn scene direction, when present.`,defaultSection:`trailing`}],Sa=new Map(xa.map(e=>[e.id,e]));function Ca(e){return Sa.get(e)}function wa(e){return Sa.get(e)?.label??`<${e}>`}function Ta(){let e=e=>({kind:`block`,blockId:e,enabled:!0});return{top:[e(`identity`),{kind:`group`,id:`behavior`,tag:`{name}_behavior`,enabled:!0,children:[e(`personality`),e(`schedule`),e(`contextStructure`),e(`environment`),e(`replyTargeting`),e(`mentionPolicy`),e(`styleConstraints`),e(`hardRules`),e(`toolUse`)]}],mid:[e(`directorNotes`),e(`activeParticipants`),e(`serverEmojis`)],trailing:[e(`relevantMemories`),e(`personalityReminder`),e(`currentlyDoing`),e(`sceneDirection`)]}}function Ea(e,t){let n=e.replace(/\{name\}/g,t).trim().toLowerCase().replace(/[^a-z0-9_-]+/g,`_`).replace(/^_+|_+$/g,``);return/^[a-z]/.test(n)?n:`waifu_${n||`unknown`}`}var Da=e=>`block:${e}`,Oa=e=>`group:${e}`,ka=e=>`section:${e}`;function Aa(e){let t=e=>e.kind===`block`?{...e}:{...e,children:e.children.map(e=>({...e}))};return{top:e.top.map(t),mid:e.mid.map(t),trailing:e.trailing.map(t)}}function ja(e,t){for(let n of ya){let r=e[n].findIndex(e=>e.kind===`group`&&e.id===t);if(r>=0)return{section:n,index:r}}}function Ma(e,t){for(let n of ya){let r=e[n];for(let e=0;e<r.length;e+=1){let i=r[e];if(i.kind===`block`&&i.blockId===t)return{ref:{kind:`section`,section:n},index:e};if(i.kind===`group`){let e=i.children.findIndex(e=>e.blockId===t);if(e>=0)return{ref:{kind:`group`,groupId:i.id},index:e}}}}}function Na(e,t){return e.kind===`section`&&t.kind===`section`?e.section===t.section:e.kind===`group`&&t.kind===`group`?e.groupId===t.groupId:!1}function Pa(e,t){if(t.ref.kind===`section`)return e[t.ref.section].splice(t.index,1)[0];let n=ja(e,t.ref.groupId);return e[n.section][n.index].children.splice(t.index,1)[0]}function Fa(e,t,n,r){if(t.kind===`section`){e[t.section].splice(n,0,r);return}let i=ja(e,t.groupId);i&&e[i.section][i.index].children.splice(n,0,r)}function Ia(e,t){if(t.startsWith(`section:`)){let n=t.slice(8);return{ref:{kind:`section`,section:n},index:e[n].length}}if(t.startsWith(`group:`)){let n=t.slice(6),r=ja(e,n);if(!r)return;let i=e[r.section][r.index];return{ref:{kind:`group`,groupId:n},index:i.children.length}}if(t.startsWith(`block:`))return Ma(e,t.slice(6))}function La(e,t,n){let r=Aa(e),i=Ma(r,t);if(!i)return e;let a=Pa(r,i),o=n.index;return Na(i.ref,n.ref)&&i.index<n.index&&--o,Fa(r,n.ref,o,a),r}function Ra(e,t,n){let r=Aa(e),i=Ma(r,t);if(!i)return e;if(i.ref.kind===`section`)r[i.ref.section][i.index].enabled=n;else{let e=ja(r,i.ref.groupId);r[e.section][e.index].children[i.index].enabled=n}return r}function za(e,t,n){let r=Aa(e),i=ja(r,t);return i?(r[i.section][i.index].enabled=n,r):e}function Ba(e,t,n){let r=Aa(e),i=ja(r,t);return i?(r[i.section][i.index].tag=n,r):e}function Va(e,t,n){let r=ja(e,t);if(!r)return e;let i=r.index+n;if(i<0||i>=e[r.section].length)return e;let a=Aa(e),o=a[r.section];return[o[r.index],o[i]]=[o[i],o[r.index]],a}function Ha(e,t){let n=ja(e,t);if(!n)return e;let r=Aa(e),i=r[n.section][n.index];return r[n.section].splice(n.index,1,...i.children),r}function Ua(e,t){let n=`custom-${Math.random().toString(36).slice(2,8)}`,r=Aa(e);return r[t].push({kind:`group`,id:n,tag:`custom_group`,enabled:!0,children:[]}),r}function Wa(e){let t=new Set,n=e=>{for(let n of e)if(n.kind===`block`)t.add(n.blockId);else for(let e of n.children)t.add(e.blockId)};n(e.top),n(e.mid),n(e.trailing);let r={top:[...e.top],mid:[...e.mid],trailing:[...e.trailing]};for(let e of xa)t.has(e.id)||r[e.defaultSection].push({kind:`block`,blockId:e.id,enabled:!1});return r}var Ga=[`top`,`mid`,`trailing`];function Ka({layout:e,tools:t,onLayoutChange:n,onToolsChange:r,waifuName:i}){let[a,o]=(0,C.useState)(void 0),s=jn(An(jr,{activationConstraint:{distance:5}}),An(Er,{coordinateGetter:ga})),c=e=>{let t=String(e.active.id);t.startsWith(`block:`)&&o(t.slice(6))},l=t=>{o(void 0);let{active:r,over:i}=t;if(!i)return;let a=String(r.id),s=String(i.id);if(!a.startsWith(`block:`)||a===s)return;let c=a.slice(6),l=Ia(e,s);l&&n(La(e,c,l))},u=(t,r)=>n(Ra(e,t,r)),d=(t,r)=>n(za(e,t,r)),f=(t,r)=>n(Ba(e,t,r)),p=(t,r)=>n(Va(e,t,r)),m=t=>n(Ha(e,t)),h=t=>n(Ua(e,t));return(0,F.jsxs)(`section`,{className:`section`,children:[(0,F.jsxs)(`div`,{className:`section-header`,children:[(0,F.jsx)(`h3`,{className:`section-title`,children:`Waifu prompt layout`}),(0,F.jsx)(`span`,{className:`section-description`,children:`Drag blocks to reorder them, move them between the three system messages, or in and out of groups. Toggle a block off to drop it from the prompt. Block wording is fixed; you control placement and grouping. PickNextWaifu and add_memory availability are server settings.`})]}),(0,F.jsxs)(Oi,{sensors:s,collisionDetection:zn,onDragStart:c,onDragEnd:l,onDragCancel:()=>o(void 0),children:[(0,F.jsx)(`div`,{className:`prompt-layout-lanes`,children:Ga.map(n=>(0,F.jsx)(qa,{section:n,nodes:e[n],tools:t,waifuName:i,onToolsChange:r,onBlockEnabled:u,onGroupEnabled:d,onGroupTag:f,onMoveGroup:p,onDeleteGroup:m,onAddGroup:()=>h(n)},n))}),(0,F.jsx)(Ki,{children:a?(0,F.jsx)(Xa,{label:wa(a).replace(`{name}`,i),dragging:!0}):null})]})]})}function qa({section:e,nodes:t,tools:n,waifuName:r,onToolsChange:i,onBlockEnabled:a,onGroupEnabled:o,onGroupTag:s,onMoveGroup:c,onDeleteGroup:l,onAddGroup:u}){let{setNodeRef:d}=Pi({id:ka(e)}),f=ba[e],p=t.map(e=>e.kind===`block`?Da(e.blockId):Oa(e.id));return(0,F.jsxs)(`div`,{className:`prompt-lane`,children:[(0,F.jsxs)(`div`,{className:`prompt-lane-head`,children:[(0,F.jsx)(`span`,{className:`prompt-lane-title`,children:f.title}),(0,F.jsx)(`span`,{className:`field-hint`,children:f.hint})]}),(0,F.jsx)(ia,{items:p,strategy:ea,children:(0,F.jsxs)(`div`,{ref:d,className:`prompt-lane-body`,children:[t.map((e,u)=>e.kind===`block`?(0,F.jsx)(Ja,{node:e,tools:n,waifuName:r,onToolsChange:i,onEnabled:a},e.blockId):(0,F.jsx)(Ya,{group:e,tools:n,waifuName:r,isFirst:u===0,isLast:u===t.length-1,onToolsChange:i,onBlockEnabled:a,onGroupEnabled:o,onGroupTag:s,onMoveGroup:c,onDeleteGroup:l},e.id)),t.length===0&&(0,F.jsx)(`div`,{className:`prompt-lane-empty`,children:`Drop blocks here`})]})}),(0,F.jsxs)(`button`,{type:`button`,className:`btn sm`,onClick:u,children:[(0,F.jsx)(je,{className:`icon`}),` Add group`]})]})}function Ja({node:e,tools:t,waifuName:n,onToolsChange:r,onEnabled:i}){let{attributes:a,listeners:o,setNodeRef:s,transform:c,transition:l,isDragging:u}=fa({id:Da(e.blockId)}),d={transform:hn.Transform.toString(c),transition:l,opacity:u?.4:1},f=Ca(e.blockId),p=(f?.label??`<${e.blockId}>`).replace(`{name}`,n),m=e.blockId===`toolUse`,h=m?t.toolUse:e.enabled,g=n=>m?r({...t,toolUse:n}):i(e.blockId,n);return(0,F.jsxs)(`div`,{ref:s,style:d,className:`prompt-card${h?``:` is-disabled`}`,children:[(0,F.jsx)(`button`,{type:`button`,className:`prompt-drag`,...a,...o,"aria-label":`Drag block`,children:(0,F.jsx)(ve,{className:`icon`})}),(0,F.jsxs)(`div`,{className:`prompt-card-main`,children:[(0,F.jsx)(`code`,{className:`prompt-card-label`,children:p}),f?.hint&&(0,F.jsx)(`span`,{className:`field-hint`,children:f.hint})]}),(0,F.jsx)(Ft,{checked:h,onChange:g,label:``})]})}function Ya({group:e,tools:t,waifuName:n,isFirst:r,isLast:i,onToolsChange:a,onBlockEnabled:o,onGroupEnabled:s,onGroupTag:c,onMoveGroup:l,onDeleteGroup:u}){let{setNodeRef:d,transform:f,transition:p}=fa({id:Oa(e.id)}),m={transform:hn.Transform.toString(f),transition:p},h=e.children.map(e=>Da(e.blockId)),g=Ea(e.tag,n),[_,v]=(0,C.useState)(e.tag);return(0,C.useEffect)(()=>v(e.tag),[e.tag]),(0,F.jsxs)(`div`,{ref:d,style:m,className:`prompt-group${e.enabled?``:` is-disabled`}`,children:[(0,F.jsxs)(`div`,{className:`prompt-group-head`,children:[(0,F.jsx)(`code`,{className:`prompt-group-tag-prefix`,children:`<`}),(0,F.jsx)(`input`,{className:`input prompt-group-tag-input`,value:_,onChange:e=>v(e.target.value),onBlur:()=>{let t=_.trim()||`custom_group`;t!==e.tag&&c(e.id,t),v(t)},"aria-label":`Group tag`,spellCheck:!1}),(0,F.jsx)(`code`,{className:`prompt-group-tag-prefix`,children:`>`}),(0,F.jsxs)(`div`,{className:`prompt-group-actions`,children:[(0,F.jsx)(`button`,{type:`button`,className:`btn icon-btn`,disabled:r,onClick:()=>l(e.id,-1),"aria-label":`Move group up`,children:(0,F.jsx)(k,{className:`icon`})}),(0,F.jsx)(`button`,{type:`button`,className:`btn icon-btn`,disabled:i,onClick:()=>l(e.id,1),"aria-label":`Move group down`,children:(0,F.jsx)(se,{className:`icon`})}),(0,F.jsx)(`button`,{type:`button`,className:`btn danger icon-btn`,onClick:()=>u(e.id),"aria-label":`Ungroup`,children:(0,F.jsx)(Ve,{className:`icon`})}),(0,F.jsx)(Ft,{checked:e.enabled,onChange:t=>s(e.id,t),label:``})]})]}),(0,F.jsxs)(`span`,{className:`field-hint`,children:[`Renders as <`,g,`>`,e.tag.includes(`{name}`)&&(0,F.jsxs)(F.Fragment,{children:[` `,`(the `,(0,F.jsx)(`code`,{children:`{name}`}),` token becomes the waifu tag)`]})]}),(0,F.jsx)(ia,{items:h,strategy:ea,children:(0,F.jsxs)(`div`,{className:`prompt-group-body`,children:[e.children.map(e=>(0,F.jsx)(Ja,{node:e,tools:t,waifuName:n,onToolsChange:a,onEnabled:o},e.blockId)),e.children.length===0&&(0,F.jsx)(`div`,{className:`prompt-lane-empty`,children:`Drop blocks into this group`})]})})]})}function Xa({label:e,dragging:t}){return(0,F.jsxs)(`div`,{className:`prompt-card${t?` is-dragging`:``}`,children:[(0,F.jsx)(`span`,{className:`prompt-drag`,children:(0,F.jsx)(ve,{className:`icon`})}),(0,F.jsx)(`div`,{className:`prompt-card-main`,children:(0,F.jsx)(`code`,{className:`prompt-card-label`,children:e})})]})}function Za(){let e=L(e=>P.waifus(e),[]),t=L(e=>P.models(e),[]),n=L(e=>P.providers(e),[]),r=L(e=>P.discordBots(e),[]),[i,a]=(0,C.useState)(void 0),[o,s]=(0,C.useState)(!1);return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`div`,{className:`view-header`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`h2`,{className:`view-title`,children:`Waifus`}),(0,F.jsx)(`p`,{className:`view-subtitle`,children:`Persona, model, Discord bot, and memory configuration per waifu.`})]}),(0,F.jsxs)(`div`,{className:`view-actions`,children:[(0,F.jsx)(`button`,{className:`btn`,onClick:e.reload,children:`Refresh`}),(0,F.jsxs)(`button`,{className:`btn primary`,onClick:()=>s(!0),children:[(0,F.jsx)(je,{className:`icon`}),` New waifu`]})]})]}),e.loading&&(0,F.jsx)(st,{rows:4,height:32}),e.error&&(0,F.jsxs)(R,{tone:`err`,children:[`Failed to load waifus: `,e.error.message]}),e.data&&e.data.waifus.length===0&&(0,F.jsx)(z,{title:`No waifus yet`,icon:(0,F.jsx)(Be,{className:`icon-lg`}),children:`Create your first waifu. You'll set a persona, pick a model, and add a Discord bot token.`}),e.data&&e.data.waifus.length>0&&(0,F.jsx)(`div`,{className:`table-wrap`,children:(0,F.jsxs)(`table`,{className:`data-table`,children:[(0,F.jsx)(`thead`,{children:(0,F.jsxs)(`tr`,{children:[(0,F.jsx)(`th`,{children:`Display name`}),(0,F.jsx)(`th`,{children:`Internal name`}),(0,F.jsx)(`th`,{children:`Model`}),(0,F.jsx)(`th`,{children:`Bot`}),(0,F.jsx)(`th`,{children:`Context`}),(0,F.jsx)(`th`,{children:`Updated`}),(0,F.jsx)(`th`,{children:`Setup`}),(0,F.jsx)(`th`,{})]})}),(0,F.jsx)(`tbody`,{children:e.data.waifus.map(e=>(0,F.jsxs)(`tr`,{children:[(0,F.jsxs)(`td`,{children:[(0,F.jsx)(`div`,{style:{fontWeight:600},children:e.displayName}),(0,F.jsx)(`div`,{style:{color:`var(--text-muted)`,fontSize:`var(--fs-xs)`,fontFamily:`var(--font-mono)`},children:e.id})]}),(0,F.jsx)(`td`,{style:{fontFamily:`var(--font-mono)`},children:e.name}),(0,F.jsx)(`td`,{children:e.modelId?(0,F.jsxs)(`span`,{style:{fontFamily:`var(--font-mono)`,fontSize:`var(--fs-xs)`},children:[e.providerId,`/`,e.modelId]}):(0,F.jsx)(I,{tone:`warn`,children:`unset`})}),(0,F.jsx)(`td`,{children:e.botId?(0,F.jsxs)(I,{tone:`info`,dot:!0,children:[`bot:`,e.botId]}):(0,F.jsx)(I,{tone:`warn`,dot:!0,children:`no bot`})}),(0,F.jsx)(`td`,{children:e.contextWindow}),(0,F.jsx)(`td`,{children:ct(e.updatedAt)}),(0,F.jsx)(`td`,{children:(0,F.jsx)($a,{waifu:e,bots:r.data})}),(0,F.jsx)(`td`,{className:`right`,children:(0,F.jsx)(`button`,{className:`btn sm`,onClick:()=>a(e.id),children:`Edit`})})]},e.id))})]})}),i&&(0,F.jsx)(eo,{waifuId:i,models:t.data,providers:n.data,bots:r.data,onClose:()=>a(void 0),onSaved:()=>{e.reload()},onDeleted:()=>{a(void 0),e.reload()}}),o&&(0,F.jsx)(Qa,{onClose:()=>s(!1),onCreated:t=>{s(!1),e.reload(),a(t.id)}})]})}function Qa({onClose:e,onCreated:t}){let[n,r]=(0,C.useState)(``),[i,a]=(0,C.useState)(``),[o,s]=(0,C.useState)(()=>no()),[c,l]=(0,C.useState)(()=>ro()),[u,d]=(0,C.useState)(()=>Ta()),[f,p]=(0,C.useState)(!1),[m,h]=(0,C.useState)(void 0);return(0,F.jsxs)(kt,{open:!0,onClose:()=>!f&&e(),title:`Create waifu`,wide:!0,footer:(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`button`,{className:`btn`,onClick:e,disabled:f,children:`Cancel`}),(0,F.jsx)(`button`,{className:`btn primary`,onClick:async()=>{if(!n.trim()||!i.trim()){h(`Both names are required.`);return}p(!0),h(void 0);try{t(await P.createWaifu({name:n.trim(),displayName:i.trim(),id:dt(n),availability:o,tools:c,promptLayout:u}))}catch(e){h(e.message)}finally{p(!1)}},disabled:f,children:f?`Creating…`:`Create`})]}),children:[(0,F.jsxs)(`div`,{className:`field`,children:[(0,F.jsx)(`label`,{className:`field-label`,children:`Internal name`}),(0,F.jsx)(`input`,{className:`input`,value:n,onChange:e=>r(e.target.value),placeholder:`aria`,autoFocus:!0}),(0,F.jsxs)(`span`,{className:`field-hint`,children:[`Lowercase, used as the id. Slug: `,(0,F.jsx)(`code`,{children:dt(n)||`—`})]})]}),(0,F.jsxs)(`div`,{className:`field`,children:[(0,F.jsx)(`label`,{className:`field-label`,children:`Display name`}),(0,F.jsx)(`input`,{className:`input`,value:i,onChange:e=>a(e.target.value),placeholder:`Aria`})]}),(0,F.jsx)(to,{value:o,onChange:s}),(0,F.jsx)(Ka,{layout:u,tools:c,onLayoutChange:d,onToolsChange:l,waifuName:i||n||`waifu`}),m&&(0,F.jsx)(R,{tone:`err`,children:m})]})}function $a({waifu:e,bots:t}){let n=t?.waifus.find(t=>t.id===e.botId);return e.modelId?e.botId?n?.tokenConfigured?(0,F.jsx)(I,{tone:`ok`,dot:!0,children:`ready`}):(0,F.jsx)(I,{tone:`warn`,dot:!0,children:`missing token`}):(0,F.jsx)(I,{tone:`warn`,dot:!0,children:`missing bot`}):(0,F.jsx)(I,{tone:`warn`,dot:!0,children:`missing model`})}function eo({waifuId:e,models:t,providers:n,bots:r,onClose:i,onSaved:a,onDeleted:o}){let[s,c]=(0,C.useState)(void 0),[l,u]=(0,C.useState)(void 0),[d,f]=(0,C.useState)(!1),[p,m]=(0,C.useState)(!1),[h,g]=(0,C.useState)(!1),[_,v]=(0,C.useState)(void 0),[y,b]=(0,C.useState)(void 0),[x,S]=(0,C.useState)(void 0),[w,T]=(0,C.useState)(void 0),[ee,E]=(0,C.useState)(``),[D,te]=(0,C.useState)(``),[re,ie]=(0,C.useState)(``),ae=L(e=>P.discordBots(e),[e]),oe=(0,C.useCallback)(async()=>{u(void 0);try{c(await P.waifu(e))}catch(e){u(e.message)}},[e]);(0,C.useEffect)(()=>{oe()},[oe]);let se=ae.data??r,O=se?.waifus.find(e=>e.id===s?.botId);(0,C.useEffect)(()=>{s&&(E(O?.displayName??s.displayName),te(O?.applicationId??``),ie(``))},[s?.id,s?.botId,s?.displayName,O?.id,O?.applicationId]);let k=e=>{c(t=>t&&{...t,...e})},ce=e=>{c(t=>t&&{...t,generation:{...t.generation,...e}})},le=(0,C.useMemo)(()=>t?s?.providerId?t.models.filter(e=>e.providerId===s.providerId):t.models:[],[t,s?.providerId]),ue=(0,C.useMemo)(()=>t?.models.find(e=>e.modelId===s?.modelId&&e.providerId===s?.providerId),[t,s?.modelId,s?.providerId]),A=async e=>{let t={revision:e.revision,name:e.name,displayName:e.displayName,enabled:!0,persona:e.persona,providerId:e.providerId,modelId:e.modelId,botId:e.botId,contextWindow:e.contextWindow,generation:e.generation,reasoning:e.reasoning,availability:e.availability,tools:e.tools,promptLayout:e.promptLayout},n=await P.updateWaifu(e.id,t);return c(n),b(void 0),a(),n},de=async()=>{if(s){f(!0),v(void 0);try{await A(s)}catch(e){fe(e)}finally{f(!1)}}},j=async()=>{if(!s)return;let e=ee.trim()||s.displayName;g(!0),v(void 0),T(void 0);try{let t=se??await P.discordBots(),n=s.botId?t.waifus.find(e=>e.id===s.botId):void 0,r=new Set(t.waifus.map(e=>e.id)),i=n?.id||dt(e)||dt(s.name)||`waifu-bot`,a=i,o=2;for(;!n&&r.has(a);)a=`${i}-${o++}`;let c={id:a,displayName:e,applicationId:D.trim()||void 0,token:re.trim()||void 0,enabled:!0},l={...t,waifus:t.waifus.some(e=>e.id===a)?t.waifus.map(e=>e.id===a?{...e,...c}:e):[...t.waifus,c]},u=await P.putDiscordBots(l);ae.setData(u),ie(``),await A({...s,botId:a}),T(`Waifu bot saved and linked.`)}catch(e){e instanceof $e?(b(e.latest),v(`Saved data was modified elsewhere. Reload before linking the bot.`)):v(e.message)}finally{g(!1)}},fe=e=>{e instanceof $e?(b(e.latest),v(`Saved data was modified elsewhere. Reload or overwrite.`)):v(e.message)};return(0,F.jsxs)(kt,{open:!0,onClose:()=>!d&&!p&&i(),wide:!0,title:s?`Edit · ${s.displayName}`:`Edit · ${e}`,footer:(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`button`,{className:`btn danger`,onClick:async()=>{if(s&&window.confirm(`Delete waifu "${s.displayName}"? This removes its folder.`)){m(!0),v(void 0);try{await P.deleteWaifu(s.id,s.revision),o()}catch(e){e instanceof $e?v(`Conflict: another change occurred. Reload first.`):v(e.message)}finally{m(!1)}}},disabled:!s||d||p,children:[(0,F.jsx)(Ve,{className:`icon`}),` `,p?`Deleting…`:`Delete`]}),(0,F.jsx)(`span`,{style:{flex:1}}),(0,F.jsx)(`button`,{className:`btn`,onClick:i,disabled:d||p,children:`Cancel`}),(0,F.jsxs)(`button`,{className:`btn primary`,onClick:de,disabled:!s||d,children:[(0,F.jsx)(Ne,{className:`icon`}),d?`Saving…`:`Save`]})]}),children:[l&&(0,F.jsx)(R,{tone:`err`,children:l}),!s&&!l&&(0,F.jsx)(st,{rows:5}),y&&(0,F.jsxs)(R,{tone:`warn`,title:`Stale revision`,children:[`Stored revision is `,y.revision,` (you had `,s?.revision,`).`,` `,(0,F.jsxs)(`button`,{className:`btn sm`,onClick:()=>{c(y),b(void 0),v(void 0)},children:[(0,F.jsx)(ne,{className:`icon`}),` Reload server copy`]})]}),_&&!y&&(0,F.jsx)(R,{tone:`err`,children:_}),s&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`div`,{className:`grid grid-2`,children:[(0,F.jsxs)(`div`,{className:`field`,children:[(0,F.jsx)(`label`,{className:`field-label`,children:`Internal name`}),(0,F.jsx)(`input`,{className:`input`,value:s.name,onChange:e=>k({name:e.target.value})})]}),(0,F.jsxs)(`div`,{className:`field`,children:[(0,F.jsx)(`label`,{className:`field-label`,children:`Display name`}),(0,F.jsx)(`input`,{className:`input`,value:s.displayName,onChange:e=>k({displayName:e.target.value})})]}),(0,F.jsxs)(`div`,{className:`field`,children:[(0,F.jsx)(`label`,{className:`field-label`,children:`Discord bot`}),(0,F.jsxs)(`select`,{className:`select`,value:s.botId??``,onChange:e=>k({botId:e.target.value||void 0}),children:[(0,F.jsx)(`option`,{value:``,children:`— Unlinked —`}),(se?.waifus??[]).map(e=>{let t=e.applicationId&&e.tokenConfigured;return(0,F.jsxs)(`option`,{value:e.id,children:[e.displayName,` (`,e.id,`) `,t?``:`— needs setup`]},e.id)})]}),(0,F.jsx)(`span`,{className:`field-hint`,children:`Choose an existing bot record or save the Discord bot details below.`})]}),(0,F.jsxs)(`div`,{className:`field`,children:[(0,F.jsx)(`label`,{className:`field-label`,children:`Context window (messages)`}),(0,F.jsx)(`input`,{className:`input`,type:`number`,min:1,max:100,value:s.contextWindow,onChange:e=>k({contextWindow:Math.max(1,Math.min(100,Number(e.target.value)||1))})}),(0,F.jsx)(`span`,{className:`field-hint`,children:`Default 50. Range 1–100.`})]}),(0,F.jsxs)(`div`,{className:`field`,children:[(0,F.jsx)(`label`,{className:`field-label`,children:`Provider`}),(0,F.jsxs)(`select`,{className:`select`,value:s.providerId??``,onChange:e=>{k({providerId:e.target.value||void 0,modelId:void 0})},children:[(0,F.jsx)(`option`,{value:``,children:`— Select provider —`}),(n?.providers??[]).map(e=>(0,F.jsxs)(`option`,{value:e.id,disabled:!e.credentials.configured,children:[e.displayName,` `,e.credentials.configured?``:`(no key)`]},e.id))]})]}),(0,F.jsxs)(`div`,{className:`field`,children:[(0,F.jsx)(`label`,{className:`field-label`,children:`Model`}),(0,F.jsxs)(`select`,{className:`select`,value:s.modelId??``,onChange:e=>k({modelId:e.target.value||void 0}),disabled:!s.providerId,children:[(0,F.jsx)(`option`,{value:``,children:`— Select model —`}),le.map(e=>(0,F.jsxs)(`option`,{value:e.modelId,children:[e.displayName,` (`,e.modelId,`)`]},e.modelId))]})]}),(0,F.jsxs)(`div`,{className:`field`,children:[(0,F.jsx)(`label`,{className:`field-label`,children:`Temperature`}),(0,F.jsx)(`input`,{className:`input`,type:`number`,step:.05,min:0,max:2,value:s.generation.temperature??``,onChange:e=>ce({temperature:e.target.value===``?void 0:Number(e.target.value)}),placeholder:ue?.defaultTemperature?.toString()??`default`})]}),(0,F.jsxs)(`div`,{className:`field`,children:[(0,F.jsx)(`label`,{className:`field-label`,children:`Top P`}),(0,F.jsx)(`input`,{className:`input`,type:`number`,step:.05,min:0,max:1,value:s.generation.topP??``,onChange:e=>ce({topP:e.target.value===``?void 0:Number(e.target.value)}),placeholder:ue?.defaultTopP?.toString()??`default`})]}),(0,F.jsxs)(`div`,{className:`field`,children:[(0,F.jsx)(`label`,{className:`field-label`,children:`Max output tokens`}),(0,F.jsx)(`input`,{className:`input`,type:`number`,min:1,value:s.generation.maxOutputTokens??``,onChange:e=>ce({maxOutputTokens:e.target.value===``?void 0:Math.max(1,Number(e.target.value))}),placeholder:ue?.maxOutputTokens?.toString()??`model default`})]}),(0,F.jsx)(Lt,{model:ue,value:s.reasoning??{},onChange:e=>k({reasoning:e})})]}),ue&&!It(ue)&&(0,F.jsx)(`span`,{className:`field-hint`,children:`Selected model does not expose reasoning controls.`}),(0,F.jsx)(to,{value:s.availability,onChange:e=>k({availability:e})}),(0,F.jsx)(Ka,{layout:Wa(s.promptLayout),tools:s.tools,onLayoutChange:e=>k({promptLayout:e}),onToolsChange:e=>k({tools:e}),waifuName:s.displayName||s.name||s.id}),ae.error&&(0,F.jsx)(R,{tone:`err`,children:ae.error.message}),w&&(0,F.jsx)(R,{tone:`ok`,children:w}),(0,F.jsxs)(`section`,{className:`section`,style:{marginTop:16},children:[(0,F.jsxs)(`div`,{className:`section-header`,children:[(0,F.jsx)(`h3`,{className:`section-title`,children:`Discord bot token`}),(0,F.jsx)(`span`,{className:`section-description`,children:`Create or update the waifu bot record, then link it to this waifu.`})]}),(0,F.jsxs)(`div`,{className:`grid grid-2`,children:[(0,F.jsxs)(`div`,{className:`field`,children:[(0,F.jsx)(`label`,{className:`field-label`,children:`Bot display name`}),(0,F.jsx)(`input`,{className:`input`,value:ee,onChange:e=>E(e.target.value),placeholder:s.displayName})]}),(0,F.jsxs)(`div`,{className:`field`,children:[(0,F.jsx)(`label`,{className:`field-label`,children:`Application ID`}),(0,F.jsx)(`input`,{className:`input code`,value:D,onChange:e=>te(e.target.value),placeholder:`17–20 digit Discord application id`})]}),(0,F.jsxs)(`div`,{className:`field`,children:[(0,F.jsx)(`label`,{className:`field-label`,children:`Bot token`}),(0,F.jsx)(`input`,{className:`input code`,type:`password`,value:re,onChange:e=>ie(e.target.value),placeholder:O?.tokenConfigured?`Saved ${O.tokenHint??``} — leave blank to keep`:`Paste bot token`}),(0,F.jsx)(`span`,{className:`field-hint`,children:`Tokens are write-only and redacted after save.`})]}),(0,F.jsxs)(`div`,{className:`field`,children:[(0,F.jsx)(`label`,{className:`field-label`,children:`Linked bot status`}),(0,F.jsxs)(`div`,{className:`row`,children:[O?(0,F.jsx)(I,{tone:O.tokenConfigured?`ok`:`warn`,dot:!0,children:O.tokenConfigured?`token saved`:`missing token`}):(0,F.jsx)(I,{tone:`warn`,dot:!0,children:`not linked`}),(0,F.jsxs)(`button`,{className:`btn primary`,onClick:j,disabled:d||h||!s,children:[(0,F.jsx)(Ne,{className:`icon`}),h?`Saving…`:`Save bot & link`]})]})]})]})]}),(0,F.jsxs)(`div`,{className:`field`,children:[(0,F.jsx)(`label`,{className:`field-label`,children:`Personality prompt`}),(0,F.jsx)(`textarea`,{className:`textarea`,value:s.persona,onChange:e=>k({persona:e.target.value}),placeholder:`Describe how the waifu speaks, what she cares about, conversational quirks, etc.`,rows:6}),(0,F.jsx)(`span`,{className:`field-hint`,children:`This becomes part of the waifu system prompt. Available server emojis and mention rules are appended automatically.`})]}),(0,F.jsxs)(`div`,{className:`grid grid-2`,children:[(0,F.jsx)(co,{kind:`pfp`,waifuId:s.id,message:x,onMessage:S}),(0,F.jsx)(co,{kind:`banner`,waifuId:s.id,message:x,onMessage:S})]}),(0,F.jsx)(Ct,{kind:`waifu`,applicationId:O?.applicationId,botDisplayName:O?.displayName??s.displayName,collapsedByDefault:!0}),(0,F.jsx)(W,{waifu:s}),(0,F.jsxs)(`div`,{className:`kv`,style:{marginTop:8},children:[(0,F.jsx)(`span`,{className:`k`,children:`Revision`}),(0,F.jsxs)(`span`,{className:`v`,children:[s.revision,` · updated `,ct(s.updatedAt)]}),(0,F.jsx)(`span`,{className:`k`,children:`Storage`}),(0,F.jsxs)(`span`,{className:`v`,style:{fontFamily:`var(--font-mono)`,fontSize:`var(--fs-xs)`},children:[`user/waifus/`,s.id,`/waifu.json`]})]})]})]})}function to({value:e,onChange:t}){let n=io(e.busy),r=n=>{t({...e,sleep:{...e.sleep,...n}})},i=(n,r)=>{t({...e,busy:e.busy.map((e,t)=>t===n?{...e,...r}:e)})},a=()=>{t({...e,busy:[...e.busy,{start:`09:00`,end:`10:00`,reason:`busy`}]})},o=n=>{t({...e,busy:e.busy.filter((e,t)=>t!==n)})};return(0,F.jsxs)(`section`,{className:`section`,style:{marginTop:16},children:[(0,F.jsxs)(`div`,{className:`section-header`,children:[(0,F.jsxs)(`h3`,{className:`section-title`,children:[(0,F.jsx)(fe,{className:`icon`,style:{verticalAlign:`-2px`}}),` Availability`]}),(0,F.jsx)(`span`,{className:`section-description`,children:`Daily local-time context for orchestrator decisions.`})]}),(0,F.jsxs)(`div`,{className:`grid grid-3`,children:[(0,F.jsxs)(`div`,{className:`field`,children:[(0,F.jsx)(`label`,{className:`field-label`,children:`Sleep window`}),(0,F.jsx)(Ft,{checked:e.sleep.enabled,onChange:e=>r({enabled:e}),label:e.sleep.enabled?`Enabled`:`Disabled`}),(0,F.jsx)(`span`,{className:`field-hint`,children:`Soft context only; this never blocks replies.`})]}),(0,F.jsxs)(`div`,{className:`field`,children:[(0,F.jsx)(`label`,{className:`field-label`,children:`Sleep start`}),(0,F.jsx)(`input`,{className:`input`,type:`time`,value:e.sleep.start,disabled:!e.sleep.enabled,onChange:e=>r({start:e.target.value})})]}),(0,F.jsxs)(`div`,{className:`field`,children:[(0,F.jsx)(`label`,{className:`field-label`,children:`Sleep end`}),(0,F.jsx)(`input`,{className:`input`,type:`time`,value:e.sleep.end,disabled:!e.sleep.enabled,onChange:e=>r({end:e.target.value})})]})]}),(0,F.jsxs)(`div`,{className:`field`,style:{marginTop:12},children:[(0,F.jsxs)(`div`,{className:`row`,style:{justifyContent:`space-between`},children:[(0,F.jsx)(`label`,{className:`field-label`,children:`Busy intervals`}),(0,F.jsxs)(`button`,{className:`btn sm`,type:`button`,onClick:a,children:[(0,F.jsx)(je,{className:`icon`}),` Add busy time`]})]}),e.busy.length===0&&(0,F.jsx)(`span`,{className:`field-hint`,children:`No busy intervals configured.`}),e.busy.map((e,t)=>(0,F.jsxs)(`div`,{className:`grid grid-4`,style:{alignItems:`end`},children:[(0,F.jsxs)(`div`,{className:`field`,children:[(0,F.jsx)(`label`,{className:`field-label`,children:`Start`}),(0,F.jsx)(`input`,{className:`input`,type:`time`,value:e.start,onChange:e=>i(t,{start:e.target.value})})]}),(0,F.jsxs)(`div`,{className:`field`,children:[(0,F.jsx)(`label`,{className:`field-label`,children:`End`}),(0,F.jsx)(`input`,{className:`input`,type:`time`,value:e.end,onChange:e=>i(t,{end:e.target.value})})]}),(0,F.jsxs)(`div`,{className:`field`,children:[(0,F.jsx)(`label`,{className:`field-label`,children:`Reason`}),(0,F.jsx)(`input`,{className:`input`,value:e.reason,onChange:e=>i(t,{reason:e.target.value}),placeholder:`class, work, commute...`}),n.has(t)&&(0,F.jsx)(`span`,{className:`field-hint`,style:{color:`var(--warn)`},children:`Busy intervals cannot overlap.`})]}),(0,F.jsxs)(`div`,{className:`field`,children:[(0,F.jsx)(`label`,{className:`field-label`,children:`Remove`}),(0,F.jsx)(`button`,{className:`btn danger`,type:`button`,onClick:()=>o(t),"aria-label":`Remove busy interval`,title:`Remove busy interval`,children:(0,F.jsx)(Ve,{className:`icon`})})]})]},t))]})]})}function no(){return{sleep:{enabled:!1,start:`23:00`,end:`07:00`},busy:[]}}function ro(){return{toolUse:!0}}function io(e){let t=new Set;for(let n=0;n<e.length;n+=1)for(let r=n+1;r<e.length;r+=1)ao(e[n],e[r])&&(t.add(n),t.add(r));return t}function ao(e,t){return oo(e).some(([e,n])=>oo(t).some(([t,r])=>Math.max(e,t)<Math.min(n,r)))}function oo(e){let t=so(e.start),n=so(e.end);return t===n?[]:t<n?[[t,n]]:[[t,1440],[0,n]]}function so(e){let[t=`0`,n=`0`]=e.split(`:`);return Number(t)*60+Number(n)}function co({kind:e,waifuId:t,message:n,onMessage:r}){let[i,a]=(0,C.useState)(!1),o=async n=>{a(!0);try{let i=`/api/waifus/${encodeURIComponent(t)}/assets/${e}`,a=await fetch(i,{method:`POST`,headers:{"content-type":n.type||`application/octet-stream`},body:n}),o=await a.text();r(`${e}: HTTP ${a.status} ${o.slice(0,160)}`)}catch(e){r(e.message)}finally{a(!1)}};return(0,F.jsxs)(`div`,{className:`field`,children:[(0,F.jsx)(`label`,{className:`field-label`,children:e===`pfp`?`Profile picture`:`Banner`}),(0,F.jsxs)(`div`,{className:`row`,children:[(0,F.jsx)(`input`,{type:`file`,accept:`image/*`,disabled:i,onChange:e=>{let t=e.target.files?.[0];t&&o(t)},style:{flex:1}}),(0,F.jsx)(be,{className:`icon`,style:{color:`var(--text-muted)`}})]}),n&&n.startsWith(`${e}:`)&&(0,F.jsx)(`span`,{className:`field-hint`,style:{color:`var(--warn)`},children:n}),(0,F.jsx)(`span`,{className:`field-hint`,children:`Uploads are stored under the waifu folder in the local data root.`})]})}function W({waifu:e}){let t=[{author:`system`,content:`You are ${e.displayName}. ${e.persona?e.persona.slice(0,140)+(e.persona.length>140?`…`:``):`(no persona set)`}`,system:!0},{author:`<@Kevin>`,content:`hey, are you around?`},{author:e.displayName,content:e.persona?`mhm, just thinking — what's up <@Kevin>?`:`yeah, what's up?`}];return(0,F.jsxs)(`div`,{className:`panel`,style:{marginTop:8},children:[(0,F.jsx)(`div`,{className:`panel-header`,children:(0,F.jsxs)(`div`,{children:[(0,F.jsxs)(`h4`,{className:`panel-title`,children:[(0,F.jsx)(De,{className:`icon`,style:{verticalAlign:`-2px`}}),` Preview`]}),(0,F.jsx)(`div`,{className:`panel-subtitle`,children:`Mock conversation. Not a live generation.`})]})}),(0,F.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:8},children:t.map((e,t)=>(0,F.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`110px 1fr`,gap:12},children:[(0,F.jsx)(`span`,{style:{color:e.system?`var(--text-muted)`:`var(--text-secondary)`,fontFamily:`var(--font-mono)`,fontSize:`var(--fs-xs)`},children:e.system?`system`:e.author}),(0,F.jsx)(`span`,{style:{color:e.system?`var(--text-muted)`:`var(--text-primary)`},children:e.content})]},t))})]})}function G(){let e=L(e=>P.servers(e),[]),t=L(e=>P.waifus(e),[]),n=L(e=>P.discordBots(e),[]),[r,i]=(0,C.useState)(void 0);return(0,C.useEffect)(()=>{!r&&e.data&&e.data.servers.length>0&&i(e.data.servers[0].guildId)},[e.data,r]),(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`div`,{className:`view-header`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`h2`,{className:`view-title`,children:`Servers`}),(0,F.jsx)(`p`,{className:`view-subtitle`,children:`Per-guild channel enablement, context windows, member/emoji caches.`})]}),(0,F.jsx)(`div`,{className:`view-actions`,children:(0,F.jsx)(`button`,{className:`btn`,onClick:e.reload,children:`Refresh`})})]}),e.loading&&(0,F.jsx)(st,{rows:3,height:42}),e.error&&(0,F.jsxs)(R,{tone:`err`,children:[`Failed to load servers: `,e.error.message]}),e.data&&e.data.servers.length===0&&(0,F.jsxs)(z,{title:`No servers yet`,icon:(0,F.jsx)(Fe,{className:`icon-lg`}),children:[`When the orchestrator connects to Discord and lands in a guild, it appears here. You can also create one by PUTting `,(0,F.jsx)(`code`,{children:`/api/servers/:guildId`}),`.`]}),e.data&&e.data.servers.length>0&&(0,F.jsxs)(`div`,{className:`grid`,style:{gridTemplateColumns:`280px 1fr`,gap:16},children:[(0,F.jsx)(`div`,{className:`table-wrap`,style:{height:`fit-content`},children:(0,F.jsxs)(`table`,{className:`data-table`,children:[(0,F.jsx)(`thead`,{children:(0,F.jsx)(`tr`,{children:(0,F.jsx)(`th`,{children:`Guild`})})}),(0,F.jsx)(`tbody`,{children:e.data.servers.map(e=>{let t=Object.values(e.channels??{}).filter(e=>(e.enabledWaifuIds?.length??0)>0).length;return(0,F.jsx)(`tr`,{onClick:()=>i(e.guildId),style:{cursor:`pointer`,background:r===e.guildId?`var(--bg-panel-hover)`:void 0},children:(0,F.jsx)(`td`,{className:`wrap`,children:(0,F.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`},children:[(0,F.jsxs)(`div`,{style:{minWidth:0},children:[(0,F.jsx)(`div`,{style:{fontWeight:600},children:e.name||e.guildId}),(0,F.jsx)(`div`,{style:{color:`var(--text-muted)`,fontSize:`var(--fs-xs)`,fontFamily:`var(--font-mono)`},children:e.guildId}),(0,F.jsxs)(`div`,{style:{marginTop:4,display:`flex`,gap:4},children:[(0,F.jsx)(I,{tone:t>0?`ok`:`neutral`,dot:!0,children:t>0?`active`:`inactive`}),(0,F.jsxs)(I,{tone:`info`,children:[t,` ch`]})]})]}),(0,F.jsx)(O,{className:`icon`,style:{color:`var(--text-muted)`}})]})})},e.guildId)})})]})}),r&&(0,F.jsx)(lo,{guildId:r,waifus:t.data?.waifus??[],bots:n.data,onChanged:()=>e.reload()})]})]})}function lo({guildId:e,waifus:t,bots:n,onChanged:r}){let[i,a]=(0,C.useState)(void 0),[o,s]=(0,C.useState)(void 0),[c,l]=(0,C.useState)(void 0),[u,d]=(0,C.useState)(!1),[f,p]=(0,C.useState)(void 0),m=L(t=>P.members(e,t),[e]),h=L(t=>P.emojis(e,t),[e]),g=L(t=>P.roles(e,t),[e]),_=(0,C.useCallback)(async()=>{try{a((await P.servers()).servers.find(t=>t.guildId===e))}catch(e){s(e.message)}},[e]);(0,C.useEffect)(()=>{_()},[_]);let v=e=>a(t=>t&&{...t,...e}),y=async()=>{if(i){d(!0),s(void 0);try{a(await P.updateServer(e,{revision:i.revision,name:i.name,enabled:!0,contextWindows:i.contextWindows,tools:i.tools,channels:i.channels})),l(void 0),r()}catch(e){e instanceof $e?(l(e.latest),s(`Server config changed elsewhere.`)):s(e.message)}finally{d(!1)}}},b=async(t,n,o)=>{if(!i)return;let c=i.channels[t],u=new Set(c?.enabledWaifuIds??[]);o?u.add(n):u.delete(n),s(void 0);try{a(await P.updateChannel(e,t,{revision:i.revision,name:c?.name,enabled:u.size>0,enabledWaifuIds:[...u]})),r()}catch(e){e instanceof $e?(l(e.latest),s(`Channel waifu allowlist conflicted with a newer server revision.`)):s(e.message)}},x=(0,C.useMemo)(()=>{let e=new Map;for(let t of m.data?.members??[]){let n=(t.guildDisplayName||t.globalDisplayName||t.username||t.userId).toLowerCase();e.set(n,(e.get(n)??0)+1)}return[...e.entries()].filter(([,e])=>e>1).map(([e])=>e)},[m.data]);if(!i)return(0,F.jsx)(`div`,{children:o?(0,F.jsx)(R,{tone:`err`,children:o}):(0,F.jsx)(st,{rows:6,height:28})});let S=Object.values(i.channels??{});return(0,F.jsxs)(`div`,{children:[c&&(0,F.jsxs)(R,{tone:`warn`,title:`Stale revision`,children:[`The server config changed (latest revision `,c.revision,`).`,` `,(0,F.jsx)(`button`,{className:`btn sm`,onClick:()=>{a(c),l(void 0),s(void 0)},children:`Reload server copy`})]}),o&&!c&&(0,F.jsx)(R,{tone:`err`,children:o}),f&&(0,F.jsx)(R,{tone:`info`,children:f}),(0,F.jsxs)(`section`,{className:`section`,children:[(0,F.jsxs)(`div`,{className:`section-header`,children:[(0,F.jsx)(`h3`,{className:`section-title`,children:i.name||i.guildId}),(0,F.jsxs)(`span`,{className:`section-description`,children:[`Revision `,i.revision,` · updated `,ct(i.updatedAt)]})]}),(0,F.jsx)(`div`,{className:`grid grid-2`,children:(0,F.jsxs)(`div`,{className:`field`,children:[(0,F.jsx)(`label`,{className:`field-label`,children:`Display name`}),(0,F.jsx)(`input`,{className:`input`,value:i.name??``,onChange:e=>v({name:e.target.value}),placeholder:`Optional friendly name`})]})}),(0,F.jsxs)(`div`,{className:`grid grid-3`,style:{marginTop:12},children:[(0,F.jsx)(uo,{label:`Orchestrator`,value:i.contextWindows.orchestrator,defaultValue:20,onChange:e=>v({contextWindows:{...i.contextWindows,orchestrator:e}})}),(0,F.jsx)(uo,{label:`Waifu`,value:i.contextWindows.waifu,defaultValue:50,onChange:e=>v({contextWindows:{...i.contextWindows,waifu:e}})}),(0,F.jsx)(uo,{label:`Stage manager`,value:i.contextWindows.stageManager,defaultValue:80,onChange:e=>v({contextWindows:{...i.contextWindows,stageManager:e}})})]}),(0,F.jsxs)(`div`,{className:`row`,style:{marginTop:12},children:[(0,F.jsx)(`span`,{className:`field-hint`,children:`Idle-trigger bounds: 100–28800 seconds.`}),(0,F.jsx)(`span`,{className:`spacer`}),(0,F.jsx)(`button`,{className:`btn primary`,onClick:y,disabled:u,children:u?`Saving…`:`Save server`})]})]}),(0,F.jsxs)(`section`,{className:`section`,children:[(0,F.jsxs)(`div`,{className:`section-header`,children:[(0,F.jsx)(`h3`,{className:`section-title`,children:`Waifu tools`}),(0,F.jsx)(`span`,{className:`section-description`,children:`Server-wide provider tools for every waifu in this guild.`})]}),(0,F.jsxs)(`div`,{className:`grid grid-2`,children:[(0,F.jsxs)(`div`,{className:`field`,children:[(0,F.jsx)(Ft,{checked:i.tools.pickNextWaifu,onChange:e=>v({tools:{...i.tools,pickNextWaifu:e}}),label:`PickNextWaifu`}),(0,F.jsx)(`span`,{className:`field-hint`,children:`Allows waifus to hand off directly to another waifu. Disabled by default.`})]}),(0,F.jsxs)(`div`,{className:`field`,children:[(0,F.jsx)(Ft,{checked:i.tools.shortTermMemory,onChange:e=>v({tools:{...i.tools,shortTermMemory:e}}),label:`add_memory`}),(0,F.jsx)(`span`,{className:`field-hint`,children:`Allows waifus to write per-channel scratchpad notes that auto-expire after 24h.`})]})]}),(0,F.jsxs)(`div`,{className:`row`,style:{marginTop:12},children:[(0,F.jsx)(`span`,{className:`spacer`}),(0,F.jsx)(`button`,{className:`btn primary`,onClick:y,disabled:u,children:u?`Saving…`:`Save server`})]})]}),(0,F.jsxs)(`section`,{className:`section`,children:[(0,F.jsxs)(`div`,{className:`section-header`,children:[(0,F.jsx)(`h3`,{className:`section-title`,children:`Invite bots to this guild`}),(0,F.jsxs)(`span`,{className:`section-description`,children:[`Pre-built OAuth2 URLs scoped to this guild. Requires `,(0,F.jsx)(`em`,{children:`Manage Server`}),` on the target guild.`]})]}),(0,F.jsx)(po,{guildId:e,bots:n})]}),(0,F.jsxs)(`section`,{className:`section`,children:[(0,F.jsxs)(`div`,{className:`section-header`,children:[(0,F.jsx)(`h3`,{className:`section-title`,children:`Channels`}),(0,F.jsxs)(`span`,{className:`section-description`,children:[S.length,` known`]})]}),S.length===0?(0,F.jsx)(z,{title:`No channels tracked`,icon:(0,F.jsx)(ye,{className:`icon-lg`}),children:`Channels appear here as soon as the orchestrator sees activity or you PUT a channel via the API.`}):(0,F.jsx)(`div`,{className:`table-wrap`,children:(0,F.jsxs)(`table`,{className:`data-table`,children:[(0,F.jsx)(`thead`,{children:(0,F.jsxs)(`tr`,{children:[(0,F.jsx)(`th`,{children:`Channel`}),(0,F.jsx)(`th`,{children:`Channel id`}),(0,F.jsx)(`th`,{children:`Runtime`}),(0,F.jsx)(`th`,{children:`Waifus`})]})}),(0,F.jsx)(`tbody`,{children:S.map(e=>(0,F.jsxs)(`tr`,{children:[(0,F.jsx)(`td`,{children:e.name||`#${e.channelId}`}),(0,F.jsx)(`td`,{style:{fontFamily:`var(--font-mono)`,fontSize:`var(--fs-xs)`},children:e.channelId}),(0,F.jsx)(`td`,{children:(e.enabledWaifuIds?.length??0)>0?(0,F.jsx)(I,{tone:`ok`,dot:!0,children:`enabled`}):(0,F.jsx)(I,{tone:`neutral`,dot:!0,children:`disabled`})}),(0,F.jsx)(`td`,{children:(0,F.jsx)(`div`,{className:`row tight`,children:t.length===0?(0,F.jsx)(`span`,{style:{color:`var(--text-muted)`},children:`none`}):t.map(t=>(0,F.jsxs)(`label`,{className:`checkbox-chip`,children:[(0,F.jsx)(`input`,{type:`checkbox`,checked:(e.enabledWaifuIds??[]).includes(t.id),onChange:n=>void b(e.channelId,t.id,n.target.checked)}),t.displayName]},t.id))})})]},e.channelId))})]})})]}),(0,F.jsxs)(`div`,{className:`grid grid-2`,children:[(0,F.jsx)(fo,{title:`Members`,icon:(0,F.jsx)(Ue,{className:`icon`}),count:m.data?.members.length??0,updatedAt:m.data?.updatedAt,onRefresh:async()=>{try{p((await P.refreshMembers(e)).message),m.reload()}catch(e){s(e.message)}},warning:x.length>0?`Duplicate display name${x.length>1?`s`:``}: ${x.slice(0,3).join(`, `)}${x.length>3?`…`:``}. <@DisplayName> mentions will be ambiguous.`:void 0}),(0,F.jsx)(fo,{title:`Emojis`,icon:(0,F.jsx)(ze,{className:`icon`}),count:h.data?.emojis.length??0,updatedAt:h.data?.updatedAt,onRefresh:async()=>{try{p((await P.refreshEmojis(e)).message),h.reload()}catch(e){s(e.message)}},warning:h.data&&h.data.emojis.some(e=>!e.available)?`Some emojis are flagged unavailable. Refresh after fixing them in Discord.`:void 0}),(0,F.jsx)(fo,{title:`Roles`,icon:(0,F.jsx)(Re,{className:`icon`}),count:g.data?.roles.length??0,updatedAt:g.data?.updatedAt,onRefresh:async()=>{try{p((await P.refreshRoles(e)).message),g.reload()}catch(e){s(e.message)}},warning:g.data&&g.data.roles.length===0?`Role mentions will show as @unknown-role until roles are cached.`:void 0})]})]})}function uo({label:e,value:t,defaultValue:n,onChange:r}){return(0,F.jsxs)(`div`,{className:`field`,children:[(0,F.jsxs)(`label`,{className:`field-label`,children:[e,` context`]}),(0,F.jsx)(`input`,{className:`input`,type:`number`,min:1,max:100,value:t,onChange:e=>r(Math.max(1,Math.min(100,Number(e.target.value)||n)))}),(0,F.jsxs)(`span`,{className:`field-hint`,children:[`Default `,n]})]})}function fo({title:e,icon:t,count:n,updatedAt:r,onRefresh:i,warning:a}){let[o,s]=(0,C.useState)(!1);return(0,F.jsxs)(`div`,{className:`panel`,children:[(0,F.jsxs)(`div`,{className:`panel-header`,children:[(0,F.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[t,(0,F.jsx)(`h4`,{className:`panel-title`,children:e})]}),(0,F.jsxs)(`button`,{className:`btn sm`,onClick:async()=>{s(!0);try{await i()}finally{s(!1)}},disabled:o,children:[(0,F.jsx)(Me,{className:`icon`}),o?`Refreshing…`:`Fetch ${e.toLowerCase()}`]})]}),(0,F.jsxs)(`div`,{className:`kv`,children:[(0,F.jsx)(`span`,{className:`k`,children:`Cached`}),(0,F.jsx)(`span`,{className:`v`,children:n}),(0,F.jsx)(`span`,{className:`k`,children:`Last refresh`}),(0,F.jsx)(`span`,{className:`v`,children:r?ct(r):`never`})]}),a&&(0,F.jsx)(`div`,{style:{marginTop:8},children:(0,F.jsxs)(R,{tone:`warn`,children:[(0,F.jsx)(He,{className:`icon`,style:{verticalAlign:`-2px`}}),` `,a]})})]})}function po({guildId:e,bots:t}){if(!t)return(0,F.jsx)(st,{rows:2,height:28});let n=[];t.orchestrator&&n.push({kind:`orchestrator`,bot:t.orchestrator});for(let e of t.waifus)n.push({kind:`waifu`,bot:e});return n.length===0?(0,F.jsxs)(R,{tone:`warn`,children:[`No Discord bots configured yet. Register the orchestrator on `,(0,F.jsx)(`strong`,{children:`Orchestrator`}),` `,`and each waifu bot in the `,(0,F.jsx)(`strong`,{children:`Waifus`}),` editor first.`]}):(0,F.jsx)(`div`,{className:`table-wrap`,children:(0,F.jsxs)(`table`,{className:`data-table`,children:[(0,F.jsx)(`thead`,{children:(0,F.jsxs)(`tr`,{children:[(0,F.jsx)(`th`,{children:`Bot`}),(0,F.jsx)(`th`,{children:`Kind`}),(0,F.jsx)(`th`,{children:`Application ID`}),(0,F.jsx)(`th`,{children:`Token`}),(0,F.jsx)(`th`,{children:`Invite`})]})}),(0,F.jsx)(`tbody`,{children:n.map(t=>{if(!t.bot)return null;let n=t.bot.applicationId&&St(t.bot.applicationId);return(0,F.jsxs)(`tr`,{children:[(0,F.jsxs)(`td`,{children:[(0,F.jsx)(`div`,{style:{fontWeight:600},children:t.bot.displayName}),(0,F.jsx)(`div`,{style:{color:`var(--text-muted)`,fontSize:`var(--fs-xs)`},children:(0,F.jsx)(`code`,{children:t.bot.id})})]}),(0,F.jsx)(`td`,{children:(0,F.jsx)(I,{tone:t.kind===`orchestrator`?`info`:`neutral`,children:t.kind})}),(0,F.jsx)(`td`,{style:{fontFamily:`var(--font-mono)`,fontSize:`var(--fs-xs)`},children:t.bot.applicationId||(0,F.jsx)(`span`,{style:{color:`var(--text-muted)`},children:`not set`})}),(0,F.jsx)(`td`,{children:t.bot.tokenConfigured?(0,F.jsx)(I,{tone:`ok`,dot:!0,children:`saved`}):(0,F.jsx)(I,{tone:`warn`,dot:!0,children:`missing`})}),(0,F.jsx)(`td`,{children:n?(0,F.jsx)(mo,{url:xt(t.bot.applicationId,t.kind,e)}):(0,F.jsx)(`span`,{style:{color:`var(--text-muted)`,fontSize:`var(--fs-xs)`},children:`add a valid Application ID on the matching bot page`})})]},`${t.kind}:${t.bot.id}`)})})]})})}function mo({url:e}){let[t,n]=(0,C.useState)(!1);return(0,F.jsxs)(`div`,{className:`row tight`,children:[(0,F.jsxs)(`a`,{className:`btn sm primary`,href:e,target:`_blank`,rel:`noreferrer`,children:[`Open `,(0,F.jsx)(ge,{className:`icon`})]}),(0,F.jsxs)(`button`,{className:`btn sm`,onClick:async()=>{try{await navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),1500)}catch{}},children:[t?(0,F.jsx)(oe,{className:`icon`}):(0,F.jsx)(me,{className:`icon`}),t?`Copied`:`Copy`]})]})}var ho=[{key:`loopBreaking`,label:`<loop_breaking>`},{key:`retriggerPacing`,label:`<retrigger_pacing>`},{key:`messageStructure`,label:`<chat_message_structure>`},{key:`toolUse`,label:`<tool_use>`}];function go(){let e=L(e=>P.providers(e),[]),t=L(e=>P.models(e),[]),n=L(e=>P.servers(e),[]),r=L(e=>P.orchestratorConfig(e),[]),i=L(e=>P.discordBots(e),[]),a=L(e=>P.orchestratorHistory(e),[]),[o,s]=(0,C.useState)(``),[c,l]=(0,C.useState)(``),[u,d]=(0,C.useState)({}),[f,p]=(0,C.useState)({loopBreaking:!0,retriggerPacing:!0,messageStructure:!0,toolUse:!0}),[m,h]=(0,C.useState)(!1),[g,_]=(0,C.useState)(!1),[v,y]=(0,C.useState)(`Orchestrator`),[b,x]=(0,C.useState)(``),[S,w]=(0,C.useState)(``),[T,ee]=(0,C.useState)(!1),[E,D]=(0,C.useState)(!1),[te,ne]=(0,C.useState)(void 0),[re,ie]=(0,C.useState)(``);(0,C.useEffect)(()=>{r.data&&(s(r.data.providerId??``),l(r.data.modelId??``),d(r.data.reasoning??{}),p(r.data.promptSections),h(r.data.useLegacyPrompt??!1),_(r.data.clipSceneDirection??!1))},[r.data]),(0,C.useEffect)(()=>{i.data&&(y(i.data.orchestrator?.displayName??`Orchestrator`),x(i.data.orchestrator?.applicationId??``),w(``))},[i.data?.revision]),(0,C.useEffect)(()=>{if(re||!n.data)return;let e=yo(n.data);e&&ie(e.value)},[n.data,re]);let ae=async()=>{if(r.data){D(!0),ne(void 0);try{let e=await P.putOrchestratorConfig({...r.data,providerId:o||void 0,modelId:c||void 0,enabled:!0,reasoning:u,promptSections:f,useLegacyPrompt:m,clipSceneDirection:g});if(r.setData(e),i.data){let e=i.data.orchestrator??{id:`orchestrator`,displayName:`Orchestrator`,enabled:!0},t=await P.putDiscordBots({...i.data,orchestrator:{...e,id:`orchestrator`,displayName:v.trim()||`Orchestrator`,applicationId:b.trim()||void 0,token:S.trim()||void 0,enabled:!0}});i.setData(t),w(``)}ne(`Orchestrator settings saved.`)}catch(e){ne(e.message)}finally{D(!1)}}},oe=async()=>{ee(!0),ne(void 0);try{let e=await P.triggerOrchestrator(bo(re));ne(e.message),e.history&&a.setData(e.history)}catch(e){ne(e.message)}finally{ee(!1)}},se=o?t.data?.models.filter(e=>e.providerId===o):t.data?.models,O=t.data?.models.find(e=>e.modelId===c&&(!o||e.providerId===o));return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`div`,{className:`view-header`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`h2`,{className:`view-title`,children:`Orchestrator`}),(0,F.jsx)(`p`,{className:`view-subtitle`,children:`Picks which waifus respond, when to trigger the stage manager or reviewer, and when to stay silent.`})]}),(0,F.jsxs)(`div`,{className:`view-actions`,children:[(0,F.jsxs)(`button`,{className:`btn`,onClick:ae,disabled:!r.data||E,children:[(0,F.jsx)(Ne,{className:`icon`}),E?`Saving…`:`Save config`]}),(0,F.jsxs)(`button`,{className:`btn primary`,onClick:oe,disabled:T,children:[(0,F.jsx)(ue,{className:`icon`}),T?`Triggering…`:`Trigger now`]})]})]}),r.error&&(0,F.jsx)(R,{tone:`err`,children:r.error.message}),i.error&&(0,F.jsx)(R,{tone:`err`,children:i.error.message}),te&&(0,F.jsx)(`div`,{style:{marginTop:12},children:(0,F.jsx)(R,{tone:`info`,children:te})}),(0,F.jsxs)(`section`,{className:`section`,style:{marginTop:16},children:[(0,F.jsxs)(`div`,{className:`section-header`,children:[(0,F.jsx)(`h3`,{className:`section-title`,children:`Discord bot`}),(0,F.jsx)(`span`,{className:`section-description`,children:`The orchestrator listens for Discord messages and decides which waifu should reply.`})]}),i.loading&&(0,F.jsx)(ot,{height:40}),i.data&&(0,F.jsxs)(`div`,{className:`grid grid-2`,children:[(0,F.jsxs)(`div`,{className:`field`,children:[(0,F.jsx)(`label`,{className:`field-label`,children:`Display name`}),(0,F.jsx)(`input`,{className:`input`,value:v,onChange:e=>y(e.target.value),placeholder:`Orchestrator`}),(0,F.jsx)(`span`,{className:`field-hint`,children:`Friendly label shown in this UI.`})]}),(0,F.jsxs)(`div`,{className:`field`,children:[(0,F.jsx)(`label`,{className:`field-label`,children:`Application ID`}),(0,F.jsx)(`input`,{className:`input code`,value:b,onChange:e=>x(e.target.value),placeholder:`17-20 digit Discord application id`})]}),(0,F.jsxs)(`div`,{className:`field`,children:[(0,F.jsx)(`label`,{className:`field-label`,children:`Bot token`}),(0,F.jsx)(`input`,{className:`input code`,type:`password`,value:S,onChange:e=>w(e.target.value),placeholder:i.data.orchestrator?.tokenConfigured?`Saved ${i.data.orchestrator.tokenHint??``} - leave blank to keep`:`Paste bot token`}),(0,F.jsx)(`span`,{className:`field-hint`,children:`Token is write-only and redacted after save.`})]}),(0,F.jsxs)(`div`,{className:`field`,children:[(0,F.jsx)(`label`,{className:`field-label`,children:`Status`}),(0,F.jsxs)(`div`,{className:`row`,children:[i.data.orchestrator?.tokenConfigured?(0,F.jsx)(I,{tone:`ok`,dot:!0,children:`token saved`}):(0,F.jsx)(I,{tone:`warn`,dot:!0,children:`missing token`}),i.data.orchestrator?.applicationId?(0,F.jsx)(I,{tone:`ok`,dot:!0,children:`app id saved`}):(0,F.jsx)(I,{tone:`warn`,dot:!0,children:`missing app id`})]})]})]}),(0,F.jsx)(Ct,{kind:`orchestrator`,applicationId:b||i.data?.orchestrator?.applicationId,botDisplayName:v,collapsedByDefault:!!i.data?.orchestrator?.tokenConfigured})]}),(0,F.jsxs)(`section`,{className:`section`,children:[(0,F.jsxs)(`div`,{className:`section-header`,children:[(0,F.jsx)(`h3`,{className:`section-title`,children:`Model`}),(0,F.jsx)(`span`,{className:`section-description`,children:`Filtered to providers with credentials configured.`})]}),e.loading&&(0,F.jsx)(ot,{height:40}),e.data&&(0,F.jsxs)(`div`,{className:`grid grid-2`,children:[(0,F.jsxs)(`div`,{className:`field`,children:[(0,F.jsx)(`label`,{className:`field-label`,children:`Provider`}),(0,F.jsxs)(`select`,{className:`select`,value:o,onChange:e=>{s(e.target.value),l(``)},children:[(0,F.jsx)(`option`,{value:``,children:`— Any —`}),e.data.providers.map(e=>(0,F.jsxs)(`option`,{value:e.id,disabled:!e.credentials.configured,children:[e.displayName,` `,e.credentials.configured?``:`(no key)`]},e.id))]})]}),(0,F.jsxs)(`div`,{className:`field`,children:[(0,F.jsx)(`label`,{className:`field-label`,children:`Model`}),(0,F.jsxs)(`select`,{className:`select`,value:c,onChange:e=>l(e.target.value),children:[(0,F.jsx)(`option`,{value:``,children:`— Select —`}),(se??[]).map(e=>(0,F.jsxs)(`option`,{value:e.modelId,children:[e.displayName,` (`,e.modelId,`)`]},`${e.providerId}/${e.modelId}`))]})]}),(0,F.jsx)(Lt,{model:O,value:u,onChange:d})]}),O&&!It(O)&&(0,F.jsx)(`span`,{className:`field-hint`,children:`Selected model does not expose reasoning controls.`})]}),(0,F.jsxs)(`section`,{className:`section`,children:[(0,F.jsxs)(`div`,{className:`section-header`,children:[(0,F.jsx)(`h3`,{className:`section-title`,children:`Prompt`}),(0,F.jsx)(`span`,{className:`section-description`,children:`Toggle optional sections of the orchestrator system prompt. Identity, hard rules, task instructions, server info, and active waifus are always included. Turning on the legacy prompt overrides everything and uses the recovered original prompt instead.`})]}),(0,F.jsx)(Ft,{label:`Use legacy prompt (overrides all sections)`,checked:m,onChange:h}),(0,F.jsx)(Ft,{label:`Clip scene direction before waifu call`,checked:g,onChange:_}),!m&&(0,F.jsx)(`div`,{className:`grid grid-2`,style:{marginTop:12},children:ho.map(e=>(0,F.jsx)(Ft,{label:e.label,checked:f[e.key],onChange:t=>p(n=>({...n,[e.key]:t}))},e.key))})]}),(0,F.jsxs)(`section`,{className:`section`,children:[(0,F.jsxs)(`div`,{className:`section-header`,children:[(0,F.jsx)(`h3`,{className:`section-title`,children:`Manual trigger target`}),(0,F.jsx)(`span`,{className:`section-description`,children:`Selecting a channel runs the runtime pipeline; no target records a dry manual entry.`})]}),(0,F.jsxs)(`div`,{className:`field`,children:[(0,F.jsx)(`label`,{className:`field-label`,children:`Server / channel`}),(0,F.jsxs)(`select`,{className:`select`,value:re,onChange:e=>ie(e.target.value),children:[(0,F.jsx)(`option`,{value:``,children:`No target`}),vo(n.data).map(e=>(0,F.jsxs)(`option`,{value:e.value,disabled:!e.enabled,children:[e.label,e.enabled?``:` (disabled)`]},e.value))]})]})]}),(0,F.jsxs)(`section`,{className:`section`,children:[(0,F.jsxs)(`div`,{className:`section-header`,children:[(0,F.jsx)(`h3`,{className:`section-title`,children:`Decision tool schema (read-only)`}),(0,F.jsx)(`span`,{className:`section-description`,children:`Orchestrator must emit exactly one structured decision.`})]}),(0,F.jsx)(`pre`,{className:`code-block`,children:`type OrchestratorDecision = {
14
+ action: "reply" | "no_reply";
15
+ respondingWaifus: Array<{
16
+ waifuId: string;
17
+ delaySeconds: number; // >= 0
18
+ replyStyle: "normal" | "short" | "long" | "sleepy";
19
+ repleyToMessageIndex: number | null;
20
+ sceneDirection: string | null;
21
+ }>;
22
+ retriggerAfterSeconds: number | null; // required when action="no_reply", 100..28800
23
+ reasoning: string;
24
+ };
25
+
26
+ // action="reply" -> respondingWaifus non-empty, retriggerAfterSeconds null
27
+ // action="no_reply" -> respondingWaifus empty, retriggerAfterSeconds in [100, 28800]`})]}),(0,F.jsxs)(`section`,{className:`section`,children:[(0,F.jsxs)(`div`,{className:`section-header`,children:[(0,F.jsx)(`h3`,{className:`section-title`,children:`Decision history`}),(0,F.jsx)(`span`,{className:`section-description`,children:`Recent decisions per server/channel.`})]}),(a.data?.decisions.length??0)===0?(0,F.jsx)(z,{title:`No decisions yet`,icon:(0,F.jsx)(pe,{className:`icon-lg`}),children:`Trigger the orchestrator or let the runtime pipeline run to record decisions here.`}):(0,F.jsxs)(`div`,{className:`table`,children:[(0,F.jsxs)(`div`,{className:`tr head`,children:[(0,F.jsx)(`span`,{children:`Time`}),(0,F.jsx)(`span`,{children:`Action`}),(0,F.jsx)(`span`,{children:`Status`}),(0,F.jsx)(`span`,{children:`Execution`}),(0,F.jsx)(`span`,{children:`Retrigger`}),(0,F.jsx)(`span`,{children:`Reasoning`})]}),a.data?.decisions.map(e=>(0,F.jsxs)(`div`,{className:`tr`,children:[(0,F.jsx)(`span`,{children:new Date(e.createdAt).toLocaleTimeString()}),(0,F.jsx)(`span`,{children:e.action}),(0,F.jsx)(`span`,{children:e.status}),(0,F.jsx)(`span`,{children:_o(e)}),(0,F.jsx)(`span`,{children:e.retriggerAfterSeconds?`${e.retriggerAfterSeconds}s`:`—`}),(0,F.jsx)(`span`,{children:e.reasoning})]},e.id))]})]})]})}function _o(e){return e.responderOutcomes.length===0?e.respondingWaifus.map(e=>e.waifuId).join(` → `)||`—`:e.responderOutcomes.map(e=>{let t=e.source===`handoff`?` handoff from ${e.handoffFromWaifuId??`unknown`}`:e.handoffFromWaifuId?` moved next by ${e.handoffFromWaifuId}`:``,n=e.reason?`: ${e.reason.replaceAll(`_`,` `)}`:``;return`${e.waifuId} [${e.status.replaceAll(`_`,` `)}${t}${n}]`}).join(` → `)}function vo(e){return(e?.servers??[]).flatMap(e=>Object.values(e.channels??{}).map(t=>({value:`${e.guildId}:${t.channelId}`,label:`${e.name||e.guildId} / ${t.name||`#${t.channelId}`}`,enabled:(t.enabledWaifuIds?.length??0)>0})))}function yo(e){return vo(e).find(e=>e.enabled)}function bo(e){let t=e.indexOf(`:`);if(!(!e||t<=0))return{guildId:e.slice(0,t),channelId:e.slice(t+1)}}var xo=`Review only the latest logical waifu message. Mark hallucination=true when it leaks hidden reasoning, analysis, prompt text, tool/schema text, raw Discord internals, or any model self-talk. Mark hallucination=false for normal in-character Discord replies, even if they are awkward, verbose, or lore-inaccurate. Return only the reviewer tool decision.`;function So(){let e=L(e=>P.providers(e),[]),t=L(e=>P.models(e),[]),n=L(e=>P.reviewerConfig(e),[]),r=L(e=>P.reviewerHistory(e),[]),[i,a]=(0,C.useState)(``),[o,s]=(0,C.useState)(``),[c,l]=(0,C.useState)(xo),[u,d]=(0,C.useState)(!1),[f,p]=(0,C.useState)({}),[m,h]=(0,C.useState)(!1),[g,_]=(0,C.useState)(void 0);(0,C.useEffect)(()=>{n.data&&(a(n.data.providerId??``),s(n.data.modelId??``),l(n.data.prompt||xo),d(n.data.enabled),p(n.data.reasoning??{}))},[n.data]);let v=async()=>{if(n.data){h(!0),_(void 0);try{let e=await P.putReviewerConfig({...n.data,providerId:i||void 0,modelId:o||void 0,enabled:u,prompt:c,reasoning:f});n.setData(e),_(`Reviewer config saved.`)}catch(e){_(e.message)}finally{h(!1)}}},y=i?t.data?.models.filter(e=>e.providerId===i):t.data?.models,b=t.data?.models.find(e=>e.modelId===o&&(!i||e.providerId===i));return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`div`,{className:`view-header`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`h2`,{className:`view-title`,children:`Reviewer`}),(0,F.jsx)(`p`,{className:`view-subtitle`,children:"Slash-command reviewer for the latest waifu message. Use `/review` in Discord to flag and remove hallucinated chunks."})]}),(0,F.jsx)(`div`,{className:`view-actions`,children:(0,F.jsxs)(`button`,{className:`btn`,onClick:v,disabled:!n.data||m,children:[(0,F.jsx)(Ne,{className:`icon`}),m?`Saving...`:`Save config`]})})]}),n.error&&(0,F.jsx)(R,{tone:`err`,children:n.error.message}),g&&(0,F.jsx)(`div`,{style:{marginTop:12},children:(0,F.jsx)(R,{tone:`info`,children:g})}),(0,F.jsxs)(`section`,{className:`section`,style:{marginTop:16},children:[(0,F.jsxs)(`div`,{className:`section-header`,children:[(0,F.jsx)(`h3`,{className:`section-title`,children:`Model`}),(0,F.jsx)(`span`,{className:`section-description`,children:`Reviewer receives one logical waifu message and returns a yes/no tool decision.`})]}),e.loading&&(0,F.jsx)(ot,{height:40}),e.data&&(0,F.jsxs)(`div`,{className:`grid grid-2`,children:[(0,F.jsxs)(`div`,{className:`field`,children:[(0,F.jsx)(`label`,{className:`field-label`,children:`Provider`}),(0,F.jsxs)(`select`,{className:`select`,value:i,onChange:e=>{a(e.target.value),s(``)},children:[(0,F.jsx)(`option`,{value:``,children:`- Any -`}),e.data.providers.map(e=>(0,F.jsxs)(`option`,{value:e.id,disabled:!e.credentials.configured,children:[e.displayName,` `,e.credentials.configured?``:`(no key)`]},e.id))]})]}),(0,F.jsxs)(`div`,{className:`field`,children:[(0,F.jsx)(`label`,{className:`field-label`,children:`Model`}),(0,F.jsxs)(`select`,{className:`select`,value:o,onChange:e=>s(e.target.value),children:[(0,F.jsx)(`option`,{value:``,children:`- Select -`}),(y??[]).map(e=>(0,F.jsxs)(`option`,{value:e.modelId,children:[e.displayName,` (`,e.modelId,`)`]},`${e.providerId}/${e.modelId}`))]})]}),(0,F.jsxs)(`div`,{className:`field`,children:[(0,F.jsx)(`label`,{className:`field-label`,children:`Runtime status`}),(0,F.jsx)(Ft,{checked:u,onChange:d,label:u?`Enabled`:`Disabled`}),(0,F.jsx)(`span`,{className:`field-hint`,children:"Disabled reviewer configs ignore `/review` commands."})]}),(0,F.jsx)(Lt,{model:b,value:f,onChange:p})]}),b&&!It(b)&&(0,F.jsx)(`span`,{className:`field-hint`,children:`Selected model does not expose reasoning controls.`})]}),(0,F.jsxs)(`section`,{className:`section`,children:[(0,F.jsxs)(`div`,{className:`section-header`,children:[(0,F.jsx)(`h3`,{className:`section-title`,children:`Prompt`}),(0,F.jsx)(`span`,{className:`section-description`,children:`Detection policy appended before the fixed JSON decision schema.`})]}),(0,F.jsx)(`textarea`,{className:`textarea`,value:c,onChange:e=>l(e.target.value),rows:8})]}),(0,F.jsxs)(`section`,{className:`section`,children:[(0,F.jsx)(`div`,{className:`section-header`,children:(0,F.jsx)(`h3`,{className:`section-title`,children:`Tool Schema`})}),(0,F.jsx)(`pre`,{className:`code-block`,children:`review_message({ hallucination: boolean })`})]}),(0,F.jsxs)(`section`,{className:`section`,children:[(0,F.jsx)(`div`,{className:`section-header`,children:(0,F.jsx)(`h3`,{className:`section-title`,children:`Review History`})}),(r.data?.reviews.length??0)===0?(0,F.jsx)(z,{title:`No reviews yet`,icon:(0,F.jsx)(Le,{className:`icon-lg`}),children:"Use `/review` in a connected Discord channel to record reviewer decisions."}):(0,F.jsxs)(`div`,{className:`table`,children:[(0,F.jsxs)(`div`,{className:`tr head`,children:[(0,F.jsx)(`span`,{children:`Time`}),(0,F.jsx)(`span`,{children:`Verdict`}),(0,F.jsx)(`span`,{children:`Deleted`}),(0,F.jsx)(`span`,{children:`Message IDs`})]}),r.data?.reviews.map(e=>(0,F.jsxs)(`div`,{className:`tr`,children:[(0,F.jsx)(`span`,{children:new Date(e.createdAt).toLocaleTimeString()}),(0,F.jsx)(`span`,{children:e.hallucination?`hallucination`:`clean`}),(0,F.jsx)(`span`,{children:e.deleted?`yes`:`no`}),(0,F.jsx)(`span`,{children:e.targetMessageIds.join(`, `)||`-`})]},e.id))]})]})]})}function Co(){let e=L(e=>P.providers(e),[]),t=L(e=>P.models(e),[]),n=L(e=>P.servers(e),[]),r=L(e=>P.stageManagerConfig(e),[]),i=L(e=>P.stageManagerHistory(e),[]),[a,o]=(0,C.useState)(``),[s,c]=(0,C.useState)(``),[l,u]=(0,C.useState)(!1),[d,f]=(0,C.useState)({}),[p,m]=(0,C.useState)(!1),[h,g]=(0,C.useState)(!1),[_,v]=(0,C.useState)(void 0),[y,b]=(0,C.useState)(``);(0,C.useEffect)(()=>{r.data&&(o(r.data.providerId??``),c(r.data.modelId??``),u(r.data.enabled),f(r.data.reasoning??{}))},[r.data]),(0,C.useEffect)(()=>{if(y||!n.data)return;let e=To(n.data);e&&b(e.value)},[n.data,y]);let x=async()=>{if(r.data){g(!0),v(void 0);try{let e=await P.putStageManagerConfig({...r.data,providerId:a||void 0,modelId:s||void 0,enabled:l,reasoning:d});r.setData(e),v(`Stage-manager config saved.`)}catch(e){v(e.message)}finally{g(!1)}}},S=async()=>{m(!0),v(void 0);try{let e=await P.triggerStageManager(Eo(y));v(e.message),e.history&&i.setData(e.history)}catch(e){v(e.message)}finally{m(!1)}},w=a?t.data?.models.filter(e=>e.providerId===a):t.data?.models,T=t.data?.models.find(e=>e.modelId===s&&(!a||e.providerId===a));return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`div`,{className:`view-header`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`h2`,{className:`view-title`,children:`Stage manager`}),(0,F.jsx)(`p`,{className:`view-subtitle`,children:`Background reviewer of long-window context that edits waifu memories without blocking replies.`})]}),(0,F.jsxs)(`div`,{className:`view-actions`,children:[(0,F.jsxs)(`button`,{className:`btn`,onClick:x,disabled:!r.data||h,children:[(0,F.jsx)(Ne,{className:`icon`}),h?`Saving…`:`Save config`]}),(0,F.jsxs)(`button`,{className:`btn primary`,onClick:S,disabled:p,children:[(0,F.jsx)(ue,{className:`icon`}),p?`Triggering…`:`Trigger now`]})]})]}),r.error&&(0,F.jsx)(R,{tone:`err`,children:r.error.message}),_&&(0,F.jsx)(`div`,{style:{marginTop:12},children:(0,F.jsx)(R,{tone:`info`,children:_})}),(0,F.jsxs)(`section`,{className:`section`,style:{marginTop:16},children:[(0,F.jsxs)(`div`,{className:`section-header`,children:[(0,F.jsx)(`h3`,{className:`section-title`,children:`Model`}),(0,F.jsx)(`span`,{className:`section-description`,children:`Defaults to a long-context model when available.`})]}),e.loading&&(0,F.jsx)(ot,{height:40}),e.data&&(0,F.jsxs)(`div`,{className:`grid grid-2`,children:[(0,F.jsxs)(`div`,{className:`field`,children:[(0,F.jsx)(`label`,{className:`field-label`,children:`Provider`}),(0,F.jsxs)(`select`,{className:`select`,value:a,onChange:e=>{o(e.target.value),c(``)},children:[(0,F.jsx)(`option`,{value:``,children:`— Any —`}),e.data.providers.map(e=>(0,F.jsxs)(`option`,{value:e.id,disabled:!e.credentials.configured,children:[e.displayName,` `,e.credentials.configured?``:`(no key)`]},e.id))]})]}),(0,F.jsxs)(`div`,{className:`field`,children:[(0,F.jsx)(`label`,{className:`field-label`,children:`Model`}),(0,F.jsxs)(`select`,{className:`select`,value:s,onChange:e=>c(e.target.value),children:[(0,F.jsx)(`option`,{value:``,children:`— Select —`}),(w??[]).map(e=>(0,F.jsxs)(`option`,{value:e.modelId,children:[e.displayName,` (`,e.modelId,`)`]},`${e.providerId}/${e.modelId}`))]})]}),(0,F.jsxs)(`div`,{className:`field`,children:[(0,F.jsx)(`label`,{className:`field-label`,children:`Runtime status`}),(0,F.jsx)(Ft,{checked:l,onChange:u,label:l?`Enabled`:`Disabled`}),(0,F.jsx)(`span`,{className:`field-hint`,children:`Disabled stage-manager configs skip memory review.`})]}),(0,F.jsx)(Lt,{model:T,value:d,onChange:f})]}),T&&!It(T)&&(0,F.jsx)(`span`,{className:`field-hint`,children:`Selected model does not expose reasoning controls.`})]}),(0,F.jsxs)(`section`,{className:`section`,children:[(0,F.jsxs)(`div`,{className:`section-header`,children:[(0,F.jsx)(`h3`,{className:`section-title`,children:`Manual trigger target`}),(0,F.jsx)(`span`,{className:`section-description`,children:`Selecting a channel runs the background memory reviewer for that channel.`})]}),(0,F.jsxs)(`div`,{className:`field`,children:[(0,F.jsx)(`label`,{className:`field-label`,children:`Server / channel`}),(0,F.jsxs)(`select`,{className:`select`,value:y,onChange:e=>b(e.target.value),children:[(0,F.jsx)(`option`,{value:``,children:`No target`}),wo(n.data).map(e=>(0,F.jsxs)(`option`,{value:e.value,disabled:!e.enabled,children:[e.label,e.enabled?``:` (disabled)`]},e.value))]})]})]}),(0,F.jsxs)(`section`,{className:`section`,children:[(0,F.jsx)(`div`,{className:`section-header`,children:(0,F.jsx)(`h3`,{className:`section-title`,children:`Pipeline`})}),(0,F.jsx)(`pre`,{className:`code-block`,children:`Pass 1 — Observer: extract atomic durable observations from chat.
28
+ record_observations(observations[{ waifuId, content, importance, kind }])
29
+
30
+ Pass 2 — Librarian: reconcile observations with existing memories.
31
+ add_memory(waifuId, content, importance)
32
+ update_memory(memoryIndex, fields)
33
+ archive_memory(memoryIndex)
34
+ merge_memories(sourceMemoryIndices[], mergedContent)
35
+ no_change(reason)`})]}),(0,F.jsxs)(`section`,{className:`section`,children:[(0,F.jsx)(`div`,{className:`section-header`,children:(0,F.jsx)(`h3`,{className:`section-title`,children:`Memory edit history`})}),(i.data?.edits.length??0)===0?(0,F.jsx)(z,{title:`No edits yet`,icon:(0,F.jsx)(we,{className:`icon-lg`}),children:`Trigger the stage manager or let the runtime pipeline run to record memory tool calls.`}):(0,F.jsxs)(`div`,{className:`table`,children:[(0,F.jsxs)(`div`,{className:`tr head`,children:[(0,F.jsx)(`span`,{children:`Time`}),(0,F.jsx)(`span`,{children:`Tool`}),(0,F.jsx)(`span`,{children:`Obs`}),(0,F.jsx)(`span`,{children:`Memory IDs`}),(0,F.jsx)(`span`,{children:`Summary`})]}),i.data?.edits.map(e=>(0,F.jsxs)(`div`,{className:`tr`,children:[(0,F.jsx)(`span`,{children:new Date(e.createdAt).toLocaleTimeString()}),(0,F.jsx)(`span`,{children:e.tool}),(0,F.jsx)(`span`,{children:e.observationCount??`—`}),(0,F.jsx)(`span`,{children:e.affectedMemoryIds.join(`, `)||`—`}),(0,F.jsx)(`span`,{children:e.summary})]},e.id))]})]}),(0,F.jsxs)(`section`,{className:`section`,children:[(0,F.jsx)(`div`,{className:`section-header`,children:(0,F.jsx)(`h3`,{className:`section-title`,children:`Background status`})}),(0,F.jsxs)(`div`,{className:`kv`,children:[(0,F.jsx)(`span`,{className:`k`,children:`Last run`}),(0,F.jsx)(`span`,{className:`v`,children:i.data?.edits[0]?.createdAt?new Date(i.data.edits[0].createdAt).toLocaleString():`—`}),(0,F.jsx)(`span`,{className:`k`,children:`Active per channel`}),(0,F.jsx)(`span`,{className:`v`,children:`0`}),(0,F.jsx)(`span`,{className:`k`,children:`Pending`}),(0,F.jsx)(`span`,{className:`v`,children:`0`})]})]})]})}function wo(e){return(e?.servers??[]).flatMap(e=>Object.values(e.channels??{}).map(t=>({value:`${e.guildId}:${t.channelId}`,label:`${e.name||e.guildId} / ${t.name||`#${t.channelId}`}`,enabled:(t.enabledWaifuIds?.length??0)>0})))}function To(e){return wo(e).find(e=>e.enabled)}function Eo(e){let t=e.indexOf(`:`);if(!(!e||t<=0))return{guildId:e.slice(0,t),channelId:e.slice(t+1)}}var Do=[`active`,`archived`],Oo=[1,2,3,4,5].reverse();function ko(){let e=L(e=>P.memories(e),[]),t=L(e=>P.shortTermMemories(e),[]),n=L(e=>P.waifus(e),[]),r=L(e=>P.servers(e),[]),[i,a]=(0,C.useState)(``),[o,s]=(0,C.useState)(``),[c,l]=(0,C.useState)(`active`),[u,d]=(0,C.useState)(``),[f,p]=(0,C.useState)(``),[m,h]=(0,C.useState)(``),[g,_]=(0,C.useState)(void 0),[v,y]=(0,C.useState)(void 0),[b,x]=(0,C.useState)(!1),[S,w]=(0,C.useState)(void 0),[T,ee]=(0,C.useState)(void 0),[,E]=(0,C.useState)(0);(0,C.useEffect)(()=>{let e=window.setInterval(()=>E(e=>e+1),6e4);return()=>window.clearInterval(e)},[]);let D=(0,C.useMemo)(()=>{let n=(e.data?.memories??[]).map(e=>({kind:`long-term`,data:e})),r=(t.data?.entries??[]).map(e=>({kind:`short-term`,data:e}));return[...n,...r]},[e.data,t.data]),te=(0,C.useMemo)(()=>D.filter(e=>{if(m&&e.kind!==m||i&&e.data.waifuId!==i||f&&!e.data.content.toLowerCase().includes(f.toLowerCase()))return!1;if(e.kind===`long-term`){if(o&&e.data.guildId!==o||c&&e.data.status!==c||u===`permanent`&&!e.data.permanent||u&&u!==`permanent`&&(e.data.permanent||String(e.data.importance)!==u))return!1}else if(o&&e.data.guildId!==o||c&&c!==`active`||u)return!1;return!0}),[D,m,i,o,c,u,f]);return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`div`,{className:`view-header`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`h2`,{className:`view-title`,children:`Memories`}),(0,F.jsx)(`p`,{className:`view-subtitle`,children:`Per-waifu guild memory store. Permanent memories are user-managed and hidden from the stage manager.`})]}),(0,F.jsxs)(`div`,{className:`view-actions`,children:[(0,F.jsx)(`button`,{className:`btn`,onClick:()=>{e.reload(),t.reload()},children:`Refresh`}),(0,F.jsxs)(`button`,{className:`btn primary`,onClick:()=>x(!0),children:[(0,F.jsx)(je,{className:`icon`}),` New memory`]})]})]}),S&&(0,F.jsxs)(R,{tone:`warn`,title:`Memory store changed during your edit`,children:[`The server returned 409 with the latest snapshot.`,` `,(0,F.jsx)(`button`,{className:`btn sm`,onClick:()=>{e.setData(S),w(void 0)},children:`Apply latest`})]}),T&&(0,F.jsxs)(R,{tone:`warn`,title:`Short-term store changed during your edit`,children:[`The server returned 409 with the latest snapshot.`,` `,(0,F.jsx)(`button`,{className:`btn sm`,onClick:()=>{t.setData(T),ee(void 0)},children:`Apply latest`})]}),(0,F.jsxs)(`div`,{className:`toolbar`,children:[(0,F.jsxs)(`select`,{className:`select`,value:m,onChange:e=>h(e.target.value),style:{maxWidth:160},children:[(0,F.jsx)(`option`,{value:``,children:`All types`}),(0,F.jsx)(`option`,{value:`long-term`,children:`Long-term`}),(0,F.jsx)(`option`,{value:`short-term`,children:`Short-term`})]}),(0,F.jsxs)(`select`,{className:`select`,value:i,onChange:e=>a(e.target.value),style:{maxWidth:200},children:[(0,F.jsx)(`option`,{value:``,children:`All waifus`}),(n.data?.waifus??[]).map(e=>(0,F.jsx)(`option`,{value:e.id,children:e.displayName},e.id))]}),(0,F.jsxs)(`select`,{className:`select`,value:o,onChange:e=>s(e.target.value),style:{maxWidth:220},children:[(0,F.jsx)(`option`,{value:``,children:`All guilds`}),(r.data?.servers??[]).map(e=>(0,F.jsx)(`option`,{value:e.guildId,children:e.name||e.guildId},e.guildId))]}),(0,F.jsxs)(`select`,{className:`select`,value:c,onChange:e=>l(e.target.value),style:{maxWidth:140},children:[(0,F.jsx)(`option`,{value:``,children:`All statuses`}),Do.map(e=>(0,F.jsx)(`option`,{value:e,children:e},e))]}),(0,F.jsxs)(`select`,{className:`select`,value:u,onChange:e=>d(e.target.value),style:{maxWidth:140},children:[(0,F.jsx)(`option`,{value:``,children:`Any importance`}),(0,F.jsx)(`option`,{value:`permanent`,children:`∞ Permanent`}),Oo.map(e=>(0,F.jsxs)(`option`,{value:String(e),children:[`★ `,e]},e))]}),(0,F.jsx)(`input`,{className:`input`,placeholder:`Search content…`,value:f,onChange:e=>p(e.target.value),style:{flex:1,minWidth:200}})]}),(e.loading||t.loading)&&(0,F.jsx)(st,{rows:6}),e.error&&(0,F.jsx)(R,{tone:`err`,children:e.error.message}),t.error&&(0,F.jsx)(R,{tone:`err`,children:t.error.message}),e.data&&t.data&&te.length===0&&(0,F.jsx)(z,{title:`No memories match`,icon:(0,F.jsx)(ae,{className:`icon-lg`}),children:`Adjust filters, or add a memory manually. Stage-manager edits will land here as well.`}),te.length>0&&(0,F.jsx)(`div`,{className:`table-wrap`,children:(0,F.jsxs)(`table`,{className:`data-table`,children:[(0,F.jsx)(`thead`,{children:(0,F.jsxs)(`tr`,{children:[(0,F.jsx)(`th`,{children:`Waifu`}),(0,F.jsx)(`th`,{children:`Guild`}),(0,F.jsx)(`th`,{children:`Importance`}),(0,F.jsx)(`th`,{children:`Status`}),(0,F.jsx)(`th`,{children:`Content`}),(0,F.jsx)(`th`,{children:`Expires`}),(0,F.jsx)(`th`,{children:`Updated`}),(0,F.jsx)(`th`,{})]})}),(0,F.jsx)(`tbody`,{children:te.map(i=>i.kind===`long-term`?(0,F.jsx)(Ao,{memory:i.data,waifus:n.data?.waifus??[],servers:r.data?.servers??[],storeRevision:e.data?.revision??0,onEdit:()=>_(i.data),onUpdated:t=>e.setData(t),onConflict:e=>w(e)},`l-${i.data.id}`):(0,F.jsx)(jo,{entry:i.data,waifus:n.data?.waifus??[],servers:r.data?.servers??[],storeRevision:t.data?.revision??0,onEdit:()=>y(i.data),onUpdated:e=>t.setData(e),onConflict:e=>ee(e)},`s-${i.data.id}`))})]})}),b&&(0,F.jsx)(Mo,{mode:`create`,waifus:n.data?.waifus??[],servers:r.data?.servers??[],revision:e.data?.revision??0,onClose:()=>x(!1),onSaved:(t,n)=>{n&&w(n),t&&e.setData(t),x(!1)}}),g&&(0,F.jsx)(Mo,{mode:`edit`,waifus:n.data?.waifus??[],servers:r.data?.servers??[],revision:e.data?.revision??0,memory:g,onClose:()=>_(void 0),onSaved:(t,n)=>{n&&w(n),t&&e.setData(t),_(void 0)}}),v&&(0,F.jsx)(No,{waifus:n.data?.waifus??[],revision:t.data?.revision??0,entry:v,onClose:()=>y(void 0),onSaved:(e,n)=>{n&&ee(n),e&&t.setData(e),y(void 0)}})]})}function Ao({memory:e,waifus:t,servers:n,storeRevision:r,onEdit:i,onUpdated:a,onConflict:o}){return(0,F.jsxs)(`tr`,{children:[(0,F.jsx)(`td`,{children:t.find(t=>t.id===e.waifuId)?.displayName||e.waifuId}),(0,F.jsx)(`td`,{children:(0,F.jsx)(I,{children:Po(n,e.guildId)})}),(0,F.jsx)(`td`,{children:e.permanent?`∞ Permanent`:`★ ${e.importance}`}),(0,F.jsx)(`td`,{children:e.status===`active`?(0,F.jsx)(I,{tone:`ok`,dot:!0,children:`active`}):(0,F.jsx)(I,{tone:`neutral`,dot:!0,children:`archived`})}),(0,F.jsx)(`td`,{className:`wrap`,style:{maxWidth:480},children:(0,F.jsx)(`div`,{style:{whiteSpace:`normal`,overflow:`hidden`},children:e.content})}),(0,F.jsx)(`td`,{children:(0,F.jsx)(`span`,{style:{color:`var(--text-muted)`},children:`—`})}),(0,F.jsx)(`td`,{children:ct(e.updatedAt)}),(0,F.jsx)(`td`,{className:`right`,children:(0,F.jsxs)(`div`,{className:`cell-actions`,children:[(0,F.jsxs)(`button`,{className:`btn sm`,onClick:i,children:[(0,F.jsx)(ke,{className:`icon`}),` Edit`]}),(0,F.jsx)(`button`,{className:`btn sm`,onClick:async()=>{try{a(await P.updateMemory(e.id,{revision:r,status:e.status===`active`?`archived`:`active`}))}catch(e){e instanceof $e&&o(e.latest)}},children:(0,F.jsx)(te,{className:`icon`})}),(0,F.jsx)(`button`,{className:`btn sm danger`,onClick:async()=>{if(window.confirm(`Delete this memory?`))try{a(await P.deleteMemory(e.id,r))}catch(e){e instanceof $e&&o(e.latest)}},children:(0,F.jsx)(Ve,{className:`icon`})})]})})]})}function jo({entry:e,waifus:t,servers:n,storeRevision:r,onEdit:i,onUpdated:a,onConflict:o}){return(0,F.jsxs)(`tr`,{children:[(0,F.jsx)(`td`,{children:t.find(t=>t.id===e.waifuId)?.displayName||e.waifuId}),(0,F.jsx)(`td`,{children:(0,F.jsx)(I,{children:Po(n,e.guildId)})}),(0,F.jsx)(`td`,{children:(0,F.jsx)(`span`,{style:{color:`var(--text-muted)`},children:`—`})}),(0,F.jsx)(`td`,{children:(0,F.jsx)(`span`,{style:{color:`var(--text-muted)`},children:`—`})}),(0,F.jsx)(`td`,{className:`wrap`,style:{maxWidth:480},children:(0,F.jsx)(`div`,{style:{whiteSpace:`normal`,overflow:`hidden`},children:e.content})}),(0,F.jsx)(`td`,{children:(0,F.jsx)(`span`,{style:{fontFamily:`var(--font-mono)`,fontSize:`var(--fs-xs)`},children:Fo(e.expiresAt)})}),(0,F.jsx)(`td`,{children:ct(e.createdAt)}),(0,F.jsx)(`td`,{className:`right`,children:(0,F.jsxs)(`div`,{className:`cell-actions`,children:[(0,F.jsxs)(`button`,{className:`btn sm`,onClick:i,children:[(0,F.jsx)(ke,{className:`icon`}),` Edit`]}),(0,F.jsx)(`button`,{className:`btn sm danger`,onClick:async()=>{if(window.confirm(`Delete this short-term memory?`))try{a(await P.deleteShortTermMemory(e.id,r))}catch(e){e instanceof $e&&o(e.latest)}},children:(0,F.jsx)(Ve,{className:`icon`})})]})})]})}function Mo({mode:e,waifus:t,servers:n,revision:r,memory:i,onClose:a,onSaved:o}){let[s,c]=(0,C.useState)(i?.waifuId??t[0]?.id??``),[l,u]=(0,C.useState)(i?.guildId??n[0]?.guildId??``),[d,f]=(0,C.useState)(i?.content??``),[p,m]=(0,C.useState)(i?.importance??3),[h,g]=(0,C.useState)(i?.permanent??!1),[_,v]=(0,C.useState)(i?.status??`active`),[y,b]=(0,C.useState)((i?.sourceMessageIds??[]).join(`
36
+ `)),[x,S]=(0,C.useState)(!1),[w,T]=(0,C.useState)(void 0);return(0,F.jsxs)(kt,{open:!0,onClose:()=>!x&&a(),wide:!0,title:e===`create`?`New memory`:`Edit memory`,footer:(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`button`,{className:`btn`,onClick:a,disabled:x,children:`Cancel`}),(0,F.jsx)(`button`,{className:`btn primary`,onClick:async()=>{if(!s||!l||!d.trim()){T(`Waifu, guild, and content are required.`);return}S(!0),T(void 0);let t=y.split(/[,\n\s]+/).map(e=>e.trim()).filter(Boolean);try{e===`create`?o(await P.createMemory({revision:r,waifuId:s,guildId:l,content:d.trim(),importance:p,permanent:h,sourceMessageIds:t}),void 0):i&&o(await P.updateMemory(i.id,{revision:r,waifuId:s,guildId:l,content:d.trim(),importance:p,permanent:h,sourceMessageIds:t,status:_}),void 0)}catch(e){e instanceof $e?o(void 0,e.latest):T(e.message)}finally{S(!1)}},disabled:x,children:x?`Saving…`:e===`create`?`Create`:`Save`})]}),children:[(0,F.jsxs)(`div`,{className:`grid grid-2`,children:[(0,F.jsxs)(`div`,{className:`field`,children:[(0,F.jsx)(`label`,{className:`field-label`,children:`Waifu`}),(0,F.jsxs)(`select`,{className:`select`,value:s,onChange:e=>c(e.target.value),children:[(0,F.jsx)(`option`,{value:``,children:`— Select —`}),t.map(e=>(0,F.jsx)(`option`,{value:e.id,children:e.displayName},e.id))]})]}),(0,F.jsxs)(`div`,{className:`field`,children:[(0,F.jsx)(`label`,{className:`field-label`,children:`Guild`}),(0,F.jsxs)(`select`,{className:`select`,value:l,onChange:e=>u(e.target.value),children:[(0,F.jsx)(`option`,{value:``,children:`— Select —`}),n.map(e=>(0,F.jsx)(`option`,{value:e.guildId,children:e.name||e.guildId},e.guildId))]})]}),(0,F.jsxs)(`div`,{className:`field`,children:[(0,F.jsx)(`label`,{className:`field-label`,children:`Importance / retention`}),(0,F.jsxs)(`select`,{className:`select`,value:h?`permanent`:String(p),onChange:e=>{if(e.target.value===`permanent`){g(!0),i?.permanent||m(5);return}g(!1),m(Number(e.target.value))},children:[(0,F.jsx)(`option`,{value:`permanent`,children:`∞ Permanent`}),Oo.map(e=>(0,F.jsxs)(`option`,{value:String(e),children:[`★ `,e]},e))]}),(0,F.jsx)(`span`,{className:`field-hint`,children:`Active permanent memories stay in the waifu prompt and can only be managed from this dashboard.`})]}),e===`edit`&&(0,F.jsxs)(`div`,{className:`field`,children:[(0,F.jsx)(`label`,{className:`field-label`,children:`Status`}),(0,F.jsx)(`select`,{className:`select`,value:_,onChange:e=>v(e.target.value),children:Do.map(e=>(0,F.jsx)(`option`,{value:e,children:e},e))})]})]}),(0,F.jsxs)(`div`,{className:`field`,children:[(0,F.jsx)(`label`,{className:`field-label`,children:`Content`}),(0,F.jsx)(`textarea`,{className:`textarea`,value:d,onChange:e=>f(e.target.value),rows:6})]}),(0,F.jsxs)(`div`,{className:`field`,children:[(0,F.jsx)(`label`,{className:`field-label`,children:`Source message ids`}),(0,F.jsx)(`textarea`,{className:`textarea`,value:y,onChange:e=>b(e.target.value),rows:3,placeholder:`Comma- or newline-separated Discord message ids`}),(0,F.jsx)(`span`,{className:`field-hint`,children:`Optional but useful when the stage manager surfaces a memory based on real messages.`})]}),w&&(0,F.jsx)(R,{tone:`err`,children:w})]})}function No({waifus:e,revision:t,entry:n,onClose:r,onSaved:i}){let[a,o]=(0,C.useState)(n.waifuId),[s,c]=(0,C.useState)(n.content),[l,u]=(0,C.useState)(!1),[d,f]=(0,C.useState)(void 0);return(0,F.jsxs)(kt,{open:!0,onClose:()=>!l&&r(),wide:!0,title:`Edit short-term memory`,footer:(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`button`,{className:`btn`,onClick:r,disabled:l,children:`Cancel`}),(0,F.jsx)(`button`,{className:`btn primary`,onClick:async()=>{if(!a||!s.trim()){f(`Waifu and content are required.`);return}u(!0),f(void 0);try{i(await P.updateShortTermMemory(n.id,{revision:t,waifuId:a,content:s.trim()}),void 0)}catch(e){e instanceof $e?i(void 0,e.latest):f(e.message)}finally{u(!1)}},disabled:l,children:l?`Saving…`:`Save`})]}),children:[(0,F.jsxs)(`div`,{className:`field`,children:[(0,F.jsx)(`label`,{className:`field-label`,children:`Waifu`}),(0,F.jsxs)(`select`,{className:`select`,value:a,onChange:e=>o(e.target.value),children:[(0,F.jsx)(`option`,{value:``,children:`— Select —`}),e.map(e=>(0,F.jsx)(`option`,{value:e.id,children:e.displayName},e.id))]})]}),(0,F.jsxs)(`div`,{className:`field`,children:[(0,F.jsx)(`label`,{className:`field-label`,children:`Content`}),(0,F.jsx)(`textarea`,{className:`textarea`,value:s,onChange:e=>c(e.target.value),rows:4}),(0,F.jsxs)(`span`,{className:`field-hint`,children:[`Expires `,Fo(n.expiresAt),` from now. Editing does not reset the timer.`]})]}),d&&(0,F.jsx)(R,{tone:`err`,children:d})]})}function Po(e,t){return t?e.find(e=>e.guildId===t)?.name||t:`unassigned`}function Fo(e){let t=Date.parse(e)-Date.now();if(Number.isNaN(t)||t<=0)return`expired`;let n=Math.floor(t/6e4),r=Math.floor(n/60),i=n%60;return r>=1?i===0?`${r}h`:`${r}h ${i}m`:`${Math.max(1,i)}m`}var Io=0;function Lo(){let[e,t]=(0,C.useState)([]),[n,r]=(0,C.useState)(!1),[i,a]=(0,C.useState)(``),[o,s]=(0,C.useState)(``),c=(0,C.useRef)(n);c.current=n;let l=L(e=>P.runtime(e),[]);(0,C.useEffect)(()=>{let e;try{e=tt()}catch{return}let n=e=>{c.current||t(t=>[{id:++Io,...e},...t].slice(0,500))};return e.addEventListener(`runtime`,e=>{let t=e.data;try{let e=JSON.parse(t);n({ts:new Date().toISOString(),level:e?.discord?.warnings?.length?`warn`:`ok`,source:`runtime`,message:zo(e)})}catch{n({ts:new Date().toISOString(),level:`info`,source:`runtime`,message:t})}}),e.addEventListener(`log`,e=>{try{let t=JSON.parse(e.data);n({ts:t.time??new Date().toISOString(),level:Ro(t.level),source:`backend`,message:t.context===void 0?t.message:`${t.message} ${ft(t.context)}`})}catch{n({ts:new Date().toISOString(),level:`info`,source:`backend`,message:e.data})}}),e.onerror=()=>{n({ts:new Date().toISOString(),level:`err`,source:`sse`,message:`Event stream disconnected; will retry.`})},()=>e?.close()},[]);let u=(0,C.useMemo)(()=>e.filter(e=>!(o&&e.level!==o||i&&!`${e.source} ${e.message}`.toLowerCase().includes(i.toLowerCase()))),[e,i,o]);return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`div`,{className:`view-header`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`h2`,{className:`view-title`,children:`Logs & diagnostics`}),(0,F.jsxs)(`p`,{className:`view-subtitle`,children:[`Live SSE events from `,(0,F.jsx)(`code`,{children:`/api/events`}),`. Provider, Discord, queue, and runtime events appear here as the backend emits them.`]})]}),(0,F.jsxs)(`div`,{className:`view-actions`,children:[(0,F.jsx)(`button`,{className:`btn`,onClick:()=>r(e=>!e),children:n?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(Ae,{className:`icon`}),` Resume stream`]}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(Oe,{className:`icon`}),` Pause stream`]})}),(0,F.jsxs)(`button`,{className:`btn`,onClick:()=>t([]),children:[(0,F.jsx)(Ve,{className:`icon`}),` Clear`]}),(0,F.jsxs)(`button`,{className:`btn primary`,onClick:async()=>{try{let e={...await P.diagnosticsBundle(),clientEntries:u.slice(0,200)};await navigator.clipboard.writeText(ft(e)),alert(`Diagnostic bundle copied to clipboard.`)}catch(e){alert(`Copy failed: `+e.message)}},children:[(0,F.jsx)(j,{className:`icon`}),` Copy diagnostic bundle`]})]})]}),(0,F.jsxs)(`div`,{className:`toolbar`,children:[(0,F.jsxs)(`select`,{className:`select`,value:o,onChange:e=>s(e.target.value),style:{maxWidth:140},children:[(0,F.jsx)(`option`,{value:``,children:`All levels`}),(0,F.jsx)(`option`,{value:`info`,children:`info`}),(0,F.jsx)(`option`,{value:`ok`,children:`ok`}),(0,F.jsx)(`option`,{value:`warn`,children:`warn`}),(0,F.jsx)(`option`,{value:`err`,children:`err`})]}),(0,F.jsx)(`input`,{className:`input`,placeholder:`Search source/message…`,value:i,onChange:e=>a(e.target.value),style:{flex:1,minWidth:200}}),(0,F.jsx)(I,{tone:n?`warn`:`ok`,dot:!0,children:n?`paused`:`live`})]}),u.length===0?(0,F.jsx)(z,{title:`No log lines`,icon:(0,F.jsx)(D,{className:`icon-lg`}),children:`Backend, provider, Discord, and queue events will appear here as the orchestrator pipeline runs.`}):(0,F.jsx)(`div`,{className:`log-list`,children:u.map(e=>(0,F.jsxs)(`div`,{className:`log-line`,children:[(0,F.jsx)(`span`,{className:`ts`,children:lt(e.ts)}),(0,F.jsx)(`span`,{className:`lvl `+e.level,children:e.level}),(0,F.jsx)(`span`,{className:`src`,children:e.source}),(0,F.jsx)(`span`,{className:`msg`,children:e.message})]},e.id))}),(0,F.jsxs)(`section`,{className:`section`,style:{marginTop:32},children:[(0,F.jsxs)(`div`,{className:`section-header`,children:[(0,F.jsx)(`h3`,{className:`section-title`,children:`Doctor`}),(0,F.jsx)(`span`,{className:`section-description`,children:`Snapshot of runtime + intent / credential status.`})]}),l.loading&&(0,F.jsx)(ot,{height:80}),l.error&&(0,F.jsx)(R,{tone:`err`,children:l.error.message}),l.data&&(0,F.jsxs)(`div`,{className:`kv`,children:[(0,F.jsx)(`span`,{className:`k`,children:`Node version`}),(0,F.jsx)(`span`,{className:`v`,children:`requires >= 20`}),(0,F.jsx)(`span`,{className:`k`,children:`Package version`}),(0,F.jsx)(`span`,{className:`v`,children:l.data.packageVersion}),(0,F.jsx)(`span`,{className:`k`,children:`PID`}),(0,F.jsx)(`span`,{className:`v`,children:l.data.pid}),(0,F.jsx)(`span`,{className:`k`,children:`Mode`}),(0,F.jsx)(`span`,{className:`v`,children:l.data.mode}),(0,F.jsx)(`span`,{className:`k`,children:`Data root`}),(0,F.jsx)(`span`,{className:`v`,style:{fontFamily:`var(--font-mono)`,fontSize:`var(--fs-xs)`},children:l.data.dataRoot}),(0,F.jsx)(`span`,{className:`k`,children:`Discord`}),(0,F.jsxs)(`span`,{className:`v`,children:[l.data.discord.connected?(0,F.jsx)(I,{tone:`ok`,dot:!0,children:`connected`}):l.data.discord.connecting?(0,F.jsx)(I,{tone:`info`,dot:!0,children:`connecting`}):(0,F.jsx)(I,{tone:`warn`,dot:!0,children:`offline`}),` `,l.data.discord.waifuBotCount,` waifu bots`]}),(0,F.jsx)(`span`,{className:`k`,children:`Required intents`}),(0,F.jsx)(`span`,{className:`v`,children:`GUILDS, GUILD_MESSAGES, GUILD_MESSAGE_REACTIONS, MESSAGE_CONTENT`}),(0,F.jsx)(`span`,{className:`k`,children:`Optional intents`}),(0,F.jsx)(`span`,{className:`v`,children:`GUILD_MEMBERS (for full member refresh)`}),l.data.discord.warnings.length>0&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`span`,{className:`k`,children:`Warnings`}),(0,F.jsx)(`span`,{className:`v`,style:{color:`var(--warn)`},children:l.data.discord.warnings.join(`; `)})]})]})]})]})}function Ro(e){return e===`error`?`err`:e===`warn`?`warn`:`info`}function zo(e){let t=e;return t?[t.paused?`paused`:`running`,t.discord?.connected?`discord-online`:`discord-offline`,`${t.queues?.active??0} queues`].join(` · `):`runtime snapshot`}var Bo={orchestrator:`orchestrator`,waifu:`waifu`,stage_manager_observer:`stage mgr · observer`,stage_manager_librarian:`stage mgr · librarian`,reviewer:`reviewer`},Vo={orchestrator:`info`,waifu:`ok`,stage_manager_observer:`info`,stage_manager_librarian:`warn`,reviewer:`warn`};function Ho(){let[e,t]=(0,C.useState)([]),[n,r]=(0,C.useState)(!1),[i,a]=(0,C.useState)(``),[o,s]=(0,C.useState)(new Set),c=(0,C.useRef)(n);c.current=n,(0,C.useEffect)(()=>{let e;try{e=tt()}catch{return}let n=e=>{c.current||t(t=>[e,...t].slice(0,200))};return e.addEventListener(`query`,e=>{try{n(JSON.parse(e.data))}catch{}}),()=>e?.close()},[]);let l=(0,C.useMemo)(()=>i?e.filter(e=>e.role===i):e,[e,i]),u=e=>{s(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},d=async e=>{try{await navigator.clipboard.writeText(ft(e.payload)),alert(`Query payload copied.`)}catch(e){alert(`Copy failed: `+e.message)}};return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`div`,{className:`view-header`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`h2`,{className:`view-title`,children:`Provider queries`}),(0,F.jsx)(`p`,{className:`view-subtitle`,children:`Conversational payloads sent to LLM providers — system prompt and messages only. Model, sampling params, and other settings are omitted by design.`})]}),(0,F.jsxs)(`div`,{className:`view-actions`,children:[(0,F.jsx)(`button`,{className:`btn`,onClick:()=>r(e=>!e),children:n?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(Ae,{className:`icon`}),` Resume stream`]}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(Oe,{className:`icon`}),` Pause stream`]})}),(0,F.jsxs)(`button`,{className:`btn`,onClick:()=>t([]),children:[(0,F.jsx)(Ve,{className:`icon`}),` Clear`]})]})]}),(0,F.jsxs)(`div`,{className:`toolbar`,children:[(0,F.jsxs)(`select`,{className:`select`,value:i,onChange:e=>a(e.target.value),style:{maxWidth:180},children:[(0,F.jsx)(`option`,{value:``,children:`All roles`}),(0,F.jsx)(`option`,{value:`orchestrator`,children:`Orchestrator`}),(0,F.jsx)(`option`,{value:`waifu`,children:`Waifu`}),(0,F.jsx)(`option`,{value:`stage_manager_observer`,children:`Stage mgr · observer`}),(0,F.jsx)(`option`,{value:`stage_manager_librarian`,children:`Stage mgr · librarian`}),(0,F.jsx)(`option`,{value:`reviewer`,children:`Reviewer`})]}),(0,F.jsx)(I,{tone:n?`warn`:`ok`,dot:!0,children:n?`paused`:`live`})]}),l.length===0?(0,F.jsx)(z,{title:`No provider queries yet`,icon:(0,F.jsx)(_e,{className:`icon-lg`}),children:`Each call to an LLM provider will appear here. Trigger orchestration in a connected Discord channel to see a query.`}):(0,F.jsx)(`div`,{className:`log-list`,children:l.map(e=>{let t=o.has(e.id);return(0,F.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`},children:[(0,F.jsxs)(`button`,{className:`log-line`,onClick:()=>u(e.id),style:{background:`transparent`,border:`none`,textAlign:`left`,cursor:`pointer`,width:`100%`},children:[(0,F.jsx)(`span`,{className:`ts`,children:lt(e.time)}),(0,F.jsx)(`span`,{className:`lvl info`,style:{minWidth:92,textAlign:`center`},children:Bo[e.role]}),(0,F.jsx)(`span`,{className:`src`,children:(0,F.jsx)(I,{tone:Vo[e.role],dot:!0,children:Bo[e.role]})}),(0,F.jsx)(`span`,{className:`msg`,children:Wo(e.payload)}),(0,F.jsx)(`span`,{style:{marginLeft:`auto`},children:t?(0,F.jsx)(se,{className:`icon`}):(0,F.jsx)(O,{className:`icon`})})]}),t&&(0,F.jsxs)(`div`,{style:{margin:`4px 8px 12px 8px`,padding:12,background:`var(--surface-2, rgba(255,255,255,0.02))`,border:`1px solid var(--border, rgba(255,255,255,0.06))`,borderRadius:8},children:[(0,F.jsx)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,marginBottom:8},children:(0,F.jsxs)(`button`,{className:`btn sm`,onClick:()=>d(e),children:[(0,F.jsx)(j,{className:`icon`}),` Copy JSON`]})}),(0,F.jsx)(`pre`,{style:{margin:0,fontFamily:`var(--font-mono)`,fontSize:`var(--fs-xs)`,whiteSpace:`pre-wrap`,wordBreak:`break-word`},children:Uo(e.payload)})]})]},e.id)})})]})}function Uo(e){let t=JSON.stringify(e,null,2);return t.replace(/"((?:\\.|[^"\\])*)"/g,(e,n,r)=>{let i=t.lastIndexOf(`
37
+ `,r-1)+1,a=` `.repeat(r-i+1);return`"${n.replace(/(?<!\\)((?:\\\\)*)\\n/g,`$1\n${a}`).replace(/(?<!\\)((?:\\\\)*)\\t/g,`$1 `)}"`})}function Wo(e){let t=[];return Array.isArray(e.messages)&&t.push(`${e.messages.length} messages`),Array.isArray(e.input)&&t.push(`${e.input.length} input items`),Array.isArray(e.contents)&&t.push(`${e.contents.length} turns`),Array.isArray(e.tools)&&t.push(`${e.tools.length} tools`),typeof e.system==`string`&&t.push(`system ${e.system.length}ch`),typeof e.instructions==`string`&&t.push(`instructions ${e.instructions.length}ch`),t.length?t.join(` · `):`empty payload`}var Go={orchestrator:`orchestrator`,waifu:`waifu`,stage_manager_observer:`stage mgr · observer`,stage_manager_librarian:`stage mgr · librarian`,reviewer:`reviewer`},Ko={orchestrator:`info`,waifu:`ok`,stage_manager_observer:`info`,stage_manager_librarian:`warn`,reviewer:`warn`};function qo(){let[e,t]=(0,C.useState)([]),[n,r]=(0,C.useState)(!1),[i,a]=(0,C.useState)(``),[o,s]=(0,C.useState)(new Set),c=(0,C.useRef)(n);c.current=n,(0,C.useEffect)(()=>{let e;try{e=tt()}catch{return}let n=e=>{c.current||t(t=>[e,...t].slice(0,200))};return e.addEventListener(`reply`,e=>{try{n(JSON.parse(e.data))}catch{}}),()=>e?.close()},[]);let l=(0,C.useMemo)(()=>i?e.filter(e=>e.role===i):e,[e,i]),u=e=>{s(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},d=async e=>{try{await navigator.clipboard.writeText(ft(e.payload)),alert(`Reply payload copied.`)}catch(e){alert(`Copy failed: `+e.message)}};return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`div`,{className:`view-header`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`h2`,{className:`view-title`,children:`Provider replies`}),(0,F.jsx)(`p`,{className:`view-subtitle`,children:`Full provider response bodies returned by LLM calls, including HTTP error bodies.`})]}),(0,F.jsxs)(`div`,{className:`view-actions`,children:[(0,F.jsx)(`button`,{className:`btn`,onClick:()=>r(e=>!e),children:n?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(Ae,{className:`icon`}),` Resume stream`]}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(Oe,{className:`icon`}),` Pause stream`]})}),(0,F.jsxs)(`button`,{className:`btn`,onClick:()=>t([]),children:[(0,F.jsx)(Ve,{className:`icon`}),` Clear`]})]})]}),(0,F.jsxs)(`div`,{className:`toolbar`,children:[(0,F.jsxs)(`select`,{className:`select`,value:i,onChange:e=>a(e.target.value),style:{maxWidth:180},children:[(0,F.jsx)(`option`,{value:``,children:`All roles`}),(0,F.jsx)(`option`,{value:`orchestrator`,children:`Orchestrator`}),(0,F.jsx)(`option`,{value:`waifu`,children:`Waifu`}),(0,F.jsx)(`option`,{value:`stage_manager_observer`,children:`Stage mgr · observer`}),(0,F.jsx)(`option`,{value:`stage_manager_librarian`,children:`Stage mgr · librarian`}),(0,F.jsx)(`option`,{value:`reviewer`,children:`Reviewer`})]}),(0,F.jsx)(I,{tone:n?`warn`:`ok`,dot:!0,children:n?`paused`:`live`})]}),l.length===0?(0,F.jsx)(z,{title:`No provider replies yet`,icon:(0,F.jsx)(Ee,{className:`icon-lg`}),children:`Each response returned by an LLM provider will appear here. Trigger orchestration in a connected Discord channel to see a reply.`}):(0,F.jsx)(`div`,{className:`log-list`,children:l.map(e=>{let t=o.has(e.id);return(0,F.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`},children:[(0,F.jsxs)(`button`,{className:`log-line`,onClick:()=>u(e.id),style:{background:`transparent`,border:`none`,textAlign:`left`,cursor:`pointer`,width:`100%`},children:[(0,F.jsx)(`span`,{className:`ts`,children:lt(e.time)}),(0,F.jsxs)(`span`,{className:`lvl `+(e.ok?`ok`:`warn`),style:{minWidth:92,textAlign:`center`},children:[`HTTP `,e.status]}),(0,F.jsx)(`span`,{className:`src`,children:(0,F.jsx)(I,{tone:Ko[e.role],dot:!0,children:Go[e.role]})}),(0,F.jsxs)(`span`,{className:`msg`,children:[`query #`,e.queryId,` · `,Yo(e.payload)]}),(0,F.jsx)(`span`,{style:{marginLeft:`auto`},children:t?(0,F.jsx)(se,{className:`icon`}):(0,F.jsx)(O,{className:`icon`})})]}),t&&(0,F.jsxs)(`div`,{style:{margin:`4px 8px 12px 8px`,padding:12,background:`var(--surface-2, rgba(255,255,255,0.02))`,border:`1px solid var(--border, rgba(255,255,255,0.06))`,borderRadius:8},children:[(0,F.jsx)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,marginBottom:8},children:(0,F.jsxs)(`button`,{className:`btn sm`,onClick:()=>d(e),children:[(0,F.jsx)(j,{className:`icon`}),` Copy JSON`]})}),(0,F.jsx)(`pre`,{style:{margin:0,fontFamily:`var(--font-mono)`,fontSize:`var(--fs-xs)`,whiteSpace:`pre-wrap`,wordBreak:`break-word`},children:Jo(e.payload)})]})]},e.id)})})]})}function Jo(e){let t=ft(e);return t.replace(/"((?:\\.|[^"\\])*)"/g,(e,n,r)=>{let i=t.lastIndexOf(`
38
+ `,r-1)+1,a=` `.repeat(r-i+1);return`"${n.replace(/(?<!\\)((?:\\\\)*)\\n/g,`$1\n${a}`).replace(/(?<!\\)((?:\\\\)*)\\t/g,`$1 `)}"`})}function Yo(e){if(typeof e==`string`)return`${e.length}ch text`;if(!e||typeof e!=`object`||Array.isArray(e))return`empty body`;let t=e,n=[];return Array.isArray(t.choices)&&n.push(`${t.choices.length} choices`),Array.isArray(t.output)&&n.push(`${t.output.length} output items`),typeof t.output_text==`string`&&n.push(`output ${t.output_text.length}ch`),Array.isArray(t.content)&&n.push(`${t.content.length} content parts`),Array.isArray(t.candidates)&&n.push(`${t.candidates.length} candidates`),typeof t.error==`string`&&n.push(`error ${t.error}`),typeof t.message==`string`&&n.push(t.message),typeof t.raw==`string`&&n.push(`raw ${t.raw.length}ch`),n.length?n.join(` · `):`${Object.keys(t).length} fields`}function Xo(){let e=L(e=>P.getConfig(e),[]),[t,n]=(0,C.useState)(void 0),[r,i]=(0,C.useState)(!1),[a,o]=(0,C.useState)(!1),[s,c]=(0,C.useState)(void 0),[l,u]=(0,C.useState)(void 0),[d,f]=(0,C.useState)(void 0);return(0,C.useEffect)(()=>{e.data&&!t&&n(e.data)},[e.data,t]),(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`div`,{className:`view-header`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`h2`,{className:`view-title`,children:`Settings`}),(0,F.jsxs)(`p`,{className:`view-subtitle`,children:[`App-wide configuration backed by `,(0,F.jsx)(`code`,{children:`config.toml`}),` under the data root.`]})]}),(0,F.jsx)(`div`,{className:`view-actions`,children:(0,F.jsxs)(`button`,{className:`btn primary`,onClick:async()=>{if(t){i(!0),c(void 0);try{let r=await P.putConfig(t);n(r),e.setData(r),u(new Date().toISOString())}catch(e){c(e.message)}finally{i(!1)}}},disabled:!t||r,children:[(0,F.jsx)(Ne,{className:`icon`}),r?`Saving…`:`Save all`]})})]}),e.loading&&(0,F.jsx)(ot,{height:120}),e.error&&(0,F.jsx)(R,{tone:`err`,children:e.error.message}),s&&(0,F.jsx)(R,{tone:`err`,children:s}),l&&!s&&(0,F.jsxs)(R,{tone:`ok`,children:[`Saved at `,new Date(l).toLocaleTimeString(),`.`]}),d&&!s&&(0,F.jsxs)(R,{tone:`ok`,children:[`OCR cache cleared at `,new Date(d).toLocaleTimeString(),`.`]}),t&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`section`,{className:`section`,children:[(0,F.jsxs)(`div`,{className:`section-header`,children:[(0,F.jsx)(`h3`,{className:`section-title`,children:`HTTP`}),(0,F.jsx)(`span`,{className:`section-description`,children:`Host and port apply on the next process start. Discord/runtime changes apply immediately.`})]}),(0,F.jsxs)(`div`,{className:`grid grid-2`,children:[(0,F.jsxs)(`div`,{className:`field`,children:[(0,F.jsx)(`label`,{className:`field-label`,children:`Host`}),(0,F.jsx)(`input`,{className:`input`,value:t.http.host,onChange:e=>n({...t,http:{...t.http,host:e.target.value}})})]}),(0,F.jsxs)(`div`,{className:`field`,children:[(0,F.jsx)(`label`,{className:`field-label`,children:`Port`}),(0,F.jsx)(`input`,{className:`input`,type:`number`,min:1,max:65535,value:t.http.port,onChange:e=>n({...t,http:{...t.http,port:Number(e.target.value)||t.http.port}})})]})]})]}),(0,F.jsxs)(`section`,{className:`section`,children:[(0,F.jsx)(`div`,{className:`section-header`,children:(0,F.jsx)(`h3`,{className:`section-title`,children:`Runtime`})}),(0,F.jsxs)(`div`,{className:`grid grid-2`,children:[(0,F.jsxs)(`div`,{className:`field`,children:[(0,F.jsx)(`label`,{className:`field-label`,children:`Auto-connect Discord on start`}),(0,F.jsx)(Ft,{checked:t.runtime.autoConnectDiscord,onChange:e=>n({...t,runtime:{...t.runtime,autoConnectDiscord:e}}),label:t.runtime.autoConnectDiscord?`Enabled`:`Disabled`})]}),(0,F.jsxs)(`div`,{className:`field`,children:[(0,F.jsx)(`label`,{className:`field-label`,children:`Start paused`}),(0,F.jsx)(Ft,{checked:t.runtime.paused,onChange:e=>n({...t,runtime:{...t.runtime,paused:e}}),label:t.runtime.paused?`Paused`:`Active`})]})]})]}),(0,F.jsxs)(`section`,{className:`section`,children:[(0,F.jsxs)(`div`,{className:`section-header`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`h3`,{className:`section-title`,children:`OCR`}),(0,F.jsx)(`span`,{className:`section-description`,children:`Fallback text extraction for image attachments when the selected model is not vision-capable.`})]}),(0,F.jsxs)(`button`,{className:`btn`,onClick:async()=>{o(!0),c(void 0);try{await P.clearOcrCache(),f(new Date().toISOString())}catch(e){c(e.message)}finally{o(!1)}},disabled:a,children:[(0,F.jsx)(Ve,{className:`icon`}),a?`Clearing...`:`Clear OCR cache`]})]}),(0,F.jsxs)(`div`,{className:`grid grid-2`,children:[(0,F.jsxs)(`div`,{className:`field`,children:[(0,F.jsx)(`label`,{className:`field-label`,children:`OCR fallback`}),(0,F.jsx)(Ft,{checked:t.ocr.enabled,onChange:e=>n({...t,ocr:{...t.ocr,enabled:e}}),label:t.ocr.enabled?`Enabled`:`Disabled`})]}),(0,F.jsxs)(`div`,{className:`field`,children:[(0,F.jsx)(`label`,{className:`field-label`,children:`Engine`}),(0,F.jsxs)(`select`,{className:`input`,value:t.ocr.engine,onChange:e=>n({...t,ocr:{...t.ocr,engine:e.target.value}}),children:[(0,F.jsx)(`option`,{value:`auto`,children:`Auto`}),(0,F.jsx)(`option`,{value:`apple-vision`,children:`Apple Vision`}),(0,F.jsx)(`option`,{value:`bundled-tesseract`,children:`Bundled Tesseract`}),(0,F.jsx)(`option`,{value:`system-tesseract`,children:`System Tesseract`})]})]}),(0,F.jsxs)(`div`,{className:`field`,children:[(0,F.jsx)(`label`,{className:`field-label`,children:`Cache TTL hours`}),(0,F.jsx)(`input`,{className:`input`,type:`number`,min:1,max:720,value:t.ocr.cacheTtlHours,onChange:e=>n({...t,ocr:{...t.ocr,cacheTtlHours:Zo(e.target.value,t.ocr.cacheTtlHours)}})})]}),(0,F.jsxs)(`div`,{className:`field`,children:[(0,F.jsx)(`label`,{className:`field-label`,children:`Timeout ms`}),(0,F.jsx)(`input`,{className:`input`,type:`number`,min:250,max:3e4,value:t.ocr.timeoutMs,onChange:e=>n({...t,ocr:{...t.ocr,timeoutMs:Zo(e.target.value,t.ocr.timeoutMs)}})})]}),(0,F.jsxs)(`div`,{className:`field`,children:[(0,F.jsx)(`label`,{className:`field-label`,children:`Max image bytes`}),(0,F.jsx)(`input`,{className:`input`,type:`number`,min:1024,max:33554432,value:t.ocr.maxImageBytes,onChange:e=>n({...t,ocr:{...t.ocr,maxImageBytes:Zo(e.target.value,t.ocr.maxImageBytes)}})})]}),(0,F.jsxs)(`div`,{className:`field`,children:[(0,F.jsx)(`label`,{className:`field-label`,children:`Max images per model call`}),(0,F.jsx)(`input`,{className:`input`,type:`number`,min:0,max:20,value:t.ocr.maxImagesPerModelCall,onChange:e=>n({...t,ocr:{...t.ocr,maxImagesPerModelCall:Zo(e.target.value,t.ocr.maxImagesPerModelCall)}})})]}),(0,F.jsxs)(`div`,{className:`field`,children:[(0,F.jsx)(`label`,{className:`field-label`,children:`Max text chars per image`}),(0,F.jsx)(`input`,{className:`input`,type:`number`,min:100,max:1e4,value:t.ocr.maxTextCharsPerImage,onChange:e=>n({...t,ocr:{...t.ocr,maxTextCharsPerImage:Zo(e.target.value,t.ocr.maxTextCharsPerImage)}})})]})]})]}),(0,F.jsxs)(`section`,{className:`section`,children:[(0,F.jsx)(`div`,{className:`section-header`,children:(0,F.jsx)(`h3`,{className:`section-title`,children:`Frontend`})}),(0,F.jsxs)(`div`,{className:`field`,children:[(0,F.jsx)(`label`,{className:`field-label`,children:`Static dir override`}),(0,F.jsx)(`input`,{className:`input code`,value:t.frontend.staticDir??``,onChange:e=>n({...t,frontend:{...t.frontend,staticDir:e.target.value||void 0}}),placeholder:`Defaults to bundled frontend build`})]})]}),(0,F.jsxs)(`section`,{className:`section`,children:[(0,F.jsxs)(`div`,{className:`section-header`,children:[(0,F.jsx)(`h3`,{className:`section-title`,children:`Raw config`}),(0,F.jsxs)(`span`,{className:`section-description`,children:[`Schema version `,t.schemaVersion,`.`]})]}),(0,F.jsx)(`pre`,{className:`code-block`,children:JSON.stringify(t,null,2)})]})]})]})}function Zo(e,t){if(e.trim()===``)return t;let n=Number(e);return Number.isFinite(n)?n:t}function Qo(){let[e,t]=Ze(),[n,r]=(0,C.useState)(!1),i=rt(),a=i?.discord.connecting??!1,o=e=>{t(e),r(!1)};return(0,F.jsxs)(`div`,{className:`app-shell`,children:[(0,F.jsxs)(`aside`,{className:`sidebar`+(n?` open`:``),children:[(0,F.jsxs)(`div`,{className:`brand`,children:[(0,F.jsx)(`span`,{className:`brand-mark`,children:`W`}),(0,F.jsx)(`span`,{children:`Discord Waifus`}),(0,F.jsx)(`span`,{style:{flex:1}}),(0,F.jsx)(`button`,{className:`btn ghost sm`,style:{display:n?`inline-flex`:`none`},onClick:()=>r(!1),"aria-label":`Close menu`,children:(0,F.jsx)(We,{className:`icon`})})]}),(0,F.jsx)(`nav`,{className:`nav`,children:qe.map(t=>(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`div`,{className:`nav-section-label`,children:t.label}),Ke.filter(e=>e.group===t.id).map(t=>{let n=t.icon;return(0,F.jsxs)(`button`,{className:`nav-item`+(e===t.id?` active`:``),onClick:()=>o(t.id),children:[(0,F.jsx)(n,{className:`icon`}),(0,F.jsx)(`span`,{children:t.label})]},t.id)})]},t.id))}),(0,F.jsxs)(`div`,{className:`sidebar-footer`,children:[(0,F.jsx)(`div`,{children:i?(0,F.jsx)(I,{tone:i.paused?`warn`:`ok`,dot:!0,children:i.paused?`Paused`:`Running`}):(0,F.jsx)(I,{tone:`neutral`,dot:!0,children:`Offline`})}),(0,F.jsx)(`div`,{children:i?.discord.connected?`Discord connected`:a?`Discord connecting`:`Discord offline`}),(0,F.jsx)(`div`,{children:i?`${i.queues.active} active queues`:``})]})]}),(0,F.jsx)(`div`,{className:`menu-backdrop`+(n?` open`:``),onClick:()=>r(!1)}),(0,F.jsxs)(`header`,{className:`topbar`,children:[(0,F.jsx)(`button`,{className:`btn ghost sm menu-btn`,onClick:()=>r(!0),"aria-label":`Open menu`,children:(0,F.jsx)(Te,{className:`icon`})}),(0,F.jsx)(`h1`,{children:Ke.find(t=>t.id===e)?.label??`Dashboard`}),(0,F.jsx)(`div`,{className:`topbar-spacer`}),(0,F.jsxs)(`div`,{className:`topbar-status`,children:[i?.discord.connected?(0,F.jsx)(I,{tone:`ok`,dot:!0,children:`Discord`}):a?(0,F.jsx)(I,{tone:`info`,dot:!0,children:`Discord connecting`}):(0,F.jsx)(I,{tone:`warn`,dot:!0,children:`Discord offline`}),i&&(0,F.jsxs)(I,{tone:`info`,dot:!0,children:[i.queues.active,` queues`]}),i?(0,F.jsx)(I,{tone:i.paused?`warn`:`ok`,dot:!0,children:i.paused?`Paused`:`Running`}):(0,F.jsx)(I,{tone:`neutral`,dot:!0,children:`Connecting…`})]})]}),(0,F.jsx)(`main`,{className:`main`,children:(0,F.jsx)($o,{route:e,navigate:o})})]})}function $o({route:e,navigate:t}){switch(e){case`dashboard`:return(0,F.jsx)(ht,{});case`setup`:return(0,F.jsx)(Ot,{onNavigate:e=>t(e)});case`providers`:return(0,F.jsx)(At,{});case`waifus`:return(0,F.jsx)(Za,{});case`servers`:return(0,F.jsx)(G,{});case`orchestrator`:return(0,F.jsx)(go,{});case`reviewer`:return(0,F.jsx)(So,{});case`stage-manager`:return(0,F.jsx)(Co,{});case`memories`:return(0,F.jsx)(ko,{});case`logs`:return(0,F.jsx)(Lo,{});case`queries`:return(0,F.jsx)(Ho,{});case`replies`:return(0,F.jsx)(qo,{});case`settings`:return(0,F.jsx)(Xo,{});default:return(0,F.jsx)(ht,{})}}var es=document.getElementById(`root`);if(!es)throw Error(`Root container not found`);(0,Ge.createRoot)(es).render((0,F.jsx)(C.StrictMode,{children:(0,F.jsx)(Qo,{})}));
39
+ //# sourceMappingURL=index-B2bB3_2r.js.map